nahida пре 1 година
родитељ
комит
c745555534
1 измењених фајлова са 138 додато и 0 уклоњено
  1. 138 0
      data-service/src/main/java/com/zksy/data/schedule/CollectDataSchedule.java

+ 138 - 0
data-service/src/main/java/com/zksy/data/schedule/CollectDataSchedule.java

@@ -0,0 +1,138 @@
+package com.zksy.data.schedule;
+
+import com.zksy.data.service.IBaseSaveDataInterface;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.ApplicationContext;
+import org.springframework.scheduling.annotation.EnableScheduling;
+import org.springframework.scheduling.annotation.Scheduled;
+import org.springframework.stereotype.Component;
+
+import javax.annotation.PostConstruct;
+import java.util.HashMap;
+
+@EnableScheduling
+@Component
+public class CollectDataSchedule {
+    private HashMap<String,String> serviceMap = new HashMap<>();
+    @Autowired
+    private ApplicationContext applicationContext;
+    @PostConstruct
+    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"));
+    }
+
+    @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点执行");
+    }
+    @Scheduled(cron = "0 0 1 * * ?")
+    public void getDataByDay1() {
+
+    }
+
+    @Scheduled(cron = "0 0 2 * * ?")
+    public void getDataByDay2() {
+
+    }
+
+    @Scheduled(cron = "0 0 3 ? * SUN")
+    public void getDataByDay0() {
+
+    }
+
+    @Scheduled(cron = "0 0 4 ? * SUN")
+    public void getDataByWeek1() {
+
+    }
+    @Scheduled(cron = "0 0 5 ? * SUN")
+    public void getDataByWeek2() {
+
+    }
+    @Scheduled(cron = "0 0 6 ? * SUN")
+    public void getDataByWeek3() {
+
+    }
+}