From 19464eb021cfa547dfbfba45a9c896837f7d0d98 Mon Sep 17 00:00:00 2001
From: ludc
Date: 星期四, 18 七月 2024 15:35:15 +0800
Subject: [PATCH] 修改密码,登录接口增加密码解密逻辑(前端传递的密码加密传输);枚举和枚举项:查询、增加、修改、删除接口上传。

---
 Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/frameworkcore/compatibility/impl/SmRoleQueryServiceImpl.java |   53 +++++++++++++++++++++++++++++++++++------------------
 1 files changed, 35 insertions(+), 18 deletions(-)

diff --git a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/frameworkcore/compatibility/impl/SmRoleQueryServiceImpl.java b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/frameworkcore/compatibility/impl/SmRoleQueryServiceImpl.java
index fa9b95d..2320280 100644
--- a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/frameworkcore/compatibility/impl/SmRoleQueryServiceImpl.java
+++ b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/frameworkcore/compatibility/impl/SmRoleQueryServiceImpl.java
@@ -1,28 +1,23 @@
 package com.vci.frameworkcore.compatibility.impl;
 
+import com.vci.constant.FrameWorkBtmTypeConstant;
 import com.vci.corba.common.PLException;
 import com.vci.corba.common.data.UserEntityInfo;
 import com.vci.corba.framework.data.RoleInfo;
 import com.vci.corba.omd.data.BusinessObject;
 import com.vci.frameworkcore.compatibility.SmRoleQueryServiceI;
-import com.vci.frameworkcore.constant.FrameWorkBtmTypeConstant;
-import com.vci.frameworkcore.dto.SmRoleDTO;
+import com.vci.constant.FrameWorkBtmTypeConstant;
+import com.vci.dto.SmRoleDTO;
 import com.vci.frameworkcore.enumpck.RoleClassifyEnum;
 import com.vci.frameworkcore.enumpck.RoleControlAreaEnum;
-import com.vci.frameworkcore.model.SmRoleForPlatform1;
-import com.vci.frameworkcore.model.dto.SmUserDTO;
-import com.vci.frameworkcore.model.po.SmRolePO;
-import com.vci.frameworkcore.model.po.SmUserPO;
-import com.vci.frameworkcore.pagemodel.OrgDepartmentVO;
-import com.vci.frameworkcore.pagemodel.SmRoleVO;
-import com.vci.frameworkcore.pagemodel.SmUserVO;
-import com.vci.frameworkcore.properties.ConfigReader;
+import com.vci.model.SmRoleForPlatform1;
+import com.vci.po.SmRolePO;
+import com.vci.pagemodel.SmRoleVO;
 import com.vci.omd.utils.ObjectTool;
 import com.vci.starter.poi.bo.ReadExcelOption;
 import com.vci.starter.poi.constant.ExcelLangCodeConstant;
 import com.vci.starter.poi.util.ExcelUtil;
 import com.vci.starter.web.constant.QueryOptionConstant;
-import com.vci.starter.web.enumpck.UserSecretEnum;
 import com.vci.starter.web.exception.VciBaseException;
 import com.vci.starter.web.pagemodel.*;
 import com.vci.starter.web.util.LangBaseUtil;
@@ -86,7 +81,7 @@
 		if(Func.isEmpty(conditionMap)){
 			return null;
 		}
-		VciQueryWrapperForDO queryWrapper = new VciQueryWrapperForDO(conditionMap,SmRoleForPlatform1.class);
+		VciQueryWrapperForDO queryWrapper = new VciQueryWrapperForDO(conditionMap, SmRoleForPlatform1.class);
 		List<SmRoleForPlatform1> smRoleForPlatform1s = boService.selectByQueryWrapper(queryWrapper, SmRoleForPlatform1.class);
 		if(Func.isNotEmpty(smRoleForPlatform1s) && Func.isNotBlank(smRoleForPlatform1s.get(0).getPluid())){
 			//瑙掕壊鍚嶄笉鑳介噸澶嶆墍浠ョ洿鎺ュ彇绗竴涓厓绱�
@@ -567,7 +562,7 @@
 	}
 
 	/**
-	 * 淇濆瓨鐢ㄦ埛瑙掕壊鍏宠仈鍏崇郴
+	 * 鎴愬憳绠$悊鍒嗛厤瑙掕壊璋冪敤锛屼繚瀛樼敤鎴疯鑹插叧鑱斿叧绯�
 	 * @param userOids
 	 * @param roleIds
 	 * @return
@@ -576,7 +571,23 @@
 	public boolean saveRights(String[] userOids, String[] roleIds) throws PLException {
 		VciBaseUtil.alertNotNull(userOids,"鐢ㄦ埛涓婚敭");
 		//roleIds鍏佽涓虹┖锛屼负绌烘椂娓呯┖褰撳墠鐢ㄦ埛鐨勬潈闄�
-		return platformClientUtil.getFrameworkService().saveRights(roleIds,userOids,new UserEntityInfo());
+		UserEntityInfo userEntityInfo = new UserEntityInfo(WebThreadLocalUtil.getCurrentUserSessionInfoInThread().getUserId(),null);
+		return platformClientUtil.getFrameworkService().saveRights(roleIds,userOids,userEntityInfo);
+	}
+
+	/**
+	 * 瑙掕壊绠$悊鍒嗛厤鎴愬憳鎺ュ彛璋冪敤
+	 * @param userOids
+	 * @param roleId
+	 * @return
+	 * @throws PLException
+	 */
+	@Override
+	public boolean saveRight(String[] userOids, String roleId) throws PLException {
+		VciBaseUtil.alertNotNull(roleId,"瑙掕壊涓婚敭");
+		//roleIds鍏佽涓虹┖锛屼负绌烘椂娓呯┖褰撳墠鐢ㄦ埛鐨勬潈闄�
+		UserEntityInfo userEntityInfo = new UserEntityInfo(WebThreadLocalUtil.getCurrentUserSessionInfoInThread().getUserId(),null);
+		return platformClientUtil.getFrameworkService().saveRight(roleId,userOids,userEntityInfo);
 	}
 
 	/**
@@ -630,7 +641,7 @@
 		VciBaseUtil.alertNotNull(
 				smRoleDTO,"娣诲姞鐨勮鑹插璞�",
 				smRoleDTO.getName(),"瑙掕壊鍚�");
-		//鏌ヨ鏁版嵁搴撲腑鐨勶紝鏍规嵁瑙掕壊鍚嶆煡
+		//鏍规嵁瑙掕壊涓婚敭鏌ヨ锛岀‘淇濅慨鏀圭殑瑙掕壊瀛樺湪
 		Map<String, String> conditionMap = new HashMap<>();
 		conditionMap.put("pluid",smRoleDTO.getOid());
 		SmRoleVO dbSmRoleVO = getRoleByConditionMap(conditionMap);
@@ -638,8 +649,14 @@
 		if(Func.isEmpty(dbSmRoleVO) || Func.isBlank(dbSmRoleVO.getOid())){
 			throw new PLException("500", new String[] { "褰撳墠淇敼鐨勮鑹蹭笉瀛樺湪!"});
 		}
-		//瑙掕壊鍚嶇浉绛夛紝浣嗘槸涓婚敭涓嶇浉绛夛紝璇存槑淇敼涓虹殑瑙掕壊鍚嶅凡瀛樺湪锛屼笉鑳介噸澶�
-		if(dbSmRoleVO.getName().equals(smRoleDTO.getName()) && !dbSmRoleVO.getOid().equals(smRoleDTO.getOid())){
+		//鏌ヨ鏁版嵁搴撲腑鐨勶紝鏍规嵁瑙掕壊鍚嶆煡閲�
+		conditionMap.clear();
+		conditionMap.put("plname",smRoleDTO.getName());
+		//鎺掗櫎鎺夊綋鍓嶄慨鏀圭殑鐢ㄦ埛
+		conditionMap.put("pluid",QueryOptionConstant.NOTEQUAL + smRoleDTO.getName());
+		SmRoleVO reapeatSmRoleVO = getRoleByConditionMap(conditionMap);
+		//璇存槑淇敼涓虹殑瑙掕壊鍚嶅凡瀛樺湪锛屼笉鑳介噸澶�
+		if(Func.isNotEmpty(reapeatSmRoleVO) && smRoleDTO.getName().equals(reapeatSmRoleVO)){
 			throw new PLException("500", new String[] { "璇ヨ鑹插悕绉板凡缁忓瓨鍦�,璇蜂慨鏀�!"});
 		}
 		SmRoleDTO smRoleDTO1 = new SmRoleDTO();
@@ -676,7 +693,7 @@
 	 * @throws VciBaseException
 	 */
 	@Override
-	public BaseResult importRole(File file) throws VciBaseException {
+	public BaseResult importRole(File file) throws Exception {
 		VciBaseUtil.alertNotNull(file,"excel鏂囦欢");
 		if(!file.exists()){
 			throw new VciBaseException("瀵煎叆鐨別xcel鏂囦欢涓嶅瓨鍦�,{0}",new String[]{file.getPath()});

--
Gitblit v1.9.3