在线监测功能
1.预处理生成超标数据和无数据监测点数据 2.分页查询数据 3.生成预告警单(处理中)
This commit is contained in:
@@ -47,4 +47,7 @@ public interface DeptLineFeignClient {
|
||||
*/
|
||||
@PostMapping("/getLineNodeByDeptId")
|
||||
HttpResult<List<String>> getLineNodeByDeptId(@RequestParam("id") String id);
|
||||
|
||||
@PostMapping("/getAllData")
|
||||
HttpResult<List<DeptLine>> getAllData();
|
||||
}
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
package com.njcn.device.pq.api;
|
||||
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
import com.njcn.common.pojo.constant.ServerInfo;
|
||||
import com.njcn.common.pojo.enums.common.LogEnum;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.device.pq.api.fallback.LineFeignClientFallbackFactory;
|
||||
import com.njcn.device.pq.pojo.dto.*;
|
||||
import com.njcn.device.pq.pojo.param.DataParam;
|
||||
@@ -343,4 +347,10 @@ public interface LineFeignClient {
|
||||
|
||||
@PostMapping("/getDeptDeviceDetailData")
|
||||
HttpResult<List<LineDetailVO.Detail>> getDeptDeviceDetailData(@RequestBody DataParam param);
|
||||
|
||||
@PostMapping("/getNoDataLine")
|
||||
HttpResult<List<LineDetailVO.noDataLineInfo>> getNoDataLine();
|
||||
|
||||
@PostMapping("/getReportLineInfo")
|
||||
HttpResult<List<ReportLineInfoVo>> getReportLineInfo(@RequestBody List<String> ids);
|
||||
}
|
||||
|
||||
@@ -68,6 +68,12 @@ public class DeptLineFeignClientFallbackFactory implements FallbackFactory<DeptL
|
||||
log.error("{}异常,降级处理,异常为:{}", "根据部门信息id查询监测点id集合", throwable.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResult<List<DeptLine>> getAllData() {
|
||||
log.error("{}异常,降级处理,异常为:{}", "获取部门监测点表所有数据", throwable.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -269,6 +269,18 @@ public class LineFeignClientFallbackFactory implements FallbackFactory<LineFeign
|
||||
log.error("{}异常,降级处理,异常为:{}", "更新监测点运行状态: ", throwable.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResult<List<LineDetailVO.noDataLineInfo>> getNoDataLine() {
|
||||
log.error("{}异常,降级处理,异常为:{}", "获取当日无数据的监测点: ", throwable.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResult<List<ReportLineInfoVo>> getReportLineInfo(List<String> ids) {
|
||||
log.error("{}异常,降级处理,异常为:{}", "根据监测点id获取预告警单基础信息: ", throwable.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -93,4 +93,17 @@ public class LineDetailVO implements Serializable {
|
||||
@ApiModelProperty("已用流量占比")
|
||||
private Float flowProportion;
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class noDataLineInfo extends LineDetailVO implements Serializable{
|
||||
|
||||
@ApiModelProperty("监测点Id")
|
||||
private String lineId;
|
||||
|
||||
@ApiModelProperty("终端id")
|
||||
private String devId;
|
||||
|
||||
@ApiModelProperty("最新数据时间")
|
||||
private LocalDateTime updateTime;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
package com.njcn.device.pq.pojo.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* @author xy
|
||||
*/
|
||||
@Data
|
||||
public class ReportLineInfoVo implements Serializable {
|
||||
|
||||
@ApiModelProperty("供电公司名称")
|
||||
private String gdName;
|
||||
|
||||
@ApiModelProperty("监测点电压等级")
|
||||
private String lineVoltage;
|
||||
|
||||
@ApiModelProperty("监测点id")
|
||||
private String lineId;
|
||||
|
||||
@ApiModelProperty("监测点名称")
|
||||
private String lineName;
|
||||
|
||||
@ApiModelProperty("所属电站")
|
||||
private String subName;
|
||||
|
||||
@ApiModelProperty("监测对象名称")
|
||||
private String objName;
|
||||
|
||||
@ApiModelProperty("电网侧变电站")
|
||||
private String subVName;
|
||||
|
||||
@ApiModelProperty("最新数据时间")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
@ApiModelProperty("监测装置网络参数")
|
||||
private String ip;
|
||||
|
||||
@ApiModelProperty("最小短路容量")
|
||||
private Double shortCapacity;
|
||||
|
||||
@ApiModelProperty("供电设备容量")
|
||||
private Double devCapacity;
|
||||
|
||||
@ApiModelProperty("供电设备容量")
|
||||
private Double standardCapacity;
|
||||
|
||||
@ApiModelProperty("超标天数")
|
||||
private Integer overDays;
|
||||
}
|
||||
@@ -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