Browse Source

Merge branch 'dev' of http://192.168.1.220:10080/Amoy/patient-co-management into dev-1.3.6.1

trick9191 7 years ago
parent
commit
741793e368

+ 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.sql.Time;
import java.text.SimpleDateFormat;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.Date;
import java.util.List;
import java.util.List;
@ -46,8 +47,12 @@ public class DoctorFeldsherTemplateJob implements Job {
        try {
        try {
            //获取居民在监测方案的监测时间前30分钟未上传监测数据
            //获取居民在监测方案的监测时间前30分钟未上传监测数据
            SimpleDateFormat formatHour = new SimpleDateFormat("HH:mm:ss");
            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) {
            for (DoctorSchemeBloodSugger patientCodeLis : patientCodeList) {
                String schemecode = patientCodeLis.getCode();
                String schemecode = patientCodeLis.getCode();
@ -66,7 +71,7 @@ public class DoctorFeldsherTemplateJob implements Job {
                short beforeSleep = patientCodeLis.getBeforeSleep();
                short beforeSleep = patientCodeLis.getBeforeSleep();
                Time beforeSleepTime = patientCodeLis.getBeforeSleepTime();
                Time beforeSleepTime = patientCodeLis.getBeforeSleepTime();
                String toDay = formatHour.format(new Date());
                String toDay = formatHour.format(today);
                long to = formatHour.parse(toDay).getTime();
                long to = formatHour.parse(toDay).getTime();
                if (beforeBreakfast == 1) {
                if (beforeBreakfast == 1) {
                    Time tempTime = Time.valueOf("00:00:00");
                    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) {
            for (DoctorSchemeBloodPressure patientCodeLis : patientCodes) {
                String schemecode = patientCodeLis.getCode();
                String schemecode = patientCodeLis.getCode();
@ -157,7 +162,7 @@ public class DoctorFeldsherTemplateJob implements Job {
                short night = patientCodeLis.getNight();
                short night = patientCodeLis.getNight();
                Time nightTime = patientCodeLis.getNightTime();
                Time nightTime = patientCodeLis.getNightTime();
//                比较现在时间和监测时间《=30
//                比较现在时间和监测时间《=30
                String toDay = formatHour.format(new Date());
                String toDay = formatHour.format(today);
                long to = formatHour.parse(toDay).getTime();
                long to = formatHour.parse(toDay).getTime();
                if (earlyMorning == 1) {
                if (earlyMorning == 1) {
                    Time tempTime = Time.valueOf("00:00:00");
                    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> {
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查询患者监测方案
    //根据schemecode查询患者监测方案
    @Query(" select p from PatientSchemeList p where p.schemecode = ?1 and p.type = ?2 ")
    @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);
                    int end = url.indexOf("&", start + 1);
                    String touser = url.substring(start, end);
                    String touser = url.substring(start, end);
                    url = url.replace(touser, "&toUser=" + member.getCode());
                    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患者姓名
                    //name患者姓名
                    sendJson.put("first", weiXinOpenIdUtils.getTitleMes(people, (int) j.get("relation"), name) + first);
                    sendJson.put("first", weiXinOpenIdUtils.getTitleMes(people, (int) j.get("relation"), name) + first);
                    sendJson.put("url", url);
                    sendJson.put("url", url);
@ -106,10 +106,10 @@ public class DoctorFeldsherTemplateService extends BaseService {
                    int end = url.indexOf("&", start + 1);
                    int end = url.indexOf("&", start + 1);
                    String touser = url.substring(start, end);
                    String touser = url.substring(start, end);
                    url = url.replace(touser, "&toUser=" + member.getCode());
                    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患者姓名
                    //name患者姓名
                    sendJson.put("first", weiXinOpenIdUtils.getTitleMes(people, (int) j.get("relation"), name) + first);
                    sendJson.put("first", weiXinOpenIdUtils.getTitleMes(people, (int) j.get("relation"), name) + first);
                    sendJson.put("url", url);
                    sendJson.put("url", url);

+ 1 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/scheme/DoctorSchemeService.java

@ -80,7 +80,7 @@ public class DoctorSchemeService {
        }
        }
        if(StringUtils.isNotBlank(diseaseCondition)){
        if(StringUtils.isNotBlank(diseaseCondition)){
            sql = sql + " and p.diseaseCondition IN ("+diseaseCondition +")";
            sql = sql + " and p.disease_condition IN ("+diseaseCondition +")";
        }
        }
        if(-1 != deviceType){
        if(-1 != deviceType){
@ -265,7 +265,6 @@ public class DoctorSchemeService {
        String content = dataObj.getString("content");
        String content = dataObj.getString("content");
        String doctorcode = dataObj.getString("doctorcode");
        String doctorcode = dataObj.getString("doctorcode");
        JSONArray datalist = dataObj.getJSONArray("list");
        JSONArray datalist = dataObj.getJSONArray("list");
        JSONArray patientcodes = dataObj.getJSONArray("patientcodes");
        for (int i = 0; i < datalist.size(); i++) {
        for (int i = 0; i < datalist.size(); i++) {

+ 7 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/common/account/PatientService.java

@ -807,8 +807,13 @@ public class PatientService extends TokenService {
                "   SELECT " +
                "   SELECT " +
                "    f.`code` " +
                "    f.`code` " +
                "   FROM " +
                "   FROM " +
                "    wlyy_sign_family f " +
                "   WHERE " +
                "    wlyy_sign_family f " ;
        if(StringUtils.isNotBlank(diseaseCondition)){
            totalGSql = totalGSql + " ,wlyy_patient p WHERE f.patient = p.code AND p.disease_condition = "+diseaseCondition +" AND ";
        }else{
            totalGSql = totalGSql + " WHERE ";
        }
            totalGSql= totalGSql +
                "    ( " +
                "    ( " +
                "     f.doctor = '" + doctor + "' " +
                "     f.doctor = '" + doctor + "' " +
                "     OR f.doctor_health = '" + doctor + "' " +
                "     OR f.doctor_health = '" + doctor + "' " +

+ 3 - 3
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/patient/SignPatientLabelInfoController.java

@ -171,8 +171,8 @@ public class SignPatientLabelInfoController extends BaseController {
                return write(200, "查询成功", "data", jsonObject);
                return write(200, "查询成功", "data", jsonObject);
            }
            }
//            JSONArray result = labelInfoService.getPatientByLabel(getUID(), labelCode, labelType, teamCode, page, pagesize,isSlowDisease,diseaseCondition);
            JSONArray result = labelInfoService.getPatientByLabel("xh1D201703150222", labelCode, labelType, teamCode, page, pagesize,isSlowDisease,diseaseCondition);
            JSONArray result = labelInfoService.getPatientByLabel(getUID(), labelCode, labelType, teamCode, page, pagesize,isSlowDisease,diseaseCondition);
//            JSONArray result = labelInfoService.getPatientByLabel("xh1D201703150222", labelCode, labelType, teamCode, page, pagesize,isSlowDisease,diseaseCondition);
            return write(200, "查询成功", "data", result);
            return write(200, "查询成功", "data", result);
        } catch (Exception e) {
        } catch (Exception e) {
@ -306,7 +306,7 @@ public class SignPatientLabelInfoController extends BaseController {
            if (labelType.equals("1") && teamCode != 0L) {
            if (labelType.equals("1") && teamCode != 0L) {
                JSONArray r = patientService.getSignByDoctorCodeGpbyServer(getUID(), teamCode + "",isSlowDisease,diseaseCondition);
                JSONArray r = patientService.getSignByDoctorCodeGpbyServer(getUID(), teamCode + "",isSlowDisease,diseaseCondition);
                //JSONArray r= patientService.getSignByDoctorCodeGpbyServer("xh1D201703150222",teamCode+"");
//                JSONArray r= patientService.getSignByDoctorCodeGpbyServer("xy201703150222",teamCode + "",isSlowDisease,diseaseCondition);
                return write(200, "查询成功", "data", r);
                return write(200, "查询成功", "data", r);
            }
            }