From a471b20fe8075a663f32b3a2ee0cd70c1c63baf7 Mon Sep 17 00:00:00 2001
From: ludc
Date: 星期四, 21 十一月 2024 21:59:42 +0800
Subject: [PATCH] 业务类型查询:树查询修改,数据列表查询接口修改(处理模板套模板情况下freemarker表达式的替换处理)。

---
 Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/LoginServiceImpl.java |   24 +++++++++++++++---------
 1 files changed, 15 insertions(+), 9 deletions(-)

diff --git a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/LoginServiceImpl.java b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/LoginServiceImpl.java
index e860eee..8bc2aa7 100644
--- a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/LoginServiceImpl.java
+++ b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/LoginServiceImpl.java
@@ -19,6 +19,7 @@
 import com.vci.starter.web.annotation.bus.VciLoginAfter;
 import com.vci.starter.web.annotation.bus.VciLogoutBefore;
 import com.vci.starter.web.annotation.bus.VciLogoutPlugin;
+import com.vci.starter.web.constant.VConstant;
 import com.vci.starter.web.exception.VciBaseException;
 import com.vci.starter.web.interceptor.VciSessionForLoginI;
 import com.vci.starter.web.pagemodel.RequestClientInfo;
@@ -30,7 +31,7 @@
 import com.vci.constant.CacheNameConstant;
 import com.vci.dto.LoginUserDTO;
 import com.vci.web.properties.WebProperties;
-import com.vci.web.redis.RedisService;
+import com.vci.starter.web.redis.RedisService;
 import com.vci.web.service.LoginServiceI;
 import com.vci.web.util.Func;
 import com.vci.web.util.PlatformClientUtil;
@@ -134,7 +135,7 @@
      * @throws VciBaseException 鐧诲綍鍙戠敓寮傚父鐨勬椂鍊欏嚭鐜颁簡閿欒
      */
     @Override
-    public LoginResultBO login(LoginUserDTO userDTO, RequestClientInfo clientInfo) throws PLException {
+    public LoginResultBO login(LoginUserDTO userDTO, RequestClientInfo clientInfo) throws Exception {
         return login(userDTO,clientInfo,true);
     }
 
@@ -146,7 +147,7 @@
      * @return 鎵ц缁撴灉
      * @throws VciBaseException 鍙傛暟閿欒锛岀敤鎴蜂笉鑳界櫥褰曠瓑浼氭姏鍑哄紓甯�
      */
-    private LoginResultBO login(LoginUserDTO userDTO, RequestClientInfo clientInfo, boolean checkPassword/*鍗曠偣鐧诲綍涓嶉渶瑕佹牎楠屽瘑鐮�*/) throws VciBaseException, PLException {
+    private LoginResultBO login(LoginUserDTO userDTO, RequestClientInfo clientInfo, boolean checkPassword/*鍗曠偣鐧诲綍涓嶉渶瑕佹牎楠屽瘑鐮�*/) throws Exception {
         LoginResultBO loginResult = new LoginResultBO();
         loginResult.setSuccess(false);
 
@@ -167,6 +168,7 @@
             String tokenKey = redisService.getCacheObject(userIdTokenKey);
             redisService.deleteObject(tokenKey);
             redisService.deleteObject(userIdTokenKey);
+            redisService.decreOnlineUser(VConstant.CURRENT_LOGGED_USERS_KEY);
         }
 
         //3.鑾峰彇鐢ㄦ埛鐨勫璞★紙瀵硅薄涓寘鍚鑹查儴闂ㄨ繕鏈夊瘑鐮佺瓥鐣ヤ俊鎭�(褰撳墠鐢ㄦ埛娌¤缃瘑鐮佺瓥鐣ュ氨鏄彇鐨勯粯璁ゅ瘑鐮佺瓥鐣�)锛�
@@ -195,9 +197,8 @@
         machine.machine = clientInfo.getMachine();
         String token = null;
         try {
-            /*ThreeDES des = new ThreeDES();// 瀹炰緥鍖栦竴涓锟�?
-            des.getKey("daliantan0v0");// 鐢熸垚瀵嗗寵
-            String encPassword = des.getDesString(userDTO.getPassword());*/
+            //鍓嶇浼犺繃鏉ョ殑瀵嗙爜鏄粡杩囧姞瀵嗕紶杈撶殑锛屾墍浠ラ渶瑕佹寜鐓х害瀹氳В瀵嗭紝鍐嶄紶缁欏钩鍙拌繘琛屾瘮瀵�
+            userDTO.setPassword(Func.decryptAes(userDTO.getPassword(),"daliantan0v0vcip"));
             LoginResult chkRes = platformClientUtil.getFrameworkService().checkLogin(userDTO.getUserId(),userDTO.getPassword(), machine);
             loginResult.setFailCode(getErrorCode(chkRes));
             //loginResult.setFailMsgArray(new String[]{userDTO.getUserId(), String.valueOf(chkRes.auxInfo)});
@@ -237,12 +238,15 @@
         }
         //6銆佺櫥褰曟垚鍔熶箣鍚庨渶瑕佸鐞嗙殑閫昏緫
         user.setLastLoginTime(new Date());//鏈�鍚庣櫥褰曟椂闂�
-        user.setPwdWrongCount(0);//瀵嗙爜閿欒娆℃暟娓�0
+        //user.setPwdWrongCount(0);//鐧诲綍鎴愬姛瀵嗙爜閿欒娆℃暟娓�0
+        platformClientUtil.getFrameworkService().updateLogonInfo(user.getOid(),true);
         //澶勭悊鐢ㄦ埛鐧诲綍鎴愬姛鐨剆ession
         SessionInfo sessionInfo = new SessionInfo();
         sessionInfo.setToken(token);
         //鍒濆鍖栧钩鍙扮殑token
         sessionForLogin.initInvocationInfo(sessionInfo);
+        //璁板綍褰撳墠鐧诲綍浜烘暟鐨勬�绘暟
+        redisService.increOnlineUser(VConstant.CURRENT_LOGGED_USERS_KEY);
         //鎷疯礉鐢ㄦ埛鍒版柊鐨剆ession浼氳瘽涓�
         copyUser2SessionInfo(user, sessionInfo, userDTO.getLangCode());
         //鎷疯礉璇锋眰淇℃伅鍒皊ession浼氳瘽涓�
@@ -323,7 +327,7 @@
 
         //3銆佸垽鏂瘑鐮佹槸鍚︽纭�
         if (checkPassword) {
-            boolean passwordIsEqual = userQueryService.checkPasswordEqual(userDTO.getPassword(), user.getOid());
+            boolean passwordIsEqual = userQueryService.checkPasswordEqual(userDTO.getPassword(), user.getName());
             if (!passwordIsEqual) {
                 if (logger.isDebugEnabled()) {
                     logger.debug("{}瀵嗙爜涓嶆纭�", user.getId());
@@ -526,7 +530,7 @@
      * @throws VciBaseException 鐧诲綍澶辫触鐨勬椂鍊欐姏鍑哄紓甯�
      */
     @Override
-    public LoginResultBO singleLogin(LoginUserDTO userDTO, RequestClientInfo clientInfo) throws PLException {
+    public LoginResultBO singleLogin(LoginUserDTO userDTO, RequestClientInfo clientInfo) throws Exception {
         return login(userDTO,clientInfo,false);
     }
 
@@ -559,6 +563,8 @@
                 }
             });
         }
+        //娓呴櫎瀛樺綋鍓嶇櫥褰曠殑鐢ㄦ埛锛堟�绘暟-1锛�
+        redisService.decreOnlineUser(VConstant.CURRENT_LOGGED_USERS_KEY);
         sessionForLogin.logout(userToken);
         if(!CollectionUtils.isEmpty(logoutpluginBeanMap)){
             logoutpluginBeanMap.forEach((k,v) -> {

--
Gitblit v1.9.3