CollectDataSchedule.java 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292
  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("xcrCompanyInvestmentServiceImpl", "gateway/api/1/getGdjczxgxxByUniscid");
  23. serviceMap.put("xcrEquityChangeServiceImpl", "gateway/api/1/getGqczbgxxByUniscid");
  24. serviceMap.put("xcrSupplementaryForeignInvestmentServiceImpl", "gateway/api/1/getWzbcxxByUniscid");
  25. serviceMap.put("xcrAppointDelegatesServiceImpl", "gateway/api/1/getWpdbxxByUniscid");
  26. serviceMap.put("xcrAgriculturalSupplementServiceImpl", "gateway/api/1/getNzbcxxByUniscid");
  27. serviceMap.put("xcrDomesticCapitalSupplementServiceImpl", "gateway/api/1/getNzbcxxByUniscid1");
  28. serviceMap.put("xcrInstallmentPaymentServiceImpl", "gateway/api/1/getFqsjxxByUniscid");
  29. serviceMap.put("xcrInvestorSubscriptionDetailsServiceImpl", "gateway/api/1/getTzrrjxxByUniscid");
  30. serviceMap.put("xcrNonNaturalPersonContributionServiceImpl", "gateway/api/1/getFzrrczxxByUniscid");
  31. serviceMap.put("xcrNaturalPersonContributionsServiceImpl", "gateway/api/1/getZrrczxxByUniscid");
  32. serviceMap.put("xcrHistoryNameServiceImpl", "gateway/api/1/getLsmcxxByUnscid");
  33. serviceMap.put("xcrHistoricalLegalRepresentativeServiceImpl", "gateway/api/1/getLsfddbrxxByUniscid");
  34. serviceMap.put("xcrAbnormalHouseholdTerminationServiceImpl", "gateway/api/1/getFzchjcxxByUniscid");
  35. serviceMap.put("xcrTaxAdministrativePenaltyServiceImpl", "gateway/api/1/getSwxzcfxxByUniscid");
  36. serviceMap.put("xcrAffiliatedEnterpriseServiceImpl", "gateway/api/1/getLsqyxxByUniscid");
  37. serviceMap.put("xcrInstallmentSubscriptionServiceImpl", "gateway/api/1/getFqrjxxByUniscid");
  38. serviceMap.put("xcrAdministrativeLicensingAgriculturalCollegesServiceImpl", "gateway/api/1/getNznbxzxkxxByUniscid");
  39. serviceMap.put("xcrEnterpriseExceptionListServiceImpl", "gateway/api/1/getQyycmlxxByUniscid1");
  40. serviceMap.put("xcrInvestorAbnormalRecordServiceImpl", "gateway/api/1/getQyjyycmlgdxxByUnsicd");
  41. serviceMap.put("xcrEnterprisePublicityLicenseServiceImpl", "gateway/api/1/getQygsxkxxByUniscid");
  42. serviceMap.put("xcrEnterprisePublicityEquityChangeServiceImpl", "gateway/api/1/getQygsgqbgxxByUniscid");
  43. serviceMap.put("xcrSimplifiedCancellationAnnouncementServiceImpl", "gateway/api/1/getJyzxggxxByUniscid");
  44. serviceMap.put("xcrCancelTaxRegistrationServiceImpl", "gateway/api/1/getZxswdjxxByUniscid");
  45. serviceMap.put("xcrEnterprisePublicityInvestorInformationStatusServiceImpl", "gateway/api/1/getQygsczrxxqkByUniscid");
  46. serviceMap.put("xcrEnterprisePublicityDetailsContributionsContributorsServiceImpl", "gateway/api/1/getCzrsjmxByUniscid");
  47. serviceMap.put("xcrEnterprisePublicationSupplySubscribedDetailsInvestorsServiceImpl", "gateway/api/1/getQygsczrrjmxByUniscid");
  48. serviceMap.put("xcrRevisionInformationAgriculturalCollegeAnnualReportServiceImpl", "gateway/api/1/getNznbxgxxByUniscid");
  49. serviceMap.put("xcrBasicSupplementAgriculturalCollegeAnnualServiceImpl", "gateway/api/1/getNznbjbxxbcByUniscid");
  50. serviceMap.put("xcrEnterpriseBasicInformationServiceImpl", "gateway/api/1/getQyjbxxByUniscid");
  51. serviceMap.put("xcrEnterpriseNameApprovalServiceImpl", "gateway/api/1/getQymcxxByUniscid");
  52. serviceMap.put("xcrSeriousIllegalDishonestEnterprisesServiceImpl", "gateway/api/1/getYzwfsxqymdBydm");
  53. serviceMap.put("xcrSeriousIllegalDishonestEnterprisesDetailServiceImpl", "gateway/api/1/getYzwfxxxxByUniscid");
  54. serviceMap.put("xcrEquityPledgeInfoServiceImpl", "gateway/api/1/getGqczdjxxBydm");
  55. serviceMap.put("xcrEquityFreezeServiceImpl", "gateway/api/1/getGqdjxxByUniscid");
  56. serviceMap.put("xcrEquityChangeInfoServiceImpl", "gateway/api/1/getGqbgxxByUniscid");
  57. serviceMap.put("xcrEquityFreezeExecutionServiceImpl", "gateway/api/1/getGqdjbzxrxxByUniscid");
  58. serviceMap.put("xcrAbnormalBusinessOperationsServiceImpl", "gateway/api/1/getQyycmlxxxxByUniscid");
  59. serviceMap.put("xcrCheckWorkInfoServiceImpl", "gateway/api/1/getJcgzxxByUniscid");
  60. serviceMap.put("xcrTaxRegistrationEstablishmentServiceImpl", "gateway/api/1/getSwdjslxxByUniscid");
  61. serviceMap.put("xcrStopBusinessInformationServiceImpl", "gateway/api/1/getGtgshtxyxxByUniscid");
  62. serviceMap.put("xcrAbnormalHouseholdIdentificationServiceImpl", "gateway/api/1/getFzchrdxxByUniscid");
  63. serviceMap.put("xcrIncomeTaxReturnServiceImpl", "gateway/api/1/getQysdssbxxByUniscid1");
  64. serviceMap.put("xcrMainFinancialStatementsServiceImpl", "gateway/api/1/getCwbbzbByUniscid");
  65. serviceMap.put("xcrInvoiceIssuanceServiceImpl", "gateway/api/1/fpkpxxByUniscid");
  66. serviceMap.put("xcrConfirmationTerminationServiceImpl", "gateway/api/1/getFzchrdjcxxbByUniscid");
  67. serviceMap.put("xcrTaxpayerCreditRatingServiceImpl", "gateway/api/1/getNsrxydjByUniscid");
  68. serviceMap.put("xcrInstitutionalClientsServiceImpl", "gateway/api/1/getJgkhxxByUnisicd");
  69. serviceMap.put("xcrRecordDishonestyServiceImpl", "gateway/api/1/getSxjlmdByQymc");
  70. serviceMap.put("xcrTechnologyPlanProjectServiceImpl", "gateway/api/1/getKjjhxmapbByQymc");
  71. serviceMap.put("xcrTechnologyAwardSupplementServiceImpl", "gateway/api/1/getKjjbxmjzjqkByQymc");
  72. serviceMap.put("xcrMinorEnterprisesServiceImpl", "gateway/api/1/getKjxzxqymdByQymc");
  73. serviceMap.put("xcrInnovationPlatformServiceImpl", "gateway/api/1/getCxptmd");
  74. serviceMap.put("xcrHighTechServiceImpl", "gateway/api/1/getGxjsqymdByUniscid");
  75. serviceMap.put("xcrFoodProductionLicenseDetaliServiceImpl", "gateway/api/1/getSpscxkzpzmxByUniscid");
  76. serviceMap.put("xcrLegalRepresentativeServiceImpl", "gateway/api/1/getSpscfddbrxxByUniscid");
  77. serviceMap.put("xcrFoodProductionLicenseServiceImpl", "gateway/api/1/getSpscxkzjbxxByUniscid");
  78. serviceMap.put("xcrFoodBusinessLicenseServiceImpl", "gateway/api/1/getSpjyxkzjbxxByUniscid");
  79. serviceMap.put("xcrMsAdministrativeLicenseServiceImpl", "gateway/api/1/getXzxkxxByUniscid");
  80. serviceMap.put("xcrContactInformationServiceImpl", "gateway/api/1/getLlyxxByUniscid");
  81. serviceMap.put("xcrFinancialManagerServiceImpl", "gateway/api/1/getCwfzrByUniscid");
  82. serviceMap.put("xcrPersonalRevokeRecordServiceImpl", "gateway/api/1/getGtdxxxByUniscid");
  83. serviceMap.put("xcrNoticeRecordServiceImpl", "gateway/api/1/getGsggxxByUniscid");
  84. serviceMap.put("xcrWebsiteInfoServiceImpl", "gateway/api/1/getGtnbwzhwdxxByUniscid");
  85. serviceMap.put("xcrSmallAndMicroEnterprisesServiceImpl", "gateway/api/1/getXwqymljbxxByUniscid");
  86. serviceMap.put("xcrRandomInspectionTaskServiceImpl", "gateway/api/1/getJcgzxxmlByUniscid");
  87. serviceMap.put("xcrAnnualReportExternalInvestmentServiceImpl", "gateway/api/1/getQynbdwtzxxByUniscid");
  88. serviceMap.put("xcrExternalGuaranteeServiceImpl", "gateway/api/1/getQynbdwtgbzxxByUniscid");
  89. serviceMap.put("xcrRevokeInfoServiceImpl", "gateway/api/1/getDxxxByUniscid");
  90. serviceMap.put("xcrBranchOfficesInfoServiceImpl", "gateway/api/1/getFzjgbaxxByUniscid1");
  91. serviceMap.put("xcrLicenseInfoServiceImpl", "gateway/api/1/getXkxxByUniscid");
  92. serviceMap.put("xcrChangeFilingServiceImpl", "gateway/api/1/getBgbaxxByUniscid");
  93. serviceMap.put("xcrSocialInsuranceDataServiceImpl", "gateway/api/1/getQynbshbxxxByUniscid");
  94. serviceMap.put("xcrAgriculturalCollegeAnnualReportServiceImpl", "gateway/api/1/getNznbjbxxByUniscid");
  95. serviceMap.put("xcrEnterprisePollutionPermitInfoServiceImpl", "gateway/api/1/getQypwxkxxByUniscid");
  96. serviceMap.put("xcrKeyPollutionSourcesServiceImpl", "gateway/api/1/getZdpwdwmlByShxyfwm");
  97. serviceMap.put("xcrEnvironmentalPenaltyDecisionServiceImpl","gateway/api/1/getHbcfjdqkxxByUniscid");
  98. serviceMap.put("xcrIndividualBusinessInformationServiceImpl","gateway/api/1/getGtjyzjbxxByUniscid");
  99. serviceMap.put("xcrIndustryCommerceServiceImpl","gateway/api/1/getGtgshjbxxByUniscid");
  100. serviceMap.put("xcrAgriculturalSpecializedWebsiteService","gateway/api/1/nznbwzhwdxxByUniscid");
  101. serviceMap.put("xcrIndividualChangeInformationServiceImpl","gateway/api/1/getGtbgxxByUniscid");
  102. serviceMap.put("xcrIndividualCancellationServiceImpl","gateway/api/1/getGtzxxxByUniscid");
  103. serviceMap.put("xcrIndividualBusinessAbnormalityServiceImpl","gateway/api/1/getGtjyycbjxxByUniscid");
  104. serviceMap.put("xcrMoveOutServiceImpl","gateway/api/1/getQcxxByUniscid");
  105. serviceMap.put("xcrMoveInServiceImpl","gateway/api/1/getQrxxByUniscid");
  106. serviceMap.put("xcrDeregistrationServiceImpl","gateway/api/1/getCxdjxxByUniscid");
  107. serviceMap.put("xcrCancellationServiceImpl","gateway/api/1/getZxxxByUniscid");
  108. serviceMap.put("xcrLiquidationBasicInfoServiceImpl","gateway/api/1/getQsjbxxByUniscid1");
  109. serviceMap.put("xcrLiquidationMemberInfoServiceImpl","gateway/api/1/getQscyxxByUniscid");
  110. serviceMap.put("xcrAbnormalOperationAnnouncementServiceImpl","gateway/api/1/getJyycggplmdxxByUniscid");
  111. serviceMap.put("xcrFarmSpecialAbnormalDetailServiceImpl","gateway/api/1/getNzycmlxxxxByUniscid");
  112. serviceMap.put("xcrEnterpriseAnnualReportWebsiteServiceImpl","gateway/api/1/getQynbwzhwdxxByUniscid");
  113. serviceMap.put("xcrEnterpriseAnnualReportEquityChangeServiceImpl","gateway/api/1/getQynbgqbgxxByUniscid");
  114. serviceMap.put("xcrIndividualCancellationObjectionServiceImpl","gateway/api/1/getJyzxyyxxByUniscid");
  115. serviceMap.put("xcrRevokeRegistrationServiceImpl","gateway/api/1/getGtcxdjxxByUniscid");
  116. serviceMap.put("xcrAgriculturalSpecializedWebsiteServiceImpl","gateway/api/1/nznbwzhwdxxByUniscid");
  117. serviceMap.put("xcrAnSfcBranchinfoServiceImpl","gateway/api/1/getNznbfzjgxxByUniscid");
  118. serviceMap.put("xcrMajorMembersServiceImpl","gateway/api/1/zyryxxByUniscid");
  119. serviceMap.put("xcrOtherInfo36ServiceImpl","interface/v1/datawarehouse/list");
  120. serviceMap.put("xcrAdministrativeLicensingServiceImpl","interface/v1/doublePublic/findLicensingList");
  121. serviceMap.put("xcrAdministrativePenaltyServiceImpl","interface/v1/doublePublic/findSanctionList");
  122. serviceMap.put("xcrOtherInfo37ServiceImpl","interface/v1/datawarehouse/list");
  123. serviceMap.put("xcrOtherInfo38ServiceImpl","interface/v1/datawarehouse/list");
  124. serviceMap.put("xcrOtherInfo39ServiceImpl","interface/v1/datawarehouse/list");
  125. serviceMap.put("xcrTrustworthyIncentive42ServiceImpl","interface/v1/datawarehouse/list");
  126. serviceMap.put("xcrDishonestyPunishment19ServiceImpl","interface/v1/datawarehouse/list");
  127. }
  128. @Scheduled(cron = "0 0 1 1 * ?")
  129. public void getDataByMonth() {
  130. List<String> serviceList = List.of(
  131. "xcrOtherInfo38ServiceImpl",
  132. "xcrOtherInfo39ServiceImpl"
  133. );
  134. commonHandler(serviceList);
  135. }
  136. @Scheduled(cron = "0 0 1 * * ?")
  137. public void getDataByDay1() {
  138. List<String> serviceList = List.of(
  139. "xcrEnvironmentalPenaltyDecisionServiceImpl",
  140. "xcrAdministrativeLicensingServiceImpl",
  141. "xcrTrustworthyIncentive42ServiceImpl",
  142. "xcrDishonestyPunishment19ServiceImpl"
  143. );
  144. commonHandler(serviceList);
  145. }
  146. @Scheduled(cron = "0 0 2 * * ?")
  147. public void getDataByDay2() {
  148. }
  149. @Scheduled(cron = "0 0 3 ? * SUN")
  150. public void getDataByDay0() {
  151. List<String> serviceList = List.of(
  152. "xcrRecordDishonestyServiceImpl",
  153. "xcrInstitutionalClientsServiceImpl",
  154. "xcrTaxpayerCreditRatingServiceImpl",
  155. "xcrMainFinancialStatementsServiceImpl",
  156. "xcrStopBusinessInformationServiceImpl",
  157. "xcrAbnormalHouseholdTerminationServiceImpl",
  158. "xcrTaxAdministrativePenaltyServiceImpl",
  159. "xcrEnterpriseBasicInformationServiceImpl"
  160. );
  161. commonHandler(serviceList);
  162. }
  163. @Scheduled(cron = "0 0 4 ? * SUN")
  164. public void getDataByWeek1() {
  165. List<String> serviceList = List.of(
  166. "xcrEnterprisePollutionPermitInfoServiceImpl",
  167. "xcrKeyPollutionSourcesServiceImpl",
  168. "xcrAgriculturalSpecializedWebsiteServiceImpl",
  169. "xcrAnSfcBranchinfoServiceImpl",
  170. "xcrCompanyInvestmentServiceImpl",
  171. "xcrEquityChangeServiceImpl",
  172. "xcrSupplementaryForeignInvestmentServiceImpl",
  173. "xcrAppointDelegatesServiceImpl",
  174. "xcrAgriculturalSupplementServiceImpl",
  175. "xcrDomesticCapitalSupplementServiceImpl",
  176. "xcrInstallmentPaymentServiceImpl",
  177. "xcrInvestorSubscriptionDetailsServiceImpl",
  178. "xcrNonNaturalPersonContributionServiceImpl",
  179. "xcrNaturalPersonContributionsServiceImpl",
  180. "xcrHistoryNameServiceImpl",
  181. "xcrHistoricalLegalRepresentativeServiceImpl",
  182. "xcrAffiliatedEnterpriseServiceImpl",
  183. "xcrInstallmentSubscriptionServiceImpl",
  184. "xcrAdministrativeLicensingAgriculturalCollegesServiceImpl",
  185. "xcrEnterpriseExceptionListServiceImpl",
  186. "xcrInvestorAbnormalRecordServiceImpl"
  187. );
  188. commonHandler(serviceList);
  189. }
  190. @Scheduled(cron = "0 0 5 ? * SUN")
  191. public void getDataByWeek2() {
  192. List<String> serviceList = List.of(
  193. "xcrNoticeRecordServiceImpl",
  194. "xcrPersonalRevokeRecordServiceImpl",
  195. "xcrCheckWorkInfoServiceImpl",
  196. "xcrAbnormalBusinessOperationsServiceImpl",
  197. "xcrEquityFreezeExecutionServiceImpl",
  198. "xcrEquityChangeInfoServiceImpl",
  199. "xcrEquityFreezeServiceImpl",
  200. "xcrEquityPledgeInfoServiceImpl",
  201. "xcrSeriousIllegalDishonestEnterprisesDetailServiceImpl",
  202. "xcrSeriousIllegalDishonestEnterprisesServiceImpl",
  203. "xcrEnterpriseNameApprovalServiceImpl",
  204. "xcrBasicSupplementAgriculturalCollegeAnnualServiceImpl",
  205. "xcrEnterprisePublicityInvestorInformationStatusServiceImpl",
  206. "xcrEnterprisePublicityDetailsContributionsContributorsServiceImpl",
  207. "xcrEnterprisePublicationSupplySubscribedDetailsInvestorsServiceImpl",
  208. "xcrRevisionInformationAgriculturalCollegeAnnualReportServiceImpl"
  209. );
  210. commonHandler(serviceList);
  211. }
  212. @Scheduled(cron = "0 0 6 ? * SUN")
  213. public void getDataByWeek3() {
  214. List<String> serviceList = List.of(
  215. "xcrCancellationServiceImpl",
  216. "xcrLiquidationBasicInfoServiceImpl",
  217. "xcrLiquidationMemberInfoServiceImpl",
  218. "xcrAbnormalOperationAnnouncementServiceImpl",
  219. "xcrFarmSpecialAbnormalDetailServiceImpl",
  220. "xcrEnterpriseAnnualReportWebsiteServiceImpl",
  221. "xcrEnterpriseAnnualReportEquityChangeServiceImpl",
  222. "xcrIndividualCancellationObjectionServiceImpl",
  223. "xcrRevokeRegistrationServiceImpl",
  224. "xcrAgriculturalCollegeAnnualReportServiceImpl",
  225. "xcrChangeFilingServiceImpl",
  226. "xcrLicenseInfoServiceImpl",
  227. "xcrBranchOfficesInfoServiceImpl",
  228. "xcrRevokeInfoServiceImpl",
  229. "xcrExternalGuaranteeServiceImpl",
  230. "xcrAnnualReportExternalInvestmentServiceImpl",
  231. "xcrRandomInspectionTaskServiceImpl",
  232. "xcrSmallAndMicroEnterprisesServiceImpl",
  233. "xcrWebsiteInfoServiceImpl",
  234. "xcrOtherInfo36ServiceImpl",
  235. "interface/v1/datawarehouse/list",
  236. "xcrOtherInfo37ServiceImpl"
  237. );
  238. commonHandler(serviceList);
  239. }
  240. @Scheduled(cron = "0 0 7 ? * SUN")
  241. public void getDataByWeek4() {
  242. List<String> serviceList = List.of(
  243. "xcrTechnologyPlanProjectServiceImpl",
  244. "xcrTechnologyAwardSupplementServiceImpl",
  245. "xcrMinorEnterprisesServiceImpl",
  246. "xcrInnovationPlatformServiceImpl",
  247. "xcrHighTechServiceImpl",
  248. "xcrFoodProductionLicenseDetaliServiceImpl",
  249. "xcrLegalRepresentativeServiceImpl",
  250. "xcrFoodProductionLicenseServiceImpl",
  251. "xcrFoodBusinessLicenseServiceImpl",
  252. "xcrMsAdministrativeLicenseServiceImpl",
  253. "xcrContactInformationServiceImpl",
  254. "xcrFinancialManagerServiceImpl",
  255. "xcrIndividualBusinessInformationServiceImpl",
  256. "xcrIndustryCommerceServiceImpl",
  257. "xcrIndividualChangeInformationServiceImpl",
  258. "xcrIndividualCancellationServiceImpl",
  259. "xcrIndividualBusinessAbnormalityServiceImpl",
  260. "xcrMoveOutServiceImpl",
  261. "xcrMoveInServiceImpl",
  262. "xcrDeregistrationServiceImpl",
  263. "xcrEnterprisePublicityLicenseServiceImpl",
  264. "xcrEnterprisePublicityEquityChangeServiceImpl",
  265. "xcrSimplifiedCancellationAnnouncementServiceImpl"
  266. );
  267. commonHandler(serviceList);
  268. }
  269. private void commonHandler(List<String> serviceList) {
  270. serviceList.parallelStream().forEach((q)->{
  271. try {
  272. Object bean = applicationContext.getBean(q);
  273. ((IBaseSaveDataInterface) bean).saveDataByUniCode(serviceMap.get(q));
  274. } catch (BeansException e) {
  275. log.error("获取name为:{}的bean失败",q);
  276. throw new RuntimeException(e);
  277. }
  278. });
  279. }
  280. }