Source/platformProject/vci-platform-web/src/main/java/com/vci/web/service/impl/UIDataServiceImpl.java
@@ -1,11 +1,13 @@
package com.vci.web.service.impl;
import com.vci.client.common.providers.ServiceProvider;
import com.vci.corba.common.PLException;
import com.vci.corba.common.VCIError;
import com.vci.corba.omd.lcm.LifeCycle;
import com.vci.file.pagemodel.VciFileObjectVO;
import com.vci.frameworkcore.lcstatuspck.FrameworkDataLCStatus;
import com.vci.frameworkcore.lcstatuspck.ReleaseDataLCStatus;
import com.vci.omd.constants.SystemAttribute;
import com.vci.starter.revision.bo.TreeWrapperOptions;
import com.vci.starter.web.annotation.bus.VciChangeDataAfter;
import com.vci.starter.web.annotation.bus.VciChangeDataBefore;
@@ -1070,11 +1072,12 @@
        com.vci.client.bof.ClientBusinessObject afterCBO = null;
        try {
//            BusinessObject resultBO = platformClientUtil.getBOFactoryService().createBusinessObject(resultCbo.getObj().getBusinessObject(),false,false);
//            com.vci.corba.omd.data.BusinessObject resultBO = ServiceProvider.getBOFService().createBusinessObject(resultCbo.getObj().getBusinessObject(),false,false);
            com.vci.corba.omd.data.BusinessObject resultBO = ServiceProvider.getBOFService().createBusinessObject(resultCbo.getObj().getBusinessObject(),false,false);
            afterCBO = new com.vci.client.bof.ClientBusinessObject();
            afterCBO.setBusinessObject(resultBO);
            result.setObj(boService.cbo2Map(afterCBO));
        } catch (VCIError vciError) {
        } catch (PLException vciError) {
            throw WebUtil.getVciBaseException(vciError);
        }
        if(!CollectionUtils.isEmpty(formDataDTO.getReleaseFileOids())){
@@ -1089,7 +1092,7 @@
            try {
//                platformClientUtil.getBOFactoryService().deleteBusinessObject(afterCBO.getBusinessObject(),1);
                ServiceProvider.getBOFService().deleteBusinessObject(afterCBO.getBusinessObject(),1);
            } catch (VCIError vciError) {
            } catch (PLException vciError) {
                throw WebUtil.getVciBaseException(vciError);
            }
            throw new VciBaseException(LangBaseUtil.getErrorMsg(e),new String[]{},e);
@@ -1135,7 +1138,7 @@
        Map<String,String> baseDataMap = formDataDTO2MapLow(formDataDTO);
        Map<String,String> allDataMapLow = new HashMap<>();
        allDataMapLow.putAll(dataLow);
        allDataMapLow.putAll(baseDataMap);
//        allDataMapLow.putAll(baseDataMap);
        //判断必输项
        BaseResult result = checkRequired(formDefineVO,null,allDataMapLow);
        if(!result.isSuccess()){
@@ -1353,7 +1356,7 @@
                cbo.setBusinessObject(bo);
                afterCBOs.add(cbo);
            });
        } catch (VCIError vciError) {
        } catch (PLException vciError) {
            throw WebUtil.getVciBaseException(vciError);
        }
        if(!CollectionUtils.isEmpty(releasedFileOids)){
@@ -1409,7 +1412,7 @@
//            platformClientUtil.getBOFactoryService().updateBusinessObject(new BusinessObjectHolder(resultCbo.getObj().getBusinessObject()));
            ServiceProvider.getBOFService().updateBusinessObject(resultCbo.getObj().getBusinessObject());
            result.setObj(boService.cbo2Map(resultCbo.getObj()));
        } catch (VCIError vciError) {
        } catch (PLException vciError) {
            throw WebUtil.getVciBaseException(vciError);
        }
        if(!CollectionUtils.isEmpty(formDataDTO.getReleaseFileOids())){
@@ -1457,7 +1460,7 @@
            com.vci.client.bof.ClientBusinessObject afterCbo = new com.vci.client.bof.ClientBusinessObject();
            afterCbo.setBusinessObject(bo);
            result.setObj(boService.cbo2Map(afterCbo));
        } catch (VCIError vciError) {
        } catch (PLException vciError) {
            throw WebUtil.getVciBaseException(vciError);
        }
        if(!CollectionUtils.isEmpty(formDataDTO.getReleaseFileOids())){
@@ -1611,11 +1614,13 @@
        }
        VciBaseUtil.switchCollectionForOracleIn(finalCbo).stream().forEach(cbos->{
            try {
                platformClientUtil.getBOFactoryService().batchDeleteBusinessObject(cbos.stream().map(s->s.getBusinessObject()).collect(Collectors.toList()).toArray(new BusinessObject[0]),1);
            } catch (VCIError vciError) {
//                platformClientUtil.getBOFactoryService().batchDeleteBusinessObject(cbos.stream().map(s->s.getBusinessObject()).collect(Collectors.toList()).toArray(new BusinessObject[0]),1);
                ServiceProvider.getBOFService().batchDeleteBusinessObject(cbos.stream().map(s->s.getBusinessObject()).collect(Collectors.toList()).toArray(new com.vci.corba.omd.data.BusinessObject[0]),1);
            } catch (PLException vciError) {
                throw WebUtil.getVciBaseException(vciError);
            }
        });
        System.out.println("zheshi shazi ");
        return BaseResult.success();
    }
@@ -1683,7 +1688,7 @@
        try {
//            fromCbo.setBusinessObject(platformClientUtil.getBOFactoryService().readBusinessObject(fromOid,fromBtmName));
            fromCbo.setBusinessObject(ServiceProvider.getBOFService().readBusinessObject(fromOid,fromBtmName));
        } catch (VCIError vciError) {
        } catch (PLException vciError) {
            throw WebUtil.getVciBaseException(vciError);
        }
        String finalPrefix = prefix;
@@ -1721,7 +1726,7 @@
        try {
//            platformClientUtil.getBOFactoryService().createBusinessObjectWithLink(bosHolder,loHolder);
            ServiceProvider.getBOFService().createBusinessObjectWithLink(bos,clo.getLinkObject());
        } catch (VCIError vciError) {
        } catch (PLException vciError) {
            throw WebUtil.getVciBaseException(vciError);
        }
        if(!CollectionUtils.isEmpty(formLinkDataDTO.getReleaseFileOids())){
@@ -1738,7 +1743,7 @@
//                platformClientUtil.getBOFactoryService().deleteLinkObject(clo.getLinkObject());
                ServiceProvider.getBOFService().deleteBusinessObject(toCbo.getBusinessObject(),1);
                ServiceProvider.getBOFService().deleteLinkObject(clo.getLinkObject());
            } catch (VCIError vciError) {
            } catch (PLException vciError) {
                throw WebUtil.getVciBaseException(vciError);
            }
            throw new VciBaseException(LangBaseUtil.getErrorMsg(e),new String[]{},e);
@@ -1777,7 +1782,7 @@
                com.vci.corba.omd.data.LinkObject linkObject = ServiceProvider.getBOFService().readLinkObjectById(formLinkDataDTO.getOid(), formLinkDataDTO.getLinkType());
                clo = new com.vci.client.bof.ClientLinkObject();
                clo.setLinkObject(linkObject);
            } catch (VCIError vciError) {
            } catch (PLException vciError) {
                throw WebUtil.getVciBaseException(vciError);
            }
        }else{
@@ -1939,11 +1944,12 @@
        com.vci.client.bof.ClientBusinessObject cbo = new com.vci.client.bof.ClientBusinessObject();
        String copyfromversion = baseDataMap.get("copyfromversion");
        OsBtmTypeVO btmTypeVO = btmService.getBtmById(btmName);
        List<String> attributeList = btmTypeVO.getAttributes().stream().map(attribute -> attribute.getId()).collect(Collectors.toList());
        if(editFlag || newRevision || newVersion){
            try {
//                cbo.setBusinessObject(platformClientUtil.getBOFactoryService().readBusinessObject(editFlag?oid:copyfromversion,btmName));
                cbo.setBusinessObject(ServiceProvider.getBOFService().readBusinessObject(editFlag?oid:copyfromversion,btmName));
            } catch (VCIError vciError) {
            } catch (PLException vciError) {
                throw new VciBaseException("使用主键在系统中没有查询到数据",new String[]{oid},vciError);
            }
            if(btmTypeVO.isRevisionFlag() && newRevision){
@@ -1975,7 +1981,7 @@
                    LifeCycle lifeCycleVO = null;
                    try {
                        lifeCycleVO = ServiceProvider.getOMDService().getLifeCycleService().getLifeCycle(btmTypeVO.getLifeCycleId());
                    } catch (VCIError e) {
                    } catch (PLException e) {
                        throw new RuntimeException(e);
                    }
                    if(lifeCycleVO == null || StringUtils.isBlank(lifeCycleVO.oid)){
@@ -2001,7 +2007,7 @@
                    LifeCycle lifeCycleVO = null;
                    try {
                        lifeCycleVO = ServiceProvider.getOMDService().getLifeCycleService().getLifeCycle(btmTypeVO.getLifeCycleId());
                    } catch (VCIError e) {
                    } catch (PLException e) {
                        throw new RuntimeException(e);
                    }
                    if(lifeCycleVO == null || StringUtils.isBlank(lifeCycleVO.oid)){
@@ -2068,7 +2074,15 @@
                cbo.setIsFirstV(true);
            }
        }
//        Iterator<Map.Entry<String, String>> iterator = baseDataMap.entrySet().iterator();
//        while(iterator.hasNext()){
//            Map.Entry<String, String> next = iterator.next();
//            if(!attributeList.contains(next.getKey())){
//                iterator.remove();
//            }
//        }
        setValueToCbo(dataLowMap,baseDataMap,cbo,editFlag);
//        cbo.setName(dataLowMap.get("name"));
        return cbo;
    }
@@ -2105,8 +2119,10 @@
                //平台不能传递这个
            }else{
                try {
                    cbo.setAttributeValueWithNoCheck(key, value, !editFlag);
                } catch (VCIError vciError) {
//                    if(!SystemAttribute.bosysAttList().contains(key)){
                        cbo.setAttributeValueWithNoCheck(key, value, !editFlag);
//                    }
                } catch (PLException vciError) {
                    throw new VciBaseException("{0}的值不符合要求,当前是{1}", new String[]{key, value}, vciError);
                }
            }
@@ -2118,16 +2134,20 @@
                if(editFlag) {
                    //编辑的时候可以都设置
                    try {
                        cbo.setAttributeValueWithNoCheck(key, value, !editFlag);
                    } catch (VCIError vciError) {
//                        if(!SystemAttribute.bosysAttList().contains(key)){
                            cbo.setAttributeValueWithNoCheck(key, value, !editFlag);
//                        }
                    } catch (PLException vciError) {
                        throw new VciBaseException("{0}的值不符合要求,当前是{1}", new String[]{key, value}, vciError);
                    }
                }else{
                    //只需要处理id,name,description,密级即可,其余的都已经被设置了
                    if(basicFields.contains(key) &&StringUtils.isNotBlank(value)){
                        try {
                            cbo.setAttributeValueWithNoCheck(key, value, true);
                        } catch (VCIError vciError) {
//                            if(!SystemAttribute.bosysAttList().contains(key)){
                                cbo.setAttributeValueWithNoCheck(key, value, true);
//                            }
                        } catch (PLException vciError) {
                            throw new VciBaseException("{0}的值不符合要求,当前是{1}", new String[]{key, value}, vciError);
                        }
                    }
@@ -2211,7 +2231,7 @@
        try {
//            platformClientUtil.getBOFactoryService().updateLinkObject(loHolder);
            ServiceProvider.getBOFService().updateLinkObject(clo.getLinkObject());
        } catch (VCIError vciError) {
        } catch (PLException vciError) {
            throw WebUtil.getVciBaseException(vciError);
        }
        //保存to端或者from端
@@ -2221,7 +2241,7 @@
        try{
//            platformClientUtil.getBOFactoryService().updateBusinessObject(boHolder);
            ServiceProvider.getBOFService().updateBusinessObject(toCbo.getBusinessObject());
        } catch (VCIError vciError) {
        } catch (PLException vciError) {
            throw WebUtil.getVciBaseException(vciError);
        }
        if(!CollectionUtils.isEmpty(formLinkDataDTO.getReleaseFileOids())){