Compare commits
32 Commits
24e4c4de37
...
2025-12
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
184b2b8fad | ||
|
|
fe029fcb95 | ||
|
|
9143466ce7 | ||
|
|
9409d57243 | ||
| 63603dee08 | |||
|
|
e35bbd9b34 | ||
|
|
ea2173fff4 | ||
| faac7953d3 | |||
| c3cc39973e | |||
| 6d8bfacd0a | |||
|
|
ab5d28e3cb | ||
|
|
2dccb22cf8 | ||
| 6b0bad6047 | |||
| 9ffbdbdf57 | |||
|
|
778f689b3e | ||
|
|
917e3fb2d5 | ||
| e0f1e314a4 | |||
| 2f2ed06a35 | |||
| 277400670d | |||
| a1031109c4 | |||
| eeb27c519b | |||
|
|
670eaf7d38 | ||
| 2b79cefad6 | |||
| 212db18835 | |||
|
|
e9a1c34160 | ||
|
|
fb7a2b7084 | ||
|
|
4b3ec39a11 | ||
|
|
2d255a5dd3 | ||
|
|
614647d36d | ||
|
|
a899614c89 | ||
|
|
2543f87dd2 | ||
|
|
c5074df93d |
@@ -83,10 +83,10 @@ public class EventRelevantAnalysisController extends BaseController {
|
|||||||
public HttpResult<Page<RmpEventDetailAssPO>> queryEventsAssPage(@RequestBody BaseParam baseParam){
|
public HttpResult<Page<RmpEventDetailAssPO>> queryEventsAssPage(@RequestBody BaseParam baseParam){
|
||||||
String methodDescribe = getMethodDescribe("queryEventsAssPage");
|
String methodDescribe = getMethodDescribe("queryEventsAssPage");
|
||||||
String searchValue = baseParam.getSearchValue();
|
String searchValue = baseParam.getSearchValue();
|
||||||
Pattern pattern = Pattern.compile(PatternRegex.SPECIAL_REGEX);
|
// Pattern pattern = Pattern.compile(PatternRegex.SPECIAL_REGEX);
|
||||||
if(pattern.matcher(searchValue).find()){
|
// if(pattern.matcher(searchValue).find()){
|
||||||
throw new BusinessException(ValidMessage.SPECIAL_REGEX);
|
// throw new BusinessException(ValidMessage.SPECIAL_REGEX);
|
||||||
}
|
// }
|
||||||
Page<RmpEventDetailAssPO> page = eventRelevantAnalysisService.queryEventsAssPage(baseParam);
|
Page<RmpEventDetailAssPO> page = eventRelevantAnalysisService.queryEventsAssPage(baseParam);
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, page, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, page, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -565,7 +565,7 @@ public class SecondaryEvaluationServiceImpl implements SecondaryEvaluationServic
|
|||||||
unblance.add(evaluationResult);
|
unblance.add(evaluationResult);
|
||||||
|
|
||||||
evaluationResult = new AssessResultVO.EvaluationResult();
|
evaluationResult = new AssessResultVO.EvaluationResult();
|
||||||
evaluationResult.setData(result.getApproUnblance().multiply(BigDecimal.valueOf(200)));
|
evaluationResult.setData(result.getApproUnblance());
|
||||||
evaluationResult.setLimitData(overLimit.getUnblance());
|
evaluationResult.setLimitData(overLimit.getUnblance());
|
||||||
evaluationResult.setIsQualified(NumberUtil.isLess(evaluationResult.getData(), evaluationResult.getLimitData()));
|
evaluationResult.setIsQualified(NumberUtil.isLess(evaluationResult.getData(), evaluationResult.getLimitData()));
|
||||||
unblance.add(evaluationResult);
|
unblance.add(evaluationResult);
|
||||||
|
|||||||
@@ -322,10 +322,7 @@ public class SgEventServiceImpl extends ServiceImpl<SgEventMapper, SgEvent> impl
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean deleteEventData(List<String> ids) {
|
public boolean deleteEventData(List<String> ids) {
|
||||||
return this.lambdaUpdate()
|
return this.removeByIds(ids);
|
||||||
.set(SgEvent::getState, DataStateEnum.DELETED.getCode())
|
|
||||||
.in(SgEvent::getId, ids)
|
|
||||||
.update();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -51,6 +51,7 @@ import net.sf.json.JSONObject;
|
|||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
import java.sql.Timestamp;
|
import java.sql.Timestamp;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.time.format.DateTimeFormatter;
|
import java.time.format.DateTimeFormatter;
|
||||||
@@ -471,6 +472,8 @@ public class EventRelevantAnalysisServiceImpl extends ServiceImpl<RmpEventAdvanc
|
|||||||
|
|
||||||
List<AdvanceEventDetailVO> advanceEventDetailVOList = BeanUtil.copyToList(rmpEventDetailPOList, AdvanceEventDetailVO.class);
|
List<AdvanceEventDetailVO> advanceEventDetailVOList = BeanUtil.copyToList(rmpEventDetailPOList, AdvanceEventDetailVO.class);
|
||||||
advanceEventDetailVOList = advanceEventDetailVOList.stream().peek(item -> {
|
advanceEventDetailVOList = advanceEventDetailVOList.stream().peek(item -> {
|
||||||
|
item.setFeatureAmplitude(roundHalfUp(item.getFeatureAmplitude()*100));
|
||||||
|
|
||||||
if (map.containsKey(item.getLineId())) {
|
if (map.containsKey(item.getLineId())) {
|
||||||
AreaLineInfoVO areaLineInfoVO = map.get(item.getLineId());
|
AreaLineInfoVO areaLineInfoVO = map.get(item.getLineId());
|
||||||
item.setGdName(areaLineInfoVO.getGdName());
|
item.setGdName(areaLineInfoVO.getGdName());
|
||||||
@@ -489,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
|
@Override
|
||||||
public Page<RmpEventDetailAssPO> queryEventsAssPage(BaseParam baseParam) {
|
public Page<RmpEventDetailAssPO> queryEventsAssPage(BaseParam baseParam) {
|
||||||
List<LocalDateTime> timeV = PubUtils.checkLocalDate(baseParam.getSearchBeginTime(), baseParam.getSearchEndTime());
|
List<LocalDateTime> timeV = PubUtils.checkLocalDate(baseParam.getSearchBeginTime(), baseParam.getSearchEndTime());
|
||||||
|
|||||||
@@ -47,4 +47,7 @@ public class DeptGetLineParam {
|
|||||||
@ApiModelProperty("监测点运行状态")
|
@ApiModelProperty("监测点运行状态")
|
||||||
@Range(min = 0, max = 2, message = "监测点运行状态" + ValidMessage.PARAM_FORMAT_ERROR)
|
@Range(min = 0, max = 2, message = "监测点运行状态" + ValidMessage.PARAM_FORMAT_ERROR)
|
||||||
private Integer lineRunFlag;
|
private Integer lineRunFlag;
|
||||||
|
|
||||||
|
@ApiModelProperty("搜索值")
|
||||||
|
private String searchValue;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,10 +7,10 @@
|
|||||||
SELECT DISTINCT
|
SELECT DISTINCT
|
||||||
monitor.Org_Id AS orgId,
|
monitor.Org_Id AS orgId,
|
||||||
monitor.Org_Name AS orgName,
|
monitor.Org_Name AS orgName,
|
||||||
monitor.`Powerr_Id` AS powerId,
|
monitor.Powerr_Id AS powerId,
|
||||||
monitor.`Powerr_Name` AS powerName,
|
monitor.Powerr_Name AS powerName,
|
||||||
monitor.id AS monitorId,
|
monitor.id AS monitorId,
|
||||||
monitor.`Name` AS monitorName,
|
monitor.Name AS monitorName,
|
||||||
monitor.Line_Id,
|
monitor.Line_Id,
|
||||||
monitor.Line_Name,
|
monitor.Line_Name,
|
||||||
pdm.Monitor_Sort AS monitorSort,
|
pdm.Monitor_Sort AS monitorSort,
|
||||||
@@ -29,8 +29,8 @@
|
|||||||
(
|
(
|
||||||
SELECT
|
SELECT
|
||||||
pm.id,
|
pm.id,
|
||||||
pm.`Name`,
|
pm.Name,
|
||||||
pm.`Status`,
|
pm.Status,
|
||||||
pm.Org_Id,
|
pm.Org_Id,
|
||||||
pm.Org_Name,
|
pm.Org_Name,
|
||||||
pm.Powerr_Id,
|
pm.Powerr_Id,
|
||||||
@@ -51,8 +51,8 @@
|
|||||||
) AS monitor
|
) AS monitor
|
||||||
INNER JOIN pms_distribution_monitor AS pdm ON monitor.id = pdm.Monitor_Id
|
INNER JOIN pms_distribution_monitor AS pdm ON monitor.id = pdm.Monitor_Id
|
||||||
WHERE
|
WHERE
|
||||||
monitor.`Status` = 1
|
monitor.Status = 1
|
||||||
AND pdm.`Status` = 1
|
AND pdm.Status = 1
|
||||||
AND monitor.Org_Id IN
|
AND monitor.Org_Id IN
|
||||||
<foreach collection="deptIdList" item="orgId" open="(" close=")" separator=",">
|
<foreach collection="deptIdList" item="orgId" open="(" close=")" separator=",">
|
||||||
#{orgId}
|
#{orgId}
|
||||||
@@ -85,7 +85,7 @@
|
|||||||
AND pdm.If_Power_User = #{pwPmsMonitorParam.ifPowerUser}
|
AND pdm.If_Power_User = #{pwPmsMonitorParam.ifPowerUser}
|
||||||
</if>
|
</if>
|
||||||
<if test="pwPmsMonitorParam.monitorName !=null and pwPmsMonitorParam.monitorName != ''">
|
<if test="pwPmsMonitorParam.monitorName !=null and pwPmsMonitorParam.monitorName != ''">
|
||||||
AND monitor.`Name` LIKE CONCAT('%',#{pwPmsMonitorParam.monitorName},'%')
|
AND monitor.Name LIKE CONCAT('%',#{pwPmsMonitorParam.monitorName},'%')
|
||||||
</if>
|
</if>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|||||||
@@ -8,4 +8,8 @@ public class PublicDTO {
|
|||||||
private String id;
|
private String id;
|
||||||
|
|
||||||
private Double data;
|
private Double data;
|
||||||
|
|
||||||
|
private Integer onlineMin;
|
||||||
|
|
||||||
|
private Integer offlineMin;
|
||||||
}
|
}
|
||||||
@@ -93,7 +93,7 @@ public class DeviceParam {
|
|||||||
@NotBlank(message = "设备制造商不能为空")
|
@NotBlank(message = "设备制造商不能为空")
|
||||||
private String manufacturer;
|
private String manufacturer;
|
||||||
|
|
||||||
@ApiModelProperty(name = "electroplate",value = "电镀功能",required = true)
|
@ApiModelProperty(name = "electroplate",value = "电度功能",required = true)
|
||||||
@NotNull(message = "电镀标识不能为空")
|
@NotNull(message = "电镀标识不能为空")
|
||||||
private Integer electroplate;
|
private Integer electroplate;
|
||||||
|
|
||||||
|
|||||||
@@ -41,4 +41,9 @@ public class MonitorBaseParam extends BaseParam {
|
|||||||
@ApiModelProperty(value = "监测点运行状态")
|
@ApiModelProperty(value = "监测点运行状态")
|
||||||
private Integer lineRunFlag;
|
private Integer lineRunFlag;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "异常天数时间")
|
||||||
|
private List<String> time;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "过滤异常时间次数")
|
||||||
|
private Integer errorTimeCount;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
package com.njcn.device.pq.pojo.po;
|
package com.njcn.device.pq.pojo.po;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import com.njcn.db.bo.BaseEntity;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import java.io.Serializable;
|
import com.github.jeffreyning.mybatisplus.anno.MppMultiId;
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
@@ -25,136 +26,306 @@ public class PqDataVerifyBak {
|
|||||||
/**
|
/**
|
||||||
* 监测点id
|
* 监测点id
|
||||||
*/
|
*/
|
||||||
|
@MppMultiId
|
||||||
|
@TableField(value = "line_id")
|
||||||
private String lineId;
|
private String lineId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 异常数据时间
|
* 异常数据时间
|
||||||
*/
|
*/
|
||||||
|
@MppMultiId
|
||||||
|
@TableField(value = "time_id")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||||
private LocalDate timeId;
|
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:异常)
|
* 电压暂降(0:正常 1:异常)
|
||||||
*/
|
*/
|
||||||
private Integer dip;
|
@TableField(value = "dip")
|
||||||
|
private Integer dip ;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电压暂降异常时间
|
||||||
|
*/
|
||||||
|
@TableField(value = "dip_time")
|
||||||
|
private Integer dipTime ;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 电压暂升(0:正常 1:异常)
|
* 电压暂升(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;
|
private String path;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -52,17 +52,5 @@ public class PqDataVerifyCount implements Serializable {
|
|||||||
@TableField(value = "total_all")
|
@TableField(value = "total_all")
|
||||||
private Integer totalAll ;
|
private Integer totalAll ;
|
||||||
|
|
||||||
/**
|
|
||||||
* 异常短时闪变数量
|
|
||||||
*/
|
|
||||||
@TableField(value = "flicker")
|
|
||||||
private Integer flicker ;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 短时闪变总数量
|
|
||||||
*/
|
|
||||||
@TableField(value = "flicker_all")
|
|
||||||
private Integer flickerAll;
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -136,8 +136,10 @@ public class AreaLineInfoVO implements Serializable {
|
|||||||
@ApiModelProperty(name = "objId",value = "对象id")
|
@ApiModelProperty(name = "objId",value = "对象id")
|
||||||
private String objId;
|
private String objId;
|
||||||
|
|
||||||
private Double vHarmonicValue; ;
|
@ApiModelProperty(name = "vHarmonicValue",value = "污染值")
|
||||||
|
private Double vHarmonicValue;
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "userList",value = "敏感用户信息")
|
||||||
private List<User> userList;
|
private List<User> userList;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
|
|||||||
@@ -96,7 +96,7 @@ public class DeviceVO implements Serializable {
|
|||||||
@ApiModelProperty(name = "manufacturer",value = "设备制造商Guid")
|
@ApiModelProperty(name = "manufacturer",value = "设备制造商Guid")
|
||||||
private String manufacturer;
|
private String manufacturer;
|
||||||
|
|
||||||
@ApiModelProperty(name = "electroplate",value = "电镀功能")
|
@ApiModelProperty(name = "electroplate",value = "电度功能")
|
||||||
private Integer electroplate;
|
private Integer electroplate;
|
||||||
|
|
||||||
@ApiModelProperty(name = "thisTimeCheck",value = "本次定检时间")
|
@ApiModelProperty(name = "thisTimeCheck",value = "本次定检时间")
|
||||||
|
|||||||
@@ -136,6 +136,18 @@ public class LineIntegrityDataVO implements Serializable {
|
|||||||
@ApiModelProperty(name = "integrityData",value = "数据完整性")
|
@ApiModelProperty(name = "integrityData",value = "数据完整性")
|
||||||
private Double integrityData;
|
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 = "在线率")
|
@ApiModelProperty(name = "onlineRate",value = "在线率")
|
||||||
private Double onlineRate;
|
private Double onlineRate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 在线分钟数
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(name = "onlineMin",value = "在线分钟数")
|
||||||
|
private Integer onlineMin;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 离线分钟数
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(name = "offlineMin",value = "离线分钟数")
|
||||||
|
private Integer offlineMin;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 最新数据时间
|
* 最新数据时间
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -17,6 +17,8 @@ public class DetailAbnormalVO {
|
|||||||
|
|
||||||
private String date;
|
private String date;
|
||||||
|
|
||||||
|
private List<TimeAndTargetKey> dateTargetList;
|
||||||
|
|
||||||
private String monitorName;
|
private String monitorName;
|
||||||
|
|
||||||
private String bdName;
|
private String bdName;
|
||||||
@@ -27,7 +29,13 @@ public class DetailAbnormalVO {
|
|||||||
|
|
||||||
private String targetKey;
|
private String targetKey;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public static class TimeAndTargetKey {
|
||||||
|
|
||||||
|
private String date;
|
||||||
|
|
||||||
|
private List<VerifyTargetVO> targetKeys;
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* 异常实体
|
* 异常实体
|
||||||
*/
|
*/
|
||||||
@@ -58,6 +66,23 @@ public class DetailAbnormalVO {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public static class DetailAbnormalCountVO {
|
||||||
|
|
||||||
|
private Integer timeSum;
|
||||||
|
private Integer errCount;
|
||||||
|
private List<DetailAbnormalInnerVO> time;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public static class DetailLimitCountVO {
|
||||||
|
|
||||||
|
private Integer timeSum;
|
||||||
|
private Integer errCount;
|
||||||
|
private List<DetailLimitInnerVO> time;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
public static class DetailLimitInnerVO{
|
public static class DetailLimitInnerVO{
|
||||||
|
|
||||||
|
|||||||
@@ -13,10 +13,10 @@ public class PowerQualityIndicatorsVO {
|
|||||||
|
|
||||||
@ApiModelProperty(name = "monitorId",value = "监测点id")
|
@ApiModelProperty(name = "monitorId",value = "监测点id")
|
||||||
private String monitorId;
|
private String monitorId;
|
||||||
//监测点名称
|
|
||||||
@ApiModelProperty(name = "monitorName",value = "监测点名称")
|
@ApiModelProperty(name = "monitorName",value = "监测点名称")
|
||||||
private String monitorName;
|
private String monitorName;
|
||||||
//所属终端名称
|
|
||||||
@ApiModelProperty(name = "devName",value = "所属终端名称")
|
@ApiModelProperty(name = "devName",value = "所属终端名称")
|
||||||
private String devName;
|
private String devName;
|
||||||
|
|
||||||
@@ -25,23 +25,25 @@ public class PowerQualityIndicatorsVO {
|
|||||||
|
|
||||||
@ApiModelProperty(name = "manufacturer",value = "所属厂商")
|
@ApiModelProperty(name = "manufacturer",value = "所属厂商")
|
||||||
private String manufacturer;
|
private String manufacturer;
|
||||||
//所属电站
|
|
||||||
@ApiModelProperty(name = "stationName",value = "所属电站")
|
@ApiModelProperty(name = "stationName",value = "所属电站")
|
||||||
private String stationName;
|
private String stationName;
|
||||||
//监测对象类型
|
|
||||||
@ApiModelProperty(name = "objType",value = "监测对象类型")
|
@ApiModelProperty(name = "objType",value = "监测对象类型")
|
||||||
private String objType;
|
private String objType;
|
||||||
//监测对象名称
|
|
||||||
@ApiModelProperty(name = "objName",value = "监测对象名称")
|
@ApiModelProperty(name = "objName",value = "监测对象名称")
|
||||||
private String objName;
|
private String objName;
|
||||||
//电压等级
|
|
||||||
@ApiModelProperty(name = "voltageLevel",value = "电压等级")
|
@ApiModelProperty(name = "voltageLevel",value = "电压等级")
|
||||||
private String voltageLevel;
|
private String voltageLevel;
|
||||||
//异常天数
|
|
||||||
@ApiModelProperty(name = "abnormalDay",value = "异常天数")
|
@ApiModelProperty(name = "abnormalDay",value = "异常天数")
|
||||||
private Integer abnormalDay;
|
private Integer abnormalDay;
|
||||||
//严重度
|
|
||||||
@ApiModelProperty(name = "severity",value = "严重度")
|
@ApiModelProperty(name = "severity",value = "严重度")
|
||||||
private Integer severity;
|
private Integer severity;
|
||||||
|
|
||||||
|
@ApiModelProperty("地市")
|
||||||
|
private String city;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -86,9 +86,9 @@ public class DataVerifyController extends BaseController {
|
|||||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
@PostMapping("/monitorAbnormalTableDetail")
|
@PostMapping("/monitorAbnormalTableDetail")
|
||||||
@ApiOperation("弹框-获取异常监测点列表详情")
|
@ApiOperation("弹框-获取异常监测点列表详情")
|
||||||
public HttpResult<List<DetailAbnormalVO.DetailAbnormalInnerVO>> monitorAbnormalTableDetail(@RequestBody MonitorBaseParam monitorBaseParam){
|
public HttpResult<DetailAbnormalVO.DetailAbnormalCountVO> monitorAbnormalTableDetail(@RequestBody MonitorBaseParam monitorBaseParam) {
|
||||||
String methodDescribe = getMethodDescribe("monitorAbnormalTableDetail");
|
String methodDescribe = getMethodDescribe("monitorAbnormalTableDetail");
|
||||||
List<DetailAbnormalVO.DetailAbnormalInnerVO> list = iPqDataVerifyBakService.monitorAbnormalTableDetail(monitorBaseParam);
|
DetailAbnormalVO.DetailAbnormalCountVO list = iPqDataVerifyBakService.monitorAbnormalTableDetail(monitorBaseParam);
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -134,9 +134,9 @@ public class DataVerifyController extends BaseController {
|
|||||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
@PostMapping("/monitorLimitTableDetail")
|
@PostMapping("/monitorLimitTableDetail")
|
||||||
@ApiOperation("弹框-获取稳态告警监测点列表详情")
|
@ApiOperation("弹框-获取稳态告警监测点列表详情")
|
||||||
public HttpResult<List<DetailAbnormalVO.DetailLimitInnerVO>> monitorLimitTableDetail(@RequestBody MonitorBaseParam monitorBaseParam){
|
public HttpResult<DetailAbnormalVO.DetailLimitCountVO> monitorLimitTableDetail(@RequestBody MonitorBaseParam monitorBaseParam){
|
||||||
String methodDescribe = getMethodDescribe("monitorLimitTableDetail");
|
String methodDescribe = getMethodDescribe("monitorLimitTableDetail");
|
||||||
List<DetailAbnormalVO.DetailLimitInnerVO> list = iDataVerifyService.monitorLimitTableDetail(monitorBaseParam);
|
DetailAbnormalVO.DetailLimitCountVO list = iDataVerifyService.monitorLimitTableDetail(monitorBaseParam);
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -168,10 +168,10 @@ public class DeptLineController extends BaseController {
|
|||||||
|
|
||||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||||
@PostMapping("/getAllData")
|
@PostMapping("/getAllData")
|
||||||
@ApiOperation("获取部门监测点表所有数据")
|
@ApiOperation("获取部门监测点表数据(仅查询在运监测点)")
|
||||||
public HttpResult<List<DeptLine>> getAllData() {
|
public HttpResult<List<DeptLine>> getAllData() {
|
||||||
String methodDescribe = getMethodDescribe("getAllData");
|
String methodDescribe = getMethodDescribe("getAllData");
|
||||||
List<DeptLine> list = deptLineMapper.selectList(null);
|
List<DeptLine> list = deptLineMapper.getOnlineMonitor();
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,9 +8,7 @@
|
|||||||
SELECT
|
SELECT
|
||||||
line_id AS lineId,
|
line_id AS lineId,
|
||||||
SUM(total) AS total,
|
SUM(total) AS total,
|
||||||
SUM(total_all) AS totalAll,
|
SUM(total_all) AS totalAll
|
||||||
SUM(flicker) AS flicker,
|
|
||||||
SUM(flicker_all) AS flickerAll
|
|
||||||
FROM
|
FROM
|
||||||
pq_data_verify_count
|
pq_data_verify_count
|
||||||
<where>
|
<where>
|
||||||
@@ -32,12 +30,12 @@
|
|||||||
|
|
||||||
<select id="getAnomalousData" resultType="OnlineMonitorVo">
|
<select id="getAnomalousData" resultType="OnlineMonitorVo">
|
||||||
SELECT DISTINCT
|
SELECT DISTINCT
|
||||||
t6.`Name` gdName,
|
t6.Name gdName,
|
||||||
t5.`Name` subName,
|
t5.Name subName,
|
||||||
t4.`Name` deviceName,
|
t4.Name deviceName,
|
||||||
t1.Line_Id lineId,
|
t1.Line_Id lineId,
|
||||||
t2.`Name` lineName,
|
t2.Name lineName,
|
||||||
t8.`Name` monitorObjType,
|
t8.Name monitorObjType,
|
||||||
t7.Obj_Name monitorObj,
|
t7.Obj_Name monitorObj,
|
||||||
"异常数据" as target,
|
"异常数据" as target,
|
||||||
count(t1.time_id) lastDay
|
count(t1.time_id) lastDay
|
||||||
@@ -51,7 +49,7 @@
|
|||||||
left join pq_line_detail t7 on t1.Line_Id = t7.Id
|
left join pq_line_detail t7 on t1.Line_Id = t7.Id
|
||||||
left join sys_dict_data t8 on t7.Load_Type = t8.Id
|
left join sys_dict_data t8 on t7.Load_Type = t8.Id
|
||||||
WHERE
|
WHERE
|
||||||
(t1.total + t1.flicker) > 0
|
t1.total > 0
|
||||||
<if test="lineIds!=null and lineIds.size > 0">
|
<if test="lineIds!=null and lineIds.size > 0">
|
||||||
and Line_Id in
|
and Line_Id in
|
||||||
<foreach collection="lineIds" item="item" open="(" close=")" separator=",">
|
<foreach collection="lineIds" item="item" open="(" close=")" separator=",">
|
||||||
|
|||||||
@@ -176,7 +176,6 @@
|
|||||||
<select id="getDevOnlineByDevIds" resultType="TerminalOnlineRateData">
|
<select id="getDevOnlineByDevIds" resultType="TerminalOnlineRateData">
|
||||||
select
|
select
|
||||||
dev_index devId,
|
dev_index devId,
|
||||||
avg(online_min/(online_min+offline_min))*100 onlineRate,
|
|
||||||
sum(online_min) onlineMin,
|
sum(online_min) onlineMin,
|
||||||
sum(offline_min) offlineMin
|
sum(offline_min) offlineMin
|
||||||
from r_stat_onlinerate_d
|
from r_stat_onlinerate_d
|
||||||
|
|||||||
@@ -381,7 +381,7 @@
|
|||||||
line.LEVEL,
|
line.LEVEL,
|
||||||
line.sort,
|
line.sort,
|
||||||
line.pids,
|
line.pids,
|
||||||
CONCAT(voltage.name, '_', line.name, '(',device.`Name`,')') name,
|
CONCAT(voltage.name, '_', line.name, '(',device.Name,')') name,
|
||||||
comFlag.Com_Flag,
|
comFlag.Com_Flag,
|
||||||
detail.pt_type,
|
detail.pt_type,
|
||||||
detail.obj_id
|
detail.obj_id
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ public interface IDataVerifyService extends IService<DataVerify> {
|
|||||||
|
|
||||||
List<DetailAbnormalVO> monitorLimitTable(MonitorBaseParam monitorBaseParam);
|
List<DetailAbnormalVO> monitorLimitTable(MonitorBaseParam monitorBaseParam);
|
||||||
|
|
||||||
List<DetailAbnormalVO.DetailLimitInnerVO> monitorLimitTableDetail(MonitorBaseParam monitorBaseParam);
|
DetailAbnormalVO.DetailLimitCountVO monitorLimitTableDetail(MonitorBaseParam monitorBaseParam);
|
||||||
|
|
||||||
|
|
||||||
DetailAbnormalVO.Assess limitTableDetail(MonitorBaseParam monitorBaseParam);
|
DetailAbnormalVO.Assess limitTableDetail(MonitorBaseParam monitorBaseParam);
|
||||||
|
|||||||
@@ -27,8 +27,7 @@ public interface IPqDataVerifyBakService extends IService<PqDataVerifyBak> {
|
|||||||
List<DetailAbnormalVO> monitorAbnormalTable(MonitorBaseParam monitorBaseParam);
|
List<DetailAbnormalVO> monitorAbnormalTable(MonitorBaseParam monitorBaseParam);
|
||||||
|
|
||||||
|
|
||||||
|
DetailAbnormalVO.DetailAbnormalCountVO monitorAbnormalTableDetail(MonitorBaseParam monitorBaseParam);
|
||||||
List<DetailAbnormalVO.DetailAbnormalInnerVO> monitorAbnormalTableDetail(MonitorBaseParam monitorBaseParam);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -264,7 +264,11 @@ public class CommTerminalServiceImpl implements CommTerminalService {
|
|||||||
public List<DeptGetSubStationDTO.Info> deptSubStationInfo(DeptGetLineParam deptGetLineParam) {
|
public List<DeptGetSubStationDTO.Info> deptSubStationInfo(DeptGetLineParam deptGetLineParam) {
|
||||||
List<DeptGetSubStationDTO.Info> result = new ArrayList<>();
|
List<DeptGetSubStationDTO.Info> result = new ArrayList<>();
|
||||||
List<DeptGetBase> temDept = getDeptChildrenByParent(deptGetLineParam);
|
List<DeptGetBase> temDept = getDeptChildrenByParent(deptGetLineParam);
|
||||||
List<TerminalGetBase.Extend> anExtends = deptLineService.orgSubStationInfoGet(filterDataTypeNew(deptGetLineParam.getServerName()), deptGetLineParam.getPowerFlag(), deptGetLineParam.getLineRunFlag(), deptGetLineParam.getIsUpToGrid());
|
List<TerminalGetBase.Extend> anExtends = deptLineService.orgSubStationInfoGet(filterDataTypeNew(deptGetLineParam.getServerName()),
|
||||||
|
deptGetLineParam.getPowerFlag(),
|
||||||
|
deptGetLineParam.getLineRunFlag(),
|
||||||
|
deptGetLineParam.getIsUpToGrid(),
|
||||||
|
deptGetLineParam.getSearchValue());
|
||||||
Map<String, List<TerminalGetBase.Extend>> orgSub = anExtends.stream().collect(Collectors.groupingBy(TerminalGetBase::getUnitId));
|
Map<String, List<TerminalGetBase.Extend>> orgSub = anExtends.stream().collect(Collectors.groupingBy(TerminalGetBase::getUnitId));
|
||||||
Map<String, String> deptNameMap = temDept.stream().collect(Collectors.toMap(DeptGetBase::getUnitId, DeptGetBase::getUnitName));
|
Map<String, String> deptNameMap = temDept.stream().collect(Collectors.toMap(DeptGetBase::getUnitId, DeptGetBase::getUnitName));
|
||||||
temDept.forEach(item -> {
|
temDept.forEach(item -> {
|
||||||
|
|||||||
@@ -18,32 +18,31 @@ import com.njcn.dataProcess.enums.DataCleanEnum;
|
|||||||
import com.njcn.dataProcess.param.DataCleanParam;
|
import com.njcn.dataProcess.param.DataCleanParam;
|
||||||
import com.njcn.dataProcess.param.LineCountEvaluateParam;
|
import com.njcn.dataProcess.param.LineCountEvaluateParam;
|
||||||
import com.njcn.dataProcess.pojo.dto.DataLimitRateDetailDto;
|
import com.njcn.dataProcess.pojo.dto.DataLimitRateDetailDto;
|
||||||
|
import com.njcn.dataProcess.pojo.dto.DataLimitRateDto;
|
||||||
import com.njcn.dataProcess.pojo.dto.DataLimitTargetDto;
|
import com.njcn.dataProcess.pojo.dto.DataLimitTargetDto;
|
||||||
import com.njcn.dataProcess.pojo.dto.PqReasonableRangeDto;
|
import com.njcn.dataProcess.pojo.dto.PqReasonableRangeDto;
|
||||||
import com.njcn.device.biz.commApi.CommTerminalGeneralClient;
|
|
||||||
import com.njcn.device.biz.enums.DeviceResponseEnum;
|
import com.njcn.device.biz.enums.DeviceResponseEnum;
|
||||||
import com.njcn.device.biz.pojo.dto.LineDevGetDTO;
|
import com.njcn.device.biz.pojo.dto.LineDevGetDTO;
|
||||||
import com.njcn.device.biz.pojo.po.Overlimit;
|
import com.njcn.device.biz.pojo.po.Overlimit;
|
||||||
import com.njcn.device.line.mapper.LineMapper;
|
import com.njcn.device.line.mapper.LineMapper;
|
||||||
|
import com.njcn.device.line.service.DeptLineService;
|
||||||
import com.njcn.device.overlimit.service.IOverLimitService;
|
import com.njcn.device.overlimit.service.IOverLimitService;
|
||||||
import com.njcn.device.pq.mapper.DataVerifyMapper;
|
import com.njcn.device.pq.mapper.DataVerifyMapper;
|
||||||
import com.njcn.device.pq.mapper.PqDataVerifyBakMapper;
|
|
||||||
import com.njcn.device.pq.pojo.param.dataClean.MonitorBaseParam;
|
import com.njcn.device.pq.pojo.param.dataClean.MonitorBaseParam;
|
||||||
import com.njcn.device.pq.pojo.po.DataVerify;
|
import com.njcn.device.pq.pojo.po.DataVerify;
|
||||||
|
import com.njcn.device.pq.pojo.po.DeptLine;
|
||||||
|
import com.njcn.device.pq.pojo.po.PqDataVerifyBak;
|
||||||
import com.njcn.device.pq.pojo.vo.AreaLineInfoVO;
|
import com.njcn.device.pq.pojo.vo.AreaLineInfoVO;
|
||||||
import com.njcn.device.pq.pojo.vo.LineDetailDataVO;
|
import com.njcn.device.pq.pojo.vo.LineDetailDataVO;
|
||||||
import com.njcn.device.pq.pojo.vo.dataClean.*;
|
import com.njcn.device.pq.pojo.vo.dataClean.*;
|
||||||
import com.njcn.device.pq.service.CommTerminalService;
|
import com.njcn.device.pq.service.CommTerminalService;
|
||||||
import com.njcn.device.pq.service.IDataVerifyService;
|
import com.njcn.device.pq.service.IDataVerifyService;
|
||||||
import com.njcn.harmonic.pojo.po.RStatDataVD;
|
|
||||||
import com.njcn.supervision.api.UserLedgerFeignClient;
|
import com.njcn.supervision.api.UserLedgerFeignClient;
|
||||||
import com.njcn.supervision.pojo.vo.user.NewUserReportVO;
|
|
||||||
import com.njcn.system.api.DicDataFeignClient;
|
import com.njcn.system.api.DicDataFeignClient;
|
||||||
import com.njcn.system.api.DictTreeFeignClient;
|
import com.njcn.system.api.DictTreeFeignClient;
|
||||||
import com.njcn.system.enums.DicDataEnum;
|
import com.njcn.system.enums.DicDataEnum;
|
||||||
import com.njcn.system.enums.DicDataTypeEnum;
|
import com.njcn.system.enums.DicDataTypeEnum;
|
||||||
import com.njcn.system.pojo.po.DictData;
|
import com.njcn.system.pojo.po.DictData;
|
||||||
import com.njcn.system.pojo.po.SysDicTreePO;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
@@ -51,7 +50,6 @@ import org.springframework.stereotype.Service;
|
|||||||
|
|
||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
import java.math.BigDecimal;
|
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.time.format.DateTimeFormatter;
|
import java.time.format.DateTimeFormatter;
|
||||||
@@ -73,28 +71,20 @@ import java.util.stream.Collectors;
|
|||||||
public class DataVerifyServiceImpl extends ServiceImpl<DataVerifyMapper, DataVerify> implements IDataVerifyService {
|
public class DataVerifyServiceImpl extends ServiceImpl<DataVerifyMapper, DataVerify> implements IDataVerifyService {
|
||||||
|
|
||||||
private static final Logger logger = LoggerFactory.getLogger(DataVerifyServiceImpl.class);
|
private static final Logger logger = LoggerFactory.getLogger(DataVerifyServiceImpl.class);
|
||||||
|
|
||||||
private static final String SEPARATOR = "&";
|
private static final String SEPARATOR = "&";
|
||||||
private static final DateTimeFormatter DATE_FORMAT = DateTimeFormatter.ofPattern(DatePattern.NORM_DATE_PATTERN);
|
private static final DateTimeFormatter DATE_FORMAT = DateTimeFormatter.ofPattern(DatePattern.NORM_DATE_PATTERN);
|
||||||
|
|
||||||
private final CommTerminalService commTerminalService;
|
private final CommTerminalService commTerminalService;
|
||||||
|
|
||||||
private final LineMapper lineMapper;
|
private final LineMapper lineMapper;
|
||||||
|
|
||||||
private final DictTreeFeignClient dictTreeFeignClient;
|
private final DictTreeFeignClient dictTreeFeignClient;
|
||||||
|
|
||||||
private final UserLedgerFeignClient userLedgerFeignClient;
|
private final UserLedgerFeignClient userLedgerFeignClient;
|
||||||
|
|
||||||
private final PqReasonableRangeFeignClient pqReasonableRangeFeignClient;
|
private final PqReasonableRangeFeignClient pqReasonableRangeFeignClient;
|
||||||
|
|
||||||
private final DataLimitTargetFeignClient dataLimitTargetFeignClient;
|
private final DataLimitTargetFeignClient dataLimitTargetFeignClient;
|
||||||
|
|
||||||
private final DataLimitRateFeignClient dataLimitRateFeignClient;
|
private final DataLimitRateFeignClient dataLimitRateFeignClient;
|
||||||
|
|
||||||
private final DataLimitRateDetailFeignClient dataLimitRateDetailFeignClient;
|
private final DataLimitRateDetailFeignClient dataLimitRateDetailFeignClient;
|
||||||
private final DicDataFeignClient dicDataFeignClient;
|
private final DicDataFeignClient dicDataFeignClient;
|
||||||
|
|
||||||
private final IOverLimitService overLimitService;
|
private final IOverLimitService overLimitService;
|
||||||
|
private final DeptLineService deptLineService;
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public VerifyMonitorVO getMonitorVerifyData(MonitorBaseParam monitorBaseParam) {
|
public VerifyMonitorVO getMonitorVerifyData(MonitorBaseParam monitorBaseParam) {
|
||||||
@@ -249,137 +239,50 @@ public class DataVerifyServiceImpl extends ServiceImpl<DataVerifyMapper, DataVer
|
|||||||
List<DetailAbnormalVO> result = new ArrayList<>();
|
List<DetailAbnormalVO> result = new ArrayList<>();
|
||||||
List<LineDetailDataVO> lineDetailList = lineMapper.getLineDetailDataVO(monitorBaseParam.getMonitorIds());
|
List<LineDetailDataVO> lineDetailList = lineMapper.getLineDetailDataVO(monitorBaseParam.getMonitorIds());
|
||||||
Map<String, LineDetailDataVO> lineDetailMap = lineDetailList.stream().collect(Collectors.toMap(LineDetailDataVO::getLineId, Function.identity()));
|
Map<String, LineDetailDataVO> lineDetailMap = lineDetailList.stream().collect(Collectors.toMap(LineDetailDataVO::getLineId, Function.identity()));
|
||||||
|
|
||||||
LineCountEvaluateParam lineCountEvaluateParam = new LineCountEvaluateParam();
|
LineCountEvaluateParam lineCountEvaluateParam = new LineCountEvaluateParam();
|
||||||
lineCountEvaluateParam.setLineId(monitorBaseParam.getMonitorIds());
|
lineCountEvaluateParam.setLineId(monitorBaseParam.getMonitorIds());
|
||||||
lineCountEvaluateParam.setStartTime(monitorBaseParam.getSearchBeginTime());
|
lineCountEvaluateParam.setStartTime(monitorBaseParam.getSearchBeginTime());
|
||||||
lineCountEvaluateParam.setEndTime(monitorBaseParam.getSearchEndTime());
|
lineCountEvaluateParam.setEndTime(monitorBaseParam.getSearchEndTime());
|
||||||
List<DataLimitRateDetailDto> dataLimitRateDetailDtoList = dataLimitRateDetailFeignClient.getRawData(lineCountEvaluateParam).getData();
|
List<DataLimitTargetDto> dataLimitTargetDtoList = dataLimitTargetFeignClient.getRawData(lineCountEvaluateParam).getData();
|
||||||
Map<LocalDate, List<DataLimitRateDetailDto>> limitMap = dataLimitRateDetailDtoList.stream().collect(Collectors.groupingBy(DataLimitRateDetailDto::getTime));
|
Map<String, List<DataLimitTargetDto>> limitMap = dataLimitTargetDtoList.stream().filter(it -> (it.getAllTime() > 0 || it.getFlickerAllTime() > 0)).collect(Collectors.groupingBy(DataLimitTargetDto::getLineId));
|
||||||
|
limitMap.forEach((lineId, value) -> {
|
||||||
limitMap.forEach((date, list) -> {
|
|
||||||
Map<String, DataLimitRateDetailDto> map = list.stream().collect(Collectors.toMap(DataLimitRateDetailDto::getLineId, Function.identity()));
|
|
||||||
map.forEach((lineId, line) -> {
|
|
||||||
LineDetailDataVO lineInfoVO = lineDetailMap.get(lineId);
|
LineDetailDataVO lineInfoVO = lineDetailMap.get(lineId);
|
||||||
Integer timeInterval = lineInfoVO.getTimeInterval();
|
|
||||||
Set<String> timeSet = new HashSet<>();
|
|
||||||
List<String> specialTargetList = new ArrayList<>();
|
|
||||||
String jonsStr = "";
|
|
||||||
if (monitorBaseParam.getTargetKey().equals(DicDataEnum.VOLTAGE_DEV.getCode())) {
|
|
||||||
//电压偏差
|
|
||||||
jonsStr = line.getVoltageDevOvertime();
|
|
||||||
} else if (monitorBaseParam.getTargetKey().equals(DicDataEnum.FLICKER.getCode())) {
|
|
||||||
jonsStr = line.getFlickerOvertime();
|
|
||||||
} else if (monitorBaseParam.getTargetKey().equals(DicDataEnum.phase_Voltage.getCode())) {
|
|
||||||
jonsStr = line.getUbalanceOvertime();
|
|
||||||
} else if (monitorBaseParam.getTargetKey().equals(DicDataEnum.FREQUENCY_DEV.getCode())) {
|
|
||||||
jonsStr = line.getFreqDevOvertime();
|
|
||||||
} else if (monitorBaseParam.getTargetKey().equals(DicDataEnum.NEG_CURRENT.getCode())) {
|
|
||||||
jonsStr = line.getINegOvertime();
|
|
||||||
} else if (monitorBaseParam.getTargetKey().equals(DicDataEnum.THD_V.getCode())) {
|
|
||||||
jonsStr = line.getUaberranceOvertime();
|
|
||||||
} else if (monitorBaseParam.getTargetKey().equals(DicDataEnum.HARMONIC_VOLTAGE.getCode())) {
|
|
||||||
for (int i = 2; i <= 25; i++) {
|
|
||||||
String uHarmKey = "uharm" + i + "Overtime";
|
|
||||||
String json = getFieldValueForDetail(line, uHarmKey);
|
|
||||||
if (StrUtil.isNotBlank(json)) {
|
|
||||||
specialTargetList.add(json);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else if (monitorBaseParam.getTargetKey().equals(DicDataEnum.HARMONIC_CURRENT.getCode())) {
|
|
||||||
for (int i = 2; i <= 25; i++) {
|
|
||||||
String uHarmKey = "iharm" + i + "Overtime";
|
|
||||||
String json = getFieldValueForDetail(line, uHarmKey);
|
|
||||||
if (StrUtil.isNotBlank(json)) {
|
|
||||||
specialTargetList.add(json);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else if (monitorBaseParam.getTargetKey().equals(DicDataEnum.INTERHARMONIC_VOLTAGE.getCode())) {
|
|
||||||
for (int i = 1; i <= 16; i++) {
|
|
||||||
String uHarmKey = "inuharm" + i + "Overtime";
|
|
||||||
String json = getFieldValueForDetail(line, uHarmKey);
|
|
||||||
if (StrUtil.isNotBlank(json)) {
|
|
||||||
specialTargetList.add(json);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (StrUtil.isNotBlank(line.getVoltageDevOvertime())) {
|
|
||||||
specialTargetList.add(line.getVoltageDevOvertime());
|
|
||||||
}
|
|
||||||
if (StrUtil.isNotBlank(line.getFlickerOvertime())) {
|
|
||||||
specialTargetList.add(line.getFlickerOvertime());
|
|
||||||
}
|
|
||||||
if (StrUtil.isNotBlank(line.getUbalanceOvertime())) {
|
|
||||||
specialTargetList.add(line.getUbalanceOvertime());
|
|
||||||
}
|
|
||||||
if (StrUtil.isNotBlank(line.getFreqDevOvertime())) {
|
|
||||||
specialTargetList.add(line.getFreqDevOvertime());
|
|
||||||
}
|
|
||||||
if (StrUtil.isNotBlank(line.getINegOvertime())) {
|
|
||||||
specialTargetList.add(line.getINegOvertime());
|
|
||||||
}
|
|
||||||
if (StrUtil.isNotBlank(line.getUaberranceOvertime())) {
|
|
||||||
specialTargetList.add(line.getUaberranceOvertime());
|
|
||||||
}
|
|
||||||
|
|
||||||
for (int i = 2; i <= 25; i++) {
|
|
||||||
String uHarmKey = "uharm" + i + "Overtime";
|
|
||||||
String json = getFieldValueForDetail(line, uHarmKey);
|
|
||||||
if (StrUtil.isNotBlank(json)) {
|
|
||||||
specialTargetList.add(json);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
for (int i = 2; i <= 25; i++) {
|
|
||||||
String uHarmKey = "iharm" + i + "Overtime";
|
|
||||||
String json = getFieldValueForDetail(line, uHarmKey);
|
|
||||||
if (StrUtil.isNotBlank(json)) {
|
|
||||||
specialTargetList.add(json);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
for (int i = 1; i <= 16; i++) {
|
|
||||||
String uHarmKey = "inuharm" + i + "Overtime";
|
|
||||||
String json = getFieldValueForDetail(line, uHarmKey);
|
|
||||||
if (StrUtil.isNotBlank(json)) {
|
|
||||||
specialTargetList.add(json);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (CollUtil.isNotEmpty(specialTargetList)) {
|
|
||||||
for (String str : specialTargetList) {
|
|
||||||
JSONArray jsonArray = new JSONArray(str);
|
|
||||||
List<JsonBaseVO> jsonBaseVOList = jsonArray.toList(JsonBaseVO.class);
|
|
||||||
jsonBaseVOList.forEach(it -> {
|
|
||||||
timeSet.addAll(Arrays.asList(it.getTime().split(StrUtil.COMMA)));
|
|
||||||
});
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (StrUtil.isNotBlank(jonsStr)) {
|
|
||||||
JSONArray jsonArray = new JSONArray(jonsStr);
|
|
||||||
List<JsonBaseVO> jsonBaseVOList = jsonArray.toList(JsonBaseVO.class);
|
|
||||||
jsonBaseVOList.forEach(it -> {
|
|
||||||
timeSet.addAll(Arrays.asList(it.getTime().split(StrUtil.COMMA)));
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (timeSet.size() > 0) {
|
|
||||||
DetailAbnormalVO detailAbnormalVO = new DetailAbnormalVO();
|
DetailAbnormalVO detailAbnormalVO = new DetailAbnormalVO();
|
||||||
detailAbnormalVO.setMonitorId(lineId);
|
detailAbnormalVO.setMonitorId(lineId);
|
||||||
detailAbnormalVO.setDate(date.format(DATE_FORMAT));
|
List<DetailAbnormalVO.TimeAndTargetKey> targetKeyList = new ArrayList<>();
|
||||||
|
DetailAbnormalVO.TimeAndTargetKey targetKey;
|
||||||
|
for (DataLimitTargetDto dto : value) {
|
||||||
|
List<VerifyTargetVO> verifyS = assLimitTarget(Arrays.asList(dto)).stream().filter(x -> x.getIds().size() > 0).collect(Collectors.toList());
|
||||||
|
if (StrUtil.isNotBlank(monitorBaseParam.getTargetKey())) {
|
||||||
|
List<VerifyTargetVO> verify = verifyS.stream().filter(x -> x.getKey().equals(monitorBaseParam.getTargetKey())).collect(Collectors.toList());
|
||||||
|
if (CollUtil.isNotEmpty(verify)) {
|
||||||
|
targetKey = new DetailAbnormalVO.TimeAndTargetKey();
|
||||||
|
targetKey.setDate(dto.getTime().format(DatePattern.NORM_DATE_FORMATTER));
|
||||||
|
targetKey.setTargetKeys(verify);
|
||||||
|
targetKeyList.add(targetKey);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
targetKey = new DetailAbnormalVO.TimeAndTargetKey();
|
||||||
|
targetKey.setDate(dto.getTime().format(DatePattern.NORM_DATE_FORMATTER));
|
||||||
|
targetKey.setTargetKeys(verifyS);
|
||||||
|
targetKeyList.add(targetKey);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
detailAbnormalVO.setDateTargetList(targetKeyList);
|
||||||
detailAbnormalVO.setMonitorName(lineInfoVO.getLineName());
|
detailAbnormalVO.setMonitorName(lineInfoVO.getLineName());
|
||||||
detailAbnormalVO.setBdName(lineInfoVO.getBdName());
|
detailAbnormalVO.setBdName(lineInfoVO.getBdName());
|
||||||
detailAbnormalVO.setTimeSum(String.valueOf(timeInterval * timeSet.size()));
|
|
||||||
detailAbnormalVO.setTargetKey(monitorBaseParam.getTargetKey());
|
detailAbnormalVO.setTargetKey(monitorBaseParam.getTargetKey());
|
||||||
result.add(detailAbnormalVO);
|
result.add(detailAbnormalVO);
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<DetailAbnormalVO.DetailLimitInnerVO> monitorLimitTableDetail(MonitorBaseParam monitorBaseParam) {
|
public DetailAbnormalVO.DetailLimitCountVO monitorLimitTableDetail(MonitorBaseParam monitorBaseParam) {
|
||||||
|
List<LineDetailDataVO> lineDetailList = lineMapper.getLineDetailDataVO(monitorBaseParam.getMonitorIds());
|
||||||
|
Map<String, LineDetailDataVO> lineDetailMap = lineDetailList.stream().collect(Collectors.toMap(LineDetailDataVO::getLineId, Function.identity()));
|
||||||
|
DetailAbnormalVO.DetailLimitCountVO v = new DetailAbnormalVO.DetailLimitCountVO();
|
||||||
List<DetailAbnormalVO.DetailLimitInnerVO> result = new ArrayList<>();
|
List<DetailAbnormalVO.DetailLimitInnerVO> result = new ArrayList<>();
|
||||||
LineCountEvaluateParam lineCountEvaluateParam = new LineCountEvaluateParam();
|
LineCountEvaluateParam lineCountEvaluateParam = new LineCountEvaluateParam();
|
||||||
lineCountEvaluateParam.setLineId(Collections.singletonList(monitorBaseParam.getMonitorIds().get(0)));
|
lineCountEvaluateParam.setLineId(Collections.singletonList(monitorBaseParam.getMonitorIds().get(0)));
|
||||||
@@ -387,7 +290,7 @@ public class DataVerifyServiceImpl extends ServiceImpl<DataVerifyMapper, DataVer
|
|||||||
lineCountEvaluateParam.setEndTime(monitorBaseParam.getSearchBeginTime());
|
lineCountEvaluateParam.setEndTime(monitorBaseParam.getSearchBeginTime());
|
||||||
List<DataLimitRateDetailDto> dtoList = dataLimitRateDetailFeignClient.getRawData(lineCountEvaluateParam).getData();
|
List<DataLimitRateDetailDto> dtoList = dataLimitRateDetailFeignClient.getRawData(lineCountEvaluateParam).getData();
|
||||||
if (CollUtil.isEmpty(dtoList)) {
|
if (CollUtil.isEmpty(dtoList)) {
|
||||||
return result;
|
return v;
|
||||||
}
|
}
|
||||||
|
|
||||||
DataLimitRateDetailDto dto = dtoList.get(0);
|
DataLimitRateDetailDto dto = dtoList.get(0);
|
||||||
@@ -397,7 +300,10 @@ public class DataVerifyServiceImpl extends ServiceImpl<DataVerifyMapper, DataVer
|
|||||||
} else {
|
} else {
|
||||||
processAllTargets(dto, targetMap, result);
|
processAllTargets(dto, targetMap, result);
|
||||||
}
|
}
|
||||||
return result;
|
int size = result.stream().map(DetailAbnormalVO.DetailLimitInnerVO::getTime).collect(Collectors.toSet()).size();
|
||||||
|
v.setTimeSum(lineDetailMap.get(monitorBaseParam.getMonitorIds().get(0)).getTimeInterval() * size);
|
||||||
|
v.setTime(result);
|
||||||
|
return v;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -545,7 +451,12 @@ public class DataVerifyServiceImpl extends ServiceImpl<DataVerifyMapper, DataVer
|
|||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
if(CollUtil.isNotEmpty(uaberrance)){
|
||||||
|
PqReasonableRangeDto dto = dataVCode.get(DataCleanEnum.VThd.getCode());
|
||||||
|
DetailAbnormalVO.DetailLimitInnerVO val = reasonAble(uaberrance, dto);
|
||||||
|
assess.setUharmData(NumberUtil.round(val.getVal(), 2).doubleValue());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
//谐波电流
|
//谐波电流
|
||||||
if (CollUtil.isNotEmpty(iharm)) {
|
if (CollUtil.isNotEmpty(iharm)) {
|
||||||
@@ -576,7 +487,7 @@ public class DataVerifyServiceImpl extends ServiceImpl<DataVerifyMapper, DataVer
|
|||||||
String[] split = val.getTargetName().split("次");
|
String[] split = val.getTargetName().split("次");
|
||||||
try {
|
try {
|
||||||
Class<?> clazz = overLimitDataById.getClass();
|
Class<?> clazz = overLimitDataById.getClass();
|
||||||
String methodName = "getInuharm" + split[0];
|
String methodName = "getInuharm" + (int)(Double.valueOf(split[0])+0.5);
|
||||||
Method method = clazz.getMethod(methodName);
|
Method method = clazz.getMethod(methodName);
|
||||||
Float value = (Float) method.invoke(overLimitDataById);
|
Float value = (Float) method.invoke(overLimitDataById);
|
||||||
assess.setInuharmLimit(value);
|
assess.setInuharmLimit(value);
|
||||||
@@ -672,6 +583,7 @@ public class DataVerifyServiceImpl extends ServiceImpl<DataVerifyMapper, DataVer
|
|||||||
processHarmonicTarget(dto, targetMap, DicDataEnum.HARMONIC_CURRENT.getCode(), "iharm", 2, 25, result);
|
processHarmonicTarget(dto, targetMap, DicDataEnum.HARMONIC_CURRENT.getCode(), "iharm", 2, 25, result);
|
||||||
processHarmonicTarget(dto, targetMap, DicDataEnum.INTERHARMONIC_VOLTAGE.getCode(), "inuharm", 1, 16, result);
|
processHarmonicTarget(dto, targetMap, DicDataEnum.INTERHARMONIC_VOLTAGE.getCode(), "inuharm", 1, 16, result);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void processStandardTarget(DataLimitRateDetailDto dto, Map<String, DictData> targetMap,
|
private void processStandardTarget(DataLimitRateDetailDto dto, Map<String, DictData> targetMap,
|
||||||
String targetCode, String data,
|
String targetCode, String data,
|
||||||
List<DetailAbnormalVO.DetailLimitInnerVO> result) {
|
List<DetailAbnormalVO.DetailLimitInnerVO> result) {
|
||||||
@@ -817,8 +729,13 @@ public class DataVerifyServiceImpl extends ServiceImpl<DataVerifyMapper, DataVer
|
|||||||
String fieldName = prefix + i + "Overtime";
|
String fieldName = prefix + i + "Overtime";
|
||||||
String json = getFieldValueForDetail(dto, fieldName);
|
String json = getFieldValueForDetail(dto, fieldName);
|
||||||
if (StrUtil.isNotBlank(json)) {
|
if (StrUtil.isNotBlank(json)) {
|
||||||
|
if (end == 16) {
|
||||||
|
result.add(json + SEPARATOR + (i - 0.5));
|
||||||
|
} else {
|
||||||
result.add(json + SEPARATOR + i);
|
result.add(json + SEPARATOR + i);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -976,7 +893,7 @@ public class DataVerifyServiceImpl extends ServiceImpl<DataVerifyMapper, DataVer
|
|||||||
List<LocalDate> dateList = list.stream().map(it -> it.getTime().toLocalDate()).distinct().sorted(Comparator.comparing(Function.identity())).collect(Collectors.toList());
|
List<LocalDate> dateList = list.stream().map(it -> it.getTime().toLocalDate()).distinct().sorted(Comparator.comparing(Function.identity())).collect(Collectors.toList());
|
||||||
processTable(monitorBaseParam, dateList, result, key);
|
processTable(monitorBaseParam, dateList, result, key);
|
||||||
});
|
});
|
||||||
dealTableResult(result);
|
dealTableResult(result, monitorBaseParam.getSearchValue());
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -988,7 +905,7 @@ public class DataVerifyServiceImpl extends ServiceImpl<DataVerifyMapper, DataVer
|
|||||||
List<LocalDate> dateList = list.stream().map(DataLimitTargetDto::getTime).distinct().sorted(Comparator.comparing(Function.identity())).collect(Collectors.toList());
|
List<LocalDate> dateList = list.stream().map(DataLimitTargetDto::getTime).distinct().sorted(Comparator.comparing(Function.identity())).collect(Collectors.toList());
|
||||||
processTable(monitorBaseParam, dateList, result, key);
|
processTable(monitorBaseParam, dateList, result, key);
|
||||||
});
|
});
|
||||||
dealTableResult(result);
|
dealTableResult(result, monitorBaseParam.getSearchValue());
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1015,34 +932,44 @@ public class DataVerifyServiceImpl extends ServiceImpl<DataVerifyMapper, DataVer
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void dealTableResult(List<PowerQualityIndicatorsVO> result) {
|
private void dealTableResult(List<PowerQualityIndicatorsVO> result, String searchValue) {
|
||||||
if (CollUtil.isNotEmpty(result)) {
|
if (CollUtil.isNotEmpty(result)) {
|
||||||
List<SysDicTreePO> dicTreePOList = dictTreeFeignClient.queryAllByType(Integer.valueOf(DicDataEnum.Obj_Type.getCode())).getData();
|
// List<SysDicTreePO> dicTreePOList = dictTreeFeignClient.queryAllByType(Integer.valueOf(DicDataEnum.Obj_Type.getCode())).getData();
|
||||||
Map<String, SysDicTreePO> sysDicTreePOMap = dicTreePOList.stream().collect(Collectors.toMap(SysDicTreePO::getId, Function.identity()));
|
// Map<String, SysDicTreePO> sysDicTreePOMap = dicTreePOList.stream().collect(Collectors.toMap(SysDicTreePO::getId, Function.identity()));
|
||||||
List<String> ids = result.stream().map(PowerQualityIndicatorsVO::getMonitorId).distinct().collect(Collectors.toList());
|
List<String> ids = result.stream().map(PowerQualityIndicatorsVO::getMonitorId).distinct().collect(Collectors.toList());
|
||||||
List<AreaLineInfoVO> areaLineInfoVOList = lineMapper.getBaseLineAreaInfo(ids, null, null);
|
List<AreaLineInfoVO> areaLineInfoVOList = lineMapper.getBaseLineAreaInfo(ids, searchValue, null);
|
||||||
Map<String, AreaLineInfoVO> areaMap = areaLineInfoVOList.stream().collect(Collectors.toMap(AreaLineInfoVO::getLineId, Function.identity()));
|
Map<String, PowerQualityIndicatorsVO> areaMap = result.stream().collect(Collectors.toMap(PowerQualityIndicatorsVO::getMonitorId, Function.identity()));
|
||||||
|
List<DeptLine> deptLines = deptLineService.selectDeptLine(ids);
|
||||||
List<String> objIds = areaLineInfoVOList.stream().map(AreaLineInfoVO::getObjId).distinct().collect(Collectors.toList());
|
Map<String, String> deptName = deptLines.stream().collect(Collectors.toMap(DeptLine::getLineId, DeptLine::getId));
|
||||||
List<NewUserReportVO> userLedgerVOList = userLedgerFeignClient.getUserReportByIds(objIds).getData();
|
// List<String> objIds = areaLineInfoVOList.stream().map(AreaLineInfoVO::getObjId).distinct().collect(Collectors.toList());
|
||||||
Map<String, NewUserReportVO> userMap = userLedgerVOList.stream().collect(Collectors.toMap(NewUserReportVO::getId, Function.identity()));
|
// List<NewUserReportVO> userLedgerVOList = userLedgerFeignClient.getUserReportByIds(objIds).getData();
|
||||||
result.forEach(it -> {
|
// Map<String, NewUserReportVO> userMap = userLedgerVOList.stream().collect(Collectors.toMap(NewUserReportVO::getId, Function.identity()));
|
||||||
if (areaMap.containsKey(it.getMonitorId())) {
|
List<PowerQualityIndicatorsVO> info = new ArrayList<>();
|
||||||
AreaLineInfoVO areaLineInfoVO = areaMap.get(it.getMonitorId());
|
for (AreaLineInfoVO lineDetail : areaLineInfoVOList) {
|
||||||
it.setMonitorName(areaLineInfoVO.getLineName());
|
if (areaMap.containsKey(lineDetail.getLineId())) {
|
||||||
it.setStationName(areaLineInfoVO.getSubName());
|
PowerQualityIndicatorsVO it = areaMap.get(lineDetail.getLineId());
|
||||||
it.setDevName(areaLineInfoVO.getDeviceName());
|
it.setMonitorName(lineDetail.getLineName());
|
||||||
it.setVoltageLevel(areaLineInfoVO.getVoltageScale());
|
it.setStationName(lineDetail.getSubName());
|
||||||
it.setIp(Base64.encode(areaLineInfoVO.getIp()));
|
if (deptName.containsKey(lineDetail.getLineId())) {
|
||||||
it.setManufacturer(areaLineInfoVO.getManufacturer());
|
it.setCity(deptName.get(lineDetail.getLineId()));
|
||||||
if (sysDicTreePOMap.containsKey(areaLineInfoVO.getSmallObjType())) {
|
|
||||||
it.setObjType(sysDicTreePOMap.get(areaLineInfoVO.getSmallObjType()).getName());
|
|
||||||
}
|
}
|
||||||
if (userMap.containsKey(areaLineInfoVO.getObjId())) {
|
it.setDevName(lineDetail.getDeviceName());
|
||||||
it.setObjName(userMap.get(areaLineInfoVO.getObjId()).getProjectName());
|
it.setVoltageLevel(lineDetail.getVoltageScale());
|
||||||
|
it.setIp(Base64.encode(lineDetail.getIp()));
|
||||||
|
it.setManufacturer(lineDetail.getManufacturer());
|
||||||
|
it.setObjType(lineDetail.getLoadType());
|
||||||
|
it.setObjName(lineDetail.getObjName());
|
||||||
|
info.add(it);
|
||||||
|
// if (sysDicTreePOMap.containsKey(areaLineInfoVO.getSmallObjType())) {
|
||||||
|
// it.setObjType(sysDicTreePOMap.get(areaLineInfoVO.getSmallObjType()).getName());
|
||||||
|
// }
|
||||||
|
// if (userMap.containsKey(areaLineInfoVO.getObjId())) {
|
||||||
|
// it.setObjName(userMap.get(areaLineInfoVO.getObjId()).getProjectName());
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
result.clear();
|
||||||
|
result.addAll(info);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -350,8 +350,10 @@ public class DeviceRunEvaluateServiceImpl implements DeviceRunEvaluateService {
|
|||||||
Map<String, String> deptMap = deptList.stream().collect(Collectors.toMap(Dept::getId, Dept::getName));
|
Map<String, String> deptMap = deptList.stream().collect(Collectors.toMap(Dept::getId, Dept::getName));
|
||||||
|
|
||||||
List<DeviceRunEvaluateVO.Detail> info = new ArrayList<>();
|
List<DeviceRunEvaluateVO.Detail> info = new ArrayList<>();
|
||||||
|
List<Integer> devRun=ObjectUtil.isNull(param.getLineRunFlag()) ? null : Arrays.asList(param.getLineRunFlag());
|
||||||
|
param.setLineRunFlag(null);
|
||||||
//获取终端台账类信息
|
//获取终端台账类信息
|
||||||
List<GeneralDeviceDTO> deviceInfo = deviceService.getDeviceInfo(param, ObjectUtil.isNull(param.getLineRunFlag()) ? null : Arrays.asList(param.getLineRunFlag()), Arrays.asList(1));
|
List<GeneralDeviceDTO> deviceInfo = deviceService.getDeviceInfo(param, devRun, Arrays.asList(1));
|
||||||
if (CollUtil.isNotEmpty(deviceInfo)) {
|
if (CollUtil.isNotEmpty(deviceInfo)) {
|
||||||
List<String> deviceIds = deviceInfo.stream()
|
List<String> deviceIds = deviceInfo.stream()
|
||||||
.flatMap(x -> x.getDeviceIndexes().stream()).collect(Collectors.toList())
|
.flatMap(x -> x.getDeviceIndexes().stream()).collect(Collectors.toList())
|
||||||
@@ -382,8 +384,6 @@ public class DeviceRunEvaluateServiceImpl implements DeviceRunEvaluateService {
|
|||||||
onlineRateParam.setIds(lineIds);
|
onlineRateParam.setIds(lineIds);
|
||||||
List<PqDataVerifyCount> sumVerify = pqDataVerifyCountService.getSumVerify(onlineRateParam);
|
List<PqDataVerifyCount> sumVerify = pqDataVerifyCountService.getSumVerify(onlineRateParam);
|
||||||
|
|
||||||
//超标率
|
|
||||||
// List<RStatLimitRateDPO> limitRatePOList = rStatLimitRateDClient.monitorIdsGetLimitInfo(rStatLimitQueryParam).getData();
|
|
||||||
|
|
||||||
for (GeneralDeviceDTO dto : deviceInfo) {
|
for (GeneralDeviceDTO dto : deviceInfo) {
|
||||||
detail = new DeviceRunEvaluateVO.Detail();
|
detail = new DeviceRunEvaluateVO.Detail();
|
||||||
@@ -391,7 +391,7 @@ public class DeviceRunEvaluateServiceImpl implements DeviceRunEvaluateService {
|
|||||||
detail.setCount(dto.getDeviceIndexes().size());
|
detail.setCount(dto.getDeviceIndexes().size());
|
||||||
detail.setOnline(onLineRate(onlineRateByDev, dto.getDeviceIndexes()));
|
detail.setOnline(onLineRate(onlineRateByDev, dto.getDeviceIndexes()));
|
||||||
detail.setIntegrity(integrity(integrityList, dto.getLineIndexes()));
|
detail.setIntegrity(integrity(integrityList, dto.getLineIndexes()));
|
||||||
detail.setQualified(verify(sumVerify, dto.getLineIndexes()));
|
detail.setQualified(verifyDev(sumVerify, dto.getLineIndexes(), dto.getDeviceIndexes()));
|
||||||
detail.setScore(ONINTEGRITY.multiply(detail.getIntegrity())
|
detail.setScore(ONINTEGRITY.multiply(detail.getIntegrity())
|
||||||
.add(ONLINERATE.multiply(detail.getOnline())
|
.add(ONLINERATE.multiply(detail.getOnline())
|
||||||
.add(LIMITRATE.multiply(detail.getQualified()))).stripTrailingZeros().setScale(2, RoundingMode.HALF_UP));
|
.add(LIMITRATE.multiply(detail.getQualified()))).stripTrailingZeros().setScale(2, RoundingMode.HALF_UP));
|
||||||
@@ -434,18 +434,33 @@ public class DeviceRunEvaluateServiceImpl implements DeviceRunEvaluateService {
|
|||||||
return info;
|
return info;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private BigDecimal verifyDev(List<PqDataVerifyCount> sumVerify, List<String> lineIds, List<String> devIds) {
|
||||||
|
//异常率
|
||||||
|
List<PqDataVerifyCount> verifyList = sumVerify.stream().filter(x->x.getTotal()>0).filter(x -> lineIds.contains(x.getLineId())).collect(Collectors.toList());
|
||||||
|
List<String> verifyLine = verifyList.stream().map(PqDataVerifyCount::getLineId).distinct().collect(Collectors.toList());
|
||||||
|
if (CollUtil.isNotEmpty(verifyLine)) {
|
||||||
|
List<String> devIdsLine = lineMapper.getDevIdsLine(verifyLine);
|
||||||
|
if (CollUtil.isNotEmpty(devIdsLine)) {
|
||||||
|
return NumberUtil.round(Math.min(devIdsLine.size() * 100.0 / devIds.size(), 100), 2);
|
||||||
|
} else {
|
||||||
|
return new BigDecimal(0);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return new BigDecimal(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
private BigDecimal verify(List<PqDataVerifyCount> sumVerify, List<String> lineIds) {
|
private BigDecimal verify(List<PqDataVerifyCount> sumVerify, List<String> lineIds) {
|
||||||
//异常率
|
//异常率
|
||||||
List<PqDataVerifyCount> verifyList = sumVerify.stream().filter(x -> lineIds.contains(x.getLineId())).collect(Collectors.toList());
|
List<PqDataVerifyCount> verifyList = sumVerify.stream().filter(x -> lineIds.contains(x.getLineId())).collect(Collectors.toList());
|
||||||
if (CollUtil.isNotEmpty(verifyList)) {
|
if (CollUtil.isNotEmpty(verifyList)) {
|
||||||
double total = verifyList.stream().mapToDouble(PqDataVerifyCount::getTotal).sum();
|
double total = verifyList.stream().mapToDouble(PqDataVerifyCount::getTotal).sum();
|
||||||
double totalAll = verifyList.stream().mapToDouble(PqDataVerifyCount::getTotalAll).sum();
|
double totalAll = verifyList.stream().mapToDouble(PqDataVerifyCount::getTotalAll).sum();
|
||||||
double flicker = verifyList.stream().mapToDouble(PqDataVerifyCount::getFlicker).sum();
|
if (totalAll == 0) {
|
||||||
double flickerAll = verifyList.stream().mapToDouble(PqDataVerifyCount::getFlickerAll).sum();
|
|
||||||
if (totalAll + flickerAll == 0) {
|
|
||||||
return new BigDecimal(0);
|
return new BigDecimal(0);
|
||||||
}
|
}
|
||||||
return NumberUtil.round(Math.min((total + flicker) * 100 / (totalAll + flickerAll), 100), 2);
|
return NumberUtil.round(Math.min(total * 100.0 / totalAll, 100), 2);
|
||||||
} else {
|
} else {
|
||||||
return new BigDecimal(0);
|
return new BigDecimal(0);
|
||||||
}
|
}
|
||||||
@@ -460,7 +475,7 @@ public class DeviceRunEvaluateServiceImpl implements DeviceRunEvaluateService {
|
|||||||
if (dueTime == 0) {
|
if (dueTime == 0) {
|
||||||
return new BigDecimal(0);
|
return new BigDecimal(0);
|
||||||
}
|
}
|
||||||
return NumberUtil.round(Math.min(realTime * 100 / dueTime, 100), 2);
|
return NumberUtil.round(Math.min(realTime * 100.0 / dueTime, 100), 2);
|
||||||
} else {
|
} else {
|
||||||
return new BigDecimal(0);
|
return new BigDecimal(0);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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 temp = lineList.stream().filter(t -> t.getAlgoDescribe() != null).min(Comparator.comparing(LineIntegrityDataVO::getAlgoDescribe)).orElse(new LineIntegrityDataVO());
|
||||||
lineIntegrityDataVO.setAlgoDescribe(temp.getAlgoDescribe());
|
lineIntegrityDataVO.setAlgoDescribe(temp.getAlgoDescribe());
|
||||||
lineIntegrityDataVO.setId(generalDeviceDTO.getIndex());
|
lineIntegrityDataVO.setId(generalDeviceDTO.getIndex());
|
||||||
lineIntegrityDataVO.setName(generalDeviceDTO.getName());
|
lineIntegrityDataVO.setName(generalDeviceDTO.getName());
|
||||||
lineIntegrityDataVO.setLevel(0);
|
lineIntegrityDataVO.setLevel(0);
|
||||||
lineIntegrityDataVO.setIntegrityData(DataStatisticsUtil.dataLimits(temValue));
|
|
||||||
pro.add(lineIntegrityDataVO);
|
pro.add(lineIntegrityDataVO);
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -193,12 +197,12 @@ public class LineIntegrityDataServiceImpl extends ServiceImpl<LineIntegrityDataM
|
|||||||
|
|
||||||
|
|
||||||
private void dealDataJinDu(List<LineIntegrityDataVO> mList,LineIntegrityDataVO children){
|
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){
|
int totalRealTime = (int) mList.stream().filter(it->it.getIntegrityData()!=3.14159).mapToLong(LineIntegrityDataVO::getRealTime).sum();
|
||||||
children.setIntegrityData(new BigDecimal(temValue).setScale(2,RoundingMode.HALF_UP).doubleValue());
|
int totalDueTime = (int) mList.stream().filter(it->it.getIntegrityData()!=3.14159).mapToLong(LineIntegrityDataVO::getDueTime).sum();
|
||||||
}else {
|
children.setRealTime(totalRealTime);
|
||||||
children.setIntegrityData(temValue);
|
children.setDueTime(totalDueTime);
|
||||||
}
|
children.setIntegrityData(DataStatisticsUtil.calculateIntegrityRate(totalRealTime, totalDueTime));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void dealMonitorData(List<LineIntegrityDataVO> lineList,List<LineDataIntegrity> percentageOfCompleteDatas,Map<String, Integer> mapA){
|
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())){
|
if(dataIntegrityMap.containsKey(monitor.getId())){
|
||||||
flag = true;
|
flag = true;
|
||||||
LineDataIntegrity integrity = dataIntegrityMap.get(monitor.getId());
|
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 (StrUtil.isNotBlank(monitor.getLineGrade())) {
|
||||||
if (mapA.containsKey(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);
|
monitor.setValueOver(1);
|
||||||
} else {
|
} else {
|
||||||
monitor.setValueOver(0);
|
monitor.setValueOver(0);
|
||||||
@@ -228,6 +235,8 @@ public class LineIntegrityDataServiceImpl extends ServiceImpl<LineIntegrityDataM
|
|||||||
if (!flag) {
|
if (!flag) {
|
||||||
//表示未匹配到数据完整性
|
//表示未匹配到数据完整性
|
||||||
monitor.setIntegrityData(3.14159);
|
monitor.setIntegrityData(3.14159);
|
||||||
|
monitor.setRealTime(0);
|
||||||
|
monitor.setDueTime(0);
|
||||||
monitor.setValueOver(0);
|
monitor.setValueOver(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -248,13 +257,19 @@ public class LineIntegrityDataServiceImpl extends ServiceImpl<LineIntegrityDataM
|
|||||||
outParam.setType(generalDeviceDTO.getName() + "\n(" + generalDeviceDTO.getLineIndexes().size() + ")");
|
outParam.setType(generalDeviceDTO.getName() + "\n(" + generalDeviceDTO.getLineIndexes().size() + ")");
|
||||||
//根据监测点查询数据完整性
|
//根据监测点查询数据完整性
|
||||||
List<PublicDTO> integrityData = getCondition(lineIndexes, integrityIconParam.getSearchBeginTime(), integrityIconParam.getSearchEndTime());
|
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())) {
|
if (StrUtil.isNotBlank(integrityIconParam.getPeriodBeginTime()) && StrUtil.isNotBlank(integrityIconParam.getPeriodEndTime())) {
|
||||||
List<PublicDTO> compareData = getCondition(lineIndexes, integrityIconParam.getPeriodBeginTime(), 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);
|
out.add(outParam);
|
||||||
}
|
}
|
||||||
@@ -320,12 +335,14 @@ public class LineIntegrityDataServiceImpl extends ServiceImpl<LineIntegrityDataM
|
|||||||
for (LineDataIntegrity lineData : percentageOfCompleteDatas) {
|
for (LineDataIntegrity lineData : percentageOfCompleteDatas) {
|
||||||
if (lineDataIntegrity.getId().equals(lineData.getLineId())) {
|
if (lineDataIntegrity.getId().equals(lineData.getLineId())) {
|
||||||
flag = true;
|
flag = true;
|
||||||
Double temValue = lineData.getIntegrityData();
|
lineDataIntegrity.setRealTime(lineData.getReal() == null ? 0 : lineData.getReal().intValue());
|
||||||
lineDataIntegrity.setIntegrityData(DataStatisticsUtil.dataLimits(temValue));
|
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 (StrUtil.isNotBlank(lineDataIntegrity.getLineGrade())) {
|
||||||
if (mapA.containsKey(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);
|
lineDataIntegrity.setValueOver(1);
|
||||||
} else {
|
} else {
|
||||||
lineDataIntegrity.setValueOver(0);
|
lineDataIntegrity.setValueOver(0);
|
||||||
@@ -343,6 +360,8 @@ public class LineIntegrityDataServiceImpl extends ServiceImpl<LineIntegrityDataM
|
|||||||
if (!flag) {
|
if (!flag) {
|
||||||
//表示未匹配到数据完整性
|
//表示未匹配到数据完整性
|
||||||
lineDataIntegrity.setIntegrityData(3.14159);
|
lineDataIntegrity.setIntegrityData(3.14159);
|
||||||
|
lineDataIntegrity.setRealTime(0);
|
||||||
|
lineDataIntegrity.setDueTime(0);
|
||||||
lineDataIntegrity.setValueOver(0);
|
lineDataIntegrity.setValueOver(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -352,13 +371,17 @@ public class LineIntegrityDataServiceImpl extends ServiceImpl<LineIntegrityDataM
|
|||||||
lineIntegrityDataVO.setChildren(subList);
|
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 temp = lineList.stream().filter(t -> t.getAlgoDescribe() != null).min(Comparator.comparing(LineIntegrityDataVO::getAlgoDescribe)).orElse(new LineIntegrityDataVO());
|
||||||
lineIntegrityDataVO.setAlgoDescribe(temp.getAlgoDescribe());
|
lineIntegrityDataVO.setAlgoDescribe(temp.getAlgoDescribe());
|
||||||
lineIntegrityDataVO.setId(generalDeviceDTO.getIndex());
|
lineIntegrityDataVO.setId(generalDeviceDTO.getIndex());
|
||||||
lineIntegrityDataVO.setName(generalDeviceDTO.getName());
|
lineIntegrityDataVO.setName(generalDeviceDTO.getName());
|
||||||
lineIntegrityDataVO.setLevel(0);
|
lineIntegrityDataVO.setLevel(0);
|
||||||
lineIntegrityDataVO.setIntegrityData(Math.min(DataStatisticsUtil.dataLimits(temValue),100.0));
|
|
||||||
pro.add(lineIntegrityDataVO);
|
pro.add(lineIntegrityDataVO);
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -397,9 +420,12 @@ public class LineIntegrityDataServiceImpl extends ServiceImpl<LineIntegrityDataM
|
|||||||
for (String pid : pids) {
|
for (String pid : pids) {
|
||||||
if (lineAdministrationTree.getId().equals(pid)) {
|
if (lineAdministrationTree.getId().equals(pid)) {
|
||||||
List<LineIntegrityDataVO> lineIntegrityDataVOList = groupLine.get(pid);
|
List<LineIntegrityDataVO> lineIntegrityDataVOList = groupLine.get(pid);
|
||||||
//父级完整性匹配
|
//父级完整性匹配 - 汇总子节点的实际时间和期望时间,重新计算完整性
|
||||||
Double temValue = lineIntegrityDataVOList.stream().filter(item -> item.getIntegrityData() != 3.14159).mapToDouble(LineIntegrityDataVO::getIntegrityData).average().orElse(3.14159);
|
int totalRealTime = (int) lineIntegrityDataVOList.stream().filter(item -> item.getIntegrityData() != 3.14159).mapToLong(LineIntegrityDataVO::getRealTime).sum();
|
||||||
lineAdministrationTree.setIntegrityData(DataStatisticsUtil.dataLimits(temValue));
|
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());
|
LineIntegrityDataVO temp = lineIntegrityDataVOList.stream().filter(t -> t.getAlgoDescribe() != null).min(Comparator.comparing(LineIntegrityDataVO::getAlgoDescribe)).orElse(new LineIntegrityDataVO());
|
||||||
lineAdministrationTree.setAlgoDescribe(temp.getAlgoDescribe());
|
lineAdministrationTree.setAlgoDescribe(temp.getAlgoDescribe());
|
||||||
}
|
}
|
||||||
@@ -418,10 +444,12 @@ public class LineIntegrityDataServiceImpl extends ServiceImpl<LineIntegrityDataM
|
|||||||
if (!CollectionUtils.isEmpty(data)) {
|
if (!CollectionUtils.isEmpty(data)) {
|
||||||
data.forEach(po -> {
|
data.forEach(po -> {
|
||||||
PublicDTO publicDTO = new PublicDTO();
|
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.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);
|
integrityList.add(publicDTO);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ package com.njcn.device.pq.service.impl;
|
|||||||
import cn.hutool.core.codec.Base64;
|
import cn.hutool.core.codec.Base64;
|
||||||
import cn.hutool.core.collection.CollUtil;
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import cn.hutool.core.date.*;
|
import cn.hutool.core.date.*;
|
||||||
|
import cn.hutool.core.util.ObjUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import cn.hutool.json.JSONArray;
|
import cn.hutool.json.JSONArray;
|
||||||
import cn.hutool.json.JSONConfig;
|
import cn.hutool.json.JSONConfig;
|
||||||
@@ -18,10 +19,12 @@ import com.njcn.dataProcess.enums.DataCleanEnum;
|
|||||||
import com.njcn.dataProcess.param.DataCleanParam;
|
import com.njcn.dataProcess.param.DataCleanParam;
|
||||||
import com.njcn.dataProcess.pojo.dto.PqReasonableRangeDto;
|
import com.njcn.dataProcess.pojo.dto.PqReasonableRangeDto;
|
||||||
import com.njcn.device.line.mapper.LineMapper;
|
import com.njcn.device.line.mapper.LineMapper;
|
||||||
|
import com.njcn.device.line.service.DeptLineService;
|
||||||
import com.njcn.device.pq.constant.Param;
|
import com.njcn.device.pq.constant.Param;
|
||||||
import com.njcn.device.pq.enums.LineBaseEnum;
|
import com.njcn.device.pq.enums.LineBaseEnum;
|
||||||
import com.njcn.device.pq.mapper.PqDataVerifyBakMapper;
|
import com.njcn.device.pq.mapper.PqDataVerifyBakMapper;
|
||||||
import com.njcn.device.pq.pojo.param.dataClean.MonitorBaseParam;
|
import com.njcn.device.pq.pojo.param.dataClean.MonitorBaseParam;
|
||||||
|
import com.njcn.device.pq.pojo.po.DeptLine;
|
||||||
import com.njcn.device.pq.pojo.po.PqDataVerifyBak;
|
import com.njcn.device.pq.pojo.po.PqDataVerifyBak;
|
||||||
import com.njcn.device.pq.pojo.vo.AreaLineInfoVO;
|
import com.njcn.device.pq.pojo.vo.AreaLineInfoVO;
|
||||||
import com.njcn.device.pq.pojo.vo.LineDetailDataVO;
|
import com.njcn.device.pq.pojo.vo.LineDetailDataVO;
|
||||||
@@ -33,10 +36,7 @@ import com.njcn.device.pq.service.CommTerminalService;
|
|||||||
import com.njcn.device.pq.service.IPqDataVerifyBakService;
|
import com.njcn.device.pq.service.IPqDataVerifyBakService;
|
||||||
import com.njcn.oss.utils.FileStorageUtil;
|
import com.njcn.oss.utils.FileStorageUtil;
|
||||||
import com.njcn.supervision.api.UserLedgerFeignClient;
|
import com.njcn.supervision.api.UserLedgerFeignClient;
|
||||||
import com.njcn.supervision.pojo.vo.user.NewUserReportVO;
|
|
||||||
import com.njcn.system.api.DictTreeFeignClient;
|
import com.njcn.system.api.DictTreeFeignClient;
|
||||||
import com.njcn.system.enums.DicDataEnum;
|
|
||||||
import com.njcn.system.pojo.po.SysDicTreePO;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
@@ -65,38 +65,34 @@ public class PqDataVerifyBakServiceImpl extends ServiceImpl<PqDataVerifyBakMappe
|
|||||||
|
|
||||||
private static final String SEPARATOR = "-";
|
private static final String SEPARATOR = "-";
|
||||||
private static final DateTimeFormatter DATE_FORMAT = DateTimeFormatter.ofPattern(DatePattern.NORM_DATE_PATTERN);
|
private static final DateTimeFormatter DATE_FORMAT = DateTimeFormatter.ofPattern(DatePattern.NORM_DATE_PATTERN);
|
||||||
|
|
||||||
private final CommTerminalService commTerminalService;
|
private final CommTerminalService commTerminalService;
|
||||||
|
|
||||||
private final PqReasonableRangeFeignClient pqReasonableRangeFeignClient;
|
private final PqReasonableRangeFeignClient pqReasonableRangeFeignClient;
|
||||||
|
|
||||||
private final LineMapper lineMapper;
|
private final LineMapper lineMapper;
|
||||||
|
|
||||||
private final DictTreeFeignClient dictTreeFeignClient;
|
private final DictTreeFeignClient dictTreeFeignClient;
|
||||||
|
|
||||||
private final UserLedgerFeignClient userLedgerFeignClient;
|
private final UserLedgerFeignClient userLedgerFeignClient;
|
||||||
|
|
||||||
private final FileStorageUtil fileStorageUtil;
|
private final FileStorageUtil fileStorageUtil;
|
||||||
|
private final DeptLineService deptLineService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public VerifyMonitorVO getMonitorVerifyData(MonitorBaseParam monitorBaseParam) {
|
public VerifyMonitorVO getMonitorVerifyData(MonitorBaseParam monitorBaseParam) {
|
||||||
|
if(Objects.isNull(monitorBaseParam.getErrorTimeCount())){
|
||||||
|
monitorBaseParam.setErrorTimeCount(720);
|
||||||
|
}
|
||||||
List<String> monitorIds = commTerminalService.getRunMonitorByDept(monitorBaseParam);
|
List<String> monitorIds = commTerminalService.getRunMonitorByDept(monitorBaseParam);
|
||||||
VerifyMonitorVO verifyMonitorVO = new VerifyMonitorVO();
|
VerifyMonitorVO verifyMonitorVO = new VerifyMonitorVO();
|
||||||
if (CollUtil.isNotEmpty(monitorIds)) {
|
if (CollUtil.isNotEmpty(monitorIds)) {
|
||||||
List<PqDataVerifyBak> dataVerifyList = baseDataVerifyQuery(monitorIds, monitorBaseParam);
|
List<PqDataVerifyBak> dataVerifyList = baseDataVerifyQuery(monitorIds, monitorBaseParam);
|
||||||
verifyMonitorVO.setRunNum(monitorIds.size());
|
verifyMonitorVO.setRunNum(monitorIds.size());
|
||||||
verifyMonitorVO.setAbnormalNum(dataVerifyList.stream().collect(Collectors.groupingBy(PqDataVerifyBak::getLineId)).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.setMapList(getRangeAbnormalMonitor(monitorBaseParam, dataVerifyList));
|
||||||
verifyMonitorVO.setTargetList(getAbnormalTarget(dataSumVerifyList));
|
verifyMonitorVO.setTargetList(getAbnormalTarget(dataVerifyList,monitorBaseParam.getErrorTimeCount()));
|
||||||
verifyMonitorVO.setMonitorAlarmInfo(getAbnormalTable(dataVerifyList, monitorBaseParam));
|
verifyMonitorVO.setMonitorAlarmInfo(getAbnormalTable(dataVerifyList, monitorBaseParam));
|
||||||
} else {
|
} else {
|
||||||
verifyMonitorVO.setRunNum(0);
|
verifyMonitorVO.setRunNum(0);
|
||||||
verifyMonitorVO.setAbnormalNum(0);
|
verifyMonitorVO.setAbnormalNum(0);
|
||||||
|
|
||||||
verifyMonitorVO.setMapList(getRangeAbnormalMonitor(monitorBaseParam, new ArrayList<>()));
|
verifyMonitorVO.setMapList(getRangeAbnormalMonitor(monitorBaseParam, new ArrayList<>()));
|
||||||
verifyMonitorVO.setTargetList(getAbnormalTarget(new ArrayList<>()));
|
verifyMonitorVO.setTargetList(getAbnormalTarget(new ArrayList<>(),monitorBaseParam.getErrorTimeCount()));
|
||||||
verifyMonitorVO.setMonitorAlarmInfo(getAbnormalTable(new ArrayList<>(), monitorBaseParam));
|
verifyMonitorVO.setMonitorAlarmInfo(getAbnormalTable(new ArrayList<>(), monitorBaseParam));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -111,7 +107,7 @@ public class PqDataVerifyBakServiceImpl extends ServiceImpl<PqDataVerifyBakMappe
|
|||||||
List<LocalDate> dateList = list.stream().map(PqDataVerifyBak::getTimeId).sorted(Comparator.comparing(Function.identity())).collect(Collectors.toList());
|
List<LocalDate> dateList = list.stream().map(PqDataVerifyBak::getTimeId).sorted(Comparator.comparing(Function.identity())).collect(Collectors.toList());
|
||||||
processTable(monitorBaseParam, dateList, result, key);
|
processTable(monitorBaseParam, dateList, result, key);
|
||||||
});
|
});
|
||||||
dealTableResult(result);
|
dealTableResult(result, monitorBaseParam.getSearchValue());
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -137,34 +133,44 @@ public class PqDataVerifyBakServiceImpl extends ServiceImpl<PqDataVerifyBakMappe
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void dealTableResult(List<PowerQualityIndicatorsVO> result) {
|
private void dealTableResult(List<PowerQualityIndicatorsVO> result, String searchValue) {
|
||||||
if (CollUtil.isNotEmpty(result)) {
|
if (CollUtil.isNotEmpty(result)) {
|
||||||
List<SysDicTreePO> dicTreePOList = dictTreeFeignClient.queryAllByType(Integer.valueOf(DicDataEnum.Obj_Type.getCode())).getData();
|
// List<SysDicTreePO> dicTreePOList = dictTreeFeignClient.queryAllByType(Integer.valueOf(DicDataEnum.Obj_Type.getCode())).getData();
|
||||||
Map<String, SysDicTreePO> sysDicTreePOMap = dicTreePOList.stream().collect(Collectors.toMap(SysDicTreePO::getId, Function.identity()));
|
// Map<String, SysDicTreePO> sysDicTreePOMap = dicTreePOList.stream().collect(Collectors.toMap(SysDicTreePO::getId, Function.identity()));
|
||||||
List<String> ids = result.stream().map(PowerQualityIndicatorsVO::getMonitorId).distinct().collect(Collectors.toList());
|
List<String> ids = result.stream().map(PowerQualityIndicatorsVO::getMonitorId).distinct().collect(Collectors.toList());
|
||||||
List<AreaLineInfoVO> areaLineInfoVOList = lineMapper.getBaseLineAreaInfo(ids, null, null);
|
List<AreaLineInfoVO> areaLineInfoVOList = lineMapper.getBaseLineAreaInfo(ids, searchValue, null);
|
||||||
Map<String, AreaLineInfoVO> areaMap = areaLineInfoVOList.stream().collect(Collectors.toMap(AreaLineInfoVO::getLineId, Function.identity()));
|
Map<String, PowerQualityIndicatorsVO> areaMap = result.stream().collect(Collectors.toMap(PowerQualityIndicatorsVO::getMonitorId, Function.identity()));
|
||||||
|
List<DeptLine> deptLines = deptLineService.selectDeptLine(ids);
|
||||||
List<String> objIds = areaLineInfoVOList.stream().map(AreaLineInfoVO::getObjId).distinct().collect(Collectors.toList());
|
Map<String, String> deptName = deptLines.stream().collect(Collectors.toMap(DeptLine::getLineId, DeptLine::getId));
|
||||||
List<NewUserReportVO> userLedgerVOList = userLedgerFeignClient.getUserReportByIds(objIds).getData();
|
// List<String> objIds = areaLineInfoVOList.stream().map(AreaLineInfoVO::getObjId).distinct().collect(Collectors.toList());
|
||||||
Map<String, NewUserReportVO> userMap = userLedgerVOList.stream().collect(Collectors.toMap(NewUserReportVO::getId, Function.identity()));
|
// List<NewUserReportVO> userLedgerVOList = userLedgerFeignClient.getUserReportByIds(objIds).getData();
|
||||||
result.forEach(it -> {
|
// Map<String, NewUserReportVO> userMap = userLedgerVOList.stream().collect(Collectors.toMap(NewUserReportVO::getId, Function.identity()));
|
||||||
if (areaMap.containsKey(it.getMonitorId())) {
|
List<PowerQualityIndicatorsVO> info = new ArrayList<>();
|
||||||
AreaLineInfoVO areaLineInfoVO = areaMap.get(it.getMonitorId());
|
for (AreaLineInfoVO lineDetail : areaLineInfoVOList) {
|
||||||
it.setMonitorName(areaLineInfoVO.getLineName());
|
if (areaMap.containsKey(lineDetail.getLineId())) {
|
||||||
it.setStationName(areaLineInfoVO.getSubName());
|
PowerQualityIndicatorsVO it = areaMap.get(lineDetail.getLineId());
|
||||||
it.setDevName(areaLineInfoVO.getDeviceName());
|
it.setMonitorName(lineDetail.getLineName());
|
||||||
it.setVoltageLevel(areaLineInfoVO.getVoltageScale());
|
it.setStationName(lineDetail.getSubName());
|
||||||
it.setIp(Base64.encode(areaLineInfoVO.getIp()));
|
it.setDevName(lineDetail.getDeviceName());
|
||||||
it.setManufacturer(areaLineInfoVO.getManufacturer());
|
if(deptName.containsKey(lineDetail.getLineId())){
|
||||||
if (sysDicTreePOMap.containsKey(areaLineInfoVO.getSmallObjType())) {
|
it.setCity(deptName.get(lineDetail.getLineId()));
|
||||||
it.setObjType(sysDicTreePOMap.get(areaLineInfoVO.getSmallObjType()).getName());
|
|
||||||
}
|
}
|
||||||
if (userMap.containsKey(areaLineInfoVO.getObjId())) {
|
it.setVoltageLevel(lineDetail.getVoltageScale());
|
||||||
it.setObjName(userMap.get(areaLineInfoVO.getObjId()).getProjectName());
|
it.setIp(Base64.encode(lineDetail.getIp()));
|
||||||
|
it.setManufacturer(lineDetail.getManufacturer());
|
||||||
|
it.setObjType(lineDetail.getLoadType());
|
||||||
|
it.setObjName(lineDetail.getObjName());
|
||||||
|
info.add(it);
|
||||||
|
// if (sysDicTreePOMap.containsKey(areaLineInfoVO.getSmallObjType())) {
|
||||||
|
// it.setObjType(sysDicTreePOMap.get(areaLineInfoVO.getSmallObjType()).getName());
|
||||||
|
// }
|
||||||
|
// if (userMap.containsKey(areaLineInfoVO.getObjId())) {
|
||||||
|
// it.setObjName(userMap.get(areaLineInfoVO.getObjId()).getProjectName());
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
result.clear();
|
||||||
|
result.addAll(info);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -177,6 +183,9 @@ public class PqDataVerifyBakServiceImpl extends ServiceImpl<PqDataVerifyBakMappe
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<DetailAbnormalVO> monitorAbnormalTable(MonitorBaseParam monitorBaseParam) {
|
public List<DetailAbnormalVO> monitorAbnormalTable(MonitorBaseParam monitorBaseParam) {
|
||||||
|
if(Objects.isNull(monitorBaseParam.getErrorTimeCount())){
|
||||||
|
monitorBaseParam.setErrorTimeCount(720);
|
||||||
|
}
|
||||||
List<DetailAbnormalVO> result = new ArrayList<>();
|
List<DetailAbnormalVO> result = new ArrayList<>();
|
||||||
//参数校验
|
//参数校验
|
||||||
Map<String, PqReasonableRangeDto> rangeMap = getStandRange();
|
Map<String, PqReasonableRangeDto> rangeMap = getStandRange();
|
||||||
@@ -199,67 +208,73 @@ public class PqDataVerifyBakServiceImpl extends ServiceImpl<PqDataVerifyBakMappe
|
|||||||
if (StrUtil.isNotBlank(monitorBaseParam.getTargetKey())) {
|
if (StrUtil.isNotBlank(monitorBaseParam.getTargetKey())) {
|
||||||
switch (monitorBaseParam.getTargetKey()) {
|
switch (monitorBaseParam.getTargetKey()) {
|
||||||
case Param.freq:
|
case Param.freq:
|
||||||
lambdaQueryWrapper.eq(PqDataVerifyBak::getFreq, 1);
|
lambdaQueryWrapper.ge(PqDataVerifyBak::getFreqTime, monitorBaseParam.getErrorTimeCount());
|
||||||
break;
|
break;
|
||||||
case Param.freq_dev:
|
case Param.freq_dev:
|
||||||
lambdaQueryWrapper.eq(PqDataVerifyBak::getFreqDev, 1);
|
lambdaQueryWrapper.ge(PqDataVerifyBak::getFreqDevTime, monitorBaseParam.getErrorTimeCount());
|
||||||
break;
|
break;
|
||||||
case Param.rms_v:
|
case Param.rms_v:
|
||||||
lambdaQueryWrapper.eq(PqDataVerifyBak::getVRms, 1);
|
lambdaQueryWrapper.ge(PqDataVerifyBak::getVRmsTime, monitorBaseParam.getErrorTimeCount());
|
||||||
break;
|
break;
|
||||||
case Param.rms_lvr:
|
case Param.rms_lvr:
|
||||||
lambdaQueryWrapper.eq(PqDataVerifyBak::getRmsLvr, 1);
|
lambdaQueryWrapper.ge(PqDataVerifyBak::getRmsLvrTime, monitorBaseParam.getErrorTimeCount());
|
||||||
break;
|
break;
|
||||||
case Param.vu_dev:
|
case Param.vu_dev:
|
||||||
lambdaQueryWrapper.eq(PqDataVerifyBak::getVuDev, 1);
|
lambdaQueryWrapper.ge(PqDataVerifyBak::getVuDevTime, monitorBaseParam.getErrorTimeCount());
|
||||||
break;
|
break;
|
||||||
case Param.vl_dev:
|
case Param.vl_dev:
|
||||||
lambdaQueryWrapper.eq(PqDataVerifyBak::getVlDev, 1);
|
lambdaQueryWrapper.ge(PqDataVerifyBak::getVlDevTime, monitorBaseParam.getErrorTimeCount());
|
||||||
break;
|
break;
|
||||||
case Param.rms_i:
|
case Param.rms_i:
|
||||||
lambdaQueryWrapper.eq(PqDataVerifyBak::getIRms, 1);
|
lambdaQueryWrapper.ge(PqDataVerifyBak::getIRmsTime, monitorBaseParam.getErrorTimeCount());
|
||||||
break;
|
break;
|
||||||
case Param.v_thd:
|
case Param.v_thd:
|
||||||
lambdaQueryWrapper.eq(PqDataVerifyBak::getVThd, 1);
|
lambdaQueryWrapper.ge(PqDataVerifyBak::getVThdTime, monitorBaseParam.getErrorTimeCount());
|
||||||
break;
|
break;
|
||||||
case Param.v_1_v:
|
case Param.v_1_v:
|
||||||
lambdaQueryWrapper.eq(PqDataVerifyBak::getV, 1);
|
lambdaQueryWrapper.ge(PqDataVerifyBak::getVTime, monitorBaseParam.getErrorTimeCount());
|
||||||
break;
|
break;
|
||||||
case Param.phasic_v_1:
|
case Param.phasic_v_1:
|
||||||
lambdaQueryWrapper.eq(PqDataVerifyBak::getV1Phasic, 1);
|
lambdaQueryWrapper.ge(PqDataVerifyBak::getV1PhasicTime, monitorBaseParam.getErrorTimeCount());
|
||||||
break;
|
break;
|
||||||
case Param.phasic_rate_x:
|
case Param.phasic_rate_x:
|
||||||
lambdaQueryWrapper.eq(PqDataVerifyBak::getVPhasic, 1);
|
lambdaQueryWrapper.ge(PqDataVerifyBak::getVPhasicTime, monitorBaseParam.getErrorTimeCount());
|
||||||
break;
|
break;
|
||||||
case Param.v_rate:
|
case Param.v_rate:
|
||||||
lambdaQueryWrapper.eq(PqDataVerifyBak::getVHarm, 1);
|
lambdaQueryWrapper.ge(PqDataVerifyBak::getVHarmTime, monitorBaseParam.getErrorTimeCount());
|
||||||
break;
|
break;
|
||||||
case Param.in_v_rate:
|
case Param.in_v_rate:
|
||||||
lambdaQueryWrapper.eq(PqDataVerifyBak::getVInharm, 1);
|
lambdaQueryWrapper.ge(PqDataVerifyBak::getVInharmTime, monitorBaseParam.getErrorTimeCount());
|
||||||
break;
|
break;
|
||||||
case Param.v_zero:
|
case Param.v_zero:
|
||||||
lambdaQueryWrapper.eq(PqDataVerifyBak::getVZero, 1);
|
lambdaQueryWrapper.ge(PqDataVerifyBak::getVZeroTime, monitorBaseParam.getErrorTimeCount());
|
||||||
break;
|
break;
|
||||||
case Param.v_neg:
|
case Param.v_neg:
|
||||||
lambdaQueryWrapper.eq(PqDataVerifyBak::getVNeg, 1);
|
lambdaQueryWrapper.ge(PqDataVerifyBak::getVNegTime, monitorBaseParam.getErrorTimeCount());
|
||||||
break;
|
break;
|
||||||
case Param.v_pos:
|
case Param.v_pos:
|
||||||
lambdaQueryWrapper.eq(PqDataVerifyBak::getVPos, 1);
|
lambdaQueryWrapper.ge(PqDataVerifyBak::getVPosTime, monitorBaseParam.getErrorTimeCount());
|
||||||
break;
|
break;
|
||||||
case Param.v_unbalance:
|
case Param.v_unbalance:
|
||||||
lambdaQueryWrapper.eq(PqDataVerifyBak::getVUnbalance, 1);
|
lambdaQueryWrapper.ge(PqDataVerifyBak::getVUnbalanceTime, monitorBaseParam.getErrorTimeCount());
|
||||||
break;
|
break;
|
||||||
case Param.fluc:
|
case Param.fluc:
|
||||||
lambdaQueryWrapper.eq(PqDataVerifyBak::getFluc, 1);
|
lambdaQueryWrapper.ge(PqDataVerifyBak::getFlucTime, monitorBaseParam.getErrorTimeCount());
|
||||||
break;
|
break;
|
||||||
case Param.pst:
|
case Param.pst:
|
||||||
lambdaQueryWrapper.eq(PqDataVerifyBak::getPst, 1);
|
lambdaQueryWrapper.ge(PqDataVerifyBak::getPstTime, monitorBaseParam.getErrorTimeCount());
|
||||||
break;
|
break;
|
||||||
case Param.plt:
|
case Param.plt:
|
||||||
lambdaQueryWrapper.eq(PqDataVerifyBak::getPlt, 1);
|
lambdaQueryWrapper.ge(PqDataVerifyBak::getPltTime, monitorBaseParam.getErrorTimeCount());
|
||||||
break;
|
break;
|
||||||
case Param.pf:
|
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;
|
break;
|
||||||
default:
|
default:
|
||||||
log.error("方法{}未匹配到异常数据指标", "monitorAbnormalTable");
|
log.error("方法{}未匹配到异常数据指标", "monitorAbnormalTable");
|
||||||
@@ -267,97 +282,37 @@ public class PqDataVerifyBakServiceImpl extends ServiceImpl<PqDataVerifyBakMappe
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
List<PqDataVerifyBak> dataVerifyList = this.list(lambdaQueryWrapper);
|
List<PqDataVerifyBak> dataVerifyList = this.list(lambdaQueryWrapper);
|
||||||
for (PqDataVerifyBak pqDataVerifyBak : dataVerifyList) {
|
Map<String, List<PqDataVerifyBak>> VerifyMap = dataVerifyList.stream().collect(Collectors.groupingBy(PqDataVerifyBak::getLineId));
|
||||||
LineDetailDataVO lineDevGetDTO = lineDetailMap.get(pqDataVerifyBak.getLineId());
|
VerifyMap.forEach((key, value) -> {
|
||||||
|
LineDetailDataVO lineDevGetDTO = lineDetailMap.get(key);
|
||||||
String temBgName = "";
|
String temBgName = "";
|
||||||
if (lineDevGetDTO.getPowerFlag().equals(LineBaseEnum.POWER_FLAG.getCode())) {
|
if (lineDevGetDTO.getPowerFlag().equals(LineBaseEnum.POWER_FLAG.getCode())) {
|
||||||
temBgName = lineDevGetDTO.getBdName();
|
temBgName = lineDevGetDTO.getBdName();
|
||||||
} else if (lineDevGetDTO.getPowerFlag().equals(LineBaseEnum.POWER_FLAG_NOT.getCode())) {
|
} else if (lineDevGetDTO.getPowerFlag().equals(LineBaseEnum.POWER_FLAG_NOT.getCode())) {
|
||||||
temBgName = lineDevGetDTO.getObjName();
|
temBgName = lineDevGetDTO.getObjName();
|
||||||
}
|
}
|
||||||
try (InputStream fileStream = fileStorageUtil.getFileStream(pqDataVerifyBak.getPath())) {
|
List<DetailAbnormalVO.TimeAndTargetKey> targetKeyList = new ArrayList<>();
|
||||||
JSONArray jsonArray = new JSONArray(new JSONTokener(fileStream, new JSONConfig()));
|
DetailAbnormalVO.TimeAndTargetKey targetKey;
|
||||||
String[] errorTimeCount = {"0"};
|
|
||||||
Long[] errAllCount = {0L};
|
|
||||||
jsonArray.forEach(it -> {
|
|
||||||
JSONObject targetJson = (JSONObject) it;
|
|
||||||
if (StrUtil.isNotBlank(monitorBaseParam.getTargetKey())) {
|
|
||||||
if (targetJson.containsKey(monitorBaseParam.getTargetKey())) {
|
|
||||||
JSONArray innerJson = targetJson.getJSONArray(monitorBaseParam.getTargetKey());
|
|
||||||
PqReasonableRangeDto dto = rangeMap.get(monitorBaseParam.getTargetKey());
|
|
||||||
if (Objects.nonNull(dto.getHarmStart()) && Objects.nonNull(dto.getHarmEnd())) {
|
|
||||||
errorTimeCount[0] = targetJson.get("errorTimes").toString();
|
|
||||||
for (Object oJson : innerJson) {
|
|
||||||
JSONObject jsonObjectTem = (JSONObject) oJson;
|
|
||||||
JSONArray list = jsonObjectTem.getJSONArray("list");
|
|
||||||
list.forEach(listItem -> {
|
|
||||||
JSONObject object = (JSONObject) listItem;
|
|
||||||
long errCount = Long.parseLong(object.get("errorCounts").toString());
|
|
||||||
errAllCount[0] += errCount;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
for (Object oJson : innerJson) {
|
|
||||||
JSONObject jsonObjectTem = (JSONObject) oJson;
|
|
||||||
JSONArray list = jsonObjectTem.getJSONArray("list");
|
|
||||||
list.forEach(listItem -> {
|
|
||||||
JSONObject object = (JSONObject) listItem;
|
|
||||||
long errCount = Long.parseLong(object.get("errorCounts").toString());
|
|
||||||
errAllCount[0] += errCount;
|
|
||||||
});
|
|
||||||
errorTimeCount[0] = jsonObjectTem.get("errorTimes").toString();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
rangeMap.forEach((rangeKey, val) -> {
|
|
||||||
if (targetJson.containsKey(rangeKey)) {
|
|
||||||
JSONArray innerJson = targetJson.getJSONArray(rangeKey);
|
|
||||||
for (Object oJson : innerJson) {
|
|
||||||
JSONObject jsonObjectTem = (JSONObject) oJson;
|
|
||||||
JSONArray list = jsonObjectTem.getJSONArray("list");
|
|
||||||
list.forEach(listItem -> {
|
|
||||||
JSONObject object = (JSONObject) listItem;
|
|
||||||
long errCount = Long.parseLong(object.get("errorCounts").toString());
|
|
||||||
errAllCount[0] += errCount;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
if (targetJson.containsKey("lineErrorTimes")) {
|
|
||||||
errorTimeCount[0] = targetJson.get("lineErrorTimes").toString();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
DetailAbnormalVO detailAbnormalVO = new DetailAbnormalVO();
|
DetailAbnormalVO detailAbnormalVO = new DetailAbnormalVO();
|
||||||
detailAbnormalVO.setTimeSum(errorTimeCount[0]);
|
for (PqDataVerifyBak pqDataVerifyBak : value) {
|
||||||
detailAbnormalVO.setDate(pqDataVerifyBak.getTimeId().format(DateTimeFormatter.ofPattern(DatePattern.NORM_DATE_PATTERN)));
|
targetKey = new DetailAbnormalVO.TimeAndTargetKey();
|
||||||
detailAbnormalVO.setMonitorName(lineDevGetDTO.getLineName());
|
targetKey.setDate(pqDataVerifyBak.getTimeId().format(DatePattern.NORM_DATE_FORMATTER));
|
||||||
detailAbnormalVO.setBdName(temBgName);
|
targetKey.setTargetKeys(getAbnormalTarget(Arrays.asList(pqDataVerifyBak),monitorBaseParam.getErrorTimeCount()).stream().filter(x->x.getIds().size()>0).collect(Collectors.toList()));
|
||||||
detailAbnormalVO.setMonitorId(lineDevGetDTO.getLineId());
|
targetKeyList.add(targetKey);
|
||||||
detailAbnormalVO.setTargetKey(monitorBaseParam.getTargetKey());
|
}
|
||||||
detailAbnormalVO.setErrCount(errAllCount[0].toString());
|
detailAbnormalVO.setDateTargetList(targetKeyList);
|
||||||
result.add(detailAbnormalVO);
|
|
||||||
} catch (BusinessException b) {
|
|
||||||
//文件为空时候的特殊处理
|
|
||||||
DetailAbnormalVO detailAbnormalVO = new DetailAbnormalVO();
|
|
||||||
detailAbnormalVO.setTimeSum("/");
|
|
||||||
detailAbnormalVO.setDate(pqDataVerifyBak.getTimeId().format(DateTimeFormatter.ofPattern(DatePattern.NORM_DATE_PATTERN)));
|
|
||||||
detailAbnormalVO.setMonitorName(lineDevGetDTO.getLineName());
|
detailAbnormalVO.setMonitorName(lineDevGetDTO.getLineName());
|
||||||
detailAbnormalVO.setBdName(temBgName);
|
detailAbnormalVO.setBdName(temBgName);
|
||||||
detailAbnormalVO.setMonitorId(lineDevGetDTO.getLineId());
|
detailAbnormalVO.setMonitorId(lineDevGetDTO.getLineId());
|
||||||
detailAbnormalVO.setTargetKey(monitorBaseParam.getTargetKey());
|
detailAbnormalVO.setTargetKey(monitorBaseParam.getTargetKey());
|
||||||
result.add(detailAbnormalVO);
|
result.add(detailAbnormalVO);
|
||||||
} catch (Exception e) {
|
});
|
||||||
throw new BusinessException("数据异常");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<DetailAbnormalVO.DetailAbnormalInnerVO> monitorAbnormalTableDetail(MonitorBaseParam monitorBaseParam) {
|
public DetailAbnormalVO.DetailAbnormalCountVO monitorAbnormalTableDetail(MonitorBaseParam monitorBaseParam) {
|
||||||
Map<String, PqReasonableRangeDto> dtoMap = getStandRange();
|
Map<String, PqReasonableRangeDto> dtoMap = getStandRange();
|
||||||
if (StrUtil.isNotBlank(monitorBaseParam.getTargetKey())) {
|
if (StrUtil.isNotBlank(monitorBaseParam.getTargetKey())) {
|
||||||
if (!dtoMap.containsKey(monitorBaseParam.getTargetKey())) {
|
if (!dtoMap.containsKey(monitorBaseParam.getTargetKey())) {
|
||||||
@@ -366,44 +321,50 @@ public class PqDataVerifyBakServiceImpl extends ServiceImpl<PqDataVerifyBakMappe
|
|||||||
}
|
}
|
||||||
List<DetailAbnormalVO.DetailAbnormalInnerVO> result = new ArrayList<>();
|
List<DetailAbnormalVO.DetailAbnormalInnerVO> result = new ArrayList<>();
|
||||||
LambdaQueryWrapper<PqDataVerifyBak> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<PqDataVerifyBak> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
lambdaQueryWrapper.eq(PqDataVerifyBak::getTimeId, DateUtil.beginOfDay(DateUtil.parse(monitorBaseParam.getSearchBeginTime())))
|
lambdaQueryWrapper.in(PqDataVerifyBak::getTimeId, monitorBaseParam.getTime())
|
||||||
.in(PqDataVerifyBak::getLineId, monitorBaseParam.getMonitorIds()).orderByAsc(PqDataVerifyBak::getTimeId);
|
.in(PqDataVerifyBak::getLineId, monitorBaseParam.getMonitorIds());
|
||||||
|
|
||||||
PqDataVerifyBak pqDataVerifyBak = this.getOne(lambdaQueryWrapper);
|
List<PqDataVerifyBak> pqDataVerifyBak = this.list(lambdaQueryWrapper);
|
||||||
try (InputStream fileStream = fileStorageUtil.getFileStream(pqDataVerifyBak.getPath())) {
|
//index[0] 总异常时间 index[1]指标异常时间
|
||||||
|
Integer[] errorTimeCount = {0, 0};
|
||||||
|
Integer[] errAllCount = {0};
|
||||||
|
for (PqDataVerifyBak dataVerifyBak : pqDataVerifyBak) {
|
||||||
|
try (InputStream fileStream = fileStorageUtil.getFileStream(dataVerifyBak.getPath())) {
|
||||||
JSONArray jsonArray = new JSONArray(new JSONTokener(fileStream, new JSONConfig()));
|
JSONArray jsonArray = new JSONArray(new JSONTokener(fileStream, new JSONConfig()));
|
||||||
for (Object it : jsonArray) {
|
jsonArray.forEach(it->{
|
||||||
JSONObject targetJson = (JSONObject) it;
|
JSONObject targetJson = (JSONObject) it;
|
||||||
if (targetJson.containsKey("lineErrorTimes")) {
|
if (targetJson.containsKey("lineErrorTimes")) {
|
||||||
continue;
|
errorTimeCount[0] += Integer.valueOf(targetJson.get("lineErrorTimes").toString());
|
||||||
}
|
}else{
|
||||||
if (StrUtil.isNotBlank(monitorBaseParam.getTargetKey())) {
|
if (StrUtil.isNotBlank(monitorBaseParam.getTargetKey())) {
|
||||||
if (targetJson.containsKey(monitorBaseParam.getTargetKey())) {
|
if (targetJson.containsKey(monitorBaseParam.getTargetKey())) {
|
||||||
resultDeal(dtoMap, monitorBaseParam.getTargetKey(), targetJson, result);
|
resultDeal(dtoMap, monitorBaseParam.getTargetKey(), targetJson, result, dataVerifyBak.getTimeId().toString(), errorTimeCount, errAllCount);
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
String tarKey = "";
|
|
||||||
for (Map.Entry<String, PqReasonableRangeDto> entry : dtoMap.entrySet()) {
|
for (Map.Entry<String, PqReasonableRangeDto> entry : dtoMap.entrySet()) {
|
||||||
String key = entry.getKey();
|
String key = entry.getKey();
|
||||||
if (targetJson.containsKey(key)) {
|
if (targetJson.containsKey(key)) {
|
||||||
tarKey = key;
|
resultDeal(dtoMap, key, targetJson, result, dataVerifyBak.getTimeId().toString(), errorTimeCount, errAllCount);
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
resultDeal(dtoMap, tarKey, targetJson, result);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
});
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new BusinessException("数据异常");
|
throw new BusinessException("数据异常" + e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// 排序实现
|
// 排序实现
|
||||||
result = result.stream()
|
DetailAbnormalVO.DetailAbnormalCountVO info = new DetailAbnormalVO.DetailAbnormalCountVO();
|
||||||
.sorted(Comparator.comparing(DetailAbnormalVO.DetailAbnormalInnerVO::getTime)
|
info.setTimeSum(StrUtil.isBlank(monitorBaseParam.getTargetKey()) ? errorTimeCount[0] : errorTimeCount[1]);
|
||||||
|
info.setErrCount(errAllCount[0]);
|
||||||
|
info.setTime(result.stream()
|
||||||
|
.sorted(Comparator.comparing(DetailAbnormalVO.DetailAbnormalInnerVO::getTargetName)
|
||||||
.thenComparing(vo -> extractHarmonicOrder(vo.getTargetName()))
|
.thenComparing(vo -> extractHarmonicOrder(vo.getTargetName()))
|
||||||
.thenComparing(DetailAbnormalVO.DetailAbnormalInnerVO::getTargetName))
|
.thenComparing(DetailAbnormalVO.DetailAbnormalInnerVO::getTime))
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList()));
|
||||||
return result;
|
return info;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -431,12 +392,14 @@ public class PqDataVerifyBakServiceImpl extends ServiceImpl<PqDataVerifyBakMappe
|
|||||||
* 处理json对象中list数组
|
* 处理json对象中list数组
|
||||||
*/
|
*/
|
||||||
|
|
||||||
private void resultDeal(Map<String, PqReasonableRangeDto> dtoMap, String targetKey, JSONObject targetJson, List<DetailAbnormalVO.DetailAbnormalInnerVO> result) {
|
private void resultDeal(Map<String, PqReasonableRangeDto> dtoMap, String targetKey, JSONObject targetJson, List<DetailAbnormalVO.DetailAbnormalInnerVO> result, String date, Integer[] errorTimeCount, Integer[] errorCounts) {
|
||||||
PqReasonableRangeDto pqReasonableRangeDto = dtoMap.get(targetKey);
|
PqReasonableRangeDto pqReasonableRangeDto = dtoMap.get(targetKey);
|
||||||
JSONArray innerJson = targetJson.getJSONArray(targetKey);
|
JSONArray innerJson = targetJson.getJSONArray(targetKey);
|
||||||
innerJson.forEach(oo -> {
|
innerJson.forEach(oo -> {
|
||||||
JSONObject jsonObjectTem = (JSONObject) oo;
|
JSONObject jsonObjectTem = (JSONObject) oo;
|
||||||
String targetName = jsonObjectTem.get("targetName").toString();
|
String targetName = jsonObjectTem.get("targetName").toString();
|
||||||
|
errorCounts[0] += Integer.valueOf(jsonObjectTem.get("errorCounts").toString());
|
||||||
|
errorTimeCount[1] += Integer.valueOf(jsonObjectTem.get("errorTimes").toString());
|
||||||
JSONArray list = jsonObjectTem.getJSONArray("list");
|
JSONArray list = jsonObjectTem.getJSONArray("list");
|
||||||
List<DetailAbnormalVO.DetailLimitInnerVO> temList = new ArrayList<>();
|
List<DetailAbnormalVO.DetailLimitInnerVO> temList = new ArrayList<>();
|
||||||
list.forEach(listItem -> {
|
list.forEach(listItem -> {
|
||||||
@@ -447,7 +410,7 @@ public class PqDataVerifyBakServiceImpl extends ServiceImpl<PqDataVerifyBakMappe
|
|||||||
String valueType = object.get("valueType").toString();
|
String valueType = object.get("valueType").toString();
|
||||||
for (int i = 0; i < timeArr.size(); i++) {
|
for (int i = 0; i < timeArr.size(); i++) {
|
||||||
DetailAbnormalVO.DetailLimitInnerVO temData = new DetailAbnormalVO.DetailLimitInnerVO();
|
DetailAbnormalVO.DetailLimitInnerVO temData = new DetailAbnormalVO.DetailLimitInnerVO();
|
||||||
temData.setTime(timeArr.get(i).toString());
|
temData.setTime(date + " " + timeArr.get(i).toString());
|
||||||
temData.setVal(valueArr.get(i).toString());
|
temData.setVal(valueArr.get(i).toString());
|
||||||
temData.setTargetName(targetName);
|
temData.setTargetName(targetName);
|
||||||
temData.setTargetKey(targetKey);
|
temData.setTargetKey(targetKey);
|
||||||
@@ -475,11 +438,11 @@ public class PqDataVerifyBakServiceImpl extends ServiceImpl<PqDataVerifyBakMappe
|
|||||||
vo.setTargetKey(targetKey);
|
vo.setTargetKey(targetKey);
|
||||||
vo.setPhaseType(phaseKey);
|
vo.setPhaseType(phaseKey);
|
||||||
|
|
||||||
if ((DataCleanEnum.DataI.getCode() + SEPARATOR + DataCleanEnum.RmsI.getCode() ).equals(targetKey)) {
|
// if ((DataCleanEnum.DataI.getCode() + SEPARATOR + DataCleanEnum.RmsI.getCode() ).equals(targetKey)) {
|
||||||
vo.setRangeDesc(pqReasonableRangeDto.getMinValue() + unit + " ~ " + pqReasonableRangeDto.getMaxValue() + "*CT1" + unit);
|
// vo.setRangeDesc(pqReasonableRangeDto.getMinValue() + unit + " ~ " + pqReasonableRangeDto.getMaxValue() + "*CT1" + unit);
|
||||||
} else {
|
// } else {
|
||||||
vo.setRangeDesc(pqReasonableRangeDto.getMinValue() + unit + " ~ " + pqReasonableRangeDto.getMaxValue() + unit);
|
vo.setRangeDesc(pqReasonableRangeDto.getMinValue() + unit + " ~ " + pqReasonableRangeDto.getMaxValue() + unit);
|
||||||
}
|
// }
|
||||||
valueList.forEach(ites -> {
|
valueList.forEach(ites -> {
|
||||||
switch (ites.getType()) {
|
switch (ites.getType()) {
|
||||||
case "AVG":
|
case "AVG":
|
||||||
@@ -512,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())))
|
lambdaQueryWrapper.between(PqDataVerifyBak::getTimeId, DateUtil.beginOfDay(DateUtil.parse(monitorBaseParam.getSearchBeginTime())), DateUtil.endOfDay(DateUtil.parse(monitorBaseParam.getSearchEndTime())))
|
||||||
.in(PqDataVerifyBak::getLineId, monitorIds)
|
.in(PqDataVerifyBak::getLineId, monitorIds)
|
||||||
.eq(PqDataVerifyBak::getState, 1)
|
.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);
|
.orderByAsc(PqDataVerifyBak::getTimeId);
|
||||||
return this.list(lambdaQueryWrapper);
|
return this.list(lambdaQueryWrapper);
|
||||||
}
|
}
|
||||||
@@ -525,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())))
|
.lambda().between(PqDataVerifyBak::getTimeId, DateUtil.beginOfDay(DateUtil.parse(monitorBaseParam.getSearchBeginTime())), DateUtil.endOfDay(DateUtil.parse(monitorBaseParam.getSearchEndTime())))
|
||||||
.in(PqDataVerifyBak::getLineId, monitorIds)
|
.in(PqDataVerifyBak::getLineId, monitorIds)
|
||||||
.eq(PqDataVerifyBak::getState, 1)
|
.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);
|
.groupBy(PqDataVerifyBak::getLineId);
|
||||||
return this.list(queryWrapper);
|
return this.list(queryWrapper);
|
||||||
}
|
}
|
||||||
@@ -565,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<>();
|
List<VerifyTargetVO> result = new ArrayList<>();
|
||||||
Map<String, PqReasonableRangeDto> rangeMap = getStandRange();
|
Map<String, PqReasonableRangeDto> rangeMap = getStandRange();
|
||||||
rangeMap.forEach((key, dto) -> {
|
rangeMap.forEach((key, dto) -> {
|
||||||
Set<String> ids;
|
Set<String> ids;
|
||||||
switch (key) {
|
switch (key) {
|
||||||
case Param.freq:
|
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);
|
assembleEntity(ids, dto, result);
|
||||||
break;
|
break;
|
||||||
case Param.freq_dev:
|
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);
|
assembleEntity(ids, dto, result);
|
||||||
break;
|
break;
|
||||||
case Param.rms_v:
|
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);
|
assembleEntity(ids, dto, result);
|
||||||
break;
|
break;
|
||||||
case Param.rms_lvr:
|
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);
|
assembleEntity(ids, dto, result);
|
||||||
break;
|
break;
|
||||||
case Param.vu_dev:
|
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);
|
assembleEntity(ids, dto, result);
|
||||||
break;
|
break;
|
||||||
case Param.vl_dev:
|
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);
|
assembleEntity(ids, dto, result);
|
||||||
break;
|
break;
|
||||||
case Param.rms_i:
|
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);
|
assembleEntity(ids, dto, result);
|
||||||
break;
|
break;
|
||||||
case Param.v_thd:
|
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);
|
assembleEntity(ids, dto, result);
|
||||||
break;
|
break;
|
||||||
case Param.v_1_v:
|
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);
|
assembleEntity(ids, dto, result);
|
||||||
break;
|
break;
|
||||||
case Param.phasic_v_1:
|
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);
|
assembleEntity(ids, dto, result);
|
||||||
break;
|
break;
|
||||||
case Param.phasic_rate_x:
|
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);
|
assembleEntity(ids, dto, result);
|
||||||
break;
|
break;
|
||||||
case Param.v_rate:
|
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);
|
assembleEntity(ids, dto, result);
|
||||||
break;
|
break;
|
||||||
case Param.in_v_rate:
|
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);
|
assembleEntity(ids, dto, result);
|
||||||
break;
|
break;
|
||||||
case Param.v_zero:
|
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);
|
assembleEntity(ids, dto, result);
|
||||||
break;
|
break;
|
||||||
case Param.v_neg:
|
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);
|
assembleEntity(ids, dto, result);
|
||||||
break;
|
break;
|
||||||
case Param.v_pos:
|
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);
|
assembleEntity(ids, dto, result);
|
||||||
break;
|
break;
|
||||||
case Param.v_unbalance:
|
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);
|
assembleEntity(ids, dto, result);
|
||||||
break;
|
break;
|
||||||
case Param.fluc:
|
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);
|
assembleEntity(ids, dto, result);
|
||||||
break;
|
break;
|
||||||
case Param.pst:
|
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);
|
assembleEntity(ids, dto, result);
|
||||||
break;
|
break;
|
||||||
case Param.plt:
|
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);
|
assembleEntity(ids, dto, result);
|
||||||
break;
|
break;
|
||||||
case Param.pf:
|
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);
|
assembleEntity(ids, dto, result);
|
||||||
break;
|
break;
|
||||||
case Param.Voltage_Dip:
|
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);
|
assembleEntity(ids, dto, result);
|
||||||
break;
|
break;
|
||||||
case Param.Voltage_Rise:
|
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);
|
assembleEntity(ids, dto, result);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@@ -686,12 +741,11 @@ public class PqDataVerifyBakServiceImpl extends ServiceImpl<PqDataVerifyBakMappe
|
|||||||
if (StrUtil.isNotBlank(dto.getUnit())) {
|
if (StrUtil.isNotBlank(dto.getUnit())) {
|
||||||
unit = dto.getUnit();
|
unit = dto.getUnit();
|
||||||
}
|
}
|
||||||
if (temStr.equals(Param.rms_i)) {
|
// if (temStr.equals(Param.rms_i)) {
|
||||||
verifyTargetVO.setRangeDesc(dto.getMinValue() + unit + " ~ " + dto.getMaxValue() + "*CT1" + unit);
|
// verifyTargetVO.setRangeDesc(dto.getMinValue() + unit + " ~ " + dto.getMaxValue() + "*CT1" + unit);
|
||||||
} else {
|
// } else {
|
||||||
verifyTargetVO.setRangeDesc(dto.getMinValue() + unit + " ~ " + dto.getMaxValue() + unit);
|
verifyTargetVO.setRangeDesc(dto.getMinValue() + unit + " ~ " + dto.getMaxValue() + unit);
|
||||||
}
|
// }
|
||||||
|
|
||||||
result.add(verifyTargetVO);
|
result.add(verifyTargetVO);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ public class RunManageServiceImpl implements RunManageService {
|
|||||||
DeviceInfoParam deviceInfoParam = new DeviceInfoParam();
|
DeviceInfoParam deviceInfoParam = new DeviceInfoParam();
|
||||||
BeanUtil.copyProperties(runManageParam, deviceInfoParam);
|
BeanUtil.copyProperties(runManageParam, deviceInfoParam);
|
||||||
deviceInfoParam.setServerName("pqs-common");
|
deviceInfoParam.setServerName("pqs-common");
|
||||||
List<GeneralDeviceDTO> generalDeviceDTOList = generalDeviceService.getDeviceInfo(deviceInfoParam, Stream.of(0,1,2).collect(Collectors.toList()), Stream.of(1).collect(Collectors.toList()));
|
List<GeneralDeviceDTO> generalDeviceDTOList = generalDeviceService.getDeviceInfo(deviceInfoParam, null, Stream.of(1).collect(Collectors.toList()));
|
||||||
lineIndexes = generalDeviceDTOList.stream().flatMap(list -> list.getLineIndexes().stream()).collect(Collectors.toList());
|
lineIndexes = generalDeviceDTOList.stream().flatMap(list -> list.getLineIndexes().stream()).collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
if (!CollectionUtils.isEmpty(lineIndexes)) {
|
if (!CollectionUtils.isEmpty(lineIndexes)) {
|
||||||
|
|||||||
@@ -182,11 +182,17 @@ public class TerminalOnlineRateDataServiceImpl implements TerminalOnlineRateData
|
|||||||
type.add(generalDeviceDTO.getName()+"\n("+generalDeviceDTO.getLineIndexes().size()+")");
|
type.add(generalDeviceDTO.getName()+"\n("+generalDeviceDTO.getLineIndexes().size()+")");
|
||||||
//根据终端索引集查询在线率
|
//根据终端索引集查询在线率
|
||||||
List<PublicDTO> onlineRateList = getCondition(deviceIndexes, onlineRateCensusParam.getSearchBeginTime(), onlineRateCensusParam.getSearchEndTime());
|
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())){
|
if(StrUtil.isNotBlank(onlineRateCensusParam.getPeriodBeginTime()) && StrUtil.isNotBlank(onlineRateCensusParam.getPeriodEndTime())){
|
||||||
List<PublicDTO> compareData = getCondition(deviceIndexes, onlineRateCensusParam.getPeriodBeginTime(), 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)) {
|
if (CollUtil.isNotEmpty(data)) {
|
||||||
data.forEach(po -> {
|
data.forEach(po -> {
|
||||||
PublicDTO publicDTO = new PublicDTO();
|
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.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);
|
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 {
|
} else {
|
||||||
subItem.setOnlineRate(3.14159);
|
subItem.setOnlineRate(3.14159);
|
||||||
|
subItem.setOnlineMin(0);
|
||||||
|
subItem.setOfflineMin(0);
|
||||||
}
|
}
|
||||||
if (Objects.nonNull(subItem.getAlgoDescribe())) {
|
if (Objects.nonNull(subItem.getAlgoDescribe())) {
|
||||||
if (mapAlarm.containsKey(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 {
|
} else {
|
||||||
gdItem.setOnlineRate(3.14159);
|
gdItem.setOnlineRate(3.14159);
|
||||||
|
gdItem.setOnlineMin(0);
|
||||||
|
gdItem.setOfflineMin(0);
|
||||||
}
|
}
|
||||||
if (Objects.nonNull(gdItem.getAlgoDescribe())) {
|
if (Objects.nonNull(gdItem.getAlgoDescribe())) {
|
||||||
if (mapAlarm.containsKey(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 {
|
} else {
|
||||||
proItem.setOnlineRate(3.14159);
|
proItem.setOnlineRate(3.14159);
|
||||||
|
proItem.setOnlineMin(0);
|
||||||
|
proItem.setOfflineMin(0);
|
||||||
}
|
}
|
||||||
if (Objects.nonNull(proItem.getAlgoDescribe())) {
|
if (Objects.nonNull(proItem.getAlgoDescribe())) {
|
||||||
if (mapAlarm.containsKey(proItem.getAlgoDescribe()))
|
if (mapAlarm.containsKey(proItem.getAlgoDescribe()))
|
||||||
|
|||||||
@@ -127,16 +127,26 @@ public class DataStatisticsUtil {
|
|||||||
for (TerminalOnlineRateData onlineRateData : terminalOnlineRateList) {
|
for (TerminalOnlineRateData onlineRateData : terminalOnlineRateList) {
|
||||||
if (onlineRateDataVO.getId().equals(onlineRateData.getDevId())) {
|
if (onlineRateDataVO.getId().equals(onlineRateData.getDevId())) {
|
||||||
flag = true;
|
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;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!flag) {
|
if (!flag) {
|
||||||
onlineRateDataVO.setOnlineRate(3.14159);
|
onlineRateDataVO.setOnlineRate(3.14159);
|
||||||
|
onlineRateDataVO.setOnlineMin(0);
|
||||||
|
onlineRateDataVO.setOfflineMin(0);
|
||||||
}
|
}
|
||||||
}).collect(Collectors.toList());
|
}).collect(Collectors.toList());
|
||||||
} else {
|
} 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;
|
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+'%'"/>
|
<bind name="searchValueLike" value="'%'+searchValue+'%'"/>
|
||||||
AND (sub.NAME LIKE #{searchValueLike}
|
AND (sub.NAME LIKE #{searchValueLike}
|
||||||
OR dev.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>
|
</if>
|
||||||
ORDER BY
|
ORDER BY
|
||||||
gdName,
|
gdName,
|
||||||
@@ -339,10 +342,10 @@
|
|||||||
</if>
|
</if>
|
||||||
<if test="searchValue != '' and searchValue != null ">
|
<if test="searchValue != '' and searchValue != null ">
|
||||||
<bind name="searchValueLike" value="'%'+searchValue+'%'"/>
|
<bind name="searchValueLike" value="'%'+searchValue+'%'"/>
|
||||||
AND sub.NAME LIKE #{searchValueLike}
|
AND (sub.NAME LIKE #{searchValueLike}
|
||||||
OR dev.NAME LIKE #{searchValueLike}
|
OR dev.NAME LIKE #{searchValueLike}
|
||||||
OR devT.Name LIKE #{searchValueLike}
|
OR devT.Name LIKE #{searchValueLike}
|
||||||
OR device.IP LIKE #{searchValueLike}
|
OR device.IP LIKE #{searchValueLike})
|
||||||
</if>
|
</if>
|
||||||
ORDER BY
|
ORDER BY
|
||||||
gdName,
|
gdName,
|
||||||
|
|||||||
@@ -36,8 +36,10 @@ public class OnLineRateServiceImpl extends ServiceImpl<OnLineRateMapper, RStatOn
|
|||||||
@Override
|
@Override
|
||||||
public DeviceOnlineRate deviceOnlineRateInfo(DeviceInfoParam.BusinessParam param) {
|
public DeviceOnlineRate deviceOnlineRateInfo(DeviceInfoParam.BusinessParam param) {
|
||||||
DeviceOnlineRate rate = new DeviceOnlineRate();
|
DeviceOnlineRate rate = new DeviceOnlineRate();
|
||||||
|
List<Integer> devRun = ObjectUtil.isNull(param.getLineRunFlag()) ? null : Arrays.asList(param.getLineRunFlag());
|
||||||
|
param.setLineRunFlag(null);
|
||||||
//获取终端台账类信息
|
//获取终端台账类信息
|
||||||
List<GeneralDeviceDTO> deviceInfo = deviceService.getDeviceInfo(param, ObjectUtil.isNull(param.getLineRunFlag()) ? null : Arrays.asList(param.getLineRunFlag()), Arrays.asList(1));
|
List<GeneralDeviceDTO> deviceInfo = deviceService.getDeviceInfo(param, devRun, Arrays.asList(1));
|
||||||
if (CollUtil.isNotEmpty(deviceInfo)) {
|
if (CollUtil.isNotEmpty(deviceInfo)) {
|
||||||
List<String> deviceIds = deviceInfo.stream()
|
List<String> deviceIds = deviceInfo.stream()
|
||||||
.flatMap(x -> x.getDeviceIndexes().stream()).collect(Collectors.toList())
|
.flatMap(x -> x.getDeviceIndexes().stream()).collect(Collectors.toList())
|
||||||
|
|||||||
@@ -81,7 +81,8 @@ public interface DeptLineMapper extends BaseMapper<DeptLine> {
|
|||||||
List<TerminalGetBase.Extend> orgSubStationInfoGet(@Param("list")List<Integer> devType,
|
List<TerminalGetBase.Extend> orgSubStationInfoGet(@Param("list")List<Integer> devType,
|
||||||
@Param("powerFlag")Integer powerFlag,
|
@Param("powerFlag")Integer powerFlag,
|
||||||
@Param("lineRunFlag") Integer lineRunFlag,
|
@Param("lineRunFlag") Integer lineRunFlag,
|
||||||
@Param("monitorFlag") Integer monitorFlag
|
@Param("monitorFlag") Integer monitorFlag,
|
||||||
|
@Param("searchValue") String searchValue
|
||||||
);
|
);
|
||||||
|
|
||||||
List<String> getLineIdByDeptIds(@Param("deptIds")List<String> deptIds,
|
List<String> getLineIdByDeptIds(@Param("deptIds")List<String> deptIds,
|
||||||
@@ -94,4 +95,6 @@ public interface DeptLineMapper extends BaseMapper<DeptLine> {
|
|||||||
List<SubGetBase> selectSubStationList(@Param("param") SubstationParam substationParam);
|
List<SubGetBase> selectSubStationList(@Param("param") SubstationParam substationParam);
|
||||||
|
|
||||||
List<String> getLineByDeptIdAndNewStation(@Param("ids") List<String> id,@Param("dictTree")List<String> dictTree);
|
List<String> getLineByDeptIdAndNewStation(@Param("ids") List<String> id,@Param("dictTree")List<String> dictTree);
|
||||||
|
|
||||||
|
List<DeptLine> getOnlineMonitor();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -579,4 +579,13 @@ public interface LineMapper extends BaseMapper<Line> {
|
|||||||
* 根据Pid获取所有子节点
|
* 根据Pid获取所有子节点
|
||||||
*/
|
*/
|
||||||
List<String> getSubIdByPid(@Param("pid") String pid);
|
List<String> getSubIdByPid(@Param("pid") String pid);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据监测点id获取终端id
|
||||||
|
*
|
||||||
|
* @param ids 监测点集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
List<String> getDevIdsLine(@Param("ids") List<String> ids);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -194,6 +194,12 @@
|
|||||||
<if test="monitorFlag!=null ">
|
<if test="monitorFlag!=null ">
|
||||||
and lineDetail.Monitor_Flag = #{monitorFlag}
|
and lineDetail.Monitor_Flag = #{monitorFlag}
|
||||||
</if>
|
</if>
|
||||||
|
<if test="searchValue != '' and searchValue != null ">
|
||||||
|
<bind name="searchValueLike" value="'%'+searchValue+'%'"/>
|
||||||
|
AND (substation.name LIKE #{searchValueLike}
|
||||||
|
OR point.NAME LIKE #{searchValueLike}
|
||||||
|
)
|
||||||
|
</if>
|
||||||
</select>
|
</select>
|
||||||
<select id="getLineIdByDeptIds" resultType="string">
|
<select id="getLineIdByDeptIds" resultType="string">
|
||||||
select
|
select
|
||||||
@@ -294,4 +300,16 @@
|
|||||||
</if>
|
</if>
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</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>
|
</mapper>
|
||||||
|
|||||||
@@ -294,7 +294,7 @@
|
|||||||
#{item.id}
|
#{item.id}
|
||||||
</foreach>
|
</foreach>
|
||||||
</if>
|
</if>
|
||||||
<if test="deviceInfoParam.searchValue!=null and deviceInfoParam.lineOrDevice==0">
|
<if test="deviceInfoParam.searchValue!=null and deviceInfoParam.searchValue!='' and deviceInfoParam.lineOrDevice==0">
|
||||||
AND t1.name like CONCAT(CONCAT('%', #{deviceInfoParam.searchValue}), '%')
|
AND t1.name like CONCAT(CONCAT('%', #{deviceInfoParam.searchValue}), '%')
|
||||||
</if>
|
</if>
|
||||||
<!-- xy -->
|
<!-- xy -->
|
||||||
@@ -344,7 +344,7 @@
|
|||||||
#{item.id}
|
#{item.id}
|
||||||
</foreach>
|
</foreach>
|
||||||
</if>
|
</if>
|
||||||
<if test="deviceInfoParam.searchValue!=null and deviceInfoParam.lineOrDevice==1">
|
<if test="deviceInfoParam.searchValue!=null and deviceInfoParam.searchValue!='' and deviceInfoParam.lineOrDevice==1">
|
||||||
AND t1.name like CONCAT(CONCAT('%', #{deviceInfoParam.searchValue}), '%')
|
AND t1.name like CONCAT(CONCAT('%', #{deviceInfoParam.searchValue}), '%')
|
||||||
</if>
|
</if>
|
||||||
<if test="devIds!=null and devIds.size()!=0">
|
<if test="devIds!=null and devIds.size()!=0">
|
||||||
@@ -1542,7 +1542,7 @@
|
|||||||
<select id="selectByIds" resultType="com.njcn.device.pq.pojo.vo.LineDetailVO$Detail">
|
<select id="selectByIds" resultType="com.njcn.device.pq.pojo.vo.LineDetailVO$Detail">
|
||||||
SELECT DISTINCT
|
SELECT DISTINCT
|
||||||
line.id as lineId,
|
line.id as lineId,
|
||||||
dept.`Name` deptName,
|
dept.Name deptName,
|
||||||
area.name as areaId,
|
area.name as areaId,
|
||||||
gd.NAME gdName,
|
gd.NAME gdName,
|
||||||
substation.NAME subName,
|
substation.NAME subName,
|
||||||
@@ -1935,5 +1935,19 @@
|
|||||||
AND t2.Monitor_Flag = 0
|
AND t2.Monitor_Flag = 0
|
||||||
</if>
|
</if>
|
||||||
</select>
|
</select>
|
||||||
|
<select id="getDevIdsLine" resultType="java.lang.String">
|
||||||
|
SELECT
|
||||||
|
DISTINCT d.id
|
||||||
|
FROM
|
||||||
|
pq_line a
|
||||||
|
INNER JOIN pq_line v ON a.pid = v.id
|
||||||
|
INNER JOIN pq_line d ON v.pid = d.id
|
||||||
|
where
|
||||||
|
a.id in
|
||||||
|
<foreach collection="ids" separator="," open="(" close=")" item="item">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
|
|
||||||
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@@ -44,6 +44,13 @@ public interface DeptLineService extends IService<DeptLine> {
|
|||||||
List<DeptLine> selectDeptBindLines(List<String> ids);
|
List<DeptLine> selectDeptBindLines(List<String> ids);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据监测点id获取部门信息
|
||||||
|
* @param ids
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<DeptLine> selectDeptLine(List<String> ids);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据部门ids集合查询所有监测点id
|
* 根据部门ids集合查询所有监测点id
|
||||||
* @param ids 部门ids
|
* @param ids 部门ids
|
||||||
@@ -115,7 +122,7 @@ public interface DeptLineService extends IService<DeptLine> {
|
|||||||
Map<String, List<TerminalGetBase>> orgSubStationGet(List<Integer> devType);
|
Map<String, List<TerminalGetBase>> orgSubStationGet(List<Integer> devType);
|
||||||
|
|
||||||
|
|
||||||
List<TerminalGetBase.Extend> orgSubStationInfoGet(List<Integer> devType,Integer powerFlag,Integer lineRunFlag,Integer monitorFlag);
|
List<TerminalGetBase.Extend> orgSubStationInfoGet(List<Integer> devType,Integer powerFlag,Integer lineRunFlag,Integer monitorFlag,String searchValue);
|
||||||
|
|
||||||
List<SubGetBase> getSubStationList(SubstationParam substationParam);
|
List<SubGetBase> getSubStationList(SubstationParam substationParam);
|
||||||
|
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ import com.njcn.system.pojo.vo.DictTreeVO;
|
|||||||
import com.njcn.user.api.DeptFeignClient;
|
import com.njcn.user.api.DeptFeignClient;
|
||||||
import com.njcn.user.pojo.dto.DeptDTO;
|
import com.njcn.user.pojo.dto.DeptDTO;
|
||||||
import com.njcn.user.pojo.po.Dept;
|
import com.njcn.user.pojo.po.Dept;
|
||||||
|
import com.njcn.user.pojo.vo.PvTerminalTreeVO;
|
||||||
import com.njcn.web.pojo.param.DeptLineParam;
|
import com.njcn.web.pojo.param.DeptLineParam;
|
||||||
import com.njcn.web.utils.WebUtil;
|
import com.njcn.web.utils.WebUtil;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
@@ -34,9 +35,7 @@ import lombok.extern.slf4j.Slf4j;
|
|||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.*;
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -81,6 +80,15 @@ public class DeptLineServiceImpl extends ServiceImpl<DeptLineMapper, DeptLine> i
|
|||||||
detailMapper.update(null, new LambdaUpdateWrapper<LineDetail>()
|
detailMapper.update(null, new LambdaUpdateWrapper<LineDetail>()
|
||||||
.set(LineDetail::getActualArea, data.getArea())
|
.set(LineDetail::getActualArea, data.getArea())
|
||||||
.in(LineDetail::getId, lineIds));
|
.in(LineDetail::getId, lineIds));
|
||||||
|
} else {
|
||||||
|
List<String> deptList = Arrays.asList("130700000000", "130300000000", "130800000000", "130200000000", "131000000000");
|
||||||
|
Dept data = deptFeignClient.getDeptById(deptLineParam.getId()).getData();
|
||||||
|
if (deptList.contains(data.getArea())) {
|
||||||
|
List<String> lineIds = list.stream().map(LineDetail::getId).collect(Collectors.toList());
|
||||||
|
detailMapper.update(null, new LambdaUpdateWrapper<LineDetail>()
|
||||||
|
.set(LineDetail::getActualArea, data.getArea())
|
||||||
|
.in(LineDetail::getId, lineIds));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.saveBatch(deptLines);
|
this.saveBatch(deptLines);
|
||||||
@@ -101,6 +109,22 @@ public class DeptLineServiceImpl extends ServiceImpl<DeptLineMapper, DeptLine> i
|
|||||||
return this.lambdaQuery().in(DeptLine::getId, ids).list();
|
return this.lambdaQuery().in(DeptLine::getId, ids).list();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<DeptLine> selectDeptLine(List<String> ids) {
|
||||||
|
List<DeptLine> list = this.lambdaQuery().in(DeptLine::getLineId, ids).list();
|
||||||
|
if (CollUtil.isNotEmpty(list)) {
|
||||||
|
List<Dept> data = deptFeignClient.getAllDept().getData();
|
||||||
|
Map<String, String> deptName = data.stream().collect(Collectors.toMap(Dept::getId, Dept::getName));
|
||||||
|
for (DeptLine deptLine : list) {
|
||||||
|
if (deptName.containsKey(deptLine.getId())) {
|
||||||
|
deptLine.setId(deptName.get(deptLine.getId()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
return new ArrayList<>();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> getLineByDeptIds(List<String> ids,String manufacturer, List<Integer> runFlag, List<Integer> dataType, String objType) {
|
public List<String> getLineByDeptIds(List<String> ids,String manufacturer, List<Integer> runFlag, List<Integer> dataType, String objType) {
|
||||||
return this.baseMapper.getLineIdByDeptIds(ids, manufacturer ,runFlag, dataType, objType);
|
return this.baseMapper.getLineIdByDeptIds(ids, manufacturer ,runFlag, dataType, objType);
|
||||||
@@ -182,8 +206,13 @@ public class DeptLineServiceImpl extends ServiceImpl<DeptLineMapper, DeptLine> i
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<TerminalGetBase.Extend> orgSubStationInfoGet(List<Integer> devType, Integer powerFlag, Integer lineRunFlag,Integer monitorFlag) {
|
public List<TerminalGetBase.Extend> orgSubStationInfoGet(List<Integer> devType,
|
||||||
return deptLineMapper.orgSubStationInfoGet(devType, powerFlag, lineRunFlag,monitorFlag);
|
Integer powerFlag,
|
||||||
|
Integer lineRunFlag,
|
||||||
|
Integer monitorFlag,
|
||||||
|
String searchValue
|
||||||
|
) {
|
||||||
|
return deptLineMapper.orgSubStationInfoGet(devType, powerFlag, lineRunFlag,monitorFlag,searchValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -19,7 +19,9 @@
|
|||||||
<select id="getOnIntegrityByIds" resultType="com.njcn.device.pq.pojo.vo.RStatIntegrityVO">
|
<select id="getOnIntegrityByIds" resultType="com.njcn.device.pq.pojo.vo.RStatIntegrityVO">
|
||||||
SELECT
|
SELECT
|
||||||
line_index AS lineIndex,
|
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
|
FROM
|
||||||
r_stat_integrity_d
|
r_stat_integrity_d
|
||||||
<where>
|
<where>
|
||||||
@@ -112,12 +114,12 @@
|
|||||||
|
|
||||||
<select id="getNoData" resultType="OnlineMonitorVo">
|
<select id="getNoData" resultType="OnlineMonitorVo">
|
||||||
SELECT DISTINCT
|
SELECT DISTINCT
|
||||||
t6.`Name` gdName,
|
t6.Name gdName,
|
||||||
t5.`Name` subName,
|
t5.Name subName,
|
||||||
t4.`Name` deviceName,
|
t4.Name deviceName,
|
||||||
t1.line_index lineId,
|
t1.line_index lineId,
|
||||||
t2.`Name` lineName,
|
t2.Name lineName,
|
||||||
t8.`Name` monitorObjType,
|
t8.Name monitorObjType,
|
||||||
t7.Obj_Name monitorObj,
|
t7.Obj_Name monitorObj,
|
||||||
"完整性为0" as target,
|
"完整性为0" as target,
|
||||||
count(t1.time_id) lastDay
|
count(t1.time_id) lastDay
|
||||||
|
|||||||
@@ -36,10 +36,10 @@ public class TransientParam extends DeviceInfoParam.BusinessParam {
|
|||||||
private BigDecimal eventValueMin;
|
private BigDecimal eventValueMin;
|
||||||
|
|
||||||
@ApiModelProperty("持续时间最大值")
|
@ApiModelProperty("持续时间最大值")
|
||||||
private Integer persistMax;
|
private Double persistMax;
|
||||||
|
|
||||||
@ApiModelProperty("持续时间最小值")
|
@ApiModelProperty("持续时间最小值")
|
||||||
private Integer persistMin;
|
private Double persistMin;
|
||||||
|
|
||||||
@ApiModelProperty("严重度最大值")
|
@ApiModelProperty("严重度最大值")
|
||||||
private BigDecimal severityMax;
|
private BigDecimal severityMax;
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ public class PqDevice implements Serializable {
|
|||||||
*/
|
*/
|
||||||
private Date nextTimeCheck;
|
private Date nextTimeCheck;
|
||||||
/**
|
/**
|
||||||
* 电镀功能 0关闭 1开启 默认关闭
|
* 电度功能 0关闭 1开启 默认关闭
|
||||||
*/
|
*/
|
||||||
private Integer electroplate;
|
private Integer electroplate;
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -55,10 +55,10 @@ public class AreaAnalysisServiceImpl implements AreaAnalysisService {
|
|||||||
@Override
|
@Override
|
||||||
public AreaAnalysisVO getEventReason(DeviceInfoParam.BusinessParam deviceInfoParam) {
|
public AreaAnalysisVO getEventReason(DeviceInfoParam.BusinessParam deviceInfoParam) {
|
||||||
//获取暂降字典信息
|
//获取暂降字典信息
|
||||||
// DictData voltageData = dicDataFeignClient.getDicDataByCode(DicDataEnum.VOLTAGE_DIP.getCode()).getData();
|
DictData voltageData = dicDataFeignClient.getDicDataByCode(DicDataEnum.VOLTAGE_DIP.getCode()).getData();
|
||||||
// if(ObjectUtil.isNull(voltageData)){
|
if(ObjectUtil.isNull(voltageData)){
|
||||||
// throw new BusinessException(DeviceResponseEnum.DIC_GET_EMPTY);
|
throw new BusinessException(DeviceResponseEnum.DIC_GET_EMPTY);
|
||||||
// }
|
}
|
||||||
AreaAnalysisVO areaAnalysisVO = new AreaAnalysisVO();
|
AreaAnalysisVO areaAnalysisVO = new AreaAnalysisVO();
|
||||||
List<DictData> dicReasonList = dicDataFeignClient.getDicDataByTypeName(DicDataTypeEnum.EVENT_REASON.getName()).getData();
|
List<DictData> dicReasonList = dicDataFeignClient.getDicDataByTypeName(DicDataTypeEnum.EVENT_REASON.getName()).getData();
|
||||||
List<DictData> dicTypeList = dicDataFeignClient.getDicDataByTypeName(DicDataTypeEnum.EVENT_TYPE.getName()).getData();
|
List<DictData> dicTypeList = dicDataFeignClient.getDicDataByTypeName(DicDataTypeEnum.EVENT_TYPE.getName()).getData();
|
||||||
@@ -67,11 +67,11 @@ public class AreaAnalysisServiceImpl implements AreaAnalysisService {
|
|||||||
List<String> lineIds = getAllLineIdList(generalDeviceDTOList);
|
List<String> lineIds = getAllLineIdList(generalDeviceDTOList);
|
||||||
|
|
||||||
//查询数据
|
//查询数据
|
||||||
// List<AreaAnalysisVO.Children> reasonList = assData(dicReasonList, lineIds, deviceInfoParam.getSearchBeginTime(), deviceInfoParam.getSearchEndTime(), "event_reason");
|
// List<AreaAnalysisVO.Children> reasonList = assData(dicReasonList, lineIds, deviceInfoParam.getSearchBeginTime(), deviceInfoParam.getSearchEndTime(), "event_reason");
|
||||||
List<RmpEventDetailPO> info = eventDetailService.list(new QueryWrapper<RmpEventDetailPO>()
|
List<RmpEventDetailPO> info = eventDetailService.list(new QueryWrapper<RmpEventDetailPO>()
|
||||||
.select("advance_reason,advance_type,count(event_id) as count")
|
.select("advance_reason,advance_type,count(event_id) as count")
|
||||||
.in("measurement_point_id", lineIds)
|
.in("measurement_point_id", lineIds)
|
||||||
// .eq("event_type", voltageData.getId())
|
.eq("event_type", voltageData.getId())
|
||||||
.in("advance_reason", dicReasonList.stream().map(DictData::getId).collect(Collectors.toList()))
|
.in("advance_reason", dicReasonList.stream().map(DictData::getId).collect(Collectors.toList()))
|
||||||
.in("advance_type", dicTypeList.stream().map(DictData::getId).collect(Collectors.toList()))
|
.in("advance_type", dicTypeList.stream().map(DictData::getId).collect(Collectors.toList()))
|
||||||
.ge(StrUtil.isNotBlank(deviceInfoParam.getSearchBeginTime()),"start_time" ,DateUtil.beginOfDay(DateUtil.parse(deviceInfoParam.getSearchBeginTime())))
|
.ge(StrUtil.isNotBlank(deviceInfoParam.getSearchBeginTime()),"start_time" ,DateUtil.beginOfDay(DateUtil.parse(deviceInfoParam.getSearchBeginTime())))
|
||||||
@@ -259,12 +259,10 @@ public class AreaAnalysisServiceImpl implements AreaAnalysisService {
|
|||||||
|
|
||||||
private List<AreaAnalysisVO.Children> assReasonPQ(Map<String, List<String>> stringListMap, List<RmpEventDetailPO> info, String typeId){
|
private List<AreaAnalysisVO.Children> assReasonPQ(Map<String, List<String>> stringListMap, List<RmpEventDetailPO> info, String typeId){
|
||||||
List<AreaAnalysisVO.Children> reasonList = new ArrayList<>();
|
List<AreaAnalysisVO.Children> reasonList = new ArrayList<>();
|
||||||
|
|
||||||
List<RmpEventDetailPO> reasons = info.stream().filter(x -> typeId.equals(x.getAdvanceReason())).collect(Collectors.toList());
|
|
||||||
Integer allCount = 0;
|
Integer allCount = 0;
|
||||||
for (Map.Entry<String, List<String>> stringListEntry : stringListMap.entrySet()) {
|
for (Map.Entry<String, List<String>> stringListEntry : stringListMap.entrySet()) {
|
||||||
List<String> value = stringListEntry.getValue();
|
List<String> value = stringListEntry.getValue();
|
||||||
Integer count = reasons.stream().filter(x -> value.contains(x.getAdvanceType())).mapToInt(RmpEventDetailPO::getCount).sum();
|
Integer count = info.stream().filter(x -> value.contains(x.getAdvanceType())).mapToInt(RmpEventDetailPO::getCount).sum();
|
||||||
AreaAnalysisVO.Children allType = new AreaAnalysisVO.Children();
|
AreaAnalysisVO.Children allType = new AreaAnalysisVO.Children();
|
||||||
allType.setName(stringListEntry.getKey());
|
allType.setName(stringListEntry.getKey());
|
||||||
allType.setValue(count);
|
allType.setValue(count);
|
||||||
|
|||||||
@@ -22,10 +22,7 @@ import lombok.extern.slf4j.Slf4j;
|
|||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.*;
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
import java.util.stream.Stream;
|
import java.util.stream.Stream;
|
||||||
@@ -67,7 +64,7 @@ public class AreaInfoServiceImpl implements AreaInfoService {
|
|||||||
|
|
||||||
if (CollectionUtil.isNotEmpty(lineIds)) {
|
if (CollectionUtil.isNotEmpty(lineIds)) {
|
||||||
List<AreaLineInfoVO> resList = lineFeignClient.getBaseLineAreaInfo(lineIds).getData();
|
List<AreaLineInfoVO> resList = lineFeignClient.getBaseLineAreaInfo(lineIds).getData();
|
||||||
if (1 == deviceInfoParam.getIsPollution()) {
|
if (Objects.equals(1,deviceInfoParam.getIsPollution())) {
|
||||||
OnlineRateParam.Info param = new OnlineRateParam.Info();
|
OnlineRateParam.Info param = new OnlineRateParam.Info();
|
||||||
param.setIds(resList.stream().map(AreaLineInfoVO::getLineId).distinct().collect(Collectors.toList()));
|
param.setIds(resList.stream().map(AreaLineInfoVO::getLineId).distinct().collect(Collectors.toList()));
|
||||||
param.setDicData(deviceInfoParam.getDicData());
|
param.setDicData(deviceInfoParam.getDicData());
|
||||||
@@ -151,6 +148,8 @@ public class AreaInfoServiceImpl implements AreaInfoService {
|
|||||||
eventDetailNew = BeanUtil.copyProperties(eventDetail, EventDetailNew.class);
|
eventDetailNew = BeanUtil.copyProperties(eventDetail, EventDetailNew.class);
|
||||||
//监测点id
|
//监测点id
|
||||||
eventDetailNew.setLineId(eventDetail.getMeasurementPointId());
|
eventDetailNew.setLineId(eventDetail.getMeasurementPointId());
|
||||||
|
//需要转成百分比*100
|
||||||
|
eventDetailNew.setFeatureAmplitude(eventDetail.getFeatureAmplitude()*100);
|
||||||
//持续时间
|
//持续时间
|
||||||
eventDetailNew.setDuration(eventDetail.getDuration());
|
eventDetailNew.setDuration(eventDetail.getDuration());
|
||||||
//特征幅值
|
//特征幅值
|
||||||
|
|||||||
@@ -490,7 +490,7 @@ public class RmpEventDetailServiceImpl extends ServiceImpl<RmpEventDetailMapper,
|
|||||||
public Page<AdvanceEventDetailVO> getEventByLineIdsCount(EventBaseParam.Info param) {
|
public Page<AdvanceEventDetailVO> getEventByLineIdsCount(EventBaseParam.Info param) {
|
||||||
Page<AdvanceEventDetailVO> pageResult = new Page<>();
|
Page<AdvanceEventDetailVO> pageResult = new Page<>();
|
||||||
param.setLineOrDevice(0);
|
param.setLineOrDevice(0);
|
||||||
param.setDeptIndex("0d52f9f6e43ec0ee83013cd32da93f66");
|
param.setDeptIndex(param.getDeptIndex());
|
||||||
param.setStatisticalType(new SimpleDTO());
|
param.setStatisticalType(new SimpleDTO());
|
||||||
//获取终端台账类信息
|
//获取终端台账类信息
|
||||||
List<GeneralDeviceDTO> deviceInfo = generalDeviceInfoClient.getPracticalRunDeviceInfo(param).getData();
|
List<GeneralDeviceDTO> deviceInfo = generalDeviceInfoClient.getPracticalRunDeviceInfo(param).getData();
|
||||||
@@ -500,6 +500,7 @@ public class RmpEventDetailServiceImpl extends ServiceImpl<RmpEventDetailMapper,
|
|||||||
.eq(StrUtil.isNotBlank(param.getDicData()), RmpEventDetailPO::getEventType, param.getDicData())
|
.eq(StrUtil.isNotBlank(param.getDicData()), RmpEventDetailPO::getEventType, param.getDicData())
|
||||||
.ge(StrUtil.isNotBlank(param.getSearchBeginTime()), RmpEventDetailPO::getStartTime, DateUtil.beginOfDay(DateUtil.parse(param.getSearchBeginTime())))
|
.ge(StrUtil.isNotBlank(param.getSearchBeginTime()), RmpEventDetailPO::getStartTime, DateUtil.beginOfDay(DateUtil.parse(param.getSearchBeginTime())))
|
||||||
.le(StrUtil.isNotBlank(param.getSearchEndTime()), RmpEventDetailPO::getStartTime, DateUtil.endOfDay(DateUtil.parse(param.getSearchEndTime())))
|
.le(StrUtil.isNotBlank(param.getSearchEndTime()), RmpEventDetailPO::getStartTime, DateUtil.endOfDay(DateUtil.parse(param.getSearchEndTime())))
|
||||||
|
.orderByDesc(RmpEventDetailPO::getStartTime)
|
||||||
);
|
);
|
||||||
List<String> tempLineIds = poPage.getRecords().stream().map(RmpEventDetailPO::getLineId).distinct().collect(Collectors.toList());
|
List<String> tempLineIds = poPage.getRecords().stream().map(RmpEventDetailPO::getLineId).distinct().collect(Collectors.toList());
|
||||||
if(CollUtil.isNotEmpty(tempLineIds)){
|
if(CollUtil.isNotEmpty(tempLineIds)){
|
||||||
|
|||||||
@@ -204,13 +204,41 @@ public class TransientServiceImpl implements TransientService {
|
|||||||
if (generalInfo.getBusinessWaveFileStorage() == GeneralConstant.LOCAL_DISK) {
|
if (generalInfo.getBusinessWaveFileStorage() == GeneralConstant.LOCAL_DISK) {
|
||||||
cfgPath = generalInfo.getBusinessWavePath() + File.separator + ip + File.separator + waveName + GeneralConstant.CFG;
|
cfgPath = generalInfo.getBusinessWavePath() + File.separator + ip + File.separator + waveName + GeneralConstant.CFG;
|
||||||
datPath = generalInfo.getBusinessWavePath() + File.separator + ip + File.separator + waveName + GeneralConstant.DAT;
|
datPath = generalInfo.getBusinessWavePath() + File.separator + ip + File.separator + waveName + GeneralConstant.DAT;
|
||||||
log.info("本地磁盘波形文件路径----" + cfgPath);
|
|
||||||
|
//适配文件后缀小写
|
||||||
|
cfgPath2 = generalInfo.getBusinessWavePath() + File.separator + ip + File.separator + waveName + GeneralConstant.CFG.toLowerCase();
|
||||||
|
datPath2 = generalInfo.getBusinessWavePath() + File.separator + ip + File.separator + waveName + GeneralConstant.DAT.toLowerCase();
|
||||||
|
log.info("本地磁盘波形文件路径----" + cfgPath2);
|
||||||
|
log.info("本地磁盘波形文件路径----" + datPath2);
|
||||||
|
try (
|
||||||
InputStream cfgStream = waveFileComponent.getFileInputStreamByFilePath(cfgPath);
|
InputStream cfgStream = waveFileComponent.getFileInputStreamByFilePath(cfgPath);
|
||||||
InputStream datStream = waveFileComponent.getFileInputStreamByFilePath(datPath);
|
InputStream datStream = waveFileComponent.getFileInputStreamByFilePath(datPath);
|
||||||
|
)
|
||||||
|
{
|
||||||
|
if (Objects.isNull(cfgStream) || Objects.isNull(datStream)) {
|
||||||
|
|
||||||
|
throw new BusinessException(WaveFileResponseEnum.ANALYSE_WAVE_NOT_FOUND);
|
||||||
|
|
||||||
|
}
|
||||||
|
waveDataDTO = waveFileComponent.getComtrade(cfgStream, datStream, 1);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.info("大写文件流为空");
|
||||||
|
try {
|
||||||
|
InputStream cfgStream = waveFileComponent.getFileInputStreamByFilePath(cfgPath2);
|
||||||
|
InputStream datStream = waveFileComponent.getFileInputStreamByFilePath(datPath2);
|
||||||
if (Objects.isNull(cfgStream) || Objects.isNull(datStream)) {
|
if (Objects.isNull(cfgStream) || Objects.isNull(datStream)) {
|
||||||
throw new BusinessException(WaveFileResponseEnum.ANALYSE_WAVE_NOT_FOUND);
|
throw new BusinessException(WaveFileResponseEnum.ANALYSE_WAVE_NOT_FOUND);
|
||||||
}
|
}
|
||||||
waveDataDTO = waveFileComponent.getComtrade(cfgStream, datStream, 1);
|
waveDataDTO = waveFileComponent.getComtrade(cfgStream, datStream, 1);
|
||||||
|
} catch (Exception e1) {
|
||||||
|
throw new BusinessException(WaveFileResponseEnum.WAVE_DATA_INVALID);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
cfgPath = OssPath.WAVE_DIR + ip + StrUtil.SLASH + waveName + GeneralConstant.CFG;
|
cfgPath = OssPath.WAVE_DIR + ip + StrUtil.SLASH + waveName + GeneralConstant.CFG;
|
||||||
datPath = OssPath.WAVE_DIR + ip + StrUtil.SLASH + waveName + GeneralConstant.DAT;
|
datPath = OssPath.WAVE_DIR + ip + StrUtil.SLASH + waveName + GeneralConstant.DAT;
|
||||||
@@ -495,22 +523,26 @@ public class TransientServiceImpl implements TransientService {
|
|||||||
try {
|
try {
|
||||||
if (generalInfo.getBusinessWaveFileStorage() == GeneralConstant.LOCAL_DISK) {
|
if (generalInfo.getBusinessWaveFileStorage() == GeneralConstant.LOCAL_DISK) {
|
||||||
cfgPath = generalInfo.getBusinessWavePath() + File.separator + ip + File.separator + waveName + GeneralConstant.CFG;
|
cfgPath = generalInfo.getBusinessWavePath() + File.separator + ip + File.separator + waveName + GeneralConstant.CFG;
|
||||||
|
log.info("cfg-----"+cfgPath);
|
||||||
|
log.info("cfg-----"+datPath);
|
||||||
|
|
||||||
|
|
||||||
//判断文件是否存在
|
//判断文件是否存在
|
||||||
boolean result1 = minIoUtils.checkFileIsExist(minIossProperties.getBucket(), cfgPath);
|
File file = new File(cfgPath);
|
||||||
if (!result1) {
|
if(!file.exists()){
|
||||||
cfgPath = OssPath.WAVE_DIR + ip + StrUtil.SLASH + waveName + GeneralConstant.CFG_LOWER;
|
cfgPath = generalInfo.getBusinessWavePath() + File.separator + ip + File.separator + waveName + GeneralConstant.CFG_LOWER;
|
||||||
cfg = GeneralConstant.CFG_LOWER;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
datPath = generalInfo.getBusinessWavePath() + File.separator + ip + File.separator + waveName + GeneralConstant.DAT;
|
datPath = generalInfo.getBusinessWavePath() + File.separator + ip + File.separator + waveName + GeneralConstant.DAT;
|
||||||
boolean result2 = minIoUtils.checkFileIsExist(minIossProperties.getBucket(), datPath);
|
File file2 = new File(datPath);
|
||||||
if (!result2) {
|
if(!file2.exists()){
|
||||||
datPath = OssPath.WAVE_DIR + ip + StrUtil.SLASH + waveName + GeneralConstant.DAT_LOWER;
|
datPath = generalInfo.getBusinessWavePath() + File.separator + ip + File.separator + waveName + GeneralConstant.DAT_LOWER;
|
||||||
dat = GeneralConstant.DAT_LOWER;
|
|
||||||
}
|
}
|
||||||
|
log.info("cfg-----"+cfgPath);
|
||||||
|
log.info("cfg-----"+datPath);
|
||||||
cfgStream = waveFileComponent.getFileInputStreamByFilePath(cfgPath);
|
cfgStream = waveFileComponent.getFileInputStreamByFilePath(cfgPath);
|
||||||
datStream = waveFileComponent.getFileInputStreamByFilePath(datPath);
|
datStream = waveFileComponent.getFileInputStreamByFilePath(datPath);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
cfgPath = OssPath.WAVE_DIR + ip + StrUtil.SLASH + waveName + GeneralConstant.CFG;
|
cfgPath = OssPath.WAVE_DIR + ip + StrUtil.SLASH + waveName + GeneralConstant.CFG;
|
||||||
boolean result1 = minIoUtils.checkFileIsExist(minIossProperties.getBucket(), cfgPath);
|
boolean result1 = minIoUtils.checkFileIsExist(minIossProperties.getBucket(), cfgPath);
|
||||||
|
|||||||
@@ -123,7 +123,8 @@ public class PollutionSubstationController extends BaseController {
|
|||||||
public HttpResult<List<SubstationVo>> getSubstationInfo(@RequestParam(value = "deptIndex") String deptIndex,
|
public HttpResult<List<SubstationVo>> getSubstationInfo(@RequestParam(value = "deptIndex") String deptIndex,
|
||||||
@RequestParam(value = "searchValue",required=false) String searchValue,
|
@RequestParam(value = "searchValue",required=false) String searchValue,
|
||||||
@RequestParam(value = "startTime") String startTime,
|
@RequestParam(value = "startTime") String startTime,
|
||||||
@RequestParam(value = "endTime") String endTime) {
|
@RequestParam(value = "endTime") String endTime
|
||||||
|
) {
|
||||||
String methodDescribe = getMethodDescribe("getSubstationInfo");
|
String methodDescribe = getMethodDescribe("getSubstationInfo");
|
||||||
LogUtil.njcnDebug(log, "{},实体参数:{},{}", methodDescribe, deptIndex, searchValue);
|
LogUtil.njcnDebug(log, "{},实体参数:{},{}", methodDescribe, deptIndex, searchValue);
|
||||||
List<SubstationVo> list = pollutionSubstationService.getSubstationInfo(deptIndex,searchValue,startTime,endTime);
|
List<SubstationVo> list = pollutionSubstationService.getSubstationInfo(deptIndex,searchValue,startTime,endTime);
|
||||||
|
|||||||
@@ -54,11 +54,11 @@ public class QualifiedReportController extends BaseController {
|
|||||||
@ApiImplicitParam(name = "qualifiedReportParam", value = "合格率报告参数", required = true)
|
@ApiImplicitParam(name = "qualifiedReportParam", value = "合格率报告参数", required = true)
|
||||||
public HttpResult<Page<FpyReportDTO>> pageTable(@RequestBody @Validated QualifiedReportParam qualifiedReportParam) {
|
public HttpResult<Page<FpyReportDTO>> pageTable(@RequestBody @Validated QualifiedReportParam qualifiedReportParam) {
|
||||||
TimeInterval timeInterval = new TimeInterval();
|
TimeInterval timeInterval = new TimeInterval();
|
||||||
String searchValue = qualifiedReportParam.getSearchValue();
|
// String searchValue = qualifiedReportParam.getSearchValue();
|
||||||
Pattern pattern = Pattern.compile(PatternRegex.SPECIAL_REGEX);
|
// Pattern pattern = Pattern.compile(PatternRegex.SPECIAL_REGEX);
|
||||||
if(pattern.matcher(searchValue).find()){
|
// if(pattern.matcher(searchValue).find()){
|
||||||
throw new BusinessException(ValidMessage.SPECIAL_REGEX);
|
// throw new BusinessException(ValidMessage.SPECIAL_REGEX);
|
||||||
}
|
// }
|
||||||
String methodDescribe = getMethodDescribe("pageTable");
|
String methodDescribe = getMethodDescribe("pageTable");
|
||||||
Page<FpyReportDTO> result = qualifiedReportService.pageTable(qualifiedReportParam);
|
Page<FpyReportDTO> result = qualifiedReportService.pageTable(qualifiedReportParam);
|
||||||
log.info("合格率报告执行时长:"+timeInterval.interval());
|
log.info("合格率报告执行时长:"+timeInterval.interval());
|
||||||
|
|||||||
@@ -7,10 +7,10 @@
|
|||||||
p1.id id,
|
p1.id id,
|
||||||
p2.Org_Name dept,
|
p2.Org_Name dept,
|
||||||
p2.Powerr_Name substation,
|
p2.Powerr_Name substation,
|
||||||
p3.`Name` deviceName,
|
p3.Name deviceName,
|
||||||
p2.`Name` lineName,
|
p2.Name lineName,
|
||||||
p1.line_id lineId,
|
p1.line_id lineId,
|
||||||
p4.`Name` businessType,
|
p4.Name businessType,
|
||||||
p2.Monitor_Object_Name objectName,
|
p2.Monitor_Object_Name objectName,
|
||||||
p1.target_type targetType,
|
p1.target_type targetType,
|
||||||
p1.over_limit_day overLimitDay,
|
p1.over_limit_day overLimitDay,
|
||||||
|
|||||||
@@ -948,6 +948,7 @@ public class PollutionSubstationServiceImpl extends ServiceImpl<RStatPollutionSu
|
|||||||
DeptGetLineParam deptGetLineParam = new DeptGetLineParam();
|
DeptGetLineParam deptGetLineParam = new DeptGetLineParam();
|
||||||
deptGetLineParam.setDeptId(deptIndex);
|
deptGetLineParam.setDeptId(deptIndex);
|
||||||
deptGetLineParam.setMonitorStateRunning(false);
|
deptGetLineParam.setMonitorStateRunning(false);
|
||||||
|
deptGetLineParam.setSearchValue(searchValue);
|
||||||
List<DeptGetSubStationDTO.Info> deptGetChildrenMoreDTOS = commTerminalGeneralClient.deptGetSubStationInfo(deptGetLineParam).getData();
|
List<DeptGetSubStationDTO.Info> deptGetChildrenMoreDTOS = commTerminalGeneralClient.deptGetSubStationInfo(deptGetLineParam).getData();
|
||||||
List<String> lineIds = deptGetChildrenMoreDTOS.stream().flatMap(x -> x.getStationIds().stream()).flatMap(x -> x.getUnitChildrenList().stream()).distinct().collect(Collectors.toList());
|
List<String> lineIds = deptGetChildrenMoreDTOS.stream().flatMap(x -> x.getStationIds().stream()).flatMap(x -> x.getUnitChildrenList().stream()).distinct().collect(Collectors.toList());
|
||||||
|
|
||||||
@@ -962,17 +963,18 @@ public class PollutionSubstationServiceImpl extends ServiceImpl<RStatPollutionSu
|
|||||||
List<RStatLimitRateDPO> limitRateList = rStatLimitRateDMapper.getAllOverTimes(lineList, startTime, endTime);
|
List<RStatLimitRateDPO> limitRateList = rStatLimitRateDMapper.getAllOverTimes(lineList, startTime, endTime);
|
||||||
Map<String, RStatLimitRateDPO> monitorMap = limitRateList.stream().collect(Collectors.toMap(RStatLimitRateDPO::getLineId, Function.identity()));
|
Map<String, RStatLimitRateDPO> monitorMap = limitRateList.stream().collect(Collectors.toMap(RStatLimitRateDPO::getLineId, Function.identity()));
|
||||||
//todo 获取监测点污染数据
|
//todo 获取监测点污染数据
|
||||||
|
//谐波电压
|
||||||
|
String v = dicDataFeignClient.getDicDataByCode(DicDataEnum.V_HARMONIC_LIMIT.getCode()).getData().getId();
|
||||||
|
//谐波电流
|
||||||
|
String i = dicDataFeignClient.getDicDataByCode(DicDataEnum.I_ALL_LIMIT.getCode()).getData().getId();
|
||||||
|
List<String> list = Arrays.asList(v, i);
|
||||||
List<RMpPollutionDPO> lineData = rMpPollutionDPOMapper.selectList(new LambdaQueryWrapper<RMpPollutionDPO>()
|
List<RMpPollutionDPO> lineData = rMpPollutionDPOMapper.selectList(new LambdaQueryWrapper<RMpPollutionDPO>()
|
||||||
.in(CollUtil.isNotEmpty(lineList), RMpPollutionDPO::getLineId, lineList)
|
.in(CollUtil.isNotEmpty(lineList), RMpPollutionDPO::getLineId, lineList)
|
||||||
|
.in(CollUtil.isNotEmpty(list), RMpPollutionDPO::getPollutionType, list)
|
||||||
.ge(StrUtil.isNotBlank(startTime), RMpPollutionDPO::getDataDate, DateUtil.beginOfDay(DateUtil.parse(startTime)))
|
.ge(StrUtil.isNotBlank(startTime), RMpPollutionDPO::getDataDate, DateUtil.beginOfDay(DateUtil.parse(startTime)))
|
||||||
.le(StrUtil.isNotBlank(endTime), RMpPollutionDPO::getDataDate, DateUtil.endOfDay(DateUtil.parse(endTime)))
|
.le(StrUtil.isNotBlank(endTime), RMpPollutionDPO::getDataDate, DateUtil.endOfDay(DateUtil.parse(endTime)))
|
||||||
);
|
);
|
||||||
//谐波电压
|
|
||||||
String v = dicDataFeignClient.getDicDataByCode(DicDataEnum.V_HARMONIC.getCode()).getData().getId();
|
|
||||||
List<RMpPollutionDPO> harmonicV = lineData.stream().filter(x -> v.equals(x.getPollutionType())).collect(Collectors.toList());
|
List<RMpPollutionDPO> harmonicV = lineData.stream().filter(x -> v.equals(x.getPollutionType())).collect(Collectors.toList());
|
||||||
|
|
||||||
//谐波电流
|
|
||||||
String i = dicDataFeignClient.getDicDataByCode(DicDataEnum.I_ALL.getCode()).getData().getId();
|
|
||||||
List<RMpPollutionDPO> harmonicI = lineData.stream().filter(x -> i.equals(x.getPollutionType())).collect(Collectors.toList());
|
List<RMpPollutionDPO> harmonicI = lineData.stream().filter(x -> i.equals(x.getPollutionType())).collect(Collectors.toList());
|
||||||
|
|
||||||
List<SubGetBase> subNameMap = deptGetChildrenMoreDTOS.stream().flatMap(x -> x.getStationIds().stream()).distinct().collect(Collectors.toList());
|
List<SubGetBase> subNameMap = deptGetChildrenMoreDTOS.stream().flatMap(x -> x.getStationIds().stream()).distinct().collect(Collectors.toList());
|
||||||
@@ -993,13 +995,14 @@ public class PollutionSubstationServiceImpl extends ServiceImpl<RStatPollutionSu
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
vo.setAlarmFreq(NumberUtil.round(alarmTime.get() * 1.0 / unitChildrenList.size(), 2).doubleValue());
|
vo.setAlarmFreq(NumberUtil.round(alarmTime.get() * 1.0 / unitChildrenList.size(), 2).doubleValue());
|
||||||
OptionalDouble maxV = harmonicV.stream().filter(x -> unitChildrenList.contains(x.getLineId())).mapToDouble(RMpPollutionDPO::getValue).max();
|
double maxV = harmonicV.stream().filter(x -> unitChildrenList.contains(x.getLineId())).mapToDouble(RMpPollutionDPO::getValue).sum();
|
||||||
vo.setVPollutionData(maxV.isPresent() ? maxV.getAsDouble() : 0.0D);
|
vo.setVPollutionData(NumberUtil.round(maxV,2).doubleValue());
|
||||||
OptionalDouble maxI = harmonicI.stream().filter(x -> unitChildrenList.contains(x.getLineId())).mapToDouble(RMpPollutionDPO::getValue).max();
|
double maxI = harmonicI.stream().filter(x -> unitChildrenList.contains(x.getLineId())).mapToDouble(RMpPollutionDPO::getValue).sum();
|
||||||
vo.setIPollutionData(maxI.isPresent() ? maxV.getAsDouble() : 0.0D);
|
vo.setIPollutionData(NumberUtil.round(maxI,2).doubleValue());
|
||||||
result.add(vo);
|
result.add(vo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
result.sort(Comparator.comparing(SubstationVo::getVPollutionData).reversed());
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -72,10 +72,12 @@ public class RMpTargetWarnDServiceImpl extends ServiceImpl<RMpTargetWarnDMapper,
|
|||||||
List<Dept> data = deptFeignClient.getDirectSonSelf(param.getId()).getData();
|
List<Dept> data = deptFeignClient.getDirectSonSelf(param.getId()).getData();
|
||||||
DeptGetLineParam deptGetLineParam = new DeptGetLineParam();
|
DeptGetLineParam deptGetLineParam = new DeptGetLineParam();
|
||||||
deptGetLineParam.setDeptId(param.getId());
|
deptGetLineParam.setDeptId(param.getId());
|
||||||
|
deptGetLineParam.setMonitorStateRunning(false);
|
||||||
List<DeptGetSubStationDTO.Info> deptGetChildrenMoreDTOS = commTerminalGeneralClient.deptGetSubStationInfo(deptGetLineParam).getData();
|
List<DeptGetSubStationDTO.Info> deptGetChildrenMoreDTOS = commTerminalGeneralClient.deptGetSubStationInfo(deptGetLineParam).getData();
|
||||||
|
|
||||||
List<String> lineIDS = deptGetChildrenMoreDTOS.stream()
|
List<String> lineIDS = deptGetChildrenMoreDTOS.stream()
|
||||||
.flatMap(x -> x.getStationIds().stream().flatMap(l -> l.getUnitChildrenList().stream()))
|
.flatMap(x -> x.getStationIds().stream().flatMap(l -> l.getUnitChildrenList().stream()))
|
||||||
|
.distinct()
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
//根据r_stat_limit_target_d来判断是否告警allTime flicker_overtime
|
//根据r_stat_limit_target_d来判断是否告警allTime flicker_overtime
|
||||||
|
|
||||||
|
|||||||
@@ -81,33 +81,56 @@ public class SteadyQualifyServiceImpl implements SteadyQualifyService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public SteadyQualifyCensusVO getSteadyQualifyCensus(DeviceInfoParam.BusinessParam steadyCensusParam) {
|
public SteadyQualifyCensusVO getSteadyQualifyCensus(DeviceInfoParam.BusinessParam steadyCensusParam) {
|
||||||
|
List<SteadyQualifyVO> steadyQualifyList = getSteadyQualifyData(steadyCensusParam);
|
||||||
SteadyQualifyCensusVO steadyQualifyCensusVO = new SteadyQualifyCensusVO();
|
SteadyQualifyCensusVO steadyQualifyCensusVO = new SteadyQualifyCensusVO();
|
||||||
List<String> type = new ArrayList<>();
|
List<String> type = new ArrayList<>();
|
||||||
//按照条件获取实际运行终端综合信息
|
|
||||||
List<GeneralDeviceDTO> deviceDataList = generalDeviceInfoClient.getPracticalRunDeviceInfo(steadyCensusParam).getData();
|
|
||||||
List<Double> harmonicVoltage = new ArrayList<>(), voltageOffset = new ArrayList<>(),
|
List<Double> harmonicVoltage = new ArrayList<>(), voltageOffset = new ArrayList<>(),
|
||||||
VoltageUnbalance = new ArrayList<>(), interHarmonic = new ArrayList<>(),
|
VoltageUnbalance = new ArrayList<>(), interHarmonic = new ArrayList<>(),
|
||||||
harmonicCurrent = new ArrayList<>(), negativeCurrent = new ArrayList<>(),
|
harmonicCurrent = new ArrayList<>(), negativeCurrent = new ArrayList<>(),
|
||||||
freqOffset = new ArrayList<>(), flicker = new ArrayList<>();
|
freqOffset = new ArrayList<>(), flicker = new ArrayList<>();
|
||||||
if (!CollectionUtils.isEmpty(deviceDataList)) {
|
if (CollUtil.isNotEmpty(steadyQualifyList)) {
|
||||||
for (GeneralDeviceDTO generalDeviceDTO : deviceDataList) {
|
for (SteadyQualifyVO steadyQualifyVO : steadyQualifyList) {
|
||||||
List<String> lineIndexes = generalDeviceDTO.getLineIndexes();
|
// 还需要递归出有多少个测点
|
||||||
if (CollectionUtils.isEmpty(lineIndexes)) {
|
int lineNum = seekLineNum(steadyQualifyVO);
|
||||||
continue;
|
type.add(steadyQualifyVO.getName() + "\n(" + lineNum + ")");
|
||||||
}
|
harmonicVoltage.add(steadyQualifyVO.getHarmonicVoltage());
|
||||||
type.add(generalDeviceDTO.getName() + "\n(" + generalDeviceDTO.getLineIndexes().size() + ")");
|
voltageOffset.add(steadyQualifyVO.getVoltageOffset());
|
||||||
List<RStatLimitRateDPO> qualifiesRate = getQualifiesRate(lineIndexes, steadyCensusParam.getSearchBeginTime(), steadyCensusParam.getSearchEndTime());
|
VoltageUnbalance.add(steadyQualifyVO.getVoltageUnbalance());
|
||||||
SteadyQualifyVO dataMoreMonitorMoreDay = getDataMoreMonitorMoreDay(qualifiesRate);
|
interHarmonic.add(steadyQualifyVO.getInterHarmonic());
|
||||||
harmonicVoltage.add(dataMoreMonitorMoreDay.getHarmonicVoltage());
|
harmonicCurrent.add(steadyQualifyVO.getHarmonicCurrent());
|
||||||
voltageOffset.add(dataMoreMonitorMoreDay.getVoltageOffset());
|
negativeCurrent.add(steadyQualifyVO.getNegativeCurrent());
|
||||||
VoltageUnbalance.add(dataMoreMonitorMoreDay.getVoltageUnbalance());
|
freqOffset.add(steadyQualifyVO.getFreqOffset());
|
||||||
interHarmonic.add(dataMoreMonitorMoreDay.getInterHarmonic());
|
flicker.add(steadyQualifyVO.getFlicker());
|
||||||
harmonicCurrent.add(dataMoreMonitorMoreDay.getHarmonicCurrent());
|
|
||||||
negativeCurrent.add(dataMoreMonitorMoreDay.getNegativeCurrent());
|
|
||||||
freqOffset.add(dataMoreMonitorMoreDay.getFreqOffset());
|
|
||||||
flicker.add(dataMoreMonitorMoreDay.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.setHarmonicVoltage(harmonicVoltage);
|
||||||
steadyQualifyCensusVO.setVoltageOffset(voltageOffset);
|
steadyQualifyCensusVO.setVoltageOffset(voltageOffset);
|
||||||
steadyQualifyCensusVO.setVoltageUnbalance(VoltageUnbalance);
|
steadyQualifyCensusVO.setVoltageUnbalance(VoltageUnbalance);
|
||||||
@@ -121,6 +144,25 @@ public class SteadyQualifyServiceImpl implements SteadyQualifyService {
|
|||||||
return steadyQualifyCensusVO;
|
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
|
@Override
|
||||||
public List<SteadyQualifyVO> getEnterpriseSteadyQualify(DeviceInfoParam.BusinessParam steadyParam) {
|
public List<SteadyQualifyVO> getEnterpriseSteadyQualify(DeviceInfoParam.BusinessParam steadyParam) {
|
||||||
List<SteadyQualifyVO> steadyQualifyList = new ArrayList<>();
|
List<SteadyQualifyVO> steadyQualifyList = new ArrayList<>();
|
||||||
@@ -365,7 +407,7 @@ public class SteadyQualifyServiceImpl implements SteadyQualifyService {
|
|||||||
steadyQualifyDTO.getIharm24Overtime() +
|
steadyQualifyDTO.getIharm24Overtime() +
|
||||||
steadyQualifyDTO.getIharm25Overtime())));
|
steadyQualifyDTO.getIharm25Overtime())));
|
||||||
//间谐波电压含有率
|
//间谐波电压含有率
|
||||||
steadyQualifyVO.setInterHarmonic(calculateIN(steadyQualifyDTO.getAllTime()*16, (steadyQualifyDTO.getInuharm1Overtime() +
|
steadyQualifyVO.setInterHarmonic(calculateIN(steadyQualifyDTO.getAllTime() * 16, (steadyQualifyDTO.getInuharm1Overtime() +
|
||||||
steadyQualifyDTO.getInuharm2Overtime() +
|
steadyQualifyDTO.getInuharm2Overtime() +
|
||||||
steadyQualifyDTO.getInuharm3Overtime() +
|
steadyQualifyDTO.getInuharm3Overtime() +
|
||||||
steadyQualifyDTO.getInuharm4Overtime() +
|
steadyQualifyDTO.getInuharm4Overtime() +
|
||||||
@@ -497,7 +539,7 @@ public class SteadyQualifyServiceImpl implements SteadyQualifyService {
|
|||||||
return 3.14159;
|
return 3.14159;
|
||||||
} else {
|
} else {
|
||||||
if (allTime >= overTime) {
|
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;
|
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.dto.PublicDTO;
|
||||||
import com.njcn.harmonic.pojo.po.RMpVThd;
|
import com.njcn.harmonic.pojo.po.RMpVThd;
|
||||||
import com.njcn.harmonic.pojo.vo.RMpVThdVO;
|
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.THDistortionCensusVO;
|
||||||
import com.njcn.harmonic.pojo.vo.THDistortionVO;
|
import com.njcn.harmonic.pojo.vo.THDistortionVO;
|
||||||
import com.njcn.harmonic.service.THDistortionService;
|
import com.njcn.harmonic.service.THDistortionService;
|
||||||
@@ -102,20 +103,23 @@ public class THDistortionServiceImpl implements THDistortionService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public THDistortionCensusVO getTHDistortionCensus(DeviceInfoParam.BusinessParam thDistortionCensusParam) {
|
public THDistortionCensusVO getTHDistortionCensus(DeviceInfoParam.BusinessParam thDistortionCensusParam) {
|
||||||
|
List<THDistortionVO> thDistortionVOS = getTHDistortionData(thDistortionCensusParam, 0);
|
||||||
|
|
||||||
THDistortionCensusVO distortionCensusVO = new THDistortionCensusVO();
|
THDistortionCensusVO distortionCensusVO = new THDistortionCensusVO();
|
||||||
thDistortionCensusParam.setServerName(generalInfo.getMicroServiceName());
|
// thDistortionCensusParam.setServerName(generalInfo.getMicroServiceName());
|
||||||
List<GeneralDeviceDTO> generalDeviceDTOList = generalDeviceInfoClient.getPracticalRunDeviceInfo(thDistortionCensusParam).getData();
|
// List<GeneralDeviceDTO> generalDeviceDTOList = generalDeviceInfoClient.getPracticalRunDeviceInfo(thDistortionCensusParam).getData();
|
||||||
List<String> type = new ArrayList<>();
|
List<String> type = new ArrayList<>();
|
||||||
List<Double> single = new ArrayList<>();
|
List<Double> single = new ArrayList<>();
|
||||||
if (!CollectionUtils.isEmpty(generalDeviceDTOList)) {
|
if (!CollectionUtils.isEmpty(thDistortionVOS)) {
|
||||||
for (GeneralDeviceDTO generalDeviceDTO : generalDeviceDTOList) {
|
for (THDistortionVO thDistortionVO : thDistortionVOS) {
|
||||||
List<String> lineIndexes = generalDeviceDTO.getLineIndexes();
|
// List<String> lineIndexes = generalDeviceDTO.getLineIndexes();
|
||||||
if (CollectionUtils.isEmpty(lineIndexes)) {
|
// if (CollectionUtils.isEmpty(lineIndexes)) {
|
||||||
continue;
|
// continue;
|
||||||
}
|
// }
|
||||||
type.add(generalDeviceDTO.getName() + "\n(" + generalDeviceDTO.getLineIndexes().size() + ")");
|
// type.add(thDistortionVO.getName() + "\n(" + seekLineNum(thDistortionVO) + ")");
|
||||||
List<PublicDTO> condition = getCondition(lineIndexes, thDistortionCensusParam.getSearchBeginTime(), thDistortionCensusParam.getSearchEndTime());
|
type.add(thDistortionVO.getName() );
|
||||||
single.add(roundHalfUp(condition.stream().mapToDouble(PublicDTO::getData).average().orElse(3.14159)));
|
// List<PublicDTO> condition = getCondition(lineIndexes, thDistortionCensusParam.getSearchBeginTime(), thDistortionCensusParam.getSearchEndTime());
|
||||||
|
single.add(thDistortionVO.getDistortion());
|
||||||
}
|
}
|
||||||
distortionCensusVO.setType(type);
|
distortionCensusVO.setType(type);
|
||||||
distortionCensusVO.setSingle(single);
|
distortionCensusVO.setSingle(single);
|
||||||
@@ -123,6 +127,25 @@ public class THDistortionServiceImpl implements THDistortionService {
|
|||||||
return distortionCensusVO;
|
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
|
* @param statisticsBizBaseParam
|
||||||
* @Description: 谐波总畸变率前十列表
|
* @Description: 谐波总畸变率前十列表
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
line_index id,
|
line_index id,
|
||||||
LEAST(ROUND(SUM(real_time) / SUM(due_time), 2) * 100,100) integrityData
|
LEAST(ROUND(SUM(real_time) / SUM(due_time), 2) * 100,100) integrityData
|
||||||
FROM
|
FROM
|
||||||
`r_stat_integrity_d`
|
r_stat_integrity_d
|
||||||
WHERE time_id between #{startTime} and #{endTime}
|
WHERE time_id between #{startTime} and #{endTime}
|
||||||
GROUP BY line_index
|
GROUP BY line_index
|
||||||
</select>
|
</select>
|
||||||
@@ -35,7 +35,7 @@
|
|||||||
100
|
100
|
||||||
) integrityData
|
) integrityData
|
||||||
FROM
|
FROM
|
||||||
`r_stat_onlinerate_d`
|
r_stat_onlinerate_d
|
||||||
WHERE time_id between #{startTime} and #{endTime}
|
WHERE time_id between #{startTime} and #{endTime}
|
||||||
GROUP BY dev_index
|
GROUP BY dev_index
|
||||||
</select>
|
</select>
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ public class SensitiveReportExcel implements Serializable {
|
|||||||
// private String orgId;
|
// private String orgId;
|
||||||
|
|
||||||
|
|
||||||
@Excel(name = "工程预期投产日期(yyyy-MM-dd)", width = 30)
|
@Excel(name = "*工程预期投产日期(yyyy-MM-dd)", width = 30)
|
||||||
private String expectedProductionDate;
|
private String expectedProductionDate;
|
||||||
|
|
||||||
@Excel(name = "电压等级", width = 30)
|
@Excel(name = "电压等级", width = 30)
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ public class SensitiveUserSExcel implements Serializable {
|
|||||||
// private String orgId;
|
// private String orgId;
|
||||||
|
|
||||||
|
|
||||||
@Excel(name = "工程预期投产日期(yyyy-MM-dd)", width = 30)
|
@Excel(name = "*工程预期投产日期(yyyy-MM-dd)", width = 30)
|
||||||
@NotBlank(message = "工程预期投产日期不能为空")
|
@NotBlank(message = "工程预期投产日期不能为空")
|
||||||
private String expectedProductionDate;
|
private String expectedProductionDate;
|
||||||
|
|
||||||
|
|||||||
@@ -209,16 +209,16 @@ public class SupervisionDevMainReportExcel {
|
|||||||
private String timeSyncFunction = "0";
|
private String timeSyncFunction = "0";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 电镀功能
|
* 电度功能
|
||||||
*/
|
*/
|
||||||
@Excel(name = "电镀功能", width = 30, replace = {"关闭_0", "开启_1"})
|
@Excel(name = "电度功能", width = 30, replace = {"关闭_0", "开启_1"})
|
||||||
private String electroplatingFunction = "0";
|
private String electroplatingFunction = "0";
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 召换标志
|
* 召唤标志
|
||||||
*/
|
*/
|
||||||
@Excel(name = "召换标志", width = 30, replace = {"周期触发_0", "变位触发_1"})
|
@Excel(name = "召唤标志", width = 30, replace = {"周期触发_0", "变位触发_1"})
|
||||||
private String summonFlag = "0";
|
private String summonFlag = "0";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -206,9 +206,9 @@ public class SupervisionTempDeviceReportParam {
|
|||||||
private Integer timeSyncFunction;
|
private Integer timeSyncFunction;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 电镀功能
|
* 电度功能
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value="电镀功能")
|
@ApiModelProperty(value="电度功能")
|
||||||
private Integer electroplatingFunction;
|
private Integer electroplatingFunction;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -218,9 +218,9 @@ public class SupervisionTempDeviceReportParam {
|
|||||||
private String monitoringDeviceInstallationPosition;
|
private String monitoringDeviceInstallationPosition;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 召换标志
|
* 召唤标志
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value="召换标志")
|
@ApiModelProperty(value="召唤标志")
|
||||||
private String summonFlag;
|
private String summonFlag;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ public class UserReportNormalParam extends BaseParam {
|
|||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
private String id;
|
private String id;
|
||||||
|
|
||||||
@ApiModelProperty(value = "保存1,提交审批2")
|
@ApiModelProperty(value = "保存1,提交审批2")
|
||||||
private String saveOrCheckflag;
|
private String saveOrCheckflag;
|
||||||
/**
|
/**
|
||||||
@@ -40,6 +41,11 @@ public class UserReportNormalParam extends BaseParam {
|
|||||||
*/
|
*/
|
||||||
private String reportUrl;
|
private String reportUrl;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 治理方案仿真校验评估报告
|
||||||
|
*/
|
||||||
|
private String simulationReportUrl;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 1:审批中;2:审批通过;3:审批不通过;4:已取消
|
* 1:审批中;2:审批通过;3:审批不通过;4:已取消
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -155,6 +155,7 @@ public class UserReportParam {
|
|||||||
|
|
||||||
private UserReportSubstationPO userReportSubstationPO;
|
private UserReportSubstationPO userReportSubstationPO;
|
||||||
|
|
||||||
|
private String secondAssessmentId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 流程实例的编号
|
* 流程实例的编号
|
||||||
|
|||||||
@@ -204,7 +204,7 @@ public class SupervisionTempDeviceReport {
|
|||||||
private Integer timeSyncFunction;
|
private Integer timeSyncFunction;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 电镀功能
|
* 电度功能
|
||||||
*/
|
*/
|
||||||
@TableField(value = "electroplating_function")
|
@TableField(value = "electroplating_function")
|
||||||
private Integer electroplatingFunction;
|
private Integer electroplatingFunction;
|
||||||
@@ -216,7 +216,7 @@ public class SupervisionTempDeviceReport {
|
|||||||
private String monitoringDeviceInstallationPosition;
|
private String monitoringDeviceInstallationPosition;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 召换标志
|
* 召唤标志
|
||||||
*/
|
*/
|
||||||
@TableField(value = "summon_flag")
|
@TableField(value = "summon_flag")
|
||||||
private String summonFlag;
|
private String summonFlag;
|
||||||
|
|||||||
@@ -37,6 +37,12 @@ public class UserReportNormalPO extends BaseEntity {
|
|||||||
*/
|
*/
|
||||||
private String reportUrl;
|
private String reportUrl;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 治理方案仿真校验评估报告
|
||||||
|
*/
|
||||||
|
private String simulationReportUrl;
|
||||||
|
|
||||||
|
|
||||||
private String processInstanceId;
|
private String processInstanceId;
|
||||||
|
|
||||||
private String historyInstanceId;
|
private String historyInstanceId;
|
||||||
|
|||||||
@@ -1,9 +1,6 @@
|
|||||||
package com.njcn.supervision.pojo.po.user;
|
package com.njcn.supervision.pojo.po.user;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
|
||||||
import com.njcn.common.pojo.constant.PatternRegex;
|
import com.njcn.common.pojo.constant.PatternRegex;
|
||||||
import com.njcn.db.bo.BaseEntity;
|
import com.njcn.db.bo.BaseEntity;
|
||||||
import com.njcn.web.constant.ValidMessage;
|
import com.njcn.web.constant.ValidMessage;
|
||||||
@@ -35,14 +32,14 @@ public class UserReportProjectPO extends BaseEntity {
|
|||||||
/**
|
/**
|
||||||
* 用户协议容量
|
* 用户协议容量
|
||||||
*/
|
*/
|
||||||
@TableField(value = "agreement_capacity")
|
@TableField(value = "agreement_capacity",updateStrategy = FieldStrategy.IGNORED)
|
||||||
@Pattern(regexp = PatternRegex.COORDINATE, message = ValidMessage.PARAM_FORMAT_ERROR)
|
@Pattern(regexp = PatternRegex.COORDINATE, message = ValidMessage.PARAM_FORMAT_ERROR)
|
||||||
private Double agreementCapacity;
|
private Double agreementCapacity;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 非线性设备类型
|
* 非线性设备类型
|
||||||
*/
|
*/
|
||||||
@TableField(value = "nonlinear_device_type")
|
@TableField(value = "nonlinear_device_type",updateStrategy = FieldStrategy.IGNORED)
|
||||||
private String nonlinearDeviceType;
|
private String nonlinearDeviceType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,9 +1,6 @@
|
|||||||
package com.njcn.supervision.pojo.po.user;
|
package com.njcn.supervision.pojo.po.user;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
|
||||||
import com.njcn.common.pojo.constant.PatternRegex;
|
import com.njcn.common.pojo.constant.PatternRegex;
|
||||||
import com.njcn.db.bo.BaseEntity;
|
import com.njcn.db.bo.BaseEntity;
|
||||||
import com.njcn.web.constant.ValidMessage;
|
import com.njcn.web.constant.ValidMessage;
|
||||||
@@ -40,28 +37,28 @@ public class UserReportSubstationPO extends BaseEntity {
|
|||||||
/**
|
/**
|
||||||
* 基准短路容量(MVA)
|
* 基准短路容量(MVA)
|
||||||
*/
|
*/
|
||||||
@TableField(value = "base_short_circuit_capacity")
|
@TableField(value = "base_short_circuit_capacity",updateStrategy = FieldStrategy.IGNORED)
|
||||||
@Pattern(regexp = PatternRegex.COORDINATE, message = ValidMessage.PARAM_FORMAT_ERROR)
|
@Pattern(regexp = PatternRegex.COORDINATE, message = ValidMessage.PARAM_FORMAT_ERROR)
|
||||||
private BigDecimal baseShortCircuitCapacity;
|
private BigDecimal baseShortCircuitCapacity;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 系统最小短路容量(MVA)
|
* 系统最小短路容量(MVA)
|
||||||
*/
|
*/
|
||||||
@TableField(value = "min_short_circuit_capacity")
|
@TableField(value = "min_short_circuit_capacity",updateStrategy = FieldStrategy.IGNORED)
|
||||||
@Pattern(regexp = PatternRegex.COORDINATE, message = ValidMessage.PARAM_FORMAT_ERROR)
|
@Pattern(regexp = PatternRegex.COORDINATE, message = ValidMessage.PARAM_FORMAT_ERROR)
|
||||||
private BigDecimal minShortCircuitCapacity;
|
private BigDecimal minShortCircuitCapacity;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* PCC供电设备容量(MVA)
|
* PCC供电设备容量(MVA)
|
||||||
*/
|
*/
|
||||||
@TableField(value = "pcc_equipment_capacity")
|
@TableField(value = "pcc_equipment_capacity",updateStrategy = FieldStrategy.IGNORED)
|
||||||
@Pattern(regexp = PatternRegex.COORDINATE, message = ValidMessage.PARAM_FORMAT_ERROR)
|
@Pattern(regexp = PatternRegex.COORDINATE, message = ValidMessage.PARAM_FORMAT_ERROR)
|
||||||
private BigDecimal pccEquipmentCapacity;
|
private BigDecimal pccEquipmentCapacity;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户用电协议容量(MVA)
|
* 用户用电协议容量(MVA)
|
||||||
*/
|
*/
|
||||||
@TableField(value = "user_agreement_capacity")
|
@TableField(value = "user_agreement_capacity",updateStrategy = FieldStrategy.IGNORED)
|
||||||
@Pattern(regexp = PatternRegex.COORDINATE, message = ValidMessage.PARAM_FORMAT_ERROR)
|
@Pattern(regexp = PatternRegex.COORDINATE, message = ValidMessage.PARAM_FORMAT_ERROR)
|
||||||
private BigDecimal userAgreementCapacity;
|
private BigDecimal userAgreementCapacity;
|
||||||
|
|
||||||
@@ -74,7 +71,7 @@ public class UserReportSubstationPO extends BaseEntity {
|
|||||||
/**
|
/**
|
||||||
* 非线性负荷类型
|
* 非线性负荷类型
|
||||||
*/
|
*/
|
||||||
@TableField(value = "nonlinear_load_type")
|
@TableField(value = "nonlinear_load_type",updateStrategy = FieldStrategy.IGNORED)
|
||||||
private String nonlinearLoadType;
|
private String nonlinearLoadType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -82,4 +82,7 @@ public class OnlineVo implements Serializable {
|
|||||||
@ApiModelProperty("最新数据时间")
|
@ApiModelProperty("最新数据时间")
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
|
||||||
private LocalDateTime updateTime;
|
private LocalDateTime updateTime;
|
||||||
|
|
||||||
|
@ApiModelProperty("数据类型 0:无数据 1:超标告警 2:异常数据")
|
||||||
|
private Integer dataType;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -121,6 +121,9 @@ public class WarningLeafletVO extends BaseEntity implements Serializable{
|
|||||||
@ApiModelProperty("预告警单下载路径")
|
@ApiModelProperty("预告警单下载路径")
|
||||||
private String filePath;
|
private String filePath;
|
||||||
|
|
||||||
|
@ApiModelProperty("实际路径")
|
||||||
|
private String absFilePath;
|
||||||
|
|
||||||
@ApiModelProperty("技术监督报告")
|
@ApiModelProperty("技术监督报告")
|
||||||
private String supervisionReport;
|
private String supervisionReport;
|
||||||
|
|
||||||
|
|||||||
@@ -23,4 +23,9 @@ public class UserLedgerVO implements Serializable {
|
|||||||
|
|
||||||
private String city;
|
private String city;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public static class AssessMent extends UserLedgerVO{
|
||||||
|
|
||||||
|
private String secondAssessmentId;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -209,6 +209,9 @@ public class UserReportVO {
|
|||||||
@ApiModelProperty(value = "入网评估报告和治理报告的文件路径名")
|
@ApiModelProperty(value = "入网评估报告和治理报告的文件路径名")
|
||||||
private String otherReport;
|
private String otherReport;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "仿真治理评估告")
|
||||||
|
private String simulationReport;
|
||||||
|
|
||||||
private String userReportId;
|
private String userReportId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -221,5 +224,8 @@ public class UserReportVO {
|
|||||||
|
|
||||||
@ApiModelProperty(value = "治理评估告")
|
@ApiModelProperty(value = "治理评估告")
|
||||||
private List<String> governReport;
|
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);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, userReportByIds, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|
||||||
//根据部门查询敏感用户信息
|
|
||||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
@PostMapping("/getSensitiveUserByDept")
|
@PostMapping("/getSensitiveUserByDept")
|
||||||
@ApiOperation("根据部门获取敏感用户信息")
|
@ApiOperation("根据部门获取敏感用户信息")
|
||||||
@@ -304,4 +303,21 @@ public class UserReportManageController extends BaseController {
|
|||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
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)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void addHeBeiNorthLineWarning(String startTime, String endTime) {
|
public void addHeBeiNorthLineWarning(String startTime, String endTime) {
|
||||||
List<LineWarning> result = new ArrayList<>();
|
List<LineWarning> result = new ArrayList<>();
|
||||||
|
List<LineWarning> channelData = new ArrayList<>();
|
||||||
//获取指标集合(10个指标)
|
//获取指标集合(10个指标)
|
||||||
List<DictData> dataList = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.STEADY_STATIS.getCode()).getData();
|
List<DictData> dataList = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.STEADY_STATIS.getCode()).getData();
|
||||||
Map<String, DictData> targetMap = dataList.stream().collect(Collectors.toMap(DictData::getCode, Function.identity()));
|
Map<String, DictData> targetMap = dataList.stream().collect(Collectors.toMap(DictData::getCode, Function.identity()));
|
||||||
//获取监测点和部门表关系
|
//获取监测点和部门表关系
|
||||||
List<DeptLine> deptLines = deptLineFeignClient.getAllData().getData();
|
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);
|
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;
|
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)) {
|
if (CollUtil.isNotEmpty(limitTarget)) {
|
||||||
limitTarget.forEach(item -> {
|
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());
|
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();
|
List<OnlineMonitorVo> list = lineIntegrityClient.getNoData(param).getData();
|
||||||
if (CollUtil.isNotEmpty(list)) {
|
if (CollUtil.isNotEmpty(list)) {
|
||||||
list.forEach(item -> {
|
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 lineWarning = new LineWarning();
|
||||||
lineWarning.setAlarmTime(firstDayOfMonth);
|
lineWarning.setAlarmTime(firstDayOfMonth);
|
||||||
lineWarning.setDeptId(deptId);
|
lineWarning.setDeptId(deptId);
|
||||||
@@ -220,7 +223,7 @@ public class LineWarningServiceImpl extends MppServiceImpl<LineWarningMapper, Li
|
|||||||
List<OnlineMonitorVo> list2 = pqDataVerifyCountClient.getAnomalousData(param).getData();
|
List<OnlineMonitorVo> list2 = pqDataVerifyCountClient.getAnomalousData(param).getData();
|
||||||
if (CollUtil.isNotEmpty(list2)) {
|
if (CollUtil.isNotEmpty(list2)) {
|
||||||
list2.forEach(item -> {
|
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 lineWarning = new LineWarning();
|
||||||
lineWarning.setAlarmTime(firstDayOfMonth);
|
lineWarning.setAlarmTime(firstDayOfMonth);
|
||||||
lineWarning.setDeptId(deptId);
|
lineWarning.setDeptId(deptId);
|
||||||
@@ -230,25 +233,38 @@ public class LineWarningServiceImpl extends MppServiceImpl<LineWarningMapper, Li
|
|||||||
result.add(lineWarning);
|
result.add(lineWarning);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
//获取时间范围内数据库的数据,然后仅替换累计超标时间
|
||||||
// //将装置无数据的统计入库 按运维要求,判断装置的最新数据不是当天,则认为装置无数据
|
LambdaQueryWrapper<LineWarning> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
// List<LineDetailVO.noDataLineInfo> noDataLineInfo = lineFeignClient.getNoDataLine().getData();
|
lambdaQueryWrapper.between(LineWarning::getAlarmTime,date,endDate);
|
||||||
// if (CollUtil.isNotEmpty(noDataLineInfo)) {
|
List<LineWarning> oldData = this.list(lambdaQueryWrapper);
|
||||||
// LambdaQueryWrapper<LineWarning> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
if (CollUtil.isNotEmpty(oldData) && CollUtil.isNotEmpty(result)) {
|
||||||
// lambdaQueryWrapper.eq(LineWarning::getTargetType, "0").eq(LineWarning::getAlarmTime, date);
|
// 创建结果数据的查找Map
|
||||||
// this.baseMapper.delete(lambdaQueryWrapper);
|
Map<String, LineWarning> resultMap = result.stream()
|
||||||
// noDataLineInfo.forEach(item -> {
|
.collect(Collectors.toMap(
|
||||||
// String deptId = Objects.isNull(deptLineMap.get(item.getLineId())) ? null : deptLineMap.get(item.getLineId()).get(0).getId();
|
item -> buildKey(item.getDeptId(), item.getLineId(), item.getTargetType()),
|
||||||
// LineWarning lineWarning = new LineWarning();
|
Function.identity()
|
||||||
// lineWarning.setAlarmTime(firstDayOfMonth);
|
));
|
||||||
// lineWarning.setDeptId(deptId);
|
for (LineWarning oldItem : oldData) {
|
||||||
// lineWarning.setLineId(item.getLineId());
|
String key = buildKey(oldItem.getDeptId(), oldItem.getLineId(), oldItem.getTargetType());
|
||||||
// lineWarning.setTargetType("0");
|
LineWarning matchingResult = resultMap.get(key);
|
||||||
// result.add(lineWarning);
|
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
|
@Override
|
||||||
public Page<OnlineVo> getLineWarningList(OnlineParam param) {
|
public Page<OnlineVo> getLineWarningList(OnlineParam param) {
|
||||||
@@ -292,7 +308,11 @@ public class LineWarningServiceImpl extends MppServiceImpl<LineWarningMapper, Li
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
queryWrapper.orderBy(true, true, "D.Name", "p4.Name", "p3.Name");
|
queryWrapper.orderBy(true, true, "D.Name", "p4.Name", "p3.Name");
|
||||||
return this.baseMapper.page(new Page<>(PageFactory.getPageNum(param), PageFactory.getPageSize(param)), queryWrapper);
|
Page<OnlineVo> page = this.baseMapper.page(new Page<>(PageFactory.getPageNum(param), PageFactory.getPageSize(param)), queryWrapper);
|
||||||
|
page.getRecords().forEach(item -> {
|
||||||
|
item.setDataType(param.getDataType());
|
||||||
|
});
|
||||||
|
return page;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -344,6 +364,8 @@ public class LineWarningServiceImpl extends MppServiceImpl<LineWarningMapper, Li
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
dataMap.put("${noData}", CollUtil.isEmpty(dataList1) ? "0" : String.valueOf(dataList1.size()));
|
dataMap.put("${noData}", CollUtil.isEmpty(dataList1) ? "0" : String.valueOf(dataList1.size()));
|
||||||
|
} else {
|
||||||
|
dataMap.put("${noData}", "0");
|
||||||
}
|
}
|
||||||
if (CollUtil.isNotEmpty(list2)) {
|
if (CollUtil.isNotEmpty(list2)) {
|
||||||
list2.forEach(item -> {
|
list2.forEach(item -> {
|
||||||
|
|||||||
@@ -56,6 +56,7 @@ import com.njcn.web.factory.PageFactory;
|
|||||||
import com.njcn.web.utils.RequestUtil;
|
import com.njcn.web.utils.RequestUtil;
|
||||||
import com.njcn.web.utils.WebUtil;
|
import com.njcn.web.utils.WebUtil;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
@@ -65,6 +66,7 @@ import org.springframework.web.multipart.MultipartFile;
|
|||||||
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
import java.util.stream.Stream;
|
import java.util.stream.Stream;
|
||||||
@@ -78,6 +80,7 @@ import java.util.stream.Stream;
|
|||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
|
@Slf4j
|
||||||
public class SupervisionDevMainReportPOServiceImpl extends ServiceImpl<SupervisionDevMainReportPOMapper, SupervisionDevMainReportPO> implements SupervisionDevMainReportPOService {
|
public class SupervisionDevMainReportPOServiceImpl extends ServiceImpl<SupervisionDevMainReportPOMapper, SupervisionDevMainReportPO> implements SupervisionDevMainReportPOService {
|
||||||
|
|
||||||
|
|
||||||
@@ -502,6 +505,7 @@ public class SupervisionDevMainReportPOServiceImpl extends ServiceImpl<Supervisi
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void importDevData(MultipartFile file, HttpServletResponse response) {
|
public void importDevData(MultipartFile file, HttpServletResponse response) {
|
||||||
|
log.info("beginImport-------------------"+ LocalDateTime.now());
|
||||||
ImportParams params = new ImportParams();
|
ImportParams params = new ImportParams();
|
||||||
//表头
|
//表头
|
||||||
params.setHeadRows(1);
|
params.setHeadRows(1);
|
||||||
@@ -528,8 +532,11 @@ public class SupervisionDevMainReportPOServiceImpl extends ServiceImpl<Supervisi
|
|||||||
throw new BusinessException(SupervisionResponseEnum.IMPORT_DEV_ERROR);
|
throw new BusinessException(SupervisionResponseEnum.IMPORT_DEV_ERROR);
|
||||||
}
|
}
|
||||||
List<SupervisionDevMainReportExcel.ExcelMsg> devMsgList = new ArrayList<>();
|
List<SupervisionDevMainReportExcel.ExcelMsg> devMsgList = new ArrayList<>();
|
||||||
|
log.info("beginqueryjiBeiArea-------------------"+ LocalDateTime.now());
|
||||||
|
|
||||||
//所属地市
|
//所属地市
|
||||||
List<DictData> jiBeiArea = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.JIBEI_AREA.getCode()).getData();
|
List<DictData> jiBeiArea = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.JIBEI_AREA.getCode()).getData();
|
||||||
|
log.info("beginquerydeptS-------------------"+ LocalDateTime.now());
|
||||||
|
|
||||||
//所属供电公司
|
//所属供电公司
|
||||||
List<DeptDTO> deptS = deptFeignClient.getDeptDescendantIndexes(RequestUtil.getDeptIndex(), WebUtil.filterDeptType()).getData();
|
List<DeptDTO> deptS = deptFeignClient.getDeptDescendantIndexes(RequestUtil.getDeptIndex(), WebUtil.filterDeptType()).getData();
|
||||||
@@ -542,6 +549,7 @@ public class SupervisionDevMainReportPOServiceImpl extends ServiceImpl<Supervisi
|
|||||||
//获取所有前置机
|
//获取所有前置机
|
||||||
List<Node> nodes = nodeClient.nodeAllList().getData();
|
List<Node> nodes = nodeClient.nodeAllList().getData();
|
||||||
Map<String, String> nodeMap = nodes.stream().collect(Collectors.toMap(Node::getName, Node::getId, (k1, k2) -> k1));
|
Map<String, String> nodeMap = nodes.stream().collect(Collectors.toMap(Node::getName, Node::getId, (k1, k2) -> k1));
|
||||||
|
log.info("beginquerydevConnect-------------------"+ LocalDateTime.now());
|
||||||
|
|
||||||
//接线方式
|
//接线方式
|
||||||
List<DictData> devConnect = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.DEV_CONNECT.getCode()).getData();
|
List<DictData> devConnect = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.DEV_CONNECT.getCode()).getData();
|
||||||
@@ -552,10 +560,14 @@ public class SupervisionDevMainReportPOServiceImpl extends ServiceImpl<Supervisi
|
|||||||
List<DictData> voltageTransformer = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.VOLTAGE_TRANSFORMER.getCode()).getData();
|
List<DictData> voltageTransformer = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.VOLTAGE_TRANSFORMER.getCode()).getData();
|
||||||
//中性点接线方式
|
//中性点接线方式
|
||||||
List<DictData> neutralPoint = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.Neutral_Point.getCode()).getData();
|
List<DictData> neutralPoint = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.Neutral_Point.getCode()).getData();
|
||||||
|
log.info("beginqueryneutralPoint-------------------"+ LocalDateTime.now());
|
||||||
|
|
||||||
SubstationParam substationParam=new SubstationParam();
|
SubstationParam substationParam=new SubstationParam();
|
||||||
substationParam.setOrgIds(deptS.stream().map(DeptDTO::getId).distinct().collect(Collectors.toList()));
|
substationParam.setOrgIds(deptS.stream().map(DeptDTO::getId).distinct().collect(Collectors.toList()));
|
||||||
|
log.info("beginquerySubGetBase-------------------"+ LocalDateTime.now());
|
||||||
|
|
||||||
List<SubGetBase> data = commterminalGeneralClient.tagOrIdGetSub(substationParam).getData();
|
List<SubGetBase> data = commterminalGeneralClient.tagOrIdGetSub(substationParam).getData();
|
||||||
|
log.info("endquerySubGetBase-------------------"+ LocalDateTime.now());
|
||||||
|
|
||||||
SupervisionDevMainReportPO po;
|
SupervisionDevMainReportPO po;
|
||||||
if (CollectionUtil.isNotEmpty(devExcels)) {
|
if (CollectionUtil.isNotEmpty(devExcels)) {
|
||||||
|
|||||||
@@ -224,7 +224,7 @@ public class SupervisionTempLineDebugPOServiceImpl extends ServiceImpl<Supervisi
|
|||||||
queryWrapper.in("supervision_temp_line_report.org_id", data);
|
queryWrapper.in("supervision_temp_line_report.org_id", data);
|
||||||
}
|
}
|
||||||
queryWrapper
|
queryWrapper
|
||||||
.and(CollUtil.isNotEmpty(InstanceUtil.filterTaskStatus()), w -> w.in("supervision_temp_line_debug.status", InstanceUtil.filterTaskStatus())
|
.and(CollUtil.isNotEmpty(InstanceUtil.filterTempLineTaskStatus()), w -> w.in("supervision_temp_line_debug.status", InstanceUtil.filterTempLineTaskStatus())
|
||||||
.or()
|
.or()
|
||||||
.eq("supervision_temp_line_debug.create_by", RequestUtil.getUserIndex())
|
.eq("supervision_temp_line_debug.create_by", RequestUtil.getUserIndex())
|
||||||
);
|
);
|
||||||
@@ -265,7 +265,7 @@ public class SupervisionTempLineDebugPOServiceImpl extends ServiceImpl<Supervisi
|
|||||||
queryWrapper.in("supervision_temp_line_report.org_id", data);
|
queryWrapper.in("supervision_temp_line_report.org_id", data);
|
||||||
}
|
}
|
||||||
queryWrapper
|
queryWrapper
|
||||||
.and(CollUtil.isNotEmpty(InstanceUtil.filterTaskStatus()), w -> w.in("supervision_temp_line_debug.status", InstanceUtil.filterTaskStatus())
|
.and(CollUtil.isNotEmpty(InstanceUtil.filterTempLineTaskStatus()), w -> w.in("supervision_temp_line_debug.status", InstanceUtil.filterTempLineTaskStatus())
|
||||||
.or()
|
.or()
|
||||||
.eq("supervision_temp_line_debug.create_by", RequestUtil.getUserIndex())
|
.eq("supervision_temp_line_debug.create_by", RequestUtil.getUserIndex())
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -163,7 +163,9 @@ public class WarningLeafletServiceImpl extends ServiceImpl<WarningLeafletMapper,
|
|||||||
x.setDutyOrgName(deptMap.get(x.getDutyOrgId()));
|
x.setDutyOrgName(deptMap.get(x.getDutyOrgId()));
|
||||||
}
|
}
|
||||||
if (!Objects.isNull(x.getFilePath())) {
|
if (!Objects.isNull(x.getFilePath())) {
|
||||||
|
x.setAbsFilePath(x.getFilePath());
|
||||||
x.setFilePath(fileStorageUtil.getFileUrl(x.getFilePath()));
|
x.setFilePath(fileStorageUtil.getFileUrl(x.getFilePath()));
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -393,6 +395,8 @@ public class WarningLeafletServiceImpl extends ServiceImpl<WarningLeafletMapper,
|
|||||||
record.setDutyOrgName(deptMap.get(record.getDutyOrgId()));
|
record.setDutyOrgName(deptMap.get(record.getDutyOrgId()));
|
||||||
}
|
}
|
||||||
if (!Objects.isNull(record.getFilePath())) {
|
if (!Objects.isNull(record.getFilePath())) {
|
||||||
|
record.setAbsFilePath(record.getFilePath());
|
||||||
|
|
||||||
record.setFilePath(fileStorageUtil.getFileUrl(record.getFilePath()));
|
record.setFilePath(fileStorageUtil.getFileUrl(record.getFilePath()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -73,4 +73,7 @@ public interface UserReportPOService extends IBpmService<UserReportPO> {
|
|||||||
|
|
||||||
List<UserReportPO> getSensitiveUserByDept(SensitiveUserParam param);
|
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());
|
userReportNormalPO.setState(DataStateEnum.ENABLE.getCode());
|
||||||
if (Objects.equals(userReportNormalParam.getSaveOrCheckflag(), "1")) {
|
if (Objects.equals(userReportNormalParam.getSaveOrCheckflag(), "1")) {
|
||||||
userReportNormalPO.setStatus(BpmTaskStatusEnum.WAIT.getStatus());
|
userReportNormalPO.setStatus(BpmTaskStatusEnum.WAIT.getStatus());
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
userReportNormalPO.setStatus(BpmTaskStatusEnum.RUNNING.getStatus());
|
userReportNormalPO.setStatus(BpmTaskStatusEnum.RUNNING.getStatus());
|
||||||
|
|
||||||
@@ -154,6 +153,7 @@ public class UserReportNormalServiceImpl extends ServiceImpl<UserReportNormalMap
|
|||||||
vo.setId(item.getId());
|
vo.setId(item.getId());
|
||||||
vo.setUserReportId(item.getUserReportId());
|
vo.setUserReportId(item.getUserReportId());
|
||||||
vo.setOtherReport(item.getReportUrl());
|
vo.setOtherReport(item.getReportUrl());
|
||||||
|
vo.setSimulationReport(item.getSimulationReportUrl());
|
||||||
vo.setProcessInstanceId(item.getProcessInstanceId());
|
vo.setProcessInstanceId(item.getProcessInstanceId());
|
||||||
vo.setCreateTime(item.getCreateTime());
|
vo.setCreateTime(item.getCreateTime());
|
||||||
vo.setStatus(item.getStatus());
|
vo.setStatus(item.getStatus());
|
||||||
@@ -175,6 +175,7 @@ public class UserReportNormalServiceImpl extends ServiceImpl<UserReportNormalMap
|
|||||||
BeanUtil.copyProperties(userReportPO, vo);
|
BeanUtil.copyProperties(userReportPO, vo);
|
||||||
BeanUtil.copyProperties(userReportNormalPO, vo);
|
BeanUtil.copyProperties(userReportNormalPO, vo);
|
||||||
vo.setOtherReport(userReportNormalPO.getReportUrl());
|
vo.setOtherReport(userReportNormalPO.getReportUrl());
|
||||||
|
vo.setSimulationReport(userReportNormalPO.getSimulationReportUrl());
|
||||||
return vo;
|
return vo;
|
||||||
}
|
}
|
||||||
return null;
|
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> 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> 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.setNetInReport(Collections.singletonList(netInReport.orElse(null)));
|
||||||
userReportVO.setGovernReport(Collections.singletonList(governReport.orElse(null)));
|
userReportVO.setGovernReport(Collections.singletonList(governReport.orElse(null)));
|
||||||
|
userReportVO.setSimulationReport(Collections.singletonList(simulationReport.orElse(null)));
|
||||||
return userReportVO;
|
return userReportVO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -129,7 +129,7 @@ public class UserReportPOServiceImpl extends ServiceImpl<UserReportPOMapper, Use
|
|||||||
if (ObjectUtil.isNotNull(userReportParam.getDataType())) {
|
if (ObjectUtil.isNotNull(userReportParam.getDataType())) {
|
||||||
userReportPO.setDataType(userReportParam.getDataType());
|
userReportPO.setDataType(userReportParam.getDataType());
|
||||||
if (userReportParam.getDataType() == 1) {
|
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());
|
userReportPO.setStatus(BpmTaskStatusEnum.APPROVE.getStatus());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -246,7 +246,7 @@ public class UserReportPOServiceImpl extends ServiceImpl<UserReportPOMapper, Use
|
|||||||
Map<String, Object> processInstanceVariables = new HashMap<>(16);
|
Map<String, Object> processInstanceVariables = new HashMap<>(16);
|
||||||
BpmProcessInstanceCreateReqDTO bpmProcessInstanceCreateReqDTO = new BpmProcessInstanceCreateReqDTO();
|
BpmProcessInstanceCreateReqDTO bpmProcessInstanceCreateReqDTO = new BpmProcessInstanceCreateReqDTO();
|
||||||
String key = SupervisionKeyEnum.BUILD_USER_INFO.getKey();
|
String key = SupervisionKeyEnum.BUILD_USER_INFO.getKey();
|
||||||
if(ObjectUtil.isNotNull(userReportPO.getDataType())){
|
if (ObjectUtil.isNotNull(userReportPO.getDataType())) {
|
||||||
//干扰源用户台账和敏感用户审核流程
|
//干扰源用户台账和敏感用户审核流程
|
||||||
if (userReportPO.getDataType() == 1) {
|
if (userReportPO.getDataType() == 1) {
|
||||||
key = SupervisionKeyEnum.BUILD_USER_INFO_ARCHIVIST.getKey();
|
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.in("supervision_user_report.city", userReportQueryParam.getCity());
|
||||||
}
|
}
|
||||||
userReportVOQueryWrapper
|
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()
|
.or()
|
||||||
.eq("supervision_user_report.create_by", RequestUtil.getUserIndex())
|
.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> 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> 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.setNetInReport(Collections.singletonList(netInReport.orElse(null)));
|
||||||
userReportVO.setGovernReport(Collections.singletonList(governReport.orElse(null)));
|
userReportVO.setGovernReport(Collections.singletonList(governReport.orElse(null)));
|
||||||
|
userReportVO.setSimulationReport(Collections.singletonList(simulationReport.orElse(null)));
|
||||||
return userReportVO;
|
return userReportVO;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -436,7 +438,7 @@ public class UserReportPOServiceImpl extends ServiceImpl<UserReportPOMapper, Use
|
|||||||
public BpmInstanceInfo getInstanceInfo(String businessId) {
|
public BpmInstanceInfo getInstanceInfo(String businessId) {
|
||||||
BpmInstanceInfo bpmInstanceInfo = new BpmInstanceInfo();
|
BpmInstanceInfo bpmInstanceInfo = new BpmInstanceInfo();
|
||||||
UserReportPO userReportPO = this.getById(businessId);
|
UserReportPO userReportPO = this.getById(businessId);
|
||||||
if(Objects.isNull(userReportPO)){
|
if (Objects.isNull(userReportPO)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
bpmInstanceInfo.setHistoryInstanceId(userReportPO.getHistoryInstanceId());
|
bpmInstanceInfo.setHistoryInstanceId(userReportPO.getHistoryInstanceId());
|
||||||
@@ -455,7 +457,7 @@ public class UserReportPOServiceImpl extends ServiceImpl<UserReportPOMapper, Use
|
|||||||
.select(UserReportPO::getProcessInstanceId);
|
.select(UserReportPO::getProcessInstanceId);
|
||||||
List<UserReportPO> userReportPOList = this.baseMapper.selectList(lambdaQueryWrapper);
|
List<UserReportPO> userReportPOList = this.baseMapper.selectList(lambdaQueryWrapper);
|
||||||
List<String> result = userReportPOList.stream().map(UserReportPO::getProcessInstanceId).collect(Collectors.toList());
|
List<String> result = userReportPOList.stream().map(UserReportPO::getProcessInstanceId).collect(Collectors.toList());
|
||||||
if(CollectionUtil.isNotEmpty(result)){
|
if (CollectionUtil.isNotEmpty(result)) {
|
||||||
rejectInstanceIds.addAll(result);
|
rejectInstanceIds.addAll(result);
|
||||||
}
|
}
|
||||||
return rejectInstanceIds;
|
return rejectInstanceIds;
|
||||||
@@ -503,11 +505,11 @@ public class UserReportPOServiceImpl extends ServiceImpl<UserReportPOMapper, Use
|
|||||||
if (!allDataFlag) {
|
if (!allDataFlag) {
|
||||||
//台账不查询全部数据,需要排除敏感及重要用户
|
//台账不查询全部数据,需要排除敏感及重要用户
|
||||||
userReportVOQueryWrapper.ne("supervision_user_report.user_type", UserNatureEnum.SENSITIVE_USER.getCode())
|
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()
|
.or()
|
||||||
.eq("supervision_user_report.create_by", RequestUtil.getUserIndex())
|
.eq("supervision_user_report.create_by", RequestUtil.getUserIndex())
|
||||||
);
|
);
|
||||||
}else{
|
} else {
|
||||||
userReportVOQueryWrapper.eq("supervision_user_report.status", FlowStatusEnum.APPROVE.getCode());
|
userReportVOQueryWrapper.eq("supervision_user_report.status", FlowStatusEnum.APPROVE.getCode());
|
||||||
}
|
}
|
||||||
if (Objects.nonNull(userReportQueryParam)) {
|
if (Objects.nonNull(userReportQueryParam)) {
|
||||||
@@ -793,14 +795,15 @@ public class UserReportPOServiceImpl extends ServiceImpl<UserReportPOMapper, Use
|
|||||||
params.setHeadRows(1);
|
params.setHeadRows(1);
|
||||||
//标题
|
//标题
|
||||||
params.setTitleRows(1);
|
params.setTitleRows(1);
|
||||||
params.setNeedVerify(true);
|
params.setNeedVerify(false);
|
||||||
params.setStartSheetIndex(0);
|
params.setStartSheetIndex(0);
|
||||||
|
params.setReadRows(100); // 最多读取100行数据
|
||||||
params.setSheetNum(1);
|
params.setSheetNum(1);
|
||||||
List<SensitiveUserSExcel> sensitiveUserExcels;
|
List<SensitiveUserSExcel> sensitiveUserExcels;
|
||||||
try {
|
try {
|
||||||
List<SensitiveUserSExcel> sensitiveUserExcelExcelImportResult = ExcelImportUtil.importExcel(file.getInputStream(), SensitiveUserSExcel.class, params);
|
List<SensitiveUserSExcel> sensitiveUserExcelExcelImportResult = ExcelImportUtil.importExcel(file.getInputStream(), SensitiveUserSExcel.class, params);
|
||||||
sensitiveUserExcels = sensitiveUserExcelExcelImportResult.stream().filter(x -> StringUtils.isNotBlank(x.getCity())).collect(Collectors.toList());
|
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);
|
throw new BusinessException(SupervisionResponseEnum.IMPORT_DEV_DATA_ERROR);
|
||||||
}
|
}
|
||||||
//如果存在非法数据,将不合格的数据导出
|
//如果存在非法数据,将不合格的数据导出
|
||||||
@@ -1018,6 +1021,7 @@ public class UserReportPOServiceImpl extends ServiceImpl<UserReportPOMapper, Use
|
|||||||
params.setTitleRows(1);
|
params.setTitleRows(1);
|
||||||
params.setNeedVerify(false); // 关闭校验,避免校验导致的性能问题
|
params.setNeedVerify(false); // 关闭校验,避免校验导致的性能问题
|
||||||
params.setStartSheetIndex(0);
|
params.setStartSheetIndex(0);
|
||||||
|
params.setReadRows(100); // 最多读取100行数据
|
||||||
params.setSheetNum(1);
|
params.setSheetNum(1);
|
||||||
// 限制最大读取行数,防止Excel模板带下拉列表导致读取大量空行
|
// 限制最大读取行数,防止Excel模板带下拉列表导致读取大量空行
|
||||||
// 如果实际数据超过此限制,需要分批导入或调整此参数
|
// 如果实际数据超过此限制,需要分批导入或调整此参数
|
||||||
@@ -1028,11 +1032,11 @@ public class UserReportPOServiceImpl extends ServiceImpl<UserReportPOMapper, Use
|
|||||||
ExcelImportResult<SensitiveReportExcel> sensitiveUserExcelExcelImportResult = ExcelImportUtil.importExcelMore(file.getInputStream(), SensitiveReportExcel.class, params);
|
ExcelImportResult<SensitiveReportExcel> sensitiveUserExcelExcelImportResult = ExcelImportUtil.importExcelMore(file.getInputStream(), SensitiveReportExcel.class, params);
|
||||||
log.info("Excel 解析完成,原始数据行数:{}", sensitiveUserExcelExcelImportResult.getList().size());
|
log.info("Excel 解析完成,原始数据行数:{}", sensitiveUserExcelExcelImportResult.getList().size());
|
||||||
//如果存在非法数据,将不合格的数据导出
|
//如果存在非法数据,将不合格的数据导出
|
||||||
if (sensitiveUserExcelExcelImportResult.isVerifyFail()) {
|
// if (sensitiveUserExcelExcelImportResult.isVerifyFail()) {
|
||||||
log.warn("存在校验失败的数据");
|
// log.warn("存在校验失败的数据");
|
||||||
PoiUtil.exportFileByWorkbook(sensitiveUserExcelExcelImportResult.getFailWorkbook(), "非法用户数据.xlsx", response);
|
// PoiUtil.exportFileByWorkbook(sensitiveUserExcelExcelImportResult.getFailWorkbook(), "非法用户数据.xlsx", response);
|
||||||
return; // 校验失败直接返回
|
// return; // 校验失败直接返回
|
||||||
} else {
|
// } else {
|
||||||
// 过滤掉空行数据(projectName 为空的行)
|
// 过滤掉空行数据(projectName 为空的行)
|
||||||
sensitiveUserExcels = sensitiveUserExcelExcelImportResult.getList().stream()
|
sensitiveUserExcels = sensitiveUserExcelExcelImportResult.getList().stream()
|
||||||
.filter(x -> StringUtils.isNotBlank(x.getProjectName()))
|
.filter(x -> StringUtils.isNotBlank(x.getProjectName()))
|
||||||
@@ -1042,7 +1046,7 @@ public class UserReportPOServiceImpl extends ServiceImpl<UserReportPOMapper, Use
|
|||||||
if (CollectionUtil.isEmpty(sensitiveUserExcels)) {
|
if (CollectionUtil.isEmpty(sensitiveUserExcels)) {
|
||||||
throw new BusinessException(SupervisionResponseEnum.IMPORT_DEV_DATA_ERROR);
|
throw new BusinessException(SupervisionResponseEnum.IMPORT_DEV_DATA_ERROR);
|
||||||
}
|
}
|
||||||
}
|
// }
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("导入失败,文件:{}", file.getOriginalFilename(), e);
|
log.error("导入失败,文件:{}", file.getOriginalFilename(), e);
|
||||||
throw new BusinessException(SupervisionResponseEnum.IMPORT_SENSITIVE_REPORT_ERROR);
|
throw new BusinessException(SupervisionResponseEnum.IMPORT_SENSITIVE_REPORT_ERROR);
|
||||||
@@ -1055,7 +1059,7 @@ public class UserReportPOServiceImpl extends ServiceImpl<UserReportPOMapper, Use
|
|||||||
//评估类型
|
//评估类型
|
||||||
List<DictData> evaluationType = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.EVALUATION_TYPE.getCode()).getData();
|
List<DictData> evaluationType = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.EVALUATION_TYPE.getCode()).getData();
|
||||||
//解决填报部门问题
|
//解决填报部门问题
|
||||||
List<DeptDTO> data = deptFeignClient.getDeptDescendantIndexes(RequestUtil.getUserIndex(), WebUtil.filterDeptType()).getData();
|
List<DeptDTO> data = deptFeignClient.getDeptDescendantIndexes(RequestUtil.getDeptIndex(), WebUtil.filterDeptType()).getData();
|
||||||
|
|
||||||
//执行批量导入敏感及重要用户,入库过程中会进行数据校验
|
//执行批量导入敏感及重要用户,入库过程中会进行数据校验
|
||||||
List<SensitiveReportExcel.SensitiveReportExcelMsg> sensitiveUserExcelMsgs = new ArrayList<>();
|
List<SensitiveReportExcel.SensitiveReportExcelMsg> sensitiveUserExcelMsgs = new ArrayList<>();
|
||||||
@@ -1163,7 +1167,7 @@ public class UserReportPOServiceImpl extends ServiceImpl<UserReportPOMapper, Use
|
|||||||
@Override
|
@Override
|
||||||
public Boolean deleteUserReport(List<String> supervisionId) {
|
public Boolean deleteUserReport(List<String> supervisionId) {
|
||||||
List<UserReportPO> userReportPOS = this.listByIds(supervisionId);
|
List<UserReportPO> userReportPOS = this.listByIds(supervisionId);
|
||||||
if(CollUtil.isEmpty(userReportPOS)){
|
if (CollUtil.isEmpty(userReportPOS)) {
|
||||||
throw new BusinessException(SupervisionResponseEnum.EXISTENCE_OR_NOT);
|
throw new BusinessException(SupervisionResponseEnum.EXISTENCE_OR_NOT);
|
||||||
}
|
}
|
||||||
//判断是否有权限操作
|
//判断是否有权限操作
|
||||||
@@ -1179,29 +1183,29 @@ public class UserReportPOServiceImpl extends ServiceImpl<UserReportPOMapper, Use
|
|||||||
public List<UserLedgerVO> selectUserList(UserReportParam userReportParam) {
|
public List<UserLedgerVO> selectUserList(UserReportParam userReportParam) {
|
||||||
LambdaQueryWrapper<UserReportPO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<UserReportPO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
|
||||||
if(StrUtil.isNotBlank(userReportParam.getCity())){
|
if (StrUtil.isNotBlank(userReportParam.getCity())) {
|
||||||
lambdaQueryWrapper.in(UserReportPO::getCity,Stream.of(userReportParam.getCity()).collect(Collectors.toList()));
|
lambdaQueryWrapper.in(UserReportPO::getCity, Stream.of(userReportParam.getCity()).collect(Collectors.toList()));
|
||||||
}
|
}
|
||||||
if(StrUtil.isNotBlank(userReportParam.getStationId())){
|
if (StrUtil.isNotBlank(userReportParam.getStationId())) {
|
||||||
lambdaQueryWrapper.eq(UserReportPO::getStationId,userReportParam.getStationId());
|
lambdaQueryWrapper.eq(UserReportPO::getStationId, userReportParam.getStationId());
|
||||||
}
|
}
|
||||||
if (ObjectUtil.isNotNull(userReportParam.getUserType())) {
|
if (ObjectUtil.isNotNull(userReportParam.getUserType())) {
|
||||||
lambdaQueryWrapper.eq(UserReportPO::getUserType, 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);
|
List<UserReportPO> list = this.list(lambdaQueryWrapper);
|
||||||
return BeanUtil.copyToList(list,UserLedgerVO.class);
|
return BeanUtil.copyToList(list, UserLedgerVO.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public UserLedgerVO selectUserInfo(String id) {
|
public UserLedgerVO selectUserInfo(String id) {
|
||||||
LambdaQueryWrapper<UserReportPO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
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);
|
UserReportPO userReportPO = this.getById(id);
|
||||||
if(Objects.nonNull(userReportPO)){
|
if (Objects.nonNull(userReportPO)) {
|
||||||
return BeanUtil.copyProperties(userReportPO,UserLedgerVO.class);
|
return BeanUtil.copyProperties(userReportPO, UserLedgerVO.class);
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -1318,6 +1322,28 @@ public class UserReportPOServiceImpl extends ServiceImpl<UserReportPOMapper, Use
|
|||||||
return this.baseMapper.selectList(userReportVOQueryWrapper);
|
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) {
|
public Map<String, String> getTreeString(String name, List<SysDicTreePO> treeVOS) {
|
||||||
Map<String, String> info = new LinkedHashMap<>();
|
Map<String, String> info = new LinkedHashMap<>();
|
||||||
for (SysDicTreePO sysMenuDtoChild : treeVOS) {
|
for (SysDicTreePO sysMenuDtoChild : treeVOS) {
|
||||||
@@ -1363,7 +1389,7 @@ public class UserReportPOServiceImpl extends ServiceImpl<UserReportPOMapper, Use
|
|||||||
LambdaQueryWrapper<UserReportPO> userReportPOLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<UserReportPO> userReportPOLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
userReportPOLambdaQueryWrapper
|
userReportPOLambdaQueryWrapper
|
||||||
.eq(UserReportPO::getProjectName, userReportParam.getProjectName())
|
.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());
|
.eq(UserReportPO::getState, DataStateEnum.ENABLE.getCode());
|
||||||
//更新的时候,需排除当前记录
|
//更新的时候,需排除当前记录
|
||||||
if (isExcludeSelf) {
|
if (isExcludeSelf) {
|
||||||
|
|||||||
@@ -69,10 +69,7 @@ public class InstanceUtil {
|
|||||||
throw new BusinessException(SupervisionResponseEnum.EXISTENCE_OR_NOT);
|
throw new BusinessException(SupervisionResponseEnum.EXISTENCE_OR_NOT);
|
||||||
}
|
}
|
||||||
//先判断是否是删除管理员,如果是就有全部删除权限,否则就只能删除带提交审批的
|
//先判断是否是删除管理员,如果是就有全部删除权限,否则就只能删除带提交审批的
|
||||||
String userRole = RequestUtil.getUserRole();
|
List<String> delete = deleteUser();
|
||||||
String trimmedString = userRole.substring(1, userRole.length() - 1).replace("\"", "");
|
|
||||||
List<String> list = Arrays.asList(trimmedString.split(","));
|
|
||||||
List<String> delete = list.stream().filter(x -> "delete_info".equals(x)).collect(Collectors.toList());
|
|
||||||
//如果为空则需要判断信息,先判断全部数据是否都是自己创建的,然后判断是否是都是带提交数据
|
//如果为空则需要判断信息,先判断全部数据是否都是自己创建的,然后判断是否是都是带提交数据
|
||||||
if (CollUtil.isEmpty(delete)) {
|
if (CollUtil.isEmpty(delete)) {
|
||||||
long count = createBy.stream().filter(x -> !userId.equals(x)).count();
|
long count = createBy.stream().filter(x -> !userId.equals(x)).count();
|
||||||
@@ -91,10 +88,7 @@ public class InstanceUtil {
|
|||||||
List<Integer> info =new ArrayList<>();
|
List<Integer> info =new ArrayList<>();
|
||||||
info.add(BpmTaskStatusEnum.RUNNING.getStatus());
|
info.add(BpmTaskStatusEnum.RUNNING.getStatus());
|
||||||
info.add(BpmTaskStatusEnum.APPROVE.getStatus());
|
info.add(BpmTaskStatusEnum.APPROVE.getStatus());
|
||||||
String userRole = RequestUtil.getUserRole();
|
List<String> delete = deleteUser();
|
||||||
String trimmedString = userRole.substring(1, userRole.length() - 1).replace("\"", "");
|
|
||||||
List<String> list = Arrays.asList(trimmedString.split(","));
|
|
||||||
List<String> delete = list.stream().filter(x -> "delete_info".equals(x)).collect(Collectors.toList());
|
|
||||||
//删除管理员默认能删除全部数据
|
//删除管理员默认能删除全部数据
|
||||||
if (CollUtil.isNotEmpty(delete)) {
|
if (CollUtil.isNotEmpty(delete)) {
|
||||||
info.clear();
|
info.clear();
|
||||||
@@ -102,4 +96,24 @@ public class InstanceUtil {
|
|||||||
return info;
|
return info;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static List<Integer> filterTempLineTaskStatus() {
|
||||||
|
List<Integer> info =new ArrayList<>();
|
||||||
|
info.add(BpmTaskStatusEnum.RUNNING.getStatus());
|
||||||
|
info.add(BpmTaskStatusEnum.APPROVE.getStatus());
|
||||||
|
info.add(BpmTaskStatusEnum.RETURN.getStatus());
|
||||||
|
List<String> delete = deleteUser();
|
||||||
|
//删除管理员默认能删除全部数据
|
||||||
|
if (CollUtil.isNotEmpty(delete)) {
|
||||||
|
info.clear();
|
||||||
|
}
|
||||||
|
return info;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static List<String> deleteUser() {
|
||||||
|
String userRole = RequestUtil.getUserRole();
|
||||||
|
String trimmedString = userRole.substring(1, userRole.length() - 1).replace("\"", "");
|
||||||
|
List<String> list = Arrays.asList(trimmedString.split(","));
|
||||||
|
return list.stream().filter(x -> "delete_info".equals(x)).collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -65,6 +65,12 @@ public class PqDashboardPageParam {
|
|||||||
@ApiModelProperty("图标")
|
@ApiModelProperty("图标")
|
||||||
private String icon;
|
private String icon;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面名称
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("用户id")
|
||||||
|
private String userId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新操作实体
|
* 更新操作实体
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.njcn.system.pojo.vo;
|
package com.njcn.system.pojo.vo;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
||||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||||
@@ -50,6 +51,12 @@ public class PqDashboardPageVO extends BaseEntity {
|
|||||||
*/
|
*/
|
||||||
private Integer sort;
|
private Integer sort;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户id
|
||||||
|
*/
|
||||||
|
@TableField(value = "user_id")
|
||||||
|
private String userId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 0未激活,1激活
|
* 0未激活,1激活
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -89,6 +89,16 @@ public class PqDashboardPageController extends BaseController {
|
|||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping("/scopePage")
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@ApiOperation("全局的驾驶舱页面")
|
||||||
|
public HttpResult<Boolean> scopePage(@RequestParam("id") String id,@RequestParam("userId") String userId){
|
||||||
|
log.info("全局的驾驶舱页面");
|
||||||
|
String methodDescribe = getMethodDescribe("scopePage");
|
||||||
|
Boolean result = pqDashboardPageService.scopePage(id,userId);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
@PostMapping("/queryActivatePage")
|
@PostMapping("/queryActivatePage")
|
||||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
@ApiOperation("查询激活的驾驶舱页面")
|
@ApiOperation("查询激活的驾驶舱页面")
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
</resultMap>
|
</resultMap>
|
||||||
<sql id="Base_Column_List">
|
<sql id="Base_Column_List">
|
||||||
<!--@mbg.generated-->
|
<!--@mbg.generated-->
|
||||||
Id, page_name, thumbnail, remark, container_config, sort, `state`, Create_By, Create_Time,
|
Id, page_name, thumbnail, remark, container_config, sort, "state", Create_By, Create_Time,
|
||||||
Update_By, Update_Time
|
Update_By, Update_Time
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
|
|||||||
@@ -33,4 +33,6 @@ public interface PqDashboardPageService extends IService<PqDashboardPage> {
|
|||||||
PqDashboardPageVO queryByPagePath(String pagePath);
|
PqDashboardPageVO queryByPagePath(String pagePath);
|
||||||
|
|
||||||
List<PqDashboardPage> getDashboardPageByUserId(String id,boolean state);
|
List<PqDashboardPage> getDashboardPageByUserId(String id,boolean state);
|
||||||
|
|
||||||
|
Boolean scopePage(String id, String userId);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,8 +40,9 @@ public class PqDashboardPageServiceImpl extends ServiceImpl<PqDashboardPageMappe
|
|||||||
// checkName(pqDashboardPageParam,false);
|
// checkName(pqDashboardPageParam,false);
|
||||||
|
|
||||||
BeanUtils.copyProperties(pqDashboardPageParam,pqDashboardPage);
|
BeanUtils.copyProperties(pqDashboardPageParam,pqDashboardPage);
|
||||||
pqDashboardPage.setState(0);
|
//根据前端传递状态赋值
|
||||||
pqDashboardPage.setUserId(RequestUtil.getUserIndex());
|
//pqDashboardPage.setState(0);
|
||||||
|
// pqDashboardPage.setUserId(RequestUtil.getUserIndex());
|
||||||
this.save(pqDashboardPage);
|
this.save(pqDashboardPage);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -73,6 +74,7 @@ public class PqDashboardPageServiceImpl extends ServiceImpl<PqDashboardPageMappe
|
|||||||
if(Objects.nonNull(param.getPageName())){
|
if(Objects.nonNull(param.getPageName())){
|
||||||
queryWrapper.like("A.page_name",param.getPageName());
|
queryWrapper.like("A.page_name",param.getPageName());
|
||||||
}
|
}
|
||||||
|
queryWrapper.orderByAsc("A.sort");
|
||||||
return this.baseMapper.page(new Page<>(PageFactory.getPageNum(param), PageFactory.getPageSize(param)), queryWrapper);
|
return this.baseMapper.page(new Page<>(PageFactory.getPageNum(param), PageFactory.getPageSize(param)), queryWrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -81,6 +83,11 @@ public class PqDashboardPageServiceImpl extends ServiceImpl<PqDashboardPageMappe
|
|||||||
return this.lambdaUpdate().set(PqDashboardPage::getState,state).eq(PqDashboardPage::getId,id).update();
|
return this.lambdaUpdate().set(PqDashboardPage::getState,state).eq(PqDashboardPage::getId,id).update();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Boolean scopePage(String id, String userId) {
|
||||||
|
return this.lambdaUpdate().set(PqDashboardPage::getUserId,userId).eq(PqDashboardPage::getId,id).update();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PqDashboardPageVO queryByPagePath(String pagePath) {
|
public PqDashboardPageVO queryByPagePath(String pagePath) {
|
||||||
List<String> userList = Arrays.asList("0",RequestUtil.getUserIndex());
|
List<String> userList = Arrays.asList("0",RequestUtil.getUserIndex());
|
||||||
@@ -107,6 +114,8 @@ public class PqDashboardPageServiceImpl extends ServiceImpl<PqDashboardPageMappe
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 校验参数,检查是否存在相同编码的字典类型
|
* 校验参数,检查是否存在相同编码的字典类型
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -98,11 +98,11 @@ public class PqFrontLogsServiceImpl extends ServiceImpl<PqFrontLogsMapper, PqFro
|
|||||||
@Override
|
@Override
|
||||||
public Page<PqFrontLogsVO> queryPage(PqFrontLogsParam baseParam) {
|
public Page<PqFrontLogsVO> queryPage(PqFrontLogsParam baseParam) {
|
||||||
QueryWrapper<PqFrontLogs> queryWrapper = new QueryWrapper<>();
|
QueryWrapper<PqFrontLogs> queryWrapper = new QueryWrapper<>();
|
||||||
if (Objects.nonNull(baseParam.getSearchBeginTime()) && Objects.nonNull(baseParam.getSearchEndTime())) {
|
if (StringUtils.isNotBlank(baseParam.getSearchBeginTime()) && StringUtils.isNotBlank(baseParam.getSearchEndTime())) {
|
||||||
queryWrapper.between("A.update_Time", baseParam.getSearchBeginTime()+" 00:00:00", baseParam.getSearchEndTime()+" 23:59:59");
|
queryWrapper.between("A.update_Time", baseParam.getSearchBeginTime()+" 00:00:00", baseParam.getSearchEndTime()+" 23:59:59");
|
||||||
}
|
}
|
||||||
|
|
||||||
if(Objects.nonNull(baseParam.getSearchValue())){
|
if(StringUtils.isNotBlank(baseParam.getSearchValue())){
|
||||||
queryWrapper.like("line.name", baseParam.getSearchValue());
|
queryWrapper.like("line.name", baseParam.getSearchValue());
|
||||||
}
|
}
|
||||||
queryWrapper.eq(StringUtils.isNotBlank(baseParam.getCode()),"A.code",baseParam.getCode());
|
queryWrapper.eq(StringUtils.isNotBlank(baseParam.getCode()),"A.code",baseParam.getCode());
|
||||||
|
|||||||
@@ -19,6 +19,8 @@ public enum AppRoleEnum {
|
|||||||
BXS_USER("bxs_user","便携式正式用户"),
|
BXS_USER("bxs_user","便携式正式用户"),
|
||||||
ROOT("root","超级管理员"),
|
ROOT("root","超级管理员"),
|
||||||
OPERATION_MANAGER("operation_manager","运维管理员"),
|
OPERATION_MANAGER("operation_manager","运维管理员"),
|
||||||
|
REGULAR_USER_8000("regular_user_8000","正式用户综合电能质量"),
|
||||||
|
REGULAR_USER("regular_user","正式用户物联云平台")
|
||||||
;
|
;
|
||||||
|
|
||||||
private final String code;
|
private final String code;
|
||||||
|
|||||||
@@ -26,10 +26,7 @@ import lombok.AllArgsConstructor;
|
|||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.util.CollectionUtils;
|
import org.springframework.util.CollectionUtils;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.*;
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Objects;
|
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -110,13 +107,15 @@ public class ComponentServiceImpl extends ServiceImpl<ComponentMapper, Component
|
|||||||
ComponentVO componentVO = new ComponentVO();
|
ComponentVO componentVO = new ComponentVO();
|
||||||
componentVO.setId(dictData.getId());
|
componentVO.setId(dictData.getId());
|
||||||
componentVO.setName(dictData.getName());
|
componentVO.setName(dictData.getName());
|
||||||
|
componentVO.setSort(dictData.getSort());
|
||||||
componentVO.setChildren(
|
componentVO.setChildren(
|
||||||
v.stream()
|
v.stream()
|
||||||
.filter(fun -> Objects.equals(ComponentState.FATHER_PID, fun.getPid()))
|
.filter(fun -> Objects.equals(ComponentState.FATHER_PID, fun.getPid()))
|
||||||
.peek(funS -> funS.setChildren(getChildCategoryList(funS, v)))
|
.peek(funS -> funS.setChildren(getChildCategoryList(funS, v))).sorted(Comparator.comparing(ComponentVO::getSort))
|
||||||
.collect(Collectors.toList()));
|
.collect(Collectors.toList()));
|
||||||
result.add(componentVO);
|
result.add(componentVO);
|
||||||
});
|
});
|
||||||
|
result.sort(Comparator.comparing(ComponentVO::getSort));
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@@ -182,7 +181,7 @@ public class ComponentServiceImpl extends ServiceImpl<ComponentMapper, Component
|
|||||||
*/
|
*/
|
||||||
private List<ComponentVO> getChildCategoryList(ComponentVO currMenu, List<ComponentVO> categories) {
|
private List<ComponentVO> getChildCategoryList(ComponentVO currMenu, List<ComponentVO> categories) {
|
||||||
return categories.stream().filter(o -> Objects.equals(o.getPid(), currMenu.getId()))
|
return categories.stream().filter(o -> Objects.equals(o.getPid(), currMenu.getId()))
|
||||||
.peek(o -> o.setChildren(getChildCategoryList(o, categories)))
|
.peek(o -> o.setChildren(getChildCategoryList(o, categories))).sorted(Comparator.comparing(ComponentVO::getSort))
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -490,15 +490,24 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
|
|||||||
List<UserVO> users = new ArrayList<>();
|
List<UserVO> users = new ArrayList<>();
|
||||||
Role roleByCode1 = roleService.getRoleByCode(AppRoleEnum.APP_VIP_USER.getCode());
|
Role roleByCode1 = roleService.getRoleByCode(AppRoleEnum.APP_VIP_USER.getCode());
|
||||||
Role roleByCode2 = roleService.getRoleByCode(AppRoleEnum.BXS_USER.getCode());
|
Role roleByCode2 = roleService.getRoleByCode(AppRoleEnum.BXS_USER.getCode());
|
||||||
List<UserRole> userRoles = userRoleMapper.selectUserRole(Stream.of(roleByCode1.getId(),roleByCode2.getId()).collect(Collectors.toList()));
|
Role roleByCode3 = roleService.getRoleByCode(AppRoleEnum.REGULAR_USER_8000.getCode());
|
||||||
|
Role roleByCode4 = roleService.getRoleByCode(AppRoleEnum.REGULAR_USER.getCode());
|
||||||
|
List<UserRole> userRoles = userRoleMapper.selectUserRole(
|
||||||
|
Stream.of(roleByCode1.getId()
|
||||||
|
,roleByCode2.getId()
|
||||||
|
,roleByCode3.getId()
|
||||||
|
,roleByCode4.getId()
|
||||||
|
).collect(Collectors.toList()));
|
||||||
List<String> collect = userRoles.stream().map(UserRole::getUserId).distinct().collect(Collectors.toList());
|
List<String> collect = userRoles.stream().map(UserRole::getUserId).distinct().collect(Collectors.toList());
|
||||||
List<User> users1 = this.listByIds(collect);
|
List<User> users1 = this.listByIds(collect);
|
||||||
if (CollectionUtil.isNotEmpty(users1)) {
|
if (CollectionUtil.isNotEmpty(users1)) {
|
||||||
users1.forEach(item->{
|
users1.forEach(item->{
|
||||||
|
if (item.getState() == 1) {
|
||||||
UserVO userVO = new UserVO();
|
UserVO userVO = new UserVO();
|
||||||
userVO.setId(item.getId());
|
userVO.setId(item.getId());
|
||||||
userVO.setName(item.getName());
|
userVO.setName(item.getName());
|
||||||
users.add(userVO);
|
users.add(userVO);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
return users;
|
return users;
|
||||||
|
|||||||
Reference in New Issue
Block a user