优化异常数据和稳态告警接口信息
This commit is contained in:
@@ -17,7 +17,7 @@ public class DetailAbnormalVO {
|
||||
|
||||
private String date;
|
||||
|
||||
private List<String> dateList;
|
||||
private List<TimeAndTargetKey> dateTargetList;
|
||||
|
||||
private String monitorName;
|
||||
|
||||
@@ -29,7 +29,13 @@ public class DetailAbnormalVO {
|
||||
|
||||
private String targetKey;
|
||||
|
||||
@Data
|
||||
public static class TimeAndTargetKey {
|
||||
|
||||
private String date;
|
||||
|
||||
private List<VerifyTargetVO> targetKeys;
|
||||
}
|
||||
/**
|
||||
* 异常实体
|
||||
*/
|
||||
@@ -68,6 +74,14 @@ public class DetailAbnormalVO {
|
||||
private List<DetailAbnormalInnerVO> time;
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class DetailLimitCountVO {
|
||||
|
||||
private Integer timeSum;
|
||||
private Integer errCount;
|
||||
private List<DetailLimitInnerVO> time;
|
||||
}
|
||||
|
||||
|
||||
@Data
|
||||
public static class DetailLimitInnerVO{
|
||||
|
||||
@@ -134,9 +134,9 @@ public class DataVerifyController extends BaseController {
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/monitorLimitTableDetail")
|
||||
@ApiOperation("弹框-获取稳态告警监测点列表详情")
|
||||
public HttpResult<List<DetailAbnormalVO.DetailLimitInnerVO>> monitorLimitTableDetail(@RequestBody MonitorBaseParam monitorBaseParam){
|
||||
public HttpResult<DetailAbnormalVO.DetailLimitCountVO> monitorLimitTableDetail(@RequestBody MonitorBaseParam monitorBaseParam){
|
||||
String methodDescribe = getMethodDescribe("monitorLimitTableDetail");
|
||||
List<DetailAbnormalVO.DetailLimitInnerVO> list = iDataVerifyService.monitorLimitTableDetail(monitorBaseParam);
|
||||
DetailAbnormalVO.DetailLimitCountVO list = iDataVerifyService.monitorLimitTableDetail(monitorBaseParam);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ public interface IDataVerifyService extends IService<DataVerify> {
|
||||
|
||||
List<DetailAbnormalVO> monitorLimitTable(MonitorBaseParam monitorBaseParam);
|
||||
|
||||
List<DetailAbnormalVO.DetailLimitInnerVO> monitorLimitTableDetail(MonitorBaseParam monitorBaseParam);
|
||||
DetailAbnormalVO.DetailLimitCountVO monitorLimitTableDetail(MonitorBaseParam monitorBaseParam);
|
||||
|
||||
|
||||
DetailAbnormalVO.Assess limitTableDetail(MonitorBaseParam monitorBaseParam);
|
||||
|
||||
@@ -18,6 +18,7 @@ import com.njcn.dataProcess.enums.DataCleanEnum;
|
||||
import com.njcn.dataProcess.param.DataCleanParam;
|
||||
import com.njcn.dataProcess.param.LineCountEvaluateParam;
|
||||
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.PqReasonableRangeDto;
|
||||
import com.njcn.device.biz.enums.DeviceResponseEnum;
|
||||
@@ -30,6 +31,7 @@ import com.njcn.device.pq.mapper.DataVerifyMapper;
|
||||
import com.njcn.device.pq.pojo.param.dataClean.MonitorBaseParam;
|
||||
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.LineDetailDataVO;
|
||||
import com.njcn.device.pq.pojo.vo.dataClean.*;
|
||||
@@ -84,7 +86,6 @@ public class DataVerifyServiceImpl extends ServiceImpl<DataVerifyMapper, DataVer
|
||||
private final DeptLineService deptLineService;
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public VerifyMonitorVO getMonitorVerifyData(MonitorBaseParam monitorBaseParam) {
|
||||
List<String> monitorIds = commTerminalService.getRunMonitorByDept(monitorBaseParam);
|
||||
@@ -238,137 +239,50 @@ public class DataVerifyServiceImpl extends ServiceImpl<DataVerifyMapper, DataVer
|
||||
List<DetailAbnormalVO> result = new ArrayList<>();
|
||||
List<LineDetailDataVO> lineDetailList = lineMapper.getLineDetailDataVO(monitorBaseParam.getMonitorIds());
|
||||
Map<String, LineDetailDataVO> lineDetailMap = lineDetailList.stream().collect(Collectors.toMap(LineDetailDataVO::getLineId, Function.identity()));
|
||||
|
||||
LineCountEvaluateParam lineCountEvaluateParam = new LineCountEvaluateParam();
|
||||
lineCountEvaluateParam.setLineId(monitorBaseParam.getMonitorIds());
|
||||
lineCountEvaluateParam.setStartTime(monitorBaseParam.getSearchBeginTime());
|
||||
lineCountEvaluateParam.setEndTime(monitorBaseParam.getSearchEndTime());
|
||||
List<DataLimitRateDetailDto> dataLimitRateDetailDtoList = dataLimitRateDetailFeignClient.getRawData(lineCountEvaluateParam).getData();
|
||||
Map<LocalDate, List<DataLimitRateDetailDto>> limitMap = dataLimitRateDetailDtoList.stream().collect(Collectors.groupingBy(DataLimitRateDetailDto::getTime));
|
||||
|
||||
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);
|
||||
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);
|
||||
}
|
||||
List<DataLimitTargetDto> dataLimitTargetDtoList = dataLimitTargetFeignClient.getRawData(lineCountEvaluateParam).getData();
|
||||
Map<String, List<DataLimitTargetDto>> limitMap = dataLimitTargetDtoList.stream().filter(it -> (it.getAllTime() > 0 || it.getFlickerAllTime() > 0)).collect(Collectors.groupingBy(DataLimitTargetDto::getLineId));
|
||||
limitMap.forEach((lineId, value) -> {
|
||||
LineDetailDataVO lineInfoVO = lineDetailMap.get(lineId);
|
||||
DetailAbnormalVO detailAbnormalVO = new DetailAbnormalVO();
|
||||
detailAbnormalVO.setMonitorId(lineId);
|
||||
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 {
|
||||
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);
|
||||
}
|
||||
}
|
||||
targetKey = new DetailAbnormalVO.TimeAndTargetKey();
|
||||
targetKey.setDate(dto.getTime().format(DatePattern.NORM_DATE_FORMATTER));
|
||||
targetKey.setTargetKeys(verifyS);
|
||||
targetKeyList.add(targetKey);
|
||||
}
|
||||
|
||||
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.setMonitorId(lineId);
|
||||
detailAbnormalVO.setDate(date.format(DATE_FORMAT));
|
||||
detailAbnormalVO.setMonitorName(lineInfoVO.getLineName());
|
||||
detailAbnormalVO.setBdName(lineInfoVO.getBdName());
|
||||
detailAbnormalVO.setTimeSum(String.valueOf(timeInterval * timeSet.size()));
|
||||
detailAbnormalVO.setTargetKey(monitorBaseParam.getTargetKey());
|
||||
result.add(detailAbnormalVO);
|
||||
}
|
||||
});
|
||||
}
|
||||
detailAbnormalVO.setDateTargetList(targetKeyList);
|
||||
detailAbnormalVO.setMonitorName(lineInfoVO.getLineName());
|
||||
detailAbnormalVO.setBdName(lineInfoVO.getBdName());
|
||||
detailAbnormalVO.setTargetKey(monitorBaseParam.getTargetKey());
|
||||
result.add(detailAbnormalVO);
|
||||
});
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@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<>();
|
||||
LineCountEvaluateParam lineCountEvaluateParam = new LineCountEvaluateParam();
|
||||
lineCountEvaluateParam.setLineId(Collections.singletonList(monitorBaseParam.getMonitorIds().get(0)));
|
||||
@@ -376,7 +290,7 @@ public class DataVerifyServiceImpl extends ServiceImpl<DataVerifyMapper, DataVer
|
||||
lineCountEvaluateParam.setEndTime(monitorBaseParam.getSearchBeginTime());
|
||||
List<DataLimitRateDetailDto> dtoList = dataLimitRateDetailFeignClient.getRawData(lineCountEvaluateParam).getData();
|
||||
if (CollUtil.isEmpty(dtoList)) {
|
||||
return result;
|
||||
return v;
|
||||
}
|
||||
|
||||
DataLimitRateDetailDto dto = dtoList.get(0);
|
||||
@@ -386,7 +300,10 @@ public class DataVerifyServiceImpl extends ServiceImpl<DataVerifyMapper, DataVer
|
||||
} else {
|
||||
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
|
||||
@@ -534,10 +451,12 @@ public class DataVerifyServiceImpl extends ServiceImpl<DataVerifyMapper, DataVer
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}else{
|
||||
PqReasonableRangeDto dto = dataVCode.get(DataCleanEnum.VThd.getCode());
|
||||
DetailAbnormalVO.DetailLimitInnerVO val = reasonAble(uaberrance, dto);
|
||||
assess.setUharmData(NumberUtil.round(val.getVal(), 2).doubleValue());
|
||||
} 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)) {
|
||||
@@ -568,7 +487,7 @@ public class DataVerifyServiceImpl extends ServiceImpl<DataVerifyMapper, DataVer
|
||||
String[] split = val.getTargetName().split("次");
|
||||
try {
|
||||
Class<?> clazz = overLimitDataById.getClass();
|
||||
String methodName = "getInuharm" + split[0];
|
||||
String methodName = "getInuharm" + (int)(Double.valueOf(split[0])+0.5);
|
||||
Method method = clazz.getMethod(methodName);
|
||||
Float value = (Float) method.invoke(overLimitDataById);
|
||||
assess.setInuharmLimit(value);
|
||||
@@ -810,7 +729,12 @@ public class DataVerifyServiceImpl extends ServiceImpl<DataVerifyMapper, DataVer
|
||||
String fieldName = prefix + i + "Overtime";
|
||||
String json = getFieldValueForDetail(dto, fieldName);
|
||||
if (StrUtil.isNotBlank(json)) {
|
||||
result.add(json + SEPARATOR + i);
|
||||
if (end == 16) {
|
||||
result.add(json + SEPARATOR + (i - 0.5));
|
||||
} else {
|
||||
result.add(json + SEPARATOR + i);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1026,7 +950,7 @@ public class DataVerifyServiceImpl extends ServiceImpl<DataVerifyMapper, DataVer
|
||||
PowerQualityIndicatorsVO it = areaMap.get(lineDetail.getLineId());
|
||||
it.setMonitorName(lineDetail.getLineName());
|
||||
it.setStationName(lineDetail.getSubName());
|
||||
if(deptName.containsKey(lineDetail.getLineId())){
|
||||
if (deptName.containsKey(lineDetail.getLineId())) {
|
||||
it.setCity(deptName.get(lineDetail.getLineId()));
|
||||
}
|
||||
it.setDevName(lineDetail.getDeviceName());
|
||||
|
||||
@@ -438,12 +438,17 @@ public class DeviceRunEvaluateServiceImpl implements DeviceRunEvaluateService {
|
||||
//异常率
|
||||
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());
|
||||
List<String> devIdsLine = lineMapper.getDevIdsLine(verifyLine);
|
||||
if (CollUtil.isNotEmpty(devIdsLine)) {
|
||||
return NumberUtil.round(Math.min(devIdsLine.size() * 100.0 / devIds.size(), 100), 2);
|
||||
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) {
|
||||
|
||||
@@ -278,8 +278,16 @@ public class PqDataVerifyBakServiceImpl extends ServiceImpl<PqDataVerifyBakMappe
|
||||
} else if (lineDevGetDTO.getPowerFlag().equals(LineBaseEnum.POWER_FLAG_NOT.getCode())) {
|
||||
temBgName = lineDevGetDTO.getObjName();
|
||||
}
|
||||
List<DetailAbnormalVO.TimeAndTargetKey> targetKeyList = new ArrayList<>();
|
||||
DetailAbnormalVO.TimeAndTargetKey targetKey;
|
||||
DetailAbnormalVO detailAbnormalVO = new DetailAbnormalVO();
|
||||
detailAbnormalVO.setDateList(value.stream().map(x -> x.getTimeId().format(DatePattern.NORM_DATE_FORMATTER)).collect(Collectors.toList()));
|
||||
for (PqDataVerifyBak pqDataVerifyBak : value) {
|
||||
targetKey = new DetailAbnormalVO.TimeAndTargetKey();
|
||||
targetKey.setDate(pqDataVerifyBak.getTimeId().format(DatePattern.NORM_DATE_FORMATTER));
|
||||
targetKey.setTargetKeys(getAbnormalTarget(Arrays.asList(pqDataVerifyBak)).stream().filter(x->x.getIds().size()>0).collect(Collectors.toList()));
|
||||
targetKeyList.add(targetKey);
|
||||
}
|
||||
detailAbnormalVO.setDateTargetList(targetKeyList);
|
||||
detailAbnormalVO.setMonitorName(lineDevGetDTO.getLineName());
|
||||
detailAbnormalVO.setBdName(temBgName);
|
||||
detailAbnormalVO.setMonitorId(lineDevGetDTO.getLineId());
|
||||
@@ -304,7 +312,8 @@ public class PqDataVerifyBakServiceImpl extends ServiceImpl<PqDataVerifyBakMappe
|
||||
.in(PqDataVerifyBak::getLineId, monitorBaseParam.getMonitorIds());
|
||||
|
||||
List<PqDataVerifyBak> pqDataVerifyBak = this.list(lambdaQueryWrapper);
|
||||
Integer[] errorTimeCount = {0};
|
||||
//index[0] 总异常时间 index[1]指标异常时间
|
||||
Integer[] errorTimeCount = {0, 0};
|
||||
Integer[] errAllCount = {0};
|
||||
for (PqDataVerifyBak dataVerifyBak : pqDataVerifyBak) {
|
||||
try (InputStream fileStream = fileStorageUtil.getFileStream(dataVerifyBak.getPath())) {
|
||||
@@ -316,17 +325,16 @@ public class PqDataVerifyBakServiceImpl extends ServiceImpl<PqDataVerifyBakMappe
|
||||
}else{
|
||||
if (StrUtil.isNotBlank(monitorBaseParam.getTargetKey())) {
|
||||
if (targetJson.containsKey(monitorBaseParam.getTargetKey())) {
|
||||
resultDeal(dtoMap, monitorBaseParam.getTargetKey(), targetJson, result, dataVerifyBak.getTimeId().toString(), errAllCount);
|
||||
resultDeal(dtoMap, monitorBaseParam.getTargetKey(), targetJson, result, dataVerifyBak.getTimeId().toString(), errorTimeCount, errAllCount);
|
||||
}
|
||||
} else {
|
||||
String tarKey = "";
|
||||
for (Map.Entry<String, PqReasonableRangeDto> entry : dtoMap.entrySet()) {
|
||||
String key = entry.getKey();
|
||||
if (targetJson.containsKey(key)) {
|
||||
tarKey = key;
|
||||
resultDeal(dtoMap, key, targetJson, result, dataVerifyBak.getTimeId().toString(), errorTimeCount, errAllCount);
|
||||
}
|
||||
}
|
||||
resultDeal(dtoMap, tarKey, targetJson, result, dataVerifyBak.getTimeId().toString(), errAllCount);
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -336,7 +344,7 @@ public class PqDataVerifyBakServiceImpl extends ServiceImpl<PqDataVerifyBakMappe
|
||||
}
|
||||
// 排序实现
|
||||
DetailAbnormalVO.DetailAbnormalCountVO info = new DetailAbnormalVO.DetailAbnormalCountVO();
|
||||
info.setTimeSum(errorTimeCount[0]);
|
||||
info.setTimeSum(StrUtil.isBlank(monitorBaseParam.getTargetKey()) ? errorTimeCount[0] : errorTimeCount[1]);
|
||||
info.setErrCount(errAllCount[0]);
|
||||
info.setTime(result.stream()
|
||||
.sorted(Comparator.comparing(DetailAbnormalVO.DetailAbnormalInnerVO::getTargetName)
|
||||
@@ -371,13 +379,14 @@ public class PqDataVerifyBakServiceImpl extends ServiceImpl<PqDataVerifyBakMappe
|
||||
* 处理json对象中list数组
|
||||
*/
|
||||
|
||||
private void resultDeal(Map<String, PqReasonableRangeDto> dtoMap, String targetKey, JSONObject targetJson, List<DetailAbnormalVO.DetailAbnormalInnerVO> result, String date, Integer[] errorCounts) {
|
||||
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);
|
||||
JSONArray innerJson = targetJson.getJSONArray(targetKey);
|
||||
innerJson.forEach(oo -> {
|
||||
JSONObject jsonObjectTem = (JSONObject) oo;
|
||||
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");
|
||||
List<DetailAbnormalVO.DetailLimitInnerVO> temList = new ArrayList<>();
|
||||
list.forEach(listItem -> {
|
||||
|
||||
@@ -224,7 +224,7 @@ public class SupervisionTempLineDebugPOServiceImpl extends ServiceImpl<Supervisi
|
||||
queryWrapper.in("supervision_temp_line_report.org_id", data);
|
||||
}
|
||||
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()
|
||||
.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
|
||||
.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()
|
||||
.eq("supervision_temp_line_debug.create_by", RequestUtil.getUserIndex())
|
||||
);
|
||||
|
||||
@@ -69,10 +69,7 @@ public class InstanceUtil {
|
||||
throw new BusinessException(SupervisionResponseEnum.EXISTENCE_OR_NOT);
|
||||
}
|
||||
//先判断是否是删除管理员,如果是就有全部删除权限,否则就只能删除带提交审批的
|
||||
String userRole = RequestUtil.getUserRole();
|
||||
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());
|
||||
List<String> delete = deleteUser();
|
||||
//如果为空则需要判断信息,先判断全部数据是否都是自己创建的,然后判断是否是都是带提交数据
|
||||
if (CollUtil.isEmpty(delete)) {
|
||||
long count = createBy.stream().filter(x -> !userId.equals(x)).count();
|
||||
@@ -91,10 +88,7 @@ public class InstanceUtil {
|
||||
List<Integer> info =new ArrayList<>();
|
||||
info.add(BpmTaskStatusEnum.RUNNING.getStatus());
|
||||
info.add(BpmTaskStatusEnum.APPROVE.getStatus());
|
||||
String userRole = RequestUtil.getUserRole();
|
||||
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());
|
||||
List<String> delete = deleteUser();
|
||||
//删除管理员默认能删除全部数据
|
||||
if (CollUtil.isNotEmpty(delete)) {
|
||||
info.clear();
|
||||
@@ -102,4 +96,24 @@ public class InstanceUtil {
|
||||
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());
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user