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 3d554f11..1fc5bb7d 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 @@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.daqing.financial.guarantee.controller.DgApplyAmountInfoController; +import com.daqing.financial.guarantee.mapper.DgGuaranteeAssignUserMapper; import com.daqing.financial.guarantee.mapper.DgGuaranteeLetterAssignUserMapper; import com.daqing.financial.guarantee.mapper.DgLoanCommitteeConsiderMapper; import com.daqing.financial.guarantee.mapper.DgPaymentConfirmationConsiderMapper; @@ -14,6 +15,7 @@ import com.daqing.financial.guarantee.model.response.PaymentConfirmationListResp import com.daqing.financial.guarantee.service.IDgGuaranteeLetterAssignUserService; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.daqing.financial.guarantee.util.AuditProcessUtil; +import com.daqing.framework.domain.guarantee.DgGuaranteeAssignUser; import com.daqing.framework.domain.guarantee.DgGuaranteeLetterAssignUser; import com.daqing.framework.domain.guarantee.DgLoanCommitteeConsider; import com.daqing.framework.domain.guarantee.DgPaymentConfirmationConsider; @@ -55,6 +57,8 @@ public class DgGuaranteeLetterAssignUserServiceImpl extends ServiceImpl queryWrapper = new QueryWrapper<>(); queryWrapper.eq("business_id",businessId).eq("role_id",PromptSuccess.FG_JL_ID); @@ -168,13 +172,25 @@ public class DgGuaranteeLetterAssignUserServiceImpl extends ServiceImpl 0){ + //获取之前指定的a角用户 + QueryWrapper wrapperA = new QueryWrapper<>(); + wrapperA.eq("business_id",businessId).eq("role_id",PromptSuccess.DB_A_ID); + DgGuaranteeAssignUser dgGuaranteeAssignUserA = guaranteeAssignUserMapper.selectOne(wrapperA); + Integer userA = dgGuaranteeAssignUserA.getEmpId(); //添加a角 DgGuaranteeLetterAssignUser guaranteeLetterUser = new DgGuaranteeLetterAssignUser(); guaranteeLetterUser.setRoleId(PromptSuccess.DB_A_ID); + guaranteeLetterUser.setUserId(userA); guaranteeLetterUser.setBusinessId(businessId); guaranteeLetterUser.setCompanyId(companyId); baseMapper.insert(guaranteeLetterUser); + //获取之前指定的a角用户 + 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); //更新成功,返回操作结果 @@ -184,7 +200,7 @@ public class DgGuaranteeLetterAssignUserServiceImpl extends ServiceImpl queryWrapper = new QueryWrapper<>(); queryWrapper.eq("business_id",businessId).eq("role_id",PromptSuccess.FG_JL_ID); @@ -220,18 +236,21 @@ public class DgGuaranteeLetterAssignUserServiceImpl extends ServiceImpl guaranteeLetterAssignUserQueryWrapperZc = new QueryWrapper<>(); guaranteeLetterAssignUserQueryWrapperZc.eq("business_id",businessId).eq("role_id",PromptSuccess.ZC_JL_ID); DgGuaranteeLetterAssignUser dgGuaranteeLetterAssignUserZc = baseMapper.selectOne(guaranteeLetterAssignUserQueryWrapperZc); - dgGuaranteeLetterAssignUserZc.setStatus(StatusCode.SP_IN_REVIEW); - dgGuaranteeLetterAssignUserZc.setOperatingStatus(StatusCode.CZ_ON_HAND); - //清空上次的审批意见 - dgGuaranteeLetterAssignUserZc.setAuditOpinion(""); - int update = baseMapper.updateById(dgGuaranteeLetterAssignUserZc); + //查询为空不作操作 + if (dgGuaranteeLetterAssignUserZc!=null){ + dgGuaranteeLetterAssignUserZc.setStatus(StatusCode.SP_IN_REVIEW); + dgGuaranteeLetterAssignUserZc.setOperatingStatus(StatusCode.CZ_ON_HAND); + //清空上次的审批意见 + dgGuaranteeLetterAssignUserZc.setAuditOpinion(""); + baseMapper.updateById(dgGuaranteeLetterAssignUserZc); + } //更新成功,返回操作结果 log.info(update > 0 ? "驳回后法规部经理成功生成担保函" : "驳回后法规部经理生成担保函失败"); return update > 0; @@ -459,7 +478,6 @@ public class DgGuaranteeLetterAssignUserServiceImpl extends ServiceImpl queryWrapperUser = new QueryWrapper<>(); queryWrapperUser.eq("business_id",businessId).eq("role_id",PromptSuccess.DB_A_ID); DgGuaranteeLetterAssignUser guaranteeLetterAssignUser = baseMapper.selectOne(queryWrapperUser); - guaranteeLetterAssignUser.setUserId(currentUser); guaranteeLetterAssignUser.setOperatingStatus(StatusCode.CZ_PROCESSED); guaranteeLetterAssignUser.setAuditOpinion(auditOpinion); //获取公司id @@ -540,7 +558,6 @@ public class DgGuaranteeLetterAssignUserServiceImpl extends ServiceImpl queryWrapperUser = new QueryWrapper<>(); queryWrapperUser.eq("business_id",businessId).eq("role_id",PromptSuccess.DB_A_ID); DgGuaranteeLetterAssignUser guaranteeLetterAssignUser = baseMapper.selectOne(queryWrapperUser); - guaranteeLetterAssignUser.setUserId(currentUser); guaranteeLetterAssignUser.setStatus(StatusCode.SP_REJECT); guaranteeLetterAssignUser.setOperatingStatus(StatusCode.CZ_PROCESSED); guaranteeLetterAssignUser.setAuditOpinion(auditOpinion); @@ -589,7 +606,6 @@ public class DgGuaranteeLetterAssignUserServiceImpl extends ServiceImpl queryWrapperUser = new QueryWrapper<>(); queryWrapperUser.eq("business_id",businessId).eq("role_id",PromptSuccess.DB_B_ID); DgGuaranteeLetterAssignUser guaranteeLetterAssignUser = baseMapper.selectOne(queryWrapperUser); - guaranteeLetterAssignUser.setUserId(currentUser); guaranteeLetterAssignUser.setOperatingStatus(StatusCode.CZ_PROCESSED); guaranteeLetterAssignUser.setAuditOpinion(auditOpinion); //获取公司id @@ -671,7 +687,6 @@ public class DgGuaranteeLetterAssignUserServiceImpl extends ServiceImpl queryWrapperUser = new QueryWrapper<>(); queryWrapperUser.eq("business_id",businessId).eq("role_id",PromptSuccess.DB_B_ID); DgGuaranteeLetterAssignUser guaranteeLetterAssignUser = baseMapper.selectOne(queryWrapperUser); - guaranteeLetterAssignUser.setUserId(currentUser); guaranteeLetterAssignUser.setStatus(StatusCode.SP_REJECT); guaranteeLetterAssignUser.setOperatingStatus(StatusCode.CZ_PROCESSED); guaranteeLetterAssignUser.setAuditOpinion(auditOpinion);