|
@@ -1,15 +1,19 @@
|
|
package com.ozs.web.controller.websocket;
|
|
package com.ozs.web.controller.websocket;
|
|
|
|
|
|
import com.alibaba.fastjson2.JSONObject;
|
|
import com.alibaba.fastjson2.JSONObject;
|
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
import com.ozs.common.core.controller.BaseController;
|
|
import com.ozs.common.core.controller.BaseController;
|
|
import com.ozs.common.utils.AppendUtils;
|
|
import com.ozs.common.utils.AppendUtils;
|
|
import com.ozs.service.entity.BaseCameraManagement;
|
|
import com.ozs.service.entity.BaseCameraManagement;
|
|
|
|
+import com.ozs.service.entity.MsgAlarm;
|
|
import com.ozs.service.entity.vo.MsgAlarmResp;
|
|
import com.ozs.service.entity.vo.MsgAlarmResp;
|
|
|
|
+import com.ozs.service.service.BaseCameraManagementService;
|
|
import com.ozs.service.service.BaseRailwayManagementService;
|
|
import com.ozs.service.service.BaseRailwayManagementService;
|
|
import com.ozs.service.service.BaseUserService;
|
|
import com.ozs.service.service.BaseUserService;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Controller;
|
|
import org.springframework.stereotype.Controller;
|
|
|
|
+import org.springframework.util.ObjectUtils;
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
import javax.annotation.Resource;
|
|
@@ -30,19 +34,27 @@ public class WebSocketConteoller extends BaseController {
|
|
private BaseUserService baseUserService;
|
|
private BaseUserService baseUserService;
|
|
@Resource
|
|
@Resource
|
|
private BaseRailwayManagementService baseRailwayManagementService;
|
|
private BaseRailwayManagementService baseRailwayManagementService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private BaseCameraManagementService baseCameraManagementService;
|
|
|
|
|
|
@ResponseBody
|
|
@ResponseBody
|
|
@PostMapping("/publish")
|
|
@PostMapping("/publish")
|
|
- public Map publish(@RequestBody BaseCameraManagement baseCameraManagement) {
|
|
|
|
|
|
+ public Map publish(@RequestBody MsgAlarm msgAlarm) {
|
|
|
|
+ LambdaQueryWrapper<BaseCameraManagement> wrapper = new LambdaQueryWrapper<BaseCameraManagement>();
|
|
|
|
+ if (!ObjectUtils.isEmpty(msgAlarm.getCameraCode())) {
|
|
|
|
+ wrapper.eq(BaseCameraManagement::getCameraCode, msgAlarm.getCameraCode());
|
|
|
|
+ }
|
|
|
|
+ BaseCameraManagement baseCameraManagement = baseCameraManagementService.getOne(wrapper);
|
|
// 获取推送人ID列表
|
|
// 获取推送人ID列表
|
|
Set<String> set = baseUserService.getUserIdList(baseCameraManagement.getCreateBy(), baseCameraManagement.getDeptId());
|
|
Set<String> set = baseUserService.getUserIdList(baseCameraManagement.getCreateBy(), baseCameraManagement.getDeptId());
|
|
- // List<String> list = new ArrayList<>(set);
|
|
|
|
String[] list = set.toArray(new String[set.size()]);
|
|
String[] list = set.toArray(new String[set.size()]);
|
|
MsgAlarmResp msgAlarmResp = new MsgAlarmResp();
|
|
MsgAlarmResp msgAlarmResp = new MsgAlarmResp();
|
|
String begin = AppendUtils.stringAppend(baseCameraManagement.getBeginMile());
|
|
String begin = AppendUtils.stringAppend(baseCameraManagement.getBeginMile());
|
|
String end = AppendUtils.stringAppend(baseCameraManagement.getEndMile());
|
|
String end = AppendUtils.stringAppend(baseCameraManagement.getEndMile());
|
|
String endMile = begin + "-" + end;
|
|
String endMile = begin + "-" + end;
|
|
msgAlarmResp.setBeginMile(endMile);
|
|
msgAlarmResp.setBeginMile(endMile);
|
|
|
|
+ msgAlarmResp.setAlarmType(msgAlarm.getAlarmType());
|
|
|
|
+ msgAlarmResp.setAlarmTime(msgAlarm.getAlarmTime());
|
|
String mile = AppendUtils.stringAppend(baseCameraManagement.getInstallMile());
|
|
String mile = AppendUtils.stringAppend(baseCameraManagement.getInstallMile());
|
|
msgAlarmResp.setAlarmMile(mile);
|
|
msgAlarmResp.setAlarmMile(mile);
|
|
String cameraCode = baseCameraManagement.getCameraCode();
|
|
String cameraCode = baseCameraManagement.getCameraCode();
|