Эх сурвалжийг харах

fix: 修复流程预测错误问题

lizhixian 6 сар өмнө
parent
commit
1f6f00164a

+ 2 - 2
yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/BpmProcessInstanceController.java

@@ -158,11 +158,11 @@ public class BpmProcessInstanceController {
         return success(true);
     }
 
-    @PostMapping("/get-approval-detail")
+    @GetMapping("/get-approval-detail")
     @Operation(summary = "获得审批详情")
     @Parameter(name = "id", description = "流程实例的编号", required = true)
     @PreAuthorize("@ss.hasPermission('bpm:process-instance:query')")
-    public CommonResult<BpmApprovalDetailRespVO> getApprovalDetail(@Valid @RequestBody BpmApprovalDetailReqVO reqVO) {
+    public CommonResult<BpmApprovalDetailRespVO> getApprovalDetail(@Valid BpmApprovalDetailReqVO reqVO) {
         return success(processInstanceService.getApprovalDetail(getLoginUserId(), reqVO));
     }
 

+ 3 - 0
yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/instance/BpmApprovalDetailReqVO.java

@@ -18,6 +18,9 @@ public class BpmApprovalDetailReqVO {
     @Schema(description = "流程变量")
     private Map<String, Object> processVariables; // 使用场景:同 processDefinitionId,用于流程预测
 
+    @Schema(description = "流程变量")
+    private String processVariablesStr; // 使用场景:同 processDefinitionId,用于流程预测
+
     @Schema(description = "流程实例的编号", example = "1024")
     private String processInstanceId;  // 使用场景:流程已发起时候传流程实例 ID
 

+ 4 - 0
yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/task/BpmProcessInstanceServiceImpl.java

@@ -7,6 +7,7 @@ import cn.hutool.core.lang.Assert;
 import cn.hutool.core.util.ArrayUtil;
 import cn.hutool.core.util.ObjectUtil;
 import cn.hutool.core.util.StrUtil;
+import cn.hutool.json.JSONUtil;
 import cn.iocoder.yudao.framework.common.pojo.PageResult;
 import cn.iocoder.yudao.framework.common.util.date.DateUtils;
 import cn.iocoder.yudao.framework.common.util.json.JsonUtils;
@@ -165,6 +166,9 @@ public class BpmProcessInstanceServiceImpl implements BpmProcessInstanceService
         HistoricProcessInstance historicProcessInstance = null; // 流程实例
         Integer processInstanceStatus = BpmProcessInstanceStatusEnum.NOT_START.getStatus(); // 流程状态
         Map<String, Object> processVariables = reqVO.getProcessVariables(); // 流程变量
+        if (reqVO.getProcessVariablesStr() != null){
+            processVariables = JSONUtil.parseObj(reqVO.getProcessVariablesStr());
+        }
         // 1.2 如果是流程已发起的场景,则使用流程实例的数据
         if (reqVO.getProcessInstanceId() != null) {
             historicProcessInstance = getHistoricProcessInstance(reqVO.getProcessInstanceId());