Browse Source

事件删除关联 删除调度记录资源 删除调度记录

develop
王兴琳 7 months ago
parent
commit
89252dc951
  1. 25
      zc-business/src/main/java/com/zc/business/enums/EventSource.java
  2. 24
      zc-business/src/main/java/com/zc/business/service/impl/DcEventServiceImpl.java
  3. 1
      zc-business/src/main/resources/mapper/business/DcEventMapper.xml

25
zc-business/src/main/java/com/zc/business/enums/EventSource.java

@ -0,0 +1,25 @@
package com.zc.business.enums;
/**
*
*/
//事件来源枚举
public enum EventSource {
VIDEO_AI(1, "视频AI");
private final Integer code;
private final String description;
EventSource(Integer code, String description) {
this.code = code;
this.description = description;
}
public Integer getCode()
{
return code;
}
public String getDescription() {
return description;
}
}

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

@ -6,11 +6,13 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils; import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StakeMarkUtils;
import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.uuid.IdUtils; import com.ruoyi.common.utils.uuid.IdUtils;
import com.ruoyi.system.service.ISysDeptService; import com.ruoyi.system.service.ISysDeptService;
import com.zc.business.domain.*; import com.zc.business.domain.*;
import com.zc.business.enums.EventSubclassEnum; import com.zc.business.enums.EventSubclassEnum;
import com.zc.business.enums.EventTypeEnum;
import com.zc.business.enums.ValueConverter; import com.zc.business.enums.ValueConverter;
import com.zc.business.mapper.*; import com.zc.business.mapper.*;
import com.zc.business.service.IDcEventProcessService; import com.zc.business.service.IDcEventProcessService;
@ -140,7 +142,6 @@ public class DcEventServiceImpl extends ServiceImpl<DcEventMapper, DcEvent> impl
String dcEventId = dcEvent.getId(); String dcEventId = dcEvent.getId();
//获取事件类型 //获取事件类型
int eventType = Math.toIntExact(dcEvent.getEventType()); int eventType = Math.toIntExact(dcEvent.getEventType());
@ -666,6 +667,21 @@ public class DcEventServiceImpl extends ServiceImpl<DcEventMapper, DcEvent> impl
*/ */
@Override @Override
public int updateDcEvent(DcEvent dcEvent) { public int updateDcEvent(DcEvent dcEvent) {
/* //事件类型校验
for (EventTypeEnum value : EventTypeEnum.values()) {
if (dcEvent.getEventType().toString()==value.getInfo()){
dcEvent.setEventType(Long.valueOf(value.getCode()));
}
}
// 事件子类校验
for (EventSubclassEnum value : EventSubclassEnum.values()) {
if (value.getInfo().equals(dcEvent.getEventSubclass())){
dcEvent.setEventSubclass(value.getCode());
}
}
//事件来源校验*/
DcEvent oldEvent = selectEventSubclassById(dcEvent.getEventType().intValue(), dcEvent.getId()); DcEvent oldEvent = selectEventSubclassById(dcEvent.getEventType().intValue(), dcEvent.getId());
dcEvent.setUpdateTime(DateUtils.getNowDate()); dcEvent.setUpdateTime(DateUtils.getNowDate());
int i7 = dcEventMapper.updateDcEvent(dcEvent); int i7 = dcEventMapper.updateDcEvent(dcEvent);
@ -752,8 +768,12 @@ public class DcEventServiceImpl extends ServiceImpl<DcEventMapper, DcEvent> impl
if (dcEvent==null){ if (dcEvent==null){
continue; continue;
} }
// 删除信息发布记录 // todo 删除信息发布记录
dcPublishManageMapper.deleteDcPublishManageEventId(id); dcPublishManageMapper.deleteDcPublishManageEventId(id);
// 删除调度记录资源
dcPublishManageMapper.deleteDisPathSource(id);
//删除调度记录
dcPublishManageMapper.deleteDisPath(id);
int eventType = Math.toIntExact(dcEvent.getEventType()); int eventType = Math.toIntExact(dcEvent.getEventType());
i7 = dcEventMapper.deleteDcEventById(id); i7 = dcEventMapper.deleteDcEventById(id);

1
zc-business/src/main/resources/mapper/business/DcEventMapper.xml

@ -487,6 +487,7 @@
WHEN '2' THEN '已完成' WHEN '2' THEN '已完成'
WHEN '3' THEN '已撤销' WHEN '3' THEN '已撤销'
END AS stringEventState, END AS stringEventState,
dc_event.event_source,
CASE dc_event.event_source CASE dc_event.event_source
WHEN '1' THEN '96659' WHEN '1' THEN '96659'
WHEN '2' THEN '交警转接' WHEN '2' THEN '交警转接'

Loading…
Cancel
Save