From 5393e1b43f7148adc93dd5a29f7b6fd4a054eec6 Mon Sep 17 00:00:00 2001 From: puzhibing <393733352@qq.com> Date: 星期四, 05 六月 2025 16:13:22 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/WarnServiceImpl.java | 61 +++++++++++++++++++++++------- 1 files changed, 47 insertions(+), 14 deletions(-) diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/WarnServiceImpl.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/WarnServiceImpl.java index b2afff4..21a4db0 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/WarnServiceImpl.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/WarnServiceImpl.java @@ -5,8 +5,10 @@ import com.ruoyi.common.core.utils.StringUtils; import com.ruoyi.common.core.web.page.PageInfo; import com.ruoyi.dataInterchange.api.feignClient.UPWarnMsgAdptInfoClient; +import com.ruoyi.dataInterchange.api.feignClient.UPWarnMsgOperationInfoClient; import com.ruoyi.dataInterchange.api.model.enums.WarnType; import com.ruoyi.dataInterchange.api.vo.UPWarnMsgAdptInfoVo; +import com.ruoyi.dataInterchange.api.vo.UPWarnMsgOperationInfoVo; import com.ruoyi.system.api.model.Car; import com.ruoyi.system.api.model.Driver; import com.ruoyi.system.api.model.Enterprise; @@ -49,6 +51,9 @@ @Resource private ICarService carService; + + @Resource + private UPWarnMsgOperationInfoClient upWarnMsgOperationInfoClient; /** @@ -121,6 +126,7 @@ warn.setCreateTime(LocalDateTime.now()); warn.setObjectId(vo.getInfoId()); warn.setVehicleNumber(vo.getVehicleNo()); + warn.setPicUrl(vo.getPicUrl()); warns.add(warn); } if (warns.size() > 0) { @@ -179,8 +185,33 @@ warn.setTreatmentState("将来处理"); break; } - this.updateById(warn); + UPWarnMsgOperationInfoVo upWarnMsgOperationInfoVo = upWarnMsgOperationInfoClient.getUPWarnMsgOperationInfo(warn.getObjectId()).getData(); + if(null != upWarnMsgOperationInfoVo){ + warn.setTreatmentUser(upWarnMsgOperationInfoVo.getOperator()); + warn.setTreatmentTime(LocalDateTime.ofEpochSecond(upWarnMsgOperationInfoVo.getCreateTime(), 0, ZoneOffset.ofHours(8)).format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))); + switch (upWarnMsgOperationInfoVo.getMethod()) { + case 0x01: + warn.setTreatmentRemark("快速拍照"); + break; + case 0x02: + warn.setTreatmentRemark("语音下发"); + break; + case 0x03: + warn.setTreatmentRemark("不做处理"); + break; + case 0x04: + warn.setTreatmentRemark("其他"); + break; + default: + warn.setTreatmentRemark("其他"); + break; + } + } } + if(null == warn.getPicUrl()){ + warn.setPicUrl(vo.getPicUrl()); + } + this.updateById(warn); } } @@ -196,19 +227,21 @@ public PageInfo<CarWarnListResp> getCarWarnList(CarWarnListReq carWarnListReq) { PageInfo<CarWarnListResp> pageInfo = new PageInfo<>(carWarnListReq.getPageCurr(), carWarnListReq.getPageSize()); String warnType = carWarnListReq.getWarnType(); - switch (warnType) { - case "前向碰撞报警": - carWarnListReq.setWarnTypes(Arrays.asList("前向碰撞报警", "碰撞预警")); - break; - case "车道偏离报警": - carWarnListReq.setWarnTypes(Arrays.asList("车道偏离报警", "偏离路线报警", "车道偏离报警")); - break; - case "疲劳驾驶报警": - carWarnListReq.setWarnTypes(Arrays.asList("疲劳驾驶报警", "疲劳驾驶报警(生理疲劳)")); - break; - default: - carWarnListReq.setWarnTypes(Arrays.asList(warnType)); - break; + if(StringUtils.isNotEmpty(warnType)){ + switch (warnType) { + case "前向碰撞报警": + carWarnListReq.setWarnTypes(Arrays.asList("前向碰撞报警", "碰撞预警")); + break; + case "车道偏离报警": + carWarnListReq.setWarnTypes(Arrays.asList("车道偏离报警", "偏离路线报警", "车道偏离报警")); + break; + case "疲劳驾驶报警": + carWarnListReq.setWarnTypes(Arrays.asList("疲劳驾驶报警", "疲劳驾驶报警(生理疲劳)")); + break; + default: + carWarnListReq.setWarnTypes(Arrays.asList(warnType)); + break; + } } return this.baseMapper.getCarWarnList(pageInfo, carWarnListReq); } -- Gitblit v1.7.1