|  | @ -32,7 +32,7 @@ import java.util.List;
 | 
												
													
														
															|  | public class AutoTimeOutRemind implements SchedulingConfigurer {
 |  | public class AutoTimeOutRemind implements SchedulingConfigurer {
 | 
												
													
														
															|  |     private static final Logger logger = LoggerFactory.getLogger(AutoTimeOutRemind.class);
 |  |     private static final Logger logger = LoggerFactory.getLogger(AutoTimeOutRemind.class);
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  |     private static String cron;
 |  | 
 | 
												
													
														
															|  | 
 |  |     private static String cron = "0 0/1 * * * ?";
 | 
												
													
														
															|  |     private static String dictName = "remind_patient_job";
 |  |     private static String dictName = "remind_patient_job";
 | 
												
													
														
															|  |     @Autowired
 |  |     @Autowired
 | 
												
													
														
															|  |     private WlyyHospitalSysDictDao wlyyHospitalSysDictDao;
 |  |     private WlyyHospitalSysDictDao wlyyHospitalSysDictDao;
 | 
												
											
												
													
														
															|  | @ -45,7 +45,7 @@ public class AutoTimeOutRemind implements SchedulingConfigurer {
 | 
												
													
														
															|  |     @Value("${wechat.ids}")
 |  |     @Value("${wechat.ids}")
 | 
												
													
														
															|  |     private String wxId;
 |  |     private String wxId;
 | 
												
													
														
															|  |     public AutoTimeOutRemind() {
 |  |     public AutoTimeOutRemind() {
 | 
												
													
														
															|  |       cron = "0 /5 * * * ?";
 |  | 
 | 
												
													
														
															|  | 
 |  |       cron = "0 0/1 * * * ?";
 | 
												
													
														
															|  |         System.out.println("创建时的corn"+cron);
 |  |         System.out.println("创建时的corn"+cron);
 | 
												
													
														
															|  |     }
 |  |     }
 | 
												
													
														
															|  |     public String change(String corIn){
 |  |     public String change(String corIn){
 | 
												
											
												
													
														
															|  | @ -88,7 +88,7 @@ public class AutoTimeOutRemind implements SchedulingConfigurer {
 | 
												
													
														
															|  |                 if (null!=wlyyOutpatientDOS){
 |  |                 if (null!=wlyyOutpatientDOS){
 | 
												
													
														
															|  |                     for (WlyyOutpatientDO wlyyOutpatientDO:wlyyOutpatientDOS){
 |  |                     for (WlyyOutpatientDO wlyyOutpatientDO:wlyyOutpatientDOS){
 | 
												
													
														
															|  |                         long patientTime = wlyyOutpatientDO.getCreateTime().getTime();
 |  |                         long patientTime = wlyyOutpatientDO.getCreateTime().getTime();
 | 
												
													
														
															|  |                         Integer currentRemindCount = wlyyOutpatientDO.getRemindCount();
 |  | 
 | 
												
													
														
															|  | 
 |  |                         Integer currentRemindCount = null==wlyyOutpatientDO.getRemindCount()?0:wlyyOutpatientDO.getRemindCount();
 | 
												
													
														
															|  |                         logger.info("接诊创建时间="+patientTime);
 |  |                         logger.info("接诊创建时间="+patientTime);
 | 
												
													
														
															|  |                         List<WlyyHospitalSysDictDO> wlyyHospitalSysDictDOS = wlyyHospitalSysDictDao.findByDictName("outpatient_timeout_remind");
 |  |                         List<WlyyHospitalSysDictDO> wlyyHospitalSysDictDOS = wlyyHospitalSysDictDao.findByDictName("outpatient_timeout_remind");
 | 
												
													
														
															|  |                         if (wlyyHospitalSysDictDOS.size()>0){
 |  |                         if (wlyyHospitalSysDictDOS.size()>0){
 | 
												
											
												
													
														
															|  | @ -98,6 +98,9 @@ public class AutoTimeOutRemind implements SchedulingConfigurer {
 | 
												
													
														
															|  |                         logger.info("当前时间="+currentTime);
 |  |                         logger.info("当前时间="+currentTime);
 | 
												
													
														
															|  |                         logger.info("数据库配置时间=0"+timeCount);
 |  |                         logger.info("数据库配置时间=0"+timeCount);
 | 
												
													
														
															|  |                         if (currentTime-patientTime>timeCount*60*1000){
 |  |                         if (currentTime-patientTime>timeCount*60*1000){
 | 
												
													
														
															|  | 
 |  |                             wlyyOutpatientDO.setRemindCount(currentRemindCount+1);
 | 
												
													
														
															|  | 
 |  |                             System.out.println("remind_count"+currentRemindCount+1);
 | 
												
													
														
															|  | 
 |  |                             outpatientDao.save(wlyyOutpatientDO);
 | 
												
													
														
															|  |                             logger.info("--便利发送消息");
 |  |                             logger.info("--便利发送消息");
 | 
												
													
														
															|  |                             reciverId = wlyyOutpatientDO.getPatient();
 |  |                             reciverId = wlyyOutpatientDO.getPatient();
 | 
												
													
														
															|  |                             logger.info("---发送人id"+senderId);
 |  |                             logger.info("---发送人id"+senderId);
 | 
												
											
												
													
														
															|  | @ -107,8 +110,7 @@ public class AutoTimeOutRemind implements SchedulingConfigurer {
 | 
												
													
														
															|  |                             logger.info("--发送结束");
 |  |                             logger.info("--发送结束");
 | 
												
													
														
															|  |                             logger.info("--模板发送开始");
 |  |                             logger.info("--模板发送开始");
 | 
												
													
														
															|  |                             prescriptionService.sendWxTemplateMsg(wxId,wlyyOutpatientDO.getId(),null,null,"outPatientTimeOutRemind","");
 |  |                             prescriptionService.sendWxTemplateMsg(wxId,wlyyOutpatientDO.getId(),null,null,"outPatientTimeOutRemind","");
 | 
												
													
														
															|  |                             wlyyOutpatientDO.setRemindCount(currentRemindCount+1);
 |  | 
 | 
												
													
														
															|  |                             outpatientDao.save(wlyyOutpatientDO);
 |  | 
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  |                         }
 |  |                         }
 | 
												
													
														
															|  |                     }
 |  |                     }
 | 
												
													
														
															|  |                 }
 |  |                 }
 |