From 80d0a7e45e644a9730dd89b3a924710ee504ee82 Mon Sep 17 00:00:00 2001 From: erdanergou Date: Thu, 20 Jul 2023 16:50:16 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=83=A8=E5=88=86=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E4=BB=A5=E5=8F=96=E6=B6=88=E5=8F=91=E9=80=81=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/PageController.java | 4 ++-- .../controller/QyWxOperationController.java | 18 ++++++++---------- .../utils/EncryptionAlgorithmUtil.java | 4 ++-- .../LineOrBarChart.html | 0 .../SunburstChart.html | 0 5 files changed, 12 insertions(+), 14 deletions(-) rename src/main/resources/templates/pages/depository/{InAndOut_echart => Tableechart}/LineOrBarChart.html (100%) rename src/main/resources/templates/pages/depository/{InAndOut_echart => Tableechart}/SunburstChart.html (100%) diff --git a/src/main/java/com/dreamchaser/depository_manage/controller/PageController.java b/src/main/java/com/dreamchaser/depository_manage/controller/PageController.java index 7961896d..f32087f9 100644 --- a/src/main/java/com/dreamchaser/depository_manage/controller/PageController.java +++ b/src/main/java/com/dreamchaser/depository_manage/controller/PageController.java @@ -4003,7 +4003,7 @@ public class PageController { ModelAndView mv = new ModelAndView(); mv.addObject("type", type); mv.addObject("echartType", echartType); - mv.setViewName("pages/depository/InAndOut_echart/LineOrBarChart"); + mv.setViewName("pages/depository/Tableechart/LineOrBarChart"); return mv; } @@ -4020,7 +4020,7 @@ public class PageController { Map previousMonth = DateUtil.getPreviousMonth(); List monthNames = ObjectFormatUtil.objToList(previousMonth.get("monthNames"), String.class); mv.addObject("monthNames", monthNames); - mv.setViewName("pages/depository/InAndOut_echart/SunburstChart"); + mv.setViewName("pages/depository/Tableechart/SunburstChart"); return mv; } } diff --git a/src/main/java/com/dreamchaser/depository_manage/controller/QyWxOperationController.java b/src/main/java/com/dreamchaser/depository_manage/controller/QyWxOperationController.java index cbe32a30..ee9bbea4 100644 --- a/src/main/java/com/dreamchaser/depository_manage/controller/QyWxOperationController.java +++ b/src/main/java/com/dreamchaser/depository_manage/controller/QyWxOperationController.java @@ -16,6 +16,7 @@ import com.dreamchaser.depository_manage.security.pool.HandlesOtherFunctionalThr import com.dreamchaser.depository_manage.security.pool.RedisPool; import com.dreamchaser.depository_manage.service.*; import com.dreamchaser.depository_manage.service.impl.QyWxOperationService; +import com.dreamchaser.depository_manage.utils.EncryptionAlgorithmUtil; import com.dreamchaser.depository_manage.utils.Md5; import com.dreamchaser.depository_manage.utils.ObjectFormatUtil; import com.dreamchaser.depository_manage.utils.QyWxXMLUtils; @@ -264,18 +265,15 @@ public class QyWxOperationController { String userId = jsonObject.getString("userid"); if (errCode == 0) { // 如果成功获取userid - Map portInfo = PublicConfig.findUserByQyWxUserId(userId); - UserByPort userByPort = (UserByPort) portInfo.get("user"); - - String key = (String) portInfo.get("key"); - String token = (String) portInfo.get("token"); +// Map portInfo = PublicConfig.findUserByQyWxUserId(userId); +// UserByPort userByPort = (UserByPort) portInfo.get("user"); + UserByPort userByPort = userService.findUserByWorkWechat(userId); + EncryptionAlgorithmUtil encryptionAlgorithmUtils = new EncryptionAlgorithmUtil(); + Map userKeyAndUserToken = encryptionAlgorithmUtils.getUserKeyAndUserToken(userByPort); + String key = userKeyAndUserToken.get("key"); + String token = userKeyAndUserToken.get("token"); if (userByPort != null) { // 如果数据库中存在该用户 - // 获取当前用户所在主部门 - Long maindeparment = userByPort.getMaindeparment(); - if (maindeparment == 309) { - userByPort.setMaindeparment(userByPort.getAdminorg()); - } // 设置放入时间 userByPort.setInstant(Instant.now()); AuthenticationTokenPool.addUserToken(token, userByPort); diff --git a/src/main/java/com/dreamchaser/depository_manage/utils/EncryptionAlgorithmUtil.java b/src/main/java/com/dreamchaser/depository_manage/utils/EncryptionAlgorithmUtil.java index 04bb8cff..38f7dbb2 100644 --- a/src/main/java/com/dreamchaser/depository_manage/utils/EncryptionAlgorithmUtil.java +++ b/src/main/java/com/dreamchaser/depository_manage/utils/EncryptionAlgorithmUtil.java @@ -65,8 +65,8 @@ public class EncryptionAlgorithmUtil { String userToken = DigestUtils.sha1Hex(sha1Str); - result.put("userKey", userKey); - result.put("userToken", userToken); + result.put("key", userKey); + result.put("token", userToken); return result; } diff --git a/src/main/resources/templates/pages/depository/InAndOut_echart/LineOrBarChart.html b/src/main/resources/templates/pages/depository/Tableechart/LineOrBarChart.html similarity index 100% rename from src/main/resources/templates/pages/depository/InAndOut_echart/LineOrBarChart.html rename to src/main/resources/templates/pages/depository/Tableechart/LineOrBarChart.html diff --git a/src/main/resources/templates/pages/depository/InAndOut_echart/SunburstChart.html b/src/main/resources/templates/pages/depository/Tableechart/SunburstChart.html similarity index 100% rename from src/main/resources/templates/pages/depository/InAndOut_echart/SunburstChart.html rename to src/main/resources/templates/pages/depository/Tableechart/SunburstChart.html