|
|
@@ -401,15 +401,11 @@ public class AutoTaskServiceImpl implements AutoTaskService {
|
|
|
fhzgAutoTaskPlan.setCreateTime(now);
|
|
|
autoTaskPlanService.save(fhzgAutoTaskPlan);
|
|
|
//查询对应地市的线路
|
|
|
- List<String> contactFeederList = autoTaskPlanService.getContactFeederList(cityCode);
|
|
|
- List<String> haveStartKgFeederList = autoTaskPlanService.getHaveStartKgFeederList(cityCode);
|
|
|
+ List<String> haveStartKgAndContactFeederList = autoTaskPlanService.getHaveStartKgAndContactFeederList(cityCode);
|
|
|
List<DwdShbDsFeederBase> feederBaseList = autoTaskPlanService.getFeederInfoByCityCode(cityCode);
|
|
|
Map<String, DwdShbDsFeederBase> feederSwitchBaseMap = feederBaseList.stream().collect(Collectors.toMap(DwdShbDsFeederBase::getPsrId, i -> i));
|
|
|
-
|
|
|
- Set<String> haveStartKgAndContactFeederSet = new HashSet<>(haveStartKgFeederList);
|
|
|
- haveStartKgAndContactFeederSet.addAll(contactFeederList);
|
|
|
List<FhzgAutoTaskPlanDetail> detailList = new ArrayList<>();
|
|
|
- haveStartKgAndContactFeederSet.forEach(i -> {
|
|
|
+ haveStartKgAndContactFeederList.forEach(i -> {
|
|
|
DwdShbDsFeederBase dwdShbDsFeederBase = feederSwitchBaseMap.get(i);
|
|
|
FhzgAutoTaskPlanDetail fhzgAutoTaskPlanDetail = new FhzgAutoTaskPlanDetail();
|
|
|
fhzgAutoTaskPlanDetail.setTaskId(snowflakeNextId);
|
|
|
@@ -430,7 +426,7 @@ public class AutoTaskServiceImpl implements AutoTaskService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- @Scheduled(cron = "0 0/5 * * * *")
|
|
|
+ @Scheduled(cron = "0 0/2 * * * *")
|
|
|
public void runTask() {
|
|
|
LambdaQueryWrapper<FhzgAutoTaskPlanDetail> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
queryWrapper.isNull(FhzgAutoTaskPlanDetail::getPlanNo);
|
|
|
@@ -447,9 +443,29 @@ public class AutoTaskServiceImpl implements AutoTaskService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ @Scheduled(cron = "0 0 0 1 * ?")
|
|
|
+ public void updateFeederStaticData(){
|
|
|
+ List<FhzgAutoTaskCountryInfo> countryInfoList = autoTaskCountryInfoService.getFeederStaticData();
|
|
|
+ countryInfoList.forEach(i -> i.setUpdateTime(LocalDate.now()));
|
|
|
+ autoTaskCountryInfoService.saveBatch(countryInfoList);
|
|
|
+ }
|
|
|
|
|
|
- public void updateStaticData(){
|
|
|
-
|
|
|
+ @Scheduled(cron = "0 0 0 * * ?")
|
|
|
+ public void updatePlanStaticData(){
|
|
|
+ LambdaQueryWrapper<FhzgAutoTaskCountryInfo> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ queryWrapper.between(FhzgAutoTaskCountryInfo::getUpdateTime,LocalDate.now().with(TemporalAdjusters.firstDayOfMonth()),LocalDate.now().with(TemporalAdjusters.lastDayOfMonth()));
|
|
|
+ List<FhzgAutoTaskCountryInfo> list = autoTaskCountryInfoService.list(queryWrapper);
|
|
|
+ for (FhzgAutoTaskCountryInfo fhzgAutoTaskCountryInfo : list) {
|
|
|
+ FhzgAutoTaskCountryInfo fhzgAutoTaskCountryInfo1 = autoTaskCountryInfoService.getPlanStaticData(fhzgAutoTaskCountryInfo.getCityCode(),fhzgAutoTaskCountryInfo.getCountryCode());
|
|
|
+ fhzgAutoTaskCountryInfo.setSimulationSuccess(fhzgAutoTaskCountryInfo1.getSimulationSuccess());
|
|
|
+ fhzgAutoTaskCountryInfo.setSimulationSuccessRate(fhzgAutoTaskCountryInfo1.getSimulationSuccessRate());
|
|
|
+ fhzgAutoTaskCountryInfo.setSchemeSuccess(fhzgAutoTaskCountryInfo1.getSchemeSuccess());
|
|
|
+ fhzgAutoTaskCountryInfo.setSchemeSuccessRate(fhzgAutoTaskCountryInfo1.getSchemeSuccessRate());
|
|
|
+ fhzgAutoTaskCountryInfo.setSvgSuccess(fhzgAutoTaskCountryInfo1.getSvgSuccess());
|
|
|
+ fhzgAutoTaskCountryInfo.setSvgSuccessRate(fhzgAutoTaskCountryInfo1.getSvgSuccessRate());
|
|
|
+ fhzgAutoTaskCountryInfo.setUpdateTime(fhzgAutoTaskCountryInfo1.getUpdateTime());
|
|
|
+ autoTaskCountryInfoService.updateById(fhzgAutoTaskCountryInfo);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
}
|