From 21263f3ae582afd034e54bbec3bd43be0aaa7569 Mon Sep 17 00:00:00 2001 From: "Mr.Wang" Date: Fri, 24 May 2024 15:14:31 +0800 Subject: [PATCH 01/12] =?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 02/12] =?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 03/12] =?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) { From f800d2c52538c06e78841fb137a79ff5331fcc87 Mon Sep 17 00:00:00 2001 From: wangsixiang <2970484253@qq.com> Date: Fri, 24 May 2024 19:46:52 +0800 Subject: [PATCH 04/12] =?UTF-8?q?=E4=BF=A1=E6=81=AF=E5=8F=91=E5=B8=83?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/zc/business/domain/DcWarning.java | 52 +++++++++---------- .../mapper/DcPublishManageMapper.java | 19 +++---- .../business/service/impl/MsmServiceImpl.java | 5 +- .../mapper/business/DcPublishManageMapper.xml | 4 +- 4 files changed, 40 insertions(+), 40 deletions(-) diff --git a/zc-business/src/main/java/com/zc/business/domain/DcWarning.java b/zc-business/src/main/java/com/zc/business/domain/DcWarning.java index ad73d6c4..dac0720c 100644 --- a/zc-business/src/main/java/com/zc/business/domain/DcWarning.java +++ b/zc-business/src/main/java/com/zc/business/domain/DcWarning.java @@ -10,7 +10,7 @@ import com.ruoyi.common.core.domain.BaseEntity; /** * 预警信息对象 dc_warning - * + * * @author ruoyi * @date 2024-01-13 */ @@ -56,14 +56,13 @@ public class DcWarning extends BaseEntity private Integer warningType; /** 事件子类:1-1 拥堵1-2 缓行 */ - @Excel(name = "事件子类", readConverterExp ="1-1-拥堵,1-2=缓行,2-1=普通行人,2-2=工作人员,3-1=摩托车,3-2=自行车,3-3=三轮车,4-1=非工程车,4-2=工程车,4-3=主路有车,4-4=匝道有车,4-5=车辆故障(弃用),4-6=交通事故(弃用),4-7=应急车道被占用,4-8=车离开应急车道,4-9=其他,4-10=未知车辆,5-1=倒车/逆行,5-2=压线,5-3=掉头,5-4=超速,5-5=低速,5-6=违规变道,5-7=未保持安全距离,6-1=烟火,6-2=火灾,6-3=障碍物,6-4=抛洒物,7-1=道路施工,8-1=雨,8-2=冰雹,8-3=风,8-4=雾,8-5=高温,8-6=积水,8-7=路面湿滑,8-8=路面结冰,8-9=道路能见度低,8-10=道路团雾,9-1=只碰撞不倾斜,9-2=只倾斜无碰撞,9-3=碰撞后倾斜,10-1=未知,10-2单车事故,10-3=多车事故,11-1=车辆抛锚,11-2=车辆炸胎(有备胎),11-2=车辆炸胎(无备胎),99-1=其它") + @Excel(name = "事件子类", readConverterExp ="1-1=拥堵,1-2=缓行,2-1=普通行人,2-2=工作人员,3-1=摩托车,3-2=自行车,3-3=三轮车,4-1=非工程车,4-2=工程车,4-3=主路有车,4-4=匝道有车,4-5=车辆故障(弃用),4-6=交通事故(弃用),4-7=应急车道被占用,4-8=车离开应急车道,4-9=其他,4-10=未知车辆,5-1=倒车/逆行,5-2=压线,5-3=掉头,5-4=超速,5-5=低速,5-6=违规变道,5-7=未保持安全距离,6-1=烟火,6-2=火灾,6-3=障碍物,6-4=抛洒物,7-1=道路施工,8-1=雨,8-2=冰雹,8-3=风,8-4=雾,8-5=高温,8-6=积水,8-7=路面湿滑,8-8=路面结冰,8-9=道路能见度低,8-10=道路团雾,9-1=只碰撞不倾斜,9-2=只倾斜无碰撞,9-3=碰撞后倾斜,10-1=未知,10-2单车事故,10-3=多车事故,11-1=车辆抛锚,11-2=车辆炸胎(有备胎),11-2=车辆炸胎(无备胎),99-1=其它") private String warningSubclass; /** 事件解除原因 */ - @Excel(name = "事件解除原因") private String relieveReason; /** 事件解除类型: 1-误报解除2-事件已结束3-无需处理事件4-其它 */ - @Excel(name = "信息来源", readConverterExp = "1=误报解除2,2=事件已结束3,3=无需处理事件,4=其它") + //@Excel(name = "事件解除类型", readConverterExp = "1=误报解除2,2=事件已结束3,3=无需处理事件,4=其它") private Integer relieveType; @@ -90,7 +89,6 @@ public class DcWarning extends BaseEntity private String latitude; /** 车辆类型 */ - //@Excel(name = "车辆类型") private String vehicleType; /** 持续时长 */ private int duration; @@ -302,102 +300,102 @@ public class DcWarning extends BaseEntity { return stakeMark; } - public void setDirection(String direction) + public void setDirection(String direction) { this.direction = direction; } - public String getDirection() + public String getDirection() { return direction; } - public void setDeptId(Long deptId) + public void setDeptId(Long deptId) { this.deptId = deptId; } - public Long getDeptId() + public Long getDeptId() { return deptId; } - public void setWarningState(Integer warningState) + public void setWarningState(Integer warningState) { this.warningState = warningState; } - public Integer getWarningState() + public Integer getWarningState() { return warningState; } - public void setWarningTime(Date warningTime) + public void setWarningTime(Date warningTime) { this.warningTime = warningTime; } - public Date getWarningTime() + public Date getWarningTime() { return warningTime; } - public void setUserId(Long userId) + public void setUserId(Long userId) { this.userId = userId; } - public Long getUserId() + public Long getUserId() { return userId; } - public void setWarningSource(Integer warningSource) + public void setWarningSource(Integer warningSource) { this.warningSource = warningSource; } - public Integer getWarningSource() + public Integer getWarningSource() { return warningSource; } - public void setWarningLevel(Integer warningLevel) + public void setWarningLevel(Integer warningLevel) { this.warningLevel = warningLevel; } - public Integer getWarningLevel() + public Integer getWarningLevel() { return warningLevel; } - public void setWarningType(Integer warningType) + public void setWarningType(Integer warningType) { this.warningType = warningType; } - public Integer getWarningType() + public Integer getWarningType() { return warningType; } - public void setWarningSubclass(String warningSubclass) + public void setWarningSubclass(String warningSubclass) { this.warningSubclass = warningSubclass; } - public String getWarningSubclass() + public String getWarningSubclass() { return warningSubclass; } - public void setWarningTitle(String warningTitle) + public void setWarningTitle(String warningTitle) { this.warningTitle = warningTitle; } - public String getWarningTitle() + public String getWarningTitle() { return warningTitle; } - public void setOtherConfig(String otherConfig) + public void setOtherConfig(String otherConfig) { this.otherConfig = otherConfig; } - public String getOtherConfig() + public String getOtherConfig() { return otherConfig; } diff --git a/zc-business/src/main/java/com/zc/business/mapper/DcPublishManageMapper.java b/zc-business/src/main/java/com/zc/business/mapper/DcPublishManageMapper.java index 8a2f318f..d30f429d 100644 --- a/zc-business/src/main/java/com/zc/business/mapper/DcPublishManageMapper.java +++ b/zc-business/src/main/java/com/zc/business/mapper/DcPublishManageMapper.java @@ -3,19 +3,20 @@ package com.zc.business.mapper; import java.util.HashMap; import java.util.List; import com.zc.business.domain.DcPublishManage; +import com.zc.business.domain.DcPublishingChannels; import org.apache.ibatis.annotations.Param; /** * 信息发布管理记录Mapper接口 - * + * * @author ruoyi * @date 2024-04-19 */ -public interface DcPublishManageMapper +public interface DcPublishManageMapper { /** * 查询信息发布管理记录 - * + * * @param id 信息发布管理记录主键 * @return 信息发布管理记录 */ @@ -23,7 +24,7 @@ public interface DcPublishManageMapper /** * 查询信息发布管理记录列表 - * + * * @param dcPublishManage 信息发布管理记录 * @return 信息发布管理记录集合 */ @@ -32,7 +33,7 @@ public interface DcPublishManageMapper List selectEventDcPublishManageList(DcPublishManage dcPublishManage); /** * 新增信息发布管理记录 - * + * * @param dcPublishManage 信息发布管理记录 * @return 结果 */ @@ -40,7 +41,7 @@ public interface DcPublishManageMapper /** * 修改信息发布管理记录 - * + * * @param dcPublishManage 信息发布管理记录 * @return 结果 */ @@ -48,7 +49,7 @@ public interface DcPublishManageMapper /** * 删除信息发布管理记录 - * + * * @param id 信息发布管理记录主键 * @return 结果 */ @@ -61,7 +62,7 @@ public interface DcPublishManageMapper int deleteDisPath(String eventId); /** * 批量删除信息发布管理记录 - * + * * @param ids 需要删除的数据主键集合 * @return 结果 */ @@ -69,7 +70,7 @@ public interface DcPublishManageMapper //查询交通事件类型 public Integer selectEventType(@Param("eventId")String eventId); //获取发布渠道信息 - public DcPublishManage selectPublishManage(@Param("dataCategory")Integer dataCategory); + public DcPublishingChannels selectPublishManage(@Param("dataCategory")Integer dataCategory); //查询信息发布列表 public List> selectDcPublishManageListMap(DcPublishManage dcPublishManage); //统计今日发布渠道分析 diff --git a/zc-business/src/main/java/com/zc/business/service/impl/MsmServiceImpl.java b/zc-business/src/main/java/com/zc/business/service/impl/MsmServiceImpl.java index 6cda816c..e2c3fe23 100644 --- a/zc-business/src/main/java/com/zc/business/service/impl/MsmServiceImpl.java +++ b/zc-business/src/main/java/com/zc/business/service/impl/MsmServiceImpl.java @@ -14,6 +14,7 @@ import com.ruoyi.common.utils.SecurityUtils; import com.ruoyi.common.utils.spring.SpringUtils; import com.zc.business.domain.DcEventProcess; import com.zc.business.domain.DcPublishManage; +import com.zc.business.domain.DcPublishingChannels; import com.zc.business.mapper.DcPublishManageMapper; import com.zc.business.service.IMsmService; import com.zc.business.utils.HttpUtil; @@ -220,7 +221,7 @@ public class MsmServiceImpl implements IMsmService { String eventId = map.get("eventId").toString();//事件id String content = map.get("content").toString();//信息内容 Integer eventType = dcPublishManageMapper.selectEventType(eventId);//事件类型 - DcPublishManage publishManage = dcPublishManageMapper.selectPublishManage(eventType);//渠道信息 + DcPublishingChannels publishManage = dcPublishManageMapper.selectPublishManage(eventType);//渠道信息 if (publishManage!=null){ dcPublishManage.setPublishChannelsId(publishManage.getId());//渠道id } @@ -276,4 +277,4 @@ public class MsmServiceImpl implements IMsmService { dcEventProcessService.insertDcEventProcess(dcEventProcess); return AjaxResult.success(message + weiXin); } -} \ No newline at end of file +} diff --git a/zc-business/src/main/resources/mapper/business/DcPublishManageMapper.xml b/zc-business/src/main/resources/mapper/business/DcPublishManageMapper.xml index 8daeb9a2..49a8b5c3 100644 --- a/zc-business/src/main/resources/mapper/business/DcPublishManageMapper.xml +++ b/zc-business/src/main/resources/mapper/business/DcPublishManageMapper.xml @@ -88,8 +88,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - + select id,publish_channels publishChannels from dc_publishing_channels where enabled=2 and data_category=#{dataCategory} + + + +