From 89252dc95153aea3b2183080208f504e28354955 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=85=B4=E7=90=B3?= <1911390090@qq.com> Date: Mon, 13 May 2024 11:08:44 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=8B=E4=BB=B6=E5=88=A0=E9=99=A4=E5=85=B3?= =?UTF-8?q?=E8=81=94=20=20=20=E5=88=A0=E9=99=A4=E8=B0=83=E5=BA=A6=E8=AE=B0?= =?UTF-8?q?=E5=BD=95=E8=B5=84=E6=BA=90=20=E5=88=A0=E9=99=A4=E8=B0=83?= =?UTF-8?q?=E5=BA=A6=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/zc/business/enums/EventSource.java | 25 +++++++++++++++++++ .../service/impl/DcEventServiceImpl.java | 24 ++++++++++++++++-- .../mapper/business/DcEventMapper.xml | 1 + 3 files changed, 48 insertions(+), 2 deletions(-) create mode 100644 zc-business/src/main/java/com/zc/business/enums/EventSource.java diff --git a/zc-business/src/main/java/com/zc/business/enums/EventSource.java b/zc-business/src/main/java/com/zc/business/enums/EventSource.java new file mode 100644 index 00000000..37547c10 --- /dev/null +++ b/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; + } +} 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 b9dfae8e..ddb4d66e 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 @@ -6,11 +6,13 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.SecurityUtils; +import com.ruoyi.common.utils.StakeMarkUtils; import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.utils.uuid.IdUtils; import com.ruoyi.system.service.ISysDeptService; import com.zc.business.domain.*; import com.zc.business.enums.EventSubclassEnum; +import com.zc.business.enums.EventTypeEnum; import com.zc.business.enums.ValueConverter; import com.zc.business.mapper.*; import com.zc.business.service.IDcEventProcessService; @@ -140,7 +142,6 @@ public class DcEventServiceImpl extends ServiceImpl impl String dcEventId = dcEvent.getId(); - //获取事件类型 int eventType = Math.toIntExact(dcEvent.getEventType()); @@ -666,6 +667,21 @@ public class DcEventServiceImpl extends ServiceImpl impl */ @Override 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.setUpdateTime(DateUtils.getNowDate()); int i7 = dcEventMapper.updateDcEvent(dcEvent); @@ -752,8 +768,12 @@ public class DcEventServiceImpl extends ServiceImpl impl if (dcEvent==null){ continue; } - // 删除信息发布记录 + // todo 删除信息发布记录 dcPublishManageMapper.deleteDcPublishManageEventId(id); + // 删除调度记录资源 + dcPublishManageMapper.deleteDisPathSource(id); + //删除调度记录 + dcPublishManageMapper.deleteDisPath(id); int eventType = Math.toIntExact(dcEvent.getEventType()); i7 = dcEventMapper.deleteDcEventById(id); diff --git a/zc-business/src/main/resources/mapper/business/DcEventMapper.xml b/zc-business/src/main/resources/mapper/business/DcEventMapper.xml index fac9ab19..ea6f3cf6 100644 --- a/zc-business/src/main/resources/mapper/business/DcEventMapper.xml +++ b/zc-business/src/main/resources/mapper/business/DcEventMapper.xml @@ -487,6 +487,7 @@ WHEN '2' THEN '已完成' WHEN '3' THEN '已撤销' END AS stringEventState, + dc_event.event_source, CASE dc_event.event_source WHEN '1' THEN '96659' WHEN '2' THEN '交警转接'