Compare commits
10 Commits
ab5d28e3cb
...
2025-12
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
184b2b8fad | ||
|
|
fe029fcb95 | ||
|
|
9143466ce7 | ||
|
|
9409d57243 | ||
| 63603dee08 | |||
|
|
e35bbd9b34 | ||
|
|
ea2173fff4 | ||
| faac7953d3 | |||
| c3cc39973e | |||
| 6d8bfacd0a |
@@ -322,10 +322,7 @@ public class SgEventServiceImpl extends ServiceImpl<SgEventMapper, SgEvent> impl
|
||||
|
||||
@Override
|
||||
public boolean deleteEventData(List<String> ids) {
|
||||
return this.lambdaUpdate()
|
||||
.set(SgEvent::getState, DataStateEnum.DELETED.getCode())
|
||||
.in(SgEvent::getId, ids)
|
||||
.update();
|
||||
return this.removeByIds(ids);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -51,6 +51,7 @@ import net.sf.json.JSONObject;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.sql.Timestamp;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
@@ -471,7 +472,7 @@ public class EventRelevantAnalysisServiceImpl extends ServiceImpl<RmpEventAdvanc
|
||||
|
||||
List<AdvanceEventDetailVO> advanceEventDetailVOList = BeanUtil.copyToList(rmpEventDetailPOList, AdvanceEventDetailVO.class);
|
||||
advanceEventDetailVOList = advanceEventDetailVOList.stream().peek(item -> {
|
||||
item.setFeatureAmplitude(item.getFeatureAmplitude()*100);
|
||||
item.setFeatureAmplitude(roundHalfUp(item.getFeatureAmplitude()*100));
|
||||
|
||||
if (map.containsKey(item.getLineId())) {
|
||||
AreaLineInfoVO areaLineInfoVO = map.get(item.getLineId());
|
||||
@@ -491,7 +492,17 @@ public class EventRelevantAnalysisServiceImpl extends ServiceImpl<RmpEventAdvanc
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 四舍五入保留两位小数
|
||||
*/
|
||||
private Double roundHalfUp(double num) {
|
||||
if (num == 3.14159) {
|
||||
return num;
|
||||
}
|
||||
BigDecimal b = new BigDecimal(num);
|
||||
//保留2位小数
|
||||
return com.njcn.harmonic.utils.PubUtils.dataLimits(b.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue());
|
||||
}
|
||||
@Override
|
||||
public Page<RmpEventDetailAssPO> queryEventsAssPage(BaseParam baseParam) {
|
||||
List<LocalDateTime> timeV = PubUtils.checkLocalDate(baseParam.getSearchBeginTime(), baseParam.getSearchEndTime());
|
||||
|
||||
@@ -8,4 +8,8 @@ public class PublicDTO {
|
||||
private String id;
|
||||
|
||||
private Double data;
|
||||
|
||||
private Integer onlineMin;
|
||||
|
||||
private Integer offlineMin;
|
||||
}
|
||||
@@ -43,4 +43,7 @@ public class MonitorBaseParam extends BaseParam {
|
||||
|
||||
@ApiModelProperty(value = "异常天数时间")
|
||||
private List<String> time;
|
||||
|
||||
@ApiModelProperty(value = "过滤异常时间次数")
|
||||
private Integer errorTimeCount;
|
||||
}
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
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 java.io.Serializable;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.github.jeffreyning.mybatisplus.anno.MppMultiId;
|
||||
import java.time.LocalDate;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
@@ -25,136 +26,306 @@ public class PqDataVerifyBak {
|
||||
/**
|
||||
* 监测点id
|
||||
*/
|
||||
@MppMultiId
|
||||
@TableField(value = "line_id")
|
||||
private String lineId;
|
||||
|
||||
/**
|
||||
* 异常数据时间
|
||||
*/
|
||||
@MppMultiId
|
||||
@TableField(value = "time_id")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||
private LocalDate timeId;
|
||||
|
||||
/**
|
||||
* 频率(0:正常 1:异常)
|
||||
* 监测点状态
|
||||
* 判断所有指标 0:无异常 1:异常
|
||||
*/
|
||||
private Integer freq;
|
||||
@TableField(value = "state")
|
||||
private Integer state ;
|
||||
|
||||
/**
|
||||
* 频率偏差(0:正常 1:异常)
|
||||
* 频率指标
|
||||
*/
|
||||
private Integer freqDev;
|
||||
@TableField(value = "freq")
|
||||
private Integer freq ;
|
||||
|
||||
/**
|
||||
* 相电压有效值(0:正常 1:异常)
|
||||
* 频率异常时间
|
||||
*/
|
||||
private Integer vRms;
|
||||
@TableField(value = "freq_time")
|
||||
private Integer freqTime ;
|
||||
|
||||
/**
|
||||
* 正序电压(0:正常 1:异常)
|
||||
* 频率偏差指标
|
||||
*/
|
||||
private Integer vPos;
|
||||
@TableField(value = "freq_dev")
|
||||
private Integer freqDev ;
|
||||
|
||||
/**
|
||||
* 负序电压(0:正常 1:异常)
|
||||
* 频率偏差异常时间
|
||||
*/
|
||||
private Integer vNeg;
|
||||
@TableField(value = "freq_dev_time")
|
||||
private Integer freqDevTime ;
|
||||
|
||||
/**
|
||||
* 零序电压(0:正常 1:异常)
|
||||
* 相电压有效值
|
||||
*/
|
||||
private Integer vZero;
|
||||
@TableField(value = "v_rms")
|
||||
private Integer vRms ;
|
||||
|
||||
/**
|
||||
* 电压不平衡度(0:正常 1:异常)
|
||||
* 相电压有效值异常时间
|
||||
*/
|
||||
private Integer vUnbalance;
|
||||
@TableField(value = "v_rms_time")
|
||||
private Integer vRmsTime ;
|
||||
|
||||
/**
|
||||
* 线电压有效值(0:正常 1:异常)
|
||||
* 正序电压
|
||||
*/
|
||||
private Integer rmsLvr;
|
||||
@TableField(value = "v_pos")
|
||||
private Integer vPos ;
|
||||
|
||||
/**
|
||||
* 电压正偏差(0:正常 1:异常)
|
||||
* 正序电压异常时间
|
||||
*/
|
||||
private Integer vuDev;
|
||||
@TableField(value = "v_pos_time")
|
||||
private Integer vPosTime ;
|
||||
|
||||
/**
|
||||
* 电压负偏差(0:正常 1:异常)
|
||||
* 负序电压
|
||||
*/
|
||||
private Integer vlDev;
|
||||
@TableField(value = "v_neg")
|
||||
private Integer vNeg ;
|
||||
|
||||
/**
|
||||
* 电压总谐波畸变率(0:正常 1:异常)
|
||||
* 负序电压异常时间
|
||||
*/
|
||||
private Integer vThd;
|
||||
@TableField(value = "v_neg_time")
|
||||
private Integer vNegTime ;
|
||||
|
||||
/**
|
||||
* 相电压基波有效值(0:正常 1:异常)
|
||||
* 零序电压
|
||||
*/
|
||||
private Integer v;
|
||||
@TableField(value = "v_zero")
|
||||
private Integer vZero ;
|
||||
|
||||
/**
|
||||
* 电流有效值(0:正常 1:异常)
|
||||
* 零序电压异常时间
|
||||
*/
|
||||
private Integer iRms;
|
||||
@TableField(value = "v_zero_time")
|
||||
private Integer vZeroTime ;
|
||||
|
||||
/**
|
||||
* 长时闪变(0:正常 1:异常)
|
||||
* 电压不平衡度
|
||||
*/
|
||||
private Integer plt;
|
||||
@TableField(value = "v_unbalance")
|
||||
private Integer vUnbalance ;
|
||||
|
||||
/**
|
||||
* 间谐波电压含有率(0:正常 1:异常)
|
||||
* 电压不平衡度异常时间
|
||||
*/
|
||||
private Integer vInharm;
|
||||
@TableField(value = "v_unbalance_time")
|
||||
private Integer vUnbalanceTime ;
|
||||
|
||||
/**
|
||||
* 谐波电压含有率(0:正常 1:异常)
|
||||
* 线电压有效值
|
||||
*/
|
||||
private Integer vHarm;
|
||||
@TableField(value = "rms_lvr")
|
||||
private Integer rmsLvr ;
|
||||
|
||||
/**
|
||||
* 功率因数(0:正常 1:异常)
|
||||
* 线电压有效值异常时间
|
||||
*/
|
||||
private Integer pf;
|
||||
@TableField(value = "rms_lvr_time")
|
||||
private Integer rmsLvrTime ;
|
||||
|
||||
/**
|
||||
* 谐波电压相角(0:正常 1:异常)
|
||||
* 电压正偏差
|
||||
*/
|
||||
private Integer vPhasic;
|
||||
@TableField(value = "vu_dev")
|
||||
private Integer vuDev ;
|
||||
|
||||
/**
|
||||
* 谐波电压基波相角(0:正常 1:异常)
|
||||
* 电压正偏差异常时间
|
||||
*/
|
||||
private Integer v1Phasic;
|
||||
@TableField(value = "vu_dev_time")
|
||||
private Integer vuDevTime ;
|
||||
|
||||
/**
|
||||
* 电压波动(0:正常 1:异常)
|
||||
* 电压负偏差
|
||||
*/
|
||||
private Integer fluc;
|
||||
@TableField(value = "vl_Dev")
|
||||
private Integer vlDev ;
|
||||
|
||||
/**
|
||||
* 短时闪变(0:正常 1:异常)
|
||||
* 电压负偏差异常时间
|
||||
*/
|
||||
private Integer pst;
|
||||
@TableField(value = "vl_Dev_time")
|
||||
private Integer vlDevTime ;
|
||||
|
||||
/**
|
||||
* 电压总谐波畸变率
|
||||
*/
|
||||
@TableField(value = "v_thd")
|
||||
private Integer vThd ;
|
||||
|
||||
/**
|
||||
* 电压总谐波畸变率异常时间
|
||||
*/
|
||||
@TableField(value = "v_thd_time")
|
||||
private Integer vThdTime ;
|
||||
|
||||
/**
|
||||
* 相电压基波有效值
|
||||
*/
|
||||
@TableField(value = "v")
|
||||
private Integer v ;
|
||||
|
||||
/**
|
||||
* 相电压基波有效值异常时间
|
||||
*/
|
||||
@TableField(value = "v_time")
|
||||
private Integer vTime ;
|
||||
|
||||
/**
|
||||
* 电流有效值
|
||||
*/
|
||||
@TableField(value = "i_rms")
|
||||
private Integer iRms ;
|
||||
|
||||
/**
|
||||
* 电流有效值异常时间
|
||||
*/
|
||||
@TableField(value = "i_rms_time")
|
||||
private Integer iRmsTime ;
|
||||
|
||||
/**
|
||||
* 长时闪变
|
||||
*/
|
||||
@TableField(value = "plt")
|
||||
private Integer plt ;
|
||||
|
||||
/**
|
||||
* 长时闪变异常时间
|
||||
*/
|
||||
@TableField(value = "plt_time")
|
||||
private Integer pltTime ;
|
||||
|
||||
/**
|
||||
* 间谐波电压含有率
|
||||
*/
|
||||
@TableField(value = "v_inharm")
|
||||
private Integer vInharm ;
|
||||
|
||||
/**
|
||||
* 间谐波电压含有率异常时间
|
||||
*/
|
||||
@TableField(value = "v_Inharm_time")
|
||||
private Integer vInharmTime ;
|
||||
|
||||
/**
|
||||
* 谐波电压含有率
|
||||
*/
|
||||
@TableField(value = "v_harm")
|
||||
private Integer vHarm ;
|
||||
|
||||
/**
|
||||
* 谐波电压含有率异常时间
|
||||
*/
|
||||
@TableField(value = "v_harm_time")
|
||||
private Integer vHarmTime ;
|
||||
|
||||
/**
|
||||
* 功率因数
|
||||
*/
|
||||
@TableField(value = "pf")
|
||||
private Integer pf ;
|
||||
|
||||
/**
|
||||
* 功率因数异常时间
|
||||
*/
|
||||
@TableField(value = "pf_time")
|
||||
private Integer pfTime ;
|
||||
|
||||
/**
|
||||
* 谐波电压相角
|
||||
*/
|
||||
@TableField(value = "v_phasic")
|
||||
private Integer vPhasic ;
|
||||
|
||||
/**
|
||||
* 谐波电压相角异常时间
|
||||
*/
|
||||
@TableField(value = "v_phasic_time")
|
||||
private Integer vPhasicTime ;
|
||||
|
||||
/**
|
||||
* 谐波电压基波相角
|
||||
*/
|
||||
@TableField(value = "v1_phasic")
|
||||
private Integer v1Phasic ;
|
||||
|
||||
/**
|
||||
* 谐波电压基波相角异常时间
|
||||
*/
|
||||
@TableField(value = "v1_phasic_time")
|
||||
private Integer v1PhasicTime ;
|
||||
|
||||
/**
|
||||
* 电压波动
|
||||
*/
|
||||
@TableField(value = "fluc")
|
||||
private Integer fluc ;
|
||||
|
||||
/**
|
||||
* 电压波动异常时间
|
||||
*/
|
||||
@TableField(value = "fluc_time")
|
||||
private Integer flucTime ;
|
||||
|
||||
/**
|
||||
* 短时闪变
|
||||
*/
|
||||
@TableField(value = "pst")
|
||||
private Integer pst ;
|
||||
|
||||
/**
|
||||
* 短时闪变异常时间
|
||||
*/
|
||||
@TableField(value = "pst_time")
|
||||
private Integer pstTime ;
|
||||
|
||||
/**
|
||||
* 电压暂降(0:正常 1:异常)
|
||||
*/
|
||||
private Integer dip;
|
||||
@TableField(value = "dip")
|
||||
private Integer dip ;
|
||||
|
||||
/**
|
||||
* 电压暂降异常时间
|
||||
*/
|
||||
@TableField(value = "dip_time")
|
||||
private Integer dipTime ;
|
||||
|
||||
/**
|
||||
* 电压暂升(0:正常 1:异常)
|
||||
*/
|
||||
private Integer rise;
|
||||
@TableField(value = "rise")
|
||||
private Integer rise ;
|
||||
|
||||
/**
|
||||
* 判断所有指标 0:无异常 1:有异常
|
||||
* 电压暂升异常时间
|
||||
*/
|
||||
private Integer state;
|
||||
@TableField(value = "rise_time")
|
||||
private Integer riseTime ;
|
||||
|
||||
|
||||
/**
|
||||
* 文件路径
|
||||
*/
|
||||
@TableField(value = "path")
|
||||
private String path;
|
||||
|
||||
|
||||
|
||||
@@ -136,6 +136,18 @@ public class LineIntegrityDataVO implements Serializable {
|
||||
@ApiModelProperty(name = "integrityData",value = "数据完整性")
|
||||
private Double integrityData;
|
||||
|
||||
/**
|
||||
* 实际时间
|
||||
*/
|
||||
@ApiModelProperty(name = "realTime",value = "实际时间")
|
||||
private Integer realTime;
|
||||
|
||||
/**
|
||||
* 期望时间
|
||||
*/
|
||||
@ApiModelProperty(name = "dueTime",value = "期望时间")
|
||||
private Integer dueTime;
|
||||
|
||||
/**
|
||||
* 监测点合格率
|
||||
*/
|
||||
|
||||
@@ -77,6 +77,18 @@ public class TerminalOnlineRateDataVO implements Serializable {
|
||||
@ApiModelProperty(name = "onlineRate",value = "在线率")
|
||||
private Double onlineRate;
|
||||
|
||||
/**
|
||||
* 在线分钟数
|
||||
*/
|
||||
@ApiModelProperty(name = "onlineMin",value = "在线分钟数")
|
||||
private Integer onlineMin;
|
||||
|
||||
/**
|
||||
* 离线分钟数
|
||||
*/
|
||||
@ApiModelProperty(name = "offlineMin",value = "离线分钟数")
|
||||
private Integer offlineMin;
|
||||
|
||||
/**
|
||||
* 最新数据时间
|
||||
*/
|
||||
|
||||
@@ -168,10 +168,10 @@ public class DeptLineController extends BaseController {
|
||||
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||
@PostMapping("/getAllData")
|
||||
@ApiOperation("获取部门监测点表所有数据")
|
||||
@ApiOperation("获取部门监测点表数据(仅查询在运监测点)")
|
||||
public HttpResult<List<DeptLine>> getAllData() {
|
||||
String methodDescribe = getMethodDescribe("getAllData");
|
||||
List<DeptLine> list = deptLineMapper.selectList(null);
|
||||
List<DeptLine> list = deptLineMapper.getOnlineMonitor();
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -176,7 +176,6 @@
|
||||
<select id="getDevOnlineByDevIds" resultType="TerminalOnlineRateData">
|
||||
select
|
||||
dev_index devId,
|
||||
avg(online_min/(online_min+offline_min))*100 onlineRate,
|
||||
sum(online_min) onlineMin,
|
||||
sum(offline_min) offlineMin
|
||||
from r_stat_onlinerate_d
|
||||
|
||||
@@ -173,13 +173,17 @@ public class LineIntegrityDataServiceImpl extends ServiceImpl<LineIntegrityDataM
|
||||
}
|
||||
|
||||
// 数据封装
|
||||
Double temValue = lineList.stream().filter(item -> item.getIntegrityData() != 3.14159).mapToDouble(LineIntegrityDataVO::getIntegrityData).average().orElse(3.14159);
|
||||
// 汇总所有监测点的实际时间和期望时间,重新计算完整性
|
||||
int totalRealTime = (int) lineList.stream().filter(item -> item.getIntegrityData() != 3.14159).mapToLong(LineIntegrityDataVO::getRealTime).sum();
|
||||
int totalDueTime = (int) lineList.stream().filter(item -> item.getIntegrityData() != 3.14159).mapToLong(LineIntegrityDataVO::getDueTime).sum();
|
||||
lineIntegrityDataVO.setRealTime(totalRealTime);
|
||||
lineIntegrityDataVO.setDueTime(totalDueTime);
|
||||
lineIntegrityDataVO.setIntegrityData(DataStatisticsUtil.calculateIntegrityRate(totalRealTime, totalDueTime));
|
||||
LineIntegrityDataVO temp = lineList.stream().filter(t -> t.getAlgoDescribe() != null).min(Comparator.comparing(LineIntegrityDataVO::getAlgoDescribe)).orElse(new LineIntegrityDataVO());
|
||||
lineIntegrityDataVO.setAlgoDescribe(temp.getAlgoDescribe());
|
||||
lineIntegrityDataVO.setId(generalDeviceDTO.getIndex());
|
||||
lineIntegrityDataVO.setName(generalDeviceDTO.getName());
|
||||
lineIntegrityDataVO.setLevel(0);
|
||||
lineIntegrityDataVO.setIntegrityData(DataStatisticsUtil.dataLimits(temValue));
|
||||
pro.add(lineIntegrityDataVO);
|
||||
|
||||
}
|
||||
@@ -193,12 +197,12 @@ public class LineIntegrityDataServiceImpl extends ServiceImpl<LineIntegrityDataM
|
||||
|
||||
|
||||
private void dealDataJinDu(List<LineIntegrityDataVO> mList,LineIntegrityDataVO children){
|
||||
double temValue = mList.stream().filter(it->it.getIntegrityData()!=3.14159).mapToDouble(LineIntegrityDataVO::getIntegrityData).average().orElse(3.14159);
|
||||
if(temValue!=3.14159){
|
||||
children.setIntegrityData(new BigDecimal(temValue).setScale(2,RoundingMode.HALF_UP).doubleValue());
|
||||
}else {
|
||||
children.setIntegrityData(temValue);
|
||||
}
|
||||
// 汇总子节点的实际时间和期望时间,重新计算完整性
|
||||
int totalRealTime = (int) mList.stream().filter(it->it.getIntegrityData()!=3.14159).mapToLong(LineIntegrityDataVO::getRealTime).sum();
|
||||
int totalDueTime = (int) mList.stream().filter(it->it.getIntegrityData()!=3.14159).mapToLong(LineIntegrityDataVO::getDueTime).sum();
|
||||
children.setRealTime(totalRealTime);
|
||||
children.setDueTime(totalDueTime);
|
||||
children.setIntegrityData(DataStatisticsUtil.calculateIntegrityRate(totalRealTime, totalDueTime));
|
||||
}
|
||||
|
||||
private void dealMonitorData(List<LineIntegrityDataVO> lineList,List<LineDataIntegrity> percentageOfCompleteDatas,Map<String, Integer> mapA){
|
||||
@@ -209,10 +213,13 @@ public class LineIntegrityDataServiceImpl extends ServiceImpl<LineIntegrityDataM
|
||||
if(dataIntegrityMap.containsKey(monitor.getId())){
|
||||
flag = true;
|
||||
LineDataIntegrity integrity = dataIntegrityMap.get(monitor.getId());
|
||||
monitor.setIntegrityData(DataStatisticsUtil.dataLimits(integrity.getIntegrityData()));
|
||||
monitor.setRealTime(integrity.getReal() == null ? 0 : integrity.getReal().intValue());
|
||||
monitor.setDueTime(integrity.getDue() == null ? 0 : integrity.getDue().intValue());
|
||||
Double integrityData = DataStatisticsUtil.calculateIntegrityRate(monitor.getRealTime(), monitor.getDueTime());
|
||||
monitor.setIntegrityData(integrityData);
|
||||
if (StrUtil.isNotBlank(monitor.getLineGrade())) {
|
||||
if (mapA.containsKey(monitor.getLineGrade())) {
|
||||
if (integrity.getIntegrityData() > mapA.get(monitor.getLineGrade())) {
|
||||
if (integrityData != 3.14159 && integrityData > mapA.get(monitor.getLineGrade())) {
|
||||
monitor.setValueOver(1);
|
||||
} else {
|
||||
monitor.setValueOver(0);
|
||||
@@ -228,6 +235,8 @@ public class LineIntegrityDataServiceImpl extends ServiceImpl<LineIntegrityDataM
|
||||
if (!flag) {
|
||||
//表示未匹配到数据完整性
|
||||
monitor.setIntegrityData(3.14159);
|
||||
monitor.setRealTime(0);
|
||||
monitor.setDueTime(0);
|
||||
monitor.setValueOver(0);
|
||||
}
|
||||
}
|
||||
@@ -248,13 +257,19 @@ public class LineIntegrityDataServiceImpl extends ServiceImpl<LineIntegrityDataM
|
||||
outParam.setType(generalDeviceDTO.getName() + "\n(" + generalDeviceDTO.getLineIndexes().size() + ")");
|
||||
//根据监测点查询数据完整性
|
||||
List<PublicDTO> integrityData = getCondition(lineIndexes, integrityIconParam.getSearchBeginTime(), integrityIconParam.getSearchEndTime());
|
||||
double v = integrityData.stream().mapToDouble(PublicDTO::getData).average().orElse(3.14159);
|
||||
outParam.setSingle(v!=3.14159?NumberUtil.round(v,2).doubleValue():v);
|
||||
// 汇总所有监测点的实际时间和期望时间,再计算总完整性
|
||||
int totalRealTime = (int) integrityData.stream().mapToLong(PublicDTO::getOnlineMin).sum();
|
||||
int totalDueTime = (int) integrityData.stream().mapToLong(PublicDTO::getOfflineMin).sum();
|
||||
double v = DataStatisticsUtil.calculateIntegrityRate(totalRealTime, totalDueTime);
|
||||
outParam.setSingle(v);
|
||||
//如果存在需要比较的时间,再获取对应数据
|
||||
if (StrUtil.isNotBlank(integrityIconParam.getPeriodBeginTime()) && StrUtil.isNotBlank(integrityIconParam.getPeriodEndTime())) {
|
||||
List<PublicDTO> compareData = getCondition(lineIndexes, integrityIconParam.getPeriodBeginTime(), integrityIconParam.getPeriodEndTime());
|
||||
double v1 = compareData.stream().mapToDouble(PublicDTO::getData).average().orElse(3.14159);
|
||||
outParam.setRatio(v1!=3.14159?NumberUtil.round(v1,2).doubleValue():v1);
|
||||
// 汇总所有监测点的实际时间和期望时间,再计算总完整性
|
||||
int compareRealTime = (int) compareData.stream().mapToLong(PublicDTO::getOnlineMin).sum();
|
||||
int compareDueTime = (int) compareData.stream().mapToLong(PublicDTO::getOfflineMin).sum();
|
||||
double v1 = DataStatisticsUtil.calculateIntegrityRate(compareRealTime, compareDueTime);
|
||||
outParam.setRatio(v1);
|
||||
}
|
||||
out.add(outParam);
|
||||
}
|
||||
@@ -320,12 +335,14 @@ public class LineIntegrityDataServiceImpl extends ServiceImpl<LineIntegrityDataM
|
||||
for (LineDataIntegrity lineData : percentageOfCompleteDatas) {
|
||||
if (lineDataIntegrity.getId().equals(lineData.getLineId())) {
|
||||
flag = true;
|
||||
Double temValue = lineData.getIntegrityData();
|
||||
lineDataIntegrity.setIntegrityData(DataStatisticsUtil.dataLimits(temValue));
|
||||
lineDataIntegrity.setRealTime(lineData.getReal() == null ? 0 : lineData.getReal().intValue());
|
||||
lineDataIntegrity.setDueTime(lineData.getDue() == null ? 0 : lineData.getDue().intValue());
|
||||
Double temValue = DataStatisticsUtil.calculateIntegrityRate(lineDataIntegrity.getRealTime(), lineDataIntegrity.getDueTime());
|
||||
lineDataIntegrity.setIntegrityData(temValue);
|
||||
//根据等级判断是否越限
|
||||
if (StrUtil.isNotBlank(lineDataIntegrity.getLineGrade())) {
|
||||
if (mapA.containsKey(lineDataIntegrity.getLineGrade())) {
|
||||
if (temValue > mapA.get(lineDataIntegrity.getLineGrade())) {
|
||||
if (temValue != 3.14159 && temValue > mapA.get(lineDataIntegrity.getLineGrade())) {
|
||||
lineDataIntegrity.setValueOver(1);
|
||||
} else {
|
||||
lineDataIntegrity.setValueOver(0);
|
||||
@@ -343,6 +360,8 @@ public class LineIntegrityDataServiceImpl extends ServiceImpl<LineIntegrityDataM
|
||||
if (!flag) {
|
||||
//表示未匹配到数据完整性
|
||||
lineDataIntegrity.setIntegrityData(3.14159);
|
||||
lineDataIntegrity.setRealTime(0);
|
||||
lineDataIntegrity.setDueTime(0);
|
||||
lineDataIntegrity.setValueOver(0);
|
||||
}
|
||||
}
|
||||
@@ -352,13 +371,17 @@ public class LineIntegrityDataServiceImpl extends ServiceImpl<LineIntegrityDataM
|
||||
lineIntegrityDataVO.setChildren(subList);
|
||||
|
||||
// 数据封装
|
||||
Double temValue = lineList.stream().filter(item -> item.getIntegrityData() != 3.14159).mapToDouble(LineIntegrityDataVO::getIntegrityData).average().orElse(3.14159);
|
||||
// 汇总所有监测点的实际时间和期望时间,重新计算完整性
|
||||
int totalRealTime = (int) lineList.stream().filter(item -> item.getIntegrityData() != 3.14159).mapToLong(LineIntegrityDataVO::getRealTime).sum();
|
||||
int totalDueTime = (int) lineList.stream().filter(item -> item.getIntegrityData() != 3.14159).mapToLong(LineIntegrityDataVO::getDueTime).sum();
|
||||
lineIntegrityDataVO.setRealTime(totalRealTime);
|
||||
lineIntegrityDataVO.setDueTime(totalDueTime);
|
||||
lineIntegrityDataVO.setIntegrityData(DataStatisticsUtil.calculateIntegrityRate(totalRealTime, totalDueTime));
|
||||
LineIntegrityDataVO temp = lineList.stream().filter(t -> t.getAlgoDescribe() != null).min(Comparator.comparing(LineIntegrityDataVO::getAlgoDescribe)).orElse(new LineIntegrityDataVO());
|
||||
lineIntegrityDataVO.setAlgoDescribe(temp.getAlgoDescribe());
|
||||
lineIntegrityDataVO.setId(generalDeviceDTO.getIndex());
|
||||
lineIntegrityDataVO.setName(generalDeviceDTO.getName());
|
||||
lineIntegrityDataVO.setLevel(0);
|
||||
lineIntegrityDataVO.setIntegrityData(Math.min(DataStatisticsUtil.dataLimits(temValue),100.0));
|
||||
pro.add(lineIntegrityDataVO);
|
||||
|
||||
}
|
||||
@@ -397,9 +420,12 @@ public class LineIntegrityDataServiceImpl extends ServiceImpl<LineIntegrityDataM
|
||||
for (String pid : pids) {
|
||||
if (lineAdministrationTree.getId().equals(pid)) {
|
||||
List<LineIntegrityDataVO> lineIntegrityDataVOList = groupLine.get(pid);
|
||||
//父级完整性匹配
|
||||
Double temValue = lineIntegrityDataVOList.stream().filter(item -> item.getIntegrityData() != 3.14159).mapToDouble(LineIntegrityDataVO::getIntegrityData).average().orElse(3.14159);
|
||||
lineAdministrationTree.setIntegrityData(DataStatisticsUtil.dataLimits(temValue));
|
||||
//父级完整性匹配 - 汇总子节点的实际时间和期望时间,重新计算完整性
|
||||
int totalRealTime = (int) lineIntegrityDataVOList.stream().filter(item -> item.getIntegrityData() != 3.14159).mapToLong(LineIntegrityDataVO::getRealTime).sum();
|
||||
int totalDueTime = (int) lineIntegrityDataVOList.stream().filter(item -> item.getIntegrityData() != 3.14159).mapToLong(LineIntegrityDataVO::getDueTime).sum();
|
||||
lineAdministrationTree.setRealTime(totalRealTime);
|
||||
lineAdministrationTree.setDueTime(totalDueTime);
|
||||
lineAdministrationTree.setIntegrityData(DataStatisticsUtil.calculateIntegrityRate(totalRealTime, totalDueTime));
|
||||
LineIntegrityDataVO temp = lineIntegrityDataVOList.stream().filter(t -> t.getAlgoDescribe() != null).min(Comparator.comparing(LineIntegrityDataVO::getAlgoDescribe)).orElse(new LineIntegrityDataVO());
|
||||
lineAdministrationTree.setAlgoDescribe(temp.getAlgoDescribe());
|
||||
}
|
||||
@@ -418,10 +444,12 @@ public class LineIntegrityDataServiceImpl extends ServiceImpl<LineIntegrityDataM
|
||||
if (!CollectionUtils.isEmpty(data)) {
|
||||
data.forEach(po -> {
|
||||
PublicDTO publicDTO = new PublicDTO();
|
||||
//数据完整性 保留四位小数
|
||||
Double integrity = po.getIntegrityRate() == null ? 3.14159 : BigDecimal.valueOf(Double.parseDouble(po.getIntegrityRate().toString())).setScale(2, RoundingMode.HALF_UP).doubleValue();
|
||||
publicDTO.setId(po.getLineIndex());
|
||||
publicDTO.setData((integrity > 100.00) ? 100.00 : integrity);
|
||||
publicDTO.setOnlineMin(po.getRealTime() == null ? 0 : po.getRealTime().intValue());
|
||||
publicDTO.setOfflineMin(po.getDueTime() == null ? 0 : po.getDueTime().intValue());
|
||||
// 计算数据完整性
|
||||
Double integrity = DataStatisticsUtil.calculateIntegrityRate(publicDTO.getOnlineMin(), publicDTO.getOfflineMin());
|
||||
publicDTO.setData(integrity);
|
||||
integrityList.add(publicDTO);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ package com.njcn.device.pq.service.impl;
|
||||
import cn.hutool.core.codec.Base64;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.date.*;
|
||||
import cn.hutool.core.util.ObjUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.json.JSONArray;
|
||||
import cn.hutool.json.JSONConfig;
|
||||
@@ -74,21 +75,24 @@ public class PqDataVerifyBakServiceImpl extends ServiceImpl<PqDataVerifyBakMappe
|
||||
|
||||
@Override
|
||||
public VerifyMonitorVO getMonitorVerifyData(MonitorBaseParam monitorBaseParam) {
|
||||
if(Objects.isNull(monitorBaseParam.getErrorTimeCount())){
|
||||
monitorBaseParam.setErrorTimeCount(720);
|
||||
}
|
||||
List<String> monitorIds = commTerminalService.getRunMonitorByDept(monitorBaseParam);
|
||||
VerifyMonitorVO verifyMonitorVO = new VerifyMonitorVO();
|
||||
if (CollUtil.isNotEmpty(monitorIds)) {
|
||||
List<PqDataVerifyBak> dataVerifyList = baseDataVerifyQuery(monitorIds, monitorBaseParam);
|
||||
verifyMonitorVO.setRunNum(monitorIds.size());
|
||||
verifyMonitorVO.setAbnormalNum(dataVerifyList.stream().collect(Collectors.groupingBy(PqDataVerifyBak::getLineId)).size());
|
||||
List<PqDataVerifyBak> dataSumVerifyList = baseDataSumVerifyQuery(monitorIds, monitorBaseParam);
|
||||
// List<PqDataVerifyBak> dataSumVerifyList = baseDataSumVerifyQuery(monitorIds, monitorBaseParam);
|
||||
verifyMonitorVO.setMapList(getRangeAbnormalMonitor(monitorBaseParam, dataVerifyList));
|
||||
verifyMonitorVO.setTargetList(getAbnormalTarget(dataSumVerifyList));
|
||||
verifyMonitorVO.setTargetList(getAbnormalTarget(dataVerifyList,monitorBaseParam.getErrorTimeCount()));
|
||||
verifyMonitorVO.setMonitorAlarmInfo(getAbnormalTable(dataVerifyList, monitorBaseParam));
|
||||
} else {
|
||||
verifyMonitorVO.setRunNum(0);
|
||||
verifyMonitorVO.setAbnormalNum(0);
|
||||
verifyMonitorVO.setMapList(getRangeAbnormalMonitor(monitorBaseParam, new ArrayList<>()));
|
||||
verifyMonitorVO.setTargetList(getAbnormalTarget(new ArrayList<>()));
|
||||
verifyMonitorVO.setTargetList(getAbnormalTarget(new ArrayList<>(),monitorBaseParam.getErrorTimeCount()));
|
||||
verifyMonitorVO.setMonitorAlarmInfo(getAbnormalTable(new ArrayList<>(), monitorBaseParam));
|
||||
}
|
||||
|
||||
@@ -179,6 +183,9 @@ public class PqDataVerifyBakServiceImpl extends ServiceImpl<PqDataVerifyBakMappe
|
||||
|
||||
@Override
|
||||
public List<DetailAbnormalVO> monitorAbnormalTable(MonitorBaseParam monitorBaseParam) {
|
||||
if(Objects.isNull(monitorBaseParam.getErrorTimeCount())){
|
||||
monitorBaseParam.setErrorTimeCount(720);
|
||||
}
|
||||
List<DetailAbnormalVO> result = new ArrayList<>();
|
||||
//参数校验
|
||||
Map<String, PqReasonableRangeDto> rangeMap = getStandRange();
|
||||
@@ -201,67 +208,73 @@ public class PqDataVerifyBakServiceImpl extends ServiceImpl<PqDataVerifyBakMappe
|
||||
if (StrUtil.isNotBlank(monitorBaseParam.getTargetKey())) {
|
||||
switch (monitorBaseParam.getTargetKey()) {
|
||||
case Param.freq:
|
||||
lambdaQueryWrapper.eq(PqDataVerifyBak::getFreq, 1);
|
||||
lambdaQueryWrapper.ge(PqDataVerifyBak::getFreqTime, monitorBaseParam.getErrorTimeCount());
|
||||
break;
|
||||
case Param.freq_dev:
|
||||
lambdaQueryWrapper.eq(PqDataVerifyBak::getFreqDev, 1);
|
||||
lambdaQueryWrapper.ge(PqDataVerifyBak::getFreqDevTime, monitorBaseParam.getErrorTimeCount());
|
||||
break;
|
||||
case Param.rms_v:
|
||||
lambdaQueryWrapper.eq(PqDataVerifyBak::getVRms, 1);
|
||||
lambdaQueryWrapper.ge(PqDataVerifyBak::getVRmsTime, monitorBaseParam.getErrorTimeCount());
|
||||
break;
|
||||
case Param.rms_lvr:
|
||||
lambdaQueryWrapper.eq(PqDataVerifyBak::getRmsLvr, 1);
|
||||
lambdaQueryWrapper.ge(PqDataVerifyBak::getRmsLvrTime, monitorBaseParam.getErrorTimeCount());
|
||||
break;
|
||||
case Param.vu_dev:
|
||||
lambdaQueryWrapper.eq(PqDataVerifyBak::getVuDev, 1);
|
||||
lambdaQueryWrapper.ge(PqDataVerifyBak::getVuDevTime, monitorBaseParam.getErrorTimeCount());
|
||||
break;
|
||||
case Param.vl_dev:
|
||||
lambdaQueryWrapper.eq(PqDataVerifyBak::getVlDev, 1);
|
||||
lambdaQueryWrapper.ge(PqDataVerifyBak::getVlDevTime, monitorBaseParam.getErrorTimeCount());
|
||||
break;
|
||||
case Param.rms_i:
|
||||
lambdaQueryWrapper.eq(PqDataVerifyBak::getIRms, 1);
|
||||
lambdaQueryWrapper.ge(PqDataVerifyBak::getIRmsTime, monitorBaseParam.getErrorTimeCount());
|
||||
break;
|
||||
case Param.v_thd:
|
||||
lambdaQueryWrapper.eq(PqDataVerifyBak::getVThd, 1);
|
||||
lambdaQueryWrapper.ge(PqDataVerifyBak::getVThdTime, monitorBaseParam.getErrorTimeCount());
|
||||
break;
|
||||
case Param.v_1_v:
|
||||
lambdaQueryWrapper.eq(PqDataVerifyBak::getV, 1);
|
||||
lambdaQueryWrapper.ge(PqDataVerifyBak::getVTime, monitorBaseParam.getErrorTimeCount());
|
||||
break;
|
||||
case Param.phasic_v_1:
|
||||
lambdaQueryWrapper.eq(PqDataVerifyBak::getV1Phasic, 1);
|
||||
lambdaQueryWrapper.ge(PqDataVerifyBak::getV1PhasicTime, monitorBaseParam.getErrorTimeCount());
|
||||
break;
|
||||
case Param.phasic_rate_x:
|
||||
lambdaQueryWrapper.eq(PqDataVerifyBak::getVPhasic, 1);
|
||||
lambdaQueryWrapper.ge(PqDataVerifyBak::getVPhasicTime, monitorBaseParam.getErrorTimeCount());
|
||||
break;
|
||||
case Param.v_rate:
|
||||
lambdaQueryWrapper.eq(PqDataVerifyBak::getVHarm, 1);
|
||||
lambdaQueryWrapper.ge(PqDataVerifyBak::getVHarmTime, monitorBaseParam.getErrorTimeCount());
|
||||
break;
|
||||
case Param.in_v_rate:
|
||||
lambdaQueryWrapper.eq(PqDataVerifyBak::getVInharm, 1);
|
||||
lambdaQueryWrapper.ge(PqDataVerifyBak::getVInharmTime, monitorBaseParam.getErrorTimeCount());
|
||||
break;
|
||||
case Param.v_zero:
|
||||
lambdaQueryWrapper.eq(PqDataVerifyBak::getVZero, 1);
|
||||
lambdaQueryWrapper.ge(PqDataVerifyBak::getVZeroTime, monitorBaseParam.getErrorTimeCount());
|
||||
break;
|
||||
case Param.v_neg:
|
||||
lambdaQueryWrapper.eq(PqDataVerifyBak::getVNeg, 1);
|
||||
lambdaQueryWrapper.ge(PqDataVerifyBak::getVNegTime, monitorBaseParam.getErrorTimeCount());
|
||||
break;
|
||||
case Param.v_pos:
|
||||
lambdaQueryWrapper.eq(PqDataVerifyBak::getVPos, 1);
|
||||
lambdaQueryWrapper.ge(PqDataVerifyBak::getVPosTime, monitorBaseParam.getErrorTimeCount());
|
||||
break;
|
||||
case Param.v_unbalance:
|
||||
lambdaQueryWrapper.eq(PqDataVerifyBak::getVUnbalance, 1);
|
||||
lambdaQueryWrapper.ge(PqDataVerifyBak::getVUnbalanceTime, monitorBaseParam.getErrorTimeCount());
|
||||
break;
|
||||
case Param.fluc:
|
||||
lambdaQueryWrapper.eq(PqDataVerifyBak::getFluc, 1);
|
||||
lambdaQueryWrapper.ge(PqDataVerifyBak::getFlucTime, monitorBaseParam.getErrorTimeCount());
|
||||
break;
|
||||
case Param.pst:
|
||||
lambdaQueryWrapper.eq(PqDataVerifyBak::getPst, 1);
|
||||
lambdaQueryWrapper.ge(PqDataVerifyBak::getPstTime, monitorBaseParam.getErrorTimeCount());
|
||||
break;
|
||||
case Param.plt:
|
||||
lambdaQueryWrapper.eq(PqDataVerifyBak::getPlt, 1);
|
||||
lambdaQueryWrapper.ge(PqDataVerifyBak::getPltTime, monitorBaseParam.getErrorTimeCount());
|
||||
break;
|
||||
case Param.pf:
|
||||
lambdaQueryWrapper.eq(PqDataVerifyBak::getPf, 1);
|
||||
lambdaQueryWrapper.ge(PqDataVerifyBak::getPfTime, monitorBaseParam.getErrorTimeCount());
|
||||
break;
|
||||
case Param.Voltage_Dip:
|
||||
lambdaQueryWrapper.ge(PqDataVerifyBak::getDipTime, monitorBaseParam.getErrorTimeCount());
|
||||
break;
|
||||
case Param.Voltage_Rise:
|
||||
lambdaQueryWrapper.ge(PqDataVerifyBak::getRiseTime, monitorBaseParam.getErrorTimeCount());
|
||||
break;
|
||||
default:
|
||||
log.error("方法{}未匹配到异常数据指标", "monitorAbnormalTable");
|
||||
@@ -284,7 +297,7 @@ public class PqDataVerifyBakServiceImpl extends ServiceImpl<PqDataVerifyBakMappe
|
||||
for (PqDataVerifyBak pqDataVerifyBak : value) {
|
||||
targetKey = new DetailAbnormalVO.TimeAndTargetKey();
|
||||
targetKey.setDate(pqDataVerifyBak.getTimeId().format(DatePattern.NORM_DATE_FORMATTER));
|
||||
targetKey.setTargetKeys(getAbnormalTarget(Arrays.asList(pqDataVerifyBak)).stream().filter(x->x.getIds().size()>0).collect(Collectors.toList()));
|
||||
targetKey.setTargetKeys(getAbnormalTarget(Arrays.asList(pqDataVerifyBak),monitorBaseParam.getErrorTimeCount()).stream().filter(x->x.getIds().size()>0).collect(Collectors.toList()));
|
||||
targetKeyList.add(targetKey);
|
||||
}
|
||||
detailAbnormalVO.setDateTargetList(targetKeyList);
|
||||
@@ -462,6 +475,52 @@ public class PqDataVerifyBakServiceImpl extends ServiceImpl<PqDataVerifyBakMappe
|
||||
lambdaQueryWrapper.between(PqDataVerifyBak::getTimeId, DateUtil.beginOfDay(DateUtil.parse(monitorBaseParam.getSearchBeginTime())), DateUtil.endOfDay(DateUtil.parse(monitorBaseParam.getSearchEndTime())))
|
||||
.in(PqDataVerifyBak::getLineId, monitorIds)
|
||||
.eq(PqDataVerifyBak::getState, 1)
|
||||
.and(x -> x.ge(PqDataVerifyBak::getFreqTime, monitorBaseParam.getErrorTimeCount())
|
||||
.or()
|
||||
.ge(PqDataVerifyBak::getFreqDevTime, monitorBaseParam.getErrorTimeCount())
|
||||
.or()
|
||||
.ge(PqDataVerifyBak::getVRmsTime, monitorBaseParam.getErrorTimeCount())
|
||||
.or()
|
||||
.ge(PqDataVerifyBak::getVPosTime, monitorBaseParam.getErrorTimeCount())
|
||||
.or()
|
||||
.ge(PqDataVerifyBak::getVNegTime, monitorBaseParam.getErrorTimeCount())
|
||||
.or()
|
||||
.ge(PqDataVerifyBak::getVZeroTime, monitorBaseParam.getErrorTimeCount())
|
||||
.or()
|
||||
.ge(PqDataVerifyBak::getVUnbalanceTime, monitorBaseParam.getErrorTimeCount())
|
||||
.or()
|
||||
.ge(PqDataVerifyBak::getRmsLvrTime, monitorBaseParam.getErrorTimeCount())
|
||||
.or()
|
||||
.ge(PqDataVerifyBak::getVuDevTime, monitorBaseParam.getErrorTimeCount())
|
||||
.or()
|
||||
.ge(PqDataVerifyBak::getVlDevTime, monitorBaseParam.getErrorTimeCount())
|
||||
.or()
|
||||
.ge(PqDataVerifyBak::getVThdTime, monitorBaseParam.getErrorTimeCount())
|
||||
.or()
|
||||
.ge(PqDataVerifyBak::getVTime, monitorBaseParam.getErrorTimeCount())
|
||||
.or()
|
||||
.ge(PqDataVerifyBak::getIRmsTime, monitorBaseParam.getErrorTimeCount())
|
||||
.or()
|
||||
.ge(PqDataVerifyBak::getPltTime, monitorBaseParam.getErrorTimeCount())
|
||||
.or()
|
||||
.ge(PqDataVerifyBak::getVInharmTime, monitorBaseParam.getErrorTimeCount())
|
||||
.or()
|
||||
.ge(PqDataVerifyBak::getVHarmTime, monitorBaseParam.getErrorTimeCount())
|
||||
.or()
|
||||
.ge(PqDataVerifyBak::getPfTime, monitorBaseParam.getErrorTimeCount())
|
||||
.or()
|
||||
.ge(PqDataVerifyBak::getVPhasicTime, monitorBaseParam.getErrorTimeCount())
|
||||
.or()
|
||||
.ge(PqDataVerifyBak::getV1PhasicTime, monitorBaseParam.getErrorTimeCount())
|
||||
.or()
|
||||
.ge(PqDataVerifyBak::getFlucTime, monitorBaseParam.getErrorTimeCount())
|
||||
.or()
|
||||
.ge(PqDataVerifyBak::getPstTime, monitorBaseParam.getErrorTimeCount())
|
||||
.or()
|
||||
.ge(PqDataVerifyBak::getDipTime, monitorBaseParam.getErrorTimeCount())
|
||||
.or()
|
||||
.ge(PqDataVerifyBak::getRiseTime, monitorBaseParam.getErrorTimeCount())
|
||||
)
|
||||
.orderByAsc(PqDataVerifyBak::getTimeId);
|
||||
return this.list(lambdaQueryWrapper);
|
||||
}
|
||||
@@ -475,6 +534,52 @@ public class PqDataVerifyBakServiceImpl extends ServiceImpl<PqDataVerifyBakMappe
|
||||
.lambda().between(PqDataVerifyBak::getTimeId, DateUtil.beginOfDay(DateUtil.parse(monitorBaseParam.getSearchBeginTime())), DateUtil.endOfDay(DateUtil.parse(monitorBaseParam.getSearchEndTime())))
|
||||
.in(PqDataVerifyBak::getLineId, monitorIds)
|
||||
.eq(PqDataVerifyBak::getState, 1)
|
||||
.and(x -> x.ge(PqDataVerifyBak::getFreqTime, monitorBaseParam.getErrorTimeCount())
|
||||
.or()
|
||||
.ge(PqDataVerifyBak::getFreqDevTime, monitorBaseParam.getErrorTimeCount())
|
||||
.or()
|
||||
.ge(PqDataVerifyBak::getVRmsTime, monitorBaseParam.getErrorTimeCount())
|
||||
.or()
|
||||
.ge(PqDataVerifyBak::getVPosTime, monitorBaseParam.getErrorTimeCount())
|
||||
.or()
|
||||
.ge(PqDataVerifyBak::getVNegTime, monitorBaseParam.getErrorTimeCount())
|
||||
.or()
|
||||
.ge(PqDataVerifyBak::getVZeroTime, monitorBaseParam.getErrorTimeCount())
|
||||
.or()
|
||||
.ge(PqDataVerifyBak::getVUnbalanceTime, monitorBaseParam.getErrorTimeCount())
|
||||
.or()
|
||||
.ge(PqDataVerifyBak::getRmsLvrTime, monitorBaseParam.getErrorTimeCount())
|
||||
.or()
|
||||
.ge(PqDataVerifyBak::getVuDevTime, monitorBaseParam.getErrorTimeCount())
|
||||
.or()
|
||||
.ge(PqDataVerifyBak::getVlDevTime, monitorBaseParam.getErrorTimeCount())
|
||||
.or()
|
||||
.ge(PqDataVerifyBak::getVThdTime, monitorBaseParam.getErrorTimeCount())
|
||||
.or()
|
||||
.ge(PqDataVerifyBak::getVTime, monitorBaseParam.getErrorTimeCount())
|
||||
.or()
|
||||
.ge(PqDataVerifyBak::getIRmsTime, monitorBaseParam.getErrorTimeCount())
|
||||
.or()
|
||||
.ge(PqDataVerifyBak::getPltTime, monitorBaseParam.getErrorTimeCount())
|
||||
.or()
|
||||
.ge(PqDataVerifyBak::getVInharmTime, monitorBaseParam.getErrorTimeCount())
|
||||
.or()
|
||||
.ge(PqDataVerifyBak::getVHarmTime, monitorBaseParam.getErrorTimeCount())
|
||||
.or()
|
||||
.ge(PqDataVerifyBak::getPfTime, monitorBaseParam.getErrorTimeCount())
|
||||
.or()
|
||||
.ge(PqDataVerifyBak::getVPhasicTime, monitorBaseParam.getErrorTimeCount())
|
||||
.or()
|
||||
.ge(PqDataVerifyBak::getV1PhasicTime, monitorBaseParam.getErrorTimeCount())
|
||||
.or()
|
||||
.ge(PqDataVerifyBak::getFlucTime, monitorBaseParam.getErrorTimeCount())
|
||||
.or()
|
||||
.ge(PqDataVerifyBak::getPstTime, monitorBaseParam.getErrorTimeCount())
|
||||
.or()
|
||||
.ge(PqDataVerifyBak::getDipTime, monitorBaseParam.getErrorTimeCount())
|
||||
.or()
|
||||
.ge(PqDataVerifyBak::getRiseTime, monitorBaseParam.getErrorTimeCount())
|
||||
)
|
||||
.groupBy(PqDataVerifyBak::getLineId);
|
||||
return this.list(queryWrapper);
|
||||
}
|
||||
@@ -515,102 +620,102 @@ public class PqDataVerifyBakServiceImpl extends ServiceImpl<PqDataVerifyBakMappe
|
||||
/**
|
||||
* 指标异常测点数量
|
||||
*/
|
||||
public List<VerifyTargetVO> getAbnormalTarget(List<PqDataVerifyBak> dataVerifyList) {
|
||||
public List<VerifyTargetVO> getAbnormalTarget(List<PqDataVerifyBak> dataVerifyList,Integer errorTimeCount) {
|
||||
List<VerifyTargetVO> result = new ArrayList<>();
|
||||
Map<String, PqReasonableRangeDto> rangeMap = getStandRange();
|
||||
rangeMap.forEach((key, dto) -> {
|
||||
Set<String> ids;
|
||||
switch (key) {
|
||||
case Param.freq:
|
||||
ids = dataVerifyList.stream().filter(it -> it.getFreq() > 0).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
ids = dataVerifyList.stream().filter(x-> ObjUtil.isNotNull(x.getFreqTime())).filter(it -> it.getFreqTime() > errorTimeCount).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
assembleEntity(ids, dto, result);
|
||||
break;
|
||||
case Param.freq_dev:
|
||||
ids = dataVerifyList.stream().filter(it -> it.getFreqDev() > 0).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
ids = dataVerifyList.stream().filter(x-> ObjUtil.isNotNull(x.getFreqDevTime())).filter(it -> it.getFreqDevTime() > errorTimeCount).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
assembleEntity(ids, dto, result);
|
||||
break;
|
||||
case Param.rms_v:
|
||||
ids = dataVerifyList.stream().filter(it -> it.getVRms() > 0).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
ids = dataVerifyList.stream().filter(x-> ObjUtil.isNotNull(x.getVRmsTime())).filter(it -> it.getVRmsTime() > errorTimeCount).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
assembleEntity(ids, dto, result);
|
||||
break;
|
||||
case Param.rms_lvr:
|
||||
ids = dataVerifyList.stream().filter(it -> it.getRmsLvr() > 0).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
ids = dataVerifyList.stream().filter(x-> ObjUtil.isNotNull(x.getRmsLvrTime())).filter(it -> it.getRmsLvrTime() > errorTimeCount).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
assembleEntity(ids, dto, result);
|
||||
break;
|
||||
case Param.vu_dev:
|
||||
ids = dataVerifyList.stream().filter(it -> it.getVuDev() > 0).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
ids = dataVerifyList.stream().filter(x-> ObjUtil.isNotNull(x.getVuDevTime())).filter(it -> it.getVuDevTime() > errorTimeCount).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
assembleEntity(ids, dto, result);
|
||||
break;
|
||||
case Param.vl_dev:
|
||||
ids = dataVerifyList.stream().filter(it -> it.getVlDev() > 0).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
ids = dataVerifyList.stream().filter(x-> ObjUtil.isNotNull(x.getVlDevTime())).filter(it -> it.getVlDevTime() > errorTimeCount).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
assembleEntity(ids, dto, result);
|
||||
break;
|
||||
case Param.rms_i:
|
||||
ids = dataVerifyList.stream().filter(it -> it.getIRms() > 0).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
ids = dataVerifyList.stream().filter(x-> ObjUtil.isNotNull(x.getIRmsTime())).filter(it -> it.getIRmsTime() > errorTimeCount).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
assembleEntity(ids, dto, result);
|
||||
break;
|
||||
case Param.v_thd:
|
||||
ids = dataVerifyList.stream().filter(it -> it.getVThd() > 0).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
ids = dataVerifyList.stream().filter(x-> ObjUtil.isNotNull(x.getVThdTime())).filter(it -> it.getVThdTime() > errorTimeCount).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
assembleEntity(ids, dto, result);
|
||||
break;
|
||||
case Param.v_1_v:
|
||||
ids = dataVerifyList.stream().filter(it -> it.getV() > 0).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
ids = dataVerifyList.stream().filter(x-> ObjUtil.isNotNull(x.getVTime())).filter(it -> it.getVTime() > errorTimeCount).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
assembleEntity(ids, dto, result);
|
||||
break;
|
||||
case Param.phasic_v_1:
|
||||
ids = dataVerifyList.stream().filter(it -> it.getV1Phasic() > 0).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
ids = dataVerifyList.stream().filter(x-> ObjUtil.isNotNull(x.getV1PhasicTime())).filter(it -> it.getV1PhasicTime() > errorTimeCount).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
assembleEntity(ids, dto, result);
|
||||
break;
|
||||
case Param.phasic_rate_x:
|
||||
ids = dataVerifyList.stream().filter(it -> it.getVPhasic() > 0).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
ids = dataVerifyList.stream().filter(x-> ObjUtil.isNotNull(x.getVPhasicTime())).filter(it -> it.getVPhasicTime() > errorTimeCount).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
assembleEntity(ids, dto, result);
|
||||
break;
|
||||
case Param.v_rate:
|
||||
ids = dataVerifyList.stream().filter(it -> it.getVHarm() > 0).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
ids = dataVerifyList.stream().filter(x-> ObjUtil.isNotNull(x.getVHarmTime())).filter(it -> it.getVHarmTime() > errorTimeCount).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
assembleEntity(ids, dto, result);
|
||||
break;
|
||||
case Param.in_v_rate:
|
||||
ids = dataVerifyList.stream().filter(it -> it.getVInharm() > 0).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
ids = dataVerifyList.stream().filter(x-> ObjUtil.isNotNull(x.getVInharmTime())).filter(it -> it.getVInharmTime() > errorTimeCount).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
assembleEntity(ids, dto, result);
|
||||
break;
|
||||
case Param.v_zero:
|
||||
ids = dataVerifyList.stream().filter(it -> it.getVZero() > 0).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
ids = dataVerifyList.stream().filter(x-> ObjUtil.isNotNull(x.getVZeroTime())).filter(it -> it.getVZeroTime() > errorTimeCount).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
assembleEntity(ids, dto, result);
|
||||
break;
|
||||
case Param.v_neg:
|
||||
ids = dataVerifyList.stream().filter(it -> it.getVNeg() > 0).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
ids = dataVerifyList.stream().filter(x-> ObjUtil.isNotNull(x.getVNegTime())).filter(it -> it.getVNegTime() > errorTimeCount).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
assembleEntity(ids, dto, result);
|
||||
break;
|
||||
case Param.v_pos:
|
||||
ids = dataVerifyList.stream().filter(it -> it.getVPos() > 0).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
ids = dataVerifyList.stream().filter(x-> ObjUtil.isNotNull(x.getVPosTime())).filter(it -> it.getVPosTime() > errorTimeCount).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
assembleEntity(ids, dto, result);
|
||||
break;
|
||||
case Param.v_unbalance:
|
||||
ids = dataVerifyList.stream().filter(it -> it.getVUnbalance() > 0).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
ids = dataVerifyList.stream().filter(x-> ObjUtil.isNotNull(x.getVUnbalanceTime())).filter(it -> it.getVUnbalanceTime() > errorTimeCount).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
assembleEntity(ids, dto, result);
|
||||
break;
|
||||
case Param.fluc:
|
||||
ids = dataVerifyList.stream().filter(it -> it.getFluc() > 0).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
ids = dataVerifyList.stream().filter(x-> ObjUtil.isNotNull(x.getFlucTime())).filter(it -> it.getFlucTime() > errorTimeCount).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
assembleEntity(ids, dto, result);
|
||||
break;
|
||||
case Param.pst:
|
||||
ids = dataVerifyList.stream().filter(it -> it.getPst() > 0).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
ids = dataVerifyList.stream().filter(x-> ObjUtil.isNotNull(x.getPstTime())).filter(it -> it.getPstTime() > errorTimeCount).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
assembleEntity(ids, dto, result);
|
||||
break;
|
||||
case Param.plt:
|
||||
ids = dataVerifyList.stream().filter(it -> it.getPlt() > 0).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
ids = dataVerifyList.stream().filter(x-> ObjUtil.isNotNull(x.getPltTime())).filter(it -> it.getPltTime() > errorTimeCount).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
assembleEntity(ids, dto, result);
|
||||
break;
|
||||
case Param.pf:
|
||||
ids = dataVerifyList.stream().filter(it -> it.getPf() > 0).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
ids = dataVerifyList.stream().filter(x-> ObjUtil.isNotNull(x.getPfTime())).filter(it -> it.getPfTime() > errorTimeCount).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
assembleEntity(ids, dto, result);
|
||||
break;
|
||||
case Param.Voltage_Dip:
|
||||
ids = dataVerifyList.stream().filter(it -> it.getDip() > 0).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
ids = dataVerifyList.stream().filter(x-> ObjUtil.isNotNull(x.getDipTime())).filter(it -> it.getDipTime() > errorTimeCount).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
assembleEntity(ids, dto, result);
|
||||
break;
|
||||
case Param.Voltage_Rise:
|
||||
ids = dataVerifyList.stream().filter(it -> it.getRise() > 0).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
ids = dataVerifyList.stream().filter(x-> ObjUtil.isNotNull(x.getRiseTime())).filter(it -> it.getRiseTime() > errorTimeCount).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
assembleEntity(ids, dto, result);
|
||||
break;
|
||||
default:
|
||||
|
||||
@@ -182,11 +182,17 @@ public class TerminalOnlineRateDataServiceImpl implements TerminalOnlineRateData
|
||||
type.add(generalDeviceDTO.getName()+"\n("+generalDeviceDTO.getLineIndexes().size()+")");
|
||||
//根据终端索引集查询在线率
|
||||
List<PublicDTO> onlineRateList = getCondition(deviceIndexes, onlineRateCensusParam.getSearchBeginTime(), onlineRateCensusParam.getSearchEndTime());
|
||||
single.add(onlineRateList.stream().mapToDouble(PublicDTO::getData).average().orElse(3.14159));
|
||||
// 汇总所有设备的在线分钟和离线分钟,再计算总在线率
|
||||
int totalOnlineMin = (int) onlineRateList.stream().mapToLong(PublicDTO::getOnlineMin).sum();
|
||||
int totalOfflineMin = (int) onlineRateList.stream().mapToLong(PublicDTO::getOfflineMin).sum();
|
||||
single.add(DataStatisticsUtil.calculateOnlineRate(totalOnlineMin, totalOfflineMin));
|
||||
//如果存在需要比较的时间,再获取对应数据
|
||||
if(StrUtil.isNotBlank(onlineRateCensusParam.getPeriodBeginTime()) && StrUtil.isNotBlank(onlineRateCensusParam.getPeriodEndTime())){
|
||||
List<PublicDTO> compareData = getCondition(deviceIndexes, onlineRateCensusParam.getPeriodBeginTime(), onlineRateCensusParam.getPeriodEndTime());
|
||||
ratio.add(compareData.stream().mapToDouble(PublicDTO::getData).average().orElse(3.14159));
|
||||
// 汇总所有设备的在线分钟和离线分钟,再计算总在线率
|
||||
int compareOnlineMin = (int) compareData.stream().mapToLong(PublicDTO::getOnlineMin).sum();
|
||||
int compareOfflineMin = (int) compareData.stream().mapToLong(PublicDTO::getOfflineMin).sum();
|
||||
ratio.add(DataStatisticsUtil.calculateOnlineRate(compareOnlineMin, compareOfflineMin));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -210,10 +216,12 @@ public class TerminalOnlineRateDataServiceImpl implements TerminalOnlineRateData
|
||||
if (CollUtil.isNotEmpty(data)) {
|
||||
data.forEach(po -> {
|
||||
PublicDTO publicDTO = new PublicDTO();
|
||||
//终端在线率 保留两位小数
|
||||
Double onlineRate = po.getOnlineRate() == null ? null : BigDecimal.valueOf(Double.parseDouble(po.getOnlineRate().toString())).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
|
||||
publicDTO.setId(po.getDevIndex());
|
||||
publicDTO.setData(DataStatisticsUtil.dataLimits(onlineRate));
|
||||
publicDTO.setOnlineMin(po.getOnlineMin() == null ? 0 : po.getOnlineMin().intValue());
|
||||
publicDTO.setOfflineMin(po.getOfflineMin() == null ? 0 : po.getOfflineMin().intValue());
|
||||
// 计算在线率
|
||||
Double onlineRate = DataStatisticsUtil.calculateOnlineRate(publicDTO.getOnlineMin(), publicDTO.getOfflineMin());
|
||||
publicDTO.setData(onlineRate);
|
||||
publicDTOList.add(publicDTO);
|
||||
});
|
||||
}
|
||||
@@ -321,14 +329,24 @@ public class TerminalOnlineRateDataServiceImpl implements TerminalOnlineRateData
|
||||
}
|
||||
}
|
||||
}
|
||||
Double devAvg = children.stream().filter(item -> item.getOnlineRate() != 3.14159).collect(Collectors.averagingDouble(TerminalOnlineRateDataVO::getOnlineRate));
|
||||
devItem.setOnlineRate(devAvg);
|
||||
// 汇总子节点的在线分钟和离线分钟,重新计算在线率
|
||||
int totalOnlineMin = (int) children.stream().filter(item -> item.getOnlineRate() != 3.14159).mapToLong(TerminalOnlineRateDataVO::getOnlineMin).sum();
|
||||
int totalOfflineMin = (int) children.stream().filter(item -> item.getOnlineRate() != 3.14159).mapToLong(TerminalOnlineRateDataVO::getOfflineMin).sum();
|
||||
devItem.setOnlineMin(totalOnlineMin);
|
||||
devItem.setOfflineMin(totalOfflineMin);
|
||||
devItem.setOnlineRate(DataStatisticsUtil.calculateOnlineRate(totalOnlineMin, totalOfflineMin));
|
||||
}
|
||||
}
|
||||
Double devAvg = devs.stream().filter(item -> item.getOnlineRate() != 3.14159).collect(Collectors.averagingDouble(TerminalOnlineRateDataVO::getOnlineRate));
|
||||
subItem.setOnlineRate(devAvg);
|
||||
// 汇总设备的在线分钟和离线分钟,重新计算变电站在线率
|
||||
int totalOnlineMin = (int)devs.stream().filter(item -> item.getOnlineRate() != 3.14159).mapToLong(TerminalOnlineRateDataVO::getOnlineMin).sum();
|
||||
int totalOfflineMin = (int)devs.stream().filter(item -> item.getOnlineRate() != 3.14159).mapToLong(TerminalOnlineRateDataVO::getOfflineMin).sum();
|
||||
subItem.setOnlineMin(totalOnlineMin);
|
||||
subItem.setOfflineMin(totalOfflineMin);
|
||||
subItem.setOnlineRate(DataStatisticsUtil.calculateOnlineRate(totalOnlineMin, totalOfflineMin));
|
||||
} else {
|
||||
subItem.setOnlineRate(3.14159);
|
||||
subItem.setOnlineMin(0);
|
||||
subItem.setOfflineMin(0);
|
||||
}
|
||||
if (Objects.nonNull(subItem.getAlgoDescribe())) {
|
||||
if (mapAlarm.containsKey(subItem.getAlgoDescribe())) {
|
||||
@@ -340,10 +358,16 @@ public class TerminalOnlineRateDataServiceImpl implements TerminalOnlineRateData
|
||||
}
|
||||
}
|
||||
}
|
||||
Double subAvg = subs.stream().filter(item -> item.getOnlineRate() != 3.14159).collect(Collectors.averagingDouble(TerminalOnlineRateDataVO::getOnlineRate));
|
||||
gdItem.setOnlineRate(subAvg);
|
||||
// 汇总变电站的在线分钟和离线分钟,重新计算供电公司在线率
|
||||
int totalOnlineMin = (int) subs.stream().filter(item -> item.getOnlineRate() != 3.14159).mapToLong(TerminalOnlineRateDataVO::getOnlineMin).sum();
|
||||
int totalOfflineMin = (int) subs.stream().filter(item -> item.getOnlineRate() != 3.14159).mapToLong(TerminalOnlineRateDataVO::getOfflineMin).sum();
|
||||
gdItem.setOnlineMin(totalOnlineMin);
|
||||
gdItem.setOfflineMin(totalOfflineMin);
|
||||
gdItem.setOnlineRate(DataStatisticsUtil.calculateOnlineRate(totalOnlineMin, totalOfflineMin));
|
||||
} else {
|
||||
gdItem.setOnlineRate(3.14159);
|
||||
gdItem.setOnlineMin(0);
|
||||
gdItem.setOfflineMin(0);
|
||||
}
|
||||
if (Objects.nonNull(gdItem.getAlgoDescribe())) {
|
||||
if (mapAlarm.containsKey(gdItem.getAlgoDescribe())) {
|
||||
@@ -355,10 +379,16 @@ public class TerminalOnlineRateDataServiceImpl implements TerminalOnlineRateData
|
||||
}
|
||||
}
|
||||
}
|
||||
Double gdAvg = gds.stream().filter(item -> item.getOnlineRate() != 3.14159).collect(Collectors.averagingDouble(TerminalOnlineRateDataVO::getOnlineRate));
|
||||
proItem.setOnlineRate(gdAvg);
|
||||
// 汇总供电公司的在线分钟和离线分钟,重新计算省会在线率
|
||||
int totalOnlineMin = (int) gds.stream().filter(item -> item.getOnlineRate() != 3.14159).mapToLong(TerminalOnlineRateDataVO::getOnlineMin).sum();
|
||||
int totalOfflineMin = (int) gds.stream().filter(item -> item.getOnlineRate() != 3.14159).mapToLong(TerminalOnlineRateDataVO::getOfflineMin).sum();
|
||||
proItem.setOnlineMin(totalOnlineMin);
|
||||
proItem.setOfflineMin(totalOfflineMin);
|
||||
proItem.setOnlineRate(DataStatisticsUtil.calculateOnlineRate(totalOnlineMin, totalOfflineMin));
|
||||
} else {
|
||||
proItem.setOnlineRate(3.14159);
|
||||
proItem.setOnlineMin(0);
|
||||
proItem.setOfflineMin(0);
|
||||
}
|
||||
if (Objects.nonNull(proItem.getAlgoDescribe())) {
|
||||
if (mapAlarm.containsKey(proItem.getAlgoDescribe()))
|
||||
|
||||
@@ -127,16 +127,26 @@ public class DataStatisticsUtil {
|
||||
for (TerminalOnlineRateData onlineRateData : terminalOnlineRateList) {
|
||||
if (onlineRateDataVO.getId().equals(onlineRateData.getDevId())) {
|
||||
flag = true;
|
||||
onlineRateDataVO.setOnlineRate( dataLimits(onlineRateData.getOnlineRate()));
|
||||
onlineRateDataVO.setOnlineMin(onlineRateData.getOnlineMin());
|
||||
onlineRateDataVO.setOfflineMin(onlineRateData.getOfflineMin());
|
||||
// 根据onlineMin和offlineMin计算在线率
|
||||
Double onlineRate = calculateOnlineRate(onlineRateData.getOnlineMin(), onlineRateData.getOfflineMin());
|
||||
onlineRateDataVO.setOnlineRate(onlineRate);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!flag) {
|
||||
onlineRateDataVO.setOnlineRate(3.14159);
|
||||
onlineRateDataVO.setOnlineMin(0);
|
||||
onlineRateDataVO.setOfflineMin(0);
|
||||
}
|
||||
}).collect(Collectors.toList());
|
||||
} else {
|
||||
deviceList = deviceList.stream().peek(onlineRateDataVO -> onlineRateDataVO.setOnlineRate(3.14159)).collect(Collectors.toList());
|
||||
deviceList = deviceList.stream().peek(onlineRateDataVO -> {
|
||||
onlineRateDataVO.setOnlineRate(3.14159);
|
||||
onlineRateDataVO.setOnlineMin(0);
|
||||
onlineRateDataVO.setOfflineMin(0);
|
||||
}).collect(Collectors.toList());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -149,6 +159,45 @@ public class DataStatisticsUtil {
|
||||
return data>100?100:data;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据在线分钟数和离线分钟数计算在线率
|
||||
* @param onlineMin 在线分钟数
|
||||
* @param offlineMin 离线分钟数
|
||||
* @return 在线率(保留两位小数,超过100则返回100)
|
||||
*/
|
||||
public static Double calculateOnlineRate(Integer onlineMin, Integer offlineMin) {
|
||||
if (onlineMin == null || offlineMin == null) {
|
||||
return 3.14159;
|
||||
}
|
||||
long totalMin = onlineMin + offlineMin;
|
||||
if (totalMin == 0) {
|
||||
return 3.14159;
|
||||
}
|
||||
double rate = onlineMin * 100.0 / totalMin;
|
||||
// 保留两位小数
|
||||
rate = Math.round(rate * 100.0) / 100.0;
|
||||
return dataLimits(rate);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据实际时间和期望时间计算数据完整性
|
||||
* @param realTime 实际时间
|
||||
* @param dueTime 期望时间
|
||||
* @return 数据完整性(保留两位小数,超过100则返回100)
|
||||
*/
|
||||
public static Double calculateIntegrityRate(Integer realTime, Integer dueTime) {
|
||||
if (realTime == null || dueTime == null) {
|
||||
return 3.14159;
|
||||
}
|
||||
if (dueTime == 0) {
|
||||
return 3.14159;
|
||||
}
|
||||
double rate = realTime * 100.0 / dueTime;
|
||||
// 保留两位小数
|
||||
rate = Math.round(rate * 100.0) / 100.0;
|
||||
return dataLimits(rate);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -123,7 +123,10 @@
|
||||
<bind name="searchValueLike" value="'%'+searchValue+'%'"/>
|
||||
AND (sub.NAME LIKE #{searchValueLike}
|
||||
OR dev.name LIKE #{searchValueLike}
|
||||
OR line.NAME LIKE #{searchValueLike})
|
||||
OR line.NAME LIKE #{searchValueLike}
|
||||
OR loadtypeId.Name LIKE #{searchValueLike}
|
||||
OR manufacturerId.name LIKE #{searchValueLike}
|
||||
)
|
||||
</if>
|
||||
ORDER BY
|
||||
gdName,
|
||||
|
||||
@@ -95,4 +95,6 @@ public interface DeptLineMapper extends BaseMapper<DeptLine> {
|
||||
List<SubGetBase> selectSubStationList(@Param("param") SubstationParam substationParam);
|
||||
|
||||
List<String> getLineByDeptIdAndNewStation(@Param("ids") List<String> id,@Param("dictTree")List<String> dictTree);
|
||||
|
||||
List<DeptLine> getOnlineMonitor();
|
||||
}
|
||||
|
||||
@@ -300,4 +300,16 @@
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="getOnlineMonitor" resultType="DeptLine">
|
||||
select
|
||||
t1.Line_Id lineId,
|
||||
t1.Id id
|
||||
from
|
||||
pq_dept_line t1,
|
||||
pq_line_detail t2
|
||||
where
|
||||
t1.Line_Id = t2.Id and t2.Run_Flag = 0
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
@@ -19,7 +19,9 @@
|
||||
<select id="getOnIntegrityByIds" resultType="com.njcn.device.pq.pojo.vo.RStatIntegrityVO">
|
||||
SELECT
|
||||
line_index AS lineIndex,
|
||||
ROUND(sum( real_time )*1.0 / sum( due_time ) * 100,2) AS integrityRate
|
||||
sum(real_time) AS realTime,
|
||||
sum(due_time) AS dueTime,
|
||||
ROUND(sum( real_time )*100.0 / sum( due_time ) ,2) AS integrityRate
|
||||
FROM
|
||||
r_stat_integrity_d
|
||||
<where>
|
||||
|
||||
@@ -36,10 +36,10 @@ public class TransientParam extends DeviceInfoParam.BusinessParam {
|
||||
private BigDecimal eventValueMin;
|
||||
|
||||
@ApiModelProperty("持续时间最大值")
|
||||
private Integer persistMax;
|
||||
private Double persistMax;
|
||||
|
||||
@ApiModelProperty("持续时间最小值")
|
||||
private Integer persistMin;
|
||||
private Double persistMin;
|
||||
|
||||
@ApiModelProperty("严重度最大值")
|
||||
private BigDecimal severityMax;
|
||||
|
||||
@@ -526,6 +526,7 @@ public class TransientServiceImpl implements TransientService {
|
||||
log.info("cfg-----"+cfgPath);
|
||||
log.info("cfg-----"+datPath);
|
||||
|
||||
|
||||
//判断文件是否存在
|
||||
File file = new File(cfgPath);
|
||||
if(!file.exists()){
|
||||
@@ -540,6 +541,8 @@ public class TransientServiceImpl implements TransientService {
|
||||
log.info("cfg-----"+cfgPath);
|
||||
log.info("cfg-----"+datPath);
|
||||
cfgStream = waveFileComponent.getFileInputStreamByFilePath(cfgPath);
|
||||
datStream = waveFileComponent.getFileInputStreamByFilePath(datPath);
|
||||
|
||||
} else {
|
||||
cfgPath = OssPath.WAVE_DIR + ip + StrUtil.SLASH + waveName + GeneralConstant.CFG;
|
||||
boolean result1 = minIoUtils.checkFileIsExist(minIossProperties.getBucket(), cfgPath);
|
||||
|
||||
@@ -81,33 +81,56 @@ public class SteadyQualifyServiceImpl implements SteadyQualifyService {
|
||||
|
||||
@Override
|
||||
public SteadyQualifyCensusVO getSteadyQualifyCensus(DeviceInfoParam.BusinessParam steadyCensusParam) {
|
||||
List<SteadyQualifyVO> steadyQualifyList = getSteadyQualifyData(steadyCensusParam);
|
||||
SteadyQualifyCensusVO steadyQualifyCensusVO = new SteadyQualifyCensusVO();
|
||||
List<String> type = new ArrayList<>();
|
||||
//按照条件获取实际运行终端综合信息
|
||||
List<GeneralDeviceDTO> deviceDataList = generalDeviceInfoClient.getPracticalRunDeviceInfo(steadyCensusParam).getData();
|
||||
List<Double> harmonicVoltage = new ArrayList<>(), voltageOffset = new ArrayList<>(),
|
||||
VoltageUnbalance = new ArrayList<>(), interHarmonic = new ArrayList<>(),
|
||||
harmonicCurrent = new ArrayList<>(), negativeCurrent = new ArrayList<>(),
|
||||
freqOffset = new ArrayList<>(), flicker = new ArrayList<>();
|
||||
if (!CollectionUtils.isEmpty(deviceDataList)) {
|
||||
for (GeneralDeviceDTO generalDeviceDTO : deviceDataList) {
|
||||
List<String> lineIndexes = generalDeviceDTO.getLineIndexes();
|
||||
if (CollectionUtils.isEmpty(lineIndexes)) {
|
||||
continue;
|
||||
}
|
||||
type.add(generalDeviceDTO.getName() + "\n(" + generalDeviceDTO.getLineIndexes().size() + ")");
|
||||
List<RStatLimitRateDPO> qualifiesRate = getQualifiesRate(lineIndexes, steadyCensusParam.getSearchBeginTime(), steadyCensusParam.getSearchEndTime());
|
||||
SteadyQualifyVO dataMoreMonitorMoreDay = getDataMoreMonitorMoreDay(qualifiesRate);
|
||||
harmonicVoltage.add(dataMoreMonitorMoreDay.getHarmonicVoltage());
|
||||
voltageOffset.add(dataMoreMonitorMoreDay.getVoltageOffset());
|
||||
VoltageUnbalance.add(dataMoreMonitorMoreDay.getVoltageUnbalance());
|
||||
interHarmonic.add(dataMoreMonitorMoreDay.getInterHarmonic());
|
||||
harmonicCurrent.add(dataMoreMonitorMoreDay.getHarmonicCurrent());
|
||||
negativeCurrent.add(dataMoreMonitorMoreDay.getNegativeCurrent());
|
||||
freqOffset.add(dataMoreMonitorMoreDay.getFreqOffset());
|
||||
flicker.add(dataMoreMonitorMoreDay.getFlicker());
|
||||
if (CollUtil.isNotEmpty(steadyQualifyList)) {
|
||||
for (SteadyQualifyVO steadyQualifyVO : steadyQualifyList) {
|
||||
// 还需要递归出有多少个测点
|
||||
int lineNum = seekLineNum(steadyQualifyVO);
|
||||
type.add(steadyQualifyVO.getName() + "\n(" + lineNum + ")");
|
||||
harmonicVoltage.add(steadyQualifyVO.getHarmonicVoltage());
|
||||
voltageOffset.add(steadyQualifyVO.getVoltageOffset());
|
||||
VoltageUnbalance.add(steadyQualifyVO.getVoltageUnbalance());
|
||||
interHarmonic.add(steadyQualifyVO.getInterHarmonic());
|
||||
harmonicCurrent.add(steadyQualifyVO.getHarmonicCurrent());
|
||||
negativeCurrent.add(steadyQualifyVO.getNegativeCurrent());
|
||||
freqOffset.add(steadyQualifyVO.getFreqOffset());
|
||||
flicker.add(steadyQualifyVO.getFlicker());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// List<String> type = new ArrayList<>();
|
||||
// //按照条件获取实际运行终端综合信息
|
||||
// List<GeneralDeviceDTO> deviceDataList = generalDeviceInfoClient.getPracticalRunDeviceInfo(steadyCensusParam).getData();
|
||||
// List<Double> harmonicVoltage = new ArrayList<>(), voltageOffset = new ArrayList<>(),
|
||||
// VoltageUnbalance = new ArrayList<>(), interHarmonic = new ArrayList<>(),
|
||||
// harmonicCurrent = new ArrayList<>(), negativeCurrent = new ArrayList<>(),
|
||||
// freqOffset = new ArrayList<>(), flicker = new ArrayList<>();
|
||||
// if (!CollectionUtils.isEmpty(deviceDataList)) {
|
||||
// for (GeneralDeviceDTO generalDeviceDTO : deviceDataList) {
|
||||
// List<String> lineIndexes = generalDeviceDTO.getLineIndexes();
|
||||
// if (CollectionUtils.isEmpty(lineIndexes)) {
|
||||
// continue;
|
||||
// }
|
||||
// type.add(generalDeviceDTO.getName() + "\n(" + generalDeviceDTO.getLineIndexes().size() + ")");
|
||||
// List<RStatLimitRateDPO> qualifiesRate = getQualifiesRate(lineIndexes, steadyCensusParam.getSearchBeginTime(), steadyCensusParam.getSearchEndTime());
|
||||
// SteadyQualifyVO dataMoreMonitorMoreDay = getDataMoreMonitorMoreDay(qualifiesRate);
|
||||
// harmonicVoltage.add(dataMoreMonitorMoreDay.getHarmonicVoltage());
|
||||
// voltageOffset.add(dataMoreMonitorMoreDay.getVoltageOffset());
|
||||
// VoltageUnbalance.add(dataMoreMonitorMoreDay.getVoltageUnbalance());
|
||||
// interHarmonic.add(dataMoreMonitorMoreDay.getInterHarmonic());
|
||||
// harmonicCurrent.add(dataMoreMonitorMoreDay.getHarmonicCurrent());
|
||||
// negativeCurrent.add(dataMoreMonitorMoreDay.getNegativeCurrent());
|
||||
// freqOffset.add(dataMoreMonitorMoreDay.getFreqOffset());
|
||||
// flicker.add(dataMoreMonitorMoreDay.getFlicker());
|
||||
// }
|
||||
// }
|
||||
steadyQualifyCensusVO.setHarmonicVoltage(harmonicVoltage);
|
||||
steadyQualifyCensusVO.setVoltageOffset(voltageOffset);
|
||||
steadyQualifyCensusVO.setVoltageUnbalance(VoltageUnbalance);
|
||||
@@ -121,6 +144,25 @@ public class SteadyQualifyServiceImpl implements SteadyQualifyService {
|
||||
return steadyQualifyCensusVO;
|
||||
}
|
||||
|
||||
/**
|
||||
* 递归出有多少个测点
|
||||
*
|
||||
* @param steadyQualifyVO 最上层的信息
|
||||
*/
|
||||
private int seekLineNum(SteadyQualifyVO steadyQualifyVO) {
|
||||
List<SteadyQualifyVO> children = steadyQualifyVO.getChildren();
|
||||
// 如果没有子节点,说明当前就是最底层节点,计数1
|
||||
if (children == null || children.isEmpty()) {
|
||||
return 1;
|
||||
}
|
||||
// 如果有子节点,递归计算所有子节点的最底层节点总数
|
||||
int total = 0;
|
||||
for (SteadyQualifyVO child : children) {
|
||||
total += seekLineNum(child);
|
||||
}
|
||||
return total;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SteadyQualifyVO> getEnterpriseSteadyQualify(DeviceInfoParam.BusinessParam steadyParam) {
|
||||
List<SteadyQualifyVO> steadyQualifyList = new ArrayList<>();
|
||||
@@ -365,7 +407,7 @@ public class SteadyQualifyServiceImpl implements SteadyQualifyService {
|
||||
steadyQualifyDTO.getIharm24Overtime() +
|
||||
steadyQualifyDTO.getIharm25Overtime())));
|
||||
//间谐波电压含有率
|
||||
steadyQualifyVO.setInterHarmonic(calculateIN(steadyQualifyDTO.getAllTime()*16, (steadyQualifyDTO.getInuharm1Overtime() +
|
||||
steadyQualifyVO.setInterHarmonic(calculateIN(steadyQualifyDTO.getAllTime() * 16, (steadyQualifyDTO.getInuharm1Overtime() +
|
||||
steadyQualifyDTO.getInuharm2Overtime() +
|
||||
steadyQualifyDTO.getInuharm3Overtime() +
|
||||
steadyQualifyDTO.getInuharm4Overtime() +
|
||||
@@ -497,7 +539,7 @@ public class SteadyQualifyServiceImpl implements SteadyQualifyService {
|
||||
return 3.14159;
|
||||
} else {
|
||||
if (allTime >= overTime) {
|
||||
return NumberUtil.round((1 - ((double) overTime /allTime)) * 100, 2).doubleValue();
|
||||
return NumberUtil.round((1 - ((double) overTime / allTime)) * 100, 2).doubleValue();
|
||||
}
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@ import com.njcn.harmonic.mapper.THDistortionMapper;
|
||||
import com.njcn.harmonic.pojo.dto.PublicDTO;
|
||||
import com.njcn.harmonic.pojo.po.RMpVThd;
|
||||
import com.njcn.harmonic.pojo.vo.RMpVThdVO;
|
||||
import com.njcn.harmonic.pojo.vo.SteadyQualifyVO;
|
||||
import com.njcn.harmonic.pojo.vo.THDistortionCensusVO;
|
||||
import com.njcn.harmonic.pojo.vo.THDistortionVO;
|
||||
import com.njcn.harmonic.service.THDistortionService;
|
||||
@@ -102,20 +103,23 @@ public class THDistortionServiceImpl implements THDistortionService {
|
||||
|
||||
@Override
|
||||
public THDistortionCensusVO getTHDistortionCensus(DeviceInfoParam.BusinessParam thDistortionCensusParam) {
|
||||
List<THDistortionVO> thDistortionVOS = getTHDistortionData(thDistortionCensusParam, 0);
|
||||
|
||||
THDistortionCensusVO distortionCensusVO = new THDistortionCensusVO();
|
||||
thDistortionCensusParam.setServerName(generalInfo.getMicroServiceName());
|
||||
List<GeneralDeviceDTO> generalDeviceDTOList = generalDeviceInfoClient.getPracticalRunDeviceInfo(thDistortionCensusParam).getData();
|
||||
// thDistortionCensusParam.setServerName(generalInfo.getMicroServiceName());
|
||||
// List<GeneralDeviceDTO> generalDeviceDTOList = generalDeviceInfoClient.getPracticalRunDeviceInfo(thDistortionCensusParam).getData();
|
||||
List<String> type = new ArrayList<>();
|
||||
List<Double> single = new ArrayList<>();
|
||||
if (!CollectionUtils.isEmpty(generalDeviceDTOList)) {
|
||||
for (GeneralDeviceDTO generalDeviceDTO : generalDeviceDTOList) {
|
||||
List<String> lineIndexes = generalDeviceDTO.getLineIndexes();
|
||||
if (CollectionUtils.isEmpty(lineIndexes)) {
|
||||
continue;
|
||||
}
|
||||
type.add(generalDeviceDTO.getName() + "\n(" + generalDeviceDTO.getLineIndexes().size() + ")");
|
||||
List<PublicDTO> condition = getCondition(lineIndexes, thDistortionCensusParam.getSearchBeginTime(), thDistortionCensusParam.getSearchEndTime());
|
||||
single.add(roundHalfUp(condition.stream().mapToDouble(PublicDTO::getData).average().orElse(3.14159)));
|
||||
if (!CollectionUtils.isEmpty(thDistortionVOS)) {
|
||||
for (THDistortionVO thDistortionVO : thDistortionVOS) {
|
||||
// List<String> lineIndexes = generalDeviceDTO.getLineIndexes();
|
||||
// if (CollectionUtils.isEmpty(lineIndexes)) {
|
||||
// continue;
|
||||
// }
|
||||
// type.add(thDistortionVO.getName() + "\n(" + seekLineNum(thDistortionVO) + ")");
|
||||
type.add(thDistortionVO.getName() );
|
||||
// List<PublicDTO> condition = getCondition(lineIndexes, thDistortionCensusParam.getSearchBeginTime(), thDistortionCensusParam.getSearchEndTime());
|
||||
single.add(thDistortionVO.getDistortion());
|
||||
}
|
||||
distortionCensusVO.setType(type);
|
||||
distortionCensusVO.setSingle(single);
|
||||
@@ -123,6 +127,25 @@ public class THDistortionServiceImpl implements THDistortionService {
|
||||
return distortionCensusVO;
|
||||
}
|
||||
|
||||
/**
|
||||
* 递归出有多少个测点
|
||||
*
|
||||
* @param thDistortionVO 最上层的信息
|
||||
*/
|
||||
private int seekLineNum(THDistortionVO thDistortionVO) {
|
||||
List<THDistortionVO> children = thDistortionVO.getChildren();
|
||||
// 如果没有子节点,说明当前就是最底层节点,计数1
|
||||
if (children == null || children.isEmpty()) {
|
||||
return 1;
|
||||
}
|
||||
// 如果有子节点,递归计算所有子节点的最底层节点总数
|
||||
int total = 0;
|
||||
for (THDistortionVO child : children) {
|
||||
total += seekLineNum(child);
|
||||
}
|
||||
return total;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param statisticsBizBaseParam
|
||||
* @Description: 谐波总畸变率前十列表
|
||||
|
||||
@@ -23,6 +23,7 @@ public class UserReportNormalParam extends BaseParam {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private String id;
|
||||
|
||||
@ApiModelProperty(value = "保存1,提交审批2")
|
||||
private String saveOrCheckflag;
|
||||
/**
|
||||
@@ -40,6 +41,11 @@ public class UserReportNormalParam extends BaseParam {
|
||||
*/
|
||||
private String reportUrl;
|
||||
|
||||
/**
|
||||
* 治理方案仿真校验评估报告
|
||||
*/
|
||||
private String simulationReportUrl;
|
||||
|
||||
/**
|
||||
* 1:审批中;2:审批通过;3:审批不通过;4:已取消
|
||||
*/
|
||||
|
||||
@@ -155,6 +155,7 @@ public class UserReportParam {
|
||||
|
||||
private UserReportSubstationPO userReportSubstationPO;
|
||||
|
||||
private String secondAssessmentId;
|
||||
|
||||
/**
|
||||
* 流程实例的编号
|
||||
|
||||
@@ -37,6 +37,12 @@ public class UserReportNormalPO extends BaseEntity {
|
||||
*/
|
||||
private String reportUrl;
|
||||
|
||||
/**
|
||||
* 治理方案仿真校验评估报告
|
||||
*/
|
||||
private String simulationReportUrl;
|
||||
|
||||
|
||||
private String processInstanceId;
|
||||
|
||||
private String historyInstanceId;
|
||||
|
||||
@@ -121,6 +121,9 @@ public class WarningLeafletVO extends BaseEntity implements Serializable{
|
||||
@ApiModelProperty("预告警单下载路径")
|
||||
private String filePath;
|
||||
|
||||
@ApiModelProperty("实际路径")
|
||||
private String absFilePath;
|
||||
|
||||
@ApiModelProperty("技术监督报告")
|
||||
private String supervisionReport;
|
||||
|
||||
|
||||
@@ -23,4 +23,9 @@ public class UserLedgerVO implements Serializable {
|
||||
|
||||
private String city;
|
||||
|
||||
@Data
|
||||
public static class AssessMent extends UserLedgerVO{
|
||||
|
||||
private String secondAssessmentId;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -209,6 +209,9 @@ public class UserReportVO {
|
||||
@ApiModelProperty(value = "入网评估报告和治理报告的文件路径名")
|
||||
private String otherReport;
|
||||
|
||||
@ApiModelProperty(value = "仿真治理评估告")
|
||||
private String simulationReport;
|
||||
|
||||
private String userReportId;
|
||||
}
|
||||
|
||||
@@ -221,5 +224,8 @@ public class UserReportVO {
|
||||
|
||||
@ApiModelProperty(value = "治理评估告")
|
||||
private List<String> governReport;
|
||||
|
||||
@ApiModelProperty(value = "仿真治理评估告")
|
||||
private List<String> simulationReport;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -293,7 +293,6 @@ public class UserReportManageController extends BaseController {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, userReportByIds, methodDescribe);
|
||||
}
|
||||
|
||||
//根据部门查询敏感用户信息
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/getSensitiveUserByDept")
|
||||
@ApiOperation("根据部门获取敏感用户信息")
|
||||
@@ -304,4 +303,21 @@ public class UserReportManageController extends BaseController {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@GetMapping("/bindAssessmentId")
|
||||
@ApiOperation("根据用户id绑定二级评估id")
|
||||
public HttpResult<Boolean> bindAssessmentId(@RequestParam("userReportId") String userReportId,@RequestParam("assessMentId") String assessMentId) {
|
||||
String methodDescribe = getMethodDescribe("bindAssessmentId");
|
||||
Boolean b = userReportPOService.bindAssessmentId(userReportId, assessMentId);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, b, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/selectUserAssessMentList")
|
||||
@ApiOperation("二级评估查询用户接口")
|
||||
public HttpResult<List<UserLedgerVO.AssessMent>> selectUserAssessMentList(@RequestBody UserReportParam userReportParam) {
|
||||
String methodDescribe = getMethodDescribe("selectUserAssessMentList");
|
||||
List<UserLedgerVO.AssessMent> userReportPOS = userReportPOService.selectUserAssessMentList(userReportParam);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, userReportPOS, methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -160,12 +160,15 @@ public class LineWarningServiceImpl extends MppServiceImpl<LineWarningMapper, Li
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void addHeBeiNorthLineWarning(String startTime, String endTime) {
|
||||
List<LineWarning> result = new ArrayList<>();
|
||||
List<LineWarning> channelData = new ArrayList<>();
|
||||
//获取指标集合(10个指标)
|
||||
List<DictData> dataList = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.STEADY_STATIS.getCode()).getData();
|
||||
Map<String, DictData> targetMap = dataList.stream().collect(Collectors.toMap(DictData::getCode, Function.identity()));
|
||||
//获取监测点和部门表关系
|
||||
List<DeptLine> deptLines = deptLineFeignClient.getAllData().getData();
|
||||
Map<String, List<DeptLine>> deptLineMap = deptLines.stream().collect(Collectors.groupingBy(DeptLine::getLineId));
|
||||
// Map<String, List<DeptLine>> deptLineMap = deptLines.stream().collect(Collectors.groupingBy(DeptLine::getLineId));
|
||||
Map<String, DeptLine> deptLineMap = deptLines.stream().collect(Collectors.toMap(DeptLine::getLineId, Function.identity()));
|
||||
|
||||
//获取监测点按时间统计越限天数
|
||||
LocalDate firstDayOfMonth = Objects.isNull(startTime) ? LocalDate.now().minusDays(1).with(TemporalAdjusters.firstDayOfMonth()) : LocalDate.parse(startTime);
|
||||
String date = Objects.isNull(startTime) ? DateUtil.format(firstDayOfMonth.atStartOfDay(), DatePattern.NORM_DATE_PATTERN) : startTime;
|
||||
@@ -175,7 +178,7 @@ public class LineWarningServiceImpl extends MppServiceImpl<LineWarningMapper, Li
|
||||
//按各指标统计越限天数
|
||||
if (CollUtil.isNotEmpty(limitTarget)) {
|
||||
limitTarget.forEach(item -> {
|
||||
String deptId = Objects.isNull(deptLineMap.get(item.getLineId())) ? null : deptLineMap.get(item.getLineId()).get(0).getId();
|
||||
String deptId = Objects.isNull(deptLineMap.get(item.getLineId())) ? null : deptLineMap.get(item.getLineId()).getId();
|
||||
//频率偏差
|
||||
LineWarning l1 = overData(firstDayOfMonth, item.getLineId(), deptId, targetMap.get(DicDataEnum.FREQUENCY_DEV.getCode()).getId(), item.getFreqDevOvertime());
|
||||
//电压偏差
|
||||
@@ -206,7 +209,7 @@ public class LineWarningServiceImpl extends MppServiceImpl<LineWarningMapper, Li
|
||||
List<OnlineMonitorVo> list = lineIntegrityClient.getNoData(param).getData();
|
||||
if (CollUtil.isNotEmpty(list)) {
|
||||
list.forEach(item -> {
|
||||
String deptId = Objects.isNull(deptLineMap.get(item.getLineId())) ? null : deptLineMap.get(item.getLineId()).get(0).getId();
|
||||
String deptId = Objects.isNull(deptLineMap.get(item.getLineId())) ? null : deptLineMap.get(item.getLineId()).getId();
|
||||
LineWarning lineWarning = new LineWarning();
|
||||
lineWarning.setAlarmTime(firstDayOfMonth);
|
||||
lineWarning.setDeptId(deptId);
|
||||
@@ -220,7 +223,7 @@ public class LineWarningServiceImpl extends MppServiceImpl<LineWarningMapper, Li
|
||||
List<OnlineMonitorVo> list2 = pqDataVerifyCountClient.getAnomalousData(param).getData();
|
||||
if (CollUtil.isNotEmpty(list2)) {
|
||||
list2.forEach(item -> {
|
||||
String deptId = Objects.isNull(deptLineMap.get(item.getLineId())) ? null : deptLineMap.get(item.getLineId()).get(0).getId();
|
||||
String deptId = Objects.isNull(deptLineMap.get(item.getLineId())) ? null : deptLineMap.get(item.getLineId()).getId();
|
||||
LineWarning lineWarning = new LineWarning();
|
||||
lineWarning.setAlarmTime(firstDayOfMonth);
|
||||
lineWarning.setDeptId(deptId);
|
||||
@@ -230,8 +233,37 @@ public class LineWarningServiceImpl extends MppServiceImpl<LineWarningMapper, Li
|
||||
result.add(lineWarning);
|
||||
});
|
||||
}
|
||||
//获取时间范围内数据库的数据,然后仅替换累计超标时间
|
||||
LambdaQueryWrapper<LineWarning> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.between(LineWarning::getAlarmTime,date,endDate);
|
||||
List<LineWarning> oldData = this.list(lambdaQueryWrapper);
|
||||
if (CollUtil.isNotEmpty(oldData) && CollUtil.isNotEmpty(result)) {
|
||||
// 创建结果数据的查找Map
|
||||
Map<String, LineWarning> resultMap = result.stream()
|
||||
.collect(Collectors.toMap(
|
||||
item -> buildKey(item.getDeptId(), item.getLineId(), item.getTargetType()),
|
||||
Function.identity()
|
||||
));
|
||||
for (LineWarning oldItem : oldData) {
|
||||
String key = buildKey(oldItem.getDeptId(), oldItem.getLineId(), oldItem.getTargetType());
|
||||
LineWarning matchingResult = resultMap.get(key);
|
||||
if (matchingResult != null) {
|
||||
oldItem.setOverLimitDay(matchingResult.getOverLimitDay());
|
||||
oldItem.setUpdateTime(LocalDateTime.now());
|
||||
channelData.add(oldItem);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (CollUtil.isNotEmpty(channelData)) {
|
||||
this.saveOrUpdateBatchByMultiId(channelData);
|
||||
} else {
|
||||
this.saveOrUpdateBatchByMultiId(result);
|
||||
}
|
||||
}
|
||||
|
||||
this.saveOrUpdateBatchByMultiId(result);
|
||||
|
||||
private static String buildKey(String deptId, String lineId, String targetType) {
|
||||
return deptId + "|" + lineId + "|" + targetType;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -163,7 +163,9 @@ public class WarningLeafletServiceImpl extends ServiceImpl<WarningLeafletMapper,
|
||||
x.setDutyOrgName(deptMap.get(x.getDutyOrgId()));
|
||||
}
|
||||
if (!Objects.isNull(x.getFilePath())) {
|
||||
x.setAbsFilePath(x.getFilePath());
|
||||
x.setFilePath(fileStorageUtil.getFileUrl(x.getFilePath()));
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -393,6 +395,8 @@ public class WarningLeafletServiceImpl extends ServiceImpl<WarningLeafletMapper,
|
||||
record.setDutyOrgName(deptMap.get(record.getDutyOrgId()));
|
||||
}
|
||||
if (!Objects.isNull(record.getFilePath())) {
|
||||
record.setAbsFilePath(record.getFilePath());
|
||||
|
||||
record.setFilePath(fileStorageUtil.getFileUrl(record.getFilePath()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -73,4 +73,7 @@ public interface UserReportPOService extends IBpmService<UserReportPO> {
|
||||
|
||||
List<UserReportPO> getSensitiveUserByDept(SensitiveUserParam param);
|
||||
|
||||
Boolean bindAssessmentId(String userReportId,String assessMentId);
|
||||
|
||||
List<UserLedgerVO.AssessMent> selectUserAssessMentList(UserReportParam userReportParam);
|
||||
}
|
||||
|
||||
@@ -68,7 +68,6 @@ public class UserReportNormalServiceImpl extends ServiceImpl<UserReportNormalMap
|
||||
userReportNormalPO.setState(DataStateEnum.ENABLE.getCode());
|
||||
if (Objects.equals(userReportNormalParam.getSaveOrCheckflag(), "1")) {
|
||||
userReportNormalPO.setStatus(BpmTaskStatusEnum.WAIT.getStatus());
|
||||
|
||||
} else {
|
||||
userReportNormalPO.setStatus(BpmTaskStatusEnum.RUNNING.getStatus());
|
||||
|
||||
@@ -154,6 +153,7 @@ public class UserReportNormalServiceImpl extends ServiceImpl<UserReportNormalMap
|
||||
vo.setId(item.getId());
|
||||
vo.setUserReportId(item.getUserReportId());
|
||||
vo.setOtherReport(item.getReportUrl());
|
||||
vo.setSimulationReport(item.getSimulationReportUrl());
|
||||
vo.setProcessInstanceId(item.getProcessInstanceId());
|
||||
vo.setCreateTime(item.getCreateTime());
|
||||
vo.setStatus(item.getStatus());
|
||||
@@ -175,6 +175,7 @@ public class UserReportNormalServiceImpl extends ServiceImpl<UserReportNormalMap
|
||||
BeanUtil.copyProperties(userReportPO, vo);
|
||||
BeanUtil.copyProperties(userReportNormalPO, vo);
|
||||
vo.setOtherReport(userReportNormalPO.getReportUrl());
|
||||
vo.setSimulationReport(userReportNormalPO.getSimulationReportUrl());
|
||||
return vo;
|
||||
}
|
||||
return null;
|
||||
@@ -278,8 +279,10 @@ public class UserReportNormalServiceImpl extends ServiceImpl<UserReportNormalMap
|
||||
);
|
||||
Optional<String> netInReport = list.stream().filter(x -> 0 == x.getType()).map(UserReportNormalPO::getReportUrl).findFirst();
|
||||
Optional<String> governReport = list.stream().filter(x -> 1 == x.getType()).map(UserReportNormalPO::getReportUrl).findFirst();
|
||||
Optional<String> simulationReport = list.stream().filter(x -> 1 == x.getType()).map(UserReportNormalPO::getSimulationReportUrl).findFirst();
|
||||
userReportVO.setNetInReport(Collections.singletonList(netInReport.orElse(null)));
|
||||
userReportVO.setGovernReport(Collections.singletonList(governReport.orElse(null)));
|
||||
userReportVO.setSimulationReport(Collections.singletonList(simulationReport.orElse(null)));
|
||||
return userReportVO;
|
||||
}
|
||||
|
||||
|
||||
@@ -129,7 +129,7 @@ public class UserReportPOServiceImpl extends ServiceImpl<UserReportPOMapper, Use
|
||||
if (ObjectUtil.isNotNull(userReportParam.getDataType())) {
|
||||
userReportPO.setDataType(userReportParam.getDataType());
|
||||
if (userReportParam.getDataType() == 1) {
|
||||
if (UserNatureEnum.SENSITIVE_USER.getCode().equals(userReportParam.getUserType())){
|
||||
if (UserNatureEnum.SENSITIVE_USER.getCode().equals(userReportParam.getUserType())) {
|
||||
userReportPO.setStatus(BpmTaskStatusEnum.APPROVE.getStatus());
|
||||
}
|
||||
}
|
||||
@@ -246,7 +246,7 @@ public class UserReportPOServiceImpl extends ServiceImpl<UserReportPOMapper, Use
|
||||
Map<String, Object> processInstanceVariables = new HashMap<>(16);
|
||||
BpmProcessInstanceCreateReqDTO bpmProcessInstanceCreateReqDTO = new BpmProcessInstanceCreateReqDTO();
|
||||
String key = SupervisionKeyEnum.BUILD_USER_INFO.getKey();
|
||||
if(ObjectUtil.isNotNull(userReportPO.getDataType())){
|
||||
if (ObjectUtil.isNotNull(userReportPO.getDataType())) {
|
||||
//干扰源用户台账和敏感用户审核流程
|
||||
if (userReportPO.getDataType() == 1) {
|
||||
key = SupervisionKeyEnum.BUILD_USER_INFO_ARCHIVIST.getKey();
|
||||
@@ -327,7 +327,7 @@ public class UserReportPOServiceImpl extends ServiceImpl<UserReportPOMapper, Use
|
||||
userReportVOQueryWrapper.in("supervision_user_report.city", userReportQueryParam.getCity());
|
||||
}
|
||||
userReportVOQueryWrapper
|
||||
.and(CollUtil.isNotEmpty(InstanceUtil.filterTaskStatus()),w -> w.in("supervision_user_report.status", InstanceUtil.filterTaskStatus())
|
||||
.and(CollUtil.isNotEmpty(InstanceUtil.filterTaskStatus()), w -> w.in("supervision_user_report.status", InstanceUtil.filterTaskStatus())
|
||||
.or()
|
||||
.eq("supervision_user_report.create_by", RequestUtil.getUserIndex())
|
||||
);
|
||||
@@ -420,8 +420,10 @@ public class UserReportPOServiceImpl extends ServiceImpl<UserReportPOMapper, Use
|
||||
);
|
||||
Optional<String> netInReport = list.stream().filter(x -> 0 == x.getType()).map(UserReportNormalPO::getReportUrl).findFirst();
|
||||
Optional<String> governReport = list.stream().filter(x -> 1 == x.getType()).map(UserReportNormalPO::getReportUrl).findFirst();
|
||||
Optional<String> simulationReport = list.stream().filter(x -> 1 == x.getType()).map(UserReportNormalPO::getSimulationReportUrl).findFirst();
|
||||
userReportVO.setNetInReport(Collections.singletonList(netInReport.orElse(null)));
|
||||
userReportVO.setGovernReport(Collections.singletonList(governReport.orElse(null)));
|
||||
userReportVO.setSimulationReport(Collections.singletonList(simulationReport.orElse(null)));
|
||||
return userReportVO;
|
||||
}
|
||||
|
||||
@@ -436,7 +438,7 @@ public class UserReportPOServiceImpl extends ServiceImpl<UserReportPOMapper, Use
|
||||
public BpmInstanceInfo getInstanceInfo(String businessId) {
|
||||
BpmInstanceInfo bpmInstanceInfo = new BpmInstanceInfo();
|
||||
UserReportPO userReportPO = this.getById(businessId);
|
||||
if(Objects.isNull(userReportPO)){
|
||||
if (Objects.isNull(userReportPO)) {
|
||||
return null;
|
||||
}
|
||||
bpmInstanceInfo.setHistoryInstanceId(userReportPO.getHistoryInstanceId());
|
||||
@@ -455,7 +457,7 @@ public class UserReportPOServiceImpl extends ServiceImpl<UserReportPOMapper, Use
|
||||
.select(UserReportPO::getProcessInstanceId);
|
||||
List<UserReportPO> userReportPOList = this.baseMapper.selectList(lambdaQueryWrapper);
|
||||
List<String> result = userReportPOList.stream().map(UserReportPO::getProcessInstanceId).collect(Collectors.toList());
|
||||
if(CollectionUtil.isNotEmpty(result)){
|
||||
if (CollectionUtil.isNotEmpty(result)) {
|
||||
rejectInstanceIds.addAll(result);
|
||||
}
|
||||
return rejectInstanceIds;
|
||||
@@ -503,11 +505,11 @@ public class UserReportPOServiceImpl extends ServiceImpl<UserReportPOMapper, Use
|
||||
if (!allDataFlag) {
|
||||
//台账不查询全部数据,需要排除敏感及重要用户
|
||||
userReportVOQueryWrapper.ne("supervision_user_report.user_type", UserNatureEnum.SENSITIVE_USER.getCode())
|
||||
.and(CollUtil.isNotEmpty(InstanceUtil.filterTaskStatus()),w -> w.in("supervision_user_report.status", InstanceUtil.filterTaskStatus())
|
||||
.and(CollUtil.isNotEmpty(InstanceUtil.filterTaskStatus()), w -> w.in("supervision_user_report.status", InstanceUtil.filterTaskStatus())
|
||||
.or()
|
||||
.eq("supervision_user_report.create_by", RequestUtil.getUserIndex())
|
||||
);
|
||||
}else{
|
||||
} else {
|
||||
userReportVOQueryWrapper.eq("supervision_user_report.status", FlowStatusEnum.APPROVE.getCode());
|
||||
}
|
||||
if (Objects.nonNull(userReportQueryParam)) {
|
||||
@@ -801,7 +803,7 @@ public class UserReportPOServiceImpl extends ServiceImpl<UserReportPOMapper, Use
|
||||
try {
|
||||
List<SensitiveUserSExcel> sensitiveUserExcelExcelImportResult = ExcelImportUtil.importExcel(file.getInputStream(), SensitiveUserSExcel.class, params);
|
||||
sensitiveUserExcels = sensitiveUserExcelExcelImportResult.stream().filter(x -> StringUtils.isNotBlank(x.getCity())).collect(Collectors.toList());
|
||||
if(CollectionUtil.isEmpty(sensitiveUserExcels)){
|
||||
if (CollectionUtil.isEmpty(sensitiveUserExcels)) {
|
||||
throw new BusinessException(SupervisionResponseEnum.IMPORT_DEV_DATA_ERROR);
|
||||
}
|
||||
//如果存在非法数据,将不合格的数据导出
|
||||
@@ -1030,11 +1032,11 @@ public class UserReportPOServiceImpl extends ServiceImpl<UserReportPOMapper, Use
|
||||
ExcelImportResult<SensitiveReportExcel> sensitiveUserExcelExcelImportResult = ExcelImportUtil.importExcelMore(file.getInputStream(), SensitiveReportExcel.class, params);
|
||||
log.info("Excel 解析完成,原始数据行数:{}", sensitiveUserExcelExcelImportResult.getList().size());
|
||||
//如果存在非法数据,将不合格的数据导出
|
||||
if (sensitiveUserExcelExcelImportResult.isVerifyFail()) {
|
||||
log.warn("存在校验失败的数据");
|
||||
PoiUtil.exportFileByWorkbook(sensitiveUserExcelExcelImportResult.getFailWorkbook(), "非法用户数据.xlsx", response);
|
||||
return; // 校验失败直接返回
|
||||
} else {
|
||||
// if (sensitiveUserExcelExcelImportResult.isVerifyFail()) {
|
||||
// log.warn("存在校验失败的数据");
|
||||
// PoiUtil.exportFileByWorkbook(sensitiveUserExcelExcelImportResult.getFailWorkbook(), "非法用户数据.xlsx", response);
|
||||
// return; // 校验失败直接返回
|
||||
// } else {
|
||||
// 过滤掉空行数据(projectName 为空的行)
|
||||
sensitiveUserExcels = sensitiveUserExcelExcelImportResult.getList().stream()
|
||||
.filter(x -> StringUtils.isNotBlank(x.getProjectName()))
|
||||
@@ -1044,7 +1046,7 @@ public class UserReportPOServiceImpl extends ServiceImpl<UserReportPOMapper, Use
|
||||
if (CollectionUtil.isEmpty(sensitiveUserExcels)) {
|
||||
throw new BusinessException(SupervisionResponseEnum.IMPORT_DEV_DATA_ERROR);
|
||||
}
|
||||
}
|
||||
// }
|
||||
} catch (Exception e) {
|
||||
log.error("导入失败,文件:{}", file.getOriginalFilename(), e);
|
||||
throw new BusinessException(SupervisionResponseEnum.IMPORT_SENSITIVE_REPORT_ERROR);
|
||||
@@ -1165,7 +1167,7 @@ public class UserReportPOServiceImpl extends ServiceImpl<UserReportPOMapper, Use
|
||||
@Override
|
||||
public Boolean deleteUserReport(List<String> supervisionId) {
|
||||
List<UserReportPO> userReportPOS = this.listByIds(supervisionId);
|
||||
if(CollUtil.isEmpty(userReportPOS)){
|
||||
if (CollUtil.isEmpty(userReportPOS)) {
|
||||
throw new BusinessException(SupervisionResponseEnum.EXISTENCE_OR_NOT);
|
||||
}
|
||||
//判断是否有权限操作
|
||||
@@ -1181,29 +1183,29 @@ public class UserReportPOServiceImpl extends ServiceImpl<UserReportPOMapper, Use
|
||||
public List<UserLedgerVO> selectUserList(UserReportParam userReportParam) {
|
||||
LambdaQueryWrapper<UserReportPO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
|
||||
if(StrUtil.isNotBlank(userReportParam.getCity())){
|
||||
lambdaQueryWrapper.in(UserReportPO::getCity,Stream.of(userReportParam.getCity()).collect(Collectors.toList()));
|
||||
if (StrUtil.isNotBlank(userReportParam.getCity())) {
|
||||
lambdaQueryWrapper.in(UserReportPO::getCity, Stream.of(userReportParam.getCity()).collect(Collectors.toList()));
|
||||
}
|
||||
if(StrUtil.isNotBlank(userReportParam.getStationId())){
|
||||
lambdaQueryWrapper.eq(UserReportPO::getStationId,userReportParam.getStationId());
|
||||
if (StrUtil.isNotBlank(userReportParam.getStationId())) {
|
||||
lambdaQueryWrapper.eq(UserReportPO::getStationId, userReportParam.getStationId());
|
||||
}
|
||||
if (ObjectUtil.isNotNull(userReportParam.getUserType())) {
|
||||
lambdaQueryWrapper.eq(UserReportPO::getUserType, userReportParam.getUserType());
|
||||
}
|
||||
|
||||
lambdaQueryWrapper.eq(UserReportPO::getState,DataStateEnum.ENABLE.getCode());
|
||||
lambdaQueryWrapper.eq(UserReportPO::getState, DataStateEnum.ENABLE.getCode());
|
||||
|
||||
List<UserReportPO> list = this.list(lambdaQueryWrapper);
|
||||
return BeanUtil.copyToList(list,UserLedgerVO.class);
|
||||
return BeanUtil.copyToList(list, UserLedgerVO.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public UserLedgerVO selectUserInfo(String id) {
|
||||
LambdaQueryWrapper<UserReportPO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.eq(UserReportPO::getId,id).eq(UserReportPO::getState,DataStateEnum.ENABLE.getCode());
|
||||
lambdaQueryWrapper.eq(UserReportPO::getId, id).eq(UserReportPO::getState, DataStateEnum.ENABLE.getCode());
|
||||
UserReportPO userReportPO = this.getById(id);
|
||||
if(Objects.nonNull(userReportPO)){
|
||||
return BeanUtil.copyProperties(userReportPO,UserLedgerVO.class);
|
||||
if (Objects.nonNull(userReportPO)) {
|
||||
return BeanUtil.copyProperties(userReportPO, UserLedgerVO.class);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@@ -1320,6 +1322,28 @@ public class UserReportPOServiceImpl extends ServiceImpl<UserReportPOMapper, Use
|
||||
return this.baseMapper.selectList(userReportVOQueryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean bindAssessmentId(String userReportId, String assessMentId) {
|
||||
if (StrUtil.isBlank(assessMentId)||"null".equals(assessMentId)) {
|
||||
assessMentId = null;
|
||||
}
|
||||
return this.update(new LambdaUpdateWrapper<UserReportPO>()
|
||||
.set(UserReportPO::getSecondAssessmentId, assessMentId)
|
||||
.eq(UserReportPO::getId, userReportId));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<UserLedgerVO.AssessMent> selectUserAssessMentList(UserReportParam userReportParam) {
|
||||
List<String> data = deptFeignClient.getDepSonIdtByDeptId(userReportParam.getOrgId()).getData();
|
||||
LambdaQueryWrapper<UserReportPO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.in(UserReportPO::getOrgId, data);
|
||||
lambdaQueryWrapper.and(x -> x.isNull(UserReportPO::getSecondAssessmentId)
|
||||
.or()
|
||||
.eq(UserReportPO::getSecondAssessmentId, userReportParam.getSecondAssessmentId()));
|
||||
lambdaQueryWrapper.eq(UserReportPO::getState, DataStateEnum.ENABLE.getCode());
|
||||
return BeanUtil.copyToList(this.list(lambdaQueryWrapper), UserLedgerVO.AssessMent.class);
|
||||
}
|
||||
|
||||
public Map<String, String> getTreeString(String name, List<SysDicTreePO> treeVOS) {
|
||||
Map<String, String> info = new LinkedHashMap<>();
|
||||
for (SysDicTreePO sysMenuDtoChild : treeVOS) {
|
||||
@@ -1365,7 +1389,7 @@ public class UserReportPOServiceImpl extends ServiceImpl<UserReportPOMapper, Use
|
||||
LambdaQueryWrapper<UserReportPO> userReportPOLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
userReportPOLambdaQueryWrapper
|
||||
.eq(UserReportPO::getProjectName, userReportParam.getProjectName())
|
||||
.in(UserReportPO::getStatus, CollectionUtil.newArrayList(BpmProcessInstanceStatusEnum.AWAIT.getStatus(),BpmProcessInstanceStatusEnum.RUNNING.getStatus(), BpmProcessInstanceStatusEnum.APPROVE.getStatus()))
|
||||
.in(UserReportPO::getStatus, CollectionUtil.newArrayList(BpmProcessInstanceStatusEnum.AWAIT.getStatus(), BpmProcessInstanceStatusEnum.RUNNING.getStatus(), BpmProcessInstanceStatusEnum.APPROVE.getStatus()))
|
||||
.eq(UserReportPO::getState, DataStateEnum.ENABLE.getCode());
|
||||
//更新的时候,需排除当前记录
|
||||
if (isExcludeSelf) {
|
||||
|
||||
Reference in New Issue
Block a user