| | |
| | | } |
| | | DataGrid<PortalVIVO> dataGrid = new DataGrid<>(); |
| | | try { |
| | | GetPagePortalVIArrayByPageInfoResult pagePortalVIArrayByPageInfoResult= platformClientUtil.getPortalService().getPagePortalVIArrayByPageInfo(typeName,viName,viType,viTypeFlag,pageIndex,pageSize); |
| | | GetPagePortalVIArrayByPageInfoResult pagePortalVIArrayByPageInfoResult = platformClientUtil.getPortalService().getPagePortalVIArrayByPageInfo(typeName,viName,viType,viTypeFlag,pageIndex,pageSize); |
| | | if(pagePortalVIArrayByPageInfoResult.total>0) { |
| | | PortalVI[] portalVIS = pagePortalVIArrayByPageInfoResult.returnValue; |
| | | List<PortalVIVO> portalVIVOS= portalVIDOO2VOS(Arrays.asList(portalVIS)); |
| | | List<PortalVIVO> portalVIVOS = portalVIDOO2VOS(Arrays.asList(portalVIS)); |
| | | dataGrid.setData(portalVIVOS); |
| | | dataGrid.setTotal(pagePortalVIArrayByPageInfoResult.total); |
| | | }else{ |
| | | dataGrid = new DataGrid<>("沒有查询到数据"); |
| | | dataGrid = new DataGrid<>(); |
| | | } |
| | | } catch (PLException e) { |
| | | e.printStackTrace(); |
| | |
| | | */ |
| | | @Override |
| | | public BaseResult addSave(PortalVIDTO portalVIDTO) throws VciBaseException { |
| | | return savePortalVIDTO(portalVIDTO,false); |
| | | return savePortalVIDTO(portalVIDTO,false); |
| | | } |
| | | |
| | | /** |
| | |
| | | if(PortalVIType.Table.getName()==viType){ |
| | | lableName=PortalVIType.Table.getLabel(); |
| | | } |
| | | PortalVIVO portalVIVO=new PortalVIVO(); |
| | | PortalVI portalVI= platformClientUtil.getPortalService().getPortalVIById(id); |
| | | PortalVIVO portalVIVO = new PortalVIVO(); |
| | | PortalVI portalVI = platformClientUtil.getPortalService().getPortalVIById(id); |
| | | if(portalVI==null||StringUtils.isBlank(portalVI.id)){ |
| | | throw new VciBaseException("根据主键未查询到数据"); |
| | | } |
| | | portalVIVO=portalVIDOO2VO(portalVI); |
| | | return portalVIVO; |
| | | } |
| | |
| | | */ |
| | | @Override |
| | | public boolean clone(ClonePortalVIDTOList clonePortalVIDTOList) throws VciBaseException { |
| | | if(clonePortalVIDTOList==null||CollectionUtils.isEmpty(clonePortalVIDTOList.getClonePortalVIDTOList())){ |
| | | if(clonePortalVIDTOList == null || CollectionUtils.isEmpty(clonePortalVIDTOList.getClonePortalVIDTOList())){ |
| | | throw new VciBaseException("请选择要克隆的对象!"); |
| | | } |
| | | try { |
| | |
| | | } |
| | | String attributeStr=""; |
| | | try { |
| | | List<OsAttributeVO> osAttributeVOList=osAttributeService.getOsAttributeVOSByBtName(portalVIDTO.getTypeName(),portalVIDTO.getTypeFlag()); |
| | | List<OsAttributeVO> osAttributeVOList=osAttributeService.getOsAttributeVOSByBtName(portalVIDTO.getTypeName(),portalVIDTO.getTypeFlag(),false); |
| | | if(!CollectionUtils.isEmpty(osAttributeVOList)){ |
| | | List<String> filedList= osAttributeVOList.stream().map(OsAttributeVO::getId).collect(Collectors.toList()); |
| | | attributeStr=VciBaseUtil.array2String(filedList.toArray(new String[]{})); |
| | |
| | | }); |
| | | } |
| | | //校验属性是否正确 |
| | | List<OsAttributeVO> osAttributeVOList = osAttributeService.getOsAttributeVOSByBtName(portalVI.typeName, portalVI.typeFlag); |
| | | List<OsAttributeVO> osAttributeVOList = osAttributeService.getOsAttributeVOSByBtName(portalVI.typeName, portalVI.typeFlag,false); |
| | | if (!CollectionUtils.isEmpty(osAttributeVOList)) { |
| | | List<String> filedList = osAttributeVOList.stream().map(OsAttributeVO::getId).collect(Collectors.toList()); |
| | | List<String> attributeList = VciBaseUtil.str2List(portalVIPO.getAttributeKey()); |
| | |
| | | boolean flag = false; |
| | | String labelName=PortalVIType.Form.getName(); |
| | | try { |
| | | VciBaseUtil.alertNotNull(portalVIDTO.getViName(),"名称不能为空!"); |
| | | VciBaseUtil.alertNotNull(portalVIDTO.getViName(),"名称"); |
| | | if(portalVIDTO.getPrm()==null||portalVIDTO.getPrm().getPrmItemList()==null||portalVIDTO.getPrm().getPrmItemList().size()==0){ |
| | | throw new Throwable(labelName+",未设置"); |
| | | } |
| | | if(PortalVIType.Table.getIntVal()==portalVIDTO.getViType()){//如果是表格的的校验 |
| | | labelName=PortalVIType.Table.getName(); |
| | | PRMItemDTO prmItemDTO= portalVIDTO.getPrm().getPrmItemList().get(0); |
| | | PRMItemDTO prmItemDTO = portalVIDTO.getPrm().getPrmItemList().get(0); |
| | | //每页显示校验 |
| | | String rtnContent = isCorrectPageNums(prmItemDTO.getItemPageSize()); |
| | | if (StringUtils.isNotBlank(rtnContent)) { |
| | | throw new VciBaseException(rtnContent); |
| | | } |
| | | }else{ |
| | | |
| | | } |
| | | labelName= PortalVIType.getByIntVal(portalVIDTO.getViType()).getLabel(); |
| | | if(!_isBtm){ |
| | | PortalVI[] portalVIS= platformClientUtil.getPortalService().getPortalVIArrayByTypeName(portalVIDTO.getTypeName()); |
| | | PortalVI[] portalVIS = platformClientUtil.getPortalService().getPortalVIArrayByTypeName(portalVIDTO.getTypeName()); |
| | | for (int i = 0; i < portalVIS.length; i++) { |
| | | PortalVI portalVI= portalVIS[i]; |
| | | String viName= portalVI.viName; |
| | | PortalVI portalVI = portalVIS[i]; |
| | | String viName = portalVI.viName; |
| | | if(isEdit){//如果为修改 |
| | | try { |
| | | PortalVI oldPortalVI= platformClientUtil.getPortalService().getPortalVIById(portalVIDTO.getId()); |
| | | flag=platformClientUtil.getPortalService().judgeUpdateButton(oldPortalVI.typeFlag, oldPortalVI.viName, oldPortalVI.typeName); |
| | | PortalVI oldPortalVI = platformClientUtil.getPortalService().getPortalVIById(portalVIDTO.getId()); |
| | | flag = platformClientUtil.getPortalService().judgeUpdateButton(oldPortalVI.typeFlag, oldPortalVI.viName, oldPortalVI.typeName); |
| | | if (flag && (StringUtils.isNotBlank(portalVIDTO.getViName()))&&(!oldPortalVI.viName.equals(portalVIDTO.getViName()))) { |
| | | throw new Throwable("该"+labelName+"已经被引用,不能修改名称!"); |
| | | } |
| | | } catch (PLException e) { |
| | | throw new Throwable("查询原有表单出现异常:"+e.getMessage()); |
| | | throw new Throwable("查询原有表单出现异常:"+e.getMessage()); |
| | | } |
| | | if (!portalVI.id.equals(portalVIDTO.getId())) { |
| | | if (portalVI.viName.equals(portalVIDTO.getViName())) { |
| | |
| | | portalVIVO.setViType(portalVI.viType); |
| | | portalVIVO.setViTypeText(PortalVIType.getByIntVal(portalVI.viType).getLabel()); |
| | | |
| | | String prm= portalVI.prm; |
| | | String prm = portalVI.prm; |
| | | if(StringUtils.isNotBlank(prm)) { |
| | | PRMDO prmdo = UITools.getPRM(prm); |
| | | portalVIVO.setPrm(prmDOO2VOS(prmdo, portalVI.viType)); |
| | |
| | | prmItemDO.setItemHrefConf(prmItemDO.getItemHrefConf());//超链接配置 |
| | | prmItemDO.setItemTips(prmItemDTO.getItemTips()); |
| | | prmItemDO.setItemTrim(prmItemDTO.getItemTrim()); |
| | | prmItemDO.setItemDateFormat(prmItemDTO.getItemDateFormat()); |
| | | //prmItemDO.setItemDateFormat(prmItemDTO.getItemDateFormat()); |
| | | prmItemDO.setItemCtrlDisplyCondition(prmItemDTO.getItemCtrlDisplyCondition());////控制显示条件 |
| | | prmItemDO.setItemEditableProgram(prmItemDTO.getItemEditableProgram()); |
| | | prmItemDO.setItemEditCondition(prmItemDTO.getItemEditCondition()); |
| | |
| | | prmItemDO.setItemHttpPathField(prmItemDTO.getItemHttpPathField()); |
| | | if(viType==PortalVIType.Table.getIntVal()) {//如果是表格 |
| | | initTableConfigDTOO2DOData(prmItemDO,prmItemDTO); |
| | | }else{ |
| | | List<String> itemValueList=new ArrayList<>(); |
| | | List<KeyValue> keyValueList=prmItemDTO.getItemKeyValueList(); |
| | | Optional.ofNullable(keyValueList).orElseGet(()->new ArrayList<>()).stream().forEach(keyValue -> { |
| | | String value= keyValue.getValue()+"{"+keyValue.getKey()+"}"; |
| | | itemValueList.add(value); |
| | | }); |
| | | prmItemDO.setItemValueList(itemValueList); |
| | | |
| | | } |
| | | return prmItemDO; |
| | | } |
| | |
| | | prmItemVO.setItemIsHttpSave(prmItemDO.getItemIsHttpSave()); |
| | | prmItemVO.setItemHttpVolumnPath(prmItemDO.getItemHttpVolumnPath()); |
| | | prmItemVO.setItemHttpPathField(prmItemDO.getItemHttpPathField()); |
| | | |
| | | if(viType==PortalVIType.Table.getIntVal()) {//如果是表格 |
| | | initTableConfigDOO2VOData(prmItemVO,prmItemDO); |
| | | }else{ |
| | | List<String> enumList= prmItemDO.getItemValueList(); |
| | | List<KeyValue>itemKeyValueList=new ArrayList<>(); |
| | | Optional.ofNullable(enumList).orElseGet(()->new ArrayList<>()).stream().forEach(enumValue->{ |
| | | List<String> keyValueList= VciBaseUtil.str2List(VciBaseUtil.removeComma(enumValue,"}"),"\\{"); |
| | | KeyValue keyValue=new KeyValue(); |
| | | keyValue.setKey(keyValueList.get(1)); |
| | | keyValue.setValue(keyValueList.get(0)); |
| | | itemKeyValueList.add(keyValue); |
| | | }); |
| | | prmItemVO.setItemKeyValueList(itemKeyValueList); |
| | | } |
| | | return prmItemVO; |
| | | } |
| | |
| | | prmItemDTO.setItemHttpPathField(prmItemDO.getItemHttpPathField()); |
| | | if(viType==PortalVIType.Table.getIntVal()) {//如果是表格 |
| | | initTableConfigDOO2VOData(prmItemDTO,prmItemDO); |
| | | }else{ |
| | | List<String> enumList= prmItemDO.getItemValueList(); |
| | | List<KeyValue>itemKeyValueList=new ArrayList<>(); |
| | | Optional.ofNullable(enumList).orElseGet(()->new ArrayList<>()).stream().forEach(enumValue->{ |
| | | List<String> keyValueList= VciBaseUtil.str2List(VciBaseUtil.removeComma(enumValue,"}"),"\\{"); |
| | | KeyValue keyValue=new KeyValue(); |
| | | keyValue.setKey(keyValueList.get(1)); |
| | | keyValue.setValue(keyValueList.get(0)); |
| | | itemKeyValueList.add(keyValue); |
| | | }); |
| | | prmItemDTO.setItemKeyValueList(itemKeyValueList); |
| | | } |
| | | return prmItemDTO; |
| | | } |
| | |
| | | List<String> allKeyList= getRefFormVIName(prmItemDO.getItemInObj()); |
| | | List<String> itemOutFieldList =VciBaseUtil.str2List(prmItemDO.getItemOutFields()); |
| | | List<String> itemKeyFieldList =VciBaseUtil.str2List(prmItemDO.getItemKeyFields()); |
| | | List<String> itemSelectoutFieldList= allKeyList.stream().filter(s ->!itemOutFieldList.stream().map(s1 -> s1).collect(Collectors.toList()).contains(s) ).collect(Collectors.toList()); |
| | | prmItemVO.setItemSelectoutFieldList(itemSelectoutFieldList);//待选择的属性字段 |
| | | List<String> itemSelectOutFieldList= allKeyList.stream() |
| | | .filter(s -> !itemOutFieldList.contains(s)) |
| | | .collect(Collectors.toList()); |
| | | prmItemVO.setItemSelectOutFieldList(itemSelectOutFieldList);//待选择的属性字段 |
| | | prmItemVO.setItemOutFieldList(itemOutFieldList);//需要使用的集合 |
| | | // List<String> itemSearchFieldList= itemOutFieldList.stream().filter(s ->!CollectionUtils.isEmpty(itemKeyFieldList).stream().map(s1 -> s1).collect(Collectors.toList()).contains(s) ).collect(Collectors.toList()); |
| | | // List<String> itemSearchFieldList= itemOutFieldList.stream().filter(s ->!CollectionUtils.isEmpty(itemKeyFieldList).stream().map(s1 -> s1).collect(Collectors.toList()).contains(s) ).collect(Collectors.toList()); |
| | | List<String> itemSearchFieldList=new ArrayList<>(); |
| | | if(!CollectionUtils.isEmpty(itemKeyFieldList)){ |
| | | itemSearchFieldList= itemOutFieldList.stream().filter(s ->!itemKeyFieldList.contains(s)).collect(Collectors.toList()); |
| | |
| | | List<String> allKeyList= getRefFormVIName(prmItemDO.getItemInObj()); |
| | | List<String> itemOutFieldList =VciBaseUtil.str2List(prmItemDO.getItemOutFields()); |
| | | List<String> itemKeyFieldList =VciBaseUtil.str2List(prmItemDO.getItemKeyFields()); |
| | | List<String> itemSelectoutFieldList= allKeyList.stream().filter(s ->!itemOutFieldList.stream().map(s1 -> s1).collect(Collectors.toList()).contains(s) ).collect(Collectors.toList()); |
| | | prmItemDTO.setItemSelectoutFieldList(itemSelectoutFieldList);//待选择的属性字段 |
| | | List<String> itemSelectOutFieldList= allKeyList.stream().filter(s ->!itemOutFieldList.stream().map(s1 -> s1).collect(Collectors.toList()).contains(s) ).collect(Collectors.toList()); |
| | | prmItemDTO.setItemSelectoutFieldList(itemSelectOutFieldList);//待选择的属性字段 |
| | | prmItemDTO.setItemOutFieldList(itemOutFieldList);//需要使用的集合 |
| | | List<String> itemSearchFieldList=new ArrayList<>(); |
| | | if(!CollectionUtils.isEmpty(itemKeyFieldList)){ |
| | |
| | | } |
| | | return itemSeniorQueryBOList; |
| | | } |
| | | |
| | | private List<String> getRefFormVIName(String refFormOid){ |
| | | List<String> keyList=new ArrayList<>(); |
| | | try { |
| | | |
| | | PortalVI refFormVI = UITools.getService().getPortalVIById(refFormOid); |
| | | PortalVIVO portalVIVO= portalVIDOO2VO(refFormVI); |
| | | if(portalVIVO!=null&&portalVIVO.getPrm().getPrmItemList().size()>0){ |