From f07aca58c4e1d96c8e75c90b021b00c593bcffff Mon Sep 17 00:00:00 2001
From: yuxc <yuxc@vci-tech.com>
Date: 星期二, 28 五月 2024 11:36:17 +0800
Subject: [PATCH] 1、平台接口修改以及web端后台的修改。 2、对平台的更新jar包上传。

---
 Source/platformProject/vci-platform-web/src/main/java/com/vci/web/service/impl/UIDataServiceImpl.java |   66 +++++++++++++++++++++-----------
 1 files changed, 43 insertions(+), 23 deletions(-)

diff --git a/Source/platformProject/vci-platform-web/src/main/java/com/vci/web/service/impl/UIDataServiceImpl.java b/Source/platformProject/vci-platform-web/src/main/java/com/vci/web/service/impl/UIDataServiceImpl.java
index cf07387..1407ee0 100644
--- a/Source/platformProject/vci-platform-web/src/main/java/com/vci/web/service/impl/UIDataServiceImpl.java
+++ b/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{
                     //鍙渶瑕佸鐞唅d,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绔垨鑰協rom绔�
@@ -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())){

--
Gitblit v1.9.3