Browse Source

撤回审批

guarantee-lsq 9 months ago
parent
commit
20b221ae53

+ 7 - 5
platform-service/src/main/java/com/platform/service/workflow/impl/WorkflowServiceImpl.java

@@ -5,10 +5,8 @@ import com.alibaba.fastjson.JSONObject;
 import com.github.pagehelper.PageHelper;
 import com.platform.common.bean.AbstractPageResultBean;
 import com.platform.common.constant.CommonConstants;
-import com.platform.common.util.BeanConverterUtil;
-import com.platform.common.util.IdGeneratorUtils;
-import com.platform.common.util.ListUtils;
-import com.platform.common.util.SecurityUtils;
+import com.platform.common.exception.DeniedException;
+import com.platform.common.util.*;
 import com.platform.dao.bean.MyPage;
 import com.platform.dao.dto.workflow.WorkflowDTO;
 import com.platform.dao.entity.workflow.Workflow;
@@ -117,7 +115,11 @@ public class WorkflowServiceImpl extends BaseServiceImpl<WorkflowMapper, Workflo
             node.setCreatedUserId(SecurityUtils.getUserInfo().getUserId());
             node.setCreatedUserName(SecurityUtils.getUserInfo().getRealName());
             node.setFrontId(jsonObject.getString("id"));
-            node.setFrontParentId(jsonObject.getString("parentId"));
+            String parentId = jsonObject.getString("parentId");
+            if(sortNum > 1 && StringUtils.isBlank(parentId)){
+                throw new DeniedException("父级节点为空");
+            }
+            node.setFrontParentId(parentId);
             node.setFlowId(record.getId());
             switch(type) {
                 case CommonConstants.CONDITION_TYPE: // 条件分支