ApplicationEvent.java 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. package com.yihu.jw.event;
  2. import com.yihu.jw.job.DataUploadJob;
  3. import com.yihu.jw.job.PrescriptionOverdueJob;
  4. import com.yihu.jw.job.PrescriptionStatusUpdateJob;
  5. import com.yihu.jw.job.QuartzHelper;
  6. import com.yihu.jw.util.SystemConf;
  7. import org.slf4j.Logger;
  8. import org.slf4j.LoggerFactory;
  9. import org.springframework.beans.factory.annotation.Autowired;
  10. import org.springframework.context.ApplicationListener;
  11. import org.springframework.context.event.ContextRefreshedEvent;
  12. import org.springframework.stereotype.Service;
  13. import java.util.HashMap;
  14. /**
  15. * Created by zdm on 2017/3/10.
  16. */
  17. @Service
  18. public class ApplicationEvent implements ApplicationListener<ContextRefreshedEvent> {
  19. private Logger logger = LoggerFactory.getLogger(ApplicationEvent.class);
  20. @Autowired
  21. QuartzHelper quartzHelper;
  22. @Override
  23. public void onApplicationEvent(ContextRefreshedEvent ContextRefreshedEvent) {
  24. try {
  25. //=================中山医院发布启动======================================================
  26. // //互联网医院处方状态更新job
  27. // if (!quartzHelper.isExistJob("prescriptionStatus_update_job")) {
  28. // String trigger = SystemConf.getInstance().getSystemProperties().getProperty("prescriptionStatus_update_job");
  29. // quartzHelper.addJob(PrescriptionStatusUpdateJob.class, trigger, "prescriptionStatus_update_job", new HashMap<String, Object>());
  30. // logger.info("prescriptionStatus_update_job job success");
  31. // } else {
  32. // logger.info("prescriptionStatus_update_job job exist");
  33. // }
  34. //
  35. // //门诊过期
  36. // if (!quartzHelper.isExistJob("prescription_overdue_job")) {
  37. // String trigger = SystemConf.getInstance().getSystemProperties().getProperty("prescription_overdue_job");
  38. // quartzHelper.addJob(PrescriptionOverdueJob.class, trigger, "prescription_overdue_job", new HashMap<String, Object>());
  39. // logger.info("prescription_overdue_job job success");
  40. // } else {
  41. // logger.info("prescription_overdue_job job exist");
  42. // }
  43. //
  44. //
  45. // //互联网医院 监管平台上报
  46. // if (!quartzHelper.isExistJob("data_upload_job")) {
  47. // String trigger = SystemConf.getInstance().getSystemProperties().getProperty("data_upload_job");
  48. // quartzHelper.addJob(DataUploadJob.class, trigger, "data_upload_job", new HashMap<String, Object>());
  49. // logger.info("data_upload_job job success");
  50. // } else {
  51. // logger.info("data_upload_job job exist");
  52. // }
  53. //=================中山医院发布启动======================================================
  54. } catch (Exception e) {
  55. logger.info("followup_plan_remind job start failed");
  56. }
  57. }
  58. }