修改保证金只抵扣末期租金

This commit is contained in:
zhulianghua 2018-07-18 17:13:40 +08:00
parent e7c45e6c5a
commit 17819f315b
2 changed files with 23 additions and 3 deletions

View File

@ -32,7 +32,7 @@ public class FundFundPlanExecutor {
public void run(ConditionBean cb , TabCalBean tcb,FundRentPlanBean rentPlan,JBOTransaction tx) throws Exception{
cb.setDocId(tcb.getDocId());
List<FundPlanBean> fundPlanBeans=new ArrayList<FundPlanBean>();
if(Double.parseDouble(cb.getCautionMoney()) > 0 ){
if(Double.parseDouble(cb.getCautionDeductionMoney()) > 0 ){
fundPlanBeans = splitFundFundPlan(rentPlan, cb, "", "feetype17","feetype16");
}else{
cb.setDeductionLastPlanDate(cb.getLastPlanDate());//不生成保证金抵扣及退还计划
@ -209,6 +209,13 @@ public class FundFundPlanExecutor {
private static List<FundPlanBean> splitFundFundPlan(FundRentPlanBean planBean,ConditionBean cb,String custID,String remainType,String reduceType) throws Exception{
List<String> planDates = planBean.getPlanDateList();
List<String> rentPlans = planBean.getRentList();
//安鹏逻辑只抵最后一期租金
BigDecimal lastRent = new BigDecimal(rentPlans.get(rentPlans.size() - 1));
BigDecimal cautionMoneyDeduction = new BigDecimal(cb.getCautionDeductionMoney());
if(lastRent.compareTo(cautionMoneyDeduction) < 0) {
cb.setCautionMoneyRemain(cautionMoneyDeduction.subtract(lastRent).toString());
cb.setCautionDeductionMoney(lastRent.toString());
}
List<FundPlanBean> newFundPlans = new ArrayList<FundPlanBean>();
if(Double.parseDouble(cb.getCautionMoneyRemain()) > 0){//退还保证金
FundPlanBean newFundPlan=new FundPlanBean();
@ -223,7 +230,16 @@ public class FundFundPlanExecutor {
}
if(Double.parseDouble(cb.getCautionDeductionMoney()) > 0){//抵扣保证金
BigDecimal planMoney=new BigDecimal(cb.getCautionDeductionMoney());
int planList=0;
FundPlanBean newFundPlan=new FundPlanBean();
newFundPlan.setFeeType(reduceType);
newFundPlan.setPlanList("1");
newFundPlan.setSettleMethod("payfund6");
newFundPlan.setPayType("pay_type_out");
newFundPlan.setPlanMoney(planMoney.toString());
newFundPlan.setPlanDate(planDates.get(planDates.size() - 1));
newFundPlan.setPayCust(custID);
newFundPlans.add(newFundPlan);
/*int planList=0;
for(int i = planDates.size()-1 ; i >= 0 ; i--){
planList++;
BigDecimal rent=new BigDecimal(rentPlans.get(i));
@ -258,7 +274,7 @@ public class FundFundPlanExecutor {
cb.setDeductionLastPlanDate(planDates.get(i));
break;
}
}
}*/
}else{
cb.setDeductionLastPlanDate(cb.getLastPlanDate());
}

View File

@ -81,6 +81,10 @@ public class ConditionHelper {
params.put("income_number", cb.getIncomeNumber() + "");
params.put("lease_term", cb.getLeaseTerm()+"");
params.put("FIRST_PAYMENT_TOTAL",cb.getFirstPaymentTotal());
//更新保证金抵扣
params.put("CAUTION_DEDUCTION_MONEY",cb.getCautionDeductionMoney());
params.put("CAUTION_MONEY_REMAIN",cb.getCautionMoneyRemain());
this.updateCondition(bean, params);
return params;
}