|
|
@ -2,27 +2,37 @@ package com.daqing.financial.guarantee.service.impl; |
|
|
|
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
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.feign.HrmsFeignService; |
|
|
|
import com.daqing.financial.guarantee.mapper.DgComplianceInvestigationMapper; |
|
|
|
import com.daqing.financial.guarantee.mapper.DgComplianceInvestigationMapper; |
|
|
|
import com.daqing.financial.guarantee.model.request.DgComplianceInvestigationRequest; |
|
|
|
import com.daqing.financial.guarantee.model.request.DgComplianceInvestigationRequest; |
|
|
|
import com.daqing.financial.guarantee.model.response.DgComplianceInvestigationResponse; |
|
|
|
import com.daqing.financial.guarantee.model.response.DgComplianceInvestigationResponse; |
|
|
|
import com.daqing.financial.guarantee.service.IDgComplianceInvestigationService; |
|
|
|
import com.daqing.financial.guarantee.service.IDgComplianceInvestigationService; |
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
|
|
|
|
|
|
|
import com.daqing.financial.guarantee.util.AuditProcessUtil; |
|
|
|
|
|
|
|
import com.daqing.framework.domain.crms.response.CrmsCode; |
|
|
|
import com.daqing.framework.domain.guarantee.DgComplianceInvestigation; |
|
|
|
import com.daqing.framework.domain.guarantee.DgComplianceInvestigation; |
|
|
|
|
|
|
|
import com.daqing.framework.domain.guarantee.DgWorkConferenceConsider; |
|
|
|
import com.daqing.framework.domain.guarantee.GuaranteeCode; |
|
|
|
import com.daqing.framework.domain.guarantee.GuaranteeCode; |
|
|
|
import com.daqing.framework.exception.ExceptionCast; |
|
|
|
import com.daqing.framework.exception.ExceptionCast; |
|
|
|
|
|
|
|
import com.daqing.framework.model.StatusCode; |
|
|
|
import com.daqing.framework.model.response.CommonCode; |
|
|
|
import com.daqing.framework.model.response.CommonCode; |
|
|
|
import com.daqing.framework.model.response.PromptSuccess; |
|
|
|
import com.daqing.framework.model.response.PromptSuccess; |
|
|
|
|
|
|
|
import com.daqing.framework.model.response.ResponseResult; |
|
|
|
import com.daqing.framework.util.RedisUtil; |
|
|
|
import com.daqing.framework.util.RedisUtil; |
|
|
|
import com.daqing.framework.utils.PageUtils; |
|
|
|
import com.daqing.framework.utils.PageUtils; |
|
|
|
|
|
|
|
import com.daqing.framework.utils.excel.ExcelUtil; |
|
|
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
import org.springframework.web.context.request.RequestContextHolder; |
|
|
|
import org.springframework.web.context.request.RequestContextHolder; |
|
|
|
import org.springframework.web.context.request.ServletRequestAttributes; |
|
|
|
import org.springframework.web.context.request.ServletRequestAttributes; |
|
|
|
|
|
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest; |
|
|
|
import javax.servlet.http.HttpServletRequest; |
|
|
|
import java.util.Arrays; |
|
|
|
import javax.servlet.http.HttpServletResponse; |
|
|
|
|
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.Date; |
|
|
|
import java.util.Date; |
|
|
|
import java.util.List; |
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
import java.util.Objects; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* <p> |
|
|
|
* <p> |
|
|
@ -36,6 +46,9 @@ import java.util.List; |
|
|
|
public class DgComplianceInvestigationServiceImpl extends ServiceImpl<DgComplianceInvestigationMapper, DgComplianceInvestigation> |
|
|
|
public class DgComplianceInvestigationServiceImpl extends ServiceImpl<DgComplianceInvestigationMapper, DgComplianceInvestigation> |
|
|
|
implements IDgComplianceInvestigationService { |
|
|
|
implements IDgComplianceInvestigationService { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
|
|
|
private HrmsFeignService hrmsFeignService; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 列表 |
|
|
|
* 列表 |
|
|
|
*/ |
|
|
|
*/ |
|
|
@ -45,29 +58,21 @@ public class DgComplianceInvestigationServiceImpl extends ServiceImpl<DgComplian |
|
|
|
page = 1; |
|
|
|
page = 1; |
|
|
|
size = 10; |
|
|
|
size = 10; |
|
|
|
} |
|
|
|
} |
|
|
|
String userId = this.getUserId(); |
|
|
|
/*String userId = this.getUserId(); |
|
|
|
// 获取当前登录用户的角色id
|
|
|
|
// 获取当前登录用户的角色id
|
|
|
|
String roleIdString = RedisUtil.get("dq:userRole:" + userId); |
|
|
|
String roleIdString = RedisUtil.get("dq:userRole:" + userId); |
|
|
|
if (roleIdString == null || roleIdString.length() == 0) { |
|
|
|
if (roleIdString == null || roleIdString.length() == 0) { |
|
|
|
ExceptionCast.cast(GuaranteeCode.ROLE_IS_NOT); |
|
|
|
ExceptionCast.cast(GuaranteeCode.ROLE_IS_NOT); |
|
|
|
} |
|
|
|
} |
|
|
|
String[] roleIds = roleIdString.split(","); |
|
|
|
String[] roleIds = roleIdString.split(",");*/ |
|
|
|
IPage<DgComplianceInvestigationResponse> list = new Page<>(); |
|
|
|
String userId = "1"; |
|
|
|
|
|
|
|
String[] roleIds = {"70"}; |
|
|
|
|
|
|
|
List<Integer> roleList = new ArrayList<>(); |
|
|
|
for (String roleId : roleIds) { |
|
|
|
for (String roleId : roleIds) { |
|
|
|
if (Integer.parseInt(roleId) == PromptSuccess.FG_JL_ID || Integer.parseInt(roleId) == PromptSuccess.FG_LD_ID){ |
|
|
|
roleList.add(Integer.parseInt(roleId)); |
|
|
|
// 当前角色都能看到的数据
|
|
|
|
|
|
|
|
list = this.getBaseMapper().list(new Page(page, size), dgComplianceInvestigationRequest, Integer.parseInt(roleId)); |
|
|
|
|
|
|
|
// 当前角色和用户同时满足才能看到的数据
|
|
|
|
|
|
|
|
IPage<DgComplianceInvestigationResponse> listByUserId = this.getBaseMapper().listByUserId(new Page(page, size), dgComplianceInvestigationRequest, Integer.parseInt(userId), Integer.parseInt(roleId)); |
|
|
|
|
|
|
|
list.getRecords().addAll(listByUserId.getRecords()); |
|
|
|
|
|
|
|
list.setTotal(list.getRecords().size()); |
|
|
|
|
|
|
|
list.setSize(list.getTotal() % size == 0 ? list.getTotal() / size : list.getTotal() / size + 1 ); |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
}else if (Integer.parseInt(roleId) == PromptSuccess.FG_C_ID){ |
|
|
|
|
|
|
|
list = this.getBaseMapper().listByUserId(new Page(page, size), dgComplianceInvestigationRequest, Integer.parseInt(userId), Integer.parseInt(roleId)); |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
IPage<DgComplianceInvestigationResponse> list = this.getBaseMapper().list(new Page(page, size), |
|
|
|
|
|
|
|
dgComplianceInvestigationRequest, roleList, Integer.parseInt(userId)); |
|
|
|
return new PageUtils(list); |
|
|
|
return new PageUtils(list); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -77,17 +82,35 @@ public class DgComplianceInvestigationServiceImpl extends ServiceImpl<DgComplian |
|
|
|
@Transactional |
|
|
|
@Transactional |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public Boolean assign(Integer iid, Integer userId) { |
|
|
|
public Boolean assign(Integer iid, Integer userId) { |
|
|
|
|
|
|
|
if (iid == null) { |
|
|
|
|
|
|
|
ExceptionCast.cast(CommonCode.INVALID_PARAM); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (userId == null) { |
|
|
|
|
|
|
|
ExceptionCast.cast(GuaranteeCode.COMPLIANCE_USER_NOT_NULL); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
// 指派
|
|
|
|
DgComplianceInvestigation complianceInvestigation = this.getComplianceInvestigation(iid); |
|
|
|
DgComplianceInvestigation complianceInvestigation = this.getComplianceInvestigation(iid); |
|
|
|
complianceInvestigation.setEmpId(userId); |
|
|
|
complianceInvestigation.setUserId(userId); |
|
|
|
|
|
|
|
complianceInvestigation.setRoleId(PromptSuccess.FG_C_ID); |
|
|
|
|
|
|
|
complianceInvestigation.setOperationStatus(StatusCode.CZ_ON_HAND); |
|
|
|
|
|
|
|
complianceInvestigation.setAuditStatus(StatusCode.SP_IN_REVIEW); |
|
|
|
complianceInvestigation.setCreateTime(new Date()); |
|
|
|
complianceInvestigation.setCreateTime(new Date()); |
|
|
|
complianceInvestigation.setUpdateTime(new Date()); |
|
|
|
complianceInvestigation.setUpdateTime(new Date()); |
|
|
|
complianceInvestigation.setStatus(0); |
|
|
|
|
|
|
|
complianceInvestigation.setRoleId(PromptSuccess.FG_C_ID); |
|
|
|
|
|
|
|
Boolean result = this.getBaseMapper().assign(complianceInvestigation); |
|
|
|
Boolean result = this.getBaseMapper().assign(complianceInvestigation); |
|
|
|
if (result) { |
|
|
|
if (result) { |
|
|
|
// 绑定该条数据的指派操作人;在审核进程表中插入一条指派数据;在角色表中插入一条数据,与当前被指派的员工(用户)关联
|
|
|
|
// 绑定该条数据的指派操作人(表示指派完成);
|
|
|
|
String id = this.getUserId(); |
|
|
|
// String id = this.getUserId();
|
|
|
|
this.getBaseMapper().updateAssign(iid, Integer.parseInt(id)); |
|
|
|
String id = "1"; |
|
|
|
|
|
|
|
Boolean result1 = this.getBaseMapper().updateAssign(iid, Integer.parseInt(id), StatusCode.SP_IN_REVIEW, StatusCode.CZ_PROCESSED); |
|
|
|
|
|
|
|
if (result1) { |
|
|
|
|
|
|
|
// 在角色表中插入一条数据,与当前被指派的员工(用户)关联
|
|
|
|
|
|
|
|
ResponseResult responseResult = hrmsFeignService.saveUserRole(userId.longValue(), PromptSuccess.FG_C_ID.longValue()); |
|
|
|
|
|
|
|
Boolean result2 = (Boolean) responseResult.getData(); |
|
|
|
|
|
|
|
if (result2) { |
|
|
|
|
|
|
|
// 在审核进程表中插入一条指派成功的数据
|
|
|
|
|
|
|
|
return true; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
@ -95,85 +118,202 @@ public class DgComplianceInvestigationServiceImpl extends ServiceImpl<DgComplian |
|
|
|
/** |
|
|
|
/** |
|
|
|
* 调查 |
|
|
|
* 调查 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
|
|
|
|
@Transactional |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public Boolean survey(Integer iid, String fileUrl, String surveyOpinion, Integer status) { |
|
|
|
public Boolean survey(Integer iid, String fileUrl, String opinion, Integer status) { |
|
|
|
if (iid == null || status == null) { |
|
|
|
if (iid == null || status == null) { |
|
|
|
ExceptionCast.cast(CommonCode.INVALID_PARAM); |
|
|
|
ExceptionCast.cast(CommonCode.INVALID_PARAM); |
|
|
|
} |
|
|
|
} |
|
|
|
String userId = this.getUserId(); |
|
|
|
//String userId = this.getUserId();
|
|
|
|
|
|
|
|
String userId = "1"; |
|
|
|
// 同意
|
|
|
|
// 同意
|
|
|
|
if (status == 1) { |
|
|
|
if (status == 1) { |
|
|
|
if (fileUrl == null || fileUrl.length() == 0) { |
|
|
|
if (fileUrl == null || fileUrl.length() == 0) { |
|
|
|
ExceptionCast.cast(GuaranteeCode.COMPLIANCE_UPLOAD_NOT_NULL); |
|
|
|
ExceptionCast.cast(GuaranteeCode.COMPLIANCE_UPLOAD_NOT_NULL); |
|
|
|
} |
|
|
|
} |
|
|
|
Boolean result = this.getBaseMapper().survey(iid, fileUrl, surveyOpinion, new Date(), Integer.parseInt(userId), status); |
|
|
|
// 更新合规调查表调查数据,表示调查完成
|
|
|
|
// 在审核进程中插入一条调查成功数据;在合规调查表中插入一条审核数据
|
|
|
|
Boolean result = this.getBaseMapper().survey(iid, opinion, new Date(), Integer.parseInt(userId), |
|
|
|
|
|
|
|
StatusCode.CZ_PROCESSED, StatusCode.SP_IN_REVIEW, fileUrl); |
|
|
|
|
|
|
|
// 上传附件到附件表里
|
|
|
|
if (result) { |
|
|
|
if (result) { |
|
|
|
DgComplianceInvestigation complianceInvestigation = this.getBaseMapper().getComplianceInvestigation(iid); |
|
|
|
Boolean result1 = this.getBaseMapper().uploadAccessory(this.getComplianceInvestigation(iid).getBusinessId(), fileUrl); |
|
|
|
complianceInvestigation.setRoleId(PromptSuccess.FG_JL_ID); |
|
|
|
// 更新合规调查表里面的审核数据
|
|
|
|
complianceInvestigation.setStatus(0); |
|
|
|
if (result1) { |
|
|
|
|
|
|
|
Boolean result2 = this.getBaseMapper().updateToAudit(this.getComplianceInvestigation(iid).getBusinessId(), |
|
|
|
|
|
|
|
StatusCode.CZ_ON_HAND, PromptSuccess.FG_JL_ID); |
|
|
|
|
|
|
|
// 在业务流程表中插入一条调查成功的数据
|
|
|
|
|
|
|
|
if (result2) { |
|
|
|
|
|
|
|
return true; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
// 驳回
|
|
|
|
|
|
|
|
if (status == 2) { |
|
|
|
|
|
|
|
if (opinion == null || opinion.length() == 0) { |
|
|
|
|
|
|
|
ExceptionCast.cast(GuaranteeCode.COMPLIANCE_INVESTIGATION_REMARK_NOT_NULL); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return false; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* 审核 |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
@Transactional |
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public Boolean check(Integer iid, String opinion, Integer status) { |
|
|
|
|
|
|
|
if (iid == null || status == null) { |
|
|
|
|
|
|
|
ExceptionCast.cast(CommonCode.INVALID_PARAM); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
// String userId = this.getUserId();
|
|
|
|
|
|
|
|
String userId = "1"; |
|
|
|
|
|
|
|
Integer operationStatus = this.getBaseMapper().getOperationStatusByBusinessId( |
|
|
|
|
|
|
|
this.getComplianceInvestigation(iid).getBusinessId(), PromptSuccess.FG_JL_ID); |
|
|
|
|
|
|
|
// 待处理,表示业务进行到法规经理审核
|
|
|
|
|
|
|
|
if (Objects.equals(operationStatus, StatusCode.CZ_ON_HAND)) { |
|
|
|
|
|
|
|
// 同意
|
|
|
|
|
|
|
|
if (status == 1) { |
|
|
|
|
|
|
|
Boolean result = this.getBaseMapper().check(iid, opinion, new Date(), |
|
|
|
|
|
|
|
StatusCode.SP_IN_REVIEW, StatusCode.CZ_PROCESSED, Integer.parseInt(userId)); |
|
|
|
|
|
|
|
if (result) { |
|
|
|
|
|
|
|
// 法规经理完成审核,新增一条法规领导审核数据(借用插入一条调查数据的接口)
|
|
|
|
|
|
|
|
DgComplianceInvestigation complianceInvestigation = this.getComplianceInvestigation(iid); |
|
|
|
|
|
|
|
complianceInvestigation.setUserId(null); |
|
|
|
|
|
|
|
complianceInvestigation.setRoleId(PromptSuccess.FG_LD_ID); |
|
|
|
|
|
|
|
complianceInvestigation.setOperationStatus(StatusCode.CZ_ON_HAND); |
|
|
|
|
|
|
|
complianceInvestigation.setAuditStatus(StatusCode.SP_IN_REVIEW); |
|
|
|
complianceInvestigation.setCreateTime(new Date()); |
|
|
|
complianceInvestigation.setCreateTime(new Date()); |
|
|
|
complianceInvestigation.setUpdateTime(new Date()); |
|
|
|
complianceInvestigation.setUpdateTime(new Date()); |
|
|
|
complianceInvestigation.setFile(fileUrl); |
|
|
|
Boolean result1 = this.getBaseMapper().assign(complianceInvestigation); |
|
|
|
complianceInvestigation.setSurveyOpinion(surveyOpinion); |
|
|
|
if (result1) { |
|
|
|
return this.getBaseMapper().insertManager(complianceInvestigation); |
|
|
|
// 在业务流程表中插入一条法规经理审核成功的数据
|
|
|
|
|
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
|
return false; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
// 拒绝
|
|
|
|
} |
|
|
|
|
|
|
|
// 驳回
|
|
|
|
if (status == 2) { |
|
|
|
if (status == 2) { |
|
|
|
if (surveyOpinion == null || surveyOpinion.length() == 0){ |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
// 拒绝
|
|
|
|
|
|
|
|
if (status == 3) { |
|
|
|
|
|
|
|
if (opinion == null || opinion.length() == 0) { |
|
|
|
ExceptionCast.cast(GuaranteeCode.COMPLIANCE_INVESTIGATION_REMARK_NOT_NULL); |
|
|
|
ExceptionCast.cast(GuaranteeCode.COMPLIANCE_INVESTIGATION_REMARK_NOT_NULL); |
|
|
|
} |
|
|
|
} |
|
|
|
Boolean result = this.getBaseMapper().survey(iid, null, surveyOpinion, new Date(), Integer.parseInt(userId), status); |
|
|
|
// 先改变所有的审核状态为已拒绝
|
|
|
|
|
|
|
|
Boolean result = this.getBaseMapper().updateAuditStatusByBusinessId(this.getComplianceInvestigation(iid).getBusinessId(), |
|
|
|
|
|
|
|
StatusCode.SP_REFUSE); |
|
|
|
if (result) { |
|
|
|
if (result) { |
|
|
|
// 在审核进程表中插入一条拒绝数据,流程结束
|
|
|
|
// 再改变自己当前的操作状态为已处理
|
|
|
|
|
|
|
|
Boolean result1 = this.getBaseMapper().updateOperationStatusById(iid, StatusCode.CZ_PROCESSED, opinion); |
|
|
|
|
|
|
|
if (result1) { |
|
|
|
|
|
|
|
// 最后改变该条贷款信息的业务状态为已否决
|
|
|
|
|
|
|
|
Boolean result2 = this.getBaseMapper().updateBusinessStatusByBusinessId( |
|
|
|
|
|
|
|
this.getComplianceInvestigation(iid).getBusinessId(), StatusCode.YW_REJECTED); |
|
|
|
|
|
|
|
if (result2) { |
|
|
|
|
|
|
|
// 在业务流程表中插入一条拒绝数据(记得带上拒绝意见)
|
|
|
|
|
|
|
|
return true; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
// 已处理,表示业务进行到法规领导审核
|
|
|
|
|
|
|
|
if (Objects.equals(operationStatus, StatusCode.CZ_PROCESSED)) { |
|
|
|
|
|
|
|
// 同意
|
|
|
|
|
|
|
|
if (status == 1) { |
|
|
|
|
|
|
|
Boolean result = this.getBaseMapper().check(iid, opinion, new Date(), StatusCode.SP_REVIEWED, |
|
|
|
|
|
|
|
StatusCode.CZ_PROCESSED, Integer.parseInt(userId)); |
|
|
|
|
|
|
|
if (result) { |
|
|
|
|
|
|
|
// 在工作会表中插入一条数据;
|
|
|
|
|
|
|
|
DgComplianceInvestigation complianceInvestigation = this.getComplianceInvestigation(iid); |
|
|
|
|
|
|
|
DgWorkConferenceConsider workConferenceConsider = new DgWorkConferenceConsider(); |
|
|
|
|
|
|
|
workConferenceConsider.setCompanyId(complianceInvestigation.getCompanyId()); |
|
|
|
|
|
|
|
workConferenceConsider.setBusinessId(complianceInvestigation.getBusinessId()); |
|
|
|
|
|
|
|
workConferenceConsider.setRoleId(PromptSuccess.GZU_ID); |
|
|
|
|
|
|
|
workConferenceConsider.setAuditStatus(StatusCode.SP_IN_REVIEW); |
|
|
|
|
|
|
|
workConferenceConsider.setOperationStatus(StatusCode.CZ_ON_HAND); |
|
|
|
|
|
|
|
workConferenceConsider.setCreateTime(new Date()); |
|
|
|
|
|
|
|
workConferenceConsider.setUpdateTime(new Date()); |
|
|
|
|
|
|
|
Boolean result1 = this.getBaseMapper().insertWorkConferenceConsider(workConferenceConsider); |
|
|
|
|
|
|
|
if (result1) { |
|
|
|
|
|
|
|
// 在业务流程表中插入一条法规领导审核成功的数据
|
|
|
|
|
|
|
|
return true; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
return false; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
// 驳回
|
|
|
|
// 驳回
|
|
|
|
|
|
|
|
if (status == 2) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
// 拒绝
|
|
|
|
if (status == 3) { |
|
|
|
if (status == 3) { |
|
|
|
if (surveyOpinion == null || surveyOpinion.length() == 0){ |
|
|
|
if (opinion == null || opinion.length() == 0) { |
|
|
|
ExceptionCast.cast(GuaranteeCode.COMPLIANCE_INVESTIGATION_REMARK_NOT_NULL); |
|
|
|
ExceptionCast.cast(GuaranteeCode.COMPLIANCE_INVESTIGATION_REMARK_NOT_NULL); |
|
|
|
} |
|
|
|
} |
|
|
|
Boolean result = this.getBaseMapper().survey(iid, null, surveyOpinion, new Date(), Integer.parseInt(userId), status); |
|
|
|
// 先改变所有的审核状态为已拒绝
|
|
|
|
|
|
|
|
Boolean result = this.getBaseMapper().updateAuditStatusByBusinessId(this.getComplianceInvestigation(iid).getBusinessId(), |
|
|
|
|
|
|
|
StatusCode.SP_REFUSE); |
|
|
|
if (result) { |
|
|
|
if (result) { |
|
|
|
// 在审核进程表中插入一条驳回数据;修改担保部调查表中AB角的数据状态为驳回
|
|
|
|
// 再改变自己当前的操作状态为已处理
|
|
|
|
|
|
|
|
Boolean result1 = this.getBaseMapper().updateOperationStatusById(iid, StatusCode.CZ_PROCESSED, opinion); |
|
|
|
|
|
|
|
if (result1) { |
|
|
|
|
|
|
|
// 最后改变该条贷款信息的业务状态为已否决
|
|
|
|
|
|
|
|
Boolean result2 = this.getBaseMapper().updateBusinessStatusByBusinessId( |
|
|
|
|
|
|
|
this.getComplianceInvestigation(iid).getBusinessId(), StatusCode.YW_REJECTED); |
|
|
|
|
|
|
|
if (result2) { |
|
|
|
|
|
|
|
// 在业务流程表中插入一条拒绝数据(记得带上拒绝意见)
|
|
|
|
|
|
|
|
return true; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
return false; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 审核 |
|
|
|
* 查看 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public Boolean check(Integer iid, String auditOpinion, Integer status) { |
|
|
|
public DgComplianceInvestigation query(Integer iid) { |
|
|
|
if (iid == null || status == null){ |
|
|
|
return this.getBaseMapper().queryDgComplianceInvestigation(iid); |
|
|
|
ExceptionCast.cast(CommonCode.INVALID_PARAM); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
String userId = this.getUserId(); |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* 导出 |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public Boolean excelExport(HttpServletResponse response, List<String> ids) { |
|
|
|
|
|
|
|
if (ids == null || ids.size() == 0) { |
|
|
|
|
|
|
|
ExceptionCast.cast(GuaranteeCode.EXCEL_ID_NOT_NULL); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
/*String userId = this.getUserId(); |
|
|
|
|
|
|
|
// 获取当前登录用户的角色id
|
|
|
|
String roleIdString = RedisUtil.get("dq:userRole:" + userId); |
|
|
|
String roleIdString = RedisUtil.get("dq:userRole:" + userId); |
|
|
|
if (roleIdString == null || roleIdString.length() == 0) { |
|
|
|
if (roleIdString == null || roleIdString.length() == 0) { |
|
|
|
ExceptionCast.cast(GuaranteeCode.ROLE_IS_NOT); |
|
|
|
ExceptionCast.cast(GuaranteeCode.ROLE_IS_NOT); |
|
|
|
} |
|
|
|
} |
|
|
|
String[] roleIds = roleIdString.split(","); |
|
|
|
String[] roleIds = roleIdString.split(",");*/ |
|
|
|
|
|
|
|
String userId = "1"; |
|
|
|
|
|
|
|
String[] roleIds = {"70"}; |
|
|
|
|
|
|
|
List<Integer> roleList = new ArrayList<>(); |
|
|
|
for (String roleId : roleIds) { |
|
|
|
for (String roleId : roleIds) { |
|
|
|
if (Integer.parseInt(roleId) == PromptSuccess.FG_JL_ID){ |
|
|
|
roleList.add(Integer.parseInt(roleId)); |
|
|
|
// 法规经理审核
|
|
|
|
|
|
|
|
if (status == 1){ |
|
|
|
|
|
|
|
// 同意
|
|
|
|
|
|
|
|
Boolean result = this.getBaseMapper().check(iid, auditOpinion, new Date(), status); |
|
|
|
|
|
|
|
if (result){ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
}else if (Integer.parseInt(roleId) == PromptSuccess.FG_LD_ID){ |
|
|
|
List<Integer> idList = new ArrayList<>(); |
|
|
|
// 法规领导审核
|
|
|
|
for (String id : ids) { |
|
|
|
|
|
|
|
idList.add(Integer.parseInt(id)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
List<DgComplianceInvestigationResponse> list = this.getBaseMapper().listExcel(roleList, Integer.parseInt(userId), idList); |
|
|
|
|
|
|
|
try { |
|
|
|
|
|
|
|
ExcelUtil.writeExcelWithSheets(response, list, "合规调查数据一览表", "complianceInvestigation", |
|
|
|
|
|
|
|
new DgComplianceInvestigationResponse()); |
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
|
|
|
ExceptionCast.cast(CrmsCode.CUSTOMER_EXPORT_EXSIT); |
|
|
|
} |
|
|
|
} |
|
|
|
return null; |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -183,7 +323,11 @@ public class DgComplianceInvestigationServiceImpl extends ServiceImpl<DgComplian |
|
|
|
private String getUserId() { |
|
|
|
private String getUserId() { |
|
|
|
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); |
|
|
|
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); |
|
|
|
String token = request.getHeader("token"); |
|
|
|
String token = request.getHeader("token"); |
|
|
|
return RedisUtil.get("dq:token:"+token); |
|
|
|
String userId = RedisUtil.get("dq:token:" + token); |
|
|
|
|
|
|
|
if (userId == null || userId.length() == 0) { |
|
|
|
|
|
|
|
ExceptionCast.cast(CommonCode.GET_LOGIN_USER_FAIL); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return userId; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|