|
@@ -53,9 +53,9 @@ public class LoanServiceImpl implements LoanService {
|
|
|
private final WxService wxService;
|
|
private final WxService wxService;
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
- public List<LoanCaseVO> findLoanCaseByIsComplete(Integer pageNum,Integer pageSize,String isComplete, boolean isDelete) {
|
|
|
|
|
|
|
+ public List<LoanCaseVO> findLoanCaseByIsComplete(Integer pageNum, Integer pageSize, String isComplete, boolean isDelete) {
|
|
|
Pageable pageable = PageRequest.of(pageNum, pageSize);
|
|
Pageable pageable = PageRequest.of(pageNum, pageSize);
|
|
|
- Page<LoanCase> loanCases = loanRepository.findByIsCompleteAndIsDelete(isComplete, isDelete,pageable);
|
|
|
|
|
|
|
+ Page<LoanCase> loanCases = loanRepository.findByIsCompleteAndIsDelete(isComplete, isDelete, pageable);
|
|
|
|
|
|
|
|
return getLoanCaseVO(loanCases.getContent());
|
|
return getLoanCaseVO(loanCases.getContent());
|
|
|
}
|
|
}
|
|
@@ -65,28 +65,25 @@ public class LoanServiceImpl implements LoanService {
|
|
|
LoanCase loanCase = new LoanCase();
|
|
LoanCase loanCase = new LoanCase();
|
|
|
loanCase.setCustomerId(customerId);
|
|
loanCase.setCustomerId(customerId);
|
|
|
loanCase.setIsComplete(DecisionEnum.PROCESS.getMsg());
|
|
loanCase.setIsComplete(DecisionEnum.PROCESS.getMsg());
|
|
|
- loanCase.setCreateTime(LocalDateTime.now()
|
|
|
|
|
- .format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
|
|
|
|
|
- loanCase.setUpdateTime(LocalDateTime.now()
|
|
|
|
|
- .format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
|
|
|
|
|
|
|
+ loanCase.setCreateTime(LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
|
|
|
|
|
+ loanCase.setUpdateTime(LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
|
|
|
loanCase.setIsDelete(false);
|
|
loanCase.setIsDelete(false);
|
|
|
|
|
|
|
|
return BeanUtil.copyProperties(loanRepository.save(loanCase), LoanCaseVO.class);
|
|
return BeanUtil.copyProperties(loanRepository.save(loanCase), LoanCaseVO.class);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
- public void updateLoanCaseById(LoanCaseDTO loanCaseDTO,Long customerId1,Long customerId2, Long caseId) {
|
|
|
|
|
|
|
+ public void updateLoanCaseById(LoanCaseDTO loanCaseDTO, Long customerId1, Long customerId2, Long caseId) {
|
|
|
LoanCase loanCase = BeanUtil.copyProperties(loanCaseDTO, LoanCase.class);
|
|
LoanCase loanCase = BeanUtil.copyProperties(loanCaseDTO, LoanCase.class);
|
|
|
loanCase.setOtherId1(customerId1);
|
|
loanCase.setOtherId1(customerId1);
|
|
|
loanCase.setOtherId2(customerId2);
|
|
loanCase.setOtherId2(customerId2);
|
|
|
|
|
|
|
|
loanCase.setIsComplete(DecisionEnum.PROCESS.getMsg());
|
|
loanCase.setIsComplete(DecisionEnum.PROCESS.getMsg());
|
|
|
- loanCase.setUpdateTime(LocalDateTime.now()
|
|
|
|
|
- .format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
|
|
|
|
|
|
|
+ loanCase.setUpdateTime(LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
|
|
|
|
|
|
|
|
|
|
|
|
|
- loanRepository.updateLoanCaseById(loanCase,caseId);
|
|
|
|
|
- loanRepository.updateCustomersById(customerId1,customerId2,caseId);
|
|
|
|
|
|
|
+ loanRepository.updateLoanCaseById(loanCase, caseId);
|
|
|
|
|
+ loanRepository.updateCustomersById(customerId1, customerId2, caseId);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@@ -95,18 +92,17 @@ public class LoanServiceImpl implements LoanService {
|
|
|
LoanCase loanCase = loanRepository.findLoanCaseById(caseId, false);
|
|
LoanCase loanCase = loanRepository.findLoanCaseById(caseId, false);
|
|
|
LoanCaseVO loanCaseVO = BeanUtil.copyProperties(loanCase, LoanCaseVO.class);
|
|
LoanCaseVO loanCaseVO = BeanUtil.copyProperties(loanCase, LoanCaseVO.class);
|
|
|
//2.获取客户信息
|
|
//2.获取客户信息
|
|
|
- loanCaseVO.setCustomer(customerService.findByCustomerIdAndIsDelete(loanCase.getCustomerId(),false));
|
|
|
|
|
|
|
+ loanCaseVO.setCustomer(customerService.findByCustomerIdAndIsDelete(loanCase.getCustomerId(), false));
|
|
|
//3.获取合同信息
|
|
//3.获取合同信息
|
|
|
RedisData redisData = new RedisData(stringRedisTemplate);
|
|
RedisData redisData = new RedisData(stringRedisTemplate);
|
|
|
List<Contract> contracts = redisData.getContracts(caseId);
|
|
List<Contract> contracts = redisData.getContracts(caseId);
|
|
|
List<ContractVO> contractVOS = new ArrayList<>();
|
|
List<ContractVO> contractVOS = new ArrayList<>();
|
|
|
- if(ObjectUtils.isEmpty(contracts))
|
|
|
|
|
- contractVOS = contractService.findContractByCaseId(caseId);
|
|
|
|
|
- else{
|
|
|
|
|
- for (Contract contract : contracts){
|
|
|
|
|
|
|
+ if (ObjectUtils.isEmpty(contracts)) contractVOS = contractService.findContractByCaseId(caseId);
|
|
|
|
|
+ else {
|
|
|
|
|
+ for (Contract contract : contracts) {
|
|
|
ContractVO contractVO = BeanUtil.copyProperties(contract, ContractVO.class);
|
|
ContractVO contractVO = BeanUtil.copyProperties(contract, ContractVO.class);
|
|
|
Customer customer = customerService.findByIdAndIsDelete(contract.getCustomerId());
|
|
Customer customer = customerService.findByIdAndIsDelete(contract.getCustomerId());
|
|
|
- contractVO.setCustomerName(customer != null?customer.getName():"");
|
|
|
|
|
|
|
+ contractVO.setCustomerName(customer != null ? customer.getName() : "");
|
|
|
|
|
|
|
|
contractVOS.add(contractVO);
|
|
contractVOS.add(contractVO);
|
|
|
}
|
|
}
|
|
@@ -114,23 +110,22 @@ public class LoanServiceImpl implements LoanService {
|
|
|
loanCaseVO.setContracts(contractVOS);
|
|
loanCaseVO.setContracts(contractVOS);
|
|
|
//4.获取押品信息
|
|
//4.获取押品信息
|
|
|
List<CollateralVO> collaterals = redisData.getCollaterals(caseId);
|
|
List<CollateralVO> collaterals = redisData.getCollaterals(caseId);
|
|
|
- if(ObjectUtils.isEmpty(collaterals))
|
|
|
|
|
- collaterals = collateralService.findByCaseId(caseId);
|
|
|
|
|
|
|
+ if (ObjectUtils.isEmpty(collaterals)) collaterals = collateralService.findByCaseId(caseId);
|
|
|
loanCaseVO.setCollateral(collaterals);
|
|
loanCaseVO.setCollateral(collaterals);
|
|
|
//5.获取合同押品关联信息
|
|
//5.获取合同押品关联信息
|
|
|
- List<ContractAndCollateral> contractAndCollaterals =redisData.getContractAndCollateral(caseId);
|
|
|
|
|
|
|
+ List<ContractAndCollateral> contractAndCollaterals = redisData.getContractAndCollateral(caseId);
|
|
|
if (ObjectUtils.isEmpty(contractAndCollaterals))
|
|
if (ObjectUtils.isEmpty(contractAndCollaterals))
|
|
|
contractAndCollaterals = contractAndCollateralService.findContractAndCollateralByCaseId(caseId);
|
|
contractAndCollaterals = contractAndCollateralService.findContractAndCollateralByCaseId(caseId);
|
|
|
- List<Map<Long,List<Long>>> relations = new ArrayList<>();
|
|
|
|
|
|
|
+ List<Map<Long, List<Long>>> relations = new ArrayList<>();
|
|
|
|
|
|
|
|
- Map<Long,List<Long>> relation = new java.util.HashMap<>();
|
|
|
|
|
|
|
+ Map<Long, List<Long>> relation = new java.util.HashMap<>();
|
|
|
List<Long> collateralIds = new ArrayList<>();
|
|
List<Long> collateralIds = new ArrayList<>();
|
|
|
- int j=0;
|
|
|
|
|
- for(int i=0; i < contractAndCollaterals.size() && j < contractVOS.size(); i++) {
|
|
|
|
|
|
|
+ int j = 0;
|
|
|
|
|
+ for (int i = 0; i < contractAndCollaterals.size() && j < contractVOS.size(); i++) {
|
|
|
if (contractAndCollaterals.get(i).getContractId().equals(contractVOS.get(j).getId())) {
|
|
if (contractAndCollaterals.get(i).getContractId().equals(contractVOS.get(j).getId())) {
|
|
|
collateralIds.add(contractAndCollaterals.get(i).getCollateralId());
|
|
collateralIds.add(contractAndCollaterals.get(i).getCollateralId());
|
|
|
- }else {
|
|
|
|
|
- relation.put(contractVOS.get(j).getId(),collateralIds);
|
|
|
|
|
|
|
+ } else {
|
|
|
|
|
+ relation.put(contractVOS.get(j).getId(), collateralIds);
|
|
|
relations.add(relation);
|
|
relations.add(relation);
|
|
|
j++;
|
|
j++;
|
|
|
relation = new java.util.HashMap<>();
|
|
relation = new java.util.HashMap<>();
|
|
@@ -139,19 +134,17 @@ public class LoanServiceImpl implements LoanService {
|
|
|
loanCaseVO.setCollateralAndContract(relations);
|
|
loanCaseVO.setCollateralAndContract(relations);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- if(j < contractVOS.size()){
|
|
|
|
|
- relation.put(contractVOS.get(j).getId(),collateralIds);
|
|
|
|
|
|
|
+ if (j < contractVOS.size()) {
|
|
|
|
|
+ relation.put(contractVOS.get(j).getId(), collateralIds);
|
|
|
relations.add(relation);
|
|
relations.add(relation);
|
|
|
loanCaseVO.setCollateralAndContract(relations);
|
|
loanCaseVO.setCollateralAndContract(relations);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//5.获取其它客户信息
|
|
//5.获取其它客户信息
|
|
|
- CustomerVO customerOther1 = customerService.findByCustomerIdAndIsDelete(loanCase.getOtherId1(),false);
|
|
|
|
|
- if(!ObjectUtils.isEmpty(customerOther1))
|
|
|
|
|
- loanCaseVO.setCustomers1(customerOther1);
|
|
|
|
|
|
|
+ CustomerVO customerOther1 = customerService.findByCustomerIdAndIsDelete(loanCase.getOtherId1(), false);
|
|
|
|
|
+ if (!ObjectUtils.isEmpty(customerOther1)) loanCaseVO.setCustomers1(customerOther1);
|
|
|
CustomerVO customerOther2 = customerService.findByCustomerIdAndIsDelete(loanCase.getOtherId2(), false);
|
|
CustomerVO customerOther2 = customerService.findByCustomerIdAndIsDelete(loanCase.getOtherId2(), false);
|
|
|
- if(!ObjectUtils.isEmpty(customerOther2))
|
|
|
|
|
- loanCaseVO.setCustomers2(customerOther2);
|
|
|
|
|
|
|
+ if (!ObjectUtils.isEmpty(customerOther2)) loanCaseVO.setCustomers2(customerOther2);
|
|
|
|
|
|
|
|
//6.获取附件信息
|
|
//6.获取附件信息
|
|
|
loanCaseVO.setDocuments(BeanUtil.copyToList(documentService.findByCaseId(caseId), DocumentVO.class));
|
|
loanCaseVO.setDocuments(BeanUtil.copyToList(documentService.findByCaseId(caseId), DocumentVO.class));
|
|
@@ -160,7 +153,7 @@ public class LoanServiceImpl implements LoanService {
|
|
|
loanCaseVO.setRecommender(BeanUtil.copyProperties(recommender.getRecommenderById(loanCase.getRecommenderId()), BizRecommenderVO.class));
|
|
loanCaseVO.setRecommender(BeanUtil.copyProperties(recommender.getRecommenderById(loanCase.getRecommenderId()), BizRecommenderVO.class));
|
|
|
|
|
|
|
|
//8.获取驳回意见
|
|
//8.获取驳回意见
|
|
|
- loanCaseVO.setRejectComment(redisData.getRejectApprovalRecord(caseId,StepPropertyEnum.BUSINESS_ACCEPT.getLabel(),StepPropertyEnum.BUSINESS_ACCEPT.getCode()));
|
|
|
|
|
|
|
+ loanCaseVO.setRejectComment(redisData.getRejectApprovalRecord(caseId, StepPropertyEnum.BUSINESS_ACCEPT.getLabel(), StepPropertyEnum.BUSINESS_ACCEPT.getCode()));
|
|
|
|
|
|
|
|
return loanCaseVO;
|
|
return loanCaseVO;
|
|
|
}
|
|
}
|
|
@@ -171,17 +164,18 @@ public class LoanServiceImpl implements LoanService {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
- public void updateUpdatetimeByIdAndIsDeleted(Long id,boolean isDelete){
|
|
|
|
|
- loanRepository.updateUpdatetimeByIdAndIsDeleted(id,false, LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
|
|
|
|
|
|
|
+ public void updateUpdatetimeByIdAndIsDeleted(Long id, boolean isDelete) {
|
|
|
|
|
+ loanRepository.updateUpdatetimeByIdAndIsDeleted(id, false, LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
@Override
|
|
@Override
|
|
|
- public void logic_delete(Long id){
|
|
|
|
|
|
|
+ public void logic_delete(Long id) {
|
|
|
loanRepository.logic_delete(id, true, LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
|
|
loanRepository.logic_delete(id, true, LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public LoanCaseSimpleVO findLoanCaseSimpleByIdAndIsDelete(Long caseId, boolean isDelete) {
|
|
public LoanCaseSimpleVO findLoanCaseSimpleByIdAndIsDelete(Long caseId, boolean isDelete) {
|
|
|
- return BeanUtil.copyProperties(loanRepository.findLoanCaseById(caseId, isDelete),LoanCaseSimpleVO.class);
|
|
|
|
|
|
|
+ return BeanUtil.copyProperties(loanRepository.findLoanCaseById(caseId, isDelete), LoanCaseSimpleVO.class);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@@ -190,7 +184,7 @@ public class LoanServiceImpl implements LoanService {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
- public List<LoanCaseVO> findLoanCaseByCustomerIds(List<Long> customerIds, Integer pageNum, Integer pageSize,String isComplete, boolean isDelete) {
|
|
|
|
|
|
|
+ public List<LoanCaseVO> findLoanCaseByCustomerIds(List<Long> customerIds, Integer pageNum, Integer pageSize, String isComplete, boolean isDelete) {
|
|
|
Pageable pageable = PageRequest.of(pageNum, pageSize);
|
|
Pageable pageable = PageRequest.of(pageNum, pageSize);
|
|
|
Page<LoanCase> page = loanRepository.findLoanCaseByCustomerIds(customerIds, pageable, isComplete, isDelete);
|
|
Page<LoanCase> page = loanRepository.findLoanCaseByCustomerIds(customerIds, pageable, isComplete, isDelete);
|
|
|
|
|
|
|
@@ -200,7 +194,7 @@ public class LoanServiceImpl implements LoanService {
|
|
|
@Override
|
|
@Override
|
|
|
public List<LoanCaseVO> findLoanCaseByCustomerIds(List<Long> customerIds, Integer pageNum, Integer pageSize, boolean isDelete) {
|
|
public List<LoanCaseVO> findLoanCaseByCustomerIds(List<Long> customerIds, Integer pageNum, Integer pageSize, boolean isDelete) {
|
|
|
Pageable pageable = PageRequest.of(pageNum, pageSize);
|
|
Pageable pageable = PageRequest.of(pageNum, pageSize);
|
|
|
- Page<LoanCase> page = loanRepository.findLoanCaseByCustomerIds(customerIds, pageable,isDelete);
|
|
|
|
|
|
|
+ Page<LoanCase> page = loanRepository.findLoanCaseByCustomerIds(customerIds, pageable, isDelete);
|
|
|
|
|
|
|
|
return getLoanCaseVO(page.getContent());
|
|
return getLoanCaseVO(page.getContent());
|
|
|
}
|
|
}
|
|
@@ -208,7 +202,7 @@ public class LoanServiceImpl implements LoanService {
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public List<Long> findIdsByIsComplete(String isComplete, boolean isDelete) {
|
|
public List<Long> findIdsByIsComplete(String isComplete, boolean isDelete) {
|
|
|
- return loanRepository.findIdsByIsCompleteAndIsDelete(isComplete,isDelete);
|
|
|
|
|
|
|
+ return loanRepository.findIdsByIsCompleteAndIsDelete(isComplete, isDelete);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@@ -222,18 +216,18 @@ public class LoanServiceImpl implements LoanService {
|
|
|
@Override
|
|
@Override
|
|
|
public void updateIsCompleteByCaseId(String msg, Long caseId) {
|
|
public void updateIsCompleteByCaseId(String msg, Long caseId) {
|
|
|
String updateTime = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
|
|
String updateTime = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
|
|
|
- loanRepository.updateIsCompleteByCaseId(msg, caseId,updateTime);
|
|
|
|
|
|
|
+ loanRepository.updateIsCompleteByCaseId(msg, caseId, updateTime);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public List<LoanCaseSimpleVO> findLoanCaseSimpleByIsComplete(String msg) {
|
|
public List<LoanCaseSimpleVO> findLoanCaseSimpleByIsComplete(String msg) {
|
|
|
- return BeanUtil.copyToList(loanRepository.findLoanSimpleByIsCompleteAndIsDelete(msg,false),LoanCaseSimpleVO.class);
|
|
|
|
|
|
|
+ return BeanUtil.copyToList(loanRepository.findLoanSimpleByIsCompleteAndIsDelete(msg, false), LoanCaseSimpleVO.class);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public List<LoanCaseVO> findLoanCaseAll(Integer pageNum, Integer pageSize, boolean isDelete) {
|
|
public List<LoanCaseVO> findLoanCaseAll(Integer pageNum, Integer pageSize, boolean isDelete) {
|
|
|
Pageable pageable = PageRequest.of(pageNum, pageSize);
|
|
Pageable pageable = PageRequest.of(pageNum, pageSize);
|
|
|
- Page<LoanCase> page = loanRepository.findByIsDelete(isDelete,pageable);
|
|
|
|
|
|
|
+ Page<LoanCase> page = loanRepository.findByIsDelete(isDelete, pageable);
|
|
|
|
|
|
|
|
return getLoanCaseVO(page.getContent());
|
|
return getLoanCaseVO(page.getContent());
|
|
|
}
|
|
}
|
|
@@ -252,26 +246,25 @@ public class LoanServiceImpl implements LoanService {
|
|
|
List<LoanCase> complete = loanRepository.findLoanCaseBetweenRangeAndIsDeleteAndComplete(begin, end, DecisionEnum.COMPLETE.getMsg(), false);
|
|
List<LoanCase> complete = loanRepository.findLoanCaseBetweenRangeAndIsDeleteAndComplete(begin, end, DecisionEnum.COMPLETE.getMsg(), false);
|
|
|
List<LoanCase> process = loanRepository.findLoanCaseBetweenRangeAndIsDeleteAndProcess(end, DecisionEnum.PROCESS.getMsg(), false);
|
|
List<LoanCase> process = loanRepository.findLoanCaseBetweenRangeAndIsDeleteAndProcess(end, DecisionEnum.PROCESS.getMsg(), false);
|
|
|
//合并两个列表
|
|
//合并两个列表
|
|
|
- List<LoanCase> allLoanCases = Stream.concat(complete.stream(), process.stream())
|
|
|
|
|
- .collect(Collectors.toList());
|
|
|
|
|
|
|
+ List<LoanCase> allLoanCases = Stream.concat(complete.stream(), process.stream()).collect(Collectors.toList());
|
|
|
return BeanUtil.copyToList(allLoanCases, LoanCaseSimpleVO.class);
|
|
return BeanUtil.copyToList(allLoanCases, LoanCaseSimpleVO.class);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public List<LoanCaseVO> listLoanCaseByIsComplete(String isComplete) {
|
|
public List<LoanCaseVO> listLoanCaseByIsComplete(String isComplete) {
|
|
|
- return getLoanCaseVO(loanRepository.listLoanCaseByIsCompleteAndIsDelete(isComplete,false));
|
|
|
|
|
|
|
+ return getLoanCaseVO(loanRepository.listLoanCaseByIsCompleteAndIsDelete(isComplete, false));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-//TODO:controller使用
|
|
|
|
|
|
|
+ //TODO:controller使用
|
|
|
@Override
|
|
@Override
|
|
|
public List<LoanCaseVO> listLoanCaseByStepCode(Integer stepCode) {
|
|
public List<LoanCaseVO> listLoanCaseByStepCode(Integer stepCode) {
|
|
|
//根据角色返回业务列表,业务员返回全部未完成、审批员与财务员仅展示未审批或未财务审批的人物
|
|
//根据角色返回业务列表,业务员返回全部未完成、审批员与财务员仅展示未审批或未财务审批的人物
|
|
|
- List<Long> loanCaseIds = loanRepository.findIdsByIsCompleteAndIsDelete(DecisionEnum.PROCESS.getMsg(),false);
|
|
|
|
|
|
|
+ List<Long> loanCaseIds = loanRepository.findIdsByIsCompleteAndIsDelete(DecisionEnum.PROCESS.getMsg(), false);
|
|
|
List<Long> ids = new ArrayList<>();
|
|
List<Long> ids = new ArrayList<>();
|
|
|
- List<StepVO> currentSteps=new ArrayList<>();
|
|
|
|
|
|
|
+ List<StepVO> currentSteps = new ArrayList<>();
|
|
|
List<LoanCaseVO> loanCaseVOS = new ArrayList<>();
|
|
List<LoanCaseVO> loanCaseVOS = new ArrayList<>();
|
|
|
|
|
|
|
|
- for(Long caseId : loanCaseIds){
|
|
|
|
|
|
|
+ for (Long caseId : loanCaseIds) {
|
|
|
List<StepVO> steps = stepService.getStepByCaseId(caseId);
|
|
List<StepVO> steps = stepService.getStepByCaseId(caseId);
|
|
|
|
|
|
|
|
StepVO processStep = null;//受理环节
|
|
StepVO processStep = null;//受理环节
|
|
@@ -281,39 +274,38 @@ public class LoanServiceImpl implements LoanService {
|
|
|
StepVO pushStep2 = null;
|
|
StepVO pushStep2 = null;
|
|
|
boolean flag = false;
|
|
boolean flag = false;
|
|
|
for (StepVO step : steps) {
|
|
for (StepVO step : steps) {
|
|
|
- if (step.getParentCode()==0 )
|
|
|
|
|
- continue;
|
|
|
|
|
|
|
+ if (step.getParentCode() == 0) continue;
|
|
|
|
|
|
|
|
//同一用户只能以一个角色处理同一单业务:如果当前环节是第二个角色处理过该单业务,则跳过(true)
|
|
//同一用户只能以一个角色处理同一单业务:如果当前环节是第二个角色处理过该单业务,则跳过(true)
|
|
|
// flag=stepService.hasRolesInCase(caseId,BaseContext.getCurrentId(),step.getCode());
|
|
// flag=stepService.hasRolesInCase(caseId,BaseContext.getCurrentId(),step.getCode());
|
|
|
|
|
|
|
|
//只保存正在处理的
|
|
//只保存正在处理的
|
|
|
- Step parent = stepService.findStepByCodeAndCaseId(step.getParentCode(),caseId);
|
|
|
|
|
- if (step.getStatus().equals(StepEnum.PROCESS.getMsg())&&parent.getCode().equals(stepCode)&&!flag) {
|
|
|
|
|
- if (step.getCode().equals(StepPropertyEnum.CASE_COMPLETE.getCode())){//仅显示结清(回款完成)的”业务终结“环节
|
|
|
|
|
|
|
+ Step parent = stepService.findStepByCodeAndCaseId(step.getParentCode(), caseId);
|
|
|
|
|
+ if (step.getStatus().equals(StepEnum.PROCESS.getMsg()) && parent.getCode().equals(stepCode) && !flag) {
|
|
|
|
|
+ if (step.getCode().equals(StepPropertyEnum.CASE_COMPLETE.getCode())) {//仅显示结清(回款完成)的”业务终结“环节
|
|
|
Step step1 = stepService.findStepByCodeAndCaseId(StepPropertyEnum.BALANCE_REPAY.getCode(), caseId);
|
|
Step step1 = stepService.findStepByCodeAndCaseId(StepPropertyEnum.BALANCE_REPAY.getCode(), caseId);
|
|
|
- if (step1!=null && step1.getStatus().equals(StepEnum.COMPLETED.getMsg())){
|
|
|
|
|
|
|
+ if (step1 != null && step1.getStatus().equals(StepEnum.COMPLETED.getMsg())) {
|
|
|
currentSteps.add(step);
|
|
currentSteps.add(step);
|
|
|
ids.add(step.getCaseId());
|
|
ids.add(step.getCaseId());
|
|
|
}
|
|
}
|
|
|
- }else{
|
|
|
|
|
|
|
+ } else {
|
|
|
currentSteps.add(step);
|
|
currentSteps.add(step);
|
|
|
ids.add(step.getCaseId());
|
|
ids.add(step.getCaseId());
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//业务受理环节显示未审批的业务
|
|
//业务受理环节显示未审批的业务
|
|
|
- if (stepCode.equals(StepPropertyEnum.BUSINESS_ACCEPT_PARENT.getCode())){
|
|
|
|
|
- if(step.getCode().equals(StepPropertyEnum.BUSINESS_ACCEPT.getCode())&&step.getStatus().equals(StepEnum.COMPLETED.getMsg()))
|
|
|
|
|
|
|
+ if (stepCode.equals(StepPropertyEnum.BUSINESS_ACCEPT_PARENT.getCode())) {
|
|
|
|
|
+ if (step.getCode().equals(StepPropertyEnum.BUSINESS_ACCEPT.getCode()) && step.getStatus().equals(StepEnum.COMPLETED.getMsg()))
|
|
|
processStep = step;
|
|
processStep = step;
|
|
|
// if(step.getCode().equals(StepPropertyEnum.PRE_TRIAL.getCode())&&!step.getStatus().equals(StepEnum.UNSTART.getMsg()))
|
|
// if(step.getCode().equals(StepPropertyEnum.PRE_TRIAL.getCode())&&!step.getStatus().equals(StepEnum.UNSTART.getMsg()))
|
|
|
// preTrialStep = step;
|
|
// preTrialStep = step;
|
|
|
- if (!step.getStatus().equals(StepEnum.COMPLETED.getMsg())&&step.getCode().equals(StepPropertyEnum.APPROVAL.getCode())){
|
|
|
|
|
- if (processStep!=null){
|
|
|
|
|
- currentSteps.add( processStep);
|
|
|
|
|
- ids.add(processStep.getCaseId());
|
|
|
|
|
- processStep = null;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ if (!step.getStatus().equals(StepEnum.COMPLETED.getMsg()) && step.getCode().equals(StepPropertyEnum.APPROVAL.getCode())) {
|
|
|
|
|
+ if (processStep != null) {
|
|
|
|
|
+ currentSteps.add(processStep);
|
|
|
|
|
+ ids.add(processStep.getCaseId());
|
|
|
|
|
+ processStep = null;
|
|
|
|
|
+ }
|
|
|
// if (preTrialStep!=null){
|
|
// if (preTrialStep!=null){
|
|
|
// currentSteps.add(preTrialStep);
|
|
// currentSteps.add(preTrialStep);
|
|
|
// ids.add(preTrialStep.getCaseId());
|
|
// ids.add(preTrialStep.getCaseId());
|
|
@@ -323,15 +315,15 @@ public class LoanServiceImpl implements LoanService {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//保留取证至回款前
|
|
//保留取证至回款前
|
|
|
- if(stepCode.equals(StepPropertyEnum.COLLATERAL_RECEIVE.getCode())){
|
|
|
|
|
- if(step.getCode().equals(StepPropertyEnum.PLAN_SUBMISSION.getCode())&&step.getStatus().equals(StepEnum.COMPLETED.getMsg())&&step.getUserId1()!=null)
|
|
|
|
|
|
|
+ if (stepCode.equals(StepPropertyEnum.COLLATERAL_RECEIVE.getCode())) {
|
|
|
|
|
+ if (step.getCode().equals(StepPropertyEnum.PLAN_SUBMISSION.getCode()) && step.getStatus().equals(StepEnum.COMPLETED.getMsg()) && step.getUserId1() != null)
|
|
|
receiveStep = step;
|
|
receiveStep = step;
|
|
|
|
|
|
|
|
// if(step.getCode().equals(StepPropertyEnum.CHANNEL_PUSH.getCode())&&step.getStatus().equals(StepEnum.COMPLETED.getMsg())&&step.getUserId1()!=null)
|
|
// if(step.getCode().equals(StepPropertyEnum.CHANNEL_PUSH.getCode())&&step.getStatus().equals(StepEnum.COMPLETED.getMsg())&&step.getUserId1()!=null)
|
|
|
// pushStep1 = step;
|
|
// pushStep1 = step;
|
|
|
|
|
|
|
|
- if (step.getCode().equals(StepPropertyEnum.APPROVAL_ASSIGNMENT_2.getCode())&&step.getStatus().equals(StepEnum.UNSTART.getMsg())){
|
|
|
|
|
- if (receiveStep!=null){
|
|
|
|
|
|
|
+ if (step.getCode().equals(StepPropertyEnum.APPROVAL_ASSIGNMENT_2.getCode()) && step.getStatus().equals(StepEnum.UNSTART.getMsg())) {
|
|
|
|
|
+ if (receiveStep != null) {
|
|
|
currentSteps.add(receiveStep);
|
|
currentSteps.add(receiveStep);
|
|
|
ids.add(receiveStep.getCaseId());
|
|
ids.add(receiveStep.getCaseId());
|
|
|
receiveStep = null;
|
|
receiveStep = null;
|
|
@@ -346,27 +338,26 @@ public class LoanServiceImpl implements LoanService {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//保留取证
|
|
//保留取证
|
|
|
- if(stepCode.equals(StepPropertyEnum.COLLATERAL_DELIVERY.getCode())){
|
|
|
|
|
- if(step.getCode().equals(StepPropertyEnum.PLAN_SUBMISSION_2.getCode())&&step.getStatus().equals(StepEnum.COMPLETED.getMsg())&&step.getUserId1()!=null)
|
|
|
|
|
|
|
+ if (stepCode.equals(StepPropertyEnum.COLLATERAL_DELIVERY.getCode())) {
|
|
|
|
|
+ if (step.getCode().equals(StepPropertyEnum.PLAN_SUBMISSION_2.getCode()) && step.getStatus().equals(StepEnum.COMPLETED.getMsg()) && step.getUserId1() != null)
|
|
|
receiveStep = step;
|
|
receiveStep = step;
|
|
|
|
|
|
|
|
// if(step.getCode().equals(StepPropertyEnum.CHANNEL_PUSH_2.getCode())&&step.getStatus().equals(StepEnum.COMPLETED.getMsg())&&step.getUserId1()!=null)
|
|
// if(step.getCode().equals(StepPropertyEnum.CHANNEL_PUSH_2.getCode())&&step.getStatus().equals(StepEnum.COMPLETED.getMsg())&&step.getUserId1()!=null)
|
|
|
// pushStep2 = step;
|
|
// pushStep2 = step;
|
|
|
|
|
|
|
|
- if (step.getCode().equals(StepPropertyEnum.REPAY_APPROVAL.getCode())){
|
|
|
|
|
- if (receiveStep!=null){
|
|
|
|
|
- if(step.getStatus().equals(StepEnum.COMPLETED.getMsg())){
|
|
|
|
|
|
|
+ if (step.getCode().equals(StepPropertyEnum.REPAY_APPROVAL.getCode())) {
|
|
|
|
|
+ if (receiveStep != null) {
|
|
|
|
|
+ if (step.getStatus().equals(StepEnum.COMPLETED.getMsg())) {
|
|
|
// 解析字符串为LocalDateTime
|
|
// 解析字符串为LocalDateTime
|
|
|
- LocalDateTime competeTime = LocalDateTime.parse(step.getUpdateTime(),
|
|
|
|
|
- DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")).plusDays(7);
|
|
|
|
|
|
|
+ LocalDateTime competeTime = LocalDateTime.parse(step.getUpdateTime(), DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")).plusDays(7);
|
|
|
//保留至指派后七天
|
|
//保留至指派后七天
|
|
|
- if (LocalDateTime.now().isBefore(competeTime)){
|
|
|
|
|
|
|
+ if (LocalDateTime.now().isBefore(competeTime)) {
|
|
|
System.out.println(LocalDateTime.now());
|
|
System.out.println(LocalDateTime.now());
|
|
|
currentSteps.add(receiveStep);
|
|
currentSteps.add(receiveStep);
|
|
|
ids.add(receiveStep.getCaseId());
|
|
ids.add(receiveStep.getCaseId());
|
|
|
receiveStep = null;
|
|
receiveStep = null;
|
|
|
}
|
|
}
|
|
|
- }else {
|
|
|
|
|
|
|
+ } else {
|
|
|
//未完成前也需要保存
|
|
//未完成前也需要保存
|
|
|
currentSteps.add(receiveStep);
|
|
currentSteps.add(receiveStep);
|
|
|
ids.add(receiveStep.getCaseId());
|
|
ids.add(receiveStep.getCaseId());
|
|
@@ -401,21 +392,21 @@ public class LoanServiceImpl implements LoanService {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
- for( int i = 0; i < ids.size(); i++){
|
|
|
|
|
|
|
+ for (int i = 0; i < ids.size(); i++) {
|
|
|
LoanCase loanCase = loanRepository.findLoanCaseById(ids.get(i), false);
|
|
LoanCase loanCase = loanRepository.findLoanCaseById(ids.get(i), false);
|
|
|
|
|
|
|
|
Long customerId = loanCase.getCustomerId();
|
|
Long customerId = loanCase.getCustomerId();
|
|
|
- CustomerVO customer = customerService.findByCustomerIdAndIsDelete(customerId,false);
|
|
|
|
|
|
|
+ CustomerVO customer = customerService.findByCustomerIdAndIsDelete(customerId, false);
|
|
|
LoanCaseVO loanCaseVO = BeanUtil.copyProperties(loanCase, LoanCaseVO.class);
|
|
LoanCaseVO loanCaseVO = BeanUtil.copyProperties(loanCase, LoanCaseVO.class);
|
|
|
loanCaseVO.setCustomer(customer);
|
|
loanCaseVO.setCustomer(customer);
|
|
|
// Long userId=stepService.findByStepNameAndCaseId(StepPropertyEnum.BUSINESS_ACCEPT.getCode(), loanCase.getId()).getUserId1();
|
|
// Long userId=stepService.findByStepNameAndCaseId(StepPropertyEnum.BUSINESS_ACCEPT.getCode(), loanCase.getId()).getUserId1();
|
|
|
// loanCaseVO.setUserName(userService.findByIdAndIsDelete(userId).getUsername());
|
|
// loanCaseVO.setUserName(userService.findByIdAndIsDelete(userId).getUsername());
|
|
|
- StepVO stepVO =currentSteps.get( i);
|
|
|
|
|
- if (stepVO.getCode().equals(StepPropertyEnum.BUSINESS_ACCEPT.getCode())&& stepVO.getStatus().equals(StepEnum.COMPLETED.getMsg()))
|
|
|
|
|
|
|
+ StepVO stepVO = currentSteps.get(i);
|
|
|
|
|
+ if (stepVO.getCode().equals(StepPropertyEnum.BUSINESS_ACCEPT.getCode()) && stepVO.getStatus().equals(StepEnum.COMPLETED.getMsg()))
|
|
|
stepVO.setStepName("预审状态");
|
|
stepVO.setStepName("预审状态");
|
|
|
loanCaseVO.setStep(currentSteps.get(i));
|
|
loanCaseVO.setStep(currentSteps.get(i));
|
|
|
User user = userService.findByIdAndIsDelete(currentSteps.get(i).getUserId1());
|
|
User user = userService.findByIdAndIsDelete(currentSteps.get(i).getUserId1());
|
|
|
- if (user!=null){
|
|
|
|
|
|
|
+ if (user != null) {
|
|
|
loanCaseVO.setUserName(user.getRealName());
|
|
loanCaseVO.setUserName(user.getRealName());
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -432,86 +423,85 @@ public class LoanServiceImpl implements LoanService {
|
|
|
//创建流程
|
|
//创建流程
|
|
|
// stepService.addStepByCaseId(loanCase.getId());
|
|
// stepService.addStepByCaseId(loanCase.getId());
|
|
|
List<List<Integer>> seq = StepPropertyEnum.seqList();
|
|
List<List<Integer>> seq = StepPropertyEnum.seqList();
|
|
|
- stepService.addStepByCaseIdAndSequences(loanCase.getId(),seq);
|
|
|
|
|
|
|
+ stepService.addStepByCaseIdAndSequences(loanCase.getId(), seq);
|
|
|
//设置当前处理人
|
|
//设置当前处理人
|
|
|
- stepService.updateUserId1ByCaseIdAndStepCode(StepPropertyEnum.BUSINESS_ADD.getCode(),BaseContext.getCurrentId(),loanCase.getId());
|
|
|
|
|
- stepService.updateStatusByCaseId(StepEnum.COMPLETED.getMsg(), StepPropertyEnum.BUSINESS_ADD.getCode(),loanCase.getId());
|
|
|
|
|
- stepService.tryStartStep(StepPropertyEnum.BUSINESS_ADD.getCode(),loanCase.getId());
|
|
|
|
|
|
|
+ stepService.updateUserId1ByCaseIdAndStepCode(StepPropertyEnum.BUSINESS_ADD.getCode(), BaseContext.getCurrentId(), loanCase.getId());
|
|
|
|
|
+ stepService.updateStatusByCaseId(StepEnum.COMPLETED.getMsg(), StepPropertyEnum.BUSINESS_ADD.getCode(), loanCase.getId());
|
|
|
|
|
+ stepService.tryStartStep(StepPropertyEnum.BUSINESS_ADD.getCode(), loanCase.getId());
|
|
|
|
|
|
|
|
return loanCase;
|
|
return loanCase;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
- public void saveLoanCase(LoanCaseDTO loanCaseDTO, Long caseId, Boolean isComplete,Boolean isSkip) {
|
|
|
|
|
|
|
+ public void saveLoanCase(LoanCaseDTO loanCaseDTO, Long caseId, Boolean isComplete, Boolean isSkip) {
|
|
|
//1.补充业务信息
|
|
//1.补充业务信息
|
|
|
LoanCaseSimpleVO loanCaseSimple = findLoanCaseSimpleByIdAndIsDelete(caseId, false);
|
|
LoanCaseSimpleVO loanCaseSimple = findLoanCaseSimpleByIdAndIsDelete(caseId, false);
|
|
|
Long otherId1 = loanCaseSimple.getOtherId1();//上次状态的借款人id
|
|
Long otherId1 = loanCaseSimple.getOtherId1();//上次状态的借款人id
|
|
|
Long otherId2 = loanCaseSimple.getOtherId2();
|
|
Long otherId2 = loanCaseSimple.getOtherId2();
|
|
|
|
|
|
|
|
//设置旧-新id的映射关系
|
|
//设置旧-新id的映射关系
|
|
|
- Map<Long,Long> customerIdMap = new HashMap<>();
|
|
|
|
|
- customerIdMap.put(loanCaseDTO.getCustomer().getId(),loanCaseDTO.getCustomer().getId());
|
|
|
|
|
|
|
+ Map<Long, Long> customerIdMap = new HashMap<>();
|
|
|
|
|
+ customerIdMap.put(loanCaseDTO.getCustomer().getId(), loanCaseDTO.getCustomer().getId());
|
|
|
//个数不变或新增
|
|
//个数不变或新增
|
|
|
CustomerDTO customers1 = loanCaseDTO.getCustomers1();
|
|
CustomerDTO customers1 = loanCaseDTO.getCustomers1();
|
|
|
Long customerId1 = null;
|
|
Long customerId1 = null;
|
|
|
- if(customers1 != null && customers1.getId()!=null){//对于其它借款人,有数据则传入后端
|
|
|
|
|
|
|
+ if (customers1 != null && customers1.getId() != null) {//对于其它借款人,有数据则传入后端
|
|
|
customerId1 = customers1.getId();
|
|
customerId1 = customers1.getId();
|
|
|
//id<0新增,否则更新
|
|
//id<0新增,否则更新
|
|
|
- if (customers1.getId()<0){
|
|
|
|
|
|
|
+ if (customers1.getId() < 0) {
|
|
|
Customer customer = BeanUtil.copyProperties(customers1, Customer.class);
|
|
Customer customer = BeanUtil.copyProperties(customers1, Customer.class);
|
|
|
customer.setIsRegister(false);
|
|
customer.setIsRegister(false);
|
|
|
Customer customer1 = customerService.addCustomer(customer);
|
|
Customer customer1 = customerService.addCustomer(customer);
|
|
|
customerId1 = customer1.getId();
|
|
customerId1 = customer1.getId();
|
|
|
- }else {
|
|
|
|
|
- customerService.updateUserById(customers1,customers1.getId());
|
|
|
|
|
|
|
+ } else {
|
|
|
|
|
+ customerService.updateUserById(customers1, customers1.getId());
|
|
|
}
|
|
}
|
|
|
- customerIdMap.put(customers1.getId(),customerId1);
|
|
|
|
|
|
|
+ customerIdMap.put(customers1.getId(), customerId1);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
CustomerDTO customers2 = loanCaseDTO.getCustomers2();
|
|
CustomerDTO customers2 = loanCaseDTO.getCustomers2();
|
|
|
Long customerId2 = null;
|
|
Long customerId2 = null;
|
|
|
- if(customers2 != null && customers2.getId()!=null){//对于其它借款人,有数据则传入后端
|
|
|
|
|
|
|
+ if (customers2 != null && customers2.getId() != null) {//对于其它借款人,有数据则传入后端
|
|
|
customerId2 = customers2.getId();
|
|
customerId2 = customers2.getId();
|
|
|
//id<0新增,否则更新
|
|
//id<0新增,否则更新
|
|
|
- if (customers2.getId()<0){
|
|
|
|
|
|
|
+ if (customers2.getId() < 0) {
|
|
|
Customer customer = BeanUtil.copyProperties(customers2, Customer.class);
|
|
Customer customer = BeanUtil.copyProperties(customers2, Customer.class);
|
|
|
customer.setIsRegister(false);
|
|
customer.setIsRegister(false);
|
|
|
Customer customer2 = customerService.addCustomer(customer);
|
|
Customer customer2 = customerService.addCustomer(customer);
|
|
|
customerId2 = customer2.getId();
|
|
customerId2 = customer2.getId();
|
|
|
- }else {
|
|
|
|
|
- customerService.updateUserById(customers2,customers2.getId());
|
|
|
|
|
|
|
+ } else {
|
|
|
|
|
+ customerService.updateUserById(customers2, customers2.getId());
|
|
|
}
|
|
}
|
|
|
- customerIdMap.put(customers2.getId(),customerId2);
|
|
|
|
|
|
|
+ customerIdMap.put(customers2.getId(), customerId2);
|
|
|
}
|
|
}
|
|
|
//个数减少
|
|
//个数减少
|
|
|
- if(otherId1 != null && customerId1 == null){
|
|
|
|
|
|
|
+ if (otherId1 != null && customerId1 == null) {
|
|
|
customerService.deleteById(otherId1);
|
|
customerService.deleteById(otherId1);
|
|
|
}
|
|
}
|
|
|
- if (customerId2 ==null && otherId2 != null){
|
|
|
|
|
|
|
+ if (customerId2 == null && otherId2 != null) {
|
|
|
customerService.deleteById(otherId2);
|
|
customerService.deleteById(otherId2);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- updateLoanCaseById(loanCaseDTO,customerId1,customerId2,caseId);
|
|
|
|
|
|
|
+ updateLoanCaseById(loanCaseDTO, customerId1, customerId2, caseId);
|
|
|
|
|
|
|
|
//2.修改客户信息
|
|
//2.修改客户信息
|
|
|
CustomerDTO customerDTO = loanCaseDTO.getCustomer();
|
|
CustomerDTO customerDTO = loanCaseDTO.getCustomer();
|
|
|
- customerService.updateUserById(customerDTO,customerDTO.getId());
|
|
|
|
|
|
|
+ customerService.updateUserById(customerDTO, customerDTO.getId());
|
|
|
|
|
|
|
|
- for(ContractDTO contractDTO :loanCaseDTO.getContracts()){
|
|
|
|
|
|
|
+ for (ContractDTO contractDTO : loanCaseDTO.getContracts()) {
|
|
|
Long customerId = contractDTO.getCustomerId();
|
|
Long customerId = contractDTO.getCustomerId();
|
|
|
|
|
|
|
|
if (customerIdMap.get(customerId) != null)//由-1变为实际
|
|
if (customerIdMap.get(customerId) != null)//由-1变为实际
|
|
|
contractDTO.setCustomerId(customerIdMap.get(customerId));
|
|
contractDTO.setCustomerId(customerIdMap.get(customerId));
|
|
|
- else
|
|
|
|
|
- contractDTO.setCustomerId(null);
|
|
|
|
|
|
|
+ else contractDTO.setCustomerId(null);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
RedisData redisData = new RedisData(stringRedisTemplate);
|
|
RedisData redisData = new RedisData(stringRedisTemplate);
|
|
|
redisData.delete(caseId);
|
|
redisData.delete(caseId);
|
|
|
- if(!isComplete){//TODO:利用redis保存草稿信息
|
|
|
|
|
- redisData.setLoanCase(caseId,loanCaseDTO);
|
|
|
|
|
|
|
+ if (!isComplete) {//TODO:利用redis保存草稿信息
|
|
|
|
|
+ redisData.setLoanCase(caseId, loanCaseDTO);
|
|
|
|
|
|
|
|
- }else {
|
|
|
|
|
|
|
+ } else {
|
|
|
/*
|
|
/*
|
|
|
//TODO:提交后才真正保存到数据库,并删除原有的草稿
|
|
//TODO:提交后才真正保存到数据库,并删除原有的草稿
|
|
|
因为后续驳回会修改,所以是如果有数据则修改,无数据则新增
|
|
因为后续驳回会修改,所以是如果有数据则修改,无数据则新增
|
|
@@ -519,13 +509,13 @@ public class LoanServiceImpl implements LoanService {
|
|
|
//3.设置合同(若存在则修改)
|
|
//3.设置合同(若存在则修改)
|
|
|
contractService.deleteAllByCaseId(caseId);
|
|
contractService.deleteAllByCaseId(caseId);
|
|
|
List<Contract> contracts = new ArrayList<>();
|
|
List<Contract> contracts = new ArrayList<>();
|
|
|
- for (ContractDTO contractDTO : loanCaseDTO.getContracts()){
|
|
|
|
|
|
|
+ for (ContractDTO contractDTO : loanCaseDTO.getContracts()) {
|
|
|
Long contractId = contractDTO.getId();
|
|
Long contractId = contractDTO.getId();
|
|
|
- if(contractId != null && contractService.existsById(contractId)){
|
|
|
|
|
|
|
+ if (contractId != null && contractService.existsById(contractId)) {
|
|
|
//修改合同
|
|
//修改合同
|
|
|
- contractService.updateContractById(contractId,contractDTO,false);
|
|
|
|
|
- contracts.add(BeanUtil.copyProperties(contractDTO,Contract.class));
|
|
|
|
|
- }else {
|
|
|
|
|
|
|
+ contractService.updateContractById(contractId, contractDTO, false);
|
|
|
|
|
+ contracts.add(BeanUtil.copyProperties(contractDTO, Contract.class));
|
|
|
|
|
+ } else {
|
|
|
//新增合同(若为负数,表示不存在)
|
|
//新增合同(若为负数,表示不存在)
|
|
|
Contract contract = contractService.saveContract(contractDTO);
|
|
Contract contract = contractService.saveContract(contractDTO);
|
|
|
contracts.add(contract);
|
|
contracts.add(contract);
|
|
@@ -535,12 +525,12 @@ public class LoanServiceImpl implements LoanService {
|
|
|
//4.设置押品
|
|
//4.设置押品
|
|
|
collateralService.deleteAllByCaseId(caseId);
|
|
collateralService.deleteAllByCaseId(caseId);
|
|
|
List<Long> collateralIds = new ArrayList<>();
|
|
List<Long> collateralIds = new ArrayList<>();
|
|
|
- for(CollateralDTO collateralDTO : loanCaseDTO.getCollateral()){
|
|
|
|
|
|
|
+ for (CollateralDTO collateralDTO : loanCaseDTO.getCollateral()) {
|
|
|
Long collateralId = collateralDTO.getId();
|
|
Long collateralId = collateralDTO.getId();
|
|
|
- if(collateralId != null && collateralService.existsById(collateralId)){
|
|
|
|
|
|
|
+ if (collateralId != null && collateralService.existsById(collateralId)) {
|
|
|
//修改押品
|
|
//修改押品
|
|
|
- collateralService.updateCollateralById(collateralId,collateralDTO,false);
|
|
|
|
|
- }else {
|
|
|
|
|
|
|
+ collateralService.updateCollateralById(collateralId, collateralDTO, false);
|
|
|
|
|
+ } else {
|
|
|
//新增押品
|
|
//新增押品
|
|
|
Collateral collateral = collateralService.saveCollateral(collateralDTO);
|
|
Collateral collateral = collateralService.saveCollateral(collateralDTO);
|
|
|
collateralId = collateral.getId();
|
|
collateralId = collateral.getId();
|
|
@@ -561,7 +551,7 @@ public class LoanServiceImpl implements LoanService {
|
|
|
|
|
|
|
|
Map<Integer, List<Integer>> contractSeqAndCollateralSeq = loanCaseDTO.getContractSeqAndCollateralSeq();
|
|
Map<Integer, List<Integer>> contractSeqAndCollateralSeq = loanCaseDTO.getContractSeqAndCollateralSeq();
|
|
|
Iterator<Map.Entry<Integer, List<Integer>>> iterator = contractSeqAndCollateralSeq.entrySet().iterator();
|
|
Iterator<Map.Entry<Integer, List<Integer>>> iterator = contractSeqAndCollateralSeq.entrySet().iterator();
|
|
|
- contractAndCollateralService.addBatch(iterator,contracts,collateralIds,caseId);
|
|
|
|
|
|
|
+ contractAndCollateralService.addBatch(iterator, contracts, collateralIds, caseId);
|
|
|
|
|
|
|
|
// //6.添加其它客户
|
|
// //6.添加其它客户
|
|
|
// customerService.deleteIsRegisterByCaseId(false,caseId);
|
|
// customerService.deleteIsRegisterByCaseId(false,caseId);
|
|
@@ -579,25 +569,24 @@ public class LoanServiceImpl implements LoanService {
|
|
|
// customerOtherService.addCustomers(loanCaseDTO.getCustomers2());
|
|
// customerOtherService.addCustomers(loanCaseDTO.getCustomers2());
|
|
|
// }
|
|
// }
|
|
|
}
|
|
}
|
|
|
- stepService.updateUserId1ByCaseIdAndStepCode(StepPropertyEnum.BUSINESS_ACCEPT.getCode(),BaseContext.getCurrentId(),caseId);
|
|
|
|
|
|
|
+ stepService.updateUserId1ByCaseIdAndStepCode(StepPropertyEnum.BUSINESS_ACCEPT.getCode(), BaseContext.getCurrentId(), caseId);
|
|
|
//7.设置阶段负责人与状态(如果第一个人是辅办人员,那第二个人必须是主办)
|
|
//7.设置阶段负责人与状态(如果第一个人是辅办人员,那第二个人必须是主办)
|
|
|
- if(isComplete){
|
|
|
|
|
- redisData.deleteApprovalByKey(caseId,StepPropertyEnum.BUSINESS_ACCEPT.getLabel(),StepPropertyEnum.BUSINESS_ACCEPT.getCode());
|
|
|
|
|
- stepService.updateStatusByCaseId(StepEnum.COMPLETED.getMsg(),StepPropertyEnum.BUSINESS_ACCEPT_PARENT.getCode(),caseId);
|
|
|
|
|
- stepService.updateStatusByCaseId(StepEnum.COMPLETED.getMsg(),StepPropertyEnum.BUSINESS_ACCEPT.getCode(),caseId);
|
|
|
|
|
- stepService.updateUserId1ByCaseIdAndStepCode(StepPropertyEnum.BUSINESS_ACCEPT.getCode(),BaseContext.getCurrentId(),caseId);
|
|
|
|
|
|
|
+ if (isComplete) {
|
|
|
|
|
+ redisData.deleteApprovalByKey(caseId, StepPropertyEnum.BUSINESS_ACCEPT.getLabel(), StepPropertyEnum.BUSINESS_ACCEPT.getCode());
|
|
|
|
|
+ stepService.updateStatusByCaseId(StepEnum.COMPLETED.getMsg(), StepPropertyEnum.BUSINESS_ACCEPT_PARENT.getCode(), caseId);
|
|
|
|
|
+ stepService.updateStatusByCaseId(StepEnum.COMPLETED.getMsg(), StepPropertyEnum.BUSINESS_ACCEPT.getCode(), caseId);
|
|
|
|
|
+ stepService.updateUserId1ByCaseIdAndStepCode(StepPropertyEnum.BUSINESS_ACCEPT.getCode(), BaseContext.getCurrentId(), caseId);
|
|
|
//设置当阶段为完成,下阶段为开始
|
|
//设置当阶段为完成,下阶段为开始
|
|
|
- stepService.tryStartStep(StepPropertyEnum.BUSINESS_ACCEPT.getCode(),caseId);
|
|
|
|
|
|
|
+ stepService.tryStartStep(StepPropertyEnum.BUSINESS_ACCEPT.getCode(), caseId);
|
|
|
|
|
|
|
|
//TODO:8.微信推送预审通过消息和通知下一环节
|
|
//TODO:8.微信推送预审通过消息和通知下一环节
|
|
|
- List<User> users =new ArrayList<>();
|
|
|
|
|
|
|
+ List<User> users = new ArrayList<>();
|
|
|
String stepName = "待处理环节为:";
|
|
String stepName = "待处理环节为:";
|
|
|
- if (isSkip){
|
|
|
|
|
|
|
+ if (isSkip) {
|
|
|
users = userService.findByRoleAndIsDelete(Arrays.asList(RoleEnum.APPROVER.getMsg()), false);
|
|
users = userService.findByRoleAndIsDelete(Arrays.asList(RoleEnum.APPROVER.getMsg()), false);
|
|
|
stepName = stepName.concat(StepPropertyEnum.APPROVAL.getLabel());
|
|
stepName = stepName.concat(StepPropertyEnum.APPROVAL.getLabel());
|
|
|
- }
|
|
|
|
|
- else{
|
|
|
|
|
- users = userService.findByRoleAndIsDelete(Arrays.asList(RoleEnum.ASSIST_SALES.getMsg(),RoleEnum.LEAD_SALES.getMsg()), false);
|
|
|
|
|
|
|
+ } else {
|
|
|
|
|
+ users = userService.findByRoleAndIsDelete(Arrays.asList(RoleEnum.ASSIST_SALES.getMsg(), RoleEnum.LEAD_SALES.getMsg()), false);
|
|
|
stepName = stepName.concat(StepPropertyEnum.PRE_TRIAL.getLabel());
|
|
stepName = stepName.concat(StepPropertyEnum.PRE_TRIAL.getLabel());
|
|
|
}
|
|
}
|
|
|
TemplateMessage message = new TemplateMessage();
|
|
TemplateMessage message = new TemplateMessage();
|
|
@@ -607,11 +596,9 @@ public class LoanServiceImpl implements LoanService {
|
|
|
data.put("amount4", Collections.singletonMap("value", String.valueOf(loanCaseDTO.getTotalLoanAmount())));
|
|
data.put("amount4", Collections.singletonMap("value", String.valueOf(loanCaseDTO.getTotalLoanAmount())));
|
|
|
data.put("things5", Collections.singletonMap("value", stepName));
|
|
data.put("things5", Collections.singletonMap("value", stepName));
|
|
|
message.setData(data);
|
|
message.setData(data);
|
|
|
- for (User user : users){
|
|
|
|
|
- if (user.getId() .equals(BaseContext.getCurrentId()))
|
|
|
|
|
- continue;
|
|
|
|
|
- if (user.getOpenid() != null)
|
|
|
|
|
- wxService.sendTemplateMessage(user.getOpenid(),message);
|
|
|
|
|
|
|
+ for (User user : users) {
|
|
|
|
|
+ if (user.getId().equals(BaseContext.getCurrentId())) continue;
|
|
|
|
|
+ if (user.getOpenid() != null) wxService.sendTemplateMessage(user.getOpenid(), message);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@@ -619,32 +606,32 @@ public class LoanServiceImpl implements LoanService {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
- public void loanCaseComplete(Long caseId, Boolean isCancel,Map<String,String> pawnList) {
|
|
|
|
|
- if(!isCancel){
|
|
|
|
|
- updateIsCompleteByCaseId(DecisionEnum.COMPLETE.getMsg(),caseId);
|
|
|
|
|
|
|
+ public void loanCaseComplete(Long caseId, Boolean isCancel, Map<String, String> pawnList) {
|
|
|
|
|
+ if (!isCancel) {
|
|
|
|
|
+ updateIsCompleteByCaseId(DecisionEnum.COMPLETE.getMsg(), caseId);
|
|
|
|
|
|
|
|
//保存当票信息
|
|
//保存当票信息
|
|
|
Iterator<Map.Entry<String, String>> iterator = pawnList.entrySet().iterator();
|
|
Iterator<Map.Entry<String, String>> iterator = pawnList.entrySet().iterator();
|
|
|
- while (iterator.hasNext()){
|
|
|
|
|
|
|
+ while (iterator.hasNext()) {
|
|
|
Map.Entry<String, String> entry = iterator.next();
|
|
Map.Entry<String, String> entry = iterator.next();
|
|
|
String pawnTicketNo = entry.getKey();
|
|
String pawnTicketNo = entry.getKey();
|
|
|
String redeemTicketNo = entry.getValue();
|
|
String redeemTicketNo = entry.getValue();
|
|
|
- if (redeemTicketNo != null && !redeemTicketNo.trim().isEmpty()){
|
|
|
|
|
- pawnTicketService.updateRedeemTicketNoByPawnTicketNo(redeemTicketNo,pawnTicketNo);
|
|
|
|
|
|
|
+ if (redeemTicketNo != null && !redeemTicketNo.trim().isEmpty()) {
|
|
|
|
|
+ pawnTicketService.updateRedeemTicketNoByPawnTicketNo(redeemTicketNo, pawnTicketNo);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- stepService.updateUserId1ByCaseIdAndStepCode(StepPropertyEnum.CASE_COMPLETE.getCode(),BaseContext.getCurrentId(), caseId);
|
|
|
|
|
- stepService.updateStatusByCaseId(StepEnum.COMPLETED.getMsg(),StepPropertyEnum.REPAY_PARENT.getCode(),caseId);
|
|
|
|
|
- stepService.updateStatusByCaseId(StepEnum.COMPLETED.getMsg(),StepPropertyEnum.CASE_COMPLETE.getCode(),caseId);
|
|
|
|
|
|
|
+ stepService.updateUserId1ByCaseIdAndStepCode(StepPropertyEnum.CASE_COMPLETE.getCode(), BaseContext.getCurrentId(), caseId);
|
|
|
|
|
+ stepService.updateStatusByCaseId(StepEnum.COMPLETED.getMsg(), StepPropertyEnum.REPAY_PARENT.getCode(), caseId);
|
|
|
|
|
+ stepService.updateStatusByCaseId(StepEnum.COMPLETED.getMsg(), StepPropertyEnum.CASE_COMPLETE.getCode(), caseId);
|
|
|
|
|
|
|
|
- stepService.tryStartStep(StepPropertyEnum.CASE_COMPLETE.getCode(),caseId);
|
|
|
|
|
- }else{
|
|
|
|
|
- updateIsCompleteByCaseId(DecisionEnum.PROCESS.getMsg(),caseId);
|
|
|
|
|
|
|
+ stepService.tryStartStep(StepPropertyEnum.CASE_COMPLETE.getCode(), caseId);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ updateIsCompleteByCaseId(DecisionEnum.PROCESS.getMsg(), caseId);
|
|
|
|
|
|
|
|
stepService.deleteUserRecordByCaseIdAndStepCode(StepPropertyEnum.CASE_COMPLETE.getCode(), caseId);
|
|
stepService.deleteUserRecordByCaseIdAndStepCode(StepPropertyEnum.CASE_COMPLETE.getCode(), caseId);
|
|
|
- stepService.updateStatusByCaseId(StepEnum.PROCESS.getMsg(),StepPropertyEnum.REPAY_PARENT.getCode(),caseId);
|
|
|
|
|
- stepService.updateStatusByCaseId(StepEnum.PROCESS.getMsg(),StepPropertyEnum.CASE_COMPLETE.getCode(),caseId);
|
|
|
|
|
|
|
+ stepService.updateStatusByCaseId(StepEnum.PROCESS.getMsg(), StepPropertyEnum.REPAY_PARENT.getCode(), caseId);
|
|
|
|
|
+ stepService.updateStatusByCaseId(StepEnum.PROCESS.getMsg(), StepPropertyEnum.CASE_COMPLETE.getCode(), caseId);
|
|
|
stepService.updateStatusByCaseId(StepEnum.UNSTART.getMsg(), StepPropertyEnum.CASE_ARCHIVE.getCode(), caseId);
|
|
stepService.updateStatusByCaseId(StepEnum.UNSTART.getMsg(), StepPropertyEnum.CASE_ARCHIVE.getCode(), caseId);
|
|
|
|
|
|
|
|
}
|
|
}
|
|
@@ -653,41 +640,97 @@ public class LoanServiceImpl implements LoanService {
|
|
|
@Override
|
|
@Override
|
|
|
public void cancelLoanCase(Long caseId) {
|
|
public void cancelLoanCase(Long caseId) {
|
|
|
//撤回业务状态
|
|
//撤回业务状态
|
|
|
- if (stepService.findStepByCodeAndCaseId(StepPropertyEnum.BUSINESS_ACCEPT.getCode(),caseId).getStatus().equals(StepEnum.COMPLETED.getMsg())){
|
|
|
|
|
- stepService.updateStatusByCaseId(StepEnum.PROCESS.getMsg(),StepPropertyEnum.BUSINESS_ACCEPT_PARENT.getCode(),caseId);
|
|
|
|
|
- stepService.updateStatusByCaseId(StepEnum.PROCESS.getMsg(),StepPropertyEnum.BUSINESS_ACCEPT.getCode(),caseId);
|
|
|
|
|
|
|
+ if (stepService.findStepByCodeAndCaseId(StepPropertyEnum.BUSINESS_ACCEPT.getCode(), caseId).getStatus().equals(StepEnum.COMPLETED.getMsg())) {
|
|
|
|
|
+ stepService.updateStatusByCaseId(StepEnum.PROCESS.getMsg(), StepPropertyEnum.BUSINESS_ACCEPT_PARENT.getCode(), caseId);
|
|
|
|
|
+ stepService.updateStatusByCaseId(StepEnum.PROCESS.getMsg(), StepPropertyEnum.BUSINESS_ACCEPT.getCode(), caseId);
|
|
|
|
|
|
|
|
//撤回预审状态
|
|
//撤回预审状态
|
|
|
- stepService.updateStatusByCaseId(StepEnum.UNSTART.getMsg(),StepPropertyEnum.PRE_TRIAL_PARENT.getCode(),caseId);
|
|
|
|
|
- stepService.updateStatusByCaseId(StepEnum.UNSTART.getMsg(),StepPropertyEnum.PRE_TRIAL.getCode(),caseId);
|
|
|
|
|
|
|
+ stepService.updateStatusByCaseId(StepEnum.UNSTART.getMsg(), StepPropertyEnum.PRE_TRIAL_PARENT.getCode(), caseId);
|
|
|
|
|
+ stepService.updateStatusByCaseId(StepEnum.UNSTART.getMsg(), StepPropertyEnum.PRE_TRIAL.getCode(), caseId);
|
|
|
|
|
|
|
|
- stepService.updateStatusByCaseId(StepEnum.UNSTART.getMsg(),StepPropertyEnum.APPROVAL_PARENT.getCode(),caseId);
|
|
|
|
|
- stepService.updateStatusByCaseId(StepEnum.UNSTART.getMsg(),StepPropertyEnum.APPROVAL.getCode(),caseId);
|
|
|
|
|
|
|
+ stepService.updateStatusByCaseId(StepEnum.UNSTART.getMsg(), StepPropertyEnum.APPROVAL_PARENT.getCode(), caseId);
|
|
|
|
|
+ stepService.updateStatusByCaseId(StepEnum.UNSTART.getMsg(), StepPropertyEnum.APPROVAL.getCode(), caseId);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public List<LoanCaseVO> listLoanCaseByKeyAndIsComplete(String keyRaw, String msg,Integer pageNum, Integer pageSize) {
|
|
|
|
|
+ // 2. 判断能否被解析成 Long
|
|
|
|
|
+ String key = keyRaw.trim();
|
|
|
|
|
+ boolean isLongKey = false;
|
|
|
|
|
+ try {
|
|
|
|
|
+ Long.parseLong(key); // 不会溢出就认为是 Long
|
|
|
|
|
+ isLongKey = true;
|
|
|
|
|
+ } catch (NumberFormatException ignore) {
|
|
|
|
|
+ // 不是纯数字,按字符串处理
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 3. 分支调用
|
|
|
|
|
+ if (isLongKey) {
|
|
|
|
|
+ // 按 Long 型主键搜索
|
|
|
|
|
+ Long id = Long.valueOf(key);
|
|
|
|
|
+ LoanCase loanCase = loanRepository.findLoanCaseById(id, false);
|
|
|
|
|
+ if (loanCase != null)
|
|
|
|
|
+ return getLoanCaseVO2(Collections.singletonList(loanCase));
|
|
|
|
|
+ return null;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ // 按字符串模糊搜索
|
|
|
|
|
+ List<Customer> customers = customerService.findByCustomerNameAndIsDelete(key, false);
|
|
|
|
|
+ if (customers != null ){
|
|
|
|
|
+ List<Long> customerIds = customers.stream().map(Customer::getId).collect(Collectors.toList());
|
|
|
|
|
+ Pageable pageable = PageRequest.of(pageNum, pageSize);
|
|
|
|
|
+ Page<LoanCase> loanCases = loanRepository.findLoanCaseByCustomerIds(customerIds, pageable, false);
|
|
|
|
|
+ return getLoanCaseVO2(loanCases.getContent());
|
|
|
|
|
+ }
|
|
|
|
|
+ return null;
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
private List<LoanCaseVO> getLoanCaseVO(List<LoanCase> loanCases) {
|
|
private List<LoanCaseVO> getLoanCaseVO(List<LoanCase> loanCases) {
|
|
|
List<LoanCaseVO> loanCaseVO = new ArrayList<>();
|
|
List<LoanCaseVO> loanCaseVO = new ArrayList<>();
|
|
|
for (LoanCase loanCase1 : loanCases) {
|
|
for (LoanCase loanCase1 : loanCases) {
|
|
|
Long customerId = loanCase1.getCustomerId();
|
|
Long customerId = loanCase1.getCustomerId();
|
|
|
- CustomerVO customer = customerService.findByCustomerIdAndIsDelete(customerId,false);
|
|
|
|
|
|
|
+ CustomerVO customer = customerService.findByCustomerIdAndIsDelete(customerId, false);
|
|
|
LoanCaseVO loanCaseVO1 = BeanUtil.copyProperties(loanCase1, LoanCaseVO.class);
|
|
LoanCaseVO loanCaseVO1 = BeanUtil.copyProperties(loanCase1, LoanCaseVO.class);
|
|
|
loanCaseVO1.setCustomer(customer);
|
|
loanCaseVO1.setCustomer(customer);
|
|
|
- Long userId=stepService.findByStepCodeAndCaseId(StepPropertyEnum.BUSINESS_ACCEPT.getCode(), loanCase1.getId()).getUserId1();
|
|
|
|
|
|
|
+ Long userId = stepService.findByStepCodeAndCaseId(StepPropertyEnum.BUSINESS_ACCEPT.getCode(), loanCase1.getId()).getUserId1();
|
|
|
User user = userService.findByIdAndIsDelete(userId);
|
|
User user = userService.findByIdAndIsDelete(userId);
|
|
|
- if (user != null)
|
|
|
|
|
- loanCaseVO1.setUserName(user.getRealName());
|
|
|
|
|
|
|
+ if (user != null) loanCaseVO1.setUserName(user.getRealName());
|
|
|
|
|
|
|
|
List<StepVO> steps = stepService.getStepByCaseId(loanCase1.getId());
|
|
List<StepVO> steps = stepService.getStepByCaseId(loanCase1.getId());
|
|
|
loanCaseVO1.setSteps(steps);
|
|
loanCaseVO1.setSteps(steps);
|
|
|
for (StepVO stepVO : steps)
|
|
for (StepVO stepVO : steps)
|
|
|
- if (stepVO.getParentCode() !=0 && stepVO.getStatus().equals(StepEnum.PROCESS.getMsg())){
|
|
|
|
|
|
|
+ if (stepVO.getParentCode() != 0 && stepVO.getStatus().equals(StepEnum.PROCESS.getMsg())) {
|
|
|
loanCaseVO1.setStep(stepVO);
|
|
loanCaseVO1.setStep(stepVO);
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+ loanCaseVO.add(loanCaseVO1);
|
|
|
|
|
+ }
|
|
|
|
|
+ return loanCaseVO;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ private List<LoanCaseVO> getLoanCaseVO2(List<LoanCase> loanCases) {
|
|
|
|
|
+ List<LoanCaseVO> loanCaseVO = new ArrayList<>();
|
|
|
|
|
+ for (LoanCase loanCase1 : loanCases) {
|
|
|
|
|
+ Long customerId = loanCase1.getCustomerId();
|
|
|
|
|
+ CustomerVO customer = customerService.findByCustomerIdAndIsDelete(customerId, false);
|
|
|
|
|
+ LoanCaseVO loanCaseVO1 = BeanUtil.copyProperties(loanCase1, LoanCaseVO.class);
|
|
|
|
|
+ loanCaseVO1.setCustomer(customer);
|
|
|
|
|
+ Long userId = stepService.findByStepCodeAndCaseId(StepPropertyEnum.BUSINESS_ACCEPT.getCode(), loanCase1.getId()).getUserId1();
|
|
|
|
|
+ User user = userService.findByIdAndIsDelete(userId);
|
|
|
|
|
+ if (user != null) loanCaseVO1.setUserName(user.getRealName());
|
|
|
|
|
+
|
|
|
|
|
+ List<StepVO> steps = stepService.getStepByCaseId(loanCase1.getId());
|
|
|
|
|
+ List<StepVO> processStep = new ArrayList<>();
|
|
|
|
|
+ for (StepVO stepVO : steps)
|
|
|
|
|
+ if (stepVO.getParentCode() != 0 && stepVO.getStatus().equals(StepEnum.PROCESS.getMsg())) {
|
|
|
|
|
+ processStep.add(stepVO);
|
|
|
|
|
+ }
|
|
|
|
|
+ loanCaseVO1.setSteps(processStep);
|
|
|
|
|
+
|
|
|
loanCaseVO.add(loanCaseVO1);
|
|
loanCaseVO.add(loanCaseVO1);
|
|
|
}
|
|
}
|
|
|
return loanCaseVO;
|
|
return loanCaseVO;
|