From 6b0365ea1986a07d304b9578c5fd05536855bd64 Mon Sep 17 00:00:00 2001 From: chen <1251790704@qq.com> Date: Wed, 25 Nov 2020 20:01:41 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DgAssetsInvestigationController.java | 2 +- .../controller/DgProcessController.java | 1 + .../DgGuaranteeLetterAssignUserMapper.java | 4 +- .../DgPaymentConfirmationConsiderMapper.java | 5 +- .../request/GuaranteeLetterQueryRequest.java | 7 +- .../GuaranteeLetterUpdateStatusRequest.java | 12 - .../model/request/LoanNoticeQueryRequest.java | 5 +- .../PaymentConfirmationQueryRequest.java | 6 +- ...gGuaranteeLetterAssignUserServiceImpl.java | 512 ++++++++++-------- ...aymentConfirmationConsiderServiceImpl.java | 34 +- .../DgGuaranteeLetterAssignUserMapper.xml | 9 +- .../DgPaymentConfirmationConsiderMapper.xml | 8 +- 12 files changed, 327 insertions(+), 278 deletions(-) diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgAssetsInvestigationController.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgAssetsInvestigationController.java index 54415791..b6efa27c 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgAssetsInvestigationController.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgAssetsInvestigationController.java @@ -46,7 +46,7 @@ public class DgAssetsInvestigationController { String CustomerNumberOrName=assetsInvestigationRequest.getCustomerNumberOrName(); Integer status=assetsInvestigationRequest.getStatus(); //获取当前登录用户userId - //String userId = dgApplyAmountInfoController.getUserId(); + // String userId = dgApplyAmountInfoController.getUserId(); String userId = "5"; //根据角色查询资产部调查列表 String roleIds = RedisUtil.get("dq:userRole:" + userId); diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgProcessController.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgProcessController.java index 966bb2f6..011cf636 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgProcessController.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgProcessController.java @@ -17,4 +17,5 @@ import org.springframework.web.bind.annotation.RestController; @RequestMapping("/dg-process") public class DgProcessController { + } diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/mapper/DgGuaranteeLetterAssignUserMapper.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/mapper/DgGuaranteeLetterAssignUserMapper.java index c2f9045b..9ec4baf6 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/mapper/DgGuaranteeLetterAssignUserMapper.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/mapper/DgGuaranteeLetterAssignUserMapper.java @@ -8,6 +8,8 @@ import com.daqing.framework.domain.guarantee.DgGuaranteeLetterAssignUser; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; +import java.util.List; + /** *

* 担保函记录 Mapper 接口 @@ -19,6 +21,6 @@ import org.apache.ibatis.annotations.Param; @Mapper public interface DgGuaranteeLetterAssignUserMapper extends BaseMapper { - IPage pageByCondition(Page page, @Param("userId") Integer userId, @Param("roleId") Integer roleId, @Param("status") Integer status, @Param("customerNumberOrName") String customerNumberOrName); + IPage pageByCondition(Page page, Integer userId, List roleIdList, Integer status, String customerNumberOrName); } diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/mapper/DgPaymentConfirmationConsiderMapper.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/mapper/DgPaymentConfirmationConsiderMapper.java index 640c09dd..8e5ced50 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/mapper/DgPaymentConfirmationConsiderMapper.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/mapper/DgPaymentConfirmationConsiderMapper.java @@ -7,6 +7,8 @@ import com.daqing.financial.guarantee.model.response.PaymentConfirmationListResp import com.daqing.framework.domain.guarantee.DgPaymentConfirmationConsider; import org.apache.ibatis.annotations.Mapper; +import java.util.List; + /** *

* 回款确认 Mapper 接口 @@ -18,5 +20,6 @@ import org.apache.ibatis.annotations.Mapper; @Mapper public interface DgPaymentConfirmationConsiderMapper extends BaseMapper { - IPage pageByCondition(Page page, Integer roleId, Integer status, String customerNumberOrName); + IPage pageByCondition(Page page, List roleIdList, Integer status, String customerNumberOrName); + } diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/request/GuaranteeLetterQueryRequest.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/request/GuaranteeLetterQueryRequest.java index fbabe524..19e831aa 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/request/GuaranteeLetterQueryRequest.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/request/GuaranteeLetterQueryRequest.java @@ -18,15 +18,10 @@ public class GuaranteeLetterQueryRequest { @ApiModelProperty(value = "每页记录数,默认显示10条") private Integer size = 10; - @ApiModelProperty(value = "流程状态:1->审核中、2->拒绝、3->已审核") + @ApiModelProperty(value = "审核状态:(1审核中 、2已审核、4已驳回)") private Integer status; @ApiModelProperty(value = "业务编号/客户名称") private String CustomerNumberOrName; - @ApiModelProperty(value = "用户ID") - private Integer userId; - - @ApiModelProperty(value = "角色ID") - private Integer roleId; } diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/request/GuaranteeLetterUpdateStatusRequest.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/request/GuaranteeLetterUpdateStatusRequest.java index 43bd34ee..6a4c7c2d 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/request/GuaranteeLetterUpdateStatusRequest.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/request/GuaranteeLetterUpdateStatusRequest.java @@ -12,18 +12,6 @@ import lombok.Data; @Data public class GuaranteeLetterUpdateStatusRequest { - @ApiModelProperty(value = "当前用户") - private Integer currentUser; - - @ApiModelProperty(value = "当前用户角色") - private Integer currentUserRole; - - @ApiModelProperty(value = "a角用户") - private Integer aUser; - - @ApiModelProperty(value = "b角用户") - private Integer bUser; - @ApiModelProperty(value = "业务id") private Integer businessId; diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/request/LoanNoticeQueryRequest.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/request/LoanNoticeQueryRequest.java index f3b3e834..805aaf66 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/request/LoanNoticeQueryRequest.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/request/LoanNoticeQueryRequest.java @@ -20,13 +20,10 @@ public class LoanNoticeQueryRequest { @ApiModelProperty(value = "每页记录数,默认显示10条") private Integer size = 10; - @ApiModelProperty(value = "流程状态:1->审核中、2->拒绝、3->已审核") + @ApiModelProperty(value = "审核状态:(1审核中 、2已审核、4已驳回)") private Integer status; @ApiModelProperty(value = "业务编号/客户名称") private String CustomerNumberOrName; - @NotNull - @ApiModelProperty(value = "角色ID") - private Integer roleId; } diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/request/PaymentConfirmationQueryRequest.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/request/PaymentConfirmationQueryRequest.java index 922fb686..d8b7e550 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/request/PaymentConfirmationQueryRequest.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/request/PaymentConfirmationQueryRequest.java @@ -20,14 +20,10 @@ public class PaymentConfirmationQueryRequest { @ApiModelProperty(value = "每页记录数,默认显示10条") private Integer size = 10; - @ApiModelProperty(value = "流程状态:1->审核中、2->拒绝、3->已审核") + @ApiModelProperty(value = "审核状态:(1审核中 、2已审核、4已驳回)") private Integer status; @ApiModelProperty(value = "业务编号/客户名称") private String CustomerNumberOrName; - @NotNull - @ApiModelProperty(value = "角色ID") - private Integer roleId; - } 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 2b78760b..8095241a 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 @@ -16,12 +16,19 @@ import com.daqing.framework.domain.guarantee.DgLoanCommitteeConsider; import com.daqing.framework.domain.guarantee.DgPaymentConfirmationConsider; import com.daqing.framework.model.StatusCode; import com.daqing.framework.model.response.PromptSuccess; +import com.daqing.framework.util.RedisUtil; import com.daqing.framework.utils.PageUtils; -import com.sun.xml.internal.bind.v2.TODO; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; + +import javax.servlet.http.HttpServletRequest; +import java.util.Arrays; +import java.util.List; +import java.util.spi.CurrencyNameProvider; /** *

@@ -41,18 +48,35 @@ public class DgGuaranteeLetterAssignUserServiceImpl extends ServiceImpl guaranteeLetterVO = baseMapper.pageByCondition(new Page(page,size),userId,roleId,status,customerNumberOrName); + //获取当前登录用户id + Integer userId = Integer.parseInt(this.getUserId()); + + //获取当前用户拥有的角色ids + String roleIds = RedisUtil.get("dq:userRole:" + userId); + IPage guaranteeLetterVO = null; + if(roleIds != null) { + String[] ids = roleIds.split(","); + List roleIdList = Arrays.asList(ids); + //分页条件查询 + guaranteeLetterVO = baseMapper.pageByCondition(new Page(page,size),userId,roleIdList,status,customerNumberOrName); + } return new PageUtils(guaranteeLetterVO); } @@ -75,20 +99,26 @@ public class DgGuaranteeLetterAssignUserServiceImpl extends ServiceImpl roleIdList = null; + if(roleIds != null) { + String[] ids = roleIds.split(","); + roleIdList = Arrays.asList(ids); + } //*************************************************根据角色更新数据************************************************ //角色不为空 - if (currentUserRole!=null){ + if (roleIdList!=null){ + //角色为法规部经理则生成担保函操作和驳回操作 - if (PromptSuccess.FG_JL_ID.equals(currentUserRole)){ + if (roleIdList.contains(PromptSuccess.FG_JL_ID)){ //更新之前,获取此数据的审批状态,如果审批状态为驳回,则更新ab角用户数据,如果审批状态为审批中,则添加ab角用户数据 QueryWrapper queryWrapperTemp = new QueryWrapper<>(); - queryWrapperTemp.eq("business_id",businessId).eq("role_id",currentUserRole); + queryWrapperTemp.eq("business_id",businessId).eq("role_id",PromptSuccess.FG_JL_ID); DgGuaranteeLetterAssignUser guaranteeLetterAssignUserTemp = baseMapper.selectOne(queryWrapperTemp); Integer approveStatus = guaranteeLetterAssignUserTemp.getStatus(); @@ -96,7 +126,7 @@ public class DgGuaranteeLetterAssignUserServiceImpl extends ServiceImpl queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("business_id",businessId).eq("role_id",currentUserRole); + queryWrapper.eq("business_id",businessId).eq("role_id",PromptSuccess.FG_JL_ID); DgGuaranteeLetterAssignUser guaranteeLetterAssignUser = baseMapper.selectOne(queryWrapper); //操作用户为当前用户 guaranteeLetterAssignUser.setUserId(currentUser); @@ -111,12 +141,12 @@ public class DgGuaranteeLetterAssignUserServiceImpl extends ServiceImpl 0){ //添加a角 DgGuaranteeLetterAssignUser guaranteeLetterUser = new DgGuaranteeLetterAssignUser(); - guaranteeLetterUser.setUserId(aUser); + guaranteeLetterUser.setRoleId(PromptSuccess.DB_A_ID); guaranteeLetterUser.setBusinessId(businessId); guaranteeLetterUser.setCompanyId(companyId); baseMapper.insert(guaranteeLetterUser); //添加b角 - guaranteeLetterUser.setUserId(bUser); + guaranteeLetterUser.setRoleId(PromptSuccess.DB_B_ID); int insert = baseMapper.insert(guaranteeLetterUser); //更新成功,返回操作结果 log.info(insert > 0 ? "法规部经理成功生成担保函" : "法规部经理生成担保函失败"); @@ -128,7 +158,7 @@ public class DgGuaranteeLetterAssignUserServiceImpl extends ServiceImpl queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("business_id",businessId).eq("role_id",currentUserRole); + queryWrapper.eq("business_id",businessId).eq("role_id",PromptSuccess.FG_JL_ID); DgGuaranteeLetterAssignUser guaranteeLetterAssignUser = baseMapper.selectOne(queryWrapper); //操作用户为当前用户 guaranteeLetterAssignUser.setUserId(currentUser); @@ -142,7 +172,7 @@ public class DgGuaranteeLetterAssignUserServiceImpl extends ServiceImpl guaranteeLetterAssignUserQueryWrapperA = new QueryWrapper<>(); - guaranteeLetterAssignUserQueryWrapperA.eq("business_id",businessId).eq("user_id",aUser); + guaranteeLetterAssignUserQueryWrapperA.eq("business_id",businessId).eq("role_id",PromptSuccess.DB_A_ID); DgGuaranteeLetterAssignUser dgGuaranteeLetterAssignUserA = baseMapper.selectOne(guaranteeLetterAssignUserQueryWrapperA); dgGuaranteeLetterAssignUserA.setStatus(StatusCode.SP_IN_REVIEW); dgGuaranteeLetterAssignUserA.setOperatingStatus(StatusCode.CZ_ON_HAND); @@ -153,7 +183,7 @@ public class DgGuaranteeLetterAssignUserServiceImpl extends ServiceImpl guaranteeLetterAssignUserQueryWrapperB = new QueryWrapper<>(); - guaranteeLetterAssignUserQueryWrapperB.eq("business_id",businessId).eq("user_id",bUser); + guaranteeLetterAssignUserQueryWrapperB.eq("business_id",businessId).eq("role_id",PromptSuccess.DB_B_ID); DgGuaranteeLetterAssignUser dgGuaranteeLetterAssignUserB = baseMapper.selectOne(guaranteeLetterAssignUserQueryWrapperB); dgGuaranteeLetterAssignUserB.setStatus(StatusCode.SP_IN_REVIEW); dgGuaranteeLetterAssignUserB.setOperatingStatus(StatusCode.CZ_ON_HAND); @@ -170,7 +200,7 @@ public class DgGuaranteeLetterAssignUserServiceImpl extends ServiceImpl queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("business_id",businessId).eq("role_id",currentUserRole); + queryWrapper.eq("business_id",businessId).eq("role_id",PromptSuccess.FG_JL_ID); DgGuaranteeLetterAssignUser guaranteeLetterAssignUser = baseMapper.selectOne(queryWrapper); //操作用户为当前用户 guaranteeLetterAssignUser.setUserId(currentUser); @@ -196,10 +226,10 @@ public class DgGuaranteeLetterAssignUserServiceImpl extends ServiceImpl queryWrapperTemp = new QueryWrapper<>(); - queryWrapperTemp.eq("business_id",businessId).eq("role_id",currentUserRole); + queryWrapperTemp.eq("business_id",businessId).eq("role_id",PromptSuccess.ZC_JL_ID); DgGuaranteeLetterAssignUser guaranteeLetterAssignUserTemp = baseMapper.selectOne(queryWrapperTemp); Integer approveStatus = guaranteeLetterAssignUserTemp.getStatus(); @@ -207,7 +237,7 @@ public class DgGuaranteeLetterAssignUserServiceImpl extends ServiceImpl queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("business_id",businessId).eq("role_id",currentUserRole); + queryWrapper.eq("business_id",businessId).eq("role_id",PromptSuccess.ZC_JL_ID); DgGuaranteeLetterAssignUser guaranteeLetterAssignUser = baseMapper.selectOne(queryWrapper); //操作用户为当前用户 guaranteeLetterAssignUser.setUserId(currentUser); @@ -236,7 +266,7 @@ public class DgGuaranteeLetterAssignUserServiceImpl extends ServiceImpl queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("business_id",businessId).eq("role_id",currentUserRole); + queryWrapper.eq("business_id",businessId).eq("role_id",PromptSuccess.ZC_JL_ID); DgGuaranteeLetterAssignUser guaranteeLetterAssignUser = baseMapper.selectOne(queryWrapper); //操作用户为当前用户 guaranteeLetterAssignUser.setUserId(currentUser); @@ -263,12 +293,11 @@ public class DgGuaranteeLetterAssignUserServiceImpl extends ServiceImpl queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("business_id",businessId).eq("role_id",currentUserRole); + queryWrapper.eq("business_id",businessId).eq("role_id",PromptSuccess.ZC_JL_ID); DgGuaranteeLetterAssignUser guaranteeLetterAssignUser = baseMapper.selectOne(queryWrapper); //操作用户为当前用户 guaranteeLetterAssignUser.setUserId(currentUser); @@ -277,21 +306,21 @@ public class DgGuaranteeLetterAssignUserServiceImpl extends ServiceImpl 0){ - //根据业务id查询A用户数据 + //根据业务id查询A角数据 QueryWrapper guaranteeLetterAssignUserQueryWrapperA = new QueryWrapper<>(); - guaranteeLetterAssignUserQueryWrapperA.eq("business_id",businessId).eq("user_id",aUser); + guaranteeLetterAssignUserQueryWrapperA.eq("business_id",businessId).eq("role_id",PromptSuccess.DB_A_ID); DgGuaranteeLetterAssignUser dgGuaranteeLetterAssignUserA = baseMapper.selectOne(guaranteeLetterAssignUserQueryWrapperA); //审批状态为已驳回,操作状态为待处理 dgGuaranteeLetterAssignUserA.setStatus(StatusCode.SP_REJECT); dgGuaranteeLetterAssignUserA.setOperatingStatus(StatusCode.CZ_ON_HAND); - //更新a用户操作业务数据 + //更新a角操作业务数据 baseMapper.updateById(dgGuaranteeLetterAssignUserA); - //根据业务id查询B用户数据 + //根据业务id查询B角数据 QueryWrapper guaranteeLetterAssignUserQueryWrapperB = new QueryWrapper<>(); - guaranteeLetterAssignUserQueryWrapperB.eq("business_id",businessId).eq("user_id",bUser); + guaranteeLetterAssignUserQueryWrapperB.eq("business_id",businessId).eq("role_id",PromptSuccess.DB_B_ID); DgGuaranteeLetterAssignUser dgGuaranteeLetterAssignUserB = baseMapper.selectOne(guaranteeLetterAssignUserQueryWrapperB); //审批状态为已驳回,操作状态为待处理 dgGuaranteeLetterAssignUserB.setStatus(StatusCode.SP_REJECT); @@ -304,232 +333,237 @@ public class DgGuaranteeLetterAssignUserServiceImpl extends ServiceImpl queryWrapperTemp = new QueryWrapper<>(); - queryWrapperTemp.eq("business_id",businessId).eq("user_id",aUser); - DgGuaranteeLetterAssignUser guaranteeLetterAssignUserTemp = baseMapper.selectOne(queryWrapperTemp); - Integer approveStatus = guaranteeLetterAssignUserTemp.getStatus(); - - //首次a角用户确认担保函,检查b角用户是否确认担保函 - if (StatusCode.SP_REVIEWED.equals(status) && StatusCode.SP_IN_REVIEW.equals(approveStatus)){ - QueryWrapper queryWrapperUser = new QueryWrapper<>(); - queryWrapperUser.eq("business_id",businessId).eq("user_id",aUser); - DgGuaranteeLetterAssignUser guaranteeLetterAssignUser = baseMapper.selectOne(queryWrapperUser); - guaranteeLetterAssignUser.setStatus(StatusCode.SP_REVIEWED); - guaranteeLetterAssignUser.setOperatingStatus(StatusCode.CZ_PROCESSED); - guaranteeLetterAssignUser.setAuditOpinion(auditOpinion); - //获取公司id - Integer companyId = guaranteeLetterAssignUser.getCompanyId(); - //根据当前用户更新审核状态和操作状态及审核意见 - int i = baseMapper.updateById(guaranteeLetterAssignUser); - log.info(i > 0 ? "首次a角用户确认担保函更新成功" : "首次a角用户确认担保函更新失败"); - //更新成功后,判断b角用户是否确认 - if (i > 0){ - QueryWrapper tempB = new QueryWrapper<>(); - //查询b用户的审核状态 - tempB.eq("business_id",businessId).eq("user_id",bUser).select("status"); - DgGuaranteeLetterAssignUser dgGuaranteeLetterAssignUser = baseMapper.selectOne(tempB); - Integer bStatus = dgGuaranteeLetterAssignUser.getStatus(); - //b用户审核通过,添加资产部经理数据 - if (StatusCode.SP_REVIEWED.equals(bStatus)){ - DgGuaranteeLetterAssignUser ZCJLGuaranteeLetterAssign = new DgGuaranteeLetterAssignUser(); - ZCJLGuaranteeLetterAssign.setBusinessId(businessId); - ZCJLGuaranteeLetterAssign.setCompanyId(companyId); - ZCJLGuaranteeLetterAssign.setRoleId(PromptSuccess.ZC_JL_ID); - int insert = baseMapper.insert(ZCJLGuaranteeLetterAssign); - //添加成功,返回操作结果 - log.info(insert > 0 ? "资产部经理添加成功" : "资产部经理添加失败"); - return insert > 0; + + //角色为a角确认担保函操作和驳回操作 + if (roleIdList.contains(PromptSuccess.DB_A_ID)){ + //更新之前,获取此用户数据的审批状态,如果审批状态为驳回,则更新资产部经理数据,如果审批状态为审批中,则添加资产部经理数据 + QueryWrapper queryWrapperTemp = new QueryWrapper<>(); + queryWrapperTemp.eq("business_id",businessId).eq("role_id",PromptSuccess.DB_A_ID); + DgGuaranteeLetterAssignUser guaranteeLetterAssignUserTemp = baseMapper.selectOne(queryWrapperTemp); + Integer approveStatus = guaranteeLetterAssignUserTemp.getStatus(); + + //首次a角用户确认担保函,检查b角用户是否确认担保函 + if (StatusCode.SP_REVIEWED.equals(status) && StatusCode.SP_IN_REVIEW.equals(approveStatus)){ + QueryWrapper 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_REVIEWED); + guaranteeLetterAssignUser.setOperatingStatus(StatusCode.CZ_PROCESSED); + guaranteeLetterAssignUser.setAuditOpinion(auditOpinion); + //获取公司id + Integer companyId = guaranteeLetterAssignUser.getCompanyId(); + //根据当前用户更新审核状态和操作状态及审核意见 + int i = baseMapper.updateById(guaranteeLetterAssignUser); + log.info(i > 0 ? "首次a角用户确认担保函更新成功" : "首次a角用户确认担保函更新失败"); + //更新成功后,判断b角用户是否确认 + if (i > 0){ + QueryWrapper tempB = new QueryWrapper<>(); + //查询b用户的审核状态 + tempB.eq("business_id",businessId).eq("role_id",PromptSuccess.DB_B_ID).select("status"); + DgGuaranteeLetterAssignUser dgGuaranteeLetterAssignUser = baseMapper.selectOne(tempB); + Integer bStatus = dgGuaranteeLetterAssignUser.getStatus(); + //b用户审核通过,添加资产部经理数据 + if (StatusCode.SP_REVIEWED.equals(bStatus)){ + DgGuaranteeLetterAssignUser ZCJLGuaranteeLetterAssign = new DgGuaranteeLetterAssignUser(); + ZCJLGuaranteeLetterAssign.setBusinessId(businessId); + ZCJLGuaranteeLetterAssign.setCompanyId(companyId); + ZCJLGuaranteeLetterAssign.setRoleId(PromptSuccess.ZC_JL_ID); + int insert = baseMapper.insert(ZCJLGuaranteeLetterAssign); + //添加成功,返回操作结果 + log.info(insert > 0 ? "资产部经理添加成功" : "资产部经理添加失败"); + return insert > 0; + } } } - } - //驳回后a角用户再次确认担保函,检查b角用户是否确认担保函 - if (StatusCode.SP_REVIEWED.equals(status) && StatusCode.SP_REJECT.equals(approveStatus)){ - QueryWrapper queryWrapperUser = new QueryWrapper<>(); - queryWrapperUser.eq("business_id",businessId).eq("user_id",aUser); - DgGuaranteeLetterAssignUser guaranteeLetterAssignUser = baseMapper.selectOne(queryWrapperUser); - guaranteeLetterAssignUser.setStatus(StatusCode.SP_REVIEWED); - guaranteeLetterAssignUser.setOperatingStatus(StatusCode.CZ_PROCESSED); - guaranteeLetterAssignUser.setAuditOpinion(auditOpinion); - //根据当前用户更新审核状态和操作状态及审核意见 - int i = baseMapper.updateById(guaranteeLetterAssignUser); - log.info(i > 0 ? "驳回后a角用户确认担保函更新成功" : "驳回后a角用户确认担保函更新失败"); - //更新成功后,判断b角用户是否确认 - if (i > 0){ - QueryWrapper tempB = new QueryWrapper<>(); - //查询b用户的审核状态 - tempB.eq("business_id",businessId).eq("user_id",bUser).select("status"); - DgGuaranteeLetterAssignUser dgGuaranteeLetterAssignUser = baseMapper.selectOne(tempB); - Integer bStatus = dgGuaranteeLetterAssignUser.getStatus(); - //b用户审核通过,更新资产部经理数据 - if (StatusCode.SP_REVIEWED.equals(bStatus)){ - QueryWrapper queryZCJLUser = new QueryWrapper<>(); - queryZCJLUser.eq("business_id",businessId).eq("role_id",PromptSuccess.ZC_JL_ID); - DgGuaranteeLetterAssignUser letterAssignUserZCJL = baseMapper.selectOne(queryZCJLUser); - //清空审批意见 - letterAssignUserZCJL.setAuditOpinion(""); - letterAssignUserZCJL.setStatus(StatusCode.SP_IN_REVIEW); - letterAssignUserZCJL.setStatus(StatusCode.CZ_ON_HAND); - int update = baseMapper.updateById(letterAssignUserZCJL); - //更新成功,返回操作结果 - log.info(update > 0 ? "资产部经理更新成功" : "资产部经理更新失败"); - return update > 0; + //驳回后a角用户再次确认担保函,检查b角用户是否确认担保函 + if (StatusCode.SP_REVIEWED.equals(status) && StatusCode.SP_REJECT.equals(approveStatus)){ + QueryWrapper queryWrapperUser = new QueryWrapper<>(); + queryWrapperUser.eq("business_id",businessId).eq("role_id",PromptSuccess.DB_A_ID); + DgGuaranteeLetterAssignUser guaranteeLetterAssignUser = baseMapper.selectOne(queryWrapperUser); + guaranteeLetterAssignUser.setStatus(StatusCode.SP_REVIEWED); + guaranteeLetterAssignUser.setOperatingStatus(StatusCode.CZ_PROCESSED); + guaranteeLetterAssignUser.setAuditOpinion(auditOpinion); + //根据当前用户更新审核状态和操作状态及审核意见 + int i = baseMapper.updateById(guaranteeLetterAssignUser); + log.info(i > 0 ? "驳回后a角用户确认担保函更新成功" : "驳回后a角用户确认担保函更新失败"); + //更新成功后,判断b角用户是否确认 + if (i > 0){ + QueryWrapper tempB = new QueryWrapper<>(); + //查询b用户的审核状态 + tempB.eq("business_id",businessId).eq("role_id",PromptSuccess.DB_B_ID).select("status"); + DgGuaranteeLetterAssignUser dgGuaranteeLetterAssignUser = baseMapper.selectOne(tempB); + Integer bStatus = dgGuaranteeLetterAssignUser.getStatus(); + //b用户审核通过,更新资产部经理数据 + if (StatusCode.SP_REVIEWED.equals(bStatus)){ + QueryWrapper queryZCJLUser = new QueryWrapper<>(); + queryZCJLUser.eq("business_id",businessId).eq("role_id",PromptSuccess.ZC_JL_ID); + DgGuaranteeLetterAssignUser letterAssignUserZCJL = baseMapper.selectOne(queryZCJLUser); + //清空审批意见 + letterAssignUserZCJL.setAuditOpinion(""); + letterAssignUserZCJL.setStatus(StatusCode.SP_IN_REVIEW); + letterAssignUserZCJL.setStatus(StatusCode.CZ_ON_HAND); + int update = baseMapper.updateById(letterAssignUserZCJL); + //更新成功,返回操作结果 + log.info(update > 0 ? "资产部经理更新成功" : "资产部经理更新失败"); + return update > 0; + } } } - } - //a角驳回操作,更新a角数据及b角数据及返回上一流程 - if (StatusCode.SP_REJECT.equals(status)){ - QueryWrapper queryWrapperUser = new QueryWrapper<>(); - queryWrapperUser.eq("business_id",businessId).eq("user_id",aUser); - DgGuaranteeLetterAssignUser guaranteeLetterAssignUser = baseMapper.selectOne(queryWrapperUser); - guaranteeLetterAssignUser.setStatus(StatusCode.SP_REJECT); - guaranteeLetterAssignUser.setOperatingStatus(StatusCode.CZ_PROCESSED); - guaranteeLetterAssignUser.setAuditOpinion(auditOpinion); - //根据当前用户更新审核状态和操作状态及审核意见 - int i = baseMapper.updateById(guaranteeLetterAssignUser); - log.info(i > 0 ? "a角用户驳回担保函更新成功" : "a角用户驳回担保函更新失败"); - //更新成功后,更新b角数据及更新法规部经理数据 - if (i > 0){ - //更新b用户的审核状态为驳回 - QueryWrapper tempB = new QueryWrapper<>(); - tempB.eq("business_id",businessId).eq("user_id",bUser); - DgGuaranteeLetterAssignUser dgGuaranteeLetterAssignUserB = baseMapper.selectOne(tempB); - dgGuaranteeLetterAssignUserB.setStatus(StatusCode.SP_REJECT); - baseMapper.updateById(dgGuaranteeLetterAssignUserB); - - //更新法规部经理的审核状态为驳回,操作状态为待处理 - QueryWrapper tempFG = new QueryWrapper<>(); - tempFG.eq("business_id",businessId).eq("role_id",PromptSuccess.FG_JL_ID); - DgGuaranteeLetterAssignUser dgGuaranteeLetterAssignUserFG = baseMapper.selectOne(tempFG); - dgGuaranteeLetterAssignUserFG.setStatus(StatusCode.SP_REJECT); - dgGuaranteeLetterAssignUserFG.setOperatingStatus(StatusCode.CZ_ON_HAND); - int update = baseMapper.updateById(dgGuaranteeLetterAssignUserFG); - //添加成功,返回操作结果 - log.info(update > 0 ? "a角驳回更新成功" : "a角驳回更新失败"); - return update > 0; + //a角驳回操作,更新a角数据及b角数据及返回上一流程 + if (StatusCode.SP_REJECT.equals(status)){ + QueryWrapper 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); + //根据当前用户更新审核状态和操作状态及审核意见 + int i = baseMapper.updateById(guaranteeLetterAssignUser); + log.info(i > 0 ? "a角用户驳回担保函更新成功" : "a角用户驳回担保函更新失败"); + //更新成功后,更新b角数据及更新法规部经理数据 + if (i > 0){ + //更新b用户的审核状态为驳回 + QueryWrapper tempB = new QueryWrapper<>(); + tempB.eq("business_id",businessId).eq("role_id",PromptSuccess.DB_B_ID); + DgGuaranteeLetterAssignUser dgGuaranteeLetterAssignUserB = baseMapper.selectOne(tempB); + dgGuaranteeLetterAssignUserB.setStatus(StatusCode.SP_REJECT); + baseMapper.updateById(dgGuaranteeLetterAssignUserB); + + //更新法规部经理的审核状态为驳回,操作状态为待处理 + QueryWrapper tempFG = new QueryWrapper<>(); + tempFG.eq("business_id",businessId).eq("role_id",PromptSuccess.FG_JL_ID); + DgGuaranteeLetterAssignUser dgGuaranteeLetterAssignUserFG = baseMapper.selectOne(tempFG); + dgGuaranteeLetterAssignUserFG.setStatus(StatusCode.SP_REJECT); + dgGuaranteeLetterAssignUserFG.setOperatingStatus(StatusCode.CZ_ON_HAND); + int update = baseMapper.updateById(dgGuaranteeLetterAssignUserFG); + //添加成功,返回操作结果 + log.info(update > 0 ? "a角驳回更新成功" : "a角驳回更新失败"); + return update > 0; + } } } - } - //当前用户为b角用户 - if (currentUser.equals(bUser)){ - //更新之前,获取此用户数据的审批状态,如果审批状态为驳回,则更新资产部经理数据,如果审批状态为审批中,则添加资产部经理数据 - QueryWrapper queryWrapperTemp = new QueryWrapper<>(); - queryWrapperTemp.eq("business_id",businessId).eq("user_id",bUser); - DgGuaranteeLetterAssignUser guaranteeLetterAssignUserTemp = baseMapper.selectOne(queryWrapperTemp); - Integer approveStatus = guaranteeLetterAssignUserTemp.getStatus(); - - //首次b角用户确认担保函,检查a角用户是否确认担保函 - if (StatusCode.SP_REVIEWED.equals(status) && StatusCode.SP_IN_REVIEW.equals(approveStatus)){ - QueryWrapper queryWrapperUser = new QueryWrapper<>(); - queryWrapperUser.eq("business_id",businessId).eq("user_id",bUser); - DgGuaranteeLetterAssignUser guaranteeLetterAssignUser = baseMapper.selectOne(queryWrapperUser); - guaranteeLetterAssignUser.setStatus(StatusCode.SP_REVIEWED); - guaranteeLetterAssignUser.setOperatingStatus(StatusCode.CZ_PROCESSED); - guaranteeLetterAssignUser.setAuditOpinion(auditOpinion); - //获取公司id - Integer companyId = guaranteeLetterAssignUser.getCompanyId(); - //根据当前用户更新审核状态和操作状态及审核意见 - int i = baseMapper.updateById(guaranteeLetterAssignUser); - log.info(i > 0 ? "首次b角用户确认担保函更新成功" : "首次b角用户确认担保函更新失败"); - //更新成功后,判断a角用户是否确认 - if (i > 0){ - QueryWrapper tempB = new QueryWrapper<>(); - //查询a用户的审核状态 - tempB.eq("business_id",businessId).eq("user_id",aUser).select("status"); - DgGuaranteeLetterAssignUser dgGuaranteeLetterAssignUser = baseMapper.selectOne(tempB); - Integer aStatus = dgGuaranteeLetterAssignUser.getStatus(); - //a用户审核通过,添加资产部经理数据 - if (StatusCode.SP_REVIEWED.equals(aStatus)){ - DgGuaranteeLetterAssignUser ZCJLGuaranteeLetterAssign = new DgGuaranteeLetterAssignUser(); - ZCJLGuaranteeLetterAssign.setBusinessId(businessId); - ZCJLGuaranteeLetterAssign.setCompanyId(companyId); - ZCJLGuaranteeLetterAssign.setRoleId(PromptSuccess.ZC_JL_ID); - int insert = baseMapper.insert(ZCJLGuaranteeLetterAssign); - //添加成功,返回操作结果 - log.info(insert > 0 ? "资产部经理添加成功" : "资产部经理添加失败"); - return insert > 0; + + //角色为b角确认担保函操作和驳回操作 + if (roleIdList.contains(PromptSuccess.DB_B_ID)){ + //更新之前,获取此用户数据的审批状态,如果审批状态为驳回,则更新资产部经理数据,如果审批状态为审批中,则添加资产部经理数据 + QueryWrapper queryWrapperTemp = new QueryWrapper<>(); + queryWrapperTemp.eq("business_id",businessId).eq("role_id",PromptSuccess.DB_B_ID); + DgGuaranteeLetterAssignUser guaranteeLetterAssignUserTemp = baseMapper.selectOne(queryWrapperTemp); + Integer approveStatus = guaranteeLetterAssignUserTemp.getStatus(); + + //首次b角用户确认担保函,检查a角用户是否确认担保函 + if (StatusCode.SP_REVIEWED.equals(status) && StatusCode.SP_IN_REVIEW.equals(approveStatus)){ + QueryWrapper 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_REVIEWED); + guaranteeLetterAssignUser.setOperatingStatus(StatusCode.CZ_PROCESSED); + guaranteeLetterAssignUser.setAuditOpinion(auditOpinion); + //获取公司id + Integer companyId = guaranteeLetterAssignUser.getCompanyId(); + //根据当前用户更新审核状态和操作状态及审核意见 + int i = baseMapper.updateById(guaranteeLetterAssignUser); + log.info(i > 0 ? "首次b角用户确认担保函更新成功" : "首次b角用户确认担保函更新失败"); + //更新成功后,判断a角用户是否确认 + if (i > 0){ + QueryWrapper tempB = new QueryWrapper<>(); + //查询a用户的审核状态 + tempB.eq("business_id",businessId).eq("role_id",PromptSuccess.DB_A_ID).select("status"); + DgGuaranteeLetterAssignUser dgGuaranteeLetterAssignUser = baseMapper.selectOne(tempB); + Integer aStatus = dgGuaranteeLetterAssignUser.getStatus(); + //a用户审核通过,添加资产部经理数据 + if (StatusCode.SP_REVIEWED.equals(aStatus)){ + DgGuaranteeLetterAssignUser ZCJLGuaranteeLetterAssign = new DgGuaranteeLetterAssignUser(); + ZCJLGuaranteeLetterAssign.setBusinessId(businessId); + ZCJLGuaranteeLetterAssign.setCompanyId(companyId); + ZCJLGuaranteeLetterAssign.setRoleId(PromptSuccess.ZC_JL_ID); + int insert = baseMapper.insert(ZCJLGuaranteeLetterAssign); + //添加成功,返回操作结果 + log.info(insert > 0 ? "资产部经理添加成功" : "资产部经理添加失败"); + return insert > 0; + } } } - } - //驳回后b角用户再次确认担保函,检查a角用户是否确认担保函 - if (StatusCode.SP_REVIEWED.equals(status) && StatusCode.SP_REJECT.equals(approveStatus)){ - QueryWrapper queryWrapperUser = new QueryWrapper<>(); - queryWrapperUser.eq("business_id",businessId).eq("user_id",bUser); - DgGuaranteeLetterAssignUser guaranteeLetterAssignUser = baseMapper.selectOne(queryWrapperUser); - guaranteeLetterAssignUser.setStatus(StatusCode.SP_REVIEWED); - guaranteeLetterAssignUser.setOperatingStatus(StatusCode.CZ_PROCESSED); - guaranteeLetterAssignUser.setAuditOpinion(auditOpinion); - - //根据当前用户更新审核状态和操作状态及审核意见 - int i = baseMapper.updateById(guaranteeLetterAssignUser); - log.info(i > 0 ? "驳回后b角用户确认担保函更新成功" : "驳回后b角用户确认担保函更新失败"); - //更新成功后,判断a角用户是否确认 - if (i > 0){ - QueryWrapper tempB = new QueryWrapper<>(); - //查询a用户的审核状态 - tempB.eq("business_id",businessId).eq("user_id",aUser).select("status"); - DgGuaranteeLetterAssignUser dgGuaranteeLetterAssignUser = baseMapper.selectOne(tempB); - Integer aStatus = dgGuaranteeLetterAssignUser.getStatus(); - //a用户审核通过,更新资产部经理数据 - if (StatusCode.SP_REVIEWED.equals(aStatus)){ - QueryWrapper queryZCJLUser = new QueryWrapper<>(); - queryZCJLUser.eq("business_id",businessId).eq("role_id",PromptSuccess.ZC_JL_ID); - DgGuaranteeLetterAssignUser letterAssignUserZCJL = baseMapper.selectOne(queryZCJLUser); - //清空审批意见 - letterAssignUserZCJL.setAuditOpinion(""); - letterAssignUserZCJL.setStatus(StatusCode.SP_IN_REVIEW); - letterAssignUserZCJL.setStatus(StatusCode.CZ_ON_HAND); - int update = baseMapper.updateById(letterAssignUserZCJL); - //更新成功,返回操作结果 - log.info(update > 0 ? "资产部经理更新成功" : "资产部经理更新失败"); - return update > 0; + //驳回后b角用户再次确认担保函,检查a角用户是否确认担保函 + if (StatusCode.SP_REVIEWED.equals(status) && StatusCode.SP_REJECT.equals(approveStatus)){ + QueryWrapper queryWrapperUser = new QueryWrapper<>(); + queryWrapperUser.eq("business_id",businessId).eq("role_id",PromptSuccess.DB_B_ID); + DgGuaranteeLetterAssignUser guaranteeLetterAssignUser = baseMapper.selectOne(queryWrapperUser); + guaranteeLetterAssignUser.setStatus(StatusCode.SP_REVIEWED); + guaranteeLetterAssignUser.setOperatingStatus(StatusCode.CZ_PROCESSED); + guaranteeLetterAssignUser.setAuditOpinion(auditOpinion); + + //根据当前用户更新审核状态和操作状态及审核意见 + int i = baseMapper.updateById(guaranteeLetterAssignUser); + log.info(i > 0 ? "驳回后b角用户确认担保函更新成功" : "驳回后b角用户确认担保函更新失败"); + //更新成功后,判断a角用户是否确认 + if (i > 0){ + QueryWrapper tempB = new QueryWrapper<>(); + //查询a用户的审核状态 + tempB.eq("business_id",businessId).eq("role_id",PromptSuccess.DB_A_ID).select("status"); + DgGuaranteeLetterAssignUser dgGuaranteeLetterAssignUser = baseMapper.selectOne(tempB); + Integer aStatus = dgGuaranteeLetterAssignUser.getStatus(); + //a用户审核通过,更新资产部经理数据 + if (StatusCode.SP_REVIEWED.equals(aStatus)){ + QueryWrapper queryZCJLUser = new QueryWrapper<>(); + queryZCJLUser.eq("business_id",businessId).eq("role_id",PromptSuccess.ZC_JL_ID); + DgGuaranteeLetterAssignUser letterAssignUserZCJL = baseMapper.selectOne(queryZCJLUser); + //清空审批意见 + letterAssignUserZCJL.setAuditOpinion(""); + letterAssignUserZCJL.setStatus(StatusCode.SP_IN_REVIEW); + letterAssignUserZCJL.setStatus(StatusCode.CZ_ON_HAND); + int update = baseMapper.updateById(letterAssignUserZCJL); + //更新成功,返回操作结果 + log.info(update > 0 ? "资产部经理更新成功" : "资产部经理更新失败"); + return update > 0; + } } } - } - //b角驳回操作,更新b角数据及a角数据及返回上一流程 - if (StatusCode.SP_REJECT.equals(status)){ - QueryWrapper queryWrapperUser = new QueryWrapper<>(); - queryWrapperUser.eq("business_id",businessId).eq("user_id",bUser); - DgGuaranteeLetterAssignUser guaranteeLetterAssignUser = baseMapper.selectOne(queryWrapperUser); - guaranteeLetterAssignUser.setStatus(StatusCode.SP_REJECT); - guaranteeLetterAssignUser.setOperatingStatus(StatusCode.CZ_PROCESSED); - guaranteeLetterAssignUser.setAuditOpinion(auditOpinion); - //根据当前用户更新审核状态和操作状态及审核意见 - int i = baseMapper.updateById(guaranteeLetterAssignUser); - log.info(i > 0 ? "b角用户驳回担保函更新成功" : "b角用户驳回担保函更新失败"); - //更新成功后,更新a角数据及更新法规部经理数据 - if (i > 0){ - //更新a用户的审核状态为驳回 - QueryWrapper tempA = new QueryWrapper<>(); - tempA.eq("business_id",businessId).eq("user_id",aUser); - DgGuaranteeLetterAssignUser dgGuaranteeLetterAssignUserA = baseMapper.selectOne(tempA); - dgGuaranteeLetterAssignUserA.setStatus(StatusCode.SP_REJECT); - baseMapper.updateById(dgGuaranteeLetterAssignUserA); - - //更新法规部经理的审核状态为驳回,操作状态为待处理 - QueryWrapper tempFG = new QueryWrapper<>(); - tempFG.eq("business_id",businessId).eq("role_id",PromptSuccess.FG_JL_ID); - DgGuaranteeLetterAssignUser dgGuaranteeLetterAssignUserFG = baseMapper.selectOne(tempFG); - dgGuaranteeLetterAssignUserFG.setStatus(StatusCode.SP_REJECT); - dgGuaranteeLetterAssignUserFG.setOperatingStatus(StatusCode.CZ_ON_HAND); - int update = baseMapper.updateById(dgGuaranteeLetterAssignUserFG); - //添加成功,返回操作结果 - log.info(update > 0 ? "b角驳回更新成功" : "b角驳回更新失败"); - return update > 0; + //b角驳回操作,更新b角数据及a角数据及返回上一流程 + if (StatusCode.SP_REJECT.equals(status)){ + QueryWrapper 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); + //根据当前用户更新审核状态和操作状态及审核意见 + int i = baseMapper.updateById(guaranteeLetterAssignUser); + log.info(i > 0 ? "b角用户驳回担保函更新成功" : "b角用户驳回担保函更新失败"); + //更新成功后,更新a角数据及更新法规部经理数据 + if (i > 0){ + //更新a用户的审核状态为驳回 + QueryWrapper tempA = new QueryWrapper<>(); + tempA.eq("business_id",businessId).eq("role_id",PromptSuccess.DB_A_ID); + DgGuaranteeLetterAssignUser dgGuaranteeLetterAssignUserA = baseMapper.selectOne(tempA); + dgGuaranteeLetterAssignUserA.setStatus(StatusCode.SP_REJECT); + baseMapper.updateById(dgGuaranteeLetterAssignUserA); + + //更新法规部经理的审核状态为驳回,操作状态为待处理 + QueryWrapper tempFG = new QueryWrapper<>(); + tempFG.eq("business_id",businessId).eq("role_id",PromptSuccess.FG_JL_ID); + DgGuaranteeLetterAssignUser dgGuaranteeLetterAssignUserFG = baseMapper.selectOne(tempFG); + dgGuaranteeLetterAssignUserFG.setStatus(StatusCode.SP_REJECT); + dgGuaranteeLetterAssignUserFG.setOperatingStatus(StatusCode.CZ_ON_HAND); + int update = baseMapper.updateById(dgGuaranteeLetterAssignUserFG); + //添加成功,返回操作结果 + log.info(update > 0 ? "b角驳回更新成功" : "b角驳回更新失败"); + return update > 0; + } } } } + //一个判断都不走,直接返回false log.info("《《《《《数据更新失败,请确保数据完整》》》》》"); return false; 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 cb7307ab..9b7b4037 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 @@ -8,6 +8,7 @@ import com.daqing.financial.guarantee.mapper.DgLoanNoticeMapper; import com.daqing.financial.guarantee.mapper.DgPaymentConfirmationConsiderMapper; import com.daqing.financial.guarantee.model.request.PaymentConfirmationQueryRequest; import com.daqing.financial.guarantee.model.request.PaymentConfirmationUpdateRequest; +import com.daqing.financial.guarantee.model.response.GuaranteeLetterListResponse; import com.daqing.financial.guarantee.model.response.PaymentConfirmationListResponse; import com.daqing.financial.guarantee.service.IDgPaymentConfirmationConsiderService; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; @@ -16,10 +17,17 @@ import com.daqing.framework.domain.guarantee.DgLoanNotice; import com.daqing.framework.domain.guarantee.DgPaymentConfirmationConsider; import com.daqing.framework.model.StatusCode; import com.daqing.framework.model.response.PromptSuccess; +import com.daqing.framework.util.RedisUtil; import com.daqing.framework.utils.PageUtils; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; + +import javax.servlet.http.HttpServletRequest; +import java.util.Arrays; +import java.util.List; /** *

@@ -39,17 +47,35 @@ public class DgPaymentConfirmationConsiderServiceImpl extends ServiceImpl paymentConfirmationVO = baseMapper.pageByCondition(new Page(page,size),roleId,status,customerNumberOrName); + + //获取当前登录用户id + Integer userId = Integer.parseInt(this.getUserId()); + + //获取当前用户拥有的角色ids + String roleIds = RedisUtil.get("dq:userRole:" + userId); + IPage paymentConfirmationVO = null; + if(roleIds != null) { + String[] ids = roleIds.split(","); + List roleIdList = Arrays.asList(ids); + //分页条件查询 + paymentConfirmationVO = baseMapper.pageByCondition(new Page(page,size),roleIdList,status,customerNumberOrName); + } return new PageUtils(paymentConfirmationVO); } diff --git a/dq-financial-guarantee/src/main/resources/mapper/guarantee/DgGuaranteeLetterAssignUserMapper.xml b/dq-financial-guarantee/src/main/resources/mapper/guarantee/DgGuaranteeLetterAssignUserMapper.xml index 5bef8979..23b72cec 100644 --- a/dq-financial-guarantee/src/main/resources/mapper/guarantee/DgGuaranteeLetterAssignUserMapper.xml +++ b/dq-financial-guarantee/src/main/resources/mapper/guarantee/DgGuaranteeLetterAssignUserMapper.xml @@ -41,11 +41,12 @@ left join dg_loan_committee_consider lcc on lau.business_id = lcc.business_id left join dg_business_process_status bps on lau.business_id = bps.business_id - - AND lau.role_id = #{roleId} - + lau.role_id in + + #{id} + - and lau.user_id = #{userId} + AND (lau.user_id = #{userId} or lau.user_id is null) AND aai.business_code LIKE CONCAT('%',#{customerNumberOrName},'%') OR cc.name LIKE CONCAT('%',#{customerNumberOrName},'%') diff --git a/dq-financial-guarantee/src/main/resources/mapper/guarantee/DgPaymentConfirmationConsiderMapper.xml b/dq-financial-guarantee/src/main/resources/mapper/guarantee/DgPaymentConfirmationConsiderMapper.xml index c176490c..6112e43f 100644 --- a/dq-financial-guarantee/src/main/resources/mapper/guarantee/DgPaymentConfirmationConsiderMapper.xml +++ b/dq-financial-guarantee/src/main/resources/mapper/guarantee/DgPaymentConfirmationConsiderMapper.xml @@ -42,7 +42,13 @@ left join dg_loan_committee_consider lcc on pcc.business_id = lcc.business_id left join dg_business_process_status bps on pcc.business_id = bps.business_id - AND pcc.role_id = #{roleId} + pcc.role_id in + + #{id} + + + AND (pcc.user_id = #{userId} or pcc.user_id is null) + AND aai.business_code LIKE CONCAT('%',#{customerNumberOrName},'%') OR cc.name LIKE CONCAT('%',#{customerNumberOrName},'%')