Quellcode durchsuchen

推进按时调用功能

nahida vor 1 Jahr
Ursprung
Commit
bcfab51a49
1 geänderte Dateien mit 107 neuen und 87 gelöschten Zeilen
  1. 107 87
      data-service/src/main/java/com/zksy/data/schedule/CollectDataSchedule.java

+ 107 - 87
data-service/src/main/java/com/zksy/data/schedule/CollectDataSchedule.java

@@ -1,6 +1,8 @@
 package com.zksy.data.schedule;
 package com.zksy.data.schedule;
 
 
 import com.zksy.data.service.IBaseSaveDataInterface;
 import com.zksy.data.service.IBaseSaveDataInterface;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.BeansException;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.ApplicationContext;
 import org.springframework.context.ApplicationContext;
 import org.springframework.scheduling.annotation.EnableScheduling;
 import org.springframework.scheduling.annotation.EnableScheduling;
@@ -9,108 +11,114 @@ import org.springframework.stereotype.Component;
 
 
 import javax.annotation.PostConstruct;
 import javax.annotation.PostConstruct;
 import java.util.HashMap;
 import java.util.HashMap;
+import java.util.List;
 
 
 @EnableScheduling
 @EnableScheduling
 @Component
 @Component
+@Slf4j
 public class CollectDataSchedule {
 public class CollectDataSchedule {
     private HashMap<String,String> serviceMap = new HashMap<>();
     private HashMap<String,String> serviceMap = new HashMap<>();
     @Autowired
     @Autowired
     private ApplicationContext applicationContext;
     private ApplicationContext applicationContext;
     @PostConstruct
     @PostConstruct
     public void init() {
     public void init() {
-        serviceMap.put("xcrELicNcertificateService", "gateway/api/1/getXzxkxxByUniscid");
-        serviceMap.put("xcrCompanyInvestmentService", "gateway/api/1/getGdjczxgxxByUniscid");
-        serviceMap.put("xcrEquityChangeService", "gateway/api/1/getGqczbgxxByUniscid");
-        serviceMap.put("xcrSupplementaryForeignInvestmentService", "gateway/api/1/getWzbcxxByUniscid");
-        serviceMap.put("xcrAppointDelegatesService", "gateway/api/1/getWpdbxxByUniscid");
-        serviceMap.put("xcrAgriculturalSupplementService", "gateway/api/1/getNzbcxxByUniscid");
-        serviceMap.put("xcrDomesticCapitalSupplementService", "gateway/api/1/getNzbcxxByUniscid1");
-        serviceMap.put("xcrInstallmentPaymentService", "gateway/api/1/getFqsjxxByUniscid");
-        serviceMap.put("xcrInvestorSubscriptionDetailsService", "gateway/api/1/getTzrrjxxByUniscid");
-        serviceMap.put("xcrNonNaturalPersonContributionService", "gateway/api/1/getFzrrczxxByUniscid");
-        serviceMap.put("xcrNaturalPersonContributionsService", "gateway/api/1/getZrrczxxByUniscid");
-        serviceMap.put("xcrHistoryNameService", "gateway/api/1/getLsmcxxByUnscid");
-        serviceMap.put("xcrHistoricalLegalRepresentativeService", "gateway/api/1/getLsfddbrxxByUniscid");
-        serviceMap.put("xcrAbnormalHouseholdTerminationService", "gateway/api/1/getFzchjcxxByUniscid");
-        serviceMap.put("xcrTaxAdministrativePenaltyService", "gateway/api/1/getSwxzcfxxByUniscid");
-        serviceMap.put("xcrAffiliatedEnterpriseService", "gateway/api/1/getLsqyxxByUniscid");
-        serviceMap.put("xcrInstallmentSubscriptionService", "gateway/api/1/getFqrjxxByUniscid");
-        serviceMap.put("xcrAdministrativeLicensingAgriculturalCollegesService", "gateway/api/1/getNznbxzxkxxByUniscid");
-        serviceMap.put("xcrEnterpriseExceptionListService", "gateway/api/1/getQyycmlxxByUniscid1");
-        serviceMap.put("xcrInvestorAbnormalRecordService", "gateway/api/1/getQyjyycmlgdxxByUnsicd");
-        serviceMap.put("xcrEnterprisePublicityLicenseService", "gateway/api/1/getQygsxkxxByUniscid");
-        serviceMap.put("xcrEnterprisePublicityEquityChangeService", "gateway/api/1/getQygsgqbgxxByUniscid");
-        serviceMap.put("xcrSimplifiedCancellationAnnouncementService", "gateway/api/1/getJyzxggxxByUniscid");
-        serviceMap.put("xcrCancelTaxRegistrationService", "gateway/api/1/getZxswdjxxByUniscid");
-        serviceMap.put("xcrEnterprisePublicityInvestorInformationStatusService", "gateway/api/1/getQygsczrxxqkByUniscid");
-        serviceMap.put("xcrEnterprisePublicityDetailsContributionsContributorsService", "gateway/api/1/getCzrsjmxByUniscid");
-        serviceMap.put("xcrEnterprisePublicationSupplySubscribedDetailsInvestorsService", "gateway/api/1/getQygsczrrjmxByUniscid");
-        serviceMap.put("xcrRevisionInformationAgriculturalCollegeAnnualReportService", "gateway/api/1/getNznbxgxxByUniscid");
-        serviceMap.put("xcrBasicSupplementAgriculturalCollegeAnnualService", "gateway/api/1/getNznbjbxxbcByUniscid");
-        serviceMap.put("xcrEnterpriseBasicInformationService", "gateway/api/1/getQyjbxxByUniscid");
-        serviceMap.put("xcrEnterpriseNameApprovalService", "gateway/api/1/getQymcxxByUniscid");
-        serviceMap.put("xcrSeriousIllegalDishonestEnterprisesService", "gateway/api/1/getYzwfsxqymdBydm");
-        serviceMap.put("xcrSeriousIllegalDishonestEnterprisesDetailService", "gateway/api/1/getYzwfxxxxByUniscid");
-        serviceMap.put("xcrEquityPledgeInfoService", "gateway/api/1/getGqczdjxxBydm");
-        serviceMap.put("xcrEquityFreezeService", "gateway/api/1/getGqdjxxByUniscid");
-        serviceMap.put("xcrEquityChangeInfoService", "gateway/api/1/getGqbgxxByUniscid");
-        serviceMap.put("xcrEquityFreezeExecutionService", "gateway/api/1/getGqdjbzxrxxByUniscid");
-        serviceMap.put("xcrAbnormalBusinessOperationsService", "gateway/api/1/getQyycmlxxxxByUniscid");
-        serviceMap.put("xcrCheckWorkInfoService", "gateway/api/1/getJcgzxxByUniscid");
-        serviceMap.put("xcrTaxRegistrationEstablishmentService", "gateway/api/1/getSwdjslxxByUniscid");
-        serviceMap.put("xcrStopBusinessInformationService", "gateway/api/1/getGtgshtxyxxByUniscid");
-        serviceMap.put("xcrAbnormalHouseholdIdentificationService", "gateway/api/1/getFzchrdxxByUniscid");
-        serviceMap.put("xcrIncomeTaxReturnService", "gateway/api/1/getQysdssbxxByUniscid1");
-        serviceMap.put("xcrMainFinancialStatementsService", "gateway/api/1/getCwbbzbByUniscid");
-        serviceMap.put("xcrInvoiceIssuanceService", "gateway/api/1/fpkpxxByUniscid");
-        serviceMap.put("xcrConfirmationTerminationService", "gateway/api/1/getFzchrdjcxxbByUniscid");
-        serviceMap.put("xcrTaxpayerCreditRatingService", "gateway/api/1/getNsrxydjByUniscid");
-        serviceMap.put("xcrInstitutionalClientsService", "gateway/api/1/getJgkhxxByUnisicd");
-        serviceMap.put("xcrRecordDishonestyService", "gateway/api/1/getSxjlmdByQymc");
-        serviceMap.put("xcrTechnologyPlanProjectService", "gateway/api/1/getKjjhxmapbByQymc");
-        serviceMap.put("xcrTechnologyAwardSupplementService", "gateway/api/1/getKjjbxmjzjqkByQymc");
-        serviceMap.put("xcrMinorEnterprisesService", "gateway/api/1/getKjxzxqymdByQymc");
-        serviceMap.put("xcrInnovationPlatformService", "gateway/api/1/getCxptmd");
-        serviceMap.put("xcrHighTechService", "gateway/api/1/getGxjsqymdByUniscid");
-        serviceMap.put("xcrFoodProductionLicenseDetaliService", "gateway/api/1/getSpscxkzpzmxByUniscid");
-        serviceMap.put("xcrLegalRepresentativeService", "gateway/api/1/getSpscfddbrxxByUniscid");
-        serviceMap.put("xcrFoodProductionLicenseService", "gateway/api/1/getSpscxkzjbxxByUniscid");
-        serviceMap.put("xcrFoodBusinessLicenseService", "gateway/api/1/getSpjyxkzjbxxByUniscid");
-        serviceMap.put("xcrMsAdministrativeLicenseService", "gateway/api/1/getXzxkxxByUniscid");
-        serviceMap.put("xcrContactInformationService", "gateway/api/1/getLlyxxByUniscid");
-        serviceMap.put("xcrFinancialManagerService", "gateway/api/1/getCwfzrByUniscid");
-        serviceMap.put("xcrPersonalRevokeRecordService", "gateway/api/1/getGtdxxxByUniscid");
-        serviceMap.put("xcrNoticeRecordService", "gateway/api/1/getGsggxxByUniscid");
-        serviceMap.put("xcrWebsiteInfoService", "gateway/api/1/getGtnbwzhwdxxByUniscid");
-        serviceMap.put("xcrSmallAndMicroEnterprisesService", "gateway/api/1/getXwqymljbxxByUniscid");
-        serviceMap.put("xcrRandomInspectionTaskService", "gateway/api/1/getJcgzxxmlByUniscid");
-        serviceMap.put("xcrAnnualReportExternalInvestmentService", "gateway/api/1/getQynbdwtzxxByUniscid");
-        serviceMap.put("xcrExternalGuaranteeService", "gateway/api/1/getQynbdwtgbzxxByUniscid");
-        serviceMap.put("xcrRevokeInfoService", "gateway/api/1/getDxxxByUniscid");
-        serviceMap.put("xcrBranchOfficesInfoService", "gateway/api/1/getFzjgbaxxByUniscid1");
-        serviceMap.put("xcrLicenseInfoService", "gateway/api/1/getXkxxByUniscid");
-        serviceMap.put("xcrChangeFilingService", "gateway/api/1/getBgbaxxByUniscid");
-        serviceMap.put("xcrSocialInsuranceDataService", "gateway/api/1/getQynbshbxxxByUniscid");
-        serviceMap.put("xcrAgriculturalCollegeAnnualReportService", "gateway/api/1/getNznbjbxxByUniscid");
-        serviceMap.put("xcrLicenseInfoService", "gateway/api/1/getXkxxByUniscid");
-        serviceMap.put("xcrEnterprisePollutionPermitInfoService", "gateway/api/1/getQypwxkxxByUniscid");
-        serviceMap.put("xcrKeyPollutionSourcesService", "gateway/api/1/getZdpwdwmlByShxyfwm");
-
-//        Object bean = applicationContext.getBean("xcrKeyPollutionSourcesService");
-//        ((IBaseSaveDataInterface) bean).saveDataByUniCode(serviceMap.get("xcrKeyPollutionSourcesService"));
+        serviceMap.put("xcrELicNcertificateServiceImpl", "gateway/api/1/getXzxkxxByUniscid");
+        serviceMap.put("xcrCompanyInvestmentServiceImpl", "gateway/api/1/getGdjczxgxxByUniscid");
+        serviceMap.put("xcrEquityChangeServiceImpl", "gateway/api/1/getGqczbgxxByUniscid");
+        serviceMap.put("xcrSupplementaryForeignInvestmentServiceImpl", "gateway/api/1/getWzbcxxByUniscid");
+        serviceMap.put("xcrAppointDelegatesServiceImpl", "gateway/api/1/getWpdbxxByUniscid");
+        serviceMap.put("xcrAgriculturalSupplementServiceImpl", "gateway/api/1/getNzbcxxByUniscid");
+        serviceMap.put("xcrDomesticCapitalSupplementServiceImpl", "gateway/api/1/getNzbcxxByUniscid1");
+        serviceMap.put("xcrInstallmentPaymentServiceImpl", "gateway/api/1/getFqsjxxByUniscid");
+        serviceMap.put("xcrInvestorSubscriptionDetailsServiceImpl", "gateway/api/1/getTzrrjxxByUniscid");
+        serviceMap.put("xcrNonNaturalPersonContributionServiceImpl", "gateway/api/1/getFzrrczxxByUniscid");
+        serviceMap.put("xcrNaturalPersonContributionsServiceImpl", "gateway/api/1/getZrrczxxByUniscid");
+        serviceMap.put("xcrHistoryNameServiceImpl", "gateway/api/1/getLsmcxxByUnscid");
+        serviceMap.put("xcrHistoricalLegalRepresentativeServiceImpl", "gateway/api/1/getLsfddbrxxByUniscid");
+        serviceMap.put("xcrAbnormalHouseholdTerminationServiceImpl", "gateway/api/1/getFzchjcxxByUniscid");
+        serviceMap.put("xcrTaxAdministrativePenaltyServiceImpl", "gateway/api/1/getSwxzcfxxByUniscid");
+        serviceMap.put("xcrAffiliatedEnterpriseServiceImpl", "gateway/api/1/getLsqyxxByUniscid");
+        serviceMap.put("xcrInstallmentSubscriptionServiceImpl", "gateway/api/1/getFqrjxxByUniscid");
+        serviceMap.put("xcrAdministrativeLicensingAgriculturalCollegesServiceImpl", "gateway/api/1/getNznbxzxkxxByUniscid");
+        serviceMap.put("xcrEnterpriseExceptionListServiceImpl", "gateway/api/1/getQyycmlxxByUniscid1");
+        serviceMap.put("xcrInvestorAbnormalRecordServiceImpl", "gateway/api/1/getQyjyycmlgdxxByUnsicd");
+        serviceMap.put("xcrEnterprisePublicityLicenseServiceImpl", "gateway/api/1/getQygsxkxxByUniscid");
+        serviceMap.put("xcrEnterprisePublicityEquityChangeServiceImpl", "gateway/api/1/getQygsgqbgxxByUniscid");
+        serviceMap.put("xcrSimplifiedCancellationAnnouncementServiceImpl", "gateway/api/1/getJyzxggxxByUniscid");
+        serviceMap.put("xcrCancelTaxRegistrationServiceImpl", "gateway/api/1/getZxswdjxxByUniscid");
+        serviceMap.put("xcrEnterprisePublicityInvestorInformationStatusServiceImpl", "gateway/api/1/getQygsczrxxqkByUniscid");
+        serviceMap.put("xcrEnterprisePublicityDetailsContributionsContributorsServiceImpl", "gateway/api/1/getCzrsjmxByUniscid");
+        serviceMap.put("xcrEnterprisePublicationSupplySubscribedDetailsInvestorsServiceImpl", "gateway/api/1/getQygsczrrjmxByUniscid");
+        serviceMap.put("xcrRevisionInformationAgriculturalCollegeAnnualReportServiceImpl", "gateway/api/1/getNznbxgxxByUniscid");
+        serviceMap.put("xcrBasicSupplementAgriculturalCollegeAnnualServiceImpl", "gateway/api/1/getNznbjbxxbcByUniscid");
+        serviceMap.put("xcrEnterpriseBasicInformationServiceImpl", "gateway/api/1/getQyjbxxByUniscid");
+        serviceMap.put("xcrEnterpriseNameApprovalServiceImpl", "gateway/api/1/getQymcxxByUniscid");
+        serviceMap.put("xcrSeriousIllegalDishonestEnterprisesServiceImpl", "gateway/api/1/getYzwfsxqymdBydm");
+        serviceMap.put("xcrSeriousIllegalDishonestEnterprisesDetailServiceImpl", "gateway/api/1/getYzwfxxxxByUniscid");
+        serviceMap.put("xcrEquityPledgeInfoServiceImpl", "gateway/api/1/getGqczdjxxBydm");
+        serviceMap.put("xcrEquityFreezeServiceImpl", "gateway/api/1/getGqdjxxByUniscid");
+        serviceMap.put("xcrEquityChangeInfoServiceImpl", "gateway/api/1/getGqbgxxByUniscid");
+        serviceMap.put("xcrEquityFreezeExecutionServiceImpl", "gateway/api/1/getGqdjbzxrxxByUniscid");
+        serviceMap.put("xcrAbnormalBusinessOperationsServiceImpl", "gateway/api/1/getQyycmlxxxxByUniscid");
+        serviceMap.put("xcrCheckWorkInfoServiceImpl", "gateway/api/1/getJcgzxxByUniscid");
+        serviceMap.put("xcrTaxRegistrationEstablishmentServiceImpl", "gateway/api/1/getSwdjslxxByUniscid");
+        serviceMap.put("xcrStopBusinessInformationServiceImpl", "gateway/api/1/getGtgshtxyxxByUniscid");
+        serviceMap.put("xcrAbnormalHouseholdIdentificationServiceImpl", "gateway/api/1/getFzchrdxxByUniscid");
+        serviceMap.put("xcrIncomeTaxReturnServiceImpl", "gateway/api/1/getQysdssbxxByUniscid1");
+        serviceMap.put("xcrMainFinancialStatementsServiceImpl", "gateway/api/1/getCwbbzbByUniscid");
+        serviceMap.put("xcrInvoiceIssuanceServiceImpl", "gateway/api/1/fpkpxxByUniscid");
+        serviceMap.put("xcrConfirmationTerminationServiceImpl", "gateway/api/1/getFzchrdjcxxbByUniscid");
+        serviceMap.put("xcrTaxpayerCreditRatingServiceImpl", "gateway/api/1/getNsrxydjByUniscid");
+        serviceMap.put("xcrInstitutionalClientsServiceImpl", "gateway/api/1/getJgkhxxByUnisicd");
+        serviceMap.put("xcrRecordDishonestyServiceImpl", "gateway/api/1/getSxjlmdByQymc");
+        serviceMap.put("xcrTechnologyPlanProjectServiceImpl", "gateway/api/1/getKjjhxmapbByQymc");
+        serviceMap.put("xcrTechnologyAwardSupplementServiceImpl", "gateway/api/1/getKjjbxmjzjqkByQymc");
+        serviceMap.put("xcrMinorEnterprisesServiceImpl", "gateway/api/1/getKjxzxqymdByQymc");
+        serviceMap.put("xcrInnovationPlatformServiceImpl", "gateway/api/1/getCxptmd");
+        serviceMap.put("xcrHighTechServiceImpl", "gateway/api/1/getGxjsqymdByUniscid");
+        serviceMap.put("xcrFoodProductionLicenseDetaliServiceImpl", "gateway/api/1/getSpscxkzpzmxByUniscid");
+        serviceMap.put("xcrLegalRepresentativeServiceImpl", "gateway/api/1/getSpscfddbrxxByUniscid");
+        serviceMap.put("xcrFoodProductionLicenseServiceImpl", "gateway/api/1/getSpscxkzjbxxByUniscid");
+        serviceMap.put("xcrFoodBusinessLicenseServiceImpl", "gateway/api/1/getSpjyxkzjbxxByUniscid");
+        serviceMap.put("xcrMsAdministrativeLicenseServiceImpl", "gateway/api/1/getXzxkxxByUniscid");
+        serviceMap.put("xcrContactInformationServiceImpl", "gateway/api/1/getLlyxxByUniscid");
+        serviceMap.put("xcrFinancialManagerServiceImpl", "gateway/api/1/getCwfzrByUniscid");
+        serviceMap.put("xcrPersonalRevokeRecordServiceImpl", "gateway/api/1/getGtdxxxByUniscid");
+        serviceMap.put("xcrNoticeRecordServiceImpl", "gateway/api/1/getGsggxxByUniscid");
+        serviceMap.put("xcrWebsiteInfoServiceImpl", "gateway/api/1/getGtnbwzhwdxxByUniscid");
+        serviceMap.put("xcrSmallAndMicroEnterprisesServiceImpl", "gateway/api/1/getXwqymljbxxByUniscid");
+        serviceMap.put("xcrRandomInspectionTaskServiceImpl", "gateway/api/1/getJcgzxxmlByUniscid");
+        serviceMap.put("xcrAnnualReportExternalInvestmentServiceImpl", "gateway/api/1/getQynbdwtzxxByUniscid");
+        serviceMap.put("xcrExternalGuaranteeServiceImpl", "gateway/api/1/getQynbdwtgbzxxByUniscid");
+        serviceMap.put("xcrRevokeInfoServiceImpl", "gateway/api/1/getDxxxByUniscid");
+        serviceMap.put("xcrBranchOfficesInfoServiceImpl", "gateway/api/1/getFzjgbaxxByUniscid1");
+        serviceMap.put("xcrLicenseInfoServiceImpl", "gateway/api/1/getXkxxByUniscid");
+        serviceMap.put("xcrChangeFilingServiceImpl", "gateway/api/1/getBgbaxxByUniscid");
+        serviceMap.put("xcrSocialInsuranceDataServiceImpl", "gateway/api/1/getQynbshbxxxByUniscid");
+        serviceMap.put("xcrAgriculturalCollegeAnnualReportServiceImpl", "gateway/api/1/getNznbjbxxByUniscid");
+        serviceMap.put("xcrEnterprisePollutionPermitInfoServiceImpl", "gateway/api/1/getQypwxkxxByUniscid");
+        serviceMap.put("xcrKeyPollutionSourcesServiceImpl", "gateway/api/1/getZdpwdwmlByShxyfwm");
+        serviceMap.put("xcrEnvironmentalPenaltyDecisionServiceImpl","gateway/api/1/getHbcfjdqkxxByUniscid");
     }
     }
 
 
     @Scheduled(cron = "0 0 1 1 * ?")
     @Scheduled(cron = "0 0 1 1 * ?")
-    public void executeTask() {
-        //通过反射获取xcrKeyPollutionSourcesService bean对象调用saveDataByUniCode参数为serviceMap.get("xcrKeyPollutionSourcesService")
-        Object bean = applicationContext.getBean("xcrKeyPollutionSourcesService");
-        ((IBaseSaveDataInterface) bean).saveDataByUniCode(serviceMap.get("xcrKeyPollutionSourcesService"));
-        // 你的任务逻辑
-        System.out.println("任务在每月第一天的凌晨1点执行");
+    public void getDataByMonth() {
+
     }
     }
     @Scheduled(cron = "0 0 1 * * ?")
     @Scheduled(cron = "0 0 1 * * ?")
     public void getDataByDay1() {
     public void getDataByDay1() {
-
+        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);
+            }
+        });
     }
     }
 
 
     @Scheduled(cron = "0 0 2 * * ?")
     @Scheduled(cron = "0 0 2 * * ?")
@@ -125,6 +133,18 @@ public class CollectDataSchedule {
 
 
     @Scheduled(cron = "0 0 4 ? * SUN")
     @Scheduled(cron = "0 0 4 ? * SUN")
     public void getDataByWeek1() {
     public void getDataByWeek1() {
+        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);
+            }
+        });
 
 
     }
     }
     @Scheduled(cron = "0 0 5 ? * SUN")
     @Scheduled(cron = "0 0 5 ? * SUN")