Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| a4e3a2f904 | |||
| 840263d53b | |||
| 4a04c8f764 | |||
|
|
def4c066fe | ||
|
|
5269496f24 | ||
| f594915363 | |||
| 29ca1e4a5f | |||
| 2b0c5e82fa | |||
| 6ddbdbb5be | |||
| 0d3dd0748c |
@@ -22,6 +22,7 @@ import java.io.ByteArrayInputStream;
|
||||
import java.util.Base64;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @author hongawen
|
||||
@@ -206,6 +207,37 @@ public class WavePicComponent {
|
||||
waveDataDetail.getColors(), waveDataDetail.getIsOpen()
|
||||
);
|
||||
picPath = composeImage(firstPic, secondPic);
|
||||
} else if (waveDataDetails.size() == 4) {
|
||||
WaveDataDetail waveDataDetail1 = waveDataDetails.get(0);
|
||||
String pic1 = drawPicUtil.drawWavePic(getTitle2(waveDataDetail1.getChannelName(),time), waveDataDetail1.getInstantData().getAValue(),
|
||||
waveDataDetail1.getInstantData().getBValue(), waveDataDetail1.getInstantData().getCValue(),
|
||||
waveDataDetail1.getUnit(), waveDataDetail1.getInstantData().getMax(), waveDataDetail1.getInstantData().getMin(),
|
||||
waveDataDetail1.getA(), waveDataDetail1.getB(), waveDataDetail1.getC(),
|
||||
waveDataDetail1.getColors(), waveDataDetail1.getIsOpen()
|
||||
);
|
||||
|
||||
WaveDataDetail waveDataDetail2 = waveDataDetails.get(1);
|
||||
String pic2 = drawPicUtil.drawWavePic(getTitle2(waveDataDetail2.getChannelName(),time), waveDataDetail2.getInstantData().getAValue(),
|
||||
waveDataDetail2.getInstantData().getBValue(), waveDataDetail2.getInstantData().getCValue(),
|
||||
waveDataDetail2.getUnit(), waveDataDetail2.getInstantData().getMax(), waveDataDetail2.getInstantData().getMin(),
|
||||
waveDataDetail2.getA(), waveDataDetail2.getB(), waveDataDetail2.getC(),
|
||||
waveDataDetail2.getColors(), waveDataDetail2.getIsOpen());
|
||||
|
||||
WaveDataDetail waveDataDetail3 = waveDataDetails.get(2);
|
||||
String pic3 = drawPicUtil.drawWavePic(getTitle2(waveDataDetail3.getChannelName(),time), waveDataDetail3.getInstantData().getAValue(),
|
||||
waveDataDetail3.getInstantData().getBValue(), waveDataDetail3.getInstantData().getCValue(),
|
||||
waveDataDetail3.getUnit(), waveDataDetail3.getInstantData().getMax(), waveDataDetail3.getInstantData().getMin(),
|
||||
waveDataDetail3.getA(), waveDataDetail3.getB(), waveDataDetail3.getC(),
|
||||
waveDataDetail3.getColors(), waveDataDetail3.getIsOpen());
|
||||
|
||||
WaveDataDetail waveDataDetail4 = waveDataDetails.get(3);
|
||||
String pic4 = drawPicUtil.drawWavePic(getTitle2(waveDataDetail4.getChannelName(),time), waveDataDetail4.getInstantData().getAValue(),
|
||||
waveDataDetail4.getInstantData().getBValue(), waveDataDetail4.getInstantData().getCValue(),
|
||||
waveDataDetail4.getUnit(), waveDataDetail4.getInstantData().getMax(), waveDataDetail4.getInstantData().getMin(),
|
||||
waveDataDetail4.getA(), waveDataDetail4.getB(), waveDataDetail4.getC(),
|
||||
waveDataDetail4.getColors(), waveDataDetail4.getIsOpen()
|
||||
);
|
||||
picPath = composeImageZl(pic1, pic2, pic3, pic4);
|
||||
}
|
||||
return picPath;
|
||||
}
|
||||
@@ -286,10 +318,55 @@ public class WavePicComponent {
|
||||
waveDataDetail.getColors(), waveDataDetail.getIsOpen()
|
||||
);
|
||||
picPath = composeImage(firstPic, secondPic);
|
||||
} else if (waveDataDetails.size() == 4) {
|
||||
WaveDataDetail waveDataDetail1 = waveDataDetails.get(0);
|
||||
String pic1 = drawPicUtil.drawWavePic(getTitle2(waveDataDetail1.getChannelName(),time), waveDataDetail1.getRmsData().getAValue(),
|
||||
waveDataDetail1.getRmsData().getBValue(), waveDataDetail1.getRmsData().getCValue(),
|
||||
waveDataDetail1.getUnit(), waveDataDetail1.getRmsData().getMax(), waveDataDetail1.getRmsData().getMin(),
|
||||
waveDataDetail1.getA(), waveDataDetail1.getB(), waveDataDetail1.getC(),
|
||||
waveDataDetail1.getColors(), waveDataDetail1.getIsOpen()
|
||||
);
|
||||
|
||||
WaveDataDetail waveDataDetail2 = waveDataDetails.get(1);
|
||||
String pic2 = drawPicUtil.drawWavePic(getTitle2(waveDataDetail2.getChannelName(),time), waveDataDetail2.getRmsData().getAValue(),
|
||||
waveDataDetail2.getRmsData().getBValue(), waveDataDetail2.getRmsData().getCValue(),
|
||||
waveDataDetail2.getUnit(), waveDataDetail2.getRmsData().getMax(), waveDataDetail2.getRmsData().getMin(),
|
||||
waveDataDetail2.getA(), waveDataDetail2.getB(), waveDataDetail2.getC(),
|
||||
waveDataDetail2.getColors(), waveDataDetail2.getIsOpen());
|
||||
|
||||
WaveDataDetail waveDataDetail3 = waveDataDetails.get(2);
|
||||
String pic3 = drawPicUtil.drawWavePic(getTitle2(waveDataDetail3.getChannelName(),time), waveDataDetail3.getRmsData().getAValue(),
|
||||
waveDataDetail3.getRmsData().getBValue(), waveDataDetail3.getRmsData().getCValue(),
|
||||
waveDataDetail3.getUnit(), waveDataDetail3.getRmsData().getMax(), waveDataDetail3.getRmsData().getMin(),
|
||||
waveDataDetail3.getA(), waveDataDetail3.getB(), waveDataDetail3.getC(),
|
||||
waveDataDetail3.getColors(), waveDataDetail3.getIsOpen());
|
||||
|
||||
WaveDataDetail waveDataDetail4 = waveDataDetails.get(3);
|
||||
String pic4 = drawPicUtil.drawWavePic(getTitle2(waveDataDetail4.getChannelName(),time), waveDataDetail4.getRmsData().getAValue(),
|
||||
waveDataDetail4.getRmsData().getBValue(), waveDataDetail4.getRmsData().getCValue(),
|
||||
waveDataDetail4.getUnit(), waveDataDetail4.getRmsData().getMax(), waveDataDetail4.getRmsData().getMin(),
|
||||
waveDataDetail4.getA(), waveDataDetail4.getB(), waveDataDetail4.getC(),
|
||||
waveDataDetail4.getColors(), waveDataDetail4.getIsOpen()
|
||||
);
|
||||
picPath = composeImageZl(pic1, pic2, pic3, pic4);
|
||||
}
|
||||
return picPath;
|
||||
}
|
||||
|
||||
public String getTitle2(String channelName, String time) {
|
||||
String title;
|
||||
if (channelName.toUpperCase().startsWith("SU")) {
|
||||
title ="电压-电网侧" + " 发生时刻:" + time;
|
||||
} else if (channelName.toUpperCase().startsWith("SI")) {
|
||||
title ="电流-电网侧" + " 发生时刻:" + time;
|
||||
} else if (channelName.toUpperCase().startsWith("LU")) {
|
||||
title ="电压-负载侧" + " 发生时刻:" + time;
|
||||
} else {
|
||||
title ="电流-负载侧" + " 发生时刻:" + time;
|
||||
}
|
||||
return title;
|
||||
}
|
||||
|
||||
/***
|
||||
* 绘制RMS波形图 App端用来绘制图片,会去掉部分数据,只保留开始数据 结束数据
|
||||
* @author xy
|
||||
@@ -364,6 +441,59 @@ public class WavePicComponent {
|
||||
}
|
||||
}
|
||||
|
||||
private String composeImage(String firstPic, String secondPic, String thirdPic, String forthPic) {
|
||||
try {
|
||||
//第一张图片 base64截取删除前缀data:image/png;base64,
|
||||
BufferedImage imageOne = ImgUtil.toBufferedImage(ImgUtil.toImage(firstPic.substring(22)), ImgUtil.IMAGE_TYPE_PNG);
|
||||
int width = imageOne.getWidth();
|
||||
int height = imageOne.getHeight();
|
||||
int[] imageArrayOne = new int[width * height];
|
||||
imageArrayOne = imageOne.getRGB(0, 0, width, height, imageArrayOne, 0, width);
|
||||
//第二张图片 base64截取删除前缀data:image/png;base64,
|
||||
BufferedImage imageTwo = ImgUtil.toBufferedImage(ImgUtil.toImage(secondPic.substring(22)), ImgUtil.IMAGE_TYPE_PNG);
|
||||
int width2 = imageTwo.getWidth();
|
||||
int height2 = imageTwo.getHeight();
|
||||
int[] ImageArrayTwo = new int[width2 * height2];
|
||||
ImageArrayTwo = imageTwo.getRGB(0, 0, width, height, ImageArrayTwo, 0, width);
|
||||
|
||||
int[] ImageArrayThree = null;
|
||||
if (Objects.equals(thirdPic, "")) {
|
||||
BufferedImage imageThree = ImgUtil.toBufferedImage(ImgUtil.toImage(thirdPic.substring(22)), ImgUtil.IMAGE_TYPE_PNG);
|
||||
int width3 = imageThree.getWidth();
|
||||
int height3 = imageThree.getHeight();
|
||||
ImageArrayThree = new int[width3 * height3];
|
||||
ImageArrayThree = imageThree.getRGB(0, 0, width, height, ImageArrayThree, 0, width);
|
||||
}
|
||||
|
||||
int[] ImageArrayForth = null;
|
||||
if (Objects.equals(forthPic, "")) {
|
||||
BufferedImage imageForth = ImgUtil.toBufferedImage(ImgUtil.toImage(forthPic.substring(22)), ImgUtil.IMAGE_TYPE_PNG);
|
||||
int width4 = imageForth.getWidth();
|
||||
int height4 = imageForth.getHeight();
|
||||
ImageArrayForth = new int[width4 * height4];
|
||||
ImageArrayForth = imageForth.getRGB(0, 0, width, height, ImageArrayForth, 0, width);
|
||||
}
|
||||
|
||||
//新图片
|
||||
BufferedImage imageNew = new BufferedImage(width, height * 2, BufferedImage.TYPE_INT_RGB);
|
||||
BufferedImageGraphicsConfig config = BufferedImageGraphicsConfig.getConfig(imageNew);
|
||||
imageNew = config.createCompatibleImage(width, height * 2, Transparency.TRANSLUCENT);
|
||||
imageNew.setRGB(0, 0, width, height, imageArrayOne, 0, width);
|
||||
imageNew.setRGB(0, height, width, height, ImageArrayTwo, 0, width);
|
||||
if (!Objects.isNull(ImageArrayThree)) {
|
||||
imageNew.setRGB(0, height, width, height, ImageArrayThree, 0, width);
|
||||
}
|
||||
if (!Objects.isNull(ImageArrayForth)) {
|
||||
imageNew.setRGB(0, height, width, height, ImageArrayForth, 0, width);
|
||||
}
|
||||
String resultImg = ImgUtil.toBase64(imageNew, ImgUtil.IMAGE_TYPE_PNG);
|
||||
byte[] bytes = Base64.getDecoder().decode(resultImg);
|
||||
return fileStorageUtil.uploadStream(new ByteArrayInputStream(bytes), OssPath.EVENT_WAVE_PIC, FileUtil.generateFileName("png"));
|
||||
} catch (Exception e) {
|
||||
throw new BusinessException(WaveFileResponseEnum.COMPOSE_PIC_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* app越限指标图
|
||||
* @param title
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
package com.njcn.device.pq.pojo.param;
|
||||
|
||||
import com.njcn.web.pojo.param.BaseParam;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
|
||||
/**
|
||||
* @Author: cdf
|
||||
* @CreateTime: 2026-07-06
|
||||
* @Description:
|
||||
*/
|
||||
@Data
|
||||
public class TerminalCheckParam extends BaseParam {
|
||||
|
||||
private String devId;
|
||||
|
||||
private String objId;
|
||||
|
||||
private String objName;
|
||||
|
||||
private String city;
|
||||
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
private LocalDate thisCheckTime;
|
||||
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
private LocalDate nextCheckTime;
|
||||
|
||||
/**
|
||||
* 检测报告
|
||||
*/
|
||||
private String checkUrl;
|
||||
}
|
||||
@@ -1,10 +1,13 @@
|
||||
package com.njcn.device.pq.pojo.po;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.njcn.db.bo.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
@@ -61,6 +64,8 @@ public class Line extends BaseEntity {
|
||||
private Integer state;
|
||||
|
||||
|
||||
@TableField(exist = false)
|
||||
private List<Line> children;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.njcn.device.pq.pojo.po;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
@@ -22,6 +23,7 @@ public class LineDetail{
|
||||
/**
|
||||
* 监测点序号
|
||||
*/
|
||||
@TableId
|
||||
private String id;
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
package com.njcn.device.pq.pojo.po;
|
||||
|
||||
/**
|
||||
* @Author: cdf
|
||||
* @CreateTime: 2026-07-07
|
||||
* @Description:
|
||||
*/
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 监测对象附件
|
||||
*/
|
||||
@Data
|
||||
@TableName("SUPERVISION_USER_REPORT_FILE")
|
||||
public class SupervisionUserReportFile {
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@TableId
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 检测报告
|
||||
*/
|
||||
private String checkUrl;
|
||||
|
||||
/**
|
||||
* 历史检测报告
|
||||
*/
|
||||
private String checkHistoryUrl;
|
||||
|
||||
/**
|
||||
* 评估报告
|
||||
*/
|
||||
private String assessUrl;
|
||||
|
||||
/**
|
||||
* 其他附件
|
||||
*/
|
||||
private String otherUrl;
|
||||
}
|
||||
@@ -1,34 +0,0 @@
|
||||
//package com.njcn.device.pq.pojo.po;
|
||||
//
|
||||
//import com.baomidou.mybatisplus.annotation.TableId;
|
||||
//import lombok.Data;
|
||||
//import org.influxdb.annotation.Column;
|
||||
//import org.influxdb.annotation.Measurement;
|
||||
//
|
||||
//import java.time.Instant;
|
||||
//
|
||||
///**
|
||||
// * @version 1.0.0
|
||||
// * @author: chenchao
|
||||
// * @date: 2022/06/22 19:03
|
||||
// */
|
||||
//@Data
|
||||
//@Measurement(name = "pqs_terminal_logs")
|
||||
//public class TerminalLogs {
|
||||
//
|
||||
// @Column(name = "time")
|
||||
// private Instant timeId;
|
||||
//
|
||||
// @Column(name = "line_id")
|
||||
// private String lineId;
|
||||
//
|
||||
// @Column(name = "terminal_type")
|
||||
// private String terminalType;
|
||||
//
|
||||
// @Column(name = "update_by")
|
||||
// private String updateBy;
|
||||
//
|
||||
// @Column(name = "terminal_describe")
|
||||
// private String terminalDescribe;
|
||||
//
|
||||
//}
|
||||
@@ -53,4 +53,12 @@ public class DevDetail {
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
private LocalDate nextTimeCheck;
|
||||
|
||||
@Data
|
||||
public static class DevPowerFlag{
|
||||
@ApiModelProperty("终端id")
|
||||
private String devIndex;
|
||||
|
||||
@ApiModelProperty(name = "powerFlag",value = "用户性质")
|
||||
private String powerFlag;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,6 +46,9 @@ public class LineDetailDataVO {
|
||||
@ApiModelProperty(name = "devName",value = "终端名称")
|
||||
private String devName;
|
||||
|
||||
@ApiModelProperty("装置型号")
|
||||
private String devType;
|
||||
|
||||
@ApiModelProperty(name = "ip",value = "网络参数")
|
||||
private String ip;
|
||||
|
||||
|
||||
@@ -44,6 +44,9 @@ public class RunManageVO {
|
||||
@ApiModelProperty(name = "ip",value = "网络参数")
|
||||
private String ip;
|
||||
|
||||
@ApiModelProperty(name = "powerFlag",value = "用户性质")
|
||||
private String powerFlag;
|
||||
|
||||
@ApiModelProperty(name = "runFlag",value = "终端运行状态")
|
||||
private String runFlag;
|
||||
|
||||
|
||||
@@ -36,6 +36,9 @@ public class RunTimeVO implements Serializable {
|
||||
@ApiModelProperty(name = "devName",value = "终端名称")
|
||||
private String devName;
|
||||
|
||||
@ApiModelProperty(name = "powerFlag",value = "用户性质")
|
||||
private String powerFlag;
|
||||
|
||||
@ApiModelProperty(name = "ip",value = "网络参数")
|
||||
private String ip;
|
||||
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
package com.njcn.device.pq.pojo.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* @Author: cdf
|
||||
* @CreateTime: 2026-07-06
|
||||
* @Description: 终端检测
|
||||
*/
|
||||
@Data
|
||||
public class TerminalCheckVO {
|
||||
|
||||
private String devId;
|
||||
|
||||
private String areaName;
|
||||
|
||||
private String bdName;
|
||||
|
||||
private String devName;
|
||||
|
||||
private String objId;
|
||||
|
||||
private String objName;
|
||||
|
||||
private LocalDate thisCheckTime;
|
||||
|
||||
private LocalDate nextCheckTime;
|
||||
|
||||
private LocalDate loginDate;
|
||||
|
||||
/**
|
||||
* 0.未逾期
|
||||
* 1.逾期
|
||||
*/
|
||||
private Integer checkStatus;
|
||||
|
||||
/**
|
||||
* 逾期时间
|
||||
*/
|
||||
private Integer overdueDay;
|
||||
|
||||
/**
|
||||
* 检测报告
|
||||
*/
|
||||
private String checkUrl;
|
||||
|
||||
|
||||
}
|
||||
@@ -48,4 +48,6 @@ public class TerminalMaintainVO implements Serializable {
|
||||
private Integer strategyFlag;
|
||||
@ApiModelProperty(name = "子级")
|
||||
List<TerminalMaintainVO> children;
|
||||
|
||||
private String objName;
|
||||
}
|
||||
|
||||
@@ -80,6 +80,7 @@ public class DeviceOnlineRate {
|
||||
private String comFlag;
|
||||
|
||||
@ApiModelProperty("最新数据时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime timeID;
|
||||
|
||||
@ApiModelProperty("在线率")
|
||||
|
||||
@@ -49,6 +49,6 @@ public class LineDataExcel implements Serializable {
|
||||
private BigDecimal integrity;
|
||||
|
||||
@ExcelProperty(value = "国网ID")
|
||||
private BigDecimal monitorId;
|
||||
private String monitorId;
|
||||
|
||||
}
|
||||
|
||||
@@ -8,7 +8,9 @@ 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.pojo.param.AlarmParam;
|
||||
import com.njcn.device.pq.pojo.param.TerminalCheckParam;
|
||||
import com.njcn.device.pq.pojo.vo.TerminalAlarmVO;
|
||||
import com.njcn.device.pq.pojo.vo.TerminalCheckVO;
|
||||
import com.njcn.device.pq.service.TerminalAlarmService;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import io.swagger.annotations.Api;
|
||||
@@ -87,4 +89,19 @@ public class TerminalAlarmController extends BaseController {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
}
|
||||
|
||||
/**
|
||||
* 终端周期检测告警
|
||||
* @author cdf
|
||||
* @date 2022/5/23
|
||||
*/
|
||||
@PostMapping("/terminalCheckPage")
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@ApiOperation("终端检测告警")
|
||||
@ApiImplicitParam(name = "alarmParam", value = "告警类型")
|
||||
public HttpResult<Page<TerminalCheckVO>> terminalCheckPage(@RequestBody @Validated TerminalCheckParam terminalCheckParam){
|
||||
String methodDescribe = getMethodDescribe("alarmInfoList");
|
||||
Page<TerminalCheckVO> res = terminalAlarmService.terminalCheckPage(terminalCheckParam);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, res, methodDescribe);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -3,8 +3,10 @@ package com.njcn.device.pq.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.njcn.device.pq.pojo.param.TerminalCheckParam;
|
||||
import com.njcn.device.pq.pojo.po.Alarm;
|
||||
import com.njcn.device.pq.pojo.vo.TerminalAlarmVO;
|
||||
import com.njcn.device.pq.pojo.vo.TerminalCheckVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
@@ -41,4 +43,8 @@ public interface AlarmMapper extends BaseMapper<Alarm> {
|
||||
* @date 2022/5/23
|
||||
*/
|
||||
boolean updateAlarmInfo(@Param("type")String type,@Param("devLineId")String devLineId,@Param("processTime")LocalDateTime processTime,@Param("userIndex")String userIndex);
|
||||
|
||||
|
||||
Page<TerminalCheckVO> terminalCheckPage(Page<TerminalCheckVO> page, @Param("terminalCheckParam")TerminalCheckParam terminalCheckParam);
|
||||
|
||||
}
|
||||
|
||||
@@ -158,5 +158,51 @@ ORDER BY
|
||||
</update>
|
||||
|
||||
|
||||
<select id="terminalCheckPage" resultType="TerminalCheckVO">
|
||||
SELECT
|
||||
dev.id AS devId,
|
||||
dev.NAME AS devName,
|
||||
users.city AS areaName,
|
||||
bd.name AS bdName,
|
||||
detail.obj_id AS objId,
|
||||
users.project_name AS objName,
|
||||
dev_detail.this_time_check AS thisCheckTime,
|
||||
dev_detail.next_time_check AS nextCheckTime,
|
||||
dev_detail.login_time AS loginDate,
|
||||
files.CHECK_URL as checkUrl,
|
||||
DATEDIFF(
|
||||
day,
|
||||
COALESCE(CAST(dev_detail.next_time_check AS DATE), CURRENT_DATE + INTERVAL '365' DAY),
|
||||
CURRENT_DATE
|
||||
) AS overdueDay,
|
||||
CASE
|
||||
WHEN DATEDIFF(
|
||||
day,
|
||||
COALESCE(CAST(dev_detail.next_time_check AS DATE), CURRENT_DATE + INTERVAL '365' DAY),
|
||||
CURRENT_DATE
|
||||
) > 0 THEN 1
|
||||
ELSE 0
|
||||
END AS checkStatus
|
||||
FROM
|
||||
pq_line line
|
||||
INNER JOIN pq_line_detail detail ON line.id = detail.id
|
||||
INNER JOIN pq_line bus ON line.pid = bus.id
|
||||
INNER JOIN pq_line dev ON bus.pid = dev.id
|
||||
INNER JOIN pq_device dev_detail ON dev.id = dev_detail.id
|
||||
INNER JOIN pq_line bd ON dev.pid = bd.id
|
||||
LEFT JOIN SUPERVISION_USER_REPORT users ON users.id = detail.obj_id
|
||||
LEFT JOIN SUPERVISION_USER_REPORT_FILE files on users.id = files.id
|
||||
<where>
|
||||
<if test="terminalCheckParam.city!=null and terminalCheckParam.city !=''">
|
||||
users.city = #{terminalCheckParam.city}
|
||||
</if>
|
||||
<if test="terminalCheckParam.searchValue!=null and terminalCheckParam.searchValue !=''">
|
||||
and users.project_name like concat('%',#{terminalCheckParam.searchValue},'%')
|
||||
</if>
|
||||
</where>
|
||||
order by checkStatus desc,loginDate desc
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
</mapper>
|
||||
|
||||
@@ -2,7 +2,9 @@ package com.njcn.device.pq.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.njcn.device.pq.pojo.param.AlarmParam;
|
||||
import com.njcn.device.pq.pojo.param.TerminalCheckParam;
|
||||
import com.njcn.device.pq.pojo.vo.TerminalAlarmVO;
|
||||
import com.njcn.device.pq.pojo.vo.TerminalCheckVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -35,4 +37,7 @@ public interface TerminalAlarmService {
|
||||
* @date 2022/5/23
|
||||
*/
|
||||
boolean updateAlarmInfo(String type,String devLineId);
|
||||
|
||||
|
||||
Page<TerminalCheckVO> terminalCheckPage(TerminalCheckParam terminalCheckParam);
|
||||
}
|
||||
|
||||
@@ -487,7 +487,7 @@ public class PqDataVerifyBakServiceImpl extends ServiceImpl<PqDataVerifyBakMappe
|
||||
lineDataExcel.setOnlineRate(onLineRate(onlineRateByDev, Arrays.asList(dto.getDeviceId())));
|
||||
lineDataExcel.setIntegrity(integrity(integrityList, Arrays.asList(dto.getLineId())));
|
||||
if (num == 1) {
|
||||
lineDataExcel.setMonitorId(new BigDecimal(dto.getMonitorId()));
|
||||
lineDataExcel.setMonitorId(dto.getMonitorId());
|
||||
}
|
||||
lineDataExcels1.add(lineDataExcel);
|
||||
}
|
||||
|
||||
@@ -20,10 +20,7 @@ import com.njcn.device.pq.pojo.param.DeviceInfoParam;
|
||||
import com.njcn.device.pq.pojo.param.RunManageParam;
|
||||
import com.njcn.device.pq.pojo.po.Line;
|
||||
import com.njcn.device.pq.pojo.po.LineDetail;
|
||||
import com.njcn.device.pq.pojo.vo.LineInfluxDbOnlineVO;
|
||||
import com.njcn.device.pq.pojo.vo.RunManageVO;
|
||||
import com.njcn.device.pq.pojo.vo.RunTimeVO;
|
||||
import com.njcn.device.pq.pojo.vo.TerminalLedgerVO;
|
||||
import com.njcn.device.pq.pojo.vo.*;
|
||||
import com.njcn.device.pq.service.RunManageService;
|
||||
import com.njcn.device.userledger.service.UserLedgerService;
|
||||
import com.njcn.supervision.pojo.vo.user.NewUserReportVO;
|
||||
@@ -31,6 +28,7 @@ import com.njcn.system.api.DicDataFeignClient;
|
||||
import com.njcn.system.enums.DicDataTypeEnum;
|
||||
import com.njcn.system.pojo.enums.StatisticsEnum;
|
||||
import com.njcn.system.pojo.po.DictData;
|
||||
import com.njcn.user.pojo.dto.DeptDTO;
|
||||
import com.njcn.web.factory.PageFactory;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -39,10 +37,7 @@ import org.springframework.util.CollectionUtils;
|
||||
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.*;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
@@ -157,7 +152,28 @@ public class RunManageServiceImpl implements RunManageService {
|
||||
if(CollUtil.isEmpty(devIndexes)){
|
||||
return new Page<>();
|
||||
}
|
||||
return deviceMapper.getDeviceLedger(new Page<>(PageFactory.getPageNum(runManageParam), PageFactory.getPageSize(runManageParam)), devIndexes, new ArrayList<>(), new ArrayList<>(), new ArrayList<>(), runManageParam.getSearchValue());
|
||||
Page<RunTimeVO> deviceLedger = deviceMapper.getDeviceLedger(new Page<>(PageFactory.getPageNum(runManageParam), PageFactory.getPageSize(runManageParam)), devIndexes, new ArrayList<>(), new ArrayList<>(), new ArrayList<>(), runManageParam.getSearchValue());
|
||||
List<String> devID = deviceLedger.getRecords().stream().map(RunTimeVO::getId).collect(Collectors.toList());
|
||||
if(CollUtil.isNotEmpty(devID)){
|
||||
//添加装置用户性质
|
||||
List<DevDetail.DevPowerFlag> devPowerFlags = deviceMapper.selectDevPowerFlagByIds(devID);
|
||||
Map<String, List<DevDetail.DevPowerFlag>> devPowerFlag =
|
||||
devPowerFlags.stream().collect(Collectors.groupingBy(DevDetail.DevPowerFlag::getDevIndex));
|
||||
deviceLedger.getRecords().stream().forEach(
|
||||
vo -> {
|
||||
if (devPowerFlag.containsKey(vo.getId())) {
|
||||
String powerFlagStr = Optional.ofNullable(devPowerFlag.get(vo.getId()))
|
||||
.orElse(Collections.emptyList())
|
||||
.stream()
|
||||
.map(DevDetail.DevPowerFlag::getPowerFlag)
|
||||
.distinct()
|
||||
.collect(Collectors.joining("/"));
|
||||
vo.setPowerFlag(powerFlagStr);
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
return deviceLedger;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,18 +1,24 @@
|
||||
package com.njcn.device.pq.service.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.njcn.common.utils.PubUtils;
|
||||
import com.njcn.device.pq.mapper.AlarmMapper;
|
||||
import com.njcn.device.pq.pojo.param.AlarmParam;
|
||||
import com.njcn.device.pq.pojo.param.TerminalCheckParam;
|
||||
import com.njcn.device.pq.pojo.vo.TerminalAlarmVO;
|
||||
import com.njcn.device.pq.pojo.vo.TerminalCheckVO;
|
||||
import com.njcn.device.pq.service.TerminalAlarmService;
|
||||
import com.njcn.web.factory.PageFactory;
|
||||
import com.njcn.web.utils.RequestUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.temporal.ChronoUnit;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -47,4 +53,11 @@ public class TerminalAlarmServiceImpl implements TerminalAlarmService {
|
||||
public boolean updateAlarmInfo(String type, String devLineId) {
|
||||
return alarmMapper.updateAlarmInfo(type,devLineId,LocalDateTime.now(),RequestUtil.getUserIndex());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Page<TerminalCheckVO> terminalCheckPage(TerminalCheckParam terminalCheckParam) {
|
||||
Page<TerminalCheckVO> page = new Page<>(PageFactory.getPageNum(terminalCheckParam),PageFactory.getPageSize(terminalCheckParam));
|
||||
Page<TerminalCheckVO> pageResult = alarmMapper.terminalCheckPage(page,terminalCheckParam);
|
||||
return pageResult;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -383,31 +383,31 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
||||
.eq(Line::getState, DataStateEnum.ENABLE.getCode())
|
||||
.in(Line::getName, subvNameList);
|
||||
List<Line> subvRes = this.list(lineLambdaQueryWrapper);
|
||||
if (!subvRes.isEmpty()) {
|
||||
/* if (!subvRes.isEmpty()) {
|
||||
List<String> subvList = subvRes.stream().map(Line::getName).collect(Collectors.toList());
|
||||
throw new BusinessException(DeviceResponseEnum.SUBV_NAME_SAME, String.join(";", subvList));
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
|
||||
//母线
|
||||
List<String> voltageName = deviceParam.getSubVoltageParam().stream().filter(item -> StrUtil.isBlank(item.getSubvIndex())).map(SubVoltageParam::getName).collect(Collectors.toList());
|
||||
if (CollectionUtil.isNotEmpty(voltageName)) {
|
||||
/* if (CollectionUtil.isNotEmpty(voltageName)) {
|
||||
List<Line> voltageList = this.baseMapper.getVoltageListBySubId(subIndex, voltageName);
|
||||
if (CollectionUtil.isNotEmpty(voltageList)) {
|
||||
throw new BusinessException(DeviceResponseEnum.SUBV_NAME_SAME, voltageList.stream().map(Line::getName).collect(Collectors.joining(";")));
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
|
||||
//校验同一变电站下只能有唯一母线名称
|
||||
List<String> addVoltage = deviceParam.getSubVoltageParam().stream().filter(item -> StrUtil.isBlank(item.getSubvIndex())).map(SubVoltageParam::getName).collect(Collectors.toList());
|
||||
if (CollectionUtil.isNotEmpty(addVoltage)) {
|
||||
/* if (CollectionUtil.isNotEmpty(addVoltage)) {
|
||||
List<Line> voltageListBySubId = this.baseMapper.getVoltageListBySubId(subIndex, addVoltage);
|
||||
if (CollectionUtil.isNotEmpty(voltageListBySubId)) {
|
||||
throw new BusinessException(DeviceResponseEnum.SUBV_NAME_SAME, voltageListBySubId.stream().map(Line::getName).collect(Collectors.joining(";")));
|
||||
}
|
||||
}
|
||||
}*/
|
||||
Integer subvSort = lineSortHelper.getNextSort(SUB_V_LEVEL.getCode());
|
||||
for (SubVoltageParam subVoltageParam : deviceParam.getSubVoltageParam()) {
|
||||
//母线id
|
||||
@@ -751,10 +751,10 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
||||
.notIn(Line::getId, subVIndexList)
|
||||
.eq(Line::getPid, voltage.getPid());
|
||||
List<Line> subVoltageList = this.list(lambdaQueryWrapper);
|
||||
if (CollectionUtil.isNotEmpty(subVoltageList)) {
|
||||
/* if (CollectionUtil.isNotEmpty(subVoltageList)) {
|
||||
List<String> repeatSubVNames = subVoltageList.stream().map(Line::getName).collect(Collectors.toList());
|
||||
throw new BusinessException(DeviceResponseEnum.SUBV_NAME_SAME, "已存在母线名称:" + String.join(";", repeatSubVNames));
|
||||
}
|
||||
}*/
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4107,6 +4107,7 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
||||
});
|
||||
});
|
||||
} catch (Exception e) {
|
||||
log.info("台账同步推送异常:" + e);
|
||||
//出现异常,直接重启整个前置
|
||||
exFlag=true;
|
||||
for (Node node : nodes) {
|
||||
|
||||
@@ -102,4 +102,6 @@ public interface DeviceMapper extends BaseMapper<Device> {
|
||||
void updateDeviceRunFlag(@Param("id")String deviceId, @Param("runFlag")Integer status);
|
||||
|
||||
List<PollutionLineInfoDTO> getPollutionDeviceInfo(@Param("id")List<String> devId);
|
||||
|
||||
List<DevDetail.DevPowerFlag> selectDevPowerFlagByIds(@Param("ids") List<String> ids);
|
||||
}
|
||||
|
||||
@@ -28,6 +28,10 @@
|
||||
manufacturerId.name as manufacturer,
|
||||
dev.name as devName,
|
||||
device.IP as ip,
|
||||
CASE linedetail.Power_Flag
|
||||
WHEN 0 THEN '电网侧'
|
||||
WHEN 1 THEN '非电网侧'
|
||||
END AS powerFlag,
|
||||
case linedetail.Run_Flag
|
||||
when 0 then '投运'
|
||||
when 1 then '检修'
|
||||
@@ -149,6 +153,10 @@
|
||||
manufacturerId.name as manufacturer,
|
||||
dev.name as devName,
|
||||
device.IP as ip,
|
||||
CASE linedetail.Power_Flag
|
||||
WHEN 0 THEN '电网侧'
|
||||
WHEN 1 THEN '非电网侧'
|
||||
END AS powerFlag,
|
||||
case linedetail.Run_Flag
|
||||
when 0 then '投运'
|
||||
when 1 then '检修'
|
||||
@@ -530,5 +538,31 @@
|
||||
AND substation.id = pqsub.id
|
||||
AND subv.id = pv.id
|
||||
</select>
|
||||
<select id="selectDevPowerFlagByIds" resultType="com.njcn.device.pq.pojo.vo.DevDetail$DevPowerFlag">
|
||||
SELECT DISTINCT
|
||||
device.id as devIndex,
|
||||
CASE lineDetail.Power_Flag
|
||||
WHEN 0 THEN '电网侧'
|
||||
WHEN 1 THEN '非电网侧'
|
||||
END AS powerFlag
|
||||
FROM
|
||||
pq_line line,
|
||||
pq_dept_line pd,
|
||||
pq_line voltage,
|
||||
pq_line device,
|
||||
pq_line_detail lineDetail
|
||||
<where>
|
||||
<if test="ids!=null and ids.size()>0">
|
||||
device.id IN
|
||||
<foreach collection="ids" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
AND line.pid = voltage.id
|
||||
AND line.id = pd.Line_Id
|
||||
AND voltage.pid = device.id
|
||||
AND line.id = lineDetail.id
|
||||
</where>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
@@ -209,15 +209,24 @@
|
||||
|
||||
|
||||
<select id="getDeviceByIdOnOrOff" resultType="com.njcn.device.pq.pojo.vo.TerminalBaseVO">
|
||||
SELECT
|
||||
t1.id devId,t1.name devName,t2.ip,t2.dev_type,t2.update_time,sub.name subName,gd.name gdName
|
||||
SELECT distinct
|
||||
case when
|
||||
t4.obj_id is not null and t4.obj_id !='' then t4.obj_name
|
||||
else sub.name end subName,
|
||||
t1.id devId,t1.name devName,t2.ip,t2.dev_type,t2.update_time,gd.name gdName
|
||||
FROM
|
||||
pq_line t3,
|
||||
pq_line_detail t4,
|
||||
pq_line bus,
|
||||
pq_line t1,
|
||||
pq_device t2,
|
||||
pq_line sub,
|
||||
pq_line gd
|
||||
WHERE
|
||||
t1.id = t2.id
|
||||
t3.id = t4.id
|
||||
and t3.pid = bus.id
|
||||
and bus.pid = t1.id
|
||||
and t1.id = t2.id
|
||||
and t1.pid = sub.id
|
||||
and sub.pid = gd.id
|
||||
<if test="deviceType.devModel!=null and deviceType.devModel.size()!=0">
|
||||
|
||||
@@ -160,6 +160,7 @@ public class LineServiceImpl extends ServiceImpl<LineMapper, Line> implements Li
|
||||
lineDetailDataVO.setIp(device.getIp());
|
||||
lineDetailDataVO.setLoginTime(device.getLoginTime());
|
||||
lineDetailDataVO.setDevId(device.getId());
|
||||
lineDetailDataVO.setDevType(device.getDevType());
|
||||
lineDetailDataVO.setBusinessType(dicDataFeignClient.getDicDataById(lineDetail.getBusinessType()).getData().getName());
|
||||
lineDetailDataVO.setLoadType(dicDataFeignClient.getDicDataById(lineDetail.getLoadType()).getData().getName());
|
||||
lineDetailDataVO.setObjId(lineDetail.getObjId());
|
||||
|
||||
@@ -24,6 +24,10 @@ public interface TerminalMaintainMapper {
|
||||
*/
|
||||
List<TerminalMaintainVO> getTerminalDevInfo(@Param("devIds") List<String> devIds, @Param("comFlag") Integer comFlag, @Param("devType") String devType);
|
||||
|
||||
|
||||
List<TerminalMaintainVO> terminalConfig(@Param("devIds") List<String> devIds, @Param("comFlag") Integer comFlag, @Param("devType") String devType);
|
||||
|
||||
|
||||
/**
|
||||
* 获取区域
|
||||
* @author cdf
|
||||
|
||||
@@ -38,6 +38,35 @@
|
||||
</if>
|
||||
</select>
|
||||
|
||||
|
||||
<select id="terminalConfig" resultType="TerminalMaintainVO">
|
||||
SELECT distinct
|
||||
IF(TRIM(detail.obj_name) != '', CONCAT(detail.obj_name,'_',a.NAME), a.NAME) as name,
|
||||
a.id,
|
||||
a.pid,
|
||||
a.level,
|
||||
b.run_flag,
|
||||
b.ip,
|
||||
b.com_flag,
|
||||
b.dev_type devType
|
||||
FROM
|
||||
pq_line line
|
||||
inner join pq_line_detail detail on line.id = detail.id
|
||||
inner join pq_line bus on line.pid = bus.id
|
||||
inner join pq_line a on bus.pid = a.id
|
||||
INNER JOIN pq_device b ON a.id = b.id
|
||||
where a.id in
|
||||
<foreach collection="devIds" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
<if test="comFlag != null">
|
||||
AND b.Com_Flag=#{comFlag}
|
||||
</if>
|
||||
<if test="devType !=null and devType != ''">
|
||||
AND b.Dev_Type =#{devType}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="getGdAndSubList" resultType="TerminalMaintainVO">
|
||||
select id,name,level,pid from pq_line where level = #{level} and state = 1 order by sort
|
||||
</select>
|
||||
@@ -77,14 +106,17 @@
|
||||
|
||||
<select id="getRunFlagList" resultType="TerminalMaintainVO">
|
||||
SELECT
|
||||
IF(TRIM(detail.obj_name) != '', CONCAT(detail.obj_name,'_',a.NAME), a.NAME) as name,
|
||||
a.id,
|
||||
a.pid,
|
||||
a.NAME,
|
||||
b.ip,
|
||||
a.level,
|
||||
b.run_flag
|
||||
FROM
|
||||
pq_line a
|
||||
pq_line line
|
||||
inner join pq_line_detail detail on line.id = detail.id
|
||||
inner join pq_line bus on line.pid = bus.id
|
||||
inner join pq_line a on bus.pid = a.id
|
||||
INNER JOIN pq_device b ON a.id = b.id
|
||||
WHERE a.id in
|
||||
<foreach collection="ids" item="item" separator="," index="index" open="(" close=")">
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.njcn.device.terminal.service.impl;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.njcn.common.pojo.dto.SimpleDTO;
|
||||
@@ -108,10 +109,13 @@ public class TerminalMaintainServiceImpl implements TerminalMaintainService {
|
||||
terminalMaintainVO.setName(generalDeviceDTO.getName());
|
||||
terminalMaintainVO.setId(generalDeviceDTO.getIndex());
|
||||
terminalMaintainVO.setLevel(1);
|
||||
List<TerminalMaintainVO> devList = terminalMaintainMapper.getTerminalDevInfo(devIds,terminalMainQueryParam.getComFlag(),terminalMainQueryParam.getDevType());
|
||||
List<TerminalMaintainVO> devList = terminalMaintainMapper.terminalConfig(devIds,terminalMainQueryParam.getComFlag(),terminalMainQueryParam.getDevType());
|
||||
if (CollectionUtil.isEmpty(devList)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
|
||||
List<String> subIndexes = devList.stream().map(TerminalMaintainVO::getPid).collect(Collectors.toList());
|
||||
List<TerminalMaintainVO> subList1 = terminalMaintainMapper.getPqLineGdAndSubList(subIndexes);
|
||||
List<String> gdIndexes = subList1.stream().map(TerminalMaintainVO::getPid).collect(Collectors.toList());
|
||||
|
||||
@@ -7,6 +7,7 @@ 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.pojo.param.TerminalCheckParam;
|
||||
import com.njcn.device.userledger.service.UserLedgerService;
|
||||
import com.njcn.supervision.pojo.param.SensitiveUserParam;
|
||||
import com.njcn.supervision.pojo.param.user.UserReportParam;
|
||||
@@ -19,6 +20,7 @@ import com.njcn.web.controller.BaseController;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import jdk.nashorn.internal.ir.Terminal;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
@@ -147,4 +149,15 @@ public class UserLedgerController extends BaseController {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, userReportVO, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON, operateType = OperateType.UPLOAD)
|
||||
@PostMapping("/userCheckUpload")
|
||||
@ApiOperation("周期检测")
|
||||
@ApiImplicitParam(name = "userReportParam", value = "实体参数", required = true)
|
||||
public HttpResult<Boolean> userCheckUpload(@RequestBody @Validated TerminalCheckParam terminalCheckParam) {
|
||||
String methodDescribe = getMethodDescribe("addUserReport");
|
||||
Boolean f = userReportPOService.userCheckUpload(terminalCheckParam);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, f, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.njcn.device.userledger.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.device.pq.pojo.po.SupervisionUserReportFile;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* @Author: cdf
|
||||
* @CreateTime: 2026-07-07
|
||||
* @Description:
|
||||
*/
|
||||
@Mapper
|
||||
public interface SupervisionUserReportFileMapper extends BaseMapper<SupervisionUserReportFile> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
package com.njcn.device.userledger.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.device.pq.pojo.po.SupervisionUserReportFile;
|
||||
|
||||
public interface SupervisionUserReportFileService extends IService<SupervisionUserReportFile> {
|
||||
|
||||
}
|
||||
@@ -2,6 +2,7 @@ package com.njcn.device.userledger.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.device.pq.pojo.param.TerminalCheckParam;
|
||||
import com.njcn.supervision.pojo.param.SensitiveUserParam;
|
||||
import com.njcn.supervision.pojo.param.user.UserReportParam;
|
||||
import com.njcn.supervision.pojo.po.user.UserReportPO;
|
||||
@@ -90,4 +91,7 @@ public interface UserLedgerService extends IService<UserReportPO> {
|
||||
* @return
|
||||
*/
|
||||
UserReportVO getUserReportById(String id);
|
||||
|
||||
|
||||
Boolean userCheckUpload(TerminalCheckParam terminalCheckParam);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.njcn.device.userledger.service.impl;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.device.userledger.mapper.SupervisionUserReportFileMapper;
|
||||
import com.njcn.device.pq.pojo.po.SupervisionUserReportFile;
|
||||
import com.njcn.device.userledger.service.SupervisionUserReportFileService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @Author: cdf
|
||||
* @CreateTime: 2026-07-07
|
||||
* @Description:
|
||||
*/
|
||||
@Service
|
||||
public class SupervisionUserReportFileServiceImpl extends ServiceImpl<SupervisionUserReportFileMapper, SupervisionUserReportFile>
|
||||
implements SupervisionUserReportFileService {
|
||||
|
||||
}
|
||||
@@ -17,15 +17,19 @@ import com.njcn.bpm.enums.BpmTaskStatusEnum;
|
||||
import com.njcn.common.pojo.constant.PatternRegex;
|
||||
import com.njcn.common.pojo.enums.common.DataStateEnum;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.device.device.mapper.DeviceMapper;
|
||||
import com.njcn.device.line.mapper.LineDetailMapper;
|
||||
import com.njcn.device.line.mapper.LineMapper;
|
||||
import com.njcn.device.pq.pojo.param.TerminalCheckParam;
|
||||
import com.njcn.device.pq.pojo.po.Device;
|
||||
import com.njcn.device.pq.pojo.po.Line;
|
||||
import com.njcn.device.pq.pojo.po.LineDetail;
|
||||
import com.njcn.device.pq.pojo.po.SupervisionUserReportFile;
|
||||
import com.njcn.device.substation.mapper.SubstationMapper;
|
||||
import com.njcn.device.userledger.mapper.SupervisionUserReportFileMapper;
|
||||
import com.njcn.device.userledger.mapper.UserReportNormalMapper;
|
||||
import com.njcn.device.userledger.mapper.UserReportPOMapper;
|
||||
import com.njcn.device.userledger.service.UserLedgerService;
|
||||
import com.njcn.device.userledger.service.UserReportProjectPOService;
|
||||
import com.njcn.device.userledger.service.UserReportSensitivePOService;
|
||||
import com.njcn.device.userledger.service.UserReportSubstationPOService;
|
||||
import com.njcn.device.userledger.service.*;
|
||||
import com.njcn.supervision.enums.FlowStatusEnum;
|
||||
import com.njcn.supervision.enums.SupervisionResponseEnum;
|
||||
import com.njcn.supervision.enums.UserNatureEnum;
|
||||
@@ -47,8 +51,10 @@ import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.function.Function;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.stream.Collectors;
|
||||
@@ -71,6 +77,9 @@ public class UserLedgerServiceImpl extends ServiceImpl<UserReportPOMapper, UserR
|
||||
private final UserReportSensitivePOService userReportSensitivePOService;
|
||||
private final UserFeignClient userFeignClient;
|
||||
private final LineMapper substationMapper;
|
||||
private final LineDetailMapper lineDetailMapper;
|
||||
private final SupervisionUserReportFileService supervisionUserReportFileService;
|
||||
private final DeviceMapper deviceMapper;
|
||||
|
||||
@Override
|
||||
public List<UserLedgerVO> selectUserList(UserReportParam userReportParam) {
|
||||
@@ -182,7 +191,10 @@ public class UserLedgerServiceImpl extends ServiceImpl<UserReportPOMapper, UserR
|
||||
List<Line> stationList = substationMapper.selectBatchIds(stationIds);
|
||||
stationList.forEach(line -> atationMap.put(line.getId(), line.getName()));
|
||||
}
|
||||
}
|
||||
|
||||
List<String> ids = page.getRecords().stream().map(UserReportVO::getId).collect(Collectors.toList());
|
||||
List<SupervisionUserReportFile> supervisionUserReportFiles = supervisionUserReportFileService.lambdaQuery().in(SupervisionUserReportFile::getId,ids).list();
|
||||
Map<String,SupervisionUserReportFile> stringSupervisionUserReportFileMap = supervisionUserReportFiles.stream().collect(Collectors.toMap(SupervisionUserReportFile::getId, Function.identity()));
|
||||
page.getRecords().forEach(temp -> {
|
||||
temp.setStationId(atationMap.getOrDefault(temp.getStationId(),"/"));
|
||||
Integer needGovernance = 0;
|
||||
@@ -230,7 +242,16 @@ public class UserLedgerServiceImpl extends ServiceImpl<UserReportPOMapper, UserR
|
||||
}
|
||||
}
|
||||
temp.setType(type);
|
||||
if(stringSupervisionUserReportFileMap.containsKey(temp.getId())){
|
||||
SupervisionUserReportFile supervisionUserReportFile = stringSupervisionUserReportFileMap.get(temp.getId());
|
||||
temp.setCheckUrl(supervisionUserReportFile.getCheckUrl());
|
||||
//temp.setCheckHistoryUrl(supervisionUserReportFile.getCheckHistoryUrl());
|
||||
temp.setAssessUrl(supervisionUserReportFile.getAssessUrl());
|
||||
temp.setOtherUrl(supervisionUserReportFile.getOtherUrl());
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
return page;
|
||||
}
|
||||
|
||||
@@ -254,6 +275,13 @@ public class UserLedgerServiceImpl extends ServiceImpl<UserReportPOMapper, UserR
|
||||
userReportVO.setOrgName(dept.getName());
|
||||
}
|
||||
}
|
||||
|
||||
SupervisionUserReportFile supervisionUserReportFile = supervisionUserReportFileService.getOne(new LambdaQueryWrapper<SupervisionUserReportFile>().eq(SupervisionUserReportFile::getId,userReportPO.getId()));
|
||||
if(Objects.nonNull(supervisionUserReportFile)){
|
||||
userReportVO.setCheckUrl(supervisionUserReportFile.getCheckUrl());
|
||||
userReportVO.setAssessUrl(supervisionUserReportFile.getAssessUrl());
|
||||
userReportVO.setOtherUrl(supervisionUserReportFile.getOtherUrl());
|
||||
}
|
||||
/*
|
||||
根据用户性质获取自己特有的字段,此处需要特殊处理
|
||||
1、每个附件需要返回文件名称以及可以预览的url
|
||||
@@ -300,6 +328,7 @@ public class UserLedgerServiceImpl extends ServiceImpl<UserReportPOMapper, UserR
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public String addUserReport(UserReportParam userReportParam) {
|
||||
UserReportPO userReportPO = new UserReportPO();
|
||||
BeanUtils.copyProperties(userReportParam, userReportPO);
|
||||
@@ -328,6 +357,27 @@ public class UserLedgerServiceImpl extends ServiceImpl<UserReportPOMapper, UserR
|
||||
userReportPO.setDataType(0);
|
||||
}
|
||||
this.saveOrUpdate(userReportPO);
|
||||
|
||||
//需要同步更新pq_line_detail 表里的obj_name字段
|
||||
if(Objects.nonNull(userReportParam.getDataType()) && userReportParam.getDataType() == 1){
|
||||
if(StrUtil.isNotBlank(userReportPO.getId())){
|
||||
List<LineDetail> lineDetailList = lineDetailMapper.selectList(new LambdaQueryWrapper<LineDetail>().eq(LineDetail::getId, userReportPO.getId()));
|
||||
if(CollUtil.isNotEmpty(lineDetailList)){
|
||||
List<String> ids = lineDetailList.stream().map(LineDetail::getId).collect(Collectors.toList());
|
||||
LineDetail lineDetail = new LineDetail();
|
||||
lineDetail.setObjName(userReportPO.getProjectName());
|
||||
lineDetailMapper.update(lineDetail,new LambdaUpdateWrapper<LineDetail>().in(LineDetail::getId,ids));
|
||||
}
|
||||
}
|
||||
}
|
||||
//处理需要上传的附件
|
||||
SupervisionUserReportFile supervisionUserReportFile = new SupervisionUserReportFile();
|
||||
supervisionUserReportFile.setId(userReportPO.getId());
|
||||
supervisionUserReportFile.setCheckUrl(userReportParam.getCheckUrl());
|
||||
supervisionUserReportFile.setAssessUrl(userReportParam.getAssessUrl());
|
||||
supervisionUserReportFile.setOtherUrl(userReportParam.getOtherUrl());
|
||||
supervisionUserReportFileService.saveOrUpdate(supervisionUserReportFile);
|
||||
|
||||
userReportPO = this.getById(userReportPO.getId());
|
||||
if (
|
||||
CollectionUtil.newArrayList(
|
||||
@@ -396,6 +446,21 @@ public class UserLedgerServiceImpl extends ServiceImpl<UserReportPOMapper, UserR
|
||||
return this.baseMapper.getUserReportById(userReportVOQueryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean userCheckUpload(TerminalCheckParam terminalCheckParam) {
|
||||
SupervisionUserReportFile supervisionUserReportFile = new SupervisionUserReportFile();
|
||||
supervisionUserReportFile.setId(terminalCheckParam.getObjId());
|
||||
supervisionUserReportFile.setCheckUrl(terminalCheckParam.getCheckUrl());
|
||||
supervisionUserReportFileService.saveOrUpdate(supervisionUserReportFile);
|
||||
Device device = new Device();
|
||||
device.setId(terminalCheckParam.getDevId());
|
||||
device.setThisTimeCheck(terminalCheckParam.getThisCheckTime());
|
||||
device.setNextTimeCheck(terminalCheckParam.getNextCheckTime());
|
||||
deviceMapper.updateById(device);
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断工程名称是否重复,如果重复则提示用户XXX已经创建该工程
|
||||
*
|
||||
|
||||
@@ -388,15 +388,5 @@ public class EventDetailServiceImpl extends ServiceImpl<RmpEventDetailMapper, Rm
|
||||
return result;
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
try{
|
||||
System.out.println(1/0);
|
||||
}catch (Exception e){
|
||||
System.out.println(1);
|
||||
}
|
||||
System.out.println(1111);
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -68,8 +68,6 @@ public class ComAssessServiceImpl extends ServiceImpl<RStatComassesDMapper, RSta
|
||||
|
||||
String systemType = commTerminalGeneralClient.isPqOrPms().getData();
|
||||
if (systemType.equals("pq")) {
|
||||
|
||||
|
||||
List<UserLedgerVO> userLedgerVOList = userLedgerFeignClient.selectUserList(new UserReportParam()).getData();
|
||||
Map<String, UserLedgerVO> userLedgerVOMap = userLedgerVOList.stream().collect(Collectors.toMap(UserLedgerVO::getId, Function.identity()));
|
||||
|
||||
@@ -158,8 +156,8 @@ public class ComAssessServiceImpl extends ServiceImpl<RStatComassesDMapper, RSta
|
||||
comAssessVOList.add(comAssessVO);
|
||||
}
|
||||
}
|
||||
List<ComAssessVO> list = comAssessVOList.stream().sorted(Comparator.comparing(ComAssessVO::getData).reversed()).collect(Collectors.toList());
|
||||
return list;
|
||||
// List<ComAssessVO> list = comAssessVOList.stream().sorted(Comparator.comparing(ComAssessVO::getData).reversed()).collect(Collectors.toList());
|
||||
return comAssessVOList;
|
||||
} else {
|
||||
DictData dictData = dicDataFeignClient.getDicDataByCodeAndType(DicDataEnum.RUN.getCode(), DicDataTypeEnum.LINE_STATE.getCode()).getData();
|
||||
PmsDeviceInfoParam param = new PmsDeviceInfoParam();
|
||||
|
||||
@@ -340,11 +340,11 @@ public class PollutionSubstationServiceImpl extends ServiceImpl<RStatPollutionSu
|
||||
list.add(pollutionVO);
|
||||
}
|
||||
}
|
||||
if (!CollectionUtils.isEmpty(list)) {
|
||||
/* if (!CollectionUtils.isEmpty(list)) {
|
||||
List<PollutionVO> listSort = list.stream().filter(x -> x.getData() != 3.14159).sorted(Comparator.comparing(PollutionVO::getData).reversed().thenComparing(PollutionVO::getName)).collect(Collectors.toList());
|
||||
listSort.addAll(list.stream().filter(x -> x.getData() == 3.14159).collect(Collectors.toList()));
|
||||
return listSort;
|
||||
}
|
||||
}*/
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
@@ -25,6 +25,8 @@ import com.njcn.harmonic.utils.PubUtils;
|
||||
import com.njcn.supervision.pojo.param.user.UserReportParam;
|
||||
import com.njcn.supervision.pojo.vo.user.UserLedgerVO;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
@@ -38,7 +40,7 @@ import java.util.stream.Collectors;
|
||||
* @Description: <描述>
|
||||
*/
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
@RequiredArgsConstructor
|
||||
public class SteadyQualifyServiceImpl implements SteadyQualifyService {
|
||||
|
||||
private final GeneralDeviceInfoClient generalDeviceInfoClient;
|
||||
@@ -51,6 +53,13 @@ public class SteadyQualifyServiceImpl implements SteadyQualifyService {
|
||||
|
||||
private final LineFeignClient lineFeignClient;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@Value("${version.used:master}")
|
||||
private String versionUsed;
|
||||
|
||||
|
||||
@Override
|
||||
public List<SteadyQualifyVO> getSteadyQualifyData(DeviceInfoParam.BusinessParam steadyParam) {
|
||||
List<SteadyQualifyVO> steadyQualifyList = new ArrayList<>();
|
||||
@@ -304,8 +313,13 @@ public class SteadyQualifyServiceImpl implements SteadyQualifyService {
|
||||
//供电公司集合
|
||||
List<SteadyQualifyVO> powerCompanyList = steadyQualifyMapper.getLineInfoByList(generalDeviceDTO.getGdIndexes());
|
||||
dealChildrenData(substationList, otherLineList, temMap, true);
|
||||
dealChildrenData(powerCompanyList, substationList, temMap, false);
|
||||
return powerCompanyList;
|
||||
|
||||
if("liaoning".equals(versionUsed)){
|
||||
return substationList;
|
||||
}else {
|
||||
dealChildrenData(powerCompanyList, substationList, temMap, false);
|
||||
return powerCompanyList;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -29,7 +29,9 @@ import com.njcn.harmonic.utils.PubUtils;
|
||||
import com.njcn.supervision.pojo.param.user.UserReportParam;
|
||||
import com.njcn.supervision.pojo.vo.user.UserLedgerVO;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
@@ -44,7 +46,7 @@ import java.util.stream.Collectors;
|
||||
* @Description: <描述>
|
||||
*/
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
@RequiredArgsConstructor
|
||||
public class THDistortionServiceImpl implements THDistortionService {
|
||||
|
||||
private final GeneralInfo generalInfo;
|
||||
@@ -53,6 +55,11 @@ public class THDistortionServiceImpl implements THDistortionService {
|
||||
private final RMpVThdMapper rMpVThdMapper;
|
||||
private final LineFeignClient lineFeignClient;
|
||||
private final UserLedgerFeignClient userLedgerFeignClient;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@Value("${version.used:master}")
|
||||
private String versionUsed;
|
||||
|
||||
@Override
|
||||
public List<THDistortionVO> getTHDistortionData(DeviceInfoParam.BusinessParam thDistortionParam, Integer nodeType) {
|
||||
@@ -83,15 +90,14 @@ public class THDistortionServiceImpl implements THDistortionService {
|
||||
//组装父级数据树
|
||||
List<THDistortionVO> treeList = getTreeData(lineIndexes, condition, userLedgerVOMap, thDistortionParam.getPowerFlag());
|
||||
thDistortionVO.setChildren(treeList);
|
||||
|
||||
thDistortionVOS.add(thDistortionVO);
|
||||
}
|
||||
if (nodeType == 1) {
|
||||
thDistortionVOS.stream().forEach(data -> {
|
||||
thDistortionVOS.forEach(data -> {
|
||||
if (CollUtil.isNotEmpty(data.getChildren())) {
|
||||
//市
|
||||
List<THDistortionVO> sub = data.getChildren().stream().flatMap(dto -> dto.getChildren().stream()).collect(Collectors.toList());
|
||||
sub.stream().forEach(x -> {
|
||||
sub.forEach(x -> {
|
||||
x.setChildren(new ArrayList<>());
|
||||
});
|
||||
data.setChildren(sub);
|
||||
@@ -117,7 +123,7 @@ public class THDistortionServiceImpl implements THDistortionService {
|
||||
// continue;
|
||||
// }
|
||||
// type.add(thDistortionVO.getName() + "\n(" + seekLineNum(thDistortionVO) + ")");
|
||||
type.add(thDistortionVO.getName() );
|
||||
type.add(thDistortionVO.getName());
|
||||
// List<PublicDTO> condition = getCondition(lineIndexes, thDistortionCensusParam.getSearchBeginTime(), thDistortionCensusParam.getSearchEndTime());
|
||||
single.add(thDistortionVO.getDistortion());
|
||||
}
|
||||
@@ -359,17 +365,20 @@ public class THDistortionServiceImpl implements THDistortionService {
|
||||
//List<THDistortionVO> deviceList = thDistortionMapper.getLineInfoByList(busBarList.stream().map(THDistortionVO::getPid).distinct().collect(Collectors.toList()));
|
||||
//变电站集合
|
||||
List<THDistortionVO> substationList = thDistortionMapper.getLineInfoByList(monitorList.stream().map(it -> it.getPidS().split(StrUtil.COMMA)[LineBaseEnum.SUB_LEVEL.getCode()]).distinct().collect(Collectors.toList()));
|
||||
//供电公司集合
|
||||
List<THDistortionVO> powerCompanyList = thDistortionMapper.getLineInfoByList(monitorList.stream().map(it -> it.getPidS().split(StrUtil.COMMA)[LineBaseEnum.GD_LEVEL.getCode()]).distinct().collect(Collectors.toList()));
|
||||
|
||||
if (!CollectionUtils.isEmpty(monitorList)) {
|
||||
setChildesList(substationList, powerLedgerList, userTemList);
|
||||
setFatherDistortion(substationList);
|
||||
powerCompanyList = powerCompanyList.stream().peek(item -> item.setChildren(getChildCategoryList(item, substationList))).collect(Collectors.toList());
|
||||
// setFatherDistortion(powerCompanyList);
|
||||
setPowerDistortion(powerCompanyList);
|
||||
if ("liaoning".equals(versionUsed)) {
|
||||
return substationList;
|
||||
} else {
|
||||
//供电公司集合
|
||||
List<THDistortionVO> powerCompanyList = thDistortionMapper.getLineInfoByList(monitorList.stream().map(it -> it.getPidS().split(StrUtil.COMMA)[LineBaseEnum.GD_LEVEL.getCode()]).distinct().collect(Collectors.toList()));
|
||||
powerCompanyList = powerCompanyList.stream().peek(item -> item.setChildren(getChildCategoryList(item, substationList))).collect(Collectors.toList());
|
||||
setPowerDistortion(powerCompanyList);
|
||||
return powerCompanyList;
|
||||
}
|
||||
}
|
||||
return powerCompanyList;
|
||||
return new ArrayList<>();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -247,13 +247,28 @@ public class HarmonicMetricServiceImpl extends MppServiceImpl<RStatAssesDMapper,
|
||||
if (dataPltMap.containsKey(phasic)) {
|
||||
List<RStatDataPltDPO> mapList = dataPltMap.get(phasic);
|
||||
Map<String, RStatDataPltDPO> pltMap = mapList.stream().collect(Collectors.toMap(RStatDataPltDPO::getValueType, Function.identity()));
|
||||
if (pltMap.get("MAX").getPlt() > (Double) overLimit.get("flicker")) {
|
||||
mpSurplusAbnormalCp95.setFlicker(pltMap.get("CP95").getPlt().floatValue());
|
||||
mpSurplusAbnormalAvg.setFlicker(pltMap.get("AVG").getPlt().floatValue());
|
||||
mpSurplusAbnormalMin.setFlicker(pltMap.get("MIN").getPlt().floatValue());
|
||||
mpSurplusAbnormalMax.setFlicker(pltMap.get("MAX").getPlt().floatValue());
|
||||
RStatDataPltDPO maxObj = pltMap.get("MAX");
|
||||
Double flickerLimit = (Double) overLimit.get("flicker");
|
||||
if (maxObj != null && flickerLimit != null && (maxObj).getPlt() > flickerLimit) {
|
||||
if (pltMap.get("CP95") != null) {
|
||||
mpSurplusAbnormalCp95.setFlicker(pltMap.get("CP95").getPlt().floatValue());
|
||||
}
|
||||
if (pltMap.get("AVG") != null) {
|
||||
mpSurplusAbnormalAvg.setFlicker(pltMap.get("AVG").getPlt().floatValue());
|
||||
}
|
||||
if (pltMap.get("MIN") != null) {
|
||||
mpSurplusAbnormalMin.setFlicker(pltMap.get("MIN").getPlt().floatValue());
|
||||
}
|
||||
mpSurplusAbnormalMax.setFlicker((maxObj).getPlt().floatValue());
|
||||
flag = true;
|
||||
}
|
||||
// if (pltMap.get("MAX").getPlt() > (Double) overLimit.get("flicker")) {
|
||||
// mpSurplusAbnormalCp95.setFlicker(pltMap.get("CP95").getPlt().floatValue());
|
||||
// mpSurplusAbnormalAvg.setFlicker(pltMap.get("AVG").getPlt().floatValue());
|
||||
// mpSurplusAbnormalMin.setFlicker(pltMap.get("MIN").getPlt().floatValue());
|
||||
// mpSurplusAbnormalMax.setFlicker(pltMap.get("MAX").getPlt().floatValue());
|
||||
// flag = true;
|
||||
// }
|
||||
}
|
||||
//谐波电压
|
||||
dealData(tenMap,phasic,overLimit,flag,mpSurplusAbnormalCp95,mpSurplusAbnormalAvg,mpSurplusAbnormalMax,mpSurplusAbnormalMin,2,26,1,"uharm_","v_",all);
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -132,6 +132,18 @@ public class UserReportParam {
|
||||
@ApiModelProperty(value = "额定容量")
|
||||
private Double ratePower;
|
||||
|
||||
@ApiModelProperty(value = "检测报告")
|
||||
private String checkUrl;
|
||||
|
||||
@ApiModelProperty(value = "历史检测报告")
|
||||
private String checkHistoryUrl;
|
||||
|
||||
@ApiModelProperty(value = "评估报告")
|
||||
private String assessUrl;
|
||||
|
||||
@ApiModelProperty(value = "其他附件")
|
||||
private String otherUrl;
|
||||
|
||||
/**
|
||||
* 预测评估结论
|
||||
*/
|
||||
|
||||
@@ -117,6 +117,18 @@ public class UserReportVO {
|
||||
@ApiModelProperty(value = "纬度")
|
||||
private BigDecimal latitude;
|
||||
|
||||
@ApiModelProperty(value = "检测报告")
|
||||
private String checkUrl;
|
||||
|
||||
@ApiModelProperty(value = "历史检测报告")
|
||||
private String checkHistoryUrl;
|
||||
|
||||
@ApiModelProperty(value = "评估报告")
|
||||
private String assessUrl;
|
||||
|
||||
@ApiModelProperty(value = "其他附件")
|
||||
private String otherUrl;
|
||||
|
||||
/**
|
||||
* 电压等级
|
||||
*/
|
||||
|
||||
@@ -8,6 +8,7 @@ import com.njcn.system.pojo.param.EleEpdPqdParam;
|
||||
import com.njcn.system.pojo.po.EleEpdPqd;
|
||||
import com.njcn.system.pojo.vo.EleEpdPqdListVO;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
@@ -64,4 +65,7 @@ public interface EpdFeignClient {
|
||||
|
||||
@PostMapping("/selectAll")
|
||||
HttpResult<List<EleEpdPqdListVO>> selectAll();
|
||||
|
||||
@PostMapping("/findListByCode")
|
||||
HttpResult<List<EleEpdPqd>> findListByCode(@RequestParam("code") @Validated String code);
|
||||
}
|
||||
|
||||
@@ -119,6 +119,12 @@ public class EpdFeignClientFallbackFactory implements FallbackFactory<EpdFeignCl
|
||||
log.error("{}异常,降级处理,异常为:{}","根据数据分类查询字典信息集合",cause.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResult<List<EleEpdPqd>> findListByCode(String code) {
|
||||
log.error("{}异常,降级处理,异常为:{}","根据告警码获取数据",cause.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -234,5 +234,15 @@ public class EleEpdPqdController extends BaseController {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, po, methodDescribe);
|
||||
}
|
||||
|
||||
@PostMapping("/findListByCode")
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@ApiOperation("根据告警码获取数据")
|
||||
@ApiImplicitParam(name = "code", value = "告警码", required = true)
|
||||
public HttpResult<List<EleEpdPqd>> findListByCode(@RequestParam("code") @Validated String code){
|
||||
String methodDescribe = getMethodDescribe("findListByCode");
|
||||
List<EleEpdPqd> po = eleEpdPqdService.lambdaQuery().like(EleEpdPqd::getDefaultValue,code).list();
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, po, methodDescribe);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -119,7 +119,7 @@ public class AppUserServiceImpl extends ServiceImpl<AppUserMapper, User> impleme
|
||||
//消息默认配置
|
||||
AppInfoSet appInfoSet = new AppInfoSet();
|
||||
appInfoSet.setUserId(newUser.getId());
|
||||
appInfoSet.setHarmonicInfo(0);
|
||||
appInfoSet.setHarmonicInfo(1);
|
||||
appInfoSet.setEventInfo(1);
|
||||
appInfoSet.setRunInfo(0);
|
||||
appInfoSet.setAlarmInfo(0);
|
||||
|
||||
Reference in New Issue
Block a user