From 0c553fadbaa50a322fbe283ef66cd32d8d26f98b Mon Sep 17 00:00:00 2001 From: yuxc <yuxc@vci-tech.com> Date: 星期五, 29 十一月 2024 17:38:56 +0800 Subject: [PATCH] 1、获取当前业务类型下的数据权限相关信息接口。 2、保存数据权限数据接口。 3、删除数据权限接口。 4、使用当前用户的类型查询用户接口。 --- Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/frameworkcore/compatibility/impl/SmUserQueryServiceImpl.java | 36 +++++++++++++++++++++++++++--------- 1 files changed, 27 insertions(+), 9 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 4321cb6..701a213 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,8 +1,9 @@ package com.vci.frameworkcore.compatibility.impl; -import com.vci.client.common.providers.ClientServiceProvider; +import com.vci.common.utility.ObjectUtility; import com.vci.corba.framework.data.DeptInfo; import com.vci.corba.framework.data.RoleInfo; +import com.vci.corba.framework.data.UserLogonInfo; import com.vci.corba.omd.etm.EnumItem; import com.vci.corba.omd.etm.EnumType; import com.vci.dto.SmUserDTO; @@ -42,7 +43,6 @@ import com.vci.web.util.WebUtil; import org.apache.commons.lang3.StringUtils; import org.apache.poi.hssf.util.HSSFColor; -import org.apache.poi.ss.formula.functions.T; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -387,11 +387,8 @@ smUserVO.setIsDeptLeader(userInfo.isDeptLeader.equals("0") ? "涓嶆槸":"鏄�"); //涓撲笟 smUserVO.setSpecialties(userInfo.specialties); - if(userInfo.status == 0){ - smUserVO.setLockFlag(false); - }else{ - smUserVO.setLockFlag(true); - } + UserLogonInfo lockObj = platformClientUtil.getFrameworkService().fetchUserLogonObj(userInfo.id); + smUserVO.setLockFlag(lockObj.plWrongNum == 0); smUserVO.setCreator(userInfo.createUser); smUserVO.setCreateTime(VciDateUtil.long2Date(userInfo.createTime)); smUserVO.setLastModifier(userInfo.updateUser); @@ -1244,7 +1241,9 @@ //TODO:鑰冭檻鏄惁闇�瑕佸皢淇敼鏂瑰紡鏀规垚鐩存帴璋冪敤骞冲彴鐨勬帴鍙o紝鍥犱负鐜板湪鐨勪慨鏀规柟寮忔病鑳芥纭殑鏇存柊缂撳瓨 userInfo.pwd = password; userInfo.pwdUpdateTime = System.currentTimeMillis(); - boolean updateBoolean = platformClientUtil.getFrameworkService().updateUser(userInfo, new UserEntityInfo(WebThreadLocalUtil.getCurrentUserSessionInfoInThread().getUserId(), null)); + boolean updateBoolean = platformClientUtil.getFrameworkService() + .updateUser(userInfo, new UserEntityInfo(WebThreadLocalUtil.getCurrentUserSessionInfoInThread()== null ? + userName : WebThreadLocalUtil.getCurrentUserSessionInfoInThread().getUserId(), null)); return updateBoolean; } @@ -1317,7 +1316,10 @@ } smUserDTO.setCreator(loginUserId); smUserDTO.setLastModifier(loginUserId); + smUserDTO.setOid(ObjectUtility.getNewObjectID36()); UserInfo userInfo = changeSmUserDTOToUserInfo(smUserDTO); + //绠$悊鍛樻坊鍔犵殑鐢ㄦ埛鍒濆瀵嗙爜淇敼鏃堕棿閮藉簲璇ヤ负0锛屽洜涓烘秹鍙婂埌鍚庨潰鐢ㄦ埛棣栨鐧诲綍鑷繁淇敼瀵嗙爜 + userInfo.pwdUpdateTime = 0; UserEntityInfo userEntityInfo = new UserEntityInfo(loginUserId, ""); String oid = platformClientUtil.getFrameworkService().saveUser(userInfo, userEntityInfo); if (Func.isEmpty(oid)) { @@ -1426,7 +1428,7 @@ } catch (PLException e) { // TODO Auto-generated catch block e.printStackTrace(); - throw new VciBaseException("妫�鏌ュ瘑鐮佺瓥鐣ョ鍚堟儏鍐靛け璐ワ紒2"); + throw new VciBaseException("妫�鏌ュ瘑鐮佺瓥鐣ョ鍚堟儏鍐靛け璐ワ紒"); } } @@ -1452,6 +1454,7 @@ userInfo.updateUser = user.getLastModifier() == null ? "" : user.getLastModifier(); userInfo.pwdUpdateTime = user.getPwdUpdateTime().getTime(); userInfo.grantor = user.getGrantor() == null ? "" : user.getGrantor(); + userInfo.secretGrade = user.getSecretGrade() == null ? 2 : Integer.valueOf(user.getGrantor()); userInfo.isDeptLeader = user.getIsDeptLeader() == null ? "0" : user.getIsDeptLeader(); return userInfo; } @@ -1661,4 +1664,19 @@ return userNameList; } + /** + * 浣跨敤褰撳墠鐢ㄦ埛鐨勭被鍨嬫煡璇㈢敤鎴� + * @return + * @throws VciBaseException + */ + @Override + public List<SmUserVO> listUserByUserType() throws PLException { + try { + UserInfo[] userInfo = platformClientUtil.getFrameworkService().fetchUserInfoByType(Short.parseShort(WebUtil.getCurrentUserSessionInfo().getUsertype())); + return userInfoArr2VO(userInfo); + } catch (PLException e) { + throw new VciBaseException("鐧诲綍鏃讹紝鑾峰彇鐢ㄦ埛淇℃伅澶辫触锛�"+e.getMessage()); + } + } + } -- Gitblit v1.9.3