From 34c25ddf37a3eb8da9efb04efedad089f13efe83 Mon Sep 17 00:00:00 2001
From: ludc
Date: 星期三, 24 七月 2024 18:20:27 +0800
Subject: [PATCH] 部门导入调整,按照部门名称/实现层级关系。枚举导入功能接口上传,属性池添加新增、查询、修改、导出、查看应用范围等接口。业务类型、链接类型、枚举类型增加等接口属性是否产生数据检查、根据属性名修改业务类型和连接类型中对应属性方法,以及属性池中需要的一些下拉查询接口。

---
 Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/frameworkcore/compatibility/impl/SmUserQueryServiceImpl.java |   58 +++++++++++++++++++++++++++++++++++++++-------------------
 1 files changed, 39 insertions(+), 19 deletions(-)

diff --git a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/frameworkcore/compatibility/impl/SmUserQueryServiceImpl.java b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/frameworkcore/compatibility/impl/SmUserQueryServiceImpl.java
index c38f4cc..d08bcbb 100644
--- a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/frameworkcore/compatibility/impl/SmUserQueryServiceImpl.java
+++ b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/frameworkcore/compatibility/impl/SmUserQueryServiceImpl.java
@@ -1,5 +1,6 @@
 package com.vci.frameworkcore.compatibility.impl;
 
+import com.vci.dto.SmUserDTO;
 import com.vci.common.util.ThreeDES;
 import com.vci.corba.common.PLException;
 import com.vci.corba.common.data.UserEntityInfo;
@@ -9,14 +10,13 @@
 import com.vci.frameworkcore.compatibility.SmPwdStrategyQueryServiceI;
 import com.vci.frameworkcore.compatibility.SmRoleQueryServiceI;
 import com.vci.frameworkcore.compatibility.SmUserQueryServiceI;
-import com.vci.frameworkcore.model.dto.SmUserDTO;
-import com.vci.frameworkcore.model.SmUserDO;
-import com.vci.frameworkcore.model.po.SmUserPO;
-import com.vci.frameworkcore.pagemodel.OrgDepartmentVO;
-import com.vci.frameworkcore.pagemodel.SmPasswordStrategyVO;
-import com.vci.frameworkcore.pagemodel.SmRoleVO;
-import com.vci.frameworkcore.pagemodel.SmUserVO;
-import com.vci.frameworkcore.properties.ConfigReader;
+import com.vci.model.SmUserDO;
+import com.vci.pagemodel.SmUserVO;
+import com.vci.po.SmUserPO;
+import com.vci.pagemodel.OrgDepartmentVO;
+import com.vci.pagemodel.SmPasswordStrategyVO;
+import com.vci.pagemodel.SmRoleVO;
+import com.vci.frameworkcore.properties.ConfigCorbaReader;
 import com.vci.omd.utils.ObjectTool;
 import com.vci.starter.poi.bo.ReadExcelOption;
 import com.vci.starter.poi.bo.WriteExcelData;
@@ -183,7 +183,7 @@
 	 * @return 鐢ㄦ埛鐨勪俊鎭�
 	 * @throws VciBaseException 鏌ヨ鍑洪敊鐨勬椂鍊欎細鎶涘嚭寮傚父
 	 */
-	private SmUserVO getUserByField(String queryField,String queryValue) throws VciBaseException{
+	private SmUserVO getUserByField(String queryField, String queryValue) throws VciBaseException{
 		VciQueryWrapperForDO queryWrapper = new VciQueryWrapperForDO(null, SmUserDO.class,null,true);
 		queryWrapper.eq(queryWrapper.getTableNick() + "." +queryField,queryValue);
 		queryWrapper.setDistinct(true);
@@ -1021,16 +1021,25 @@
 	 /**
      * 淇敼瀵嗙爜
      * @param userOid 鐢ㄦ埛涓婚敭
+     * @param oldPassword 鏃х殑瀵嗙爜
      * @param password 鏂扮殑瀵嗙爜
      * @param confirmPassword 纭瀵嗙爜
      */
 	@Override
 	@Transactional(rollbackFor = Exception.class)
-	public void changePassword(String userOid, String password,
-			String confirmPassword) throws PLException {
-		WebUtil.alertNotNull(userOid,"鐢ㄦ埛涓婚敭",password,"瀵嗙爜",confirmPassword,"纭瀵嗙爜");
+	public boolean changePassword(String userOid,String oldPassword, String password,
+			String confirmPassword) throws Exception {
+		WebUtil.alertNotNull(userOid,"鐢ㄦ埛涓婚敭",oldPassword,"鐧诲綍瀵嗙爜",password,"瀵嗙爜",confirmPassword,"纭瀵嗙爜");
 		if(!password.equals(confirmPassword)){
 			throw new VciBaseException("瀵嗙爜鍜岀‘璁ゅ瘑鐮佷笉鐩哥瓑");
+		}
+		//瀵规棫瀵嗙爜鍜屽瘑鐮佽繘琛岃В瀵嗭紝渚夸簬姣斿瀵嗙爜鐢�
+		oldPassword = Func.decryptAes(oldPassword,"daliantan0v0vcip");
+		password = Func.decryptAes(password,"daliantan0v0vcip");
+		//瀵规瘮鏃у瘑鐮�
+		boolean b = this.checkPasswordEqual(oldPassword, userOid);
+		if(!b){
+			throw new PLException("500", new String[] { "鎮ㄨ緭鍏ョ殑瀵嗙爜涓庣櫥褰曞瘑鐮佷笉涓�鑷�,璇烽噸鏂拌緭鍏�!"});
 		}
 		SmUserVO smUserVO = getUserByUserOid(userOid);
 		if(Func.isEmpty(smUserVO)){
@@ -1039,16 +1048,25 @@
 		//TODO:鏍¢獙瀵嗙爜鏄惁绗﹀悎绛栫暐
 		String error = platformClientUtil.getFrameworkService().checkPasswordStrategyByUserId(smUserVO.getId(), password,null);
 		if (!StringUtils.isBlank(error)) {
-			throw new VciBaseException("褰撳墠璁剧疆鐨勫瘑鐮侊紝瀵嗙爜绛栫暐鏍¢獙鏈�氳繃");
+			throw new VciBaseException("褰撳墠璁剧疆鐨勫瘑鐮侊紝瀵嗙爜绛栫暐鏍¢獙鏈�氳繃!");
 		}
+
+		//TODO:鑰冭檻鏄惁闇�瑕佸皢淇敼鏂瑰紡鏀规垚鐩存帴璋冪敤骞冲彴鐨勬帴鍙o紝鍥犱负鐜板湪鐨勪慨鏀规柟寮忔病鑳芥纭殑鏇存柊缂撳瓨
+		/*UserInfo userInfo = new UserInfo();
+		userInfo.id = userOid.trim();
+		userInfo.pwd = password;
+		userInfo.pwdUpdateTime = System.currentTimeMillis();
+		boolean updateBoolean = platformClientUtil.getFrameworkService().updateUser(userInfo, new UserEntityInfo(WebThreadLocalUtil.getCurrentUserSessionInfoInThread().getUserId(), null));
+		return updateBoolean;*/
+
 		ThreeDES des = new ThreeDES();// 瀹炰緥鍖栦竴涓锟�?
 		des.getKey("daliantan0v0");// 鐢熸垚瀵嗗寵
 		String encPassword = des.getEncString(password);
-
 		//淇敼瀵嗙爜鐨勫悓鏃堕渶瑕佸皢瀵嗙爜淇敼鏃堕棿涔熸洿鏂�
-		String sql = "update pluser set plpassword = '" + encPassword + "' plpwdupdatetime = '"+ System.currentTimeMillis() +"' where pluid = '" + userOid.trim() + "'";
+		String sql = "update pluser set plpassword = '" + encPassword + "', plpwdupdatetime = TO_DATE('"
+				+ Func.format(new Date(),"yyyy-MM-dd HH:mm:ss") +"','yyyy-MM-dd hh24:mi:ss') where pluid = '" + userOid.trim() + "'";
 		try {
-			platformClientUtil.getBOFactoryService().executeUpdateSql(sql);
+			return platformClientUtil.getBOFactoryService().executeUpdateSql(sql);
 		} catch (PLException vciError) {
 			throw WebUtil.getVciBaseException(vciError);
 		}
@@ -1304,7 +1322,7 @@
 		// 璁剧疆琛ㄥ崟鍒楀悕
 		List<String> columns = new ArrayList<>(Arrays.asList("璐﹀彿", "瀵嗙爜", "濮撳悕", "鐢靛瓙閭", "涓撲笟", "鎻忚堪", "閮ㄩ棬(涓婁笅绾ч儴闂ㄤ箣闂翠互鍙嶆枩鏉犻殧寮�(/))"));
 		//鑾峰彇鏄惁瀵煎嚭瀵嗙骇閰嶇疆椤�
-		String flag = ConfigReader.getConfigValue("exportSecretGrade");
+		String flag = ConfigCorbaReader.getConfigValue("exportSecretGrade");
 		if (flag != null && flag.equalsIgnoreCase("true")) {
 			columns = new ArrayList<>(Arrays.asList("璐﹀彿", "瀵嗙爜", "濮撳悕", "鐢靛瓙閭", "涓撲笟", "鎻忚堪", "閮ㄩ棬(涓婁笅绾ч儴闂ㄤ箣闂翠互鍙嶆枩鏉犻殧寮�(/))" ,"瀵嗙骇"));
 		}
@@ -1356,7 +1374,7 @@
 			String loginUserId = WebThreadLocalUtil.getCurrentUserSessionInfoInThread().getUserId();
 			UserEntityInfo userEntityInfo = new UserEntityInfo(loginUserId,null);
 			//鏄惁瀵煎叆瀵嗙骇閰嶇疆
-			boolean exportSecretGrade = Boolean.parseBoolean(ConfigReader.getConfigValue("exportSecretGrade"));
+			boolean exportSecretGrade = Boolean.parseBoolean(ConfigCorbaReader.getConfigValue("exportSecretGrade"));
 			List<SmUserPO> poList = ExcelUtil.readDataObjectFromExcel(file, SmUserPO.class,excelOption,(value, po, fieldName)->{
 				Integer secretValue = UserSecretEnum.getSecretValueByText(po.getSecretGradeText());
 				//鏄惁蹇呴』瀵煎叆瀵嗙骇
@@ -1380,7 +1398,9 @@
 			//褰撳墠excel涓槸鍚﹂噸澶嶇敤鐨勫垽閲峂ap:锛坘ey锛氳处鍙凤紝value锛氳鍙凤級
 			Map<String, String> excelReapeat = new HashMap<>();
 			//鍏堣幏鍙栧叏閮ㄩ儴闂ㄥ悕绉扮殑鐖跺瓙瀵瑰簲鍏崇郴锛歬ey涓洪儴闂ㄥ瓙鐖剁骇鍚嶇О璺緞锛寁alue涓洪儴闂ㄤ俊鎭�
-			Map<String,OrgDepartmentVO> deptVOMap = orgDeptQueryService.getDeptAllTreeMap();
+			List<OrgDepartmentVO> orgDepartmentVOList = orgDeptQueryService.getDeptAllFullName();
+			Map<String, OrgDepartmentVO> deptVOMap = orgDepartmentVOList.stream().collect(Collectors.toMap(OrgDepartmentVO::getFullDeptNamePath, s->s));
+			//Map<String,OrgDepartmentVO> deptVOMap = orgDeptQueryService.getDeptAllTreeMap();
 			//鍒ゆ柇蹇呭~灞炴�ф槸鍚︿负绌猴紝鐢ㄦ埛鏄惁宸插瓨鍦紝浠ュ強閮ㄩ棬鏄惁濉敊绛夋牎楠岄�昏緫
 			List<String> finalRepeatUserId = repeatUserId;
 			poList.stream().forEach(smUserPO -> {

--
Gitblit v1.9.3