|
@@ -1,6 +1,8 @@
|
|
|
package com.persagy.proxy.adm.service.impl;
|
|
|
|
|
|
import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
+import java.util.Set;
|
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
@@ -9,6 +11,7 @@ import org.springframework.stereotype.Service;
|
|
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
|
import com.fasterxml.jackson.databind.node.ObjectNode;
|
|
|
import com.google.common.collect.Lists;
|
|
|
+import com.persagy.dmp.basic.dto.RequestData;
|
|
|
import com.persagy.dmp.basic.model.QueryCriteria;
|
|
|
import com.persagy.dmp.common.helper.SpringHelper;
|
|
|
import com.persagy.dmp.common.model.response.CommonResult;
|
|
@@ -17,6 +20,7 @@ import com.persagy.dmp.define.client.DigitalRelationDefineFacade;
|
|
|
import com.persagy.dmp.define.entity.GraphDefine;
|
|
|
import com.persagy.dmp.define.entity.RelationDefine;
|
|
|
import com.persagy.dmp.digital.client.DigitalObjectFacade;
|
|
|
+import com.persagy.dmp.digital.client.DigitalObjectSimpleFacade;
|
|
|
import com.persagy.dmp.digital.client.DigitalRelationFacade;
|
|
|
import com.persagy.dmp.digital.client.DigitalRelationProjectCalFacade;
|
|
|
import com.persagy.dmp.digital.entity.ObjectRelation;
|
|
@@ -52,7 +56,21 @@ public class RelationReportService implements IRelationReportService {
|
|
|
private RelationObjectContext relationObjectContext;
|
|
|
|
|
|
@Override
|
|
|
+ public List<Map<String, Object>> queryObjectCountByObjInfos(String groupCode, Set<String> classCodes, Set<String> objTypes, List<String> groups) {
|
|
|
+ groupCode = StrUtil.isBlank(groupCode) ? defaultCode : groupCode;
|
|
|
+
|
|
|
+ RequestData requestData = new RequestData();
|
|
|
+ requestData.setClassCodes(classCodes);
|
|
|
+ requestData.setObjTypes(objTypes);
|
|
|
+ requestData.setGroups(groups);
|
|
|
+ List<Map<String,Object>> list = DigitalObjectSimpleFacade.queryObjectCountByObjInfos(groupCode, AdmCommonConstant.APP_ID, AdmCommonConstant.USER_ID, requestData);
|
|
|
+ return CollectionUtil.isEmpty(list) ? Lists.newArrayList() : list;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
public List<GraphDefine> getGraphDefine(String groupCode, String projectId, String graphCode) {
|
|
|
+ groupCode = StrUtil.isBlank(groupCode) ? defaultCode : groupCode;
|
|
|
+
|
|
|
ObjectMapper objectMapper = SpringHelper.getBean(ObjectMapper.class);
|
|
|
QueryCriteria queryCriteria = new QueryCriteria();
|
|
|
ObjectNode criteria = objectMapper.createObjectNode();
|
|
@@ -66,6 +84,8 @@ public class RelationReportService implements IRelationReportService {
|
|
|
|
|
|
@Override
|
|
|
public List<RelationDefine> getRelationDefine(String groupCode, String projectId, String graphCode, String relCode) {
|
|
|
+ groupCode = StrUtil.isBlank(groupCode) ? defaultCode : groupCode;
|
|
|
+
|
|
|
ObjectMapper objectMapper = SpringHelper.getBean(ObjectMapper.class);
|
|
|
QueryCriteria queryCriteria = new QueryCriteria();
|
|
|
ObjectNode criteria = objectMapper.createObjectNode();
|
|
@@ -82,6 +102,8 @@ public class RelationReportService implements IRelationReportService {
|
|
|
|
|
|
@Override
|
|
|
public ObjectNode getRelationProjectCal(String groupCode, String projectId, String relType) {
|
|
|
+ groupCode = StrUtil.isBlank(groupCode) ? defaultCode : groupCode;
|
|
|
+
|
|
|
AdmRelationTypeEnum relationTypeEnum = AdmCommonConstant.RELATION_TYPE_MAP.get(relType);
|
|
|
if (relationTypeEnum == null) {
|
|
|
return null;
|
|
@@ -116,6 +138,8 @@ public class RelationReportService implements IRelationReportService {
|
|
|
|
|
|
@Override
|
|
|
public ObjectNode getRelationProjectCal(String groupCode, String projectId, String graphCode, String relCode, String zoneType) {
|
|
|
+ groupCode = StrUtil.isBlank(groupCode) ? defaultCode : groupCode;
|
|
|
+
|
|
|
ObjectMapper objectMapper = SpringHelper.getBean(ObjectMapper.class);
|
|
|
QueryCriteria queryCriteria = new QueryCriteria();
|
|
|
ObjectNode criteria = objectMapper.createObjectNode();
|
|
@@ -134,6 +158,8 @@ public class RelationReportService implements IRelationReportService {
|
|
|
|
|
|
@Override
|
|
|
public long countRelationObject(String groupCode, String projectId, String graphCode, String relCode, String zoneType) {
|
|
|
+ groupCode = StrUtil.isBlank(groupCode) ? defaultCode : groupCode;
|
|
|
+
|
|
|
QueryCriteria queryCriteria = new QueryCriteria();
|
|
|
ObjectMapper objectMapper = SpringHelper.getBean(ObjectMapper.class);
|
|
|
ObjectNode criteria = objectMapper.createObjectNode();
|
|
@@ -150,6 +176,8 @@ public class RelationReportService implements IRelationReportService {
|
|
|
|
|
|
@Override
|
|
|
public long countObject(String groupCode, String projectId, String classCode, String objType) {
|
|
|
+ groupCode = StrUtil.isBlank(groupCode) ? defaultCode : groupCode;
|
|
|
+
|
|
|
QueryCriteria queryCriteria = new QueryCriteria();
|
|
|
ObjectMapper objectMapper = SpringHelper.getBean(ObjectMapper.class);
|
|
|
ObjectNode criteria = objectMapper.createObjectNode();
|
|
@@ -165,6 +193,8 @@ public class RelationReportService implements IRelationReportService {
|
|
|
|
|
|
@Override
|
|
|
public ObjectNode getObjectNode(String groupCode, String projectId, String id) {
|
|
|
+ groupCode = StrUtil.isBlank(groupCode) ? defaultCode : groupCode;
|
|
|
+
|
|
|
ObjectMapper objectMapper = SpringHelper.getBean(ObjectMapper.class);
|
|
|
QueryCriteria queryCriteria = new QueryCriteria();
|
|
|
ObjectNode criteria = objectMapper.createObjectNode();
|
|
@@ -176,6 +206,8 @@ public class RelationReportService implements IRelationReportService {
|
|
|
|
|
|
@Override
|
|
|
public List<ObjectNode> findObjectNodes(String groupCode, String projectId, String objType, String code, String value) {
|
|
|
+ groupCode = StrUtil.isBlank(groupCode) ? defaultCode : groupCode;
|
|
|
+
|
|
|
if (StrUtil.isBlank(code)) {
|
|
|
return null;
|
|
|
}
|