From 08579f2efb9bd870a9ad4cae3ec5b25cbb30a198 Mon Sep 17 00:00:00 2001
From: 田源 <lastanimals@163.com>
Date: 星期二, 22 十月 2024 18:01:44 +0800
Subject: [PATCH] 表单定义克隆功能 以及 模糊查询功能
---
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/UIManagerServiceImpl.java | 100 +++++++++++++++++++++++++------------------------
1 files changed, 51 insertions(+), 49 deletions(-)
diff --git a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/UIManagerServiceImpl.java b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/UIManagerServiceImpl.java
index bbca258..3f4e4fe 100644
--- a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/UIManagerServiceImpl.java
+++ b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/UIManagerServiceImpl.java
@@ -39,6 +39,7 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
+import javax.swing.tree.TreePath;
import java.io.File;
import java.util.*;
import java.util.concurrent.TimeUnit;
@@ -1693,18 +1694,18 @@
if (conditionMap == null) {
conditionMap = new HashMap<>();
}
- //String roleId = StringUtils.isBlank(conditionMap.get("roleId")) ? "" : conditionMap.get("roleId");
+ String roleId = StringUtils.isBlank(conditionMap.get("roleId")) ? "" : conditionMap.get("roleId");
String type = StringUtils.isBlank(conditionMap.get("type")) ? "" : conditionMap.get("type");
- //String context = StringUtils.isBlank(conditionMap.get("context")) ? "" : conditionMap.get("context");
+ String context = StringUtils.isBlank(conditionMap.get("context")) ? "" : conditionMap.get("context");
boolean showCheckBox = Boolean.parseBoolean(conditionMap.get("showCheckBox"));
- /*Map<String,RoleRightVO> roleRightVOMap=new HashMap<>();
+ Map<String,RoleRightVO> roleRightVOMap = new HashMap<>();
if(StringUtils.isNotBlank(roleId)){
String userName = WebThreadLocalUtil.getCurrentUserSessionInfoInThread().getUserId();
- RoleRightInfo[] rightInfos= platformClientUtil.getFrameworkService().getRoleRightList(roleId,userName);
+ RoleRightInfo[] rightInfos = platformClientUtil.getFrameworkService().getRoleRightList(roleId,userName);
List<RoleRightVO> roleRightVOList = roleRightDOO2VOS(Arrays.asList(rightInfos));
roleRightVOMap = roleRightVOList.stream().collect(Collectors.toMap(RoleRightVO::getFuncId,roleRightVO ->roleRightVO,(oldValue,newOldValue)->oldValue));
- }*/
- BizType[] bizTypes=osBtmServiceI.getBizTypes(type);
+ }
+ BizType[] bizTypes = osBtmServiceI.getBizTypes(type);
List<Tree> treeList=new ArrayList<>();
Tree rootNode =new Tree("root","鍔熻兘妯″潡","root");
rootNode.setLevel(0);
@@ -1721,15 +1722,14 @@
bizTypeTree.setParentId(rootNode.getOid());
bizTypeTree.setParentName(rootNode.getText());
bizTypeTree.setParentBtmName(bizTypes[i].name);
-
//long startTime1 = System.currentTimeMillis();
- List<PLUILayout> contextList = uiDataFetcher.getContext(bizTypes[i].name);
+ List<PLUILayout> contextList = uiDataFetcher.getContext(bizTypes[i].name/*+context*/);
//long endTime1 = System.currentTimeMillis();
//System.out.println("============================================鑾峰彇UI瀹氫箟鏁版嵁寮曟搸鑰楁椂锛�"+((endTime1-startTime1)/1000)+"s");
List<Tree> btmChildList = new ArrayList<>();
btmChildList.add(bizTypeTree);
- setChildNode(btmChildList,contextList/*,roleRightVOMap*/,showCheckBox);
+ setChildNode(btmChildList,contextList,roleRightVOMap,showCheckBox);
childList.add(bizTypeTree);
}
//long endTime = System.currentTimeMillis();
@@ -1745,14 +1745,15 @@
* @return
* @throws PLException
*/
- @Override
- public List<RoleRightVO> getRightListByRoleId(String roleId) throws PLException {
- VciBaseUtil.alertNotNull(roleId,"鏌ヨ鏉′欢瑙掕壊涓婚敭");
- String userName = WebThreadLocalUtil.getCurrentUserSessionInfoInThread().getUserId();
- RoleRightInfo[] rightInfos= platformClientUtil.getFrameworkService().getRoleRightList(roleId,userName);
- List<RoleRightVO> roleRightVOList = roleRightDOO2VOS(Arrays.asList(rightInfos));
- return roleRightVOList;
- }
+ /* @Override
+ public Map<String,RoleRightVO> getRightListByRoleId(String roleId) throws PLException {
+ VciBaseUtil.alertNotNull(roleId,"鏌ヨ鏉′欢瑙掕壊涓婚敭");
+ String userName = WebThreadLocalUtil.getCurrentUserSessionInfoInThread().getUserId();
+ RoleRightInfo[] rightInfos= platformClientUtil.getFrameworkService().getRoleRightList(roleId,userName);
+ List<RoleRightVO> roleRightVOList = roleRightDOO2VOS(Arrays.asList(rightInfos));
+ Map<String,RoleRightVO> roleRightVOMap = roleRightVOList.stream().collect(Collectors.toMap(RoleRightVO::getFuncId,roleRightVO ->roleRightVO,(oldValue,newOldValue)->oldValue));
+ return roleRightVOMap;
+ }*/
/***
* UI鎺堟潈
@@ -1773,31 +1774,31 @@
conditionMap.put("context",uiAuthorDTO.getContext());
conditionMap.put("showCheckBox","true");
treeQueryObject.setConditionMap(conditionMap);
- List<Tree> treeList=this.getUIAuthor(treeQueryObject);
- HashMap<String,Tree> allTreeMap=new HashMap<>();
- Map<String,RoleRightDTO> roleRightVOMap=new HashMap<>();
+ List<Tree> treeList = this.getUIAuthor(treeQueryObject);
+ HashMap<String,Tree> allTreeMap = new HashMap<>();
+ Map<String,RoleRightDTO> roleRightVOMap = new HashMap<>();
if(!CollectionUtil.isEmpty(treeList)){
if(StringUtils.isNotBlank(uiAuthorDTO.getRoleId())){
- String userName= WebThreadLocalUtil.getCurrentUserSessionInfoInThread().getUserId();
- RoleRightInfo[] rightInfos= platformClientUtil.getFrameworkService().getRoleRightList(uiAuthorDTO.getRoleId(),userName);
- List<RoleRightVO> roleRightVOList=roleRightDOO2VOS(Arrays.asList(rightInfos));
- roleRightVOMap=roleRightVOList.stream().collect(Collectors.toMap(RoleRightVO::getFuncId,roleRightVO ->roleRightVOO2DTO(roleRightVO),(oldValue,newValue)->oldValue));
+ String userName = WebThreadLocalUtil.getCurrentUserSessionInfoInThread().getUserId();
+ RoleRightInfo[] rightInfos = platformClientUtil.getFrameworkService().getRoleRightList(uiAuthorDTO.getRoleId(),userName);
+ List<RoleRightVO> roleRightVOList = roleRightDOO2VOS(Arrays.asList(rightInfos));
+ roleRightVOMap = roleRightVOList.stream().collect(Collectors.toMap(RoleRightVO::getFuncId,roleRightVO ->roleRightVOO2DTO(roleRightVO),(oldValue,newValue)->oldValue));
}
convertTreeDOO2Map(treeList,allTreeMap);
- List<RoleRightDTO> roleRightDTOList=new ArrayList<>();
- List<Tree> selectTreeList= uiAuthorDTO.getSelectTreeList();
+ List<RoleRightDTO> roleRightDTOList = new ArrayList<>();
+ List<Tree> selectTreeList = uiAuthorDTO.getSelectTreeList();
getSelectedRoleRightObjs(uiAuthorDTO.getRoleId(),selectTreeList,allTreeMap,roleRightVOMap,roleRightDTOList);
SessionInfo sessionInfo = WebThreadLocalUtil.getCurrentUserSessionInfoInThread();
String currentUserName = sessionInfo.getUserId();
- boolean isDeveloper= rightControlUtil.isDeveloper(currentUserName);
- List<RoleRightInfo> roleRightInfoList= roleRightDTOO2InfoS(roleRightDTOList);
- UserEntityInfo info=new UserEntityInfo();
+ //boolean isDeveloper = rightControlUtil.isDeveloper(currentUserName);
+ List<RoleRightInfo> roleRightInfoList = roleRightDTOO2InfoS(roleRightDTOList);
+ UserEntityInfo info = new UserEntityInfo();
info.modules="UI鎺堟潈";
- info.userName=currentUserName;
+ info.userName = currentUserName;
try {
- res= platformClientUtil.getFrameworkService().saveRoleRight(roleRightInfoList.toArray(new RoleRightInfo[]{}),uiAuthorDTO.getRoleId(),currentUserName,info);
+ res = platformClientUtil.getFrameworkService().saveRoleRight(roleRightInfoList.toArray(new RoleRightInfo[]{}),uiAuthorDTO.getRoleId(),currentUserName,info);
}catch (PLException e){
- throw new Exception("淇濆瓨澶辫触锛�"+e.getMessage());
+ throw new Exception("淇濆瓨澶辫触锛�" + e.getMessage());
}
}
return res;
@@ -1810,15 +1811,15 @@
* @param allTreeMap
* @param roleRightDTOList
*/
- private void getSelectedRoleRightObjs(String roleOid,List<Tree> selectTreeList,HashMap<String,Tree> allTreeMap,Map<String,RoleRightDTO> allRoleRightDTOMap, List<RoleRightDTO> roleRightDTOList){
- Date date=new Date();
- Map<String,RoleRightDTO> roleRightDTOMap=new HashMap<>();
+ private void getSelectedRoleRightObjs(String roleOid, List<Tree> selectTreeList, HashMap<String,Tree> allTreeMap, Map<String,RoleRightDTO> allRoleRightDTOMap, List<RoleRightDTO> roleRightDTOList){
+ //Date date=new Date();
+ Map<String,RoleRightDTO> roleRightDTOMap = new HashMap<>();
if(!CollectionUtil.isEmpty(selectTreeList)){
selectTreeList.stream().forEach(tree -> {
- String oid=tree.getOid();
+ String oid = tree.getOid();
if(allTreeMap.containsKey(oid)){
- tree= allTreeMap.get(oid);
- Object data= tree.getData();
+ tree = allTreeMap.get(oid);
+ Object data = tree.getData();
if (data instanceof String) {
getRightValue(roleOid, tree, allTreeMap, false, roleRightDTOMap);//鍚戜笅鑾峰彇鎵�鏈夋ā鍧楃殑鏉冮檺鍊�
} else if (!(data instanceof PLTabButton)) {//涓氬姟绫诲瀷
@@ -1829,16 +1830,17 @@
if(allTreeMap.containsKey(parrentId)){
SessionInfo sessionInfo = WebThreadLocalUtil.getCurrentUserSessionInfoInThread();
String currentUserName = sessionInfo.getUserId();
- boolean isDeveloper= rightControlUtil.isDeveloper(currentUserName);
+ boolean isDeveloper = rightControlUtil.isDeveloper(currentUserName);
Tree parentNode= allTreeMap.get(parrentId);
String funcId = parentNode.getOid();
- getRightValue(roleOid,tree, allTreeMap, true, roleRightDTOMap);//鍚戜笂澶勭悊璇ユ搷浣滅埗绾х殑涓婄骇妯″潡鏉冮檺(涓嶅寘鍚埗鑺傜偣)
+ getRightValue(roleOid, tree, allTreeMap, true, roleRightDTOMap);//鍚戜笂澶勭悊璇ユ搷浣滅埗绾х殑涓婄骇妯″潡鏉冮檺(涓嶅寘鍚埗鑺傜偣)
if(!roleRightDTOMap.containsKey(funcId)){
RoleRightDTO roleRightDTO = new RoleRightDTO();
roleRightDTO.setId(ObjectUtility.getNewObjectID36());//涓婚敭
roleRightDTO.setFuncId(funcId);
if(isDeveloper) {
- roleRightDTO.setRightType((short) 1);//鏉冮檺绫诲瀷 鏉冮檺绫诲瀷锛岃秴绾х鐞嗗憳缁欑鐞嗗憳鎺堟潈涓�1锛岀鐞嗗憳缁欐櫘閫氱敤鎴锋巿鏉冧负2
+ //鏉冮檺绫诲瀷 鏉冮檺绫诲瀷锛岃秴绾х鐞嗗憳缁欑鐞嗗憳鎺堟潈涓�1锛岀鐞嗗憳缁欐櫘閫氱敤鎴锋巿鏉冧负2
+ roleRightDTO.setRightType((short) 1);
}else{
roleRightDTO.setRightType((short) 2);
}
@@ -1862,7 +1864,7 @@
});
/* allRoleRightDTOMap.putAll(roleRightDTOMap.entrySet().stream()
.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry:: getValue)));*/
- List<RoleRightDTO> newRoleRightDTOList=Optional.ofNullable(roleRightDTOMap).orElseGet(()->new HashMap<String,RoleRightDTO>()).values().stream().collect(Collectors.toList());
+ List<RoleRightDTO> newRoleRightDTOList = Optional.ofNullable(roleRightDTOMap).orElseGet(()->new HashMap<String,RoleRightDTO>()).values().stream().collect(Collectors.toList());
roleRightDTOList.addAll(newRoleRightDTOList);
}
}
@@ -2125,7 +2127,7 @@
* @param contextList
* @param isShowCheckBox
*/
- private void setChildNode(List<Tree> parentTree, List<PLUILayout>contextList, boolean isShowCheckBox){
+ private void setChildNode(List<Tree> parentTree, List<PLUILayout>contextList,Map<String,RoleRightVO> roleRightVOMap, boolean isShowCheckBox){
Optional.ofNullable(parentTree).orElseGet(()->new ArrayList<>()).stream().forEach(pTree -> {
Object funcObj = pTree.getData();
List<Tree> chiledTreeList = new ArrayList<>();
@@ -2143,7 +2145,7 @@
pTree.setChildren(chiledTreeList);
}
if(!CollectionUtil.isEmpty(chiledTreeList)) {
- setChildNode(chiledTreeList, contextList, isShowCheckBox);
+ setChildNode(chiledTreeList, contextList,roleRightVOMap, isShowCheckBox);
}
}else if (funcObj instanceof PLUILayout){//UI
PLUILayout context = (PLUILayout) funcObj;
@@ -2160,7 +2162,7 @@
});
}
if(!CollectionUtil.isEmpty(chiledTreeList)) {
- setChildNode(chiledTreeList, contextList, isShowCheckBox);
+ setChildNode(chiledTreeList, contextList,roleRightVOMap, isShowCheckBox);
}
pTree.setChildren(chiledTreeList);
}else if (funcObj instanceof PLTabPage) {//涓婁笅鏂�
@@ -2179,7 +2181,7 @@
pTree.setChildren(chiledTreeList);
}
if(!CollectionUtil.isEmpty(chiledTreeList)) {
- setChildNode(chiledTreeList, contextList, isShowCheckBox);
+ setChildNode(chiledTreeList, contextList,roleRightVOMap, isShowCheckBox);
}
}else if (funcObj instanceof PLPageDefination) {
PLPageDefination plPageDefination = (PLPageDefination) funcObj;
@@ -2198,9 +2200,9 @@
pTree.setChildren(chiledTreeList);
}
if(!CollectionUtil.isEmpty(chiledTreeList)) {
- setChildNode(chiledTreeList, contextList, isShowCheckBox);
+ setChildNode(chiledTreeList, contextList,roleRightVOMap, isShowCheckBox);
}
- }/*else if (funcObj instanceof PLTabButton) {//鎸夐挳
+ }else if (funcObj instanceof PLTabButton) {//鎸夐挳
PLTabButton plTabButton = (PLTabButton) funcObj;
String id = plTabButton.plTableOId;
if(roleRightVOMap.containsKey(id)){
@@ -2216,7 +2218,7 @@
}else{
pTree.setChecked(false);
}
- }*/
+ }
});
}
--
Gitblit v1.9.3