diff --git a/calc/com/tenwa/reckon/executor/EvenInterestExecutor.java b/calc/com/tenwa/reckon/executor/EvenInterestExecutor.java index 8882eab6f..38ad1b6d7 100644 --- a/calc/com/tenwa/reckon/executor/EvenInterestExecutor.java +++ b/calc/com/tenwa/reckon/executor/EvenInterestExecutor.java @@ -51,13 +51,13 @@ public class EvenInterestExecutor extends FundRentPlanExecutor { String leaseMoney = cb.getCleanLeaseMoney(); List interest = new InterestCalServiceImpl().getInterestList(leaseMoney, cb.getLeaseTerm(), cb.getIncomeNumber() + cb.getGrace(), cb.getEquipEndValue(), cb.getYearRate()); List corpus = null; - if("one_1".equals(cb.getCorpusType())){//按月付息一次还本 + /*if("one_1".equals(cb.getCorpusType())){//按月付息一次还本 corpus = new CorpusServiceImpl().getCorpusListForOne(cb.getCleanLeaseMoney(), cb.getIncomeNumber(), cb.getEquipEndValue(), cb.getGrace()); }else if("three_1".equals(cb.getCorpusType())){//按月付息按季还本 corpus = new CorpusServiceImpl().getCorpusListForThree(cb.getCleanLeaseMoney(), cb.getIncomeNumber(), cb.getEquipEndValue(), cb.getGrace()); - }else{ - corpus = new CorpusServiceImpl().getCorpusList(cb.getCleanLeaseMoney(), cb.getIncomeNumber(), cb.getEquipEndValue(), cb.getGrace()); - } + }else{*/ + corpus = new CorpusServiceImpl().getCorpusListFinalPayment(cb, cb.getCleanLeaseMoney(), cb.getIncomeNumber(), cb.getEquipEndValue(), cb.getGrace()); + //} List rentList = new RentalServiceImpl().getRentListByCond(cb.getCleanLeaseMoney(), cb.getEquipEndValue(), corpus, interest,cb); List dateList =pdsi.getPlanDateList(cb, String.valueOf(frpb.getRentList().size())); List interestDateList=pdsi.getInterestDateList(cb); diff --git a/calc/com/tenwa/reckon/help/CorpusServiceImpl.java b/calc/com/tenwa/reckon/help/CorpusServiceImpl.java index 6ba3b982b..bf386588e 100644 --- a/calc/com/tenwa/reckon/help/CorpusServiceImpl.java +++ b/calc/com/tenwa/reckon/help/CorpusServiceImpl.java @@ -99,6 +99,38 @@ public class CorpusServiceImpl { return corpus_l; } + /** + * scl ( 获得均息法下的利息列表 均息法 不区分期初期末的利息) + * + * @param leaseMoney + * 总本金 + * @param Income_number + * 还款次数 + * @param endValue + * 剩余本金 + * @return + */ + public List getCorpusListFinalPayment(ConditionBean cb, String leaseMoney, int Income_number, String endValue, int grace) { + String corpus = (new BigDecimal(leaseMoney).subtract(new BigDecimal(endValue))).divide(new BigDecimal(Income_number), 20, BigDecimal.ROUND_HALF_UP).setScale(RentTools.getCorpusAccuracy(), BigDecimal.ROUND_HALF_UP).toString();// 均息法下的本金值 + BigDecimal finalPayment = new BigDecimal(cb.getFinalPayment()); + if(finalPayment.compareTo(BigDecimal.ONE) != 0 && "final_payment_method02".equals(cb.getFinalPaymentMethod())) { + corpus = (new BigDecimal(leaseMoney).subtract(new BigDecimal(endValue))).subtract(finalPayment).divide(new BigDecimal(Income_number), 20, BigDecimal.ROUND_HALF_UP).setScale(RentTools.getCorpusAccuracy(), BigDecimal.ROUND_HALF_UP).toString(); + } + List corpus_l = new ArrayList(); + for (int i = 0; i < Income_number + grace; i++) { + if (i < grace) { + corpus_l.add("0.0");// 宽限期本金为0 + } else { + if(i == cb.getIncomeNumber() - 1 && finalPayment.compareTo(BigDecimal.ONE) != 0 && "final_payment_method02".equals(cb.getFinalPaymentMethod())) { + corpus_l.add(finalPayment.add(new BigDecimal(corpus)).toString()); + } else { + corpus_l.add(corpus); + } + } + } + return corpus_l; + } + /** * 按月付息一次还本 * diff --git a/calc/com/tenwa/reckon/util/RentCalculateUtil.java b/calc/com/tenwa/reckon/util/RentCalculateUtil.java index 0a9c4f182..c122c60e0 100644 --- a/calc/com/tenwa/reckon/util/RentCalculateUtil.java +++ b/calc/com/tenwa/reckon/util/RentCalculateUtil.java @@ -245,6 +245,7 @@ public class RentCalculateUtil { BigDecimal issueRate = condition.getIssueRate();// 期利率 BigDecimal leaseAmtRemain = leaseAmt;// 剩余本金 + BigDecimal finalPayment = new BigDecimal(cb.getFinalPayment()); //求出日利率(按365天算) for (int i = 0; i < interestDateList.size(); i++) { BigDecimal corpus = null; @@ -258,7 +259,9 @@ public class RentCalculateUtil { : new BigDecimal(corpusList.get(i));// 本金 }else{ corpus = ( corpusList == null || corpusList.size() <= 0 ) - ? leaseAmt.subtract(condition.getEquipEndValue()).divide(new BigDecimal(incomeTimes), Scale.CORPUS_SCALE, BigDecimal.ROUND_HALF_EVEN) + ? finalPayment.compareTo(BigDecimal.ONE) != 0 && "final_payment_method02".equals(cb.getFinalPaymentMethod()) ? + leaseAmt.subtract(condition.getEquipEndValue()).subtract(finalPayment).divide(new BigDecimal(incomeTimes), Scale.CORPUS_SCALE, BigDecimal.ROUND_HALF_EVEN) + : leaseAmt.subtract(condition.getEquipEndValue()).divide(new BigDecimal(incomeTimes), Scale.CORPUS_SCALE, BigDecimal.ROUND_HALF_EVEN) : new BigDecimal(corpusList.get(i));// 本金 } BigDecimal interest = BigDecimal.ZERO;