|
@@ -1,12 +1,17 @@
|
|
|
package com.zd.laboratory.controller.bigview;
|
|
package com.zd.laboratory.controller.bigview;
|
|
|
|
|
|
|
|
|
|
+import com.zd.algorithm.api.speaker.feign.RemoteSpeakService;
|
|
|
|
|
+import com.zd.common.core.redis.RedisService;
|
|
|
|
|
+import com.zd.common.core.security.TokenService;
|
|
|
import com.zd.common.core.web.controller.BaseController;
|
|
import com.zd.common.core.web.controller.BaseController;
|
|
|
import com.zd.laboratory.api.entity.LabSubjectEntity;
|
|
import com.zd.laboratory.api.entity.LabSubjectEntity;
|
|
|
import com.zd.laboratory.api.entity.LabSubjectControllerVO;
|
|
import com.zd.laboratory.api.entity.LabSubjectControllerVO;
|
|
|
|
|
+import com.zd.laboratory.domain.LabHazardSubjectRelation;
|
|
|
import com.zd.laboratory.domain.bigview.HardwareState;
|
|
import com.zd.laboratory.domain.bigview.HardwareState;
|
|
|
import com.zd.laboratory.domain.bigview.HazardTotal;
|
|
import com.zd.laboratory.domain.bigview.HazardTotal;
|
|
|
import com.zd.laboratory.domain.bigview.SenseState;
|
|
import com.zd.laboratory.domain.bigview.SenseState;
|
|
|
import com.zd.laboratory.domain.vo.*;
|
|
import com.zd.laboratory.domain.vo.*;
|
|
|
|
|
+import com.zd.laboratory.mqtt.service.impl.SubMessageSendManager;
|
|
|
import com.zd.laboratory.service.*;
|
|
import com.zd.laboratory.service.*;
|
|
|
import com.zd.laboratory.service.impl.BigViewServiceImpl;
|
|
import com.zd.laboratory.service.impl.BigViewServiceImpl;
|
|
|
import com.zd.laboratory.service.impl.LabSubjectManagerService;
|
|
import com.zd.laboratory.service.impl.LabSubjectManagerService;
|
|
@@ -18,14 +23,18 @@ import com.zd.model.page.TableDataInfo;
|
|
|
import com.zd.system.api.feign.RemoteUserService;
|
|
import com.zd.system.api.feign.RemoteUserService;
|
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
|
|
+import jdk.nashorn.internal.parser.Token;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
|
|
+import java.time.LocalDateTime;
|
|
|
|
|
+import java.time.format.DateTimeFormatter;
|
|
|
import java.util.Collections;
|
|
import java.util.Collections;
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
|
import java.util.Optional;
|
|
import java.util.Optional;
|
|
|
|
|
+import java.util.concurrent.TimeUnit;
|
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -62,6 +71,18 @@ public class BigViewController extends BaseController {
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private RemoteUserService remoteUserService;
|
|
private RemoteUserService remoteUserService;
|
|
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ RedisService redisService;
|
|
|
|
|
+
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private SubMessageSendManager messageSendService;
|
|
|
|
|
+
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private RemoteSpeakService remoteSpeakService;
|
|
|
|
|
+
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private TokenService tokenService;
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* echarts-条形图:设备概览
|
|
* echarts-条形图:设备概览
|
|
|
*
|
|
*
|
|
@@ -96,7 +117,7 @@ public class BigViewController extends BaseController {
|
|
|
@ApiOperation("echarts-条形图:危险源")
|
|
@ApiOperation("echarts-条形图:危险源")
|
|
|
@GetMapping("/HazardTotal")
|
|
@GetMapping("/HazardTotal")
|
|
|
public Option echartsHazardTotalview() {
|
|
public Option echartsHazardTotalview() {
|
|
|
- List<HazardTotal> list = bigViewService.queryHazardRank();
|
|
|
|
|
|
|
+ List<HazardTotal> list = bigViewService.queryHazardRank(new LabHazardSubjectRelation());
|
|
|
Builder builder = new EchartsBuilder(list);
|
|
Builder builder = new EchartsBuilder(list);
|
|
|
return builder.build();
|
|
return builder.build();
|
|
|
}
|
|
}
|
|
@@ -270,4 +291,55 @@ public class BigViewController extends BaseController {
|
|
|
startPage();
|
|
startPage();
|
|
|
return getDataTable(labGradeManageRecordService.queryManageWorkChartDetails(labManageWorkChartVo));
|
|
return getDataTable(labGradeManageRecordService.queryManageWorkChartDetails(labManageWorkChartVo));
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 疏散页面统计:疏散危险源统计
|
|
|
|
|
+ *
|
|
|
|
|
+ * @return
|
|
|
|
|
+ */
|
|
|
|
|
+ @ApiOperation("疏散页面统计:疏散危险源统计")
|
|
|
|
|
+ @GetMapping("/exitHazardTotal")
|
|
|
|
|
+ public ResultData exitHazardTotal(LabHazardSubjectRelation labHazardSubjectRelation) {
|
|
|
|
|
+ List<HazardTotal> list = bigViewService.queryHazardRank(labHazardSubjectRelation);
|
|
|
|
|
+ if(list.size()>5){
|
|
|
|
|
+ return ResultData.success(list.subList(0,5));
|
|
|
|
|
+ }
|
|
|
|
|
+ return ResultData.success(list);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 风险应急处置:获取喇叭消息
|
|
|
|
|
+ *
|
|
|
|
|
+ * @return
|
|
|
|
|
+ */
|
|
|
|
|
+ @ApiOperation("喇叭消息暂存:喇叭消息最后一条")
|
|
|
|
|
+ @GetMapping("/getHornLastMess")
|
|
|
|
|
+ public ResultData getHornLastMess(LabHornMessageVo labHornMessageVo) {
|
|
|
|
|
+ if(redisService.getCacheObject("sendHornMess"+labHornMessageVo.getFloorId())!=null){
|
|
|
|
|
+ return ResultData.success(redisService.getCacheObject("sendHornMess"+labHornMessageVo.getFloorId()));
|
|
|
|
|
+ }
|
|
|
|
|
+ return ResultData.success(new LabHornMessageVo());
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 风险应急处置:喇叭消息暂存
|
|
|
|
|
+ *
|
|
|
|
|
+ * @return
|
|
|
|
|
+ */
|
|
|
|
|
+ @ApiOperation("风险应急处置:喇叭消息暂存")
|
|
|
|
|
+ @PostMapping("/sendHornMess")
|
|
|
|
|
+ public ResultData sendHornMess(@RequestBody LabHornMessageVo labHornMessageVo) {
|
|
|
|
|
+ LocalDateTime localDateTime = LocalDateTime.now();
|
|
|
|
|
+ labHornMessageVo.setSendName(tokenService.getLoginUser().getNickName());
|
|
|
|
|
+ labHornMessageVo.setNowTime(localDateTime.format(DateTimeFormatter.ofPattern("HH:mm")));
|
|
|
|
|
+ redisService.setCacheObject("sendHornMess"+labHornMessageVo.getFloorId(), labHornMessageVo, 3L, TimeUnit.HOURS);
|
|
|
|
|
+ //todo 消息下发,告诉前端
|
|
|
|
|
+ messageSendService.sendHornMessToFloor(labHornMessageVo.getFloorId());
|
|
|
|
|
+ //todo 调用喇叭服务
|
|
|
|
|
+// remoteSpeakService.textParseUrlIps(labHornMessageVo.getMessageContext(),labHornMessageVo.getPlayVo());
|
|
|
|
|
+ return ResultData.success();
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|