From 83c2e2522ac0b3d16e5a41194f52272ee77cf819 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=85=B4=E7=90=B3?= <1911390090@qq.com> Date: Tue, 14 May 2024 11:06:30 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B0=94=E8=B1=A1=20=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/DcEventController.java | 11 +++---- .../zc/business/service/IDcEventService.java | 2 +- .../service/impl/DcEventServiceImpl.java | 7 +++-- .../DcMeteorologicalDetectorDataMapper.xml | 29 +++++-------------- 4 files changed, 17 insertions(+), 32 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 0428137a..629bf40c 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 @@ -98,15 +98,12 @@ public class DcEventController extends BaseController @ApiOperation("获取事件以及子类详细信息") //@PreAuthorize("@ss.hasPermi('system:event:query')") - @GetMapping( "/eventSubclass/{eventType}/{id}") - @ApiImplicitParams({ - @ApiImplicitParam(name = "eventType", value = "事件类型", dataType = "int"), - @ApiImplicitParam(name = "id", value = "事件id", dataType = "String"), - }) + @GetMapping( "/eventSubclass/{id}") + @ApiImplicitParams(@ApiImplicitParam(name = "id", value = "事件id", dataType = "String")) - public AjaxResult getEventById(@PathVariable int eventType,@PathVariable("id") String id) + public AjaxResult getEventById(@PathVariable("id") String id) { - DcEvent dcEvent = dcEventService.selectEventSubclassById(eventType,id); + DcEvent dcEvent = dcEventService.selectEventSubclassById(id); return AjaxResult.success(dcEvent); } 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 8bebab43..058a6469 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 @@ -90,7 +90,7 @@ public interface IDcEventService * @param id * @return */ - DcEvent selectEventSubclassById(int eventType, String id); + DcEvent selectEventSubclassById(String id); Map selectCount(); 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 ddb4d66e..485979da 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 @@ -682,7 +682,7 @@ public class DcEventServiceImpl extends ServiceImpl impl } //事件来源校验*/ - DcEvent oldEvent = selectEventSubclassById(dcEvent.getEventType().intValue(), dcEvent.getId()); + DcEvent oldEvent = selectEventSubclassById(dcEvent.getId()); dcEvent.setUpdateTime(DateUtils.getNowDate()); int i7 = dcEventMapper.updateDcEvent(dcEvent); if (i7 > 0) { @@ -850,14 +850,15 @@ public class DcEventServiceImpl extends ServiceImpl impl /** * 获取事件以及子类详细信息 * - * @param eventType + * @param * @param id * @return */ @Override - public DcEvent selectEventSubclassById(int eventType, String id) { + public DcEvent selectEventSubclassById(String id) { // DcEvent dcEvent = dcEventMapper.selectDcEventById(id); + int eventType = Math.toIntExact(dcEvent.getEventType()); List processConfigList = dcProcessConfigMapper.selectDcProcessConfigByEventType(Math.toIntExact(dcEvent.getEventType())); dcEvent.setProcessConfigList(processConfigList); switch (eventType) { diff --git a/zc-business/src/main/resources/mapper/business/DcMeteorologicalDetectorDataMapper.xml b/zc-business/src/main/resources/mapper/business/DcMeteorologicalDetectorDataMapper.xml index 6f4421ab..60e822da 100644 --- a/zc-business/src/main/resources/mapper/business/DcMeteorologicalDetectorDataMapper.xml +++ b/zc-business/src/main/resources/mapper/business/DcMeteorologicalDetectorDataMapper.xml @@ -175,34 +175,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" date;