Przeglądaj źródła

fix bug:/rel/si-in-sp-base/link-list接口创建的关系没有graphId,relValue的值

lijie 3 lat temu
rodzic
commit
7e84076489

+ 6 - 2
src/main/java/com/persagy/proxy/relation/controller/RelationSpInSiController.java

@@ -4,6 +4,7 @@ import cn.hutool.core.util.StrUtil;
 import com.fasterxml.jackson.databind.node.JsonNodeFactory;
 import com.fasterxml.jackson.databind.node.ObjectNode;
 import com.persagy.dmp.basic.model.QueryCriteria;
+import com.persagy.dmp.common.constant.CommonConstant;
 import com.persagy.proxy.adm.constant.AdmRelationTypeEnum;
 import com.persagy.proxy.relation.model.SiInSpBase;
 import com.persagy.proxy.relation.model.SiInSpBaseList;
@@ -59,11 +60,14 @@ public class RelationSpInSiController {
         for (SiInSpBase siInSpBase : content) {
             String ispaceId = siInSpBase.getIspaceId();
             String spaceId = siInSpBase.getSpaceId();
-            String objectType = siInSpBase.getObjectType();
+            if (StrUtil.isBlank(type)){
+                type = siInSpBase.getClassCode();
+            }
             if (StrUtil.isEmpty(spaceId) || StrUtil.isBlank(ispaceId)) {
                 return AdmResponse.failure("必填项:ispaceId(元空间id)、spaceId(空间id)");
             }
-            RelationDTO relation = new RelationDTO(null, graphCode, relCode, objectType, spaceId, ispaceId);
+            RelationDTO relation = new RelationDTO(StrUtil.format(CommonConstant.DEFAULT_GRAPH_ID_FORMAT,graphCode),
+                    graphCode, relCode, type, spaceId, ispaceId);
             voList.add(relation);
         }
         service.doSave(AdmContextUtil.toDmpContext(), voList);

+ 3 - 0
src/main/java/com/persagy/proxy/relation/model/SiInSpBase.java

@@ -32,4 +32,7 @@ public class SiInSpBase {
     /** 计算标记 1 为手动 2为自动 */
     private Integer sign;
 
+    /** 计算标记 1 为手动 2为自动 */
+    private String classCode;
+
 }