From f07aca58c4e1d96c8e75c90b021b00c593bcffff Mon Sep 17 00:00:00 2001 From: yuxc <yuxc@vci-tech.com> Date: 星期二, 28 五月 2024 11:36:17 +0800 Subject: [PATCH] 1、平台接口修改以及web端后台的修改。 2、对平台的更新jar包上传。 --- Source/platformProject/vci-platform-web/src/main/java/com/vci/web/service/impl/WebBoServiceImpl.java | 287 ++++++++++++++++++++++++++++++-------------------------- 1 files changed, 154 insertions(+), 133 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 55b4ed4..b75e0f4 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 @@ -2,19 +2,24 @@ import com.alibaba.fastjson.JSONObject; import com.vci.base.common.utility.ObjectUtility; +import com.vci.client.common.providers.ServiceProvider; +import com.vci.corba.common.PLException; import com.vci.corba.common.VCIError; +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.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.starter.web.constant.VciSystemVarConstants; +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; @@ -22,7 +27,6 @@ import com.vci.web.util.PlatformClientUtil; import com.vci.web.util.WebUtil; import org.apache.commons.lang3.StringUtils; -import org.apache.tools.ant.taskdefs.condition.Os; import org.dom4j.DocumentException; import org.dom4j.DocumentHelper; import org.omg.CORBA.IntHolder; @@ -31,13 +35,9 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; -import plm.bs.bom.clientobject.ClientBusinessObject; +import com.vci.client.bof.ClientBusinessObject; import plm.bs.bom.clientobject.ClientLinkObject; import plm.bs.bom.common.*; -import plm.corba.qt.BtmRefQueryOption; -import plm.corba.qt.KV; -import plm.corba.qt.QTServiceOperations; -import plm.corba.qt.QTWrapper; import plm.oq.objectQuery.common.*; import java.lang.reflect.Field; @@ -141,7 +141,6 @@ } } - /** * 鍒濆鍖栦笟鍔$被鍨� * --绗竴娆¤皟鐢ㄧ殑鏃跺�欎細鐩稿鎱竴涓嬶紝鍚庣画鑾峰彇灏卞緢蹇殑 @@ -186,14 +185,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())){ @@ -201,8 +200,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())){ @@ -213,7 +212,7 @@ bo.setName(""); bo.setDescription(""); bo.setOwner(userName); - bo.setCheckinBy(userName); +// bo.setCheckinBy(userName); bo.setCopyFromVersion(""); this.initTypeAttributeValue(bo,btmTypeVO); return bo; @@ -228,7 +227,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); } @@ -259,20 +258,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; @@ -281,16 +280,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); } @@ -310,10 +309,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; } @@ -399,11 +398,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()); } } @@ -433,9 +432,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); @@ -465,7 +464,6 @@ return checkDataExsitByColumn(btmName,columnName,Arrays.asList(columnValues.split(","))); } - /** * 鏍规嵁鏌ヨ鏉′欢鏉ユ煡璇笟鍔$被鍨嬩笅鐨勬暟鎹� * @param btmType 涓氬姟绫诲瀷鐨勫悕绉帮紝浼氳嚜鍔ㄥ彉鎴愬皬鍐� @@ -474,7 +472,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("*"); @@ -491,7 +489,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>(); @@ -509,7 +507,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(); @@ -560,14 +558,14 @@ * @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("*"); } setRightValueToQueryTemplate(qt,conditionMap);//璁剧疆瀵嗙骇鏌ヨ锛屽拰鏁版嵁鏉冮檺鎺у埗 - List<BtmRefQueryOption> refOpts = new ArrayList<BtmRefQueryOption>(); + List<com.vci.corba.query.data.BtmRefQueryOption> refOpts = new ArrayList<BtmRefQueryOption>(); List<String> enumAttrName = new ArrayList<String>(); List<String> thisQueryAttr = new ArrayList<String>(); if(clauseList!=null && clauseList.size()>0){ @@ -614,23 +612,25 @@ //璁剧疆鍒嗛〉淇℃伅鍜屾帓搴� setPageAndOrderToQT(qt,ph); try { - QTServiceOperations qtService = platformClientUtil.getQueryService(); + // QTServiceOperations qtService = platformClientUtil.getQueryService(); + ObjectQueryServicePrx qtService = ServiceProvider.getOQService(); if(qtService == null){ logger.error("娌℃湁鎵惧埌鏌ヨ鏈嶅姟"); throw new VciBaseException(msgCodePrefix+"qtServerNull", new String[]{}); } - IntHolder count = new IntHolder(); - BusinessObject[] bos = null; - String invo = JSONObject.toJSONString(InvocationUtility.getInvocation()); +// IntHolder count = new IntHolder(); + ObjectQueryService.FindBTMObjectsV3Result bos = null; +// String invo = JSONObject.toJSONString(InvocationUtility.getInvocation()); try{ - bos = qtService.findBTMObjectsV4(invo,qt.getId(), Tool.qtTOXMl(qt).asXML(),count,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(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 (PLException 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])); } - - if (bos != null && bos.length > 0) { - for (BusinessObject bo : bos) { - ClientBusinessObject cbo = new ClientBusinessObject(); + if (bos != null && bos.count > 0) { + for (com.vci.corba.omd.data.BusinessObject bo : bos.returnValue) { + com.vci.client.bof.ClientBusinessObject cbo = new com.vci.client.bof.ClientBusinessObject(); cbo.setBusinessObject(bo); queryEnumText(cbo,enumAttrName); allCbos.add(cbo); @@ -638,11 +638,21 @@ //鍥犱负淇敼浜嗘煡璇㈢殑鏂瑰紡锛屾墍浠ュ氨涓嶉渶瑕佸崟鐙煡璇㈠弬鐓� } queryLcStatus(allCbos); - } catch (VCIError e) { -// logger.error(e.error_code,e); -// throw WebUtil.getVciBaseException(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; } /** @@ -718,7 +728,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(); @@ -738,7 +748,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); } @@ -750,7 +760,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")){ @@ -828,7 +838,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); @@ -847,13 +857,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) { @@ -866,7 +876,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; @@ -875,13 +885,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()]); } @@ -891,7 +901,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); } @@ -904,7 +914,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); @@ -922,7 +932,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>(); @@ -942,14 +952,15 @@ QueryTemplate qt = null; try{ VciBaseUtil.alertNotNull(name,"鏌ヨ妯℃澘鐨勫悕绉�"); - QTWrapper wrapper = platformClientUtil.getQueryService().getQT(name); + // QTWrapper wrapper = platformClientUtil.getQueryService().getQT(name); + QTInfo wrapper = ServiceProvider.getOMDService().getQTDService().getQT(name); qt = Tool.getQTByDoc(DocumentHelper.parseText(wrapper.qtText), name); //鍥犱负涔嬪墠骞冲彴鐨凾ool.replaceQTValues 娌℃湁澶勭悊 ${xxx}銆傦紝 涓轰簡蹇界暐澶у皬鍐欙紝鎴戜滑杩欓噷鍗曠嫭澶勭悊 weidy@2021-3-10 //鎴戜滑杞崲涓哄皬鍐� Condition condition = qt.getCondition(); Map<String,String> replaceLowMap = new HashMap<>(); if(condition !=null && condition.getCIMap()!=null){ - Map<String, String> systemVarValueMap = VciSystemVarConstants.getSystemVarValueMap(); + // Map<String, String> systemVarValueMap = VciSystemVarConstants.getSystemVarValueMap(); if(!CollectionUtils.isEmpty(replaceMap)){ replaceMap.forEach((key,value)->{ replaceLowMap.put(key.toLowerCase(),value); @@ -963,7 +974,7 @@ if(StringUtils.isNotBlank(value)){ if(value.contains("#")){ //绯荤粺鍙橀噺.鏀寔涓�涓� - lInfo.getValue().setOrdinaryValue(systemVarValueMap.getOrDefault(value.toUpperCase(),"")); + //lInfo.getValue().setOrdinaryValue(systemVarValueMap.getOrDefault(value.toUpperCase(),"")); }else if(value.contains("${")){ //鏈�${xxxx}鐨勬柟寮� if(!CollectionUtils.isEmpty(replaceLowMap)) { @@ -980,10 +991,10 @@ } }); } - }catch(VCIError e){ -// logger.error(e.error_code,e); -// throw WebUtil.getVciBaseException(e); - } catch (DocumentException e) { + }catch(PLException e){ + //logger.error(e.error_code,e); + //throw WebUtil.getVciBaseException(e); + } catch (DocumentException | VCIError e) { logger.error("鏌ヨ妯℃澘杞崲",e); throw new VciBaseException(this.msgCodePrefix + "qtError", new Object[]{name}); } @@ -1001,7 +1012,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); @@ -1029,11 +1040,13 @@ } int count = 0; try{ - count = platformClientUtil.getQueryService().findTotalCount(qt.getId(), Tool.qtTOXMl(qt).asXML()); - }catch (VCIError e) { +// count = platformClientUtil.getQueryService().findTotalCount(); + count = Integer.parseInt(String.valueOf(ServiceProvider.getOQService().findTotalCount(qt.getId(), Tool.qtTOXMl(qt).asXML()))); + }catch (PLException e) { try { - count = platformClientUtil.getQueryService().findTotalCount(qt.getId(), Tool.qtTOXMl(qt).asXML()); - }catch (VCIError ee) { +// count = platformClientUtil.getQueryService().findTotalCount(qt.getId(), Tool.qtTOXMl(qt).asXML()); + count = Integer.parseInt(String.valueOf(ServiceProvider.getOQService().findTotalCount(qt.getId(), Tool.qtTOXMl(qt).asXML()))); + }catch (PLException ee) { // logger.error(ee.error_code,ee); // throw WebUtil.getVciBaseException(ee); } @@ -1137,11 +1150,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); } @@ -1154,10 +1167,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); } @@ -1176,11 +1189,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]; @@ -1190,7 +1204,7 @@ dataList.add(data); } } - } catch (VCIError e) { + } catch (PLException e) { throw WebUtil.getVciBaseException(e); } return dataList; @@ -1264,9 +1278,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()){ @@ -1275,15 +1289,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(); @@ -1320,7 +1335,7 @@ }else{ return new ArrayList<Map>(); } - } catch (VCIError e) { + } catch (PLException e) { // logger.error(e.error_code,e); throw WebUtil.getVciBaseException(e); } @@ -1370,11 +1385,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(); @@ -1475,10 +1490,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(); @@ -1542,7 +1557,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()}); @@ -1616,7 +1631,7 @@ } else { cbo.setAttributeValueWithNoCheck(attrName.toLowerCase(), value); } - } catch (VCIError e) { + } catch (PLException e) { throw WebUtil.getVciBaseException(e); } } @@ -1687,9 +1702,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()); @@ -1710,7 +1725,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(); @@ -1728,11 +1743,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; @@ -1741,7 +1756,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); } @@ -2001,7 +2016,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); } /** @@ -2249,7 +2264,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; @@ -2263,9 +2278,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)); } @@ -2280,8 +2295,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; } @@ -2314,12 +2329,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); } } @@ -2329,11 +2350,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(); } @@ -2345,11 +2366,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(); } @@ -2363,11 +2384,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 = ""; @@ -2376,7 +2397,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