| | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.alibaba.fastjson.serializer.SerializerFeature; |
| | | 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.query.ObjectQueryService; |
| | | import com.vci.starter.web.constant.QueryOptionConstant; |
| | | import com.vci.starter.web.exception.VciBaseException; |
| | | import com.vci.starter.web.pagemodel.DataGrid; |
| | |
| | | } |
| | | |
| | | @Override |
| | | public Map<String, ClientBusinessObject> queryLinkedCbo(LinkObject[] lo, |
| | | public Map<String, com.vci.client.bof.ClientBusinessObject> queryLinkedCbo(LinkObject[] lo, |
| | | boolean isDirection) throws VciBaseException { |
| | | ClientLinkObject[] clos = new ClientLinkObject[lo.length]; |
| | | for(int i =0 ; i < lo.length; i ++){ |
| | |
| | | } |
| | | |
| | | @Override |
| | | public Map<String, ClientBusinessObject> queryLinkedCbo(List los, |
| | | public Map<String, com.vci.client.bof.ClientBusinessObject> queryLinkedCbo(List los, |
| | | boolean isDirection) throws VciBaseException { |
| | | return queryLinkedCbo(los,isDirection,new ArrayList<String>()); |
| | | } |
| | | |
| | | @Override |
| | | public Map<String, ClientBusinessObject> queryLinkedCbo(List los, |
| | | public Map<String, com.vci.client.bof.ClientBusinessObject> queryLinkedCbo(List los, |
| | | boolean isDirection,List<String> queryColumn) throws VciBaseException { |
| | | ClientLinkObject[] clos = new ClientLinkObject[los.size()]; |
| | | for(int i = 0 ; i < los.size(); i ++){ |
| | |
| | | } |
| | | |
| | | @Override |
| | | public Map<String, ClientBusinessObject> queryLinkedCbo( |
| | | public Map<String, com.vci.client.bof.ClientBusinessObject> queryLinkedCbo( |
| | | ClientLinkObject[] clol, boolean isDirection) throws VciBaseException { |
| | | return queryLinkedCbo(clol,isDirection,new ArrayList<String>()); |
| | | } |
| | |
| | | * |
| | | */ |
| | | @Override |
| | | public Map<String, ClientBusinessObject> queryLinkedCbo( |
| | | public Map<String, com.vci.client.bof.ClientBusinessObject> queryLinkedCbo( |
| | | ClientLinkObject[] clol, boolean isDirection,List<String> queryColumn) throws VciBaseException{ |
| | | Map<String/*t_oid或者f_oid*/,String/*oid*/> linkBoOidMap = new HashMap<String, String>(); |
| | | Map<String,String> btmTypeOidMap = new HashMap<String, String>(); |
| | |
| | | btmTypeOidMap.put(btmType, oids); |
| | | } |
| | | } |
| | | Map<String,ClientBusinessObject> linkedCboMap = new HashMap<String, ClientBusinessObject>(); |
| | | Map<String,com.vci.client.bof.ClientBusinessObject> linkedCboMap = new HashMap<>(); |
| | | Iterator<String> it = btmTypeOidMap.keySet().iterator(); |
| | | while(it.hasNext()){ |
| | | String btmType = it.next(); |
| | |
| | | } |
| | | Map<String,String> conditionMap = new HashMap<>(); |
| | | conditionMap.put("oid",oids); |
| | | List<ClientBusinessObject> allCbo = boService.queryCBO(btmType, conditionMap,new PageHelper(-1),clauseList); |
| | | List<com.vci.client.bof.ClientBusinessObject> allCbo = boService.queryCBO(btmType, conditionMap,new PageHelper(-1),clauseList); |
| | | if(allCbo.size()>0){ |
| | | for(ClientBusinessObject cbo : allCbo){ |
| | | for(com.vci.client.bof.ClientBusinessObject cbo : allCbo){ |
| | | String linkOid = linkBoOidMap.get(cbo.getOid()); |
| | | linkedCboMap.put(linkOid, cbo); |
| | | } |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<Map> clos2Map(List<ClientLinkObject> clos) throws VciBaseException { |
| | | public List<Map> clos2Map(List<com.vci.client.bof.ClientLinkObject> clos) throws VciBaseException { |
| | | List<Map> allMap = new ArrayList<Map>(); |
| | | for(ClientLinkObject clo : clos){ |
| | | for(com.vci.client.bof.ClientLinkObject clo : clos){ |
| | | allMap.add(clo2Map(clo)); |
| | | } |
| | | return allMap; |
| | | } |
| | | |
| | | @Override |
| | | public Map clo2Map(ClientLinkObject clo) throws VciBaseException { |
| | | public Map clo2Map(com.vci.client.bof.ClientLinkObject clo) throws VciBaseException { |
| | | Map<String,String> map = new HashMap<String, String>(); |
| | | WebUtil.copyValueToMapFromClos(clo, map); |
| | | return map; |
| | |
| | | * @return 链接类型和关联的to端 |
| | | */ |
| | | @Override |
| | | public List<BOAndLO> queryCLOAndBOBySchema(UILinkTypeDataQuery linkTypeDataQuery) { |
| | | public List<com.vci.corba.query.data.BOAndLO> queryCLOAndBOBySchema(UILinkTypeDataQuery linkTypeDataQuery) { |
| | | VciBaseUtil.alertNotNull(linkTypeDataQuery,"链接类型查询对象",linkTypeDataQuery.getQueryTemplateName(),"查询模板的名称"); |
| | | QueryTemplate qt =boService.getQtByName(linkTypeDataQuery.getQueryTemplateName(),linkTypeDataQuery.getReplaceMap()); |
| | | return queryCLOAndBOByQueryTemplate(qt,linkTypeDataQuery); |
| | |
| | | * @param linkTypeDataQuery 链接类型的查询对象 |
| | | * @return 链接类型和业务类型 |
| | | */ |
| | | private List<BOAndLO> queryCLOAndBOByQueryTemplate(QueryTemplate qt,UILinkTypeDataQuery linkTypeDataQuery){ |
| | | private List<com.vci.corba.query.data.BOAndLO> queryCLOAndBOByQueryTemplate(QueryTemplate qt,UILinkTypeDataQuery linkTypeDataQuery){ |
| | | if(StringUtils.isNotBlank(linkTypeDataQuery.getToBtmType()) && StringUtils.isBlank(qt.getBtmType())) { |
| | | qt.setBtmType(linkTypeDataQuery.getToBtmType()); |
| | | } |
| | |
| | | } |
| | | boService.setPageAndOrderToQT(qt,linkTypeDataQuery.getPageHelper()); |
| | | try { |
| | | BOAndLO[] bos = platformClientUtil.getQueryService().getBOAndLOS(qt.getId(), Tool.qtTOXMl(qt).asXML(),linkTypeDataQuery.getParentOid()==null?"":linkTypeDataQuery.getParentOid()); |
| | | // com.vci.corba.query.data.BOAndLO[] bos = platformClientUtil.getQueryService().getBOAndLOS(qt.getId(), Tool.qtTOXMl(qt).asXML(),linkTypeDataQuery.getParentOid()==null?"":linkTypeDataQuery.getParentOid()); |
| | | com.vci.corba.query.data.BOAndLO[] bos = ServiceProvider.getOQService().getBOAndLOS(qt.getId(), Tool.qtTOXMl(qt).asXML(),linkTypeDataQuery.getParentOid()==null?"":linkTypeDataQuery.getParentOid()); |
| | | return Arrays.stream(bos).collect(Collectors.toList()); |
| | | } catch (VCIError e) { |
| | | } catch (PLException e) { |
| | | // logger.error(e.error_code,e); |
| | | throw WebUtil.getVciBaseException(e); |
| | | } |
| | |
| | | * @return 链接对象和to端业务对象 |
| | | */ |
| | | @Override |
| | | public List<BOAndLO> queryCLOAndBoByLinkType(UILinkTypeDataQuery linkTypeDataQuery){ |
| | | public List<com.vci.corba.query.data.BOAndLO> queryCLOAndBoByLinkType(UILinkTypeDataQuery linkTypeDataQuery){ |
| | | VciBaseUtil.alertNotNull(linkTypeDataQuery,"链接类型查询对象",linkTypeDataQuery.getLinkType(),"链接类型的名称"); |
| | | QueryTemplate qt = null; |
| | | if(StringUtils.isBlank(linkTypeDataQuery.getQueryTemplateName())){ |
| | |
| | | Map<String,List<String>> toBtmOidsMap = new HashMap<>(); |
| | | try { |
| | | IntHolder totalHolder = new IntHolder(); |
| | | LinkObject[] linkObjects = platformClientUtil.getQueryService().findLTObjectsV2(qt.getId(), Tool.qtTOXMl(qt).asXML(),totalHolder); |
| | | // com.vci.corba.omd.data.LinkObject[] linkObjects = platformClientUtil.getQueryService().findLTObjectsV2(qt.getId(), Tool.qtTOXMl(qt).asXML(),totalHolder); |
| | | ObjectQueryService.FindLTObjectsV2Result linkObjects = ServiceProvider.getOQService().findLTObjectsV2(qt.getId(), Tool.qtTOXMl(qt).asXML()); |
| | | |
| | | |
| | | List<Map<String,String>> data = new ArrayList<>(); |
| | | List<String> finalEnumFields = enumFields; |
| | | final Integer[] total = {totalHolder.value}; |
| | | Arrays.stream(linkObjects).forEach(lo->{ |
| | | ClientLinkObject clo = new ClientLinkObject(); |
| | | Arrays.stream(linkObjects.returnValue).forEach(lo->{ |
| | | com.vci.client.bof.ClientLinkObject clo = new com.vci.client.bof.ClientLinkObject(); |
| | | clo.setLinkObject(lo); |
| | | Map<String, String> map = new HashMap<>(); |
| | | boService.queryEnumText(null,clo, finalEnumFields); |
| | | WebUtil.copyValueToMapFromClos(clo,map); |
| | | List<String> fromOids = fromBtmOidsMap.getOrDefault(lo.fromBTMName, new ArrayList<>()); |
| | | List<String> fromOids = fromBtmOidsMap.getOrDefault(lo.fromBTName, new ArrayList<>()); |
| | | fromOids.add(lo.fromOid); |
| | | fromBtmOidsMap.put(lo.fromBTMName,fromOids); |
| | | fromBtmOidsMap.put(lo.fromBTName,fromOids); |
| | | |
| | | List<String> toOids = toBtmOidsMap.getOrDefault(lo.toBTMName, new ArrayList<>()); |
| | | List<String> toOids = toBtmOidsMap.getOrDefault(lo.toBTName, new ArrayList<>()); |
| | | toOids.add(lo.toOid); |
| | | toBtmOidsMap.put(lo.toBTMName,toOids); |
| | | toBtmOidsMap.put(lo.toBTName,toOids); |
| | | data.add(map); |
| | | if(total[0] == 0){ |
| | | total[0] = VciBaseUtil.getInt(map.getOrDefault(QTConstants.COUNT_OVER_ALIAS.toLowerCase(),"0")); |
| | |
| | | }); |
| | | dataGrid.setData(data); |
| | | dataGrid.setTotal(total[0]); |
| | | } catch (VCIError e) { |
| | | } catch (PLException e) { |
| | | // logger.error(e.error_code,e); |
| | | throw WebUtil.getVciBaseException(e); |
| | | } |
| | |
| | | //分页不要超过1000 |
| | | Map<String,String> boConditionMap =new HashMap<>(); |
| | | boConditionMap.put("oid",QueryOptionConstant.IN + "(" + WebUtil.toInSql(oids.toArray(new String[0])) + ")"); |
| | | List<ClientBusinessObject> cbos = boService.queryCBO(btm, boConditionMap, null, fromFieldsFix); |
| | | List<com.vci.client.bof.ClientBusinessObject> cbos = boService.queryCBO(btm, boConditionMap, null, fromFieldsFix); |
| | | if(!CollectionUtils.isEmpty(cbos)){ |
| | | cbos.stream().forEach(cbo->{ |
| | | dataGrid.getData().forEach(data->{ |
| | |
| | | //分页不要超过1000 |
| | | Map<String,String> boConditionMap =new HashMap<>(); |
| | | boConditionMap.put("oid",QueryOptionConstant.IN + "(" + WebUtil.toInSql(oids.toArray(new String[0])) + ")"); |
| | | List<ClientBusinessObject> cbos = boService.queryCBO(btm, boConditionMap, null, toFieldsFix); |
| | | List<com.vci.client.bof.ClientBusinessObject> cbos = boService.queryCBO(btm, boConditionMap, null, toFieldsFix); |
| | | if(!CollectionUtils.isEmpty(cbos)){ |
| | | cbos.stream().forEach(cbo->{ |
| | | dataGrid.getData().forEach(data->{ |