合规调查列表

master
river 4 years ago
parent d6e4a4a33a
commit d1c02d1084
  1. 10
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgComplianceInvestigationController.java
  2. 24
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/mapper/DgComplianceInvestigationMapper.java
  3. 6
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/DgComplianceInvestigationResponse.java
  4. 6
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/IDgComplianceInvestigationService.java
  5. 157
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgComplianceInvestigationServiceImpl.java
  6. 70
      dq-financial-guarantee/src/main/resources/mapper/guarantee/DgComplianceInvestigationMapper.xml
  7. 11
      dq-framework-model/src/main/java/com/daqing/framework/domain/guarantee/DgComplianceInvestigation.java
  8. 6
      dq-framework-model/src/main/java/com/daqing/framework/domain/guarantee/GuaranteeCode.java

@ -39,11 +39,11 @@ public class DgComplianceInvestigationController {
/**
* 调查同意
*/
@PostMapping("/surveyConsent")
@ApiOperation(value = "调查同意",notes = "调查同意")
public ResponseResult surveyConsent(@RequestParam("iid") Integer iid,
@RequestParam("fileUrl") String fileUrl,@RequestParam("auditOpinion") String auditOpinion) {
Boolean result = iDgComplianceInvestigationService.surveyConsent(iid, fileUrl, auditOpinion);
@PostMapping("/survey")
@ApiOperation(value = "调查",notes = "调查")
public ResponseResult survey(@RequestParam("iid") Integer iid,@RequestParam("status") Integer status,
@RequestParam("fileUrl") String fileUrl, @RequestParam("auditOpinion") String auditOpinion) {
Boolean result = iDgComplianceInvestigationService.survey(iid, fileUrl, auditOpinion,status);
return result ? ResponseResult.SUCCESS() : ResponseResult.FAIL();
}
}

@ -22,15 +22,23 @@ import java.util.Date;
@Mapper
public interface DgComplianceInvestigationMapper extends BaseMapper<DgComplianceInvestigation> {
IPage<DgComplianceInvestigationResponse> list(Page page, @Param("cr") DgComplianceInvestigationRequest dgComplianceInvestigationRequest);
IPage<DgComplianceInvestigationResponse> list(Page page, @Param("cr") DgComplianceInvestigationRequest dgComplianceInvestigationRequest,
@Param("roleId") Integer roleId);
Boolean surveyConsent(@Param("iid") Integer iid, @Param("fileUrl") String fileUrl,
@Param("auditOpinion") String auditOpinion, @Param("date")Date date,
@Param("empId") Integer empId);
IPage<DgComplianceInvestigationResponse> listByUserId(Page page, @Param("cr") DgComplianceInvestigationRequest dgComplianceInvestigationRequest,
@Param("userId") Integer userId,@Param("roleId") Integer roleId);
Boolean surveyReturn(@Param("iid") Integer iid,@Param("auditOpinion") String auditOpinion,
@Param("empId") Integer empId,@Param("date") Date date);
Boolean survey(@Param("iid") Integer iid, @Param("fileUrl") String fileUrl, @Param("surveyOpinion") String surveyOpinion,
@Param("date")Date date, @Param("userId") Integer userId, @Param("status") Integer status);
Boolean surveyRefuse(@Param("iid") Integer iid,@Param("auditOpinion") String auditOpinion,
@Param("empId")Integer empId,@Param("date") Date date);
DgComplianceInvestigation getComplianceInvestigation(Integer iid);
Boolean updateAssign(@Param("iid") Integer iid, @Param("userId") Integer userId);
Boolean assign(@Param("dci") DgComplianceInvestigation dgComplianceInvestigation);
Boolean insertManager(@Param("dci") DgComplianceInvestigation dgComplianceInvestigation);
Boolean check(@Param("iid") Integer iid,@Param("auditOpinion") String auditOpinion,
@Param("date") Date date,@Param("status") Integer status);
}

@ -43,12 +43,12 @@ public class DgComplianceInvestigationResponse implements Serializable {
@JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
private Date createTime;
@ApiModelProperty("当前审批人")
private String empName;
@ApiModelProperty("状态,0:,1:,2:,3:,4:")
private Integer status;
@ApiModelProperty("合规调查表id")
private Integer iId;
@ApiModelProperty("角色id")
private Integer roleId;
}

@ -17,9 +17,9 @@ public interface IDgComplianceInvestigationService extends IService<DgCompliance
PageUtils list(Integer page, Integer size, DgComplianceInvestigationRequest dgComplianceInvestigationRequest);
Boolean surveyConsent(Integer iid, String fileUrl, String auditOpinion);
Boolean assign(Integer iid,Integer userId);
Boolean surveyReturn(Integer iid,String auditOpinion);
Boolean survey(Integer iid, String fileUrl, String surveyOpinion,Integer status);
Boolean surveyRefuse(Integer iid,String auditOpinion);
Boolean check(Integer iid,String auditOpinion,Integer status);
}

@ -11,10 +11,18 @@ import com.daqing.framework.domain.guarantee.DgComplianceInvestigation;
import com.daqing.framework.domain.guarantee.GuaranteeCode;
import com.daqing.framework.exception.ExceptionCast;
import com.daqing.framework.model.response.CommonCode;
import com.daqing.framework.model.response.PromptSuccess;
import com.daqing.framework.util.RedisUtil;
import com.daqing.framework.utils.PageUtils;
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.Date;
import java.util.List;
/**
* <p>
@ -37,55 +45,152 @@ public class DgComplianceInvestigationServiceImpl extends ServiceImpl<DgComplian
page = 1;
size = 10;
}
IPage<DgComplianceInvestigationResponse> list = this.getBaseMapper().list(new Page(page, size), dgComplianceInvestigationRequest);
String userId = this.getUserId();
// 获取当前登录用户的角色id
String roleIdString = RedisUtil.get("dq:userRole:" + userId);
if (roleIdString == null || roleIdString.length() == 0){
ExceptionCast.cast(GuaranteeCode.ROLE_IS_NOT);
}
String[] roleIds = roleIdString.split(",");
IPage<DgComplianceInvestigationResponse> list = new Page<>();
for (String roleId : roleIds) {
if (Integer.parseInt(roleId) == PromptSuccess.FG_JL_ID || Integer.parseInt(roleId) == PromptSuccess.FG_LD_ID){
// 当前角色都能看到的数据
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;
}
}
return new PageUtils(list);
}
/**
* 调查同意
* 指派
*/
@Transactional
@Override
public Boolean surveyConsent(Integer iid, String fileUrl, String auditOpinion) {
if (iid == null || fileUrl == null || fileUrl.length() == 0){
ExceptionCast.cast(CommonCode.INVALID_PARAM);
public Boolean assign(Integer iid, Integer userId) {
DgComplianceInvestigation complianceInvestigation = this.getComplianceInvestigation(iid);
complianceInvestigation.setEmpId(userId);
complianceInvestigation.setCreateTime(new Date());
complianceInvestigation.setUpdateTime(new Date());
complianceInvestigation.setStatus(0);
complianceInvestigation.setRoleId(PromptSuccess.FG_C_ID);
Boolean result = this.getBaseMapper().assign(complianceInvestigation);
if (result){
// 绑定该条数据的指派操作人;在审核进程表中插入一条指派数据;在角色表中插入一条数据,与当前被指派的员工(用户)关联
String id = this.getUserId();
this.getBaseMapper().updateAssign(iid, Integer.parseInt(id));
}
// 获取登录用户id
Integer userId = 1;
return this.getBaseMapper().surveyConsent(iid, fileUrl, auditOpinion, new Date(), userId);
return false;
}
/**
* 调查驳回
* 调查
*/
@Override
public Boolean surveyReturn(Integer iid, String auditOpinion) {
if (iid == null){
public Boolean survey(Integer iid, String fileUrl, String surveyOpinion, Integer status) {
if (iid == null || status == null){
ExceptionCast.cast(CommonCode.INVALID_PARAM);
}
if (auditOpinion == null || auditOpinion.length() == 0){
String userId = this.getUserId();
// 同意
if (status == 1){
if (fileUrl == null || fileUrl.length() == 0){
ExceptionCast.cast(GuaranteeCode.COMPLIANCE_UPLOAD_NOT_NULL);
}
Boolean result = this.getBaseMapper().survey(iid, fileUrl, surveyOpinion, new Date(), Integer.parseInt(userId), status);
// 在审核进程中插入一条调查成功数据;在合规调查表中插入一条审核数据
if (result){
DgComplianceInvestigation complianceInvestigation = this.getBaseMapper().getComplianceInvestigation(iid);
complianceInvestigation.setRoleId(PromptSuccess.FG_JL_ID);
complianceInvestigation.setStatus(0);
complianceInvestigation.setCreateTime(new Date());
complianceInvestigation.setUpdateTime(new Date());
complianceInvestigation.setFile(fileUrl);
complianceInvestigation.setSurveyOpinion(surveyOpinion);
return this.getBaseMapper().insertManager(complianceInvestigation);
}
return false;
}
// 拒绝
if (status == 2){
if (surveyOpinion == null || surveyOpinion.length() == 0){
ExceptionCast.cast(GuaranteeCode.COMPLIANCE_INVESTIGATION_REMARK_NOT_NULL);
}
// 获取登录用户id
Integer userId = 1;
// TODO 驳回至资产调查指派A/B角
return this.getBaseMapper().surveyReturn(iid,auditOpinion,userId,new Date());
Boolean result = this.getBaseMapper().survey(iid, null, surveyOpinion, new Date(), Integer.parseInt(userId), status);
if (result){
// 在审核进程表中插入一条拒绝数据,流程结束
}
return false;
}
// 驳回
if (status == 3){
if (surveyOpinion == null || surveyOpinion.length() == 0){
ExceptionCast.cast(GuaranteeCode.COMPLIANCE_INVESTIGATION_REMARK_NOT_NULL);
}
Boolean result = this.getBaseMapper().survey(iid, null, surveyOpinion, new Date(), Integer.parseInt(userId), status);
if (result){
// 在审核进程表中插入一条驳回数据;修改担保部调查表中AB角的数据状态为驳回
}
return false;
}
return false;
}
/**
* 调查拒绝
* 审核
*/
@Override
public Boolean surveyRefuse(Integer iid, String auditOpinion) {
if (iid == null){
public Boolean check(Integer iid, String auditOpinion, Integer status) {
if (iid == null || status == null){
ExceptionCast.cast(CommonCode.INVALID_PARAM);
}
if (auditOpinion == null || auditOpinion.length() == 0){
ExceptionCast.cast(GuaranteeCode.COMPLIANCE_INVESTIGATION_REMARK_NOT_NULL);
String userId = this.getUserId();
String roleIdString = RedisUtil.get("dq:userRole:" + userId);
if (roleIdString == null || roleIdString.length() == 0){
ExceptionCast.cast(GuaranteeCode.ROLE_IS_NOT);
}
// 获取登录用户id
Integer userId = 1;
// TODO 直接拒接至初始状态
return this.getBaseMapper().surveyRefuse(iid,auditOpinion,userId,new Date());
String[] roleIds = roleIdString.split(",");
for (String roleId : roleIds) {
if (Integer.parseInt(roleId) == PromptSuccess.FG_JL_ID){
// 法规经理审核
if (status == 1){
// 同意
Boolean result = this.getBaseMapper().check(iid, auditOpinion, new Date(), status);
if (result){
}
}
}else if (Integer.parseInt(roleId) == PromptSuccess.FG_LD_ID){
// 法规领导审核
}
}
return null;
}
/**
* 获取当前登录用户信息
*/
private String getUserId(){
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
String token = request.getHeader("token");
return RedisUtil.get("dq:token:"+token);
}
/**
* 获取基本信息
*/
private DgComplianceInvestigation getComplianceInvestigation(Integer iid){
return this.getBaseMapper().getComplianceInvestigation(iid);
}
}

@ -14,10 +14,10 @@
<result column="update_time" property="updateTime" />
</resultMap>
<select id="list" parameterType="com.daqing.financial.guarantee.model.request.DgComplianceInvestigationRequest" resultType="com.daqing.financial.guarantee.model.response.DgComplianceInvestigationResponse">
<select id="list" resultType="com.daqing.financial.guarantee.model.response.DgComplianceInvestigationResponse">
SELECT a.id AS id,a.business_code AS business_code,a.business_type AS business_type,a.apply_amount AS apply_amount,
a.apply_time AS apply_time,a.create_time AS create_time,c.name AS name,c.phone AS phone,p.emp_name AS emp_name,
i.status AS status,i.id AS iid
a.apply_time AS apply_time,a.create_time AS create_time,c.name AS name,c.phone AS phone,i.status AS status,
i.id AS iid,i.role_id AS role_id
FROM dg_apply_amount_info AS a
LEFT JOIN dg_audit_process AS p
ON a.id = p.apply_amount_info_id
@ -26,6 +26,8 @@
LEFT JOIN dg_compliance_investigation AS i
ON a.id = i.business_id
WHERE c.del_or_not = 0
AND i.role_id = #{roleId}
AND i.user_id = ''
<if test="cr.status != null and cr.status != ''">
AND i.status = #{cr.status}
</if>
@ -35,21 +37,63 @@
ORDER BY a.create_time DESC
</select>
<!-- 调查同意 -->
<update id="surveyConsent">
UPDATE dg_compliance_investigation SET emp_id = #{empId},file = #{fileUrl},remark = #{auditOpinion},status = 2,update_time = #{date}
<!-- 法规部经理和法规领导指派或者调查之后的数据 -->
<select id="listByUserId" resultType="com.daqing.financial.guarantee.model.response.DgComplianceInvestigationResponse">
SELECT a.id AS id,a.business_code AS business_code,a.business_type AS business_type,a.apply_amount AS apply_amount,
a.apply_time AS apply_time,a.create_time AS create_time,c.name AS name,c.phone AS phone,i.status AS status,
i.id AS iid,i.role_id AS role_id
FROM dg_apply_amount_info AS a
LEFT JOIN dg_audit_process AS p
ON a.id = p.apply_amount_info_id
LEFT JOIN crms_customer AS c
ON a.company_id = c.id
LEFT JOIN dg_compliance_investigation AS i
ON a.id = i.business_id
WHERE c.del_or_not = 0
AND i.role_id = #{roleId}
AND i.user_id = #{userId}
<if test="cr.status != null and cr.status != ''">
AND i.status = #{cr.status}
</if>
<if test="cr.codeOrName != null and cr.codeOrName != ''">
AND (a.business_code LIKE CONCAT('%',#{cr.codeOrName},'%') OR c.name LIKE CONCAT('%',#{cr.codeOrName},'%'))
</if>
ORDER BY a.create_time DESC
</select>
<!-- 调查 -->
<update id="survey">
UPDATE dg_compliance_investigation
SET user_id = #{userId},file = #{fileUrl},survey_opinion = #{surveyOpinion},status = #{status},update_time = #{date}
WHERE id = #{iid}
</update>
<!-- 调查驳回 -->
<update id="surveyReturn">
UPDATE dg_compliance_investigation SET emp_id = #{empId},remark = #{auditOpinion},status = 3,update_time = #{date}
WHERE id = #{iid}
<select id="getComplianceInvestigation" parameterType="integer" resultType="com.daqing.framework.domain.guarantee.DgComplianceInvestigation">
SELECT company_id,business_id FROM dg_compliance_investigation
</select>
<!-- 指派之后将法规经理与该条数据绑定 -->
<update id="updateAssign">
UPDATE dg_compliance_investigation SET user_id = #{userId} WHERE id = #{iid}
</update>
<!-- 调查拒绝 -->
<update id="surveyRefuse">
UPDATE dg_compliance_investigation SET emp_id = #{empId},remark = #{auditOpinion},status = 4,update_time = #{date}
<!-- 新增一条指派数据 -->
<insert id="assign" parameterType="com.daqing.framework.domain.guarantee.DgComplianceInvestigation">
INSERT INTO (company_id,user_id,status,create_time,update_time,business_id,role_id)
VALUES (#{dci.companyId},#{dci.userId},#{dci.status},#{dci.createTime},#{dci.updateTime},#{dci.businessId},#{dci.roleId})
</insert>
<!-- 插入经理可以查询到的数据 -->
<insert id="insertManager" parameterType="com.daqing.framework.domain.guarantee.DgComplianceInvestigation">
INSERT INTO (company_id,file,status,create_time,update_time,business_id,role_id,survey_opinion)
VALUES (#{dci.companyId},#{dci.file},#{dci.status},#{dci.createTime},#{dci.updateTime},
#{dci.businessId},#{dci.roleId},#{dci.surveyOpinion})
</insert>
<!-- 审核 -->
<update id="check">
UPDATE dg_compliance_investigation
SET remark = #{auditOpinion},status = #{status},update_time = #{date}
WHERE id = #{iid}
</update>
</mapper>

@ -33,7 +33,7 @@ public class DgComplianceInvestigation implements Serializable {
private Integer companyId;
/**
* 调查者id
* 用户id
*/
private Integer empId;
@ -60,4 +60,13 @@ public class DgComplianceInvestigation implements Serializable {
@TableField(fill = FieldFill.INSERT_UPDATE)
private Date updateTime;
@ApiModelProperty("贷款信息表id")
private Integer businessId;
@ApiModelProperty("角色id")
private Integer roleId;
@ApiModelProperty("调查意见")
private String surveyOpinion;
}

@ -16,7 +16,11 @@ import lombok.ToString;
public enum GuaranteeCode implements ResultCode {
COMPLIANCE_INVESTIGATION_REMARK_NOT_NULL(false,80001,"驳回或拒绝时,意见不能为空!");
COMPLIANCE_INVESTIGATION_REMARK_NOT_NULL(false,80001,"意见不能为空,请输入拒绝/驳回意见!"),
COMPLIANCE_UPLOAD_NOT_NULL(false,80002,"附件不能为空,请上传附件!"),
ROLE_IS_NOT(false,90001,"当前登录用户角色信息不存在,无法查询!");
/**
* 操作是否成功

Loading…
Cancel
Save