CollectDataSchedule.java 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. package com.zksy.data.schedule;
  2. import com.zksy.data.service.IBaseSaveDataInterface;
  3. import lombok.extern.slf4j.Slf4j;
  4. import org.springframework.beans.BeansException;
  5. import org.springframework.beans.factory.annotation.Autowired;
  6. import org.springframework.context.ApplicationContext;
  7. import org.springframework.scheduling.annotation.EnableScheduling;
  8. import org.springframework.scheduling.annotation.Scheduled;
  9. import org.springframework.stereotype.Component;
  10. import javax.annotation.PostConstruct;
  11. import java.util.HashMap;
  12. import java.util.List;
  13. @EnableScheduling
  14. @Component
  15. @Slf4j
  16. public class CollectDataSchedule {
  17. private HashMap<String,String> serviceMap = new HashMap<>();
  18. @Autowired
  19. private ApplicationContext applicationContext;
  20. @PostConstruct
  21. public void init() {
  22. serviceMap.put("xcrELicNcertificateServiceImpl", "gateway/api/1/getXzxkxxByUniscid");
  23. serviceMap.put("xcrCompanyInvestmentServiceImpl", "gateway/api/1/getGdjczxgxxByUniscid");
  24. serviceMap.put("xcrEquityChangeServiceImpl", "gateway/api/1/getGqczbgxxByUniscid");
  25. serviceMap.put("xcrSupplementaryForeignInvestmentServiceImpl", "gateway/api/1/getWzbcxxByUniscid");
  26. serviceMap.put("xcrAppointDelegatesServiceImpl", "gateway/api/1/getWpdbxxByUniscid");
  27. serviceMap.put("xcrAgriculturalSupplementServiceImpl", "gateway/api/1/getNzbcxxByUniscid");
  28. serviceMap.put("xcrDomesticCapitalSupplementServiceImpl", "gateway/api/1/getNzbcxxByUniscid1");
  29. serviceMap.put("xcrInstallmentPaymentServiceImpl", "gateway/api/1/getFqsjxxByUniscid");
  30. serviceMap.put("xcrInvestorSubscriptionDetailsServiceImpl", "gateway/api/1/getTzrrjxxByUniscid");
  31. serviceMap.put("xcrNonNaturalPersonContributionServiceImpl", "gateway/api/1/getFzrrczxxByUniscid");
  32. serviceMap.put("xcrNaturalPersonContributionsServiceImpl", "gateway/api/1/getZrrczxxByUniscid");
  33. serviceMap.put("xcrHistoryNameServiceImpl", "gateway/api/1/getLsmcxxByUnscid");
  34. serviceMap.put("xcrHistoricalLegalRepresentativeServiceImpl", "gateway/api/1/getLsfddbrxxByUniscid");
  35. serviceMap.put("xcrAbnormalHouseholdTerminationServiceImpl", "gateway/api/1/getFzchjcxxByUniscid");
  36. serviceMap.put("xcrTaxAdministrativePenaltyServiceImpl", "gateway/api/1/getSwxzcfxxByUniscid");
  37. serviceMap.put("xcrAffiliatedEnterpriseServiceImpl", "gateway/api/1/getLsqyxxByUniscid");
  38. serviceMap.put("xcrInstallmentSubscriptionServiceImpl", "gateway/api/1/getFqrjxxByUniscid");
  39. serviceMap.put("xcrAdministrativeLicensingAgriculturalCollegesServiceImpl", "gateway/api/1/getNznbxzxkxxByUniscid");
  40. serviceMap.put("xcrEnterpriseExceptionListServiceImpl", "gateway/api/1/getQyycmlxxByUniscid1");
  41. serviceMap.put("xcrInvestorAbnormalRecordServiceImpl", "gateway/api/1/getQyjyycmlgdxxByUnsicd");
  42. serviceMap.put("xcrEnterprisePublicityLicenseServiceImpl", "gateway/api/1/getQygsxkxxByUniscid");
  43. serviceMap.put("xcrEnterprisePublicityEquityChangeServiceImpl", "gateway/api/1/getQygsgqbgxxByUniscid");
  44. serviceMap.put("xcrSimplifiedCancellationAnnouncementServiceImpl", "gateway/api/1/getJyzxggxxByUniscid");
  45. serviceMap.put("xcrCancelTaxRegistrationServiceImpl", "gateway/api/1/getZxswdjxxByUniscid");
  46. serviceMap.put("xcrEnterprisePublicityInvestorInformationStatusServiceImpl", "gateway/api/1/getQygsczrxxqkByUniscid");
  47. serviceMap.put("xcrEnterprisePublicityDetailsContributionsContributorsServiceImpl", "gateway/api/1/getCzrsjmxByUniscid");
  48. serviceMap.put("xcrEnterprisePublicationSupplySubscribedDetailsInvestorsServiceImpl", "gateway/api/1/getQygsczrrjmxByUniscid");
  49. serviceMap.put("xcrRevisionInformationAgriculturalCollegeAnnualReportServiceImpl", "gateway/api/1/getNznbxgxxByUniscid");
  50. serviceMap.put("xcrBasicSupplementAgriculturalCollegeAnnualServiceImpl", "gateway/api/1/getNznbjbxxbcByUniscid");
  51. serviceMap.put("xcrEnterpriseBasicInformationServiceImpl", "gateway/api/1/getQyjbxxByUniscid");
  52. serviceMap.put("xcrEnterpriseNameApprovalServiceImpl", "gateway/api/1/getQymcxxByUniscid");
  53. serviceMap.put("xcrSeriousIllegalDishonestEnterprisesServiceImpl", "gateway/api/1/getYzwfsxqymdBydm");
  54. serviceMap.put("xcrSeriousIllegalDishonestEnterprisesDetailServiceImpl", "gateway/api/1/getYzwfxxxxByUniscid");
  55. serviceMap.put("xcrEquityPledgeInfoServiceImpl", "gateway/api/1/getGqczdjxxBydm");
  56. serviceMap.put("xcrEquityFreezeServiceImpl", "gateway/api/1/getGqdjxxByUniscid");
  57. serviceMap.put("xcrEquityChangeInfoServiceImpl", "gateway/api/1/getGqbgxxByUniscid");
  58. serviceMap.put("xcrEquityFreezeExecutionServiceImpl", "gateway/api/1/getGqdjbzxrxxByUniscid");
  59. serviceMap.put("xcrAbnormalBusinessOperationsServiceImpl", "gateway/api/1/getQyycmlxxxxByUniscid");
  60. serviceMap.put("xcrCheckWorkInfoServiceImpl", "gateway/api/1/getJcgzxxByUniscid");
  61. serviceMap.put("xcrTaxRegistrationEstablishmentServiceImpl", "gateway/api/1/getSwdjslxxByUniscid");
  62. serviceMap.put("xcrStopBusinessInformationServiceImpl", "gateway/api/1/getGtgshtxyxxByUniscid");
  63. serviceMap.put("xcrAbnormalHouseholdIdentificationServiceImpl", "gateway/api/1/getFzchrdxxByUniscid");
  64. serviceMap.put("xcrIncomeTaxReturnServiceImpl", "gateway/api/1/getQysdssbxxByUniscid1");
  65. serviceMap.put("xcrMainFinancialStatementsServiceImpl", "gateway/api/1/getCwbbzbByUniscid");
  66. serviceMap.put("xcrInvoiceIssuanceServiceImpl", "gateway/api/1/fpkpxxByUniscid");
  67. serviceMap.put("xcrConfirmationTerminationServiceImpl", "gateway/api/1/getFzchrdjcxxbByUniscid");
  68. serviceMap.put("xcrTaxpayerCreditRatingServiceImpl", "gateway/api/1/getNsrxydjByUniscid");
  69. serviceMap.put("xcrInstitutionalClientsServiceImpl", "gateway/api/1/getJgkhxxByUnisicd");
  70. serviceMap.put("xcrRecordDishonestyServiceImpl", "gateway/api/1/getSxjlmdByQymc");
  71. serviceMap.put("xcrTechnologyPlanProjectServiceImpl", "gateway/api/1/getKjjhxmapbByQymc");
  72. serviceMap.put("xcrTechnologyAwardSupplementServiceImpl", "gateway/api/1/getKjjbxmjzjqkByQymc");
  73. serviceMap.put("xcrMinorEnterprisesServiceImpl", "gateway/api/1/getKjxzxqymdByQymc");
  74. serviceMap.put("xcrInnovationPlatformServiceImpl", "gateway/api/1/getCxptmd");
  75. serviceMap.put("xcrHighTechServiceImpl", "gateway/api/1/getGxjsqymdByUniscid");
  76. serviceMap.put("xcrFoodProductionLicenseDetaliServiceImpl", "gateway/api/1/getSpscxkzpzmxByUniscid");
  77. serviceMap.put("xcrLegalRepresentativeServiceImpl", "gateway/api/1/getSpscfddbrxxByUniscid");
  78. serviceMap.put("xcrFoodProductionLicenseServiceImpl", "gateway/api/1/getSpscxkzjbxxByUniscid");
  79. serviceMap.put("xcrFoodBusinessLicenseServiceImpl", "gateway/api/1/getSpjyxkzjbxxByUniscid");
  80. serviceMap.put("xcrMsAdministrativeLicenseServiceImpl", "gateway/api/1/getXzxkxxByUniscid");
  81. serviceMap.put("xcrContactInformationServiceImpl", "gateway/api/1/getLlyxxByUniscid");
  82. serviceMap.put("xcrFinancialManagerServiceImpl", "gateway/api/1/getCwfzrByUniscid");
  83. serviceMap.put("xcrPersonalRevokeRecordServiceImpl", "gateway/api/1/getGtdxxxByUniscid");
  84. serviceMap.put("xcrNoticeRecordServiceImpl", "gateway/api/1/getGsggxxByUniscid");
  85. serviceMap.put("xcrWebsiteInfoServiceImpl", "gateway/api/1/getGtnbwzhwdxxByUniscid");
  86. serviceMap.put("xcrSmallAndMicroEnterprisesServiceImpl", "gateway/api/1/getXwqymljbxxByUniscid");
  87. serviceMap.put("xcrRandomInspectionTaskServiceImpl", "gateway/api/1/getJcgzxxmlByUniscid");
  88. serviceMap.put("xcrAnnualReportExternalInvestmentServiceImpl", "gateway/api/1/getQynbdwtzxxByUniscid");
  89. serviceMap.put("xcrExternalGuaranteeServiceImpl", "gateway/api/1/getQynbdwtgbzxxByUniscid");
  90. serviceMap.put("xcrRevokeInfoServiceImpl", "gateway/api/1/getDxxxByUniscid");
  91. serviceMap.put("xcrBranchOfficesInfoServiceImpl", "gateway/api/1/getFzjgbaxxByUniscid1");
  92. serviceMap.put("xcrLicenseInfoServiceImpl", "gateway/api/1/getXkxxByUniscid");
  93. serviceMap.put("xcrChangeFilingServiceImpl", "gateway/api/1/getBgbaxxByUniscid");
  94. serviceMap.put("xcrSocialInsuranceDataServiceImpl", "gateway/api/1/getQynbshbxxxByUniscid");
  95. serviceMap.put("xcrAgriculturalCollegeAnnualReportServiceImpl", "gateway/api/1/getNznbjbxxByUniscid");
  96. serviceMap.put("xcrEnterprisePollutionPermitInfoServiceImpl", "gateway/api/1/getQypwxkxxByUniscid");
  97. serviceMap.put("xcrKeyPollutionSourcesServiceImpl", "gateway/api/1/getZdpwdwmlByShxyfwm");
  98. serviceMap.put("xcrEnvironmentalPenaltyDecisionServiceImpl","gateway/api/1/getHbcfjdqkxxByUniscid");
  99. }
  100. @Scheduled(cron = "0 0 1 1 * ?")
  101. public void getDataByMonth() {
  102. }
  103. @Scheduled(cron = "0 0 1 * * ?")
  104. public void getDataByDay1() {
  105. List<String> serviceList = List.of(
  106. "xcrEnvironmentalPenaltyDecisionServiceImpl"
  107. );
  108. serviceList.parallelStream().forEach((q)->{
  109. try {
  110. Object bean = applicationContext.getBean(q);
  111. ((IBaseSaveDataInterface) bean).saveDataByUniCode(serviceMap.get(q));
  112. } catch (BeansException e) {
  113. log.error("获取name为:{}的bean失败",q);
  114. throw new RuntimeException(e);
  115. }
  116. });
  117. }
  118. @Scheduled(cron = "0 0 2 * * ?")
  119. public void getDataByDay2() {
  120. }
  121. @Scheduled(cron = "0 0 3 ? * SUN")
  122. public void getDataByDay0() {
  123. }
  124. @Scheduled(cron = "0 0 4 ? * SUN")
  125. public void getDataByWeek1() {
  126. List<String> serviceList = List.of(
  127. "xcrEnterprisePollutionPermitInfoServiceImpl"
  128. );
  129. serviceList.parallelStream().forEach((q)->{
  130. try {
  131. Object bean = applicationContext.getBean(q);
  132. ((IBaseSaveDataInterface) bean).saveDataByUniCode(serviceMap.get(q));
  133. } catch (BeansException e) {
  134. log.error("获取name为:{}的bean失败",q);
  135. throw new RuntimeException(e);
  136. }
  137. });
  138. }
  139. @Scheduled(cron = "0 0 5 ? * SUN")
  140. public void getDataByWeek2() {
  141. }
  142. @Scheduled(cron = "0 0 6 ? * SUN")
  143. public void getDataByWeek3() {
  144. }
  145. }