Browse Source

修改流程配置初始化json

车车 3 tháng trước cách đây
mục cha
commit
4d82b8cec6

+ 5 - 3
yudao-module-iscs/src/main/java/cn/iocoder/yudao/module/iscs/api/task/IscsInitApiImpl.java

@@ -17,6 +17,7 @@ import com.fasterxml.jackson.databind.ObjectMapper;
 import com.fasterxml.jackson.databind.node.ArrayNode;
 import com.fasterxml.jackson.databind.node.ArrayNode;
 import com.fasterxml.jackson.databind.node.ObjectNode;
 import com.fasterxml.jackson.databind.node.ObjectNode;
 import jakarta.annotation.Resource;
 import jakarta.annotation.Resource;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.validation.annotation.Validated;
 
 
@@ -333,7 +334,7 @@ public class IscsInitApiImpl implements IscsInitApi {
                 "        \"type\": \"isolation\",\n" +
                 "        \"type\": \"isolation\",\n" +
                 "        \"nodeId\": \"005\",\n" +
                 "        \"nodeId\": \"005\",\n" +
                 "        \"icon\": \"6005.png\",\n" +
                 "        \"icon\": \"6005.png\",\n" +
-                "        \"workerUserId\": \"181\",\n" +
+                "        \"workerUserId\": \"\",\n" +
                 "        \"remark\": \"\",\n" +
                 "        \"remark\": \"\",\n" +
                 "        \"formId\": \"\",\n" +
                 "        \"formId\": \"\",\n" +
                 "        \"isolationType\": \"1\",\n" +
                 "        \"isolationType\": \"1\",\n" +
@@ -381,7 +382,7 @@ public class IscsInitApiImpl implements IscsInitApi {
                 "        \"type\": \"releaseIsolation\",\n" +
                 "        \"type\": \"releaseIsolation\",\n" +
                 "        \"nodeId\": \"006\",\n" +
                 "        \"nodeId\": \"006\",\n" +
                 "        \"icon\": \"7007.png\",\n" +
                 "        \"icon\": \"7007.png\",\n" +
-                "        \"workerUserId\": \"181\",\n" +
+                "        \"workerUserId\": \"\",\n" +
                 "        \"remark\": \"\",\n" +
                 "        \"remark\": \"\",\n" +
                 "        \"formId\": \"\",\n" +
                 "        \"formId\": \"\",\n" +
                 "        \"isolationType\": \"1\",\n" +
                 "        \"isolationType\": \"1\",\n" +
@@ -533,7 +534,8 @@ public class IscsInitApiImpl implements IscsInitApi {
                     } else {
                     } else {
                         ObjectNode dataNode = (ObjectNode) nodeObj.get("data");
                         ObjectNode dataNode = (ObjectNode) nodeObj.get("data");
                         // 替换节点负责人,处理null情况
                         // 替换节点负责人,处理null情况
-                        if (workerUserId != null) {
+                        String workerUserIdText = nodeObj.get("workerUserId").asText();
+                        if (workerUserId != null && StringUtils.isNotBlank(workerUserIdText)) {
                             dataNode.put("workerUserId", workerUserId);
                             dataNode.put("workerUserId", workerUserId);
                         } else {
                         } else {
                             dataNode.putNull("workerUserId"); // 若为null则设为JSON null
                             dataNode.putNull("workerUserId"); // 若为null则设为JSON null

+ 1 - 1
yudao-module-iscs/src/main/java/cn/iocoder/yudao/module/iscs/controller/admin/isolationpoint/IsolationPointController.java

@@ -63,7 +63,7 @@ public class IsolationPointController {
     @GetMapping("/selectIsolationPointById")
     @GetMapping("/selectIsolationPointById")
     @Operation(summary = "获得隔离点")
     @Operation(summary = "获得隔离点")
     @Parameter(name = "id", description = "编号", required = true, example = "1024")
     @Parameter(name = "id", description = "编号", required = true, example = "1024")
-    @PreAuthorize("@ss.hasPermission('iscs:isolation-point:query')")
+    // @PreAuthorize("@ss.hasPermission('iscs:isolation-point:query')")
     public CommonResult<IsolationPointRespVO> selectIsolationPointById(@RequestParam("id") Long id) {
     public CommonResult<IsolationPointRespVO> selectIsolationPointById(@RequestParam("id") Long id) {
         IsolationPointDO isolationPoint = isolationPointService.getIsolationPoint(id);
         IsolationPointDO isolationPoint = isolationPointService.getIsolationPoint(id);
         return success(BeanUtils.toBean(isolationPoint, IsolationPointRespVO.class));
         return success(BeanUtils.toBean(isolationPoint, IsolationPointRespVO.class));

+ 4 - 4
yudao-module-iscs/src/main/java/cn/iocoder/yudao/module/iscs/service/workdesign/WorkflowDesignNodeServiceImpl.java

@@ -48,10 +48,10 @@ public class WorkflowDesignNodeServiceImpl extends ServiceImpl<WorkflowDesignNod
             List<WorkflowDesignNodeDO> workflowDesignNodeDOS = parseJsonToList(content);
             List<WorkflowDesignNodeDO> workflowDesignNodeDOS = parseJsonToList(content);
             workflowDesignNodeDOS.forEach(o -> {
             workflowDesignNodeDOS.forEach(o -> {
                 o.setDesignId(designId);
                 o.setDesignId(designId);
-                // 临时吧上锁人给负责人,防止解除隔离点位找不到任务
-                if ("releaseIsolation".equals(o.getType()) && StringUtils.isNotBlank(o.getLockPerson())) {
-                    o.setWorkerUserId(Long.valueOf(o.getLockPerson()));
-                }
+                // 临时吧上锁人给负责人,防止解除隔离点位找不到任务(node冗余了上锁人共锁人字段,可以删除下面逻辑了)
+                // if ("releaseIsolation".equals(o.getType()) && StringUtils.isNotBlank(o.getLockPerson())) {
+                //     o.setWorkerUserId(Long.valueOf(o.getLockPerson()));
+                // }
             });
             });
             saveBatch(workflowDesignNodeDOS);
             saveBatch(workflowDesignNodeDOS);
             if (!workflowDesignNodeDOS.isEmpty()) {
             if (!workflowDesignNodeDOS.isEmpty()) {