| | |
| | | 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; |
| | |
| | | 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); |
| | | } |
| | |
| | | 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) { |
| | | com.vci.client.bof.ClientBusinessObject cbo = new com.vci.client.bof.ClientBusinessObject(); |
| | | // BusinessObject businessObject = new BusinessObject(bo.oid, bo.revisionid, bo.nameoid, bo.btName, bo.isLastR ? 1 : 0, bo.isFirstR ? 1 : 0, |
| | | // bo.isLastV ? 1 : 0, bo.isFirstV ? 1 : 0, bo.creator, String.valueOf(bo.createTime), bo.modifier, String.valueOf(bo.modifyTime), |
| | | // bo.revisionRule, bo.versionRule, bo.revisionSeq, bo.revisionValue, bo.versionSeq, |
| | | // bo.versionValue, bo.lctId, bo.lcStatus, String.valueOf(bo.ts), bo.id, bo.name, bo.description, |
| | | // bo.owner,null, null, null, null, |
| | | // bo.fromVersion, copyToAttributeValue(bo.newAttrValList), copyToAttributeValue(bo.hisAttrValList)); |
| | | 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; |
| | |
| | | } |
| | | }); |
| | | } |
| | | }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}); |
| | | } |
| | |
| | | try{ |
| | | // count = platformClientUtil.getQueryService().findTotalCount(); |
| | | count = Integer.parseInt(String.valueOf(ServiceProvider.getOQService().findTotalCount(qt.getId(), Tool.qtTOXMl(qt).asXML()))); |
| | | }catch (VCIError e) { |
| | | }catch (PLException e) { |
| | | try { |
| | | // 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 (VCIError ee) { |
| | | }catch (PLException ee) { |
| | | // logger.error(ee.error_code,ee); |
| | | // throw WebUtil.getVciBaseException(ee); |
| | | } |
| | |
| | | dataList.add(data); |
| | | } |
| | | } |
| | | } catch (VCIError e) { |
| | | } catch (PLException e) { |
| | | throw WebUtil.getVciBaseException(e); |
| | | } |
| | | return dataList; |
| | |
| | | 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()){ |
| | |
| | | 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(); |
| | |
| | | }else{ |
| | | return new ArrayList<Map>(); |
| | | } |
| | | } catch (VCIError e) { |
| | | } catch (PLException e) { |
| | | // logger.error(e.error_code,e); |
| | | throw WebUtil.getVciBaseException(e); |
| | | } |
| | |
| | | } else { |
| | | cbo.setAttributeValueWithNoCheck(attrName.toLowerCase(), value); |
| | | } |
| | | } catch (VCIError e) { |
| | | } catch (PLException e) { |
| | | throw WebUtil.getVciBaseException(e); |
| | | } |
| | | } |
| | |
| | | cboArray2Bo(batchCbos.getUpdateCboArray()), |
| | | cloArray2Lo(batchCbos.getUpdateCloArray()), |
| | | cboArray2Bo(batchCbos.getDeleteCboArray()), cloArray2Lo(batchCbos.getDeleteCloArray())); |
| | | } catch (VCIError e) { |
| | | } catch (PLException e) { |
| | | throw WebUtil.getVciBaseException(e); |
| | | } |
| | | } |