From a114e04bea1d6a217a79249cc61e6eb4c6d4b2ef Mon Sep 17 00:00:00 2001 From: shijie <648688341@qq.com> Date: Fri, 27 Nov 2020 16:24:44 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=A1=E6=89=B9=E6=B5=81=E7=A8=8B=E8=BF=9B?= =?UTF-8?q?=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DgApplyAmountInfoController.java | 20 +++++++++++++++++++ .../controller/DgAuditProcessController.java | 2 ++ .../model/request/ApprovalAssetsRequest.java | 3 +++ .../impl/DgApplyAmountInfoServiceImpl.java | 16 +++++++++++++++ .../DgAssetsInvestigationServiceImpl.java | 19 +++++++++++++++++- .../DgGuaranteeAssignUserServiceImpl.java | 18 ++++++++++++++++- .../DgMessageInvestigationServiceImpl.java | 15 ++++++++++++++ .../guarantee/DgAssetsInvestigationMapper.xml | 1 + .../service/impl/UserLoginServiceImpl.java | 2 +- .../com/daqing/framework/util/JwtUtils.java | 11 +++++----- .../guarantee/DgAssetsInvestigation.java | 5 +++++ 11 files changed, 104 insertions(+), 8 deletions(-) diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgApplyAmountInfoController.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgApplyAmountInfoController.java index e59f7e8e..cd32401a 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgApplyAmountInfoController.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgApplyAmountInfoController.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(); + } + + + + } diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgAuditProcessController.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgAuditProcessController.java index 522ffaaa..229fa3ae 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgAuditProcessController.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgAuditProcessController.java @@ -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 { diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/request/ApprovalAssetsRequest.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/request/ApprovalAssetsRequest.java index be382cbe..c0c82739 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/request/ApprovalAssetsRequest.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/request/ApprovalAssetsRequest.java @@ -31,6 +31,9 @@ public class ApprovalAssetsRequest { @ApiModelProperty(value = "补充原因") private String[] remark; + @ApiModelProperty(value = "其他原因") + private String otherRemark; + } 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 a89f2bc6..b836439d 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 @@ -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() .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(). 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 ids, HttpServletResponse response) { //根据ids查询业务申请列表信息 ListassetsList = this.baseMapper.selectListByIds(ids); - System.out.println("applyList==========================="+assetsList); try { ExcelUtil.writeExcelWithSheets(response, assetsList, "资产调查一览表", "assetsInvestigation", new AssetsInvestigationListResponse()) .finish(); diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgGuaranteeAssignUserServiceImpl.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgGuaranteeAssignUserServiceImpl.java index 74b3ee65..bc93d300 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgGuaranteeAssignUserServiceImpl.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgGuaranteeAssignUserServiceImpl.java @@ -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 + diff --git a/dq-financial-hrms-auth/src/main/java/com/daqing/financial/hrauth/service/impl/UserLoginServiceImpl.java b/dq-financial-hrms-auth/src/main/java/com/daqing/financial/hrauth/service/impl/UserLoginServiceImpl.java index 1e828573..df1192d7 100644 --- a/dq-financial-hrms-auth/src/main/java/com/daqing/financial/hrauth/service/impl/UserLoginServiceImpl.java +++ b/dq-financial-hrms-auth/src/main/java/com/daqing/financial/hrauth/service/impl/UserLoginServiceImpl.java @@ -155,7 +155,7 @@ public class UserLoginServiceImpl extends ServiceImpl 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().eq("user_id", userEntity.getId())); if(userToken != null){ //删除redis里面的token diff --git a/dq-framework-common/src/main/java/com/daqing/framework/util/JwtUtils.java b/dq-framework-common/src/main/java/com/daqing/framework/util/JwtUtils.java index 16ee473b..a02a9762 100644 --- a/dq-framework-common/src/main/java/com/daqing/framework/util/JwtUtils.java +++ b/dq-framework-common/src/main/java/com/daqing/framework/util/JwtUtils.java @@ -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")); } /** diff --git a/dq-framework-model/src/main/java/com/daqing/framework/domain/guarantee/DgAssetsInvestigation.java b/dq-framework-model/src/main/java/com/daqing/framework/domain/guarantee/DgAssetsInvestigation.java index e7dac5c9..c278d4c9 100644 --- a/dq-framework-model/src/main/java/com/daqing/framework/domain/guarantee/DgAssetsInvestigation.java +++ b/dq-framework-model/src/main/java/com/daqing/framework/domain/guarantee/DgAssetsInvestigation.java @@ -138,6 +138,11 @@ public class DgAssetsInvestigation implements Serializable { */ private String remark; + /** + * 其他原因 + */ + private String otherRemark; + /** * 创建时间 */