From 27a126034bae8b2d132d6edca3f283f52692742e Mon Sep 17 00:00:00 2001
From: jiangping <jp@doumee.com>
Date: 星期四, 17 十月 2024 16:00:30 +0800
Subject: [PATCH] 最新版本541200007

---
 server/system_service/src/main/java/com/doumee/core/utils/DESUtil.java                                |    9 ++++++---
 server/visits/dmvisit_admin/src/main/java/com/doumee/cloud/openapi/HkOpenApiController.java           |   12 +++---------
 server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/PositionServiceImpl.java |    4 +++-
 3 files changed, 12 insertions(+), 13 deletions(-)

diff --git a/server/system_service/src/main/java/com/doumee/core/utils/DESUtil.java b/server/system_service/src/main/java/com/doumee/core/utils/DESUtil.java
index 1871e2d..89cfa4f 100644
--- a/server/system_service/src/main/java/com/doumee/core/utils/DESUtil.java
+++ b/server/system_service/src/main/java/com/doumee/core/utils/DESUtil.java
@@ -18,6 +18,7 @@
 import java.net.URLEncoder;
 import java.security.Key;
 import java.util.Base64;
+import java.util.UUID;
 import java.util.concurrent.TimeUnit;
 
 public class DESUtil {
@@ -191,12 +192,14 @@
          long currentTimeMillis = System.currentTimeMillis() + 1000*60*60*hour;
          String encrypt = DESUtil.encrypt("12345678",currentTimeMillis + "_" + userName );
         try{
-            encrypt = URLEncoder.encode(encrypt,"UTF-8");
+//            encrypt =  Base64.getEncoder().encodeToString(encrypt.getBytes());
+//            encrypt = URLEncoder.encode(encrypt,"UTF-8");
         }catch (Exception e){
             throw new BusinessException(ResponseStatus.SERVER_ERROR.getCode(),"鐢熸垚鍔犲瘑鐮佸け璐�!");
         }
-        redisTemplate.opsForValue().set(Constants.REDIS_HK_TOKEN_KEY+encrypt, encrypt,1000*60*60*hour, TimeUnit.MILLISECONDS);
-         return encrypt;
+        String token = UUID.randomUUID().toString();
+        redisTemplate.opsForValue().set(Constants.REDIS_HK_TOKEN_KEY+token, encrypt,1000*60*60*hour, TimeUnit.MILLISECONDS);
+        return token;
     }
 
 
diff --git a/server/visits/dmvisit_admin/src/main/java/com/doumee/cloud/openapi/HkOpenApiController.java b/server/visits/dmvisit_admin/src/main/java/com/doumee/cloud/openapi/HkOpenApiController.java
index 83fb8c8..7782d65 100644
--- a/server/visits/dmvisit_admin/src/main/java/com/doumee/cloud/openapi/HkOpenApiController.java
+++ b/server/visits/dmvisit_admin/src/main/java/com/doumee/cloud/openapi/HkOpenApiController.java
@@ -68,12 +68,10 @@
     @ApiOperation("token瑙f瀽")
     @GetMapping("/water/decodeToken")
     public Map<String,Object> decodeToken(@RequestParam String token) {
-        String token1 =token;
-        log.info("銆愬畨闃插钩鍙板崟鐐圭櫥褰晅oken瑙f瀽銆�================="+token1);
+        log.info("銆愬畨闃插钩鍙板崟鐐圭櫥褰晅oken瑙f瀽銆�================="+token);
         int success = Constants.ZERO;
         Map<String,Object>  result = new HashMap<>() ;
         try {
-             token = URLEncoder.encode(token1);
             HkBaseTokenRequest hkBaseTokenRequest = new HkBaseTokenRequest();
             hkBaseTokenRequest.setToken(token);
             result = this.decodeTokenForHk(hkBaseTokenRequest);
@@ -85,7 +83,7 @@
             e.printStackTrace();
             success = Constants.ONE;
         }finally {
-            interfaceLogService.saveInterfaceLog("/hk/api/water/decodeToken", "銆愬畨闃插钩鍙般�戝崟鐐圭櫥褰晅oken瑙f瀽",token1,
+            interfaceLogService.saveInterfaceLog("/hk/api/water/decodeToken", "銆愬畨闃插钩鍙般�戝崟鐐圭櫥褰晅oken瑙f瀽",token,
                     success, JSONObject.toJSONString(result),Constants.ZERO);
         }
         return result;
@@ -106,11 +104,7 @@
             result.put("msg","token鏃犳晥!");
             return result;
         }
-        String userName = null;
-        try {
-             userName = DESUtil.verifyHkToken(URLDecoder.decode(hkBaseTokenRequest.getToken(),"UTF-8"));
-        }catch (Exception e){
-        }
+        String userName = DESUtil.verifyHkToken( redisToken);;
         if(StringUtils.isBlank(userName)){
             result.put("code","-1");
             result.put("msg","token鍙傛暟涓虹┖");
diff --git a/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/PositionServiceImpl.java b/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/PositionServiceImpl.java
index 4b518a6..6b5c2b8 100644
--- a/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/PositionServiceImpl.java
+++ b/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/PositionServiceImpl.java
@@ -109,7 +109,9 @@
         QueryWrapper<Position> queryWrapper = new QueryWrapper<>();
         Utils.MP.blankToNull(pageWrap.getModel());
         pageWrap.getModel().setIsdeleted(Constants.ZERO);
-        queryWrapper.lambda()
+        queryWrapper
+                .select("*,(select count(1) from member where member.position_id = position.id and member.type=2 and isdeleted=0) as memberNum" )
+                .lambda()
                 .eq(pageWrap.getModel().getId() != null, Position::getId, pageWrap.getModel().getId())
                 .eq(pageWrap.getModel().getCreator() != null, Position::getCreator, pageWrap.getModel().getCreator())
                 .ge(pageWrap.getModel().getCreateDate() != null, Position::getCreateDate, Utils.Date.getStart(pageWrap.getModel().getCreateDate()))

--
Gitblit v1.9.3