diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgGuaranteeLetterAssignUserController.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgGuaranteeLetterAssignUserController.java index 980fe9ef..423ed9b6 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgGuaranteeLetterAssignUserController.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgGuaranteeLetterAssignUserController.java @@ -77,7 +77,7 @@ public class DgGuaranteeLetterAssignUserController { @ApiParam(name = "guaranteeLetterUpdateStatusRequest", value = "更新确认状态请求", required = true) @RequestBody GuaranteeLetterUpdateStatusRequest guaranteeLetterUpdateStatusRequest) { //如果为驳回操作且无审核意见,抛出异常 - if (StatusCode.SP_REJECT.equals(guaranteeLetterUpdateStatusRequest.getStatus()) && guaranteeLetterUpdateStatusRequest.getAuditOpinion()==null && guaranteeLetterUpdateStatusRequest.getAuditOpinion().length()==0){ + if (StatusCode.SP_REJECT.equals(guaranteeLetterUpdateStatusRequest.getStatus()) && guaranteeLetterUpdateStatusRequest.getAuditOpinion()==null){ return ResponseResult.FAIL(44444,"请填写审核意见!"); } boolean result = guaranteeLetterAssignUserService.updateGuaranteeLetterStatus(guaranteeLetterUpdateStatusRequest); diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgLoanNoticeController.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgLoanNoticeController.java index 4ef34bef..41e5d6f0 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgLoanNoticeController.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgLoanNoticeController.java @@ -71,7 +71,7 @@ public class DgLoanNoticeController { @ApiParam(name = "loanNoticeUpdateRequest", value = "更新放款通知请求", required = true) @RequestBody LoanNoticeUpdateRequest loanNoticeUpdateRequest) { //如果为驳回操作且无审核意见,抛出异常 - if (StatusCode.SP_REJECT.equals(loanNoticeUpdateRequest.getStatus()) && loanNoticeUpdateRequest.getAuditOpinion()==null && loanNoticeUpdateRequest.getAuditOpinion().length()==0){ + if (StatusCode.SP_REJECT.equals(loanNoticeUpdateRequest.getStatus()) && loanNoticeUpdateRequest.getAuditOpinion()==null){ return ResponseResult.FAIL(44444,"请填写审核意见!"); } boolean result = loanNoticeService.updateLoanNotice(loanNoticeUpdateRequest); diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgPaymentConfirmationConsiderController.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgPaymentConfirmationConsiderController.java index f5ddc538..5fa82d4f 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgPaymentConfirmationConsiderController.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgPaymentConfirmationConsiderController.java @@ -62,7 +62,7 @@ public class DgPaymentConfirmationConsiderController { @ApiParam(name = "paymentConfirmationUpdateRequest", value = "更新回款确认请求", required = true) @RequestBody PaymentConfirmationUpdateRequest paymentConfirmationUpdateRequest) { //如果为驳回操作且无审核意见,抛出异常 - if (StatusCode.SP_REJECT.equals(paymentConfirmationUpdateRequest.getStatus()) && paymentConfirmationUpdateRequest.getAuditOpinion()==null && paymentConfirmationUpdateRequest.getAuditOpinion().length()==0){ + if (StatusCode.SP_REJECT.equals(paymentConfirmationUpdateRequest.getStatus()) && paymentConfirmationUpdateRequest.getAuditOpinion()==null){ return ResponseResult.FAIL(44444,"请填写审核意见!"); } boolean result = paymentConfirmationConsiderService.updatePaymentConfirmation(paymentConfirmationUpdateRequest); diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgGuaranteeLetterAssignUserServiceImpl.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgGuaranteeLetterAssignUserServiceImpl.java index 100d46d7..adee80e8 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgGuaranteeLetterAssignUserServiceImpl.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgGuaranteeLetterAssignUserServiceImpl.java @@ -178,22 +178,50 @@ public class DgGuaranteeLetterAssignUserServiceImpl extends ServiceImpl guaranteeLetterAssignUserQueryWrapperA = new QueryWrapper<>(); + guaranteeLetterAssignUserQueryWrapperA.eq("business_id",businessId).eq("role_id",PromptSuccess.DB_A_ID); + DgGuaranteeLetterAssignUser dgGuaranteeLetterAssignUserA = baseMapper.selectOne(guaranteeLetterAssignUserQueryWrapperA); + //如果a角数据不存在,则进行添加 + if (dgGuaranteeLetterAssignUserA==null){ + //添加a角 + guaranteeLetterUser.setRoleId(PromptSuccess.DB_A_ID); + guaranteeLetterUser.setUserId(userA); + guaranteeLetterUser.setBusinessId(businessId); + guaranteeLetterUser.setCompanyId(companyId); + baseMapper.insert(guaranteeLetterUser); + }else { + //存在则进行更新 + dgGuaranteeLetterAssignUserA.setStatus(StatusCode.SP_IN_REVIEW); + dgGuaranteeLetterAssignUserA.setOperatingStatus(StatusCode.CZ_ON_HAND); + //清空上次的审批意见 + dgGuaranteeLetterAssignUserA.setAuditOpinion(""); + baseMapper.updateById(dgGuaranteeLetterAssignUserA); + } + + //获取之前指定的b角用户 QueryWrapper wrapperB = new QueryWrapper<>(); wrapperB.eq("business_id",businessId).eq("role_id",PromptSuccess.DB_B_ID); DgGuaranteeAssignUser dgGuaranteeAssignUserB = guaranteeAssignUserMapper.selectOne(wrapperB); Integer userB = dgGuaranteeAssignUserB.getEmpId(); - //添加b角 - guaranteeLetterUser.setUserId(userB); - guaranteeLetterUser.setRoleId(PromptSuccess.DB_B_ID); - int insert = baseMapper.insert(guaranteeLetterUser); + int insert = 0; + //根据业务id查询B用户数据 + QueryWrapper guaranteeLetterAssignUserQueryWrapperB = new QueryWrapper<>(); + guaranteeLetterAssignUserQueryWrapperB.eq("business_id",businessId).eq("role_id",PromptSuccess.DB_B_ID); + DgGuaranteeLetterAssignUser dgGuaranteeLetterAssignUserB = baseMapper.selectOne(guaranteeLetterAssignUserQueryWrapperB); + if (dgGuaranteeLetterAssignUserB==null){ + //添加b角 + guaranteeLetterUser.setUserId(userB); + guaranteeLetterUser.setRoleId(PromptSuccess.DB_B_ID); + insert = baseMapper.insert(guaranteeLetterUser); + }else { + dgGuaranteeLetterAssignUserB.setStatus(StatusCode.SP_IN_REVIEW); + dgGuaranteeLetterAssignUserB.setOperatingStatus(StatusCode.CZ_ON_HAND); + //清空上次的审批意见 + dgGuaranteeLetterAssignUserB.setAuditOpinion(""); + insert = baseMapper.updateById(dgGuaranteeLetterAssignUserB); + } //更新成功,返回操作结果 log.info(insert > 0 ? "法规部经理成功生成担保函" : "法规部经理生成担保函失败"); return insert > 0; @@ -342,13 +370,23 @@ public class DgGuaranteeLetterAssignUserServiceImpl extends ServiceImpl queryWrapperCWB = new QueryWrapper<>(); + queryWrapperCWB.eq("business_id",businessId).eq("role_id", PromptSuccess.CWB_ID); + DgPaymentConfirmationConsider paymentConfirmationConsiderCWB = paymentConfirmationConsiderMapper.selectOne(queryWrapperCWB); + if (paymentConfirmationConsiderCWB==null){ + DgPaymentConfirmationConsider paymentConfirmationConsider = new DgPaymentConfirmationConsider(); + paymentConfirmationConsider.setRoleId(PromptSuccess.CWB_ID); + paymentConfirmationConsider.setBusinessId(businessId); + paymentConfirmationConsider.setCompanyId(companyId); + insert = paymentConfirmationConsiderMapper.insert(paymentConfirmationConsider); + }else { + paymentConfirmationConsiderCWB.setOperatingStatus(StatusCode.CZ_ON_HAND); + paymentConfirmationConsiderCWB.setStatus(StatusCode.SP_IN_REVIEW); + paymentConfirmationConsiderCWB.setAuditOpinion(""); + insert = paymentConfirmationConsiderMapper.updateById(paymentConfirmationConsiderCWB); + } //更新成功,返回操作结果 log.info(insert > 0 ? "资产部经理成功添加回款数据" : "资产部经理添加回款数据失败"); return insert > 0; @@ -498,13 +536,24 @@ public class DgGuaranteeLetterAssignUserServiceImpl extends ServiceImpl queryWrapperZC = new QueryWrapper<>(); + queryWrapperZC.eq("business_id",businessId).eq("role_id",PromptSuccess.ZC_JL_ID); + DgGuaranteeLetterAssignUser guaranteeLetterAssignUserZC = baseMapper.selectOne(queryWrapperZC); + if (guaranteeLetterAssignUserZC==null){ + DgGuaranteeLetterAssignUser ZCJLGuaranteeLetterAssign = new DgGuaranteeLetterAssignUser(); + ZCJLGuaranteeLetterAssign.setBusinessId(businessId); + ZCJLGuaranteeLetterAssign.setCompanyId(companyId); + ZCJLGuaranteeLetterAssign.setRoleId(PromptSuccess.ZC_JL_ID); + insert = baseMapper.insert(ZCJLGuaranteeLetterAssign); + }else { + guaranteeLetterAssignUserZC.setStatus(StatusCode.SP_IN_REVIEW); + guaranteeLetterAssignUserZC.setOperatingStatus(StatusCode.CZ_ON_HAND); + guaranteeLetterAssignUserZC.setAuditOpinion(""); + insert = baseMapper.updateById(guaranteeLetterAssignUserZC); + } //添加成功,返回操作结果 log.info(insert > 0 ? "资产部经理添加成功" : "资产部经理添加失败"); //b用户审核没通过,返回结果 @@ -628,11 +677,22 @@ public class DgGuaranteeLetterAssignUserServiceImpl extends ServiceImpl queryWrapperZC = new QueryWrapper<>(); + queryWrapperZC.eq("business_id",businessId).eq("role_id",PromptSuccess.ZC_JL_ID); + DgGuaranteeLetterAssignUser guaranteeLetterAssignUserZC = baseMapper.selectOne(queryWrapperZC); + if (guaranteeLetterAssignUserZC==null){ + DgGuaranteeLetterAssignUser ZCJLGuaranteeLetterAssign = new DgGuaranteeLetterAssignUser(); + ZCJLGuaranteeLetterAssign.setBusinessId(businessId); + ZCJLGuaranteeLetterAssign.setCompanyId(companyId); + ZCJLGuaranteeLetterAssign.setRoleId(PromptSuccess.ZC_JL_ID); + insert = baseMapper.insert(ZCJLGuaranteeLetterAssign); + }else { + guaranteeLetterAssignUserZC.setStatus(StatusCode.SP_IN_REVIEW); + guaranteeLetterAssignUserZC.setOperatingStatus(StatusCode.CZ_ON_HAND); + guaranteeLetterAssignUserZC.setAuditOpinion(""); + insert = baseMapper.updateById(guaranteeLetterAssignUserZC); + } //添加成功,返回操作结果 log.info(insert > 0 ? "资产部经理添加成功" : "资产部经理添加失败"); return insert > 0; diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgPaymentConfirmationConsiderServiceImpl.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgPaymentConfirmationConsiderServiceImpl.java index 491f021f..c55c0d3e 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgPaymentConfirmationConsiderServiceImpl.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgPaymentConfirmationConsiderServiceImpl.java @@ -147,12 +147,23 @@ public class DgPaymentConfirmationConsiderServiceImpl extends ServiceImpl 0){ - DgPaymentConfirmationConsider dgPaymentConfirmationConsider = new DgPaymentConfirmationConsider(); - dgPaymentConfirmationConsider.setRoleId(PromptSuccess.FG_JL_ID); - dgPaymentConfirmationConsider.setBusinessId(businessId); - dgPaymentConfirmationConsider.setCompanyId(companyId); - dgPaymentConfirmationConsider.setImgFile(imgFile); - int insert = baseMapper.insert(dgPaymentConfirmationConsider); + int insert = 0; + QueryWrapper wrapperTemp = new QueryWrapper<>(); + wrapperTemp.eq("business_id",businessId).eq("role_id", PromptSuccess.FG_JL_ID); + DgPaymentConfirmationConsider paymentConfirmationTemp = baseMapper.selectOne(wrapperTemp); + if (paymentConfirmationTemp==null){ + DgPaymentConfirmationConsider dgPaymentConfirmationConsider = new DgPaymentConfirmationConsider(); + dgPaymentConfirmationConsider.setRoleId(PromptSuccess.FG_JL_ID); + dgPaymentConfirmationConsider.setBusinessId(businessId); + dgPaymentConfirmationConsider.setCompanyId(companyId); + dgPaymentConfirmationConsider.setImgFile(imgFile); + insert = baseMapper.insert(dgPaymentConfirmationConsider); + }else { + paymentConfirmationTemp.setAuditOpinion(""); + paymentConfirmationTemp.setStatus(StatusCode.SP_IN_REVIEW); + paymentConfirmationTemp.setOperatingStatus(StatusCode.CZ_ON_HAND); + insert = baseMapper.updateById(paymentConfirmationTemp); + } //更新成功,返回操作结果 log.info(insert > 0 ? "财务部经理确认成功" : "财务部经理确认失败"); return insert > 0; @@ -274,11 +285,22 @@ public class DgPaymentConfirmationConsiderServiceImpl extends ServiceImpl loanNoticeQueryWrapperFG = new QueryWrapper<>(); + loanNoticeQueryWrapperFG.eq("business_id",businessId).eq("role_id", PromptSuccess.FG_JL_ID); + DgLoanNotice loanNoticeFG = dgLoanNoticeMapper.selectOne(loanNoticeQueryWrapperFG); + if (loanNoticeFG==null){ + DgLoanNotice loanNotice = new DgLoanNotice(); + loanNotice.setCompanyId(companyId); + loanNotice.setBusinessId(businessId); + loanNotice.setRoleId(PromptSuccess.FG_JL_ID); + insert = dgLoanNoticeMapper.insert(loanNotice); + }else { + loanNoticeFG.setStatus(StatusCode.SP_IN_REVIEW); + loanNoticeFG.setOperatingStatus(StatusCode.CZ_ON_HAND); + loanNoticeFG.setAuditOpinion(""); + insert = dgLoanNoticeMapper.updateById(loanNoticeFG); + } //更新成功,返回操作结果 log.info(insert > 0 ? "法规部经理确认成功" : "法规部经理确认失败"); return insert > 0;