异常数据功能调整
This commit is contained in:
@@ -16,7 +16,9 @@ import java.time.LocalDateTime;
|
|||||||
@Data
|
@Data
|
||||||
@ApiModel
|
@ApiModel
|
||||||
public class LineDetailDataVO {
|
public class LineDetailDataVO {
|
||||||
|
|
||||||
private String lineId;
|
private String lineId;
|
||||||
|
|
||||||
@ApiModelProperty(name = "id",value = "监测点序号")
|
@ApiModelProperty(name = "id",value = "监测点序号")
|
||||||
private Integer id;
|
private Integer id;
|
||||||
|
|
||||||
@@ -83,6 +85,9 @@ public class LineDetailDataVO {
|
|||||||
@ApiModelProperty(name = "dealCapacity",value = "用户协议容量(MVA)")
|
@ApiModelProperty(name = "dealCapacity",value = "用户协议容量(MVA)")
|
||||||
private Float dealCapacity;
|
private Float dealCapacity;
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "powerFlag",value = "电网标志(0-电网侧;1-非电网侧)")
|
||||||
|
private Integer powerFlag;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 测量间隔(1-10分钟)
|
* 测量间隔(1-10分钟)
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -16,6 +16,8 @@ public class DetailAbnormalVO {
|
|||||||
|
|
||||||
private String monitorName;
|
private String monitorName;
|
||||||
|
|
||||||
|
private String bdName;
|
||||||
|
|
||||||
private String timeSum;
|
private String timeSum;
|
||||||
|
|
||||||
private String errCount;
|
private String errCount;
|
||||||
|
|||||||
@@ -456,6 +456,9 @@ public interface LineMapper extends BaseMapper<Line> {
|
|||||||
*/
|
*/
|
||||||
List<LineDevGetDTO> getMonitorListDetail(@Param("monitorIds") List<String> monitorIds);
|
List<LineDevGetDTO> getMonitorListDetail(@Param("monitorIds") List<String> monitorIds);
|
||||||
|
|
||||||
|
|
||||||
|
List<LineDetailDataVO> getLineDetailDataVO(@Param("monitorIds") List<String> monitorIds);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据条件进行监测筛选出监测点id
|
* 根据条件进行监测筛选出监测点id
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -1202,6 +1202,26 @@
|
|||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
<select id="getLineDetailDataVO" resultType="com.njcn.device.pq.pojo.vo.LineDetailDataVO">
|
||||||
|
select line.id lineId,
|
||||||
|
line.name lineName,
|
||||||
|
dev.id devId,
|
||||||
|
station.name bdName,
|
||||||
|
lineDetail.Time_Interval as timeInterval,
|
||||||
|
lineDetail.obj_name as objName,
|
||||||
|
lineDetail.Power_Flag as powerFlag
|
||||||
|
from pq_line line
|
||||||
|
inner join pq_line_detail lineDetail on line.id = lineDetail.id
|
||||||
|
inner join pq_line subv on line.pid = subv.id
|
||||||
|
inner join pq_line dev on subv.pid = dev.id
|
||||||
|
inner join pq_line station on dev.pid = station.id
|
||||||
|
where line.id in
|
||||||
|
<foreach collection="monitorIds" item="item" open="(" close=")" separator=",">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
<select id="getLineByIDs" resultType="java.lang.String">
|
<select id="getLineByIDs" resultType="java.lang.String">
|
||||||
SELECT DISTINCT
|
SELECT DISTINCT
|
||||||
line.id
|
line.id
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ import com.njcn.device.pq.pojo.po.DataVerify;
|
|||||||
import com.njcn.device.pq.pojo.po.Line;
|
import com.njcn.device.pq.pojo.po.Line;
|
||||||
import com.njcn.device.pq.pojo.po.LineDetail;
|
import com.njcn.device.pq.pojo.po.LineDetail;
|
||||||
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.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;
|
||||||
@@ -257,8 +258,8 @@ public class DataVerifyServiceImpl extends ServiceImpl<DataVerifyMapper, DataVer
|
|||||||
@Override
|
@Override
|
||||||
public List<DetailAbnormalVO> monitorLimitTable(MonitorBaseParam monitorBaseParam) {
|
public List<DetailAbnormalVO> monitorLimitTable(MonitorBaseParam monitorBaseParam) {
|
||||||
List<DetailAbnormalVO> result = new ArrayList<>();
|
List<DetailAbnormalVO> result = new ArrayList<>();
|
||||||
List<LineDevGetDTO> lineDetailList = lineMapper.getMonitorListDetail(monitorBaseParam.getMonitorIds());
|
List<LineDetailDataVO> lineDetailList = lineMapper.getLineDetailDataVO(monitorBaseParam.getMonitorIds());
|
||||||
Map<String, LineDevGetDTO> lineDetailMap = lineDetailList.stream().collect(Collectors.toMap(LineDevGetDTO::getPointId, 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());
|
||||||
@@ -270,7 +271,7 @@ public class DataVerifyServiceImpl extends ServiceImpl<DataVerifyMapper, DataVer
|
|||||||
limitMap.forEach((date, list) -> {
|
limitMap.forEach((date, list) -> {
|
||||||
Map<String, DataLimitRateDetailDto> map = list.stream().collect(Collectors.toMap(DataLimitRateDetailDto::getLineId, Function.identity()));
|
Map<String, DataLimitRateDetailDto> map = list.stream().collect(Collectors.toMap(DataLimitRateDetailDto::getLineId, Function.identity()));
|
||||||
map.forEach((lineId, line) -> {
|
map.forEach((lineId, line) -> {
|
||||||
LineDevGetDTO lineInfoVO = lineDetailMap.get(lineId);
|
LineDetailDataVO lineInfoVO = lineDetailMap.get(lineId);
|
||||||
Integer timeInterval = lineInfoVO.getTimeInterval();
|
Integer timeInterval = lineInfoVO.getTimeInterval();
|
||||||
Set<String> timeSet = new HashSet<>();
|
Set<String> timeSet = new HashSet<>();
|
||||||
List<String> specialTargetList = new ArrayList<>();
|
List<String> specialTargetList = new ArrayList<>();
|
||||||
@@ -364,20 +365,25 @@ public class DataVerifyServiceImpl extends ServiceImpl<DataVerifyMapper, DataVer
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
if(StrUtil.isNotBlank(jonsStr)){
|
||||||
JSONArray jsonArray = new JSONArray(jonsStr);
|
JSONArray jsonArray = new JSONArray(jonsStr);
|
||||||
List<JsonBaseVO> jsonBaseVOList = jsonArray.toList(JsonBaseVO.class);
|
List<JsonBaseVO> jsonBaseVOList = jsonArray.toList(JsonBaseVO.class);
|
||||||
jsonBaseVOList.forEach(it -> {
|
jsonBaseVOList.forEach(it -> {
|
||||||
timeSet.addAll(Arrays.asList(it.getTime().split(StrUtil.COMMA)));
|
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));
|
detailAbnormalVO.setDate(date.format(DATE_FORMAT));
|
||||||
detailAbnormalVO.setMonitorName(lineInfoVO.getPointName());
|
detailAbnormalVO.setMonitorName(lineInfoVO.getLineName());
|
||||||
detailAbnormalVO.setTimeSum("");
|
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;
|
||||||
@@ -427,7 +433,7 @@ public class DataVerifyServiceImpl extends ServiceImpl<DataVerifyMapper, DataVer
|
|||||||
case FLICKER:
|
case FLICKER:
|
||||||
jsonArray = new JSONArray(dto.getFlickerOvertime());
|
jsonArray = new JSONArray(dto.getFlickerOvertime());
|
||||||
break;
|
break;
|
||||||
case phase_Voltage:
|
case PHASE_VOLTAGE:
|
||||||
jsonArray = new JSONArray(dto.getUbalanceOvertime());
|
jsonArray = new JSONArray(dto.getUbalanceOvertime());
|
||||||
break;
|
break;
|
||||||
case FREQUENCY_DEV:
|
case FREQUENCY_DEV:
|
||||||
|
|||||||
@@ -18,14 +18,17 @@ 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.biz.enums.DeviceResponseEnum;
|
import com.njcn.device.biz.enums.DeviceResponseEnum;
|
||||||
|
import com.njcn.device.biz.enums.LineFlagEnum;
|
||||||
import com.njcn.device.biz.pojo.dto.LineDevGetDTO;
|
import com.njcn.device.biz.pojo.dto.LineDevGetDTO;
|
||||||
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.mapper.LineMapper;
|
import com.njcn.device.pq.mapper.LineMapper;
|
||||||
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.DataVerify;
|
import com.njcn.device.pq.pojo.po.DataVerify;
|
||||||
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.dataClean.DetailAbnormalVO;
|
import com.njcn.device.pq.pojo.vo.dataClean.DetailAbnormalVO;
|
||||||
import com.njcn.device.pq.pojo.vo.dataClean.PowerQualityIndicatorsVO;
|
import com.njcn.device.pq.pojo.vo.dataClean.PowerQualityIndicatorsVO;
|
||||||
import com.njcn.device.pq.pojo.vo.dataClean.VerifyMonitorVO;
|
import com.njcn.device.pq.pojo.vo.dataClean.VerifyMonitorVO;
|
||||||
@@ -184,10 +187,9 @@ public class PqDataVerifyBakServiceImpl extends ServiceImpl<PqDataVerifyBakMappe
|
|||||||
throw new BusinessException("targetKey异常参数!");
|
throw new BusinessException("targetKey异常参数!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//查询台账
|
//查询台账
|
||||||
List<LineDevGetDTO> lineDetailList = lineMapper.getMonitorListDetail(monitorBaseParam.getMonitorIds());
|
List<LineDetailDataVO> lineDetailList = lineMapper.getLineDetailDataVO(monitorBaseParam.getMonitorIds());
|
||||||
Map<String, LineDevGetDTO> lineDetailMap = lineDetailList.stream().collect(Collectors.toMap(LineDevGetDTO::getPointId, Function.identity()));
|
Map<String, LineDetailDataVO> lineDetailMap = lineDetailList.stream().collect(Collectors.toMap(LineDetailDataVO::getLineId, Function.identity()));
|
||||||
|
|
||||||
LambdaQueryWrapper<PqDataVerifyBak> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<PqDataVerifyBak> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
lambdaQueryWrapper.between(PqDataVerifyBak::getTimeId, DateUtil.beginOfDay(DateUtil.parse(monitorBaseParam.getSearchBeginTime())),
|
lambdaQueryWrapper.between(PqDataVerifyBak::getTimeId, DateUtil.beginOfDay(DateUtil.parse(monitorBaseParam.getSearchBeginTime())),
|
||||||
@@ -216,7 +218,6 @@ public class PqDataVerifyBakServiceImpl extends ServiceImpl<PqDataVerifyBakMappe
|
|||||||
case Param.vl_dev:
|
case Param.vl_dev:
|
||||||
lambdaQueryWrapper.eq(PqDataVerifyBak::getVlDev,1);
|
lambdaQueryWrapper.eq(PqDataVerifyBak::getVlDev,1);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Param.rms_i:
|
case Param.rms_i:
|
||||||
lambdaQueryWrapper.eq(PqDataVerifyBak::getIRms,1);
|
lambdaQueryWrapper.eq(PqDataVerifyBak::getIRms,1);
|
||||||
break;
|
break;
|
||||||
@@ -269,6 +270,13 @@ public class PqDataVerifyBakServiceImpl extends ServiceImpl<PqDataVerifyBakMappe
|
|||||||
}
|
}
|
||||||
List<PqDataVerifyBak> dataVerifyList = this.list(lambdaQueryWrapper);
|
List<PqDataVerifyBak> dataVerifyList = this.list(lambdaQueryWrapper);
|
||||||
for (PqDataVerifyBak pqDataVerifyBak : dataVerifyList) {
|
for (PqDataVerifyBak pqDataVerifyBak : dataVerifyList) {
|
||||||
|
LineDetailDataVO lineDevGetDTO = lineDetailMap.get(pqDataVerifyBak.getLineId());
|
||||||
|
String temBgName = "";
|
||||||
|
if(lineDevGetDTO.getPowerFlag().equals(LineBaseEnum.POWER_FLAG.getCode())){
|
||||||
|
temBgName = lineDevGetDTO.getBdName();
|
||||||
|
}else if(lineDevGetDTO.getPowerFlag().equals(LineBaseEnum.POWER_FLAG_NOT.getCode())) {
|
||||||
|
temBgName = lineDevGetDTO.getObjName();
|
||||||
|
}
|
||||||
try (InputStream fileStream = fileStorageUtil.getFileStream(pqDataVerifyBak.getPath())) {
|
try (InputStream fileStream = fileStorageUtil.getFileStream(pqDataVerifyBak.getPath())) {
|
||||||
JSONArray jsonArray = new JSONArray(new JSONTokener(fileStream, new JSONConfig()));
|
JSONArray jsonArray = new JSONArray(new JSONTokener(fileStream, new JSONConfig()));
|
||||||
String[] errorTimeCount = {"0"};
|
String[] errorTimeCount = {"0"};
|
||||||
@@ -324,22 +332,22 @@ public class PqDataVerifyBakServiceImpl extends ServiceImpl<PqDataVerifyBakMappe
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
DetailAbnormalVO detailAbnormalVO = new DetailAbnormalVO();
|
DetailAbnormalVO detailAbnormalVO = new DetailAbnormalVO();
|
||||||
LineDevGetDTO lineDevGetDTO = lineDetailMap.get(pqDataVerifyBak.getLineId());
|
|
||||||
detailAbnormalVO.setTimeSum(errorTimeCount[0]);
|
detailAbnormalVO.setTimeSum(errorTimeCount[0]);
|
||||||
detailAbnormalVO.setDate(pqDataVerifyBak.getTimeId().format(DateTimeFormatter.ofPattern(DatePattern.NORM_DATE_PATTERN)));
|
detailAbnormalVO.setDate(pqDataVerifyBak.getTimeId().format(DateTimeFormatter.ofPattern(DatePattern.NORM_DATE_PATTERN)));
|
||||||
detailAbnormalVO.setMonitorName(lineDevGetDTO.getPointName());
|
detailAbnormalVO.setMonitorName(lineDevGetDTO.getLineName());
|
||||||
detailAbnormalVO.setMonitorId(lineDevGetDTO.getPointId());
|
detailAbnormalVO.setBdName(temBgName);
|
||||||
|
detailAbnormalVO.setMonitorId(lineDevGetDTO.getLineId());
|
||||||
detailAbnormalVO.setTargetKey(monitorBaseParam.getTargetKey());
|
detailAbnormalVO.setTargetKey(monitorBaseParam.getTargetKey());
|
||||||
detailAbnormalVO.setErrCount(errAllCount[0].toString());
|
detailAbnormalVO.setErrCount(errAllCount[0].toString());
|
||||||
result.add(detailAbnormalVO);
|
result.add(detailAbnormalVO);
|
||||||
} catch (BusinessException b){
|
} catch (BusinessException b){
|
||||||
//文件为空时候的特殊处理
|
//文件为空时候的特殊处理
|
||||||
DetailAbnormalVO detailAbnormalVO = new DetailAbnormalVO();
|
DetailAbnormalVO detailAbnormalVO = new DetailAbnormalVO();
|
||||||
LineDevGetDTO lineDevGetDTO = lineDetailMap.get(pqDataVerifyBak.getLineId());
|
|
||||||
detailAbnormalVO.setTimeSum("/");
|
detailAbnormalVO.setTimeSum("/");
|
||||||
detailAbnormalVO.setDate(pqDataVerifyBak.getTimeId().format(DateTimeFormatter.ofPattern(DatePattern.NORM_DATE_PATTERN)));
|
detailAbnormalVO.setDate(pqDataVerifyBak.getTimeId().format(DateTimeFormatter.ofPattern(DatePattern.NORM_DATE_PATTERN)));
|
||||||
detailAbnormalVO.setMonitorName(lineDevGetDTO.getPointName());
|
detailAbnormalVO.setMonitorName(lineDevGetDTO.getLineName());
|
||||||
detailAbnormalVO.setMonitorId(lineDevGetDTO.getPointId());
|
detailAbnormalVO.setBdName(temBgName);
|
||||||
|
detailAbnormalVO.setMonitorId(lineDevGetDTO.getLineId());
|
||||||
detailAbnormalVO.setTargetKey(monitorBaseParam.getTargetKey());
|
detailAbnormalVO.setTargetKey(monitorBaseParam.getTargetKey());
|
||||||
result.add(detailAbnormalVO);
|
result.add(detailAbnormalVO);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|||||||
Reference in New Issue
Block a user