省侧大屏首页
This commit is contained in:
parent
ab6a0b43df
commit
8dee899ff4
|
|
@ -49,6 +49,7 @@ public class Constant {
|
||||||
public final static String DJ = "待建";
|
public final static String DJ = "待建";
|
||||||
public final static String TC = "投产";
|
public final static String TC = "投产";
|
||||||
public final static String TG = "停工";
|
public final static String TG = "停工";
|
||||||
|
public final static String ONLINE = "1";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -180,7 +180,7 @@
|
||||||
LEFT JOIN tb_pro_bd tpb ON tbd.bd_id = tpb.id
|
LEFT JOIN tb_pro_bd tpb ON tbd.bd_id = tpb.id
|
||||||
LEFT JOIN sys_dict sd ON sd.dict_code = tbd.devic_type
|
LEFT JOIN sys_dict sd ON sd.dict_code = tbd.devic_type
|
||||||
LEFT JOIN sys_dict sd2 ON sd2.dict_code = tbd.status
|
LEFT JOIN sys_dict sd2 ON sd2.dict_code = tbd.status
|
||||||
LEFT JOIN sys_area sa ON tbd.area_id = sa.area_id
|
LEFT JOIN tb_area sa ON tbd.area_id = sa.area_id
|
||||||
<where>
|
<where>
|
||||||
tbd.del_flage = 0
|
tbd.del_flage = 0
|
||||||
<if test="keyWord!=null and keyWord!=''">
|
<if test="keyWord!=null and keyWord!=''">
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@ import com.securitycontrol.common.core.web.domain.AjaxResult;
|
||||||
import com.securitycontrol.entity.screen.dto.ScreenParamDto;
|
import com.securitycontrol.entity.screen.dto.ScreenParamDto;
|
||||||
import com.securitycontrol.screen.service.IScIndexService;
|
import com.securitycontrol.screen.service.IScIndexService;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
@ -24,20 +25,38 @@ public class ScIndexController {
|
||||||
private IScIndexService service;
|
private IScIndexService service;
|
||||||
|
|
||||||
@ApiOperation(value = "工程统计")
|
@ApiOperation(value = "工程统计")
|
||||||
@PostMapping("proStatusStatistics")
|
@GetMapping("proStatusStatistics")
|
||||||
public AjaxResult proStatusStatistics(ScreenParamDto dto){
|
public AjaxResult proStatusStatistics(ScreenParamDto dto){
|
||||||
return service.proStatusStatistics(dto);
|
return service.proStatusStatistics(dto);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation(value = "地图风险点")
|
@ApiOperation(value = "地图风险点")
|
||||||
@PostMapping("riskStatistics")
|
@GetMapping("riskStatistics")
|
||||||
public AjaxResult riskStatistics(ScreenParamDto dto){
|
public AjaxResult riskStatistics(ScreenParamDto dto){
|
||||||
return service.riskStatistics(dto);
|
return service.riskStatistics(dto);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation(value = "施工质量")
|
@ApiOperation(value = "施工质量")
|
||||||
@PostMapping("constrQuality")
|
@GetMapping("constrQuality")
|
||||||
public AjaxResult constrQuality(ScreenParamDto dto){
|
public AjaxResult constrQuality(ScreenParamDto dto){
|
||||||
return service.constrQuality(dto);
|
return service.constrQuality(dto);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "告警提醒")
|
||||||
|
@GetMapping("alarmReminder")
|
||||||
|
public AjaxResult alarmReminder(ScreenParamDto dto){
|
||||||
|
return service.alarmReminder(dto);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "环境监测")
|
||||||
|
@GetMapping("environmentDetection")
|
||||||
|
public AjaxResult environmentDetection(ScreenParamDto dto){
|
||||||
|
return service.environmentDetection(dto);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "设备状态")
|
||||||
|
@GetMapping("deviceStatus")
|
||||||
|
public AjaxResult deviceStatus(ScreenParamDto dto){
|
||||||
|
return service.deviceStatus(dto);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -42,6 +42,7 @@ public interface IScIndexMapper {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 施工质量
|
* 施工质量
|
||||||
|
*
|
||||||
* @param dto
|
* @param dto
|
||||||
* @return List<ConstrQuality>
|
* @return List<ConstrQuality>
|
||||||
* @description
|
* @description
|
||||||
|
|
@ -49,4 +50,39 @@ public interface IScIndexMapper {
|
||||||
* @date 2024/3/27 15:26
|
* @date 2024/3/27 15:26
|
||||||
*/
|
*/
|
||||||
List<ConstrQuality> constrQuality(ScreenParamDto dto);
|
List<ConstrQuality> constrQuality(ScreenParamDto dto);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 告警提醒
|
||||||
|
*
|
||||||
|
* @param dto
|
||||||
|
* @return List<Map < String>>
|
||||||
|
* @description
|
||||||
|
* @author cwchen
|
||||||
|
* @date 2024/3/27 16:40
|
||||||
|
*/
|
||||||
|
@MapKey("warningId")
|
||||||
|
List<Map<String, String>> alarmReminder(ScreenParamDto dto);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 环境监测分析
|
||||||
|
*
|
||||||
|
* @param dto
|
||||||
|
* @return List<Map < String>>
|
||||||
|
* @description
|
||||||
|
* @author cwchen
|
||||||
|
* @date 2024/3/27 17:26
|
||||||
|
*/
|
||||||
|
@MapKey("id")
|
||||||
|
List<Map<String, Object>> environmentDetection(ScreenParamDto dto);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备状态
|
||||||
|
* @param dto
|
||||||
|
* @return List<Map < Object>>
|
||||||
|
* @description
|
||||||
|
* @author cwchen
|
||||||
|
* @date 2024/3/27 19:54
|
||||||
|
*/
|
||||||
|
@MapKey("bidCode")
|
||||||
|
List<Map<String, Object>> deviceStatus(ScreenParamDto dto);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -34,6 +34,7 @@ public interface IScIndexService {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 施工质量
|
* 施工质量
|
||||||
|
*
|
||||||
* @param dto
|
* @param dto
|
||||||
* @return AjaxResult
|
* @return AjaxResult
|
||||||
* @description
|
* @description
|
||||||
|
|
@ -41,4 +42,36 @@ public interface IScIndexService {
|
||||||
* @date 2024/3/27 15:18
|
* @date 2024/3/27 15:18
|
||||||
*/
|
*/
|
||||||
AjaxResult constrQuality(ScreenParamDto dto);
|
AjaxResult constrQuality(ScreenParamDto dto);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 告警提醒
|
||||||
|
*
|
||||||
|
* @param dto
|
||||||
|
* @return AjaxResult
|
||||||
|
* @description
|
||||||
|
* @author cwchen
|
||||||
|
* @date 2024/3/27 16:33
|
||||||
|
*/
|
||||||
|
AjaxResult alarmReminder(ScreenParamDto dto);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 环境监测
|
||||||
|
*
|
||||||
|
* @param dto
|
||||||
|
* @return AjaxResult
|
||||||
|
* @description
|
||||||
|
* @author cwchen
|
||||||
|
* @date 2024/3/27 17:23
|
||||||
|
*/
|
||||||
|
AjaxResult environmentDetection(ScreenParamDto dto);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备状态
|
||||||
|
* @param dto
|
||||||
|
* @return AjaxResult
|
||||||
|
* @description
|
||||||
|
* @author cwchen
|
||||||
|
* @date 2024/3/27 19:50
|
||||||
|
*/
|
||||||
|
AjaxResult deviceStatus(ScreenParamDto dto);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
package com.securitycontrol.screen.service.impl;
|
package com.securitycontrol.screen.service.impl;
|
||||||
|
|
||||||
import com.securitycontrol.common.core.constant.Constant;
|
import com.securitycontrol.common.core.constant.Constant;
|
||||||
import com.securitycontrol.common.core.utils.StringUtils;
|
|
||||||
import com.securitycontrol.common.core.web.domain.AjaxResult;
|
import com.securitycontrol.common.core.web.domain.AjaxResult;
|
||||||
import com.securitycontrol.entity.screen.dto.ScreenParamDto;
|
import com.securitycontrol.entity.screen.dto.ScreenParamDto;
|
||||||
import com.securitycontrol.entity.screen.vo.ConstrQuality;
|
import com.securitycontrol.entity.screen.vo.ConstrQuality;
|
||||||
|
|
@ -9,6 +8,7 @@ import com.securitycontrol.entity.screen.vo.MapRiskVo;
|
||||||
import com.securitycontrol.screen.mapper.IScIndexMapper;
|
import com.securitycontrol.screen.mapper.IScIndexMapper;
|
||||||
import com.securitycontrol.screen.service.IScIndexService;
|
import com.securitycontrol.screen.service.IScIndexService;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
|
@ -118,4 +118,80 @@ public class ScIndexServiceImpl implements IScIndexService {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public AjaxResult alarmReminder(ScreenParamDto dto) {
|
||||||
|
List<Map<String, String>> list = new ArrayList<>();
|
||||||
|
try {
|
||||||
|
list = mapper.alarmReminder(dto);
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("告警提醒", e);
|
||||||
|
}
|
||||||
|
return AjaxResult.success(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public AjaxResult environmentDetection(ScreenParamDto dto) {
|
||||||
|
List<Map<String, Object>> list = new ArrayList<>();
|
||||||
|
try {
|
||||||
|
list = mapper.environmentDetection(dto);
|
||||||
|
if (CollectionUtils.isEmpty(list)) {
|
||||||
|
Map<String, Object> map = new HashMap<>(6);
|
||||||
|
map.put("aqiNormalNum", 0);
|
||||||
|
map.put("aqiErrorNum", 0);
|
||||||
|
map.put("dbNormalNum", 0);
|
||||||
|
map.put("dbErrorNum", 0);
|
||||||
|
map.put("hcNormalNum", 0);
|
||||||
|
map.put("hcErrorNum", 0);
|
||||||
|
list.add(map);
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("环境监测分析", e);
|
||||||
|
}
|
||||||
|
return AjaxResult.success(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public AjaxResult deviceStatus(ScreenParamDto dto) {
|
||||||
|
HashMap<Object, Object> returnMap = new HashMap<>();
|
||||||
|
List<Map<String, Object>> dataList = new ArrayList<>(256);
|
||||||
|
List<Map<String, Object>> list = new ArrayList<>(256);
|
||||||
|
int allTotalNum = 0, onlineTotalNum = 0, offTotalNum = 0;
|
||||||
|
try {
|
||||||
|
list = mapper.deviceStatus(dto);
|
||||||
|
Map<String, List<Map<String, Object>>> map = list.stream().collect(Collectors.groupingBy(item -> {
|
||||||
|
return String.valueOf(item.get("bidCode"));
|
||||||
|
}));
|
||||||
|
map.forEach((k, v) -> {
|
||||||
|
Map<String, Object> dataMap = new HashMap<>(3);
|
||||||
|
int onlineNum = 0, offNum = 0, totalNum = 0;
|
||||||
|
for (int i = 0; i < v.size(); i++) {
|
||||||
|
String status = String.valueOf(v.get(i).get("status"));
|
||||||
|
if (Objects.equals(status, Constant.ONLINE)) {
|
||||||
|
onlineNum++;
|
||||||
|
} else {
|
||||||
|
offNum++;
|
||||||
|
}
|
||||||
|
totalNum++;
|
||||||
|
}
|
||||||
|
dataMap.put("proName", v.get(0).get("proName"));
|
||||||
|
dataMap.put("onlineNum", onlineNum);
|
||||||
|
dataMap.put("offLineNum", offNum);
|
||||||
|
dataMap.put("totalNum", totalNum);
|
||||||
|
dataList.add(dataMap);
|
||||||
|
});
|
||||||
|
for (Map<String, Object> objectMap : dataList) {
|
||||||
|
allTotalNum += Integer.parseInt(String.valueOf(objectMap.get("totalNum")));
|
||||||
|
onlineTotalNum += Integer.parseInt(String.valueOf(objectMap.get("onlineNum")));
|
||||||
|
offTotalNum += Integer.parseInt(String.valueOf(objectMap.get("offLineNum")));
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("设备状态", e);
|
||||||
|
}
|
||||||
|
returnMap.put("valueList", dataList);
|
||||||
|
returnMap.put("allTotalNum", allTotalNum);
|
||||||
|
returnMap.put("onlineTotalNum", onlineTotalNum);
|
||||||
|
returnMap.put("offTotalNum", offTotalNum);
|
||||||
|
return AjaxResult.success(returnMap);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -44,4 +44,39 @@
|
||||||
LEFT JOIN tb_project tp ON tp.bid_code = twt.bid_code AND tp.del_flag = 0
|
LEFT JOIN tb_project tp ON tp.bid_code = twt.bid_code AND tp.del_flag = 0
|
||||||
WHERE tte.del_falge = 0
|
WHERE tte.del_falge = 0
|
||||||
</select>
|
</select>
|
||||||
|
<!--告警提醒-->
|
||||||
|
<select id="alarmReminder" resultType="java.util.Map">
|
||||||
|
SELECT tw.warn_content AS warningContent,
|
||||||
|
tp.pro_name AS proName,
|
||||||
|
tw.warn_id AS warningId
|
||||||
|
FROM tb_warn tw
|
||||||
|
LEFT JOIN tb_project tp ON tw.bid_code = tp.bid_code AND tp.del_flag = 0
|
||||||
|
WHERE tw.warn_time BETWEEN CONCAT(CURRENT_DATE, ' 00:00:00') AND CONCAT(CURRENT_DATE, ' 23:59:59')
|
||||||
|
ORDER BY tw.warn_time DESC
|
||||||
|
</select>
|
||||||
|
<!--环境监测分析-->
|
||||||
|
<select id="environmentDetection" resultType="java.util.Map">
|
||||||
|
SELECT COUNT(IF(tdd.mode_name = '空气质量' and tdv.is_warn = 0,1,NULL)) AS aqiNormalNum,
|
||||||
|
COUNT(IF(tdd.mode_name = '空气质量' and tdv.is_warn = 1,1,NULL)) AS aqiErrorNum,
|
||||||
|
COUNT(IF(tdd.mode_name = '噪声水平' and tdv.is_warn = 0,1,NULL)) AS dbNormalNum,
|
||||||
|
COUNT(IF(tdd.mode_name = '噪声水平' and tdv.is_warn = 1,1,NULL)) AS dbErrorNum,
|
||||||
|
COUNT(IF(tdd.mode_name = '灰尘浓度' and tdv.is_warn = 0,1,NULL)) AS hcNormalNum,
|
||||||
|
COUNT(IF(tdd.mode_name = '灰尘浓度' and tdv.is_warn = 1,1,NULL)) AS hcErrorNum
|
||||||
|
FROM tb_bd_device tbd
|
||||||
|
INNER JOIN sys_dict sd ON tbd.devic_type = sd.dict_code AND sd.del_flag = 0 AND sd.dict_code = '1804'
|
||||||
|
INNER JOIN tb_area ta ON tbd.area_id = ta.area_id AND ta.del_flag = 0 AND ta.area_type = '0'
|
||||||
|
LEFT JOIN tb_device_detail tdd ON tbd.device_id = tdd.device_id AND tdd.del_flag = 0
|
||||||
|
LEFT JOIN tb_device_value tdv ON tdd.id = tdv.attribute_id
|
||||||
|
WHERE tbd.del_flage = 0
|
||||||
|
</select>
|
||||||
|
<!--设备状态 目前只查询边带设备-->
|
||||||
|
<select id="deviceStatus" resultType="java.util.Map">
|
||||||
|
SELECT tp.bid_code AS bidCode,
|
||||||
|
tp.pro_name AS proName,
|
||||||
|
IF(tbd.status = '801', '1', '0') AS status
|
||||||
|
FROM tb_bd_device tbd
|
||||||
|
INNER JOIN tb_pro_bd tpb ON tpb.id = tbd.bd_id AND tpb.del_flag = 0
|
||||||
|
INNER JOIN tb_project tp on tpb.bid_code = tp.bid_code AND tp.del_flag = 0
|
||||||
|
WHERE tbd.del_flage = 0
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
@ -92,7 +92,7 @@
|
||||||
<select id="getAreaLists" resultType="com.securitycontrol.entity.system.vo.SelectVo">
|
<select id="getAreaLists" resultType="com.securitycontrol.entity.system.vo.SelectVo">
|
||||||
SELECT area_id AS id,
|
SELECT area_id AS id,
|
||||||
area_name AS name
|
area_name AS name
|
||||||
FROM sys_area
|
FROM tb_area
|
||||||
<where>
|
<where>
|
||||||
bid_code = #{bidCode}
|
bid_code = #{bidCode}
|
||||||
<if test="gtId !=null and gtId!=''">
|
<if test="gtId !=null and gtId!=''">
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue