Pārlūkot izejas kodu

监测方案提醒

wujunjie 7 gadi atpakaļ
vecāks
revīzija
e391a4cd9d

+ 19 - 12
patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/job/DoctorFeldsherTemplateJob.java

@ -52,6 +52,7 @@ public class DoctorFeldsherTemplateJob implements Job {
            c.setTime(today);
            int weekday=c.get(Calendar.DAY_OF_WEEK);
            //查询当天医生设置的监测方案
            List<DoctorSchemeBloodSugger> patientCodeList = schemeListDao.findSuggerPatient((short)weekday);
            for (DoctorSchemeBloodSugger patientCodeLis : patientCodeList) {
                String schemecode = patientCodeLis.getCode();
@ -240,21 +241,27 @@ public class DoctorFeldsherTemplateJob implements Job {
        Date today = new Date();
        if (minutes <= 30 && minutes > 0) {
            PatientSchemeList patient = schemeListDao.findPatientBySchemecode(schemecode,type);
            String patientCode = patient.getPatientcode();
            //查询使用同一套监测方案的所有居民
            List<PatientSchemeList> patientList = schemeListDao.findPatientBySchemecode(schemecode,type);
            for (PatientSchemeList patient :patientList) {
                String patientCode = patient.getPatientcode();
            String day = formatDay.format(today);
            Date begin = formatTime.parse(day + beginTime);
            Date end = formatTime.parse(day + endTime);
            List<DevicePatientHealthIndex> healthIndices = patientHealthIndexDao.findByPatient(patientCode, type, begin, end);
            if (healthIndices==null || healthIndices.size()==0) {
                try {
                    //为居民发送监测代办事项提醒消息
                    feldsherTemplateService.sendChangeTemplate(type, patientCode, comment);
                } catch (Exception e) {
                    logger.info("DoctorFeldsherTemplateJob error ..........continue this JOB,CODE:" + patientCode + ",message:" + e.getMessage());
                String day = formatDay.format(today);
                Date begin = formatTime.parse(day + beginTime);
                Date end = formatTime.parse(day + endTime);
                //查询监测提醒时间段居民是否有对应设备数据上传
                List<DevicePatientHealthIndex> healthIndices = patientHealthIndexDao.findByPatient(patientCode, type, begin, end);
                if (healthIndices==null || healthIndices.size()==0) {
                    try {
                        //为居民发送监测代办事项提醒消息
                        feldsherTemplateService.sendChangeTemplate(type, patientCode, comment);
                    } catch (Exception e) {
                        logger.info("DoctorFeldsherTemplateJob error ..........continue this JOB,CODE:" + patientCode + ",message:" + e.getMessage());
                    }
                }
            }
        }
    }
}

+ 1 - 1
patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/repository/patient/PatientSchemeListDao.java

@ -23,5 +23,5 @@ public interface PatientSchemeListDao extends PagingAndSortingRepository<Patient
    //根据schemecode查询患者监测方案
    @Query(" select p from PatientSchemeList p where p.schemecode = ?1 and p.type = ?2 ")
    PatientSchemeList findPatientBySchemecode(String schemecode,Integer type);
    List<PatientSchemeList> findPatientBySchemecode(String schemecode,Integer type);
}