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 | 21 ++
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/frameworkcore/compatibility/impl/SmPwdStrategyQueryServiceImpl.java | 285 ++++++++++++++++++++++++++++++++++++++++
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/frameworkcore/compatibility/SmPwdStrategyQueryServiceI.java | 78 +++++++++++
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/frameworkcore/controller/SmPwdStrategyQueryController.java | 8 +
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/frameworkcore/compatibility/OrgDeptQueryServiceI.java | 1
5 files changed, 388 insertions(+), 5 deletions(-)
diff --git a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/frameworkcore/compatibility/OrgDeptQueryServiceI.java b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/frameworkcore/compatibility/OrgDeptQueryServiceI.java
index 5805af3..edff563 100644
--- a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/frameworkcore/compatibility/OrgDeptQueryServiceI.java
+++ b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/frameworkcore/compatibility/OrgDeptQueryServiceI.java
@@ -58,7 +58,6 @@
*/
OrgDepartmentVO listDeptByUserOid(String userOid, Map<String, String> queryMap);
-
/**
* 鑾峰彇鏈叧鑱旀煇涓敤鎴风殑閮ㄩ棬
* @param userOid 鐢ㄦ埛涓婚敭
diff --git a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/frameworkcore/compatibility/SmPwdStrategyQueryServiceI.java b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/frameworkcore/compatibility/SmPwdStrategyQueryServiceI.java
new file mode 100644
index 0000000..daac304
--- /dev/null
+++ b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/frameworkcore/compatibility/SmPwdStrategyQueryServiceI.java
@@ -0,0 +1,78 @@
+package com.vci.frameworkcore.compatibility;
+
+import com.vci.corba.common.PLException;
+import com.vci.corba.omd.data.BusinessObject;
+import com.vci.frameworkcore.pagemodel.OrgDepartmentVO;
+import com.vci.frameworkcore.pagemodel.SmPasswordStrategyVO;
+import com.vci.frameworkcore.pagemodel.SmRoleVO;
+import com.vci.starter.web.exception.VciBaseException;
+import com.vci.starter.web.util.BeanUtil;
+import com.vci.starter.web.wrapper.VciQueryWrapperForDO;
+import com.vci.web.model.SmPasswordStrategyDO;
+import com.vci.web.util.WebUtil;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.util.CollectionUtils;
+
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 瀵嗙爜绛栫暐鏌ヨ鏈嶅姟
+ * @author ludc
+ * @date 2024/6/24 16:33
+ */
+public interface SmPwdStrategyQueryServiceI {
+
+ /**
+ * 鑾峰彇榛樿瀵嗙爜绛栫暐
+ * @return
+ */
+ SmPasswordStrategyVO getPasswordStrategyVOByDefault();
+
+ /**
+ * 鏍规嵁涓婚敭鏌ヨ瀵嗙爜绛栫暐map瀵硅薄
+ * @param oidList
+ * @return key涓哄瘑鐮佺瓥鐣ヤ富閿� value涓哄瘑鐮佺瓥鐣�
+ */
+ Map<String,SmPasswordStrategyVO> mapPasswordStrategyVOMapByOid(Collection<String> oidList);
+
+ /**
+ * 浣跨敤涓婚敭鑾峰彇瀵嗙爜绛栫暐
+ * @param oid 涓婚敭
+ * @return 瀵嗙爜绛栫暐鏄剧ず瀵硅薄
+ */
+ SmPasswordStrategyVO getPasswordStrategyVOByOid(String oid);
+
+ /**
+ * 鏍规嵁鍗曟潯鐢ㄦ埛鐨勪富閿紝鑾峰彇鐢ㄦ埛鐨勫瘑鐮佸畨鍏ㄧ瓥鐣�
+ * @param userOid 鐢ㄦ埛鐨勪富閿�
+ * @return 瀵嗙爜瀹夊叏绛栫暐鐨勬樉绀哄璞★紝濡傛灉涓嶅瓨鍦ㄥ垯浼氳繑鍥濶ull
+ * @throws VciBaseException 鍙傛暟涓虹┖鎴栬�呮暟鎹簱鏌ヨ鍑洪敊鐨勬椂鍊欎細鎶涘嚭寮傚父
+ */
+ SmPasswordStrategyVO getPasswordStrategyVOByUserOid(String userOid) throws PLException;
+
+ /**
+ * 鏍规嵁鍗曟潯鐢ㄦ埛涓婚敭锛岃幏鍙栫敤鎴风殑瀵嗙爜瀹夊叏绛栫暐
+ * @param userOids
+ * @return
+ * @throws PLException
+ */
+ List<SmPasswordStrategyVO> listSmPasswordStrategyVOByUserOids(Collection<String> userOids) throws PLException;
+
+ /**
+ * 鏍规嵁涓婚敭锛屾壒閲忚幏鍙栧瘑鐮佸畨鍏ㄧ瓥鐣�
+ * @param oids
+ * @return
+ * @throws PLException
+ */
+ List<SmPasswordStrategyVO> listSmPasswordStrategyVOByOids(Collection<String> oids) throws PLException;
+
+ /**
+ * 鎵归噺鏍规嵁鐢ㄦ埛鐨勪富閿潵鑾峰彇瀵嗙爜绛栫暐
+ * @param userOidCollection 鐢ㄦ埛涓婚敭闆嗗悎
+ * @return 瀵嗙爜绛栫暐鐨勬樉绀哄璞★紝key鏄敤鎴蜂富閿�,value鏄繖涓敤鎴峰叧鑱旂殑瀵嗙爜绛栫暐
+ */
+ Map<String, SmPasswordStrategyVO> batchSmPwdStrategyByUserOids(Collection<String> userOidCollection);
+
+}
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 d652b0e..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
@@ -27,6 +27,7 @@
import org.springframework.util.CollectionUtils;
import java.util.*;
+import java.util.function.Function;
import java.util.stream.Collectors;
/**
@@ -103,6 +104,7 @@
}
return departmentVO;
}
+
/**
* 鎵归噺鑾峰彇閮ㄩ棬鐨勪俊鎭� 锛堟牴鎹儴闂ㄤ富閿級
* @param deptOidCollections 閮ㄩ棬涓婚敭鐨勯泦鍚堬紝鍙互瓒呰繃1000涓�
@@ -127,6 +129,7 @@
});
return deptDO2VOs(depts);
}
+
/**
* 鑾峰彇閮ㄩ棬鐨勫垪琛紝榛樿浼氫互閮ㄩ棬鍚嶇О鍗囧簭鎺掑垪锛岄儴闂ㄧ殑缂栬緫椤甸潰鍒楄〃涓嶈浣跨敤杩欎釜鎺ュ彛
* @param queryMap 鏌ヨ鏉′欢
@@ -150,6 +153,7 @@
}
return dataGrid;
}
+
/**
* 鏍规嵁閮ㄩ棬涓婚敭鑾峰彇閮ㄩ棬鐨勫鍚�
* @param deptOid 閮ㄩ棬涓婚敭
@@ -200,7 +204,8 @@
}
return deptDO2VOs(roles);
}
- /**
+
+ /**
* 鏍规嵁鐢ㄦ埛涓婚敭鑾峰彇鍏宠仈鐨勯儴闂�
* @param userOid 鐢ㄦ埛涓婚敭
* @param queryMap 鏌ヨ鏉′欢锛屽鏋滈渶瑕佷娇鐢ㄧ敤鎴风殑灞炴�ф潵鏌ヨ鍙互浣跨敤pkUser.xxxx
@@ -215,6 +220,7 @@
}
return departmentVOS.get(0);
}
+
/**
* 鑾峰彇鏈叧鑱旀煇涓敤鎴风殑閮ㄩ棬
* @param userOid 鐢ㄦ埛涓婚敭
@@ -290,16 +296,19 @@
List<BusinessObject> cbos = boService.queryBySql(sql, null);
if(!CollectionUtils.isEmpty(cbos)){
cbos.stream().forEach(cbo->{
- String userOid = ObjectTool.getBOAttributeValue(cbo,"pluseruid");
+ String userOid = ObjectTool.getNewBOAttributeValue(cbo,"pluseruid");
List<String> deptOids = userDeptOidMap.getOrDefault(userOid,new ArrayList<>());
- deptOids.add(ObjectTool.getBOAttributeValue(cbo,"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<>();
@@ -314,6 +323,7 @@
}
return new HashMap<>();
}
+
/**
* 鑾峰彇鏌愪釜閮ㄩ棬鐨勭洿灞炰笅绾ч儴闂�
* @param pkFatherDepartmment 閮ㄩ棬鐨勪富閿�
@@ -332,6 +342,7 @@
List<OrgDeptForPlatform1> depts = boService.selectByQueryWrapper(queryWrapperForDO, OrgDeptForPlatform1.class);
return deptDO2VOs(depts);
}
+
/**
* 鑾峰彇鏌愪釜閮ㄩ棬鐨勬墍鏈夊眰绾х殑涓嬬骇閮ㄩ棬
* @param pkFatherDepartmment 閮ㄩ棬鐨勪富閿�
@@ -345,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 鏍戝舰鏌ヨ鐨勬潯浠�
@@ -371,6 +383,7 @@
return dept.getId() + " " + dept.getName() + (FrameworkDataLCStatus.DISABLED.getValue().equals(dept.getLcStatus())?"銆愬仠鐢ㄣ��":"");
});
}
+
/**
* 鍙傜収鏍戝舰琛ㄦ牸鐨勯儴闂ㄤ俊鎭紝涓婄骇閮ㄩ棬鐨勬槸琛ㄦ牸涓殑鏍戝舰鍒�
* @param treeQueryObject 鏍戝舰鏌ヨ鐨勬潯浠�
diff --git a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/frameworkcore/compatibility/impl/SmPwdStrategyQueryServiceImpl.java b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/frameworkcore/compatibility/impl/SmPwdStrategyQueryServiceImpl.java
new file mode 100644
index 0000000..5aac379
--- /dev/null
+++ b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/frameworkcore/compatibility/impl/SmPwdStrategyQueryServiceImpl.java
@@ -0,0 +1,285 @@
+package com.vci.frameworkcore.compatibility.impl;
+
+import com.vci.corba.common.PLException;
+import com.vci.corba.omd.data.BusinessObject;
+import com.vci.frameworkcore.compatibility.SmPwdStrategyQueryServiceI;
+import com.vci.frameworkcore.compatibility.SmUserQueryServiceI;
+import com.vci.frameworkcore.model.OrgDeptForPlatform1;
+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.omd.utils.ObjectTool;
+import com.vci.starter.web.constant.QueryOptionConstant;
+import com.vci.starter.web.exception.VciBaseException;
+import com.vci.starter.web.util.BeanUtil;
+import com.vci.starter.web.wrapper.VciQueryWrapperForDO;
+import com.vci.web.model.SmPasswordStrategyDO;
+import com.vci.web.service.WebBoServiceI;
+import com.vci.web.util.Func;
+import com.vci.web.util.WebUtil;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.util.CollectionUtils;
+
+import java.util.*;
+import java.util.function.Function;
+import java.util.stream.Collectors;
+
+import static com.vci.frameworkcore.constant.FrameWorkBusLangCodeConstant.DATA_OID_NOT_EXIST;
+
+/**
+ * 瀵嗙爜绛栫暐鏌ヨ鏈嶅姟
+ * @author ludc
+ * @date 2024/6/24 16:33
+ */
+@Service
+public class SmPwdStrategyQueryServiceImpl implements SmPwdStrategyQueryServiceI {
+
+ /**
+ * 涓氬姟鏁版嵁鏈嶅姟
+ */
+ @Autowired
+ private WebBoServiceI boService;
+
+ /**
+ * 鐢ㄦ埛鏌ヨ鏈嶅姟
+ */
+ @Autowired
+ private SmUserQueryServiceI smUserQueryService;
+
+ /**
+ * 鑾峰彇榛樿瀵嗙爜绛栫暐
+ * @return
+ */
+ public SmPasswordStrategyVO getPasswordStrategyVOByDefault(){
+ //鑾峰彇榛樿鐨�
+ VciQueryWrapperForDO queryWrapperForDO = new VciQueryWrapperForDO(null, SmPasswordStrategyDO.class);
+ queryWrapperForDO.eq("plisdefault","1");
+ List<BusinessObject> cboList = boService.queryBySql(queryWrapperForDO.getSelectFieldSql() + " from plpasswordstrategy " +
+ queryWrapperForDO.getTableNick() + queryWrapperForDO.getLinkTableSql() +
+ (StringUtils.isBlank(queryWrapperForDO.getWhereSql()) ? "" : (" where " + queryWrapperForDO.getWhereSql())), null);
+ if(!CollectionUtils.isEmpty(cboList)){
+ SmPasswordStrategyDO passwordStrategyDO = new SmPasswordStrategyDO();
+ WebUtil.copyValueToObjectFromCbos(cboList.get(0),passwordStrategyDO);
+ return pwdStrategyDO2VO(passwordStrategyDO);
+ }
+ return null;
+ }
+
+ /**
+ * 鏍规嵁涓婚敭鏌ヨ瀵嗙爜绛栫暐map瀵硅薄
+ * @param oidList
+ * @return key涓哄瘑鐮佺瓥鐣ヤ富閿� value涓哄瘑鐮佺瓥鐣�
+ */
+ @Override
+ public Map<String, SmPasswordStrategyVO> mapPasswordStrategyVOMapByOid(Collection<String> oidList) {
+ VciQueryWrapperForDO queryWrapperForDO = new VciQueryWrapperForDO(null, SmPasswordStrategyDO.class);
+ queryWrapperForDO.in("oid",oidList.stream().collect(Collectors.joining(",")));
+ List<BusinessObject> cboList = boService.queryBySql(queryWrapperForDO.getSelectFieldSql() + " from plpasswordstrategy " +
+ queryWrapperForDO.getTableNick() + queryWrapperForDO.getLinkTableSql() +
+ (StringUtils.isBlank(queryWrapperForDO.getWhereSql()) ? "" : (" where " + queryWrapperForDO.getWhereSql())), null);
+ Map<String,SmPasswordStrategyVO> smPasswordStrategyVOMap = new HashMap<>();
+ if(Func.isEmpty(cboList)){
+ return new HashMap<>();
+ }
+ cboList.stream().forEach(item->{
+ SmPasswordStrategyDO passwordStrategyDO = new SmPasswordStrategyDO();
+ WebUtil.copyValueToObjectFromCbos(item,passwordStrategyDO);
+ SmPasswordStrategyVO passwordStrategyVO = new SmPasswordStrategyVO();
+ BeanUtil.convert(passwordStrategyDO,passwordStrategyVO);
+ smPasswordStrategyVOMap.put(passwordStrategyVO.getOid(),passwordStrategyVO);
+ });
+ return smPasswordStrategyVOMap;
+ }
+
+ /**
+ * 浣跨敤涓婚敭鑾峰彇瀵嗙爜绛栫暐
+ * @param oid 涓婚敭
+ * @return 瀵嗙爜绛栫暐鏄剧ず瀵硅薄
+ */
+ public SmPasswordStrategyVO getPasswordStrategyVOByOid(String oid){
+ VciQueryWrapperForDO queryWrapperForDO = new VciQueryWrapperForDO(null, SmPasswordStrategyDO.class);
+ queryWrapperForDO.eq("oid",oid.trim());
+ List<BusinessObject> cboList = boService.queryBySql(queryWrapperForDO.getSelectFieldSql() + " from plpasswordstrategy " +
+ queryWrapperForDO.getTableNick() + queryWrapperForDO.getLinkTableSql() +
+ (StringUtils.isBlank(queryWrapperForDO.getWhereSql()) ? "" : (" where " + queryWrapperForDO.getWhereSql())), null);
+ if(!CollectionUtils.isEmpty(cboList)){
+ SmPasswordStrategyDO passwordStrategyDO = new SmPasswordStrategyDO();
+ WebUtil.copyValueToObjectFromCbos(cboList.get(0),passwordStrategyDO);
+ SmPasswordStrategyVO passwordStrategyVO = new SmPasswordStrategyVO();
+ BeanUtil.convert(passwordStrategyDO,passwordStrategyVO);
+ return passwordStrategyVO;
+ }else{
+ //鑾峰彇榛樿鐨�
+ queryWrapperForDO = new VciQueryWrapperForDO(null, SmPasswordStrategyDO.class);
+ queryWrapperForDO.eq("plisdefault","1");
+ cboList = boService.queryBySql(queryWrapperForDO.getSelectFieldSql() + " from plpasswordstrategy " +
+ queryWrapperForDO.getTableNick() + queryWrapperForDO.getLinkTableSql() +
+ (StringUtils.isBlank(queryWrapperForDO.getWhereSql()) ? "" : (" where " + queryWrapperForDO.getWhereSql())), null);
+ if(!CollectionUtils.isEmpty(cboList)){
+ SmPasswordStrategyDO passwordStrategyDO = new SmPasswordStrategyDO();
+ WebUtil.copyValueToObjectFromCbos(cboList.get(0),passwordStrategyDO);
+ return pwdStrategyDO2VO(passwordStrategyDO);
+ }
+ }
+ return null;
+ }
+
+ /**
+ * 澶氭潯瀵嗙爜绛栫暐do瀵硅薄杞瑅o瀵硅薄
+ * @param smPasswordStrategyDOList
+ * @return
+ */
+ private List<SmPasswordStrategyVO> pwdStrategyDO2VOS(List<SmPasswordStrategyDO> smPasswordStrategyDOList){
+ List<SmPasswordStrategyVO> smPasswordStrategyVOList = new ArrayList<>();
+ if(Func.isEmpty(smPasswordStrategyDOList)) {
+ return smPasswordStrategyVOList;
+ }
+ smPasswordStrategyDOList.stream().forEach(item->{
+ smPasswordStrategyVOList.add(pwdStrategyDO2VO(item));
+ });
+ return smPasswordStrategyVOList;
+ }
+
+ /**
+ * 瀵嗙爜绛栫暐do瀵硅薄杞瑅o瀵硅薄
+ * @param smPasswordStrategyDO
+ * @return
+ */
+ private SmPasswordStrategyVO pwdStrategyDO2VO(SmPasswordStrategyDO smPasswordStrategyDO){
+ SmPasswordStrategyVO passwordStrategyVO = new SmPasswordStrategyVO();
+ BeanUtil.convert(smPasswordStrategyDO,passwordStrategyVO);
+ return passwordStrategyVO;
+ }
+
+ /**
+ * 鏍规嵁鐢ㄦ埛鐨勪富閿紝鑾峰彇鐢ㄦ埛鐨勫瘑鐮佸畨鍏ㄧ瓥鐣�
+ * @param userOid 鐢ㄦ埛鐨勪富閿�
+ * @return 瀵嗙爜瀹夊叏绛栫暐鐨勬樉绀哄璞★紝濡傛灉涓嶅瓨鍦ㄥ垯浼氳繑鍥濶ull
+ * @throws VciBaseException 鍙傛暟涓虹┖鎴栬�呮暟鎹簱鏌ヨ鍑洪敊鐨勬椂鍊欎細鎶涘嚭寮傚父
+ */
+ @Override
+ public SmPasswordStrategyVO getPasswordStrategyVOByUserOid(String userOid) throws PLException {
+ WebUtil.alertNotNull(userOid,"鐢ㄦ埛鐨勪富閿�");
+ if(smUserQueryService.checkUserExist(null,userOid)){
+ throw new VciBaseException(DATA_OID_NOT_EXIST);
+ }
+ String sql = "select plpasswordstrategyuid,pluseruid from pluserpasswordstrategy where pluseruid = '"+ userOid +"')";
+ List<BusinessObject> cbos = boService.queryBySql(sql, null);
+ if(Func.isNotEmpty(cbos)){
+ return getPasswordStrategyVOByOid(ObjectTool.getNewBOAttributeValue(cbos.get(0), "plpasswordstrategyuid"));
+ }
+ return null;
+ }
+
+ /**
+ * 鏍规嵁澶氭潯鐢ㄦ埛涓婚敭锛岃幏鍙栫敤鎴风殑瀵嗙爜瀹夊叏绛栫暐
+ * @param userOids
+ * @return
+ * @throws PLException
+ */
+ @Override
+ public List<SmPasswordStrategyVO> listSmPasswordStrategyVOByUserOids(Collection<String> userOids) {
+ WebUtil.alertNotNull(userOids,"鐢ㄦ埛鐨勪富閿�");
+ //鍏堟煡鍏宠仈琛�
+ List<String> userPwdStrategyList = new ArrayList<>();
+ WebUtil.switchCollectionForOracleIn(userOids).stream().forEach(userOidSplit->{
+ //鏌ュ叧鑱旇〃sql
+ String sql = "select plpasswordstrategyuid,pluseruid from pluserpasswordstrategy where pluseruid in (" + WebUtil.toInSql(userOidSplit.toArray(new String[0])) + ")";
+ List<BusinessObject> cbos = boService.queryBySql(sql, null);
+ cbos.stream().forEach(cbo->{
+ userPwdStrategyList.add(ObjectTool.getNewBOAttributeValue(cbo,"plpasswordstrategyuid"));
+ });
+ });
+ return listSmPasswordStrategyVOByOids(userPwdStrategyList);
+ }
+
+ /**
+ * 鏍规嵁鐢ㄦ埛涓婚敭鏌ヨ瀵嗙爜绛栫暐鍏宠仈琛ㄤ腑鐨勫瘑鐮佺瓥鐣ヤ富閿�
+ * @param userOids
+ * @return key涓虹敤鎴穙id锛歷alue涓哄瘑鐮佺瓥鐣id
+ */
+ private Map<String,String> mapUserPwdStrategy(Collection<String> userOids){
+ Map<String,String> userPwdStrategyMap = new HashMap<>();
+ WebUtil.switchCollectionForOracleIn(userOids).stream().forEach(userOidSplit->{
+ //鏌ュ叧鑱旇〃sql
+ String sql = "select plpasswordstrategyuid,pluseruid from pluserpasswordstrategy where pluseruid in (" + WebUtil.toInSql(userOidSplit.toArray(new String[0])) + ")";
+ List<BusinessObject> cbos = boService.queryBySql(sql, null);
+ cbos.stream().forEach(cbo->{
+ String pluseruid = ObjectTool.getNewBOAttributeValue(cbo, "pluseruid");
+ String plpasswordstrategyuid = ObjectTool.getNewBOAttributeValue(cbo, "plpasswordstrategyuid");
+ userPwdStrategyMap.put(pluseruid,plpasswordstrategyuid);
+ });
+ });
+ return userPwdStrategyMap;
+ }
+
+ /**
+ * 鏍规嵁涓婚敭锛屾壒閲忚幏鍙栧瘑鐮佸畨鍏ㄧ瓥鐣ヤ富閿�
+ * @param oids
+ * @return
+ * @throws PLException
+ */
+ @Override
+ public List<SmPasswordStrategyVO> listSmPasswordStrategyVOByOids(Collection<String> oids) {
+ VciQueryWrapperForDO queryWrapperForDO = new VciQueryWrapperForDO(null, SmPasswordStrategyDO.class);
+ queryWrapperForDO.in("oid",oids.stream().collect(Collectors.joining(",")));
+ List<BusinessObject> cboList = boService.queryBySql(queryWrapperForDO.getSelectFieldSql() + " from plpasswordstrategy " +
+ queryWrapperForDO.getTableNick() + queryWrapperForDO.getLinkTableSql() +
+ (StringUtils.isBlank(queryWrapperForDO.getWhereSql()) ? "" : (" where " + queryWrapperForDO.getWhereSql())), null);
+ List<SmPasswordStrategyVO> smPasswordStrategyVOList = new ArrayList<>();
+ if(Func.isEmpty(cboList)){
+ return smPasswordStrategyVOList;
+ }
+ cboList.stream().forEach(item->{
+ SmPasswordStrategyDO passwordStrategyDO = new SmPasswordStrategyDO();
+ WebUtil.copyValueToObjectFromCbos(item,passwordStrategyDO);
+ SmPasswordStrategyVO passwordStrategyVO = new SmPasswordStrategyVO();
+ BeanUtil.convert(passwordStrategyDO,passwordStrategyVO);
+ smPasswordStrategyVOList.add(passwordStrategyVO);
+ });
+ return smPasswordStrategyVOList;
+ }
+
+ /**
+ * 鎵归噺鏍规嵁鐢ㄦ埛鐨勪富閿潵鑾峰彇瀵嗙爜绛栫暐
+ * @param userOidCollection 鐢ㄦ埛涓婚敭闆嗗悎
+ * @return 瀵嗙爜绛栫暐鐨勬樉绀哄璞★紝key鏄敤鎴蜂富閿�,value鏄繖涓敤鎴峰叧鑱旂殑瀵嗙爜绛栫暐
+ */
+ @Override
+ public Map<String, SmPasswordStrategyVO> batchSmPwdStrategyByUserOids(Collection<String> userOidCollection) {
+ if(CollectionUtils.isEmpty(userOidCollection)){
+ return new HashMap<>();
+ }
+ Map<String,SmPasswordStrategyVO> smPasswordStrategyVOMap = new HashMap<>();
+ Map<String,String> userPasswordStrategyVOMap = new HashMap<>();
+
+ Map<String/*鐢ㄦ埛id*/, SmPasswordStrategyVO/*瀵嗙爜绛栫暐*/> returnMap = new HashMap<>();
+ WebUtil.switchCollectionForOracleIn(userOidCollection).stream().forEach(userOids->{
+ //鏌ヨ瀵嗙爜绛栫暐鍏宠仈淇℃伅锛宬ey涓虹敤鎴穙id锛歷alue涓哄瘑鐮佺瓥鐣id
+ Map<String, String> userPwdStrategyMap = mapUserPwdStrategy(userOids);
+ userPasswordStrategyVOMap.putAll(userPwdStrategyMap);
+ //鏌ヨ瀵嗙爜绛栫暐锛宬ey涓哄瘑鐮佺瓥鐣ヤ富閿細value涓哄瘑鐮佺瓥鐣�
+ smPasswordStrategyVOMap.putAll(mapPasswordStrategyVOMapByOid(userPwdStrategyMap.values()));
+ });
+ //鏌ヨ榛樿鐨勫瘑鐮佺瓥鐣�
+ SmPasswordStrategyVO passwordStrategyVOByDefault = getPasswordStrategyVOByDefault();
+ //寰幆鐢ㄦ埛id锛屾煡璇㈡槸鍚︽湁绗﹀悎鏉′欢鐨刼id
+ userOidCollection.stream().forEach(oid->{
+ SmPasswordStrategyVO smPasswordStrategyVO;
+ //閫氳繃鐢ㄦ埛oid娌¤幏鍙栧埌瀵嗙爜绛栫暐oid锛岃鏄庢病鏈夌粰褰撳墠鐢ㄦ埛璁剧疆绛栫暐锛岀洿鎺ヨ繑榛樿鐨勫瘑鐮佺瓥鐣�
+ String pwdStrategyId = userPasswordStrategyVOMap.get(oid);
+ if(Func.isNotBlank(pwdStrategyId)){
+ //閫氳繃瀵嗙爜绛栫暐oid鍘籱ap涓彇瀵嗙爜绛栫暐
+ smPasswordStrategyVO = smPasswordStrategyVOMap.get(pwdStrategyId);
+ }else {
+ smPasswordStrategyVO = passwordStrategyVOByDefault;
+ }
+ returnMap.put(oid,smPasswordStrategyVO);
+ });
+ return returnMap;
+ }
+
+}
diff --git a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/frameworkcore/controller/SmPwdStrategyQueryController.java b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/frameworkcore/controller/SmPwdStrategyQueryController.java
new file mode 100644
index 0000000..d99648b
--- /dev/null
+++ b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/frameworkcore/controller/SmPwdStrategyQueryController.java
@@ -0,0 +1,8 @@
+package com.vci.frameworkcore.controller;
+
+/**
+ * @author ludc
+ * @date 2024/6/24 16:31
+ */
+public class SmPwdStrategyQueryController {
+}
--
Gitblit v1.9.3