| | |
| | | package com.vci.web.service.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.vci.common.utility.ObjectUtility; |
| | | import com.vci.corba.common.PLException; |
| | | import com.vci.corba.common.data.UserEntityInfo; |
| | | import com.vci.corba.framework.data.RoleRightInfo; |
| | | import com.vci.corba.omd.btm.BizType; |
| | | import com.vci.corba.portal.PortalService; |
| | |
| | | import javax.annotation.Resource; |
| | | import java.io.File; |
| | | import java.util.*; |
| | | import java.util.concurrent.atomic.AtomicBoolean; |
| | | import java.util.concurrent.atomic.AtomicInteger; |
| | | import java.util.stream.Collectors; |
| | | import java.util.regex.Pattern; |
| | |
| | | @Resource |
| | | private PlatformClientUtil platformClientUtil; |
| | | |
| | | /** |
| | | * è§è² |
| | | */ |
| | | @Resource |
| | | private SmRoleQueryServiceI smRoleQueryServiceI; |
| | | /*** |
| | | * æ¯å¦æ¯ç®¡çå |
| | | */ |
| | |
| | | public List<PLUILayout> getUIContextDataByBtName(String btemName,String context) throws PLException { |
| | | VciBaseUtil.alertNotNull(btemName,"ä¸å¡ç±»å"); |
| | | List<PLUILayout> pluiLayoutList=new ArrayList<>(); |
| | | List<String> contextList= VciBaseUtil.str2List(context); |
| | | List<String> contextList= new ArrayList<>(); |
| | | if(StringUtils.isNotBlank(context)){ |
| | | contextList=VciBaseUtil.str2List(context); |
| | | }else{ |
| | |
| | | String userName= WebThreadLocalUtil.getCurrentUserSessionInfoInThread().getUserId(); |
| | | RoleRightInfo[] rightInfos= platformClientUtil.getFrameworkService().getRoleRightList(roleId,userName); |
| | | List<RoleRightVO> roleRightVOList=roleRightDOO2VOS(Arrays.asList(rightInfos)); |
| | | roleRightVOMap=roleRightVOList.stream().collect(Collectors.toMap(RoleRightVO::getFuncId,roleRightVO ->roleRightVO)); |
| | | roleRightVOMap=roleRightVOList.stream().collect(Collectors.toMap(RoleRightVO::getFuncId,roleRightVO ->roleRightVO,(oldValue,newOldValue)->oldValue)); |
| | | } |
| | | BizType[] bizTypes=osBtmServiceI.getBizTypes(type); |
| | | List<Tree> treeList=new ArrayList<>(); |
| | |
| | | bizTypeTree.setShowCheckbox(true); |
| | | bizTypeTree.setParentBtmName(bizTypes[i].name); |
| | | childList.add(bizTypeTree); |
| | | if(roleRightVOMap.containsKey(bizTypes[i].oid)){ |
| | | List<PLUILayout>contextList=getUIContextDataByBtName(bizTypes[i].name,context); |
| | | List<Tree> btmChildList=new ArrayList<>(); |
| | | btmChildList.add(bizTypeTree); |
| | | setChildNode(btmChildList,contextList,roleRightVOMap,showCheckBox); |
| | | } |
| | | List<PLUILayout>contextList=getUIContextDataByBtName(bizTypes[i].name,context); |
| | | List<Tree> btmChildList=new ArrayList<>(); |
| | | btmChildList.add(bizTypeTree); |
| | | setChildNode(btmChildList,contextList,roleRightVOMap,showCheckBox); |
| | | } |
| | | rootNode.setChildren(childList); |
| | | treeList.add(rootNode); |
| | |
| | | treeQueryObject.setConditionMap(conditionMap); |
| | | List<Tree> treeList=this.getUIAuthor(treeQueryObject); |
| | | HashMap<String,Tree> allTreeMap=new HashMap<>(); |
| | | Map<String,RoleRightVO> roleRightVOMap=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 ->roleRightVO)); |
| | | 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(); |
| | | getSelectedRoleRightObjs(uiAuthorDTO.getRoleId(),selectTreeList,allTreeMap,roleRightDTOList); |
| | | 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(); |
| | | info.modules="UIææ"; |
| | | info.userName=currentUserName; |
| | | try { |
| | | res= platformClientUtil.getFrameworkService().saveRoleRight(roleRightInfoList.toArray(new RoleRightInfo[]{}),uiAuthorDTO.getRoleId(),currentUserName,info); |
| | | }catch (PLException e){ |
| | | throw new Exception("ä¿å失败ï¼"+e.getMessage()); |
| | | } |
| | | } |
| | | return res; |
| | | } |
| | | |
| | | /** |
| | | * |
| | | *æ ¹æ®æé计ç®ä¸ä¸æé |
| | | * @param roleOid |
| | | * @param selectTreeList |
| | | * @param allTreeMap |
| | | * @param roleRightDTOList |
| | | */ |
| | | private void getSelectedRoleRightObjs(String roleOid,List<Tree> selectTreeList,HashMap<String,Tree> allTreeMap, List<RoleRightDTO> 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<>(); |
| | | selectTreeList.stream().forEach(tree -> { |
| | | RoleRightDTO roleRightDTO=new RoleRightDTO(); |
| | | String id=ObjectUtility.getNewObjectID36(); |
| | | Object data= tree.getData(); |
| | | if(data instanceof String){ |
| | | getRightValue(roleOid,tree,allTreeMap,false,roleRightDTOMap);//åä¸è·åæææ¨¡åçæéå¼ |
| | | }else if (!(data instanceof PLTabButton)) {//ä¸å¡ç±»å |
| | | getRightValue(roleOid,tree,allTreeMap,true,roleRightDTOMap);//åä¸å¤ç |
| | | getRightValue(roleOid,tree,allTreeMap,false,roleRightDTOMap);//åä¸å¤çï¼å
å«å½åèç¹ï¼ |
| | | }else if (data instanceof PLTabButton) {//æé® |
| | | if(!CollectionUtil.isEmpty(selectTreeList)){ |
| | | selectTreeList.stream().forEach(tree -> { |
| | | String oid=tree.getOid(); |
| | | if(allTreeMap.containsKey(oid)){ |
| | | tree= allTreeMap.get(oid); |
| | | Object data= tree.getData(); |
| | | if (data instanceof String) { |
| | | getRightValue(roleOid, tree, allTreeMap, false, roleRightDTOMap);//åä¸è·åæææ¨¡åçæéå¼ |
| | | } else if (!(data instanceof PLTabButton)) {//ä¸å¡ç±»å |
| | | getRightValue(roleOid, tree, allTreeMap, true, roleRightDTOMap);//åä¸å¤ç |
| | | getRightValue(roleOid, tree, allTreeMap, false, roleRightDTOMap);//åä¸å¤çï¼å
å«å½åèç¹ï¼ |
| | | } else if (data instanceof PLTabButton) {//æé® |
| | | String parrentId=tree.getParentId(); |
| | | if(allTreeMap.containsKey(parrentId)){ |
| | | SessionInfo sessionInfo = WebThreadLocalUtil.getCurrentUserSessionInfoInThread(); |
| | | String currentUserName = sessionInfo.getUserId(); |
| | | boolean isDeveloper= rightControlUtil.isDeveloper(currentUserName); |
| | | Tree parentNode= allTreeMap.get(parrentId); |
| | | String funcId = parentNode.getOid(); |
| | | 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 |
| | | }else{ |
| | | roleRightDTO.setRightType((short) 2); |
| | | } |
| | | roleRightDTO.setRightValue(1);// æéå¼ï¼æ²¡ææä½ç模åæéå¼åå¨ä¸º0 |
| | | roleRightDTO.setRoleId(roleOid);//è§è²ID |
| | | roleRightDTO.setCreateUser(currentUserName);//å建è
|
| | | roleRightDTO.setCreateTime(VciDateUtil.date2Str(new Date(),""));//å建æ¶é´ |
| | | roleRightDTO.setModifyUser(currentUserName);//ä¿®æ¹è
|
| | | roleRightDTO.setModifyTime(VciDateUtil.date2Str(new Date(),""));//ä¿®æ¹æ¶é´ |
| | | roleRightDTO.setLicensor(""); |
| | | if(!roleRightDTOMap.containsKey(funcId)){ |
| | | roleRightDTOMap.put(funcId, roleRightDTO); |
| | | } |
| | | roleRightDTOMap.put(funcId, roleRightDTO); |
| | | } |
| | | } |
| | | |
| | | } |
| | | }); |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | | }); |
| | | /* 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()); |
| | | roleRightDTOList.addAll(newRoleRightDTOList); |
| | | } |
| | | } |
| | | |
| | | /** |
| | |
| | | SessionInfo sessionInfo = WebThreadLocalUtil.getCurrentUserSessionInfoInThread(); |
| | | String currentUserName = sessionInfo.getUserId(); |
| | | boolean isDeveloper= rightControlUtil.isDeveloper(currentUserName); |
| | | String parentOid=node.getParentId(); |
| | | if(allTreeMap.containsKey(parentOid)){ |
| | | String id=ObjectUtility.getNewObjectID36(); |
| | | Tree parentNode =allTreeMap.get(parentOid); |
| | | Object parentData= parentNode.getData(); |
| | | if(isUp) {//åä¸è·åï¼å卿¯ä¸ªä¸çº§æ¨¡åçæéå¼ |
| | | while (!"root".equals(parentNode.getData())){ |
| | | String id=ObjectUtility.getNewObjectID36(); |
| | | Object data=node.getData(); |
| | | if(isUp) {//åä¸è·åï¼å卿¯ä¸ªä¸çº§æ¨¡åçæéå¼ |
| | | while (!"root".equals(node.getData())){ |
| | | data=node.getData(); |
| | | String oid=node.getOid(); |
| | | if(allTreeMap.containsKey(oid)){ |
| | | String funcId = ""; |
| | | if (parentData instanceof BizType) { |
| | | BizType bizType = (BizType) parentData; |
| | | if (data instanceof BizType) { |
| | | BizType bizType = (BizType) data; |
| | | funcId = bizType.name; |
| | | } else if (parentData instanceof PLUILayout) { |
| | | PLUILayout context = (PLUILayout)parentData; |
| | | } else if (data instanceof PLUILayout) { |
| | | PLUILayout context = (PLUILayout)data; |
| | | funcId = context.plOId; |
| | | } else if (parentData instanceof PLTabPage) { |
| | | PLTabPage tab = (PLTabPage) parentData; |
| | | } else if (data instanceof PLTabPage) { |
| | | PLTabPage tab = (PLTabPage) data; |
| | | funcId = tab.plOId; |
| | | } else if (parentData instanceof PLPageDefination){ |
| | | PLPageDefination pageDef = (PLPageDefination) parentData; |
| | | } else if (data instanceof PLPageDefination){ |
| | | PLPageDefination pageDef = (PLPageDefination) data; |
| | | funcId = pageDef.plOId; |
| | | } else if (parentData instanceof PLTabButton) { |
| | | PLTabButton but = (PLTabButton)parentData; |
| | | } else if (data instanceof PLTabButton) { |
| | | PLTabButton but = (PLTabButton)data; |
| | | funcId = but.plOId; |
| | | } |
| | | RoleRightDTO roleRightDTO = new RoleRightDTO(); |
| | |
| | | roleRightDTO.setRightValue(1);// æéå¼ï¼æ²¡ææä½ç模åæéå¼åå¨ä¸º0 |
| | | roleRightDTO.setRoleId(roleId);//è§è²ID |
| | | roleRightDTO.setCreateUser(currentUserName);//å建è
|
| | | roleRightDTO.setCreateTime(new Date());//å建æ¶é´ |
| | | roleRightDTO.setCreateTime(VciDateUtil.date2Str(new Date(),""));//å建æ¶é´ |
| | | roleRightDTO.setModifyUser(currentUserName);//ä¿®æ¹è
|
| | | roleRightDTO.setModifyTime(new Date());//ä¿®æ¹æ¶é´ |
| | | roleRightDTO.setModifyTime(VciDateUtil.date2Str(new Date(),""));//ä¿®æ¹æ¶é´ |
| | | roleRightDTO.setLicensor(""); |
| | | if(!rightMap.containsKey(funcId)){ |
| | | rightMap.put(funcId, roleRightDTO); |
| | | } |
| | | } |
| | | }else{ |
| | | String funcId = ""; |
| | | if(parentData instanceof String){ |
| | | funcId = (String)parentData; |
| | | } else if (parentData instanceof BizType) { |
| | | BizType bizType = (BizType)parentData; |
| | | funcId = bizType.name; |
| | | } else if (parentData instanceof PLUILayout) { |
| | | PLUILayout context = (PLUILayout)parentData; |
| | | funcId = context.plOId; |
| | | } else if (parentData instanceof PLTabPage) { |
| | | PLTabPage tab = (PLTabPage) parentData; |
| | | funcId = tab.plOId; |
| | | } else if (parentData instanceof PLPageDefination){ |
| | | PLPageDefination pageDef = (PLPageDefination) parentData; |
| | | funcId = pageDef.plOId; |
| | | } else if (parentData instanceof PLTabButton) { |
| | | PLTabButton but = (PLTabButton)parentData; |
| | | funcId = but.plOId; |
| | | } |
| | | if(!(parentData instanceof PLPageDefination)) {//åèç¹ä¸æ¯æä½ |
| | | if(!rightMap.containsKey(funcId)&&!funcId.equals("root")){ |
| | | RoleRightDTO roleRightDTO = new RoleRightDTO(); |
| | | roleRightDTO.setFuncId(funcId); |
| | | if(isDeveloper) { |
| | | roleRightDTO.setRightType((short) 1);//æéç±»å æéç±»åï¼è¶
级管çåç»ç®¡çåææä¸º1ï¼ç®¡çåç»æ®éç¨æ·ææä¸º2 |
| | | }else{ |
| | | roleRightDTO.setRightType((short) 2); |
| | | } |
| | | roleRightDTO.setRightValue(0);//没ææä½ç模åæéå¼åå¨ä¸º0 |
| | | roleRightDTO.setRoleId(roleId); |
| | | roleRightDTO.setCreateUser(currentUserName); |
| | | roleRightDTO.setCreateTime(new Date()); |
| | | roleRightDTO.setModifyUser(currentUserName); |
| | | roleRightDTO.setModifyTime(new Date()); |
| | | roleRightDTO.setLicensor(""); |
| | | rightMap.put(funcId, roleRightDTO); |
| | | } |
| | | for(int i = 0;i < parentNode.getChildren().size();i++){ |
| | | //对æ¯ä¸ªååä¸éå½éå |
| | | getRightValue(roleId,parentNode.getChildren().get(i),allTreeMap,false,rightMap); |
| | | } |
| | | }else { |
| | | if(!rightMap.containsKey(funcId)){ |
| | | RoleRightDTO roleRightDTO = new RoleRightDTO(); |
| | | roleRightDTO.setFuncId(funcId); |
| | | roleRightDTO.setRightType((short)2); // 设置UIæé |
| | | roleRightDTO.setRightValue(countRightValue(parentNode,true));//没ææä½ç模åæéå¼åå¨ä¸º0 |
| | | roleRightDTO.setRoleId(roleId); |
| | | |
| | | roleRightDTO.setCreateUser(currentUserName); |
| | | roleRightDTO.setCreateTime(new Date()); |
| | | roleRightDTO.setModifyUser(currentUserName); |
| | | roleRightDTO.setModifyTime(new Date()); |
| | | roleRightDTO.setLicensor(""); |
| | | rightMap.put(funcId, roleRightDTO); |
| | | oid= node.getParentId(); |
| | | if(allTreeMap.containsKey(oid)) { |
| | | node=allTreeMap.get(oid); |
| | | } |
| | | } |
| | | } |
| | | }else { |
| | | String funcId = ""; |
| | | if (data instanceof String) { |
| | | funcId = (String) data; |
| | | } else if (data instanceof BizType) { |
| | | BizType bizType = (BizType) data; |
| | | funcId = bizType.name; |
| | | } else if (data instanceof PLUILayout) { |
| | | PLUILayout context = (PLUILayout) data; |
| | | funcId = context.plOId; |
| | | } else if (data instanceof PLTabPage) { |
| | | PLTabPage tab = (PLTabPage) data; |
| | | funcId = tab.plOId; |
| | | } else if (data instanceof PLPageDefination) { |
| | | PLPageDefination pageDef = (PLPageDefination) data; |
| | | funcId = pageDef.plOId; |
| | | } else if (data instanceof PLTabButton) { |
| | | PLTabButton but = (PLTabButton) data; |
| | | funcId = but.plOId; |
| | | } |
| | | if (!(data instanceof PLPageDefination)) {//åèç¹ä¸æ¯æä½ |
| | | if (!rightMap.containsKey(funcId) && !funcId.equals("root")) { |
| | | RoleRightDTO roleRightDTO = new RoleRightDTO(); |
| | | roleRightDTO.setFuncId(funcId); |
| | | if (isDeveloper) { |
| | | roleRightDTO.setRightType((short) 1);//æéç±»å æéç±»åï¼è¶
级管çåç»ç®¡çåææä¸º1ï¼ç®¡çåç»æ®éç¨æ·ææä¸º2 |
| | | } else { |
| | | roleRightDTO.setRightType((short) 2); |
| | | } |
| | | roleRightDTO.setRightValue(0);//没ææä½ç模åæéå¼åå¨ä¸º0 |
| | | roleRightDTO.setRoleId(roleId); |
| | | roleRightDTO.setCreateUser(currentUserName); |
| | | roleRightDTO.setCreateTime(VciDateUtil.date2Str(new Date(),"")); |
| | | roleRightDTO.setModifyUser(currentUserName); |
| | | roleRightDTO.setModifyTime(VciDateUtil.date2Str(new Date(),"")); |
| | | roleRightDTO.setLicensor(""); |
| | | rightMap.put(funcId, roleRightDTO); |
| | | } |
| | | for (int i = 0; i < node.getChildren().size(); i++) { |
| | | //对æ¯ä¸ªååä¸éå½éå |
| | | getRightValue(roleId, node.getChildren().get(i), allTreeMap, false, rightMap); |
| | | } |
| | | } else { |
| | | if (!rightMap.containsKey(funcId)) { |
| | | RoleRightDTO roleRightDTO = new RoleRightDTO(); |
| | | roleRightDTO.setFuncId(funcId); |
| | | roleRightDTO.setRightType((short) 2); // 设置UIæé |
| | | roleRightDTO.setRightValue(countRightValue(node, true));//没ææä½ç模åæéå¼åå¨ä¸º0 |
| | | roleRightDTO.setRoleId(roleId); |
| | | |
| | | roleRightDTO.setCreateUser(currentUserName); |
| | | roleRightDTO.setCreateTime(VciDateUtil.date2Str(new Date(),"")); |
| | | roleRightDTO.setModifyUser(currentUserName); |
| | | roleRightDTO.setModifyTime(VciDateUtil.date2Str(new Date(),"")); |
| | | roleRightDTO.setLicensor(""); |
| | | rightMap.put(funcId, roleRightDTO); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | }); |
| | | } |
| | | |
| | | /*** |
| | | * éååèç¹ |
| | | * @param parentTree |
| | | * @param contextList |
| | | * @param roleRightVOMap |
| | | * @param isShowCheckBox |
| | | */ |
| | | private void setChildNode(List<Tree> parentTree, List<PLUILayout>contextList,Map<String,RoleRightVO> roleRightVOMap,boolean isShowCheckBox){ |
| | | Optional.ofNullable(parentTree).orElseGet(()->new ArrayList<Tree>()).stream().forEach(pTree -> { |
| | | Object funcObj= pTree.getData(); |
| | |
| | | }); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * UIè§è²å¯¹è±¡è½¬æ¢ |
| | | * @param vos |
| | | * @return |
| | | */ |
| | | private List<RoleRightDTO> roleRightVOO2DTOS(List<RoleRightVO> vos){ |
| | | List<RoleRightDTO> roleRightVOS=new ArrayList<>(); |
| | | Optional.ofNullable(vos).orElseGet(()->new ArrayList<>()).stream().forEach(vo -> { |
| | | RoleRightDTO dto=roleRightVOO2DTO(vo); |
| | | roleRightVOS.add(dto); |
| | | }); |
| | | |
| | | return roleRightVOS; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * UIè§è²å¯¹è±¡è½¬æ¢ |
| | | * @param infos |
| | |
| | | |
| | | return roleRightVOS; |
| | | } |
| | | /** |
| | | * UIè§è²å¯¹è±¡è½¬æ¢ |
| | | * @param dtos |
| | | * @return |
| | | */ |
| | | private List<RoleRightInfo> roleRightDTOO2InfoS(List<RoleRightDTO> dtos){ |
| | | List<RoleRightInfo> roleRightInfoList=new ArrayList<>(); |
| | | Optional.ofNullable(dtos).orElseGet(()->new ArrayList<>()).stream().forEach(dto -> { |
| | | RoleRightInfo info= null; |
| | | try { |
| | | info = roleRightDTOO2Info(dto); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | roleRightInfoList.add(info); |
| | | }); |
| | | |
| | | return roleRightInfoList; |
| | | } |
| | | /** |
| | | * UIè§è²å¯¹è±¡è½¬æ¢ |
| | | * @param info |
| | |
| | | vo.setModifyTime(VciDateUtil.date2Str(VciDateUtil.long2Date(info.modifyTime),"")); |
| | | vo.setModifyUser(info.modifyUser); |
| | | return vo; |
| | | } |
| | | /** |
| | | * UIè§è²å¯¹è±¡è½¬æ¢ |
| | | * @param vo |
| | | * @return |
| | | */ |
| | | private RoleRightDTO roleRightVOO2DTO(RoleRightVO vo){ |
| | | RoleRightDTO dto=new RoleRightDTO(); |
| | | dto.setId(vo.getId()); |
| | | dto.setCreateTime(vo.getCreateTime()); |
| | | dto.setCreateUser(vo.getCreateUser()); |
| | | dto.setRoleId(vo.getRoleId()); |
| | | dto.setRightType(vo.getRightType()); |
| | | dto.setLicensor(vo.getLicensor()); |
| | | dto.setRightValue(vo.getRightValue()); |
| | | dto.setFuncId(vo.getFuncId()); |
| | | dto.setModifyTime(vo.getModifyTime()); |
| | | dto.setModifyUser(vo.getModifyUser()); |
| | | return dto; |
| | | } |
| | | |
| | | /** |
| | | * UIè§è²å¯¹è±¡è½¬æ¢ |
| | | * @param dto |
| | | * @return |
| | | */ |
| | | private RoleRightInfo roleRightDTOO2Info(RoleRightDTO dto) throws Exception { |
| | | RoleRightInfo info=new RoleRightInfo(); |
| | | info.id=StringUtils.isBlank(dto.getId())?"":dto.getId(); |
| | | info.createTime=StringUtils.isBlank(dto.getCreateTime())?new Date().getTime():VciDateUtil.getTime(VciDateUtil.str2Date(dto.getCreateTime(),"")); |
| | | info.createUser=StringUtils.isBlank(dto.getCreateUser())?"":dto.getCreateUser(); |
| | | info.roleId=StringUtils.isBlank(dto.getRoleId())?"":dto.getRoleId(); |
| | | info.rightType=dto.getRightType(); |
| | | info.licensor =StringUtils.isBlank(dto.getLicensor())?"":dto.getLicensor(); |
| | | info.rightValue=dto.getRightValue(); |
| | | info.funcId=StringUtils.isBlank(dto.getFuncId())?"":dto.getFuncId(); |
| | | info.modifyTime=StringUtils.isBlank(dto.getModifyTime())? new Date().getTime() :VciDateUtil.getTime(VciDateUtil.str2Date(dto.getModifyTime(),"")); |
| | | info.modifyUser=StringUtils.isBlank(dto.getModifyUser())?"":dto.getModifyUser(); |
| | | return info; |
| | | } |
| | | |
| | | /** |
| | |
| | | } |
| | | } else { |
| | | // 龿¥ç±»å为空æ¶ï¼åªéè¦æ£æ¥ä¸å¡ç±»åä¸çæ¥è¯¢æ¨¡æ¿æ¯å¦ææ |
| | | if(!(super.checkQTNameTxtIsOk("æ¥è¯¢æ¨¡æ¿", queryTemplateName, btmType,true))){ |
| | | if(!(super.checkQTNameTxtIsOk("æ¥è¯¢æ¨¡æ¿", queryTemplateName, btmType))){ |
| | | res = false; |
| | | return res; |
| | | } |