From 9af506773aa2df712b22a6e5b7a5dcf3619ddf1b Mon Sep 17 00:00:00 2001 From: lau572 <1010031226@qq.com> Date: Tue, 1 Apr 2025 16:01:50 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=8B=E4=BB=B6=E8=A7=A3=E9=99=A4=E6=97=B6?= =?UTF-8?q?=E8=AE=BE=E5=A4=87=E6=8E=A7=E5=88=B6=E6=81=A2=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/DcEventServiceImpl.java | 44 +++++++++++++++++++ 1 file changed, 44 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 7da836f0..8f7e2f0c 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 @@ -1,6 +1,8 @@ package com.zc.business.service.impl; 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.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.ruoyi.common.core.domain.AjaxResult; @@ -9,6 +11,8 @@ 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.constant.DeviceFunctionIdConstants; +import com.zc.business.controller.DcDeviceController; import com.zc.business.domain.*; import com.zc.business.enums.*; import com.zc.business.mapper.*; @@ -24,6 +28,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import javax.annotation.Resource; import java.io.IOException; import java.text.SimpleDateFormat; import java.util.*; @@ -92,6 +97,12 @@ public class DcEventServiceImpl extends ServiceImpl impl @Autowired private DcWarningServiceImpl dcWarningService; + @Autowired + private EventPlanAssocMapper eventPlanAssocMapper; + + @Autowired + private DcDeviceController deviceController; + private final String HAPPEN = UniversalEnum.TAKE_PLACE.getValue(); private final String EVENT = UniversalEnum.INCIDENT.getValue(); //private final String SUBEVENT = "0"; @@ -2003,6 +2014,39 @@ public class DcEventServiceImpl extends ServiceImpl impl boolean flag = dcEventMapper.completeEvent(eventId); if (flag) { + EventPlanAssoc eventPlanAssoc = new EventPlanAssoc(); + eventPlanAssoc.setEventId(eventId); + LambdaQueryWrapper lambdaQueryWrapper = new LambdaQueryWrapper<>(); + lambdaQueryWrapper.eq(EventPlanAssoc::getEventId,eventId); + lambdaQueryWrapper.eq(EventPlanAssoc::getOperationType,"1"); + List eventPlanAssocs = eventPlanAssocMapper.selectList(lambdaQueryWrapper); + if (eventPlanAssocs != null && eventPlanAssocs.size() > 0){ + for (EventPlanAssoc planAssoc : eventPlanAssocs) { + JSONArray control = JSONArray.parseArray(planAssoc.getControl()); + for (Object o : control) { + JSONObject controlItem = (JSONObject) o; + String[] deviceList = controlItem.getString("deviceList").split(","); + JSONObject recoverConfig = controlItem.getJSONObject("recoverConfig"); + int deviceType = controlItem.getIntValue("deviceType"); + if (deviceType == 2){ + //情报板 切换播放目录 + for (String deviceId : deviceList) { + HashMap props = new HashMap<>(); + props.put("fileId", UniversalEnum.TEN.getValue()); + String functionId = DeviceFunctionIdConstants.VARIABLE_INFORMATION_FLAG_1B; + deviceController.getAjaxResult(deviceId, functionId, props); + } + + } else if (deviceType == 10){ + //激光疲劳唤醒 + + } else if (deviceType == 12){ + //行车诱导 + + } + } + } + } //中间库 MdEvent mdEvent = new MdEvent();