1.添加终端周期检测功能
This commit is contained in:
@@ -0,0 +1,13 @@
|
|||||||
|
package com.njcn.device.pq.pojo.param;
|
||||||
|
|
||||||
|
import com.njcn.web.pojo.param.BaseParam;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: cdf
|
||||||
|
* @CreateTime: 2026-07-06
|
||||||
|
* @Description:
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class TerminalCheckParam extends BaseParam {
|
||||||
|
}
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.njcn.device.pq.pojo.po;
|
package com.njcn.device.pq.pojo.po;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
@@ -22,6 +23,7 @@ public class LineDetail{
|
|||||||
/**
|
/**
|
||||||
* 监测点序号
|
* 监测点序号
|
||||||
*/
|
*/
|
||||||
|
@TableId
|
||||||
private String id;
|
private String id;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,44 @@
|
|||||||
|
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 objName;
|
||||||
|
|
||||||
|
private LocalDate thisCheckTime;
|
||||||
|
|
||||||
|
private LocalDate nextCheckTime;
|
||||||
|
|
||||||
|
private LocalDate loginDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 0.未逾期
|
||||||
|
* 1.逾期
|
||||||
|
*/
|
||||||
|
private Integer checkStatus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 逾期时间
|
||||||
|
*/
|
||||||
|
private Integer overdueDay;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -80,6 +80,7 @@ public class DeviceOnlineRate {
|
|||||||
private String comFlag;
|
private String comFlag;
|
||||||
|
|
||||||
@ApiModelProperty("最新数据时间")
|
@ApiModelProperty("最新数据时间")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
private LocalDateTime timeID;
|
private LocalDateTime timeID;
|
||||||
|
|
||||||
@ApiModelProperty("在线率")
|
@ApiModelProperty("在线率")
|
||||||
|
|||||||
@@ -8,7 +8,9 @@ import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
|||||||
import com.njcn.common.pojo.response.HttpResult;
|
import com.njcn.common.pojo.response.HttpResult;
|
||||||
import com.njcn.common.utils.HttpResultUtil;
|
import com.njcn.common.utils.HttpResultUtil;
|
||||||
import com.njcn.device.pq.pojo.param.AlarmParam;
|
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.TerminalAlarmVO;
|
||||||
|
import com.njcn.device.pq.pojo.vo.TerminalCheckVO;
|
||||||
import com.njcn.device.pq.service.TerminalAlarmService;
|
import com.njcn.device.pq.service.TerminalAlarmService;
|
||||||
import com.njcn.web.controller.BaseController;
|
import com.njcn.web.controller.BaseController;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
@@ -87,4 +89,19 @@ public class TerminalAlarmController extends BaseController {
|
|||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.njcn.device.pq.pojo.po.Alarm;
|
import com.njcn.device.pq.pojo.po.Alarm;
|
||||||
import com.njcn.device.pq.pojo.vo.TerminalAlarmVO;
|
import com.njcn.device.pq.pojo.vo.TerminalAlarmVO;
|
||||||
|
import com.njcn.device.pq.pojo.vo.TerminalCheckVO;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
@@ -41,4 +42,8 @@ public interface AlarmMapper extends BaseMapper<Alarm> {
|
|||||||
* @date 2022/5/23
|
* @date 2022/5/23
|
||||||
*/
|
*/
|
||||||
boolean updateAlarmInfo(@Param("type")String type,@Param("devLineId")String devLineId,@Param("processTime")LocalDateTime processTime,@Param("userIndex")String userIndex);
|
boolean updateAlarmInfo(@Param("type")String type,@Param("devLineId")String devLineId,@Param("processTime")LocalDateTime processTime,@Param("userIndex")String userIndex);
|
||||||
|
|
||||||
|
|
||||||
|
Page<TerminalCheckVO> terminalCheckPage(Page<TerminalCheckVO> page);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -158,5 +158,41 @@ ORDER BY
|
|||||||
</update>
|
</update>
|
||||||
|
|
||||||
|
|
||||||
|
<select id="terminalCheckPage" resultType="TerminalCheckVO">
|
||||||
|
SELECT
|
||||||
|
dev.id AS devId,
|
||||||
|
dev.NAME AS devName,
|
||||||
|
dept.NAME AS areaName,
|
||||||
|
bd.name AS bdName,
|
||||||
|
detail.obj_name AS objName,
|
||||||
|
dev_detail.this_time_check AS thisCheckTime,
|
||||||
|
dev_detail.next_time_check AS nextCheckTime,
|
||||||
|
dev_detail.login_time AS loginDate,
|
||||||
|
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
|
||||||
|
INNER JOIN pq_dept_line dept_line ON line.id = dept_line.line_id
|
||||||
|
INNER JOIN sys_dept dept ON dept_line.id = dept.id AND dept.type = 0
|
||||||
|
order by overdueDay desc
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@@ -2,7 +2,9 @@ package com.njcn.device.pq.service;
|
|||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.njcn.device.pq.pojo.param.AlarmParam;
|
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.TerminalAlarmVO;
|
||||||
|
import com.njcn.device.pq.pojo.vo.TerminalCheckVO;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -35,4 +37,7 @@ public interface TerminalAlarmService {
|
|||||||
* @date 2022/5/23
|
* @date 2022/5/23
|
||||||
*/
|
*/
|
||||||
boolean updateAlarmInfo(String type,String devLineId);
|
boolean updateAlarmInfo(String type,String devLineId);
|
||||||
|
|
||||||
|
|
||||||
|
Page<TerminalCheckVO> terminalCheckPage(TerminalCheckParam terminalCheckParam);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,18 +1,24 @@
|
|||||||
package com.njcn.device.pq.service.impl;
|
package com.njcn.device.pq.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.date.DateUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.njcn.common.utils.PubUtils;
|
import com.njcn.common.utils.PubUtils;
|
||||||
import com.njcn.device.pq.mapper.AlarmMapper;
|
import com.njcn.device.pq.mapper.AlarmMapper;
|
||||||
import com.njcn.device.pq.pojo.param.AlarmParam;
|
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.TerminalAlarmVO;
|
||||||
|
import com.njcn.device.pq.pojo.vo.TerminalCheckVO;
|
||||||
import com.njcn.device.pq.service.TerminalAlarmService;
|
import com.njcn.device.pq.service.TerminalAlarmService;
|
||||||
import com.njcn.web.factory.PageFactory;
|
import com.njcn.web.factory.PageFactory;
|
||||||
import com.njcn.web.utils.RequestUtil;
|
import com.njcn.web.utils.RequestUtil;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
import java.time.temporal.ChronoUnit;
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -47,4 +53,11 @@ public class TerminalAlarmServiceImpl implements TerminalAlarmService {
|
|||||||
public boolean updateAlarmInfo(String type, String devLineId) {
|
public boolean updateAlarmInfo(String type, String devLineId) {
|
||||||
return alarmMapper.updateAlarmInfo(type,devLineId,LocalDateTime.now(),RequestUtil.getUserIndex());
|
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);
|
||||||
|
return pageResult;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -383,31 +383,31 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
|||||||
.eq(Line::getState, DataStateEnum.ENABLE.getCode())
|
.eq(Line::getState, DataStateEnum.ENABLE.getCode())
|
||||||
.in(Line::getName, subvNameList);
|
.in(Line::getName, subvNameList);
|
||||||
List<Line> subvRes = this.list(lineLambdaQueryWrapper);
|
List<Line> subvRes = this.list(lineLambdaQueryWrapper);
|
||||||
if (!subvRes.isEmpty()) {
|
/* if (!subvRes.isEmpty()) {
|
||||||
List<String> subvList = subvRes.stream().map(Line::getName).collect(Collectors.toList());
|
List<String> subvList = subvRes.stream().map(Line::getName).collect(Collectors.toList());
|
||||||
throw new BusinessException(DeviceResponseEnum.SUBV_NAME_SAME, String.join(";", subvList));
|
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());
|
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);
|
List<Line> voltageList = this.baseMapper.getVoltageListBySubId(subIndex, voltageName);
|
||||||
if (CollectionUtil.isNotEmpty(voltageList)) {
|
if (CollectionUtil.isNotEmpty(voltageList)) {
|
||||||
throw new BusinessException(DeviceResponseEnum.SUBV_NAME_SAME, voltageList.stream().map(Line::getName).collect(Collectors.joining(";")));
|
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());
|
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);
|
List<Line> voltageListBySubId = this.baseMapper.getVoltageListBySubId(subIndex, addVoltage);
|
||||||
if (CollectionUtil.isNotEmpty(voltageListBySubId)) {
|
if (CollectionUtil.isNotEmpty(voltageListBySubId)) {
|
||||||
throw new BusinessException(DeviceResponseEnum.SUBV_NAME_SAME, voltageListBySubId.stream().map(Line::getName).collect(Collectors.joining(";")));
|
throw new BusinessException(DeviceResponseEnum.SUBV_NAME_SAME, voltageListBySubId.stream().map(Line::getName).collect(Collectors.joining(";")));
|
||||||
}
|
}
|
||||||
}
|
}*/
|
||||||
Integer subvSort = lineSortHelper.getNextSort(SUB_V_LEVEL.getCode());
|
Integer subvSort = lineSortHelper.getNextSort(SUB_V_LEVEL.getCode());
|
||||||
for (SubVoltageParam subVoltageParam : deviceParam.getSubVoltageParam()) {
|
for (SubVoltageParam subVoltageParam : deviceParam.getSubVoltageParam()) {
|
||||||
//母线id
|
//母线id
|
||||||
@@ -751,10 +751,10 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
|||||||
.notIn(Line::getId, subVIndexList)
|
.notIn(Line::getId, subVIndexList)
|
||||||
.eq(Line::getPid, voltage.getPid());
|
.eq(Line::getPid, voltage.getPid());
|
||||||
List<Line> subVoltageList = this.list(lambdaQueryWrapper);
|
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());
|
List<String> repeatSubVNames = subVoltageList.stream().map(Line::getName).collect(Collectors.toList());
|
||||||
throw new BusinessException(DeviceResponseEnum.SUBV_NAME_SAME, "已存在母线名称:" + String.join(";", repeatSubVNames));
|
throw new BusinessException(DeviceResponseEnum.SUBV_NAME_SAME, "已存在母线名称:" + String.join(";", repeatSubVNames));
|
||||||
}
|
}*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -210,7 +210,10 @@
|
|||||||
|
|
||||||
<select id="getDeviceByIdOnOrOff" resultType="com.njcn.device.pq.pojo.vo.TerminalBaseVO">
|
<select id="getDeviceByIdOnOrOff" resultType="com.njcn.device.pq.pojo.vo.TerminalBaseVO">
|
||||||
SELECT
|
SELECT
|
||||||
t1.id devId,t1.name devName,t2.ip,t2.dev_type,t2.update_time,sub.name subName,gd.name gdName
|
case when
|
||||||
|
t3.obj_id is not null and t3.obj_id !='' then t3.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
|
FROM
|
||||||
pq_line t1,
|
pq_line t1,
|
||||||
pq_device t2,
|
pq_device t2,
|
||||||
|
|||||||
@@ -17,8 +17,10 @@ import com.njcn.bpm.enums.BpmTaskStatusEnum;
|
|||||||
import com.njcn.common.pojo.constant.PatternRegex;
|
import com.njcn.common.pojo.constant.PatternRegex;
|
||||||
import com.njcn.common.pojo.enums.common.DataStateEnum;
|
import com.njcn.common.pojo.enums.common.DataStateEnum;
|
||||||
import com.njcn.common.pojo.exception.BusinessException;
|
import com.njcn.common.pojo.exception.BusinessException;
|
||||||
|
import com.njcn.device.line.mapper.LineDetailMapper;
|
||||||
import com.njcn.device.line.mapper.LineMapper;
|
import com.njcn.device.line.mapper.LineMapper;
|
||||||
import com.njcn.device.pq.pojo.po.Line;
|
import com.njcn.device.pq.pojo.po.Line;
|
||||||
|
import com.njcn.device.pq.pojo.po.LineDetail;
|
||||||
import com.njcn.device.substation.mapper.SubstationMapper;
|
import com.njcn.device.substation.mapper.SubstationMapper;
|
||||||
import com.njcn.device.userledger.mapper.UserReportNormalMapper;
|
import com.njcn.device.userledger.mapper.UserReportNormalMapper;
|
||||||
import com.njcn.device.userledger.mapper.UserReportPOMapper;
|
import com.njcn.device.userledger.mapper.UserReportPOMapper;
|
||||||
@@ -47,6 +49,7 @@ import lombok.extern.slf4j.Slf4j;
|
|||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.regex.Matcher;
|
import java.util.regex.Matcher;
|
||||||
@@ -71,6 +74,7 @@ public class UserLedgerServiceImpl extends ServiceImpl<UserReportPOMapper, UserR
|
|||||||
private final UserReportSensitivePOService userReportSensitivePOService;
|
private final UserReportSensitivePOService userReportSensitivePOService;
|
||||||
private final UserFeignClient userFeignClient;
|
private final UserFeignClient userFeignClient;
|
||||||
private final LineMapper substationMapper;
|
private final LineMapper substationMapper;
|
||||||
|
private final LineDetailMapper lineDetailMapper;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<UserLedgerVO> selectUserList(UserReportParam userReportParam) {
|
public List<UserLedgerVO> selectUserList(UserReportParam userReportParam) {
|
||||||
@@ -300,6 +304,7 @@ public class UserLedgerServiceImpl extends ServiceImpl<UserReportPOMapper, UserR
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public String addUserReport(UserReportParam userReportParam) {
|
public String addUserReport(UserReportParam userReportParam) {
|
||||||
UserReportPO userReportPO = new UserReportPO();
|
UserReportPO userReportPO = new UserReportPO();
|
||||||
BeanUtils.copyProperties(userReportParam, userReportPO);
|
BeanUtils.copyProperties(userReportParam, userReportPO);
|
||||||
@@ -328,6 +333,19 @@ public class UserLedgerServiceImpl extends ServiceImpl<UserReportPOMapper, UserR
|
|||||||
userReportPO.setDataType(0);
|
userReportPO.setDataType(0);
|
||||||
}
|
}
|
||||||
this.saveOrUpdate(userReportPO);
|
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));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
userReportPO = this.getById(userReportPO.getId());
|
userReportPO = this.getById(userReportPO.getId());
|
||||||
if (
|
if (
|
||||||
CollectionUtil.newArrayList(
|
CollectionUtil.newArrayList(
|
||||||
|
|||||||
@@ -25,6 +25,8 @@ import com.njcn.harmonic.utils.PubUtils;
|
|||||||
import com.njcn.supervision.pojo.param.user.UserReportParam;
|
import com.njcn.supervision.pojo.param.user.UserReportParam;
|
||||||
import com.njcn.supervision.pojo.vo.user.UserLedgerVO;
|
import com.njcn.supervision.pojo.vo.user.UserLedgerVO;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.util.CollectionUtils;
|
import org.springframework.util.CollectionUtils;
|
||||||
|
|
||||||
@@ -38,7 +40,7 @@ import java.util.stream.Collectors;
|
|||||||
* @Description: <描述>
|
* @Description: <描述>
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
@AllArgsConstructor
|
@RequiredArgsConstructor
|
||||||
public class SteadyQualifyServiceImpl implements SteadyQualifyService {
|
public class SteadyQualifyServiceImpl implements SteadyQualifyService {
|
||||||
|
|
||||||
private final GeneralDeviceInfoClient generalDeviceInfoClient;
|
private final GeneralDeviceInfoClient generalDeviceInfoClient;
|
||||||
@@ -51,6 +53,13 @@ public class SteadyQualifyServiceImpl implements SteadyQualifyService {
|
|||||||
|
|
||||||
private final LineFeignClient lineFeignClient;
|
private final LineFeignClient lineFeignClient;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@Value("${version.used:master}")
|
||||||
|
private String versionUsed;
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<SteadyQualifyVO> getSteadyQualifyData(DeviceInfoParam.BusinessParam steadyParam) {
|
public List<SteadyQualifyVO> getSteadyQualifyData(DeviceInfoParam.BusinessParam steadyParam) {
|
||||||
List<SteadyQualifyVO> steadyQualifyList = new ArrayList<>();
|
List<SteadyQualifyVO> steadyQualifyList = new ArrayList<>();
|
||||||
@@ -304,8 +313,13 @@ public class SteadyQualifyServiceImpl implements SteadyQualifyService {
|
|||||||
//供电公司集合
|
//供电公司集合
|
||||||
List<SteadyQualifyVO> powerCompanyList = steadyQualifyMapper.getLineInfoByList(generalDeviceDTO.getGdIndexes());
|
List<SteadyQualifyVO> powerCompanyList = steadyQualifyMapper.getLineInfoByList(generalDeviceDTO.getGdIndexes());
|
||||||
dealChildrenData(substationList, otherLineList, temMap, true);
|
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.param.user.UserReportParam;
|
||||||
import com.njcn.supervision.pojo.vo.user.UserLedgerVO;
|
import com.njcn.supervision.pojo.vo.user.UserLedgerVO;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.util.CollectionUtils;
|
import org.springframework.util.CollectionUtils;
|
||||||
|
|
||||||
@@ -44,7 +46,7 @@ import java.util.stream.Collectors;
|
|||||||
* @Description: <描述>
|
* @Description: <描述>
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
@AllArgsConstructor
|
@RequiredArgsConstructor
|
||||||
public class THDistortionServiceImpl implements THDistortionService {
|
public class THDistortionServiceImpl implements THDistortionService {
|
||||||
|
|
||||||
private final GeneralInfo generalInfo;
|
private final GeneralInfo generalInfo;
|
||||||
@@ -53,6 +55,11 @@ public class THDistortionServiceImpl implements THDistortionService {
|
|||||||
private final RMpVThdMapper rMpVThdMapper;
|
private final RMpVThdMapper rMpVThdMapper;
|
||||||
private final LineFeignClient lineFeignClient;
|
private final LineFeignClient lineFeignClient;
|
||||||
private final UserLedgerFeignClient userLedgerFeignClient;
|
private final UserLedgerFeignClient userLedgerFeignClient;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@Value("${version.used:master}")
|
||||||
|
private String versionUsed;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<THDistortionVO> getTHDistortionData(DeviceInfoParam.BusinessParam thDistortionParam, Integer nodeType) {
|
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());
|
List<THDistortionVO> treeList = getTreeData(lineIndexes, condition, userLedgerVOMap, thDistortionParam.getPowerFlag());
|
||||||
thDistortionVO.setChildren(treeList);
|
thDistortionVO.setChildren(treeList);
|
||||||
|
|
||||||
thDistortionVOS.add(thDistortionVO);
|
thDistortionVOS.add(thDistortionVO);
|
||||||
}
|
}
|
||||||
if (nodeType == 1) {
|
if (nodeType == 1) {
|
||||||
thDistortionVOS.stream().forEach(data -> {
|
thDistortionVOS.forEach(data -> {
|
||||||
if (CollUtil.isNotEmpty(data.getChildren())) {
|
if (CollUtil.isNotEmpty(data.getChildren())) {
|
||||||
//市
|
//市
|
||||||
List<THDistortionVO> sub = data.getChildren().stream().flatMap(dto -> dto.getChildren().stream()).collect(Collectors.toList());
|
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<>());
|
x.setChildren(new ArrayList<>());
|
||||||
});
|
});
|
||||||
data.setChildren(sub);
|
data.setChildren(sub);
|
||||||
@@ -117,7 +123,7 @@ public class THDistortionServiceImpl implements THDistortionService {
|
|||||||
// continue;
|
// continue;
|
||||||
// }
|
// }
|
||||||
// type.add(thDistortionVO.getName() + "\n(" + seekLineNum(thDistortionVO) + ")");
|
// type.add(thDistortionVO.getName() + "\n(" + seekLineNum(thDistortionVO) + ")");
|
||||||
type.add(thDistortionVO.getName() );
|
type.add(thDistortionVO.getName());
|
||||||
// List<PublicDTO> condition = getCondition(lineIndexes, thDistortionCensusParam.getSearchBeginTime(), thDistortionCensusParam.getSearchEndTime());
|
// List<PublicDTO> condition = getCondition(lineIndexes, thDistortionCensusParam.getSearchBeginTime(), thDistortionCensusParam.getSearchEndTime());
|
||||||
single.add(thDistortionVO.getDistortion());
|
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> 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> 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)) {
|
if (!CollectionUtils.isEmpty(monitorList)) {
|
||||||
setChildesList(substationList, powerLedgerList, userTemList);
|
setChildesList(substationList, powerLedgerList, userTemList);
|
||||||
setFatherDistortion(substationList);
|
setFatherDistortion(substationList);
|
||||||
powerCompanyList = powerCompanyList.stream().peek(item -> item.setChildren(getChildCategoryList(item, substationList))).collect(Collectors.toList());
|
if ("liaoning".equals(versionUsed)) {
|
||||||
// setFatherDistortion(powerCompanyList);
|
return substationList;
|
||||||
setPowerDistortion(powerCompanyList);
|
} 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<>();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user