修改等额本金和均息法的尾款处理
This commit is contained in:
parent
30180b15e3
commit
527b187d9d
@ -51,13 +51,13 @@ public class EvenInterestExecutor extends FundRentPlanExecutor {
|
||||
String leaseMoney = cb.getCleanLeaseMoney();
|
||||
List<String> interest = new InterestCalServiceImpl().getInterestList(leaseMoney, cb.getLeaseTerm(), cb.getIncomeNumber() + cb.getGrace(), cb.getEquipEndValue(), cb.getYearRate());
|
||||
List<String> 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<String> rentList = new RentalServiceImpl().getRentListByCond(cb.getCleanLeaseMoney(), cb.getEquipEndValue(), corpus, interest,cb);
|
||||
List<String> dateList =pdsi.getPlanDateList(cb, String.valueOf(frpb.getRentList().size()));
|
||||
List<String> interestDateList=pdsi.getInterestDateList(cb);
|
||||
|
||||
@ -99,6 +99,38 @@ public class CorpusServiceImpl {
|
||||
return corpus_l;
|
||||
}
|
||||
|
||||
/**
|
||||
* scl ( 获得均息法下的利息列表 均息法 不区分期初期末的利息)
|
||||
*
|
||||
* @param leaseMoney
|
||||
* 总本金
|
||||
* @param Income_number
|
||||
* 还款次数
|
||||
* @param endValue
|
||||
* 剩余本金
|
||||
* @return
|
||||
*/
|
||||
public List<String> 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<String> corpus_l = new ArrayList<String>();
|
||||
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;
|
||||
}
|
||||
|
||||
/**
|
||||
* 按月付息一次还本
|
||||
*
|
||||
|
||||
@ -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;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user