Commit e3a60a57 authored by LSL's avatar LSL

结清默认结清账单

parent 40960339
...@@ -9,6 +9,7 @@ import com.jqtx.windows.component.BackedDetailComponent; ...@@ -9,6 +9,7 @@ import com.jqtx.windows.component.BackedDetailComponent;
import com.jqtx.windows.component.LoanComponent; import com.jqtx.windows.component.LoanComponent;
import com.jqtx.windows.component.LoanPlanComponent; import com.jqtx.windows.component.LoanPlanComponent;
import com.jqtx.windows.component.LoanRepayComponent; import com.jqtx.windows.component.LoanRepayComponent;
import com.jqtx.windows.component.enums.IsSettleEnum;
import com.jqtx.windows.component.model.BackedDetailModel; import com.jqtx.windows.component.model.BackedDetailModel;
import com.jqtx.windows.component.model.LoanModel; import com.jqtx.windows.component.model.LoanModel;
import com.jqtx.windows.component.model.LoanPlanModel; import com.jqtx.windows.component.model.LoanPlanModel;
...@@ -108,11 +109,14 @@ public class BackedCommand extends AbstractCommand { ...@@ -108,11 +109,14 @@ public class BackedCommand extends AbstractCommand {
loanModel.setLoanStatus(DebtInfoStatusEnum.OVERDUED.getCode()); loanModel.setLoanStatus(DebtInfoStatusEnum.OVERDUED.getCode());
} else { } else {
//存在还款中计划改为还款中 //存在还款中计划改为还款中
List<LoanPlanModel> backingList = planList.stream().filter(i -> i.getStatus() == DebtPlanStatusEnum.BACKING.getCode()).collect(Collectors.toList()); List<LoanPlanModel> backingList = planList.stream().filter(i -> i.getStatus() == DebtPlanStatusEnum.SETTLED.getCode()).collect(Collectors.toList());
if (CollectionUtils.isNotEmpty(backingList)) { if (CollectionUtils.isNotEmpty(backingList)) {
loanModel.setLoanStatus(DebtInfoStatusEnum.SETTLED.getCode()); loanModel.setLoanStatus(DebtInfoStatusEnum.SETTLED.getCode());
} }
} }
if (IsSettleEnum.ONE.getCode().equals(backedRequest.getIsSettle())) {
loanModel.setLoanStatus(DebtPlanStatusEnum.SETTLED.getCode());
}
//修改 windows_loan 还款状态 //修改 windows_loan 还款状态
loanComponent.updateByLoanNo(loanModel); loanComponent.updateByLoanNo(loanModel);
return loanModel.getLoanStatus(); return loanModel.getLoanStatus();
...@@ -183,6 +187,9 @@ public class BackedCommand extends AbstractCommand { ...@@ -183,6 +187,9 @@ public class BackedCommand extends AbstractCommand {
} }
} }
} }
if (IsSettleEnum.ONE.getCode().equals(backedRequest.getIsSettle())) {
debtPlanModel.setStatus(DebtPlanStatusEnum.SETTLED.getCode());
}
if (debtBackedModel.getBackedAmt().compareTo(BigDecimal.ZERO) > 0) { if (debtBackedModel.getBackedAmt().compareTo(BigDecimal.ZERO) > 0) {
//生成 windows_backed_detail 信息 //生成 windows_backed_detail 信息
backedDetailComponent.insert(debtBackedModel); backedDetailComponent.insert(debtBackedModel);
......
package com.jqtx.windows.component.enums;
public enum IsSettleEnum {
ONE("1", "是"),
ZERO("0", "否"),
;
IsSettleEnum(String code, String msg) {
this.code = code;
this.msg = msg;
}
public static IsSettleEnum getByCode(String code) {
for (IsSettleEnum e : IsSettleEnum.values()) {
if (e.getCode().equals(code)) {
return e;
}
}
return null;
}
private String code;
private String msg;
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment