Ver código fonte

居民监测方案提醒

wujunjie 7 anos atrás
pai
commit
656182b2a1

+ 9 - 4
patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/job/DoctorFeldsherTemplateJob.java

@ -18,6 +18,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import java.sql.Time;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
@ -46,8 +47,12 @@ public class DoctorFeldsherTemplateJob implements Job {
        try {
            //获取居民在监测方案的监测时间前30分钟未上传监测数据
            SimpleDateFormat formatHour = new SimpleDateFormat("HH:mm:ss");
            Date today = new Date();
            Calendar c=Calendar.getInstance();
            c.setTime(today);
            int weekday=c.get(Calendar.DAY_OF_WEEK);
            List<DoctorSchemeBloodSugger> patientCodeList = schemeListDao.findSuggerPatient();
            List<DoctorSchemeBloodSugger> patientCodeList = schemeListDao.findSuggerPatient((short)weekday);
            for (DoctorSchemeBloodSugger patientCodeLis : patientCodeList) {
                String schemecode = patientCodeLis.getCode();
@ -66,7 +71,7 @@ public class DoctorFeldsherTemplateJob implements Job {
                short beforeSleep = patientCodeLis.getBeforeSleep();
                Time beforeSleepTime = patientCodeLis.getBeforeSleepTime();
                String toDay = formatHour.format(new Date());
                String toDay = formatHour.format(today);
                long to = formatHour.parse(toDay).getTime();
                if (beforeBreakfast == 1) {
                    Time tempTime = Time.valueOf("00:00:00");
@ -142,7 +147,7 @@ public class DoctorFeldsherTemplateJob implements Job {
                }
            }
            List<DoctorSchemeBloodPressure> patientCodes = schemeListDao.findPressurePatient();
            List<DoctorSchemeBloodPressure> patientCodes = schemeListDao.findPressurePatient((short)weekday);
            for (DoctorSchemeBloodPressure patientCodeLis : patientCodes) {
                String schemecode = patientCodeLis.getCode();
@ -157,7 +162,7 @@ public class DoctorFeldsherTemplateJob implements Job {
                short night = patientCodeLis.getNight();
                Time nightTime = patientCodeLis.getNightTime();
//                比较现在时间和监测时间《=30
                String toDay = formatHour.format(new Date());
                String toDay = formatHour.format(today);
                long to = formatHour.parse(toDay).getTime();
                if (earlyMorning == 1) {
                    Time tempTime = Time.valueOf("00:00:00");

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

@ -13,13 +13,13 @@ import java.util.List;
public interface PatientSchemeListDao extends PagingAndSortingRepository<PatientSchemeList, Long>, JpaSpecificationExecutor<PatientSchemeList> {
    //联合wlyy_patient_scheme_list和wlyy_doctor_scheme_blood_pressure查询有血糖监测方案且在监测时间前十分钟未上传监测数据
    @Query(value = " select s from PatientSchemeList p,DoctorSchemeBloodSugger s where p.schemecode=s.code and p.type = 1 and s.alertTag = 1 ")
    List<DoctorSchemeBloodSugger> findSuggerPatient();
    //联合wlyy_patient_scheme_list和wlyy_doctor_scheme_blood_pressure查询当天有血糖监测方案且在监测时间前十分钟未上传监测数据
    @Query(value = " select s from PatientSchemeList p,DoctorSchemeBloodSugger s where p.schemecode=s.code and p.type = 1 and s.alertTag = 1 and s.dayofweek = ?1 ")
    List<DoctorSchemeBloodSugger> findSuggerPatient(short dayOfWeek);
    //联合wlyy_patient_scheme_list和wlyy_doctor_scheme_blood_pressure查询有血压监测方案且在监测时间前十分钟未上传监测数据
    @Query(" select s from PatientSchemeList p,DoctorSchemeBloodPressure s where p.schemecode=s.code and p.type=2 and s.alertTag = 1 ")
    List<DoctorSchemeBloodPressure> findPressurePatient();
    //联合wlyy_patient_scheme_list和wlyy_doctor_scheme_blood_pressure查询当天有血压监测方案且在监测时间前十分钟未上传监测数据
    @Query(" select s from PatientSchemeList p,DoctorSchemeBloodPressure s where p.schemecode=s.code and p.type=2 and s.alertTag = 1 and s.dayofweek = ?1 ")
    List<DoctorSchemeBloodPressure> findPressurePatient(short dayOfWeek);
    //根据schemecode查询患者监测方案
    @Query(" select p from PatientSchemeList p where p.schemecode = ?1 and p.type = ?2 ")

+ 8 - 8
patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/service/template/DoctorFeldsherTemplateService.java

@ -73,10 +73,10 @@ public class DoctorFeldsherTemplateService extends BaseService {
                    int end = url.indexOf("&", start + 1);
                    String touser = url.substring(start, end);
                    url = url.replace(touser, "&toUser=" + member.getCode());
                    int representedStart = url.indexOf("&represented=");
                    int representedEnd = url.length();
                    String represented = url.substring(representedStart, representedEnd);
                    url = url.replace(represented, "&represented=" + member.getCode());
//                    int representedStart = url.indexOf("&represented=");
//                    int representedEnd = url.length();
//                    String represented = url.substring(representedStart, representedEnd);
//                    url = url.replace(represented, "&represented=" + member.getCode());
                    //name患者姓名
                    sendJson.put("first", weiXinOpenIdUtils.getTitleMes(people, (int) j.get("relation"), name) + first);
                    sendJson.put("url", url);
@ -106,10 +106,10 @@ public class DoctorFeldsherTemplateService extends BaseService {
                    int end = url.indexOf("&", start + 1);
                    String touser = url.substring(start, end);
                    url = url.replace(touser, "&toUser=" + member.getCode());
                    int representedStart = url.indexOf("&represented=");
                    int representedEnd = url.length();
                    String represented = url.substring(representedStart, representedEnd);
                    url = url.replace(represented, "&represented=" + member.getCode());
//                    int representedStart = url.indexOf("&represented=");
//                    int representedEnd = url.length();
//                    String represented = url.substring(representedStart, representedEnd);
//                    url = url.replace(represented, "&represented=" + member.getCode());
                    //name患者姓名
                    sendJson.put("first", weiXinOpenIdUtils.getTitleMes(people, (int) j.get("relation"), name) + first);
                    sendJson.put("url", url);