休眠期测算补上等额本金的测算
This commit is contained in:
parent
05cb4d90f0
commit
546b8389f8
@ -14,6 +14,7 @@ import com.tenwa.lease.flow.comm.serviceImp.LeaseFlowBaseServiceImp;
|
||||
import com.tenwa.officetempalte.util.ExcelVersionEnum;
|
||||
import com.tenwa.quartz.StringUtil;
|
||||
import com.tenwa.reckon.bean.*;
|
||||
import com.tenwa.reckon.constant.Scale;
|
||||
import com.tenwa.reckon.executor.rentChange.RentChangeExe;
|
||||
import com.tenwa.reckon.executor.rentTerminate.RentTerminateExe;
|
||||
import com.tenwa.reckon.help.*;
|
||||
@ -826,26 +827,47 @@ public class CreateTransactionExecutor implements Transaction {
|
||||
String CORPUS = bolLRPT.get(startList-1).getAttribute("CORPUS").toString();
|
||||
BigDecimal allRemainCorpus = new BigDecimal(ALL_REMAIN_CORPUS).add(new BigDecimal(CORPUS));
|
||||
BigDecimal dormantInterest = allRemainCorpus.multiply(new BigDecimal(dormantYearRate)).divide(new BigDecimal("100")).divide(new BigDecimal("12"),2,BigDecimal.ROUND_HALF_UP);
|
||||
|
||||
//尾款
|
||||
BigDecimal finalPayment = new BigDecimal(cb.getFinalPayment()==null?"0":cb.getFinalPayment());
|
||||
//期利率
|
||||
String preRate = RateTools.getPreRate(cb.getYearRate(), cb.getIncomeNumberYear(),cb.getRateAdjustType());
|
||||
String rent = new BigDecimal(RentTools.getPMT(preRate, bolLRPT.size()-endList + "", "-"+allRemainCorpus.toString(), finalPayment.toString(), cb.getPeriodType())).toString();
|
||||
List<String> rentList = new ArrayList<>();
|
||||
for(int i=0;i<bolLRPT.size()-endList;i++){
|
||||
rentList.add(i,rent);
|
||||
}
|
||||
// 加载利息列表
|
||||
InterestCalServiceImpl icsi = new InterestCalServiceImpl();
|
||||
List<String> interests = icsi.getInterestList(rentList, allRemainCorpus.toString(), cb.getYearRate(), cb.getPeriodType(), cb.getGrace(), cb.getIncomeNumberYear(), cb.getEquipEndValue(),cb.getRateAdjustType());
|
||||
int afreshSize = bolLRPT.size()-endList;
|
||||
|
||||
// 加载本金列表103196.63*(1.0075)
|
||||
CorpusServiceImpl csi = new CorpusServiceImpl();
|
||||
List<String> corpusList = csi.getCorpusList(rentList, interests);
|
||||
List<String> rentList = new ArrayList<>();
|
||||
List<String> corpusList = new ArrayList<>();
|
||||
List<String> interestList = new ArrayList<>();
|
||||
// TODO 等额本金时的休眠(待测试)
|
||||
if("even_corpus".equals(cb.getSettleMethod())){
|
||||
BigDecimal corpus = allRemainCorpus.subtract(new BigDecimal(cb.getEquipEndValue())).subtract(finalPayment).divide(new BigDecimal(afreshSize), Scale.CORPUS_SCALE, BigDecimal.ROUND_HALF_EVEN);
|
||||
BigDecimal RemainCorpus = allRemainCorpus;
|
||||
BigDecimal issueRate = new BigDecimal(cb.getYearRate()).divide(new BigDecimal(cb.getIncomeNumberYear()), Scale.RATE_SCALE, BigDecimal.ROUND_HALF_EVEN);
|
||||
for(int i=0;i<afreshSize;i++){
|
||||
corpusList.add(i,corpus.toString());
|
||||
BigDecimal interest = RemainCorpus.multiply(issueRate).setScale(Scale.RATE_SCALE, BigDecimal.ROUND_HALF_UP);
|
||||
RemainCorpus = RemainCorpus.subtract(corpus);
|
||||
interestList.add(i,interest.toString());
|
||||
BigDecimal rentC = corpus.add(interest);
|
||||
rentList.add(i,rentC.toString());
|
||||
}
|
||||
}else{
|
||||
//添加租金列表
|
||||
String rent = new BigDecimal(RentTools.getPMT(preRate, afreshSize + "", "-"+allRemainCorpus.toString(), finalPayment.toString(), cb.getPeriodType())).toString();
|
||||
for(int i=0;i<afreshSize;i++){
|
||||
rentList.add(i,rent);
|
||||
}
|
||||
// 加载利息列表
|
||||
InterestCalServiceImpl icsi = new InterestCalServiceImpl();
|
||||
interestList = icsi.getInterestList(rentList, allRemainCorpus.toString(), cb.getYearRate(), cb.getPeriodType(), cb.getGrace(), cb.getIncomeNumberYear(), cb.getEquipEndValue(),cb.getRateAdjustType());
|
||||
|
||||
// 加载本金列表
|
||||
CorpusServiceImpl csi = new CorpusServiceImpl();
|
||||
corpusList = csi.getCorpusList(rentList, interestList);
|
||||
}
|
||||
|
||||
FundRentPlanBean frpb = new FundRentPlanBean();
|
||||
frpb.setRentList(rentList);
|
||||
frpb.setCorpusBusinessList(corpusList);
|
||||
frpb.setInterestBusinessList(interests);
|
||||
frpb.setInterestBusinessList(interestList);
|
||||
|
||||
// ¼ÓÔØµ÷ÕûÐÅÏ¢Áбí
|
||||
RentPlanServiceImpl rpsi = new RentPlanServiceImpl();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user