From 1ad78f56f94702bfbfc0db83d14f57f7bc985016 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=85=B4=E7=90=B3?= <1911390090@qq.com> Date: Thu, 18 Apr 2024 15:21:30 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=20=E4=BA=8B=E4=BB=B6?= =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/DcEventController.java | 6 +- .../com/zc/business/mapper/DcEventMapper.java | 2 + .../zc/business/service/IDcEventService.java | 2 +- .../service/impl/DcEventServiceImpl.java | 107 +++++++++--------- .../mapper/business/DcEventMapper.xml | 8 +- 5 files changed, 65 insertions(+), 60 deletions(-) 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 c15bd0bc..0428137a 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 @@ -140,10 +140,10 @@ public class DcEventController extends BaseController @ApiOperation("删除事件信息") // @PreAuthorize("@ss.hasPermi('system:event:remove')") @Log(title = "事件信息", businessType = BusinessType.DELETE) - @DeleteMapping("/{eventType}/{ids}") - public AjaxResult remove(@PathVariable int eventType,@PathVariable String[] ids ) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable String[] ids ) { - return toAjax(dcEventService.deleteDcEventByIds(eventType,ids)); + return toAjax(dcEventService.deleteDcEventByIds(ids)); } @ApiOperation("事件数量统计") // @PreAuthorize("@ss.hasPermi('system:event:list')") diff --git a/zc-business/src/main/java/com/zc/business/mapper/DcEventMapper.java b/zc-business/src/main/java/com/zc/business/mapper/DcEventMapper.java index 4b0786ae..89f211a9 100644 --- a/zc-business/src/main/java/com/zc/business/mapper/DcEventMapper.java +++ b/zc-business/src/main/java/com/zc/business/mapper/DcEventMapper.java @@ -27,6 +27,8 @@ public interface DcEventMapper extends BaseMapper * @return 事件信息 */ public DcEvent selectDcEventById(String id); + //查询事件主类信息 + public DcEvent selectDcEventMainById(String id); /** * 查询事件信息列表 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 c05eac4e..8bebab43 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 @@ -69,7 +69,7 @@ public interface IDcEventService * @param ids 需要删除的事件信息主键集合 * @return 结果 */ - public int deleteDcEventByIds(int eventType,String[] ids); + public int deleteDcEventByIds(String[] ids); /** * 删除事件信息信息 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 b46f49a2..be673ca6 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 @@ -677,13 +677,10 @@ if (eventType !=3 &&dcEventId == null){//非 事件处置 和收费站等多条 @Override public int updateDcEvent(DcEvent dcEvent) { DcEvent oldEvent = selectEventSubclassById(dcEvent.getEventType().intValue(),dcEvent.getId()); - dcEvent.setUpdateTime(DateUtils.getNowDate()); int i7 = dcEventMapper.updateDcEvent(dcEvent); if (i7 > 0) { - String context = comparisonInfo(oldEvent,dcEvent); - //事件处置流程记录 DcEventProcess dcEventProcess = new DcEventProcess(); dcEventProcess.setEventId(dcEvent.getId()); @@ -691,7 +688,6 @@ if (eventType !=3 &&dcEventId == null){//非 事件处置 和收费站等多条 dcEventProcess.setContext(context); dcEventProcessService.insertDcEventProcess(dcEventProcess); - //中间库 MdEvent mdEvent = new MdEvent(dcEvent); middleDatabaseService.updateMiddleDatabaseEvent(mdEvent); @@ -760,59 +756,62 @@ if (eventType !=3 &&dcEventId == null){//非 事件处置 和收费站等多条 * @return 结果 */ @Override - public int deleteDcEventByIds(int eventType, String[] ids) { - int i7 = dcEventMapper.deleteDcEventByIds(ids); - if (i7 > 0) { - switch (eventType) { - //交通事故 - case 1: - int i1 = dcEventAccidentMapper.deleteDcEventAccidentByIds(ids); - break; - //车辆事故 - case 2: - int i5 = dcEventVehicleAccidentMapper.deleteDcEventVehicleAccidentByIds(ids); - break; - //交通管制 - case 3: - int i6 = dcEventTrafficControlMapper.deleteDcEventTrafficControlByIds(ids); - break; - //交通拥堵 - case 4: - int i4 = dcEventTrafficCongestionMapper.deleteDcEventTrafficCongestionByIds(ids); + public int deleteDcEventByIds(String[] ids) { + int i7=-1; + for (String id : ids) { + DcEvent dcEvent = dcEventMapper.selectDcEventMainById(id); + int eventType = Math.toIntExact(dcEvent.getEventType()); + i7 = dcEventMapper.deleteDcEventById(id); - break; - //非法上路 - case 5: - break; - //路障清除 - case 6: - break; - //施工建设 - case 7: - int i2 = dcEventConstructionMapper.deleteDcEventConstructionByIds(ids); - break; - //服务区异常 - case 8: - int i3 = dcEventServiceAreaMapper.deleteDcEventServiceAreaByIds(ids); - break; - //设施设备隐患 - case 9: - break; - //异常天气 - case 10: - int i = dcEventAbnormalWeatherMapper.deleteDcEventAbnormalWeatherByIds(ids); - break; - //其他事件 - case 11: - break; - // - default: - break; + switch (eventType) { + //交通事故 + case 1: + int i1 = dcEventAccidentMapper.deleteDcEventAccidentById(id); + break; + //车辆事故 + case 2: + int i5 = dcEventVehicleAccidentMapper.deleteDcEventVehicleAccidentById(id); + break; + //交通管制 + case 3: + int i6 = dcEventTrafficControlMapper.deleteDcEventTrafficControlById(id); + break; + //交通拥堵 + case 4: + int i4 = dcEventTrafficCongestionMapper.deleteDcEventTrafficCongestionById(id); + + break; + //非法上路 + case 5: + break; + //路障清除 + case 6: + break; + //施工建设 + case 7: + int i2 = dcEventConstructionMapper.deleteDcEventConstructionById(id); + break; + //服务区异常 + case 8: + int i3 = dcEventServiceAreaMapper.deleteDcEventServiceAreaById(id); + break; + //设施设备隐患 + case 9: + break; + //异常天气 + case 10: + int i = dcEventAbnormalWeatherMapper.deleteDcEventAbnormalWeatherById(id); + break; + //其他事件 + case 11: + break; + // + default: + break; + } } return i7; - } else { - return -1; - } + } /** diff --git a/zc-business/src/main/resources/mapper/business/DcEventMapper.xml b/zc-business/src/main/resources/mapper/business/DcEventMapper.xml index b476cfaf..941597fe 100644 --- a/zc-business/src/main/resources/mapper/business/DcEventMapper.xml +++ b/zc-business/src/main/resources/mapper/business/DcEventMapper.xml @@ -144,9 +144,9 @@ --> - + SELECT id, dc_event.dept_id as dept_id, @@ -500,6 +500,10 @@ where dc_event.id = #{id} +