| | |
| | | package com.vci.web.service.impl; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.vci.common.utility.ObjectUtility; |
| | | import com.vci.corba.common.PLException; |
| | | import com.vci.corba.framework.data.RoleRightInfo; |
| | |
| | | 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.WriteExcelData; |
| | | import com.vci.starter.poi.bo.WriteExcelOption; |
| | | 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.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.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.atomic.AtomicInteger; |
| | | import java.util.stream.Collectors; |
| | | import java.util.regex.Pattern; |
| | | |
| | |
| | | } |
| | | |
| | | /** |
| | | * 根据勾选的条件获取需要导出的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> excelDataList = new ArrayList<>(); |
| | | //设置列头 |
| | | for (int index = 0; index < columns.size(); index++) { |
| | | excelDataList.add(new WriteExcelData(0,index, columns.get(index))); |
| | | } |
| | | AtomicInteger row = new AtomicInteger(1); |
| | | expConditionMap.entrySet().stream().forEach(item->{ |
| | | //key存放的ui上下文的id |
| | | try { |
| | | PLUILayout pluiLayout = platformClientUtil.getUIService().getPLUILayoutById(item.getKey()); |
| | | //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->{ |
| | | excelDataList.add(new WriteExcelData(row.get(),0, pluiLayout.plRelatedType)); |
| | | excelDataList.add(new WriteExcelData(row.get(),1, pluiLayout.plName)); |
| | | excelDataList.add(new WriteExcelData(row.get(),2, pluiLayout.plCode)); |
| | | excelDataList.add(new WriteExcelData(row.get(),3, pluiLayout.plIsShowForm)); |
| | | excelDataList.add(new WriteExcelData(row.get(),4, pluiLayout.plIsShowNavigator)); |
| | | excelDataList.add(new WriteExcelData(row.get(),5, pluiLayout.plIsShowTab)); |
| | | excelDataList.add(new WriteExcelData(row.get(),6, tabPage.plSeq)); |
| | | excelDataList.add(new WriteExcelData(row.get(),7, tabPage.plLabel)); |
| | | excelDataList.add(new WriteExcelData(row.get(),8, tabPage.plName)); |
| | | excelDataList.add(new WriteExcelData(row.get(),9, tabPage.plIsOpen)); |
| | | excelDataList.add(new WriteExcelData(row.get(),10, tabPage.plOpenExpression)); |
| | | excelDataList.add(new WriteExcelData(row.get(),11, tabPage.plUIParser)); |
| | | excelDataList.add(new WriteExcelData(row.get(),12, tabPage.plExtAttr)); |
| | | excelDataList.add(new WriteExcelData(row.get(),13, tabPage.plDesc)); |
| | | try { |
| | | PLPageDefination[] plPageDefinations = platformClientUtil.getUIService().getPLPageDefinationsByPageContextOId(tabPage.plOId); |
| | | if(Func.isNotEmpty(plPageDefinations)){ |
| | | excelDataList.add(new WriteExcelData(row.get(),14, JSON.toJSONString(plPageDefinations))); |
| | | List<PLTabButtonVO> tabButtonsTotal = new ArrayList<>(); |
| | | Arrays.stream(plPageDefinations).forEach(plPageDefination->{ |
| | | List<PLTabButtonVO> tabButtons = this.getTabButtons(plPageDefination.plOId); |
| | | tabButtonsTotal.addAll(tabButtons); |
| | | }); |
| | | excelDataList.add(new WriteExcelData(row.get(),15, JSON.toJSONString(tabButtonsTotal))); |
| | | } |
| | | } catch (PLException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | row.getAndIncrement(); |
| | | }); |
| | | } |
| | | } catch (PLException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | }); |
| | | WriteExcelOption excelOption = new WriteExcelOption(excelDataList); |
| | | ExcelUtil.writeDataToFile(excelPath, excelOption); |
| | | return excelPath; |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Override |
| | | public BaseResult impUIContextData(MultipartFile file) { |
| | | |
| | | |
| | | |
| | | |
| | | return null; |
| | | } |
| | | |
| | |
| | | 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()); |
| | |
| | | |
| | | /** |
| | | * 非空检查 |
| | | * @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; |