审批流程进程

master
shijie 4 years ago
parent d86e57b003
commit a114e04bea
  1. 20
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgApplyAmountInfoController.java
  2. 2
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgAuditProcessController.java
  3. 3
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/request/ApprovalAssetsRequest.java
  4. 16
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgApplyAmountInfoServiceImpl.java
  5. 19
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgAssetsInvestigationServiceImpl.java
  6. 18
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgGuaranteeAssignUserServiceImpl.java
  7. 15
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgMessageInvestigationServiceImpl.java
  8. 1
      dq-financial-guarantee/src/main/resources/mapper/guarantee/DgAssetsInvestigationMapper.xml
  9. 2
      dq-financial-hrms-auth/src/main/java/com/daqing/financial/hrauth/service/impl/UserLoginServiceImpl.java
  10. 11
      dq-framework-common/src/main/java/com/daqing/framework/util/JwtUtils.java
  11. 5
      dq-framework-model/src/main/java/com/daqing/framework/domain/guarantee/DgAssetsInvestigation.java

@ -18,9 +18,11 @@ import com.daqing.framework.domain.crms.request.DgApplyAmountInfoRequest;
import com.daqing.framework.domain.guarantee.response.EmployeeMessageResponse;
import com.daqing.framework.model.response.PromptSuccess;
import com.daqing.framework.model.response.ResponseResult;
import com.daqing.framework.util.JwtUtils;
import com.daqing.framework.util.RedisUtil;
import com.daqing.framework.utils.PageUtils;
import com.daqing.framework.utils.excel.EasyExcelUtil;
import io.jsonwebtoken.Claims;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
@ -287,4 +289,22 @@ public class DgApplyAmountInfoController implements DgApplyAmountInfoControllerA
return RedisUtil.get("dq:token:"+token);
}
/**
* 获取当前登录用户名称
*/
public static String getAccount() {
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
String token = request.getHeader("token");
Claims claims = null;
try {
claims = JwtUtils.parseJWT(token);
} catch (Exception e) {
e.printStackTrace();
}
return claims.getIssuer();
}
}

@ -4,6 +4,7 @@ package com.daqing.financial.guarantee.controller;
import com.daqing.financial.guarantee.service.IDgAuditProcessService;
import com.daqing.framework.domain.guarantee.DgAuditProcess;
import com.daqing.framework.model.response.ResponseResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
@ -23,6 +24,7 @@ import java.util.List;
* @author Qyq
* @since 2020-11-05
*/
@Api(tags = {"审核流程进程"})
@RestController
@RequestMapping("/dg-audit-process")
public class DgAuditProcessController {

@ -31,6 +31,9 @@ public class ApprovalAssetsRequest {
@ApiModelProperty(value = "补充原因")
private String[] remark;
@ApiModelProperty(value = "其他原因")
private String otherRemark;
}

@ -3,6 +3,7 @@ package com.daqing.financial.guarantee.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.daqing.financial.guarantee.controller.DgApplyAmountInfoController;
import com.daqing.financial.guarantee.feign.CrmsFeignService;
import com.daqing.financial.guarantee.feign.HrmsFeignService;
import com.daqing.financial.guarantee.mapper.*;
@ -14,6 +15,7 @@ import com.daqing.financial.guarantee.model.response.DgEnclosureInfoResponse;
import com.daqing.financial.guarantee.service.IDgApplyAmountInfoService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.daqing.financial.guarantee.util.ArraysUtil;
import com.daqing.financial.guarantee.util.AuditProcessUtil;
import com.daqing.framework.domain.crms.CrmsCustomerRelated;
import com.daqing.framework.domain.crms.request.DgApplyAmountInfoRequest;
import com.daqing.framework.domain.crms.response.CrmsCode;
@ -80,6 +82,8 @@ public class DgApplyAmountInfoServiceImpl extends ServiceImpl<DgApplyAmountInfoM
@Resource
private DgBusinessProcessStatusMapper dgBusinessProcessStatusMapper;
@Resource
private DgApplyAmountInfoController dgApplyAmountInfoController;
@Override
@ -175,6 +179,10 @@ public class DgApplyAmountInfoServiceImpl extends ServiceImpl<DgApplyAmountInfoM
status.setBusinessId(dgApplyAmountInfo.getId());
status.setBusinessStatus(StatusCode.YW_IN_PROGRESS);//业务状态设置为进行中
dgBusinessProcessStatusMapper.insert(status);
//同时往审核流程进程表新增一条记录
String account = dgApplyAmountInfoController.getAccount();
AuditProcessUtil.save(dgApplyAmountInfo.getId(),account,"担保业务员","");
}
return 1;
}
@ -357,6 +365,10 @@ public class DgApplyAmountInfoServiceImpl extends ServiceImpl<DgApplyAmountInfoM
dgApplyAmountListMapper.update(applyAmountList,new QueryWrapper<DgApplyAmountList>()
.eq("business_id",applyAmountList.getBusinessId())
.eq("type",applyAmountList.getType()));
//同时往审核流程进程表新增一条记录
String account = dgApplyAmountInfoController.getAccount();
AuditProcessUtil.save(dgApplyAmountList1.getBusinessId(),account,"担保业务员","");
//将业务流程状态设置为已撤销
DgBusinessProcessStatus status = new DgBusinessProcessStatus();
@ -472,6 +484,10 @@ public class DgApplyAmountInfoServiceImpl extends ServiceImpl<DgApplyAmountInfoM
dgMessageInvestigation.setStatus(StatusCode.SP_TO_BE_ASSIGNED);//状态为待指派
dgMessageInvestigation.setOperatingStatus(StatusCode.CZ_ON_HAND);//操作状态为待处理
dgMessageInvestigationMapper.insert(dgMessageInvestigation);
//同时往审核流程进程表新增一条记录
String account = dgApplyAmountInfoController.getAccount();
AuditProcessUtil.save(dgApplyAmountList1.getBusinessId(),account,"担保部经理",remark);
}

@ -17,6 +17,7 @@ import com.daqing.financial.guarantee.model.request.InvestigateAssetsRequest;
import com.daqing.financial.guarantee.model.response.*;
import com.daqing.financial.guarantee.service.IDgAssetsInvestigationService;
import com.daqing.financial.guarantee.util.ArraysUtil;
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.DgApplyAmountInfo;
@ -229,6 +230,10 @@ public class DgAssetsInvestigationServiceImpl extends ServiceImpl<DgAssetsInvest
this.baseMapper.update(assetsInvestigation2,new QueryWrapper<DgAssetsInvestigation>().
eq("business_id",dgAssetsInvestigation.getBusinessId()).eq("type",2));
}
//同时往审核流程进程表新增一条记录
String account = dgApplyAmountInfoController.getAccount();
AuditProcessUtil.save(dgAssetsInvestigation.getBusinessId(),account,"资产部专员",investigateAssetsRequest.getApplyContent());
return 1;
}
@ -240,6 +245,7 @@ public class DgAssetsInvestigationServiceImpl extends ServiceImpl<DgAssetsInvest
dgAssetsInvestigation.setId(approvalAssetsRequest.getId());
dgAssetsInvestigation.setEmpId(Integer.parseInt(dgApplyAmountInfoController.getUserId()));
dgAssetsInvestigation.setRemark(ArraysUtil.toString(approvalAssetsRequest.getRemark()));//补充原因
dgAssetsInvestigation.setOtherRemark(approvalAssetsRequest.getOtherRemark());//其他原因
dgAssetsInvestigation.setStatus(approvalAssetsRequest.getStatus());
dgAssetsInvestigation.setOperatingStatus(StatusCode.CZ_PROCESSED);//状态设置为已处理
dgAssetsInvestigation.setAmount(approvalAssetsRequest.getAmount());//金额
@ -264,10 +270,22 @@ public class DgAssetsInvestigationServiceImpl extends ServiceImpl<DgAssetsInvest
assets.setStatus(StatusCode.SP_IN_REVIEW);//审批状态设置为审核中
assets.setOperatingStatus(StatusCode.CZ_ON_HAND);//操作状态设置为待处理
this.baseMapper.insert(assets);
//同时往审核流程进程表新增一条记录
String account = dgApplyAmountInfoController.getAccount();
AuditProcessUtil.save(assetsInvestigation.getBusinessId(),account,"资产部经理",approvalAssetsRequest.getApplyContent());
}
//如果担保部分管领导审核通过,同时判断资产部分管领导审核以及信息部分管领导审核是否通过,如果通过就往合规调查中插入一条数据
//待完善
if(approvalAssetsRequest.getStatus()==StatusCode.SP_REVIEWED && assetsInvestigation.getOperatingStatus()==StatusCode.CZ_PROCESSED && assetsInvestigation.getType()==3) {//资产部分管领导审核通过
//同时往审核流程进程表新增一条记录
String account = dgApplyAmountInfoController.getAccount();
AuditProcessUtil.save(assetsInvestigation.getBusinessId(),account,"资产部分管领导",approvalAssetsRequest.getApplyContent());
}
return 1;
}
@ -276,7 +294,6 @@ public class DgAssetsInvestigationServiceImpl extends ServiceImpl<DgAssetsInvest
public Boolean excelExport(List<String> ids, HttpServletResponse response) {
//根据ids查询业务申请列表信息
List<AssetsInvestigationListResponse>assetsList = this.baseMapper.selectListByIds(ids);
System.out.println("applyList==========================="+assetsList);
try {
ExcelUtil.writeExcelWithSheets(response, assetsList, "资产调查一览表", "assetsInvestigation", new AssetsInvestigationListResponse())
.finish();

@ -14,6 +14,7 @@ import com.daqing.financial.guarantee.model.response.*;
import com.daqing.financial.guarantee.service.IDgGuaranteeAssignUserService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.daqing.financial.guarantee.util.ArraysUtil;
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.DgApplyAmountInfo;
@ -205,6 +206,10 @@ public class DgGuaranteeAssignUserServiceImpl extends ServiceImpl<DgGuaranteeAss
.eq("type",3));
}
//同时往审核流程进程表新增一条记录
String account = dgApplyAmountInfoController.getAccount();
AuditProcessUtil.save(guaranteeAssignUser.getBusinessId(),account,"担保部A/B角",investigateGuaranteeRequest.getApplyContent());
return 1;
}
@ -241,12 +246,23 @@ public class DgGuaranteeAssignUserServiceImpl extends ServiceImpl<DgGuaranteeAss
assignUser.setStatus(StatusCode.SP_IN_REVIEW);//审批状态设置为审核中
assignUser.setOperatingStatus(StatusCode.CZ_ON_HAND);//操作状态设置为待处理
this.baseMapper.insert(assignUser);
//同时往审核流程进程表新增一条记录
String account = dgApplyAmountInfoController.getAccount();
AuditProcessUtil.save(guaranteeAssignUser.getBusinessId(),account,"担保部经理",approvalGuaranteeRequest.getApplyContent());
}
//如果担保部分管领导审核通过,同时判断资产部分管领导审核以及信息部分管领导审核是否通过,如果通过就往合规调查中插入一条数据
//待完善
if(approvalGuaranteeRequest.getStatus()==StatusCode.SP_REVIEWED && guaranteeUser.getOperatingStatus()==StatusCode.CZ_PROCESSED && guaranteeUser.getType()==4) {//担保部领导审核通过
return 1;
//同时往审核流程进程表新增一条记录
String account = dgApplyAmountInfoController.getAccount();
AuditProcessUtil.save(guaranteeUser.getBusinessId(),account,"担保部分管领导",approvalGuaranteeRequest.getApplyContent());
}
return 1;
}
@Override

@ -16,6 +16,7 @@ import com.daqing.financial.guarantee.model.response.*;
import com.daqing.financial.guarantee.service.IDgMessageInvestigationService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.daqing.financial.guarantee.util.ArraysUtil;
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.*;
@ -217,6 +218,10 @@ public class DgMessageInvestigationServiceImpl extends ServiceImpl<DgMessageInve
.eq("type",2));
}
//同时往审核流程进程表新增一条记录
String account = dgApplyAmountInfoController.getAccount();
AuditProcessUtil.save(messageInvestigation.getBusinessId(),account,"信息部专员",investigateMessageRequest.getRemark());
return 1;
}
@ -249,11 +254,21 @@ public class DgMessageInvestigationServiceImpl extends ServiceImpl<DgMessageInve
message.setStatus(StatusCode.SP_IN_REVIEW);//审批状态设置为审核中
message.setOperatingStatus(StatusCode.CZ_ON_HAND);//操作状态设置为待处理
this.baseMapper.insert(message);
//同时往审核流程进程表新增一条记录
String account = dgApplyAmountInfoController.getAccount();
AuditProcessUtil.save(messageInvestigation2.getBusinessId(),account,"信息部经理",approvalMessageRequest.getRemark());
}
//如果担保部分管领导审核通过,同时判断资产部分管领导审核以及信息部分管领导审核是否通过,如果通过就往合规调查中插入一条数据
//待完善
if(approvalMessageRequest.getStatus()==StatusCode.SP_REVIEWED && messageInvestigation.getOperatingStatus()==StatusCode.CZ_PROCESSED && messageInvestigation.getType()==3) {//信息部领导审核通过
//同时往审核流程进程表新增一条记录
String account = dgApplyAmountInfoController.getAccount();
AuditProcessUtil.save(messageInvestigation.getBusinessId(),account,"信息部分管领导",approvalMessageRequest.getRemark());
}
return 1;
}

@ -27,6 +27,7 @@
<result column="amount" property="amount" />
<result column="term" property="term" />
<result column="remark" property="remark" />
<result column="other_remark" property="otherRemark" />
<result column="create_time" property="createTime" />
<result column="update_time" property="updateTime" />
</resultMap>

@ -155,7 +155,7 @@ public class UserLoginServiceImpl extends ServiceImpl<UserLoginDao, UserEntity>
if(loginRequest.getTenDayEffective() == 1){
times = 864000;
}
String token = JwtUtils.createJWT(userEntity.getId()+"","token", times);
String token = JwtUtils.createJWT(userEntity.getId()+"",userEntity.getAccount(),"token", times);
Token userToken = tokenService.getOne(new QueryWrapper<Token>().eq("user_id", userEntity.getId()));
if(userToken != null){
//删除redis里面的token

@ -24,14 +24,14 @@ public class JwtUtils {
* @return String
*
*/
public static String createJWT(String id, String subject, long ttlMillis) {
public static String createJWT(String id, String account,String subject, long ttlMillis) {
ttlMillis = ttlMillis * 1000;
SignatureAlgorithm signatureAlgorithm = SignatureAlgorithm.HS256;
long nowMillis = System.currentTimeMillis();
Date now = new Date(nowMillis);
SecretKey secretKey = generalKey();
JwtBuilder builder = Jwts.builder().setId(String.valueOf(id)).setSubject(subject) // 主题
.setIssuer("user") // 签发者
.setIssuer(account) // 签发者 "user"
.setIssuedAt(now) // 签发时间
.signWith(signatureAlgorithm, secretKey); // 签名算法以及密匙
if (ttlMillis >= 0) {
@ -42,10 +42,11 @@ public class JwtUtils {
return builder.compact();
}
public static void main(String[] args) {
//System.out.printf(createJWT("1","111", 10000000));
boolean isTrue = validateJWT("eyJhbGciOiJIUzI1NiJ9.eyJqdGkiOiIxIiwic3ViIjoiMTExIiwiaXNzIjoidXNlciIsImlhdCI6MTYwMTM0MzYyNywiZXhwIjoxNjAxMzUzNjI3fQ.q5Ssg2LM1OzzgvVWqLhgP_Hko0-pfeNO5bvpUE5KQ-s");
public static void main(String[] args) throws Exception {
//System.out.printf(createJWT("5","七七","111", 10000000));
boolean isTrue = validateJWT("eyJhbGciOiJIUzI1NiJ9.eyJqdGkiOiI1Iiwic3ViIjoiMTExIiwiaXNzIjoi5LiD5LiDIiwiaWF0IjoxNjA2NDYxMDI1LCJleHAiOjE2MTY0NjEwMjV9.Pywtr4On2QAjhkckvXO2eED_K0304dpUmuGwnYoKITM");
System.out.println(isTrue);
System.out.println(parseJWT("eyJhbGciOiJIUzI1NiJ9.eyJqdGkiOiI1Iiwic3ViIjoiMTExIiwiaXNzIjoi5LiD5LiDIiwiaWF0IjoxNjA2NDYxMDI1LCJleHAiOjE2MTY0NjEwMjV9.Pywtr4On2QAjhkckvXO2eED_K0304dpUmuGwnYoKITM"));
}
/**

@ -138,6 +138,11 @@ public class DgAssetsInvestigation implements Serializable {
*/
private String remark;
/**
* 其他原因
*/
private String otherRemark;
/**
* 创建时间
*/

Loading…
Cancel
Save