From bef639f88149304416b70a7105e6ff76a0c1868f Mon Sep 17 00:00:00 2001 From: lau572 <1010031226@qq.com> Date: Mon, 18 Mar 2024 11:28:28 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E6=84=9F=E7=9F=A5=E4=BA=8B=E4=BB=B6?= =?UTF-8?q?=E6=89=B9=E9=87=8F=E6=93=8D=E4=BD=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/DcWarningController.java | 22 ++-- .../com/zc/business/domain/DcWarning.java | 21 ++++ .../domain/DcWarningBatchConvert.java | 38 +++++++ .../java/com/zc/business/domain/MdEvent.java | 4 +- .../zc/business/mapper/DcWarningMapper.java | 3 + .../zc/business/service/IDcEventService.java | 11 ++ .../business/service/IDcWarningService.java | 12 +++ .../service/impl/DcEventServiceImpl.java | 102 +++++++++++++++++- .../service/impl/DcWarningServiceImpl.java | 77 +++++++++++++ .../mapper/business/DcEventMapper.xml | 2 + .../mapper/business/DcWarningMapper.xml | 22 ++++ 11 files changed, 302 insertions(+), 12 deletions(-) create mode 100644 zc-business/src/main/java/com/zc/business/domain/DcWarningBatchConvert.java 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 df443061..800a725a 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 @@ -1,6 +1,7 @@ package com.zc.business.controller; import com.ruoyi.common.utils.uuid.IdUtils; +import com.zc.business.domain.DcWarningBatchConvert; import com.zc.business.service.IDcWarningService; import com.ruoyi.common.annotation.Log; import com.ruoyi.common.core.controller.BaseController; @@ -9,17 +10,13 @@ import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.enums.BusinessType; import com.ruoyi.common.utils.poi.ExcelUtil; import com.zc.business.domain.DcWarning; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; -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 javax.servlet.http.HttpServletResponse; import java.util.HashMap; @@ -31,6 +28,7 @@ import java.util.List; * @author ruoyi * @date 2024-01-26 */ +@Api(tags = "感知事件") @RestController @RequestMapping("/business/warning") public class DcWarningController extends BaseController @@ -41,6 +39,7 @@ public class DcWarningController extends BaseController /** * 查询预警信息列表 */ + @ApiOperation("查询感知事件列表") @PreAuthorize("@ss.hasPermi('business:warning:list')") @GetMapping("/list") public TableDataInfo list(DcWarning dcWarning) @@ -130,4 +129,11 @@ public class DcWarningController extends BaseController List> list = dcWarningService.selectDcWarningoTherConfig(dcWarning); return getDataTable(list); } + + @ApiOperation("感知事件批量转换") + @PostMapping("/batchConvert") + public AjaxResult batchConvert(@RequestBody DcWarningBatchConvert dcWarningBatchConvert){ + + return dcWarningService.batchConvert(dcWarningBatchConvert); + } } 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 970ee88d..3c9376a5 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 @@ -116,6 +116,11 @@ public class DcWarning extends BaseEntity private String startStakeMark; private String endStakeMark; + //开始日期 + private String startDate; + //结束日期 + private String endDate; + public String getStartStakeMark() { return startStakeMark; } @@ -372,6 +377,22 @@ public class DcWarning extends BaseEntity return otherConfig; } + public String getStartDate() { + return startDate; + } + + public void setStartDate(String startDate) { + this.startDate = startDate; + } + + public String getEndDate() { + return endDate; + } + + public void setEndDate(String endDate) { + this.endDate = endDate; + } + @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) diff --git a/zc-business/src/main/java/com/zc/business/domain/DcWarningBatchConvert.java b/zc-business/src/main/java/com/zc/business/domain/DcWarningBatchConvert.java new file mode 100644 index 00000000..2ee7b80f --- /dev/null +++ b/zc-business/src/main/java/com/zc/business/domain/DcWarningBatchConvert.java @@ -0,0 +1,38 @@ +package com.zc.business.domain; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import java.util.List; + +/** + * @Description 感知事件批量处理 + * + * @author liuwenge + * @date 2024/3/16 16:27 + */ +@ApiModel("感知事件批量处理") +public class DcWarningBatchConvert { + + @ApiModelProperty("操作类型:0误报,1确认") + private String type; + + @ApiModelProperty("感知事件列表") + private List warningList; + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public List getWarningList() { + return warningList; + } + + public void setWarningList(List warningList) { + this.warningList = warningList; + } +} diff --git a/zc-business/src/main/java/com/zc/business/domain/MdEvent.java b/zc-business/src/main/java/com/zc/business/domain/MdEvent.java index 23f2eab6..18f47296 100644 --- a/zc-business/src/main/java/com/zc/business/domain/MdEvent.java +++ b/zc-business/src/main/java/com/zc/business/domain/MdEvent.java @@ -666,8 +666,8 @@ public class MdEvent //交通事件详情 this.eventDesc = dcEvent.getDescription(); //发生时间 - this.occurTime = dcEvent.getStartTime(); - //发生时间 + this.occurTime = dcEvent.getOccurrenceTime(); + //结束时间 this.endTime = dcEvent.getEndTime(); //发生路段位置桩号 this.stakeNumber = dcEvent.getStakeMark(); 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 a55e1ed6..35aaf365 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 @@ -70,4 +70,7 @@ public interface DcWarningMapper //AI视频 List> selectDcWarningoTherConfig(DcWarning dcWarning); + boolean batchUpdateState(@Param("userId") Long userId,@Param("dcWarningList") List dcWarningList); + + boolean batchDelete(@Param("dcWarningList") List dcWarningList); } 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 7ac8db57..ed7ce542 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 @@ -38,6 +38,17 @@ public interface IDcEventService */ public int insertDcEvent(DcEvent dcEvent); public int insertDcEventWarning(DcEvent dcEvent); + + /** + * @Description 批量添加事件 + * + * @author liuwenge + * @date 2024/3/18 8:43 + * @param dcEventList + * @return int + */ + public boolean batchInsertDcEventWarning(List dcEventList); + /** * 修改事件信息 * 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 837c6dfa..7d2650ad 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 @@ -5,6 +5,8 @@ import java.util.List; import com.ruoyi.common.core.domain.AjaxResult; import com.zc.business.domain.DcWarning; +import com.zc.business.domain.DcWarningBatchConvert; +import org.springframework.web.bind.annotation.RequestBody; /** * 预警信息Service接口 @@ -69,4 +71,14 @@ public interface IDcWarningService int deleteDcWarningByStringId(DcWarning dcWarning); List> selectDcWarningoTherConfig(DcWarning dcWarning); + /** + * @Description 感知事件批量转换 + * + * @author liuwenge + * @date 2024/3/16 16:35 + * @param dcWarningBatchConvert + * @return com.ruoyi.common.core.domain.AjaxResult + */ + AjaxResult batchConvert(DcWarningBatchConvert dcWarningBatchConvert); + } 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 98415896..b3940d8d 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 @@ -101,14 +101,14 @@ public class DcEventServiceImpl extends ServiceImpl impl } List dcEventList = dcEventMapper.selectDcEventList(dcEvent); - for (DcEvent dcEvents : dcEventList) { + /*for (DcEvent dcEvents : dcEventList) { // 根据 deptId 获取部门名称 Long deptId = dcEvents.getDeptId(); String deptName = deptService.selectDeptById(deptId).getDeptName(); // 将部门名称赋值给 deptName 字段 dcEvents.setDeptName(deptName); - } + }*/ return dcEventList; } @@ -348,6 +348,104 @@ public class DcEventServiceImpl extends ServiceImpl impl } } + /** + * @Description 批量添加事件 + * + * @author liuwenge + * @date 2024/3/18 8:42 + * @param dcEventList + * @return int + */ + @Override + public boolean batchInsertDcEventWarning(List dcEventList) { + for (DcEvent dcEvent : dcEventList) { + + //设置事件Id UUID无下划线格式32 + String uuid = dcEvent.getId(); + int i7 = dcEventMapper.insertDcEvent(dcEvent); + if (i7 > 0) { + //中间库 + MdEvent mdEvent = new MdEvent(dcEvent); + middleDatabaseService.insertMiddleDatabaseEvent(mdEvent); + + //获取事件类型 + int eventType = Math.toIntExact(dcEvent.getEventType()); + switch (eventType) { + //交通事故 + case 1: + if (dcEvent.getDcEventAccident() != null) { + dcEvent.getDcEventAccident().setId(uuid); + int i1 = dcEventAccidentMapper.insertDcEventAccident(dcEvent.getDcEventAccident()); + } + + break; + //车辆事故 + case 2: + if (dcEvent.getDcEventVehicleAccident() != null) { + dcEvent.getDcEventVehicleAccident().setId(uuid); + int i5 = dcEventVehicleAccidentMapper.insertDcEventVehicleAccident(dcEvent.getDcEventVehicleAccident()); + } + + break; + //交通管制 + case 3: + if (dcEvent.getDcEventTrafficControl() != null) { + dcEvent.getDcEventTrafficControl().setId(uuid); + int i6 = dcEventTrafficControlMapper.insertDcEventTrafficControl(dcEvent.getDcEventTrafficControl()); + } + break; + //交通拥堵 + case 4: + if (dcEvent.getDcEventTrafficCongestion() != null) { + dcEvent.getDcEventTrafficCongestion().setId(uuid); + int i4 = dcEventTrafficCongestionMapper.insertDcEventTrafficCongestion(dcEvent.getDcEventTrafficCongestion()); + } + + break; + //非法上路 + case 5: + break; + //路障清除 + case 6: + break; + //施工建设 + case 7: + if (dcEvent.getDcEventConstruction() != null) { + dcEvent.getDcEventConstruction().setId(uuid); + int i2 = dcEventConstructionMapper.insertDcEventConstruction(dcEvent.getDcEventConstruction()); + } + + break; + //服务区异常 + case 8: + if (dcEvent.getDcEventServiceArea() != null) { + dcEvent.getDcEventServiceArea().setId(uuid); + int i3 = dcEventServiceAreaMapper.insertDcEventServiceArea(dcEvent.getDcEventServiceArea()); + } + break; + //设施设备隐患 + case 9: + break; + //异常天气 + case 10: + if (dcEvent.getDcEventAbnormalWeather() != null) { + dcEvent.getDcEventAbnormalWeather().setId(uuid); + int i = dcEventAbnormalWeatherMapper.insertDcEventAbnormalWeather(dcEvent.getDcEventAbnormalWeather()); + } + break; + //其他事件 + case 11: + break; + // + default: + break; + + } + } + } + return true; + } + /** * 修改事件信息 * 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 93112275..3bce9a25 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 @@ -6,6 +6,7 @@ import com.ruoyi.common.utils.SecurityUtils; import com.ruoyi.common.utils.uuid.IdUtils; import com.zc.business.domain.DcEvent; import com.zc.business.domain.DcWarning; +import com.zc.business.domain.DcWarningBatchConvert; import com.zc.business.enums.ValueConverter; import com.zc.business.mapper.DcEventMapper; import com.zc.business.mapper.DcWarningMapper; @@ -16,6 +17,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -170,4 +172,79 @@ public class DcWarningServiceImpl implements IDcWarningService { return dcWarningMapper.selectDcWarningoTherConfig(dcWarning); } + + /** + * @Description 感知事件批量转换 + * + * @author liuwenge + * @date 2024/3/16 16:36 + * @param dcWarningBatchConvert + * @return com.ruoyi.common.core.domain.AjaxResult + */ + @Override + @Transactional + public AjaxResult batchConvert(DcWarningBatchConvert dcWarningBatchConvert){ + + if (StringUtils.isBlank(dcWarningBatchConvert.getType())){ + return AjaxResult.error("请选择操作类型"); + } + List dcWarningList = dcWarningBatchConvert.getWarningList(); + + if (dcWarningList != null && dcWarningList.size() > 0){ + + //误报,批量删除 + if ("0".equals(dcWarningBatchConvert.getType())){ + dcWarningMapper.batchDelete(dcWarningList); + } else { + //确认,批量转换为事件 + List dcEventList = new ArrayList<>(); + for (DcWarning dcWarning : dcWarningList) { + if (dcWarning == null || dcWarning.getId() == null || StringUtils.isBlank(dcWarning.getStakeMark()) || + StringUtils.isBlank(dcWarning.getDirection())) { + return AjaxResult.error("参数错误"); + } + dcWarning.setUserId(SecurityUtils.getUserId()); + + DcEvent dcEvent = new DcEvent(); + dcEvent.setId(dcWarning.getId());//id + dcEvent.setStakeMark(dcWarning.getStakeMark());//桩号 + dcEvent.setDirection(dcWarning.getDirection());//方向 + dcEvent.setDeptId(dcWarning.getDeptId());//部门 + dcEvent.setOccurrenceTime(dcWarning.getWarningTime());//预警时间 + if (dcWarning.getWarningLevel() != null) { + dcEvent.setEventLevel(dcWarning.getWarningLevel().longValue());//事件等级 + } + if (dcWarning.getWarningSource() != null) { + dcEvent.setEventSource((long) ValueConverter.convertValueSource(dcWarning.getWarningSource()));//事件来源 + } + if (dcWarning.getWarningType() != null) { + dcEvent.setEventType((long) ValueConverter.convertValueHost(dcWarning.getWarningType()));//事件主类 + } + if (StringUtils.isBlank(dcWarning.getWarningSubclass())) { + dcEvent.setEventSubclass(ValueConverter.convertValueSon(dcWarning.getWarningSubclass()));//事件子类 + } + dcEvent.setEventTitle(dcWarning.getWarningTitle());//标题 + dcEvent.setLang(dcWarning.getLane());//车道 + dcEvent.setRemark(dcEvent.getRemark());//备注 + dcEvent.setIsPerceived(1);//是否感知事件 + dcEvent.setEventState(Long.valueOf(1));//状态为处理中 + dcEvent.setCreateTime(DateUtils.getNowDate());//创建时间 + dcEvent.setUserId(SecurityUtils.getUserId());//处置人员 + + dcEventList.add(dcEvent); + } + + //批量更改感知事件状态 + dcWarningMapper.batchUpdateState(SecurityUtils.getUserId(),dcWarningList); + //批量插入事件表 + dcEventService.batchInsertDcEventWarning(dcEventList); + } + + + } else { + return AjaxResult.error("请选择感知事件"); + } + return AjaxResult.success("批量操作成功"); + } + } diff --git a/zc-business/src/main/resources/mapper/business/DcEventMapper.xml b/zc-business/src/main/resources/mapper/business/DcEventMapper.xml index bcb89011..931e5e9d 100644 --- a/zc-business/src/main/resources/mapper/business/DcEventMapper.xml +++ b/zc-business/src/main/resources/mapper/business/DcEventMapper.xml @@ -144,6 +144,7 @@ SELECT id, dc_event.dept_id as dept_id, + sys_dept.dept_name, stake_mark, CASE direction WHEN '1' THEN '菏泽方向' @@ -257,6 +258,7 @@ FROM dc_event LEFT JOIN sys_user on dc_event.user_id = sys_user.user_id + LEFT JOIN sys_dept on dc_event.dept_id = sys_dept.dept_id select dc_event.id AS id, diff --git a/zc-business/src/main/resources/mapper/business/DcWarningMapper.xml b/zc-business/src/main/resources/mapper/business/DcWarningMapper.xml index 04da5447..255812b2 100644 --- a/zc-business/src/main/resources/mapper/business/DcWarningMapper.xml +++ b/zc-business/src/main/resources/mapper/business/DcWarningMapper.xml @@ -59,6 +59,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and warning_title = #{warningTitle} and other_config = #{otherConfig} and lane = #{lane} + and date_format(warning_time,'%Y-%m-%d') >= #{startDate} + and date_format(warning_time,'%Y-%m-%d') <= #{endDate} @@ -148,6 +150,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" update dc_warning set warning_state=2,user_id=#{userId} where id=#{id} + + update dc_warning set warning_state = 2,user_id = #{userId} + where id in + + #{item.id} + + + + delete from dc_warning where id = #{id} @@ -158,6 +170,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" delete from dc_warning where id= #{id} + + + delete from dc_warning + where id in + + #{item.id} + + + From 199b85bb397b01e9dd93f0e950033b9cc5ea2be2 Mon Sep 17 00:00:00 2001 From: zhaoxianglong Date: Mon, 18 Mar 2024 14:28:28 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=8A=A4=E6=A0=8F?= =?UTF-8?q?=E7=A2=B0=E6=92=9E=E8=AE=BE=E5=A4=87=E4=BA=8B=E4=BB=B6=E4=B8=8A?= =?UTF-8?q?=E6=8A=A5=E5=A4=84=E7=90=86=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/zc/business/enums/IotProductEnum.java | 3 + .../device/handler/DeviceMessageHandler.java | 123 ++++++++++++++---- 2 files changed, 102 insertions(+), 24 deletions(-) diff --git a/zc-business/src/main/java/com/zc/business/enums/IotProductEnum.java b/zc-business/src/main/java/com/zc/business/enums/IotProductEnum.java index e22bfef9..2499377b 100644 --- a/zc-business/src/main/java/com/zc/business/enums/IotProductEnum.java +++ b/zc-business/src/main/java/com/zc/business/enums/IotProductEnum.java @@ -13,6 +13,9 @@ public enum IotProductEnum { // 行车诱导 TRAFFIC_GUIDANCE("8866"), + // 护栏碰撞 + GUARDRAIL_COLLISION("hlpz"), + // 气象检测器 WEATHER_DETECTOR("zc-meteorological"), 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 eec32d66..e65f7add 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 @@ -4,6 +4,7 @@ import cn.hutool.core.date.DateUtil; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.ruoyi.common.core.redis.RedisCache; import com.zc.business.constant.RedisKeyConstants; import com.zc.business.domain.DcDevice; @@ -21,10 +22,9 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import javax.annotation.Resource; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.*; import java.util.stream.Collectors; /** @@ -116,6 +116,11 @@ public class DeviceMessageHandler { if (IotProductEnum.WEATHER_DETECTOR.value().equals(productId)) { weatherDetectorMessageHandle(data); } + + // 护栏碰撞 + if (IotProductEnum.GUARDRAIL_COLLISION.value().equals(productId)) { + guardrailCollisionDeviceMessageHandle(data); + } } @@ -229,26 +234,27 @@ public class DeviceMessageHandler { extracted1(data, dcWarning); } //抛洒物(有ID有框) - if (illegalTrafficEventSubType.equals("abandonedObjectEnd")){ + if (illegalTrafficEventSubType.equals("abandonedObjectEnd")) { extracted3(data, dcWarning); } //事故(有ID有框) - if(illegalTrafficEventSubType.equals("trafficAccidentEnd")){ + if (illegalTrafficEventSubType.equals("trafficAccidentEnd")) { extracted3(data, dcWarning); } //车辆抛锚有ID有框) - if(illegalTrafficEventSubType.equals("singleVehicleBreakdownEnd")){ + if (illegalTrafficEventSubType.equals("singleVehicleBreakdownEnd")) { extracted3(data, dcWarning); } //违停(有ID有框) - if(illegalTrafficEventSubType.equals("illegalParkingEnd")){ + if (illegalTrafficEventSubType.equals("illegalParkingEnd")) { extracted3(data, dcWarning); } } -//(有ID有框) + + //(有ID有框) private void extracted3(JSONObject data, DcWarning dcWarning) { //事件上报ID String targetId = data.getString("targetId"); @@ -267,7 +273,7 @@ public class DeviceMessageHandler { String targetIdEvent = (String) hashMap.get("targetId"); //事件位置 String coordinateEvent = (String) hashMap.get("coordinate"); - if (coordinate.equals(coordinateEvent)&&targetId.equals(targetIdEvent)) { + if (coordinate.equals(coordinateEvent) && targetId.equals(targetIdEvent)) { DcWarning dcWarning2 = new DcWarning(); dcWarning2.setId(id); //自动确定状态 @@ -326,6 +332,7 @@ public class DeviceMessageHandler { /** * 一站式情况调查站设备消息处理入口 + * * @param msg 设备消息 */ private void oneStopDeviceMessageHandle(JSONObject msg) { @@ -333,8 +340,76 @@ public class DeviceMessageHandler { } + /** + * 护栏碰撞设备消息处理入口 + * + * @param msg 设备消息 + */ + private void guardrailCollisionDeviceMessageHandle(JSONObject msg) { + JSONObject dataJsonObject = msg.getJSONObject("data"); + String serviceIP = dataJsonObject.getString("serviceIP");//告警ip + String timeOfFireAlarming = dataJsonObject.getString("timeOfFireAlarming");//告警时间 + JSONArray jsonArray = dataJsonObject.getJSONArray("data"); + for (Object o : jsonArray) { + JSONObject jsonObject = JSONObject.parseObject(o.toString()); + String nodeAddress = jsonObject.getString("nodeAddress");//节点地址 + String alarmType = jsonObject.getString("alarmType");//告警类型 + String location = jsonObject.getString("location");//告警位置 + String areaCode = jsonObject.getString("areaCode");//区域号 + DcWarning dcWarning = new DcWarning(); + + LambdaQueryWrapper lambdaQueryWrapper = new LambdaQueryWrapper<>(); + lambdaQueryWrapper.eq(DcDevice::getIotDeviceId, nodeAddress); + List dcDevices = dcDeviceService.list(lambdaQueryWrapper); + + String direction = ""; + if (Objects.equals(location, "0")) { + dcWarning.setDirection("1"); + direction = "上行右侧"; + } else if (Objects.equals(location, "1")) { + dcWarning.setDirection("1"); + direction = "上行左侧"; + } else if (Objects.equals(location, "10")) { + dcWarning.setDirection("0"); + direction = "下行右侧"; + } else if (Objects.equals(location, "11")) { + dcWarning.setDirection("0"); + direction = "下行左侧"; + } + + String eventType = ""; + if (Objects.equals(alarmType, "1")) { + eventType = "碰撞"; + } else if (Objects.equals(alarmType, "2")) { + eventType = "只倾斜无碰撞"; + } else if (Objects.equals(alarmType, "3")) { + eventType = "碰撞后倾斜"; + } else if (Objects.equals(alarmType, "4")) { + eventType = "应急车道被占"; + } else if (Objects.equals(alarmType, "5")) { + eventType = "车离开应急车道"; + } + + SimpleDateFormat sdf = new SimpleDateFormat("yy年MM月dd日HH时mm分"); + try { + Date date = sdf.parse(timeOfFireAlarming); + dcWarning.setWarningTime(date); + } catch (ParseException e) { + e.printStackTrace(); + } + dcWarning.setStakeMark(dcDevices.get(0).getStakeMark()); + dcWarning.setWarningType(9); + dcWarning.setCreateTime(new Date()); + dcWarning.setWarningTitle("护栏碰撞上报事件:区域号为" + areaCode + "在" + timeOfFireAlarming + direction + "发生" + eventType + "事件"); + dcWarning.setOtherConfig(dataJsonObject.toJSONString()); + dcWarningService.insertDcWarning(dcWarning); + } + } + + /** * 气象检测器消息处理入口 + * * @param msg 设备消息 */ private void weatherDetectorMessageHandle(JSONObject msg) { @@ -350,20 +425,20 @@ public class DeviceMessageHandler { mdDeviceData.setTimeStamp(new Date()); mdDeviceData.setCreatorUserId("自动存储"); - Map expands = new HashMap<>(); - expands.put("rainFall",meteorologicalDetectorData.getRainfall()); //雨量 - expands.put("windSpeed",meteorologicalDetectorData.getWindSpeed()); //风速 - expands.put("windDirection",meteorologicalDetectorData.getWindDirection()); //风向 - expands.put("temperature",meteorologicalDetectorData.getTemperature()); //大气温度 - expands.put("humidity",meteorologicalDetectorData.getHumidity()); //大气湿度 - expands.put("airPressure",meteorologicalDetectorData.getAtmosphericPressure()); //数字气压 - expands.put("wet",meteorologicalDetectorData.getWetSlipperyCoefficient()); //湿滑 - expands.put("rainXingTai",meteorologicalDetectorData.getPrecipitationType()); //雨量降水形态 - expands.put("visibility",meteorologicalDetectorData.getVisibility()); //能见度 - expands.put("pathContactLu",meteorologicalDetectorData.getRoadSurfaceTemperature()); //路面温度 - expands.put("pathContactBing",meteorologicalDetectorData.getFreezingPointTemperature()); //冰点温度 - expands.put("pathContactYan",meteorologicalDetectorData.getSalinityValue()); //路面盐度 - expands.put("pathContactZhuang",meteorologicalDetectorData.getRemoteRoadSurfaceStatus()); //路面状况 + Map expands = new HashMap<>(); + expands.put("rainFall", meteorologicalDetectorData.getRainfall()); //雨量 + expands.put("windSpeed", meteorologicalDetectorData.getWindSpeed()); //风速 + expands.put("windDirection", meteorologicalDetectorData.getWindDirection()); //风向 + expands.put("temperature", meteorologicalDetectorData.getTemperature()); //大气温度 + expands.put("humidity", meteorologicalDetectorData.getHumidity()); //大气湿度 + expands.put("airPressure", meteorologicalDetectorData.getAtmosphericPressure()); //数字气压 + expands.put("wet", meteorologicalDetectorData.getWetSlipperyCoefficient()); //湿滑 + expands.put("rainXingTai", meteorologicalDetectorData.getPrecipitationType()); //雨量降水形态 + expands.put("visibility", meteorologicalDetectorData.getVisibility()); //能见度 + expands.put("pathContactLu", meteorologicalDetectorData.getRoadSurfaceTemperature()); //路面温度 + expands.put("pathContactBing", meteorologicalDetectorData.getFreezingPointTemperature()); //冰点温度 + expands.put("pathContactYan", meteorologicalDetectorData.getSalinityValue()); //路面盐度 + expands.put("pathContactZhuang", meteorologicalDetectorData.getRemoteRoadSurfaceStatus()); //路面状况 mdDeviceData.setExpands(JSONObject.toJSONString(expands)); From 5d650c12cb07985db0b8483c998a268ab392a89c Mon Sep 17 00:00:00 2001 From: lau572 <1010031226@qq.com> Date: Mon, 18 Mar 2024 16:42:16 +0800 Subject: [PATCH 3/3] =?UTF-8?q?1.=E6=89=B9=E9=87=8F=E6=93=8D=E4=BD=9C?= =?UTF-8?q?=E6=84=9F=E7=9F=A5=E4=BA=8B=E4=BB=B6=202.=E6=B0=94=E8=B1=A1?= =?UTF-8?q?=E6=A3=80=E6=B5=8B=E5=99=A8=E6=95=B0=E6=8D=AE=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/DcMeteorologicalDetectorData.java | 124 +++--------------- .../com/zc/business/mapper/DcEventMapper.java | 10 ++ .../business/mapper/MiddleDatabaseMapper.java | 10 ++ .../device/handler/DeviceMessageHandler.java | 28 ++-- .../service/IMiddleDatabaseService.java | 3 + .../service/impl/DcEventServiceImpl.java | 92 ++----------- .../impl/MiddleDatabaseServiceImpl.java | 6 + .../mapper/business/DcEventMapper.xml | 63 ++++++++- .../mapper/business/MiddleDatabaseMapper.xml | 86 ++++++++++++ 9 files changed, 218 insertions(+), 204 deletions(-) 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 436edfa8..627f5f12 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 @@ -34,14 +34,22 @@ public class DcMeteorologicalDetectorData extends BaseEntity @Excel(name = "能见度") private String visibility; - /** 路面状况 */ - @Excel(name = "路面状况") - private String roadSurfaceStatus; + /** 路面温度 */ + @Excel(name = "路面温度") + private String remoteRoadSurfaceTemperature; /** 气压 */ @Excel(name = "气压") private String atmosphericPressure; + /** 降水类型 */ + @Excel(name = "降水类型") + private String precipitationType; + + /** 湿滑系数 */ + @Excel(name = "湿滑系数") + private String wetSlipperyCoefficient; + /** 气温 */ @Excel(name = "气温") private String temperature; @@ -58,49 +66,18 @@ public class DcMeteorologicalDetectorData extends BaseEntity @Excel(name = "风速") private String windSpeed; - /** 冰点温度 */ - @Excel(name = "冰点温度") - private String freezingPointTemperature; - - /** 盐度值 */ - @Excel(name = "盐度值") - private String salinityValue; - - /** 路面温度 */ - @Excel(name = "路面温度") - private String roadSurfaceTemperature; - - /** 水膜厚度(GS1) */ - @Excel(name = "水膜厚度(GS1)") - private String waterFilmThickness; - - /** 降水类型 */ - @Excel(name = "降水类型") - private String precipitationType; + /** 路面状态 */ + @Excel(name = "路面状态") + private String remoteRoadSurfaceStatus; - /** 湿滑系数 */ - @Excel(name = "湿滑系数") - private String wetSlipperyCoefficient; + /** 水膜厚度 */ + @Excel(name = "水膜厚度") + private String waterFilmIceSnowValue; - /** 传感器温度 */ - @Excel(name = "传感器温度") - private String sensorTemperature; - /** 远程路面温度 */ - @Excel(name = "远程路面温度") - private String remoteRoadSurfaceTemperature; - /** 远程路面状态 */ - @Excel(name = "远程路面状态") - private String remoteRoadSurfaceStatus; - /** 路基温度 */ - @Excel(name = "路基温度") - private String subSurfaceTemperature; - /** 水膜厚度(GS2) */ - @Excel(name = "水膜厚度(GS2)") - private String waterFilmIceSnowValue; public void setId(Long id) { @@ -147,15 +124,6 @@ public class DcMeteorologicalDetectorData extends BaseEntity { return visibility; } - public void setRoadSurfaceStatus(String roadSurfaceStatus) - { - this.roadSurfaceStatus = roadSurfaceStatus; - } - - public String getRoadSurfaceStatus() - { - return roadSurfaceStatus; - } public void setAtmosphericPressure(String atmosphericPressure) { this.atmosphericPressure = atmosphericPressure; @@ -201,42 +169,7 @@ public class DcMeteorologicalDetectorData extends BaseEntity { return windSpeed; } - public void setFreezingPointTemperature(String freezingPointTemperature) - { - this.freezingPointTemperature = freezingPointTemperature; - } - - public String getFreezingPointTemperature() - { - return freezingPointTemperature; - } - public void setSalinityValue(String salinityValue) - { - this.salinityValue = salinityValue; - } - - public String getSalinityValue() - { - return salinityValue; - } - public void setRoadSurfaceTemperature(String roadSurfaceTemperature) - { - this.roadSurfaceTemperature = roadSurfaceTemperature; - } - public String getRoadSurfaceTemperature() - { - return roadSurfaceTemperature; - } - public void setWaterFilmThickness(String waterFilmThickness) - { - this.waterFilmThickness = waterFilmThickness; - } - - public String getWaterFilmThickness() - { - return waterFilmThickness; - } public void setPrecipitationType(String precipitationType) { this.precipitationType = precipitationType; @@ -255,15 +188,7 @@ public class DcMeteorologicalDetectorData extends BaseEntity { return wetSlipperyCoefficient; } - public void setSensorTemperature(String sensorTemperature) - { - this.sensorTemperature = sensorTemperature; - } - public String getSensorTemperature() - { - return sensorTemperature; - } public void setRemoteRoadSurfaceTemperature(String remoteRoadSurfaceTemperature) { this.remoteRoadSurfaceTemperature = remoteRoadSurfaceTemperature; @@ -282,15 +207,7 @@ public class DcMeteorologicalDetectorData extends BaseEntity { return remoteRoadSurfaceStatus; } - public void setSubSurfaceTemperature(String subSurfaceTemperature) - { - this.subSurfaceTemperature = subSurfaceTemperature; - } - public String getSubSurfaceTemperature() - { - return subSurfaceTemperature; - } public void setWaterFilmIceSnowValue(String waterFilmIceSnowValue) { this.waterFilmIceSnowValue = waterFilmIceSnowValue; @@ -309,22 +226,15 @@ public class DcMeteorologicalDetectorData extends BaseEntity .append("rainfall", getRainfall()) .append("visibilityType", getVisibilityType()) .append("visibility", getVisibility()) - .append("roadSurfaceStatus", getRoadSurfaceStatus()) .append("atmosphericPressure", getAtmosphericPressure()) .append("temperature", getTemperature()) .append("humidity", getHumidity()) .append("windDirection", getWindDirection()) .append("windSpeed", getWindSpeed()) - .append("freezingPointTemperature", getFreezingPointTemperature()) - .append("salinityValue", getSalinityValue()) - .append("roadSurfaceTemperature", getRoadSurfaceTemperature()) - .append("waterFilmThickness", getWaterFilmThickness()) .append("precipitationType", getPrecipitationType()) .append("wetSlipperyCoefficient", getWetSlipperyCoefficient()) - .append("sensorTemperature", getSensorTemperature()) .append("remoteRoadSurfaceTemperature", getRemoteRoadSurfaceTemperature()) .append("remoteRoadSurfaceStatus", getRemoteRoadSurfaceStatus()) - .append("subSurfaceTemperature", getSubSurfaceTemperature()) .append("waterFilmIceSnowValue", getWaterFilmIceSnowValue()) .toString(); } diff --git a/zc-business/src/main/java/com/zc/business/mapper/DcEventMapper.java b/zc-business/src/main/java/com/zc/business/mapper/DcEventMapper.java index 24fc59d0..c82f85ef 100644 --- a/zc-business/src/main/java/com/zc/business/mapper/DcEventMapper.java +++ b/zc-business/src/main/java/com/zc/business/mapper/DcEventMapper.java @@ -73,6 +73,16 @@ public interface DcEventMapper extends BaseMapper List>selectCount(); + /** + * @Description 批量添加事件 + * + * @author liuwenge + * @date 2024/3/18 15:02 + * @param eventList + * @return boolean + */ + boolean batchInsertDcEvent(List eventList); + } diff --git a/zc-business/src/main/java/com/zc/business/mapper/MiddleDatabaseMapper.java b/zc-business/src/main/java/com/zc/business/mapper/MiddleDatabaseMapper.java index 180700fb..051869d5 100644 --- a/zc-business/src/main/java/com/zc/business/mapper/MiddleDatabaseMapper.java +++ b/zc-business/src/main/java/com/zc/business/mapper/MiddleDatabaseMapper.java @@ -81,4 +81,14 @@ public interface MiddleDatabaseMapper * @return 结果 */ boolean updateMiddleDatabaseEvent(MdEvent mdEvent); + + /** + * @Description 中间库批量添加事件 + * + * @author liuwenge + * @date 2024/3/18 15:09 + * @param mdEventList + * @return boolean + */ + boolean batchInsertMiddleDatabaseEvent(List mdEventList); } 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 e65f7add..663f37e4 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 @@ -425,20 +425,20 @@ public class DeviceMessageHandler { mdDeviceData.setTimeStamp(new Date()); mdDeviceData.setCreatorUserId("自动存储"); - Map expands = new HashMap<>(); - expands.put("rainFall", meteorologicalDetectorData.getRainfall()); //雨量 - expands.put("windSpeed", meteorologicalDetectorData.getWindSpeed()); //风速 - expands.put("windDirection", meteorologicalDetectorData.getWindDirection()); //风向 - expands.put("temperature", meteorologicalDetectorData.getTemperature()); //大气温度 - expands.put("humidity", meteorologicalDetectorData.getHumidity()); //大气湿度 - expands.put("airPressure", meteorologicalDetectorData.getAtmosphericPressure()); //数字气压 - expands.put("wet", meteorologicalDetectorData.getWetSlipperyCoefficient()); //湿滑 - expands.put("rainXingTai", meteorologicalDetectorData.getPrecipitationType()); //雨量降水形态 - expands.put("visibility", meteorologicalDetectorData.getVisibility()); //能见度 - expands.put("pathContactLu", meteorologicalDetectorData.getRoadSurfaceTemperature()); //路面温度 - expands.put("pathContactBing", meteorologicalDetectorData.getFreezingPointTemperature()); //冰点温度 - expands.put("pathContactYan", meteorologicalDetectorData.getSalinityValue()); //路面盐度 - expands.put("pathContactZhuang", meteorologicalDetectorData.getRemoteRoadSurfaceStatus()); //路面状况 + Map expands = new HashMap<>(); + expands.put("rainFall",meteorologicalDetectorData.getRainfall()); //雨量 + expands.put("windDirection",meteorologicalDetectorData.getWindDirection()); //风向 + expands.put("windSpeed",meteorologicalDetectorData.getWindSpeed()); //风速 + expands.put("temperature",meteorologicalDetectorData.getTemperature()); //大气温度 + expands.put("humidity",meteorologicalDetectorData.getHumidity()); //大气湿度 + expands.put("airPressure",meteorologicalDetectorData.getAtmosphericPressure()); //气压 + expands.put("waterThick",meteorologicalDetectorData.getWaterFilmIceSnowValue()); //水膜厚度 + expands.put("wet",meteorologicalDetectorData.getWetSlipperyCoefficient()); //湿滑 + expands.put("rainXingTai",meteorologicalDetectorData.getPrecipitationType()); //雨量降水形态 + expands.put("visibility",meteorologicalDetectorData.getVisibility()); //能见度 + expands.put("remoteRoadSurfaceTemperature",meteorologicalDetectorData.getRemoteRoadSurfaceTemperature()); //路面温度 + expands.put("pathContactZhuang",meteorologicalDetectorData.getRemoteRoadSurfaceStatus()); //路面状况 + mdDeviceData.setExpands(JSONObject.toJSONString(expands)); diff --git a/zc-business/src/main/java/com/zc/business/service/IMiddleDatabaseService.java b/zc-business/src/main/java/com/zc/business/service/IMiddleDatabaseService.java index 96560db1..004b2954 100644 --- a/zc-business/src/main/java/com/zc/business/service/IMiddleDatabaseService.java +++ b/zc-business/src/main/java/com/zc/business/service/IMiddleDatabaseService.java @@ -89,4 +89,7 @@ public interface IMiddleDatabaseService */ boolean updateMiddleDatabaseEvent(MdEvent mdEvent); + + boolean batchInsertMiddleDatabaseEvent(List mdEventList); + } 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 b3940d8d..77161fbd 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 @@ -358,92 +358,20 @@ public class DcEventServiceImpl extends ServiceImpl impl */ @Override public boolean batchInsertDcEventWarning(List dcEventList) { - for (DcEvent dcEvent : dcEventList) { - //设置事件Id UUID无下划线格式32 - String uuid = dcEvent.getId(); - int i7 = dcEventMapper.insertDcEvent(dcEvent); - if (i7 > 0) { - //中间库 - MdEvent mdEvent = new MdEvent(dcEvent); - middleDatabaseService.insertMiddleDatabaseEvent(mdEvent); - - //获取事件类型 - int eventType = Math.toIntExact(dcEvent.getEventType()); - switch (eventType) { - //交通事故 - case 1: - if (dcEvent.getDcEventAccident() != null) { - dcEvent.getDcEventAccident().setId(uuid); - int i1 = dcEventAccidentMapper.insertDcEventAccident(dcEvent.getDcEventAccident()); - } - - break; - //车辆事故 - case 2: - if (dcEvent.getDcEventVehicleAccident() != null) { - dcEvent.getDcEventVehicleAccident().setId(uuid); - int i5 = dcEventVehicleAccidentMapper.insertDcEventVehicleAccident(dcEvent.getDcEventVehicleAccident()); - } - - break; - //交通管制 - case 3: - if (dcEvent.getDcEventTrafficControl() != null) { - dcEvent.getDcEventTrafficControl().setId(uuid); - int i6 = dcEventTrafficControlMapper.insertDcEventTrafficControl(dcEvent.getDcEventTrafficControl()); - } - break; - //交通拥堵 - case 4: - if (dcEvent.getDcEventTrafficCongestion() != null) { - dcEvent.getDcEventTrafficCongestion().setId(uuid); - int i4 = dcEventTrafficCongestionMapper.insertDcEventTrafficCongestion(dcEvent.getDcEventTrafficCongestion()); - } - - break; - //非法上路 - case 5: - break; - //路障清除 - case 6: - break; - //施工建设 - case 7: - if (dcEvent.getDcEventConstruction() != null) { - dcEvent.getDcEventConstruction().setId(uuid); - int i2 = dcEventConstructionMapper.insertDcEventConstruction(dcEvent.getDcEventConstruction()); - } - - break; - //服务区异常 - case 8: - if (dcEvent.getDcEventServiceArea() != null) { - dcEvent.getDcEventServiceArea().setId(uuid); - int i3 = dcEventServiceAreaMapper.insertDcEventServiceArea(dcEvent.getDcEventServiceArea()); - } - break; - //设施设备隐患 - case 9: - break; - //异常天气 - case 10: - if (dcEvent.getDcEventAbnormalWeather() != null) { - dcEvent.getDcEventAbnormalWeather().setId(uuid); - int i = dcEventAbnormalWeatherMapper.insertDcEventAbnormalWeather(dcEvent.getDcEventAbnormalWeather()); - } - break; - //其他事件 - case 11: - break; - // - default: - break; + boolean flag = dcEventMapper.batchInsertDcEvent(dcEventList); - } + if (flag) { + //中间库 + List mdEventList = new ArrayList<>(); + for (DcEvent dcEvent : dcEventList) { + MdEvent mdEvent = new MdEvent(dcEvent); + mdEventList.add(mdEvent); } + middleDatabaseService.batchInsertMiddleDatabaseEvent(mdEventList); } - return true; + + return flag; } /** diff --git a/zc-business/src/main/java/com/zc/business/service/impl/MiddleDatabaseServiceImpl.java b/zc-business/src/main/java/com/zc/business/service/impl/MiddleDatabaseServiceImpl.java index 7f5021de..af8e8a74 100644 --- a/zc-business/src/main/java/com/zc/business/service/impl/MiddleDatabaseServiceImpl.java +++ b/zc-business/src/main/java/com/zc/business/service/impl/MiddleDatabaseServiceImpl.java @@ -153,4 +153,10 @@ public class MiddleDatabaseServiceImpl implements IMiddleDatabaseService { } return middleDatabaseMapper.updateMiddleDatabaseEvent(mdEvent); } + + @Override + public boolean batchInsertMiddleDatabaseEvent(List mdEventList){ + return middleDatabaseMapper.batchInsertMiddleDatabaseEvent(mdEventList); + } + } diff --git a/zc-business/src/main/resources/mapper/business/DcEventMapper.xml b/zc-business/src/main/resources/mapper/business/DcEventMapper.xml index 931e5e9d..85c410f8 100644 --- a/zc-business/src/main/resources/mapper/business/DcEventMapper.xml +++ b/zc-business/src/main/resources/mapper/business/DcEventMapper.xml @@ -544,8 +544,69 @@ #{isPerceived}, + + + insert into dc_event + + id, + dept_id, + stake_mark, + direction, + user_id, + start_time, + end_time, + estimated_end_time, + event_level, + event_type, + event_subclass, + event_cause, + description, + event_state, + event_source, + event_nature, + remark, + create_time, + update_time, + event_source_tips, + in_tunnel, + road_id, + lang, + event_title, + occurrence_time, + is_perceived, + + + #{dcEvent.id}, + #{dcEvent.deptId}, + #{dcEvent.stakeMark}, + #{dcEvent.direction}, + #{dcEvent.userId}, + #{dcEvent.startTime}, + #{dcEvent.endTime}, + #{dcEvent.estimatedEndTime}, + #{dcEvent.eventLevel}, + #{dcEvent.eventType}, + #{dcEvent.eventSubclass}, + #{dcEvent.eventCause}, + #{dcEvent.description}, + #{dcEvent.eventState}, + #{dcEvent.eventSource}, + #{dcEvent.eventNature}, + #{dcEvent.remark}, + #{dcEvent.createTime}, + #{dcEvent.updateTime}, + #{dcEvent.eventSourceTips}, + #{dcEvent.inTunnel}, + #{dcEvent.roadId}, + #{dcEvent.lang}, + #{dcEvent.eventTitle}, + #{dcEvent.occurrenceTime}, + #{dcEvent.isPerceived}, + + + - + update dc_event dept_id = #{deptId}, diff --git a/zc-business/src/main/resources/mapper/business/MiddleDatabaseMapper.xml b/zc-business/src/main/resources/mapper/business/MiddleDatabaseMapper.xml index 1a7e42e7..9e8b9615 100644 --- a/zc-business/src/main/resources/mapper/business/MiddleDatabaseMapper.xml +++ b/zc-business/src/main/resources/mapper/business/MiddleDatabaseMapper.xml @@ -231,6 +231,92 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + + insert into event + + fusionId, + event_name, + event_type_code, + event_desc, + occur_time, + end_time, + stake_number, + longitude, + latitude, + lane, + direction, + location, + event_source_code, + event_source, + event_status, + event_level, + section_id, + event_type_code2, + event_cause, + accident_weather, + accident_queue, + congestion_pile, + congestion_reason, + control_category, + control_reason, + control_reason_type, + control_station, + control_pile, + control_strategy, + control_type, + control_vehicle_type, + CreatorUserId, + LastModificationTime, + LastModifierUserId, + IsDeleted, + DeleterUserId, + DeletionTime, + CreationTime, + + + #{mdEvent.fusionId}, + #{mdEvent.eventName}, + #{mdEvent.eventTypeCode}, + #{mdEvent.eventDesc}, + #{mdEvent.occurTime}, + #{mdEvent.endTime}, + #{mdEvent.stakeNumber}, + #{mdEvent.longitude}, + #{mdEvent.latitude}, + #{mdEvent.lane}, + #{mdEvent.direction}, + #{mdEvent.location}, + #{mdEvent.eventSourceCode}, + #{mdEvent.eventSource}, + #{mdEvent.eventStatus}, + #{mdEvent.eventLevel}, + #{mdEvent.sectionId}, + #{mdEvent.eventTypeCode2}, + #{mdEvent.eventCause}, + #{mdEvent.accidentWeather}, + #{mdEvent.accidentQueue}, + #{mdEvent.congestionPile}, + #{mdEvent.congestionReason}, + #{mdEvent.controlCategory}, + #{mdEvent.controlReason}, + #{mdEvent.controlReasonType}, + #{mdEvent.controlStation}, + #{mdEvent.controlPile}, + #{mdEvent.controlStrategy}, + #{mdEvent.controlType}, + #{mdEvent.controlVehicleType}, + #{mdEvent.creatorUserId}, + #{mdEvent.lastModificationTime}, + #{mdEvent.lastModifierUserId}, + #{mdEvent.isDeleted}, + #{mdEvent.deleterUserId}, + #{mdEvent.deletionTime}, + now() + + + + update device