From 6f994bf94166b3b900eb43edcba07611017a6474 Mon Sep 17 00:00:00 2001 From: ludc Date: 星期二, 25 六月 2024 10:21:26 +0800 Subject: [PATCH] 用户管理:分页查询接口,用户角色,密码策略部分查询接口添加 --- Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/frameworkcore/compatibility/impl/OrgDeptQueryServiceImpl.java | 25 ++++++++++++++++++++----- 1 files changed, 20 insertions(+), 5 deletions(-) diff --git a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/frameworkcore/compatibility/impl/OrgDeptQueryServiceImpl.java b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/frameworkcore/compatibility/impl/OrgDeptQueryServiceImpl.java index abe3257..f2a737f 100644 --- a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/frameworkcore/compatibility/impl/OrgDeptQueryServiceImpl.java +++ b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/frameworkcore/compatibility/impl/OrgDeptQueryServiceImpl.java @@ -1,11 +1,13 @@ package com.vci.frameworkcore.compatibility.impl; +import com.vci.corba.omd.data.BusinessObject; import com.vci.frameworkcore.compatibility.OrgDeptQueryServiceI; import com.vci.frameworkcore.lcstatuspck.FrameworkDataLCStatus; import com.vci.frameworkcore.model.OrgDeptForPlatform1; import com.vci.frameworkcore.model.SmRoleForPlatform1; import com.vci.frameworkcore.pagemodel.OrgDepartmentVO; import com.vci.frameworkcore.pagemodel.SmRoleVO; +import com.vci.omd.utils.ObjectTool; import com.vci.starter.revision.bo.TreeWrapperOptions; import com.vci.starter.revision.service.RevisionModelUtil; import com.vci.starter.web.constant.QueryOptionConstant; @@ -25,6 +27,7 @@ import org.springframework.util.CollectionUtils; import java.util.*; +import java.util.function.Function; import java.util.stream.Collectors; /** @@ -101,6 +104,7 @@ } return departmentVO; } + /** * 鎵归噺鑾峰彇閮ㄩ棬鐨勪俊鎭� 锛堟牴鎹儴闂ㄤ富閿級 * @param deptOidCollections 閮ㄩ棬涓婚敭鐨勯泦鍚堬紝鍙互瓒呰繃1000涓� @@ -125,6 +129,7 @@ }); return deptDO2VOs(depts); } + /** * 鑾峰彇閮ㄩ棬鐨勫垪琛紝榛樿浼氫互閮ㄩ棬鍚嶇О鍗囧簭鎺掑垪锛岄儴闂ㄧ殑缂栬緫椤甸潰鍒楄〃涓嶈浣跨敤杩欎釜鎺ュ彛 * @param queryMap 鏌ヨ鏉′欢 @@ -148,6 +153,7 @@ } return dataGrid; } + /** * 鏍规嵁閮ㄩ棬涓婚敭鑾峰彇閮ㄩ棬鐨勫鍚� * @param deptOid 閮ㄩ棬涓婚敭 @@ -198,7 +204,8 @@ } return deptDO2VOs(roles); } - /** + + /** * 鏍规嵁鐢ㄦ埛涓婚敭鑾峰彇鍏宠仈鐨勯儴闂� * @param userOid 鐢ㄦ埛涓婚敭 * @param queryMap 鏌ヨ鏉′欢锛屽鏋滈渶瑕佷娇鐢ㄧ敤鎴风殑灞炴�ф潵鏌ヨ鍙互浣跨敤pkUser.xxxx @@ -213,6 +220,7 @@ } return departmentVOS.get(0); } + /** * 鑾峰彇鏈叧鑱旀煇涓敤鎴风殑閮ㄩ棬 * @param userOid 鐢ㄦ埛涓婚敭 @@ -285,19 +293,22 @@ if(!CollectionUtils.isEmpty(deptVOs)){ deptVOList.addAll(deptVOs); String sql = "select pluseruid,pldeptuid from pluserdept where pluseruid in (" + WebUtil.toInSql(userOids.toArray(new String[0])) + ")"; - List<com.vci.client.bof.ClientBusinessObject> cbos = boService.queryBySql(sql, null); + List<BusinessObject> cbos = boService.queryBySql(sql, null); if(!CollectionUtils.isEmpty(cbos)){ cbos.stream().forEach(cbo->{ - String userOid = cbo.getAttributeValue("pluseruid"); + String userOid = ObjectTool.getNewBOAttributeValue(cbo,"pluseruid"); List<String> deptOids = userDeptOidMap.getOrDefault(userOid,new ArrayList<>()); - deptOids.add(cbo.getAttributeValue("pldeptuid")); + deptOids.add(ObjectTool.getNewBOAttributeValue(cbo,"pldeptuid")); userDeptOidMap.put(userOid,deptOids); }); } } }); if(!CollectionUtils.isEmpty(deptVOList)){ - Map<String, OrgDepartmentVO> deptVOMap = deptVOList.stream().collect(Collectors.toMap(s -> s.getOid(), t -> t)); + //杩欏効搴旇瀵筪eptVOList鍋氫竴娆″幓閲嶅鐞嗭紝鍥犱负鑲畾浼氭湁閲嶅鐨勯儴闂ㄨ鏌ュ嚭鏉� + Map<String, OrgDepartmentVO> deptVOMap = deptVOList.stream() + .collect(Collectors.toMap(OrgDepartmentVO::getOid, Function.identity(), (existing, replacement) -> existing)); + //Map<String, OrgDepartmentVO> deptVOMap = deptVOList.stream().distinct().collect(Collectors.toMap(s -> s.getOid(), t -> t)); Map<String, List<OrgDepartmentVO>> userDeptVOMap = new HashMap<>(); userDeptOidMap.forEach((userOid,deptOids)->{ List<OrgDepartmentVO> deptVOS = new ArrayList<>(); @@ -312,6 +323,7 @@ } return new HashMap<>(); } + /** * 鑾峰彇鏌愪釜閮ㄩ棬鐨勭洿灞炰笅绾ч儴闂� * @param pkFatherDepartmment 閮ㄩ棬鐨勪富閿� @@ -330,6 +342,7 @@ List<OrgDeptForPlatform1> depts = boService.selectByQueryWrapper(queryWrapperForDO, OrgDeptForPlatform1.class); return deptDO2VOs(depts); } + /** * 鑾峰彇鏌愪釜閮ㄩ棬鐨勬墍鏈夊眰绾х殑涓嬬骇閮ㄩ棬 * @param pkFatherDepartmment 閮ㄩ棬鐨勪富閿� @@ -343,6 +356,7 @@ queryWrapperForDO.in("pluid","select pluid from pldept start with " + (StringUtils.isBlank(pkFatherDepartmment)?" (plparentuid is null or plparentuid = '') ":"plparentuid = '" + pkFatherDepartmment.trim() + "'") + "connect by PRIOR pluid=plparentuid"); return deptDO2VOs(boService.selectByQueryWrapper(queryWrapperForDO, OrgDeptForPlatform1.class)); } + /** * 鍙傜収鏍戝舰鏁版嵁鐨勯儴闂ㄤ俊鎭� * @param treeQueryObject 鏍戝舰鏌ヨ鐨勬潯浠� @@ -369,6 +383,7 @@ return dept.getId() + " " + dept.getName() + (FrameworkDataLCStatus.DISABLED.getValue().equals(dept.getLcStatus())?"銆愬仠鐢ㄣ��":""); }); } + /** * 鍙傜収鏍戝舰琛ㄦ牸鐨勯儴闂ㄤ俊鎭紝涓婄骇閮ㄩ棬鐨勬槸琛ㄦ牸涓殑鏍戝舰鍒� * @param treeQueryObject 鏍戝舰鏌ヨ鐨勬潯浠� -- Gitblit v1.9.3