From 73c82111f89911e2588ea6202c39a67a0dc41c8e Mon Sep 17 00:00:00 2001 From: lau572 <1010031226@qq.com> Date: Mon, 29 Apr 2024 09:07:05 +0800 Subject: [PATCH 01/60] =?UTF-8?q?=E6=83=85=E6=8A=A5=E6=9D=BF=E5=8F=91?= =?UTF-8?q?=E7=89=88=E8=AE=B0=E5=BD=95=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/resources/mapper/business/DcBoardReleaseLogMapper.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/zc-business/src/main/resources/mapper/business/DcBoardReleaseLogMapper.xml b/zc-business/src/main/resources/mapper/business/DcBoardReleaseLogMapper.xml index 7be095d3..697be257 100644 --- a/zc-business/src/main/resources/mapper/business/DcBoardReleaseLogMapper.xml +++ b/zc-business/src/main/resources/mapper/business/DcBoardReleaseLogMapper.xml @@ -32,6 +32,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and t1.device_id = #{deviceId} + and t2.direction = #{direction} and t2.device_name like concat('%', #{deviceName}, '%') and t1.release_content = #{releaseContent} and t1.release_status = #{releaseStatus} From b71d654e8761d510a8f2c8ee9d689e2596fab137 Mon Sep 17 00:00:00 2001 From: zhaoxianglong Date: Mon, 29 Apr 2024 17:52:38 +0800 Subject: [PATCH 02/60] =?UTF-8?q?=E4=BC=98=E5=8C=96=E7=AE=A1=E6=8E=A7?= =?UTF-8?q?=E8=AE=B0=E5=BD=95=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/DcDeviceController.java | 1 - .../controller/DcOperLogController.java | 4 +- .../business/domain/DcBatchFunctionsJob.java | 5 +- .../interfaces/OperationLogAspect.java | 118 ++++-------------- .../DcBatchFunctionsJobGroupServiceImpl.java | 1 + .../impl/DcBatchFunctionsJobServiceImpl.java | 2 +- 6 files changed, 30 insertions(+), 101 deletions(-) diff --git a/zc-business/src/main/java/com/zc/business/controller/DcDeviceController.java b/zc-business/src/main/java/com/zc/business/controller/DcDeviceController.java index bb41e2b5..dd305ca3 100644 --- a/zc-business/src/main/java/com/zc/business/controller/DcDeviceController.java +++ b/zc-business/src/main/java/com/zc/business/controller/DcDeviceController.java @@ -501,7 +501,6 @@ public class DcDeviceController extends BaseController { if (!Objects.equals(String.valueOf(ajaxResult.get("code")), "200")) { return AjaxResult.error(); } - } } return AjaxResult.success(resultArray); 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 789580f5..451a612a 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 @@ -40,7 +40,7 @@ public class DcOperLogController extends BaseController { @ApiOperation("分页查询列表") @PreAuthorize("@ss.hasPermi('iot:facility:list')") @GetMapping("list") - public TableDataInfo listFacility(DcOperLog dcOperLog,@RequestParam(value = "endTime", required = false)Date endTime,@RequestParam(value = "startTime", required = false)Date startTime) { + public TableDataInfo listFacility( DcOperLog dcOperLog,@RequestParam(value = "endTime", required = false)Date endTime,@RequestParam(value = "startTime", required = false)Date startTime) { return getDataTable(dcOperLogService.pageDcOperLog(dcOperLog,endTime,startTime)); } @@ -53,7 +53,7 @@ public class DcOperLogController extends BaseController { @ApiOperation("无分页查询列表") @PreAuthorize("@ss.hasPermi('iot:facility:query')") @GetMapping("query") - public AjaxResult queryFacility(DcOperLog dcOperLog, @RequestParam(value = "endTime", required = false) Date endTime, @RequestParam(value = "startTime", required = false)Date startTime) { + public AjaxResult queryFacility( DcOperLog dcOperLog, @RequestParam(value = "endTime", required = false) Date endTime, @RequestParam(value = "startTime", required = false)Date startTime) { return AjaxResult.success(dcOperLogService.listDcOperLog(dcOperLog,endTime,startTime)); } diff --git a/zc-business/src/main/java/com/zc/business/domain/DcBatchFunctionsJob.java b/zc-business/src/main/java/com/zc/business/domain/DcBatchFunctionsJob.java index ea43a28f..3b896fb1 100644 --- a/zc-business/src/main/java/com/zc/business/domain/DcBatchFunctionsJob.java +++ b/zc-business/src/main/java/com/zc/business/domain/DcBatchFunctionsJob.java @@ -1,6 +1,7 @@ package com.zc.business.domain; import com.baomidou.mybatisplus.annotation.TableField; +import com.ruoyi.common.annotation.Excel; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @@ -15,8 +16,8 @@ public class DcBatchFunctionsJob { private Long jobId; @ApiModelProperty("任务组ID") private String jobGroup; - //@Excel(name = "任务名称") - @TableField(exist = false) + @Excel(name = "任务名称") + //@TableField(exist = false) private String jobName; @ApiModelProperty("调用目标字符串") private String invokeTarget; diff --git a/zc-business/src/main/java/com/zc/business/interfaces/OperationLogAspect.java b/zc-business/src/main/java/com/zc/business/interfaces/OperationLogAspect.java index d2b38529..72f02414 100644 --- a/zc-business/src/main/java/com/zc/business/interfaces/OperationLogAspect.java +++ b/zc-business/src/main/java/com/zc/business/interfaces/OperationLogAspect.java @@ -129,34 +129,13 @@ public class OperationLogAspect { request = null; } - AjaxResult proceed = (AjaxResult) joinPoint.proceed(pointArgs); - //String jsonResultString = ""; - //JSONArray jsonArray = (JSONArray) proceed; - //for (Object o : jsonArray) { - // JSONObject jsonObject = (JSONObject) o; - // if (Objects.equals(jsonObject.getString("code"), "200")) { - // JSONArray data = jsonObject.getJSONArray("data"); - // for (Object datum : data) { - // JSONObject results = (JSONObject) datum; - // JSONObject result = results.getJSONObject("result"); - // if (Objects.equals(result.getString("code"), "200")) { - // jsonResultString = "设备"+d+""; - // } - // } - // } - //} SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); String date = df.format(new Date()); String sta = ""; - if (Objects.equals(state, "0")&&Objects.equals(String.valueOf(proceed.get("code")), "200")) { - //if (Objects.equals(String.valueOf(proceed.get("code")), "200")) { - operLog.setStatus(0); - sta = "成功"; - //} else { - // operLog.setStatus(1); - // sta = "失败"; - //} + if (Objects.equals(state, "0") && Objects.equals(String.valueOf(((AjaxResult)jsonResult).get("code")), "200")) { + operLog.setStatus(0); + sta = "成功"; } else { operLog.setStatus(1); sta = "失败"; @@ -164,26 +143,18 @@ public class OperationLogAspect { ArrayList deviceIds = new ArrayList<>(); ArrayList deviceNames = new ArrayList<>(); - //ArrayList functionIds = new ArrayList<>(); String deviceType = ""; StringBuilder remark = new StringBuilder("在" + date + "调用"); if (operUrl.contains("batchFunctions")) { //批量调用 + JSONObject pointArg = null; + if (pointArgs[0] instanceof JSONObject){ + pointArg = (JSONObject) pointArgs[0]; + }else { + pointArg = (JSONObject) JSON.toJSON(pointArgs[0]); + } + - //if (loginUser != null) { - // SysDept sysDept = deptService.selectDeptById(loginUser.getDeptId()); - // - // dcOperLog.setOperName(loginUser.getUsername()); - // dcOperLog.setDeptName(sysDept.getDeptName()); - // dcOperLog.setOperLocation(loginUser.getLoginLocation()); - // dcOperLog.setOperType("2"); - //} else { - // dcOperLog.setOperType("1"); - //} - //dcOperLog.setOperIp(IpUtils.getIpAddr(request)); - //dcOperLog.setOperTime(new Date()); - - JSONObject pointArg = (JSONObject) pointArgs[0]; JSONArray devices = pointArg.getJSONArray("devices"); JSONArray functions = pointArg.getJSONArray("functions"); @@ -230,7 +201,6 @@ public class OperationLogAspect { } } - if (loginUser != null) { SysDept sysDept = deptService.selectDeptById(loginUser.getDeptId()); @@ -241,21 +211,26 @@ public class OperationLogAspect { } else { operLog.setOperType("1"); } - operLog.setOperParam((Arrays.toString(pointArgs))); + + JSONArray jsonArray = (JSONArray) JSON.toJSON(pointArgs); + + operLog.setOperParam(String.valueOf(jsonArray)); operLog.setDcDeviceId(deviceIds.toString()); operLog.setDcDeviceName(deviceNames.toString()); operLog.setOperIp(IpUtils.getIpAddr(request)); operLog.setOperTime(new Date()); operLog.setDcDeviceType(deviceType); operLog.setRemark(remark.toString()); - operLog.setJsonResult(String.valueOf(proceed)); + operLog.setJsonResult(jsonResult.toString()); dcOperLogService.addDcOperLog(operLog); - } else if (operUrl.contains("functions")) { + LambdaQueryWrapper lambdaQueryWrapper = new LambdaQueryWrapper<>(); lambdaQueryWrapper.eq(DcDevice::getIotDeviceId, pointArgs[0]); - DcDevice dcDevice = dcDeviceService.getById(Long.valueOf(String.valueOf(pointArgs[0]))); + List list = dcDeviceService.list(lambdaQueryWrapper); + DcDevice dcDevice = list.get(0); + if (!Objects.isNull(dcDevice)) { Long deviceId = dcDevice.getId(); @@ -271,7 +246,6 @@ public class OperationLogAspect { remark.append(deviceName).append("的").append(hashMap).append("功能并且调用").append(sta).append("了"); - if (loginUser != null) { SysDept sysDept = deptService.selectDeptById(loginUser.getDeptId()); operLog.setOperName(loginUser.getUsername()); @@ -281,7 +255,10 @@ public class OperationLogAspect { } else { operLog.setOperType("1"); } - operLog.setOperParam((Arrays.toString(pointArgs))); + + JSONObject pointArg = (JSONObject) JSON.toJSON(pointArgs); + + operLog.setOperParam(String.valueOf(pointArg)); operLog.setDcDeviceId(deviceIds.toString()); operLog.setDcDeviceName(deviceNames.toString()); operLog.setOperIp(IpUtils.getIpAddr(request)); @@ -290,55 +267,6 @@ public class OperationLogAspect { operLog.setJsonResult(remark.toString()); dcOperLogService.addDcOperLog(operLog); - - // - ////DcDevice dcDevice = list.get(0); - //operLog.setDcDeviceId(String.valueOf(dcDevice.getId())); - //operLog.setDcDeviceName(dcDevice.getDeviceName()); - //deviceType = dcDevice.getDeviceType(); - //operLog.setDcDeviceType(deviceType); - //if (loginUser != null) { - // SysDept sysDept = deptService.selectDeptById(loginUser.getDeptId()); - // - // dcOperLog.setOperName(loginUser.getUsername()); - // dcOperLog.setDeptName(sysDept.getDeptName()); - // dcOperLog.setOperLocation(loginUser.getLoginLocation()); - // dcOperLog.setOperType("0"); - //} else { - // dcOperLog.setOperType("1"); - //} - //dcOperLog.setOperIp(IpUtils.getIpAddr(request)); - //dcOperLog.setOperParam(Arrays.toString(pointArgs)); - //dcOperLog.setJsonResult("设备" + dcDevice.getDeviceName() + "在" + date + "调用了" + hashMap + "功能并且调用" + sta + "了"); - ////dcOperLog.setJsonResult(dcDevice.getDeviceName() + "设备在" + date + "调用" + sta + "ID为" + dcDevice.getId() + "的设备功能标识为" + pointArgs[1].toString() + "的方法"); - //dcOperLog.setOperTime(new Date()); - //dcOperLogService.addDcOperLog(dcOperLog); - // - // - //String remark = "设备在" + date + "调用" + sta + "ID为" + deviceIds + "的设备功能标识为" + functionIds + "的方法"; - //System.out.println(remark); - //System.out.println(deviceIds.toString()); - //System.out.println(functionIds.toString()); - //DcOperLog operLog = new DcOperLog(); - //SysDept sysDept = deptService.selectDeptById(loginUser.getDeptId()); - //operLog.setOperParam((Arrays.toString(pointArgs))); - //operLog.setOperLocation(loginUser.getLoginLocation()); - //operLog.setOperName(loginUser.getUsername()); - //operLog.setDeptName(sysDept.getDeptName()); - //operLog.setDcDeviceId(deviceIds.toString()); - //operLog.setOperType("2"); - //operLog.setOperIp(IpUtils.getIpAddr(request)); - //operLog.setOperTime(new Date()); - //operLog.setDcDeviceType(deviceType); - //operLog.setJsonResult(remark); - //if (Objects.equals(state, "0")) { - // operLog.setStatus(0); - //} else { - // operLog.setStatus(1); - //} - //dcOperLogService.addDcOperLog(operLog); - - } } diff --git a/zc-business/src/main/java/com/zc/business/service/impl/DcBatchFunctionsJobGroupServiceImpl.java b/zc-business/src/main/java/com/zc/business/service/impl/DcBatchFunctionsJobGroupServiceImpl.java index 46f8bc39..43642183 100644 --- a/zc-business/src/main/java/com/zc/business/service/impl/DcBatchFunctionsJobGroupServiceImpl.java +++ b/zc-business/src/main/java/com/zc/business/service/impl/DcBatchFunctionsJobGroupServiceImpl.java @@ -113,6 +113,7 @@ public class DcBatchFunctionsJobGroupServiceImpl extends ServiceImpl dcBatchFunctionsJobs = dcBatchFunctionsJobService.listDcBatchFunctionsJob(dcBatchFunctionsJob); for (DcBatchFunctionsJob batchFunctionsJob : dcBatchFunctionsJobs) { + batchFunctionsJob.setJobName(dcBatchFunctionsJobGroup.getGroupName()); boolean changeStatus = dcBatchFunctionsJobService.changeStatus(batchFunctionsJob, dcBatchFunctionsJobGroup.getStatus()); if (!changeStatus) { return false; diff --git a/zc-business/src/main/java/com/zc/business/service/impl/DcBatchFunctionsJobServiceImpl.java b/zc-business/src/main/java/com/zc/business/service/impl/DcBatchFunctionsJobServiceImpl.java index 02f366f3..1f001728 100644 --- a/zc-business/src/main/java/com/zc/business/service/impl/DcBatchFunctionsJobServiceImpl.java +++ b/zc-business/src/main/java/com/zc/business/service/impl/DcBatchFunctionsJobServiceImpl.java @@ -62,6 +62,7 @@ public class DcBatchFunctionsJobServiceImpl extends ServiceImpl detaileds = detailedConfigurations.stream().filter(detailed -> Objects.equals((String) ((JSONObject) detailed).get("time"), time) From cc7315e09c27cf5ebd00e8b3d783d1c607a6dbbb Mon Sep 17 00:00:00 2001 From: zhaoxianglong Date: Mon, 29 Apr 2024 17:59:34 +0800 Subject: [PATCH 03/60] =?UTF-8?q?=E4=BC=98=E5=8C=96=E7=AE=A1=E6=8E=A7?= =?UTF-8?q?=E8=AE=B0=E5=BD=95=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/zc/business/interfaces/OperationLogAspect.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/zc-business/src/main/java/com/zc/business/interfaces/OperationLogAspect.java b/zc-business/src/main/java/com/zc/business/interfaces/OperationLogAspect.java index 72f02414..297dc489 100644 --- a/zc-business/src/main/java/com/zc/business/interfaces/OperationLogAspect.java +++ b/zc-business/src/main/java/com/zc/business/interfaces/OperationLogAspect.java @@ -251,14 +251,14 @@ public class OperationLogAspect { operLog.setOperName(loginUser.getUsername()); operLog.setDeptName(sysDept.getDeptName()); operLog.setOperLocation(loginUser.getLoginLocation()); - operLog.setOperType("2"); + operLog.setOperType("0"); } else { operLog.setOperType("1"); } - JSONObject pointArg = (JSONObject) JSON.toJSON(pointArgs); + JSONArray jsonArray = (JSONArray) JSON.toJSON(pointArgs); - operLog.setOperParam(String.valueOf(pointArg)); + operLog.setOperParam(String.valueOf(jsonArray)); operLog.setDcDeviceId(deviceIds.toString()); operLog.setDcDeviceName(deviceNames.toString()); operLog.setOperIp(IpUtils.getIpAddr(request)); From 3c14dc0fd3ed3a658f4ca2e2c1df82cfcc86e647 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, 6 May 2024 10:39:19 +0800 Subject: [PATCH 04/60] =?UTF-8?q?=E6=A0=B9=E6=8D=AE=E8=AE=BE=E5=A4=87?= =?UTF-8?q?=E5=90=8D=E7=A7=B0=E6=9F=A5=E8=AF=A2=E6=B0=94=E8=B1=A1=E8=AF=A6?= =?UTF-8?q?=E7=BB=86=E4=BF=A1=E6=81=AF=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DcMeteorologicalDetectorController.java | 7 +++++ .../domain/DcMeteorologicalDetectorData.java | 10 +++++++ .../DcMeteorologicalDetectorDataMapper.java | 7 +++++ .../IDcMeteorologicalDetectorDataService.java | 7 +++++ ...MeteorologicalDetectorDataServiceImpl.java | 10 +++++++ .../DcMeteorologicalDetectorDataMapper.xml | 29 +++++++++++++++++++ 6 files changed, 70 insertions(+) diff --git a/zc-business/src/main/java/com/zc/business/controller/DcMeteorologicalDetectorController.java b/zc-business/src/main/java/com/zc/business/controller/DcMeteorologicalDetectorController.java index 4eaaf8d2..cd526d05 100644 --- a/zc-business/src/main/java/com/zc/business/controller/DcMeteorologicalDetectorController.java +++ b/zc-business/src/main/java/com/zc/business/controller/DcMeteorologicalDetectorController.java @@ -32,6 +32,13 @@ public class DcMeteorologicalDetectorController extends BaseController { List> list = dcMeteorologicalDetectorDataService.selectStatistics(deviceName); return getDataTable(list); } + @ApiOperation("根据设备名称查询详细信息列表") + @GetMapping("/device/{deviceName}") + public TableDataInfo deviceNameList(@PathVariable("deviceName") String deviceName) + { + List list = dcMeteorologicalDetectorDataService.selectDeviceNameList(deviceName); + return getDataTable(list); + } @ApiOperation("统计气象设备当天最新信息列表") @GetMapping("/listLatest") public TableDataInfo listAll(DcMeteorologicalDetectorData dcMeteorologicalDetectorData) diff --git a/zc-business/src/main/java/com/zc/business/domain/DcMeteorologicalDetectorData.java b/zc-business/src/main/java/com/zc/business/domain/DcMeteorologicalDetectorData.java index a3608d70..1aea8102 100644 --- a/zc-business/src/main/java/com/zc/business/domain/DcMeteorologicalDetectorData.java +++ b/zc-business/src/main/java/com/zc/business/domain/DcMeteorologicalDetectorData.java @@ -125,6 +125,16 @@ public class DcMeteorologicalDetectorData extends BaseEntity @TableField(exist = false) private String stakeMarkRange; + @ApiModelProperty("安装位置") + @TableField(exist = false) + private String installationSite; + @ApiModelProperty("其他配置")//USRegal + @TableField(exist = false) + private String otherConfig; + @ApiModelProperty("所属网段")//USRegal + @TableField(exist = false) + private String networkSegment; + // "rainfall": 0, // "visibility": "05.000", // "remoteRoadSurfaceTemperature": 11.5, diff --git a/zc-business/src/main/java/com/zc/business/mapper/DcMeteorologicalDetectorDataMapper.java b/zc-business/src/main/java/com/zc/business/mapper/DcMeteorologicalDetectorDataMapper.java index 50cbebc2..cd75db0a 100644 --- a/zc-business/src/main/java/com/zc/business/mapper/DcMeteorologicalDetectorDataMapper.java +++ b/zc-business/src/main/java/com/zc/business/mapper/DcMeteorologicalDetectorDataMapper.java @@ -67,4 +67,11 @@ public interface DcMeteorologicalDetectorDataMapper List selectlistAll(DcMeteorologicalDetectorData dcMeteorologicalDetectorData); List selectlistVisibility(DcMeteorologicalDetectorData dcMeteorologicalDetectorData); + + /** + * 根据设备名称查询详细信息列表 + * @param deviceName + * @return + */ + List selectDeviceNameList(String deviceName); } diff --git a/zc-business/src/main/java/com/zc/business/service/IDcMeteorologicalDetectorDataService.java b/zc-business/src/main/java/com/zc/business/service/IDcMeteorologicalDetectorDataService.java index ca7cb92a..a01e5986 100644 --- a/zc-business/src/main/java/com/zc/business/service/IDcMeteorologicalDetectorDataService.java +++ b/zc-business/src/main/java/com/zc/business/service/IDcMeteorologicalDetectorDataService.java @@ -67,4 +67,11 @@ public interface IDcMeteorologicalDetectorDataService List selectlistAll(DcMeteorologicalDetectorData dcMeteorologicalDetectorData); List selectlistVisibility(DcMeteorologicalDetectorData dcMeteorologicalDetectorData); + + /** + * 根据设备名称查询详细信息列表 + * @param deviceName + * @return + */ + List selectDeviceNameList(String deviceName); } diff --git a/zc-business/src/main/java/com/zc/business/service/impl/DcMeteorologicalDetectorDataServiceImpl.java b/zc-business/src/main/java/com/zc/business/service/impl/DcMeteorologicalDetectorDataServiceImpl.java index 887d86a2..51cdff13 100644 --- a/zc-business/src/main/java/com/zc/business/service/impl/DcMeteorologicalDetectorDataServiceImpl.java +++ b/zc-business/src/main/java/com/zc/business/service/impl/DcMeteorologicalDetectorDataServiceImpl.java @@ -115,4 +115,14 @@ public class DcMeteorologicalDetectorDataServiceImpl implements IDcMeteorologica public List selectlistVisibility(DcMeteorologicalDetectorData dcMeteorologicalDetectorData) { return dcMeteorologicalDetectorDataMapper.selectlistVisibility(dcMeteorologicalDetectorData); } + + /** + * 根据设备名称查询详细信息列表 + * @param deviceName + * @return + */ + @Override + public List selectDeviceNameList(String deviceName) { + return dcMeteorologicalDetectorDataMapper.selectDeviceNameList(deviceName); + } } diff --git a/zc-business/src/main/resources/mapper/business/DcMeteorologicalDetectorDataMapper.xml b/zc-business/src/main/resources/mapper/business/DcMeteorologicalDetectorDataMapper.xml index 7250028c..94f1781a 100644 --- a/zc-business/src/main/resources/mapper/business/DcMeteorologicalDetectorDataMapper.xml +++ b/zc-business/src/main/resources/mapper/business/DcMeteorologicalDetectorDataMapper.xml @@ -26,6 +26,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + + + + @@ -193,6 +198,30 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" d.device_type = 3 ORDER BY d.stake_mark ASC; + + + + + + + + \ No newline at end of file From 1d5958b4958a5de26cfdb0e54dc1b24b6912f0be Mon Sep 17 00:00:00 2001 From: zhaoxianglong Date: Tue, 7 May 2024 08:28:46 +0800 Subject: [PATCH 06/60] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=9C=B0=E5=8C=BA?= =?UTF-8?q?=E4=BF=A1=E6=81=AFController=20=E4=BC=98=E5=8C=96=E7=AE=A1?= =?UTF-8?q?=E6=8E=A7=E8=AE=B0=E5=BD=95=E7=B1=BB=E5=9E=8B=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/DcDeviceController.java | 3 + .../controller/DcRegionController.java | 118 ++++++++++++++++++ .../interfaces/OperationLogAspect.java | 13 +- .../task/ScheduledTaskSchedulingTask.java | 1 + 4 files changed, 131 insertions(+), 4 deletions(-) create mode 100644 zc-business/src/main/java/com/zc/business/controller/DcRegionController.java diff --git a/zc-business/src/main/java/com/zc/business/controller/DcDeviceController.java b/zc-business/src/main/java/com/zc/business/controller/DcDeviceController.java index dd305ca3..8a746918 100644 --- a/zc-business/src/main/java/com/zc/business/controller/DcDeviceController.java +++ b/zc-business/src/main/java/com/zc/business/controller/DcDeviceController.java @@ -444,6 +444,7 @@ public class DcDeviceController extends BaseController { @PathVariable String deviceId, @PathVariable String functionId, @RequestBody HashMap props) throws HttpException, IOException { + //public AjaxResult invokedFunction(@PathVariable String deviceId,@PathVariable String functionId,@RequestBody HashMap props,int operType) throws HttpException, IOException { todo return getAjaxResult(deviceId, functionId, props); @@ -481,6 +482,7 @@ public class DcDeviceController extends BaseController { @ApiOperation("批量设备功能调用") @PostMapping("/batchFunctions") @OperationLog(operUrl = "/business/device/batchFunctions") + //public AjaxResult batchInvokedFunction(@RequestBody Map props,int operType) throws HttpException, IOException, InterruptedException { todo public AjaxResult batchInvokedFunction(@RequestBody Map props) throws HttpException, IOException, InterruptedException { ArrayList devices = (ArrayList) props.get("devices"); ArrayList functions = (ArrayList) props.get("functions"); @@ -613,6 +615,7 @@ public class DcDeviceController extends BaseController { @OperationLog(operUrl = "/business/device/batchFunctions") public AjaxResult batchInvokedFunction(Object object) throws HttpException, IOException, InterruptedException { + //public AjaxResult batchInvokedFunction(Object object,int operType) throws HttpException, IOException, InterruptedException { todo Map map = new ObjectMapper().convertValue(object, Map.class); return batchInvokedFunction(map); } diff --git a/zc-business/src/main/java/com/zc/business/controller/DcRegionController.java b/zc-business/src/main/java/com/zc/business/controller/DcRegionController.java new file mode 100644 index 00000000..4e9c1032 --- /dev/null +++ b/zc-business/src/main/java/com/zc/business/controller/DcRegionController.java @@ -0,0 +1,118 @@ +package com.zc.business.controller; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.core.page.TableDataInfo; +import com.ruoyi.common.enums.BusinessType; +import com.zc.business.domain.DcRegion; +import com.zc.business.service.impl.DcRegionServiceImpl; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import javax.validation.Valid; +import java.util.List; + +/** + * 地区信息Controller + * + * @author zhaoxianglong + */ +@Api(tags = {"地区信息"}) +@RestController +@RequestMapping("/business/region") +public class DcRegionController extends BaseController { + @Resource + private DcRegionServiceImpl dcRegionService; + + //*********************************道路增删改查****************************************** + + /** + * 分页查询道路列表 + * + * @param dcRegion 请求参数 + * @return 分页查询结果 + */ + @ApiOperation("分页查询道路列表") + @PreAuthorize("@ss.hasPermi('iot:road:list')") + @GetMapping("list") + public TableDataInfo listRoad(DcRegion dcRegion) { + return getDataTable(dcRegionService.list()); + } + + /** + * 无分页查询道路列表 + * + * @param dcRegion 请求参数 + * @return 查询结果 + */ + @ApiOperation("无分页查询道路列表") + @PreAuthorize("@ss.hasPermi('iot:road:query')") + @GetMapping("query") + public AjaxResult queryRoad(DcRegion dcRegion) { + return AjaxResult.success(dcRegionService.list()); + } + + /** + * 根据id查询道路信息 + * + * @param id id + * @return 查询结果 + */ + @ApiOperation("根据id查询道路信息") + @PreAuthorize("@ss.hasPermi('iot:road:query')") + @GetMapping("{id}") + public AjaxResult getRoad(@PathVariable String id) { + return AjaxResult.success(dcRegionService.getById(id)); + } + + + /** + * 新增 + * + * @param dcRegion 新增参数 + * @return 新增操作结果 + */ + @ApiOperation("新增") + @PreAuthorize("@ss.hasPermi('iot:road:add')") + @Log(title = "新增道路", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult addRoad(@Valid @RequestBody DcRegion dcRegion) { + return toAjax(dcRegionService.save(dcRegion)); + } + + /** + * 修改 + * + * @param dcRegion 修改参数 + * @return 修改操作结果 + */ + @ApiOperation("修改") + @PreAuthorize("@ss.hasPermi('iot:road:edit')") + @Log(title = "修改道路", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult editRoad(@Valid @RequestBody DcRegion dcRegion) { + LambdaQueryWrapper lambdaQueryWrapper = new LambdaQueryWrapper<>(); + lambdaQueryWrapper.eq(DcRegion::getId,dcRegion.getId()); + return toAjax(dcRegionService.update(dcRegion,lambdaQueryWrapper)); + } + + /** + * 删除 + * + * @param ids id集 + * @return 删除操作结果 + */ + @ApiOperation("删除") + @PreAuthorize("@ss.hasPermi('iot:road:remove')") + @Log(title = "删除", businessType = BusinessType.DELETE) + @DeleteMapping("{ids}") + public AjaxResult removeRoad(@PathVariable List ids) { + return toAjax(dcRegionService.removeByIds(ids)); + } + +} diff --git a/zc-business/src/main/java/com/zc/business/interfaces/OperationLogAspect.java b/zc-business/src/main/java/com/zc/business/interfaces/OperationLogAspect.java index 297dc489..1402a3b8 100644 --- a/zc-business/src/main/java/com/zc/business/interfaces/OperationLogAspect.java +++ b/zc-business/src/main/java/com/zc/business/interfaces/OperationLogAspect.java @@ -121,6 +121,11 @@ public class OperationLogAspect { } Object[] pointArgs = joinPoint.getArgs(); + + //String operType = String.valueOf(pointArgs[pointArgs.length - 1]); + //operLog.setOperType(operType); + + HttpServletRequest request; try { @@ -133,7 +138,7 @@ public class OperationLogAspect { SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); String date = df.format(new Date()); String sta = ""; - if (Objects.equals(state, "0") && Objects.equals(String.valueOf(((AjaxResult)jsonResult).get("code")), "200")) { + if (Objects.equals(state, "0") && Objects.equals(String.valueOf(((AjaxResult) jsonResult).get("code")), "200")) { operLog.setStatus(0); sta = "成功"; } else { @@ -148,9 +153,9 @@ public class OperationLogAspect { if (operUrl.contains("batchFunctions")) { //批量调用 JSONObject pointArg = null; - if (pointArgs[0] instanceof JSONObject){ + if (pointArgs[0] instanceof JSONObject) { pointArg = (JSONObject) pointArgs[0]; - }else { + } else { pointArg = (JSONObject) JSON.toJSON(pointArgs[0]); } @@ -229,7 +234,7 @@ public class OperationLogAspect { LambdaQueryWrapper lambdaQueryWrapper = new LambdaQueryWrapper<>(); lambdaQueryWrapper.eq(DcDevice::getIotDeviceId, pointArgs[0]); List list = dcDeviceService.list(lambdaQueryWrapper); - DcDevice dcDevice = list.get(0); + DcDevice dcDevice = list.get(0); if (!Objects.isNull(dcDevice)) { diff --git a/zc-business/src/main/java/com/zc/business/task/ScheduledTaskSchedulingTask.java b/zc-business/src/main/java/com/zc/business/task/ScheduledTaskSchedulingTask.java index 8c17d150..445df902 100644 --- a/zc-business/src/main/java/com/zc/business/task/ScheduledTaskSchedulingTask.java +++ b/zc-business/src/main/java/com/zc/business/task/ScheduledTaskSchedulingTask.java @@ -29,6 +29,7 @@ public class ScheduledTaskSchedulingTask { JSONArray jsonArray = JSONArray.parseArray(job.getCallParameter()); for (Object o : jsonArray) { deviceController.batchInvokedFunction(o); + //deviceController.batchInvokedFunction(o,1); todo } } } From 48be807c4ebb7b0a86bec80ef6886f1ecc64d914 Mon Sep 17 00:00:00 2001 From: wangsixiang <2970484253@qq.com> Date: Tue, 7 May 2024 11:11:28 +0800 Subject: [PATCH 07/60] =?UTF-8?q?=E5=8F=91=E5=B8=83=E6=B8=A0=E9=81=93?= =?UTF-8?q?=E5=AF=B9=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DcPublishingChannelsController.java | 36 +++++++++++++++++-- .../business/domain/DcPublishingChannels.java | 25 +++++++++++-- .../mapper/DcPublishingChannelsMapper.java | 9 +++++ .../service/IDcPublishingChannelsService.java | 6 ++++ .../impl/DcPublishingChannelsServiceImpl.java | 17 +++++++++ .../mapper/business/DcPublishManageMapper.xml | 2 +- .../business/DcPublishingChannelsMapper.xml | 16 +++++++++ 7 files changed, 106 insertions(+), 5 deletions(-) diff --git a/zc-business/src/main/java/com/zc/business/controller/DcPublishingChannelsController.java b/zc-business/src/main/java/com/zc/business/controller/DcPublishingChannelsController.java index c7ccae60..a6983e17 100644 --- a/zc-business/src/main/java/com/zc/business/controller/DcPublishingChannelsController.java +++ b/zc-business/src/main/java/com/zc/business/controller/DcPublishingChannelsController.java @@ -1,7 +1,11 @@ package com.zc.business.controller; +import java.util.HashMap; import java.util.List; import javax.servlet.http.HttpServletResponse; + +import com.ruoyi.common.utils.DateUtils; +import org.apache.commons.lang3.StringUtils; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; @@ -38,8 +42,8 @@ public class DcPublishingChannelsController extends BaseController * 查询发布渠道列表 */ @PreAuthorize("@ss.hasPermi('business:channels:list')") - @GetMapping("/list") - public TableDataInfo list(DcPublishingChannels dcPublishingChannels) + @PostMapping("/list") + public TableDataInfo list(@RequestBody DcPublishingChannels dcPublishingChannels) { startPage(); List list = dcPublishingChannelsService.selectDcPublishingChannelsList(dcPublishingChannels); @@ -114,4 +118,32 @@ public class DcPublishingChannelsController extends BaseController { return toAjax(dcPublishingChannelsService.deleteDcPublishingChannelsByIds(ids)); } + /** + * 修改启用停用 + */ + @PostMapping("/updateEnabled") + public AjaxResult updateEnabled(@RequestBody DcPublishingChannels dcPublishingChannels) + { + Integer enabled = dcPublishingChannels.getEnabled();//状态 + if (enabled==null){ + return AjaxResult.error("参数错误"); + } + if (enabled==2){ //启用状态,修改启用时间 + dcPublishingChannels.setEnableDate(DateUtils.getNowDate()); + } + return toAjax(dcPublishingChannelsService.updateEnabled(dcPublishingChannels)); + } + //事件调度处置事件推送发布渠道 + @PostMapping("/eventPublishChannels") + public AjaxResult eventPublishChannels(@RequestBody HashMap map) + { + if (map==null||map.size()==0){ + return AjaxResult.error("参数错误"); + } + String eventId = map.get("eventId").toString(); + if (StringUtils.isBlank(eventId)){ + return AjaxResult.error("参数错误"); + } + return AjaxResult.success(dcPublishingChannelsService.eventPublishChannels(eventId)); + } } diff --git a/zc-business/src/main/java/com/zc/business/domain/DcPublishingChannels.java b/zc-business/src/main/java/com/zc/business/domain/DcPublishingChannels.java index adb0a72f..d3e8a928 100644 --- a/zc-business/src/main/java/com/zc/business/domain/DcPublishingChannels.java +++ b/zc-business/src/main/java/com/zc/business/domain/DcPublishingChannels.java @@ -43,13 +43,34 @@ public class DcPublishingChannels extends BaseEntity @Excel(name = "启用日期", readConverterExp = "$column.readConverterExp()") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8") private Date enableDate; - + //查询参数 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8") + private Date startDate; + //查询参数 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8") + private Date endDate; public void setId(Long id) { this.id = id; } - public Long getId() + public Date getStartDate() { + return startDate; + } + + public void setStartDate(Date startDate) { + this.startDate = startDate; + } + + public Date getEndDate() { + return endDate; + } + + public void setEndDate(Date endDate) { + this.endDate = endDate; + } + + public Long getId() { return id; } diff --git a/zc-business/src/main/java/com/zc/business/mapper/DcPublishingChannelsMapper.java b/zc-business/src/main/java/com/zc/business/mapper/DcPublishingChannelsMapper.java index d08e2fe4..96557b9c 100644 --- a/zc-business/src/main/java/com/zc/business/mapper/DcPublishingChannelsMapper.java +++ b/zc-business/src/main/java/com/zc/business/mapper/DcPublishingChannelsMapper.java @@ -1,7 +1,9 @@ package com.zc.business.mapper; +import java.util.HashMap; import java.util.List; import com.zc.business.domain.DcPublishingChannels; +import org.apache.ibatis.annotations.Param; /** * 发布渠道Mapper接口 @@ -60,4 +62,11 @@ public interface DcPublishingChannelsMapper int deleteDcPublishingChannelsByIds(Long[] ids); //查询数据类型是否已经存在 public List selectChannelsDataCategory(Integer dataCategory); + //修改启用停用 + int updateEnabled(DcPublishingChannels dcPublishingChannels); + //查询事件类型 + public String eventType(@Param("id")String id); + //事件调度处置事件推送发布渠道 + public DcPublishingChannels eventPublishChannels(@Param("dataCategory") String dataCategory); + } diff --git a/zc-business/src/main/java/com/zc/business/service/IDcPublishingChannelsService.java b/zc-business/src/main/java/com/zc/business/service/IDcPublishingChannelsService.java index 70d73cbd..8488a4a3 100644 --- a/zc-business/src/main/java/com/zc/business/service/IDcPublishingChannelsService.java +++ b/zc-business/src/main/java/com/zc/business/service/IDcPublishingChannelsService.java @@ -1,7 +1,9 @@ package com.zc.business.service; +import java.util.HashMap; import java.util.List; import com.zc.business.domain.DcPublishingChannels; +import org.apache.ibatis.annotations.Param; /** * 发布渠道Service接口 @@ -60,4 +62,8 @@ public interface IDcPublishingChannelsService int deleteDcPublishingChannelsById(Long id); //查询数据类型是否已经存在 public List selectChannelsDataCategory(Integer dataCategory); + //修改启用停用 + int updateEnabled(DcPublishingChannels dcPublishingChannels); + //事件调度处置事件推送发布渠道 + public DcPublishingChannels eventPublishChannels(String eventId); } diff --git a/zc-business/src/main/java/com/zc/business/service/impl/DcPublishingChannelsServiceImpl.java b/zc-business/src/main/java/com/zc/business/service/impl/DcPublishingChannelsServiceImpl.java index f9e8f5ab..fa1461a0 100644 --- a/zc-business/src/main/java/com/zc/business/service/impl/DcPublishingChannelsServiceImpl.java +++ b/zc-business/src/main/java/com/zc/business/service/impl/DcPublishingChannelsServiceImpl.java @@ -1,7 +1,9 @@ package com.zc.business.service.impl; +import java.util.HashMap; import java.util.List; import com.ruoyi.common.utils.DateUtils; +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.zc.business.mapper.DcPublishingChannelsMapper; @@ -54,6 +56,7 @@ public class DcPublishingChannelsServiceImpl implements IDcPublishingChannelsSer public int insertDcPublishingChannels(DcPublishingChannels dcPublishingChannels) { dcPublishingChannels.setCreateTime(DateUtils.getNowDate()); + dcPublishingChannels.setEnabled(0);//新增时默认状态为停用 return dcPublishingChannelsMapper.insertDcPublishingChannels(dcPublishingChannels); } @@ -98,4 +101,18 @@ public class DcPublishingChannelsServiceImpl implements IDcPublishingChannelsSer public List selectChannelsDataCategory(Integer dataCategory) { return dcPublishingChannelsMapper.selectChannelsDataCategory(dataCategory); } + //修改启用停用 + @Override + public int updateEnabled(DcPublishingChannels dcPublishingChannels) { + return dcPublishingChannelsMapper.updateEnabled(dcPublishingChannels); + } + //事件调度处置事件推送发布渠道 + @Override + public DcPublishingChannels eventPublishChannels(String eventId) { + String type = dcPublishingChannelsMapper.eventType(eventId);//事件类型 + if (StringUtils.isBlank(type)){ + return null; + } + return dcPublishingChannelsMapper.eventPublishChannels(type); + } } diff --git a/zc-business/src/main/resources/mapper/business/DcPublishManageMapper.xml b/zc-business/src/main/resources/mapper/business/DcPublishManageMapper.xml index e9341438..5cf86603 100644 --- a/zc-business/src/main/resources/mapper/business/DcPublishManageMapper.xml +++ b/zc-business/src/main/resources/mapper/business/DcPublishManageMapper.xml @@ -76,7 +76,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" GROUP BY manage.event_id - ORDER BY manage.create_time + ORDER BY event.create_time desc + and enable_date >= #{startDate} + and enable_date <= #{endDate} and enable_date = #{enableDate} and data_category = #{dataCategory} and info_level = #{infoLevel} @@ -78,6 +80,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" where id = #{id} + + update dc_publishing_channels + + enabled = #{enabled}, + enable_date = #{enableDate}, + + where id = #{id} + delete from dc_publishing_channels where id = #{id} @@ -92,4 +102,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + \ No newline at end of file From 8783edda40068ce74cb548483e61d907b8b141d1 Mon Sep 17 00:00:00 2001 From: lau572 <1010031226@qq.com> Date: Tue, 7 May 2024 14:36:25 +0800 Subject: [PATCH 08/60] =?UTF-8?q?=E4=BA=8B=E4=BB=B6=E5=A4=84=E7=BD=AE?= =?UTF-8?q?=E8=B7=B3=E8=BF=87=E6=B8=85=E9=9A=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/mapper/business/DcEventMapper.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zc-business/src/main/resources/mapper/business/DcEventMapper.xml b/zc-business/src/main/resources/mapper/business/DcEventMapper.xml index 9add2632..7d8acdf5 100644 --- a/zc-business/src/main/resources/mapper/business/DcEventMapper.xml +++ b/zc-business/src/main/resources/mapper/business/DcEventMapper.xml @@ -775,7 +775,7 @@ ORDER BY nodeNode From b2831b499e1e328279607098d9e68f044f863c51 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, 7 May 2024 15:12:43 +0800 Subject: [PATCH 09/60] =?UTF-8?q?=E4=BA=8B=E4=BB=B6=E8=AF=A6=E6=83=85?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=20=E6=96=B0=E5=A2=9E=20=E7=BB=8F=E7=BA=AC?= =?UTF-8?q?=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/mapper/business/DcEventMapper.xml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/zc-business/src/main/resources/mapper/business/DcEventMapper.xml b/zc-business/src/main/resources/mapper/business/DcEventMapper.xml index 7d8acdf5..02766ac8 100644 --- a/zc-business/src/main/resources/mapper/business/DcEventMapper.xml +++ b/zc-business/src/main/resources/mapper/business/DcEventMapper.xml @@ -396,8 +396,6 @@ WHEN '3' THEN '济南方向' END AS direction, dc_event.user_id, - dc_event.dimension, - dc_event.longitude, dc_event.is_perceived, dc_event.user_id as user_id, sys_user.nick_name as nickName, @@ -504,12 +502,17 @@ dc_event.lang as lang, dc_event_type.event_name AS event_name, sys_dept.dept_name as organization_name, + + dc_stake_mark.latitude AS dimension, + dc_stake_mark.longitude AS longitude, dc_road.road_name as road_name + FROM dc_event LEFT JOIN dc_event_type ON dc_event_type.event_type = dc_event.event_type LEFT JOIN sys_dept ON dc_event.dept_id = sys_dept.dept_id LEFT JOIN dc_road ON dc_event.road_id = dc_road.id LEFT JOIN sys_user on dc_event.user_id = sys_user.user_id + LEFT JOIN dc_stake_mark ON dc_event.stake_mark=dc_stake_mark.stake_mark AND dc_event.direction=dc_stake_mark.direction where dc_event.id = #{id} From 932b79d7fee771cd3051170afee6691cd7fa6e43 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, 7 May 2024 16:09:01 +0800 Subject: [PATCH 10/60] =?UTF-8?q?=E8=BF=87=E6=BB=A4=E8=83=BD=E8=A7=81?= =?UTF-8?q?=E5=BA=A6=20=E7=AD=89=E7=BA=A70=20500m?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../business/message/device/handler/DeviceMessageHandler.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/zc-business/src/main/java/com/zc/business/message/device/handler/DeviceMessageHandler.java b/zc-business/src/main/java/com/zc/business/message/device/handler/DeviceMessageHandler.java index c1410b23..d8378b55 100644 --- a/zc-business/src/main/java/com/zc/business/message/device/handler/DeviceMessageHandler.java +++ b/zc-business/src/main/java/com/zc/business/message/device/handler/DeviceMessageHandler.java @@ -238,8 +238,10 @@ public class DeviceMessageHandler { /* JSONObject combinedData = new JSONObject(); combinedData.put("address", otherConfig);*/ dcWarning.setOtherConfig(otherConfig.toString()); + if (dcWarning.getWarningLevel() !=0){ + dcWarningService.insertDcWarning(dcWarning); + } - dcWarningService.insertDcWarning(dcWarning); } //无法判定事件结束上报的类型有:占用应急车道,路障,逆行,机占非 From 8560d794b45833a3bf2f9a105566f8a7a3cb5d9a Mon Sep 17 00:00:00 2001 From: wangsixiang <2970484253@qq.com> Date: Wed, 8 May 2024 09:18:44 +0800 Subject: [PATCH 11/60] =?UTF-8?q?=E5=8F=91=E5=B8=83=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DcPublishingChannelsController.java | 6 +----- .../zc/business/domain/DcPublishManage.java | 20 +++++++++++++++++++ .../service/impl/DcWarningServiceImpl.java | 3 +++ .../mapper/business/DcPublishManageMapper.xml | 8 ++++++++ 4 files changed, 32 insertions(+), 5 deletions(-) diff --git a/zc-business/src/main/java/com/zc/business/controller/DcPublishingChannelsController.java b/zc-business/src/main/java/com/zc/business/controller/DcPublishingChannelsController.java index a6983e17..afe6ae94 100644 --- a/zc-business/src/main/java/com/zc/business/controller/DcPublishingChannelsController.java +++ b/zc-business/src/main/java/com/zc/business/controller/DcPublishingChannelsController.java @@ -100,11 +100,7 @@ public class DcPublishingChannelsController extends BaseController @PutMapping public AjaxResult edit(@RequestBody DcPublishingChannels dcPublishingChannels) { - List channelsList = dcPublishingChannelsService. - selectChannelsDataCategory(dcPublishingChannels.getDataCategory()); - if (channelsList!=null&&channelsList.size()>0){ - return AjaxResult.error("事件类型已存在"); - } + return toAjax(dcPublishingChannelsService.updateDcPublishingChannels(dcPublishingChannels)); } diff --git a/zc-business/src/main/java/com/zc/business/domain/DcPublishManage.java b/zc-business/src/main/java/com/zc/business/domain/DcPublishManage.java index 89524611..ad4fe4ef 100644 --- a/zc-business/src/main/java/com/zc/business/domain/DcPublishManage.java +++ b/zc-business/src/main/java/com/zc/business/domain/DcPublishManage.java @@ -118,6 +118,26 @@ public class DcPublishManage extends BaseEntity private String facilityName; //事件状态:0-待确认1-处理中2-已完成 private Integer eventState; + //关联情报板id + private Long logId; + //关联语音广告发布id + private Long voiceId; + + public Long getLogId() { + return logId; + } + + public void setLogId(Long logId) { + this.logId = logId; + } + + public Long getVoiceId() { + return voiceId; + } + + public void setVoiceId(Long voiceId) { + this.voiceId = voiceId; + } public Integer getEventState() { return eventState; diff --git a/zc-business/src/main/java/com/zc/business/service/impl/DcWarningServiceImpl.java b/zc-business/src/main/java/com/zc/business/service/impl/DcWarningServiceImpl.java index 092a3abe..6f08a2bb 100644 --- a/zc-business/src/main/java/com/zc/business/service/impl/DcWarningServiceImpl.java +++ b/zc-business/src/main/java/com/zc/business/service/impl/DcWarningServiceImpl.java @@ -183,6 +183,9 @@ public class DcWarningServiceImpl implements IDcWarningService redisCache.setCacheObject(WARNINGDATA+key,dataId,Integer.parseInt(strategyTime),TimeUnit.MINUTES);//重新设置延迟时间 return dcWarningMapper.updateOtherConfig(dataId, jsonObject.toString(),dcWarning.getEndTime());//修改数据库配置 } + if (redisValueTwo==null){ //如果传进来的事件未配置策略,在这里出入默认的过去时间值 + dcWarning.setEndTime(DateUtils.getObtainDateAfter(60));//注入过期时间(默认值为60分钟) + } //事件推送至 Websocket extracted(dcWarning); return dcWarningMapper.insertDcWarning(dcWarning);//如果没有配置策略直接加入数据库; diff --git a/zc-business/src/main/resources/mapper/business/DcPublishManageMapper.xml b/zc-business/src/main/resources/mapper/business/DcPublishManageMapper.xml index 5cf86603..65358545 100644 --- a/zc-business/src/main/resources/mapper/business/DcPublishManageMapper.xml +++ b/zc-business/src/main/resources/mapper/business/DcPublishManageMapper.xml @@ -32,6 +32,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + @@ -123,6 +125,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" remark, update_time, create_time, + log_id, + voice_id, #{eventId}, @@ -144,6 +148,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{remark}, #{updateTime}, #{createTime}, + #{logId}, + #{voiceId}, @@ -169,6 +175,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" remark = #{remark}, update_time = #{updateTime}, create_time = #{createTime}, + log_id = #{logId}, + voice_id = #{voiceId}, where id = #{id} From ce8c79dc003345469f092123e9679ec3e2a73992 Mon Sep 17 00:00:00 2001 From: zhaoxianglong Date: Wed, 8 May 2024 09:56:36 +0800 Subject: [PATCH 12/60] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=93=8D=E4=BD=9C?= =?UTF-8?q?=E8=AE=B0=E5=BD=95=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../interfaces/OperationLogAspect.java | 43 ++++++++++++++++++- 1 file changed, 41 insertions(+), 2 deletions(-) diff --git a/zc-business/src/main/java/com/zc/business/interfaces/OperationLogAspect.java b/zc-business/src/main/java/com/zc/business/interfaces/OperationLogAspect.java index 1402a3b8..2e622d94 100644 --- a/zc-business/src/main/java/com/zc/business/interfaces/OperationLogAspect.java +++ b/zc-business/src/main/java/com/zc/business/interfaces/OperationLogAspect.java @@ -14,8 +14,11 @@ import com.ruoyi.common.utils.spring.SpringUtils; import com.ruoyi.system.service.ISysDeptService; import com.zc.business.domain.DcDevice; import com.zc.business.domain.DcOperLog; +import com.zc.business.domain.DcPublishManage; import com.zc.business.service.IDcDeviceService; import com.zc.business.service.IDcOperLogService; +import com.zc.business.service.IDcPublishInfoService; +import com.zc.business.service.IDcPublishManageService; import org.aspectj.lang.JoinPoint; import org.aspectj.lang.ProceedingJoinPoint; import org.aspectj.lang.annotation.*; @@ -108,6 +111,7 @@ public class OperationLogAspect { ISysDeptService deptService = SpringUtils.getBean(ISysDeptService.class); IDcOperLogService dcOperLogService = SpringUtils.getBean(IDcOperLogService.class); IDcDeviceService dcDeviceService = SpringUtils.getBean(IDcDeviceService.class); + IDcPublishManageService dcPublishManageService = SpringUtils.getBean(IDcPublishManageService.class); try { DcOperLog operLog = new DcOperLog(); @@ -177,6 +181,7 @@ public class OperationLogAspect { deviceType = dcDevice.getDeviceType(); + deviceIds.add(String.valueOf(deviceId)); deviceNames.add(deviceName); @@ -190,7 +195,10 @@ public class OperationLogAspect { "发布语音广播" : String.valueOf( ((HashMap) (DEVICEFUNCTIONNAME.get(deviceType))) - .get(function.getString("functionId"))); + .get(function.getString("functionId")) == null ? + "未知方法" : + ((HashMap) (DEVICEFUNCTIONNAME.get(deviceType))) + .get(function.getString("functionId"))); remark.append("调用").append(hashMap).append("功能").append(sta); @@ -227,7 +235,38 @@ public class OperationLogAspect { operLog.setDcDeviceType(deviceType); operLog.setRemark(remark.toString()); operLog.setJsonResult(jsonResult.toString()); - dcOperLogService.addDcOperLog(operLog); + dcOperLogService.save(operLog); + + + if ((Objects.equals(deviceType, "2") || Objects.equals(deviceType, "5")) && Objects.nonNull(operLog.getId())) { + DcPublishManage dcPublishManage = new DcPublishManage(); + + if (Objects.equals(state, "0") && Objects.equals(String.valueOf(((AjaxResult) jsonResult).get("code")), "200")) { + dcPublishManage.setPublishStatus(1);//发布状态1-成功2-失败 + } else { + dcPublishManage.setPublishStatus(2);//发布状态1-成功2-失败 + } + + if (loginUser != null) { + dcPublishManage.setPublisher(loginUser.getUsername());//发布人 + } else { + dcPublishManage.setPublisher("系统定时调用");//发布人 + } + dcPublishManage.setPublishTime(new Date());//发布时间 + dcPublishManage.setCreateTime(new Date());//创建时间 + + if (Objects.equals(deviceType, "2")) { + dcPublishManage.setLogId(Long.valueOf(operLog.getId()));//发布的如果的情报板传对应id + dcPublishManage.setPublishChannels(4); + } else { + dcPublishManage.setVoiceId(Long.valueOf(operLog.getId()));//发布的如果是语音传对应id + dcPublishManage.setPublishChannels(7); + } + + dcPublishManage.setContentDetails(remark.toString()); + dcPublishManageService.insertDcPublishManage(dcPublishManage); + } + } else if (operUrl.contains("functions")) { From 1a241d1da4c12b23cc5ef960abbb9d843a33b220 Mon Sep 17 00:00:00 2001 From: zhaoxianglong Date: Wed, 8 May 2024 11:55:35 +0800 Subject: [PATCH 13/60] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=93=8D=E4=BD=9C?= =?UTF-8?q?=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/zc/business/interfaces/OperationLogAspect.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/zc-business/src/main/java/com/zc/business/interfaces/OperationLogAspect.java b/zc-business/src/main/java/com/zc/business/interfaces/OperationLogAspect.java index 2e622d94..f223851f 100644 --- a/zc-business/src/main/java/com/zc/business/interfaces/OperationLogAspect.java +++ b/zc-business/src/main/java/com/zc/business/interfaces/OperationLogAspect.java @@ -255,11 +255,10 @@ public class OperationLogAspect { dcPublishManage.setPublishTime(new Date());//发布时间 dcPublishManage.setCreateTime(new Date());//创建时间 + dcPublishManage.setLogId(Long.valueOf(operLog.getId()));//发布的如果的情报板传对应id if (Objects.equals(deviceType, "2")) { - dcPublishManage.setLogId(Long.valueOf(operLog.getId()));//发布的如果的情报板传对应id dcPublishManage.setPublishChannels(4); } else { - dcPublishManage.setVoiceId(Long.valueOf(operLog.getId()));//发布的如果是语音传对应id dcPublishManage.setPublishChannels(7); } From a0cb61db6c66a97d7358c13062a3da8db456412b Mon Sep 17 00:00:00 2001 From: zhaoxianglong Date: Wed, 8 May 2024 14:27:47 +0800 Subject: [PATCH 14/60] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=8D=95=E8=AE=BE?= =?UTF-8?q?=E5=A4=87=E5=9C=A8=E7=BA=BF=E8=B7=AF=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../business/controller/StatusController.java | 24 ++++++++++++++----- 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/zc-business/src/main/java/com/zc/business/controller/StatusController.java b/zc-business/src/main/java/com/zc/business/controller/StatusController.java index 957be29a..c86f20f8 100644 --- a/zc-business/src/main/java/com/zc/business/controller/StatusController.java +++ b/zc-business/src/main/java/com/zc/business/controller/StatusController.java @@ -1,4 +1,5 @@ package com.zc.business.controller; + import com.github.pagehelper.util.StringUtil; import com.ruoyi.common.annotation.Log; import com.ruoyi.common.core.controller.BaseController; @@ -21,7 +22,10 @@ import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import javax.servlet.http.HttpServletResponse; +import java.math.BigDecimal; +import java.math.RoundingMode; import java.time.LocalDateTime; +import java.time.format.DateTimeFormatter; import java.time.temporal.ChronoUnit; import java.util.*; import java.util.stream.Collectors; @@ -130,19 +134,27 @@ public class StatusController extends BaseController { List listStatus = statusService.deviceStatusListById(status); // Calculate average successRate by day - Map averageSuccessRateByDay = listStatus.stream() - .collect(Collectors.groupingBy(s -> s.getTime().getDayOfMonth(), + Map averageSuccessRateByDay = listStatus.stream() + .collect(Collectors.groupingBy(s -> { + // 使用 DateTimeFormatter 格式化日期 + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd"); + String formattedDate = s.getTime().format(formatter); + return formattedDate; + }, Collectors.averagingDouble(s -> Double.parseDouble(s.getSuccessRate().replace("%", ""))))); if (averageSuccessRateByDay.isEmpty()) { return AjaxResult.success("暂无数据"); } - // Round average successRate to two decimal places - Map roundedAverageSuccessRateByDay = averageSuccessRateByDay.entrySet().stream() - .collect(Collectors.toMap(Map.Entry::getKey, entry -> Math.round(entry.getValue() * 100.0) / 100.0)); + averageSuccessRateByDay.keySet().forEach(item -> { + + BigDecimal bigDecimal = new BigDecimal(averageSuccessRateByDay.get(item)); + averageSuccessRateByDay.put(item, bigDecimal.setScale(2, RoundingMode.HALF_UP).doubleValue()); + + }); - return AjaxResult.success(roundedAverageSuccessRateByDay); + return AjaxResult.success(new TreeMap<>(averageSuccessRateByDay)); } //按类型划分设备 From e14b28a563687670f7607f42992c6da3c8932dbe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=85=B4=E7=90=B3?= <1911390090@qq.com> Date: Wed, 8 May 2024 16:17:03 +0800 Subject: [PATCH 15/60] =?UTF-8?q?=E4=BC=98=E5=8C=96=20=E4=BA=8B=E4=BB=B6?= =?UTF-8?q?=E6=8E=A8=E9=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/zc/business/service/impl/DcEventServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 3feebbaf..9ed91296 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 @@ -219,7 +219,7 @@ public class DcEventServiceImpl extends ServiceImpl impl //TODO 插入多个收费站 if (dcEvent.getDcEventTrafficControl().getFacilityIds().length == 1) {//facilityIds==1 说明只选择了一个收费站 - if (dcEventId != null) {//不等于空 事件处置页面 修改 + if (dcEventId != null && !dcEventId.equals("")) {//不等于空 事件处置页面 修改 dcEventMapper.deleteDcEventById(uuid);//删除添加的事件主类 DcEvent dcEvent1 = new DcEvent(); dcEvent1.setId(dcEventId);//事件id From 749b84468654c3b5dc36d34174c89d1a4e6efdaa Mon Sep 17 00:00:00 2001 From: wangsixiang <2970484253@qq.com> Date: Wed, 8 May 2024 17:18:36 +0800 Subject: [PATCH 16/60] =?UTF-8?q?=E6=9C=8D=E5=8A=A1=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/DcPublishManageController.java | 19 ++++++ .../zc/business/domain/DcPublishManage.java | 9 +-- .../mapper/DcPublishManageMapper.java | 6 ++ .../service/IDcPublishManageService.java | 7 ++ .../impl/DcPublishManageServiceImpl.java | 16 +++++ .../mapper/business/DcPublishManageMapper.xml | 65 +++++++++++++++++-- 6 files changed, 110 insertions(+), 12 deletions(-) diff --git a/zc-business/src/main/java/com/zc/business/controller/DcPublishManageController.java b/zc-business/src/main/java/com/zc/business/controller/DcPublishManageController.java index 94908506..86b185ba 100644 --- a/zc-business/src/main/java/com/zc/business/controller/DcPublishManageController.java +++ b/zc-business/src/main/java/com/zc/business/controller/DcPublishManageController.java @@ -114,4 +114,23 @@ public class DcPublishManageController extends BaseController { return toAjax(dcPublishManageService.deleteDcPublishManageByIds(ids)); } + //统计服务,今日发布渠道分析 + @PostMapping("/statisticsPublishManage") + public AjaxResult statisticsPublishManage() + { + return AjaxResult.success(dcPublishManageService.statisticsPublishManage()); + } + //统计服务,今日发布事件类型分析 + @PostMapping("/eventTypePublishManage") + public AjaxResult eventTypePublishManage() + { + return AjaxResult.success(dcPublishManageService.eventTypePublishManage()); + } + //统计服务,今日发布趋势分析 + @PostMapping("/trendsPublishManage") + public AjaxResult releaseTrendsPublishManage() + { + return AjaxResult.success(dcPublishManageService.releaseTrendsPublishManage()); + } + } diff --git a/zc-business/src/main/java/com/zc/business/domain/DcPublishManage.java b/zc-business/src/main/java/com/zc/business/domain/DcPublishManage.java index ad4fe4ef..abed367f 100644 --- a/zc-business/src/main/java/com/zc/business/domain/DcPublishManage.java +++ b/zc-business/src/main/java/com/zc/business/domain/DcPublishManage.java @@ -120,8 +120,7 @@ public class DcPublishManage extends BaseEntity private Integer eventState; //关联情报板id private Long logId; - //关联语音广告发布id - private Long voiceId; + public Long getLogId() { return logId; @@ -131,13 +130,7 @@ public class DcPublishManage extends BaseEntity this.logId = logId; } - public Long getVoiceId() { - return voiceId; - } - public void setVoiceId(Long voiceId) { - this.voiceId = voiceId; - } public Integer getEventState() { return eventState; 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 07853632..7076aaf3 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 @@ -67,4 +67,10 @@ public interface DcPublishManageMapper public DcPublishManage selectPublishManage(@Param("dataCategory")Integer dataCategory); //查询信息发布列表 public List> selectDcPublishManageListMap(DcPublishManage dcPublishManage); + //统计今日发布渠道分析 + public List> statisticsPublishManage(); + //统计今日发布事件类型分析 + public List> eventTypePublishManage(); + //统计今日发布趋势分析 + public List> releaseTrendsPublishManage(); } diff --git a/zc-business/src/main/java/com/zc/business/service/IDcPublishManageService.java b/zc-business/src/main/java/com/zc/business/service/IDcPublishManageService.java index e2d48f76..a0333386 100644 --- a/zc-business/src/main/java/com/zc/business/service/IDcPublishManageService.java +++ b/zc-business/src/main/java/com/zc/business/service/IDcPublishManageService.java @@ -1,5 +1,6 @@ package com.zc.business.service; +import java.util.HashMap; import java.util.List; import com.zc.business.domain.DcPublishManage; @@ -59,4 +60,10 @@ public interface IDcPublishManageService * @return 结果 */ int deleteDcPublishManageById(Long id); + //统计今日发布渠道分析 + public List> statisticsPublishManage(); + //统计今日发布事件类型分析 + public List> eventTypePublishManage(); + //统计今日发布趋势分析 + public List> releaseTrendsPublishManage(); } diff --git a/zc-business/src/main/java/com/zc/business/service/impl/DcPublishManageServiceImpl.java b/zc-business/src/main/java/com/zc/business/service/impl/DcPublishManageServiceImpl.java index 9541ae3e..a6602b50 100644 --- a/zc-business/src/main/java/com/zc/business/service/impl/DcPublishManageServiceImpl.java +++ b/zc-business/src/main/java/com/zc/business/service/impl/DcPublishManageServiceImpl.java @@ -9,6 +9,7 @@ import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.util.HashMap; import java.util.List; /** @@ -109,4 +110,19 @@ public class DcPublishManageServiceImpl implements IDcPublishManageService { return dcPublishManageMapper.deleteDcPublishManageById(id); } + //统计今日发布渠道分析 + @Override + public List> statisticsPublishManage() { + return dcPublishManageMapper.statisticsPublishManage(); + } + //统计今日发布事件类型分析 + @Override + public List> eventTypePublishManage() { + return dcPublishManageMapper.eventTypePublishManage(); + } + //统计今日发布趋势分析 + @Override + public List> releaseTrendsPublishManage() { + return dcPublishManageMapper.releaseTrendsPublishManage(); + } } diff --git a/zc-business/src/main/resources/mapper/business/DcPublishManageMapper.xml b/zc-business/src/main/resources/mapper/business/DcPublishManageMapper.xml index 65358545..8db6431a 100644 --- a/zc-business/src/main/resources/mapper/business/DcPublishManageMapper.xml +++ b/zc-business/src/main/resources/mapper/business/DcPublishManageMapper.xml @@ -33,7 +33,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - + @@ -62,6 +62,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + insert into dc_publish_manage @@ -126,7 +128,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" update_time, create_time, log_id, - voice_id, + #{eventId}, @@ -149,7 +151,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{updateTime}, #{createTime}, #{logId}, - #{voiceId}, + @@ -176,7 +178,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" update_time = #{updateTime}, create_time = #{createTime}, log_id = #{logId}, - voice_id = #{voiceId}, where id = #{id} @@ -191,4 +192,60 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{id} + + + \ No newline at end of file From a0ae98869275eaf6d9796aaaf78c0031b926f91b 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, 9 May 2024 09:12:56 +0800 Subject: [PATCH 17/60] =?UTF-8?q?=E5=BC=82=E5=B8=B8=E5=A4=A9=E6=B0=94?= =?UTF-8?q?=E7=AD=89=E7=BA=A7=20=E8=BF=87=E6=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../message/device/handler/DeviceMessageHandler.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/zc-business/src/main/java/com/zc/business/message/device/handler/DeviceMessageHandler.java b/zc-business/src/main/java/com/zc/business/message/device/handler/DeviceMessageHandler.java index d8378b55..805ab2c3 100644 --- a/zc-business/src/main/java/com/zc/business/message/device/handler/DeviceMessageHandler.java +++ b/zc-business/src/main/java/com/zc/business/message/device/handler/DeviceMessageHandler.java @@ -238,11 +238,16 @@ public class DeviceMessageHandler { /* JSONObject combinedData = new JSONObject(); combinedData.put("address", otherConfig);*/ dcWarning.setOtherConfig(otherConfig.toString()); - if (dcWarning.getWarningLevel() !=0){ + //异常天气等级 过滤 + if (data.getInteger("warningType") == VISIBILITY_LEVEL) { + int WarningLevel=data.getInteger("visibilityLevel"); + if (WarningLevel !=0){ + dcWarningService.insertDcWarning(dcWarning); + } + }else { dcWarningService.insertDcWarning(dcWarning); } - } //无法判定事件结束上报的类型有:占用应急车道,路障,逆行,机占非 //非持续性事件:拥堵、 From 6d89a90ee52b753455135ba9a838a0cc0214e840 Mon Sep 17 00:00:00 2001 From: lau572 <1010031226@qq.com> Date: Thu, 9 May 2024 09:43:58 +0800 Subject: [PATCH 18/60] =?UTF-8?q?1.=E9=87=8D=E8=A6=81=E4=BA=8B=E4=BB=B6?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E5=86=85=E5=AE=B9=E7=94=9F=E6=88=90=202.word?= =?UTF-8?q?=E7=94=9F=E6=88=90=E5=B7=A5=E5=85=B7=E7=B1=BB=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DcEventImportantFileController.java | 20 +- .../service/IDcEventImportantFileService.java | 11 + .../impl/DcEventImportantFileServiceImpl.java | 240 +++++++++++++++++- .../java/com/zc/business/utils/PoiUtil.java | 12 +- 4 files changed, 270 insertions(+), 13 deletions(-) diff --git a/zc-business/src/main/java/com/zc/business/controller/DcEventImportantFileController.java b/zc-business/src/main/java/com/zc/business/controller/DcEventImportantFileController.java index 2ea37c94..29d8cf4a 100644 --- a/zc-business/src/main/java/com/zc/business/controller/DcEventImportantFileController.java +++ b/zc-business/src/main/java/com/zc/business/controller/DcEventImportantFileController.java @@ -9,16 +9,10 @@ import javax.servlet.http.HttpServletResponse; import com.zc.business.utils.PoiUtil; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; import org.apache.poi.xwpf.usermodel.XWPFDocument; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; import com.ruoyi.common.annotation.Log; import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.domain.AjaxResult; @@ -86,7 +80,7 @@ public class DcEventImportantFileController extends BaseController { InputStream inputStream = this.getClass().getClassLoader().getResourceAsStream("wordTemplate/importantTemplate.docx"); - XWPFDocument document = null; + XWPFDocument document = null; try { @@ -171,4 +165,12 @@ public class DcEventImportantFileController extends BaseController public AjaxResult getImportantFileStatus(@PathVariable("eventId") String eventId){ return dcEventImportantFileService.getImportantFileStatus(eventId); } + + @ApiOperation("生成重要事件文件内容") + @PostMapping("/generate") + public AjaxResult generate(@ApiParam(value="事件id", name="eventId", required=true) @RequestParam("eventId") String eventId, + @ApiParam(value="类型 1:初报,2续报,3终报", name="type", required=true) @RequestParam("type") String type){ + return dcEventImportantFileService.generate(eventId,type); + } + } diff --git a/zc-business/src/main/java/com/zc/business/service/IDcEventImportantFileService.java b/zc-business/src/main/java/com/zc/business/service/IDcEventImportantFileService.java index 223b11de..bc862eb3 100644 --- a/zc-business/src/main/java/com/zc/business/service/IDcEventImportantFileService.java +++ b/zc-business/src/main/java/com/zc/business/service/IDcEventImportantFileService.java @@ -68,4 +68,15 @@ public interface IDcEventImportantFileService * @return 结果 */ AjaxResult getImportantFileStatus(String eventId); + + /** + * @Description 生成重要事件文件内容 + * + * @author liuwenge + * @date 2024/5/8 15:50 + * @param eventId 事件id + * @param type 类型 1:初报,2续报,3终报 + * @return com.ruoyi.common.core.domain.AjaxResult + */ + AjaxResult generate(String eventId,String type); } diff --git a/zc-business/src/main/java/com/zc/business/service/impl/DcEventImportantFileServiceImpl.java b/zc-business/src/main/java/com/zc/business/service/impl/DcEventImportantFileServiceImpl.java index 12513d6c..a9e2ed1d 100644 --- a/zc-business/src/main/java/com/zc/business/service/impl/DcEventImportantFileServiceImpl.java +++ b/zc-business/src/main/java/com/zc/business/service/impl/DcEventImportantFileServiceImpl.java @@ -1,17 +1,20 @@ package com.zc.business.service.impl; +import java.text.SimpleDateFormat; +import java.util.Arrays; import java.util.Date; +import java.util.HashSet; import java.util.List; import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.core.domain.entity.SysUser; import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.SecurityUtils; import com.ruoyi.common.utils.StringUtils; -import com.zc.business.domain.DcEventProcess; +import com.zc.business.domain.*; +import com.zc.business.mapper.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; -import com.zc.business.mapper.DcEventImportantFileMapper; -import com.zc.business.domain.DcEventImportantFile; import com.zc.business.service.IDcEventImportantFileService; /** @@ -27,6 +30,16 @@ public class DcEventImportantFileServiceImpl implements IDcEventImportantFileSer private DcEventImportantFileMapper dcEventImportantFileMapper; @Autowired private DcEventProcessServiceImpl dcEventProcessService; + @Autowired + private DcEventServiceImpl dcEventService; + @Autowired + private DcEventMapper dcEventMapper; + @Autowired + private DcEventAccidentMapper dcEventAccidentMapper; + @Autowired + private DcEventTrafficCongestionMapper dcEventTrafficCongestionMapper; + @Autowired + private DcEventImportantMapper dcEventImportantMapper; /** * 查询重要事件文件内容 @@ -153,4 +166,225 @@ public class DcEventImportantFileServiceImpl implements IDcEventImportantFileSer return AjaxResult.success(num); } + /** + * @Description 生成重要事件文件内容 + * + * @author liuwenge + * @date 2024/5/8 15:51 + * @param eventId 事件id + * @param type 类型 1:初报,2续报,3终报 + * @return com.ruoyi.common.core.domain.AjaxResult + */ + @Override + public AjaxResult generate(String eventId,String type){ + + if (StringUtils.isEmpty(eventId) || StringUtils.isEmpty(type)){ + return AjaxResult.error("参数错误!"); + } + DcEvent dcEvent = dcEventMapper.selectDcEventById(eventId); + if (dcEvent == null){ + return AjaxResult.error("事件查询失败,请检查事件id是否正确!"); + } + String eventType = dcEvent.getEventType().toString(); + if ("1".equals(eventType) && "4".equals(eventType)){ + return AjaxResult.error("事件类型错误!"); + } + + DcEventImportantFile dcEventImportantFile = new DcEventImportantFile(); + dcEventImportantFile.setFromDept("齐鲁高速股份有限公司"); + SimpleDateFormat df = new SimpleDateFormat("yyyy年MM月dd日 HH时mm分"); + String createTime = df.format(new Date()); + dcEventImportantFile.setCreateTime(createTime); + + String title = "关于G35济菏高速" + dcEvent.getStakeMark() + "交通事故"; + if ("1".equals(type)){ + title += "的初报"; + } else if ("2".equals(type)){ + title += "的续报"; + } else if ("3".equals(type)){ + title += "的终报"; + } + dcEventImportantFile.setTitle(title); + + dcEventImportantFile.setToDept("智慧管理中心:"); + + String content = "\t" + df.format(dcEvent.getOccurrenceTime()) + ",G35济菏高速" + dcEvent.getStakeMark(); + if ("1".equals(dcEvent.getDirection()) || "菏泽方向".equals(dcEvent.getDirection())) { + content += "菏泽方向"; + } else if ("3".equals(dcEvent.getDirection()) || "济南方向".equals(dcEvent.getDirection())) { + content += "济南方向"; + } + content += "发生"; + if ("1-1".equals(dcEvent.getEventSubclass()) || "追尾".equals(dcEvent.getEventSubclass())) { + content += "追尾"; + } else if ("1-2".equals(dcEvent.getEventSubclass()) || "侧翻".equals(dcEvent.getEventSubclass())) { + content += "侧翻"; + } else if ("1-3".equals(dcEvent.getEventSubclass()) || "撞护栏".equals(dcEvent.getEventSubclass())) { + content += "撞护栏"; + } else if ("1-4".equals(dcEvent.getEventSubclass()) || "自燃".equals(dcEvent.getEventSubclass())) { + content += "自燃"; + } else if ("1-5".equals(dcEvent.getEventSubclass()) || "其他".equals(dcEvent.getEventSubclass())){ + content += "其他"; + } else if ("4-1".equals(dcEvent.getEventSubclass()) || "道路拥堵".equals(dcEvent.getEventSubclass())){ + content += "道路拥堵"; + } else if ("4-2".equals(dcEvent.getEventSubclass()) || "立交拥堵".equals(dcEvent.getEventSubclass())){ + content += "立交拥堵"; + } else if ("4-3".equals(dcEvent.getEventSubclass()) || "收费站拥堵".equals(dcEvent.getEventSubclass())){ + content += "收费站拥堵"; + } else if ("4-4".equals(dcEvent.getEventSubclass()) || "服务区拥堵".equals(dcEvent.getEventSubclass())){ + content += "服务区拥堵"; + } + content += "事故。"; + + if ("1".equals(type) || "2".equals(type)) { + + //占用车道 + if (StringUtils.isNotEmpty(dcEvent.getLang())) { + String[] langArr = dcEvent.getLang().split(","); + content += "事故占用"; + for (String lang : langArr) { + if ("0".equals(lang)) { + content += "应急车道、"; + } else if ("1".equals(lang)) { + content += "行1车道、"; + } else if ("2".equals(lang)) { + content += "行2车道、"; + } else if ("3".equals(lang)) { + content += "行3车道、"; + } else if ("4".equals(lang)) { + content += "行4车道、"; + } + } + content = content.substring(0, content.length() - 1); + content += ","; + + String[] langAll = {"1", "2", "3", "4", "0"}; + HashSet diff = new HashSet<>(Arrays.asList(langAll)); + diff.removeAll(Arrays.asList(langArr)); + for (String s : diff) { + if ("0".equals(s)) { + content += "应急车道、"; + } else if ("1".equals(s)) { + content += "行1车道、"; + } else if ("2".equals(s)) { + content += "行2车道、"; + } else if ("3".equals(s)) { + content += "行3车道、"; + } else if ("4".equals(s)) { + content += "行4车道、"; + } + } + content = content.substring(0, content.length() - 1); + content += "正常通行,"; + + + } else { + content += "行1车道、行2车道、行3车道、行4车道、应急车道正常通行,"; + } + + //压车情况 + if ("1".equals(eventType)) { + DcEventAccident dcEventAccident = dcEventAccidentMapper.selectDcEventAccidentById(eventId); + if (dcEventAccident != null && dcEventAccident.getTrafficJam() != null && dcEventAccident.getTrafficJam() > 0f) { + content += "压车" + dcEventAccident.getTrafficJam() + "公里。\n\t"; + } else { + content += "无压车。\n\t"; + } + } else if ("4".equals(eventType)){ + DcEventTrafficCongestion dcEventTrafficCongestion = dcEventTrafficCongestionMapper.selectDcEventTrafficCongestionById(eventId); + if (dcEventTrafficCongestion != null && dcEventTrafficCongestion.getCongestionMileage() != null && dcEventTrafficCongestion.getCongestionMileage() > 0f) { + content += "压车" + dcEventTrafficCongestion.getCongestionMileage() + "公里。\n\t"; + } else { + content += "无压车。\n\t"; + } + } + + //到达现场情况 + DcEventImportant dcEventImportant = dcEventImportantMapper.selectDcEventImportantByEventId(eventId); + if (dcEventImportant == null){ + dcEventImportant = new DcEventImportant(); + dcEventImportant.setEventId(eventId); + dcEventImportant.setTrafficPoliceStatus(0); + dcEventImportant.setMedicalStatus(0); + dcEventImportant.setFireStatus(0); + dcEventImportant.setBoardStatus(0); + dcEventImportantMapper.insertDcEventImportant(dcEventImportant); + } + if (StringUtils.isNotEmpty(dcEventImportant.getPlateNumber())) { + content += "现场事故车辆及车牌号信息:" + dcEventImportant.getPlateNumber() + "。"; + } + + String arrived = ""; + String notArrived = "路管、"; + if (dcEventImportant.getTrafficPoliceStatus() == 1) { + arrived += "交警、"; + } else { + notArrived += "交警、"; + } + if (dcEventImportant.getMedicalStatus() == 1) { + arrived += "医疗、"; + } else { + notArrived += "医疗、"; + } + if (dcEventImportant.getFireStatus() == 1) { + arrived += "消防、"; + } else { + notArrived += "消防、"; + } + if (arrived.length() > 0) { + arrived = arrived.substring(0, arrived.length() - 1); + content += arrived + "等单位已到达现场。"; + } + + + if (StringUtils.isNotEmpty(dcEventImportant.getCurrentProgress())) { + content += "事故目前处置进度为" + dcEventImportant.getCurrentProgress() + "。"; + } + if (StringUtils.isNotEmpty(dcEventImportant.getTakeSteps())) { + content += "已采取的措施:" + dcEventImportant.getTakeSteps() + "。"; + } + if (StringUtils.isNotEmpty(dcEventImportant.getTakeSteps())) { + content += "在" + dcEventImportant.getTakeSteps() + "进行分流。"; + } + + if (dcEventImportant.getBoardStatus() == 1) { + content += "事故点后方情报板已经做好信息提示。"; + } + content += "\n"; + + notArrived = notArrived.substring(0, notArrived.length() - 1); + content += "\t" + notArrived + "等单位正在赶往现场。"; + + if ("1".equals(type)) { + content += "具体情况稍后报告。"; + } else if ("2".equals(type)) { + if (dcEvent.getEstimatedEndTime() != null) { + SimpleDateFormat dateFormat = new SimpleDateFormat("HH时mm分"); + content += "预计结束时间为" + dateFormat.format(dcEvent.getEstimatedEndTime()) + "。"; + } + } + + dcEventImportantFile.setContent(content); + + + } else if ("3".equals(type)){ + content += "\n\t"; + SimpleDateFormat dateFormat = new SimpleDateFormat("HH时mm分"); + content += dateFormat.format(new Date()) + ",事故处理完毕,道路恢复畅通。"; + dcEventImportantFile.setContent(content); + + } else { + return AjaxResult.error("文件类型错误!"); + } + + + SysUser user = SecurityUtils.getLoginUser().getUser(); + dcEventImportantFile.setCreateName(user.getNickName()); + dcEventImportantFile.setPhoneNumber(user.getPhonenumber()); + dcEventImportantFile.setType(type); + dcEventImportantFile.setStatus("0"); + + return AjaxResult.success(dcEventImportantFile); + } + } diff --git a/zc-business/src/main/java/com/zc/business/utils/PoiUtil.java b/zc-business/src/main/java/com/zc/business/utils/PoiUtil.java index 5727021c..768f44ae 100644 --- a/zc-business/src/main/java/com/zc/business/utils/PoiUtil.java +++ b/zc-business/src/main/java/com/zc/business/utils/PoiUtil.java @@ -516,7 +516,17 @@ public class PoiUtil { //判断key在Map中是否存在 if (textMap.containsKey(runsText)) { if (value != null) { - run.setText(value.toString(), 0); + String valueStr = value.toString().replaceAll("\\\\t"," "); + String[] valueArr = valueStr.split("\\\\n"); + if (valueArr.length > 1) { + for (int index = 0; index < valueArr.length; index++) { + run.setText(valueArr[index], index); + run.addBreak(); + } + } else { + run.setText(valueStr,0); + } + } else { run.setText("", 0); } From 42e8f015fbedb743c95b01b43b2c4bd706f63f1d Mon Sep 17 00:00:00 2001 From: lau572 <1010031226@qq.com> Date: Thu, 9 May 2024 10:32:25 +0800 Subject: [PATCH 19/60] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=87=8D=E8=A6=81?= =?UTF-8?q?=E4=BA=8B=E4=BB=B6=E6=96=87=E4=BB=B6=E5=86=85=E5=AE=B9=E7=94=9F?= =?UTF-8?q?=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/DcEventImportantFileServiceImpl.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/zc-business/src/main/java/com/zc/business/service/impl/DcEventImportantFileServiceImpl.java b/zc-business/src/main/java/com/zc/business/service/impl/DcEventImportantFileServiceImpl.java index a9e2ed1d..f6ee4e7b 100644 --- a/zc-business/src/main/java/com/zc/business/service/impl/DcEventImportantFileServiceImpl.java +++ b/zc-business/src/main/java/com/zc/business/service/impl/DcEventImportantFileServiceImpl.java @@ -196,7 +196,7 @@ public class DcEventImportantFileServiceImpl implements IDcEventImportantFileSer String createTime = df.format(new Date()); dcEventImportantFile.setCreateTime(createTime); - String title = "关于G35济菏高速" + dcEvent.getStakeMark() + "交通事故"; + String title = "关于G35济菏高速" + dcEvent.getStakeMark() + dcEvent.getStringEventType(); if ("1".equals(type)){ title += "的初报"; } else if ("2".equals(type)){ @@ -223,7 +223,7 @@ public class DcEventImportantFileServiceImpl implements IDcEventImportantFileSer content += "撞护栏"; } else if ("1-4".equals(dcEvent.getEventSubclass()) || "自燃".equals(dcEvent.getEventSubclass())) { content += "自燃"; - } else if ("1-5".equals(dcEvent.getEventSubclass()) || "其他".equals(dcEvent.getEventSubclass())){ + } else if ("1-5".equals(dcEvent.getEventSubclass()) || "其他事故".equals(dcEvent.getEventSubclass())){ content += "其他"; } else if ("4-1".equals(dcEvent.getEventSubclass()) || "道路拥堵".equals(dcEvent.getEventSubclass())){ content += "道路拥堵"; @@ -383,6 +383,7 @@ public class DcEventImportantFileServiceImpl implements IDcEventImportantFileSer dcEventImportantFile.setPhoneNumber(user.getPhonenumber()); dcEventImportantFile.setType(type); dcEventImportantFile.setStatus("0"); + dcEventImportantFile.setEventId(eventId); return AjaxResult.success(dcEventImportantFile); } From 0a3336637acab203e9c3bc6e32fac122b08dba85 Mon Sep 17 00:00:00 2001 From: lau572 <1010031226@qq.com> Date: Thu, 9 May 2024 10:42:06 +0800 Subject: [PATCH 20/60] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=87=8D=E8=A6=81?= =?UTF-8?q?=E4=BA=8B=E4=BB=B6=E6=96=87=E4=BB=B6=E5=86=85=E5=AE=B9=E7=94=9F?= =?UTF-8?q?=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/DcEventImportantFileServiceImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zc-business/src/main/java/com/zc/business/service/impl/DcEventImportantFileServiceImpl.java b/zc-business/src/main/java/com/zc/business/service/impl/DcEventImportantFileServiceImpl.java index f6ee4e7b..251de5de 100644 --- a/zc-business/src/main/java/com/zc/business/service/impl/DcEventImportantFileServiceImpl.java +++ b/zc-business/src/main/java/com/zc/business/service/impl/DcEventImportantFileServiceImpl.java @@ -343,8 +343,8 @@ public class DcEventImportantFileServiceImpl implements IDcEventImportantFileSer if (StringUtils.isNotEmpty(dcEventImportant.getTakeSteps())) { content += "已采取的措施:" + dcEventImportant.getTakeSteps() + "。"; } - if (StringUtils.isNotEmpty(dcEventImportant.getTakeSteps())) { - content += "在" + dcEventImportant.getTakeSteps() + "进行分流。"; + if (StringUtils.isNotEmpty(dcEventImportant.getDiversionPoint())) { + content += "在" + dcEventImportant.getDiversionPoint() + "进行分流。"; } if (dcEventImportant.getBoardStatus() == 1) { From ff11c2ef668ba8cbc76c80fdee484737766e23e7 Mon Sep 17 00:00:00 2001 From: lau572 <1010031226@qq.com> Date: Thu, 9 May 2024 11:09:38 +0800 Subject: [PATCH 21/60] =?UTF-8?q?word=E7=94=9F=E6=88=90=E5=B7=A5=E5=85=B7?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- zc-business/src/main/java/com/zc/business/utils/PoiUtil.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zc-business/src/main/java/com/zc/business/utils/PoiUtil.java b/zc-business/src/main/java/com/zc/business/utils/PoiUtil.java index 768f44ae..a85915f2 100644 --- a/zc-business/src/main/java/com/zc/business/utils/PoiUtil.java +++ b/zc-business/src/main/java/com/zc/business/utils/PoiUtil.java @@ -521,7 +521,7 @@ public class PoiUtil { if (valueArr.length > 1) { for (int index = 0; index < valueArr.length; index++) { run.setText(valueArr[index], index); - run.addBreak(); + run.addCarriageReturn(); } } else { run.setText(valueStr,0); From 55a4c53051868c0438268affda416114e71a6900 Mon Sep 17 00:00:00 2001 From: zhaoxianglong Date: Thu, 9 May 2024 11:30:26 +0800 Subject: [PATCH 22/60] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E8=AE=BE=E5=A4=87?= =?UTF-8?q?=E5=AF=BC=E5=87=BA=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/DcDeviceController.java | 16 ++++++++++++ .../java/com/zc/business/domain/DcDevice.java | 26 +++++++++++++++++++ 2 files changed, 42 insertions(+) diff --git a/zc-business/src/main/java/com/zc/business/controller/DcDeviceController.java b/zc-business/src/main/java/com/zc/business/controller/DcDeviceController.java index 8a746918..3ab0011e 100644 --- a/zc-business/src/main/java/com/zc/business/controller/DcDeviceController.java +++ b/zc-business/src/main/java/com/zc/business/controller/DcDeviceController.java @@ -11,6 +11,7 @@ import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.common.utils.poi.ExcelUtil; import com.zc.business.constant.DeviceTypeConstants; import com.zc.business.domain.DcDevice; import com.zc.business.interfaces.OperationLog; @@ -30,6 +31,7 @@ import org.springframework.util.StringUtils; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; +import javax.servlet.http.HttpServletResponse; import javax.validation.Valid; import java.io.IOException; import java.util.*; @@ -182,6 +184,20 @@ public class DcDeviceController extends BaseController { } + /** + * 导出 + * @param response 响应 + * @param iotDevice 导入数据结果 + */ + @PreAuthorize("@ss.hasPermi('iot:device:export')") + @Log(title = "导出设备", businessType = BusinessType.EXPORT) + @PostMapping("export") + public void exportDevice(HttpServletResponse response, DcDevice iotDevice) { + List list = dcDeviceService.listDevice(iotDevice); + ExcelUtil util = new ExcelUtil<>(DcDevice.class); + util.exportExcel(response, list, "设备数据"); + } + //***********************************物联设备接口************************************** diff --git a/zc-business/src/main/java/com/zc/business/domain/DcDevice.java b/zc-business/src/main/java/com/zc/business/domain/DcDevice.java index ed37f702..0bd60eb7 100644 --- a/zc-business/src/main/java/com/zc/business/domain/DcDevice.java +++ b/zc-business/src/main/java/com/zc/business/domain/DcDevice.java @@ -3,6 +3,7 @@ package com.zc.business.domain; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; +import com.ruoyi.common.annotation.Excel; import com.zc.business.utils.StakeMarkUtils; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; @@ -28,55 +29,80 @@ public class DcDevice { public static final String ONLINE = "1"; @ApiModelProperty("ID") + @Excel(name = "设备ID") @TableId(value = "id", type = IdType.AUTO) private Long id; @ApiModelProperty("物联设备ID") + @Excel(name = "物联设备ID") private String iotDeviceId; @ApiModelProperty("组ID") + @Excel(name = "组ID") private Long groupId; @ApiModelProperty("产品ID") + @Excel(name = "产品ID") private Long productId; @ApiModelProperty("桩号") + @Excel(name = "桩号") private String stakeMark; @ApiModelProperty("方向1-上行(菏泽方向),2-中,3-下行(济南方向)") + @Excel(name = "方向") private String direction; @ApiModelProperty("设备名称") + @Excel(name = "设备名称") private String deviceName; @ApiModelProperty("设备编号") + @Excel(name = "设备编号") private String deviceCode; @ApiModelProperty("设备类型") + @Excel(name = "设备类型") private String deviceType; @ApiModelProperty("所属网段") + @Excel(name = "所属网段") private String networkSegment; @ApiModelProperty("设备图片") + @Excel(name = "设备图片") private String deviceImg; @ApiModelProperty("安装日期") + @Excel(name = "安装日期") private Date installationDate; @ApiModelProperty("生产日期") + @Excel(name = "生产日期") private Date productionDate; @ApiModelProperty("使用年限") + @Excel(name = "使用年限") private String durableYears; @ApiModelProperty("安装位置") + @Excel(name = "安装位置") private String installationSite; @ApiModelProperty("设备状态") + @Excel(name = "设备状态") private String deviceState; @ApiModelProperty("使用状态") + @Excel(name = "使用状态") private Integer useState; @ApiModelProperty("其他配置") + @Excel(name = "其他配置") private String otherConfig; @ApiModelProperty("备注") + @Excel(name = "备注") private String remark; @ApiModelProperty("设施归属类型(0:默认1: 道路沿线2:桥梁3: 隧道4:收费广场5: 收费站6: 服务区等") + @Excel(name = "设施归属类型") private String facilitiesType; @ApiModelProperty("设备ip") + @Excel(name = "设备ip") private String deviceIp; @ApiModelProperty("范围桩号") + @Excel(name = "范围桩号") private String stakeMarkRange; @ApiModelProperty("创建时间") + @Excel(name = "创建时间") private Date createTime; @ApiModelProperty("修改时间") + @Excel(name = "修改时间") private Date updateTime; @ApiModelProperty("子类型") + @Excel(name = "子类型") private String childType; @TableField(exist = false) private String longitude; From bf2a13f8587a759b691d402aa423bb0f73b21a4f Mon Sep 17 00:00:00 2001 From: "Mr.Wang" Date: Thu, 9 May 2024 16:03:00 +0800 Subject: [PATCH 23/60] =?UTF-8?q?=E6=8E=A8=E9=80=81=E8=AE=BE=E5=A4=87?= =?UTF-8?q?=E7=8A=B6=E6=80=81=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../business/message/device/handler/DeviceMessageHandler.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/zc-business/src/main/java/com/zc/business/message/device/handler/DeviceMessageHandler.java b/zc-business/src/main/java/com/zc/business/message/device/handler/DeviceMessageHandler.java index 805ab2c3..77310221 100644 --- a/zc-business/src/main/java/com/zc/business/message/device/handler/DeviceMessageHandler.java +++ b/zc-business/src/main/java/com/zc/business/message/device/handler/DeviceMessageHandler.java @@ -16,6 +16,7 @@ import com.zc.business.enums.WarningSourceEnum; import com.zc.business.enums.WarningStateEnum; import com.zc.business.enums.WarningSubclassEnum; import com.zc.business.service.*; +import com.zc.common.core.websocket.WebSocketService; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -38,6 +39,8 @@ public class DeviceMessageHandler { private final int EVENT_STATE = 1; private final int EVENTEND_STATE = 4; private final int VISIBILITY_LEVEL = 8; + private final String DEVICE_STATE = "deviceState"; + private final Logger logger = LoggerFactory.getLogger(this.getClass()); @Resource @@ -77,6 +80,7 @@ public class DeviceMessageHandler { // 批量更新设备状态 dcDeviceService.batchUpdate(dcDevices); + WebSocketService.broadcast(DEVICE_STATE, dcDevices); //推送设备状态更新 // 批量更新中间库设备状态 middleDatabaseService.updateMiddleDatabaseDeviceByList(dcDevices); } From ab56f755de3376d632b6ec82d39da93f5bac4100 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, 9 May 2024 17:35:18 +0800 Subject: [PATCH 24/60] =?UTF-8?q?=E6=94=B6=E8=B4=B9=E8=BF=90=E8=90=A5=20?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/AESEncryptionController.java | 53 +++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 zc-business/src/main/java/com/zc/business/controller/AESEncryptionController.java diff --git a/zc-business/src/main/java/com/zc/business/controller/AESEncryptionController.java b/zc-business/src/main/java/com/zc/business/controller/AESEncryptionController.java new file mode 100644 index 00000000..9d2cf0b0 --- /dev/null +++ b/zc-business/src/main/java/com/zc/business/controller/AESEncryptionController.java @@ -0,0 +1,53 @@ +package com.zc.business.controller; + +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.utils.SecurityUtils; +import com.ruoyi.system.service.ISysConfigService; +import io.swagger.annotations.Api; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import javax.crypto.Cipher; +import javax.crypto.spec.IvParameterSpec; +import javax.crypto.spec.SecretKeySpec; +import java.nio.charset.StandardCharsets; +import java.util.Base64; + +/** + * + */ +@Api(tags = "收费运营接口") +@RestController +@RequestMapping("/AESEncryption") +public class AESEncryptionController extends BaseController { + @Autowired + private ISysConfigService configService; + + @GetMapping() + public AjaxResult AESEncryption() throws Exception{ + String secretKey= configService.selectConfigByKey("AESKey");//密钥 + String iv= configService.selectConfigByKey("AESIv");// 偏移量(初始化向量) + String plainText = SecurityUtils.getLoginUser().getUser().getRoles().get(0).getRoleKey(); // 要加密的文本 + // 转换密钥和IV为字节数组 + byte[] keyBytes = secretKey.getBytes(StandardCharsets.UTF_8); + byte[] ivBytes = iv.getBytes(StandardCharsets.UTF_8); + // 创建密钥规格 + SecretKeySpec keySpec = new SecretKeySpec(keyBytes, "AES"); + // 创建初始化向量规格 + IvParameterSpec ivSpec = new IvParameterSpec(ivBytes); + // 创建并初始化Cipher对象,指定为AES/CBC/PKCS5Padding模式 + Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5Padding"); + cipher.init(Cipher.ENCRYPT_MODE, keySpec, ivSpec); + // 将要加密的文本转换为字节数组 + byte[] plainBytes = plainText.getBytes(StandardCharsets.UTF_8); + // 执行加密操作 + byte[] encryptedBytes = cipher.doFinal(plainBytes); + // 将加密后的字节数组使用Base64编码,并输出为字符串 + String encryptedBase64 = Base64.getEncoder().encodeToString(encryptedBytes); + String url=configService.selectConfigByKey("AESEncryption")+encryptedBase64; + return AjaxResult.success(url); + } +} From 14160b1cd34a3f959280e1e5428c86d891a36500 Mon Sep 17 00:00:00 2001 From: zhaoxianglong Date: Thu, 9 May 2024 18:14:39 +0800 Subject: [PATCH 25/60] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=93=8D=E4=BD=9C?= =?UTF-8?q?=E8=AE=B0=E5=BD=95=E6=9F=A5=E8=AF=A2=E6=9D=A1=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/zc/business/service/impl/DcOperLogServiceImpl.java | 3 +++ 1 file changed, 3 insertions(+) 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 4972cf88..a7ca7493 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 @@ -69,6 +69,9 @@ public class DcOperLogServiceImpl extends ServiceImpl Date: Thu, 9 May 2024 18:38:39 +0800 Subject: [PATCH 26/60] =?UTF-8?q?=E5=88=A0=E9=99=A4=E4=BA=8B=E4=BB=B6=20?= =?UTF-8?q?=E4=BA=8B=E4=BB=B6=E6=9F=A5=E8=AF=A2=E4=B8=BA=E7=A9=BA=E8=B7=B3?= =?UTF-8?q?=E5=87=BA=E5=BE=AA=E7=8E=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/zc/business/service/impl/DcEventServiceImpl.java | 3 +++ 1 file changed, 3 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 9ed91296..4f67491b 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 @@ -745,6 +745,9 @@ public class DcEventServiceImpl extends ServiceImpl impl int i7 = -1; for (String id : ids) { DcEvent dcEvent = dcEventMapper.selectDcEventMainById(id); + if (dcEvent==null){ + continue; + } int eventType = Math.toIntExact(dcEvent.getEventType()); i7 = dcEventMapper.deleteDcEventById(id); From f71b94889a0ccd3d9f46de48990e6af7f8ed76eb Mon Sep 17 00:00:00 2001 From: wangsixiang <2970484253@qq.com> Date: Thu, 9 May 2024 19:46:45 +0800 Subject: [PATCH 27/60] =?UTF-8?q?=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/DcPublishManageController.java | 11 ++++++++++- .../com/zc/business/mapper/DcPublishManageMapper.java | 5 ++++- .../zc/business/service/IDcPublishManageService.java | 2 ++ .../service/impl/DcPublishManageServiceImpl.java | 5 +++++ 4 files changed, 21 insertions(+), 2 deletions(-) diff --git a/zc-business/src/main/java/com/zc/business/controller/DcPublishManageController.java b/zc-business/src/main/java/com/zc/business/controller/DcPublishManageController.java index 86b185ba..33ac456d 100644 --- a/zc-business/src/main/java/com/zc/business/controller/DcPublishManageController.java +++ b/zc-business/src/main/java/com/zc/business/controller/DcPublishManageController.java @@ -1,5 +1,6 @@ package com.zc.business.controller; +import java.util.HashMap; import java.util.List; import javax.servlet.http.HttpServletResponse; @@ -132,5 +133,13 @@ public class DcPublishManageController extends BaseController { return AjaxResult.success(dcPublishManageService.releaseTrendsPublishManage()); } - + //统计服务,月发布渠道趋势分析 + @PostMapping("/monthTrendsPublishManage") + public AjaxResult monthTrendsPublishManage(@RequestBody DcPublishManage dcPublishManage) + { + if (dcPublishManage==null||dcPublishManage.getPublishTime()==null){ + return AjaxResult.error("参数错误"); + } + return AjaxResult.success(dcPublishManageService.monthTrendsPublishManage(dcPublishManage)); + } } 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 7076aaf3..28263919 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 @@ -53,7 +53,8 @@ public interface DcPublishManageMapper * @return 结果 */ int deleteDcPublishManageById(Long id); - + //删除事件发布记录 params 事件id + int deleteDcPublishManageEventId(String eventId); /** * 批量删除信息发布管理记录 * @@ -73,4 +74,6 @@ public interface DcPublishManageMapper public List> eventTypePublishManage(); //统计今日发布趋势分析 public List> releaseTrendsPublishManage(); + //统计月发布趋势分析 + public List> monthTrendsPublishManage(DcPublishManage dcPublishManage); } diff --git a/zc-business/src/main/java/com/zc/business/service/IDcPublishManageService.java b/zc-business/src/main/java/com/zc/business/service/IDcPublishManageService.java index a0333386..18c2165b 100644 --- a/zc-business/src/main/java/com/zc/business/service/IDcPublishManageService.java +++ b/zc-business/src/main/java/com/zc/business/service/IDcPublishManageService.java @@ -66,4 +66,6 @@ public interface IDcPublishManageService public List> eventTypePublishManage(); //统计今日发布趋势分析 public List> releaseTrendsPublishManage(); + //统计月发布趋势分析 + public List> monthTrendsPublishManage(DcPublishManage dcPublishManage); } diff --git a/zc-business/src/main/java/com/zc/business/service/impl/DcPublishManageServiceImpl.java b/zc-business/src/main/java/com/zc/business/service/impl/DcPublishManageServiceImpl.java index a6602b50..808c7e30 100644 --- a/zc-business/src/main/java/com/zc/business/service/impl/DcPublishManageServiceImpl.java +++ b/zc-business/src/main/java/com/zc/business/service/impl/DcPublishManageServiceImpl.java @@ -125,4 +125,9 @@ public class DcPublishManageServiceImpl implements IDcPublishManageService public List> releaseTrendsPublishManage() { return dcPublishManageMapper.releaseTrendsPublishManage(); } + //统计月发布趋势分析 + @Override + public List> monthTrendsPublishManage(DcPublishManage dcPublishManage) { + return dcPublishManageMapper.monthTrendsPublishManage(dcPublishManage); + } } From 88bd49c1ff0a54d4a802c678de5648e65426d5fd Mon Sep 17 00:00:00 2001 From: wangsixiang <2970484253@qq.com> Date: Thu, 9 May 2024 19:47:05 +0800 Subject: [PATCH 28/60] =?UTF-8?q?=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapper/business/DcPublishManageMapper.xml | 31 ++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/zc-business/src/main/resources/mapper/business/DcPublishManageMapper.xml b/zc-business/src/main/resources/mapper/business/DcPublishManageMapper.xml index 8db6431a..d6df52a6 100644 --- a/zc-business/src/main/resources/mapper/business/DcPublishManageMapper.xml +++ b/zc-business/src/main/resources/mapper/business/DcPublishManageMapper.xml @@ -185,13 +185,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" delete from dc_publish_manage where id = #{id} - + + delete from dc_publish_manage where event_id = #{eventId} + delete from dc_publish_manage where id in #{id} + + \ No newline at end of file From 2c155937c76f67adc0ec0decd43352bcd0c85c6f 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, 9 May 2024 19:48:51 +0800 Subject: [PATCH 29/60] =?UTF-8?q?=E5=88=A0=E9=99=A4=E4=BA=8B=E4=BB=B6?= =?UTF-8?q?=E5=85=B3=E8=81=94=E4=BF=A1=E6=81=AF=E5=8F=91=E5=B8=83=E5=88=A0?= =?UTF-8?q?=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/zc/business/service/impl/DcEventServiceImpl.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 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 4f67491b..6ef7a01f 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 @@ -77,6 +77,9 @@ public class DcEventServiceImpl extends ServiceImpl impl @Autowired private IDcEventProcessService dcEventProcessService; + @Autowired + private DcPublishManageMapper dcPublishManageMapper; + private final String HAPPEN = "发生"; private final String EVENT = "事件"; private final String SUBEVENT = "0"; @@ -216,7 +219,7 @@ public class DcEventServiceImpl extends ServiceImpl impl //交通管制 case 3: if (dcEvent.getDcEventTrafficControl() != null) { - //TODO 插入多个收费站 + // 插入多个收费站 if (dcEvent.getDcEventTrafficControl().getFacilityIds().length == 1) {//facilityIds==1 说明只选择了一个收费站 if (dcEventId != null && !dcEventId.equals("")) {//不等于空 事件处置页面 修改 @@ -748,6 +751,8 @@ public class DcEventServiceImpl extends ServiceImpl impl if (dcEvent==null){ continue; } + // 删除信息发布记录 + dcPublishManageMapper.deleteDcPublishManageEventId(id); int eventType = Math.toIntExact(dcEvent.getEventType()); i7 = dcEventMapper.deleteDcEventById(id); @@ -830,7 +835,7 @@ public class DcEventServiceImpl extends ServiceImpl impl */ @Override public DcEvent selectEventSubclassById(int eventType, String id) { - //todo + // DcEvent dcEvent = dcEventMapper.selectDcEventById(id); List processConfigList = dcProcessConfigMapper.selectDcProcessConfigByEventType(Math.toIntExact(dcEvent.getEventType())); dcEvent.setProcessConfigList(processConfigList); From 5d7543b2bbaeb1e9576bad894effa4ad5126893f Mon Sep 17 00:00:00 2001 From: zhaoxianglong Date: Thu, 9 May 2024 21:01:06 +0800 Subject: [PATCH 30/60] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=B0=83=E7=94=A8?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/zc/business/controller/DcDeviceController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zc-business/src/main/java/com/zc/business/controller/DcDeviceController.java b/zc-business/src/main/java/com/zc/business/controller/DcDeviceController.java index 3ab0011e..ab94bd0a 100644 --- a/zc-business/src/main/java/com/zc/business/controller/DcDeviceController.java +++ b/zc-business/src/main/java/com/zc/business/controller/DcDeviceController.java @@ -517,7 +517,7 @@ public class DcDeviceController extends BaseController { resultArray.add(result); AjaxResult ajaxResult = (AjaxResult) result.get("result"); if (!Objects.equals(String.valueOf(ajaxResult.get("code")), "200")) { - return AjaxResult.error(); + return AjaxResult.error(200,"500"); } } } From 3ea7e9d0d88fe121ee34f04debcea71308210ef6 Mon Sep 17 00:00:00 2001 From: "Mr.Wang" Date: Fri, 10 May 2024 08:52:28 +0800 Subject: [PATCH 31/60] =?UTF-8?q?=E6=8E=A8=E9=80=81=E8=AE=BE=E5=A4=87?= =?UTF-8?q?=E7=8A=B6=E6=80=81=E6=9B=B4=E6=96=B0=E6=B6=88=E6=81=AF=E4=B8=AD?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=AE=BE=E5=A4=87=E7=BC=96=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../message/device/handler/DeviceMessageHandler.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/zc-business/src/main/java/com/zc/business/message/device/handler/DeviceMessageHandler.java b/zc-business/src/main/java/com/zc/business/message/device/handler/DeviceMessageHandler.java index 77310221..59ca08df 100644 --- a/zc-business/src/main/java/com/zc/business/message/device/handler/DeviceMessageHandler.java +++ b/zc-business/src/main/java/com/zc/business/message/device/handler/DeviceMessageHandler.java @@ -21,6 +21,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.util.ObjectUtils; import javax.annotation.Resource; import java.text.ParseException; @@ -79,6 +80,12 @@ public class DeviceMessageHandler { // 批量更新设备状态 dcDeviceService.batchUpdate(dcDevices); + dcDevices.forEach(dcDevice -> { + DcDevice device = redisCache.getCacheMapValue(RedisKeyConstants.DC_DEVICES, dcDevice.getIotDeviceId()); + if (!ObjectUtils.isEmpty(device)) { + dcDevice.setId(device.getId()); + } + }); WebSocketService.broadcast(DEVICE_STATE, dcDevices); //推送设备状态更新 // 批量更新中间库设备状态 From adca995427cd0884c4e1380cc2f1767087d4064f Mon Sep 17 00:00:00 2001 From: lau572 <1010031226@qq.com> Date: Fri, 10 May 2024 15:17:01 +0800 Subject: [PATCH 32/60] =?UTF-8?q?=E9=87=8D=E8=A6=81=E4=BA=8B=E4=BB=B6?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E5=86=85=E5=AE=B9=E5=8F=82=E6=95=B0=E9=AA=8C?= =?UTF-8?q?=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DcEventImportantFileController.java | 4 ++-- .../service/IDcEventImportantFileService.java | 4 ++-- .../impl/DcEventImportantFileServiceImpl.java | 17 +++++++++++++---- 3 files changed, 17 insertions(+), 8 deletions(-) diff --git a/zc-business/src/main/java/com/zc/business/controller/DcEventImportantFileController.java b/zc-business/src/main/java/com/zc/business/controller/DcEventImportantFileController.java index 29d8cf4a..e276c604 100644 --- a/zc-business/src/main/java/com/zc/business/controller/DcEventImportantFileController.java +++ b/zc-business/src/main/java/com/zc/business/controller/DcEventImportantFileController.java @@ -132,7 +132,7 @@ public class DcEventImportantFileController extends BaseController @PostMapping public AjaxResult add(@RequestBody DcEventImportantFile dcEventImportantFile) { - return toAjax(dcEventImportantFileService.insertDcEventImportantFile(dcEventImportantFile)); + return dcEventImportantFileService.insertDcEventImportantFile(dcEventImportantFile); } /** @@ -143,7 +143,7 @@ public class DcEventImportantFileController extends BaseController @PutMapping public AjaxResult edit(@RequestBody DcEventImportantFile dcEventImportantFile) { - return toAjax(dcEventImportantFileService.updateDcEventImportantFile(dcEventImportantFile)); + return dcEventImportantFileService.updateDcEventImportantFile(dcEventImportantFile); } /** diff --git a/zc-business/src/main/java/com/zc/business/service/IDcEventImportantFileService.java b/zc-business/src/main/java/com/zc/business/service/IDcEventImportantFileService.java index bc862eb3..b1653132 100644 --- a/zc-business/src/main/java/com/zc/business/service/IDcEventImportantFileService.java +++ b/zc-business/src/main/java/com/zc/business/service/IDcEventImportantFileService.java @@ -35,7 +35,7 @@ public interface IDcEventImportantFileService * @param dcEventImportantFile 重要事件文件内容 * @return 结果 */ - int insertDcEventImportantFile(DcEventImportantFile dcEventImportantFile); + AjaxResult insertDcEventImportantFile(DcEventImportantFile dcEventImportantFile); /** * 修改重要事件文件内容 @@ -43,7 +43,7 @@ public interface IDcEventImportantFileService * @param dcEventImportantFile 重要事件文件内容 * @return 结果 */ - int updateDcEventImportantFile(DcEventImportantFile dcEventImportantFile); + AjaxResult updateDcEventImportantFile(DcEventImportantFile dcEventImportantFile); /** * 批量删除重要事件文件内容 diff --git a/zc-business/src/main/java/com/zc/business/service/impl/DcEventImportantFileServiceImpl.java b/zc-business/src/main/java/com/zc/business/service/impl/DcEventImportantFileServiceImpl.java index 251de5de..799dadea 100644 --- a/zc-business/src/main/java/com/zc/business/service/impl/DcEventImportantFileServiceImpl.java +++ b/zc-business/src/main/java/com/zc/business/service/impl/DcEventImportantFileServiceImpl.java @@ -72,8 +72,11 @@ public class DcEventImportantFileServiceImpl implements IDcEventImportantFileSer * @return 结果 */ @Override - public int insertDcEventImportantFile(DcEventImportantFile dcEventImportantFile) + public AjaxResult insertDcEventImportantFile(DcEventImportantFile dcEventImportantFile) { + if (StringUtils.isEmpty(dcEventImportantFile.getEventId())){ + return AjaxResult.error("事件id不能为空!"); + } int i = dcEventImportantFileMapper.insertDcEventImportantFile(dcEventImportantFile); if (i > 0){ if (StringUtils.isNotEmpty(dcEventImportantFile.getStatus()) && "1".equals(dcEventImportantFile.getStatus())) { @@ -94,8 +97,9 @@ public class DcEventImportantFileServiceImpl implements IDcEventImportantFileSer dcEventProcess.setContext(context); dcEventProcessService.insertDcEventProcess(dcEventProcess); } + return AjaxResult.success("新增成功!"); } - return i; + return AjaxResult.error("新增失败!"); } /** @@ -105,8 +109,11 @@ public class DcEventImportantFileServiceImpl implements IDcEventImportantFileSer * @return 结果 */ @Override - public int updateDcEventImportantFile(DcEventImportantFile dcEventImportantFile) + public AjaxResult updateDcEventImportantFile(DcEventImportantFile dcEventImportantFile) { + if (dcEventImportantFile.getId() == null || StringUtils.isEmpty(dcEventImportantFile.getEventId())){ + return AjaxResult.error("参数错误!"); + } int i = dcEventImportantFileMapper.updateDcEventImportantFile(dcEventImportantFile); if (i > 0){ if (StringUtils.isNotEmpty(dcEventImportantFile.getStatus()) && "1".equals(dcEventImportantFile.getStatus())){ @@ -126,8 +133,10 @@ public class DcEventImportantFileServiceImpl implements IDcEventImportantFileSer dcEventProcess.setContext(context); dcEventProcessService.insertDcEventProcess(dcEventProcess); } + return AjaxResult.success("修改成功"); + } - return i; + return AjaxResult.error("修改失败"); } /** From cff0cc6378c571bc5fe1eacff24219d890f62106 Mon Sep 17 00:00:00 2001 From: lau572 <1010031226@qq.com> Date: Fri, 10 May 2024 15:34:01 +0800 Subject: [PATCH 33/60] =?UTF-8?q?=E8=B7=B3=E8=BF=87=E6=B8=85=E9=9A=9C=20?= =?UTF-8?q?=E4=BA=8B=E4=BB=B6=E7=B1=BB=E5=9E=8B=E9=AA=8C=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/zc/business/service/impl/DcEventServiceImpl.java | 4 ++++ 1 file changed, 4 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 6ef7a01f..1c6d7623 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 @@ -1426,6 +1426,10 @@ public class DcEventServiceImpl extends ServiceImpl impl if (i > 0) { return AjaxResult.error("已跳过清障,无法重复操作!"); } + DcEvent dcEvent = dcEventMapper.selectDcEventById(eventId); + if (dcEvent.getEventType() == null || (dcEvent.getEventType() != 1 && dcEvent.getEventType() != 2 && dcEvent.getEventType() != 6)){ + return AjaxResult.error("该事件类型无需清障!"); + } //事件处置流程记录 DcEventProcess dcEventProcess = new DcEventProcess(); From 8257d5f87a9943aaaf5536ce707fc9891ce95bc3 Mon Sep 17 00:00:00 2001 From: lau572 <1010031226@qq.com> Date: Fri, 10 May 2024 15:47:54 +0800 Subject: [PATCH 34/60] =?UTF-8?q?=E8=B7=B3=E8=BF=87=E6=B8=85=E9=9A=9C=20?= =?UTF-8?q?=E4=BA=8B=E4=BB=B6=E7=8A=B6=E6=80=81=E9=AA=8C=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/zc/business/service/impl/DcEventServiceImpl.java | 4 ++++ 1 file changed, 4 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 1c6d7623..be761f69 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,6 +6,7 @@ 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.StringUtils; import com.ruoyi.common.utils.uuid.IdUtils; import com.ruoyi.system.service.ISysDeptService; import com.zc.business.domain.*; @@ -1430,6 +1431,9 @@ public class DcEventServiceImpl extends ServiceImpl impl if (dcEvent.getEventType() == null || (dcEvent.getEventType() != 1 && dcEvent.getEventType() != 2 && dcEvent.getEventType() != 6)){ return AjaxResult.error("该事件类型无需清障!"); } + if (dcEvent.getEventState() != null && dcEvent.getEventState() == 2){ + return AjaxResult.error("该事件已结束,无法进行操作!"); + } //事件处置流程记录 DcEventProcess dcEventProcess = new DcEventProcess(); From ac54b69a08912e87a04b918996121eac5a2799b0 Mon Sep 17 00:00:00 2001 From: "Mr.Wang" Date: Fri, 10 May 2024 16:17:35 +0800 Subject: [PATCH 35/60] =?UTF-8?q?=E6=9B=B4=E6=94=B9=E4=BA=8B=E4=BB=B6?= =?UTF-8?q?=E9=A2=84=E6=A1=88=E5=85=B3=E8=81=94=E8=A1=A8id=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/zc/business/domain/EventPlanAssoc.java | 2 +- .../impl/DcEmergencyPlansServiceImpl.java | 2 -- .../mapper/business/EventPlanAssocMapper.xml | 16 +++++++++++++--- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/zc-business/src/main/java/com/zc/business/domain/EventPlanAssoc.java b/zc-business/src/main/java/com/zc/business/domain/EventPlanAssoc.java index d41b8c5d..98b5f157 100644 --- a/zc-business/src/main/java/com/zc/business/domain/EventPlanAssoc.java +++ b/zc-business/src/main/java/com/zc/business/domain/EventPlanAssoc.java @@ -22,7 +22,7 @@ import java.util.Date; public class EventPlanAssoc { @ApiModelProperty("预案事件关联id") - private String id; + private Long id; /** * 所属事件编号 */ 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 6a61c259..c0dddd88 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 @@ -743,8 +743,6 @@ public class DcEmergencyPlansServiceImpl implements DcEmergencyPlansService { eventPlanAssoc.setControlDevice(deviceIds.toString().replaceFirst(";", "")); eventPlanAssoc.setControlResult(resultArray.toJSONString()); eventPlanAssoc.setCreateTime(DateUtils.getNowDate()); - // IdUtils.fastSimpleUUID() - eventPlanAssoc.setId(IdUtils.fastSimpleUUID()); eventPlanAssocMapper.insertEventPlanAssoc(eventPlanAssoc); resultObject.put("eventPlanAssocId",eventPlanAssoc.getId()); }else { diff --git a/zc-business/src/main/resources/mapper/business/EventPlanAssocMapper.xml b/zc-business/src/main/resources/mapper/business/EventPlanAssocMapper.xml index 58efcd2c..abda69d3 100644 --- a/zc-business/src/main/resources/mapper/business/EventPlanAssocMapper.xml +++ b/zc-business/src/main/resources/mapper/business/EventPlanAssocMapper.xml @@ -4,10 +4,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - + + + + + + + + + + + + insert into event_plan_assoc - id, event_id, emergency_plans_id, control_device, @@ -17,7 +28,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" control_result, - #{id}, #{eventId}, #{emergencyPlansId}, #{controlDevice}, From 613a81a88dfcf9b4327b7c2a84c458a6ab49be77 Mon Sep 17 00:00:00 2001 From: lau572 <1010031226@qq.com> Date: Sat, 11 May 2024 16:17:40 +0800 Subject: [PATCH 36/60] =?UTF-8?q?=E4=BA=8B=E4=BB=B6=E5=A4=84=E7=BD=AE?= =?UTF-8?q?=E8=AE=B0=E5=BD=95?= 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, 6 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 be761f69..970b0110 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 @@ -1423,10 +1423,7 @@ public class DcEventServiceImpl extends ServiceImpl impl @Override public AjaxResult skipClear(String eventId) { - int i = dcEventMapper.selectClearInfo(eventId); - if (i > 0) { - return AjaxResult.error("已跳过清障,无法重复操作!"); - } + DcEvent dcEvent = dcEventMapper.selectDcEventById(eventId); if (dcEvent.getEventType() == null || (dcEvent.getEventType() != 1 && dcEvent.getEventType() != 2 && dcEvent.getEventType() != 6)){ return AjaxResult.error("该事件类型无需清障!"); @@ -1434,6 +1431,10 @@ public class DcEventServiceImpl extends ServiceImpl impl if (dcEvent.getEventState() != null && dcEvent.getEventState() == 2){ return AjaxResult.error("该事件已结束,无法进行操作!"); } + int i = dcEventMapper.selectClearInfo(eventId); + if (i > 0) { + return AjaxResult.error("该事件已清障结束,无法进行操作!"); + } //事件处置流程记录 DcEventProcess dcEventProcess = new DcEventProcess(); @@ -1443,7 +1444,7 @@ public class DcEventServiceImpl extends ServiceImpl impl dcEventProcess.setProcessId(6L); dcEventProcess.setProcessName("清障结束"); - dcEventProcess.setContext("选择不需要清障"); + dcEventProcess.setContext("选择无需清障"); dcEventProcessService.insertDcEventProcess(dcEventProcess); return AjaxResult.success("无需清障成功"); } From 8ac3263680c44a56c82aed1d3522e07aec02092c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=85=B4=E7=90=B3?= <1911390090@qq.com> Date: Sat, 11 May 2024 17:54:56 +0800 Subject: [PATCH 37/60] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BA=8B=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/mapper/business/DcEventMapper.xml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/zc-business/src/main/resources/mapper/business/DcEventMapper.xml b/zc-business/src/main/resources/mapper/business/DcEventMapper.xml index 02766ac8..030387c9 100644 --- a/zc-business/src/main/resources/mapper/business/DcEventMapper.xml +++ b/zc-business/src/main/resources/mapper/business/DcEventMapper.xml @@ -677,7 +677,7 @@ event_source_tips = #{eventSourceTips}, in_tunnel = #{inTunnel}, road_id = #{roadId}, - road_id = #{lang}, + lang = #{lang}, event_title = #{eventTitle}, occurrence_time = #{occurrenceTime}, is_perceived = #{isPerceived}, @@ -711,12 +711,11 @@ event_source_tips = #{eventSourceTips}, in_tunnel = #{inTunnel}, road_id = #{roadId}, - road_id = #{lang}, + lang = #{lang}, event_title = #{eventTitle}, occurrence_time = #{occurrenceTime}, is_perceived = #{isPerceived}, dimension = #{dimension}, - event_nature = #{eventNature}, link_id = #{linkId}, From e220381919fbfa3fe8cf392b74a0fc475de5a36c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=85=B4=E7=90=B3?= <1911390090@qq.com> Date: Sat, 11 May 2024 18:30:11 +0800 Subject: [PATCH 38/60] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BA=8B=E4=BB=B6=20?= =?UTF-8?q?=E5=90=8C=E4=B8=80=E4=BA=8B=E4=BB=B6=E7=8A=B6=E6=80=81=E5=B7=B2?= =?UTF-8?q?=E8=A2=AB=E4=BF=AE=E6=94=B9=20=E8=BF=94=E5=9B=9E=E6=88=90?= =?UTF-8?q?=E5=8A=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/zc/business/domain/DcEvent.java | 5 ++++- .../zc/business/service/impl/DcEventServiceImpl.java | 12 +++++++++++- .../main/resources/mapper/business/DcEventMapper.xml | 3 +++ 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/zc-business/src/main/java/com/zc/business/domain/DcEvent.java b/zc-business/src/main/java/com/zc/business/domain/DcEvent.java index aa171517..cb481f77 100644 --- a/zc-business/src/main/java/com/zc/business/domain/DcEvent.java +++ b/zc-business/src/main/java/com/zc/business/domain/DcEvent.java @@ -69,6 +69,9 @@ public class DcEvent { @ApiModelProperty("处理人员") private Long userId; + @ApiModelProperty("事件子类") + private String eventSubclas; + /** * 开始时间 */ @@ -133,7 +136,7 @@ public class DcEvent { * 3-3 立交封闭和限行 * 3-4 服务区封闭和限行 */ - @Excel(name = "事件类型") + @Excel(name = "事件类型字符串") @ApiModelProperty("事件子类 例:事件子类:* 1-1 追尾* 1-2 侧翻* 1-3 撞护栏* 1-4 自然* 1-5 其他事故* 2-1 车辆故障") private String eventSubclass; 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 970b0110..b9dfae8e 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 @@ -960,8 +960,18 @@ public class DcEventServiceImpl extends ServiceImpl impl @Override public int updateDcEventState(String id, int state) { + //多次修改请求 + DcEvent dcEvent1 = dcEventMapper.selectDcEventById(id); + //事件删除 后 返回成功 + if (dcEvent1 ==null){ + return 1; + } + //事件状态已被修改 返回成功 + if (dcEvent1.getEventState()==state){ + return 1; + } - int i = dcEventMapper.updateDcEventState(id, state); + int i = dcEventMapper.updateDcEventState(id, state); if (i > 0) { DcEvent dcEvent = dcEventMapper.selectDcEventMainById(id); diff --git a/zc-business/src/main/resources/mapper/business/DcEventMapper.xml b/zc-business/src/main/resources/mapper/business/DcEventMapper.xml index 030387c9..fac9ab19 100644 --- a/zc-business/src/main/resources/mapper/business/DcEventMapper.xml +++ b/zc-business/src/main/resources/mapper/business/DcEventMapper.xml @@ -36,6 +36,7 @@ + @@ -166,6 +167,7 @@ longitude, dimension, event_title, + event_subclass as event_subclas, link_id, is_perceived, CASE event_type @@ -406,6 +408,7 @@ dc_event.event_title, dc_event.occurrence_time, dc_event.event_type AS event_type, + dc_event.event_subclass AS event_subclas, CASE dc_event.event_type WHEN '1' THEN '交通事故' WHEN '2' THEN '车辆故障' From 339e8fa789e6da402f02ab0cfa3587aaa5c0dc82 Mon Sep 17 00:00:00 2001 From: wangsixiang <2970484253@qq.com> Date: Mon, 13 May 2024 09:12:49 +0800 Subject: [PATCH 39/60] =?UTF-8?q?=E6=9C=8D=E5=8A=A1=E7=BB=9F=E8=AE=A1?= =?UTF-8?q?=E4=B8=8E=E4=BA=8B=E4=BB=B6=E5=88=A0=E9=99=A4=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E8=B0=83=E5=BA=A6=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/DcPublishManageController.java | 15 +++++ .../mapper/DcPublishManageMapper.java | 6 ++ .../service/IDcPublishManageService.java | 4 ++ .../impl/DcPublishManageServiceImpl.java | 10 +++ .../mapper/business/DcPublishManageMapper.xml | 62 +++++++++++++++++++ 5 files changed, 97 insertions(+) diff --git a/zc-business/src/main/java/com/zc/business/controller/DcPublishManageController.java b/zc-business/src/main/java/com/zc/business/controller/DcPublishManageController.java index 33ac456d..1f2199cb 100644 --- a/zc-business/src/main/java/com/zc/business/controller/DcPublishManageController.java +++ b/zc-business/src/main/java/com/zc/business/controller/DcPublishManageController.java @@ -142,4 +142,19 @@ public class DcPublishManageController extends BaseController } return AjaxResult.success(dcPublishManageService.monthTrendsPublishManage(dcPublishManage)); } + //统计服务,事件类型对应的发布渠道发布的数量 + @PostMapping("/eventTypePublishManageSum") + public AjaxResult eventTypePublishManageSum() + { + return AjaxResult.success(dcPublishManageService.eventTypePublishManageSum()); + } + //统计服务,事件类型对应的发布渠道发布的数量按月统计 + @PostMapping("/eventTypePublishManageMonth") + public AjaxResult eventTypePublishManageMonth(@RequestBody DcPublishManage dcPublishManage) + { + if (dcPublishManage==null||dcPublishManage.getPublishTime()==null){ + return AjaxResult.error("参数错误"); + } + return AjaxResult.success(dcPublishManageService.eventTypePublishManageMonth(dcPublishManage)); + } } 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 28263919..dd74c983 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 @@ -55,6 +55,8 @@ public interface DcPublishManageMapper int deleteDcPublishManageById(Long id); //删除事件发布记录 params 事件id int deleteDcPublishManageEventId(String eventId); + //删除调度记录 + int deleteDisPath(String eventId); /** * 批量删除信息发布管理记录 * @@ -76,4 +78,8 @@ public interface DcPublishManageMapper public List> releaseTrendsPublishManage(); //统计月发布趋势分析 public List> monthTrendsPublishManage(DcPublishManage dcPublishManage); + //统计不同事件的发布渠道数量 + public List> eventTypePublishManageSum(); + //统计不同事件的发布渠道数量(月统计) + public List> eventTypePublishManageMonth(DcPublishManage dcPublishManage); } diff --git a/zc-business/src/main/java/com/zc/business/service/IDcPublishManageService.java b/zc-business/src/main/java/com/zc/business/service/IDcPublishManageService.java index 18c2165b..107c4452 100644 --- a/zc-business/src/main/java/com/zc/business/service/IDcPublishManageService.java +++ b/zc-business/src/main/java/com/zc/business/service/IDcPublishManageService.java @@ -68,4 +68,8 @@ public interface IDcPublishManageService public List> releaseTrendsPublishManage(); //统计月发布趋势分析 public List> monthTrendsPublishManage(DcPublishManage dcPublishManage); + //统计不同事件的发布渠道数量 + public List> eventTypePublishManageSum(); + //统计不同事件的发布渠道数量(月统计) + public List> eventTypePublishManageMonth(DcPublishManage dcPublishManage); } diff --git a/zc-business/src/main/java/com/zc/business/service/impl/DcPublishManageServiceImpl.java b/zc-business/src/main/java/com/zc/business/service/impl/DcPublishManageServiceImpl.java index 808c7e30..3a8bc631 100644 --- a/zc-business/src/main/java/com/zc/business/service/impl/DcPublishManageServiceImpl.java +++ b/zc-business/src/main/java/com/zc/business/service/impl/DcPublishManageServiceImpl.java @@ -130,4 +130,14 @@ public class DcPublishManageServiceImpl implements IDcPublishManageService public List> monthTrendsPublishManage(DcPublishManage dcPublishManage) { return dcPublishManageMapper.monthTrendsPublishManage(dcPublishManage); } + //统计不同事件的发布渠道数量 + @Override + public List> eventTypePublishManageSum() { + return dcPublishManageMapper.eventTypePublishManageSum(); + } + //统计不同事件的发布渠道数量(月统计) + @Override + public List> eventTypePublishManageMonth(DcPublishManage dcPublishManage) { + return dcPublishManageMapper.eventTypePublishManageMonth(dcPublishManage); + } } diff --git a/zc-business/src/main/resources/mapper/business/DcPublishManageMapper.xml b/zc-business/src/main/resources/mapper/business/DcPublishManageMapper.xml index d6df52a6..11fd36f6 100644 --- a/zc-business/src/main/resources/mapper/business/DcPublishManageMapper.xml +++ b/zc-business/src/main/resources/mapper/business/DcPublishManageMapper.xml @@ -194,6 +194,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{id} + + delete dc_dispatch,dc_dispatch_resource + from dc_dispatch_resource + JOIN dc_dispatch on dc_dispatch_resource.dispatch_id=dc_dispatch.id + WHERE dc_dispatch.event_id=#{eventId} + + + + \ No newline at end of file From fb0392aaa4e87d86ebe51502e1e8ce8d747c369e Mon Sep 17 00:00:00 2001 From: wangsixiang <2970484253@qq.com> Date: Mon, 13 May 2024 09:21:19 +0800 Subject: [PATCH 40/60] =?UTF-8?q?=E8=B0=83=E5=BA=A6=E5=88=A0=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/mapper/business/DcPublishManageMapper.xml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/zc-business/src/main/resources/mapper/business/DcPublishManageMapper.xml b/zc-business/src/main/resources/mapper/business/DcPublishManageMapper.xml index 11fd36f6..6d2adf52 100644 --- a/zc-business/src/main/resources/mapper/business/DcPublishManageMapper.xml +++ b/zc-business/src/main/resources/mapper/business/DcPublishManageMapper.xml @@ -195,11 +195,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - delete dc_dispatch,dc_dispatch_resource - from dc_dispatch_resource - JOIN dc_dispatch on dc_dispatch_resource.dispatch_id=dc_dispatch.id - WHERE dc_dispatch.event_id=#{eventId} - + DELETE FROM dc_dispatch_resource WHERE dispatch_id IN ( + SELECT id FROM dc_dispatch WHERE event_id = #{eventId} + ); + DELETE FROM dc_dispatch WHERE event_id = #{eventId}; From a449e77146bf889b5fdd4a5476b036764ec42375 Mon Sep 17 00:00:00 2001 From: lau572 <1010031226@qq.com> Date: Mon, 13 May 2024 10:16:55 +0800 Subject: [PATCH 42/60] =?UTF-8?q?=E4=BA=8B=E4=BB=B6=E5=A4=84=E7=BD=AE?= =?UTF-8?q?=E8=81=94=E7=BB=9C=E8=B0=83=E5=BA=A6=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../zc/business/service/impl/DcWarningServiceImpl.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/zc-business/src/main/java/com/zc/business/service/impl/DcWarningServiceImpl.java b/zc-business/src/main/java/com/zc/business/service/impl/DcWarningServiceImpl.java index 6f08a2bb..2b9438b9 100644 --- a/zc-business/src/main/java/com/zc/business/service/impl/DcWarningServiceImpl.java +++ b/zc-business/src/main/java/com/zc/business/service/impl/DcWarningServiceImpl.java @@ -719,8 +719,9 @@ public class DcWarningServiceImpl implements IDcWarningService dcWarningMapper.deleteDispatchResource(dispatchId);//删除全部属于该调度记录下的全部资源 ArrayList> employeesArray = (ArrayList>) map.get("employees");//取出人员 - String context = "路管人员"; + String context = ""; if (employeesArray!=null&&employeesArray.size()>0) { + context += "路管人员"; for (Map array : employeesArray) { dcDispatchResource.setDispatchType(1);//类型 dcDispatchResource.setResourceId(Long.valueOf(array.get("id").toString()));//资源id @@ -736,7 +737,10 @@ public class DcWarningServiceImpl implements IDcWarningService } ArrayList> vehicleArray = (ArrayList>) map.get("vehicle");////取出车辆 if (vehicleArray!=null&&vehicleArray.size()>0) { - context += ",救援车辆"; + if (context.length() > 0){ + context += ","; + } + context += "救援车辆"; for (Map array : vehicleArray) { dcDispatchResource.setDispatchType(2); dcDispatchResource.setResourceId(Long.valueOf(array.get("id").toString())); 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 43/60] =?UTF-8?q?=E4=BA=8B=E4=BB=B6=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E5=85=B3=E8=81=94=20=20=20=E5=88=A0=E9=99=A4=E8=B0=83=E5=BA=A6?= =?UTF-8?q?=E8=AE=B0=E5=BD=95=E8=B5=84=E6=BA=90=20=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E8=B0=83=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 '交警转接' From be28bceea837e20072ba897f44bd93eccbbfde25 Mon Sep 17 00:00:00 2001 From: wangsixiang <2970484253@qq.com> Date: Mon, 13 May 2024 13:51:40 +0800 Subject: [PATCH 44/60] =?UTF-8?q?=E6=84=9F=E7=9F=A5=E8=AF=AF=E6=8A=A5?= =?UTF-8?q?=EF=BC=8C=E4=BA=BA=E5=91=98=E5=85=A8=E9=83=A8=E8=B0=83=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/DcWarningController.java | 9 +++++++ .../com/zc/business/domain/DcWarning.java | 25 +++++++++++++++++++ .../zc/business/mapper/DcWarningMapper.java | 3 ++- .../business/service/IDcWarningService.java | 2 ++ .../service/impl/DcWarningServiceImpl.java | 6 +++++ .../business/DcPublishingChannelsMapper.xml | 2 +- .../mapper/business/DcWarningMapper.xml | 14 ++++++++++- 7 files changed, 58 insertions(+), 3 deletions(-) diff --git a/zc-business/src/main/java/com/zc/business/controller/DcWarningController.java b/zc-business/src/main/java/com/zc/business/controller/DcWarningController.java index 1cb74c8c..74cc2479 100644 --- a/zc-business/src/main/java/com/zc/business/controller/DcWarningController.java +++ b/zc-business/src/main/java/com/zc/business/controller/DcWarningController.java @@ -174,4 +174,13 @@ public class DcWarningController extends BaseController } return toAjax(dcWarningService.insertDispatchSource(map)); } + //感知事件误报 + @PostMapping("/falseAlarm") + public AjaxResult falseAlarmResolution(@RequestBody DcWarning dcWarning){ + if (dcWarning==null||dcWarning.getRelieveType()==null||StringUtils.isBlank(dcWarning.getId())){ + return AjaxResult.error("参数错误"); + } + return toAjax(dcWarningService.falseAlarmResolution(dcWarning)); + } + } 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 311ca679..ad73d6c4 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 @@ -59,6 +59,14 @@ public class DcWarning extends BaseEntity @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=其它") + private Integer relieveType; + + /** 事件标题 */ @Excel(name = "事件标题") private String warningTitle; @@ -113,6 +121,23 @@ public class DcWarning extends BaseEntity private String endDate; //收费站 private String facilityName; + + public String getRelieveReason() { + return relieveReason; + } + + public void setRelieveReason(String relieveReason) { + this.relieveReason = relieveReason; + } + + public Integer getRelieveType() { + return relieveType; + } + + public void setRelieveType(Integer relieveType) { + this.relieveType = relieveType; + } + public String getStartStakeMark() { return startStakeMark; } diff --git a/zc-business/src/main/java/com/zc/business/mapper/DcWarningMapper.java b/zc-business/src/main/java/com/zc/business/mapper/DcWarningMapper.java index 2e6e4af2..7f07269b 100644 --- a/zc-business/src/main/java/com/zc/business/mapper/DcWarningMapper.java +++ b/zc-business/src/main/java/com/zc/business/mapper/DcWarningMapper.java @@ -130,5 +130,6 @@ public interface DcWarningMapper public Integer deleteDispatchResource(@Param("dispatchId")Long dispatchId); DcDispatch selectDcDispatchById(@Param("id") Long id); - + //误报解除 + public Integer falseAlarmResolution(DcWarning dcWarning); } diff --git a/zc-business/src/main/java/com/zc/business/service/IDcWarningService.java b/zc-business/src/main/java/com/zc/business/service/IDcWarningService.java index 93af5845..2200db6f 100644 --- a/zc-business/src/main/java/com/zc/business/service/IDcWarningService.java +++ b/zc-business/src/main/java/com/zc/business/service/IDcWarningService.java @@ -92,4 +92,6 @@ public interface IDcWarningService public Integer insertDispatch(DcDispatch dcDispatch); //新增指挥调度资源记录 public Integer insertDispatchSource(HashMap map); + //误报解除 + public Integer falseAlarmResolution(DcWarning dcWarning); } diff --git a/zc-business/src/main/java/com/zc/business/service/impl/DcWarningServiceImpl.java b/zc-business/src/main/java/com/zc/business/service/impl/DcWarningServiceImpl.java index 6f08a2bb..186aa613 100644 --- a/zc-business/src/main/java/com/zc/business/service/impl/DcWarningServiceImpl.java +++ b/zc-business/src/main/java/com/zc/business/service/impl/DcWarningServiceImpl.java @@ -760,5 +760,11 @@ public class DcWarningServiceImpl implements IDcWarningService dcEventProcessService.insertDcEventProcess(dcEventProcess); return 1; } + //误报解除 + @Override + public Integer falseAlarmResolution(DcWarning dcWarning) { + dcWarning.setUpdateTime(DateUtils.getNowDate()); + return dcWarningMapper.falseAlarmResolution(dcWarning); + } } diff --git a/zc-business/src/main/resources/mapper/business/DcPublishingChannelsMapper.xml b/zc-business/src/main/resources/mapper/business/DcPublishingChannelsMapper.xml index bf18ac45..25b43302 100644 --- a/zc-business/src/main/resources/mapper/business/DcPublishingChannelsMapper.xml +++ b/zc-business/src/main/resources/mapper/business/DcPublishingChannelsMapper.xml @@ -103,7 +103,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" select id from dc_publishing_channels where data_category=#{dataCategory} + + + From 19a0369e6dfb0f332f461a4bfe2b021970fb2539 Mon Sep 17 00:00:00 2001 From: lau572 <1010031226@qq.com> Date: Mon, 13 May 2024 17:54:30 +0800 Subject: [PATCH 46/60] =?UTF-8?q?=E4=BA=8B=E4=BB=B6=E5=A4=84=E7=BD=AE?= =?UTF-8?q?=E5=89=8D=E7=BD=AE=E8=8A=82=E7=82=B9=E7=8A=B6=E6=80=81=E9=AA=8C?= =?UTF-8?q?=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/DcEventProcessController.java | 7 +++++++ .../zc/business/mapper/DcEventProcessMapper.java | 12 ++++++++++++ .../business/service/IDcEventProcessService.java | 12 ++++++++++++ .../service/impl/DcEventProcessServiceImpl.java | 15 +++++++++++++++ .../mapper/business/DcEventProcessMapper.xml | 5 +++++ 5 files changed, 51 insertions(+) diff --git a/zc-business/src/main/java/com/zc/business/controller/DcEventProcessController.java b/zc-business/src/main/java/com/zc/business/controller/DcEventProcessController.java index 79e0fcf7..08f1bf54 100644 --- a/zc-business/src/main/java/com/zc/business/controller/DcEventProcessController.java +++ b/zc-business/src/main/java/com/zc/business/controller/DcEventProcessController.java @@ -2,6 +2,7 @@ package com.zc.business.controller; import java.io.IOException; import java.util.List; +import java.util.Map; import javax.servlet.http.HttpServletResponse; import com.ruoyi.common.config.RuoYiConfig; @@ -100,6 +101,12 @@ public class DcEventProcessController extends BaseController @Log(title = "事件处理流程", businessType = BusinessType.INSERT) @PostMapping public AjaxResult add(@RequestBody DcEventProcess dcEventProcess){ + if (dcEventProcess.getProcessType() != null && dcEventProcess.getProcessType() == 1){ + int status = dcEventProcessService.selectPreviousNodeStatus(dcEventProcess.getEventId(),dcEventProcess.getProcessId()); + if (status < 1){ + return AjaxResult.error("前置节点未点亮!"); + } + } return toAjax(dcEventProcessService.insertDcEventProcess(dcEventProcess)); } diff --git a/zc-business/src/main/java/com/zc/business/mapper/DcEventProcessMapper.java b/zc-business/src/main/java/com/zc/business/mapper/DcEventProcessMapper.java index d512e150..4a00c447 100644 --- a/zc-business/src/main/java/com/zc/business/mapper/DcEventProcessMapper.java +++ b/zc-business/src/main/java/com/zc/business/mapper/DcEventProcessMapper.java @@ -2,6 +2,7 @@ package com.zc.business.mapper; import java.util.List; import com.zc.business.domain.DcEventProcess; +import org.apache.ibatis.annotations.Param; /** * 事件处理流程Mapper接口 @@ -75,4 +76,15 @@ public interface DcEventProcessMapper List selectDcDispatchByEventId(String id); int selectFinalNode(String eventId); + + /** + * @Description 查询前置节点状态 + * + * @author liuwenge + * @date 2024/5/13 16:08 + * @param eventId 事件id + * @param processId 节点id + * @return 状态 0未完成 1已完成 + */ + int selectPreviousNodeStatus(@Param("eventId") String eventId, @Param("processId") Long processId); } diff --git a/zc-business/src/main/java/com/zc/business/service/IDcEventProcessService.java b/zc-business/src/main/java/com/zc/business/service/IDcEventProcessService.java index f0023517..3d261edd 100644 --- a/zc-business/src/main/java/com/zc/business/service/IDcEventProcessService.java +++ b/zc-business/src/main/java/com/zc/business/service/IDcEventProcessService.java @@ -2,6 +2,7 @@ package com.zc.business.service; import java.io.IOException; import java.util.List; +import java.util.Map; import com.ruoyi.common.exception.file.InvalidExtensionException; import com.zc.business.domain.DcEventProcess; @@ -71,4 +72,15 @@ public interface IDcEventProcessService int deleteDcEventProcessById(Long id); List selectDcEventProcessListById(String id); + + /** + * @Description 查询前置节点状态 + * + * @author liuwenge + * @date 2024/5/13 15:57 + * @param eventId 事件id + * @param processId 节点id + * @return status 0未完成 1已完成 + */ + int selectPreviousNodeStatus(String eventId, Long processId); } diff --git a/zc-business/src/main/java/com/zc/business/service/impl/DcEventProcessServiceImpl.java b/zc-business/src/main/java/com/zc/business/service/impl/DcEventProcessServiceImpl.java index a097984a..6dd2a68c 100644 --- a/zc-business/src/main/java/com/zc/business/service/impl/DcEventProcessServiceImpl.java +++ b/zc-business/src/main/java/com/zc/business/service/impl/DcEventProcessServiceImpl.java @@ -148,4 +148,19 @@ public class DcEventProcessServiceImpl implements IDcEventProcessService public List selectDcEventProcessListById(String id) { return dcEventProcessMapper.selectDcDispatchByEventId(id); } + + /** + * @Description 查询前置节点状态 + * + * @author liuwenge + * @date 2024/5/13 16:07 + * @param eventId 事件id + * @param processId 节点id + * @return 状态 0未完成 1已完成 + */ + @Override + public int selectPreviousNodeStatus(String eventId, Long processId){ + return dcEventProcessMapper.selectPreviousNodeStatus(eventId,processId); + } + } diff --git a/zc-business/src/main/resources/mapper/business/DcEventProcessMapper.xml b/zc-business/src/main/resources/mapper/business/DcEventProcessMapper.xml index cab4e024..6a7ea7fb 100644 --- a/zc-business/src/main/resources/mapper/business/DcEventProcessMapper.xml +++ b/zc-business/src/main/resources/mapper/business/DcEventProcessMapper.xml @@ -145,4 +145,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" where t1.id = #{eventId}; + + \ No newline at end of file From 5528350e0a8aadde132e1abad6d40dfe11919839 Mon Sep 17 00:00:00 2001 From: "Mr.Wang" Date: Mon, 13 May 2024 18:04:06 +0800 Subject: [PATCH 47/60] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E8=B7=AF=E5=BE=84=E5=90=8D=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../zc/business/controller/DcEmergencyPlansController.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zc-business/src/main/java/com/zc/business/controller/DcEmergencyPlansController.java b/zc-business/src/main/java/com/zc/business/controller/DcEmergencyPlansController.java index 307f08f6..e21493ce 100644 --- a/zc-business/src/main/java/com/zc/business/controller/DcEmergencyPlansController.java +++ b/zc-business/src/main/java/com/zc/business/controller/DcEmergencyPlansController.java @@ -132,7 +132,7 @@ public class DcEmergencyPlansController extends BaseController { */ @ApiOperation("根据事件id-查询预案事件关联表") @GetMapping("/event/assoc/{id}") - public AjaxResult eventConfirm(@PathVariable("id") String id) { + public AjaxResult eventConfirmByEventId(@PathVariable("id") String id) { return AjaxResult.success(dcEmergencyPlansService.selectEventPlanAssocByEventId(id)); } @@ -140,7 +140,7 @@ public class DcEmergencyPlansController extends BaseController { * 根据id-查询预案事件关联表 */ @ApiOperation("根据id-查询预案事件关联表") - @GetMapping("/event/assoc/{assocId}") + @GetMapping("/event/assocId/{assocId}") public AjaxResult eventConfirmById(@PathVariable("assocId") Long assocId) { return AjaxResult.success(dcEmergencyPlansService.selectEventPlanAssocById(assocId)); } From daa0f3ab2bac4e74a176d2c80e46acd4dddff58b Mon Sep 17 00:00:00 2001 From: zhaoxianglong Date: Tue, 14 May 2024 11:03:54 +0800 Subject: [PATCH 48/60] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=E8=B0=83=E7=94=A8=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../interfaces/OperationLogAspect.java | 36 +++++++++++++++++-- 1 file changed, 33 insertions(+), 3 deletions(-) diff --git a/zc-business/src/main/java/com/zc/business/interfaces/OperationLogAspect.java b/zc-business/src/main/java/com/zc/business/interfaces/OperationLogAspect.java index f223851f..ec8e4fe8 100644 --- a/zc-business/src/main/java/com/zc/business/interfaces/OperationLogAspect.java +++ b/zc-business/src/main/java/com/zc/business/interfaces/OperationLogAspect.java @@ -142,7 +142,7 @@ public class OperationLogAspect { SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); String date = df.format(new Date()); String sta = ""; - if (Objects.equals(state, "0") && Objects.equals(String.valueOf(((AjaxResult) jsonResult).get("code")), "200")) { + if (Objects.equals(state, "0") && Objects.equals(String.valueOf(((AjaxResult) jsonResult).get("code")), "200") && !Objects.equals(String.valueOf(((AjaxResult) jsonResult).get("msg")), "500") ) { operLog.setStatus(0); sta = "成功"; } else { @@ -307,8 +307,38 @@ public class OperationLogAspect { operLog.setOperIp(IpUtils.getIpAddr(request)); operLog.setOperTime(new Date()); operLog.setDcDeviceType(deviceType); - operLog.setJsonResult(remark.toString()); - dcOperLogService.addDcOperLog(operLog); + operLog.setRemark(remark.toString()); + operLog.setJsonResult(jsonResult.toString()); + dcOperLogService.save(operLog); + + + if ((Objects.equals(deviceType, "2") || Objects.equals(deviceType, "5")) && Objects.nonNull(operLog.getId())) { + DcPublishManage dcPublishManage = new DcPublishManage(); + + if (Objects.equals(state, "0") && Objects.equals(String.valueOf(((AjaxResult) jsonResult).get("code")), "200")) { + dcPublishManage.setPublishStatus(1);//发布状态1-成功2-失败 + } else { + dcPublishManage.setPublishStatus(2);//发布状态1-成功2-失败 + } + + if (loginUser != null) { + dcPublishManage.setPublisher(loginUser.getUsername());//发布人 + } else { + dcPublishManage.setPublisher("系统定时调用");//发布人 + } + dcPublishManage.setPublishTime(new Date());//发布时间 + dcPublishManage.setCreateTime(new Date());//创建时间 + + dcPublishManage.setLogId(Long.valueOf(operLog.getId()));//发布的如果的情报板传对应id + if (Objects.equals(deviceType, "2")) { + dcPublishManage.setPublishChannels(4); + } else { + dcPublishManage.setPublishChannels(7); + } + + dcPublishManage.setContentDetails(remark.toString()); + dcPublishManageService.insertDcPublishManage(dcPublishManage); + } } } 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 49/60] =?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; From 4d45884c041aa4963b1892399bd7ad8e56253b6e 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:34:43 +0800 Subject: [PATCH 50/60] =?UTF-8?q?=20=E4=BF=AE=E6=94=B9=20=E6=B0=94?= =?UTF-8?q?=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 --- .../mapper/business/DcMeteorologicalDetectorDataMapper.xml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/zc-business/src/main/resources/mapper/business/DcMeteorologicalDetectorDataMapper.xml b/zc-business/src/main/resources/mapper/business/DcMeteorologicalDetectorDataMapper.xml index 60e822da..b8eb4308 100644 --- a/zc-business/src/main/resources/mapper/business/DcMeteorologicalDetectorDataMapper.xml +++ b/zc-business/src/main/resources/mapper/business/DcMeteorologicalDetectorDataMapper.xml @@ -175,7 +175,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" date; select facility.facility_name,event.event_state,manage.publish_time, manage.create_time, @@ -65,7 +64,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" manage.event_id is not null and event.event_state = #{eventState} and event.event_type = #{eventType} - and manage.publish_status = #{publishStatus} + and manage.publish_status = #{publishStatus} and manage.create_time between #{startTime} and #{endTime} @@ -81,7 +80,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" GROUP BY manage.event_id ORDER BY event.create_time desc - + - \ No newline at end of file + + From 1cf1113efbfb14073d6ae72f94498a5be0398f95 Mon Sep 17 00:00:00 2001 From: wangsixiang <2970484253@qq.com> Date: Wed, 15 May 2024 14:58:42 +0800 Subject: [PATCH 58/60] =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E4=BA=8B=E4=BB=B6?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=E5=8F=91=E5=B8=83=E6=B8=A0=E9=81=93=E9=97=AE?= =?UTF-8?q?=E9=A2=98=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/resources/mapper/business/DcPublishManageMapper.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zc-business/src/main/resources/mapper/business/DcPublishManageMapper.xml b/zc-business/src/main/resources/mapper/business/DcPublishManageMapper.xml index acc5ff98..9ec470fe 100644 --- a/zc-business/src/main/resources/mapper/business/DcPublishManageMapper.xml +++ b/zc-business/src/main/resources/mapper/business/DcPublishManageMapper.xml @@ -319,7 +319,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" SELECT publish_channels ,dc_event.event_type eventType, COUNT(*)AS number FROM dc_publish_manage LEFT JOIN dc_event on dc_publish_manage.event_id=dc_event.id - GROUP BY HOUR(publish_time), publish_channels + GROUP BY dc_event.event_type ) AS m ON h.eventType = m.eventType AND pc.publish_channels = m.publish_channels ORDER BY h.eventType, pc.publish_channels; From dfb244866147b75f7acf7a6e002beb24081ac6f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=85=B4=E7=90=B3?= <1911390090@qq.com> Date: Wed, 15 May 2024 15:44:15 +0800 Subject: [PATCH 59/60] =?UTF-8?q?=E8=AF=AD=E9=9F=B3=E5=B9=BF=E6=92=AD=20?= =?UTF-8?q?=E6=A8=A1=E6=9D=BF=E6=96=B0=E5=A2=9E=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../zc/business/domain/DcVoiceBroadcast.java | 48 ++++--------------- .../business/DcVoiceBroadcastMapper.xml | 14 +++++- 2 files changed, 22 insertions(+), 40 deletions(-) diff --git a/zc-business/src/main/java/com/zc/business/domain/DcVoiceBroadcast.java b/zc-business/src/main/java/com/zc/business/domain/DcVoiceBroadcast.java index 51cfc018..33e6ab75 100644 --- a/zc-business/src/main/java/com/zc/business/domain/DcVoiceBroadcast.java +++ b/zc-business/src/main/java/com/zc/business/domain/DcVoiceBroadcast.java @@ -2,6 +2,9 @@ package com.zc.business.domain; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; import com.ruoyi.common.annotation.Excel; @@ -13,7 +16,10 @@ import com.ruoyi.common.core.domain.BaseEntity; * @author ruoyi * @date 2024-04-19 */ +@Data @ApiModel("语音广播预发布对象") +@NoArgsConstructor +@AllArgsConstructor public class DcVoiceBroadcast extends BaseEntity { private static final long serialVersionUID = 1L; @@ -29,44 +35,8 @@ public class DcVoiceBroadcast extends BaseEntity /** 内容 */ @Excel(name = "内容") private String content; +private String repeatTimes; +private String priority; +private String outVol; - public void setId(Long id) - { - this.id = id; - } - - public Long getId() - { - return id; - } - public void setCategory(String category) - { - this.category = category; - } - - public String getCategory() - { - return category; - } - public void setContent(String content) - { - this.content = content; - } - - public String getContent() - { - return content; - } - - @Override - public String toString() { - return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) - .append("id", getId()) - .append("category", getCategory()) - .append("content", getContent()) - .append("remark", getRemark()) - .append("createTime", getCreateTime()) - .append("updateTime", getUpdateTime()) - .toString(); - } } diff --git a/zc-business/src/main/resources/mapper/business/DcVoiceBroadcastMapper.xml b/zc-business/src/main/resources/mapper/business/DcVoiceBroadcastMapper.xml index 45b14aa3..2551fa05 100644 --- a/zc-business/src/main/resources/mapper/business/DcVoiceBroadcastMapper.xml +++ b/zc-business/src/main/resources/mapper/business/DcVoiceBroadcastMapper.xml @@ -11,10 +11,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + + - select id, category, content, remark, create_time, update_time from dc_voice_broadcast + select id, category, content, remark, create_time, update_time,priority,outVol,repeat_times from dc_voice_broadcast