Browse Source

查询关联事件

develop
lau572 6 months ago
parent
commit
cb77b40acd
  1. 14
      zc-business/src/main/java/com/zc/business/controller/DcEventController.java
  2. 10
      zc-business/src/main/java/com/zc/business/service/IDcEventService.java
  3. 31
      zc-business/src/main/java/com/zc/business/service/impl/DcEventServiceImpl.java

14
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);
}
}

10
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<DcEvent> dispatchRecordEventList(DcEvent dcEvent);
}

31
zc-business/src/main/java/com/zc/business/service/impl/DcEventServiceImpl.java

@ -1818,4 +1818,35 @@ public class DcEventServiceImpl extends ServiceImpl<DcEventMapper, DcEvent> 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<Map<String,Object>> result = new ArrayList<>();
DcEvent dcEvent = dcEventMapper.selectDcEventById(eventId);
if (StringUtils.isNotEmpty(dcEvent.getLinkId())){
Map<String,Object> 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);
}
}

Loading…
Cancel
Save