在线监测功能
1.预处理生成超标数据和无数据监测点数据 2.分页查询数据 3.生成预告警单(处理中)
This commit is contained in:
@@ -7,6 +7,7 @@ import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.common.utils.LogUtil;
|
||||
import com.njcn.device.pq.mapper.DeptLineMapper;
|
||||
import com.njcn.device.pq.pojo.po.DeptLine;
|
||||
import com.njcn.device.pq.pojo.vo.LineDeviceStateVO;
|
||||
import com.njcn.device.pq.service.DeptLineService;
|
||||
@@ -37,6 +38,7 @@ import java.util.Map;
|
||||
public class DeptLineController extends BaseController {
|
||||
|
||||
private final DeptLineService deptLineService;
|
||||
private final DeptLineMapper deptLineMapper;
|
||||
|
||||
/**
|
||||
* 部门绑定监测点
|
||||
@@ -146,4 +148,13 @@ public class DeptLineController extends BaseController {
|
||||
List<String> list = deptLineService.getLineNodeByDeptId(id);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||
@PostMapping("/getAllData")
|
||||
@ApiOperation("获取部门监测点表所有数据")
|
||||
public HttpResult<List<DeptLine>> getAllData() {
|
||||
String methodDescribe = getMethodDescribe("getAllData");
|
||||
List<DeptLine> list = deptLineMapper.selectList(null);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -516,4 +516,22 @@ public class LineController extends BaseController {
|
||||
List<LineDetailVO.Detail> deptDeviceDetailData = lineService.getDeptDeviceDetailData(param);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, deptDeviceDetailData, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@ApiOperation("获取当日无数据的监测点")
|
||||
@PostMapping("/getNoDataLine")
|
||||
HttpResult<List<LineDetailVO.noDataLineInfo>> getNoDataLine(){
|
||||
String methodDescribe = getMethodDescribe("getNoDataLine");
|
||||
List<LineDetailVO.noDataLineInfo> result = lineService.getNoDataLine();
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@ApiOperation("根据监测点id获取预告警单基础信息")
|
||||
@PostMapping("/getReportLineInfo")
|
||||
HttpResult<List<ReportLineInfoVo>> getReportLineInfo(@RequestBody List<String> ids){
|
||||
String methodDescribe = getMethodDescribe("getReportLineInfo");
|
||||
List<ReportLineInfoVo> result = lineService.getReportLineInfo(ids);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -551,4 +551,8 @@ public interface LineMapper extends BaseMapper<Line> {
|
||||
@Param("type")Integer type);
|
||||
|
||||
LineDetailVO getLineInfoVO(@Param("id")String id);
|
||||
|
||||
List<LineDetailVO.noDataLineInfo> getNoDataLine(@Param("time")String time);
|
||||
|
||||
List<ReportLineInfoVo> getReportLineInfo(@Param("ids")List<String> ids);
|
||||
}
|
||||
|
||||
@@ -1668,4 +1668,57 @@
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="getNoDataLine" resultType="com.njcn.device.pq.pojo.vo.LineDetailVO$noDataLineInfo">
|
||||
select
|
||||
pl3.Id lineId,
|
||||
pl3.Name lineName,
|
||||
pd.Id devId,
|
||||
pl1.name devName,
|
||||
pd.Update_Time
|
||||
from
|
||||
pq_device pd
|
||||
left join pq_line pl1 on pd.Id = pl1.Id
|
||||
left join pq_line pl2 on pl1.Id = pl2.pId
|
||||
left join pq_line pl3 on pl2.Id = pl3.pId
|
||||
where
|
||||
pd.Dev_Model = 1
|
||||
and pd.Run_Flag = 0
|
||||
and pl1.state = 1
|
||||
and pl3.Id is not null
|
||||
and pd.Update_Time < #{time}
|
||||
</select>
|
||||
|
||||
<select id="getReportLineInfo" resultType="com.njcn.device.pq.pojo.vo.ReportLineInfoVo">
|
||||
select
|
||||
pl5.Name gdName,
|
||||
sdd.Name lineVoltage,
|
||||
pl.id lineId,
|
||||
pl.name lineName,
|
||||
pl4.Name subName,
|
||||
pld.Obj_Name objName,
|
||||
pl4.name subVName,
|
||||
pd.Update_Time updateTime,
|
||||
pd.IP ip,
|
||||
pld.Short_Capacity shortCapacity,
|
||||
pld.Dev_Capacity devCapacity,
|
||||
pld.Standard_Capacity standardCapacity
|
||||
from
|
||||
pq_line pl
|
||||
left join pq_line_detail pld on pl.Id = pld.Id
|
||||
left join pq_line pl2 on pl.pId = pl2.Id
|
||||
left join pq_line pl3 on pl2.pId = pl3.Id
|
||||
left join pq_line pl4 on pl3.pId = pl4.Id
|
||||
left join pq_line pl5 on pl4.pId = pl5.Id
|
||||
left join pq_line pl6 on pl5.pId = pl6.Id
|
||||
left join pq_voltage pv on pv.Id = pl2.Id
|
||||
left join pq_device pd on pl3.Id = pd.Id
|
||||
left join sys_dict_data sdd on pv.`Scale` = sdd.Id
|
||||
where
|
||||
<if test="ids!=null and ids.size() > 0">
|
||||
pl.Id IN
|
||||
<foreach collection="ids" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@@ -220,4 +220,8 @@ public interface LineService extends IService<Line> {
|
||||
List<LineALLInfoDTO> getLineAllDetailList(List<String> ids);
|
||||
|
||||
List<LineDetailVO.Detail> getDeptDeviceDetailData(DataParam param);
|
||||
|
||||
List<LineDetailVO.noDataLineInfo> getNoDataLine();
|
||||
|
||||
List<ReportLineInfoVo> getReportLineInfo(List<String> ids);
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.njcn.device.pq.service.impl;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.date.DatePattern;
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
@@ -57,6 +58,7 @@ import org.springframework.util.CollectionUtils;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.Instant;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.*;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
@@ -681,6 +683,17 @@ public class LineServiceImpl extends ServiceImpl<LineMapper, Line> implements Li
|
||||
return new ArrayList<>();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<LineDetailVO.noDataLineInfo> getNoDataLine() {
|
||||
String time = DateUtil.format(LocalDateTime.now(), DatePattern.NORM_DATE_PATTERN);
|
||||
return this.baseMapper.getNoDataLine(time);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ReportLineInfoVo> getReportLineInfo(List<String> ids) {
|
||||
return this.baseMapper.getReportLineInfo(ids);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Overlimit> getOverLimitByList(PollutionParamDTO pollutionParamDTO) {
|
||||
return overlimitMapper.selectBatchIds(pollutionParamDTO.getLineList());
|
||||
|
||||
Reference in New Issue
Block a user