ludc
2024-10-22 af99adcdd1198af865d091204b8566e2b81e389d
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsPortalVIServiceImpl.java
@@ -128,7 +128,7 @@
            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{
@@ -149,7 +149,7 @@
     */
    @Override
    public BaseResult addSave(PortalVIDTO portalVIDTO) throws VciBaseException {
        return  savePortalVIDTO(portalVIDTO,false);
        return savePortalVIDTO(portalVIDTO,false);
    }
    /**
@@ -166,8 +166,8 @@
        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("根据主键未查询到数据");
        }
@@ -649,30 +649,28 @@
            }
            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())) {
@@ -885,7 +883,7 @@
        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));
@@ -1166,10 +1164,12 @@
        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());
@@ -1190,8 +1190,8 @@
        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)){
@@ -1290,6 +1290,7 @@
        }
        return itemSeniorQueryBOList;
    }
    private List<String> getRefFormVIName(String refFormOid){
        List<String> keyList=new ArrayList<>();
        try {