From fa8f28cf848d2c3aeaa548a7ac65f93b690392c3 Mon Sep 17 00:00:00 2001
From: yuxc <yuxc@vci-tech.com>
Date: 星期五, 23 八月 2024 10:19:35 +0800
Subject: [PATCH] 1、配置文件上传
---
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/frameworkcore/compatibility/impl/SmUserQueryServiceImpl.java | 34 ++++++++++++++++++++++++----------
1 files changed, 24 insertions(+), 10 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 80dd56a..6a52208 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
@@ -16,7 +16,7 @@
import com.vci.pagemodel.OrgDepartmentVO;
import com.vci.pagemodel.SmPasswordStrategyVO;
import com.vci.pagemodel.SmRoleVO;
-import com.vci.frameworkcore.properties.ConfigReader;
+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;
@@ -117,7 +117,7 @@
/**
* 蹇呭~鍒�
*/
- private ArrayList<Integer> ColumnNameisRed = new ArrayList<Integer>();
+ private List<Integer> ColumnNameisRed = new ArrayList<Integer>();
/**
* 鐢ㄦ埛鍒嗛〉鏌ヨ鏃惰幏鍙栭儴闂ㄦ斁鍒拌繖閲岄伩鍏嶉噸澶嶆煡璇�
@@ -1028,15 +1028,18 @@
@Override
@Transactional(rollbackFor = Exception.class)
public boolean changePassword(String userOid,String oldPassword, String password,
- String confirmPassword) throws PLException {
+ 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[] { "鎮ㄨ緭鍏ョ殑瀵嗙爜涓庣櫥褰曞瘑鐮佷笉涓�鑷�,璇烽噸鏂拌緭鍏�!"});
- }
- if(!password.equals(confirmPassword)){
- throw new VciBaseException("瀵嗙爜鍜岀‘璁ゅ瘑鐮佷笉鐩哥瓑");
}
SmUserVO smUserVO = getUserByUserOid(userOid);
if(Func.isEmpty(smUserVO)){
@@ -1047,12 +1050,21 @@
if (!StringUtils.isBlank(error)) {
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 = TO_DATE('"
- + Func.format(new Date(),"yyyy-MM-dd HH:mm:ss") +"','yyyy-MM-dd hh24:mi:ssxff') where pluid = '" + userOid.trim() + "'";
+ + Func.format(new Date(),"yyyy-MM-dd HH:mm:ss") +"','yyyy-MM-dd hh24:mi:ss') where pluid = '" + userOid.trim() + "'";
try {
return platformClientUtil.getBOFactoryService().executeUpdateSql(sql);
} catch (PLException vciError) {
@@ -1310,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("璐﹀彿", "瀵嗙爜", "濮撳悕", "鐢靛瓙閭", "涓撲笟", "鎻忚堪", "閮ㄩ棬(涓婁笅绾ч儴闂ㄤ箣闂翠互鍙嶆枩鏉犻殧寮�(/))" ,"瀵嗙骇"));
}
@@ -1362,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());
//鏄惁蹇呴』瀵煎叆瀵嗙骇
@@ -1386,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