Browse Source

类型 默认值添加,为空时添加

lvxianyun 3 years ago
parent
commit
80a5794086

+ 7 - 2
dmp-business/dmp-rwd/src/main/java/com/persagy/dmp/rwd/define/controller/ObjectTypeController.java

@@ -1,6 +1,7 @@
 package com.persagy.dmp.rwd.define.controller;
 
 import cn.hutool.core.collection.CollUtil;
+import cn.hutool.core.util.StrUtil;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.fasterxml.jackson.databind.node.ObjectNode;
@@ -134,8 +135,12 @@ public class ObjectTypeController {
             projectId = CommonConstant.DEFAULT_ID;
         }
         for (ObjectTypeDefine vo : voList) {
-            vo.setGroupCode(groupCode);
-            vo.setProjectId(projectId);
+            if(StrUtil.isEmpty(vo.getProjectId())){
+                vo.setProjectId(projectId);
+            }
+            if(StrUtil.isEmpty(vo.getGroupCode())){
+                vo.setGroupCode(groupCode);
+            }
         }
     }
 }