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