From 99ebaf1851fa36421b34dfe9bfea7e3018a103fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=85=B4=E7=90=B3?= <1911390090@qq.com> Date: Fri, 24 May 2024 09:35:50 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E4=BA=8B=E4=BB=B6=20=E6=A1=A9=E5=8F=B7?= =?UTF-8?q?=E9=AA=8C=E8=AF=81=E4=BF=AE=E8=AE=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../zc/business/service/impl/DcEventServiceImpl.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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 b89af386..eef85d98 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 @@ -143,10 +143,7 @@ public class DcEventServiceImpl extends ServiceImpl impl public int insertDcEvent(DcEvent dcEvent) { String dcEventId = dcEvent.getId(); - //桩号校验 - if (!com.ruoyi.common.utils.StakeMarkUtils.checkStakeMark(dcEvent.getStakeMark())){ - return -1; - } + //获取事件类型 int eventType = Math.toIntExact(dcEvent.getEventType()); @@ -199,7 +196,10 @@ public class DcEventServiceImpl extends ServiceImpl impl String facilityId = String.valueOf(dcEvent.getDcEventServiceArea().getFacilityId()); dcEvent.setStakeMark(extracted(facilityId)); } - + //桩号校验 + if (!com.ruoyi.common.utils.StakeMarkUtils.checkStakeMark(dcEvent.getStakeMark())){ + return -1; + } int i7 = dcEventMapper.insertDcEvent(dcEvent); From 21263f3ae582afd034e54bbec3bd43be0aaa7569 Mon Sep 17 00:00:00 2001 From: "Mr.Wang" Date: Fri, 24 May 2024 15:14:31 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BA=8B=E4=BB=B6?= =?UTF-8?q?=E7=A1=AE=E8=AE=A4=E6=8E=A5=E5=8F=A3=E4=B8=AD=E7=9A=84=E8=A1=8C?= =?UTF-8?q?=E8=BD=A6=E8=AF=B1=E5=AF=BC=E5=92=8C=E6=BF=80=E5=85=89=E6=8D=A2?= =?UTF-8?q?=E7=96=B2=E5=8A=B3=E8=AE=BE=E5=A4=87=E6=8E=A7=E5=88=B6=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/DcEmergencyPlansServiceImpl.java | 47 ++++++------------- 1 file changed, 15 insertions(+), 32 deletions(-) diff --git a/zc-business/src/main/java/com/zc/business/service/impl/DcEmergencyPlansServiceImpl.java b/zc-business/src/main/java/com/zc/business/service/impl/DcEmergencyPlansServiceImpl.java index 8bca9564..8fd2494e 100644 --- a/zc-business/src/main/java/com/zc/business/service/impl/DcEmergencyPlansServiceImpl.java +++ b/zc-business/src/main/java/com/zc/business/service/impl/DcEmergencyPlansServiceImpl.java @@ -798,40 +798,28 @@ public class DcEmergencyPlansServiceImpl implements DcEmergencyPlansService { if (device.getDeviceType().equals(DeviceTypeConstants.DRIVING_GUIDANCE.toString())) { // 行车诱导 functionId = DeviceFunctionIdConstants.DRIVING_GUIDANCE; - // 控制模式 1-手动 2-自动 3-万年历 + // 控制模式 00-手动 01-自动 02-万年历 String controlModel = otherConfig.get("controlModel").toString(); props.put("onWorkStatus", otherConfig.get("state").toString()); props.put("inWorkStatus", otherConfig.get("state").toString()); props.put("mode", controlModel); JSONObject result = new JSONObject(); - String state = ""; - // 01常亮02流水03闪烁04关闭 - if (otherConfig.get("state").toString().equals("01")) { - state = "常量"; - } else if (otherConfig.get("state").toString().equals("02")) { - state = "流水"; - } else if (otherConfig.get("state").toString().equals("03")) { - state = "闪烁"; - }else { - state = "关闭"; - } + String stateName = otherConfig.get("name").toString(); if (controlModel.equals("01")) { String startTime = otherConfig.get("startTime").toString(); String endTime = otherConfig.get("endTime").toString(); - props.put("mode", "01"); props.put("startDisplayTime", startTime); props.put("endDisplayTime", endTime); - result.put("content","时间自动:"+state+";"+startTime+"-"+endTime); + result.put("content","自动:"+stateName+";时间范围:"+startTime+"-"+endTime); } else if (controlModel.equals("00")) { - result.put("content","手动:"+state); + result.put("content","手动:"+stateName); }else { - result.put("content","万年历:"+state); + result.put("content","万年历:"+stateName); } - - AjaxResult ajaxResult = dcDeviceController.invokedFunction(iotDeviceId, functionId, props); - // 将调用结果存入到 resultArray(操作结果) 中 result.put("device", device.getId()); result.put("deviceName",device.getDeviceName()); + AjaxResult ajaxResult = dcDeviceController.invokedFunction(iotDeviceId, functionId, props); + // 将调用结果存入到 resultArray(操作结果) 中 result.put("result", ajaxResult); resultArray.add(result); @@ -919,14 +907,13 @@ public class DcEmergencyPlansServiceImpl implements DcEmergencyPlansService { } else if (device.getDeviceType().equals(DeviceTypeConstants.LASER_FATIGUE_AWAKENING.toString())) { // 激光疲劳唤醒 - functionId = otherConfig.get("state").toString(); - - AjaxResult ajaxResultState = dcDeviceController.invokedFunction(iotDeviceId, functionId, new HashMap<>()); - JSONObject result = new JSONObject(); - result.put("device", device.getId()); - result.put("deviceName",device.getDeviceName()); - result.put("result", ajaxResultState); - resultArray.add(result); + HashMap map = new HashMap<>(); + map.put("SET",otherConfig.get("operationType").toString()); + JSONObject resultTime = new JSONObject(); + resultTime.put("device", device.getId()); + resultTime.put("deviceName",device.getDeviceName()); + AjaxResult ajaxResultState = dcDeviceController.invokedFunction(iotDeviceId, "SETMD", map); + resultTime.put("resultState", ajaxResultState); // 操作时长 String operationDuration = "SETTM" + otherConfig.get("operationDuration").toString(); @@ -934,12 +921,8 @@ public class DcEmergencyPlansServiceImpl implements DcEmergencyPlansService { HashMap propsTime = new HashMap<>(); propsTime.put("SET", operationDuration); functionId = DeviceFunctionIdConstants.VARIABLE_INFORMATION_FLAG_SETTM; - + resultTime.put("content","状态:"+name+";操作时长"+otherConfig.get("operationDuration")+"分钟"); AjaxResult ajaxResult = dcDeviceController.invokedFunction(iotDeviceId, functionId, propsTime); - JSONObject resultTime = new JSONObject(); - resultTime.put("device", device.getId()); - resultTime.put("deviceName",device.getDeviceName()); - resultTime.put("content","状态:"+name+"操作时长"+otherConfig.get("operationDuration")); resultTime.put("result", ajaxResult); resultArray.add(resultTime); From 6b769a3aa515a6e90b9760614f026ef0865586ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=85=B4=E7=90=B3?= <1911390090@qq.com> Date: Fri, 24 May 2024 18:42:35 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E4=BA=8B=E4=BB=B6=E5=A4=84=E7=BD=AE?= =?UTF-8?q?=E9=A1=B5=20=E5=85=B6=E4=BB=96=E7=AE=A1=E5=88=B6=E4=BA=8B?= =?UTF-8?q?=E4=BB=B6=20=E6=B7=BB=E5=8A=A0=20=E5=85=B3=E8=81=94=E4=BA=8B?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../zc/business/service/impl/DcEventServiceImpl.java | 11 +++++++++++ 1 file changed, 11 insertions(+) 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 eef85d98..7c66a582 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 @@ -435,6 +435,17 @@ public class DcEventServiceImpl extends ServiceImpl impl break; //其他事件 case 11: + if (dcEventId != null) {//首页进入 + + DcEvent dcEvent1 = new DcEvent(); + dcEvent1.setId(dcEventId);//事件id + dcEvent1.setEventNature(1l);//首发事件 + dcEvent1.setLinkId(uuid);//关联管制事件id + dcEventMapper.updateDcEventLinkId(dcEvent1);//修改事件性质 + dcEvent.setEventNature(2l); + dcEventMapper.updateDcEventLinkId(dcEvent);//修改 新添加的 事件性质 + + } break; // default: From e72a53faad5f7fff838f165aa5b6da5bc2a9f27c Mon Sep 17 00:00:00 2001 From: "Mr.Wang" Date: Fri, 24 May 2024 19:33:37 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E8=AE=BE=E5=A4=87=E7=9A=84=E8=B0=83=E7=94=A8=E6=AC=A1=E6=95=B0?= =?UTF-8?q?=E6=A0=B9=E6=8D=AE=E8=AE=BE=E5=A4=87=E7=B1=BB=E5=9E=8B=E5=88=86?= =?UTF-8?q?=E7=BB=84=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../zc/business/controller/DcOperLogController.java | 9 +++++++++ .../com/zc/business/service/IDcOperLogService.java | 6 ++++++ .../business/service/impl/DcOperLogServiceImpl.java | 13 +++++++++++++ 3 files changed, 28 insertions(+) diff --git a/zc-business/src/main/java/com/zc/business/controller/DcOperLogController.java b/zc-business/src/main/java/com/zc/business/controller/DcOperLogController.java index 451a612a..46374c70 100644 --- a/zc-business/src/main/java/com/zc/business/controller/DcOperLogController.java +++ b/zc-business/src/main/java/com/zc/business/controller/DcOperLogController.java @@ -31,6 +31,15 @@ public class DcOperLogController extends BaseController { //*********************************调用功能记录增删改查****************************************** + /** + * 查询设备的调用次数根据设备类型分组 + */ + @ApiOperation("查询设备的调用次数根据设备类型分组") + @GetMapping("count/deviceType") + public AjaxResult countByDeviceType() { + return AjaxResult.success(dcOperLogService.countByDeviceType()); + } + /** * 分页查询列表 * diff --git a/zc-business/src/main/java/com/zc/business/service/IDcOperLogService.java b/zc-business/src/main/java/com/zc/business/service/IDcOperLogService.java index 3be2ff5d..fb4627a2 100644 --- a/zc-business/src/main/java/com/zc/business/service/IDcOperLogService.java +++ b/zc-business/src/main/java/com/zc/business/service/IDcOperLogService.java @@ -6,6 +6,7 @@ import com.zc.business.domain.DcOperLog; import java.util.List; import java.util.Date; +import java.util.Map; /** * 调用功能记录Service接口 @@ -49,4 +50,9 @@ public interface IDcOperLogService extends IService { */ List listDcOperLog(DcOperLog dcOperLog,Date endTime,Date startTime); + /** + * 查询设备的调用次数根据设备类型分组 + */ + List> countByDeviceType(); + } diff --git a/zc-business/src/main/java/com/zc/business/service/impl/DcOperLogServiceImpl.java b/zc-business/src/main/java/com/zc/business/service/impl/DcOperLogServiceImpl.java index dcd70a49..f01fa195 100644 --- a/zc-business/src/main/java/com/zc/business/service/impl/DcOperLogServiceImpl.java +++ b/zc-business/src/main/java/com/zc/business/service/impl/DcOperLogServiceImpl.java @@ -1,6 +1,7 @@ package com.zc.business.service.impl; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.ruoyi.common.utils.PageUtils; import com.zc.business.domain.*; @@ -46,6 +47,18 @@ public class DcOperLogServiceImpl extends ServiceImpl> countByDeviceType() { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.select("COUNT(dc_device_type) as deviceCount", "dc_device_type") + .ne("dc_device_type", "") + .groupBy("dc_device_type"); + return listMaps(queryWrapper); + } + private static LambdaQueryWrapper getDcOperLogLambdaQueryWrapper(DcOperLog dcOperLog, Date endTime, Date startTime) { LambdaQueryWrapper lambdaQueryWrapper = new LambdaQueryWrapper<>(); if (dcOperLog.getId() != null) {