|
@@ -1,11 +1,12 @@
|
|
|
package com.persagy.proxy.calculation.service.impl;
|
|
|
|
|
|
-import cn.hutool.core.collection.CollUtil;
|
|
|
-import cn.hutool.core.date.DateUtil;
|
|
|
-import cn.hutool.core.util.StrUtil;
|
|
|
-import cn.hutool.extra.spring.SpringUtil;
|
|
|
-import com.alibaba.fastjson.JSONObject;
|
|
|
-import com.fasterxml.jackson.databind.JsonNode;
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
+import java.util.Set;
|
|
|
+
|
|
|
+import org.springframework.stereotype.Service;
|
|
|
+
|
|
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
|
import com.fasterxml.jackson.databind.node.ArrayNode;
|
|
|
import com.fasterxml.jackson.databind.node.ObjectNode;
|
|
@@ -19,24 +20,23 @@ import com.persagy.dmp.digital.entity.ObjectDigital;
|
|
|
import com.persagy.dmp.digital.entity.ObjectRelation;
|
|
|
import com.persagy.proxy.adm.constant.AdmCommonConstant;
|
|
|
import com.persagy.proxy.adm.constant.AdmObjectInfoConstant;
|
|
|
+import com.persagy.proxy.adm.constant.AdmRelationTypeEnum;
|
|
|
import com.persagy.proxy.adm.constant.BusinessErrorRwdCode;
|
|
|
-import com.persagy.proxy.calculation.model.AdmManualRelCalRequest;
|
|
|
-import com.persagy.proxy.calculation.model.AdmManualRelationCalcDel;
|
|
|
-import com.persagy.proxy.calculation.model.AdmRelationAddRequest;
|
|
|
import com.persagy.proxy.adm.request.AdmCreateResponse;
|
|
|
import com.persagy.proxy.adm.request.AdmManualRelCalResponse;
|
|
|
import com.persagy.proxy.adm.request.AdmResponse;
|
|
|
+import com.persagy.proxy.calculation.model.AdmManualRelCalRequest;
|
|
|
+import com.persagy.proxy.calculation.model.AdmManualRelationCalcDel;
|
|
|
+import com.persagy.proxy.calculation.model.AdmRelationAddRequest;
|
|
|
import com.persagy.proxy.calculation.service.AdmManualRelCalService;
|
|
|
-import com.persagy.proxy.adm.constant.AdmRelationTypeEnum;
|
|
|
import com.persagy.proxy.common.entity.InstanceUrlParam;
|
|
|
+
|
|
|
+import cn.hutool.core.collection.CollUtil;
|
|
|
+import cn.hutool.core.date.DateUtil;
|
|
|
+import cn.hutool.core.util.StrUtil;
|
|
|
+import cn.hutool.extra.spring.SpringUtil;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
-import org.springframework.stereotype.Service;
|
|
|
-
|
|
|
-import java.util.ArrayList;
|
|
|
-import java.util.List;
|
|
|
-import java.util.Map;
|
|
|
-import java.util.Set;
|
|
|
|
|
|
/***
|
|
|
* Description: 手动计算逻辑处理类
|
|
@@ -298,11 +298,10 @@ public class AdmManualRelCalServiceImpl implements AdmManualRelCalService {
|
|
|
@Override
|
|
|
public AdmCreateResponse delRels(InstanceUrlParam context, AdmManualRelationCalcDel admManualRelationCalcDel) {
|
|
|
ObjectRelation objectRelation = new ObjectRelation();
|
|
|
- Map<String, AdmRelationTypeEnum> relationTypeMap = AdmRelationTypeEnum.getRelationTypeMap();
|
|
|
- if (relationTypeMap.containsKey(admManualRelationCalcDel.getRelType())){
|
|
|
+ AdmRelationTypeEnum relationTypeEnum = AdmCommonConstant.RELATION_TYPE_MAP.get(admManualRelationCalcDel.getRelType());
|
|
|
+ if (relationTypeEnum == null){
|
|
|
return AdmCreateResponse.failure("不存在的关系类型");
|
|
|
}
|
|
|
- AdmRelationTypeEnum relationTypeEnum = relationTypeMap.get(admManualRelationCalcDel.getRelType());
|
|
|
objectRelation.setGraphCode(relationTypeEnum.getGraphCode());
|
|
|
objectRelation.setRelCode(relationTypeEnum.getRelCode());
|
|
|
objectRelation.setObjFrom(admManualRelationCalcDel.getFromId());
|