| | |
| | | |
| | | 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 com.vci.corba.portal.data.*; |
| | | import com.vci.dto.RoleRightDTO; |
| | | import com.vci.dto.UIAuthorDTO; |
| | | import com.vci.frameworkcore.compatibility.SmRoleQueryServiceI; |
| | | import com.vci.model.PLDefination; |
| | | import com.vci.pagemodel.*; |
| | | import com.vci.starter.poi.bo.*; |
| | | import com.vci.starter.poi.util.ExcelUtil; |
| | | import com.vci.starter.web.exception.VciBaseException; |
| | | import com.vci.starter.web.pagemodel.*; |
| | | import com.vci.starter.web.pagemodel.BaseQueryObject; |
| | | import com.vci.starter.web.pagemodel.BaseResult; |
| | | import com.vci.starter.web.pagemodel.DataGrid; |
| | | import com.vci.starter.web.pagemodel.SessionInfo; |
| | | import com.vci.starter.web.util.VciBaseUtil; |
| | | import com.vci.starter.web.util.VciDateUtil; |
| | | import com.vci.starter.web.util.WebThreadLocalUtil; |
| | | import com.vci.starter.web.util.*; |
| | | import com.vci.web.redis.RedisService; |
| | | import com.vci.web.service.OsBtmServiceI; |
| | | import com.vci.web.service.UIManagerServiceI; |
| | | import com.vci.web.util.*; |
| | | import com.vci.web.util.BeanUtil; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import com.vci.web.util.Func; |
| | | import com.vci.web.util.PlatformClientUtil; |
| | |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import javax.swing.*; |
| | | import javax.swing.tree.TreePath; |
| | | import java.io.IOException; |
| | | import java.io.File; |
| | | import java.util.*; |
| | | import java.util.concurrent.TimeUnit; |
| | | import java.util.concurrent.atomic.AtomicInteger; |
| | | import java.util.stream.Collectors; |
| | | import java.util.regex.Pattern; |
| | | |
| | |
| | | @Resource |
| | | private PlatformClientUtil platformClientUtil; |
| | | |
| | | /** |
| | | * ç¼åå·¥å
· |
| | | */ |
| | | @Resource |
| | | private RedisService redisService; |
| | | |
| | | /*** |
| | | * æ¯å¦æ¯ç®¡çå |
| | | */ |
| | |
| | | * æ¥å¿ |
| | | */ |
| | | private Logger logger = LoggerFactory.getLogger(getClass()); |
| | | |
| | | /** |
| | | * 导å
¥æ°æ®çsheetéå |
| | | */ |
| | | private final String IMPORTUIKEY = "importUIKey:"; |
| | | |
| | | /** |
| | | * æåºæ¯è¾å¨ |
| | |
| | | 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{ |
| | |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®å¾éçæ¡ä»¶è·åéè¦å¯¼åºçuiä¸ä¸ææ |
| | | * @param expDatas |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Tree getExpContextTree(List<String> expDatas) { |
| | | VciBaseUtil.alertNotNull(expDatas,"å¯¼åºæ¥è¯¢å表"); |
| | | Tree tree = new Tree(); |
| | | String newObjectID36 = ObjectUtility.getNewObjectID36(); |
| | | tree.setOid(newObjectID36); |
| | | tree.setText("åºå"); |
| | | tree.setLevel(0); |
| | | List<Tree> treeList = new ArrayList<>(); |
| | | expDatas.stream().forEach(oid->{ |
| | | try { |
| | | PLUILayout pluiLayout = platformClientUtil.getUIService().getPLUILayoutById(oid); |
| | | if(Func.isNotEmpty(pluiLayout) && Func.isNotBlank(pluiLayout.plOId)){ |
| | | Tree tree1 = new Tree(); |
| | | tree1.setText(pluiLayout.plName); |
| | | tree1.setOid(pluiLayout.plOId); |
| | | tree1.setLevel(1); |
| | | tree1.setParentId(newObjectID36); |
| | | //æ¥è¯¢ |
| | | PLTabPage[] plTabPages = platformClientUtil.getUIService().getPLTabPagesByPageDefinationOId(pluiLayout.plOId); |
| | | List<Tree> treeChildrens = new ArrayList<>(); |
| | | Arrays.stream(plTabPages).forEach(item->{ |
| | | Tree tree2 = new Tree(); |
| | | tree2.setLeaf(true); |
| | | tree2.setOid(item.plOId); |
| | | tree2.setText(item.plName); |
| | | tree2.setLevel(2); |
| | | tree2.setParentId(item.plContextOId); |
| | | treeChildrens.add(tree2); |
| | | }); |
| | | tree1.setChildren(treeChildrens); |
| | | treeList.add(tree1); |
| | | } |
| | | } catch (PLException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | }); |
| | | |
| | | tree.setChildren(treeList); |
| | | return tree; |
| | | } |
| | | |
| | | /** |
| | | * 导åºuiä¸ä¸æ(å¾éçè¦å¯¼åºçæ§å¶åºçæ°æ®) |
| | | * oids |
| | | * @return |
| | | */ |
| | | @Override |
| | | public void expUIContextData(String[] oids, HttpServletResponse response) throws PLException, IOException { |
| | | public String expUIContextData(Map<String,String> expConditionMap) throws PLException { |
| | | if(Func.isEmpty(expConditionMap)){ |
| | | throw new PLException("500",new String[]{"请å¾éè¦å¯¼åºçUIä¸ä¸ææ°æ®!"}); |
| | | } |
| | | //ç颿²¡ä¼ åç§°ï¼ä½¿ç¨é»è®¤å¯¼åºåç§° |
| | | String exportFileName = "UIä¸ä¸æå¯¼åº_" + Func.format(new Date(),"yyyy-MM-dd HHmmss.sss"); |
| | | //设置åå |
| | | /*List<String> columns = Arrays.asList( |
| | | "æå±ä¸å¡ç±»å","åç§°", "UIä¸ä¸æ", "导èªåº", "æ§å¶åº","æä½åº", |
| | | "页ç¾åºå·","åºåç¼ç ","åºååç§°","æ¯å¦å¯ç¨","æ¾ç¤ºè¡¨è¾¾å¼", "UIè§£æç±»", |
| | | "æ©å±å±æ§", "æè¿°","页é¢è®¾è®¡ä¿¡æ¯","页é¢ä¸é
ç½®çæé®" |
| | | );*/ |
| | | |
| | | //åexcel |
| | | String excelPath = LocalFileUtil.getDefaultTempFolder() + File.separator + exportFileName + ".xls"; |
| | | try { |
| | | new File(excelPath).createNewFile(); |
| | | } catch (Throwable e) { |
| | | throw new VciBaseException(LangBaseUtil.getErrorMsg(e), new String[]{excelPath}, e); |
| | | } |
| | | //设置å |
| | | List<WriteExcelData> pldDataList = new ArrayList<>(); |
| | | List<WriteExcelData> tpDataList = new ArrayList<>(); |
| | | List<WriteExcelData> pdDataList = new ArrayList<>(); |
| | | List<WriteExcelData> tbDataList = new ArrayList<>(); |
| | | List<WriteExcelData> cpDataList = new ArrayList<>(); |
| | | //设置å头 |
| | | /*for (int index = 0; index < columns.size(); index++) { |
| | | excelDataList.add(new WriteExcelData(0,index, columns.get(index))); |
| | | }*/ |
| | | AtomicInteger pldRow = new AtomicInteger(0); |
| | | AtomicInteger tpRow = new AtomicInteger(0); |
| | | AtomicInteger pdRow = new AtomicInteger(0); |
| | | AtomicInteger tbRow = new AtomicInteger(0); |
| | | AtomicInteger cpRow = new AtomicInteger(0); |
| | | |
| | | expConditionMap.entrySet().stream().forEach(item->{ |
| | | //keyåæ¾çuiä¸ä¸æçid |
| | | try { |
| | | PLUILayout pluiLayout = platformClientUtil.getUIService().getPLUILayoutById(item.getKey()); |
| | | pldDataList.add(new WriteExcelData(pldRow.get(),0, pluiLayout.plOId)); |
| | | pldDataList.add(new WriteExcelData(pldRow.get(),1, pluiLayout.plCode)); |
| | | pldDataList.add(new WriteExcelData(pldRow.get(),2, pluiLayout.plName)); |
| | | pldDataList.add(new WriteExcelData(pldRow.get(),3, pluiLayout.plRelatedType)); |
| | | pldDataList.add(new WriteExcelData(pldRow.get(),4, pluiLayout.plIsShowForm)); |
| | | pldDataList.add(new WriteExcelData(pldRow.get(),5, pluiLayout.plIsShowNavigator)); |
| | | pldDataList.add(new WriteExcelData(pldRow.get(),6, pluiLayout.plIsShowTab)); |
| | | pldRow.getAndIncrement(); |
| | | |
| | | //valueä¸åæ¾çå¤ä¸ªä»¥éå·é´éç页ç¾id,éè¿è¿ä¸ªidæ¥è¯¢åºå
¶ä¸ç页é¢è®¾è®¡åæé®é
ç½® |
| | | List<String> plTabPageOIds = Arrays.asList(item.getValue().split(",")); |
| | | if(Func.isNotEmpty(pluiLayout) && Func.isNotBlank(pluiLayout.plOId) && Func.isNotEmpty(plTabPageOIds)){ |
| | | PLTabPage[] plTabPages = platformClientUtil.getUIService().getPLTabPagesByPageDefinationOId(pluiLayout.plOId); |
| | | List<PLTabPage> filterTabPages = Arrays.stream(plTabPages).filter(plTabPage -> plTabPageOIds.contains(plTabPage.plOId)).collect(Collectors.toList()); |
| | | filterTabPages.stream().forEach(tabPage->{ |
| | | //åºåå®ä¹ |
| | | tpDataList.add(new WriteExcelData(tpRow.get(),0, tabPage.plOId)); |
| | | tpDataList.add(new WriteExcelData(tpRow.get(),1, tabPage.plSeq)); |
| | | tpDataList.add(new WriteExcelData(tpRow.get(),2, tabPage.plCode)); |
| | | tpDataList.add(new WriteExcelData(tpRow.get(),3, tabPage.plLabel)); |
| | | tpDataList.add(new WriteExcelData(tpRow.get(),4, tabPage.plName)); |
| | | tpDataList.add(new WriteExcelData(tpRow.get(),5, tabPage.plContextOId)); |
| | | tpDataList.add(new WriteExcelData(tpRow.get(),6, tabPage.plAreaType)); |
| | | tpDataList.add(new WriteExcelData(tpRow.get(),7, tabPage.plIsOpen)); |
| | | tpDataList.add(new WriteExcelData(tpRow.get(),8, tabPage.plOpenExpression)); |
| | | tpDataList.add(new WriteExcelData(tpRow.get(),9, tabPage.plUIParser)); |
| | | tpDataList.add(new WriteExcelData(tpRow.get(),10, tabPage.plExtAttr)); |
| | | tpDataList.add(new WriteExcelData(tpRow.get(),11, tabPage.plDesc)); |
| | | tpDataList.add(new WriteExcelData(tpRow.get(),12, tabPage.plLicensOrs)); |
| | | tpRow.getAndIncrement(); |
| | | try { |
| | | PLPageDefination[] plPageDefinations = platformClientUtil.getUIService().getPLPageDefinationsByPageContextOId(tabPage.plOId); |
| | | if(Func.isNotEmpty(plPageDefinations)){ |
| | | //List<PLTabButtonVO> tabButtonsTotal = new ArrayList<>(); |
| | | Arrays.stream(plPageDefinations).forEach(plPageDefination->{ |
| | | pdDataList.add(new WriteExcelData(pdRow.get(),0, plPageDefination.plOId)); |
| | | pdDataList.add(new WriteExcelData(pdRow.get(),1, plPageDefination.plTabPageOId)); |
| | | pdDataList.add(new WriteExcelData(pdRow.get(),2, plPageDefination.plType)); |
| | | pdDataList.add(new WriteExcelData(pdRow.get(),3, plPageDefination.name)); |
| | | pdDataList.add(new WriteExcelData(pdRow.get(),4, plPageDefination.desc)); |
| | | pdDataList.add(new WriteExcelData(pdRow.get(),5, plPageDefination.seq)); |
| | | pdDataList.add(new WriteExcelData(pdRow.get(),6, plPageDefination.plDefination)); |
| | | pdRow.getAndIncrement(); |
| | | //æ¥è¯¢æé® |
| | | try { |
| | | PLTabButton[] tabButtons = platformClientUtil.getUIService().getPLTabButtonsByTableOId(plPageDefination.plOId); |
| | | for (PLTabButton tabButton:tabButtons){ |
| | | tbDataList.add(new WriteExcelData(tbRow.get(),0, tabButton.plOId)); |
| | | tbDataList.add(new WriteExcelData(tbRow.get(),1, tabButton.plTableOId)); |
| | | tbDataList.add(new WriteExcelData(tbRow.get(),2, tabButton.plPageOId)); |
| | | tbDataList.add(new WriteExcelData(tbRow.get(),3, tabButton.plActionOId)); |
| | | tbDataList.add(new WriteExcelData(tbRow.get(),4, tabButton.plLabel)); |
| | | tbDataList.add(new WriteExcelData(tbRow.get(),5, tabButton.plAreaType)); |
| | | tbDataList.add(new WriteExcelData(tbRow.get(),6, tabButton.plDesc)); |
| | | tbDataList.add(new WriteExcelData(tbRow.get(),7, tabButton.plSeq)); |
| | | tbDataList.add(new WriteExcelData(tbRow.get(),8, tabButton.plParentOid)); |
| | | tbDataList.add(new WriteExcelData(tbRow.get(),9, tabButton.displayMode)); |
| | | tbDataList.add(new WriteExcelData(tbRow.get(),10, tabButton.iconPath)); |
| | | tbDataList.add(new WriteExcelData(tbRow.get(),11, tabButton.authorization)); |
| | | tbDataList.add(new WriteExcelData(tbRow.get(),12, tabButton.show)); |
| | | tbRow.getAndIncrement(); |
| | | PLCommandParameter[] parameters = platformClientUtil.getUIService().getPLCommandParametersByCommandOId(tabButton.plOId); |
| | | if(Func.isNotEmpty(parameters)){ |
| | | Arrays.stream(parameters).forEach(param->{ |
| | | cpDataList.add(new WriteExcelData(cpRow.get(),0, param.plOId)); |
| | | cpDataList.add(new WriteExcelData(cpRow.get(),1, param.plCommandOId)); |
| | | cpDataList.add(new WriteExcelData(cpRow.get(),2, param.plKey)); |
| | | cpDataList.add(new WriteExcelData(cpRow.get(),3, param.plValue)); |
| | | cpRow.getAndIncrement(); |
| | | }); |
| | | } |
| | | } |
| | | } catch (PLException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | }); |
| | | } |
| | | } catch (PLException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | }); |
| | | } |
| | | } catch (PLException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | }); |
| | | WriteExcelOption excelOption = new WriteExcelOption(); |
| | | excelOption.addSheetDataList("PlpageLayoutDefnation",pldDataList); |
| | | excelOption.addSheetDataList("Pltabpage",tpDataList); |
| | | excelOption.addSheetDataList("Plpagedefination",pdDataList); |
| | | excelOption.addSheetDataList("Pltabbutton",tbDataList); |
| | | excelOption.addSheetDataList("PlcommondParam",cpDataList); |
| | | ExcelUtil.writeDataToFile(excelPath, excelOption); |
| | | return excelPath; |
| | | } |
| | | |
| | | /** |
| | | * 导å
¥UIä¸ä¸æ |
| | | * @param file |
| | | * @param isCovered æ¯å¦è¦ç |
| | | * @param selectBtm éæ©çä¸å¡ç±»å |
| | | * @return |
| | | */ |
| | | @Override |
| | | public BaseResult impUIContextData(MultipartFile file) { |
| | | return null; |
| | | public BaseResult impUIContextData(File file,boolean isCovered,String selectBtm) { |
| | | if(!isCovered){ |
| | | VciBaseUtil.alertNotNull(file,"excelæä»¶"); |
| | | if(!file.exists()){ |
| | | throw new VciBaseException("导å
¥çexcelæä»¶ä¸åå¨,{0}",new String[]{file.getPath()}); |
| | | } |
| | | } |
| | | |
| | | try { |
| | | List<SheetDataSet> sheetDataSets = null; |
| | | SessionInfo sessionInfo = WebThreadLocalUtil.getCurrentUserSessionInfoInThread(); |
| | | //æ¯è¦çæä½ï¼æä»¥ç´æ¥è¯»å |
| | | if(isCovered){ |
| | | sheetDataSets = redisService.getCacheList(IMPORTUIKEY + sessionInfo.getUserId()); |
| | | if(Func.isEmpty(sheetDataSets)){ |
| | | throw new VciBaseException("ä»ç¼å䏿ªè·åå°å¯¼å
¥çæ°æ®ï¼è¯·å·æ°åéè¯ï¼ï¼"); |
| | | } |
| | | }else{ |
| | | //读åexcel表 |
| | | ReadExcelOption readExcelOption = new ReadExcelOption(); |
| | | readExcelOption.setReadAllSheet(true); //读åå
¨é¨çsheet |
| | | sheetDataSets = ExcelUtil.readDataObjectFromExcel(file,SheetDataSet.class,readExcelOption); |
| | | } |
| | | |
| | | PLUILayout[] plpagelayoutdefinations = null; |
| | | |
| | | SheetDataSet plpagelayoutdefnationsheet = sheetDataSets.get(0); |
| | | SheetDataSet pltabpagesheet = sheetDataSets.get(1); |
| | | SheetDataSet plpagedefinationsheet = sheetDataSets.get(2); |
| | | SheetDataSet pltabbuttonsheet = sheetDataSets.get(3); |
| | | SheetDataSet plcommondparamsheet = sheetDataSets.get(4); |
| | | |
| | | Map<PLUILayout,List<PLTabPage>> pdMap = new HashMap<>(); |
| | | Map<PLTabPage,List<PLPageDefination>> tdMap = new HashMap<>(); |
| | | Map<PLPageDefination,List<PLTabButton>> dbMap = new HashMap<>(); |
| | | Map<PLTabButton,List<PLCommandParameter>> bcMap = new HashMap<>(); |
| | | |
| | | List<PLUILayout> plpagelayoutdefinationList = new ArrayList<>(); |
| | | List<PLTabPage> pltabpagelist = new ArrayList<>(); |
| | | List<PLPageDefination> plpagedefinationlist = new ArrayList<>(); |
| | | List<PLTabButton> pltabbuttonlist = new ArrayList<>(); |
| | | List<PLCommandParameter> plcommandparameterlist = new ArrayList<>(); |
| | | |
| | | /*StringBuffer checkplpagelayoutdefination = new StringBuffer(); |
| | | StringBuffer checkplpagelayoutdefinationPlcode = new StringBuffer();*/ |
| | | StringBuffer plActionIDNulls = new StringBuffer(); |
| | | |
| | | //add by caill start åå§åæ è®° |
| | | int count=0; |
| | | int preCount=0; |
| | | String preOID=""; |
| | | String doublePreOID=""; |
| | | String plpageLayoutDefinationId=""; |
| | | String plPageContextOId=""; |
| | | String plCommandOId=""; |
| | | String plTableOId=""; |
| | | |
| | | //add by caill end |
| | | PLAction[] allPLAction = platformClientUtil.getUIService().getAllPLAction(); |
| | | Map<String,String> relation = null; |
| | | List<SheetRowData> rowData = plpagelayoutdefnationsheet.getRowData(); |
| | | for(int i=0; i<rowData.size(); i++){ |
| | | pltabpagelist = new ArrayList<PLTabPage>(); |
| | | PLUILayout p = new PLUILayout(); |
| | | //HSSFRow readrow = plpagelayoutdefnationsheet.getRowData(); |
| | | Map<Integer, String> dataMap = rowData.get(i).getData(); |
| | | if(Func.isEmpty(dataMap)){ |
| | | break; |
| | | } |
| | | //æ ¹æ®ä¸å¡ç±»åæ¥è¯¢uiä¸ä¸æ |
| | | plpagelayoutdefinations = platformClientUtil.getUIService().getPLUILayoutsByRelatedType(selectBtm); |
| | | |
| | | p.plOId = ObjectUtility.getNewObjectID36(); |
| | | p.plCode = dataMap.get(1); |
| | | p.plName = dataMap.get(2); |
| | | //add by caill start |
| | | //éåUIåç§° |
| | | for(PLUILayout pd : plpagelayoutdefinations){ |
| | | if(pd.plName.equals(p.plName) && !isCovered){ |
| | | //å¦æç¨æ·éæ©è¦çï¼ç¬¬äºæ¬¡è°ç¨å°±ä¸ä¼ä¼ 导å
¥æä»¶ï¼æä»¥è¿éåå
¥ç¼å |
| | | redisService.setCacheList(IMPORTUIKEY+sessionInfo.getUserId(),sheetDataSets); |
| | | //è®¾ç½®è¿ææ¶é´ä¸º5åéï¼å 为ä¸è¬æ
åµä¸ä¸ä¼è¯´æ¯ç太ä¹
|
| | | redisService.expire(IMPORTUIKEY+sessionInfo.getUserId(),5, TimeUnit.MINUTES); |
| | | throw new VciBaseException(pd.plName+"åç§°å·²ç»åå¨,æ¯å¦è¦ç?"); |
| | | } |
| | | //æ ¹æ®UIä¸ä¸æå夿 |
| | | if(pd.plCode.equals(p.plCode)){ |
| | | count=1; |
| | | preOID=pd.plOId; //妿UIä¸ä¸æç¸åï¼å°±æç³»ç»ä¸çidèµå¼ç»æ°å¯¼å
¥çid |
| | | p.plOId=pd.plOId; |
| | | } |
| | | } |
| | | //add by caill end |
| | | plpageLayoutDefinationId = dataMap.get(0); |
| | | String name = dataMap.get(3); |
| | | p.plRelatedType = dataMap.get(3); |
| | | p.plIsShowNavigator = Short.parseShort(dataMap.get(4)); |
| | | p.plIsShowTab = Short.parseShort(dataMap.get(5)); |
| | | p.plIsShowForm = Short.parseShort(dataMap.get(6)); |
| | | //éæ©çå导å
¥çä¸å¡ç±»åèç¹ä¸ä¸è´ |
| | | if(!selectBtm.equals(name)){ |
| | | throw new VciBaseException("è¯·éæ©è¦å¯¼å
¥çç±»åèç¹åç§°ï¼"); |
| | | } |
| | | |
| | | plpagelayoutdefinationList.add(p); |
| | | |
| | | //åºåå®ä¹sheetå¤ç |
| | | List<SheetRowData> tabPageRowData = pltabpagesheet.getRowData(); |
| | | if(Func.isNotEmpty(tabPageRowData)){ |
| | | for(int j=0; j<tabPageRowData.size(); j++){ |
| | | plpagedefinationlist = new ArrayList<PLPageDefination>(); |
| | | PLTabPage pt = new PLTabPage(); |
| | | Map<Integer, String> tabPageDataMap = tabPageRowData.get(j).getData(); |
| | | if(Func.isEmpty(tabPageDataMap)){ |
| | | break; |
| | | } |
| | | pt.plOId = ObjectUtility.getNewObjectID36(); |
| | | pt.plCode = tabPageDataMap.get(2); |
| | | pt.plName = tabPageDataMap.get(4); |
| | | //add by caill start |
| | | if(count==1) { |
| | | PLTabPage[] PLTabPages = platformClientUtil.getUIService().getPLTabPagesByPageDefinationOId(preOID); |
| | | //éåæ§å¶åºè¡¨æ ¼ |
| | | for(PLTabPage pl : PLTabPages){ |
| | | if(pl.plCode.equals(pt.plCode)){ |
| | | pt.plOId=pl.plOId; //妿æ§å¶åºè¡¨æ ¼çç¼ç å导å
¥çç¼ç 䏿 ·ï¼å°±ææ§å¶åºidèµå¼ç»æ°å¯¼å
¥çid |
| | | preCount=1; |
| | | doublePreOID=pl.plOId; |
| | | } |
| | | } |
| | | } |
| | | //add by caill end |
| | | pt.plSeq = Short.parseShort(tabPageDataMap.get(1)); |
| | | pt.plLabel = tabPageDataMap.get(3); |
| | | pt.plContextOId = tabPageDataMap.get(5); |
| | | pt.plAreaType = Short.parseShort(tabPageDataMap.get(6)); |
| | | pt.plIsOpen = Short.parseShort(tabPageDataMap.get(7)); |
| | | pt.plOpenExpression = tabPageDataMap.get(8); |
| | | pt.plUIParser = tabPageDataMap.get(9); |
| | | pt.plExtAttr = tabPageDataMap.get(10); |
| | | pt.plDesc = tabPageDataMap.get(11); |
| | | pt.plLicensOrs = tabPageDataMap.get(12); |
| | | plPageContextOId = tabPageDataMap.get(5); |
| | | if(pt.plContextOId.equals(plpageLayoutDefinationId)){ |
| | | pt.plContextOId = p.plOId; |
| | | pltabpagelist.add(pt); |
| | | //页é¢è®¾è®¡å¤ç |
| | | List<SheetRowData> pagedefinationRowData = plpagedefinationsheet.getRowData(); |
| | | if(Func.isNotEmpty(pagedefinationRowData)){ |
| | | for(int k=0;k<pagedefinationRowData.size();k++){ |
| | | pltabbuttonlist = new ArrayList<>(); |
| | | PLPageDefination plpagedefination = new PLPageDefination(); |
| | | Map<Integer, String> pagedefinationDataMap = pagedefinationRowData.get(k).getData(); |
| | | |
| | | if(Func.isEmpty(pagedefinationDataMap)){ |
| | | break; |
| | | } |
| | | plpagedefination.plOId = ObjectUtility.getNewObjectID36(); |
| | | plpagedefination.name = pagedefinationDataMap.get(3); |
| | | //add by caill start |
| | | //æåä¸çº§ç夿 |
| | | if(preCount==1) { |
| | | PLPageDefination[] PLPageDefinations = platformClientUtil.getUIService().getPLPageDefinationsByPageContextOId(doublePreOID); |
| | | for(PLPageDefination plp : PLPageDefinations) { |
| | | if(plp.name.equals(plpagedefination.name)) { |
| | | plpagedefination.plOId=plp.plOId; |
| | | |
| | | } |
| | | |
| | | } |
| | | } |
| | | //add by caill end |
| | | plpagedefination.plDefination = pagedefinationDataMap.get(6); |
| | | plpagedefination.seq = Short.parseShort(pagedefinationDataMap.get(5)); |
| | | plpagedefination.plTabPageOId = pagedefinationDataMap.get(1); |
| | | plpagedefination.desc = pagedefinationDataMap.get(4); |
| | | plpagedefination.plType = Short.parseShort(pagedefinationDataMap.get(2)); |
| | | plTableOId = pagedefinationDataMap.get(1); |
| | | if(plpagedefination.plTabPageOId.equals(plPageContextOId)){ |
| | | plpagedefination.plTabPageOId = pt.plOId; |
| | | plpagedefinationlist.add(plpagedefination); |
| | | //ä¿åæ°æ§oidçå
³ç³»ï¼å¨ç¡®å®å±çº§å
³ç³»æ¶ä½¿ç¨ |
| | | relation = new HashMap<String,String>(); |
| | | List<SheetRowData> tabbuttonRowData = pltabbuttonsheet.getRowData(); |
| | | if(Func.isNotEmpty(tabbuttonRowData)){ |
| | | for(int a=0;a<tabbuttonRowData.size();a++){ |
| | | Map<Integer, String> tabbuttonDataMap = tabbuttonRowData.get(a).getData(); |
| | | if(Func.isNotEmpty(tabbuttonDataMap)){ |
| | | plCommandOId = tabbuttonDataMap.get(1); |
| | | String newOId = ObjectUtility.getNewObjectID36(); |
| | | relation.put(plCommandOId, newOId); |
| | | } |
| | | } |
| | | for(int a=0;a<tabbuttonRowData.size();a++){ |
| | | plcommandparameterlist = new ArrayList<PLCommandParameter>(); |
| | | PLTabButton plTabButton = new PLTabButton(); |
| | | Map<Integer, String> tabbuttonDataMap = tabbuttonRowData.get(a).getData(); |
| | | if(Func.isEmpty(tabbuttonDataMap)){ |
| | | break; |
| | | } |
| | | plTabButton.plOId = ObjectUtility.getNewObjectID36(); |
| | | plTabButton.plLabel = tabbuttonDataMap.get(4); |
| | | plTabButton.plAreaType = tabbuttonDataMap.get(5); |
| | | plTabButton.plTableOId = tabbuttonDataMap.get(1); |
| | | plTabButton.plSeq = Short.parseShort(tabbuttonDataMap.get(7)); |
| | | String plActionId = ""; |
| | | //PLAction[] allPLAction = Tool.getService().getAllPLAction(); |
| | | for(PLAction action : allPLAction){ |
| | | if((tabbuttonDataMap.get(3)!=null&&!"".equals(tabbuttonDataMap.get(3)) |
| | | )&&(tabbuttonDataMap.get(3).trim().equals(action.plCode.trim())) |
| | | ){ |
| | | plActionId = action.plOId; |
| | | break; |
| | | } |
| | | } |
| | | if(plActionId==null||"".equals(plActionId)){ |
| | | if(!plActionIDNulls.toString().contains(tabbuttonDataMap.get(3))){ |
| | | plActionIDNulls.append("\n\tActionç¼å·:"+tabbuttonDataMap.get(3)); |
| | | } |
| | | } |
| | | plTabButton.plActionOId = plActionId; |
| | | plTabButton.plAreaType = tabbuttonDataMap.get(5); |
| | | plTabButton.plDesc = tabbuttonDataMap.get(6); |
| | | String parentOid = tabbuttonDataMap.get(8);//ç¶oid |
| | | plCommandOId = tabbuttonDataMap.get(1); |
| | | plTabButton.displayMode = tabbuttonDataMap.get(9); |
| | | plTabButton.iconPath = tabbuttonDataMap.get(10); |
| | | plTabButton.authorization = tabbuttonDataMap.get(11); |
| | | plTabButton.show = tabbuttonDataMap.get(12); |
| | | |
| | | //èµäºä¿å好çå¼ï¼æ¥ä¿è¯å±çº§å
³ç³»ä¸ä¼ä¸¢å¤± |
| | | plTabButton.plOId = relation.get(plCommandOId); |
| | | if(parentOid != null && parentOid.length() > 0) { |
| | | plTabButton.plParentOid = |
| | | relation.get(parentOid) == null ? "" : relation.get(parentOid); |
| | | } |
| | | if(plTabButton.plTableOId.equals(plTableOId)){ |
| | | plTabButton.plTableOId = plpagedefination.plOId; |
| | | pltabbuttonlist.add(plTabButton); |
| | | List<SheetRowData> commondparamsRowData = plcommondparamsheet.getRowData(); |
| | | if(Func.isNotEmpty(commondparamsRowData)){ |
| | | for(int b=0;b<commondparamsRowData.size();b++){ |
| | | PLCommandParameter plCommandParameter = new PLCommandParameter(); |
| | | Map<Integer, String> commandParameterDataMap = commondparamsRowData.get(b).getData(); |
| | | if(Func.isEmpty(commandParameterDataMap)){ |
| | | break; |
| | | } |
| | | plCommandParameter.plOId = ObjectUtility.getNewObjectID36(); |
| | | plCommandParameter.plCommandOId = commandParameterDataMap.get(1); |
| | | plCommandParameter.plKey = commandParameterDataMap.get(2); |
| | | plCommandParameter.plValue = commandParameterDataMap.get(3); |
| | | if(plCommandParameter.plCommandOId.equals(plCommandOId)){ |
| | | plCommandParameter.plCommandOId = plTabButton.plOId; |
| | | plcommandparameterlist.add(plCommandParameter); |
| | | } |
| | | } |
| | | bcMap.put(plTabButton, plcommandparameterlist); |
| | | } |
| | | } |
| | | } |
| | | dbMap.put(plpagedefination, pltabbuttonlist); |
| | | } |
| | | } |
| | | } |
| | | tdMap.put(pt, plpagedefinationlist); |
| | | } |
| | | } |
| | | } |
| | | pdMap.put(p, pltabpagelist); |
| | | } |
| | | } |
| | | |
| | | if(plActionIDNulls.length()>0){ |
| | | throw new VciBaseException(plActionIDNulls.toString()+"ä¸åå¨ï¼"); |
| | | } |
| | | |
| | | //å é¤åæbuttonæ°æ® |
| | | if(tdMap.size() > 0) { |
| | | for(List<PLPageDefination> list : tdMap.values()) { |
| | | for(PLPageDefination ppd : list) { |
| | | if(ppd.plOId != null && ppd.plOId.length() > 0) { |
| | | PLTabButton[] buttons = platformClientUtil.getUIService().getPLTabButtonsByTableOId(ppd.plOId); |
| | | if(buttons != null && buttons.length > 0) { |
| | | for(PLTabButton ptb : buttons) { |
| | | platformClientUtil.getUIService().deletePLTabButtonByID(ptb.plOId); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | for(PLUILayout plPageLayoutDefination : plpagelayoutdefinationList){ |
| | | List<PLTabPage> pltabpagelists = pdMap.get(plPageLayoutDefination); |
| | | for(PLTabPage pltabpage:pltabpagelists){ |
| | | List<PLPageDefination> plpagedefinationlists = tdMap.get(pltabpage); |
| | | for(PLPageDefination plpagedefination : plpagedefinationlists){ |
| | | List<PLTabButton> pltabbuttons = dbMap.get(plpagedefination); |
| | | for(PLTabButton pltabbutton : pltabbuttons){ |
| | | List<PLCommandParameter> plcommandParams = bcMap.get(pltabbutton); |
| | | for(PLCommandParameter plcommandparameter : plcommandParams){ |
| | | plcommandparameter.plCreateUser = sessionInfo.getUserId(); |
| | | plcommandparameter.plModifyUser = sessionInfo.getUserId(); |
| | | platformClientUtil.getUIService().savePLCommandParameter(plcommandparameter); |
| | | } |
| | | pltabbutton.plCreateUser = sessionInfo.getUserId(); |
| | | pltabbutton.plModifyUser = sessionInfo.getUserId(); |
| | | platformClientUtil.getUIService().savePLTabButton(pltabbutton); |
| | | } |
| | | platformClientUtil.getUIService().savePLPageDefination(plpagedefination); |
| | | } |
| | | pltabpage.plCreateUser = sessionInfo.getUserId(); |
| | | pltabpage.plModifyUser = sessionInfo.getUserId(); |
| | | platformClientUtil.getUIService().savePLTabPage(pltabpage); |
| | | } |
| | | plPageLayoutDefination.plCreateUser = sessionInfo.getUserId(); |
| | | plPageLayoutDefination.plModifyUser = sessionInfo.getUserId(); |
| | | platformClientUtil.getUIService().savePLUILayout(plPageLayoutDefination); |
| | | } |
| | | return BaseResult.success("UIä¸ä¸æå¯¼å
¥æåï¼"); |
| | | } catch (PLException e) { |
| | | e.printStackTrace(); |
| | | return BaseResult.success("UIä¸ä¸æå¯¼å
¥å¤±è´¥,åå ï¼"+VciBaseUtil.getExceptionMessage(e)); |
| | | } |
| | | } |
| | | |
| | | /** |
| | |
| | | PLDefinationVO plDefinationVO = new PLDefinationVO(); |
| | | PLDefination plDefination = UITools.getPLDefination(item.plDefination); |
| | | BeanUtil.copy(plDefination,plDefinationVO); |
| | | plDefinationVO.setDescription(item.desc); |
| | | plDefinationVO.setSeq(String.valueOf(item.seq)); |
| | | plDefinationVO.setTabPageOId(item.plTabPageOId); |
| | | plDefinationVO.setId(item.plOId); |
| | | plDefinationVO.setName(item.name); |
| | | plDefinationVO.setType(item.plType); |
| | | plDefinationVO.setTemplateType(String.valueOf(plDefination.getTemplateType())); |
| | | plDefinationVOList.add(plDefinationVO); |
| | | } catch (Throwable e) { |
| | | e.printStackTrace(); |
| | |
| | | pd.plTabPageOId = pdVO.getTabPageOId(); |
| | | pd.plOId = ObjectUtility.getNewObjectID36(); |
| | | //ä¸è½ä¸ºç©ºå±æ§æ£æ¥ |
| | | if(!this.baseInfoIsOk(pd,false)){ |
| | | /*if(!this.baseInfoIsOk(pd,false)){ |
| | | return false; |
| | | } |
| | | }*/ |
| | | |
| | | pd.name = pdVO.getName().trim(); |
| | | pd.seq = Short.valueOf(pdVO.getSeq().trim()); |
| | | pd.desc = pdVO.getDescription(); |
| | | pd.plType = Short.parseShort(pdVO.getTemplateType()); |
| | | pd.plType = (short) pdVO.getType(); |
| | | |
| | | d.setName(pdVO.getName().trim()); |
| | | d.setUiParser(pdVO.getUiParser().trim()); |
| | |
| | | newPLDefinationIsOk(pdVO, false); |
| | | |
| | | // æ£æ¥å个类åä¸çæ°æ®æ¯å¦è¾å
¥æææ,ä¸å
±6ç§ç±»åæç±»åæ£éª |
| | | short plType = pd.plType; |
| | | switch (plType){ |
| | | String templateType = pdVO.getTemplateType(); |
| | | switch (templateType){ |
| | | //Table(è¡¨æ ¼) |
| | | case 1: |
| | | case "1": |
| | | //From(表å) |
| | | case 4: |
| | | case "4": |
| | | TableComptCheckInput tci = new TableComptCheckInput( |
| | | pdVO.getSearchTarger() |
| | | ,pdVO.getBtmType() |
| | | ,pdVO.getShowType() |
| | | ,pdVO.getLinkType() |
| | | ,pdVO.getTemplateId() |
| | | ,pdVO.getQueryTemplateName() |
| | |
| | | d = tci.getNewPLDefination(d); |
| | | break; |
| | | //Custom(èªå®ä¹æ¨¡æ¿) |
| | | case 2: |
| | | case "2": |
| | | //åªæ£æ¥æ§å¶è·¯å¾ä¸è½ä¸ºç©º,æé®é¢ä¼ç´æ¥æ¥é |
| | | CustomComptCheckInput ccci = new CustomComptCheckInput(pdVO.getControlPath()); |
| | | if(!ccci.checkInputIsOk()){ |
| | |
| | | d = ccci.getNewPLDefination(d); |
| | | break; |
| | | //TreeTable(æ 表) |
| | | case 3: |
| | | case "3": |
| | | TreeTableComptCheckInput ttcci = new TreeTableComptCheckInput( |
| | | pdVO.getSearchTarger() |
| | | ,pdVO.getBtmType() |
| | | ,pdVO.getShowType() |
| | | ,pdVO.getLinkType() |
| | | ,pdVO.getTemplateId() |
| | | ,pdVO.getQueryTemplateName() |
| | |
| | | d = ttcci.getNewPLDefination(d); |
| | | break; |
| | | //Tree(æ ) |
| | | case 5: |
| | | case "5": |
| | | TreeComptCheckInput tcci = new TreeComptCheckInput( |
| | | pdVO.getBtmType(), |
| | | pdVO.getShowType(), |
| | | pdVO.getLinkType(), |
| | | pdVO.getQueryTemplateName(), |
| | | pdVO.getShowExpressionRoot(), |
| | |
| | | d = tcci.getNewPLDefination(d); |
| | | break; |
| | | //UILayout(UIå®ä¹) |
| | | case 6: |
| | | case "6": |
| | | UILayoutComptCheckInput ulci = new UILayoutComptCheckInput( |
| | | pdVO.getSearchTarger(), |
| | | pdVO.getBtmType(), |
| | | pdVO.getShowType(), |
| | | pdVO.getUiLayout(), |
| | | pdVO.getQueryTemplateName(), |
| | | pdVO.getQryType() |
| | |
| | | BeanUtil.copy(pdVO,d); |
| | | |
| | | //ä¸è½ä¸ºç©ºå±æ§æ£æ¥ |
| | | if(!this.baseInfoIsOk(pd,true)){ |
| | | /*if(!this.baseInfoIsOk(pd,true)){ |
| | | return false; |
| | | } |
| | | }*/ |
| | | pd.plOId = pdVO.getId(); |
| | | pd.plTabPageOId = pdVO.getTabPageOId(); |
| | | pd.name = pdVO.getName().trim(); |
| | | pd.seq = Short.valueOf(pdVO.getSeq().trim()); |
| | | pd.desc = pdVO.getDescription(); |
| | | pd.plType = Short.parseShort(pdVO.getTemplateType()); |
| | | pd.plType = (short) pdVO.getType(); |
| | | |
| | | d.setId(pdVO.getId()); |
| | | d.setName(pdVO.getName().trim()); |
| | | d.setUiParser(pdVO.getUiParser().trim()); |
| | | d.setExtAttr(pdVO.getExtAttr().trim()); |
| | |
| | | this.newPLDefinationIsOk(pdVO, true); |
| | | |
| | | // æ£æ¥å个ç»ä»¶å
é¨çæ°æ®æ¯å¦ææ |
| | | int plType = pdVO.getType(); |
| | | switch (plType){ |
| | | String templateType = pdVO.getTemplateType(); |
| | | switch (templateType){ |
| | | //Table(è¡¨æ ¼) |
| | | case 1: |
| | | case "1": |
| | | //From(表å) |
| | | case 4: |
| | | case "4": |
| | | TableComptCheckInput tci = new TableComptCheckInput( |
| | | pdVO.getSearchTarger() |
| | | ,pdVO.getBtmType() |
| | | ,pdVO.getShowType() |
| | | ,pdVO.getLinkType() |
| | | ,pdVO.getTemplateId() |
| | | ,pdVO.getQueryTemplateName() |
| | |
| | | d = tci.getNewPLDefination(d); |
| | | break; |
| | | //Custom(èªå®ä¹æ¨¡æ¿) |
| | | case 2: |
| | | case "2": |
| | | //åªæ£æ¥æ§å¶è·¯å¾ä¸è½ä¸ºç©º,æé®é¢ä¼ç´æ¥æ¥é |
| | | CustomComptCheckInput ccci = new CustomComptCheckInput(pdVO.getControlPath()); |
| | | if(!ccci.checkInputIsOk()){ |
| | |
| | | d = ccci.getNewPLDefination(d); |
| | | break; |
| | | //TreeTable(æ 表) |
| | | case 3: |
| | | case "3": |
| | | TreeTableComptCheckInput ttcci = new TreeTableComptCheckInput( |
| | | pdVO.getSearchTarger() |
| | | ,pdVO.getBtmType() |
| | | ,pdVO.getShowType() |
| | | ,pdVO.getLinkType() |
| | | ,pdVO.getTemplateId() |
| | | ,pdVO.getQueryTemplateName() |
| | |
| | | d = ttcci.getNewPLDefination(d); |
| | | break; |
| | | //Tree(æ ) |
| | | case 5: |
| | | case "5": |
| | | TreeComptCheckInput tcci = new TreeComptCheckInput( |
| | | pdVO.getBtmType(), |
| | | pdVO.getShowType(), |
| | | pdVO.getLinkType(), |
| | | pdVO.getQueryTemplateName(), |
| | | pdVO.getShowExpressionRoot(), |
| | |
| | | d = tcci.getNewPLDefination(d); |
| | | break; |
| | | //UILayout(UIå®ä¹) |
| | | case 6: |
| | | case "6": |
| | | UILayoutComptCheckInput ulci = new UILayoutComptCheckInput( |
| | | pdVO.getSearchTarger(), |
| | | pdVO.getBtmType(), |
| | | pdVO.getShowType(), |
| | | pdVO.getUiLayout(), |
| | | pdVO.getQueryTemplateName(), |
| | | pdVO.getQryType() |
| | |
| | | @Override |
| | | public boolean delPageDefination(String[] oids) throws PLException { |
| | | VciBaseUtil.alertNotNull(oids,"å é¤ç页é¢å®ä¹ä¸»é®"); |
| | | boolean res = platformClientUtil.getUIService().deletePLUILayoutByOidsForCascade(oids); |
| | | boolean res = platformClientUtil.getUIService().deletePLPageDefinationByOidsForCascade(oids); |
| | | return res; |
| | | } |
| | | |
| | |
| | | logger.error(errorLog); |
| | | throw new VciBaseException(errorLog); |
| | | } |
| | | |
| | | }); |
| | | return plTabButtonVOList; |
| | | } |
| | |
| | | //åæ°ä¿¡æ¯åå¡« |
| | | PLCommandParameter[] parameters = platformClientUtil.getUIService().getPLCommandParametersByCommandOId(tabButtonDO.plOId); |
| | | if(Func.isNotEmpty(parameters)){ |
| | | LinkedHashMap<String, String> parameterMap = (LinkedHashMap<String, String>)Arrays.stream(parameters).collect(Collectors.toMap(parm -> parm.plKey, parm -> parm.plValue)); |
| | | LinkedHashMap<String, String> parameterMap = Arrays.stream(parameters) |
| | | .collect(Collectors.toMap( |
| | | parm -> parm.plKey, |
| | | parm -> parm.plValue, |
| | | (existing, replacement) -> existing, // å¤çéå¤é®çæ
åµ |
| | | LinkedHashMap::new // æå®ä½¿ç¨ LinkedHashMap |
| | | )); |
| | | plTabButtonVO.setButtonParams(parameterMap); |
| | | } |
| | | return plTabButtonVO; |
| | |
| | | } |
| | | |
| | | LinkedHashMap<String, String> buttonParams = tabButtonVO.getButtonParams(); |
| | | if(!buttonParams.isEmpty()) { |
| | | if(Func.isNotEmpty(buttonParams)) { |
| | | Iterator<Map.Entry<String, String>> iterator = buttonParams.entrySet().iterator(); |
| | | while(iterator.hasNext()){ |
| | | Map.Entry<String, String> next = iterator.next(); |
| | |
| | | iterator.remove(); |
| | | } |
| | | } |
| | | if(!buttonParams.isEmpty()){ |
| | | Iterator<Map.Entry<String, String>> kvItor = buttonParams.entrySet().iterator(); |
| | | while(kvItor.hasNext()){ |
| | | Map.Entry<String, String> next = kvItor.next(); |
| | | PLCommandParameter plCommandParameter = new PLCommandParameter(); |
| | | plCommandParameter.plOId = ObjectUtility.getNewObjectID36(); |
| | | plCommandParameter.plCommandOId = plTabButton.plOId; |
| | | plCommandParameter.plKey = next.getKey(); |
| | | plCommandParameter.plValue = next.getValue(); |
| | | plCommandParameter.plCreateUser = sessionInfo.getUserId(); |
| | | plCommandParameter.plModifyUser = sessionInfo.getUserId(); |
| | | try { |
| | | platformClientUtil.getUIService().savePLCommandParameter(plCommandParameter); |
| | | } catch (PLException e) { |
| | | e.printStackTrace(); |
| | | throw new VciBaseException("ä¿åæé®ä¿¡æ¯æ¶åçå¼å¸¸ï¼"+ e.getMessage()); |
| | | } |
| | | Iterator<Map.Entry<String, String>> kvItor = buttonParams.entrySet().iterator(); |
| | | while(kvItor.hasNext()){ |
| | | Map.Entry<String, String> next = kvItor.next(); |
| | | PLCommandParameter plCommandParameter = new PLCommandParameter(); |
| | | plCommandParameter.plOId = ObjectUtility.getNewObjectID36(); |
| | | plCommandParameter.plCommandOId = plTabButton.plOId; |
| | | plCommandParameter.plKey = next.getKey(); |
| | | plCommandParameter.plValue = next.getValue(); |
| | | plCommandParameter.plCreateUser = sessionInfo.getUserId(); |
| | | plCommandParameter.plModifyUser = sessionInfo.getUserId(); |
| | | try { |
| | | platformClientUtil.getUIService().savePLCommandParameter(plCommandParameter); |
| | | } catch (PLException e) { |
| | | e.printStackTrace(); |
| | | throw new VciBaseException("ä¿åæé®ä¿¡æ¯æ¶åçå¼å¸¸ï¼"+ e.getMessage()); |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | /** |
| | | * å é¤å个æé®é
ç½® |
| | | * @param tabButton |
| | | * @param tabButtonVO |
| | | * @return |
| | | */ |
| | | @Override |
| | | public boolean deleteTapButton(PLTabButton tabButton) throws PLException { |
| | | VciBaseUtil.alertNotNull(tabButton,"å é¤çæé®é
置对象"); |
| | | boolean success = UITools.getService().deletePLTabButton(tabButton); |
| | | if(success == false){ |
| | | throw new VciBaseException("该æå级æé®ï¼ä¸è½å é¤ï¼"); |
| | | } |
| | | return true; |
| | | public boolean deleteTapButton(PLTabButtonVO tabButtonVO) throws PLException { |
| | | VciBaseUtil.alertNotNull(tabButtonVO,"å é¤çæé®é
置对象"); |
| | | boolean success = platformClientUtil.getUIService().deletePLTabButton(this.tabButtonVO2TabButton(new PLTabButton(),tabButtonVO)); |
| | | if(success == false){ |
| | | throw new VciBaseException("该æå级æé®ï¼ä¸è½å é¤ï¼"); |
| | | } |
| | | return true; |
| | | } |
| | | |
| | | /** |
| | | * è°æ´ä¸ºä¸çº§æé® |
| | | * @param plTabButton |
| | | * @param tabButtonVO |
| | | * @return |
| | | */ |
| | | @Override |
| | | public BaseResult joinBtn(PLTabButton plTabButton) throws PLException { |
| | | VciBaseUtil.alertNotNull(plTabButton,"éè°æ´ä¸ºä¸çº§æé®",plTabButton.plTableOId,"å½åæé®é
ç½®æå¨ç页é¢ä¸»é®"); |
| | | public BaseResult joinBtn(PLTabButtonVO tabButtonVO) throws PLException { |
| | | VciBaseUtil.alertNotNull(tabButtonVO,"éè°æ´ä¸ºä¸çº§æé®",tabButtonVO.getTableOId(),"å½åæé®é
ç½®æå¨ç页é¢ä¸»é®"); |
| | | //åä¸é¡µé¢ä¸çæé® |
| | | List<PLTabButtonVO> plTabButtons = this.getTabButtons(plTabButton.plTableOId); |
| | | List<PLTabButtonVO> plTabButtons = this.getTabButtons(tabButtonVO.getTableOId()); |
| | | if(Func.isEmpty(plTabButtons)){ |
| | | return BaseResult.fail("æªè·åå°æé®é
置信æ¯ï¼"); |
| | | } |
| | | //è·åå½åè¦ç§»å¨çæé®ç䏿 |
| | | int index = 0; |
| | | for (int i = 0; i < plTabButtons.size(); i++) { |
| | | if (plTabButtons.get(i).getOId().equals(plTabButton.plOId)) { |
| | | if (plTabButtons.get(i).getOId().equals(tabButtonVO.getOId())) { |
| | | index = i; // æ¾å°åè®°å½ä¸æ |
| | | break; // æ¾å°åéåºå¾ªç¯ |
| | | } |
| | |
| | | return BaseResult.fail("å½åèç¹ä¸åå¨å
èç¹ï¼æ æ³è°æ´ä¸ºä¸çº§æé®ï¼"); |
| | | } |
| | | //设置ç¶id为ä¸ä¸ä¸ªèç¹ç |
| | | plTabButton.plParentOid = plTabButtons.get(index-1).getOId(); |
| | | |
| | | tabButtonVO.setParentOid(plTabButtons.get(index-1).getOId()); |
| | | PLTabButton plTabButton = this.tabButtonVO2TabButton(new PLTabButton(), tabButtonVO); |
| | | boolean success = platformClientUtil.getUIService().updatePLTabButton(plTabButton); |
| | | if(success == false) { |
| | | return BaseResult.fail("ä¿®æ¹å¤±è´¥ï¼"); |
| | |
| | | |
| | | /** |
| | | * è°æ´ä¸ºä¸çº§æé® |
| | | * @param plTabButton |
| | | * @param tabButtonVO |
| | | * @return |
| | | */ |
| | | @Override |
| | | public BaseResult exitBtn(PLTabButton plTabButton) throws PLException { |
| | | plTabButton.plParentOid = ""; |
| | | |
| | | public BaseResult exitBtn(PLTabButtonVO tabButtonVO) throws PLException { |
| | | tabButtonVO.setParentOid(""); |
| | | PLTabButton plTabButton = this.tabButtonVO2TabButton(new PLTabButton(), tabButtonVO); |
| | | boolean success = platformClientUtil.getUIService().updatePLTabButton(plTabButton); |
| | | if(success == false) { |
| | | BaseResult.fail("æ¤é失败ï¼"); |
| | |
| | | * @throws PLException |
| | | */ |
| | | private void newPLDefinationIsOk(PLDefinationVO pd, boolean isEdit) throws PLException{ |
| | | boolean res = false; |
| | | boolean nameExist = false; |
| | | boolean seqExist = false; |
| | | PLPageDefination[] pds = platformClientUtil.getUIService().getPLPageDefinationsByPageContextOId(pd.getTabPageOId()); |
| | |
| | | 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 |
| | | */ |
| | |
| | | }); |
| | | |
| | | 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; |
| | | } |
| | | |
| | | /** |
| | |
| | | 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; |
| | | } |
| | | |
| | | /** |
| | |
| | | |
| | | /** |
| | | * éç©ºæ£æ¥ |
| | | * @param tip |
| | | * @param txt |
| | | * @param tip æç¤ºä¿¡æ¯ |
| | | * @param txt æ ¡éªçå
容 |
| | | * @param isRequired æ¯å¦å¿
å¡« |
| | | * @return |
| | | */ |
| | | protected boolean checkRequiredIsOk(String tip, String txt){ |
| | | protected boolean checkRequiredIsOk(String tip, String txt,boolean isRequired/*æ¯å¦å¿
å¡«*/){ |
| | | boolean res = false; |
| | | if(Func.isBlank(txt)){ |
| | | if(Func.isBlank(txt) && isRequired){ |
| | | throw new VciBaseException(tip + " ä¸è½ä¸ºç©ºï¼"); |
| | | } else { |
| | | res = true; |
| | |
| | | * @param btmName ä¸å¡ç±»åå |
| | | * @return |
| | | */ |
| | | protected boolean checkBtmTypeTxtIsOk(String tipName, String btmName) throws PLException { |
| | | protected boolean checkBtmTypeTxtIsOk(String tipName, String btmName,boolean isRequired) throws PLException { |
| | | boolean res = false; |
| | | if(tipName == null) return true; |
| | | if(btmName == null) return true; |
| | | if(!checkRequiredIsOk(tipName, btmName)){ |
| | | if(!checkRequiredIsOk(tipName, btmName, isRequired)){ |
| | | res = false; |
| | | } else if(!checkBtmNameIsExist(tipName, btmName)){ |
| | | res = false; |
| | |
| | | * @param btmLinkType |
| | | * @return |
| | | */ |
| | | protected boolean checkPortalVITxtIsOk(String tip, String txtVIName, String btmLinkType) throws PLException { |
| | | protected boolean checkPortalVITxtIsOk(String tip, String txtVIName, String btmLinkType, boolean isRequired) throws PLException { |
| | | boolean res = false; |
| | | if(tip == null) return true; |
| | | if(txtVIName == null) return true; |
| | | if(!checkRequiredIsOk(tip, txtVIName)){ |
| | | if(!checkRequiredIsOk(tip, txtVIName,isRequired)){ |
| | | res = false; |
| | | } else if(!checkPortalVIIsExist(tip, txtVIName, btmLinkType)){ |
| | | res = false; |
| | |
| | | * @param btmLinkType |
| | | * @return |
| | | */ |
| | | protected boolean checkQTNameTxtIsOk(String tip, String txtQTName, String btmLinkType) throws PLException { |
| | | protected boolean checkQTNameTxtIsOk(String tip, String txtQTName, String btmLinkType, boolean isRequired) throws PLException { |
| | | boolean res = false; |
| | | if(tip == null) return true; |
| | | if(txtQTName == null) return true; |
| | | if(!checkRequiredIsOk(tip, txtQTName)){ |
| | | if(!checkRequiredIsOk(tip, txtQTName, isRequired)){ |
| | | res = false; |
| | | } else if(Func.isBlank(txtQTName) && !checkQTIsExist(tip, txtQTName, btmLinkType)){ |
| | | } else if(Func.isNotBlank(txtQTName) && !checkQTIsExist(tip, txtQTName, btmLinkType)){ |
| | | res = false; |
| | | } else { |
| | | res = true; |
| | |
| | | * @param btmLinkType |
| | | * @return |
| | | */ |
| | | protected boolean checkUILayoutTxtIsOk(String tip, String uiName, String btmLinkType) throws PLException { |
| | | protected boolean checkUILayoutTxtIsOk(String tip, String uiName, String btmLinkType, boolean isRequired) throws PLException { |
| | | boolean res = false; |
| | | if(tip == null) return true; |
| | | if(uiName == null) return true; |
| | | if(!checkRequiredIsOk(tip, uiName)){ |
| | | if(!checkRequiredIsOk(tip, uiName,isRequired)){ |
| | | res = false; |
| | | } else if(!checkUILayoutIsExist(tip, uiName, btmLinkType)){ |
| | | res = false; |
| | |
| | | * @param linkTypeName |
| | | * @return |
| | | */ |
| | | protected boolean checkLinkTypeTxtIsOk(String tip, String linkTypeName) throws PLException { |
| | | protected boolean checkLinkTypeTxtIsOk(String tip, String linkTypeName, boolean isRequired) throws PLException { |
| | | boolean res = false; |
| | | if(tip == null) return true; |
| | | if(linkTypeName == null) return true; |
| | | if(!checkRequiredIsOk(tip, linkTypeName)){ |
| | | if(!checkRequiredIsOk(tip, linkTypeName,isRequired)){ |
| | | res = false; |
| | | } else if(!checkLinkTypeIsExist(tip, linkTypeName)){ |
| | | res = false; |
| | |
| | | */ |
| | | private boolean checkBtmTypeInputIsOk(String btmType,String txtVIName/*éæ©æ¨¡æ¿*/,String txtQTName/*æ¥è¯¢æ¨¡æ¿*/) throws PLException { |
| | | boolean res = false; |
| | | if(!super.checkBtmTypeTxtIsOk("ä¸å¡ç±»å", btmType)){ |
| | | if(!super.checkBtmTypeTxtIsOk("ä¸å¡ç±»å", btmType,true)){ |
| | | res = false; |
| | | } else if(!super.checkPortalVITxtIsOk("éæ©æ¨¡æ¿", txtVIName, btmType)){ |
| | | } else if(!super.checkPortalVITxtIsOk("éæ©æ¨¡æ¿", txtVIName, btmType,true)){ |
| | | res = false; |
| | | } else if(!super.checkQTNameTxtIsOk("æ¥è¯¢æ¨¡æ¿", txtQTName, btmType)){ |
| | | } else if(!super.checkQTNameTxtIsOk("æ¥è¯¢æ¨¡æ¿", txtQTName, btmType,false)){ |
| | | res = false; |
| | | } else { |
| | | res = true; |
| | |
| | | */ |
| | | private boolean checkLinkTypeInputIsOk(String txtVIName/*éæ©çæ¨¡æ¿*/,String txtQTName/*æ¥è¯¢æ¨¡æ¿*/,String btmType) throws PLException { |
| | | boolean res = false; |
| | | if(!(this.checkBtmTypeTxtIsOk("ç®æ 对象", linkType))){ |
| | | if(!(this.checkBtmTypeTxtIsOk("ç®æ 对象", linkType,true))){ |
| | | res = false; |
| | | } else if(!(this.checkPortalVITxtIsOk("éæ©æ¨¡æ¿", txtVIName, linkType))){ |
| | | } else if(!(this.checkPortalVITxtIsOk("éæ©æ¨¡æ¿", txtVIName, linkType,true))){ |
| | | res = false; |
| | | } else if(!(this.checkQTNameTxtIsOk("æ¥è¯¢æ¨¡æ¿", txtQTName, linkType))){ |
| | | } else if(!(this.checkQTNameTxtIsOk("æ¥è¯¢æ¨¡æ¿", txtQTName, linkType,false))){ |
| | | res = false; |
| | | } else { |
| | | res = true; |
| | |
| | | |
| | | private boolean checkBtmTypeInputIsOk() throws PLException { |
| | | boolean res = false; |
| | | if(!(super.checkBtmTypeTxtIsOk("顶级èç¹æ¾ç¤ºç±»å", btmType))){ |
| | | if(!(super.checkBtmTypeTxtIsOk("顶级èç¹æ¾ç¤ºç±»å", btmType,true))){ |
| | | res = false; |
| | | } else if(!(super.checkPortalVITxtIsOk("éæ©æ¨¡æ¿", txtVIName, btmType))){ |
| | | } else if(!(super.checkPortalVITxtIsOk("éæ©æ¨¡æ¿", txtVIName, btmType,true))){ |
| | | res = false; |
| | | } else if(!(super.checkQTNameTxtIsOk("æ¥è¯¢æ¨¡æ¿", txtQTName , btmType))){ |
| | | } else if(!(super.checkQTNameTxtIsOk("æ¥è¯¢æ¨¡æ¿", txtQTName , btmType,false))){ |
| | | res = false; |
| | | } else { |
| | | res = true; |
| | |
| | | |
| | | private boolean checkLinkTypeInputIsOk() throws PLException { |
| | | boolean res = false; |
| | | if(!(super.checkBtmTypeTxtIsOk("顶级èç¹æ¾ç¤ºç±»å", linkType))){ |
| | | if(!(super.checkBtmTypeTxtIsOk("顶级èç¹æ¾ç¤ºç±»å", linkType,true))){ |
| | | res = false; |
| | | } else if(!(super.checkPortalVITxtIsOk("éæ©æ¨¡æ¿", txtVIName, linkType))){ |
| | | } else if(!(super.checkPortalVITxtIsOk("éæ©æ¨¡æ¿", txtVIName, linkType,true))){ |
| | | res = false; |
| | | } else if(!(super.checkQTNameTxtIsOk("æ¥è¯¢æ¨¡æ¿", txtQTName, linkType))){ |
| | | } else if(!(super.checkQTNameTxtIsOk("æ¥è¯¢æ¨¡æ¿", txtQTName, linkType,false))){ |
| | | res = false; |
| | | } else { |
| | | res = true; |
| | |
| | | |
| | | private boolean checkBtmTypeInputIsOk() throws PLException { |
| | | boolean res = false; |
| | | if(!(super.checkBtmTypeTxtIsOk("ä¸å¡ç±»å", btmType))){ |
| | | if(!(super.checkBtmTypeTxtIsOk("ä¸å¡ç±»å", btmType,true))){ |
| | | res = false; |
| | | return res; |
| | | } |
| | | // 龿¥ç±»åä¸ä¸ºç©ºæ¶ï¼éè¦åæ¶æ£æ¥é¾æ¥ç±»åå龿¥ç±»åä¸çæ¥è¯¢æ¨¡æ¿æ¯å¦ææ |
| | | if(Func.isBlank(linkType)){ |
| | | if(!(super.checkLinkTypeTxtIsOk("龿¥ç±»å", linkType))){ |
| | | if(!(super.checkLinkTypeTxtIsOk("龿¥ç±»å", linkType,false))){ |
| | | res = false; |
| | | return res; |
| | | } else if(!(super.checkQTNameTxtIsOk("æ¥è¯¢æ¨¡æ¿", queryTemplateName, linkType))){ |
| | | } else if(!(super.checkQTNameTxtIsOk("æ¥è¯¢æ¨¡æ¿", queryTemplateName, linkType,true))){ |
| | | res = false; |
| | | return res; |
| | | } |
| | | } else { |
| | | // 龿¥ç±»å为空æ¶ï¼åªéè¦æ£æ¥ä¸å¡ç±»åä¸çæ¥è¯¢æ¨¡æ¿æ¯å¦ææ |
| | | if(!(super.checkQTNameTxtIsOk("æ¥è¯¢æ¨¡æ¿", queryTemplateName, btmType))){ |
| | | if(!(super.checkQTNameTxtIsOk("æ¥è¯¢æ¨¡æ¿", queryTemplateName, btmType,true))){ |
| | | res = false; |
| | | return res; |
| | | } |
| | | } |
| | | |
| | | if(!super.checkRequiredIsOk("æ ¹èç¹æ¾ç¤ºè¡¨è¾¾å¼", showExpressionRoot)){ |
| | | if(!super.checkRequiredIsOk("æ ¹èç¹æ¾ç¤ºè¡¨è¾¾å¼", showExpressionRoot,true)){ |
| | | res = false; |
| | | } |
| | | else if(!super.checkRequiredIsOk("æ èç¹æ¾ç¤ºè¡¨è¾¾å¼", showExpression)){ |
| | | else if(!super.checkRequiredIsOk("æ èç¹æ¾ç¤ºè¡¨è¾¾å¼", showExpression,true)){ |
| | | res = false; |
| | | } |
| | | else if(!super.checkRequiredIsOk("åç
§æ 设置", refTreeSet)){ |
| | | else if(!super.checkRequiredIsOk("åç
§æ 设置", refTreeSet,true)){ |
| | | res = false; |
| | | } |
| | | else { |
| | |
| | | |
| | | private boolean checkUILayoutInputIsOk() throws PLException { |
| | | boolean res = false; |
| | | if (!(super.checkBtmTypeTxtIsOk("对象类å", uiBtmType))) { |
| | | if (!(super.checkBtmTypeTxtIsOk("对象类å", uiBtmType,true))) { |
| | | res = false; |
| | | } else if (!(super.checkUILayoutTxtIsOk("UIå®ä¹", uiLayout, uiBtmType))) { |
| | | } else if (!(super.checkUILayoutTxtIsOk("UIå®ä¹", uiLayout, uiBtmType,true))) { |
| | | res = false; |
| | | } else if (!(super.checkQTNameTxtIsOk("æ¥è¯¢æ¨¡æ¿", queryTemplateName, qryType))) { |
| | | } else if (!(super.checkQTNameTxtIsOk("æ¥è¯¢æ¨¡æ¿", queryTemplateName, qryType,false))) { |
| | | res = false; |
| | | } else { |
| | | res = true; |