|
|
@@ -110,15 +110,7 @@ public class CollectDataSchedule {
|
|
|
List<String> serviceList = List.of(
|
|
|
"xcrEnvironmentalPenaltyDecisionServiceImpl"
|
|
|
);
|
|
|
- serviceList.parallelStream().forEach((q)->{
|
|
|
- try {
|
|
|
- Object bean = applicationContext.getBean(q);
|
|
|
- ((IBaseSaveDataInterface) bean).saveDataByUniCode(serviceMap.get(q));
|
|
|
- } catch (BeansException e) {
|
|
|
- log.error("获取name为:{}的bean失败",q);
|
|
|
- throw new RuntimeException(e);
|
|
|
- }
|
|
|
- });
|
|
|
+ commonHandler(serviceList);
|
|
|
}
|
|
|
|
|
|
@Scheduled(cron = "0 0 2 * * ?")
|
|
|
@@ -136,15 +128,7 @@ public class CollectDataSchedule {
|
|
|
List<String> serviceList = List.of(
|
|
|
"xcrEnterprisePollutionPermitInfoServiceImpl"
|
|
|
);
|
|
|
- serviceList.parallelStream().forEach((q)->{
|
|
|
- try {
|
|
|
- Object bean = applicationContext.getBean(q);
|
|
|
- ((IBaseSaveDataInterface) bean).saveDataByUniCode(serviceMap.get(q));
|
|
|
- } catch (BeansException e) {
|
|
|
- log.error("获取name为:{}的bean失败",q);
|
|
|
- throw new RuntimeException(e);
|
|
|
- }
|
|
|
- });
|
|
|
+ commonHandler(serviceList);
|
|
|
|
|
|
}
|
|
|
@Scheduled(cron = "0 0 5 ? * SUN")
|
|
|
@@ -155,4 +139,17 @@ public class CollectDataSchedule {
|
|
|
public void getDataByWeek3() {
|
|
|
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ private void commonHandler(List<String> serviceList) {
|
|
|
+ serviceList.parallelStream().forEach((q)->{
|
|
|
+ try {
|
|
|
+ Object bean = applicationContext.getBean(q);
|
|
|
+ ((IBaseSaveDataInterface) bean).saveDataByUniCode(serviceMap.get(q));
|
|
|
+ } catch (BeansException e) {
|
|
|
+ log.error("获取name为:{}的bean失败",q);
|
|
|
+ throw new RuntimeException(e);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
}
|