|
|
@@ -1,8 +1,10 @@
|
|
|
package com.zd.laboratory.controller.bigview;
|
|
|
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
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.utils.DateUtils;
|
|
|
import com.zd.common.core.utils.StringUtils;
|
|
|
import com.zd.common.core.web.controller.BaseController;
|
|
|
import com.zd.laboratory.api.entity.LabSubjectEntity;
|
|
|
@@ -10,6 +12,7 @@ import com.zd.laboratory.api.entity.LabSubjectControllerVO;
|
|
|
import com.zd.laboratory.domain.LabHazardSubjectRelation;
|
|
|
import com.zd.laboratory.domain.LabRiskPlanAbnormalGroup;
|
|
|
import com.zd.laboratory.domain.LabSubject;
|
|
|
+import com.zd.laboratory.domain.WarningNoticeLog;
|
|
|
import com.zd.laboratory.domain.bigview.HardwareState;
|
|
|
import com.zd.laboratory.domain.bigview.HazardTotal;
|
|
|
import com.zd.laboratory.domain.bigview.SenseState;
|
|
|
@@ -22,11 +25,12 @@ import com.zd.model.domain.ResultData;
|
|
|
import com.zd.model.echarts.Builder;
|
|
|
import com.zd.model.echarts.EchartsBuilder;
|
|
|
import com.zd.model.echarts.Option;
|
|
|
+import com.zd.model.entity.SysDept;
|
|
|
import com.zd.model.page.TableDataInfo;
|
|
|
+import com.zd.system.api.feign.RemoteDeptService;
|
|
|
import com.zd.system.api.feign.RemoteUserService;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
-import jdk.nashorn.internal.parser.Token;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
@@ -87,7 +91,13 @@ public class BigViewController extends BaseController {
|
|
|
private ILabRiskPlanAbnormalGroupService groupService;
|
|
|
|
|
|
@Autowired
|
|
|
- ILabSubjectService subjectService;
|
|
|
+ private ILabSubjectService subjectService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private RemoteDeptService remoteDeptService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private WarningNoticeLogService warningNoticeLogService;
|
|
|
|
|
|
/**
|
|
|
* echarts-条形图:设备概览
|
|
|
@@ -424,6 +434,41 @@ public class BigViewController extends BaseController {
|
|
|
return ResultData.success(list);
|
|
|
}
|
|
|
|
|
|
+ @ApiOperation("大屏-学院安全状态查询")
|
|
|
+ @GetMapping("/getCollege")
|
|
|
+ public ResultData getCollege() {
|
|
|
+ //查询学院
|
|
|
+ ResultData<List<SysDept>> rList = remoteDeptService.getdepartments();
|
|
|
+ List<SysDept> deptList = rList.getData();
|
|
|
+
|
|
|
+ for (SysDept dp:deptList) {
|
|
|
+ //查询学院下的实验室
|
|
|
+ LabSubject subject = new LabSubject();
|
|
|
+ subject.setDeptId(dp.getDeptId());
|
|
|
+ List<LabSubject> subjectList= subjectService.buildBySub(subject);
|
|
|
+
|
|
|
+ if(subjectList!=null && subjectList.size()>0){
|
|
|
+ List<Long> subjectIds = subjectList.stream().map(LabSubject::getId).collect(Collectors.toList());
|
|
|
+ //查询实验室下的预案信息
|
|
|
+ LabRiskPlanAbnormalGroup group = new LabRiskPlanAbnormalGroup();
|
|
|
+ group.setIds(subjectIds);
|
|
|
+ group.setStatus(1L);
|
|
|
+ List<LabRiskPlanAbnormalGroup> groupList = groupService.selectListBySubjectIds(group);
|
|
|
+ if(groupList!=null && groupList.size()>0){
|
|
|
+ String timediff = DateUtils.getDatePoor(new Date(), groupList.get(0).getCreateTime());
|
|
|
+ dp.setRemark(timediff);
|
|
|
+ }else {
|
|
|
+ //无预案
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ //无实验室
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ return ResultData.success(deptList);
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
@ApiOperation("大屏-校级-预警通知")
|
|
|
@GetMapping("/warningNotice")
|
|
|
@@ -441,24 +486,48 @@ public class BigViewController extends BaseController {
|
|
|
LabSubjectVO labSubject = new LabSubjectVO();
|
|
|
labSubject.setId(vo.getSubjectId());
|
|
|
List<LabSubjectVO> labSubjects = subjectService.selectLabSubjectListAuthByPc(labSubject);
|
|
|
- labSubjects.get(0).setRemark(vo.getGroupName());
|
|
|
+ labSubjects.get(0).setRiskName(vo.getGroupName());
|
|
|
subList.add(labSubjects.size()>0?labSubjects.get(0):null);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
//获取硬件信息
|
|
|
list = subjectManagerService.completeMainSubInfo(subList);
|
|
|
- //组装楼栋、楼层、房间号、预案名称
|
|
|
- for (LabSubjectControllerVO vo:list) {
|
|
|
- for (LabSubjectVO suvo:subList) {
|
|
|
- if(vo.getId().equals(suvo.getId())){
|
|
|
- vo.setBuildName(suvo.getBuildName());
|
|
|
- vo.setFloorName(suvo.getFloorName());
|
|
|
- vo.setRoomName(suvo.getRoomName());
|
|
|
- vo.setRiskName(suvo.getRemark());
|
|
|
+ if(list!=null && list.size()>0){
|
|
|
+ //组装楼栋、楼层、房间号、预案名称
|
|
|
+ for (LabSubjectControllerVO vo:list) {
|
|
|
+ for (LabSubjectVO suvo:subList) {
|
|
|
+ if(vo.getId().equals(suvo.getId())){
|
|
|
+ vo.setBuildName(suvo.getBuildName());
|
|
|
+ vo.setFloorName(suvo.getFloorName());
|
|
|
+ vo.setRoomName(suvo.getRoomName());
|
|
|
+ vo.setRiskName(suvo.getRiskName());
|
|
|
+ vo.setRemark("1");//预案
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ //查询气瓶带离预警
|
|
|
+ QueryWrapper<WarningNoticeLog> queryWrapper = new QueryWrapper<>();
|
|
|
+ queryWrapper.lambda().eq(WarningNoticeLog::getWarningType,3).eq(WarningNoticeLog::getDispose,0).last("limit 0,10").orderByDesc(WarningNoticeLog::getCreateTime);
|
|
|
+ List<WarningNoticeLog> warningNoticeLogList= warningNoticeLogService.list(queryWrapper);
|
|
|
+ if(warningNoticeLogList!=null && warningNoticeLogList.size()>0){
|
|
|
+ if(list==null){
|
|
|
+ list = new ArrayList<>();
|
|
|
+ }
|
|
|
+ for (WarningNoticeLog warning:warningNoticeLogList) {
|
|
|
+ LabSubjectControllerVO subjectControllerVO = new LabSubjectControllerVO();
|
|
|
+ subjectControllerVO.setName(warning.getSubName());
|
|
|
+ subjectControllerVO.setBuildName(warning.getBuildName());
|
|
|
+ subjectControllerVO.setFloorName(warning.getFloorName());
|
|
|
+ subjectControllerVO.setRoomName(warning.getRoomNum());
|
|
|
+ subjectControllerVO.setRemark("2");//气瓶
|
|
|
+ subjectControllerVO.setRiskName(warning.getWarningContent()+": "+warning.getName());
|
|
|
+ list.add(subjectControllerVO);
|
|
|
+ }
|
|
|
+ }
|
|
|
return ResultData.success(list);
|
|
|
}
|
|
|
}
|