From ac3f3629a261770f573f27e5e23f7ec19d096c2a Mon Sep 17 00:00:00 2001
From: xiejun <xiejun@vci-tech.com>
Date: 星期三, 04 九月 2024 18:29:05 +0800
Subject: [PATCH] UI授权功能查询

---
 Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/UIDataServiceImpl.java |   42 +++++++++++++++++++++---------------------
 1 files changed, 21 insertions(+), 21 deletions(-)

diff --git a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/UIDataServiceImpl.java b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/UIDataServiceImpl.java
index 8f0443d..5d53a0d 100644
--- a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/UIDataServiceImpl.java
+++ b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/UIDataServiceImpl.java
@@ -1,14 +1,14 @@
 package com.vci.web.service.impl;
 
-import com.vci.client.common.providers.ClientServiceProvider;
 import com.vci.corba.common.PLException;
 import com.vci.corba.framework.data.UserInfo;
 import com.vci.corba.omd.data.*;
 import com.vci.corba.omd.lcm.LifeCycle;
-import com.vci.file.pagemodel.VciFileObjectVO;
+import com.vci.dto.*;
 import com.vci.frameworkcore.lcstatuspck.FrameworkDataLCStatus;
 import com.vci.frameworkcore.lcstatuspck.ReleaseDataLCStatus;
 import com.vci.omd.utils.ObjectTool;
+import com.vci.pagemodel.*;
 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 +21,9 @@
 import com.vci.starter.web.pagemodel.*;
 import com.vci.starter.web.util.*;
 import com.vci.starter.web.wrapper.VciQueryWrapperForDO;
-import com.vci.web.dto.*;
+import com.vci.web.enumpck.DeleteTypeEnum;
 import com.vci.web.enumpck.UIFieldTypeEnum;
 import com.vci.web.enumpck.UITreeLoadTypeEnum;
-import com.vci.web.pageModel.*;
 import com.vci.web.query.UIDataGridQuery;
 import com.vci.web.query.UIFormQuery;
 import com.vci.web.query.UILinkTypeDataQuery;
@@ -42,7 +41,8 @@
 import java.util.*;
 import java.util.stream.Collectors;
 
-import static com.vci.frameworkcore.constant.FrameWorkBusLangCodeConstant.DATA_OID_NOT_EXIST;
+import static com.vci.constant.FrameWorkBusLangCodeConstant.DATA_OID_NOT_EXIST;
+
 
 /**
  * UI涓婄殑鏁版嵁鏌ヨ
@@ -762,7 +762,7 @@
      * @throws VciBaseException 閰嶇疆鎴栬�呮槸璋冪敤涓嶆垚鍔熺殑鏃跺�欙紝浼氭姏鍑哄紓甯�
      */
     @Override
-    public BaseResult callPreEvent(BaseModelDTOList baseModelDTOList,BaseLinkModelDTOList baseLinkModelDTOList, String preEvent, VciChangeDocumentTypeEnum businessType) throws VciBaseException{
+    public BaseResult callPreEvent(BaseModelDTOList baseModelDTOList, BaseLinkModelDTOList baseLinkModelDTOList, String preEvent, VciChangeDocumentTypeEnum businessType) throws VciBaseException{
         if((baseModelDTOList == null || CollectionUtils.isEmpty(baseModelDTOList.getDataList())) && (baseLinkModelDTOList == null || CollectionUtils.isEmpty(baseLinkModelDTOList.getDataList()))){
             return BaseResult.success();
         }
@@ -1364,7 +1364,7 @@
         }catch (Throwable e){
             //璇存槑鍚庣疆浜嬩欢鍑虹幇浜嗛敊璇紝閭d箞灏遍渶瑕佸垹闄や互鍓嶇殑杩欐潯鏁版嵁
             try {
-                platformClientUtil.getBOFactoryService().batchDeleteBusinessObject(afterBOs.toArray(new BusinessObject[0]),1);
+                platformClientUtil.getBOFactoryService().batchDeleteBusinessObject(afterBOs.toArray(new BusinessObject[0]),DeleteTypeEnum.OID_AND_TS.getValue());
             } catch (PLException vciError) {
                 throw WebUtil.getVciBaseException(vciError);
             }
@@ -1684,13 +1684,6 @@
             throw new VciBaseException(formLinkDataDTO.isDirection()?"from绔�":"to绔�" + "鐨勪笟鍔$被鍨嬩负绌�");
         }
 
-        //鏌ヨfrom绔殑
-        BusinessObject fromCbo = new BusinessObject();
-        try {
-            fromCbo = platformClientUtil.getBOFService().readBusinessObject(fromOid,fromBtmName);
-        } catch (PLException vciError) {
-            throw WebUtil.getVciBaseException(vciError);
-        }
         String finalPrefix = prefix;
         formLinkDataDTO.getData().forEach((key, value)->{
             if(key.toLowerCase().startsWith(finalPrefix)){
@@ -1711,10 +1704,12 @@
             return BaseResult.fail(resultClo.getMsg(),resultClo.getMsgObjs());
         }
         clo = resultClo.getObj();
+        if(StringUtils.isBlank(clo.toOid)){
+            clo.toOid = toCbo.oid;
+        }
         //鎵ц淇濆瓨
         BusinessObject[] bos = new BusinessObject[1];
         ObjectTool.dealBusinessObjectNullValue(toCbo);
-        ObjectTool.dealLinkObjectNullValue(clo);
         bos[0] = toCbo;
         try {
             platformClientUtil.getBOFService().createBusinessObjectWithLink(bos,clo);
@@ -1769,7 +1764,6 @@
         if(editFlag){
             try {
                 LinkObject linkObject = platformClientUtil.getBOFService().readLinkObjectById(formLinkDataDTO.getOid(), formLinkDataDTO.getLinkType());
-                clo = new LinkObject();
                 clo = linkObject;
             } catch (PLException vciError) {
                 throw WebUtil.getVciBaseException(vciError);
@@ -1782,6 +1776,14 @@
             clo.createTime = System.currentTimeMillis();
             clo.ts = System.currentTimeMillis();
             clo.ltName = formLinkDataDTO.getLinkType();
+            clo.toOid = formLinkDataDTO.getToid();
+            clo.toNameOid = formLinkDataDTO.getTnameoid();
+            clo.toRevOid = formLinkDataDTO.getTrevisionoid();
+            clo.toBTName = formLinkDataDTO.getTbtmname();
+            clo.fromOid = formLinkDataDTO.getFoid();
+            clo.fromBTName = formLinkDataDTO.getFbtmname();
+            clo.fromNameOid = formLinkDataDTO.getFnameoid();
+            clo.fromRevOid = formLinkDataDTO.getFrevisionoid();
         }
         //
         LinkObject finalClo = clo;
@@ -2040,7 +2042,7 @@
                     if (ruleVO == null || StringUtils.isBlank(ruleVO.getOid())) {
                         throw new VciBaseException("{0}閲岀殑鐗堟湰瑙勫垯璁剧疆寰椾笉姝g‘锛屽湪绯荤粺涓病鏈夋壘鍒皗1}杩欎釜鐗堟湰瑙勫垯", new String[]{btmTypeVO.getName(), btmTypeVO.getRevisionRuleId()});
                     }
-                    cbo.revisionValue = ruleVO.getStartCode();
+                    cbo.revisionValue = ruleVO.getInitialValue();
                 }
                 if (StringUtils.isBlank(cbo.nameoid)) {
                     cbo.nameoid = VciBaseUtil.getPk();
@@ -2158,8 +2160,6 @@
         String prefix = formLinkDataDTO.isDirection()?LO_FROM_PREFIX:LO_TO_PREFIX;
         String toOid = formLinkDataDTO.isDirection()?formLinkDataDTO.getFoid():formLinkDataDTO.getToid();
         String toBtmName =  formLinkDataDTO.isDirection()?formLinkDataDTO.getFbtmname():formLinkDataDTO.getTbtmname();
-        String fromOid = formLinkDataDTO.isDirection()?formLinkDataDTO.getToid():formLinkDataDTO.getFoid();
-        String fromBtmName = formLinkDataDTO.isDirection()?formLinkDataDTO.getTbtmname():formLinkDataDTO.getFbtmname();
 
         Map<String,String> boData = new HashMap<>();
         Map<String,String> loData = new HashMap<>();
@@ -2296,7 +2296,7 @@
         if(deleteLinkDataDTO.isDeleteFromData()){
             fromBtmDataGroups.forEach((btm,cbos)->{
                 try{
-                    platformClientUtil.getBOFactoryService().batchDeleteBusinessObject(cbos.toArray(new BusinessObject[0]),1);
+                    platformClientUtil.getBOFactoryService().batchDeleteBusinessObject(cbos.toArray(new BusinessObject[0]), DeleteTypeEnum.OID_AND_TS.getValue());
                 }catch (PLException vciError) {
                     throw WebUtil.getVciBaseException(vciError);
                 }
@@ -2305,7 +2305,7 @@
         if(deleteLinkDataDTO.isDeleteToData()){
             toBtmDataGroups.forEach((btm,cbos)->{
                 try{
-                    platformClientUtil.getBOFactoryService().batchDeleteBusinessObject(cbos.toArray(new BusinessObject[0]),1);
+                    platformClientUtil.getBOFactoryService().batchDeleteBusinessObject(cbos.toArray(new BusinessObject[0]),DeleteTypeEnum.OID_AND_TS.getValue());
                 }catch (PLException vciError) {
                     throw WebUtil.getVciBaseException(vciError);
                 }

--
Gitblit v1.9.3