删除校验

This commit is contained in:
hzj
2024-12-05 15:19:24 +08:00
parent 62db637bdd
commit 3f56fa0de9

View File

@@ -611,81 +611,81 @@ public class CarryCapacityServiceImpl implements CarryCapacityService {
List<CarryCapcityData> dataHarmPowerq2List = excelDataDTO.getDataHarmPowerQ2List(); List<CarryCapcityData> dataHarmPowerq2List = excelDataDTO.getDataHarmPowerQ2List();
List<CarryCapcityData> dataHarmPoweruList = excelDataDTO.getDataHarmPowerU2List(); List<CarryCapcityData> dataHarmPoweruList = excelDataDTO.getDataHarmPowerU2List();
//数据校验 // //数据校验
if (CollectionUtil.isEmpty(dataHarmPowerpList)) { // if (CollectionUtil.isEmpty(dataHarmPowerpList)) {
throw new BusinessException(AdvanceResponseEnum.DATA_NOT_FOUND); // throw new BusinessException(AdvanceResponseEnum.DATA_NOT_FOUND);
} else { // } else {
//
if (checkData(dataHarmPowerpList, startDate, endDate, timeInterval)) { // if (checkData(dataHarmPowerpList, startDate, endDate, timeInterval)) {
//
throw new BusinessException(AdvanceResponseEnum.DATA_NOT_FOUND); // throw new BusinessException(AdvanceResponseEnum.DATA_NOT_FOUND);
} // }
} // }
linearInterpolation(dataHarmPowerpList); // linearInterpolation(dataHarmPowerpList);
//
//数据校验 // //数据校验
if (CollectionUtil.isEmpty(dataHarmPowerp2List)) { // if (CollectionUtil.isEmpty(dataHarmPowerp2List)) {
throw new BusinessException(AdvanceResponseEnum.DATA_NOT_FOUND); // throw new BusinessException(AdvanceResponseEnum.DATA_NOT_FOUND);
} else { // } else {
//
if (checkData(dataHarmPowerp2List, startDate2, endDate2, timeInterval)) { // if (checkData(dataHarmPowerp2List, startDate2, endDate2, timeInterval)) {
//
throw new BusinessException(AdvanceResponseEnum.DATA_NOT_FOUND); // throw new BusinessException(AdvanceResponseEnum.DATA_NOT_FOUND);
} // }
} // }
linearInterpolation(dataHarmPowerp2List); // linearInterpolation(dataHarmPowerp2List);
//
//数据校验 // //数据校验
if (CollectionUtil.isEmpty(dataHarmPowerqList)) { // if (CollectionUtil.isEmpty(dataHarmPowerqList)) {
throw new BusinessException(AdvanceResponseEnum.DATA_NOT_FOUND); // throw new BusinessException(AdvanceResponseEnum.DATA_NOT_FOUND);
} else { // } else {
//
if (checkData(dataHarmPowerqList, startDate, endDate, timeInterval)) { // if (checkData(dataHarmPowerqList, startDate, endDate, timeInterval)) {
//
throw new BusinessException(AdvanceResponseEnum.DATA_NOT_FOUND); // throw new BusinessException(AdvanceResponseEnum.DATA_NOT_FOUND);
} // }
} // }
linearInterpolation(dataHarmPowerqList); // linearInterpolation(dataHarmPowerqList);
//
//数据校验 // //数据校验
if (CollectionUtil.isEmpty(dataHarmPowerq2List)) { // if (CollectionUtil.isEmpty(dataHarmPowerq2List)) {
throw new BusinessException(AdvanceResponseEnum.DATA_NOT_FOUND); // throw new BusinessException(AdvanceResponseEnum.DATA_NOT_FOUND);
} else { // } else {
//
if (checkData(dataHarmPowerq2List, startDate2, endDate2, timeInterval)) { // if (checkData(dataHarmPowerq2List, startDate2, endDate2, timeInterval)) {
//
throw new BusinessException(AdvanceResponseEnum.DATA_NOT_FOUND); // throw new BusinessException(AdvanceResponseEnum.DATA_NOT_FOUND);
} // }
} // }
linearInterpolation(dataHarmPowerq2List); // linearInterpolation(dataHarmPowerq2List);
//
//数据校验 // //数据校验
if (CollectionUtil.isEmpty(dataHarmPoweruList)) { // if (CollectionUtil.isEmpty(dataHarmPoweruList)) {
throw new BusinessException(AdvanceResponseEnum.DATA_NOT_FOUND); // throw new BusinessException(AdvanceResponseEnum.DATA_NOT_FOUND);
} else { // } else {
//
if (checkData(dataHarmPoweruList, startDate2, endDate2, timeInterval)) { // if (checkData(dataHarmPoweruList, startDate2, endDate2, timeInterval)) {
//
throw new BusinessException(AdvanceResponseEnum.DATA_NOT_FOUND); // throw new BusinessException(AdvanceResponseEnum.DATA_NOT_FOUND);
} // }
} // }
linearInterpolation(dataHarmPoweruList); // linearInterpolation(dataHarmPoweruList);
//
if (CollectionUtil.isEmpty(dataiList)) { // if (CollectionUtil.isEmpty(dataiList)) {
throw new BusinessException(AdvanceResponseEnum.DATA_NOT_FOUND); // throw new BusinessException(AdvanceResponseEnum.DATA_NOT_FOUND);
} else { // } else {
List<CarryCapcityData> iList = dataiList.stream().map(temp -> { // List<CarryCapcityData> iList = dataiList.stream().map(temp -> {
CarryCapcityData carryCapcityData = new CarryCapcityData(); // CarryCapcityData carryCapcityData = new CarryCapcityData();
BeanUtils.copyProperties(temp, carryCapcityData); // BeanUtils.copyProperties(temp, carryCapcityData);
carryCapcityData.setValue(temp.getI2()); // carryCapcityData.setValue(temp.getI2());
return carryCapcityData; // return carryCapcityData;
}).collect(Collectors.toList()); // }).collect(Collectors.toList());
if (checkData(iList, startDate, endDate, timeInterval)) { // if (checkData(iList, startDate, endDate, timeInterval)) {
//
throw new BusinessException(AdvanceResponseEnum.DATA_NOT_FOUND); // throw new BusinessException(AdvanceResponseEnum.DATA_NOT_FOUND);
} // }
} // }
linearInterpolationI(dataiList); // linearInterpolationI(dataiList);
// 存入redis // 存入redis
redisUtil.saveByKey(lineId + "#" + LocalDateTimeUtil.format(startDate, formatter) + "#" + LocalDateTimeUtil.format(endDate, formatter) + "#" + "P", redisUtil.saveByKey(lineId + "#" + LocalDateTimeUtil.format(startDate, formatter) + "#" + LocalDateTimeUtil.format(endDate, formatter) + "#" + "P",