Commit 67a5077c authored by ZWT's avatar ZWT

feat(吉林演示): 松原

1.修改天气数据抽取定时任务,解决部分历史数据丢失问题;

BREAKING CHANGE: 无

Closes 无

[skip ci]
parent 6c8216c0
...@@ -427,11 +427,15 @@ public class BaseWeatherCloudServiceImpl implements IBaseWeatherCloudService { ...@@ -427,11 +427,15 @@ public class BaseWeatherCloudServiceImpl implements IBaseWeatherCloudService {
context.getLogger().info("------ weatherDataProcess weatherBureauDataProcess begin ------"); context.getLogger().info("------ weatherDataProcess weatherBureauDataProcess begin ------");
List<String> deleteList = new ArrayList<>(32); List<String> deleteList = new ArrayList<>(32);
List<WeatherBureauDataView> batchList = new ArrayList<>(13312); List<WeatherBureauDataView> batchList = new ArrayList<>(13312);
DateTime create = DateUtil.offsetMinute(DateTime.of(DateUtil.now(), "yyyy-MM-dd HH"), -5); DateTime create = DateUtil.date();
DateTime end = DateUtil.offsetDay(create, 16); DateTime end = DateUtil.offsetDay(create, 16);
int count = 0; int count = 0;
for (JSONObject jsonObject : jsonObjectList) { for (JSONObject jsonObject : jsonObjectList) {
this.dataFractionation(jsonObject, deleteList, batchList); this.dataFractionation(jsonObject, deleteList, batchList);
if (count == 0) {
batchList.sort(Comparator.comparing(WeatherBureauDataView::getDataTime));
create = DateUtil.offsetMinute(batchList.get(0).getDataTime(), -5);
}
count++; count++;
if (BusinessConstant.TEN.equals(count)) { if (BusinessConstant.TEN.equals(count)) {
this.deleteWeatherBureauList(context, deleteList, create, end); this.deleteWeatherBureauList(context, deleteList, create, end);
...@@ -577,7 +581,7 @@ public class BaseWeatherCloudServiceImpl implements IBaseWeatherCloudService { ...@@ -577,7 +581,7 @@ public class BaseWeatherCloudServiceImpl implements IBaseWeatherCloudService {
context.getLogger().info("------ weatherDataProcess dataFractionation"); context.getLogger().info("------ weatherDataProcess dataFractionation");
List<String> deleteList = new ArrayList<>(32); List<String> deleteList = new ArrayList<>(32);
List<WindPredictionFutureView> batchList = new ArrayList<>(13312); List<WindPredictionFutureView> batchList = new ArrayList<>(13312);
DateTime create = DateUtil.offsetMinute(DateTime.of(DateUtil.now(), "yyyy-MM-dd HH"), -5); DateTime create = DateUtil.date();
DateTime end = DateUtil.offsetDay(create, 16); DateTime end = DateUtil.offsetDay(create, 16);
//按照cityCode分组 //按照cityCode分组
Map<String, List<BaseWindTurbineView>> turbineMap = turbineList.stream() Map<String, List<BaseWindTurbineView>> turbineMap = turbineList.stream()
...@@ -585,6 +589,10 @@ public class BaseWeatherCloudServiceImpl implements IBaseWeatherCloudService { ...@@ -585,6 +589,10 @@ public class BaseWeatherCloudServiceImpl implements IBaseWeatherCloudService {
int count = 0; int count = 0;
for (JSONObject jsonObject : jsonObjectList) { for (JSONObject jsonObject : jsonObjectList) {
this.dataFractionation(jsonObject, turbineMap, deleteList, batchList); this.dataFractionation(jsonObject, turbineMap, deleteList, batchList);
if (count == 0) {
batchList.sort(Comparator.comparing(WindPredictionFutureView::getDataTime));
create = DateUtil.offsetMinute(batchList.get(0).getDataTime(), -5);
}
count++; count++;
if (BusinessConstant.FIVE.equals(count)) { if (BusinessConstant.FIVE.equals(count)) {
this.deleteWindTurbineList(context, deleteList, create, end); this.deleteWindTurbineList(context, deleteList, create, end);
...@@ -806,7 +814,7 @@ public class BaseWeatherCloudServiceImpl implements IBaseWeatherCloudService { ...@@ -806,7 +814,7 @@ public class BaseWeatherCloudServiceImpl implements IBaseWeatherCloudService {
context.getLogger().info("------ weatherDataProcess dataFractionation"); context.getLogger().info("------ weatherDataProcess dataFractionation");
List<PlantPredictedPowerDataEnt> deleteList = new ArrayList<>(32); List<PlantPredictedPowerDataEnt> deleteList = new ArrayList<>(32);
List<PlantPredictedPowerDataEnt> batchList = new ArrayList<>(13312); List<PlantPredictedPowerDataEnt> batchList = new ArrayList<>(13312);
DateTime create = DateUtil.offsetMinute(DateTime.of(DateUtil.now(), "yyyy-MM-dd HH"), -5); DateTime create = DateUtil.date();
DateTime end = DateUtil.offsetDay(create, 16); DateTime end = DateUtil.offsetDay(create, 16);
//按照cityCode分组 //按照cityCode分组
Map<String, List<BasePhotovoltaicPlantView>> plantMap = plantList.stream() Map<String, List<BasePhotovoltaicPlantView>> plantMap = plantList.stream()
...@@ -814,6 +822,10 @@ public class BaseWeatherCloudServiceImpl implements IBaseWeatherCloudService { ...@@ -814,6 +822,10 @@ public class BaseWeatherCloudServiceImpl implements IBaseWeatherCloudService {
int count = 0; int count = 0;
for (JSONObject jsonObject : jsonObjectList) { for (JSONObject jsonObject : jsonObjectList) {
this.dataFractionation(jsonObject, plantMap, deleteList, create, end, batchList); this.dataFractionation(jsonObject, plantMap, deleteList, create, end, batchList);
if (count == 0) {
batchList.sort(Comparator.comparing(PlantPredictedPowerDataEnt::getDataDate));
create = DateUtil.offsetMinute(DateUtil.parse(batchList.get(0).getDataDate()), -5);
}
count++; count++;
if (BusinessConstant.FIVE.equals(count)) { if (BusinessConstant.FIVE.equals(count)) {
this.deletePlantPredictedPowerList(context, deleteList); this.deletePlantPredictedPowerList(context, deleteList);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment