Ver código fonte

Merge branch 'dev' of http://192.168.1.220:10080/Amoy2/wlyy2.0 into dev

wangzhinan 4 anos atrás
pai
commit
199df20ea9

+ 1 - 1
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/dao/OutpatientDao.java

@ -41,7 +41,7 @@ public interface OutpatientDao extends PagingAndSortingRepository<WlyyOutpatient
    @Query("select count(id) from  WlyyOutpatientDO a where a.outpatientType = ?1 and a.doctor = ?2 and a.admDate >=?3 and a.admDate <=?4")
    Integer countByTime(String type,String doctor,Date startTime,Date endTime);
    @Query("from WlyyOutpatientDO a where a.status = 0 and a.payStatus = 1 and a.remindCount<?1 ")
    @Query("from WlyyOutpatientDO a where a.status = 0 and a.payStatus = 1 and (a.remindCount<?1 or a.remindCount is null)")
    List<WlyyOutpatientDO> findWaitingOutpatient(Integer remindCount);
    /*@Query("from WlyyOutpatientDO a where a.patient = ?1 and a.outpatientType = 1")

+ 7 - 5
svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/util/AutoTimeOutRemind.java

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