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 | 250 ++++++++++++++++++++++++++----------------------- 1 files changed, 133 insertions(+), 117 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..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 @@ -3,10 +3,12 @@ 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; @@ -18,16 +20,13 @@ 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; @@ -36,11 +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.KV; -import plm.corba.qt.QTServiceOperations; import plm.oq.objectQuery.common.*; import java.lang.reflect.Field; @@ -188,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())){ @@ -203,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())){ @@ -215,7 +212,7 @@ bo.setName(""); bo.setDescription(""); bo.setOwner(userName); - bo.setCheckinBy(userName); +// bo.setCheckinBy(userName); bo.setCopyFromVersion(""); this.initTypeAttributeValue(bo,btmTypeVO); return bo; @@ -230,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); } @@ -261,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; @@ -283,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); } @@ -312,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; } @@ -401,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()); } } @@ -435,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); @@ -475,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("*"); @@ -492,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>(); @@ -510,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(); @@ -561,8 +558,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("*"); @@ -621,32 +618,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){ + }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.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 +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(); @@ -742,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); } @@ -754,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")){ @@ -832,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); @@ -851,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) { @@ -870,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; @@ -879,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()]); } @@ -895,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); } @@ -908,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); @@ -926,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>(); @@ -985,10 +991,10 @@ } }); } - }catch(VCIError e){ + }catch(PLException e){ //logger.error(e.error_code,e); //throw WebUtil.getVciBaseException(e); - } catch (DocumentException e) { + } catch (DocumentException | VCIError e) { logger.error("鏌ヨ妯℃澘杞崲",e); throw new VciBaseException(this.msgCodePrefix + "qtError", new Object[]{name}); } @@ -1006,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); @@ -1034,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); } @@ -1142,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); } @@ -1159,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); } @@ -1181,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]; @@ -1195,7 +1204,7 @@ dataList.add(data); } } - } catch (VCIError e) { + } catch (PLException e) { throw WebUtil.getVciBaseException(e); } return dataList; @@ -1269,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()){ @@ -1280,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(); @@ -1325,7 +1335,7 @@ }else{ return new ArrayList<Map>(); } - } catch (VCIError e) { + } catch (PLException e) { // logger.error(e.error_code,e); throw WebUtil.getVciBaseException(e); } @@ -1375,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(); @@ -1480,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(); @@ -1547,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()}); @@ -1621,7 +1631,7 @@ } else { cbo.setAttributeValueWithNoCheck(attrName.toLowerCase(), value); } - } catch (VCIError e) { + } catch (PLException e) { throw WebUtil.getVciBaseException(e); } } @@ -1692,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()); @@ -1715,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(); @@ -1733,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; @@ -1746,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); } @@ -2006,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); } /** @@ -2254,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; @@ -2268,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)); } @@ -2285,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; } @@ -2319,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); } } @@ -2334,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(); } @@ -2350,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(); } @@ -2368,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 = ""; @@ -2381,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