|
|
|
@ -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<DgGuaran |
|
|
|
|
@Autowired |
|
|
|
|
private DgLoanCommitteeConsiderMapper dgLoanCommitteeConsiderMapper; |
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
private DgGuaranteeAssignUserMapper guaranteeAssignUserMapper; |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public GuaranteeLetterListResponse selectGuaranteeLetter(String businessId,String roleId) { |
|
|
|
@ -149,7 +153,7 @@ public class DgGuaranteeLetterAssignUserServiceImpl extends ServiceImpl<DgGuaran |
|
|
|
|
Integer approveStatus = guaranteeLetterAssignUserTemp.getStatus(); |
|
|
|
|
|
|
|
|
|
//之前状态为审批中,同意确定生成担保函,添加数据给指派的AB角用户
|
|
|
|
|
if (StatusCode.SP_REVIEWED.equals(status) && StatusCode.SP_IN_REVIEW.equals(approveStatus)){ |
|
|
|
|
if (StatusCode.SP_IN_REVIEW.equals(approveStatus) && StatusCode.SP_REVIEWED.equals(status)){ |
|
|
|
|
//根据角色及业务id查询需要更新数据
|
|
|
|
|
QueryWrapper<DgGuaranteeLetterAssignUser> queryWrapper = new QueryWrapper<>(); |
|
|
|
|
queryWrapper.eq("business_id",businessId).eq("role_id",PromptSuccess.FG_JL_ID); |
|
|
|
@ -168,13 +172,25 @@ public class DgGuaranteeLetterAssignUserServiceImpl extends ServiceImpl<DgGuaran |
|
|
|
|
AuditProcessUtil.save(businessId,account,"法规部经理",auditOpinion,8); |
|
|
|
|
//更新成功,添加ab角数据
|
|
|
|
|
if (i > 0){ |
|
|
|
|
//获取之前指定的a角用户
|
|
|
|
|
QueryWrapper<DgGuaranteeAssignUser> 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<DgGuaranteeAssignUser> 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<DgGuaran |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//之前状态为驳回,同意确定生成担保函,更新数据给指派的AB角用户
|
|
|
|
|
if (StatusCode.SP_REVIEWED.equals(status) && StatusCode.SP_REJECT.equals(approveStatus)){ |
|
|
|
|
if (StatusCode.SP_REJECT.equals(approveStatus) && StatusCode.SP_REVIEWED.equals(status)){ |
|
|
|
|
//根据角色及业务id查询需要更新数据
|
|
|
|
|
QueryWrapper<DgGuaranteeLetterAssignUser> queryWrapper = new QueryWrapper<>(); |
|
|
|
|
queryWrapper.eq("business_id",businessId).eq("role_id",PromptSuccess.FG_JL_ID); |
|
|
|
@ -220,18 +236,21 @@ public class DgGuaranteeLetterAssignUserServiceImpl extends ServiceImpl<DgGuaran |
|
|
|
|
dgGuaranteeLetterAssignUserB.setOperatingStatus(StatusCode.CZ_ON_HAND); |
|
|
|
|
//清空上次的审批意见
|
|
|
|
|
dgGuaranteeLetterAssignUserB.setAuditOpinion(""); |
|
|
|
|
baseMapper.updateById(dgGuaranteeLetterAssignUserB); |
|
|
|
|
int update = baseMapper.updateById(dgGuaranteeLetterAssignUserB); |
|
|
|
|
|
|
|
|
|
//更新资产部经理
|
|
|
|
|
//根据业务id查询资产部经理数据
|
|
|
|
|
QueryWrapper<DgGuaranteeLetterAssignUser> guaranteeLetterAssignUserQueryWrapperZc = new QueryWrapper<>(); |
|
|
|
|
guaranteeLetterAssignUserQueryWrapperZc.eq("business_id",businessId).eq("role_id",PromptSuccess.ZC_JL_ID); |
|
|
|
|
DgGuaranteeLetterAssignUser dgGuaranteeLetterAssignUserZc = baseMapper.selectOne(guaranteeLetterAssignUserQueryWrapperZc); |
|
|
|
|
//查询为空不作操作
|
|
|
|
|
if (dgGuaranteeLetterAssignUserZc!=null){ |
|
|
|
|
dgGuaranteeLetterAssignUserZc.setStatus(StatusCode.SP_IN_REVIEW); |
|
|
|
|
dgGuaranteeLetterAssignUserZc.setOperatingStatus(StatusCode.CZ_ON_HAND); |
|
|
|
|
//清空上次的审批意见
|
|
|
|
|
dgGuaranteeLetterAssignUserZc.setAuditOpinion(""); |
|
|
|
|
int update = baseMapper.updateById(dgGuaranteeLetterAssignUserZc); |
|
|
|
|
baseMapper.updateById(dgGuaranteeLetterAssignUserZc); |
|
|
|
|
} |
|
|
|
|
//更新成功,返回操作结果
|
|
|
|
|
log.info(update > 0 ? "驳回后法规部经理成功生成担保函" : "驳回后法规部经理生成担保函失败"); |
|
|
|
|
return update > 0; |
|
|
|
@ -459,7 +478,6 @@ public class DgGuaranteeLetterAssignUserServiceImpl extends ServiceImpl<DgGuaran |
|
|
|
|
QueryWrapper<DgGuaranteeLetterAssignUser> 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<DgGuaran |
|
|
|
|
QueryWrapper<DgGuaranteeLetterAssignUser> 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<DgGuaran |
|
|
|
|
QueryWrapper<DgGuaranteeLetterAssignUser> 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<DgGuaran |
|
|
|
|
QueryWrapper<DgGuaranteeLetterAssignUser> 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); |
|
|
|
|