dangsn
2024-06-05 f29ad099c6dc5c55d6cb94fb190d06743777ec6d
Source/platformProject/vci-platform-web/src/main/java/com/vci/web/service/impl/UIDataServiceImpl.java
@@ -1,13 +1,15 @@
package com.vci.web.service.impl;
import com.vci.client.bof.ClientLinkObject;
import com.vci.client.bof.RevisionValueObject;
import com.vci.client.bof.VersionValueObject;
import com.vci.client.common.providers.ServiceProvider;
import com.vci.corba.common.PLException;
import com.vci.corba.common.VCIError;
import com.vci.corba.omd.data.*;
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;
@@ -21,10 +23,8 @@
import com.vci.starter.web.util.*;
import com.vci.starter.web.wrapper.VciQueryWrapperForDO;
import com.vci.web.dto.*;
import com.vci.web.enumpck.UIComponentTypeEnum;
import com.vci.web.enumpck.UIFieldTypeEnum;
import com.vci.web.enumpck.UITreeLoadTypeEnum;
import com.vci.web.model.BaseLinkModel;
import com.vci.web.pageModel.*;
import com.vci.web.query.UIDataGridQuery;
import com.vci.web.query.UIFormQuery;
@@ -37,9 +37,6 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import plm.bs.bom.clientobject.*;
import plm.bs.bom.common.*;
import plm.corba.qt.BOAndLO;
import java.lang.reflect.Method;
import java.util.*;
@@ -1072,8 +1069,8 @@
        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);
//            BusinessObject resultBO = ServiceProvider.getBOFService().createBusinessObject(resultCbo.getObj().getBusinessObject(),false,false);
            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));
@@ -1249,7 +1246,7 @@
                baseModel.setRevisionValue("");
            }
            return  changeRevisionValueInfoToObject(platformClientUtil.getBOFactoryService().getNextRevisionValueObject(WebUtil.getTableName(btmTypeVO.getId()),baseModel.getNameOid(),btmTypeVO.getRevisionRuleId(),btmTypeVO.isInputRevisionFlag(),baseModel.getRevisionValue()));
        } catch (VCIError vciError) {
        } catch (PLException vciError) {
            throw WebUtil.getVciBaseException(vciError);
        }
    }
@@ -1273,10 +1270,10 @@
     * @return 版本的值对象
     */
    @Override
    public VersionValueObject getNextVersion(OsBtmTypeVO btmTypeVO,BaseModel baseModel){
    public VersionValueObject getNextVersion(OsBtmTypeVO btmTypeVO, BaseModel baseModel){
        try{
            return changeRevisionValueInfoToObject(platformClientUtil.getBOFactoryService().getNextVersionValue(WebUtil.getTableName(btmTypeVO.getId()),baseModel.getRevisionOid(),baseModel.getNameOid(),WebUtil.getInt(btmTypeVO.getVersionRule())));
        }catch (VCIError vciError){
        }catch (PLException vciError){
            throw WebUtil.getVciBaseException(vciError);
        }
    }
@@ -1332,8 +1329,8 @@
            return beforeResult;
        }
        //封装数据
        List<com.vci.corba.omd.data.BusinessObject> addBos = new ArrayList<>();
        List<com.vci.corba.omd.data.BusinessObject> afterBOs = new ArrayList<>();
        List<BusinessObject> addBos = new ArrayList<>();
        List<BusinessObject> afterBOs = new ArrayList<>();
        List<com.vci.client.bof.ClientBusinessObject> afterCBOs = new ArrayList<>();
        Map<String,List<String>> releasedFileOids = new HashMap<>();
        for(FormDataDTO formDataDTO:formDataDTOList.getFormDataDTOS()) {
@@ -1348,8 +1345,8 @@
            }
        }
        try {
//            com.vci.corba.omd.data.BusinessObject[] resultBOs = platformClientUtil.getBOFactoryService().batchCreateBusinessObject(addBos.toArray(new BusinessObject[0]), false, false);
            com.vci.corba.omd.data.BusinessObject[] resultBOs = ServiceProvider.getBOFService().batchCreateBusinessObject(addBos.toArray(new com.vci.corba.omd.data.BusinessObject[0]), false, false);
//            BusinessObject[] resultBOs = platformClientUtil.getBOFactoryService().batchCreateBusinessObject(addBos.toArray(new BusinessObject[0]), false, false);
            BusinessObject[] resultBOs = ServiceProvider.getBOFService().batchCreateBusinessObject(addBos.toArray(new BusinessObject[0]), false, false);
            afterBOs = Arrays.stream(resultBOs).collect(Collectors.toList());
            Arrays.stream(resultBOs).forEach(bo->{
                com.vci.client.bof.ClientBusinessObject cbo = new com.vci.client.bof.ClientBusinessObject();
@@ -1372,7 +1369,7 @@
            //说明后置事件出现了错误,那么就需要删除以前的这条数据
            try {
                platformClientUtil.getBOFactoryService().batchDeleteBusinessObject(afterBOs.toArray(new BusinessObject[0]),1);
            } catch (VCIError vciError) {
            } catch (PLException vciError) {
                throw WebUtil.getVciBaseException(vciError);
            }
            throw new VciBaseException(LangBaseUtil.getErrorMsg(e),new String[]{},e);
@@ -1456,7 +1453,7 @@
        BaseResult<Map<String,Object>> result = BaseResult.success();
        try {
//            BusinessObject bo = platformClientUtil.getBOFactoryService().createBusinessObject(resultCbo.getObj().getBusinessObject(),formDataDTO.isUpVersion()?false:true,formDataDTO.isUpVersion());
            com.vci.corba.omd.data.BusinessObject bo = ServiceProvider.getBOFService().createBusinessObject(resultCbo.getObj().getBusinessObject(),formDataDTO.isUpVersion()?false:true,formDataDTO.isUpVersion());
            BusinessObject bo = ServiceProvider.getBOFService().createBusinessObject(resultCbo.getObj().getBusinessObject(),formDataDTO.isUpVersion()?false:true,formDataDTO.isUpVersion());
            com.vci.client.bof.ClientBusinessObject afterCbo = new com.vci.client.bof.ClientBusinessObject();
            afterCbo.setBusinessObject(bo);
            result.setObj(boService.cbo2Map(afterCbo));
@@ -1497,7 +1494,7 @@
            return beforeResult;
        }
        //封装数据
        List<com.vci.corba.omd.data.BusinessObject> updateCBOS = new ArrayList<>();
        List<BusinessObject> updateCBOS = new ArrayList<>();
        Map<String,List<String>> releasedFileOids = new HashMap<>();
        List<com.vci.client.bof.ClientBusinessObject> afterCBOs = new ArrayList<>();
        for(FormDataDTO formDataDTO:formDataDTOList.getFormDataDTOS()) {
@@ -1512,8 +1509,8 @@
            }
        }
        try {
            platformClientUtil.getBOFactoryService().batchUpdateBusinessObject(new BusinessObjectListHolder(updateCBOS.toArray(new BusinessObject[0])));
        } catch (VCIError vciError) {
            platformClientUtil.getBOFactoryService().batchUpdateBusinessObject(updateCBOS.toArray(new BusinessObject[updateCBOS.size()]));
        } catch (PLException vciError) {
            throw WebUtil.getVciBaseException(vciError);
        }
        if(!CollectionUtils.isEmpty(releasedFileOids)){
@@ -1615,7 +1612,7 @@
        VciBaseUtil.switchCollectionForOracleIn(finalCbo).stream().forEach(cbos->{
            try {
//                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);
                ServiceProvider.getBOFService().batchDeleteBusinessObject(cbos.stream().map(s->s.getBusinessObject()).collect(Collectors.toList()).toArray(new BusinessObject[0]),1);
            } catch (PLException vciError) {
                throw WebUtil.getVciBaseException(vciError);
            }
@@ -1719,7 +1716,7 @@
            clo.setToBO(toCbo);
        }
        //执行保存
        com.vci.corba.omd.data.BusinessObject[] bos = new com.vci.corba.omd.data.BusinessObject[1];
        BusinessObject[] bos = new BusinessObject[1];
        toCbo.dealBusinessObjectNullValue();
        clo.dealLinkObjectNullValue();
        bos[0] = toCbo.getBusinessObject();
@@ -1775,18 +1772,18 @@
            return result;
        }
        //处理业务类型得到数据
        com.vci.client.bof.ClientLinkObject clo ;
        ClientLinkObject clo ;
        if(editFlag){
            try {
//                LinkObject linkObject = platformClientUtil.getBOFactoryService().readLinkObjectById(formLinkDataDTO.getOid(), formLinkDataDTO.getLinkType());
                com.vci.corba.omd.data.LinkObject linkObject = ServiceProvider.getBOFService().readLinkObjectById(formLinkDataDTO.getOid(), formLinkDataDTO.getLinkType());
                clo = new com.vci.client.bof.ClientLinkObject();
                LinkObject linkObject = ServiceProvider.getBOFService().readLinkObjectById(formLinkDataDTO.getOid(), formLinkDataDTO.getLinkType());
                clo = new ClientLinkObject();
                clo.setLinkObject(linkObject);
            } catch (PLException vciError) {
                throw WebUtil.getVciBaseException(vciError);
            }
        }else{
            clo = new com.vci.client.bof.ClientLinkObject();
            clo = new ClientLinkObject();
            //处理初始化的数据
            clo.setOid(VciBaseUtil.getPk());
            clo.setCreator(VciBaseUtil.getCurrentUserId());
@@ -2335,14 +2332,14 @@
        });
        try {
            platformClientUtil.getBOFactoryService().batchDeleteLinkObject(los.toArray(new LinkObject[0]));
        } catch (VCIError vciError) {
        } catch (PLException vciError) {
            throw WebUtil.getVciBaseException(vciError);
        }
        if(deleteLinkDataDTO.isDeleteFromData()){
            fromBtmDataGroups.forEach((btm,cbos)->{
                try{
                    platformClientUtil.getBOFactoryService().batchDeleteBusinessObject(cbos.stream().map(com.vci.client.bof.ClientBusinessObject::getBusinessObject).toArray(BusinessObject[] :: new),1);
                }catch (VCIError vciError) {
                }catch (PLException vciError) {
                    throw WebUtil.getVciBaseException(vciError);
                }
            });
@@ -2351,7 +2348,7 @@
            toBtmDataGroups.forEach((btm,cbos)->{
                try{
                    platformClientUtil.getBOFactoryService().batchDeleteBusinessObject(cbos.stream().map(com.vci.client.bof.ClientBusinessObject::getBusinessObject).toArray(BusinessObject[] :: new),1);
                }catch (VCIError vciError) {
                }catch (PLException vciError) {
                    throw WebUtil.getVciBaseException(vciError);
                }
            });