diff --git a/dq-financial-crms/src/main/java/com/daqing/financial/crms/model/request/CompanyCustomerRequest.java b/dq-financial-crms/src/main/java/com/daqing/financial/crms/model/request/CompanyCustomerRequest.java index 18bfa20c..2b911495 100644 --- a/dq-financial-crms/src/main/java/com/daqing/financial/crms/model/request/CompanyCustomerRequest.java +++ b/dq-financial-crms/src/main/java/com/daqing/financial/crms/model/request/CompanyCustomerRequest.java @@ -85,7 +85,7 @@ public class CompanyCustomerRequest implements Serializable { private String legalName; @ApiModelProperty(value = "法人-性别 1、男,0、女") - private String legalGender; + private Integer legalGender; @ApiModelProperty(value = "法人-身份证号") private String legalIdNumber; diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgGuaranteeAssignUserController.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgGuaranteeAssignUserController.java index eacef93f..39c36fe4 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgGuaranteeAssignUserController.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgGuaranteeAssignUserController.java @@ -10,6 +10,8 @@ import com.daqing.financial.guarantee.model.response.GuaranteeDetailResponse; import com.daqing.financial.guarantee.service.IDgGuaranteeAssignUserService; import com.daqing.framework.domain.guarantee.DgGuaranteeAssignUser; import com.daqing.framework.domain.guarantee.po.DgGuaranteePO; +import com.daqing.framework.domain.hrms.response.HrmsCode; +import com.daqing.framework.exception.ExceptionCast; import com.daqing.framework.model.StatusCode; import com.daqing.framework.model.response.PromptSuccess; import com.daqing.framework.model.response.ResponseResult; @@ -46,12 +48,6 @@ public class DgGuaranteeAssignUserController { @Autowired private IDgGuaranteeAssignUserService dgGuaranteeAssignUserService; - @Resource - private DgGuaranteeAssignUserMapper dgGuaranteeAssignUserMapper; - - @Resource - private HrmsFeignService hrmsFeignService; - /** * 担保部调查列表 * @param @@ -69,22 +65,9 @@ public class DgGuaranteeAssignUserController { PageUtils data = null; if(roleIds != null) { String[] ids = roleIds.split(","); - List roleIdlist = Arrays.asList(ids); data = dgGuaranteeAssignUserService.queryPage(page, size, CustomerNumberOrName, roleIdlist, userId, status); - -/* String A = String.valueOf(PromptSuccess.DB_A_ID); - String B = String.valueOf(PromptSuccess.DB_B_ID); - //判断角色数组中是否包含A角或者B角元素 - Boolean f = Arrays.asList(ids).contains(A); - Boolean g = Arrays.asList(ids).contains(B); - - if (f.equals(true) || g.equals(true)) {//如果存在A,B元素,则要根据角色以及用户id查询列表 - data = dgGuaranteeAssignUserService.queryPage(page, size, CustomerNumberOrName, roleIdlist, userId); - } else { - data = dgGuaranteeAssignUserService.queryPage(page, size, CustomerNumberOrName, roleIdlist, null); - }*/ } return new ResponseResult().SUCCESS(data); @@ -112,52 +95,7 @@ public class DgGuaranteeAssignUserController { @Transactional public ResponseResult assignCorners(@RequestBody GuaranteeRequest guaranteeRequest){ - //根据主键id修改当前记录状态为审核中,操作状态为已处理,设置审批人id为当前用户id - //获取当前登录用户userId - String userId = dgApplyAmountInfoController.getUserId(); - DgGuaranteeAssignUser guaranteeAssignUser = new DgGuaranteeAssignUser(); - guaranteeAssignUser.setStatus(StatusCode.SP_IN_REVIEW);//状态设置为审核中 - guaranteeAssignUser.setOperatingStatus(StatusCode.CZ_PROCESSED);//操作状态设置为已处理 - guaranteeAssignUser.setEmpId(Integer.parseInt(userId)); - guaranteeAssignUser.setId(guaranteeRequest.getId()); - dgGuaranteeAssignUserMapper.updateById(guaranteeAssignUser); - - //新增A角记录到担保部记录表 - DgGuaranteeAssignUser dgGuaranteeAssignUser = new DgGuaranteeAssignUser(); - dgGuaranteeAssignUser.setBusinessId(guaranteeRequest.getBusinessId());//业务id - dgGuaranteeAssignUser.setCompanyId(guaranteeRequest.getCompanyId());//企业id - dgGuaranteeAssignUser.setEmpId(guaranteeRequest.getEmpAId());//用户A角id - dgGuaranteeAssignUser.setRoleId(PromptSuccess.DB_A_ID);//角色设置为A角 - dgGuaranteeAssignUser.setType(1);//A角操作 - dgGuaranteeAssignUser.setStatus(StatusCode.SP_IN_REVIEW);//审批状态为审核中 - dgGuaranteeAssignUser.setOperatingStatus(StatusCode.CZ_ON_HAND);//操作状态设置为待处理 - dgGuaranteeAssignUserMapper.insert(dgGuaranteeAssignUser); - //新增B角记录到担保部记录表 - DgGuaranteeAssignUser dgGuaranteeAssignUser2 = new DgGuaranteeAssignUser(); - dgGuaranteeAssignUser2.setBusinessId(guaranteeRequest.getBusinessId());//业务id - dgGuaranteeAssignUser2.setCompanyId(guaranteeRequest.getCompanyId());//企业id - dgGuaranteeAssignUser2.setEmpId(guaranteeRequest.getEmpBId());//用户B角id - dgGuaranteeAssignUser2.setRoleId(PromptSuccess.DB_B_ID);//角色设置为B角 - dgGuaranteeAssignUser2.setType(2);//B角操作 - dgGuaranteeAssignUser2.setStatus(StatusCode.SP_IN_REVIEW);//审批状态为审核中 - dgGuaranteeAssignUser2.setOperatingStatus(StatusCode.CZ_ON_HAND);//操作状态设置为待处理 - dgGuaranteeAssignUserMapper.insert(dgGuaranteeAssignUser2); - - List list = new ArrayList(); - DgGuaranteePO dgGuaranteePO1 = new DgGuaranteePO(); - dgGuaranteePO1.setUserId(guaranteeRequest.getEmpAId().longValue()); - dgGuaranteePO1.setRoleId(PromptSuccess.DB_A_ID.longValue()); - DgGuaranteePO dgGuaranteePO2 = new DgGuaranteePO(); - dgGuaranteePO2.setUserId(guaranteeRequest.getEmpBId().longValue()); - dgGuaranteePO2.setRoleId(PromptSuccess.DB_B_ID.longValue()); - list.add(dgGuaranteePO1); - list.add(dgGuaranteePO2); - //批量绑定角色关系 - hrmsFeignService.insertUsrRole(list); - - //hrmsFeignService.insertUserRole(guaranteeRequest.getEmpAId().longValue(),PromptSuccess.DB_A_ID.longValue()); - //hrmsFeignService.insertUserRole(guaranteeRequest.getEmpBId().longValue(),PromptSuccess.DB_B_ID.longValue()); - return new ResponseResult().SUCCESS(); + return dgGuaranteeAssignUserService.assignCorners(guaranteeRequest); } diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/request/BusinessApplicationRequest.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/request/BusinessApplicationRequest.java index b675274e..dc9e7872 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/request/BusinessApplicationRequest.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/request/BusinessApplicationRequest.java @@ -82,6 +82,9 @@ public class BusinessApplicationRequest implements Serializable { @ApiModelProperty(value = "反担保措施描述") private String description; + @ApiModelProperty(value = "客户类型") + private String customerType; + /** * 业务类型 */ diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/DgApplyAmountInfoResponse.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/DgApplyAmountInfoResponse.java index e560289e..2b78cc44 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/DgApplyAmountInfoResponse.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/DgApplyAmountInfoResponse.java @@ -73,6 +73,11 @@ public class DgApplyAmountInfoResponse implements Serializable { */ private String enGuaranteeMeasures; + /** + * 客户类型 + */ + private String customerType; + /** * 业务类型 */ diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/IDgGuaranteeAssignUserService.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/IDgGuaranteeAssignUserService.java index c2e51508..606889df 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/IDgGuaranteeAssignUserService.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/IDgGuaranteeAssignUserService.java @@ -2,9 +2,11 @@ package com.daqing.financial.guarantee.service; import com.baomidou.mybatisplus.extension.service.IService; import com.daqing.financial.guarantee.model.request.ApprovalGuaranteeRequest; +import com.daqing.financial.guarantee.model.request.GuaranteeRequest; import com.daqing.financial.guarantee.model.request.InvestigateGuaranteeRequest; import com.daqing.financial.guarantee.model.response.GuaranteeDetailResponse; import com.daqing.framework.domain.guarantee.DgGuaranteeAssignUser; +import com.daqing.framework.model.response.ResponseResult; import com.daqing.framework.utils.PageUtils; import javax.servlet.http.HttpServletResponse; @@ -29,4 +31,6 @@ public interface IDgGuaranteeAssignUserService extends IService ids, HttpServletResponse response); + + ResponseResult assignCorners(GuaranteeRequest guaranteeRequest); } diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgApplyAmountInfoServiceImpl.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgApplyAmountInfoServiceImpl.java index 968cc051..e3c9db5e 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgApplyAmountInfoServiceImpl.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgApplyAmountInfoServiceImpl.java @@ -121,6 +121,7 @@ public class DgApplyAmountInfoServiceImpl extends ServiceImpl() + .eq("business_id", assetsRequest.getBusinessId()) + .eq("type", 1).eq("emp_id", assetsRequest.getEmpId())); + + Integer count = dgGuaranteeAssignUserMapper.selectCount(new QueryWrapper() + .eq("business_id", assetsRequest.getBusinessId()) + .eq("type", 2).eq("emp_id", assetsRequest.getEmpId())); + if(count1 >0 || count >0){//已被指派情况下直接返回 + ExceptionCast.cast(HrmsCode.EMP_TO_BE_CHOOSE); + } + + //查询empId在信息部调查中是否被指派 + Integer count2 = dgMessageInvestigationMapper.selectCount(new QueryWrapper() + .eq("business_id", assetsRequest.getBusinessId()) + .eq("type", 1).eq("emp_id", assetsRequest.getEmpId())); + + if(count2 >0 ){//已被指派情况下直接返回 + ExceptionCast.cast(HrmsCode.EMP_TO_BE_CHOOSE); + } //根据主键id修改当前记录状态为审核中,操作状态为已处理,设置审批人id为当前用户id //获取当前登录用户userId @@ -355,11 +377,6 @@ public class DgAssetsInvestigationServiceImpl extends ServiceImpl roleIdlist, String userId, Integer status) { @@ -80,7 +89,7 @@ public class DgGuaranteeAssignUserServiceImpl extends ServiceImpl positionVO = this.getBaseMapper().pageByCondition(new Page(page, size),customerNumberOrName,roleIdlist,userId,status); + IPage positionVO = this.getBaseMapper().pageByCondition(new Page(page, size), customerNumberOrName, roleIdlist, userId, status); return new PageUtils(positionVO); } @@ -92,29 +101,29 @@ public class DgGuaranteeAssignUserServiceImpl extends ServiceImpl0){ - String a = measures.substring(1,measures.length()-1); - String arry[]=a.split(","); + String measures = dgApplyAmountInfo.getEnGuaranteeMeasures(); + if (measures.length() > 0) { + String a = measures.substring(1, measures.length() - 1); + String arry[] = a.split(","); List demoList = Arrays.asList(arry); dgApplyAmountInfo.setEnGuaranteeMeasure(demoList); - System.out.println("arry==============="+demoList); + System.out.println("arry===============" + demoList); } - System.out.println("业务申请详细========="+dgApplyAmountInfo); + System.out.println("业务申请详细=========" + dgApplyAmountInfo); DgApplyAmountInfoRequest applyAmountInfo = new DgApplyAmountInfoRequest(); applyAmountInfo.setCompanyId(dgApplyAmountInfo.getCompanyId()); //根据企业id查询企业详情 ResponseResult result = crmsFeignService.queryCustomerInfoById(applyAmountInfo); - LinkedHashMap linkedList = (LinkedHashMap)result.getData(); - System.out.println("企业详细============"+linkedList); + LinkedHashMap linkedList = (LinkedHashMap) result.getData(); + System.out.println("企业详细============" + linkedList); //查询附件详细,附件关联业务主键id DgEnclosureInfoResponse dgEnclosureInfo = dgEnclosureInfoMapper.selectByCompanyId(guaranteeAssignUser.getBusinessId()); - Listlist = new ArrayList<>(); + List list = new ArrayList<>(); list.add(dgEnclosureInfo.getAccountingFirm()); list.add(dgEnclosureInfo.getAssessmentReport()); list.add(dgEnclosureInfo.getBusinessLicense()); @@ -132,16 +141,16 @@ public class DgGuaranteeAssignUserServiceImpl extends ServiceImpl(); - for(int i=0;i arr1List; - if(list.get(i)!=null){ - String a1 = list.get(i).substring(1,list.get(i).length()-1); - String arr1[]=a1.split(","); + if (list.get(i) != null) { + String a1 = list.get(i).substring(1, list.get(i).length() - 1); + String arr1[] = a1.split(","); arr1List = Arrays.asList(arr1); - arr1List2.add(i,arr1List); - System.out.println("arr1LIst===="+arr1List); - }else{ - arr1List2.add(i,null); + arr1List2.add(i, arr1List); + System.out.println("arr1LIst====" + arr1List); + } else { + arr1List2.add(i, null); } } dgEnclosureInfo.setAccountingFirmList((List) arr1List2.get(0)); @@ -159,12 +168,12 @@ public class DgGuaranteeAssignUserServiceImpl extends ServiceImpl) arr1List2.get(12)); dgEnclosureInfo.setMarriageCopyList((List) arr1List2.get(13)); - System.out.println("附件详细=============="+dgEnclosureInfo); + System.out.println("附件详细==============" + dgEnclosureInfo); //查询担保部经理审核的金额和期限 DgGuaranteeAssignUser assignUser = this.baseMapper.selectOne(new QueryWrapper() .eq("business_id", guaranteeAssignUser.getBusinessId()).eq("type", 3)); - GuaranteeDetailResponse guaranteeDetailResponse= new GuaranteeDetailResponse(); + GuaranteeDetailResponse guaranteeDetailResponse = new GuaranteeDetailResponse(); guaranteeDetailResponse.setDgApplyAmountInfo(dgApplyAmountInfo); guaranteeDetailResponse.setDgEnclosureInfo(dgEnclosureInfo); guaranteeDetailResponse.setLinkedHashMap(linkedList); @@ -179,7 +188,7 @@ public class DgGuaranteeAssignUserServiceImpl extends ServiceImpl().eq("business_id",guaranteeAssignUser.getBusinessId()) - .eq("type",1).eq("status",StatusCode.SP_REJECT).eq("operating_status",StatusCode.CZ_PROCESSED)); - int n = this.baseMapper.selectCount(new QueryWrapper().eq("business_id",guaranteeAssignUser.getBusinessId()) - .eq("type",2).eq("status",StatusCode.SP_REJECT).eq("operating_status",StatusCode.CZ_PROCESSED)); - int sum = i+n; + int i = this.baseMapper.selectCount(new QueryWrapper().eq("business_id", guaranteeAssignUser.getBusinessId()) + .eq("type", 1).eq("status", StatusCode.SP_REJECT).eq("operating_status", StatusCode.CZ_PROCESSED)); + int n = this.baseMapper.selectCount(new QueryWrapper().eq("business_id", guaranteeAssignUser.getBusinessId()) + .eq("type", 2).eq("status", StatusCode.SP_REJECT).eq("operating_status", StatusCode.CZ_PROCESSED)); + int sum = i + n; //如果A或B调查通过,审批状态仍然是驳回,操作状态改为已处理 - if(sum == 1){ + if (sum == 1) { DgGuaranteeAssignUser assignUser = new DgGuaranteeAssignUser(); assignUser.setId(investigateGuaranteeRequest.getId());//主键id assignUser.setStatus(StatusCode.SP_REJECT);//驳回 this.baseMapper.updateById(assignUser); } //判断AB角是否都调查通过,如果通过,则将担保部经理的状态改为待处理,同时所有的审批状态都变成审核中 - if(sum == 2){ + if (sum == 2) { DgGuaranteeAssignUser user = new DgGuaranteeAssignUser(); user.setStatus(StatusCode.SP_IN_REVIEW);//审核中 - this.baseMapper.update(user,new QueryWrapper() - .eq("business_id",guaranteeAssignUser.getBusinessId())); + this.baseMapper.update(user, new QueryWrapper() + .eq("business_id", guaranteeAssignUser.getBusinessId())); } - }else{ + } else { //AB角调查,修改审核意见以及状态 DgGuaranteeAssignUser dgGuaranteeAssignUser = new DgGuaranteeAssignUser(); dgGuaranteeAssignUser.setId(investigateGuaranteeRequest.getId());//主键id @@ -218,81 +227,92 @@ public class DgGuaranteeAssignUserServiceImpl extends ServiceImpl() - .eq("business_id",guaranteeAssignUser.getBusinessId()).eq("type",1)); + dgApplyAmountListMapper.update(dgApplyAmountList, new QueryWrapper() + .eq("business_id", guaranteeAssignUser.getBusinessId()).eq("type", 1)); //业务申请部分担保部经理审批状态设置为驳回,操作状态设置为已处理 - DgApplyAmountList applyAmountList= new DgApplyAmountList(); + DgApplyAmountList applyAmountList = new DgApplyAmountList(); applyAmountList.setStatus(StatusCode.SP_REJECT);//状态设置为驳回 applyAmountList.setOperatingStatus(StatusCode.CZ_PROCESSED);//操作状态设置为已处理 - dgApplyAmountListMapper.update(applyAmountList,new QueryWrapper() - .eq("business_id",guaranteeAssignUser.getBusinessId()).eq("type",2)); + dgApplyAmountListMapper.update(applyAmountList, new QueryWrapper() + .eq("business_id", guaranteeAssignUser.getBusinessId()).eq("type", 2)); //修改担保部调查下该业务的所有审批状态为驳回 DgGuaranteeAssignUser assignUser = new DgGuaranteeAssignUser(); assignUser.setStatus(StatusCode.SP_REJECT);//驳回 - this.baseMapper.update(assignUser,new QueryWrapper() - .eq("business_id",guaranteeAssignUser.getBusinessId())); + this.baseMapper.update(assignUser, new QueryWrapper() + .eq("business_id", guaranteeAssignUser.getBusinessId())); } //判断A角和B角是否都调查通过,如果都审核通过,修改担保部经理操作状态为待处理 - int a = this.baseMapper.selectCount(new QueryWrapper().eq("business_id",guaranteeAssignUser.getBusinessId()) - .eq("type",1).eq("status",StatusCode.SP_IN_REVIEW).eq("operating_status",StatusCode.CZ_PROCESSED)); - int b = this.baseMapper.selectCount(new QueryWrapper().eq("business_id",guaranteeAssignUser.getBusinessId()) - .eq("type",2).eq("status",StatusCode.SP_IN_REVIEW).eq("operating_status",StatusCode.CZ_PROCESSED)); - int sum2 = a+b; - if(sum2==2){ + int a = this.baseMapper.selectCount(new QueryWrapper().eq("business_id", guaranteeAssignUser.getBusinessId()) + .eq("type", 1).eq("status", StatusCode.SP_IN_REVIEW).eq("operating_status", StatusCode.CZ_PROCESSED)); + int b = this.baseMapper.selectCount(new QueryWrapper().eq("business_id", guaranteeAssignUser.getBusinessId()) + .eq("type", 2).eq("status", StatusCode.SP_IN_REVIEW).eq("operating_status", StatusCode.CZ_PROCESSED)); + int sum2 = a + b; + if (sum2 == 2) { //如果合规调查C角状态为驳回,并且操作状态为已处理,同时此条数据也是被驳回来的数据,则为合规调查驳回情况处理 DgComplianceInvestigation investigation = dgComplianceInvestigationMapper.selectOne(new QueryWrapper() - .eq("business_id", guaranteeAssignUser.getBusinessId()).eq("role_id",PromptSuccess.FG_C_ID)); + .eq("business_id", guaranteeAssignUser.getBusinessId()).eq("role_id", PromptSuccess.FG_C_ID)); //如果贷审会状态为驳回,并且操作状态为已处理,同时此条数据也是被驳回来的数据,则为贷审会驳回情况处理 DgLoanCommitteeConsider consider = dgLoanCommitteeConsiderMapper.selectOne(new QueryWrapper() .eq("business_id", guaranteeAssignUser.getBusinessId()).eq("role_id", PromptSuccess.DSH_ID)); - if(investigation != null && investigation.getAuditStatus().equals(StatusCode.SP_REJECT) && investigation.getOperationStatus().equals(StatusCode.CZ_PROCESSED) - && guaranteeAssignUser.getStatus().equals(StatusCode.SP_REJECT)){//合规调查驳回情况处理 + if (investigation != null && investigation.getAuditStatus().equals(StatusCode.SP_REJECT) && investigation.getOperationStatus().equals(StatusCode.CZ_PROCESSED) + && guaranteeAssignUser.getStatus().equals(StatusCode.SP_REJECT)) {//合规调查驳回情况处理 //调查通过,修改法规经理操作状态为待处理,其他子业务为审核中 - if(investigateGuaranteeRequest.getStatus().equals(StatusCode.SP_IN_REVIEW)){//如果调查通过 + if (investigateGuaranteeRequest.getStatus().equals(StatusCode.SP_IN_REVIEW)) {//如果调查通过 DgComplianceInvestigation dgCompliance = new DgComplianceInvestigation(); dgCompliance.setOperationStatus(StatusCode.CZ_ON_HAND);//待处理 - dgComplianceInvestigationMapper.update(dgCompliance,new QueryWrapper() - .eq("business_id",guaranteeAssignUser.getBusinessId()).eq("role_id",PromptSuccess.FG_JL_ID)); + dgComplianceInvestigationMapper.update(dgCompliance, new QueryWrapper() + .eq("business_id", guaranteeAssignUser.getBusinessId()).eq("role_id", PromptSuccess.FG_JL_ID)); DgComplianceInvestigation dgInvestigation = new DgComplianceInvestigation(); dgInvestigation.setAuditStatus(StatusCode.SP_IN_REVIEW);//审核中 - dgComplianceInvestigationMapper.update(dgInvestigation,new QueryWrapper() - .eq("business_id",guaranteeAssignUser.getBusinessId())); + dgComplianceInvestigationMapper.update(dgInvestigation, new QueryWrapper() + .eq("business_id", guaranteeAssignUser.getBusinessId())); + + //修改担保业务审批状态为已审核 + DgGuaranteeAssignUser assignUser = new DgGuaranteeAssignUser(); + assignUser.setStatus(StatusCode.SP_REVIEWED);//已审核 + this.baseMapper.update(assignUser, new QueryWrapper() + .eq("business_id", guaranteeAssignUser.getBusinessId())); } - }else if(consider != null && consider.getStatus().equals(StatusCode.SP_REJECT) && consider.getOperatingStatus().equals(StatusCode.CZ_PROCESSED) - && guaranteeAssignUser.getStatus().equals(StatusCode.SP_REJECT)){//贷审会业务流程驳回情况处理 + } else if (consider != null && consider.getStatus().equals(StatusCode.SP_REJECT) && consider.getOperatingStatus().equals(StatusCode.CZ_PROCESSED) + && guaranteeAssignUser.getStatus().equals(StatusCode.SP_REJECT)) {//贷审会业务流程驳回情况处理 //调查通过,修改贷审会操作状态为待处理,其他子业务为审核中 - if(investigateGuaranteeRequest.getStatus().equals(StatusCode.SP_IN_REVIEW)){//如果调查通过 + if (investigateGuaranteeRequest.getStatus().equals(StatusCode.SP_IN_REVIEW)) {//如果调查通过 DgLoanCommitteeConsider dgLoanCommittee = new DgLoanCommitteeConsider(); dgLoanCommittee.setOperatingStatus(StatusCode.CZ_ON_HAND);//待处理 - dgLoanCommitteeConsiderMapper.update(dgLoanCommittee,new QueryWrapper() - .eq("business_id",guaranteeAssignUser.getBusinessId()).eq("role_id",PromptSuccess.DSH_ID)); + dgLoanCommitteeConsiderMapper.update(dgLoanCommittee, new QueryWrapper() + .eq("business_id", guaranteeAssignUser.getBusinessId()).eq("role_id", PromptSuccess.DSH_ID)); DgLoanCommitteeConsider dgConsider = new DgLoanCommitteeConsider(); dgConsider.setStatus(StatusCode.SP_IN_REVIEW);//审核中 - dgLoanCommitteeConsiderMapper.update(dgConsider,new QueryWrapper() - .eq("business_id",guaranteeAssignUser.getBusinessId())); + dgLoanCommitteeConsiderMapper.update(dgConsider, new QueryWrapper() + .eq("business_id", guaranteeAssignUser.getBusinessId())); + + //修改担保业务审批状态为已审核 + DgGuaranteeAssignUser assignUser = new DgGuaranteeAssignUser(); + assignUser.setStatus(StatusCode.SP_REVIEWED);//已审核 + this.baseMapper.update(assignUser, new QueryWrapper() + .eq("business_id", guaranteeAssignUser.getBusinessId())); } - - }else{//正常情况处理 + } else {//正常情况处理 DgGuaranteeAssignUser assignUser = new DgGuaranteeAssignUser(); assignUser.setRoleId(PromptSuccess.DB_JL_ID);//担保部经理 assignUser.setStatus(StatusCode.SP_IN_REVIEW);//审批状态设置为审核中 assignUser.setOperatingStatus(StatusCode.CZ_ON_HAND);//操作状态设置为待处理 - this.baseMapper.update(assignUser,new QueryWrapper().eq("business_id",guaranteeAssignUser.getBusinessId()) - .eq("type",3)); + this.baseMapper.update(assignUser, new QueryWrapper().eq("business_id", guaranteeAssignUser.getBusinessId()) + .eq("type", 3)); } } @@ -312,13 +332,20 @@ public class DgGuaranteeAssignUserServiceImpl extends ServiceImpl().eq("business_id",guaranteeAssignUser.getBusinessId())); + dgEnclosureInfoMapper.delete(new QueryWrapper().eq("business_id", guaranteeAssignUser.getBusinessId())); //附件新增 dgEnclosureInfoMapper.insert(dgEnclosureInfo); + Integer type = guaranteeAssignUser.getType(); + String deptName; + if (type == 1) { + deptName = "担保部A角"; + } else { + deptName = "担保部B角"; + } //同时往审核流程进程表新增一条记录 String account = dgApplyAmountInfoController.getAccount(); - AuditProcessUtil.save(guaranteeAssignUser.getBusinessId(),account,"担保部A/B角",investigateGuaranteeRequest.getApplyContent(),2); + AuditProcessUtil.save(guaranteeAssignUser.getBusinessId(), account, deptName, investigateGuaranteeRequest.getApplyContent(), 2); return 1; } @@ -347,43 +374,43 @@ public class DgGuaranteeAssignUserServiceImpl extends ServiceImpl() - .eq("business_id",guaranteeUser.getBusinessId())); + this.baseMapper.update(assignUser, new QueryWrapper() + .eq("business_id", guaranteeUser.getBusinessId())); } //如果是处理驳回数据,如果审核通过,则将担保部调查业务下所有审批状态设置为审核中,担保领导这条记录操作状态设置为待处理 - if(guaranteeUser.getStatus().equals(StatusCode.SP_REJECT) && approvalGuaranteeRequest.getStatus().equals(StatusCode.SP_IN_REVIEW) && guaranteeUser.getType()==3){ + if (guaranteeUser.getStatus().equals(StatusCode.SP_REJECT) && approvalGuaranteeRequest.getStatus().equals(StatusCode.SP_IN_REVIEW) && guaranteeUser.getType() == 3) { DgGuaranteeAssignUser assignUser = new DgGuaranteeAssignUser(); assignUser.setStatus(StatusCode.SP_IN_REVIEW);//审核中 - this.baseMapper.update(assignUser,new QueryWrapper().eq("business_id",guaranteeUser.getBusinessId())); + this.baseMapper.update(assignUser, new QueryWrapper().eq("business_id", guaranteeUser.getBusinessId())); DgGuaranteeAssignUser user = new DgGuaranteeAssignUser(); user.setOperatingStatus(StatusCode.CZ_ON_HAND);//操作状态为待处理 - this.baseMapper.update(user,new QueryWrapper() - .eq("business_id",guaranteeUser.getBusinessId()).eq("type",4)); - }else if(approvalGuaranteeRequest.getStatus().equals(StatusCode.SP_REFUSE)){//如果为拒绝,业务状态则为已否决 + this.baseMapper.update(user, new QueryWrapper() + .eq("business_id", guaranteeUser.getBusinessId()).eq("type", 4)); + } else if (approvalGuaranteeRequest.getStatus().equals(StatusCode.SP_REFUSE)) {//如果为拒绝,业务状态则为已否决 DgBusinessProcessStatus processStatus = new DgBusinessProcessStatus(); processStatus.setBusinessId(guaranteeUser.getBusinessId()); processStatus.setBusinessStatus(StatusCode.YW_REJECTED);//业务状态设置为已否决 - dgBusinessProcessStatusMapper.update(processStatus,new QueryWrapper() - .eq("business_id",processStatus.getBusinessId())); - }else if(approvalGuaranteeRequest.getStatus().equals(StatusCode.SP_REJECT) && guaranteeUser.getType()==3){ + dgBusinessProcessStatusMapper.update(processStatus, new QueryWrapper() + .eq("business_id", processStatus.getBusinessId())); + } else if (approvalGuaranteeRequest.getStatus().equals(StatusCode.SP_REJECT) && guaranteeUser.getType() == 3) { //担保部经理驳回情况 //A,B角调查部分审批状态统一设置驳回,操作状态设置为待处理 - this.baseMapper.update(dgAssignUser,new QueryWrapper() - .eq("business_id",guaranteeUser.getBusinessId()).eq("type",1)); - this.baseMapper.update(dgAssignUser,new QueryWrapper() - .eq("business_id",guaranteeUser.getBusinessId()).eq("type",2)); - }else if(approvalGuaranteeRequest.getStatus().equals(StatusCode.SP_REJECT) && guaranteeUser.getType()==4){ + this.baseMapper.update(dgAssignUser, new QueryWrapper() + .eq("business_id", guaranteeUser.getBusinessId()).eq("type", 1)); + this.baseMapper.update(dgAssignUser, new QueryWrapper() + .eq("business_id", guaranteeUser.getBusinessId()).eq("type", 2)); + } else if (approvalGuaranteeRequest.getStatus().equals(StatusCode.SP_REJECT) && guaranteeUser.getType() == 4) { //担保部领导驳回情况 //担保部经理审批状态设置为驳回,操作状态设置为待处理 - this.baseMapper.update(dgAssignUser,new QueryWrapper() - .eq("business_id",guaranteeUser.getBusinessId()).eq("type",3)); - }else if(approvalGuaranteeRequest.getStatus()==StatusCode.SP_IN_REVIEW && dgGuaranteeAssignUser.getOperatingStatus()==StatusCode.CZ_PROCESSED && guaranteeUser.getType()==3){//担保部经理审核通过 + this.baseMapper.update(dgAssignUser, new QueryWrapper() + .eq("business_id", guaranteeUser.getBusinessId()).eq("type", 3)); + } else if (approvalGuaranteeRequest.getStatus() == StatusCode.SP_IN_REVIEW && dgGuaranteeAssignUser.getOperatingStatus() == StatusCode.CZ_PROCESSED && guaranteeUser.getType() == 3) {//担保部经理审核通过 //如果担保部经理审核通过,则往担保部分管领导处加一条记录,由分管领导审核 //根据主键id查询业务id DgGuaranteeAssignUser guaranteeAssignUser = this.getBaseMapper().selectById(approvalGuaranteeRequest.getId()); @@ -396,30 +423,25 @@ public class DgGuaranteeAssignUserServiceImpl extends ServiceImpl().eq("business_id",guaranteeUser.getBusinessId())); + this.baseMapper.update(user, new QueryWrapper().eq("business_id", guaranteeUser.getBusinessId())); //查看信息部分管领导是否审核通过 - int a=dgMessageInvestigationMapper.selectCount(new QueryWrapper() - .eq("business_id",guaranteeUser.getBusinessId()) - .eq("type",3).eq("status",StatusCode.SP_REVIEWED).eq("operating_status",StatusCode.CZ_PROCESSED)); + int a = dgMessageInvestigationMapper.selectCount(new QueryWrapper() + .eq("business_id", guaranteeUser.getBusinessId()) + .eq("type", 3).eq("status", StatusCode.SP_REVIEWED).eq("operating_status", StatusCode.CZ_PROCESSED)); //查看资产部分管领导是否审核通过 - int b=dgAssetsInvestigationMapper.selectCount(new QueryWrapper() - .eq("business_id",guaranteeUser.getBusinessId()) - .eq("type",3).eq("status",StatusCode.SP_REVIEWED).eq("operating_status",StatusCode.CZ_PROCESSED)); - int sum = a+b; - if(sum==2){ + int b = dgAssetsInvestigationMapper.selectCount(new QueryWrapper() + .eq("business_id", guaranteeUser.getBusinessId()) + .eq("type", 3).eq("status", StatusCode.SP_REVIEWED).eq("operating_status", StatusCode.CZ_PROCESSED)); + int sum = a + b; + if (sum == 2) { //新增记录到合规调查 - DgComplianceInvestigation compliance =new DgComplianceInvestigation(); + DgComplianceInvestigation compliance = new DgComplianceInvestigation(); compliance.setCompanyId(guaranteeUser.getCompanyId());//企业id compliance.setRoleId(PromptSuccess.FG_JL_ID);//角色id compliance.setBusinessId(guaranteeUser.getBusinessId());//业务id @@ -427,20 +449,26 @@ public class DgGuaranteeAssignUserServiceImpl extends ServiceImpl ids, HttpServletResponse response) { //根据ids查询业务申请列表信息 - ListguaranteeList = this.baseMapper.selectListByIds(ids); - System.out.println("applyList==========================="+guaranteeList); + List guaranteeList = this.baseMapper.selectListByIds(ids); + System.out.println("applyList===========================" + guaranteeList); try { ExcelUtil.writeExcelWithSheets(response, guaranteeList, "担保调查一览表", "businessApplication", new GuaranteeListResponse()) .finish(); @@ -451,5 +479,84 @@ public class DgGuaranteeAssignUserServiceImpl extends ServiceImpl() + .eq("business_id", guaranteeRequest.getBusinessId()) + .eq("type", 1).eq("emp_id", guaranteeRequest.getEmpAId())); + + Integer count = dgAssetsInvestigationMapper.selectCount(new QueryWrapper() + .eq("business_id", guaranteeRequest.getBusinessId()) + .eq("type", 1).eq("emp_id", guaranteeRequest.getEmpBId())); + if(count1 >0 || count >0){//已被指派情况下直接返回 + ExceptionCast.cast(HrmsCode.EMP_TO_BE_CHOOSE); + } + + //查询empAId,empBId在信息部调查中是否被指派 + Integer count2 = dgMessageInvestigationMapper.selectCount(new QueryWrapper() + .eq("business_id", guaranteeRequest.getBusinessId()) + .eq("type", 1).eq("emp_id", guaranteeRequest.getEmpAId())); + + Integer count3 = dgMessageInvestigationMapper.selectCount(new QueryWrapper() + .eq("business_id", guaranteeRequest.getBusinessId()) + .eq("type", 1).eq("emp_id", guaranteeRequest.getEmpBId())); + if(count2 >0 || count3 >0){//已被指派情况下直接返回 + ExceptionCast.cast(HrmsCode.EMP_TO_BE_CHOOSE); + } + //根据主键id修改当前记录状态为审核中,操作状态为已处理,设置审批人id为当前用户id + //获取当前登录用户userId + String userId = dgApplyAmountInfoController.getUserId(); + DgGuaranteeAssignUser guaranteeAssignUser = new DgGuaranteeAssignUser(); + guaranteeAssignUser.setStatus(StatusCode.SP_IN_REVIEW);//状态设置为审核中 + guaranteeAssignUser.setOperatingStatus(StatusCode.CZ_PROCESSED);//操作状态设置为已处理 + guaranteeAssignUser.setEmpId(Integer.parseInt(userId)); + guaranteeAssignUser.setId(guaranteeRequest.getId()); + dgGuaranteeAssignUserMapper.updateById(guaranteeAssignUser); + + //新增A角记录到担保部记录表 + DgGuaranteeAssignUser dgGuaranteeAssignUser = new DgGuaranteeAssignUser(); + dgGuaranteeAssignUser.setBusinessId(guaranteeRequest.getBusinessId());//业务id + dgGuaranteeAssignUser.setCompanyId(guaranteeRequest.getCompanyId());//企业id + dgGuaranteeAssignUser.setEmpId(guaranteeRequest.getEmpAId());//用户A角id + dgGuaranteeAssignUser.setRoleId(PromptSuccess.DB_A_ID);//角色设置为A角 + dgGuaranteeAssignUser.setType(1);//A角操作 + dgGuaranteeAssignUser.setStatus(StatusCode.SP_IN_REVIEW);//审批状态为审核中 + dgGuaranteeAssignUser.setOperatingStatus(StatusCode.CZ_ON_HAND);//操作状态设置为待处理 + dgGuaranteeAssignUserMapper.insert(dgGuaranteeAssignUser); + //新增B角记录到担保部记录表 + DgGuaranteeAssignUser dgGuaranteeAssignUser2 = new DgGuaranteeAssignUser(); + dgGuaranteeAssignUser2.setBusinessId(guaranteeRequest.getBusinessId());//业务id + dgGuaranteeAssignUser2.setCompanyId(guaranteeRequest.getCompanyId());//企业id + dgGuaranteeAssignUser2.setEmpId(guaranteeRequest.getEmpBId());//用户B角id + dgGuaranteeAssignUser2.setRoleId(PromptSuccess.DB_B_ID);//角色设置为B角 + dgGuaranteeAssignUser2.setType(2);//B角操作 + dgGuaranteeAssignUser2.setStatus(StatusCode.SP_IN_REVIEW);//审批状态为审核中 + dgGuaranteeAssignUser2.setOperatingStatus(StatusCode.CZ_ON_HAND);//操作状态设置为待处理 + dgGuaranteeAssignUserMapper.insert(dgGuaranteeAssignUser2); + + List list = new ArrayList(); + DgGuaranteePO dgGuaranteePO1 = new DgGuaranteePO(); + dgGuaranteePO1.setUserId(guaranteeRequest.getEmpAId().longValue()); + dgGuaranteePO1.setRoleId(PromptSuccess.DB_A_ID.longValue()); + DgGuaranteePO dgGuaranteePO2 = new DgGuaranteePO(); + dgGuaranteePO2.setUserId(guaranteeRequest.getEmpBId().longValue()); + dgGuaranteePO2.setRoleId(PromptSuccess.DB_B_ID.longValue()); + list.add(dgGuaranteePO1); + list.add(dgGuaranteePO2); + //批量绑定角色关系 + hrmsFeignService.insertUsrRole(list); + + //hrmsFeignService.insertUserRole(guaranteeRequest.getEmpAId().longValue(),PromptSuccess.DB_A_ID.longValue()); + //hrmsFeignService.insertUserRole(guaranteeRequest.getEmpBId().longValue(),PromptSuccess.DB_B_ID.longValue()); + return new ResponseResult(); + } + + } diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgMessageInvestigationServiceImpl.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgMessageInvestigationServiceImpl.java index 71dfb0a5..9997e4ad 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgMessageInvestigationServiceImpl.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgMessageInvestigationServiceImpl.java @@ -18,6 +18,7 @@ import com.daqing.financial.guarantee.util.AuditProcessUtil; import com.daqing.framework.domain.crms.request.DgApplyAmountInfoRequest; import com.daqing.framework.domain.crms.response.CrmsCode; import com.daqing.framework.domain.guarantee.*; +import com.daqing.framework.domain.hrms.response.HrmsCode; import com.daqing.framework.exception.ExceptionCast; import com.daqing.framework.model.StatusCode; import com.daqing.framework.model.response.PromptSuccess; @@ -88,6 +89,25 @@ public class DgMessageInvestigationServiceImpl extends ServiceImpl() + .eq("business_id", messageRequest.getBusinessId()) + .eq("type", 1).eq("emp_id", messageRequest.getEmpId())); + + Integer count = dgGuaranteeAssignUserMapper.selectCount(new QueryWrapper() + .eq("business_id", messageRequest.getBusinessId()) + .eq("type", 2).eq("emp_id", messageRequest.getEmpId())); + if(count1 >0 || count >0){//已被指派情况下直接返回 + ExceptionCast.cast(HrmsCode.EMP_TO_BE_CHOOSE); + } + + //查询empId在资产部调查中是否被指派 + Integer count2 = dgAssetsInvestigationMapper.selectCount(new QueryWrapper() + .eq("business_id", messageRequest.getBusinessId()) + .eq("type", 1).eq("emp_id", messageRequest.getEmpId())); + if(count2 >0 ){//已被指派情况下直接返回 + ExceptionCast.cast(HrmsCode.EMP_TO_BE_CHOOSE); + } //根据主键id修改当前记录状态为审核中,操作状态为已处理,设置审批人id为当前用户id //获取当前登录用户userId @@ -140,12 +160,14 @@ public class DgMessageInvestigationServiceImpl extends ServiceImpl() .eq("business_id", dgMessageInvestigation.getBusinessId()) .eq("type", 1)); - String files=messageInvestigation.getFile(); - if(files!=null){ - String a = files.substring(1,files.length()-1); - String arry[]=a.split(","); - List demoList = Arrays.asList(arry); - messageDetailResponse.setMessageFileList(demoList); + if(messageInvestigation != null){ + String files=messageInvestigation.getFile(); + if(files!=null){ + String a = files.substring(1,files.length()-1); + String arry[]=a.split(","); + List demoList = Arrays.asList(arry); + messageDetailResponse.setMessageFileList(demoList); + } } DgApplyAmountInfoRequest applyAmountInfo = new DgApplyAmountInfoRequest(); @@ -252,7 +274,6 @@ public class DgMessageInvestigationServiceImpl extends ServiceImpl + diff --git a/dq-financial-hrms-auth/src/main/resources/mapper/hrauth/RolePermissionMapper.xml b/dq-financial-hrms-auth/src/main/resources/mapper/hrauth/RolePermissionMapper.xml index 0ecf4749..9c784c8f 100644 --- a/dq-financial-hrms-auth/src/main/resources/mapper/hrauth/RolePermissionMapper.xml +++ b/dq-financial-hrms-auth/src/main/resources/mapper/hrauth/RolePermissionMapper.xml @@ -76,7 +76,7 @@ - delete from hrms_role where id=#{roleId} + update hrms_role set del_or_not = 1 where id=#{roleId} - select * from ( + /*select * from (*/ SELECT u.id, u.account , GROUP_CONCAT(er.role_id SEPARATOR ',') roleId @@ -227,11 +227,11 @@ AND u.account LIKE CONCAT('%',#{account},'%') GROUP BY u.id - )alias +/* )alias where (!FIND_IN_SET(59,roleId) AND !FIND_IN_SET(60,roleId) AND !FIND_IN_SET(63,roleId) AND !FIND_IN_SET(66,roleId) AND - !FIND_IN_SET(69,roleId)) or roleId is null + !FIND_IN_SET(69,roleId)) or roleId is null*/ diff --git a/dq-framework-model/src/main/java/com/daqing/framework/domain/guarantee/DgApplyAmountInfo.java b/dq-framework-model/src/main/java/com/daqing/framework/domain/guarantee/DgApplyAmountInfo.java index ced6ec01..723a419a 100644 --- a/dq-framework-model/src/main/java/com/daqing/framework/domain/guarantee/DgApplyAmountInfo.java +++ b/dq-framework-model/src/main/java/com/daqing/framework/domain/guarantee/DgApplyAmountInfo.java @@ -78,6 +78,11 @@ public class DgApplyAmountInfo implements Serializable { */ private String enGuaranteeMeasures; + /** + * 客户类型 + */ + private String customerType; + /** * 业务类型 */ diff --git a/dq-framework-model/src/main/java/com/daqing/framework/domain/hrms/response/HrmsCode.java b/dq-framework-model/src/main/java/com/daqing/framework/domain/hrms/response/HrmsCode.java index c32b47c0..ad6ee94d 100644 --- a/dq-framework-model/src/main/java/com/daqing/framework/domain/hrms/response/HrmsCode.java +++ b/dq-framework-model/src/main/java/com/daqing/framework/domain/hrms/response/HrmsCode.java @@ -75,7 +75,10 @@ public enum HrmsCode implements ResultCode { ROLE_EMP_EXIST(false,44001,"该角色有用户关联,不能删除!"), ROLE_NAME_EXIST(false,44002,"该角色名称已存在,请重新输入!"), - EMP_POSITION_EXSIT(false, 22006, "该职位下已关联员工!"); + EMP_POSITION_EXSIT(false, 22006, "该职位下已关联员工!"), + + EMP_SAME(false, 51001, "A,B角不能选同一个人!"), + EMP_TO_BE_CHOOSE(false, 51002, "该用户已经被指派!");