From 546b8389f8655b20e622bee589b53fe4dc600e2b Mon Sep 17 00:00:00 2001 From: zhangbeibei Date: Thu, 22 Apr 2021 15:13:13 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=91=E7=9C=A0=E6=9C=9F=E6=B5=8B=E7=AE=97?= =?UTF-8?q?=E8=A1=A5=E4=B8=8A=E7=AD=89=E9=A2=9D=E6=9C=AC=E9=87=91=E7=9A=84?= =?UTF-8?q?=E6=B5=8B=E7=AE=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../executor/CreateTransactionExecutor.java | 48 ++++++++++++++----- 1 file changed, 35 insertions(+), 13 deletions(-) diff --git a/calc/com/tenwa/reckon/executor/CreateTransactionExecutor.java b/calc/com/tenwa/reckon/executor/CreateTransactionExecutor.java index 3996ce5cf..979ba948a 100644 --- a/calc/com/tenwa/reckon/executor/CreateTransactionExecutor.java +++ b/calc/com/tenwa/reckon/executor/CreateTransactionExecutor.java @@ -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 rentList = new ArrayList<>(); - for(int i=0;i 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 corpusList = csi.getCorpusList(rentList, interests); + List rentList = new ArrayList<>(); + List corpusList = new ArrayList<>(); + List 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