JobService.java 20 KB

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