From f29ad099c6dc5c55d6cb94fb190d06743777ec6d Mon Sep 17 00:00:00 2001
From: dangsn <dangsn@chicecm.com>
Date: 星期三, 05 六月 2024 10:56:48 +0800
Subject: [PATCH] 项目引用调整

---
 Source/platformProject/vci-platform-web/src/main/java/com/vci/web/service/impl/WebBoServiceImpl.java |  300 ++++++++++++++++++++++++++++++-----------------------------
 1 files changed, 154 insertions(+), 146 deletions(-)

diff --git a/Source/platformProject/vci-platform-web/src/main/java/com/vci/web/service/impl/WebBoServiceImpl.java b/Source/platformProject/vci-platform-web/src/main/java/com/vci/web/service/impl/WebBoServiceImpl.java
index cb1e6e2..0d56564 100644
--- a/Source/platformProject/vci-platform-web/src/main/java/com/vci/web/service/impl/WebBoServiceImpl.java
+++ b/Source/platformProject/vci-platform-web/src/main/java/com/vci/web/service/impl/WebBoServiceImpl.java
@@ -1,47 +1,42 @@
 package com.vci.web.service.impl;
 
-import com.alibaba.fastjson.JSONObject;
-import com.vci.base.common.utility.ObjectUtility;
+import com.vci.client.bof.ClientBusinessObject;
+import com.vci.client.common.oq.OQTool;
 import com.vci.client.common.providers.ServiceProvider;
-import com.vci.corba.common.VCIError;
+import com.vci.common.qt.object.*;
+import com.vci.common.utility.ObjectUtility;
+import com.vci.corba.common.PLException;
+import com.vci.corba.omd.data.AttributeValue;
+import com.vci.corba.omd.data.BusinessObject;
 import com.vci.corba.omd.qtm.QTInfo;
 import com.vci.corba.query.ObjectQueryService;
 import com.vci.corba.query.ObjectQueryServicePrx;
+import com.vci.corba.query.data.BtmRefQueryOption;
+import com.vci.corba.query.data.KV;
 import com.vci.frameworkcore.compatibility.SmUserQueryServiceI;
-import com.vci.mw.client.InvocationUtility;
 import com.vci.starter.web.annotation.Column;
 import com.vci.starter.web.constant.QueryOptionConstant;
-import com.vci.corba.query.data.BtmRefQueryOption;
 import com.vci.starter.web.enumpck.BooleanEnum;
 import com.vci.starter.web.exception.VciBaseException;
 import com.vci.starter.web.pagemodel.DataGrid;
 import com.vci.starter.web.pagemodel.PageHelper;
 import com.vci.starter.web.util.BeanUtil;
 import com.vci.starter.web.util.VciBaseUtil;
-import com.vci.starter.web.util.VciDateUtil;
 import com.vci.starter.web.wrapper.VciQueryWrapperForDO;
 import com.vci.web.pageModel.*;
 import com.vci.web.properties.WebProperties;
 import com.vci.web.service.*;
-import com.vci.web.util.Func;
 import com.vci.web.util.PlatformClientUtil;
 import com.vci.web.util.WebUtil;
 import org.apache.commons.lang3.StringUtils;
-import org.apache.poi.ss.formula.functions.T;
 import org.dom4j.DocumentException;
 import org.dom4j.DocumentHelper;
-import org.omg.CORBA.IntHolder;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.util.CollectionUtils;
-import plm.bs.bom.clientobject.ClientBusinessObject;
-import plm.bs.bom.clientobject.ClientLinkObject;
-import plm.bs.bom.common.*;
-import plm.corba.qt.KV;
-import plm.corba.qt.QTServiceOperations;
-import plm.oq.objectQuery.common.*;
+
 
 import java.lang.reflect.Field;
 import java.util.*;
@@ -188,14 +183,14 @@
 		bo.setRevisionid((new ObjectUtility()).getNewObjectID36());
 		bo.setNameoid((new ObjectUtility()).getNewObjectID36());
 		bo.setBtmName(boName);
-		bo.setIsLastR(1);
-		bo.setIsFirstR(1);
-		bo.setIsFirstV(1);
-		bo.setIsLastV(1);
+		bo.setIsLastR(true);
+		bo.setIsFirstR(true);
+		bo.setIsFirstV(true);
+		bo.setIsLastV(true);
 		bo.setCreator(userName);
-		bo.setCreateTime(String.valueOf(System.currentTimeMillis()));
+		bo.setCreateTime(System.currentTimeMillis());
 		bo.setLastModifier(userName);
-		bo.setLastModifyTime(String.valueOf(System.currentTimeMillis()));
+		bo.setLastModifyTime(System.currentTimeMillis());
 		bo.setRevisionRule(btmTypeVO.getRevisionRuleId());
 		bo.setVersionRule(String.valueOf(btmTypeVO.getVersionRule()));
 		if(StringUtils.isNotBlank(btmTypeVO.getRevisionRuleId())){
@@ -203,8 +198,8 @@
 			bo.setRevisionValue(revisionRuleVO.getStartCode());
 		}
 
-		bo.setRevisionSeq(1);
-		bo.setVersionSeq(1);
+		bo.setRevisionSeq((short) 1);
+		bo.setVersionSeq((short) 1);
 		bo.setVersionValue(getVersionValue(WebUtil.getInt(btmTypeVO.getVersionRule())));
 		bo.setLctId(btmTypeVO.getLifeCycleId());
 		if(StringUtils.isNotBlank(btmTypeVO.getLifeCycleId())){
@@ -215,7 +210,7 @@
 		bo.setName("");
 		bo.setDescription("");
 		bo.setOwner(userName);
-		bo.setCheckinBy(userName);
+//		bo.setCheckinBy(userName);
 		bo.setCopyFromVersion("");
 		this.initTypeAttributeValue(bo,btmTypeVO);
 		return bo;
@@ -230,7 +225,7 @@
 		Optional.ofNullable(btmTypeVO.getAttributes()).orElseGet(()->new ArrayList<>()).stream().forEach(attribute->{
 			try {
 				cbo.setAttributeValueWithNoCheck(attribute.getId(),attribute.getDefaultValue());
-			} catch (VCIError vciError) {
+			} catch (PLException vciError) {
 				if(logger.isErrorEnabled()){
 					logger.error("璁剧疆灞炴�х殑鍊肩殑鏃跺�欏嚭鐜颁簡閿欒",vciError);
 				}
@@ -261,20 +256,20 @@
 	 */
 	private  ClientBusinessObject cloneClientBusinessObject(ClientBusinessObject cbo){
     	if(cbo !=null){
-			BusinessObject businessObject = new BusinessObject();
-			BusinessObject bo = cbo.getBusinessObject();
+			com.vci.corba.omd.data.BusinessObject businessObject = new com.vci.corba.omd.data.BusinessObject();
+			com.vci.corba.omd.data.BusinessObject bo = cbo.getBusinessObject();
 			businessObject.oid = new ObjectUtility().getNewObjectID36();
 			businessObject.revisionid = new ObjectUtility().getNewObjectID36();
 			businessObject.nameoid = new ObjectUtility().getNewObjectID36();
-			businessObject.btmName = bo.btmName;
+			businessObject.btName = bo.btName;
 			businessObject.isLastR = bo.isLastR;
 			businessObject.isFirstR = bo.isFirstR;
 			businessObject.isLastV = bo.isLastV;
 			businessObject.isFirstV = bo.isFirstV;
 			businessObject.creator = WebUtil.getCurrentUserId();
-			businessObject.createTime = String.valueOf(System.currentTimeMillis());
-			businessObject.lastModifier = bo.lastModifier;
-			businessObject.lastModifyTime = String.valueOf(bo.lastModifyTime);
+			businessObject.createTime = System.currentTimeMillis();
+			businessObject.modifier = bo.modifier;
+			businessObject.modifyTime = bo.modifyTime;
 			businessObject.revisionRule = bo.revisionRule;
 			businessObject.versionRule = bo.versionRule;
 			businessObject.revisionSeq = bo.revisionSeq;
@@ -283,16 +278,16 @@
 			businessObject.versionValue = bo.versionValue;
 			businessObject.lctId = bo.lctId;
 			businessObject.lcStatus = bo.lcStatus;
-			businessObject.ts = VciDateUtil.getNowString();
+			businessObject.ts = System.currentTimeMillis();
 			businessObject.id = bo.id;
 			businessObject.name = bo.name;
 			businessObject.description = bo.description;
 			businessObject.owner = businessObject.creator;
-			businessObject.checkinBy = bo.checkinBy;
-			businessObject.checkinTime = bo.checkinTime;
-			businessObject.checkoutBy = bo.checkoutBy;
-			businessObject.checkoutTime = bo.checkoutTime;
-			businessObject.copyFromVersion = bo.copyFromVersion;
+//			businessObject.checkinBy = bo.checkinBy;
+//			businessObject.checkinTime = bo.checkinTime;
+//			businessObject.checkoutBy = bo.checkoutBy;
+//			businessObject.checkoutTime = bo.checkoutTime;
+			businessObject.fromVersion = bo.fromVersion;
 			if(bo.newAttrValList !=null){
 				businessObject.newAttrValList = clone(bo.newAttrValList);
 			}
@@ -312,10 +307,10 @@
 	 * @param newAttrValList 灞炴�у�煎璞℃暟缁�
 	 * @return 鎷疯礉鍚庣殑鏂板睘鎬ф暟缁�
 	 */
-	private  AttributeValue[] clone(AttributeValue[] newAttrValList) {
-		AttributeValue[] n = new AttributeValue[newAttrValList.length];
+	private  com.vci.corba.omd.data.AttributeValue[] clone(com.vci.corba.omd.data.AttributeValue[] newAttrValList) {
+		com.vci.corba.omd.data.AttributeValue[] n = new com.vci.corba.omd.data.AttributeValue[newAttrValList.length];
 		for (int i = 0; i < newAttrValList.length; i++) {
-			n[i] = new AttributeValue(newAttrValList[i].attrName,newAttrValList[i].attrVal);
+			n[i] = new com.vci.corba.omd.data.AttributeValue(newAttrValList[i].attrName,newAttrValList[i].attrVal);
 		}
 		return n;
 	}
@@ -346,11 +341,11 @@
 					if(key.indexOf("_start")>-1){
 						String attr = key.replace("_start", "");
 						thisConditionMap.put(attr, value);
-						condition = Tool.getCondition(thisConditionMap);
+						condition = OQTool.getCondition(thisConditionMap);
 						if(conditionMap.containsKey(attr + "_end")){//濡傛灉娌℃湁缁撴潫锛屽叾瀹炰篃鏄厑璁哥殑锛�
 							Map<String,String> endConditonMap = new HashMap<String, String>();
 							endConditonMap.put(attr, conditionMap.get(attr + "_end"));
-							condition = Tool.mergeCondition(condition, Tool.getCondition(endConditonMap), Connector.AND);
+							condition = OQTool.mergeCondition(condition, OQTool.getCondition(endConditonMap), Connector.AND);
 						}
 					}
 				}else{
@@ -371,12 +366,12 @@
 					}else {
 						thisConditionMap.put(key, value);
 					}
-					condition = Tool.getCondition(thisConditionMap);
+					condition = OQTool.getCondition(thisConditionMap);
 				}
 				if(mergeCondition == null){
 					mergeCondition = condition;
 				}else{
-					mergeCondition = Tool.mergeCondition(mergeCondition, condition, isOr?Connector.OR:Connector.AND);
+					mergeCondition = OQTool.mergeCondition(mergeCondition, condition, isOr? Connector.OR:Connector.AND);
 				}
 			}
 		}
@@ -401,11 +396,11 @@
 		String fieldName = referInfo.split("\\.")[1].trim().toLowerCase();
 		Map<String,String> conditionMap = new HashMap<String, String>();
 		conditionMap.put(fieldName,QueryOptionConstant.IN + "(" + WebUtil.toInSql(value.toArray(new String[0])) + ")");
-		List<ClientBusinessObject> cbos = queryCBO(btmName,conditionMap,null, Arrays.asList(new String[]{"oid",fieldName}));
+		List<com.vci.client.bof.ClientBusinessObject> cbos = queryCBO(btmName,conditionMap,null, Arrays.asList(new String[]{"oid",fieldName}));
 
 		Map<String,String> data = new HashMap<String, String>();
 		if(cbos!=null && cbos.size() > 0){
-			for(ClientBusinessObject cbo : cbos){
+			for(com.vci.client.bof.ClientBusinessObject cbo : cbos){
 				data.put(cbo.getAttributeValue(fieldName),cbo.getOid());
 			}
 		}
@@ -435,9 +430,9 @@
 			throw new VciBaseException("灞炴��" + columnName + "鐨勫�间负绌�");
 		}
 		conditionMap.put(columnName,QueryOptionConstant.IN + "(" + VciBaseUtil.toInSql(oidSet.toArray(new String[0])) + ")");
-		List<ClientBusinessObject> cbos = queryCBO(btmName,conditionMap,null,Arrays.asList(new String[]{columnName}));
+		List<com.vci.client.bof.ClientBusinessObject> cbos = queryCBO(btmName,conditionMap,null,Arrays.asList(new String[]{columnName}));
 		if(cbos !=null && cbos.size() >0){
-			for(ClientBusinessObject cbo : cbos){
+			for(com.vci.client.bof.ClientBusinessObject cbo : cbos){
 				String oid = cbo.getAttributeValue(columnName);
 				if(oidSet.contains(oid)){
 					oidSet.remove(oid);
@@ -475,7 +470,7 @@
 	 * @throws VciBaseException 鏌ヨ鍑洪敊鐨勬槸鎶涘嚭寮傚父
 	 */
 	@Override
-	public List<ClientBusinessObject> queryCBO(String btmType,
+	public List<com.vci.client.bof.ClientBusinessObject> queryCBO(String btmType,
 			Map<String, String> conditionMap) throws VciBaseException {
 		List<String> clauseList = new ArrayList<String>();
 		clauseList.add("*");
@@ -492,7 +487,7 @@
 	 * @throws VciBaseException 鏌ヨ鍑洪敊鐨勬槸鎶涘嚭寮傚父
 	 */
 	@Override
-	public List<ClientBusinessObject> queryCBO(String btmType,
+	public List<com.vci.client.bof.ClientBusinessObject> queryCBO(String btmType,
 			Map<String, String> conditionMap, PageHelper ph)
 			throws VciBaseException {
 		List<String> clauseList = new ArrayList<String>();
@@ -510,7 +505,7 @@
 	 * @throws VciBaseException 鏌ヨ鍑洪敊鐨勬槸鎶涘嚭寮傚父
 	 */
 	@Override
-	public List<ClientBusinessObject> queryCBO(String btmType,
+	public List<com.vci.client.bof.ClientBusinessObject> queryCBO(String btmType,
 			Map<String, String> conditionMap, PageHelper ph,
 			List<String> clauseList) throws VciBaseException {
 		QueryTemplate qt = new QueryTemplate();
@@ -561,8 +556,8 @@
 	 * @return 鏌ヨ鍑烘潵鐨勫��
 	 * @throws VciBaseException 鏌ヨ鍑洪敊鐨勬椂鍊欎細鎶涘嚭寮傚父
 	 */
-	private List<ClientBusinessObject> baseQueryCBO(QueryTemplate qt,Map<String,String> conditionMap,PageHelper ph,List<String> clauseList) throws VciBaseException{
-		List<ClientBusinessObject> allCbos = new ArrayList<ClientBusinessObject>();
+	private List<com.vci.client.bof.ClientBusinessObject> baseQueryCBO(QueryTemplate qt,Map<String,String> conditionMap,PageHelper ph,List<String> clauseList) throws VciBaseException{
+		List<com.vci.client.bof.ClientBusinessObject> allCbos = new ArrayList<com.vci.client.bof.ClientBusinessObject>();
 		if(clauseList == null){
 			clauseList = new ArrayList<String>();
 			clauseList.add("*");
@@ -606,7 +601,7 @@
 		conditionMap = WebUtil.getNotNullMap(conditionMap);
 		Condition condition = getConditionByMap(conditionMap);
 		if(qt.getCondition() !=null) {
-			qt.setCondition(Tool.mergeCondition(qt.getCondition(), condition, Connector.AND));
+			qt.setCondition(OQTool.mergeCondition(qt.getCondition(), condition, Connector.AND));
 		}else {
 			qt.setCondition(condition);
 		}
@@ -621,32 +616,41 @@
 				logger.error("娌℃湁鎵惧埌鏌ヨ鏈嶅姟");
 				throw new VciBaseException(msgCodePrefix+"qtServerNull", new String[]{});
 			}
-			IntHolder count = new IntHolder();
+//			IntHolder count = new IntHolder();
 			ObjectQueryService.FindBTMObjectsV3Result bos = null;
-			String invo = JSONObject.toJSONString(InvocationUtility.getInvocation());
+//			String invo = JSONObject.toJSONString(InvocationUtility.getInvocation());
 			try{
-				//bos = qtService.findBTMObjectsV3(invo,qt.getId(), Tool.qtTOXMl(qt).asXML(),count,refOpts.toArray(new BtmRefQueryOption[0]));
-				bos = qtService.findBTMObjectsV3(qt.getId(), Tool.qtTOXMl(qt).asXML(), refOpts.toArray(new BtmRefQueryOption[0]));
-			}catch (VCIError e){
-				//bos = qtService.findBTMObjectsV4(invo,qt.getId(), Tool.qtTOXMl(qt).asXML(),count,refOpts.toArray(new BtmRefQueryOption[0]));
-				bos = qtService.findBTMObjectsV3(qt.getId(), Tool.qtTOXMl(qt).asXML(), refOpts.toArray(new BtmRefQueryOption[0]));
+				//bos = qtService.findBTMObjectsV3(invo,qt.getId(), OQTool.qtTOXMl(qt).asXML(),count,refOpts.toArray(new BtmRefQueryOption[0]));
+				bos = qtService.findBTMObjectsV3(qt.getId(), OQTool.qtTOXMl(qt).asXML(), refOpts.toArray(new BtmRefQueryOption[0]));
+			}catch (PLException e){
+				//bos = qtService.findBTMObjectsV4(invo,qt.getId(), OQTool.qtTOXMl(qt).asXML(),count,refOpts.toArray(new BtmRefQueryOption[0]));
+				bos = qtService.findBTMObjectsV3(qt.getId(), OQTool.qtTOXMl(qt).asXML(), refOpts.toArray(new BtmRefQueryOption[0]));
 			}
 			if (bos != null && bos.count > 0) {
 				for (com.vci.corba.omd.data.BusinessObject bo : bos.returnValue) {
-					ClientBusinessObject cbo = new ClientBusinessObject();
-					BusinessObject businessObject = Func.copyProperties(bo, BusinessObject.class);
-					cbo.setBusinessObject(businessObject);
+					com.vci.client.bof.ClientBusinessObject cbo = new com.vci.client.bof.ClientBusinessObject();
+					cbo.setBusinessObject(bo);
 					queryEnumText(cbo,enumAttrName);
 					allCbos.add(cbo);
 				}
 				//鍥犱负淇敼浜嗘煡璇㈢殑鏂瑰紡锛屾墍浠ュ氨涓嶉渶瑕佸崟鐙煡璇㈠弬鐓�
 			}
 			queryLcStatus(allCbos);
-		} catch (VCIError e) {
-			//logger.error(e.error_code,e);
+		} catch (PLException e) {
 			throw WebUtil.getVciBaseException(e);
 		}
 		return allCbos;
+	}
+
+	public AttributeValue[] copyToAttributeValue(com.vci.corba.omd.data.AttributeValue[] attributeValues){
+		AttributeValue[] attributeValueList = new AttributeValue[attributeValues.length];
+		for (int i = 0; i < attributeValues.length; i++) {
+			AttributeValue newAttributeValue = new AttributeValue();
+			newAttributeValue.attrName = attributeValues[i].attrName;
+			newAttributeValue.attrVal = attributeValues[i].attrVal;
+			attributeValueList[i] = newAttributeValue;
+		}
+		return attributeValueList;
 	}
 
 	/**
@@ -722,7 +726,7 @@
 	 * 鏌ヨ鐢熷懡鍛ㄦ湡鐨勫��
 	 * @param cbos 涓氬姟瀵硅薄
 	 */
-	private void queryLcStatus(List<ClientBusinessObject> cbos){
+	private void queryLcStatus(List<com.vci.client.bof.ClientBusinessObject> cbos){
 		if(!CollectionUtils.isEmpty(cbos)){
 
 			Map<String, OsStatusVO> statusVOMap = statusService.selectAllStatusMap();
@@ -742,7 +746,7 @@
 	 * @param enumAttrName 鏋氫妇灞炴�х殑鍊�
 	 * @throws VciBaseException
 	 */
-	private void queryEnumText(ClientBusinessObject cbo,List<String> enumAttrName) throws VciBaseException{
+	private void queryEnumText(com.vci.client.bof.ClientBusinessObject cbo,List<String> enumAttrName) throws VciBaseException{
 		queryEnumText(cbo,null,enumAttrName);
 	}
 
@@ -754,7 +758,7 @@
 	 * @throws VciBaseException 鏌ヨ鏋氫妇鍑洪敊鐨勬椂鍊欎細鎶涘嚭寮傚父
 	 */
 	@Override
-	public void queryEnumText(ClientBusinessObject cbo, ClientLinkObject clo, List<String> enumAttrName) throws VciBaseException{
+	public void queryEnumText(com.vci.client.bof.ClientBusinessObject cbo, com.vci.client.bof.ClientLinkObject clo, List<String> enumAttrName) throws VciBaseException{
 		if(enumAttrName.size()>0){//鏌ヨ鏋氫妇
 			for(String enumAttr:enumAttrName){//鏍煎紡涓�   code_field  code鏄灇涓剧殑缂栫爜锛宖ield鏄綋鍓嶄笟鍔$被鍨嬪瓨鍌ㄦ灇涓惧�肩殑瀛楁
 				if(enumAttr.toLowerCase().equals("creator_name")){
@@ -832,7 +836,7 @@
 	 * @param attr 灞炴�у悕
 	 * @param value 鍊�
 	 */
-	private void setValueToCboOrClo(ClientBusinessObject cbo,ClientLinkObject clo,String attr,String value){
+	private void setValueToCboOrClo(com.vci.client.bof.ClientBusinessObject cbo,com.vci.client.bof.ClientLinkObject clo,String attr,String value){
 		try {
 			if (cbo != null) {
 				cbo.setAttributeValueWithNoCheck(attr, value);
@@ -851,13 +855,13 @@
 	 * @param attributeValue 灞炴�х殑鍊�
 	 */
 	@Override
-	public void setAttributeValueForClo(ClientLinkObject clo, String attributeName, String attributeValue) {
-		AttributeValue[] attrValues = clo.getLinkObject().newAttrValList;
-		ArrayList<AttributeValue> attrValList = new ArrayList();
-		AttributeValue attrVal;
+	public void setAttributeValueForClo(com.vci.client.bof.ClientLinkObject clo, String attributeName, String attributeValue) {
+		com.vci.corba.omd.data.AttributeValue[] attrValues = clo.getLinkObject().newAttrValList;
+		ArrayList<com.vci.corba.omd.data.AttributeValue> attrValList = new ArrayList();
+		com.vci.corba.omd.data.AttributeValue attrVal;
 		int i;
 		if (attrValues != null && attrValues.length > 0) {
-			AttributeValue[] var9 = attrValues;
+			com.vci.corba.omd.data.AttributeValue[] var9 = attrValues;
 			i = attrValues.length;
 
 			for (int var7 = 0; var7 < i; ++var7) {
@@ -870,7 +874,7 @@
 		boolean isExist = false;
 
 		for (i = 0; i < attrValList.size(); ++i) {
-			attrVal = (AttributeValue) attrValList.get(i);
+			attrVal = (com.vci.corba.omd.data.AttributeValue) attrValList.get(i);
 			if (attrVal.attrName.toUpperCase().equals(attributeName.toUpperCase())) {
 				attrVal.attrVal = attributeValue;
 				isExist = true;
@@ -879,13 +883,13 @@
 		}
 
 		if (!isExist) {
-			attrVal = new AttributeValue();
+			attrVal = new com.vci.corba.omd.data.AttributeValue();
 			attrVal.attrName = attributeName.toUpperCase();
 			attrVal.attrVal = attributeValue;
 			attrValList.add(attrVal);
 		}
 
-		clo.getLinkObject().newAttrValList = (AttributeValue[]) attrValList.toArray(new AttributeValue[attrValList.size()]);
+		clo.getLinkObject().newAttrValList = (com.vci.corba.omd.data.AttributeValue[]) attrValList.toArray(new com.vci.corba.omd.data.AttributeValue[attrValList.size()]);
 	}
 
 
@@ -895,7 +899,7 @@
 	 * @param enumAttrName 鏋氫妇灞炴��
 	 * @throws VciBaseException 鏌ヨ鍑洪敊鐨勬椂鍊欎細鎶涘嚭寮傚父
 	 */
-	private void queryEnumTextClo(ClientLinkObject clo,List<String> enumAttrName) throws VciBaseException{
+	private void queryEnumTextClo(com.vci.client.bof.ClientLinkObject clo,List<String> enumAttrName) throws VciBaseException{
 		queryEnumText(null,clo,enumAttrName);
 	}
 
@@ -908,7 +912,7 @@
 	 * @throws VciBaseException 鏌ヨ鍑洪敊鐨勬椂鍊欎細鎶涘嚭寮傚父
 	 */
 	@Override
-	public List<ClientBusinessObject> queryCBOByScheme(String queryScheme,
+	public List<com.vci.client.bof.ClientBusinessObject> queryCBOByScheme(String queryScheme,
 			Map<String, String> conditionMap, Map<String, String> replaceMap)
 			throws VciBaseException {
 		PageHelper ph = new PageHelper(-1);
@@ -926,7 +930,7 @@
 	 * @throws VciBaseException 鏌ヨ鍑洪敊鐨勬椂鍊欎細鎶涘嚭寮傚父
 	 */
 	@Override
-	public List<ClientBusinessObject> queryCBOByScheme(String queryScheme,
+	public List<com.vci.client.bof.ClientBusinessObject> queryCBOByScheme(String queryScheme,
 			Map<String, String> conditionMap, Map<String, String> replaceMap,
 			PageHelper ph) throws VciBaseException {
 		List<String> clauseList = new ArrayList<String>();
@@ -948,7 +952,7 @@
 			VciBaseUtil.alertNotNull(name,"鏌ヨ妯℃澘鐨勫悕绉�");
 			// QTWrapper wrapper = platformClientUtil.getQueryService().getQT(name);
 			QTInfo wrapper = ServiceProvider.getOMDService().getQTDService().getQT(name);
-			qt = Tool.getQTByDoc(DocumentHelper.parseText(wrapper.qtText), name);
+			qt = OQTool.getQTByDoc(DocumentHelper.parseText(wrapper.qtText), name);
 			//鍥犱负涔嬪墠骞冲彴鐨凾ool.replaceQTValues 娌℃湁澶勭悊 ${xxx}銆傦紝 涓轰簡蹇界暐澶у皬鍐欙紝鎴戜滑杩欓噷鍗曠嫭澶勭悊 weidy@2021-3-10
 			//鎴戜滑杞崲涓哄皬鍐�
 			Condition condition = qt.getCondition();
@@ -985,9 +989,9 @@
 					}
 				});
 			}
-		}catch(VCIError e){
-			//logger.error(e.error_code,e);
-			//throw WebUtil.getVciBaseException(e);
+		}catch(PLException e){
+			logger.error(e.code,e);
+			throw WebUtil.getVciBaseException(e);
 		} catch (DocumentException e) {
 			logger.error("鏌ヨ妯℃澘杞崲",e);
 			throw new VciBaseException(this.msgCodePrefix + "qtError", new Object[]{name});
@@ -1006,7 +1010,7 @@
 	 * @throws VciBaseException 鏌ヨ鍑洪敊浼氭姏鍑哄紓甯�
 	 */
 	@Override
-	public List<ClientBusinessObject> queryCBOByScheme(String queryScheme,
+	public List<com.vci.client.bof.ClientBusinessObject> queryCBOByScheme(String queryScheme,
 			Map<String, String> conditionMap, Map<String, String> replaceMap,
 			PageHelper ph, List<String> clauseList) throws VciBaseException {
 		QueryTemplate qt = getQtByName(queryScheme,replaceMap);
@@ -1028,22 +1032,18 @@
 		conditionMap = WebUtil.getNotNullMap(conditionMap);
 		Condition condition = getConditionByMap(conditionMap);
 		if(qt.getCondition() !=null) {
-			qt.setCondition(Tool.mergeCondition(qt.getCondition(), condition, Connector.AND));
+			qt.setCondition(OQTool.mergeCondition(qt.getCondition(), condition, Connector.AND));
 		}else {
 			qt.setCondition(condition);
 		}
-		int count = 0;
+		long count = 0;
 		try{
-			count = platformClientUtil.getQueryService().findTotalCount(qt.getId(), Tool.qtTOXMl(qt).asXML());
-		}catch (VCIError e) {
-			try {
-				count = platformClientUtil.getQueryService().findTotalCount(qt.getId(), Tool.qtTOXMl(qt).asXML());
-			}catch (VCIError ee) {
-//				logger.error(ee.error_code,ee);
-//				throw WebUtil.getVciBaseException(ee);
-			}
+			count = platformClientUtil.getQueryService().findTotalCount(qt.getId(), OQTool.qtTOXMl(qt).asXML());
+		}catch (PLException e) {
+			logger.error(e.code,e);
+			throw WebUtil.getVciBaseException(e);
 		} 
-		return count;
+		return (int) count;
 	}
 
 	/**
@@ -1099,8 +1099,8 @@
 			if(results!=null && results.length>0 && results[0] != null && results[0].length>0){
 				return WebUtil.getInt(results[0][0]);
 			}
-		}catch (VCIError e){
-			throw WebUtil.getVciBaseException(e);
+		} catch (PLException e) {
+			throw new RuntimeException(e);
 		}
 		return 0;
 	}
@@ -1142,11 +1142,11 @@
      * @throws VciBaseException 鏌ヨ鍑洪敊浼氭姏鍑哄紓甯�
      */
 	@Override
-	public List<ClientBusinessObject> queryBySql(String sql,
+	public List<com.vci.client.bof.ClientBusinessObject> queryBySql(String sql,
 			Map<String, String> conditionMap) throws VciBaseException {
 		List<Map> allData = queryBySqlForMap(sql,conditionMap);
 		if(allData == null || allData.size() == 0){
-			return new ArrayList<ClientBusinessObject>();
+			return new ArrayList<com.vci.client.bof.ClientBusinessObject>();
 		}else{
 			return map2Cbos(allData);
 		}
@@ -1159,10 +1159,10 @@
 	 * @throws VciBaseException 鏌ヨ鍑洪敊娲绘姏鍑哄紓甯�
 	 */
 	@Override
-	public List<ClientBusinessObject> queryByOnlySql(String sql) throws VciBaseException{
+	public List<com.vci.client.bof.ClientBusinessObject> queryByOnlySql(String sql) throws VciBaseException{
 		List<Map> allData = queryByOnlySqlForMap(sql);
 		if(allData == null || allData.size() == 0){
-			return new ArrayList<ClientBusinessObject>();
+			return new ArrayList<com.vci.client.bof.ClientBusinessObject>();
 		}else{
 			return map2Cbos(allData);
 		}
@@ -1181,11 +1181,12 @@
 		}
 		List<Map> dataList = new ArrayList<>();
 		try {
-			KV[][] kvs = platformClientUtil.getQueryService().queryBySql(sql);
+//			KV[][] kvs = platformClientUtil.getQueryService().queryBySql(sql);
+			com.vci.corba.query.data.KV[][] kvs = ServiceProvider.getOQService().queryBySql(sql);
 			if(kvs!=null && kvs.length>0){
 				for (int i = 0; i < kvs.length; i++) {
 					Map<String,String> data = new HashMap<>();
-					KV[] kv = kvs[i];
+					com.vci.corba.query.data.KV[] kv = kvs[i];
 					if(kv!=null && kv.length >0){
 						for (int j = 0; j < kv.length; j++) {
 							KV kv1 = kv[j];
@@ -1195,7 +1196,7 @@
 					dataList.add(data);
 				}
 			}
-		} catch (VCIError e) {
+		} catch (PLException e) {
 			throw WebUtil.getVciBaseException(e);
 		}
 		return dataList;
@@ -1269,9 +1270,9 @@
 			sql = sql.replaceAll(" FROM "," from ");
 		}
 
-		AttributeValue[] ava = null;
+		com.vci.corba.omd.data.AttributeValue[] ava = null;
 		if(conditionMap!=null&&!conditionMap.isEmpty()){
-			ava = new AttributeValue[conditionMap.size()];
+			ava = new com.vci.corba.omd.data.AttributeValue[conditionMap.size()];
 			Iterator<String> it = conditionMap.keySet().iterator();
 			int i = 0 ;
 			while(it.hasNext()){
@@ -1280,15 +1281,16 @@
 				if(value == null){
 					value = "";
 				}
-				AttributeValue av = new AttributeValue(key, value);
+				com.vci.corba.omd.data.AttributeValue av = new com.vci.corba.omd.data.AttributeValue(key, value);
 				ava[i] = av;
 				i++;
 			}
 		}else{
-			ava = new AttributeValue[0];
+			ava = new com.vci.corba.omd.data.AttributeValue[0];
 		}
 		try {
-			String[][] results =platformClientUtil.getBOFactoryService().getSqlQueryResult(sql, ava);
+//			String[][] results =platformClientUtil.getBOFactoryService().getSqlQueryResult(sql, ava);
+			String[][] results =ServiceProvider.getBOFService().getSqlQueryResult(sql, ava);
 			if(results.length>0){
 				if(selectKeys==null) {
 					String selectSql = sql.substring(sql.toLowerCase(Locale.ROOT).indexOf("select") + 6, sql.toLowerCase(Locale.ROOT).indexOf(" from")).trim();
@@ -1325,7 +1327,7 @@
 			}else{
 				return new ArrayList<Map>();
 			}
-		} catch (VCIError e) {
+		} catch (PLException e) {
 //			logger.error(e.error_code,e);
 			throw WebUtil.getVciBaseException(e);
 		}
@@ -1375,11 +1377,11 @@
 			allFieldAttrMap.put(columnName.toLowerCase(),fieldName);
 		}
 		List<T> allObject = new ArrayList<T>();
-		List<ClientBusinessObject> allCbos = queryCBO(WebUtil.getBtmTypeByObject(c), conditionMap, ph, allFieldAttrMap.keySet().stream().collect(Collectors.toList()));//鎵ц鏌ヨ
+		List<com.vci.client.bof.ClientBusinessObject> allCbos = queryCBO(WebUtil.getBtmTypeByObject(c), conditionMap, ph, allFieldAttrMap.keySet().stream().collect(Collectors.toList()));//鎵ц鏌ヨ
 		List<String> oids = new ArrayList<String>();
 		
 		if(allCbos!=null&&allCbos.size()>0){
-			for(ClientBusinessObject cbo : allCbos){
+			for(com.vci.client.bof.ClientBusinessObject cbo : allCbos){
 				T obj  = null;
 				try {
 					obj = c.newInstance();
@@ -1480,10 +1482,10 @@
 			allFieldAttrMap.put(columnName.toLowerCase(),fieldName);
 		}
 		List<T> allObject = new ArrayList<T>();
-		List<ClientBusinessObject> allCbos = queryCBOByScheme(queryScheme, conditionMap, replaceMap,ph, allFieldAttrMap.keySet().stream().collect(Collectors.toList()));
+		List<com.vci.client.bof.ClientBusinessObject> allCbos = queryCBOByScheme(queryScheme, conditionMap, replaceMap,ph, allFieldAttrMap.keySet().stream().collect(Collectors.toList()));
 		List<String> oids = new ArrayList<String>();
 		if(allCbos!=null&&allCbos.size()>0){
-			for(ClientBusinessObject cbo : allCbos){
+			for(com.vci.client.bof.ClientBusinessObject cbo : allCbos){
 				T obj  = null;
 				try {
 					obj = c.newInstance();
@@ -1547,7 +1549,7 @@
 	 * @param isEdit 鏄惁涓虹紪杈�
 	 * @throws VciBaseException 璁剧疆鍑洪敊浼氭姏鍑哄紓甯�
 	 */
-	private void setValueToCbo(Object obj,String btmType,ClientBusinessObject cbo ,boolean isEdit) throws VciBaseException{
+	private void setValueToCbo(Object obj,String btmType,com.vci.client.bof.ClientBusinessObject cbo ,boolean isEdit) throws VciBaseException{
 		Field pkField = WebUtil.getPkFieldForObj(obj.getClass());
 		if(pkField == null){
 			throw new VciBaseException("{0}绫讳腑娌℃湁瀹氫箟涓婚敭灞炴��",new Object[]{obj.getClass()});
@@ -1621,7 +1623,7 @@
 						} else {
 							cbo.setAttributeValueWithNoCheck(attrName.toLowerCase(), value);
 						}
-					} catch (VCIError e) {
+					} catch (PLException e) {
 						throw WebUtil.getVciBaseException(e);
 					}
 				}
@@ -1692,9 +1694,9 @@
 		if(list==null){
 			throw new VciBaseException(VciBaseException.paramNull);
 		}
-		Set<ClientBusinessObject> allUpdateCbos = new HashSet<ClientBusinessObject>();
-		Set<ClientBusinessObject> allDeleteCbos = new HashSet<ClientBusinessObject>();
-		Set<ClientBusinessObject> allAddCbos = new HashSet<ClientBusinessObject>();
+		Set<com.vci.client.bof.ClientBusinessObject> allUpdateCbos = new HashSet<com.vci.client.bof.ClientBusinessObject>();
+		Set<com.vci.client.bof.ClientBusinessObject> allDeleteCbos = new HashSet<com.vci.client.bof.ClientBusinessObject>();
+		Set<com.vci.client.bof.ClientBusinessObject> allAddCbos = new HashSet<com.vci.client.bof.ClientBusinessObject>();
 		Map<String,String> btmOidsMap = new HashMap<String, String>();
 		for(T obj : list){
 			String btmType = WebUtil.getBtmTypeByObject(obj.getClass());
@@ -1715,7 +1717,7 @@
 			}
 			btmOidsMap.put(btmType, tempOids);
 		}
-		List<ClientBusinessObject> needUpdateCbos = new ArrayList<ClientBusinessObject>();
+		List<com.vci.client.bof.ClientBusinessObject> needUpdateCbos = new ArrayList<com.vci.client.bof.ClientBusinessObject>();
 		Iterator<String> it = btmOidsMap.keySet().iterator();
 		while(it.hasNext()){
 			String btmType = it.next();
@@ -1733,11 +1735,11 @@
 			}
 			//涓婚敭
 			Object pkValue = WebUtil.getValueFromField(pkField.getName(), obj);
-			ClientBusinessObject cbo = null;
+			com.vci.client.bof.ClientBusinessObject cbo = null;
 			if(pkValue == null || (pkValue instanceof String && WebUtil.isNull(pkValue.toString()))){
 				continue;
 			}else{
-				for(ClientBusinessObject tempCbo : needUpdateCbos){
+				for(com.vci.client.bof.ClientBusinessObject tempCbo : needUpdateCbos){
 					if(tempCbo.getOid().equalsIgnoreCase(pkValue.toString().trim())){
 						cbo = tempCbo;
 						break;
@@ -1746,7 +1748,7 @@
 			}
 			String btmType = WebUtil.getBtmTypeByObject(obj.getClass());
 			//鎷疯礉涔嬪墠鍏堟竻闄ゅ凡缁忔湁鐨勫��
-			cbo.getBusinessObject().newAttrValList = new AttributeValue[0];
+			cbo.getBusinessObject().newAttrValList = new com.vci.corba.omd.data.AttributeValue[0];
 			setValueToCbo(obj,btmType,cbo,true);
 			allUpdateCbos.add(cbo);
 		}
@@ -2006,7 +2008,7 @@
 		if(ts.contains(".")){
 			ts = ts.substring(0,ts.lastIndexOf("."));
 		}
-		return cbos.get(0).getTs().contains(ts);
+		return cbos.get(0).getTs() == Long.valueOf(ts);
 	}
 
 	/**
@@ -2254,7 +2256,7 @@
      * @throws VciBaseException 杞崲鍑洪敊浼氭姏鍑哄紓甯�
      */
 	@Override
-	public Map cbo2Map(ClientBusinessObject cbo) throws VciBaseException {
+	public Map cbo2Map(com.vci.client.bof.ClientBusinessObject cbo) throws VciBaseException {
 		Map<String,String> map = new HashMap<String, String>();
 		WebUtil.copyValueToMapFromCbos(cbo, map);
 		return map;
@@ -2268,9 +2270,9 @@
      * @throws VciBaseException 杞崲鍑洪敊浼氭姏鍑哄紓甯�
      */
 	@Override
-	public List<ClientBusinessObject> map2Cbos(List<Map> mapList)
+	public List<com.vci.client.bof.ClientBusinessObject> map2Cbos(List<Map> mapList)
 			throws VciBaseException {
-		List<ClientBusinessObject> cboList = new ArrayList<ClientBusinessObject>();
+		List<com.vci.client.bof.ClientBusinessObject> cboList = new ArrayList<com.vci.client.bof.ClientBusinessObject>();
 		for(Map map : mapList){
 			cboList.add(map2Cbo(map));
 		}
@@ -2285,8 +2287,8 @@
      * @throws VciBaseException 杞崲鍑洪敊浼氭姏鍑哄紓甯�
      */
 	@Override
-	public ClientBusinessObject map2Cbo(Map map) throws VciBaseException {
-		ClientBusinessObject cbo = new ClientBusinessObject();
+	public com.vci.client.bof.ClientBusinessObject map2Cbo(Map map) throws VciBaseException {
+		com.vci.client.bof.ClientBusinessObject cbo = new com.vci.client.bof.ClientBusinessObject();
 		WebUtil.copyValueToCboFromMap(cbo, map);
 		return cbo;
 	}
@@ -2319,12 +2321,18 @@
 			deleteReferAttrInCbo(batchCbos.getDeleteCbos());
 		}
 		try {
-			platformClientUtil.getBOFactoryService().batchCUDBOLO(new BusinessObjectListHolder(cboArray2Bo(batchCbos.getCreateCboArray())),
-					new LinkObjectListHolder(cloArray2Lo(batchCbos.getCreateCloArray())),
-					new BusinessObjectListHolder(cboArray2Bo(batchCbos.getUpdateCboArray())),
-					new LinkObjectListHolder(cloArray2Lo(batchCbos.getUpdateCloArray())),
+//			platformClientUtil.getBOFactoryService().batchCUDBOLO(new BusinessObjectListHolder(cboArray2Bo(batchCbos.getCreateCboArray())),
+//					new LinkObjectListHolder(cloArray2Lo(batchCbos.getCreateCloArray())),
+//					new BusinessObjectListHolder(cboArray2Bo(batchCbos.getUpdateCboArray())),
+//					new LinkObjectListHolder(cloArray2Lo(batchCbos.getUpdateCloArray())),
+//					cboArray2Bo(batchCbos.getDeleteCboArray()), cloArray2Lo(batchCbos.getDeleteCloArray()));
+//			new BusinessObjectListHolder(cboArray2Bo(batchCbos.getCreateCboArray()))
+			ServiceProvider.getBOFService().batchCUDBOLO(cboArray2Bo(batchCbos.getCreateCboArray()),
+					cloArray2Lo(batchCbos.getCreateCloArray()),
+					cboArray2Bo(batchCbos.getUpdateCboArray()),
+					cloArray2Lo(batchCbos.getUpdateCloArray()),
 					cboArray2Bo(batchCbos.getDeleteCboArray()), cloArray2Lo(batchCbos.getDeleteCloArray()));
-		} catch (VCIError e) {
+		} catch (PLException e) {
 			throw WebUtil.getVciBaseException(e);
 		}
 	}
@@ -2334,11 +2342,11 @@
 	 * @param cbos 瀹㈡埛绔璞�
 	 * @return 涓氬姟瀵硅薄
 	 */
-	private BusinessObject[] cboArray2Bo(ClientBusinessObject[] cbos){
+	private com.vci.corba.omd.data.BusinessObject[] cboArray2Bo(ClientBusinessObject[] cbos){
 		if(cbos == null ||cbos.length == 0){
-			return new BusinessObject[0];
+			return new com.vci.corba.omd.data.BusinessObject[0];
 		}
-		BusinessObject[] bos = new BusinessObject[cbos.length];
+		com.vci.corba.omd.data.BusinessObject[] bos = new com.vci.corba.omd.data.BusinessObject[cbos.length];
 		for(int i = 0; i < cbos.length; i++){
 			bos[i] = cbos[i].getBusinessObject();
 		}
@@ -2350,11 +2358,11 @@
 	 * @param clos 瀹㈡埛绔璞�
 	 * @return 涓氬姟瀵硅薄
 	 */
-	private LinkObject[] cloArray2Lo(ClientLinkObject[] clos){
+	private com.vci.corba.omd.data.LinkObject[] cloArray2Lo(com.vci.client.bof.ClientLinkObject[] clos){
 		if(clos == null ||clos.length == 0){
-			return new LinkObject[0];
+			return new com.vci.corba.omd.data.LinkObject[0];
 		}
-		LinkObject[] bos = new LinkObject[clos.length];
+		com.vci.corba.omd.data.LinkObject[] bos = new com.vci.corba.omd.data.LinkObject[clos.length];
 		for(int i = 0; i < clos.length; i++){
 			bos[i] = clos[i].getLinkObject();
 		}
@@ -2368,11 +2376,11 @@
 	private void deleteReferAttrInCbo(Set<ClientBusinessObject> cbos){
 		if(cbos !=null){
 			for(ClientBusinessObject cbo : cbos){
-				BusinessObject bo = cbo.getBusinessObject();
-				List<AttributeValue> newAttr = new ArrayList<AttributeValue>();
+				com.vci.corba.omd.data.BusinessObject bo = cbo.getBusinessObject();
+				List<com.vci.corba.omd.data.AttributeValue> newAttr = new ArrayList<com.vci.corba.omd.data.AttributeValue>();
 				if (bo.newAttrValList != null) {
 					for (int i = 0; i < bo.newAttrValList.length; ++i) {
-						AttributeValue av = bo.newAttrValList[i];
+						com.vci.corba.omd.data.AttributeValue av = bo.newAttrValList[i];
 						if (WebUtil.isNormalAttr(av.attrName)) {
 							if(av.attrVal == null){
 								av.attrVal = "";
@@ -2381,7 +2389,7 @@
 						}
 					}
 				}
-				bo.newAttrValList = newAttr.toArray(new AttributeValue[0]);
+				bo.newAttrValList = newAttr.toArray(new com.vci.corba.omd.data.AttributeValue[0]);
 				cbo.setBusinessObject(bo);
 			}
 		}

--
Gitblit v1.9.3