From d0ae279ff3b83358d1c07f4481a041c4ad335026 Mon Sep 17 00:00:00 2001
From: dangsn <dangsn@chicecm.com>
Date: 星期二, 03 十二月 2024 11:57:38 +0800
Subject: [PATCH] 提取业务系统使用的功能,独立出一个单独的模块

---
 Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/UIDataServiceImpl.java |  937 ++++++++++++++++++++++++++++++++++------------------------
 1 files changed, 548 insertions(+), 389 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 dc56825..1ce66c2 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,15 +1,26 @@
 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.client.common.oq.OQTool;
+import com.vci.common.qt.object.QueryTemplate;
 import com.vci.corba.common.PLException;
-import com.vci.corba.omd.data.*;
+import com.vci.corba.framework.data.UserInfo;
+import com.vci.corba.omd.data.BusinessObject;
+import com.vci.corba.omd.data.LinkObject;
+import com.vci.corba.omd.data.RevisionDataInfo;
+import com.vci.corba.omd.data.VersionDataInfo;
 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.corba.omd.ltm.LinkType;
+import com.vci.corba.omd.qtm.QTInfo;
+import com.vci.corba.query.data.BOAndLO;
+import com.vci.dto.*;
+import com.vci.lcstatuspck.FrameworkDataLCStatus;
+import com.vci.lcstatuspck.ReleaseDataLCStatus;
+import com.vci.omd.utils.ObjectTool;
+import com.vci.pagemodel.*;
+import com.vci.query.UIDataGridQuery;
+import com.vci.query.UIFormQuery;
+import com.vci.query.UILinkTypeDataQuery;
+import com.vci.query.UITreeQuery;
 import com.vci.starter.revision.bo.TreeWrapperOptions;
 import com.vci.starter.web.annotation.bus.VciChangeDataAfter;
 import com.vci.starter.web.annotation.bus.VciChangeDataBefore;
@@ -21,28 +32,27 @@
 import com.vci.starter.web.model.BaseModel;
 import com.vci.starter.web.pagemodel.*;
 import com.vci.starter.web.util.*;
+import com.vci.starter.web.util.Lcm.Func;
 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;
-import com.vci.web.query.UITreeQuery;
 import com.vci.web.service.*;
 import com.vci.web.util.PlatformClientUtil;
 import com.vci.web.util.WebUtil;
 import org.apache.commons.lang3.StringUtils;
+import org.dom4j.DocumentHelper;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
 import org.springframework.util.CollectionUtils;
 
 import java.lang.reflect.Method;
 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涓婄殑鏁版嵁鏌ヨ
@@ -69,6 +79,11 @@
      */
     @Autowired
     private OsBtmServiceI btmService;
+    /**
+     * 灞炴�ф湇鍔�
+     */
+    @Autowired
+    private OsAttributeServiceI attrService;
 
     /**
      * 閾炬帴绫诲瀷
@@ -130,11 +145,11 @@
      * @throws VciBaseException 鏌ヨ鍑洪敊鐨勬椂鍊欎細鎶涘嚭寮傚父
      */
     @Override
-    public DataGrid getDataForGrid(UIDataGridQuery dataGridQuery) throws VciBaseException {
+    public DataGrid getDataForGrid(UIDataGridQuery dataGridQuery) throws VciBaseException, PLException {
         VciBaseUtil.alertNotNull(dataGridQuery,"鏌ヨ瀵硅薄",dataGridQuery.getBtmname(),"涓氬姟绫诲瀷",dataGridQuery.getTableDefineId());
         //鍏堝垽鏂煡璇㈡ā鏉�
-        UITableDefineVO tableDefineVO = uiEngineService.getComponentByOid(dataGridQuery.getComponentOid()).getTableDefineVO();
-        String queryTemplate = !CollectionUtils.isEmpty(dataGridQuery.getSourceData())?dataGridQuery.getSourceData().getOrDefault("querytemplate",tableDefineVO.getQueryTemplateName()):tableDefineVO.getQueryTemplateName();
+        UITableDefineVO tableDefineVO = uiEngineService.getComponentByOid(dataGridQuery.getComponentOid(),null).getTableDefineVO();
+        String queryTemplate = !CollectionUtils.isEmpty(dataGridQuery.getSourceData())? (String) dataGridQuery.getSourceData().getOrDefault("querytemplate",tableDefineVO.getQueryTemplateName()) :tableDefineVO.getQueryTemplateName();
         if(StringUtils.isBlank(queryTemplate)){
             //璇存槑娌℃湁璁剧疆鏌ヨ妯℃澘锛岄渶瑕佺湅鐪嬪湪杩欎釜琛ㄦ牸鎵�鍦ㄧ殑缁勪欢鏈夋病鏈夎缃�
             tableDefineVO = uiEngineService.getTableById(dataGridQuery.getBtmname(), dataGridQuery.getTableDefineId());
@@ -171,14 +186,15 @@
             queryFieldList.addAll(linkTypeVO.getAttributes().stream().map(OsLinkTypeAttributeVO::getId).collect(Collectors.toList()));
             queryFieldList.addAll(WebLoServiceImpl.LO_BASE_FIELD_MAP.values());
         }else{
-            btmTypeVO = btmService.getBtmById(dataGridQuery.getBtmname());
+            //btmTypeVO = btmService.getBtmById(dataGridQuery.getBtmname());
+            btmTypeVO = btmService.getBtmByName(dataGridQuery.getBtmname());
             queryFieldList.addAll(btmTypeVO.getAttributes().stream().map(OsBtmTypeAttributeVO::getId).collect(Collectors.toList()));
             queryFieldList.addAll(WebBoServiceImpl.BO_BASE_FIELD_MAP.values());
         }
         queryFieldList.add("creator_name");
         queryFieldList.add("lastmodifier_name");
         //鎴戜滑鍦ㄥ悗鍙版煡璇笟鍔℃暟鎹�
-        Map<String, String> replaceMap = wrapperReplaceMap( dataGridQuery.getSourceData());
+        Map<String, Object> replaceMap = wrapperReplaceMap(dataGridQuery.getSourceData());
 
         if(dataGridQuery.isLinkTypeFlag()){
             UILinkTypeDataQuery linkTypeDataQuery = new UILinkTypeDataQuery();
@@ -192,8 +208,9 @@
             }
             return loService.queryGridByScheme(linkTypeDataQuery);
         }else {
-            return boService.queryGridByScheme(queryTemplate,
+            DataGrid dataGrid = boService.queryGridByScheme(queryTemplate,
                     dataGridQuery.getConditionMap(), replaceMap, dataGridQuery.getPageHelper(), queryFieldList.stream().collect(Collectors.toList()));
+            return dataGrid;
         }
         //鐢熷懡鍛ㄦ湡鍦ㄥ叾涓煡璇㈠悗灏变細澶勭悊
         //鏋氫妇涔熶細琚鐞嗕簡
@@ -207,10 +224,10 @@
      * @throws VciBaseException 鏌ヨ鍑洪敊鐨勬椂鍊欎細鎶涘嚭寮傚父
      */
     @Override
-    public UIFormDataVO getDataForForm(UIFormQuery formQuery) throws VciBaseException {
+    public UIFormDataVO getDataForForm(UIFormQuery formQuery) throws VciBaseException, PLException {
         VciBaseUtil.alertNotNull(formQuery,"琛ㄥ崟鐨勬煡璇㈠璞�",formQuery.getBtmname(),"涓氬姟绫诲瀷鐨勪俊鎭�",formQuery.getOid(),"涓氬姟鏁版嵁鐨勪富閿�",formQuery.getFormDefineId(),"琛ㄥ崟鐨勫畾涔夌紪鍙�");
         UIFormDefineVO formDefineVO = uiEngineService.getFormById(formQuery.getBtmname(),formQuery.getFormDefineId());
-        String queryTemplate = !CollectionUtils.isEmpty(formQuery.getSourceData())?formQuery.getSourceData().getOrDefault("querytemplate",formDefineVO.getQueryTemplateName()):formDefineVO.getQueryTemplateName();
+        String queryTemplate = !CollectionUtils.isEmpty(formQuery.getSourceData())? (String) formQuery.getSourceData().getOrDefault("querytemplate",formDefineVO.getQueryTemplateName()) :formDefineVO.getQueryTemplateName();
         Set<String> queryFieldList = formDefineVO.getItems().stream().filter(s->!UIFieldTypeEnum.CUSTOM.getValue().equalsIgnoreCase(s.getType())).map(UIFormItemVO::getField).collect(Collectors.toSet());
         //鑾峰彇鍙傜収
         List<UIFormItemVO> referFieldList = formDefineVO.getItems().stream().filter(s -> UIFieldTypeEnum.REFER.getValue().equalsIgnoreCase(s.getType())).collect(Collectors.toList());
@@ -237,17 +254,17 @@
             queryFieldList.addAll(linkTypeVO.getAttributes().stream().map(OsLinkTypeAttributeVO::getId).collect(Collectors.toList()));
             queryFieldList.addAll(WebLoServiceImpl.LO_BASE_FIELD_MAP.values());
         }else{
-            btmTypeVO = btmService.getBtmById(formQuery.getBtmname());
+            btmTypeVO = btmService.getBtmByName(formQuery.getBtmname());
             queryFieldList.addAll(btmTypeVO.getAttributes().stream().map(OsBtmTypeAttributeVO::getId).collect(Collectors.toList()));
         }
         queryFieldList.add("creator_name");
         queryFieldList.add("lastmodifier_name");
         Map<String,String> conditionMap = WebUtil.getOidQuery(formQuery.getOid());
-        Map<String, String> replaceMap = wrapperReplaceMap(formQuery.getSourceData());
+        Map<String, Object> replaceMap = wrapperReplaceMap(formQuery.getSourceData());
         UIFormDataVO formDataVO = new UIFormDataVO();
         replaceMap.put("oid", formQuery.getOid().trim());
         if(!formDefineVO.isLinkTypeFlag()) {
-            List<com.vci.client.bof.ClientBusinessObject> cbos = null;
+            List<BusinessObject> cbos = null;
             if (StringUtils.isNotBlank(queryTemplate)) {
                 replaceMap.put("oid", formQuery.getOid().trim());
                 cbos = boService.queryCBOByScheme(queryTemplate, conditionMap, replaceMap, null, queryFieldList.stream().collect(Collectors.toList()));
@@ -256,7 +273,7 @@
                 cbos = boService.queryCBO(formQuery.getBtmname(), conditionMap, null, queryFieldList.stream().collect(Collectors.toList()));
             }
             if (!CollectionUtils.isEmpty(cbos)) {
-                com.vci.client.bof.ClientBusinessObject cbo = cbos.get(0);
+                BusinessObject cbo = cbos.get(0);
                 formDataVO.setData(boService.cbo2Map(cbo));
             } else {
                 throw new VciBaseException(DATA_OID_NOT_EXIST);
@@ -313,13 +330,14 @@
      * @param sourceDataMap 鏉ユ簮鏁版嵁
      * @return 鏇挎崲鍚庣殑鍊�
      */
-    private Map<String,String> wrapperReplaceMap(Map<String,String> sourceDataMap){
-        Map<String,String> replaceMap =!CollectionUtils.isEmpty(sourceDataMap)? sourceDataMap:new HashMap<>();
+    private Map<String,Object> wrapperReplaceMap(Map<String,Object> sourceDataMap){
+        Map<String,Object> replaceMap =!CollectionUtils.isEmpty(sourceDataMap)? sourceDataMap:new HashMap<>();
         if(!replaceMap.containsKey("f_oid")){
             replaceMap.put("f_oid",replaceMap.getOrDefault("oid",""));
         }
-        if(replaceMap.get("f_oid").contains(TREE_NODE_ID_SEP)){
-            replaceMap.put("f_oid",replaceMap.get("f_oid").split(TREE_NODE_ID_SEP)[1]);
+        String fOid = replaceMap.get("f_oid").toString();
+        if(fOid.contains(TREE_NODE_ID_SEP)){
+            replaceMap.put("f_oid",fOid.split(TREE_NODE_ID_SEP)[1]);
         }
         return replaceMap;
     }
@@ -337,9 +355,10 @@
      * @throws VciBaseException 鏌ヨ鍑洪敊鐨勬椂鍊欎細鎶涘嚭寮傚父
      */
     @Override
-    public List<Tree> getDataForTree(UITreeQuery treeQuery) throws VciBaseException {
+    public List<UIDataTree> getDataForTree(UITreeQuery treeQuery) throws Exception {
         VciBaseUtil.alertNotNull(treeQuery,"琛ㄥ崟鐨勬煡璇㈠璞�",treeQuery.getBtmname(),"涓氬姟绫诲瀷鐨勪俊鎭�",treeQuery.getComponentOid(),"鏍戞墍鍦ㄧ殑缁勪欢鐨勪富閿�");
-        UIComponentVO componentVO = uiEngineService.getComponentByOid(treeQuery.getComponentOid());
+        Map<String, OsAttributeVO> attributeVOMap = attrService.selectAllAttributeMap();
+        UIComponentVO componentVO = uiEngineService.getComponentByOid(treeQuery.getComponentOid(),attributeVOMap);
         if(componentVO == null || StringUtils.isBlank(componentVO.getOid())){
             throw new VciBaseException("鏍戠殑閰嶇疆淇℃伅娌℃湁鑾峰彇鍒�");
         }
@@ -351,14 +370,21 @@
         if(!treeQuery.isLinkTypeFlag() && StringUtils.isBlank(treeQuery.getParentBtmName())){
             treeQuery.setParentBtmName(treeQuery.getBtmname());
         }
-
+        //TODO: 鏇挎崲鏍戝畾涔変笂鐨勬鍙嶅悜鏌ヨ灞炴�э紝鍥犱负姝e弽鍚戞煡璇㈡槸鐢遍摼鎺ョ被鍨嬫煡璇㈡ā鏉夸笂鎺у埗鐨�
+        boolean isOrientation = false; //鏄惁鍙嶅悜锛屼娇鐢ㄦā鏉夸笂閰嶇疆鐨�
+        String qtName = treeDefineVO.getQueryTemplateName();
+        if(Func.isNotBlank(treeDefineVO.getLinkType()) && Func.isNotBlank(qtName)){
+            QTInfo wrapper = platformClientUtil.getQTDService().getQT(qtName);
+            QueryTemplate qt = OQTool.getQTByDoc(DocumentHelper.parseText(wrapper.qtText), qtName);
+            isOrientation = qt.getDirection().equals("opposite");
+        }
         if(treeQuery.getConditionMap() == null){
             treeQuery.setConditionMap(new HashMap<>());
         }
         if(treeQuery.getExtandParamsMap() != null){
             treeQuery.getConditionMap().putAll(treeQuery.getExtandParamsMap());
         }
-        String parentFieldName = treeQuery.getParentFieldName();
+       String parentFieldName = treeQuery.getParentFieldName();
         if(parentFieldName.contains(",")){
             parentFieldName = parentFieldName.split(",")[0];
         }
@@ -370,19 +396,19 @@
         if(StringUtils.isNotBlank(treeQuery.getParentOid()) && treeQuery.getParentOid().contains(TREE_NODE_ID_SEP)){
             treeQuery.setParentOid(treeQuery.getParentOid().split(TREE_NODE_ID_SEP)[1]);
         }
-        String queryTemplate = StringUtils.isNotBlank(treeQuery.getQueryTemplate())?treeQuery.getQueryTemplate():(!CollectionUtils.isEmpty(treeQuery.getSourceData())?treeQuery.getSourceData().getOrDefault("querytemplate",treeDefineVO.getQueryTemplateName()):treeDefineVO.getQueryTemplateName());
-        String valueField = treeQuery.isLinkTypeFlag()?(!treeDefineVO.isOrientation()?"${oid}" + TREE_NODE_ID_SEP + "${t_oid}":"${oid}" + TREE_NODE_ID_SEP + "${f_oid}"):(StringUtils.isNotBlank(treeQuery.getValueField())?treeQuery.getValueField():"oid");
+        String queryTemplate = StringUtils.isNotBlank(treeQuery.getQueryTemplate())?treeQuery.getQueryTemplate():(!CollectionUtils.isEmpty(treeQuery.getSourceData())? (String) treeQuery.getSourceData().getOrDefault("querytemplate",treeDefineVO.getQueryTemplateName()) :treeDefineVO.getQueryTemplateName());
+        String valueField = treeQuery.isLinkTypeFlag()?(!isOrientation?"${oid}" + TREE_NODE_ID_SEP + "${t_oid}":"${oid}" + TREE_NODE_ID_SEP + "${f_oid}"):(StringUtils.isNotBlank(treeQuery.getValueField())?treeQuery.getValueField():"oid");
         String textField = StringUtils.isNotBlank(treeDefineVO.getTreeNodeExpression())?treeDefineVO.getTreeNodeExpression():(StringUtils.isNotBlank(treeQuery.getTextField())?treeQuery.getTextField():"name");
-        List<Tree> rootTreeList = new ArrayList<>();
+        List<UIDataTree> rootTreeList = new ArrayList<>();
         List<String> queryFieldList = new ArrayList<>();
         queryFieldList.add("creator_name");
         queryFieldList.add("lastmodifier_name");
         String rootExpress = StringUtils.isNotBlank(treeQuery.getRootExpress())?treeQuery.getRootExpress():treeDefineVO.getRootContent();
-        Map<String, String> replaceMap = wrapperReplaceMap(treeQuery.getSourceData());
+        Map<String, Object> replaceMap = wrapperReplaceMap(treeQuery.getSourceData());
         if(StringUtils.isBlank(treeDefineVO.getLinkType())){
             //杩欎釜鏄笟鍔$被鍨嬬殑鑷弬鐓�
             //浠ュ墠鐨勫钩鍙版病鏈夊鑷弬鐓ц繖绉嶆湁鍏ㄩ儴鏌ヨ鐨�
-            OsBtmTypeVO btmTypeVO = btmService.getBtmById(treeDefineVO.getBtmType());
+            OsBtmTypeVO btmTypeVO = btmService.getBtmByName(treeDefineVO.getBtmType());
             queryFieldList.addAll(btmTypeVO.getAttributes().stream().map(OsBtmTypeAttributeVO::getId).collect(Collectors.toList()));
             queryFieldList.addAll(WebBoServiceImpl.BO_BASE_FIELD_MAP.values());
 
@@ -391,7 +417,7 @@
 
             if(treeQuery.isQueryRoot()){
                 //鏄煡璇㈡牴鑺傜偣
-                List<com.vci.client.bof.ClientBusinessObject> rootCbos = null;
+                List<BusinessObject> rootCbos = null;
                 if(StringUtils.isNotBlank(queryTemplate)){
                     //璇存槑鏄彍鍗曢噷瀹氫箟浜嗘煡璇㈡ā鏉跨殑
                     rootCbos = boService.queryCBOByScheme(queryTemplate, null, replaceMap);
@@ -401,7 +427,7 @@
                     if(StringUtils.isBlank(parentFieldNameAndValue) || !parentFieldNameAndValue.contains(",")){
                         throw new VciBaseException("閰嶇疆鐨勪俊鎭湁璇�傚湪娌℃湁鍦ㄨ彍鍗曟垨鑰呮潵婧愭暟鎹缃牴鑺傜偣鐨勬煡璇㈡ā鏉挎椂锛岃鍦ㄦ爲鐨勩�愬弬鐓ф爲銆戜笂璁剧疆涓婄骇瀛楁鐨勫悕绉板拰鏍硅妭鐐圭殑鏌ヨ鐨勫�笺�傛瘮濡倄xxx,yyy銆傚叾涓瓁xxx鏄笂绾у瓧娈佃嫳鏂囧悕绉�");
                     }
-                    parentFieldName= parentFieldNameAndValue.split(",")[0];
+                    parentFieldName = parentFieldNameAndValue.split(",")[0];
                     String rootQueryValue = parentFieldNameAndValue.split(",")[1];
                     treeQuery.getConditionMap().put(parentFieldName,rootQueryValue);
                     replaceMap.put(parentFieldName,rootQueryValue);
@@ -427,7 +453,7 @@
                 return rootTreeList;
             }else{
                 //杩欎釜涓嶆槸璺熻妭鐐癸紝浣嗘槸涓�鑸彧鏄鍔犱竴涓�愮骇鏌ヨ锛屽洜涓哄叏閮ㄦ煡璇㈢殑鏃跺�欙紝鍦ㄦ牴鑺傜偣宸茬粡鍏ㄩ儴鏌ヨ瀹屼簡
-                List<com.vci.client.bof.ClientBusinessObject> thisChildren = null;
+                List<BusinessObject> thisChildren = null;
                 if (StringUtils.isNotBlank(queryTemplate)) {
                     thisChildren = boService.queryCBOByScheme(queryTemplate, treeQuery.getConditionMap(), replaceMap, null, queryFieldList);
                 } else {
@@ -436,8 +462,10 @@
                 return cbo2Trees(thisChildren, valueField, textField, parentFieldName, treeQuery.isShowCheckBox(), null);
             }
         }else{
-            OsLinkTypeVO linkTypeVO = linkTypeService.getLinkTypeById(treeDefineVO.getLinkType());
-            queryFieldList.addAll(linkTypeVO.getAttributes().stream().map(OsLinkTypeAttributeVO::getId).collect(Collectors.toList()));
+            //OsLinkTypeVO linkTypeVO = linkTypeService.getLinkTypeById(treeDefineVO.getLinkType());
+            LinkType linkType = platformClientUtil.getLinkTypeService().getLinkType(treeDefineVO.getLinkType());
+            //queryFieldList.addAll(linkTypeVO.getAttributes().stream().map(OsLinkTypeAttributeVO::getId).collect(Collectors.toList()));
+            queryFieldList.addAll(Arrays.asList(linkType.attributes));
             queryFieldList.addAll(WebLoServiceImpl.LO_BASE_FIELD_MAP.values());
 
             addQueryField(queryFieldList,valueField);
@@ -448,7 +476,7 @@
             linkTypeDataQuery.setConditionMap(treeQuery.getConditionMap());
             linkTypeDataQuery.setParentOid(treeQuery.getParentOid());
             linkTypeDataQuery.setClauseList(queryFieldList);
-            linkTypeDataQuery.setDirection(treeDefineVO.isOrientation());
+            linkTypeDataQuery.setDirection(isOrientation);
             linkTypeDataQuery.setToBtmType(treeDefineVO.getBtmType());
             linkTypeDataQuery.setLinkType(treeDefineVO.getLinkType());
             if(UITreeLoadTypeEnum.ALL.getValue().equalsIgnoreCase(treeDefineVO.getLoadType())){
@@ -456,7 +484,7 @@
             }
             if(treeQuery.isQueryRoot()){
                 //鏌ヨ鏍硅妭鐐�.鎴戜滑闇�瑕佸垽鏂槸鍚﹁缃簡鏍硅妭鐐圭殑鏌ヨ鏉′欢
-                List<com.vci.corba.query.data.BOAndLO> rootCbos = null;
+                List<BOAndLO> rootCbos = null;
                 String parentFieldNameAndValue = treeDefineVO.getShowLinkAbs();
                 if(StringUtils.isNotBlank(parentFieldNameAndValue)){
                     if(StringUtils.isNotBlank(queryTemplate)){
@@ -478,7 +506,7 @@
                     }
                     if(!CollectionUtils.isEmpty(rootCbos)){
                         if(StringUtils.isBlank(parentFieldName)){
-                            if(treeDefineVO.isOrientation()){
+                            if(isOrientation){
                                 parentFieldName = "t_oid";
                             }else{
                                 parentFieldName = "f_oid";
@@ -498,15 +526,15 @@
                     if(CollectionUtils.isEmpty(replaceMap)){
                         throw new VciBaseException("鏍硅妭鐐规病鏈夐厤缃煡璇㈡潯浠讹紝涔熸病鏈夋潵婧愭暟鎹�");
                     }
-                    Tree root = new Tree();
-                    root.setOid(replaceMap.getOrDefault("oid",replaceMap.getOrDefault("t_oid","")));
+                    UIDataTree root = new UIDataTree();
+                    root.setOid((String) replaceMap.getOrDefault("oid",replaceMap.getOrDefault("t_oid","")));
                     root.setText(getValueByExpressForBOAndLO(new HashMap<>(),replaceMap,rootExpress));
                     root.setAttributes(replaceMap);
                     root.setIndex("0");
                     rootTreeList.add(root);
 
                     if(StringUtils.isBlank(parentFieldName)){
-                        if(treeDefineVO.isOrientation()){
+                        if(isOrientation){
                             parentFieldName = "t_oid";
                         }else{
                             parentFieldName = "f_oid";
@@ -526,11 +554,74 @@
                     if(linkTypeDataQuery.getReplaceMap() == null){
                         linkTypeDataQuery.setReplaceMap(new HashMap<>());
                     }
-                    linkTypeDataQuery.getReplaceMap().put(treeDefineVO.isOrientation()?"t_oid":"f_oid",treeQuery.getParentOid());
+                    linkTypeDataQuery.getReplaceMap().put(isOrientation?"t_oid":"f_oid",treeQuery.getParentOid());
                 }
                 return cloAndCbo2Trees(loService.queryCLOAndBoByLinkType(linkTypeDataQuery),valueField,textField,parentFieldName,treeQuery.isShowCheckBox(),treeQuery.getParentOid());
             }
         }
+    }
+
+    /**
+     * 鑾峰彇鏁版嵁(鏍规嵁鏌ヨ妯℃澘鏌ヨ瀵硅薄锛岃繑鍥炵殑缁撴瀯鎸夌収ui瀹氫箟锛屽畾涔夌殑妯℃澘绫诲瀷杩斿洖)
+     * @param treeQuery 鏍戝舰鏌ヨ鏉′欢
+     * @return 鏍戝舰鏁版嵁
+     * @throws VciBaseException 鏌ヨ鍑洪敊鐨勬椂鍊欎細鎶涘嚭寮傚父
+     */
+    @Override
+    public BaseResult getDataByTemp(UITreeQuery treeQuery) throws Exception {
+        VciBaseUtil.alertNotNull(treeQuery,"琛ㄥ崟鐨勬煡璇㈠璞�",treeQuery.getComponentOid(),"褰撳墠缁勪欢鐨勪富閿�");
+        //1銆佸厛鏌ヨ椤甸潰瀹氫箟缁勪欢
+        Map<String, OsAttributeVO> attributeVOMap = attrService.selectAllAttributeMap();
+        UIComponentVO componentVO = uiEngineService.getComponentByOid(treeQuery.getComponentOid(),attributeVOMap);
+        if(componentVO == null || StringUtils.isBlank(componentVO.getOid())){
+            throw new VciBaseException("鏈幏鍙栧埌鐣岄潰閰嶇疆淇℃伅锛�");
+        }
+        // 2銆佹牴鎹厤缃殑鏌ヨ妯℃澘鏌ヨ鏁版嵁(闇�瑕佽�冭檻鍏ㄩ潰涓�鐐�),
+        // 杩欏効鏍规嵁褰撳墠绫诲瀷鏉ヨ幏鍙栨槸浠�涔堢被鍨嬬殑鏌ヨ妯℃澘锛岀劧鍚庡仛瀵瑰簲鐨勬煡璇㈠鐞�
+        //TODO: 鏇挎崲鏍戝畾涔変笂鐨勬鍙嶅悜鏌ヨ灞炴�э紝鍥犱负姝e弽鍚戞煡璇㈡槸鐢遍摼鎺ョ被鍨嬫煡璇㈡ā鏉夸笂鎺у埗鐨�
+        UITreeDefineVO treeDefineVO = componentVO.getTreeDefineVO();
+        boolean isOrientation = false; //鏄惁鍙嶅悜锛屼娇鐢ㄦā鏉夸笂閰嶇疆鐨�
+        String qtName = treeDefineVO.getQueryTemplateName();
+        if(Func.isNotBlank(treeDefineVO.getLinkType()) && Func.isNotBlank(qtName)){
+            QTInfo wrapper = platformClientUtil.getQTDService().getQT(qtName);
+            QueryTemplate qt = OQTool.getQTByDoc(DocumentHelper.parseText(wrapper.qtText), qtName);
+            isOrientation = qt.getDirection().equals("opposite");
+        }
+        String queryTemplate = StringUtils.isNotBlank(treeQuery.getQueryTemplate())?treeQuery.getQueryTemplate():(!CollectionUtils.isEmpty(treeQuery.getSourceData())? (String) treeQuery.getSourceData().getOrDefault("querytemplate",treeDefineVO.getQueryTemplateName()) :treeDefineVO.getQueryTemplateName());
+        Map<String, Object> replaceMap = wrapperReplaceMap(treeQuery.getSourceData());
+        List<String> queryFieldList = new ArrayList<>();
+        String valueField = treeQuery.isLinkTypeFlag()?(!isOrientation?"${oid}" + TREE_NODE_ID_SEP + "${t_oid}":"${oid}" + TREE_NODE_ID_SEP + "${f_oid}"):(StringUtils.isNotBlank(treeQuery.getValueField())?treeQuery.getValueField():"oid");
+        String textField = StringUtils.isNotBlank(treeDefineVO.getTreeNodeExpression())?treeDefineVO.getTreeNodeExpression():(StringUtils.isNotBlank(treeQuery.getTextField())?treeQuery.getTextField():"name");
+        String rootExpress = StringUtils.isNotBlank(treeQuery.getRootExpress())?treeQuery.getRootExpress():treeDefineVO.getRootContent();
+        String parentFieldName = treeQuery.getParentFieldName();
+        if(parentFieldName.contains(",")){
+            parentFieldName = parentFieldName.split(",")[0];
+        }
+        queryFieldList.add("creator_name");
+        queryFieldList.add("lastmodifier_name");
+        OsBtmTypeVO btmTypeVO = btmService.getBtmByName(treeDefineVO.getBtmType());
+        queryFieldList.addAll(btmTypeVO.getAttributes().stream().map(OsBtmTypeAttributeVO::getId).collect(Collectors.toList()));
+        queryFieldList.addAll(WebBoServiceImpl.BO_BASE_FIELD_MAP.values());
+
+        addQueryField(queryFieldList,valueField);
+        addQueryField(queryFieldList,textField);
+        List<BusinessObject> rootCbos = boService.queryCBOByScheme(queryTemplate, null, replaceMap);
+
+        //3銆佹牴鎹笉鍚岀殑缁勪欢杩斿洖涓嶅悓鐨勬暟鎹被鍨嬶紙鏍戙�佸垪琛ㄣ�佹爲琛ㄣ�佽嚜瀹氫箟妯℃澘銆佽〃鍗曠瓑锛�
+        List<UIDataTree> rootTreeList = null;
+        if(!CollectionUtils.isEmpty(rootCbos)){
+            rootTreeList = cbo2Trees(rootCbos,valueField,StringUtils.isBlank(rootExpress)?textField:rootExpress,parentFieldName,treeQuery.isShowCheckBox(),null);
+            TreeQueryObject treeQueryObject = new TreeQueryObject();
+            treeQueryObject.setValueField(valueField);
+            treeQueryObject.setTextField(textField);
+            treeQueryObject.setParentFieldName(parentFieldName);
+            treeQueryObject.setShowCheckBox(treeQuery.isShowCheckBox());
+            if(UITreeLoadTypeEnum.ALL.getValue().equalsIgnoreCase(treeDefineVO.getLoadType())){
+                treeQueryObject.setQueryAllLevel(false);
+            }
+            //queryTreeForBO(rootTreeList,treeDefineVO.getQueryTemplateName(),queryFieldList,treeQueryObject);
+        }
+        return BaseResult.tree(rootTreeList);
     }
 
     /**
@@ -540,19 +631,19 @@
      * @param queryFieldList 鏌ヨ鐨勫瓧娈�
      * @param treeQueryObject 鏍戝舰鏌ヨ瀵硅薄锛岄渶瑕乿alueField鍜宼extField锛岃繕鏈塸arentFieldName,鍜宑heckBox
      */
-    private void queryTreeForBO(List<Tree> rootTreeList, String queryTemplate,List<String> queryFieldList,TreeQueryObject treeQueryObject) {
-        for (Tree rootTree : rootTreeList) {
-            List<com.vci.client.bof.ClientBusinessObject> thisChildren = null;
-            Map<String,String> sourceDataMap = rootTree.getAttributes();
+    private void queryTreeForBO(List<UIDataTree> rootTreeList, String queryTemplate,List<String> queryFieldList,TreeQueryObject treeQueryObject) {
+        for (UIDataTree rootTree : rootTreeList) {
+            List<BusinessObject> thisChildren = null;
+            Map<String,Object> sourceDataMap = rootTree.getAttributes();
             sourceDataMap.put("f_oid",rootTree.getOid());
             Map<String,String> conditionMap = new HashMap<>();
             conditionMap.put(treeQueryObject.getParentFieldName(),rootTree.getOid());
             if (StringUtils.isNotBlank(queryTemplate)) {
                 thisChildren = boService.queryCBOByScheme(queryTemplate, conditionMap, sourceDataMap, null, queryFieldList);
             } else {
-                thisChildren = boService.queryCBO(sourceDataMap.getOrDefault("btmname",sourceDataMap.getOrDefault("btmName",treeQueryObject.getParentBtmName())), conditionMap, null, queryFieldList);
+                thisChildren = boService.queryCBO((String) sourceDataMap.getOrDefault("btmname",sourceDataMap.getOrDefault("btmName",treeQueryObject.getParentBtmName())), conditionMap, null, queryFieldList);
             }
-            List<Tree> childrenTree = cbo2Trees(thisChildren, treeQueryObject.getValueField(), treeQueryObject.getTextField(), treeQueryObject.getParentFieldName(), treeQueryObject.isShowCheckBox(), null);
+            List<UIDataTree> childrenTree = cbo2Trees(thisChildren, treeQueryObject.getValueField(), treeQueryObject.getTextField(), treeQueryObject.getParentFieldName(), treeQueryObject.isShowCheckBox(), null);
             rootTree.setChildren(childrenTree);
             if(treeQueryObject.isQueryAllLevel() && !CollectionUtils.isEmpty(childrenTree) ) {
                 queryTreeForBO(childrenTree,queryTemplate,queryFieldList,treeQueryObject);
@@ -569,8 +660,8 @@
      * @param textField 鏄剧ず琛ㄨ揪寮�
      * @param showCheckBox 鏄惁鏄剧ず澶嶉�夋
      */
-    private void queryTreeForLO(List<Tree> rootTreeList, UILinkTypeDataQuery linkTypeDataQuery,String parentFieldName,String valueField,String textField,boolean showCheckBox) {
-        for (Tree rootTree : rootTreeList) {
+    private void queryTreeForLO(List<UIDataTree> rootTreeList, UILinkTypeDataQuery linkTypeDataQuery,String parentFieldName,String valueField,String textField,boolean showCheckBox) {
+        for (UIDataTree rootTree : rootTreeList) {
             Map<String,String> conditionMap = new HashMap<>();
             conditionMap.put(linkTypeDataQuery.isDirection()?"t_oid":"f_oid",rootTree.getOid());
             linkTypeDataQuery.setConditionMap(conditionMap);
@@ -589,18 +680,21 @@
      * @param parentOid 涓婄骇鐨勪富閿�
      * @return 鏍�
      */
-    private List<Tree> cbo2Trees(Collection<com.vci.client.bof.ClientBusinessObject> cbos,String valueField,String textField,String parentFieldName,boolean showCheckBox,String parentOid){
+    private List<UIDataTree> cbo2Trees(Collection<BusinessObject> cbos,String valueField,String textField,String parentFieldName,boolean showCheckBox,String parentOid){
         final int[] i = {0};
-        List<Tree> rootList = new ArrayList<>();
-        List<Tree> children = new ArrayList<>();
+        List<UIDataTree> rootList = new ArrayList<>();
+        List<UIDataTree> children = new ArrayList<>();
         cbos.stream().forEach(cbo->{
-            Tree tree = new Tree();
+            UIDataTree tree = new UIDataTree();
             tree.setOid(getValueByExpress(cbo,valueField));
             tree.setText(getValueByExpress(cbo,textField));
             if(StringUtils.isNotBlank(parentFieldName)){
-                tree.setParentId(cbo.getAttributeValue(parentFieldName));
+                tree.setParentId(ObjectTool.getBOAttributeValue(cbo,parentFieldName));
             }
-            tree.setAttributes(boService.cbo2Map(cbo));
+            Map<String,Object> cbo2Map = boService.cbo2Map(cbo);
+            Map<String, Object> returnMap = new HashMap<>();
+            returnMap.put((String) cbo2Map.get("btmname"),cbo2Map);
+            tree.setAttributes(returnMap);
             tree.setIndex(i[0] + "");
             i[0]++;
             tree.setChecked(showCheckBox);
@@ -614,7 +708,7 @@
         if(rootList.size() == 0 && children.size() == 0){
             return rootList;
         }
-        return Tree.getChildList(rootList,children);
+        return UIDataTree.getChildList(rootList,children);
     }
 
     /**
@@ -627,36 +721,41 @@
      * @param parentOid 涓婄骇鐨勫��
      * @return 鏍戝舰鏁版嵁
      */
-    public List<Tree> cloAndCbo2Trees(Collection<com.vci.corba.query.data.BOAndLO> boAndLOS,String valueField,String textField,String parentFieldName,boolean showCheckBox,String parentOid){
+    public List<UIDataTree> cloAndCbo2Trees(Collection<BOAndLO> boAndLOS, String valueField, String textField, String parentFieldName, boolean showCheckBox, String parentOid){
         final int[] i = {0};
-        List<Tree> rootList = new ArrayList<>();
-        List<Tree> children = new ArrayList<>();
+        List<UIDataTree> rootList = new ArrayList<>();
+        List<UIDataTree> children = new ArrayList<>();
         boAndLOS.stream().forEach(boAndLO->{
-            Tree tree = new Tree();
-            com.vci.client.bof.ClientBusinessObject cbo = new com.vci.client.bof.ClientBusinessObject();
-            cbo.setBusinessObject(boAndLO.bo);
-            com.vci.client.bof.ClientLinkObject clo = new com.vci.client.bof.ClientLinkObject();
-            clo.setLinkObject(boAndLO.lo);
-            Map<String,String> cloMap = loService.clo2Map(clo);
-            Map<String,String> cbo2Map = boService.cbo2Map(cbo);
-            if(!CollectionUtils.isEmpty(cbo2Map)){
+            UIDataTree tree = new UIDataTree();
+            BusinessObject cbo = new BusinessObject();
+            cbo = boAndLO.bo;
+            LinkObject clo = new LinkObject();
+            clo = boAndLO.lo;
+            Map<String,Object> cloMap = loService.clo2Map(clo);
+            Map<String,Object> cbo2Map = boService.cbo2Map(cbo);
+
+            /*if(!CollectionUtils.isEmpty(cbo2Map)){
                 cbo2Map.forEach((key,value)->{
-                    cloMap.put(parentFieldName + "." + key,value);
+                    //TODO: 杩欏効涓哄暐瑕佹嫾鎺ヤ笂parentFieldName锛屽鑷村悗闈reemarker琛ㄨ揪寮忔棤娉曟纭浛鎹�
+                    cloMap.put(/*parentFieldName + "." + key,value);
                 });
-            }
+            }*/
             tree.setOid(getValueByExpressForBOAndLO(cloMap,cbo2Map,valueField));
             tree.setText(getValueByExpressForBOAndLO(cloMap,cbo2Map,textField));
             if(StringUtils.isBlank(parentFieldName)){
                 tree.setParentId(boAndLO.lo.oid + TREE_NODE_ID_SEP + boAndLO.lo.fromOid);
             }else {
                 if (parentFieldName.contains(".")) {
-                    tree.setParentId(cbo.getAttributeValue(parentFieldName));
+                    tree.setParentId(ObjectTool.getBOAttributeValue(cbo,parentFieldName));
                 } else {
-                    tree.setParentId(clo.getAttributeValue(parentFieldName));
+                    tree.setParentId(ObjectTool.getLOAttributeValue(clo,parentFieldName));
                 }
             }
-
-            tree.setAttributes(cbo2Map);
+            //TODO锛氳繑鍥炵殑鏁版嵁鏀规垚鎸夐摼鎺ョ被鍨嬪拰涓氬姟绫诲瀷涓簁ey锛氬�间负瀵瑰簲鐨勫睘鎬ч泦鍚堝舰寮忚繑鍥�
+            Map<String, Object> returnMap = new HashMap<>();
+            returnMap.put((String) cloMap.get("linktypename"),cloMap);
+            returnMap.put((String) cbo2Map.get("btmname"),cbo2Map);
+            tree.setAttributes(returnMap);
             tree.setIndex(i[0] + "");
             i[0]++;
             tree.setChecked(showCheckBox);
@@ -668,7 +767,7 @@
             }
         });
 
-        return Tree.getChildList(rootList,children);
+        return UIDataTree.getChildList(rootList,children);
     }
 
     /**
@@ -677,7 +776,7 @@
      * @param fieldExpress 琛ㄨ揪寮忕殑鍊�
      * @return 杞崲鍚庣殑鍊�
      */
-    private String getValueByExpress(com.vci.client.bof.ClientBusinessObject cbo,String fieldExpress){
+    private String getValueByExpress(BusinessObject cbo,String fieldExpress){
         if(StringUtils.isBlank(fieldExpress)){
             return "";
         }
@@ -688,7 +787,7 @@
             List<String> fieldList = VciBaseUtil.str2List(fieldExpress);
             StringBuilder sb = new StringBuilder();
             fieldList.stream().forEach(field->{
-                sb.append(cbo.getAttributeValue(field)).append(" ");
+                sb.append(ObjectTool.getBOAttributeValue(cbo,field)).append(" ");
             });
             return sb.toString().trim();
         }
@@ -700,17 +799,30 @@
      * @param fieldExpress 琛ㄨ揪寮�
      * @return 鏇挎崲鍚庣殑鍊�
      */
-    private String getValueByExpressForBOAndLO(Map<String,String> valueMap,Map<String,String> boValueMap,String fieldExpress){
+    private String getValueByExpressForBOAndLO(Map<String,Object> valueMap,Map<String,Object> boValueMap,String fieldExpress){
         if(fieldExpress.contains("${")){
             //浣跨敤freemarker澶勭悊
-            return VciBaseUtil.replaceByFreeMarker(fieldExpress,valueMap);
+            /*
+            TODO:琛ㄨ揪寮忓瓨鍦═_OID.name杩欑褰㈠紡鏃秄reemarker鏇挎崲瑙勫垯鏄粠T_OID杩欎釜瀵硅薄涓嫑name灞炴�э紝
+                浣嗘槸valueMap鏄竴涓猄tring,String鐨凪ap鎵�浠ラ渶瑕佸皢T_OID.鎴朏_OID.鍘绘帀锛屽洜涓轰笉绠℃槸鏌ヨ鐨�
+                form绔繕鏄痶o绔兘鏄钩鍙版煡濂芥斁鍦ㄤ笟鍔″睘鎬oValueMap闆嗗悎涓殑锛屾墍浠ョ洿鎺ユ浛灏卞彲浠�
+            */
+            if(fieldExpress.contains(".")){
+                //鍘婚櫎t_oid銆乀_OID浠ュ強f_oid銆丗_OID
+                fieldExpress = fieldExpress
+                        .replace("t_oid.","")
+                        .replace("T_OID.","")
+                        .replace("f_oid.","")
+                        .replace("F_OID.","");
+            }
+            return VciBaseUtil.replaceByFreeMarker(fieldExpress,boValueMap);
         }else {
             List<String> fieldList = VciBaseUtil.str2List(fieldExpress);
-            Map<String,String> valueLowMap = new HashMap<>();
+            Map<String,Object> valueLowMap = new HashMap<>();
             valueMap.forEach((key,value)->{
                 valueLowMap.put(key.toLowerCase(),value);
             });
-            Map<String,String> boLowValueMap = new HashMap<>();
+            Map<String,Object> boLowValueMap = new HashMap<>();
             if(!CollectionUtils.isEmpty(boValueMap)){
                 boValueMap.forEach((key,value)->{
                     boLowValueMap.put(key.toLowerCase(),value);
@@ -718,7 +830,7 @@
             }
             StringBuilder sb = new StringBuilder();
             fieldList.stream().forEach(field->{
-                sb.append(valueLowMap.getOrDefault(field,boLowValueMap.getOrDefault(field,""))).append(" ");
+                sb.append(boLowValueMap.getOrDefault(field,valueLowMap.getOrDefault(field,""))).append(" ");
             });
             return sb.toString().trim();
         }
@@ -762,11 +874,11 @@
      * @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();
         }
-        String btmType = (baseModelDTOList !=null && !CollectionUtils.isEmpty(baseModelDTOList.getDataList()))? baseModelDTOList.getDataList().get(0).getBtmname():null;
+        String btmType = (baseModelDTOList !=null && !CollectionUtils.isEmpty(baseModelDTOList.getDataList()))? baseModelDTOList.getDataList().get(0).getBtmName():null;
         String linkType = (baseLinkModelDTOList !=null && !CollectionUtils.isEmpty(baseLinkModelDTOList.getDataList()))?baseLinkModelDTOList.getDataList().get(0).getLinkType():null;
         if(StringUtils.isNotBlank(preEvent)){
             //鍓嶇疆浜嬩欢
@@ -869,12 +981,12 @@
      * @throws VciBaseException 鎵ц鍑洪敊鐨勪細鎶涘嚭寮傚父锛屾垨鑰呬簨浠剁洿鎺ヨ繑鍥炰簡寮傚父
      */
     @Override
-    public BaseResult callPostEvent(Collection<com.vci.client.bof.ClientBusinessObject> cbos, Collection<com.vci.client.bof.ClientLinkObject> clos, String postEvent, VciChangeDocumentTypeEnum businessType) throws VciBaseException{
+    public BaseResult callPostEvent(Collection<BusinessObject> cbos, Collection<LinkObject> clos, String postEvent, VciChangeDocumentTypeEnum businessType) throws VciBaseException{
         if(CollectionUtils.isEmpty(cbos)){
             return BaseResult.success();
         }
-        String btmType = !CollectionUtils.isEmpty(cbos)?cbos.stream().findFirst().get().getBtmName():null;
-        String linkType = !CollectionUtils.isEmpty(clos)?clos.stream().findFirst().get().getLinkObject().ltName:null;
+        String btmType = !CollectionUtils.isEmpty(cbos)?cbos.stream().findFirst().get().btName:null;
+        String linkType = !CollectionUtils.isEmpty(clos)?clos.stream().findFirst().get().ltName:null;
         if(StringUtils.isNotBlank(postEvent)){
             //鍓嶇疆浜嬩欢
             //bean鐨勫悕瀛�#鏂规硶; 鎴栬�呭叏璺緞銆傛渶鍚庝竴涓槸鏂规硶鐨勫悕瀛�
@@ -976,7 +1088,7 @@
     public BaseModelDTOList formData2DTOList(FormDataDTO formDataDTO){
         BaseModelDTOList modelDTOList = new BaseModelDTOList();
         BaseModelDTO modelDTO = new BaseModelDTO();
-        BeanUtil.convert((BaseModelDTO)formDataDTO,modelDTO);
+        BeanUtilForVCI.convert(formDataDTO,modelDTO);
         modelDTO.setData(formDataDTO.getData());
         List<BaseModelDTO> modelDTOS = new ArrayList<>();
         modelDTOS.add(modelDTO);
@@ -994,7 +1106,7 @@
         BaseLinkModelDTOList modelDTOList = new BaseLinkModelDTOList();
         BaseLinkModelDTO modelDTO = new BaseLinkModelDTO();
         modelDTO.setData(formLinkDataDTO.getData());
-        BeanUtil.convert((BaseLinkModelDTO)formLinkDataDTO,modelDTO);
+        BeanUtilForVCI.convert(formLinkDataDTO,modelDTO);
         List<BaseLinkModelDTO> linkModelDTOS = new ArrayList<>();
         linkModelDTOS.add(modelDTO);
         modelDTOList.setDataList(linkModelDTOS);
@@ -1013,7 +1125,7 @@
         modelDTOS.stream().findAny().orElseGet(()->null);
         formDataDTOList.getFormDataDTOS().forEach(formDataDTO -> {
             BaseModelDTO modelDTO = new BaseModelDTO();
-            BeanUtil.convert((BaseModelDTO)formDataDTO,modelDTO);
+            BeanUtilForVCI.convert((BaseModelDTO)formDataDTO,modelDTO);
             modelDTO.setData(formDataDTO.getData());
             modelDTOS.add(modelDTO);
         });
@@ -1032,7 +1144,7 @@
         List<BaseLinkModelDTO> modelDTOS = new ArrayList<>();
         formLinkDataDTOList.getDataDTOList().forEach(formDataDTO -> {
             BaseLinkModelDTO modelDTO = new BaseLinkModelDTO();
-            BeanUtil.convert((BaseLinkModelDTO)formDataDTO,modelDTO);
+            BeanUtilForVCI.convert((BaseLinkModelDTO)formDataDTO,modelDTO);
             modelDTO.setData(formDataDTO.getData());
             modelDTOS.add(modelDTO);
         });
@@ -1048,10 +1160,10 @@
      * @throws VciBaseException 淇濆瓨鍑洪敊鐨勬椂鍊欎細鎶涘嚭寮傚父
      */
     @Override
-    public BaseResult<Map<String, Object>> addSave(FormDataDTO formDataDTO) throws VciBaseException {
+    public BaseResult<Map<String, Object>> addSave(FormDataDTO formDataDTO) throws VciBaseException, PLException {
         //棣栧厛鍒ゆ柇瀵硅薄鏄惁涓虹┖
-        VciBaseUtil.alertNotNull(formDataDTO,"娣诲姞鐨勬暟鎹璞�",formDataDTO.getBtmname(),"涓氬姟绫诲瀷鐨勫悕绉�",formDataDTO.getFormDefineId(),"琛ㄥ崟瀹氫箟鐨勭紪鍙�");
-        UIFormDefineVO formDefineVO = uiEngineService.getFormById(formDataDTO.getBtmname(), formDataDTO.getFormDefineId());
+        VciBaseUtil.alertNotNull(formDataDTO,"娣诲姞鐨勬暟鎹璞�",formDataDTO.getBtmName(),"涓氬姟绫诲瀷鐨勫悕绉�",formDataDTO.getFormDefineId(),"琛ㄥ崟瀹氫箟鐨勭紪鍙�");
+        UIFormDefineVO formDefineVO = uiEngineService.getFormById(formDataDTO.getBtmName(), formDataDTO.getFormDefineId());
         String preEvent = formDataDTO.getPreEvent();
         BaseModelDTOList modelDTOList = formData2DTOList(formDataDTO);
         BaseResult beforeResult = callPreEvent(modelDTOList, null,preEvent, VciChangeDocumentTypeEnum.ADD);
@@ -1060,35 +1172,32 @@
             return beforeResult;
         }
         //灏佽鏁版嵁
-        BaseResult<com.vci.client.bof.ClientBusinessObject> resultCbo = wrapperCbo(formDataDTO,formDefineVO,false,false,false);
+        BaseResult<BusinessObject> resultCbo = wrapperCbo(formDataDTO,formDefineVO,false,false,false);
         if(!resultCbo.isSuccess()){
             return BaseResult.fail(resultCbo.getMsg(),resultCbo.getMsgObjs());
         }
         //鎵ц淇濆瓨
         BaseResult<Map<String,Object>> result = BaseResult.success();
-        com.vci.client.bof.ClientBusinessObject afterCBO = null;
+        BusinessObject afterCBO = null;
         try {
-//            BusinessObject resultBO = platformClientUtil.getBOFactoryService().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);
+            BusinessObject resultBO = platformClientUtil.getBOFService().createBusinessObject(resultCbo.getObj(),false,false);
+            afterCBO = new BusinessObject();
+            afterCBO = resultBO;
             result.setObj(boService.cbo2Map(afterCBO));
         } catch (PLException vciError) {
             throw WebUtil.getVciBaseException(vciError);
         }
         if(!CollectionUtils.isEmpty(formDataDTO.getReleaseFileOids())){
-            fileObjectService.releasedFile(afterCBO.getBtmName(),afterCBO.getOid(),formDataDTO.getReleaseFileOids());
+            fileObjectService.releasedFile(afterCBO.btName,afterCBO.oid,formDataDTO.getReleaseFileOids());
         }
         //鍚庣疆浜嬩欢
         String afterEvent = formDataDTO.getPostEvent();
         try {
-            callPostEvent(Arrays.stream(new com.vci.client.bof.ClientBusinessObject[]{afterCBO}).collect(Collectors.toList()),null, afterEvent, VciChangeDocumentTypeEnum.ADD);
+            callPostEvent(Arrays.stream(new BusinessObject[]{afterCBO}).collect(Collectors.toList()),null, afterEvent, VciChangeDocumentTypeEnum.ADD);
         }catch (Throwable e){
             //璇存槑鍚庣疆浜嬩欢鍑虹幇浜嗛敊璇紝閭d箞灏遍渶瑕佸垹闄や互鍓嶇殑杩欐潯鏁版嵁
             try {
-//                platformClientUtil.getBOFactoryService().deleteBusinessObject(afterCBO.getBusinessObject(),1);
-                ServiceProvider.getBOFService().deleteBusinessObject(afterCBO.getBusinessObject(),1);
+                platformClientUtil.getBOFService().deleteBusinessObject(afterCBO,1);
             } catch (PLException vciError) {
                 throw WebUtil.getVciBaseException(vciError);
             }
@@ -1107,7 +1216,7 @@
      * @param newVersion 鏂扮増娆�
      * @return  鎵ц鐨勭粨鏋�
      */
-    private BaseResult<com.vci.client.bof.ClientBusinessObject> wrapperCbo(FormDataDTO formDataDTO,UIFormDefineVO formDefineVO,boolean editFlag,boolean newRevision,boolean newVersion){
+    private BaseResult<BusinessObject> wrapperCbo(FormDataDTO formDataDTO,UIFormDefineVO formDefineVO,boolean editFlag,boolean newRevision,boolean newVersion) throws PLException {
         //鎵╁睍灞炴�х殑鍊�
         Map<String, String> data = formDataDTO.getData();
         Map<String,String> dataLow = new HashMap<>();
@@ -1135,7 +1244,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()){
@@ -1148,7 +1257,7 @@
         if(!result.isSuccess()){
             return result;
         }
-        com.vci.client.bof.ClientBusinessObject cbo = createOrGetCbo(dataLow,baseDataMap,editFlag,newRevision,newVersion);
+        BusinessObject cbo = createOrGetCbo(dataLow,baseDataMap,editFlag,newRevision,newVersion);
         return BaseResult.success(cbo);
     }
 
@@ -1158,41 +1267,41 @@
      * @return 鍩虹瀵硅薄
      */
     @Override
-    public BaseModel cbo2BaseModel(com.vci.client.bof.ClientBusinessObject cbo){
+    public BaseModel cbo2BaseModel(BusinessObject cbo){
         BaseModel baseModel = new BaseModel();
-        baseModel.setOid(cbo.getOid());
-        baseModel.setNameOid(cbo.getNameoid());
-        baseModel.setRevisionOid(cbo.getRevisionid());
-        baseModel.setBtmname(cbo.getBtmName());
-        baseModel.setLastR(String.valueOf(cbo.getIsLastR()));
-        baseModel.setLastV(String.valueOf(cbo.getIsLastV()));
-        baseModel.setFirstR(String.valueOf(cbo.getIsFirstR()));
-        baseModel.setFirstV(String.valueOf(cbo.getIsFirstV()));
-        baseModel.setCreator(cbo.getCreator());
+        baseModel.setOid(cbo.oid);
+        baseModel.setNameOid(cbo.nameoid);
+        baseModel.setRevisionOid(cbo.revisionid);
+        baseModel.setBtmName(cbo.btName);
+        baseModel.setLastR(String.valueOf(cbo.isLastR));
+        baseModel.setLastV(String.valueOf(cbo.isLastV));
+        baseModel.setFirstR(String.valueOf(cbo.isFirstR));
+        baseModel.setFirstV(String.valueOf(cbo.isFirstV));
+        baseModel.setCreator(cbo.creator);
         try {
-            baseModel.setCreateTime(new Date(cbo.getCreateTime()));
-            baseModel.setLastModifyTime(new Date(cbo.getLastModifyTime()));
-            baseModel.setTs(new Date(cbo.getTs()));
+            baseModel.setCreateTime(new Date(cbo.createTime));
+            baseModel.setLastModifyTime(new Date(cbo.modifyTime));
+            baseModel.setTs(new Date(cbo.ts));
 //            baseModel.setCheckInTime(VciDateUtil.str2Date(cbo.getCheckinTime(), VciDateUtil.DateTimeFormat));
 //            baseModel.setCheckOutTime(VciDateUtil.str2Date(cbo.getCheckoutTime(), VciDateUtil.DateTimeFormat));
         }catch (Throwable e){
 
         }
-        baseModel.setLastModifier(cbo.getLastModifier());
-        baseModel.setRevisionRule(cbo.getRevisionRule());
-        baseModel.setVersionRule(cbo.getVersionRule());
-        baseModel.setRevisionSeq(cbo.getRevisionSeq());
-        baseModel.setRevisionValue(cbo.getRevisionValue());
-        baseModel.setVersionSeq(cbo.getVersionSeq());
-        baseModel.setVersionValue(cbo.getVersionValue());
-        baseModel.setLcStatus(cbo.getLcStatus());
-        baseModel.setId(cbo.getId());
-        baseModel.setName(cbo.getName());
-        baseModel.setDescription(cbo.getDescription());
-        baseModel.setOwner(cbo.getOwner());
+        baseModel.setLastModifier(cbo.modifier);
+        baseModel.setRevisionRule(cbo.revisionRule);
+        baseModel.setVersionRule(cbo.versionRule);
+        baseModel.setRevisionSeq(cbo.revisionSeq);
+        baseModel.setRevisionValue(cbo.revisionValue);
+        baseModel.setVersionSeq(cbo.versionSeq);
+        baseModel.setVersionValue(cbo.versionValue);
+        baseModel.setLcStatus(cbo.lcStatus);
+        baseModel.setId(cbo.id);
+        baseModel.setName(cbo.name);
+        baseModel.setDescription(cbo.description);
+        baseModel.setOwner(cbo.owner);
 //        baseModel.setCheckInBy(cbo.getCheckinBy());
 //        baseModel.setCheckOutBy(cbo.getCheckoutBy());
-        baseModel.setCopyFromVersion(cbo.getCopyFromVersion());
+        baseModel.setCopyFromVersion(cbo.fromVersion);
         return baseModel;
     }
 
@@ -1240,12 +1349,12 @@
      * @return 鐗堟湰鐨勫璞�
      */
     @Override
-    public RevisionValueObject getNextRevision(OsBtmTypeVO btmTypeVO, BaseModel baseModel){
+    public RevisionDataInfo getNextRevision(OsBtmTypeVO btmTypeVO, BaseModel baseModel){
         try {
             if(baseModel.getRevisionValue() == null){
                 baseModel.setRevisionValue("");
             }
-            return  changeRevisionValueInfoToObject(platformClientUtil.getBOFactoryService().getNextRevisionValueObject(WebUtil.getTableName(btmTypeVO.getId()),baseModel.getNameOid(),btmTypeVO.getRevisionRuleId(),btmTypeVO.isInputRevisionFlag(),baseModel.getRevisionValue()));
+            return  changeRevisionValueInfoToObject(platformClientUtil.getBOFactoryService().getNextRevisionValueObject(btmTypeVO.getId(),baseModel.getNameOid(),btmTypeVO.getRevisionRuleId(),btmTypeVO.isInputRevisionFlag(),baseModel.getRevisionValue()));
         } catch (PLException vciError) {
             throw WebUtil.getVciBaseException(vciError);
         }
@@ -1256,10 +1365,10 @@
      * @param info corba瀵硅薄
      * @return java瀵硅薄
      */
-    private RevisionValueObject changeRevisionValueInfoToObject(RevisionDataInfo info) {
-        RevisionValueObject object = new RevisionValueObject();
-        object.setRevisionVal(info.revisionVal);
-        object.setRevisionSeq(info.revisionSeq);
+    private RevisionDataInfo changeRevisionValueInfoToObject(RevisionDataInfo info) {
+        RevisionDataInfo object = new RevisionDataInfo();
+        object.revisionVal = info.revisionVal;
+        object.revisionSeq = info.revisionSeq;
         return object;
     }
 
@@ -1270,7 +1379,7 @@
      * @return 鐗堟湰鐨勫�煎璞�
      */
     @Override
-    public VersionValueObject getNextVersion(OsBtmTypeVO btmTypeVO, BaseModel baseModel){
+    public VersionDataInfo getNextVersion(OsBtmTypeVO btmTypeVO, BaseModel baseModel){
         try{
             return changeRevisionValueInfoToObject(platformClientUtil.getBOFactoryService().getNextVersionValue(WebUtil.getTableName(btmTypeVO.getId()),baseModel.getRevisionOid(),baseModel.getNameOid(),WebUtil.getInt(btmTypeVO.getVersionRule())));
         }catch (PLException vciError){
@@ -1283,10 +1392,10 @@
      * @param info 鐗堟鐨勫��
      * @return java瀵硅薄
      */
-    private VersionValueObject changeRevisionValueInfoToObject(VersionDataInfo info) {
-        VersionValueObject object = new VersionValueObject();
-        object.setVersionVal(info.versionVal);
-        object.setVersionSeq(info.versionSeq);
+    private VersionDataInfo changeRevisionValueInfoToObject(VersionDataInfo info) {
+        VersionDataInfo object = new VersionDataInfo();
+        object.versionVal = info.versionVal;
+        object.versionSeq = info.versionSeq;
         return object;
     }
     /**
@@ -1316,11 +1425,11 @@
      * @throws VciBaseException 淇濆瓨鍑洪敊鐨勬椂鍊欎細鎶涘嚭寮傚父
      */
     @Override
-    public BaseResult<String> batchAddSave(FormDataDTOList formDataDTOList) throws VciBaseException {
+    public BaseResult<String> batchAddSave(FormDataDTOList formDataDTOList) throws VciBaseException, PLException {
         VciBaseUtil.alertNotNull(formDataDTOList,"瑕佹坊鍔犵殑鏁版嵁",formDataDTOList.getFormDataDTOS(),"瑕佹坊鍔犵殑鏁版嵁");
         //棣栧厛鍒ゆ柇瀵硅薄鏄惁涓虹┖
         FormDataDTO firstFormDataDTO = formDataDTOList.getFormDataDTOS().stream().findFirst().get();
-        UIFormDefineVO formDefineVO = uiEngineService.getFormById(firstFormDataDTO.getBtmname(), firstFormDataDTO.getId());
+        UIFormDefineVO formDefineVO = uiEngineService.getFormById(firstFormDataDTO.getBtmName(), firstFormDataDTO.getId());
         String preEvent = firstFormDataDTO.getPreEvent();
         BaseModelDTOList modelDTOList = formDataList2DTOList(formDataDTOList);
         BaseResult beforeResult = callPreEvent(modelDTOList, null, preEvent, VciChangeDocumentTypeEnum.ADD);
@@ -1331,26 +1440,25 @@
         //灏佽鏁版嵁
         List<BusinessObject> addBos = new ArrayList<>();
         List<BusinessObject> afterBOs = new ArrayList<>();
-        List<com.vci.client.bof.ClientBusinessObject> afterCBOs = new ArrayList<>();
+        List<BusinessObject> afterCBOs = new ArrayList<>();
         Map<String,List<String>> releasedFileOids = new HashMap<>();
         for(FormDataDTO formDataDTO:formDataDTOList.getFormDataDTOS()) {
-            BaseResult<com.vci.client.bof.ClientBusinessObject> resultCbo = wrapperCbo(formDataDTO, formDefineVO, false, false, false);
+            BaseResult<BusinessObject> resultCbo = wrapperCbo(formDataDTO, formDefineVO, false, false, false);
             if (!resultCbo.isSuccess()) {
                 return BaseResult.fail(resultCbo.getMsg(), resultCbo.getMsgObjs());
             }
-            addBos.add(resultCbo.getObj().getBusinessObject());
+            addBos.add(resultCbo.getObj());
             //鎵ц淇濆瓨
             if (!CollectionUtils.isEmpty(formDataDTO.getReleaseFileOids())) {
-                releasedFileOids.put(resultCbo.getObj().getOid(),formDataDTO.getReleaseFileOids());
+                releasedFileOids.put(resultCbo.getObj().oid,formDataDTO.getReleaseFileOids());
             }
         }
         try {
-//            BusinessObject[] resultBOs = platformClientUtil.getBOFactoryService().batchCreateBusinessObject(addBos.toArray(new BusinessObject[0]), false, false);
-            BusinessObject[] resultBOs = ServiceProvider.getBOFService().batchCreateBusinessObject(addBos.toArray(new BusinessObject[0]), false, false);
+            BusinessObject[] resultBOs = platformClientUtil.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();
-                cbo.setBusinessObject(bo);
+                BusinessObject cbo = new BusinessObject();
+                cbo = bo;
                 afterCBOs.add(cbo);
             });
         } catch (PLException vciError) {
@@ -1358,7 +1466,7 @@
         }
         if(!CollectionUtils.isEmpty(releasedFileOids)){
             releasedFileOids.forEach((oid,fileOids)->{
-                fileObjectService.releasedFile(firstFormDataDTO.getBtmname(),oid,fileOids);
+                fileObjectService.releasedFile(firstFormDataDTO.getBtmName(),oid,fileOids);
             });
         }
         //鍚庣疆浜嬩欢
@@ -1368,7 +1476,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);
             }
@@ -1387,10 +1495,10 @@
      * @throws VciBaseException 淇濆瓨鍑洪敊鐨勬椂鍊欎細鎶涘嚭寮傚父
      */
     @Override
-    public BaseResult<Map<String, Object>> editSave(FormDataDTO formDataDTO) throws VciBaseException {
+    public BaseResult<Map<String, Object>> editSave(FormDataDTO formDataDTO) throws VciBaseException, PLException {
         //棣栧厛鍒ゆ柇瀵硅薄鏄惁涓虹┖
-        VciBaseUtil.alertNotNull(formDataDTO,"淇敼鐨勬暟鎹璞�",formDataDTO.getBtmname(),"涓氬姟绫诲瀷鐨勫悕绉�",formDataDTO.getFormDefineId(),"琛ㄥ崟瀹氫箟鐨勭紪鍙�");
-        UIFormDefineVO formDefineVO = uiEngineService.getFormById(formDataDTO.getBtmname(), formDataDTO.getFormDefineId());
+        VciBaseUtil.alertNotNull(formDataDTO,"淇敼鐨勬暟鎹璞�",formDataDTO.getBtmName(),"涓氬姟绫诲瀷鐨勫悕绉�",formDataDTO.getFormDefineId(),"琛ㄥ崟瀹氫箟鐨勭紪鍙�");
+        UIFormDefineVO formDefineVO = uiEngineService.getFormById(formDataDTO.getBtmName(), formDataDTO.getFormDefineId());
         String preEvent = formDataDTO.getPreEvent();
         BaseModelDTOList modelDTOList = formData2DTOList(formDataDTO);
         BaseResult beforeResult = callPreEvent(modelDTOList,null, preEvent, VciChangeDocumentTypeEnum.EDIT);
@@ -1399,26 +1507,25 @@
             return beforeResult;
         }
         //灏佽鏁版嵁
-        BaseResult<com.vci.client.bof.ClientBusinessObject> resultCbo = wrapperCbo(formDataDTO,formDefineVO,true,false,false);
+        BaseResult<BusinessObject> resultCbo = wrapperCbo(formDataDTO,formDefineVO,true,false,false);
         if(!resultCbo.isSuccess()){
             return BaseResult.fail(resultCbo.getMsg(),resultCbo.getMsgObjs());
         }
         //鎵ц淇濆瓨
          BaseResult<Map<String,Object>> result = BaseResult.success();
         try {
-//            platformClientUtil.getBOFactoryService().updateBusinessObject(new BusinessObjectHolder(resultCbo.getObj().getBusinessObject()));
-            ServiceProvider.getBOFService().updateBusinessObject(resultCbo.getObj().getBusinessObject());
+            platformClientUtil.getBOFService().updateBusinessObject(resultCbo.getObj());
             result.setObj(boService.cbo2Map(resultCbo.getObj()));
         } catch (PLException vciError) {
             throw WebUtil.getVciBaseException(vciError);
         }
         if(!CollectionUtils.isEmpty(formDataDTO.getReleaseFileOids())){
-            fileObjectService.releasedFile(resultCbo.getObj().getBtmName(),resultCbo.getObj().getOid(),formDataDTO.getReleaseFileOids());
+            fileObjectService.releasedFile(resultCbo.getObj().btName,resultCbo.getObj().oid,formDataDTO.getReleaseFileOids());
         }
         //鍚庣疆浜嬩欢
         String afterEvent = formDataDTO.getPostEvent();
         try {
-            callPostEvent(Arrays.stream(new com.vci.client.bof.ClientBusinessObject[]{resultCbo.getObj()}).collect(Collectors.toList()), null,afterEvent, VciChangeDocumentTypeEnum.EDIT);
+            callPostEvent(Arrays.stream(new BusinessObject[]{resultCbo.getObj()}).collect(Collectors.toList()), null,afterEvent, VciChangeDocumentTypeEnum.EDIT);
         }catch (Throwable e){
             throw new VciBaseException(LangBaseUtil.getErrorMsg(e),new String[]{},e);
         }
@@ -1433,10 +1540,10 @@
      * @throws VciBaseException 淇濆瓨鍑洪敊鐨勬椂鍊欎細鎶涘嚭寮傚父
      */
     @Override
-    public BaseResult<Map<String, Object>> upRevision(FormDataDTO formDataDTO) throws VciBaseException {
+    public BaseResult<Map<String, Object>> upRevision(FormDataDTO formDataDTO) throws VciBaseException, PLException {
         //棣栧厛鍒ゆ柇瀵硅薄鏄惁涓虹┖
-        VciBaseUtil.alertNotNull(formDataDTO,"淇敼鐨勬暟鎹璞�",formDataDTO.getBtmname(),"涓氬姟绫诲瀷鐨勫悕绉�",formDataDTO.getFormDefineId(),"琛ㄥ崟瀹氫箟鐨勭紪鍙�",formDataDTO.getCopyFromVersion(),"鑰佺増鏈殑涓婚敭");
-        UIFormDefineVO formDefineVO = uiEngineService.getFormById(formDataDTO.getBtmname(), formDataDTO.getFormDefineId());
+        VciBaseUtil.alertNotNull(formDataDTO,"淇敼鐨勬暟鎹璞�",formDataDTO.getBtmName(),"涓氬姟绫诲瀷鐨勫悕绉�",formDataDTO.getFormDefineId(),"琛ㄥ崟瀹氫箟鐨勭紪鍙�",formDataDTO.getCopyFromVersion(),"鑰佺増鏈殑涓婚敭");
+        UIFormDefineVO formDefineVO = uiEngineService.getFormById(formDataDTO.getBtmName(), formDataDTO.getFormDefineId());
         String preEvent = formDataDTO.getPreEvent();
         BaseModelDTOList modelDTOList = formData2DTOList(formDataDTO);
         BaseResult beforeResult = callPreEvent(modelDTOList, null,preEvent, VciChangeDocumentTypeEnum.UPREVISION);
@@ -1444,29 +1551,40 @@
             //璇存槑鍓嶇疆浜嬩欢娌℃湁鎵ц鎴愬姛
             return beforeResult;
         }
-        //灏佽鏁版嵁
-        BaseResult<com.vci.client.bof.ClientBusinessObject> resultCbo = wrapperCbo(formDataDTO,formDefineVO,false,formDataDTO.isUpVersion()?false:true,formDataDTO.isUpVersion());
-        if(!resultCbo.isSuccess()){
-            return BaseResult.fail(resultCbo.getMsg(),resultCbo.getMsgObjs());
+        List<BusinessObject> businessObjects = null;
+        Date ts = formDataDTO.getTs();
+        Map<String,String> conditionMap = WebUtil.getOidQuery(formDataDTO.getCopyFromVersion());
+        conditionMap.put("ts", VciDateUtil.date2Str(ts,VciDateUtil.DateTimeMillFormat));
+        conditionMap.put("oid",formDataDTO.getCopyFromVersion());
+        businessObjects = boService.queryCBO(formDataDTO.getBtmName(), conditionMap);
+        if(businessObjects.size() ==0){
+            throw new VciBaseException("鏁版嵁涓嶆槸鏈�鏂扮殑锛屽缓璁偍鍒锋柊鍚庨噸鏂版搷浣�");
         }
+        //鎵╁睍灞炴�х殑鍊�
+        Map<String, String> data = formDataDTO.getData();
+        Map<String,String> dataLow = new HashMap<>();
+        data.forEach((key,value)->{
+            dataLow.put(key.toLowerCase(),value);
+        });
+
+        Map<String,String> baseDataMap = formDataDTO2MapLow(formDataDTO);
+        Map<String,String> allDataMapLow = new HashMap<>();
+        allDataMapLow.putAll(dataLow);
+        allDataMapLow.putAll(baseDataMap);
+        //鍒ゆ柇鍞竴椤�
+        BaseResult baseResult = checkUnique(formDefineVO, null, allDataMapLow, true);
+        if(!baseResult.isSuccess()){
+            return baseResult;
+        }
+        BusinessObject businessObject = platformClientUtil.getBOFService()
+                .revisionBusinessObject(businessObjects.get(0), null, !formDataDTO.isUpVersion(),true, false, false);
         //鎵ц淇濆瓨
-        BaseResult<Map<String,Object>> result = BaseResult.success();
-        try {
-//            BusinessObject bo = platformClientUtil.getBOFactoryService().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));
-        } catch (PLException vciError) {
-            throw WebUtil.getVciBaseException(vciError);
-        }
-        if(!CollectionUtils.isEmpty(formDataDTO.getReleaseFileOids())){
-            fileObjectService.releasedFile(resultCbo.getObj().getBtmName(),resultCbo.getObj().getOid(),formDataDTO.getReleaseFileOids());
-        }
+        BaseResult<Map<String, Object>> result = BaseResult.success();
+        result.setObj(boService.cbo2Map(businessObject));
         //鍚庣疆浜嬩欢
         String afterEvent = formDataDTO.getPostEvent();
         try {
-            callPostEvent(Arrays.stream(new com.vci.client.bof.ClientBusinessObject[]{resultCbo.getObj()}).collect(Collectors.toList()), null,afterEvent, VciChangeDocumentTypeEnum.EDIT);
+            callPostEvent(Arrays.stream(new BusinessObject[]{businessObject}).collect(Collectors.toList()), null,afterEvent, VciChangeDocumentTypeEnum.EDIT);
         }catch (Throwable e){
             throw new VciBaseException(LangBaseUtil.getErrorMsg(e),new String[]{},e);
         }
@@ -1481,11 +1599,11 @@
      * @throws VciBaseException 淇濆瓨鍑洪敊鐨勬椂鍊欎細鎶涘嚭寮傚父
      */
     @Override
-    public BaseResult<String> batchEditSave(FormDataDTOList formDataDTOList) throws VciBaseException {
+    public BaseResult<String> batchEditSave(FormDataDTOList formDataDTOList) throws VciBaseException, PLException {
         VciBaseUtil.alertNotNull(formDataDTOList,"瑕佷慨鏀圭殑鏁版嵁",formDataDTOList.getFormDataDTOS(),"瑕佷慨鏀圭殑鏁版嵁");
         //棣栧厛鍒ゆ柇瀵硅薄鏄惁涓虹┖
         FormDataDTO firstFormDataDTO = formDataDTOList.getFormDataDTOS().stream().findFirst().get();
-        UIFormDefineVO formDefineVO = uiEngineService.getFormById(firstFormDataDTO.getBtmname(), firstFormDataDTO.getId());
+        UIFormDefineVO formDefineVO = uiEngineService.getFormById(firstFormDataDTO.getBtmName(), firstFormDataDTO.getId());
         String preEvent = firstFormDataDTO.getPreEvent();
         BaseModelDTOList modelDTOList = formDataList2DTOList(formDataDTOList);
         BaseResult beforeResult = callPreEvent(modelDTOList,null, preEvent, VciChangeDocumentTypeEnum.EDIT);
@@ -1496,16 +1614,16 @@
         //灏佽鏁版嵁
         List<BusinessObject> updateCBOS = new ArrayList<>();
         Map<String,List<String>> releasedFileOids = new HashMap<>();
-        List<com.vci.client.bof.ClientBusinessObject> afterCBOs = new ArrayList<>();
+        List<BusinessObject> afterCBOs = new ArrayList<>();
         for(FormDataDTO formDataDTO:formDataDTOList.getFormDataDTOS()) {
-            BaseResult<com.vci.client.bof.ClientBusinessObject> resultCbo = wrapperCbo(formDataDTO, formDefineVO, true, false, false);
+            BaseResult<BusinessObject> resultCbo = wrapperCbo(formDataDTO, formDefineVO, true, false, false);
             if (!resultCbo.isSuccess()) {
                 return BaseResult.fail(resultCbo.getMsg(), resultCbo.getMsgObjs());
             }
-            updateCBOS.add(resultCbo.getObj().getBusinessObject());
+            updateCBOS.add(resultCbo.getObj());
             //鎵ц淇濆瓨
             if (!CollectionUtils.isEmpty(formDataDTO.getReleaseFileOids())) {
-                releasedFileOids.put(resultCbo.getObj().getOid(),formDataDTO.getReleaseFileOids());
+                releasedFileOids.put(resultCbo.getObj().oid,formDataDTO.getReleaseFileOids());
             }
         }
         try {
@@ -1515,7 +1633,7 @@
         }
         if(!CollectionUtils.isEmpty(releasedFileOids)){
             releasedFileOids.forEach((oid,fileOids)->{
-                fileObjectService.releasedFile(firstFormDataDTO.getBtmname(),oid,fileOids);
+                fileObjectService.releasedFile(firstFormDataDTO.getBtmName(),oid,fileOids);
             });
         }
         //鍚庣疆浜嬩欢
@@ -1538,15 +1656,15 @@
      * @throws VciBaseException 鏁版嵁琚紩鐢ㄧ殑鏃跺�欎細鎶涘嚭寮傚父
      */
     @Override
-    public BaseResult batchDelete(DeleteDataDTO deleteDataDTO) throws VciBaseException {
+    public BaseResult batchDelete(DeleteDataDTO deleteDataDTO) throws VciBaseException, PLException {
         VciBaseUtil.alertNotNull(deleteDataDTO,"鏁版嵁浼犺緭瀵硅薄",deleteDataDTO.getDataList(),"鏁版嵁浼犺緭瀵硅薄");
-        String btmName = deleteDataDTO.getDataList().get(0).getBtmname();
+        String btmName = deleteDataDTO.getDataList().get(0).getBtmName();
         List<String> oidList = deleteDataDTO.getDataList().stream().map(BaseModelDTO::getOid).collect(Collectors.toList());
         //鐪嬬湅绾ц仈鍒犻櫎銆傚彧鏈夎嚜宸卞紩鐢ㄨ嚜宸辩殑鏃跺�欏彲浠ョ骇鑱斿垹闄�
-        List<com.vci.client.bof.ClientBusinessObject> cbo = null;
+        List<BusinessObject> cbo = null;
         if(deleteDataDTO.isCascade()){
             //绾ц仈鍒犻櫎
-            OsBtmTypeVO btmTypeVO = btmService.getBtmById(btmName);
+            OsBtmTypeVO btmTypeVO = btmService.getBtmByName(btmName);
             OsBtmTypeAttributeVO parentAttributeVO = btmTypeVO.getAttributes().stream().filter(s -> s.getReferBtmTypeId().equalsIgnoreCase(btmName)).findFirst().orElseGet(null);
             if(parentAttributeVO != null){
                 //椤甸潰鍒嗛〉涓嶈兘鏄剧ず瓒呰繃1000
@@ -1562,8 +1680,8 @@
         if(CollectionUtils.isEmpty(cbo)){
             return BaseResult.fail("娌℃湁鍦ㄧ郴缁熶腑鎵惧埌杩欎簺鏁版嵁锛屾湭鎵ц鍒犻櫎鎿嶄綔");
         }
-        List<com.vci.client.bof.ClientBusinessObject> finalCbo = cbo;
-        Collection<Collection<String>> oidCollections = WebUtil.switchCollectionForOracleIn(finalCbo.stream().map(com.vci.client.bof.ClientBusinessObject::getOid).collect(Collectors.toList()));
+        List<BusinessObject> finalCbo = cbo;
+        Collection<Collection<String>> oidCollections = WebUtil.switchCollectionForOracleIn(finalCbo.stream().map(bo -> bo.oid).collect(Collectors.toList()));
         List<OsUsedAttributeVO> usedAttributeVOS = null;
         boolean adminCascade = false;
         if("admin".equalsIgnoreCase(VciBaseUtil.getCurrentUserId()) && deleteDataDTO.isAdminCascade()){
@@ -1579,7 +1697,12 @@
                         conditionMap.put(usedAttributeVO.getId(),QueryOptionConstant.IN + "(" + VciBaseUtil.toInSql(oids.toArray(new String[0])) + ")");
                         if(StringUtils.isNotBlank(usedAttributeVO.getPkBtmType())) {
                             if (boService.queryCount(usedAttributeVO.getPkBtmType(), conditionMap) > 0) {
-                                OsBtmTypeVO btmTypeVO = btmService.getBtmById(usedAttributeVO.getPkBtmType());
+                                OsBtmTypeVO btmTypeVO = null;
+                                try {
+                                    btmTypeVO = btmService.getBtmById(usedAttributeVO.getPkBtmType());
+                                } catch (PLException e) {
+                                    e.printStackTrace();
+                                }
                                 throw new VciBaseException("鏁版嵁鍦ㄣ��" + btmTypeVO.getName() + "銆戜腑鐨勫瓧娈礫" + usedAttributeVO.getName() + "]閲岃寮曠敤.涓嶈兘鍒犻櫎");
                             }
                         }else{
@@ -1598,7 +1721,7 @@
                         Map<String,String> conditionMap = new HashMap<>();
                         conditionMap.put(usedAttributeVO.getId(),QueryOptionConstant.IN + "(" + VciBaseUtil.toInSql(oids.toArray(new String[0])) + ")");
                         if(StringUtils.isNotBlank(usedAttributeVO.getPkBtmType())) {
-                            List<com.vci.client.bof.ClientBusinessObject> tempCbos = boService.queryCBO(usedAttributeVO.getPkBtmType(), conditionMap);
+                            List<BusinessObject> tempCbos = boService.queryCBO(usedAttributeVO.getPkBtmType(), conditionMap);
                             if(!CollectionUtils.isEmpty(tempCbos)){
                                 finalCbo.addAll(tempCbos);
                             }
@@ -1611,13 +1734,11 @@
         }
         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 BusinessObject[0]),1);
+                platformClientUtil.getBOFService().batchDeleteBusinessObject(cbos.toArray(new BusinessObject[0]),1);
             } catch (PLException vciError) {
                 throw WebUtil.getVciBaseException(vciError);
             }
         });
-        System.out.println("zheshi shazi ");
         return BaseResult.success();
     }
 
@@ -1629,7 +1750,7 @@
      * @throws VciBaseException 鍙傛暟涓虹┖锛屽繀杈撻」缂哄け
      */
     @Override
-    public BaseResult<String> linkAddSave(FormLinkDataDTO formLinkDataDTO) throws VciBaseException {
+    public BaseResult<String> linkAddSave(FormLinkDataDTO formLinkDataDTO) throws VciBaseException, PLException {
         //棣栧厛鍒ゆ柇瀵硅薄鏄惁涓虹┖
         VciBaseUtil.alertNotNull(formLinkDataDTO,"娣诲姞鐨勬暟鎹璞�",formLinkDataDTO.getLinkType(),"閾炬帴绫诲瀷鐨勫悕绉�",formLinkDataDTO.getFormDefineId(),"琛ㄥ崟瀹氫箟鐨勭紪鍙�");
         if(formLinkDataDTO.getData() ==null){
@@ -1653,7 +1774,7 @@
             //璇存槑鍓嶇疆浜嬩欢娌℃湁鎵ц鎴愬姛
             return beforeResult;
         }
-        com.vci.client.bof.ClientLinkObject clo = null;
+        LinkObject clo = null;
         String prefix = "";
         if(formLinkDataDTO.isDirection()){
             prefix = LO_FROM_PREFIX;
@@ -1680,14 +1801,6 @@
             throw new VciBaseException(formLinkDataDTO.isDirection()?"from绔�":"to绔�" + "鐨勪笟鍔$被鍨嬩负绌�");
         }
 
-        //鏌ヨfrom绔殑
-        com.vci.client.bof.ClientBusinessObject fromCbo = new com.vci.client.bof.ClientBusinessObject();
-        try {
-//            fromCbo.setBusinessObject(platformClientUtil.getBOFactoryService().readBusinessObject(fromOid,fromBtmName));
-            fromCbo.setBusinessObject(ServiceProvider.getBOFService().readBusinessObject(fromOid,fromBtmName));
-        } catch (PLException vciError) {
-            throw WebUtil.getVciBaseException(vciError);
-        }
         String finalPrefix = prefix;
         formLinkDataDTO.getData().forEach((key, value)->{
             if(key.toLowerCase().startsWith(finalPrefix)){
@@ -1697,55 +1810,47 @@
             }
         });
         //灏佽to绔殑
-        BaseResult<com.vci.client.bof.ClientBusinessObject> result = wrapperToCbo(formLinkDataDTO,formDefineVO,toOid,toBtmName,boData);
+        BaseResult<BusinessObject> result = wrapperToCbo(formLinkDataDTO,formDefineVO,toOid,toBtmName,boData);
         if(!result.isSuccess()){
             return BaseResult.fail(result.getMsg(),result.getMsgObjs());
         }
-        com.vci.client.bof.ClientBusinessObject toCbo = result.getObj();
+        BusinessObject toCbo = result.getObj();
         //鍒濆鍖栭摼鎺ョ被鍨嬬殑鍊�
-        BaseResult<com.vci.client.bof.ClientLinkObject> resultClo = wrapperOnlyCLO(formLinkDataDTO, loData, formDefineVO, false);
+        BaseResult<LinkObject> resultClo = wrapperOnlyCLO(formLinkDataDTO, loData, formDefineVO, false);
         if(!resultClo.isSuccess()){
             return BaseResult.fail(resultClo.getMsg(),resultClo.getMsgObjs());
         }
         clo = resultClo.getObj();
-        if(formLinkDataDTO.isDirection()){
-            clo.setFromBO(toCbo);
-            clo.setToBO(fromCbo);
-        } else {
-            clo.setFromBO(fromCbo);
-            clo.setToBO(toCbo);
+        if(StringUtils.isBlank(clo.toOid)){
+            clo.toOid = toCbo.oid;
         }
         //鎵ц淇濆瓨
         BusinessObject[] bos = new BusinessObject[1];
-        toCbo.dealBusinessObjectNullValue();
-        clo.dealLinkObjectNullValue();
-        bos[0] = toCbo.getBusinessObject();
+        ObjectTool.dealBusinessObjectNullValue(toCbo);
+        bos[0] = toCbo;
         try {
-//            platformClientUtil.getBOFactoryService().createBusinessObjectWithLink(bosHolder,loHolder);
-            ServiceProvider.getBOFService().createBusinessObjectWithLink(bos,clo.getLinkObject());
+            platformClientUtil.getBOFService().createBusinessObjectWithLink(bos,clo);
         } catch (PLException vciError) {
             throw WebUtil.getVciBaseException(vciError);
         }
         if(!CollectionUtils.isEmpty(formLinkDataDTO.getReleaseFileOids())){
-            fileObjectService.releasedFile(formLinkDataDTO.getLinkType(),clo.getOid(),formLinkDataDTO.getReleaseFileOids());
+            fileObjectService.releasedFile(formLinkDataDTO.getLinkType(),clo.oid,formLinkDataDTO.getReleaseFileOids());
         }
         //鍚庣疆浜嬩欢
         String afterEvent = formLinkDataDTO.getPostEvent();
         try {
-            callPostEvent(null,Arrays.stream(new com.vci.client.bof.ClientLinkObject[]{clo}).collect(Collectors.toList()), afterEvent, VciChangeDocumentTypeEnum.ADD);
+            callPostEvent(null,Arrays.stream(new LinkObject[]{clo}).collect(Collectors.toList()), afterEvent, VciChangeDocumentTypeEnum.ADD);
         }catch (Throwable e){
             //璇存槑鍚庣疆浜嬩欢鍑虹幇浜嗛敊璇紝閭d箞灏遍渶瑕佸垹闄や互鍓嶇殑杩欐潯鏁版嵁
             try {
-//                platformClientUtil.getBOFactoryService().deleteBusinessObject(toCbo.getBusinessObject(),1);
-//                platformClientUtil.getBOFactoryService().deleteLinkObject(clo.getLinkObject());
-                ServiceProvider.getBOFService().deleteBusinessObject(toCbo.getBusinessObject(),1);
-                ServiceProvider.getBOFService().deleteLinkObject(clo.getLinkObject());
+                platformClientUtil.getBOFService().deleteBusinessObject(toCbo,1);
+                platformClientUtil.getBOFService().deleteLinkObject(clo);
             } catch (PLException vciError) {
                 throw WebUtil.getVciBaseException(vciError);
             }
             throw new VciBaseException(LangBaseUtil.getErrorMsg(e),new String[]{},e);
         }
-        return BaseResult.success(clo.getOid());
+        return BaseResult.success(clo.oid);
     }
 
     /**
@@ -1756,7 +1861,7 @@
      * @param editFlag 鏄惁涓虹紪杈�
      * @return 閾炬帴绫诲瀷鐨勫唴瀹�
      */
-    private BaseResult<com.vci.client.bof.ClientLinkObject> wrapperOnlyCLO(FormLinkDataDTO formLinkDataDTO,Map<String,String> loData,UIFormDefineVO formDefineVO,boolean editFlag){
+    private BaseResult<LinkObject> wrapperOnlyCLO(FormLinkDataDTO formLinkDataDTO,Map<String,String> loData,UIFormDefineVO formDefineVO,boolean editFlag){
         Map<String,String> baseDataMap = formLinkDataDTO2MapLow(formLinkDataDTO);
         Map<String,String> allDataMap = new HashMap<>();
         allDataMap.putAll(loData);
@@ -1772,33 +1877,40 @@
             return result;
         }
         //澶勭悊涓氬姟绫诲瀷寰楀埌鏁版嵁
-        ClientLinkObject clo ;
+        LinkObject clo ;
         if(editFlag){
             try {
-//                LinkObject linkObject = platformClientUtil.getBOFactoryService().readLinkObjectById(formLinkDataDTO.getOid(), formLinkDataDTO.getLinkType());
-                LinkObject linkObject = ServiceProvider.getBOFService().readLinkObjectById(formLinkDataDTO.getOid(), formLinkDataDTO.getLinkType());
-                clo = new ClientLinkObject();
-                clo.setLinkObject(linkObject);
+                LinkObject linkObject = platformClientUtil.getBOFService().readLinkObjectById(formLinkDataDTO.getOid(), formLinkDataDTO.getLinkType());
+                clo = linkObject;
             } catch (PLException vciError) {
                 throw WebUtil.getVciBaseException(vciError);
             }
         }else{
-            clo = new ClientLinkObject();
+            clo = new LinkObject();
             //澶勭悊鍒濆鍖栫殑鏁版嵁
-            clo.setOid(VciBaseUtil.getPk());
-            clo.setCreator(VciBaseUtil.getCurrentUserId());
-            clo.setCreateTime(System.currentTimeMillis());
-            clo.setTs(System.currentTimeMillis());
-            clo.setLoName(formLinkDataDTO.getLinkType());
+            clo.oid = VciBaseUtil.getPk();
+            clo.creator = VciBaseUtil.getCurrentUserId();
+            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();
         }
         //
-        allDataMap.forEach((key,value)->{
+        LinkObject finalClo = clo;
+        allDataMap.forEach((key, value)->{
             if(editFlag&&("lastmodifier".equalsIgnoreCase(key) || "lastmodifytime".equalsIgnoreCase(key)
                     || "ts".equalsIgnoreCase(key)  || "creator".equalsIgnoreCase(key)
                     || "createtime".equalsIgnoreCase(key))){
                 //骞冲彴涓嶈兘浼犻�掕繖涓�
             }else{
-                loService.setAttribute(clo,key,value);
+                loService.setAttribute(finalClo,key,value);
             }
         });
         return BaseResult.success(clo);
@@ -1814,7 +1926,7 @@
      * @param boData to鐨勬暟鎹�
      * @return 鍖呭惈鐨勫璞�
      */
-    private BaseResult<com.vci.client.bof.ClientBusinessObject> wrapperToCbo(FormLinkDataDTO formLinkDataDTO,UIFormDefineVO formDefineVO,String toOid,String toBtmName,Map<String,String> boData){
+    private BaseResult<BusinessObject> wrapperToCbo(FormLinkDataDTO formLinkDataDTO,UIFormDefineVO formDefineVO,String toOid,String toBtmName,Map<String,String> boData) throws PLException {
         Map<String,String> dataLow = new HashMap<>();
         boData.forEach((key,value)->{
             dataLow.put(key.toLowerCase(),value);
@@ -1841,7 +1953,7 @@
         if(!result.isSuccess()){
             return result;
         }
-        com.vci.client.bof.ClientBusinessObject cbo = createOrGetCbo(dataLow,baseDataMap,editFlag,formLinkDataDTO.isToUpRevision(),formLinkDataDTO.isToUpVersion());
+        BusinessObject cbo = createOrGetCbo(dataLow,baseDataMap,editFlag,formLinkDataDTO.isToUpRevision(),formLinkDataDTO.isToUpVersion());
         return BaseResult.success(cbo);
 
     }
@@ -1934,141 +2046,140 @@
      * @param newVersion 鏄惁鍗囩増娆�
      * @return cbo瀵硅薄
      */
-    public com.vci.client.bof.ClientBusinessObject createOrGetCbo(Map<String,String> dataLowMap,Map<String,String> baseDataMap,boolean editFlag,boolean newRevision,boolean newVersion){
+    public BusinessObject createOrGetCbo(Map<String,String> dataLowMap,Map<String,String> baseDataMap,boolean editFlag,boolean newRevision,boolean newVersion) throws PLException {
         String btmName = baseDataMap.get("btmname");
         String oid = baseDataMap.get("oid");
-//        ClientBusinessObject cbo = new ClientBusinessObject();
-        com.vci.client.bof.ClientBusinessObject cbo = new com.vci.client.bof.ClientBusinessObject();
+//        BusinessObject cbo = new BusinessObject();
+        BusinessObject cbo = new BusinessObject();
         String copyfromversion = baseDataMap.get("copyfromversion");
-        OsBtmTypeVO btmTypeVO = btmService.getBtmById(btmName);
-        List<String> attributeList = btmTypeVO.getAttributes().stream().map(attribute -> attribute.getId()).collect(Collectors.toList());
+        //OsBtmTypeVO btmTypeVO = btmService.getBtmById(btmName);
+        OsBtmTypeVO btmTypeVO = btmService.getBtmByName(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));
+                cbo = platformClientUtil.getBOFService().readBusinessObject(editFlag?oid:copyfromversion,btmName);
             } catch (PLException vciError) {
                 throw new VciBaseException("浣跨敤涓婚敭鍦ㄧ郴缁熶腑娌℃湁鏌ヨ鍒版暟鎹�",new String[]{oid},vciError);
             }
             if(btmTypeVO.isRevisionFlag() && newRevision){
-                cbo.setOid(VciBaseUtil.getPk());
-                cbo.setCopyFromVersion(copyfromversion);
+                cbo.oid = VciBaseUtil.getPk();
+                cbo.fromVersion = copyfromversion;
                 if(btmTypeVO.isInputRevisionFlag() && StringUtils.isNotBlank(baseDataMap.getOrDefault("revisionvalue",""))){
                     //鎵嬪姩鐨勶紝鎵�浠ヤ笉澶勭悊鐗堟湰瑙勫垯浜�
-                    cbo.setRevisionValue(baseDataMap.get("revisionvalue"));
+                    cbo.revisionValue = baseDataMap.get("revisionvalue");
                 }else{
                     //璇存槑鏄崌鐗�
                     BaseModel baseModel = cbo2BaseModel(cbo);
-                    RevisionValueObject revisionValueObject = getNextRevision(btmTypeVO,baseModel);
-                    cbo.setRevisionid(VciBaseUtil.getPk());
-                    cbo.setRevisionSeq((short) revisionValueObject.getRevisionSeq());
-                    cbo.setRevisionValue(revisionValueObject.getRevisionVal());
-                    cbo.setIsLastR(true);
-                    cbo.setIsFirstR(false);
+                    RevisionDataInfo revisionValueObject = getNextRevision(btmTypeVO,baseModel);
+                    cbo.revisionid = VciBaseUtil.getPk();
+                    cbo.revisionSeq = revisionValueObject.revisionSeq;
+                    cbo.revisionValue = revisionValueObject.revisionVal;
+                    cbo.isLastR = true;
+                    cbo.isFirstR = false;
                     //澶勭悊鐗堟
-                    cbo.setVersionValue(getFirstVersion(btmTypeVO.getVersionRule()));
-                    cbo.setVersionRule(btmTypeVO.getVersionRule());
-                    cbo.setVersionSeq((short) 0);
-                    cbo.setIsLastV(true);
-                    cbo.setIsFirstV(true);
+                    cbo.versionValue = getFirstVersion(btmTypeVO.getVersionRule());
+                    cbo.versionRule = btmTypeVO.getVersionRule();
+                    cbo.versionSeq = (short) 0;
+                    cbo.isLastV = true;
+                    cbo.isFirstV = true;
                 }
                 //鍗囩増鐨勬椂鍊欙紝鐢熷懡鍛ㄦ湡鐨勭姸鎬侀渶瑕佹敼鍔ㄥ埌榛樿鐘舵��
                 if(StringUtils.isNotBlank(btmTypeVO.getLifeCycleId())){
                     //鏌ヨ鐢熷懡鍛ㄦ湡
-//                    OsLifeCycleVO lifeCycleVO = lifeCycleService.getLifeCycleById(btmTypeVO.getLifeCycleId());
                     LifeCycle lifeCycleVO = null;
                     try {
-                        lifeCycleVO = ServiceProvider.getOMDService().getLifeCycleService().getLifeCycle(btmTypeVO.getLifeCycleId());
+                        lifeCycleVO = platformClientUtil.getLifeCycleService().getLifeCycle(btmTypeVO.getLifeCycleId());
                     } catch (PLException e) {
                         throw new RuntimeException(e);
                     }
                     if(lifeCycleVO == null || StringUtils.isBlank(lifeCycleVO.oid)){
                         throw new VciBaseException("{0}閲岀殑鐢熷懡鍛ㄦ湡璁剧疆寰椾笉姝g‘锛屽湪绯荤粺涓病鏈夋壘鍒皗1}杩欎釜鐢熷懡鍛ㄦ湡",new String[]{btmTypeVO.getName(),btmTypeVO.getLifeCycleId()});
                     }
-                    cbo.setLcStatus(lifeCycleVO.startState);
+                    cbo.lcStatus = lifeCycleVO.startState;
                 }
             }
             if(btmTypeVO.isRevisionFlag() && newVersion){
-                cbo.setCopyFromVersion(copyfromversion);
-                cbo.setOid(VciBaseUtil.getPk());
+                cbo.fromVersion = copyfromversion;
+                cbo.oid = VciBaseUtil.getPk();
                 //杩欐槸鍗囩増娆★紝涓嶅瓨鍦ㄥ嵆鍗囩増鏈紝鍙堝崌鐗堟鐨勬儏鍐�
                 BaseModel baseModel = cbo2BaseModel(cbo);
-                VersionValueObject versionValueObject = getNextVersion(btmTypeVO,baseModel);
-                cbo.setVersionValue(versionValueObject.getVersionVal());
-                cbo.setVersionSeq((short) versionValueObject.getVersionSeq());
-                cbo.setIsLastV(true);
-                cbo.setIsFirstV(false);
+                VersionDataInfo versionValueObject = getNextVersion(btmTypeVO,baseModel);
+                cbo.versionValue = versionValueObject.versionVal;
+                cbo.versionSeq = versionValueObject.versionSeq;
+                cbo.isLastV = true;
+                cbo.isFirstV = false;
                 //鍗囩増鐨勬椂鍊欙紝鐢熷懡鍛ㄦ湡鐨勭姸鎬侀渶瑕佹敼鍔ㄥ埌榛樿鐘舵��
                 if(StringUtils.isNotBlank(btmTypeVO.getLifeCycleId())){
                     //鏌ヨ鐢熷懡鍛ㄦ湡
-//                    OsLifeCycleVO lifeCycleVO = lifeCycleService.getLifeCycleById(btmTypeVO.getLifeCycleId());
                     LifeCycle lifeCycleVO = null;
                     try {
-                        lifeCycleVO = ServiceProvider.getOMDService().getLifeCycleService().getLifeCycle(btmTypeVO.getLifeCycleId());
+                        lifeCycleVO = platformClientUtil.getLifeCycleService().getLifeCycle(btmTypeVO.getLifeCycleId());
                     } catch (PLException e) {
                         throw new RuntimeException(e);
                     }
                     if(lifeCycleVO == null || StringUtils.isBlank(lifeCycleVO.oid)){
                         throw new VciBaseException("{0}閲岀殑鐢熷懡鍛ㄦ湡璁剧疆寰椾笉姝g‘锛屽湪绯荤粺涓病鏈夋壘鍒皗1}杩欎釜鐢熷懡鍛ㄦ湡",new String[]{btmTypeVO.getName(),btmTypeVO.getLifeCycleId()});
                     }
-                    cbo.setLcStatus(lifeCycleVO.startState);
+                    cbo.lcStatus = lifeCycleVO.startState;
                 }
             }
         }else{
             //鎴戜滑闇�瑕佸皢灞炴�у垵濮嬪寲
-            if(StringUtils.isBlank(cbo.getOid()) || (newRevision || newVersion)){
-                cbo.setOid(VciBaseUtil.getPk());
+            if(StringUtils.isBlank(cbo.oid) || (newRevision || newVersion)){
+                cbo.oid = VciBaseUtil.getPk();
             }
-            if(StringUtils.isBlank(cbo.getCreator())){
-                cbo.setCreator(VciBaseUtil.getCurrentUserId());
+            if(StringUtils.isBlank(cbo.creator)){
+                cbo.creator = VciBaseUtil.getCurrentUserId();
             }
-            if(cbo.getCreateTime() != 0){
-                cbo.setCreateTime(System.currentTimeMillis());
+            if(cbo.createTime != 0){
+                cbo.createTime = System.currentTimeMillis();
             }
-            if(StringUtils.isBlank(cbo.getOwner())){
-                cbo.setOwner(cbo.getCreator());
+            if(StringUtils.isBlank(cbo.owner)){
+                cbo.owner = cbo.creator;
             }
-            cbo.setTs(System.currentTimeMillis());
-            if(StringUtils.isNotBlank(btmTypeVO.getLifeCycleId()) && (StringUtils.isBlank(cbo.getLcStatus()) || newRevision || newVersion)){
+            cbo.ts = System.currentTimeMillis();
+            if(StringUtils.isNotBlank(btmTypeVO.getLifeCycleId()) && (StringUtils.isBlank(cbo.lcStatus) || newRevision || newVersion)){
                 //鏌ヨ鐢熷懡鍛ㄦ湡
                 OsLifeCycleVO lifeCycleVO = lifeCycleService.getLifeCycleById(btmTypeVO.getLifeCycleId());
                 if(lifeCycleVO == null || StringUtils.isBlank(lifeCycleVO.getOid())){
                     throw new VciBaseException("{0}閲岀殑鐢熷懡鍛ㄦ湡璁剧疆寰椾笉姝g‘锛屽湪绯荤粺涓病鏈夋壘鍒皗1}杩欎釜鐢熷懡鍛ㄦ湡",new String[]{btmTypeVO.getName(),btmTypeVO.getLifeCycleId()});
                 }
-                cbo.setLcStatus(lifeCycleVO.getStartStatus());
-                cbo.setLctId(btmTypeVO.getLifeCycleId());
+                cbo.lcStatus = lifeCycleVO.getStartStatus();
+                cbo.lctId = btmTypeVO.getLifeCycleId();
             }
-            if(StringUtils.isBlank(cbo.getBtmName())){
-                cbo.setBtmName(btmTypeVO.getId());
+            if(StringUtils.isBlank(cbo.btName)){
+                cbo.btName = btmTypeVO.getId();
             }
+
             if(btmTypeVO.isRevisionFlag()){
                 //瑕佺鐞嗙増鏈�
                 if(btmTypeVO.isInputRevisionFlag() && StringUtils.isNotBlank(baseDataMap.getOrDefault("revisionvalue",""))){
                     //鎵嬪姩鐨勶紝鎵�浠ヤ笉澶勭悊鐗堟湰瑙勫垯浜�
-                    cbo.setRevisionValue(baseDataMap.get("revisionvalue"));
+                    cbo.revisionValue = baseDataMap.get("revisionvalue");
                 }else {
                     OsRevisionRuleVO ruleVO = revisionRuleServiceI.getRevisionRuleById(btmTypeVO.getRevisionRuleId());
                     if (ruleVO == null || StringUtils.isBlank(ruleVO.getOid())) {
                         throw new VciBaseException("{0}閲岀殑鐗堟湰瑙勫垯璁剧疆寰椾笉姝g‘锛屽湪绯荤粺涓病鏈夋壘鍒皗1}杩欎釜鐗堟湰瑙勫垯", new String[]{btmTypeVO.getName(), btmTypeVO.getRevisionRuleId()});
                     }
-                    cbo.setRevisionValue(ruleVO.getStartCode());
+                    cbo.revisionValue = ruleVO.getInitialValue();
                 }
-                if (StringUtils.isBlank(cbo.getNameoid())) {
-                    cbo.setNameoid(VciBaseUtil.getPk());
+                if (StringUtils.isBlank(cbo.nameoid)) {
+                    cbo.nameoid = VciBaseUtil.getPk();
                 }
-                if (StringUtils.isBlank(cbo.getRevisionid())) {
-                    cbo.setRevisionid(VciBaseUtil.getPk());
+                if (StringUtils.isBlank(cbo.revisionid)) {
+                    cbo.revisionid = VciBaseUtil.getPk();
                 }
-                cbo.setIsFirstR(true);
-                cbo.setIsLastR(true);
-                cbo.setRevisionRule(btmTypeVO.getRevisionRuleId());
-                cbo.setRevisionSeq((short) 0);
+                cbo.isFirstR = true;
+                cbo.isLastR = true;
+                cbo.revisionRule = btmTypeVO.getRevisionRuleId();
+                cbo.revisionSeq = (short) 0;
                 //鐪嬬湅鏄惁闇�瑕佸鐞嗙増娆�
 
-                cbo.setVersionValue(getFirstVersion(btmTypeVO.getVersionRule()));
-                cbo.setVersionRule(btmTypeVO.getVersionRule());
-                cbo.setVersionSeq((short) 0);
-                cbo.setIsLastV(true);
-                cbo.setIsFirstV(true);
+                cbo.versionValue = getFirstVersion(btmTypeVO.getVersionRule());
+                cbo.versionRule = btmTypeVO.getVersionRule();
+                cbo.versionSeq = (short) 0;
+                cbo.isLastV = true;
+                cbo.isFirstV = true;
             }
         }
 //        Iterator<Map.Entry<String, String>> iterator = baseDataMap.entrySet().iterator();
@@ -2079,7 +2190,16 @@
 //            }
 //        }
         setValueToCbo(dataLowMap,baseDataMap,cbo,editFlag);
-//        cbo.setName(dataLowMap.get("name"));
+        //TODO:榛樿灞炴�ч渶瑕佹斁鍦╟bo澶栧眰
+        if(StringUtils.isNotBlank(baseDataMap.getOrDefault("id",""))){
+            cbo.id = baseDataMap.getOrDefault("id","");
+        }
+        if(StringUtils.isNotBlank(baseDataMap.getOrDefault("name",""))){
+            cbo.name = baseDataMap.getOrDefault("name","");
+        }
+        if(StringUtils.isNotBlank(baseDataMap.getOrDefault("description",""))){
+            cbo.description = baseDataMap.getOrDefault("description","");
+        }
         return cbo;
     }
 
@@ -2110,18 +2230,12 @@
      * @param editFlag 鏄惁涓虹紪杈�
      */
     @Override
-    public void setValueToCbo(Map<String, String> dataLow, Map<String, String> baseDataLow, com.vci.client.bof.ClientBusinessObject cbo, boolean editFlag){
+    public void setValueToCbo(Map<String, String> dataLow, Map<String, String> baseDataLow, BusinessObject cbo, boolean editFlag){
         dataLow.forEach((key,value)->{
             if(editFlag&&notSendOnEdit(key)){
                 //骞冲彴涓嶈兘浼犻�掕繖涓�
             }else{
-                try {
-//                    if(!SystemAttribute.bosysAttList().contains(key)){
-                        cbo.setAttributeValueWithNoCheck(key, value, !editFlag);
-//                    }
-                } catch (PLException vciError) {
-                    throw new VciBaseException("{0}鐨勫�间笉绗﹀悎瑕佹眰锛屽綋鍓嶆槸{1}", new String[]{key, value}, vciError);
-                }
+                ObjectTool.setBOAttributeValue(cbo,key,value);
             }
         });
         baseDataLow.forEach((key,value)->{
@@ -2130,23 +2244,11 @@
             }else{
                 if(editFlag) {
                     //缂栬緫鐨勬椂鍊欏彲浠ラ兘璁剧疆
-                    try {
-//                        if(!SystemAttribute.bosysAttList().contains(key)){
-                            cbo.setAttributeValueWithNoCheck(key, value, !editFlag);
-//                        }
-                    } catch (PLException vciError) {
-                        throw new VciBaseException("{0}鐨勫�间笉绗﹀悎瑕佹眰锛屽綋鍓嶆槸{1}", new String[]{key, value}, vciError);
-                    }
+                    ObjectTool.setBOAttributeValue(cbo,key,value);
                 }else{
                     //鍙渶瑕佸鐞唅d,name,description锛屽瘑绾у嵆鍙紝鍏朵綑鐨勯兘宸茬粡琚缃簡
                     if(basicFields.contains(key) &&StringUtils.isNotBlank(value)){
-                        try {
-//                            if(!SystemAttribute.bosysAttList().contains(key)){
-                                cbo.setAttributeValueWithNoCheck(key, value, true);
-//                            }
-                        } catch (PLException vciError) {
-                            throw new VciBaseException("{0}鐨勫�间笉绗﹀悎瑕佹眰锛屽綋鍓嶆槸{1}", new String[]{key, value}, vciError);
-                        }
+                        ObjectTool.setBOAttributeValue(cbo,key,value);
                     }
                 }
             }
@@ -2161,7 +2263,7 @@
      * @throws VciBaseException 鍙傛暟涓虹┖锛屽繀杈撻」缂哄け
      */
     @Override
-    public BaseResult linkEditSave(FormLinkDataDTO formLinkDataDTO) throws VciBaseException {
+    public BaseResult linkEditSave(FormLinkDataDTO formLinkDataDTO) throws VciBaseException, PLException {
         VciBaseUtil.alertNotNull(formLinkDataDTO,"淇敼鐨勬暟鎹璞�",formLinkDataDTO.getLinkType(),"閾炬帴绫诲瀷鐨勫悕绉�",
                 formLinkDataDTO.getFormDefineId(),"琛ㄥ崟瀹氫箟鐨勭紪鍙�",formLinkDataDTO.getOid(),"涓婚敭",
                 formLinkDataDTO.getFoid(),"from绔富閿�",formLinkDataDTO.getToid(),"to绔富閿�");
@@ -2182,12 +2284,10 @@
             //璇存槑鍓嶇疆浜嬩欢娌℃湁鎵ц鎴愬姛
             return beforeResult;
         }
-        com.vci.client.bof.ClientLinkObject clo = null;
+        LinkObject clo = null;
         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<>();
@@ -2200,10 +2300,10 @@
                 }
             });
         }
-        com.vci.client.bof.ClientBusinessObject toCbo =null;
+        BusinessObject toCbo =null;
         if(!CollectionUtils.isEmpty(boData)) {
             //灏佽to绔殑
-            BaseResult<com.vci.client.bof.ClientBusinessObject> result = wrapperToCbo(formLinkDataDTO, formDefineVO, toOid, toBtmName, boData);
+            BaseResult<BusinessObject> result = wrapperToCbo(formLinkDataDTO, formDefineVO, toOid, toBtmName, boData);
             if (!result.isSuccess()) {
                 return BaseResult.fail(result.getMsg(), result.getMsgObjs());
             }
@@ -2211,44 +2311,34 @@
         }
 
         //鍒濆鍖栭摼鎺ョ被鍨嬬殑鍊�
-        BaseResult<com.vci.client.bof.ClientLinkObject> resultClo = wrapperOnlyCLO(formLinkDataDTO, loData, formDefineVO, true);
+        BaseResult<LinkObject> resultClo = wrapperOnlyCLO(formLinkDataDTO, loData, formDefineVO, true);
         if(!resultClo.isSuccess()){
             return BaseResult.fail(resultClo.getMsg(),resultClo.getMsgObjs());
         }
         clo = resultClo.getObj();
-        if(toCbo!=null) {
-            if (formLinkDataDTO.isDirection()) {
-                clo.setFromBO(toCbo);
-            } else {
-                clo.setToBO(toCbo);
-            }
-        }
-//        LinkObjectHolder loHolder = new LinkObjectHolder();
-//        loHolder.value = clo.getLinkObject();
         try {
-//            platformClientUtil.getBOFactoryService().updateLinkObject(loHolder);
-            ServiceProvider.getBOFService().updateLinkObject(clo.getLinkObject());
+            platformClientUtil.getBOFService().updateLinkObject(clo);
         } catch (PLException vciError) {
             throw WebUtil.getVciBaseException(vciError);
         }
         //淇濆瓨to绔垨鑰協rom绔�
         try{
-            platformClientUtil.getBOFactoryService().updateBusinessObject(toCbo.getBusinessObject());
+            platformClientUtil.getBOFactoryService().updateBusinessObject(toCbo);
         } catch (PLException vciError) {
             throw WebUtil.getVciBaseException(vciError);
         }
         if(!CollectionUtils.isEmpty(formLinkDataDTO.getReleaseFileOids())){
-            fileObjectService.releasedFile(formLinkDataDTO.getLinkType(),clo.getOid(),formLinkDataDTO.getReleaseFileOids());
+            fileObjectService.releasedFile(formLinkDataDTO.getLinkType(),clo.oid,formLinkDataDTO.getReleaseFileOids());
         }
         //鍚庣疆浜嬩欢
         String afterEvent = formLinkDataDTO.getPostEvent();
         try {
-            callPostEvent(null,Arrays.stream(new com.vci.client.bof.ClientLinkObject[]{clo}).collect(Collectors.toList()), afterEvent, VciChangeDocumentTypeEnum.ADD);
+            callPostEvent(null,Arrays.stream(new LinkObject[]{clo}).collect(Collectors.toList()), afterEvent, VciChangeDocumentTypeEnum.ADD);
         }catch (Throwable e){
             //鍚庣疆浜嬩欢鏈夐棶棰樹簡灏卞彧鑳芥槸杩欐牱浜嗭紝娌″姙娉曟仮澶�
             throw new VciBaseException(LangBaseUtil.getErrorMsg(e),new String[]{},e);
         }
-        return BaseResult.success(clo.getOid());
+        return BaseResult.success(clo.oid);
     }
 
     /**
@@ -2264,31 +2354,31 @@
         if(deleteLinkDataDTO.getDataList().stream().anyMatch(s->StringUtils.isBlank(s.getOid()) || StringUtils.isBlank(s.getLinkType()))){
             throw new VciBaseException("鏈夋暟鎹殑涓婚敭(鎴栭摼鎺ョ被鍨嬶級娌℃湁鍊硷紝鏃犳硶鍒犻櫎");
         }
-        List<ClientLinkObject> clos = new ArrayList<>();
+        List<LinkObject> clos = new ArrayList<>();
         VciBaseUtil.switchListForOracleIn(deleteLinkDataDTO.getDataList()).stream().forEach(linkModelDTOs->{
             Map<String,String> conditionMap = new HashMap<>();
             conditionMap.put("oid",QueryOptionConstant.IN +"(" + VciBaseUtil.toInSql(linkModelDTOs.stream().map(BaseLinkModelDTO::getOid).toArray(String[]::new)) +")");
-            List<ClientLinkObject> clientLinkObjects = loService.queryCLO(linkModelDTOs.get(0).getLinkType(), conditionMap);
-            if(!CollectionUtils.isEmpty(clientLinkObjects)){
-                clos.addAll(clientLinkObjects);
+            List<LinkObject> LinkObjects = loService.queryCLO(linkModelDTOs.get(0).getLinkType(), conditionMap);
+            if(!CollectionUtils.isEmpty(LinkObjects)){
+                clos.addAll(LinkObjects);
             }
         });
         if(CollectionUtils.isEmpty(clos)){
             throw new VciBaseException("浣跨敤涓婚敭娌℃湁鍦ㄧ郴缁熶腑鎵惧埌閾炬帴绫诲瀷鐨勬暟鎹�");
         }
-        Map<String,List<ClientLinkObject>> fromBtmGroups = clos.stream().collect(Collectors.groupingBy(s->s.getFromBTMName()));
-        Map<String,List<ClientLinkObject>> toBtmGroups = clos.stream().collect(Collectors.groupingBy(s->s.getToBTMName()));
-        Map<String,List<com.vci.client.bof.ClientBusinessObject>> fromBtmDataGroups = new HashMap<>();
-        Map<String,List<com.vci.client.bof.ClientBusinessObject>> toBtmDataGroups = new HashMap<>();
+        Map<String,List<LinkObject>> fromBtmGroups = clos.stream().collect(Collectors.groupingBy(s->s.fromBTName));
+        Map<String,List<LinkObject>> toBtmGroups = clos.stream().collect(Collectors.groupingBy(s->s.toBTName));
+        Map<String,List<BusinessObject>> fromBtmDataGroups = new HashMap<>();
+        Map<String,List<BusinessObject>> toBtmDataGroups = new HashMap<>();
         if(!CollectionUtils.isEmpty(fromBtmGroups)){
             fromBtmGroups.forEach((btmType,cloList)->{
-                List<com.vci.client.bof.ClientBusinessObject> cbos = boService.selectCBOByOidCollection(cloList.stream().map(ClientLinkObject::getFromOid).collect(Collectors.toList()), btmType);
+                List<BusinessObject> cbos = boService.selectCBOByOidCollection(cloList.stream().map(clo -> clo.fromOid).collect(Collectors.toList()), btmType);
                 fromBtmDataGroups.put(btmType,cbos);
             });
         }
         if(!CollectionUtils.isEmpty(toBtmGroups)){
             toBtmGroups.forEach((btmType,cloList)->{
-                List<com.vci.client.bof.ClientBusinessObject> cbos = boService.selectCBOByOidCollection(cloList.stream().map(ClientLinkObject::getToOid).collect(Collectors.toList()), btmType);
+                List<BusinessObject> cbos = boService.selectCBOByOidCollection(cloList.stream().map(clo -> clo.toOid).collect(Collectors.toList()), btmType);
                 toBtmDataGroups.put(btmType,cbos);
             });
         }
@@ -2303,19 +2393,19 @@
                 if(attr.toLowerCase().startsWith(LO_FROM_PREFIX)){
                     fromBtmDataGroups.forEach((btm,cbos)->{
                         String attrNotPrefix = attr.substring(LO_FROM_PREFIX.length());
-                        if(!CollectionUtils.isEmpty(cbos) && cbos.stream().anyMatch(s->!attrValue.equalsIgnoreCase(s.getAttributeValue(attrNotPrefix)))){
+                        if(!CollectionUtils.isEmpty(cbos) && cbos.stream().anyMatch(s->!attrValue.equalsIgnoreCase(ObjectTool.getBOAttributeValue(s, attrNotPrefix)))){
                             throw new VciBaseException("鏁版嵁鐨勫唴瀹逛笉鍏佽鍒犻櫎,{0}", new String[]{deleteLinkDataDTO.getCheckNotDeleteMsg()});
                         }
                     });
                 }else if(attr.toLowerCase().startsWith(LO_TO_PREFIX)){
                     toBtmDataGroups.forEach((btm,cbos)->{
                         String attrNotPrefix = attr.substring(LO_TO_PREFIX.length());
-                        if(!CollectionUtils.isEmpty(cbos) && cbos.stream().anyMatch(s->!attrValue.equalsIgnoreCase(s.getAttributeValue(attrNotPrefix)))){
+                        if(!CollectionUtils.isEmpty(cbos) && cbos.stream().anyMatch(s->!attrValue.equalsIgnoreCase(ObjectTool.getBOAttributeValue(s, attrNotPrefix)))){
                             throw new VciBaseException("鏁版嵁鐨勫唴瀹逛笉鍏佽鍒犻櫎,{0}", new String[]{deleteLinkDataDTO.getCheckNotDeleteMsg()});
                         }
                     });
                 }else {
-                    if (clos.stream().anyMatch(s -> attrValue.equalsIgnoreCase(s.getAttributeValue(attr)))) {
+                    if (clos.stream().anyMatch(s -> attrValue.equalsIgnoreCase(ObjectTool.getLOAttributeValue(s,attr)))) {
                         throw new VciBaseException("鏁版嵁鐨勫唴瀹逛笉鍏佽鍒犻櫎,{0}", new String[]{deleteLinkDataDTO.getCheckNotDeleteMsg()});
                     }
                 }
@@ -2324,7 +2414,7 @@
         //閾炬帴绫诲瀷鏈韩涓�鑸笉浼氭湁鍏宠仈
         List<LinkObject> los = new ArrayList<>();
         clos.stream().forEach(clo->{
-            los.add(clo.getLinkObject());
+            los.add(clo);
         });
         try {
             platformClientUtil.getBOFactoryService().batchDeleteLinkObject(los.toArray(new LinkObject[0]));
@@ -2334,7 +2424,7 @@
         if(deleteLinkDataDTO.isDeleteFromData()){
             fromBtmDataGroups.forEach((btm,cbos)->{
                 try{
-                    platformClientUtil.getBOFactoryService().batchDeleteBusinessObject(cbos.stream().map(com.vci.client.bof.ClientBusinessObject::getBusinessObject).toArray(BusinessObject[] :: new),1);
+                    platformClientUtil.getBOFactoryService().batchDeleteBusinessObject(cbos.toArray(new BusinessObject[0]), DeleteTypeEnum.OID_AND_TS.getValue());
                 }catch (PLException vciError) {
                     throw WebUtil.getVciBaseException(vciError);
                 }
@@ -2343,7 +2433,7 @@
         if(deleteLinkDataDTO.isDeleteToData()){
             toBtmDataGroups.forEach((btm,cbos)->{
                 try{
-                    platformClientUtil.getBOFactoryService().batchDeleteBusinessObject(cbos.stream().map(com.vci.client.bof.ClientBusinessObject::getBusinessObject).toArray(BusinessObject[] :: new),1);
+                    platformClientUtil.getBOFactoryService().batchDeleteBusinessObject(cbos.toArray(new BusinessObject[0]),DeleteTypeEnum.OID_AND_TS.getValue());
                 }catch (PLException vciError) {
                     throw WebUtil.getVciBaseException(vciError);
                 }
@@ -2360,10 +2450,10 @@
      * @return 鍒楄〃鏁版嵁
      */
     @Override
-    public DataGrid referDataGrid(ReferConfigVO referConfigVO, PageHelper pageHelper) {
+    public DataGrid referDataGrid(ReferConfigVO referConfigVO, PageHelper pageHelper) throws PLException {
         checkReferConfig(referConfigVO);
         //浣跨敤涓氬姟绫诲瀷鏌ヨ
-        OsBtmTypeVO btmById = btmService.getBtmById(referConfigVO.getReferBo());
+        OsBtmTypeVO btmById = btmService.getBtmByName(referConfigVO.getReferBo());
         if(referConfigVO.getConditionMap() == null){
             referConfigVO.setConditionMap(new HashMap<>());
         }
@@ -2417,7 +2507,7 @@
             referConfigVO.setConditionMap(new HashMap<>());
         }
 
-        List<com.vci.client.bof.ClientBusinessObject> cbos = null;
+        List<BusinessObject> cbos = null;
         String oidFieldName = StringUtils.isNotBlank(referConfigVO.getParentUsedField())?referConfigVO.getParentUsedField():referConfigVO.getValueField();
         if(referConfigVO.isSelectAllLevel()) {
             String parentOidSql = "";
@@ -2492,7 +2582,7 @@
     @Override
     public List<Map<String,String>> getDataAttr(String btmname, String oid) {
         VciBaseUtil.alertNotNull(btmname,"涓氬姟绫诲瀷鐨勪俊鎭�",oid,"涓氬姟鏁版嵁鐨勪富閿�");
-        List<com.vci.client.bof.ClientBusinessObject> cbos = boService.queryCBO(btmname,WebUtil.getOidQuery(oid));
+        List<BusinessObject> cbos = boService.queryCBO(btmname,WebUtil.getOidQuery(oid));
         List<Map<String,String>> dataMap = new ArrayList<>();
         if(!CollectionUtils.isEmpty(cbos)){
             cbos.stream().forEach(cbo->{
@@ -2503,4 +2593,73 @@
         }
         return dataMap;
     }
+
+    /**
+     * 鏁版嵁鍗囩増鏈�/娆★紝鍓嶇浣跨敤JSON鎻愪氦
+     * @param btmname 涓氬姟绫诲瀷鐨勪俊鎭�
+     * @param oid 涓氬姟鏁版嵁鐨勪富閿�
+     * @param type 1:鐗堟瀵硅薄锛�2锛氱増鏈璞★紱3锛氫富瀵硅薄
+     * @return 鎵ц鐨勭粨鏋�
+     */
+    @Override
+    public BaseResult deleteBusinessObject(String btmname, String oid, int type) throws PLException {
+        List<BusinessObject> cbos = boService.queryCBO(btmname,WebUtil.getOidQuery(oid));
+        BaseResult<Object> objectBaseResult = new BaseResult<>();
+        if(cbos.size() == 0){
+            objectBaseResult.setSuccess(false);
+            throw new PLException("500", new String[]{"娌℃湁鑾峰彇鍒版暟鎹殑涓婚敭"});
+        }
+        for (BusinessObject cbo : cbos) {
+            if(StringUtils.isBlank(cbo.revisionid)){
+                String revisionoid = Arrays.stream(cbo.hisAttrValList).filter(e -> e.attrName.equals("REVISIONOID")).findFirst().map(e -> e.attrVal).orElse("");
+                cbo.revisionid = revisionoid;
+            }
+            boolean b = platformClientUtil.getBOFService().deleteBusinessObject(cbo,type);
+            if(!b){
+                throw new PLException("500", new String[]{"鏁版嵁鍒犻櫎澶辫触锛侊紒"});
+            }
+        }
+        return BaseResult.success();
+    }
+    /**
+     * 鍙樻洿鎵�鏈夎��
+     * @param btmname 涓氬姟绫诲瀷
+     * @param oid 涓婚敭
+     * @return 鎵ц鐨勭粨鏋�
+     */
+    @Override
+    public BaseResult changeBusinessObjectOwner(String btmname, String oid) throws PLException {
+        List<BusinessObject> cbos = boService.queryCBO(btmname,WebUtil.getOidQuery(oid));
+        BaseResult<Object> objectBaseResult = new BaseResult<>();
+        if(cbos.size() == 0){
+            objectBaseResult.setSuccess(false);
+            throw new PLException("500", new String[]{"娌℃湁鑾峰彇鍒版暟鎹殑涓婚敭"});
+        }
+        UserInfo userInfo = platformClientUtil.getFrameworkService().getUserObjectByUserName(WebUtil.getCurrentUserId());
+        for (BusinessObject cbo : cbos) {
+            platformClientUtil.getBOFService().changeBusinessObjectOwner(cbo,userInfo);
+        }
+        return BaseResult.success();
+    }
+    /**
+     * 鍙樻洿鎵�鏈夎��
+     * @param btmname 涓氬姟绫诲瀷
+     * @param oid 涓婚敭
+     * @param releaseStatus 鍙戝竷鐘舵��
+     * @return 鎵ц鐨勭粨鏋�
+     */
+    @Override
+    @Transactional
+    public BaseResult transferBusinessObject(String btmname, String oid, String toStatus,String releaseStatus) throws PLException {
+        List<BusinessObject> cbos = boService.queryCBO(btmname,WebUtil.getOidQuery(oid));
+        BaseResult<Object> objectBaseResult = new BaseResult<>();
+        if(cbos.size() == 0){
+            objectBaseResult.setSuccess(false);
+            throw new PLException("500", new String[]{"娌℃湁鑾峰彇鍒版暟鎹殑涓婚敭"});
+        }
+        for (BusinessObject cbo : cbos) {
+            platformClientUtil.getBOFService().transferBusinessObjectAndRelease(cbo, toStatus, releaseStatus);
+        }
+        return BaseResult.success();
+    }
 }

--
Gitblit v1.9.3