From 19a0369e6dfb0f332f461a4bfe2b021970fb2539 Mon Sep 17 00:00:00 2001 From: lau572 <1010031226@qq.com> Date: Mon, 13 May 2024 17:54:30 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=8B=E4=BB=B6=E5=A4=84=E7=BD=AE=E5=89=8D?= =?UTF-8?q?=E7=BD=AE=E8=8A=82=E7=82=B9=E7=8A=B6=E6=80=81=E9=AA=8C=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/DcEventProcessController.java | 7 +++++++ .../zc/business/mapper/DcEventProcessMapper.java | 12 ++++++++++++ .../business/service/IDcEventProcessService.java | 12 ++++++++++++ .../service/impl/DcEventProcessServiceImpl.java | 15 +++++++++++++++ .../mapper/business/DcEventProcessMapper.xml | 5 +++++ 5 files changed, 51 insertions(+) diff --git a/zc-business/src/main/java/com/zc/business/controller/DcEventProcessController.java b/zc-business/src/main/java/com/zc/business/controller/DcEventProcessController.java index 79e0fcf7..08f1bf54 100644 --- a/zc-business/src/main/java/com/zc/business/controller/DcEventProcessController.java +++ b/zc-business/src/main/java/com/zc/business/controller/DcEventProcessController.java @@ -2,6 +2,7 @@ package com.zc.business.controller; import java.io.IOException; import java.util.List; +import java.util.Map; import javax.servlet.http.HttpServletResponse; import com.ruoyi.common.config.RuoYiConfig; @@ -100,6 +101,12 @@ public class DcEventProcessController extends BaseController @Log(title = "事件处理流程", businessType = BusinessType.INSERT) @PostMapping public AjaxResult add(@RequestBody DcEventProcess dcEventProcess){ + if (dcEventProcess.getProcessType() != null && dcEventProcess.getProcessType() == 1){ + int status = dcEventProcessService.selectPreviousNodeStatus(dcEventProcess.getEventId(),dcEventProcess.getProcessId()); + if (status < 1){ + return AjaxResult.error("前置节点未点亮!"); + } + } return toAjax(dcEventProcessService.insertDcEventProcess(dcEventProcess)); } diff --git a/zc-business/src/main/java/com/zc/business/mapper/DcEventProcessMapper.java b/zc-business/src/main/java/com/zc/business/mapper/DcEventProcessMapper.java index d512e150..4a00c447 100644 --- a/zc-business/src/main/java/com/zc/business/mapper/DcEventProcessMapper.java +++ b/zc-business/src/main/java/com/zc/business/mapper/DcEventProcessMapper.java @@ -2,6 +2,7 @@ package com.zc.business.mapper; import java.util.List; import com.zc.business.domain.DcEventProcess; +import org.apache.ibatis.annotations.Param; /** * 事件处理流程Mapper接口 @@ -75,4 +76,15 @@ public interface DcEventProcessMapper List selectDcDispatchByEventId(String id); int selectFinalNode(String eventId); + + /** + * @Description 查询前置节点状态 + * + * @author liuwenge + * @date 2024/5/13 16:08 + * @param eventId 事件id + * @param processId 节点id + * @return 状态 0未完成 1已完成 + */ + int selectPreviousNodeStatus(@Param("eventId") String eventId, @Param("processId") Long processId); } diff --git a/zc-business/src/main/java/com/zc/business/service/IDcEventProcessService.java b/zc-business/src/main/java/com/zc/business/service/IDcEventProcessService.java index f0023517..3d261edd 100644 --- a/zc-business/src/main/java/com/zc/business/service/IDcEventProcessService.java +++ b/zc-business/src/main/java/com/zc/business/service/IDcEventProcessService.java @@ -2,6 +2,7 @@ package com.zc.business.service; import java.io.IOException; import java.util.List; +import java.util.Map; import com.ruoyi.common.exception.file.InvalidExtensionException; import com.zc.business.domain.DcEventProcess; @@ -71,4 +72,15 @@ public interface IDcEventProcessService int deleteDcEventProcessById(Long id); List selectDcEventProcessListById(String id); + + /** + * @Description 查询前置节点状态 + * + * @author liuwenge + * @date 2024/5/13 15:57 + * @param eventId 事件id + * @param processId 节点id + * @return status 0未完成 1已完成 + */ + int selectPreviousNodeStatus(String eventId, Long processId); } diff --git a/zc-business/src/main/java/com/zc/business/service/impl/DcEventProcessServiceImpl.java b/zc-business/src/main/java/com/zc/business/service/impl/DcEventProcessServiceImpl.java index a097984a..6dd2a68c 100644 --- a/zc-business/src/main/java/com/zc/business/service/impl/DcEventProcessServiceImpl.java +++ b/zc-business/src/main/java/com/zc/business/service/impl/DcEventProcessServiceImpl.java @@ -148,4 +148,19 @@ public class DcEventProcessServiceImpl implements IDcEventProcessService public List selectDcEventProcessListById(String id) { return dcEventProcessMapper.selectDcDispatchByEventId(id); } + + /** + * @Description 查询前置节点状态 + * + * @author liuwenge + * @date 2024/5/13 16:07 + * @param eventId 事件id + * @param processId 节点id + * @return 状态 0未完成 1已完成 + */ + @Override + public int selectPreviousNodeStatus(String eventId, Long processId){ + return dcEventProcessMapper.selectPreviousNodeStatus(eventId,processId); + } + } diff --git a/zc-business/src/main/resources/mapper/business/DcEventProcessMapper.xml b/zc-business/src/main/resources/mapper/business/DcEventProcessMapper.xml index cab4e024..6a7ea7fb 100644 --- a/zc-business/src/main/resources/mapper/business/DcEventProcessMapper.xml +++ b/zc-business/src/main/resources/mapper/business/DcEventProcessMapper.xml @@ -145,4 +145,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" where t1.id = #{eventId}; + + \ No newline at end of file