|
|
@ -5,8 +5,10 @@ import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
|
|
import com.daqing.financial.guarantee.controller.DgApplyAmountInfoController; |
|
|
|
import com.daqing.financial.guarantee.controller.DgApplyAmountInfoController; |
|
|
|
import com.daqing.financial.guarantee.feign.CrmsFeignService; |
|
|
|
import com.daqing.financial.guarantee.feign.CrmsFeignService; |
|
|
|
|
|
|
|
import com.daqing.financial.guarantee.feign.HrmsFeignService; |
|
|
|
import com.daqing.financial.guarantee.mapper.*; |
|
|
|
import com.daqing.financial.guarantee.mapper.*; |
|
|
|
import com.daqing.financial.guarantee.model.request.ApprovalGuaranteeRequest; |
|
|
|
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.request.InvestigateGuaranteeRequest; |
|
|
|
import com.daqing.financial.guarantee.model.response.*; |
|
|
|
import com.daqing.financial.guarantee.model.response.*; |
|
|
|
import com.daqing.financial.guarantee.service.IDgGuaranteeAssignUserService; |
|
|
|
import com.daqing.financial.guarantee.service.IDgGuaranteeAssignUserService; |
|
|
@ -16,7 +18,9 @@ import com.daqing.financial.guarantee.util.AuditProcessUtil; |
|
|
|
import com.daqing.framework.domain.crms.request.DgApplyAmountInfoRequest; |
|
|
|
import com.daqing.framework.domain.crms.request.DgApplyAmountInfoRequest; |
|
|
|
import com.daqing.framework.domain.crms.response.CrmsCode; |
|
|
|
import com.daqing.framework.domain.crms.response.CrmsCode; |
|
|
|
import com.daqing.framework.domain.guarantee.*; |
|
|
|
import com.daqing.framework.domain.guarantee.*; |
|
|
|
|
|
|
|
import com.daqing.framework.domain.guarantee.po.DgGuaranteePO; |
|
|
|
import com.daqing.framework.domain.guarantee.response.EmployeeMessageResponse; |
|
|
|
import com.daqing.framework.domain.guarantee.response.EmployeeMessageResponse; |
|
|
|
|
|
|
|
import com.daqing.framework.domain.hrms.response.HrmsCode; |
|
|
|
import com.daqing.framework.exception.ExceptionCast; |
|
|
|
import com.daqing.framework.exception.ExceptionCast; |
|
|
|
import com.daqing.framework.model.StatusCode; |
|
|
|
import com.daqing.framework.model.StatusCode; |
|
|
|
import com.daqing.framework.model.response.PromptSuccess; |
|
|
|
import com.daqing.framework.model.response.PromptSuccess; |
|
|
@ -70,6 +74,11 @@ public class DgGuaranteeAssignUserServiceImpl extends ServiceImpl<DgGuaranteeAss |
|
|
|
@Resource |
|
|
|
@Resource |
|
|
|
private DgLoanCommitteeConsiderMapper dgLoanCommitteeConsiderMapper; |
|
|
|
private DgLoanCommitteeConsiderMapper dgLoanCommitteeConsiderMapper; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
|
|
|
|
private DgGuaranteeAssignUserMapper dgGuaranteeAssignUserMapper; |
|
|
|
|
|
|
|
@Resource |
|
|
|
|
|
|
|
private HrmsFeignService hrmsFeignService; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public PageUtils queryPage(Integer page, Integer size, String customerNumberOrName, List<String> roleIdlist, String userId, Integer status) { |
|
|
|
public PageUtils queryPage(Integer page, Integer size, String customerNumberOrName, List<String> roleIdlist, String userId, Integer status) { |
|
|
@ -269,6 +278,12 @@ public class DgGuaranteeAssignUserServiceImpl extends ServiceImpl<DgGuaranteeAss |
|
|
|
dgInvestigation.setAuditStatus(StatusCode.SP_IN_REVIEW);//审核中
|
|
|
|
dgInvestigation.setAuditStatus(StatusCode.SP_IN_REVIEW);//审核中
|
|
|
|
dgComplianceInvestigationMapper.update(dgInvestigation, new QueryWrapper<DgComplianceInvestigation>() |
|
|
|
dgComplianceInvestigationMapper.update(dgInvestigation, new QueryWrapper<DgComplianceInvestigation>() |
|
|
|
.eq("business_id", guaranteeAssignUser.getBusinessId())); |
|
|
|
.eq("business_id", guaranteeAssignUser.getBusinessId())); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//修改担保业务审批状态为已审核
|
|
|
|
|
|
|
|
DgGuaranteeAssignUser assignUser = new DgGuaranteeAssignUser(); |
|
|
|
|
|
|
|
assignUser.setStatus(StatusCode.SP_REVIEWED);//已审核
|
|
|
|
|
|
|
|
this.baseMapper.update(assignUser, new QueryWrapper<DgGuaranteeAssignUser>() |
|
|
|
|
|
|
|
.eq("business_id", guaranteeAssignUser.getBusinessId())); |
|
|
|
} |
|
|
|
} |
|
|
|
} else if (consider != null && consider.getStatus().equals(StatusCode.SP_REJECT) && consider.getOperatingStatus().equals(StatusCode.CZ_PROCESSED) |
|
|
|
} else if (consider != null && consider.getStatus().equals(StatusCode.SP_REJECT) && consider.getOperatingStatus().equals(StatusCode.CZ_PROCESSED) |
|
|
|
&& guaranteeAssignUser.getStatus().equals(StatusCode.SP_REJECT)) {//贷审会业务流程驳回情况处理
|
|
|
|
&& guaranteeAssignUser.getStatus().equals(StatusCode.SP_REJECT)) {//贷审会业务流程驳回情况处理
|
|
|
@ -284,8 +299,13 @@ public class DgGuaranteeAssignUserServiceImpl extends ServiceImpl<DgGuaranteeAss |
|
|
|
dgConsider.setStatus(StatusCode.SP_IN_REVIEW);//审核中
|
|
|
|
dgConsider.setStatus(StatusCode.SP_IN_REVIEW);//审核中
|
|
|
|
dgLoanCommitteeConsiderMapper.update(dgConsider, new QueryWrapper<DgLoanCommitteeConsider>() |
|
|
|
dgLoanCommitteeConsiderMapper.update(dgConsider, new QueryWrapper<DgLoanCommitteeConsider>() |
|
|
|
.eq("business_id", guaranteeAssignUser.getBusinessId())); |
|
|
|
.eq("business_id", guaranteeAssignUser.getBusinessId())); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//修改担保业务审批状态为已审核
|
|
|
|
|
|
|
|
DgGuaranteeAssignUser assignUser = new DgGuaranteeAssignUser(); |
|
|
|
|
|
|
|
assignUser.setStatus(StatusCode.SP_REVIEWED);//已审核
|
|
|
|
|
|
|
|
this.baseMapper.update(assignUser, new QueryWrapper<DgGuaranteeAssignUser>() |
|
|
|
|
|
|
|
.eq("business_id", guaranteeAssignUser.getBusinessId())); |
|
|
|
|
|
|
|
} |
|
|
|
} else {//正常情况处理
|
|
|
|
} else {//正常情况处理
|
|
|
|
DgGuaranteeAssignUser assignUser = new DgGuaranteeAssignUser(); |
|
|
|
DgGuaranteeAssignUser assignUser = new DgGuaranteeAssignUser(); |
|
|
|
assignUser.setRoleId(PromptSuccess.DB_JL_ID);//担保部经理
|
|
|
|
assignUser.setRoleId(PromptSuccess.DB_JL_ID);//担保部经理
|
|
|
@ -316,9 +336,16 @@ public class DgGuaranteeAssignUserServiceImpl extends ServiceImpl<DgGuaranteeAss |
|
|
|
//附件新增
|
|
|
|
//附件新增
|
|
|
|
dgEnclosureInfoMapper.insert(dgEnclosureInfo); |
|
|
|
dgEnclosureInfoMapper.insert(dgEnclosureInfo); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Integer type = guaranteeAssignUser.getType(); |
|
|
|
|
|
|
|
String deptName; |
|
|
|
|
|
|
|
if (type == 1) { |
|
|
|
|
|
|
|
deptName = "担保部A角"; |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
deptName = "担保部B角"; |
|
|
|
|
|
|
|
} |
|
|
|
//同时往审核流程进程表新增一条记录
|
|
|
|
//同时往审核流程进程表新增一条记录
|
|
|
|
String account = dgApplyAmountInfoController.getAccount(); |
|
|
|
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; |
|
|
|
return 1; |
|
|
|
} |
|
|
|
} |
|
|
@ -396,11 +423,6 @@ public class DgGuaranteeAssignUserServiceImpl extends ServiceImpl<DgGuaranteeAss |
|
|
|
assignUser.setStatus(StatusCode.SP_IN_REVIEW);//审批状态设置为审核中
|
|
|
|
assignUser.setStatus(StatusCode.SP_IN_REVIEW);//审批状态设置为审核中
|
|
|
|
assignUser.setOperatingStatus(StatusCode.CZ_ON_HAND);//操作状态设置为待处理
|
|
|
|
assignUser.setOperatingStatus(StatusCode.CZ_ON_HAND);//操作状态设置为待处理
|
|
|
|
this.baseMapper.insert(assignUser); |
|
|
|
this.baseMapper.insert(assignUser); |
|
|
|
|
|
|
|
|
|
|
|
//同时往审核流程进程表新增一条记录
|
|
|
|
|
|
|
|
String account = dgApplyAmountInfoController.getAccount(); |
|
|
|
|
|
|
|
AuditProcessUtil.save(guaranteeAssignUser.getBusinessId(),account,"担保部经理",approvalGuaranteeRequest.getApplyContent(),2); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} else if (approvalGuaranteeRequest.getStatus() == StatusCode.SP_REVIEWED && dgGuaranteeAssignUser.getOperatingStatus() == StatusCode.CZ_PROCESSED && guaranteeUser.getType() == 4) {//担保部领导审核通过
|
|
|
|
} else if (approvalGuaranteeRequest.getStatus() == StatusCode.SP_REVIEWED && dgGuaranteeAssignUser.getOperatingStatus() == StatusCode.CZ_PROCESSED && guaranteeUser.getType() == 4) {//担保部领导审核通过
|
|
|
|
//如果担保部分管领导审核通过,同时判断资产部分管领导审核以及信息部分管领导审核是否通过,如果通过就往合规调查中插入一条数据
|
|
|
|
//如果担保部分管领导审核通过,同时判断资产部分管领导审核以及信息部分管领导审核是否通过,如果通过就往合规调查中插入一条数据
|
|
|
|
//如果信息部领导审核通过,则该子业务流程下的所有审批状态都为已审核状态
|
|
|
|
//如果信息部领导审核通过,则该子业务流程下的所有审批状态都为已审核状态
|
|
|
@ -427,12 +449,18 @@ public class DgGuaranteeAssignUserServiceImpl extends ServiceImpl<DgGuaranteeAss |
|
|
|
compliance.setAuditStatus(StatusCode.SP_TO_BE_ASSIGNED);//审核状态设置为待指派
|
|
|
|
compliance.setAuditStatus(StatusCode.SP_TO_BE_ASSIGNED);//审核状态设置为待指派
|
|
|
|
dgComplianceInvestigationMapper.insert(compliance); |
|
|
|
dgComplianceInvestigationMapper.insert(compliance); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
Integer type = guaranteeUser.getType(); |
|
|
|
|
|
|
|
String deptName; |
|
|
|
|
|
|
|
if (type == 3) { |
|
|
|
|
|
|
|
deptName = "担保部经理"; |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
deptName = "担保部分管领导"; |
|
|
|
|
|
|
|
} |
|
|
|
//同时往审核流程进程表新增一条记录
|
|
|
|
//同时往审核流程进程表新增一条记录
|
|
|
|
String account = dgApplyAmountInfoController.getAccount(); |
|
|
|
String account = dgApplyAmountInfoController.getAccount(); |
|
|
|
AuditProcessUtil.save(guaranteeUser.getBusinessId(),account,"担保部分管领导",approvalGuaranteeRequest.getApplyContent(),2); |
|
|
|
AuditProcessUtil.save(guaranteeUser.getBusinessId(), account, deptName, approvalGuaranteeRequest.getApplyContent(), 2); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return 1; |
|
|
|
return 1; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -451,5 +479,84 @@ public class DgGuaranteeAssignUserServiceImpl extends ServiceImpl<DgGuaranteeAss |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public ResponseResult assignCorners(GuaranteeRequest guaranteeRequest) { |
|
|
|
|
|
|
|
//A,B角用户id不能选择同一个人
|
|
|
|
|
|
|
|
if (guaranteeRequest.getEmpAId().equals(guaranteeRequest.getEmpBId())) { |
|
|
|
|
|
|
|
ExceptionCast.cast(HrmsCode.EMP_SAME); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
//判断即将被指派成A角的用户id以及B角的用户id是否在当前业务中已被指派
|
|
|
|
|
|
|
|
//查询empAId,empBId在资产部调查中是否被指派
|
|
|
|
|
|
|
|
Integer count1 = dgAssetsInvestigationMapper.selectCount(new QueryWrapper<DgAssetsInvestigation>() |
|
|
|
|
|
|
|
.eq("business_id", guaranteeRequest.getBusinessId()) |
|
|
|
|
|
|
|
.eq("type", 1).eq("emp_id", guaranteeRequest.getEmpAId())); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Integer count = dgAssetsInvestigationMapper.selectCount(new QueryWrapper<DgAssetsInvestigation>() |
|
|
|
|
|
|
|
.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<DgMessageInvestigation>() |
|
|
|
|
|
|
|
.eq("business_id", guaranteeRequest.getBusinessId()) |
|
|
|
|
|
|
|
.eq("type", 1).eq("emp_id", guaranteeRequest.getEmpAId())); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Integer count3 = dgMessageInvestigationMapper.selectCount(new QueryWrapper<DgMessageInvestigation>() |
|
|
|
|
|
|
|
.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<DgGuaranteePO> 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(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|