package com.tenwa.reckon.executor; import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; import com.amarsoft.are.jbo.JBOTransaction; import com.tenwa.reckon.bean.ConditionBean; import com.tenwa.reckon.bean.FundRentPlanBean; import com.tenwa.reckon.bean.TabCalBean; import com.tenwa.reckon.help.CorpusServiceImpl; import com.tenwa.reckon.help.RentPlanContrCalDAOImpl; import com.tenwa.reckon.help.RentPlanServiceImpl; import com.tenwa.reckon.help.RentalServiceImpl; import com.tenwa.reckon.util.NumTools; public class EvenInterestChangeExecutor extends FundRentPlanExecutor { public EvenInterestChangeExecutor(JBOTransaction tx) { super(tx); // TODO Auto-generated constructor stub } @Override public FundRentPlanBean create(TabCalBean tcb,Integer startList) throws Exception { FundRentPlanBean fpb = new FundRentPlanBean(); //均息法变更 先用财务剩余本金 和年利率 根据pmt得到财务本金和利息 业务本金=剩余业务本金/期数 利息=租金-本金 EvenRentExecutor executor = new EvenRentExecutor(tx); FundRentPlanBean frpb = new RentPlanContrCalDAOImpl().getRentAndDateByTcb(tcb, 1,tx); String clean_lease_money=NumTools.getSumCorpusOverage(frpb.getColumn_1(),startList); if(new BigDecimal(tcb.getCb().getRepurchaseMoney()).compareTo(BigDecimal.ZERO)!=0){//回购 clean_lease_money=NumTools.getSumCorpusOverage(frpb.getColumn_1(),startList-1); } //删除租金计划 executor.deleteRentPlan(tcb.getRentPlan_tb(), tcb, startList); executor.getPmtRentPlan(tcb.getCb(), fpb,tcb); tcb.getCb().setCleanLeaseMoney(new BigDecimal(clean_lease_money).subtract(new BigDecimal(tcb.getCb().getRepurchaseMoney())).toString()); this.rentPlanEvenInterestCal(tcb.getCb(), fpb); this.addRentPlan(fpb, tcb,startList); return fpb; } public void rentPlanEvenInterestCal(ConditionBean cb, FundRentPlanBean frpb) throws Exception { //先找到总本金值 BigDecimal corpusTotal=new BigDecimal(cb.getCleanLeaseMoney()); List interest =new ArrayList(); List corpus = new CorpusServiceImpl().getCorpusList(cb.getCleanLeaseMoney(), cb.getIncomeNumber(), cb.getEquipEndValue(), cb.getGrace()); List rentList =frpb.getRentList(); BigDecimal c=BigDecimal.ZERO; for(int i=0;i rentListTemp = rentList; List rentRemainList = new RentalServiceImpl().getRentRemainList(rentListTemp); frpb.setAllRemainRentList(rentRemainList); } }