|
|
@@ -14,14 +14,13 @@ import com.loan.system.service.DisbursementRecordService;
|
|
|
import com.loan.system.utils.ResultUtil;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
import net.bytebuddy.dynamic.scaffold.MethodRegistry;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
import org.springframework.util.ObjectUtils;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
-import java.time.LocalDateTime;
|
|
|
-import java.time.format.DateTimeFormatter;
|
|
|
import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
@@ -31,35 +30,28 @@ import static com.loan.system.utils.ValidUtil.isAllFieldsNull;
|
|
|
@RestController
|
|
|
@RequestMapping("/wechat/repayment")
|
|
|
@Api(tags = "还款接口")
|
|
|
+@Slf4j
|
|
|
public class RepaymentController {
|
|
|
|
|
|
- @Autowired
|
|
|
- private DisbursementService disbursementService;
|
|
|
@Autowired
|
|
|
private StepService stepService;
|
|
|
@Autowired
|
|
|
- private ContractService contractService;
|
|
|
- @Autowired
|
|
|
- private ContractRepaymentService contractRepaymentService;
|
|
|
- @Autowired
|
|
|
private RepaymentService repaymentService;
|
|
|
@Autowired
|
|
|
- private RepaymentRecordService repaymentRecordService;
|
|
|
- @Autowired
|
|
|
private LoanService loanService;
|
|
|
|
|
|
@GetMapping("/{caseId}/repayDetails")
|
|
|
@ApiOperation("显示回款详情")//与loanContraller的方法一致,但为了规范
|
|
|
@PreAuthorize("@pms.hasAnyRoles('SYSTEM_ADMIN','APPROVER','LEAD_SALES', 'ASSIST_SALES', 'FINANCE', 'BACK_OFFICE')")
|
|
|
- public Result findLoanCaseDetails(@PathVariable("caseId")Long caseId){
|
|
|
- if(!loanService.existsByIdAndIsDelete(caseId))
|
|
|
+ public Result findLoanCaseDetails(@PathVariable("caseId") Long caseId) {
|
|
|
+ if (!loanService.existsByIdAndIsDelete(caseId))
|
|
|
throw new DescribeException(ExceptionEnum.PROJECT_NOT_EXIST);
|
|
|
|
|
|
- StepVO stepVO = stepService.findByStepNameAndCaseId(StepPropertyEnum.REPAY_START.getLabel(),caseId);
|
|
|
- if(ObjectUtils.isEmpty(stepVO) || stepVO.getStatus().equals(StepEnum.UNSTART.getMsg()))
|
|
|
+ StepVO stepVO = stepService.findByStepCodeAndCaseId(StepPropertyEnum.REPAY_START.getCode(), caseId);
|
|
|
+ if (ObjectUtils.isEmpty(stepVO) || stepVO.getStatus().equals(StepEnum.UNSTART.getMsg()))
|
|
|
throw new DescribeException(STEP_HAS_NOT_PROCESS);
|
|
|
|
|
|
- return ResultUtil.success("success",repaymentService.getDetails(caseId, StepPropertyEnum.REPAY_START.getLabel()));
|
|
|
+ return ResultUtil.success("success", repaymentService.getDetails(caseId, StepPropertyEnum.REPAY_START.getCode()));
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -67,134 +59,49 @@ public class RepaymentController {
|
|
|
@ApiOperation(value = "启动回款")
|
|
|
@PreAuthorize("@pms.hasAnyRoles('LEAD_SALES', 'ASSIST_SALES')")
|
|
|
public Result addDisbursement(@RequestBody RepaymentRecordDTO repaymentRecordDTO, @RequestParam Long caseId, @PathVariable("id") Long recordId) {
|
|
|
- if(ObjectUtils.isEmpty(repaymentRecordDTO)||isAllFieldsNull(repaymentRecordDTO))
|
|
|
+ if (ObjectUtils.isEmpty(repaymentRecordDTO) || isAllFieldsNull(repaymentRecordDTO))
|
|
|
throw new DescribeException(INPUT_ERROR);
|
|
|
|
|
|
- System.out.println(repaymentRecordDTO);
|
|
|
-
|
|
|
- if(caseId == null ||!loanService.existsByIdAndIsDelete(caseId))
|
|
|
+ if (caseId == null || !loanService.existsByIdAndIsDelete(caseId))
|
|
|
throw new DescribeException(ExceptionEnum.PROJECT_NOT_EXIST);
|
|
|
|
|
|
- StepVO stepVO = stepService.findByStepNameAndCaseId(StepPropertyEnum.REPAY_START.getLabel(),caseId);
|
|
|
- if(ObjectUtils.isEmpty(stepVO) || !stepVO.getStatus().equals(StepEnum.PROCESS.getMsg()))
|
|
|
+ StepVO stepVO = stepService.findByStepCodeAndCaseId(StepPropertyEnum.REPAY_START.getCode(), caseId);
|
|
|
+ if (ObjectUtils.isEmpty(stepVO) || !stepVO.getStatus().equals(StepEnum.PROCESS.getMsg()))
|
|
|
throw new DescribeException(STEP_HAS_NOT_PROCESS);
|
|
|
|
|
|
-
|
|
|
- Repayment repayment = repaymentService.findByCaseIdAndIsDelete(caseId, false);
|
|
|
- if(ObjectUtils.isEmpty(repayment)){
|
|
|
- Repayment rep = new Repayment();
|
|
|
- rep.setCaseId(caseId);
|
|
|
- rep.setStartUserId(BaseContext.getCurrentId());
|
|
|
- rep.setTotalAmount(disbursementService.getDisbursementByCaseId(caseId).getPlannedAmount());
|
|
|
- repayment=repaymentService.addRepayment(rep);
|
|
|
- }
|
|
|
-
|
|
|
- RepaymentRecord record =new RepaymentRecord();
|
|
|
- //上报计划(-1表示当前为新增)
|
|
|
- if(recordId <= 0){
|
|
|
- List<RepaymentRecord> repaymentRecords = repaymentRecordService.findByRepaymentIdAndIsDelete(repayment.getId(), false);
|
|
|
- if(!repaymentRecords.isEmpty()){
|
|
|
- record = repaymentRecords.get(repaymentRecords.size()-1);
|
|
|
- if(record.getApprovalDecision()==null || !record.getApprovalDecision().equals(DecisionEnum.PASS.getMsg()))
|
|
|
- throw new DescribeException(REPAYMENT_HAS_BEEN_REJECTED);
|
|
|
- }
|
|
|
- RepaymentRecord repaymentRecord = repaymentRecordService.addRepaymentRecord(repaymentRecordDTO, repayment.getId());
|
|
|
- recordId = repaymentRecord.getId();
|
|
|
- } else{
|
|
|
- //审批意见为通过,无法修改
|
|
|
- record = repaymentRecordService.findByIdAndIsDelete(recordId);
|
|
|
- if(record.getApprovalDecision()==null || record.getApprovalDecision().equals(DecisionEnum.PASS.getMsg()))
|
|
|
- throw new DescribeException(REPAYMENT_HAS_COMPLETED);
|
|
|
-
|
|
|
- repaymentRecordService.updateRepaymentRecordById(repaymentRecordDTO,recordId);
|
|
|
- //获取合同回款
|
|
|
- List<Long> Ids = contractRepaymentService.findByRepaymentRecordIdAndIsDelete(recordId);
|
|
|
- contractRepaymentService.deleteByIds(Ids);
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- //创建新关联关系
|
|
|
- Iterator<Map.Entry<Long, Double>> iterator = repaymentRecordDTO.getContractIdAndAmount().entrySet().iterator();
|
|
|
- while (iterator.hasNext()) {
|
|
|
- Map.Entry<Long, Double> entry = iterator.next();
|
|
|
- Long contractId = entry.getKey();
|
|
|
- double amount = entry.getValue();
|
|
|
- contractRepaymentService.addContractRepayment(recordId,contractId,caseId,amount,record.getRepayTime());
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- //修改状态
|
|
|
- if(isCleared(caseId,StepPropertyEnum.REPAY_START.getLabel())){
|
|
|
- //若结清,则回款完成
|
|
|
- stepService.updateStatusByCaseId( StepEnum.COMPLETED.getMsg(),StepPropertyEnum.REPAY_START.getLabel(), caseId);
|
|
|
- }
|
|
|
-
|
|
|
- stepService.tryStartStep(StepPropertyEnum.REPAY_START.getLabel(),caseId);
|
|
|
-
|
|
|
- //TODO:微信推送预审通过消息和通知下一环节
|
|
|
-// SysMessage message = new SysMessage();
|
|
|
-// message.setMobile(null);
|
|
|
-// message.setUserRole("");
|
|
|
-// message.setMessageTitle("");
|
|
|
-// message.setMessageContent("");
|
|
|
-// message.setStepName("");
|
|
|
-// message.setRelatedId(loanCase.getId());
|
|
|
-// message.setRelatedType("");
|
|
|
-// messageService.addMessage(message);
|
|
|
-// wxService.sendTemplateMessage(loanCase.getCustomer().getMobile(),new TemplateMessage());
|
|
|
+ repaymentService.addDisbursement(repaymentRecordDTO, caseId, recordId);
|
|
|
|
|
|
return ResultUtil.success("success");
|
|
|
}
|
|
|
|
|
|
@GetMapping("/{caseId}/approvalDetails")
|
|
|
@ApiOperation("显示审批详情")//与loanContraller的方法一致,但为了规范
|
|
|
- @PreAuthorize("@pms.hasAnyRoles('SYSTEM_ADMIN','APPROVER','LEAD_SALES', 'ASSIST_SALES', 'FINANCE', 'BACK_OFFICE')")
|
|
|
- public Result findLoanCaseDetails2(@PathVariable("caseId")Long caseId){
|
|
|
- if (caseId == null ||!loanService.existsByIdAndIsDelete(caseId))
|
|
|
+ @PreAuthorize("@pms.hasAnyRoles('SYSTEM_ADMIN','APPROVER', 'BACK_OFFICE')")
|
|
|
+ public Result findLoanCaseDetails2(@PathVariable("caseId") Long caseId) {
|
|
|
+ if (caseId == null || !loanService.existsByIdAndIsDelete(caseId))
|
|
|
throw new DescribeException(ExceptionEnum.PROJECT_NOT_EXIST);
|
|
|
|
|
|
- return ResultUtil.success("success",repaymentService.getDetails(caseId, StepPropertyEnum.REPAY_APPROVAL.getLabel()));
|
|
|
+ return ResultUtil.success("success", repaymentService.getDetails(caseId, StepPropertyEnum.REPAY_APPROVAL.getCode()));
|
|
|
}
|
|
|
|
|
|
//TODO:在回款记录添加审批记录,且每次审批完之后才能再回款
|
|
|
@PostMapping("/approval/pass")
|
|
|
@ApiOperation(value = "回款审批")
|
|
|
@PreAuthorize("@pms.hasRole('APPROVER')")
|
|
|
- public Result repaymentApproval(@RequestBody RepaymentApprovalDTO approvalDTO,@RequestParam Long chargeId) {
|
|
|
- if(ObjectUtils.isEmpty(approvalDTO)||approvalDTO.getCaseId() == null||approvalDTO.getRecordId() == null)
|
|
|
+ public Result repaymentApproval(@RequestBody RepaymentApprovalDTO approvalDTO, @RequestParam Long chargeId, @RequestParam(required = false) Long assistantId) {
|
|
|
+ if (ObjectUtils.isEmpty(approvalDTO) || approvalDTO.getCaseId() == null || approvalDTO.getRecordId() == null)
|
|
|
throw new DescribeException(INPUT_ERROR);
|
|
|
|
|
|
- if(!loanService.existsByIdAndIsDelete(approvalDTO.getCaseId()))
|
|
|
+ if (!loanService.existsByIdAndIsDelete(approvalDTO.getCaseId()))
|
|
|
throw new DescribeException(ExceptionEnum.PROJECT_NOT_EXIST);
|
|
|
|
|
|
Long caseId = approvalDTO.getCaseId();
|
|
|
|
|
|
- StepVO stepVO = stepService.findByStepNameAndCaseId(StepPropertyEnum.REPAY_APPROVAL.getLabel(),caseId);
|
|
|
- if(!stepVO.getStatus().equals(StepEnum.PROCESS.getMsg()))
|
|
|
+ StepVO stepVO = stepService.findByStepCodeAndCaseId(StepPropertyEnum.REPAY_APPROVAL.getCode(), caseId);
|
|
|
+ if (!stepVO.getStatus().equals(StepEnum.PROCESS.getMsg()))
|
|
|
throw new DescribeException(STEP_HAS_NOT_PROCESS);
|
|
|
|
|
|
- //填写审批意见
|
|
|
- repaymentRecordService.updateApprovalById(approvalDTO.getComments(),DecisionEnum.PASS.getMsg(),BaseContext.getCurrentId(),approvalDTO.getRecordId());
|
|
|
- //TODO:微信推送预审通过消息和通知下一环节
|
|
|
-// SysMessage message = new SysMessage();
|
|
|
-// message.setMobile(null);
|
|
|
-// message.setUserRole("");
|
|
|
-// message.setMessageTitle("");
|
|
|
-// message.setMessageContent("");
|
|
|
-// message.setStepName("");
|
|
|
-// message.setRelatedId(loanCase.getId());
|
|
|
-// message.setRelatedType("");
|
|
|
-// messageService.addMessage(message);
|
|
|
-// wxService.sendTemplateMessage(loanCase.getCustomer().getMobile(),new TemplateMessage());
|
|
|
-
|
|
|
- //修改状态
|
|
|
- stepService.updateUserByCaseId(StepPropertyEnum.REPAY_APPROVAL.getLabel(), BaseContext.getCurrentId(), caseId);
|
|
|
- //TODO:更新结清状态(因为是一审一批,只有通过的时候才结清状态,不通过则不结清,保证了结清时的总金额为审批通过的)
|
|
|
- contractIsCleared(repaymentService.findByCaseIdAndIsDelete(caseId,false).getId(),chargeId);
|
|
|
-
|
|
|
- if(isCleared(caseId,StepPropertyEnum.REPAY_APPROVAL.getLabel()))
|
|
|
- stepService.updateStatusByCaseId(StepEnum.COMPLETED.getMsg(),StepPropertyEnum.REPAY_APPROVAL.getLabel(), caseId);
|
|
|
- stepService.tryStartStep(StepPropertyEnum.REPAY_APPROVAL.getLabel(),caseId);
|
|
|
+ repaymentService.repaymentApproval(approvalDTO, chargeId, assistantId);
|
|
|
|
|
|
return ResultUtil.success("success");
|
|
|
}
|
|
|
@@ -203,366 +110,182 @@ public class RepaymentController {
|
|
|
@ApiOperation(value = "回款审批驳回")
|
|
|
@PreAuthorize("@pms.hasRole('APPROVER')")
|
|
|
public Result repaymentCancel(@RequestBody RepaymentApprovalDTO approvalDTO) {
|
|
|
- if(ObjectUtils.isEmpty(approvalDTO)||approvalDTO.getCaseId() == null||approvalDTO.getRecordId() == null)
|
|
|
+ if (ObjectUtils.isEmpty(approvalDTO) || approvalDTO.getCaseId() == null || approvalDTO.getRecordId() == null)
|
|
|
throw new DescribeException(INPUT_ERROR);
|
|
|
|
|
|
- if(!loanService.existsByIdAndIsDelete(approvalDTO.getCaseId()))
|
|
|
+ if (!loanService.existsByIdAndIsDelete(approvalDTO.getCaseId()))
|
|
|
throw new DescribeException(ExceptionEnum.PROJECT_NOT_EXIST);
|
|
|
|
|
|
Long caseId = approvalDTO.getCaseId();
|
|
|
|
|
|
- StepVO stepVO = stepService.findByStepNameAndCaseId(StepPropertyEnum.REPAY_APPROVAL.getLabel(),caseId);
|
|
|
- if(stepVO.getStatus().equals(StepEnum.COMPLETED.getMsg()))
|
|
|
+ StepVO stepVO = stepService.findByStepCodeAndCaseId(StepPropertyEnum.REPAY_APPROVAL.getCode(), caseId);
|
|
|
+ if (stepVO.getStatus().equals(StepEnum.COMPLETED.getMsg()))
|
|
|
throw new DescribeException(ExceptionEnum.STEP_HAS_COMPLETEED);
|
|
|
|
|
|
- //填写驳回意见
|
|
|
- repaymentRecordService.updateApprovalById(approvalDTO.getComments(),DecisionEnum.REJECT.getMsg(),BaseContext.getCurrentId(),approvalDTO.getRecordId());
|
|
|
-
|
|
|
- //修改负责人
|
|
|
- stepService.updateUserByCaseId(StepPropertyEnum.REPAY_APPROVAL.getLabel(), BaseContext.getCurrentId(), caseId);
|
|
|
- stepService.updateStatusByCaseId(StepEnum.PROCESS.getMsg(), StepPropertyEnum.REPAY_START.getLabel(), caseId);
|
|
|
- stepService.updateStatusByCaseId(StepEnum.UNSTART.getMsg(), StepPropertyEnum.REPAY_APPROVAL.getLabel(), caseId);
|
|
|
-
|
|
|
- //TODO:微信推送预审通过消息和通知下一环节
|
|
|
-// SysMessage message = new SysMessage();
|
|
|
-// message.setMobile(null);
|
|
|
-// message.setUserRole("");
|
|
|
-// message.setMessageTitle("");
|
|
|
-// message.setMessageContent("");
|
|
|
-// message.setStepName("");
|
|
|
-// message.setRelatedId(loanCase.getId());
|
|
|
-// message.setRelatedType("");
|
|
|
-// messageService.addMessage(message);
|
|
|
-// wxService.sendTemplateMessage(loanCase.getCustomer().getMobile(),new TemplateMessage());
|
|
|
+ repaymentService.repaymentCancel(approvalDTO);
|
|
|
|
|
|
return ResultUtil.success("success");
|
|
|
}
|
|
|
|
|
|
- //TODO:用于判断总的金额是否结清
|
|
|
- private Boolean isCleared(Long caseId,String stepName){
|
|
|
- Repayment repayment = repaymentService.findByCaseIdAndIsDelete(caseId, false);
|
|
|
- //获取回款记录
|
|
|
- List<RepaymentRecord> repaymentRecords = repaymentRecordService.findByRepaymentIdAndIsDelete(repayment.getId(), false);
|
|
|
- Double totalAmount = repaymentService.findByCaseIdAndIsDelete(caseId, false).getTotalAmount();
|
|
|
-
|
|
|
- Double currentAmount= 0.0;
|
|
|
- for (RepaymentRecord repaymentRecord : repaymentRecords)
|
|
|
- if(stepName.equals(StepPropertyEnum.REPAY_APPROVAL.getLabel())){
|
|
|
- if(repaymentRecord.getApprovalDecision()!=null && repaymentRecord.getApprovalDecision().equals(DecisionEnum.PASS.getMsg())
|
|
|
- && !repaymentRecord.getIsInterest())//审批、财务环节显示审批通过后的总额
|
|
|
- currentAmount += repaymentRecord.getAmount();
|
|
|
- }else if(stepName.equals(StepPropertyEnum.REPAY_START.getLabel())){
|
|
|
- if( !repaymentRecord.getIsInterest())//审批、财务环节显示审批通过后的总额
|
|
|
- currentAmount += repaymentRecord.getAmount();
|
|
|
- }
|
|
|
-
|
|
|
- return Math.abs(totalAmount-currentAmount)< Double.MIN_VALUE;
|
|
|
- }
|
|
|
-
|
|
|
- /*TODO:更新合同结清状态
|
|
|
- * 1.根据recordId查合同关联表,
|
|
|
- * 2.查出每个合同id对应的回款金额
|
|
|
- * 3.若回款金额与借款金额相同,则结清
|
|
|
- * */
|
|
|
- private void contractIsCleared(Long repaymentId,Long chargeId) {
|
|
|
- //1.
|
|
|
- List<RepaymentRecord> repaymentRecords = repaymentRecordService.findByRepaymentIdAndIsDelete(repaymentId, false);
|
|
|
- List<Long> recordIds= repaymentRecords.stream().map(RepaymentRecord::getId).collect(Collectors.toList());
|
|
|
- List<ContractRepayment> contractRepayments = contractRepaymentService.findByRepaymentRecordIdsAndIsDelete(recordIds);
|
|
|
-
|
|
|
- //2.
|
|
|
- List<Long> contractIds = contractRepayments.stream().map(ContractRepayment::getContractId).collect(Collectors.toList());
|
|
|
- for(Long contractId:contractIds){
|
|
|
- double amount = 0.0;
|
|
|
- for (ContractRepayment contractRepayment:contractRepayments){
|
|
|
- RepaymentRecord repaymentRecord = repaymentRecordService.findByIdAndIsDelete(contractRepayment.getRepaymentRecordId());
|
|
|
- if(!repaymentRecord.getIsInterest() && contractRepayment.getContractId().equals(contractId))
|
|
|
- amount += contractRepayment.getAmount();
|
|
|
- }
|
|
|
-
|
|
|
- System.out.println("amount:"+amount);
|
|
|
- //3.
|
|
|
- if(Math.abs(amount-contractService.findContractById(contractId).getContractAmount())< Double.MIN_VALUE)
|
|
|
- contractService.updateRepayById(true,0.0,chargeId,contractId,false);
|
|
|
- }
|
|
|
- }
|
|
|
- @GetMapping("/financeDetails")
|
|
|
- @ApiOperation("显示财务核算详情")//与loanContraller的方法一致,但为了规范
|
|
|
- @PreAuthorize("@pms.hasAnyRoles('SYSTEM_ADMIN','APPROVER','LEAD_SALES', 'ASSIST_SALES', 'FINANCE', 'BACK_OFFICE')")
|
|
|
- public Result findLoanCaseDetails3(@RequestParam Long caseId){
|
|
|
- if (caseId == null ||!loanService.existsByIdAndIsDelete(caseId))
|
|
|
- throw new DescribeException(ExceptionEnum.PROJECT_NOT_EXIST);
|
|
|
- return ResultUtil.success("success",repaymentService.getDetails(caseId,StepPropertyEnum.FINANCE_CHECK.getLabel()));
|
|
|
- }
|
|
|
+// @GetMapping("/financeDetails")
|
|
|
+// @ApiOperation("显示财务核算详情")//与loanContraller的方法一致,但为了规范
|
|
|
+// @PreAuthorize("@pms.hasAnyRoles('SYSTEM_ADMIN','APPROVER', 'FINANCE', 'BACK_OFFICE')")
|
|
|
+// public Result findLoanCaseDetails3(@RequestParam Long caseId){
|
|
|
+// if (caseId == null ||!loanService.existsByIdAndIsDelete(caseId))
|
|
|
+// throw new DescribeException(ExceptionEnum.PROJECT_NOT_EXIST);
|
|
|
+// return ResultUtil.success("success",repaymentService.getDetails(caseId,StepPropertyEnum.FINANCE_CHECK.getCode()));
|
|
|
+// }
|
|
|
|
|
|
@PostMapping("/financeCheck/{caseId}")
|
|
|
- @ApiOperation(value = "财务核算")
|
|
|
+ @ApiOperation(value = "财务核算")//x
|
|
|
@PreAuthorize("@pms.hasRole('FINANCE')")
|
|
|
- public Result financeDisbursement( @PathVariable Long caseId,@RequestParam Double interest,@RequestParam Long contractId) {
|
|
|
- if(caseId==null||!loanService.existsByIdAndIsDelete(caseId))
|
|
|
+ public Result financeDisbursement(@PathVariable Long caseId, @RequestParam Double interest, @RequestParam Long contractId) {
|
|
|
+ if (caseId == null || !loanService.existsByIdAndIsDelete(caseId))
|
|
|
throw new DescribeException(ExceptionEnum.PROJECT_NOT_EXIST);
|
|
|
|
|
|
- StepVO stepVO = stepService.findByStepNameAndCaseId(StepPropertyEnum.FINANCE_CHECK.getLabel(),caseId);
|
|
|
- if(ObjectUtils.isEmpty(stepVO)||!stepVO.getStatus().equals(StepEnum.PROCESS.getMsg()))
|
|
|
- throw new DescribeException(STEP_HAS_NOT_PROCESS);
|
|
|
+// StepVO stepVO = stepService.findByStepCodeAndCaseId(StepPropertyEnum.FINANCE_CHECK.getCode(),caseId);
|
|
|
+// if(ObjectUtils.isEmpty(stepVO)||!stepVO.getStatus().equals(StepEnum.PROCESS.getMsg()))
|
|
|
+// throw new DescribeException(STEP_HAS_NOT_PROCESS);
|
|
|
|
|
|
- Contract contract = contractService.findContractById(contractId);
|
|
|
- if(!contract.getIsCleared())
|
|
|
- throw new DescribeException(FUND_NOT_CLEAR);
|
|
|
- if(contract.getFinanceUserId()!=null && !contract.getFinanceUserId().equals(BaseContext.getCurrentId()))
|
|
|
- throw new DescribeException(STEP_USER_NOT_EXPECTED);
|
|
|
+ //TODO:1.无需结清,一次回款计划结算一次,按合同结算,并统计本次利息金额
|
|
|
+// Contract contract = contractService.findContractById(contractId);
|
|
|
+// if(!contract.getIsCleared())
|
|
|
+// throw new DescribeException(FUND_NOT_CLEAR);
|
|
|
|
|
|
- //修改合同信息
|
|
|
- contractService.updateRepayById(true,interest,BaseContext.getCurrentId(),contractId,false);
|
|
|
-
|
|
|
- //修改状态
|
|
|
- stepService.updateUserByCaseId(StepPropertyEnum.FINANCE_CHECK.getLabel(), BaseContext.getCurrentId(), caseId);
|
|
|
- boolean flag = true;
|
|
|
- List<Contract> contractByCaseId = contractService.findContractByCaseId2(caseId);
|
|
|
- for (Contract contract2 : contractByCaseId)
|
|
|
- if (contract2.getFinanceUserId()== null){
|
|
|
- flag = false;
|
|
|
- break;
|
|
|
- }
|
|
|
- if (flag)//如果全部合同都有财务人员,则表示全部核算完成
|
|
|
- stepService.updateStatusByCaseId( StepEnum.COMPLETED.getMsg(),StepPropertyEnum.FINANCE_CHECK.getLabel(),caseId);
|
|
|
-
|
|
|
- stepService.tryStartStep(StepPropertyEnum.FINANCE_CHECK.getLabel(),caseId);
|
|
|
-
|
|
|
- //TODO:微信推送预审通过消息和通知下一环节
|
|
|
-// SysMessage message = new SysMessage();
|
|
|
-// message.setMobile(null);
|
|
|
-// message.setUserRole("");
|
|
|
-// message.setMessageTitle("");
|
|
|
-// message.setMessageContent("");
|
|
|
-// message.setStepName("");
|
|
|
-// message.setRelatedId(loanCase.getId());
|
|
|
-// message.setRelatedType("");
|
|
|
-// messageService.addMessage(message);
|
|
|
-// wxService.sendTemplateMessage(loanCase.getCustomer().getMobile(),new TemplateMessage());
|
|
|
+ repaymentService.financeDisbursement(caseId, interest, contractId);
|
|
|
|
|
|
return ResultUtil.success("success");
|
|
|
}
|
|
|
|
|
|
@GetMapping("/balanceDetails")
|
|
|
@ApiOperation("显示费息回款详情")//与loanContraller的方法一致,但为了规范
|
|
|
- @PreAuthorize("@pms.hasAnyRoles('SYSTEM_ADMIN','APPROVER','LEAD_SALES', 'ASSIST_SALES', 'FINANCE', 'BACK_OFFICE')")
|
|
|
- public Result findLoanCaseDetails4(@RequestParam Long caseId){
|
|
|
- if (caseId == null ||!loanService.existsByIdAndIsDelete(caseId))
|
|
|
+ @PreAuthorize("@pms.hasAnyRoles('SYSTEM_ADMIN','APPROVER','LEAD_SALES','FINANCE', 'ASSIST_SALES','BACK_OFFICE')")
|
|
|
+ public Result findLoanCaseDetails4(@RequestParam Long caseId) {
|
|
|
+ if (caseId == null || !loanService.existsByIdAndIsDelete(caseId))
|
|
|
throw new DescribeException(ExceptionEnum.PROJECT_NOT_EXIST);
|
|
|
-
|
|
|
- return ResultUtil.success("success",repaymentService.getDetails(caseId,StepPropertyEnum.BALANCE_REPAY.getLabel()));
|
|
|
+ return ResultUtil.success("success", repaymentService.getDetails(caseId, StepPropertyEnum.BALANCE_REPAY.getCode()));
|
|
|
}
|
|
|
|
|
|
+ /*
|
|
|
+ TODO:
|
|
|
+ 1.显示本次回款本金
|
|
|
+ 2.若本金结清,可输入合同利息总额
|
|
|
+ 3.显示本次回款利息
|
|
|
+ 4.一次汇款可能从多个银行汇款,所以再加一个表绑定汇款计划
|
|
|
+ */
|
|
|
+
|
|
|
@PostMapping("/balanceRepay")
|
|
|
- @ApiOperation(value = "费息回款")
|
|
|
+ @ApiOperation(value = "本金加费息回款")
|
|
|
@PreAuthorize("@pms.hasAnyRoles('LEAD_SALES', 'ASSIST_SALES')")
|
|
|
- public Result balanceRepay(@RequestParam Long caseId , @RequestBody RepaymentRecordDTO repaymentRecordDTO ) {
|
|
|
- if(ObjectUtils.isEmpty(repaymentRecordDTO)||caseId==null)
|
|
|
+ public Result balanceRepay(@RequestParam Long caseId, @RequestBody RepaymentRecordDTO repaymentRecordDTO) {
|
|
|
+ if (ObjectUtils.isEmpty(repaymentRecordDTO) || caseId == null)
|
|
|
throw new DescribeException(INPUT_ERROR);
|
|
|
- if(!loanService.existsByIdAndIsDelete(caseId))
|
|
|
+ if (!loanService.existsByIdAndIsDelete(caseId))
|
|
|
throw new DescribeException(ExceptionEnum.PROJECT_NOT_EXIST);
|
|
|
|
|
|
- StepVO stepVO = stepService.findByStepNameAndCaseId(StepPropertyEnum.BALANCE_REPAY.getLabel(),caseId);
|
|
|
- if(ObjectUtils.isEmpty(stepVO)||!stepVO.getStatus().equals(StepEnum.PROCESS.getMsg()))
|
|
|
+ StepVO stepVO = stepService.findByStepCodeAndCaseId(StepPropertyEnum.BALANCE_REPAY.getCode(), caseId);
|
|
|
+ if (ObjectUtils.isEmpty(stepVO) || !stepVO.getStatus().equals(StepEnum.PROCESS.getMsg()))
|
|
|
throw new DescribeException(STEP_HAS_NOT_PROCESS);
|
|
|
|
|
|
-// Long currentId = stepVO.getUserId1();
|
|
|
-// if(currentId!=null && !BaseContext.getCurrentId().equals(currentId)){
|
|
|
-// throw new DescribeException(STEP_USER_NOT_EXPECTED);
|
|
|
-// }
|
|
|
-
|
|
|
- //添加回款记录
|
|
|
- repaymentRecordDTO.setIsInterest( true);
|
|
|
- RepaymentRecord record = repaymentRecordService.addRepaymentRecord(repaymentRecordDTO, repaymentService.findByCaseIdAndIsDelete(caseId, false).getId());
|
|
|
- //创建新关联关系
|
|
|
- Iterator<Map.Entry<Long, Double>> iterator = repaymentRecordDTO.getContractIdAndAmount().entrySet().iterator();
|
|
|
- while (iterator.hasNext()) {
|
|
|
- Map.Entry<Long, Double> entry = iterator.next();
|
|
|
- Long contractId = entry.getKey();
|
|
|
- double amount = entry.getValue();
|
|
|
- contractRepaymentService.addContractRepayment(record.getId(),contractId,caseId,amount,record.getRepayTime());
|
|
|
-
|
|
|
+ if (stepVO.getUserIds() != null) {
|
|
|
+ boolean flag = false;//是否存在
|
|
|
+ String[] userIds = stepVO.getUserIds().split(",");//分主办与辅办,但仅需任意一人操作即可
|
|
|
+ for (String userId : userIds) {
|
|
|
+ Long currentId = Long.valueOf(userId);
|
|
|
+ if (BaseContext.getCurrentId().equals(currentId)) {
|
|
|
+ flag = true;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (!flag)
|
|
|
+ //全部遍历结束未break,表示不是预期用户
|
|
|
+ throw new DescribeException(STEP_USER_NOT_EXPECTED);
|
|
|
}
|
|
|
|
|
|
- //TODO:添加赎当号码
|
|
|
-
|
|
|
- stepService.updateUserId1ByCaseIdAndStepName(StepPropertyEnum.BALANCE_REPAY.getLabel(), BaseContext.getCurrentId(), caseId);
|
|
|
- if(interestIsCleared(repaymentService.findByCaseIdAndIsDelete(caseId, false).getId()))//当全部的合同的费息都完成时才结束环节
|
|
|
- stepService.updateStatusByCaseId(StepEnum.COMPLETED.getMsg(),StepPropertyEnum.BALANCE_REPAY.getLabel(),caseId);
|
|
|
-
|
|
|
- stepService.tryStartStep(StepPropertyEnum.BALANCE_REPAY.getLabel(),caseId);
|
|
|
-
|
|
|
- //TODO:微信推送预审通过消息和通知下一环节
|
|
|
-// SysMessage message = new SysMessage();
|
|
|
-// message.setMobile(null);
|
|
|
-// message.setUserRole("");
|
|
|
-// message.setMessageTitle("");
|
|
|
-// message.setMessageContent("");
|
|
|
-// message.setStepName("");
|
|
|
-// message.setRelatedId(loanCase.getId());
|
|
|
-// message.setRelatedType("");
|
|
|
-// messageService.addMessage(message);
|
|
|
-// wxService.sendTemplateMessage(loanCase.getCustomer().getMobile(),new TemplateMessage());
|
|
|
+ repaymentService.balanceRepay(repaymentRecordDTO, caseId);
|
|
|
|
|
|
return ResultUtil.success("success");
|
|
|
}
|
|
|
- /*TODO:更新合同费息结清状态
|
|
|
- * 1.根据recordId查合同关联表,
|
|
|
- * 2.查出每个合同id对应的回款金额
|
|
|
- * 3.若全部合同的回款金额与费息相同,则结清
|
|
|
- * */
|
|
|
- private Boolean interestIsCleared(Long repaymentId) {
|
|
|
- //1.
|
|
|
- List<RepaymentRecord> repaymentRecords = repaymentRecordService.findByRepaymentIdAndIsInterestAndIsDelete(repaymentId, false);
|
|
|
- List<Long> recordIds= repaymentRecords.stream().map(RepaymentRecord::getId).collect(Collectors.toList());
|
|
|
- List<ContractRepayment> contractRepayments = contractRepaymentService.findByRepaymentRecordIdsAndIsDelete(recordIds);
|
|
|
-
|
|
|
- //2.
|
|
|
- List<Long> contractIds = contractRepayments.stream().map(ContractRepayment::getContractId).collect(Collectors.toList());
|
|
|
- for(Long contractId:contractIds){
|
|
|
- double amount = 0.0;
|
|
|
- for (ContractRepayment contractRepayment:contractRepayments){
|
|
|
- RepaymentRecord record = repaymentRecordService.findByIdAndIsDelete(contractRepayment.getRepaymentRecordId());
|
|
|
- if(contractRepayment.getContractId().equals(contractId)&&record.getIsInterest())
|
|
|
- amount += contractRepayment.getAmount();
|
|
|
- }
|
|
|
-
|
|
|
- //3.
|
|
|
- if(Math.abs(amount-contractService.findContractById(contractId).getInterestAmount())> Double.MIN_VALUE)
|
|
|
- return false;
|
|
|
- }
|
|
|
- return true;
|
|
|
- }
|
|
|
|
|
|
+ /*
|
|
|
+ 客户名称、合同金额、剩余回款金额、本次回款金额、本次回款费息、本次回款本金及费息合计;
|
|
|
+ */
|
|
|
@PostMapping("/financeConfirm")
|
|
|
@ApiOperation(value = "财务确认")
|
|
|
@PreAuthorize("@pms.hasRole('FINANCE')")
|
|
|
- public Result financeConfirm(@RequestParam List<Long> recordIds,@RequestParam Long caseId) {//TODO:一下子可以确认多笔
|
|
|
- if(caseId==null || !loanService.existsByIdAndIsDelete(caseId))
|
|
|
+ public Result financeConfirm(@RequestParam List<Long> recordIds, @RequestParam Long caseId, @RequestParam String comment) {//TODO:一下子可以确认多笔
|
|
|
+ if (caseId == null || !loanService.existsByIdAndIsDelete(caseId))
|
|
|
throw new DescribeException(ExceptionEnum.PROJECT_NOT_EXIST);
|
|
|
|
|
|
- StepVO stepVO = stepService.findByStepNameAndCaseId(StepPropertyEnum.FINANCE_CONFIRM.getLabel(),caseId);
|
|
|
- if(ObjectUtils.isEmpty(stepVO)||!stepVO.getStatus().equals(StepEnum.PROCESS.getMsg()))
|
|
|
+ StepVO stepVO = stepService.findByStepCodeAndCaseId(StepPropertyEnum.FINANCE_CONFIRM.getCode(), caseId);
|
|
|
+ if (ObjectUtils.isEmpty(stepVO) || !stepVO.getStatus().equals(StepEnum.PROCESS.getMsg()))
|
|
|
throw new DescribeException(STEP_HAS_NOT_PROCESS);
|
|
|
|
|
|
-// Long currentId = stepVO.getUserId1();
|
|
|
-// if(currentId!=null && !BaseContext.getCurrentId().equals(currentId)){
|
|
|
-// throw new DescribeException(STEP_USER_NOT_EXPECTED);
|
|
|
-// }
|
|
|
- for(Long recordId:recordIds){
|
|
|
- repaymentRecordService.updateApprovalById("",DecisionEnum.PASS.getMsg(),BaseContext.getCurrentId(),recordId);
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- stepService.updateUserId1ByCaseIdAndStepName(StepPropertyEnum.FINANCE_CONFIRM.getLabel(), BaseContext.getCurrentId(), caseId);
|
|
|
- if(interestIsCleared(repaymentService.findByCaseIdAndIsDelete(caseId, false).getId())){
|
|
|
- stepService.updateStatusByCaseId(StepEnum.COMPLETED.getMsg(),StepPropertyEnum.FINANCE_CONFIRM.getLabel(),caseId);
|
|
|
-
|
|
|
-// loanService.updateIsCompleteByCaseId(DecisionEnum.COMPLETE.getMsg(),caseId);
|
|
|
- }
|
|
|
- stepService.tryStartStep(StepPropertyEnum.FINANCE_CONFIRM.getLabel(),caseId);
|
|
|
-
|
|
|
- //TODO:微信推送预审通过消息和通知下一环节
|
|
|
-// SysMessage message = new SysMessage();
|
|
|
-// message.setMobile(null);
|
|
|
-// message.setUserRole("");
|
|
|
-// message.setMessageTitle("");
|
|
|
-// message.setMessageContent("");
|
|
|
-// message.setStepName("");
|
|
|
-// message.setRelatedId(loanCase.getId());
|
|
|
-// message.setRelatedType("");
|
|
|
-// messageService.addMessage(message);
|
|
|
-// wxService.sendTemplateMessage(loanCase.getCustomer().getMobile(),new TemplateMessage());
|
|
|
+ repaymentService.financeConfirm(recordIds, caseId, comment);
|
|
|
|
|
|
return ResultUtil.success("success");
|
|
|
}
|
|
|
|
|
|
@PostMapping("/repayComplete")
|
|
|
@ApiOperation(value = "回款完成")
|
|
|
- @PreAuthorize("@pms.hasAnyRoles('APPROVAL')")
|
|
|
+ @PreAuthorize("@pms.hasAnyRoles('LEAD_SALES', 'ASSIST_SALES')")
|
|
|
public Result repayComplete(@RequestParam Long caseId) {
|
|
|
- if(caseId==null || !loanService.existsByIdAndIsDelete(caseId))
|
|
|
+ if (caseId == null || !loanService.existsByIdAndIsDelete(caseId))
|
|
|
throw new DescribeException(ExceptionEnum.PROJECT_NOT_EXIST);
|
|
|
|
|
|
- StepVO stepVO = stepService.findByStepNameAndCaseId(StepPropertyEnum.REPAYMENT_COMPLETE.getLabel(),caseId);
|
|
|
- if(ObjectUtils.isEmpty(stepVO)||!stepVO.getStatus().equals(StepEnum.PROCESS.getMsg()))
|
|
|
+ StepVO stepVO = stepService.findByStepCodeAndCaseId(StepPropertyEnum.REPAYMENT_COMPLETE.getCode(), caseId);
|
|
|
+ if (ObjectUtils.isEmpty(stepVO) || !stepVO.getStatus().equals(StepEnum.PROCESS.getMsg()))
|
|
|
throw new DescribeException(STEP_HAS_NOT_PROCESS);
|
|
|
|
|
|
- StepVO stepVO1 = stepService.findByStepNameAndCaseId(StepPropertyEnum.FINANCE_CONFIRM.getLabel(), caseId);
|
|
|
- if(ObjectUtils.isEmpty(stepVO1)||!stepVO1.getStatus().equals(StepEnum.COMPLETED.getMsg()))
|
|
|
+ StepVO stepVO1 = stepService.findByStepCodeAndCaseId(StepPropertyEnum.FINANCE_CONFIRM.getCode(), caseId);
|
|
|
+ if (ObjectUtils.isEmpty(stepVO1) || !stepVO1.getStatus().equals(StepEnum.COMPLETED.getMsg()))
|
|
|
throw new DescribeException(PRE_STEP_NOT_COMPLETE);
|
|
|
|
|
|
List<StepVO> steps = stepService.getStepByCaseId(caseId);
|
|
|
- for(StepVO step:steps){
|
|
|
- if(!step.getStatus().equals(StepEnum.COMPLETED.getMsg()))
|
|
|
+ for (StepVO step : steps) {
|
|
|
+ if (!step.getParentCode().equals(stepVO.getParentCode()) || step.getCode().equals(StepPropertyEnum.CASE_COMPLETE.getCode()) || step.getCode().equals(stepVO.getCode()))
|
|
|
+ continue;
|
|
|
+ if (!step.getStatus().equals(StepEnum.COMPLETED.getMsg()))
|
|
|
throw new DescribeException(STEP_EXIST_NOT_COMPLETE);
|
|
|
}
|
|
|
|
|
|
+ repaymentService.repayComplete(caseId);
|
|
|
|
|
|
- //更新回款单
|
|
|
- repaymentService.updateStatusByCaseId(DecisionEnum.REPAYMENT_COMPLETE.getMsg(),caseId);
|
|
|
-
|
|
|
+ return ResultUtil.success("success");
|
|
|
+ }
|
|
|
|
|
|
- stepService.updateUserId1ByCaseIdAndStepName(StepPropertyEnum.REPAYMENT_COMPLETE.getLabel(),BaseContext.getCurrentId(), caseId);
|
|
|
- //stepService.updateStatusByCaseId(StepEnum.COMPLETED.getMsg(),StepPropertyEnum.REPAY_PARENT.getLabel(),caseId);
|
|
|
- stepService.updateStatusByCaseId(StepEnum.COMPLETED.getMsg(),StepPropertyEnum.REPAYMENT_COMPLETE.getLabel(),caseId);
|
|
|
+ @GetMapping("/caseDetails")
|
|
|
+ @ApiOperation("显示业务终结详情")//
|
|
|
+ @PreAuthorize("@pms.hasAnyRoles('SYSTEM_ADMIN','APPROVER','LEAD_SALES','FINANCE', 'ASSIST_SALES','BACK_OFFICE')")
|
|
|
+ public Result getCompleteDetails(@RequestParam Long caseId) {
|
|
|
+ if (caseId == null || !loanService.existsByIdAndIsDelete(caseId))
|
|
|
+ throw new DescribeException(PROJECT_NOT_EXIST);
|
|
|
|
|
|
- stepService.tryStartStep(StepPropertyEnum.REPAYMENT_COMPLETE.getLabel(),caseId);
|
|
|
- return ResultUtil.success("success");
|
|
|
+ return ResultUtil.success("success", repaymentService.getCompleteDetails(caseId));
|
|
|
}
|
|
|
|
|
|
@PostMapping("/caseComplete")
|
|
|
@ApiOperation(value = "业务完成")
|
|
|
@PreAuthorize("@pms.hasAnyRoles('BACK_OFFICE')")
|
|
|
- public Result loanCaseComplete(@RequestParam Long caseId) {
|
|
|
- if(caseId==null || !loanService.existsByIdAndIsDelete(caseId))
|
|
|
+ public Result loanCaseComplete(@RequestParam Long caseId, @RequestParam Boolean isCancel, @RequestBody Map<String, String> pawnList) {
|
|
|
+ if (caseId == null || !loanService.existsByIdAndIsDelete(caseId))
|
|
|
throw new DescribeException(ExceptionEnum.PROJECT_NOT_EXIST);
|
|
|
|
|
|
- StepVO stepVO = stepService.findByStepNameAndCaseId(StepPropertyEnum.CASE_COMPLETE.getLabel(),caseId);
|
|
|
- if(ObjectUtils.isEmpty(stepVO)||!stepVO.getStatus().equals(StepEnum.PROCESS.getMsg()))
|
|
|
- throw new DescribeException(STEP_HAS_NOT_PROCESS);
|
|
|
+ if (isCancel)
|
|
|
+ loanService.loanCaseComplete(caseId, true, pawnList);
|
|
|
|
|
|
- StepVO stepVO1 = stepService.findByStepNameAndCaseId(StepPropertyEnum.FINANCE_CONFIRM.getLabel(), caseId);
|
|
|
- if(ObjectUtils.isEmpty(stepVO1)||!stepVO1.getStatus().equals(StepEnum.COMPLETED.getMsg()))
|
|
|
- throw new DescribeException(PRE_STEP_NOT_COMPLETE);
|
|
|
+ StepVO stepVO = stepService.findByStepCodeAndCaseId(StepPropertyEnum.CASE_COMPLETE.getCode(), caseId);
|
|
|
+ if (ObjectUtils.isEmpty(stepVO) || !stepVO.getStatus().equals(StepEnum.PROCESS.getMsg()))
|
|
|
+ throw new DescribeException(STEP_HAS_NOT_PROCESS);
|
|
|
|
|
|
- //设置业务状态
|
|
|
- loanService.updateIsCompleteByCaseId(DecisionEnum.COMPLETE.getMsg(),caseId);
|
|
|
+ if (stepVO.getUserId1() != null && !BaseContext.getCurrentId().equals(stepVO.getUserId1()))
|
|
|
+ throw new DescribeException(STEP_USER_NOT_EXPECTED);
|
|
|
|
|
|
- stepService.updateUserId1ByCaseIdAndStepName(StepPropertyEnum.CASE_COMPLETE.getLabel(),BaseContext.getCurrentId(), caseId);
|
|
|
- stepService.updateStatusByCaseId(StepEnum.COMPLETED.getMsg(),StepPropertyEnum.REPAY_PARENT.getLabel(),caseId);
|
|
|
- stepService.updateStatusByCaseId(StepEnum.COMPLETED.getMsg(),StepPropertyEnum.CASE_COMPLETE.getLabel(),caseId);
|
|
|
+ //设置业务状态 TODO:撤销,防止误判
|
|
|
+ loanService.loanCaseComplete(caseId, isCancel, pawnList);
|
|
|
|
|
|
- stepService.tryStartStep(StepPropertyEnum.CASE_COMPLETE.getLabel(),caseId);
|
|
|
return ResultUtil.success("success");
|
|
|
}
|
|
|
|
|
|
|
|
|
- //TODO:因为现在是一审一批,所以仅最后一笔金额可能是未通过
|
|
|
-// private Boolean isCleared(Long caseId,String stepName){
|
|
|
-// Repayment repayment = repaymentService.findByCaseIdAndIsDelete(caseId, false);
|
|
|
-// //获取回款记录
|
|
|
-// List<RepaymentRecord> repaymentRecords = repaymentRecordService.findByRepaymentIdAndIsDelete(repayment.getId(), false);
|
|
|
-// Double totalAmount = repaymentService.findByCaseIdAndIsDelete(caseId, false).getTotalAmount();
|
|
|
-//
|
|
|
-// Double currentAmount= 0.0;
|
|
|
-// if(stepName.equals(StepPropertyEnum.REPAY_START.getLabel())){
|
|
|
-// //不计算最后一次,因为最后一次一定未审批
|
|
|
-// totalAmount-= repaymentRecords.get(repaymentRecords.size()-1).getAmount();
|
|
|
-// for (int i=0;i<repaymentRecords.size()-1;i++){
|
|
|
-// RepaymentRecord repaymentRecord = repaymentRecords.get(i);
|
|
|
-// if(repaymentRecord.getApprovalDecision().equals(DecisionEnum.PASS.getMsg())&&!repaymentRecord.getIsInterest())//审批、财务环节显示审批通过后的总额
|
|
|
-// currentAmount += repaymentRecord.getAmount();
|
|
|
-// }
|
|
|
-// }else{
|
|
|
-// for (RepaymentRecord repaymentRecord : repaymentRecords)
|
|
|
-// if(repaymentRecord.getApprovalDecision().equals(DecisionEnum.PASS.getMsg())&& !repaymentRecord.getIsInterest())//审批、财务环节显示审批通过后的总额
|
|
|
-// currentAmount += repaymentRecord.getAmount();
|
|
|
-//
|
|
|
-// }
|
|
|
-//
|
|
|
-// return Math.abs(totalAmount-currentAmount)< Double.MIN_VALUE;
|
|
|
-// }
|
|
|
-
|
|
|
}
|