JobService.java 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513
  1. package com.yihu.wlyy.statistics.service;
  2. import com.yihu.wlyy.statistics.dao.DoctorPatientGroupInfoDao;
  3. import com.yihu.wlyy.statistics.dao.QuartzJobConfigDao;
  4. import com.yihu.wlyy.statistics.dao.QuotaDao;
  5. import com.yihu.wlyy.statistics.dao.SignFamilyDao;
  6. import com.yihu.wlyy.statistics.etl.model.CacheModel;
  7. import com.yihu.wlyy.statistics.etl.mycache.CachePool;
  8. import com.yihu.wlyy.statistics.job.business.QuartzHelper;
  9. import com.yihu.wlyy.statistics.job.cache.CacheCleanJob;
  10. import com.yihu.wlyy.statistics.job.check.CheckSignJob;
  11. import com.yihu.wlyy.statistics.job.check.ReportAllLogJob;
  12. import com.yihu.wlyy.statistics.job.message.FollowupPlanJob;
  13. import com.yihu.wlyy.statistics.job.message.HealthMessageJob;
  14. import com.yihu.wlyy.statistics.job.message.NoticeJob;
  15. import com.yihu.wlyy.statistics.model.doctor.DoctorPatientGroupInfo;
  16. import com.yihu.wlyy.statistics.model.job.QuartzJobConfig;
  17. import com.yihu.wlyy.statistics.model.job.WlyyQuota;
  18. import com.yihu.wlyy.statistics.model.signfamily.SignFamily;
  19. import com.yihu.wlyy.statistics.vo.WlyyJobConfigVO;
  20. import com.yihu.wlyy.statistics.vo.WlyyQuotaVO;
  21. import org.quartz.SchedulerException;
  22. import org.springframework.beans.BeanUtils;
  23. import org.springframework.beans.factory.annotation.Autowired;
  24. import org.springframework.beans.factory.annotation.Value;
  25. import org.springframework.scheduling.annotation.Async;
  26. import org.springframework.stereotype.Service;
  27. import org.springframework.transaction.annotation.Transactional;
  28. import org.springframework.util.StringUtils;
  29. import java.text.ParseException;
  30. import java.text.SimpleDateFormat;
  31. import java.util.*;
  32. /**
  33. * @author chenweida
  34. */
  35. @Service
  36. public class JobService {
  37. @Autowired
  38. private QuartzHelper quartzHelper;
  39. @Autowired
  40. private QuartzJobConfigDao wlyyJobConfigDao;
  41. @Autowired
  42. private QuotaDao quotaDao;
  43. @Autowired
  44. private SignFamilyDao signFamilyDao;
  45. @Autowired
  46. private DoctorPatientGroupInfoDao doctorPatientGroupInfoDao;
  47. @Autowired
  48. private CachePool cachePool;
  49. @Transactional
  50. public void stopById(String id) throws Exception {
  51. QuartzJobConfig quartzJobConfig = wlyyJobConfigDao.findById(id, "1");
  52. if (quartzJobConfig != null) {
  53. quartzHelper.removeJob(quartzJobConfig.getId());
  54. quartzJobConfig.setStatus("0");
  55. } else {
  56. throw new Exception("任务已经停止");
  57. }
  58. }
  59. @Transactional
  60. public void startById(String id) throws Exception {
  61. QuartzJobConfig quartzJobConfig = wlyyJobConfigDao.findById(id, "0");
  62. if (quartzJobConfig != null) {
  63. startOneJob(quartzJobConfig);
  64. } else {
  65. throw new Exception("任务已经启动");
  66. }
  67. }
  68. @Transactional
  69. public void stopAll() throws Exception {
  70. List<QuartzJobConfig> quartzJobConfigs = wlyyJobConfigDao.findByAll("1");
  71. if (quartzJobConfigs != null && quartzJobConfigs.size() > 0) {
  72. for (QuartzJobConfig quartzJobConfig : quartzJobConfigs) {
  73. quartzHelper.removeJob(quartzJobConfig.getId());
  74. quartzJobConfig.setStatus("0");
  75. }
  76. } else {
  77. throw new Exception("任务已经全部停止");
  78. }
  79. }
  80. @Transactional
  81. public void startAll() throws Exception {
  82. List<QuartzJobConfig> quartzJobConfigs = wlyyJobConfigDao.findByAll("0");
  83. if (quartzJobConfigs != null && quartzJobConfigs.size() > 0) {
  84. for (QuartzJobConfig quartzJobConfig : quartzJobConfigs) {
  85. startOneJob(quartzJobConfig);
  86. }
  87. } else {
  88. throw new Exception("任务已经全部启动");
  89. }
  90. }
  91. /**
  92. * 启动单个任务
  93. *
  94. * @param quartzJobConfig
  95. * @throws Exception
  96. */
  97. private void startOneJob(QuartzJobConfig quartzJobConfig) throws Exception {
  98. WlyyQuota wlyyQuota = quotaDao.findOne(quartzJobConfig.getQuotaId());
  99. WlyyQuotaVO wlyyQuotaVO = new WlyyQuotaVO();
  100. WlyyJobConfigVO wlyyJobConfigVO = new WlyyJobConfigVO();
  101. BeanUtils.copyProperties(wlyyQuota, wlyyQuotaVO);
  102. BeanUtils.copyProperties(quartzJobConfig, wlyyJobConfigVO);
  103. Map<String, Object> params = new HashMap<String, Object>();
  104. params.put("quota", wlyyQuotaVO);
  105. params.put("jobConfig", wlyyJobConfigVO);
  106. if (!StringUtils.isEmpty(quartzJobConfig.getJobClass())) {
  107. //往quartz框架添加任务
  108. quartzHelper.addJob(getRightClass(quartzJobConfig), quartzJobConfig.getQuartzCron(), quartzJobConfig.getId(), params);
  109. quartzJobConfig.setStatus("1");//设置任务状态是启动
  110. }
  111. }
  112. public void startNowById(String id) throws Exception {
  113. QuartzJobConfig quartzJobConfig = wlyyJobConfigDao.findOne(id);
  114. WlyyQuota wlyyQuota = quotaDao.findOne(quartzJobConfig.getQuotaId());
  115. WlyyQuotaVO wlyyQuotaVO = new WlyyQuotaVO();
  116. WlyyJobConfigVO wlyyJobConfigVO = new WlyyJobConfigVO();
  117. BeanUtils.copyProperties(wlyyQuota, wlyyQuotaVO);
  118. BeanUtils.copyProperties(quartzJobConfig, wlyyJobConfigVO);
  119. Map<String, Object> params = new HashMap<String, Object>();
  120. params.put("quota", wlyyQuotaVO);
  121. params.put("jobConfig", wlyyJobConfigVO);
  122. //往quartz框架添加任务
  123. if (!StringUtils.isEmpty(quartzJobConfig.getJobClass())) {
  124. quartzHelper.startNow(getRightClass(quartzJobConfig), quartzJobConfig.getId() + UUID.randomUUID().toString().replace("-", ""), params);
  125. }
  126. }
  127. public void productDataByDay(Integer day) throws Exception {
  128. List<QuartzJobConfig> quartzJobConfigs = wlyyJobConfigDao.findByIds();
  129. for (QuartzJobConfig quartzJobConfig : quartzJobConfigs) {
  130. WlyyQuota wlyyQuota = quotaDao.findOne(quartzJobConfig.getQuotaId());
  131. WlyyQuotaVO wlyyQuotaVO = new WlyyQuotaVO();
  132. WlyyJobConfigVO wlyyJobConfigVO = new WlyyJobConfigVO();
  133. BeanUtils.copyProperties(wlyyQuota, wlyyQuotaVO);
  134. BeanUtils.copyProperties(quartzJobConfig, wlyyJobConfigVO);
  135. Map<String, Object> params = new HashMap<String, Object>();
  136. params.put("quota", wlyyQuotaVO);
  137. params.put("jobConfig", wlyyJobConfigVO);
  138. for (int i = 1; i <= day; i++) {
  139. //往quartz框架添加任务
  140. params.put("daybefore", getYesterday(0 - i - 1));
  141. params.put("yesterday", getYesterday(0 - i));
  142. if (!StringUtils.isEmpty(quartzJobConfig.getJobClass())) {
  143. quartzHelper.startNow(getRightClass(quartzJobConfig), quartzJobConfig.getId() + UUID.randomUUID().toString().replace("-", ""), params);
  144. Thread.sleep(20000L);
  145. }
  146. }
  147. }
  148. }
  149. public static String getYesterday(Integer day) {
  150. Calendar cal = Calendar.getInstance();
  151. cal.add(Calendar.DATE, day);
  152. String yesterday = new SimpleDateFormat("yyyy-MM-dd").format(cal.getTime());
  153. return yesterday;
  154. }
  155. public void productDataByOneDay(String yesterday) throws Exception {
  156. SimpleDateFormat dataSimple = new SimpleDateFormat("yyyy-MM-dd");
  157. Date date = dataSimple.parse(yesterday);
  158. if (date == null) {
  159. throw new Exception("时间格式错误");
  160. }
  161. Calendar calendar = new GregorianCalendar();
  162. calendar.setTime(date);
  163. calendar.add(calendar.DATE, -1);//把日期往后增加一天.整数往后推,负数往前移动
  164. Date nowDate = calendar.getTime(); //这个时间就是日期往后推一天的结果
  165. String daybefore = new SimpleDateFormat("yyyy-MM-dd").format(nowDate.getTime());
  166. List<QuartzJobConfig> quartzJobConfigs = wlyyJobConfigDao.findByIds();
  167. for (QuartzJobConfig quartzJobConfig : quartzJobConfigs) {
  168. WlyyQuota wlyyQuota = quotaDao.findOne(quartzJobConfig.getQuotaId());
  169. WlyyQuotaVO wlyyQuotaVO = new WlyyQuotaVO();
  170. WlyyJobConfigVO wlyyJobConfigVO = new WlyyJobConfigVO();
  171. BeanUtils.copyProperties(wlyyQuota, wlyyQuotaVO);
  172. BeanUtils.copyProperties(quartzJobConfig, wlyyJobConfigVO);
  173. Map<String, Object> params = new HashMap<String, Object>();
  174. params.put("quota", wlyyQuotaVO);
  175. params.put("jobConfig", wlyyJobConfigVO);
  176. //往quartz框架添加任务
  177. params.put("daybefore", daybefore);
  178. params.put("yesterday", yesterday);
  179. if (!StringUtils.isEmpty(quartzJobConfig.getJobClass())) {
  180. quartzHelper.startNow(getRightClass(quartzJobConfig), quartzJobConfig.getId() + UUID.randomUUID().toString().replace("-", ""), params);
  181. Thread.sleep(20000L);
  182. }
  183. }
  184. }
  185. /**
  186. * @param quartzJobConfig
  187. * @return
  188. * @throws ClassNotFoundException
  189. */
  190. private Class getRightClass(QuartzJobConfig quartzJobConfig) throws ClassNotFoundException {
  191. return Class.forName(quartzJobConfig.getJobClass());
  192. }
  193. public void productDataByOneDayWithId(String yesterday, String id) throws Exception {
  194. SimpleDateFormat dataSimple = new SimpleDateFormat("yyyy-MM-dd");
  195. Date date = dataSimple.parse(yesterday);
  196. if (date == null) {
  197. throw new Exception("时间格式错误");
  198. }
  199. Calendar calendar = new GregorianCalendar();
  200. calendar.setTime(date);
  201. calendar.add(calendar.DATE, -1);//把日期往后增加一天.整数往后推,负数往前移动
  202. Date nowDate = calendar.getTime(); //这个时间就是日期往后推一天的结果
  203. String daybefore = new SimpleDateFormat("yyyy-MM-dd").format(nowDate.getTime());
  204. QuartzJobConfig quartzJobConfig = wlyyJobConfigDao.findById(id);
  205. if (quartzJobConfig == null) {
  206. throw new Exception("id不存在");
  207. }
  208. WlyyQuota wlyyQuota = quotaDao.findOne(quartzJobConfig.getQuotaId());
  209. WlyyQuotaVO wlyyQuotaVO = new WlyyQuotaVO();
  210. WlyyJobConfigVO wlyyJobConfigVO = new WlyyJobConfigVO();
  211. BeanUtils.copyProperties(wlyyQuota, wlyyQuotaVO);
  212. BeanUtils.copyProperties(quartzJobConfig, wlyyJobConfigVO);
  213. Map<String, Object> params = new HashMap<String, Object>();
  214. params.put("quota", wlyyQuotaVO);
  215. params.put("jobConfig", wlyyJobConfigVO);
  216. //往quartz框架添加任务
  217. params.put("daybefore", daybefore);
  218. params.put("yesterday", yesterday);
  219. if (!StringUtils.isEmpty(quartzJobConfig.getJobClass())) {
  220. quartzHelper.startNow(getRightClass(quartzJobConfig), quartzJobConfig.getId() + UUID.randomUUID().toString().replace("-", ""), params);
  221. Thread.sleep(20000L);
  222. }
  223. }
  224. @Transactional
  225. @Async("dbExtractExecutor")
  226. public void startaaaa() throws Exception {
  227. quartzHelper.startNow(HealthMessageJob.class, UUID.randomUUID().toString().replace("-", ""), new HashMap<>());
  228. }
  229. public void productDataByDayAndId(Integer day, String id) throws Exception {
  230. QuartzJobConfig quartzJobConfig = wlyyJobConfigDao.findById(id);
  231. if (quartzJobConfig == null) {
  232. throw new Exception("id不存在");
  233. }
  234. WlyyQuota wlyyQuota = quotaDao.findOne(quartzJobConfig.getQuotaId());
  235. WlyyQuotaVO wlyyQuotaVO = new WlyyQuotaVO();
  236. WlyyJobConfigVO wlyyJobConfigVO = new WlyyJobConfigVO();
  237. BeanUtils.copyProperties(wlyyQuota, wlyyQuotaVO);
  238. BeanUtils.copyProperties(quartzJobConfig, wlyyJobConfigVO);
  239. Map<String, Object> params = new HashMap<String, Object>();
  240. params.put("quota", wlyyQuotaVO);
  241. params.put("jobConfig", wlyyJobConfigVO);
  242. for (int i = 1; i <= day; i++) {
  243. //往quartz框架添加任务
  244. params.put("daybefore", getYesterday(0 - i - 1));
  245. params.put("yesterday", getYesterday(0 - i));
  246. if (!StringUtils.isEmpty(quartzJobConfig.getJobClass())) {
  247. quartzHelper.startNow(getRightClass(quartzJobConfig), quartzJobConfig.getId() + UUID.randomUUID().toString().replace("-", ""), params);
  248. Thread.sleep(20000L);
  249. }
  250. }
  251. }
  252. public void startCheckSignJob() throws Exception {
  253. if (!quartzHelper.isExistJob(CheckSignJob.jobKey)) {
  254. quartzHelper.addJob(CheckSignJob.class, CheckSignJob.cron, CheckSignJob.jobKey, new HashMap<>());
  255. }
  256. }
  257. public void stopCheckSignJob() throws Exception {
  258. if (quartzHelper.isExistJob(CheckSignJob.jobKey)) {
  259. quartzHelper.removeJob(CheckSignJob.jobKey);
  260. }
  261. }
  262. public void productDataByDayToDay(String start, String end) throws Exception {
  263. SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
  264. Date startDate = sdf.parse(start);
  265. Date endDate = sdf.parse(end);
  266. if (startDate.after(endDate)) {
  267. throw new Exception("日期参数错误");
  268. }
  269. int day = daysBetween(startDate, endDate);
  270. for (int i = 0; i < day; i++) {
  271. productDataByOneDay(getYesterday(i, startDate));
  272. }
  273. }
  274. public static String getYesterday(Integer day, Date startDate) {
  275. Calendar cal = Calendar.getInstance();
  276. cal.setTime(startDate);
  277. cal.add(Calendar.DAY_OF_MONTH, day);
  278. String yesterday = new SimpleDateFormat("yyyy-MM-dd").format(cal.getTime());
  279. return yesterday;
  280. }
  281. public static int daysBetween(Date smdate, Date bdate) throws ParseException {
  282. SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
  283. smdate = sdf.parse(sdf.format(smdate));
  284. bdate = sdf.parse(sdf.format(bdate));
  285. Calendar cal = Calendar.getInstance();
  286. cal.setTime(smdate);
  287. long time1 = cal.getTimeInMillis();
  288. cal.setTime(bdate);
  289. long time2 = cal.getTimeInMillis();
  290. long between_days = (time2 - time1) / (1000 * 3600 * 24);
  291. return Integer.parseInt(String.valueOf(between_days));
  292. }
  293. public void productDataByDayToDayAndId(String start, String end, String id) throws Exception {
  294. SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
  295. Date startDate = sdf.parse(start);
  296. Date endDate = sdf.parse(end);
  297. if (startDate.after(endDate)) {
  298. throw new Exception("日期参数错误");
  299. }
  300. int day = daysBetween(startDate, endDate);
  301. for (int i = 0; i < day; i++) {
  302. productDataByOneDayWithId(getYesterday(i, startDate), id);
  303. }
  304. }
  305. public void startCleanCacheJob() throws Exception {
  306. if (!quartzHelper.isExistJob(CacheCleanJob.jobKey)) {
  307. quartzHelper.addJob(CacheCleanJob.class, CacheCleanJob.cron, CacheCleanJob.jobKey, new HashMap<>());
  308. } else {
  309. throw new Exception("已经启动");
  310. }
  311. }
  312. public void stopCleanCacheJob() throws Exception {
  313. if (quartzHelper.isExistJob(CacheCleanJob.jobKey)) {
  314. quartzHelper.removeJob(CacheCleanJob.jobKey);
  315. } else {
  316. throw new Exception("已经停止");
  317. }
  318. }
  319. public void cleanCache() {
  320. CachePool.cleanAllCache();
  321. }
  322. public String seeCache() {
  323. Map<String, CacheModel> cacheModesCache = CachePool.getArriveSignFamilyExpenseStatus1Map();
  324. Map<String, String> patientGroupCache = CachePool.getPatientGroup();
  325. Map<String, String> healthGroupCache = CachePool.getHealthGroup();
  326. Map<String, List<String>> diseaseGroupCache = CachePool.getDiseaseGroup();
  327. String returnMessage = " 签约缓存:缓存存在" + cacheModesCache.size() + "天的缓存,";
  328. for (Map.Entry<String, CacheModel> entry : cacheModesCache.entrySet()) {
  329. returnMessage += entry.getKey() + ",";
  330. }
  331. returnMessage += "patientGroupCache" + (patientGroupCache.size() > 0 ? "有缓存" : "没有缓存");
  332. returnMessage += "healthGroupCache" + (healthGroupCache.size() > 0 ? "有缓存" : "没有缓存");
  333. returnMessage += "diseaseGroupCache" + (diseaseGroupCache.size() > 0 ? "有缓存" : "没有缓存");
  334. return returnMessage;
  335. }
  336. public void startHealthMessageJob() throws Exception {
  337. if (!quartzHelper.isExistJob(HealthMessageJob.jobKey)) {
  338. quartzHelper.addJob(HealthMessageJob.class, HealthMessageJob.cron, HealthMessageJob.jobKey, new HashMap<>());
  339. } else {
  340. throw new Exception("已经启动");
  341. }
  342. }
  343. public void stopHealthMessageJob() throws Exception {
  344. if (quartzHelper.isExistJob(HealthMessageJob.jobKey)) {
  345. quartzHelper.removeJob(HealthMessageJob.jobKey);
  346. } else {
  347. throw new Exception("已经停止");
  348. }
  349. }
  350. public void productHealthDataByOneDay(String day) throws Exception {
  351. SimpleDateFormat dataSimple = new SimpleDateFormat("yyyy-MM-dd");
  352. Date date = dataSimple.parse(day);
  353. if (date == null) {
  354. throw new Exception("时间格式错误");
  355. }
  356. Calendar calendar = new GregorianCalendar();
  357. calendar.setTime(date);
  358. calendar.add(calendar.DATE, 1);//把日期往后增加一天.整数往后推,负数往前移动
  359. Date nowDate = calendar.getTime(); //这个时间就是日期往后推一天的结果
  360. String yesterday = new SimpleDateFormat("yyyy-MM-dd").format(nowDate.getTime());
  361. Map<String, Object> params = new HashMap<String, Object>();
  362. //往quartz框架添加任务
  363. params.put("now", yesterday);
  364. params.put("yesterday", day);
  365. quartzHelper.startNow(HealthMessageJob.class, HealthMessageJob.jobKey + UUID.randomUUID().toString().replace("-", ""), params);
  366. Thread.sleep(20000L);
  367. }
  368. public void productHealthDataByDayToDay(String start, String end) throws Exception {
  369. SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
  370. Date startDate = sdf.parse(start);
  371. Date endDate = sdf.parse(end);
  372. if (startDate.after(endDate)) {
  373. throw new Exception("日期参数错误");
  374. }
  375. int day = daysBetween(startDate, endDate);
  376. for (int i = 0; i < day; i++) {
  377. productHealthDataByOneDay(getYesterday(i, startDate));
  378. }
  379. }
  380. public static void main(String[] args) throws Exception {
  381. SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
  382. Date startDate = sdf.parse("2016-10-20");
  383. Date endDate = sdf.parse("2016-10-28");
  384. System.out.println(daysBetween(startDate, endDate));
  385. System.out.println(getYesterday(0, startDate));
  386. }
  387. public void startEveryDayReportJob() throws Exception {
  388. if (!quartzHelper.isExistJob(ReportAllLogJob.jobKey)) {
  389. quartzHelper.addJob(ReportAllLogJob.class, ReportAllLogJob.cron, ReportAllLogJob.jobKey, new HashMap<>());
  390. } else {
  391. throw new Exception("已经启动");
  392. }
  393. }
  394. public void stopEveryDayReportJob() throws Exception {
  395. if (quartzHelper.isExistJob(ReportAllLogJob.jobKey)) {
  396. quartzHelper.removeJob(ReportAllLogJob.jobKey);
  397. } else {
  398. throw new Exception("已经停止");
  399. }
  400. }
  401. public void startNoticeJob() throws Exception {
  402. if (!quartzHelper.isExistJob(NoticeJob.jobKey)) {
  403. quartzHelper.addJob(NoticeJob.class, NoticeJob.jobCron, NoticeJob.jobKey, new HashMap<>());
  404. // quartzHelper.startNow(NoticeJob.class, UUID.randomUUID().toString().replace("-", ""), new HashMap<>());
  405. } else {
  406. throw new Exception("已经启动");
  407. }
  408. }
  409. public void stopNoticeJob() throws Exception {
  410. if (quartzHelper.isExistJob(NoticeJob.jobKey)) {
  411. quartzHelper.removeJob(NoticeJob.jobKey);
  412. } else {
  413. throw new Exception("已经停止");
  414. }
  415. }
  416. /*******************************
  417. * 随访计划任务
  418. *******************************************************/
  419. @Value("${spring.followupMessage.jobId}")
  420. private String followupJob;
  421. @Value("${spring.followupMessage.cron}")
  422. private String followupJobCron;
  423. public void startFollowupPlantJob() throws Exception {
  424. if (!quartzHelper.isExistJob(followupJob)) {
  425. quartzHelper.addJob(FollowupPlanJob.class, followupJobCron, followupJob, new HashMap<>());
  426. } else {
  427. throw new Exception("已经启动");
  428. }
  429. }
  430. public void stopFollowupPlantJob() throws Exception {
  431. if (quartzHelper.isExistJob(followupJob)) {
  432. quartzHelper.removeJob(followupJob);
  433. } else {
  434. throw new Exception("已经停止");
  435. }
  436. }
  437. public void startNoticeJobNow() throws Exception {
  438. quartzHelper.startNow(NoticeJob.class, UUID.randomUUID().toString(), new HashMap<>());
  439. }
  440. public void startHealthMessageJobNow() throws Exception {
  441. quartzHelper.startNow(HealthMessageJob.class, UUID.randomUUID().toString(), new HashMap<>());
  442. }
  443. }