diff --git a/zc-business/src/main/java/com/zc/business/controller/DcEventController.java b/zc-business/src/main/java/com/zc/business/controller/DcEventController.java index 6c024945..8fe87c39 100644 --- a/zc-business/src/main/java/com/zc/business/controller/DcEventController.java +++ b/zc-business/src/main/java/com/zc/business/controller/DcEventController.java @@ -213,4 +213,18 @@ public class DcEventController extends BaseController return getDataTable(list); } + + /** + * @Description 查询关联事件 + * + * @author liuwenge + * @date 2024/5/30 14:27 + * @param eventId + * @return com.ruoyi.common.core.domain.AjaxResult + */ + @ApiOperation("查询关联事件") + @GetMapping( "/getLinkEvent/{eventId}") + public AjaxResult getLinkEvent(@ApiParam(name = "eventId", value = "事件id", required = true) @PathVariable("eventId") String eventId){ + return dcEventService.getLinkEvent(eventId); + } } diff --git a/zc-business/src/main/java/com/zc/business/service/IDcEventService.java b/zc-business/src/main/java/com/zc/business/service/IDcEventService.java index 9a740f91..8d5d5933 100644 --- a/zc-business/src/main/java/com/zc/business/service/IDcEventService.java +++ b/zc-business/src/main/java/com/zc/business/service/IDcEventService.java @@ -128,5 +128,15 @@ public interface IDcEventService */ AjaxResult skipClear(String eventId); + /** + * @Description 查询关联事件 + * + * @author liuwenge + * @date 2024/5/30 14:28 + * @param eventId + * @return com.ruoyi.common.core.domain.AjaxResult + */ + AjaxResult getLinkEvent(String eventId); + List dispatchRecordEventList(DcEvent dcEvent); } diff --git a/zc-business/src/main/java/com/zc/business/service/impl/DcEventServiceImpl.java b/zc-business/src/main/java/com/zc/business/service/impl/DcEventServiceImpl.java index 453f9260..7e59ea01 100644 --- a/zc-business/src/main/java/com/zc/business/service/impl/DcEventServiceImpl.java +++ b/zc-business/src/main/java/com/zc/business/service/impl/DcEventServiceImpl.java @@ -1818,4 +1818,35 @@ public class DcEventServiceImpl extends ServiceImpl impl } + /** + * @Description 查询关联事件 + * + * @author liuwenge + * @date 2024/5/30 14:29 + * @param eventId + * @return com.ruoyi.common.core.domain.AjaxResult + */ + @Override + public AjaxResult getLinkEvent(String eventId){ + + List> result = new ArrayList<>(); + DcEvent dcEvent = dcEventMapper.selectDcEventById(eventId); + if (StringUtils.isNotEmpty(dcEvent.getLinkId())){ + Map item = new HashMap<>(); + item.put("eventId",eventId); + item.put("eventNature",dcEvent.getEventNature()); + result.add(item); + + String[] linkIds = dcEvent.getLinkId().split(","); + for (String linkId : linkIds) { + item = new HashMap<>(); + item.put("eventId",linkId); + item.put("eventNature",2); + result.add(item); + } + } + return AjaxResult.success(result); + } + + }