From 986aa62ed00bee39363bab41b4eeb8259d446efd Mon Sep 17 00:00:00 2001 From: ludc <ludc@vci-tech.com> Date: 星期四, 16 一月 2025 18:20:32 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- Source/Service/FrameService/src/com/vci/server/framework/delegate/RightManagementDelegate.java | 247 ++++++++++++++++++++++++------------------------- 1 files changed, 122 insertions(+), 125 deletions(-) diff --git a/Source/Service/FrameService/src/com/vci/server/framework/delegate/RightManagementDelegate.java b/Source/Service/FrameService/src/com/vci/server/framework/delegate/RightManagementDelegate.java index dfcb0e0..b1f2f43 100644 --- a/Source/Service/FrameService/src/com/vci/server/framework/delegate/RightManagementDelegate.java +++ b/Source/Service/FrameService/src/com/vci/server/framework/delegate/RightManagementDelegate.java @@ -1,13 +1,10 @@ package com.vci.server.framework.delegate; import java.text.Collator; -import java.text.ParseException; -import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.Comparator; -import java.util.Date; import java.util.Iterator; import java.util.LinkedHashMap; import java.util.List; @@ -22,9 +19,11 @@ import com.vci.corba.common.data.UserEntityInfo; import com.vci.corba.framework.data.UserInfo; import com.vci.corba.framework.data.UserLogonInfo; +import com.vci.corba.log.data.LogType; import com.vci.server.base.delegate.BaseDelegate; import com.vci.server.base.delegate.UserEntityDelegate; import com.vci.server.base.utility.LogHelper; +import com.vci.server.base.utility.LogRecordUtil; import com.vci.server.cache.OrgCacheProvider; import com.vci.server.common.ThreeDES; import com.vci.server.framework.Logon.SessionInfo; @@ -33,7 +32,6 @@ import com.vci.server.framework.cache.UserCacheUtil; import com.vci.server.framework.interfac.SingleLogonInterface; import com.vci.server.framework.interfac.TokenLogonInterface; -import com.vci.server.framework.systemConfig.log.LogRecordUtil; import com.vci.server.framework.systemConfig.stafforgmanage.combination.Combination; import com.vci.server.framework.systemConfig.stafforgmanage.combination.CombinationService; import com.vci.server.framework.systemConfig.stafforgmanage.combination.CombinationValue; @@ -50,10 +48,7 @@ import com.vci.server.framework.systemConfig.stafforgmanage.user.UserLogon; import com.vci.server.framework.systemConfig.stafforgmanage.user.UserService; import com.vci.server.framework.utils.ObjectConvert; -//import com.vci.common.LoginInfoDTO; -import com.vci.common.log.LogType; import com.vci.common.log.ServerWithLog4j; -import com.vci.common.objects.UserEntity; import com.vci.common.utility.ObjectUtility; /** @@ -182,10 +177,12 @@ UserInfo ui = fetchUserInfoByName(userName); if (ui != null && ui.status == 0 && ui.pwd.equals(password)) { res = ui; + LogRecordUtil.saveLoginLog(true, "鐧婚檰鎴愬姛", userEntityInfo); + } else { + //System.out.println("===========鐢ㄦ埛=" + res.userName + "锛� 鐘舵��=" + res.status); + // else + LogRecordUtil.saveLogoutLog("鐧婚檰澶辫触", userEntityInfo); } - //System.out.println("===========鐢ㄦ埛=" + res.userName + "锛� 鐘舵��=" + res.status); - // else - // LogRecordUtil.writeLog(userEntity, "鐧婚檰", "鐧婚檰澶辫触", LogType.Login, ""); } catch (Exception e) { ServerWithLog4j.logger.error(e); @@ -1157,7 +1154,7 @@ // log.append("鐢ㄦ埛鍚嶏細"); // User user = (User) userService.getUserInfoList(id).get(0); // log.append("[" + user.getUserName() + "]"); -// LogRecordUtil.writeLog(userEntity, "鍚戞枃浠舵煖鍒嗛厤鎴愬憳", "鎴愬姛", log.toString(), LogType.GeneralOperation, +// LogRecordUtil.writeLog(userEntity, "鍚戞枃浠舵煖鍒嗛厤鎴愬憳", "鎴愬姛", log.toString(), LogType.General, // pvolume.getId()); // } // } catch (Exception e) { @@ -1182,7 +1179,7 @@ */ public boolean saveRight(String roleId, String[] userIds, UserEntityInfo userEntityInfo) throws VCIError { boolean rs = true; - UserEntity userEntity = ObjectConvert.changeUserEntityInfoToUserEntity(userEntityInfo); + //UserEntity userEntity = ObjectConvert.changeUserEntityInfoToUserEntity(userEntityInfo); try { RoleService roleService = new RoleService(); UserService userService = new UserService(); @@ -1217,7 +1214,7 @@ // log.append("鐢ㄦ埛:"); User user = (User) userService.getUserInfoList(id).get(0); log.append("[" + user.getUserName() + "(" + user.getTrueName() + ")]"); - LogRecordUtil.writeLog(userEntity, "瑙掕壊澧炲姞鎴愬憳", "鎴愬姛", log.toString(), LogType.GeneralOperation, role.getId()); + LogRecordUtil.writeLog(userEntityInfo, "瑙掕壊澧炲姞鎴愬憳", "鎴愬姛", log.toString(), LogType.General, role.getId()); } // 鍒犻櫎鐨勪汉鍛� @@ -1226,7 +1223,7 @@ log.append(role.getLogInfo() + "->[鍑忓皯鐢ㄦ埛]->"); // log.append("鐢ㄦ埛:"); log.append("[" + u.getUserName() + "(" + u.getTrueName() + ")]"); - LogRecordUtil.writeLog(userEntity, "瑙掕壊鍑忓皯鎴愬憳", "鎴愬姛", log.toString(), LogType.GeneralOperation, role.getId()); + LogRecordUtil.writeLog(userEntityInfo, "瑙掕壊鍑忓皯鎴愬憳", "鎴愬姛", log.toString(), LogType.General, role.getId()); } // for(String id : userIds){ @@ -1235,10 +1232,10 @@ // log.append("鐢ㄦ埛鍚嶏細"); // User user = (User)userService.getUserInfoList(id).get(0); // log.append("["+user.getUserName()+"]"); -// LogRecordUtil.writeLog(userEntity, "鍚戣鑹插垎閰嶆垚鍛�", log.toString(), LogType.GeneralOperation, role.getId()); +// LogRecordUtil.writeLog(userEntity, "鍚戣鑹插垎閰嶆垚鍛�", log.toString(), LogType.General, role.getId()); // } // LogRecordUtil.writeLog(userEntity, "鍚戣鑹插垎閰嶆垚鍛�", role.getLogInfo() + ",瑙掕壊鍙戠敓鍙樺寲", - // LogType.GeneralOperation, role.getId()); + // LogType.General, role.getId()); } catch (Exception e) { throw new VCIError("120306", new String[0]); } @@ -1257,7 +1254,7 @@ */ public boolean saveSpecialRole(String roleId, String[] userIds, UserEntityInfo userEntityInfo) throws VCIError { boolean rs = true; - UserEntity userEntity = ObjectConvert.changeUserEntityInfoToUserEntity(userEntityInfo); + // UserEntity userEntity = ObjectConvert.changeUserEntityInfoToUserEntity(userEntityInfo); try { RoleService roleService = new RoleService(); UserService userService = new UserService(); @@ -1287,7 +1284,7 @@ // log.append("鐢ㄦ埛:"); User user = (User) userService.getUserInfoList(id).get(0); log.append("[" + user.getUserName() + "(" + user.getTrueName() + ")]"); - LogRecordUtil.writeLog(userEntity, "瑙掕壊澧炲姞鎴愬憳", "鎴愬姛", log.toString(), LogType.GeneralOperation, role.getId()); + LogRecordUtil.writeLog(userEntityInfo, "瑙掕壊澧炲姞鎴愬憳", "鎴愬姛", log.toString(), LogType.General, role.getId()); } @@ -1297,7 +1294,7 @@ // log.append("鐢ㄦ埛鍚嶏細"); // User user = (User)userService.getUserInfoList(id).get(0); // log.append("["+user.getUserName()+"]"); -// LogRecordUtil.writeLog(userEntity, "瑙掕壊鍒嗛厤鎴愬憳", log.toString(), LogType.GeneralOperation,role.getId()); +// LogRecordUtil.writeLog(userEntity, "瑙掕壊鍒嗛厤鎴愬憳", log.toString(), LogType.General,role.getId()); // } } catch (Exception e) { throw new VCIError("120306", new String[0]); @@ -1321,7 +1318,7 @@ */ public boolean saveRighForDept(String deptId, String[] userIds, UserEntityInfo userEntityInfo) throws VCIError { boolean rs = true; - UserEntity userEntity = ObjectConvert.changeUserEntityInfoToUserEntity(userEntityInfo); + // UserEntity userEntity = ObjectConvert.changeUserEntityInfoToUserEntity(userEntityInfo); try { DepartmentService deptService = new DepartmentService(); @@ -1356,7 +1353,7 @@ // log.append("鐢ㄦ埛:"); User user = (User) userService.getUserInfoList(id).get(0); log.append("[" + user.getUserName() + "(" + user.getTrueName() + ")]"); - LogRecordUtil.writeLog(userEntity, "閮ㄩ棬澧炲姞鎴愬憳", "鎴愬姛", log.toString(), LogType.GeneralOperation, deptId); + LogRecordUtil.writeLog(userEntityInfo, "閮ㄩ棬澧炲姞鎴愬憳", "鎴愬姛", log.toString(), LogType.General, deptId); } // 鍒犻櫎鐨勪汉鍛� @@ -1365,7 +1362,7 @@ log.append("[").append(deptPath).append("]->[鍑忓皯鐢ㄦ埛]->"); // log.append("鐢ㄦ埛:"); log.append("[" + u.getUserName() + "(" + u.getTrueName() + ")]"); - LogRecordUtil.writeLog(userEntity, "閮ㄩ棬鍑忓皯鎴愬憳", "鎴愬姛", log.toString(), LogType.GeneralOperation, deptId); + LogRecordUtil.writeLog(userEntityInfo, "閮ㄩ棬鍑忓皯鎴愬憳", "鎴愬姛", log.toString(), LogType.General, deptId); } } catch (Exception e) { throw new VCIError("120111", new String[0]); @@ -1376,7 +1373,7 @@ public boolean saveRights(String[] roleIds, String[] userIds, UserEntityInfo userEntityInfo) throws VCIError { boolean rs = true; - UserEntity userEntity = ObjectConvert.changeUserEntityInfoToUserEntity(userEntityInfo); + // UserEntity userEntity = ObjectConvert.changeUserEntityInfoToUserEntity(userEntityInfo); try { UserService userService = new UserService(); RoleService roleService = new RoleService(); @@ -1395,8 +1392,8 @@ log.append("->"); for (String roleId : roleIds) { Role role = roleService.selectRole(roleId); - LogRecordUtil.writeLog(userEntity, "鎴愬憳鍒嗛厤瑙掕壊", "鎴愬姛", log.toString() + "[" + role.getName() + "]", - LogType.GeneralOperation, "瑙掕壊ID:" + roleId + " 鐢ㄦ埛ID:" + userId); + LogRecordUtil.writeLog(userEntityInfo, "鎴愬憳鍒嗛厤瑙掕壊", "鎴愬姛", log.toString() + "[" + role.getName() + "]", + LogType.General, "瑙掕壊ID:" + roleId + " 鐢ㄦ埛ID:" + userId); } } @@ -1409,7 +1406,7 @@ public boolean saveUserDept(String[] userIds, String deptId, UserEntityInfo userEntityInfo) throws VCIError { boolean rs = true; - UserEntity userEntity = ObjectConvert.changeUserEntityInfoToUserEntity(userEntityInfo); + // UserEntity userEntity = ObjectConvert.changeUserEntityInfoToUserEntity(userEntityInfo); try { UserService userService = new UserService(); DepartmentService departmentService = new DepartmentService(); @@ -1441,7 +1438,7 @@ log.append("[").append(deptPath).append("]"); // log.append("["+user.getUserName()+"]"); } - LogRecordUtil.writeLog(userEntity, "鐢ㄦ埛鍒嗛厤閮ㄩ棬", "鎴愬姛", log.toString(), LogType.GeneralOperation, + LogRecordUtil.writeLog(userEntityInfo, "鐢ㄦ埛鍒嗛厤閮ㄩ棬", "鎴愬姛", log.toString(), LogType.General, "閮ㄩ棬ID:" + deptId + " 鐢ㄦ埛id锛�" + userId); } } catch (Exception e) { @@ -1496,18 +1493,18 @@ String id = ObjectUtility.getNewObjectID36(); department.setId(id); } - UserEntity userEntity = ObjectConvert.changeUserEntityInfoToUserEntity(userEntityInfo); + // UserEntity userEntity = ObjectConvert.changeUserEntityInfoToUserEntity(userEntityInfo); try { DepartmentService departmentService = new DepartmentService(); UserEntityDelegate.setUserEntityToService(departmentService, userEntityInfo); departmentService.saveDepartment(department); // LogRecordUtil.writeLog(userEntity, "娣诲姞", department.getLogInfo(), - // LogType.GeneralOperation,department.getId()); + // LogType.General,department.getId()); DeptCacheUtil.getInstance().setObject(departmentInfo); String log = String.format("娣诲姞閮ㄩ棬锛�%s [%s]", department.getName(), LogHelper.toNewLogString(department)); - LogRecordUtil.writeLog(userEntity, "娣诲姞", "鎴愬姛", log, LogType.GeneralOperation, department.getId()); + LogRecordUtil.writeLog(userEntityInfo, "娣诲姞", "鎴愬姛", log, LogType.General, department.getId()); } catch (Exception e) { throw new VCIError("120109", new String[0]); } @@ -1561,7 +1558,7 @@ Role role = ObjectConvert.changeRoleInfoToRole(roleInfo); String id = ObjectUtility.getNewObjectID36(); role.setId(id); - UserEntity userEntity = ObjectConvert.changeUserEntityInfoToUserEntity(userEntityInfo); + // UserEntity userEntity = ObjectConvert.changeUserEntityInfoToUserEntity(userEntityInfo); try { RoleService roleService = new RoleService(); UserEntityDelegate.setUserEntityToService(roleService, userEntityInfo); @@ -1570,10 +1567,10 @@ RoleCacheUtil.getInstance().setObject(role); String log = String.format("娣诲姞瑙掕壊锛�%s [%s]", role.getName(), LogHelper.toNewLogString(role)); - LogRecordUtil.writeLog(userEntity, "娣诲姞", "鎴愬姛", log, LogType.GeneralOperation, role.getId()); + LogRecordUtil.writeLog(userEntityInfo, "娣诲姞", "鎴愬姛", log, LogType.General, role.getId()); // LogRecordUtil.writeLog(userEntity, "娣诲姞", role.getLogInfo(), - // LogType.GeneralOperation,role.getId()); + // LogType.General,role.getId()); } catch (Exception e) { //e.printStackTrace(); ServerWithLog4j.logger.error(e); @@ -1619,7 +1616,7 @@ } else { id = user.getId(); } - UserEntity userEntity = ObjectConvert.changeUserEntityInfoToUserEntity(userEntityInfo); + // UserEntity userEntity = ObjectConvert.changeUserEntityInfoToUserEntity(userEntityInfo); try { UserService userService = new UserService(); UserEntityDelegate.setUserEntityToService(userService, userEntityInfo); @@ -1628,10 +1625,10 @@ UserCacheUtil.getInstance().setObject(userInfo); String log = String.format("娣诲姞鐢ㄦ埛锛�%s [%s]", user.getUserName(), LogHelper.toNewLogString(user)); - LogRecordUtil.writeLog(userEntity, "娣诲姞", "鎴愬姛", log, LogType.GeneralOperation, user.getId()); + LogRecordUtil.writeLog(userEntityInfo, "娣诲姞", "鎴愬姛", log, LogType.General, user.getId()); // LogRecordUtil.writeLog(userEntity, "娣诲姞", user.getLogInfo(), - // LogType.GeneralOperation,user.getId()); + // LogType.General,user.getId()); } catch (Exception e) { //e.printStackTrace(); ServerWithLog4j.logger.error(e); @@ -1655,7 +1652,7 @@ public boolean updateDepartment(DeptInfo deptInfo, UserEntityInfo userEntityInfo) throws VCIError { boolean rs = true; Department departmentAfter = ObjectConvert.changeDepartmentInfoToDepartment(deptInfo); - UserEntity userEntity = ObjectConvert.changeUserEntityInfoToUserEntity(userEntityInfo); + // UserEntity userEntity = ObjectConvert.changeUserEntityInfoToUserEntity(userEntityInfo); try { DepartmentService departmentService = new DepartmentService(); UserEntityDelegate.setUserEntityToService(departmentService, userEntityInfo); @@ -1672,9 +1669,9 @@ DeptCacheUtil.getInstance().setObject(deptInfo); if (rs) - LogRecordUtil.writeLog(userEntity, "鏇存柊", "鎴愬姛", log, LogType.GeneralOperation, departmentAfter.getId()); + LogRecordUtil.writeLog(userEntityInfo, "鏇存柊", "鎴愬姛", log, LogType.General, departmentAfter.getId()); else - LogRecordUtil.writeLog(userEntity, "鏇存柊", "澶辫触", log, LogType.GeneralOperation, departmentAfter.getId()); + LogRecordUtil.writeLog(userEntityInfo, "鏇存柊", "澶辫触", log, LogType.General, departmentAfter.getId()); } catch (Exception e) { //e.printStackTrace(); @@ -1699,7 +1696,7 @@ public boolean updateRole(RoleInfo roleInfo, UserEntityInfo userEntityInfo) throws VCIError { boolean rs = true; Role role = ObjectConvert.changeRoleInfoToRole(roleInfo); - UserEntity userEntity = ObjectConvert.changeUserEntityInfoToUserEntity(userEntityInfo); + // UserEntity userEntity = ObjectConvert.changeUserEntityInfoToUserEntity(userEntityInfo); try { RoleService roleService = new RoleService(); UserEntityDelegate.setUserEntityToService(roleService, userEntityInfo); @@ -1715,7 +1712,7 @@ // StringBuilder log = new StringBuilder(); // log.append("鏇存柊鍓嶏細"+roleBefroe.getLogInfo()); // log.append(" 鏇存柊鍚庯細"+role.getLogInfo()); - LogRecordUtil.writeLog(userEntity, "鏇存柊", "鎴愬姛", log, LogType.GeneralOperation, role.getId()); + LogRecordUtil.writeLog(userEntityInfo, "鏇存柊", "鎴愬姛", log, LogType.General, role.getId()); } catch (Exception e) { //e.printStackTrace(); ServerWithLog4j.logger.error(e); @@ -1776,7 +1773,7 @@ public boolean updateUser(UserInfo userInfo, UserEntityInfo userEntityInfo) throws VCIError { boolean rs = true; User user = ObjectConvert.changeUserInfoToUser(userInfo); - UserEntity userEntity = ObjectConvert.changeUserEntityInfoToUserEntity(userEntityInfo); + // UserEntity userEntity = ObjectConvert.changeUserEntityInfoToUserEntity(userEntityInfo); try { UserService userService = new UserService(); UserEntityDelegate.setUserEntityToService(userService, userEntityInfo); @@ -1788,7 +1785,7 @@ userService.updateUser(user); UserCacheUtil.getInstance().setObject(userInfo); - LogRecordUtil.writeLog(userEntity, "鏇存柊", "鎴愬姛", log, LogType.GeneralOperation, user.getId()); + LogRecordUtil.writeLog(userEntityInfo, "鏇存柊", "鎴愬姛", log, LogType.General, user.getId()); } catch (Exception e) { //e.printStackTrace(); ServerWithLog4j.logger.error(e); @@ -1816,7 +1813,7 @@ public String modifyUserPassword(String idUser, String oldPW, String newPW, UserEntityInfo userEntityInfo) throws VCIError { boolean rs = true; String error = ""; - UserEntity userEntity = ObjectConvert.changeUserEntityInfoToUserEntity(userEntityInfo); + // UserEntity userEntity = ObjectConvert.changeUserEntityInfoToUserEntity(userEntityInfo); try { UserService userService = new UserService(); UserEntityDelegate.setUserEntityToService(userService, userEntityInfo); @@ -1824,7 +1821,7 @@ if (StringUtils.isEmpty(user.getId())) { error = String.format("鐢ㄦ埛ID鏃犳晥:", idUser); - LogRecordUtil.writeLog(userEntity, "淇敼瀵嗙爜", "澶辫触", error, LogType.GeneralOperation, user.getId()); + LogRecordUtil.writeLog(userEntityInfo, "淇敼瀵嗙爜", "澶辫触", error, LogType.General, user.getId()); return error; } @@ -1835,7 +1832,7 @@ oldPW = des.getEncString(oldPW); if (!user.getPassword().equals(oldPW)) { error = String.format("鏇存敼[%s]瀵嗙爜澶辫触锛岃緭鍏ユ棫瀵嗙爜涓嶆纭紒", user.getUserName()); - LogRecordUtil.writeLog(userEntity, "淇敼瀵嗙爜", "澶辫触", error, LogType.GeneralOperation, user.getId()); + LogRecordUtil.writeLog(userEntityInfo, "淇敼瀵嗙爜", "澶辫触", error, LogType.General, user.getId()); return error; //throw new VCIError("120405", new String[] {"鏃у瘑鐮佽緭鍏ヤ笉姝g‘锛�"}); } @@ -1843,7 +1840,7 @@ error = checkPasswordStrategyByUserId(idUser, newPW); if (!StringUtils.isEmpty(error)) { - LogRecordUtil.writeLog(userEntity, "淇敼瀵嗙爜", "澶辫触", "鏇存敼鐢ㄦ埛瀵嗙爜锛�" + user.getUserName() + "; " + error, LogType.GeneralOperation, user.getId()); + LogRecordUtil.writeLog(userEntityInfo, "淇敼瀵嗙爜", "澶辫触", "鏇存敼鐢ㄦ埛瀵嗙爜锛�" + user.getUserName() + "; " + error, LogType.General, user.getId()); return error; } @@ -1853,7 +1850,7 @@ if (!rs) { error = "淇敼鐢ㄦ埛瀵嗙爜澶辫触"; - LogRecordUtil.writeLog(userEntity, "淇敼瀵嗙爜", "澶辫触", "鏇存敼鐢ㄦ埛瀵嗙爜锛�%s" + user.getUserName() +"; " + error, LogType.GeneralOperation, user.getId()); + LogRecordUtil.writeLog(userEntityInfo, "淇敼瀵嗙爜", "澶辫触", "鏇存敼鐢ㄦ埛瀵嗙爜锛�%s" + user.getUserName() +"; " + error, LogType.General, user.getId()); return error; } @@ -1862,7 +1859,7 @@ log = String.format("鏇存敼鐢ㄦ埛瀵嗙爜锛�%s", user.getUserName()); - LogRecordUtil.writeLog(userEntity, "淇敼瀵嗙爜", "鎴愬姛", log, LogType.GeneralOperation, user.getId()); + LogRecordUtil.writeLog(userEntityInfo, "淇敼瀵嗙爜", "鎴愬姛", log, LogType.General, user.getId()); } catch (VCIError e) { throw e; } catch (Exception e) { @@ -1995,7 +1992,7 @@ public boolean deleteDepartment(String[] id, UserEntityInfo userEntityInfo) throws VCIError { boolean rs = true; // List<Department> list = new ArrayList<Department>(); - UserEntity userEntity = ObjectConvert.changeUserEntityInfoToUserEntity(userEntityInfo); + // UserEntity userEntity = ObjectConvert.changeUserEntityInfoToUserEntity(userEntityInfo); try { DepartmentService departmentService = new DepartmentService(); UserEntityDelegate.setUserEntityToService(departmentService, userEntityInfo); @@ -2012,7 +2009,7 @@ Iterator<String> it = map.keySet().iterator(); while (it.hasNext()) { String deptId = it.next(); - LogRecordUtil.writeLog(userEntity, "鍒犻櫎", "鎴愬姛", deptId, LogType.GeneralOperation, map.get(deptId)); + LogRecordUtil.writeLog(userEntityInfo, "鍒犻櫎", "鎴愬姛", deptId, LogType.General, map.get(deptId)); } } catch (Exception e) { @@ -2025,7 +2022,7 @@ public boolean updateDeptParentId(String id, String parentId, UserEntityInfo userEntityInfo) throws VCIError { boolean rs = true; - UserEntity userEntity = ObjectConvert.changeUserEntityInfoToUserEntity(userEntityInfo); + // UserEntity userEntity = ObjectConvert.changeUserEntityInfoToUserEntity(userEntityInfo); try { DepartmentService departmentService = new DepartmentService(); UserEntityDelegate.setUserEntityToService(departmentService, userEntityInfo); @@ -2038,7 +2035,7 @@ DeptCacheUtil.getInstance().setObject(dept); if (rs) { - LogRecordUtil.writeLog(userEntity, "鏇存柊", "鎴愬姛", parentId, LogType.GeneralOperation, id); + LogRecordUtil.writeLog(userEntityInfo, "鏇存柊", "鎴愬姛", parentId, LogType.General, id); } } catch (Exception e) { @@ -2063,7 +2060,7 @@ */ public boolean deleteRole(String[] ids, UserEntityInfo userEntityInfo) throws VCIError { boolean rs = true; - UserEntity userEntity = ObjectConvert.changeUserEntityInfoToUserEntity(userEntityInfo); + // UserEntity userEntity = ObjectConvert.changeUserEntityInfoToUserEntity(userEntityInfo); try { RoleService roleService = new RoleService(); UserEntityDelegate.setUserEntityToService(roleService, userEntityInfo); @@ -2078,7 +2075,7 @@ String id = it.next(); RoleCacheUtil.getInstance().delObject(id); - LogRecordUtil.writeLog(userEntity, "鍒犻櫎", "鎴愬姛", map.get(id), LogType.GeneralOperation, id); + LogRecordUtil.writeLog(userEntityInfo, "鍒犻櫎", "鎴愬姛", map.get(id), LogType.General, id); } } catch (Exception e) { //e.printStackTrace(); @@ -2103,7 +2100,7 @@ */ public boolean deleteUser(String[] ids, UserEntityInfo userEntityInfo) throws VCIError { boolean rs = true; - UserEntity userEntity = ObjectConvert.changeUserEntityInfoToUserEntity(userEntityInfo); + // UserEntity userEntity = ObjectConvert.changeUserEntityInfoToUserEntity(userEntityInfo); try { UserService userService = new UserService(); UserEntityDelegate.setUserEntityToService(userService, userEntityInfo); @@ -2119,7 +2116,7 @@ Iterator<String> it = map.keySet().iterator(); while (it.hasNext()) { String id = it.next(); - LogRecordUtil.writeLog(userEntity, "鍒犻櫎", "鎴愬姛", map.get(id), LogType.GeneralOperation, id); + LogRecordUtil.writeLog(userEntityInfo, "鍒犻櫎", "鎴愬姛", map.get(id), LogType.General, id); } } catch (Exception e) { //e.printStackTrace(); @@ -2144,7 +2141,7 @@ */ public boolean stopUsers(String[] id, boolean flag, UserEntityInfo userEntityInfo) throws VCIError { boolean rs = true; - UserEntity userEntity = ObjectConvert.changeUserEntityInfoToUserEntity(userEntityInfo); + // UserEntity userEntity = ObjectConvert.changeUserEntityInfoToUserEntity(userEntityInfo); try { UserService userService = new UserService(); UserEntityDelegate.setUserEntityToService(userService, userEntityInfo); @@ -2159,7 +2156,7 @@ user.setStatus(flag ? (short)1 : (short)0); UserCacheUtil.getInstance().setObject(user); - LogRecordUtil.writeLog(userEntity, "鍋滅敤銆佸惎鐢�", rs ? "鎴愬姛" : "澶辫触", log.toString(), LogType.GeneralOperation, user.getId()); + LogRecordUtil.writeLog(userEntityInfo, "鍋滅敤銆佸惎鐢�", rs ? "鎴愬姛" : "澶辫触", log.toString(), LogType.General, user.getId()); } } catch (Exception e) { @@ -2295,13 +2292,13 @@ public boolean savePasswordStrategy(PasswordStrategyInfo info, //String[] combinationIds, UserEntityInfo userEntityInfo) throws VCIError { boolean res = false; - UserEntity userEntity = ObjectConvert.changeUserEntityInfoToUserEntity(userEntityInfo); + // UserEntity userEntity = ObjectConvert.changeUserEntityInfoToUserEntity(userEntityInfo); try { PasswordStrategyService srv = new PasswordStrategyService(); UserEntityDelegate.setUserEntityToService(srv, userEntityInfo); PasswordStrategy passwordStrategy = ObjectConvert.changePassStrategyInfoToEntity(info); res = srv.savePasswordStrategy(passwordStrategy); - LogRecordUtil.writeLog(userEntity, "娣诲姞", "鎴愬姛", passwordStrategy.getLogInfo(), LogType.GeneralOperation, + LogRecordUtil.writeLog(userEntityInfo, "娣诲姞", "鎴愬姛", passwordStrategy.getLogInfo(), LogType.General, passwordStrategy.getId()); } catch (Exception e) { //e.printStackTrace(); @@ -2314,7 +2311,7 @@ public boolean editPasswordStrategy(PasswordStrategyInfo info, UserEntityInfo userEntityInfo) throws VCIError { boolean res = true; - UserEntity userEntity = ObjectConvert.changeUserEntityInfoToUserEntity(userEntityInfo); + // UserEntity userEntity = ObjectConvert.changeUserEntityInfoToUserEntity(userEntityInfo); try { PasswordStrategyService srv = new PasswordStrategyService(); UserEntityDelegate.setUserEntityToService(srv, userEntityInfo); @@ -2328,7 +2325,7 @@ res = srv.updatePasswordStrategy(passwordStrategy); - LogRecordUtil.writeLog(userEntity, "鏇存柊", "鎴愬姛", log.toString(), LogType.GeneralOperation, + LogRecordUtil.writeLog(userEntityInfo, "鏇存柊", "鎴愬姛", log.toString(), LogType.General, passwordStrategyBefore.getId()); } catch (Exception e) { //e.printStackTrace(); @@ -2340,7 +2337,7 @@ public boolean deletePasswordStrategy(String[] ids, UserEntityInfo userEntityInfo) throws VCIError { boolean res = true; - UserEntity userEntity = ObjectConvert.changeUserEntityInfoToUserEntity(userEntityInfo); + // UserEntity userEntity = ObjectConvert.changeUserEntityInfoToUserEntity(userEntityInfo); try { PasswordStrategyService srv = new PasswordStrategyService(); UserEntityDelegate.setUserEntityToService(srv, userEntityInfo); @@ -2353,7 +2350,7 @@ Iterator<String> it = map.keySet().iterator(); while (it.hasNext()) { String logKey = it.next(); - LogRecordUtil.writeLog(userEntity, "鍒犻櫎", "鎴愬姛", logKey, LogType.GeneralOperation, map.get(logKey)); + LogRecordUtil.writeLog(userEntityInfo, "鍒犻櫎", "鎴愬姛", logKey, LogType.General, map.get(logKey)); } } catch (Exception e) { //e.printStackTrace(); @@ -2390,7 +2387,7 @@ public boolean saveUserPasswordStrateg(String[] userIds, String passwordStrategId, UserEntityInfo userEntityInfo) throws VCIError { boolean rs = true; - UserEntity userEntity = ObjectConvert.changeUserEntityInfoToUserEntity(userEntityInfo); + // UserEntity userEntity = ObjectConvert.changeUserEntityInfoToUserEntity(userEntityInfo); try { UserService userService = new UserService(); PasswordStrategyService srv = new PasswordStrategyService(); @@ -2408,7 +2405,7 @@ rs = userService.saveUserPasswordStrateg(userId, passwordStrategId); log.append("->"); log.append(passwordStrategy.getLogInfo()); - LogRecordUtil.writeLog(userEntity, "涓烘垚鍛樺垎閰嶅瘑鐮佺瓥鐣�", "鎴愬姛", log.toString(), LogType.GeneralOperation, + LogRecordUtil.writeLog(userEntityInfo, "涓烘垚鍛樺垎閰嶅瘑鐮佺瓥鐣�", "鎴愬姛", log.toString(), LogType.General, userId + "瀵嗙爜绛栫暐ID:" + passwordStrategId); } } catch (Exception e) { @@ -2469,7 +2466,7 @@ } public void deblock(String[] ids, UserEntityInfo userEntityInfo) throws VCIError { - UserEntity userEntity = ObjectConvert.changeUserEntityInfoToUserEntity(userEntityInfo); + // UserEntity userEntity = ObjectConvert.changeUserEntityInfoToUserEntity(userEntityInfo); try { UserService userSrv = new UserService(); UserEntityDelegate.setUserEntityToService(userSrv, userEntityInfo); @@ -2477,10 +2474,10 @@ for (String userId : ids) { User user = (User) userSrv.getUserObjectByoid(userId); // LogRecordUtil.writeLog(userEntity, "璐︽埛瑙i攣", "["+user.getLogInfo()+"]", - // LogType.GeneralOperation, userId); + // LogType.General, userId); // add by caill 2016.9.13 - LogRecordUtil.writeLog(userEntity, LogType.UnlockUser.getLabel(), "瑙i攣鎴愬姛", "[" + user.getLogInfo() + "]", + LogRecordUtil.writeLog(userEntityInfo, "瑙i攣鐢ㄦ埛", "瑙i攣鎴愬姛", "[" + user.getLogInfo() + "]", LogType.UnlockUser, userId); } } catch (Exception ex) { @@ -2490,47 +2487,47 @@ } } - /** - * 绠�鍗曡褰曠郴缁熺櫥鍏ャ�佺櫥鍑烘棩锟�? - * <p> - * Description: - * </p> - * - * @author wangxl - * @time 2012-12-27 - * @param message - * @param userEntityInfo - * @throws VCIError - */ - public void savelog(String message, UserEntityInfo userEntityInfo) throws VCIError { - userEntityInfo.modules = "鐧诲綍妯″潡";// add by liujw - UserEntity userEntity = ObjectConvert.changeUserEntityInfoToUserEntity(userEntityInfo); - User user = ObjectConvert.changeUserInfoToUser(fetchUserInfoByName(userEntity.getUserName())); - LogRecordUtil.writeLog(userEntity, message, "鐧诲綍鎴愬姛", message, - "鐧诲叆".equals(message) ? LogType.Login : LogType.Logout, user.getId()); - } - - public void saveLogV2(String result, String message, String type, int logTypeIntVal, String dataObjOid, - UserEntityInfo userEntityInfo) throws VCIError { - UserEntity userEntity = ObjectConvert.changeUserEntityInfoToUserEntity(userEntityInfo); - LogType logType = LogType.getByIntVal(logTypeIntVal); - LogRecordUtil.writeLog(userEntity, type, result, message, logType, dataObjOid); - } - - public void savelogfail(String message, UserEntityInfo userEntityInfo) throws VCIError { - userEntityInfo.modules = "鐧诲綍妯″潡"; - UserEntity userEntity = ObjectConvert.changeUserEntityInfoToUserEntity(userEntityInfo); - User user = ObjectConvert.changeUserInfoToUser(fetchUserInfoByName(userEntity.getUserName())); - LogRecordUtil.writeLog(userEntity, "鐧诲叆", "鐧诲綍澶辫触", message, LogType.Login, user.getId()); - } - - // add by caill start 2016.9.13绠�鍗曡褰曠敤鎴疯閿佸畾鐨勬棩蹇� - public void blocklog(String userId, UserEntityInfo userEntityInfo) throws VCIError { - UserEntity userEntity = ObjectConvert.changeUserEntityInfoToUserEntity(userEntityInfo); - User user = ObjectConvert.changeUserInfoToUser(fetchUserInfoByName(userEntity.getUserName())); - LogRecordUtil.writeLog(userEntity, LogType.LockUser.getLabel(), "鐢ㄦ埛閿佸畾", - "[" + user.getLogInfo() + "]" + "鍦ㄨ繛缁緭鍏ュ娆″瘑鐮侀敊璇悗瀵艰嚧璐︽埛琚攣瀹�", LogType.LockUser, userId); - } +// /** +// * 绠�鍗曡褰曠郴缁熺櫥鍏ャ�佺櫥鍑烘棩锟�? +// * <p> +// * Description: +// * </p> +// * +// * @author wangxl +// * @time 2012-12-27 +// * @param message +// * @param userEntityInfo +// * @throws VCIError +// */ +// public void savelog(String message, UserEntityInfo userEntityInfo) throws VCIError { +// userEntityInfo.modules = "鐧诲綍妯″潡";// add by liujw +// // UserEntity userEntity = ObjectConvert.changeUserEntityInfoToUserEntity(userEntityInfo); +// User user = ObjectConvert.changeUserInfoToUser(fetchUserInfoByName(userEntity.getUserName())); +// LogRecordUtil.writeLog(userEntityInfo, message, "鐧诲綍鎴愬姛", message, +// "鐧诲叆".equals(message) ? LogType.Login : LogType.Logout, user.getId()); +// } +// +// public void saveLogV2(String result, String message, String type, int logTypeIntVal, String dataObjOid, +// UserEntityInfo userEntityInfo) throws VCIError { +// // UserEntity userEntity = ObjectConvert.changeUserEntityInfoToUserEntity(userEntityInfo); +// LogType logType = LogType.getByIntVal(logTypeIntVal); +// LogRecordUtil.writeLog(userEntityInfo, type, result, message, logType, dataObjOid); +// } +// +// public void savelogfail(String message, UserEntityInfo userEntityInfo) throws VCIError { +// userEntityInfo.modules = "鐧诲綍妯″潡"; +// // UserEntity userEntity = ObjectConvert.changeUserEntityInfoToUserEntity(userEntityInfo); +// User user = ObjectConvert.changeUserInfoToUser(fetchUserInfoByName(userEntity.getUserName())); +// LogRecordUtil.writeLog(userEntityInfo, "鐧诲叆", "鐧诲綍澶辫触", message, LogType.Login, user.getId()); +// } +// +// // add by caill start 2016.9.13绠�鍗曡褰曠敤鎴疯閿佸畾鐨勬棩蹇� +// public void blocklog(String userId, UserEntityInfo userEntityInfo) throws VCIError { +// // UserEntity userEntity = ObjectConvert.changeUserEntityInfoToUserEntity(userEntityInfo); +// User user = ObjectConvert.changeUserInfoToUser(fetchUserInfoByName(userEntity.getUserName())); +// LogRecordUtil.writeLog(userEntityInfo, LogType.LockUser.getLabel(), "鐢ㄦ埛閿佸畾", +// "[" + user.getLogInfo() + "]" + "鍦ㄨ繛缁緭鍏ュ娆″瘑鐮侀敊璇悗瀵艰嚧璐︽埛琚攣瀹�", LogType.LockUser, userId); +// } /** * 鑾峰彇鎵�鏈夊瘑鐮佺粍鍚堟柟锟�? @@ -2590,12 +2587,12 @@ Combination comb = changeCombinationInfoToCombination(info); String id = ObjectUtility.getNewObjectID36(); comb.setId(id); - UserEntity userEntity = ObjectConvert.changeUserEntityInfoToUserEntity(userEntityInfo); + // UserEntity userEntity = ObjectConvert.changeUserEntityInfoToUserEntity(userEntityInfo); try { CombinationService service = new CombinationService(); UserEntityDelegate.setUserEntityToService(service, userEntityInfo); service.saveCombination(comb); - LogRecordUtil.writeLog(userEntity, "娣诲姞", "鎴愬姛", comb.getLogInfo(), LogType.GeneralOperation, comb.getId()); + LogRecordUtil.writeLog(userEntityInfo, "娣诲姞", "鎴愬姛", comb.getLogInfo(), LogType.General, comb.getId()); } catch (Exception e) { throw new VCIError("120502", new String[0]); } @@ -2605,7 +2602,7 @@ public boolean updateCombination(CombinationInfo info, UserEntityInfo userEntityInfo) throws VCIError { boolean rs = true; Combination comb = changeCombinationInfoToCombination(info); - UserEntity userEntity = ObjectConvert.changeUserEntityInfoToUserEntity(userEntityInfo); + // UserEntity userEntity = ObjectConvert.changeUserEntityInfoToUserEntity(userEntityInfo); try { CombinationService service = new CombinationService(); UserEntityDelegate.setUserEntityToService(service, userEntityInfo); @@ -2614,7 +2611,7 @@ StringBuilder log = new StringBuilder(); log.append("鏇存柊鍓嶏細" + combinationBefore.getLogInfo()); log.append(" 鏇存柊鍚庯細" + comb.getLogInfo()); - LogRecordUtil.writeLog(userEntity, "鏇存柊", "鎴愬姛", log.toString(), LogType.GeneralOperation, comb.getId()); + LogRecordUtil.writeLog(userEntityInfo, "鏇存柊", "鎴愬姛", log.toString(), LogType.General, comb.getId()); } catch (Exception e) { throw new VCIError("120503", new String[0]); } @@ -2623,7 +2620,7 @@ public boolean deleteCombination(String[] id, UserEntityInfo userEntityInfo) throws VCIError { boolean rs = true; - UserEntity userEntity = ObjectConvert.changeUserEntityInfoToUserEntity(userEntityInfo); + // UserEntity userEntity = ObjectConvert.changeUserEntityInfoToUserEntity(userEntityInfo); try { CombinationService service = new CombinationService(); UserEntityDelegate.setUserEntityToService(service, userEntityInfo); @@ -2636,7 +2633,7 @@ Iterator<String> it = map.keySet().iterator(); while (it.hasNext()) { String logKey = it.next(); - LogRecordUtil.writeLog(userEntity, "鍒犻櫎", "鎴愬姛", logKey, LogType.GeneralOperation, map.get(logKey)); + LogRecordUtil.writeLog(userEntityInfo, "鍒犻櫎", "鎴愬姛", logKey, LogType.General, map.get(logKey)); } } catch (Exception e) { throw new VCIError("120504", new String[0]); @@ -2664,7 +2661,7 @@ @SuppressWarnings("unchecked") public String saveCombinationValue(CombinationValueInfo[] valueInfos, UserEntityInfo userEntityInfo) throws VCIError { - UserEntity userEntity = ObjectConvert.changeUserEntityInfoToUserEntity(userEntityInfo); + // UserEntity userEntity = ObjectConvert.changeUserEntityInfoToUserEntity(userEntityInfo); CombinationValueService service = new CombinationValueService(); int length = valueInfos.length; @@ -2687,7 +2684,7 @@ service.saveCombinationValue(combinationValues); for (CombinationValue value : combinationValues) { - LogRecordUtil.writeLog(userEntity, "娣诲姞", "鎴愬姛", value.getLogInfo(), LogType.GeneralOperation, value.getId()); + LogRecordUtil.writeLog(userEntityInfo, "娣诲姞", "鎴愬姛", value.getLogInfo(), LogType.General, value.getId()); } ; @@ -2702,7 +2699,7 @@ throws VCIError { boolean rs = true; CombinationValue combVal = changeCombinationValueInfoToVal(valueInfo); - UserEntity userEntity = ObjectConvert.changeUserEntityInfoToUserEntity(userEntityInfo); + // UserEntity userEntity = ObjectConvert.changeUserEntityInfoToUserEntity(userEntityInfo); CombinationValueService service = new CombinationValueService(); // add by liujw @@ -2720,7 +2717,7 @@ log.append("鏇存柊鍓嶏細" + combinationValueBefroe.getLogInfo()); log.append(" 鏇存柊鍚庯細" + combVal.getLogInfo()); rs = service.updateCombinationValue(combVal); - LogRecordUtil.writeLog(userEntity, "鏇存柊", "鎴愬姛", log.toString(), LogType.GeneralOperation, combVal.getId()); + LogRecordUtil.writeLog(userEntityInfo, "鏇存柊", "鎴愬姛", log.toString(), LogType.General, combVal.getId()); } catch (Exception e) { throw new VCIError("120508", new String[0]); } @@ -2729,7 +2726,7 @@ public boolean deletCombinationValues(String[] id, UserEntityInfo userEntityInfo) throws VCIError { boolean rs = true; - UserEntity userEntity = ObjectConvert.changeUserEntityInfoToUserEntity(userEntityInfo); + // UserEntity userEntity = ObjectConvert.changeUserEntityInfoToUserEntity(userEntityInfo); try { CombinationValueService service = new CombinationValueService(); CombinationService combinService = new CombinationService(); @@ -2755,7 +2752,7 @@ } } rs = service.deleteCombinationValueByMQL(id); - LogRecordUtil.writeLog(userEntity, "鍒犻櫎", "鎴愬姛", log.toString(), LogType.GeneralOperation, + LogRecordUtil.writeLog(userEntityInfo, "鍒犻櫎", "鎴愬姛", log.toString(), LogType.General, combinIds.toString() + valuesIds.toString()); } catch (Exception e) { e.printStackTrace(); @@ -2934,8 +2931,8 @@ */ public void savelogGeneralOperation(String result, String message, UserEntityInfo userEntityInfo, String dataId, String plType) throws VCIError { - UserEntity userEntity = ObjectConvert.changeUserEntityInfoToUserEntity(userEntityInfo); - LogRecordUtil.writeLog(userEntity, plType, result, message, LogType.GeneralOperation, dataId); + // UserEntity userEntity = ObjectConvert.changeUserEntityInfoToUserEntity(userEntityInfo); + LogRecordUtil.writeLog(userEntityInfo, plType, result, message, LogType.General, dataId); } /**** -- Gitblit v1.9.3