Sfoglia il codice sorgente

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

wujunjie 7 anni fa
parent
commit
dffae783b5
15 ha cambiato i file con 191 aggiunte e 96 eliminazioni
  1. 1 1
      common/common-entity/src/main/java/com/yihu/wlyy/entity/doctor/reply/DoctorQuickReply.java
  2. 3 2
      common/common-entity/src/main/java/com/yihu/wlyy/entity/patient/prescription/PrescriptionFollowupContent.java
  3. 1 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/doctor/DoctorQuickReplyDao.java
  4. 5 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/followup/FollowUpDao.java
  5. 53 39
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/consult/ConsultTeamService.java
  6. 1 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/followup/FollowUpService.java
  7. 91 36
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/prescription/PrescriptionFollowupContentService.java
  8. 9 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/prescription/PrescriptionInfoService.java
  9. 16 5
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/reply/DoctorQuickReplyService.java
  10. 1 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/statisticsES/StatisticsESService.java
  11. 4 4
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/consult/DoctorConsultController.java
  12. 2 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/reply/DoctorQuickReplyController.java
  13. 2 2
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/prescription/PatientPrescriptionFollowupContentController.java
  14. 1 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/statistic/EsStatisticsController.java
  15. 1 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/statistic/StatisticsController.java

+ 1 - 1
common/common-entity/src/main/java/com/yihu/wlyy/entity/doctor/reply/DoctorQuickReply.java

@ -25,7 +25,7 @@ public class DoctorQuickReply extends IdEntity {
    private Integer status;
    // 类型 0为健康教育,1为续方咨询
    private Integer type;
    // 0为自定义消息  大于0的为系统消息
    // 0为自定义消息  大于1为系统消息(1体征和生活方式 2症状 3血糖 4血压)
    private Integer systag;
    public String getDoctor() {

+ 3 - 2
common/common-entity/src/main/java/com/yihu/wlyy/entity/patient/prescription/PrescriptionFollowupContent.java

@ -1,10 +1,10 @@
package com.yihu.wlyy.entity.patient.prescription;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yihu.wlyy.entity.IdEntity;
import javax.persistence.*;
import java.sql.Date;
import java.sql.Timestamp;
import java.util.Date;
/**
 * 续方咨询随访问卷表
@ -85,6 +85,7 @@ public class PrescriptionFollowupContent extends IdEntity {
	
	@Basic
	@Column(name = "create_time")
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
	public Date getCreateTime() {
		return createTime;
	}

+ 1 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/doctor/DoctorQuickReplyDao.java

@ -32,6 +32,6 @@ public interface DoctorQuickReplyDao extends PagingAndSortingRepository<DoctorQu
    @Query("select q from DoctorQuickReply q where q.doctor = ?1 and q.status = 1")
    List<DoctorQuickReply> findDoctorReplies(String doctor, Sort sort);
    
    @Query("select q from DoctorQuickReply q where q.doctor = ?1 and q.status = 1")
    @Query("select q from DoctorQuickReply q where q.doctor = ?1 and q.type = ?2 and q.status = 1")
    List<DoctorQuickReply> findDoctorRepliesByType(String doctor, Integer type ,Sort sort);
}

+ 5 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/followup/FollowUpDao.java

@ -9,6 +9,7 @@ import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
@ -71,4 +72,8 @@ public interface FollowUpDao extends PagingAndSortingRepository<Followup, Long>,
     */
    @Query("select a from Followup a where a.prescriptionCode = ?1 and a.status <> '0'")
	Followup getFollowupByPrescriptionCode(String prescriptionCode);
    
    @Modifying
    @Query("update Followup a set a.status=?2 where a.prescriptionCode = ?1 ")
    void updateStatusByPrescriptionCode(String prescriptionCode, Integer status);
}

+ 53 - 39
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/consult/ConsultTeamService.java

@ -1009,38 +1009,38 @@ public class ConsultTeamService extends ConsultService {
            //3、获取上次续方时间:与平安的“智慧医保的审方系统”对接,判断居民上次续方时间,点击跳转上次续方记录。(此功能需与第三方系统对接,如果本次版本无法实现,则消息中不显示此条信息)
            jsonObject.put("lastTime","");
    
            //--增加问卷填写情况---huangwenjie--2017.11.01
            List<PrescriptionFollowupContent> prescriptionFollowupContents =prescriptionFollowupContentDao.findByPrescriptionCode(prescription.getCode());
            boolean zzFlag = false;//是否填写症状问卷
            boolean tzssFlag = false;//是否填写体征和生活问卷
            for (PrescriptionFollowupContent prescriptionFollowupContent: prescriptionFollowupContents) {
                if(!zzFlag && "1".equals(prescriptionFollowupContent.getFollowupProject())){
                    zzFlag = true;
                }
    
                if(!tzssFlag &&
                        ("2".equals(prescriptionFollowupContent.getFollowupProject())
                                || "4".equals(prescriptionFollowupContent.getFollowupProject()))
                        ){
                    zzFlag = true;
                }
                
                if(zzFlag && tzssFlag){
                    break;
                }
            }
            if(zzFlag){
                jsonObject.put("zzMsg","居民已填写问卷");
            }else{
                jsonObject.put("zzMsg","居民未填写问卷");
            }
            if(tzssFlag){
                jsonObject.put("tzssMsg","居民已填写问卷");
            }else{
                jsonObject.put("tzssMsg","居民未填写问卷");
            }
            jsonObject.put("zzFlag",zzFlag);
            jsonObject.put("tzssFlag",tzssFlag);
//            //--增加问卷填写情况---huangwenjie--2017.11.01---已和产品确认,这块消息不在续方咨询消息中添加
//            List<PrescriptionFollowupContent> prescriptionFollowupContents =prescriptionFollowupContentDao.findByPrescriptionCode(prescription.getCode());
//            boolean zzFlag = false;//是否填写症状问卷
//            boolean tzssFlag = false;//是否填写体征和生活问卷
//            for (PrescriptionFollowupContent prescriptionFollowupContent: prescriptionFollowupContents) {
//                if(!zzFlag && "1".equals(prescriptionFollowupContent.getFollowupProject())){
//                    zzFlag = true;
//                }
//
//                if(!tzssFlag &&
//                        ("2".equals(prescriptionFollowupContent.getFollowupProject())
//                                || "4".equals(prescriptionFollowupContent.getFollowupProject()))
//                        ){
//                    zzFlag = true;
//                }
//
//                if(zzFlag && tzssFlag){
//                    break;
//                }
//            }
//            if(zzFlag){
//                jsonObject.put("zzMsg","居民已填写问卷");
//            }else{
//                jsonObject.put("zzMsg","居民未填写问卷");
//            }
//            if(tzssFlag){
//                jsonObject.put("tzssMsg","居民已填写问卷");
//            }else{
//                jsonObject.put("tzssMsg","居民未填写问卷");
//            }
//            jsonObject.put("zzFlag",zzFlag);
//            jsonObject.put("tzssFlag",tzssFlag);
            
            
            
@ -1141,20 +1141,27 @@ public class ConsultTeamService extends ConsultService {
            followup.setPatientCode(patient);
            followup.setPatientName(patientObj.getName());
            followup.setIdcard(patientObj.getIdcard());
            followup.setFollowupType(String.valueOf(type));
            
            if(3 == type){
                followup.setFollowupType("1,2");
            }else{
                followup.setFollowupType(String.valueOf(type));
            }
            
            if(2 == doctor.getLevel()){//全科
                followup.setFollowupClass("22");
            }else if(3 == doctor.getLevel()){//健管
                followup.setFollowupClass("10");
            }
            followup.setDataFrom("2");//数据来源 1基卫 2APP
            followup.setStatus("3");     //状态 0取消 1已完成 2未开始 3进行中
            followup.setStatus("2");     //状态 0取消 1已完成 2未开始 3进行中
            followup.setCreateTime(new Date());
            followup.setCreater(doctorCode);
            followup.setAdminTeamCode(signFamily.getAdminTeamId());
            followup.setSignType(2);
            //保存质询code
            followup.setSignCode(patientService.getSignCodeByPatient(patient));
            followup.setPrescriptionCode(prescription.getCode());
            followupDao.save(followup);
            return 1;
@ -2623,12 +2630,16 @@ public class ConsultTeamService extends ConsultService {
     * @param prescriptionCode
     * @param type
     */
    public void addPrescriptionBloodStatusConsult(String prescriptionCode, String type,String followupid) throws Exception {
    public org.json.JSONArray addPrescriptionBloodStatusConsult(String prescriptionCode, String type,String followupid) throws Exception {
        org.json.JSONArray result = new JSONArray();
        
        if("1".equals(type)){//血压
            prescriptionFollowupContentService.importPatientBloodPressureToFollowup(prescriptionCode,followupid,true);
            result = prescriptionFollowupContentService.importPatientBloodPressureToFollowup(prescriptionCode,followupid,true);
        }else if("2".equals(type)){//血糖
            prescriptionFollowupContentService.importPatientBloodSugarToFollowup(prescriptionCode,followupid,true);
            result = prescriptionFollowupContentService.importPatientBloodSugarToFollowup(prescriptionCode,followupid,true);
        }
        
        return result;
    }
    
    /**
@ -2636,7 +2647,7 @@ public class ConsultTeamService extends ConsultService {
     * @param prescriptionCode
     * @param type
     */
    public void addPrescriptionFollowupContentConsult(String prescriptionCode, String type, String followupid) throws Exception {
    public org.json.JSONArray addPrescriptionFollowupContentConsult(String prescriptionCode, String type, String followupid) throws Exception {
        Prescription prescription = prescriptionDao.findByCode(prescriptionCode);
        org.json.JSONObject contentDoctor = new org.json.JSONObject();
        //医生发送的消息
@ -2645,8 +2656,11 @@ public class ConsultTeamService extends ConsultService {
        }else{
            contentDoctor.put("text", "请填写您近期体征及生活方式调查问卷");
        }
        contentDoctor.put("type",type);
        contentDoctor.put("msgType",type);
        //医生发送Im消息
        ImUtill.sendTopicIM(prescription.getDoctor(), prescription.getDoctorName(), prescription.getConsult(), "17", contentDoctor.toString(), null);
        org.json.JSONArray result = new JSONArray();
        result.put(contentDoctor);
        return result;
    }
}

+ 1 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/followup/FollowUpService.java

@ -309,7 +309,7 @@ public class FollowUpService extends BaseService {
                        followup.put("followupClassName", "高血压");
                    } else if (objArr[4].toString().equals("2")) {
                        followup.put("followupClassName", "糖尿病");
                    } else if (objArr[4].toString().equals("3")) {
                    } else if (objArr[4].toString().equals("1,2")) {
                        followup.put("followupClassName", "高血压,糖尿病");
                    } else {
                    }

+ 91 - 36
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/prescription/PrescriptionFollowupContentService.java

@ -91,6 +91,7 @@ public class PrescriptionFollowupContentService extends BaseService {
		JSONArray objects = JSON.parseArray(followupProjectData);
		
		if(objects!= null & objects.size() >0){
			boolean isSendTZSHMsg = false;//是否已发送过体征和生活方式消息
			for (int i = 0; i < objects.size(); i++) {
				List<PrescriptionFollowupContent> savedatas = new ArrayList<>();
				JSONObject jsonObject = objects.getJSONObject(i);
@ -107,6 +108,7 @@ public class PrescriptionFollowupContentService extends BaseService {
							prescriptionFollowupContent.setFollowupKey(key);
							prescriptionFollowupContent.setFollowupValue(value);
							prescriptionFollowupContent.setPatientCode(patientCode);
							prescriptionFollowupContent.setCreateTime(new Date());
							savedatas.add(prescriptionFollowupContent);
						});
					}
@ -120,12 +122,19 @@ public class PrescriptionFollowupContentService extends BaseService {
						content.put("title", "【本消息为系统提醒】:");
						if("1".equals(followupProject)){
							content.put("text", "居民已填写《身份异常症状问卷》");
							content.put("msgType", 1);
						}else{
							if(isSendTZSHMsg){//判断是否已发送过,避免重复发送
								continue;
							}
							content.put("text", "居民已填写《体征及生活方式调查问卷》");
							isSendTZSHMsg = true;
							content.put("msgType", 2);
						}
						content.put("sysMsg","填写完成并提交后,医生将可以查看您的问卷内容");
						Prescription p = prescriptionDao.findByCode(prescriptioncode);
						ImUtill.sendTopicIM(p.getDoctor(), p.getDoctorName(), p.getConsult(), "17", content.toString(), null);
//						System.out.println(content.toString());
						ImUtill.sendTopicIM(p.getPatient(), p.getPatientName(), p.getConsult(), "17", content.toString(), null);
					}
				}
			}
@ -149,7 +158,7 @@ public class PrescriptionFollowupContentService extends BaseService {
		for (PrescriptionFollowupContent prescriptionFollowupContent: list) {
			
			if("1".equals(prescriptionFollowupContent.getFollowupProject())){
				if(prescriptionFollowupContent1 != null){
				if(prescriptionFollowupContent1 == null){
					prescriptionFollowupContent1 = prescriptionFollowupContent;
				}else{
					continue;
@ -157,7 +166,7 @@ public class PrescriptionFollowupContentService extends BaseService {
			}
			
			if("2".equals(prescriptionFollowupContent.getFollowupProject())){
				if(prescriptionFollowupContent2 != null){
				if(prescriptionFollowupContent2 == null){
					prescriptionFollowupContent2 = prescriptionFollowupContent;
				}else{
					continue;
@ -165,7 +174,7 @@ public class PrescriptionFollowupContentService extends BaseService {
			}
			
			if("4".equals(prescriptionFollowupContent.getFollowupProject())){
				if(prescriptionFollowupContent2 != null){
				if(prescriptionFollowupContent2 == null){
					prescriptionFollowupContent2 = prescriptionFollowupContent;
				}else{
					continue;
@ -174,24 +183,33 @@ public class PrescriptionFollowupContentService extends BaseService {
		}
		
		JSONArray result = new JSONArray();
		
		JSONObject jsonObject1 = new JSONObject();
		if(prescriptionFollowupContent1 != null){
			JSONObject jsonObject1 = new JSONObject();
			jsonObject1.put("type","1");
			jsonObject1.put("name","身份异常症状问卷");
			jsonObject1.put("statue","1");//1已填写,2未填写
			jsonObject1.put("createtime",prescriptionFollowupContent1.getCreateTime());
			result.add(jsonObject1);
			jsonObject1.put("createtime",DateUtil.dateToStrLong(prescriptionFollowupContent1.getCreateTime()));
		}else{
			jsonObject1.put("type","1");
			jsonObject1.put("name","身份异常症状问卷");
			jsonObject1.put("statue","2");//1已填写,2未填写
			jsonObject1.put("createtime","");
		}
		result.add(jsonObject1);
		
		JSONObject jsonObject2 = new JSONObject();
		if(prescriptionFollowupContent2 != null){
			JSONObject jsonObject2 = new JSONObject();
			jsonObject2.put("type","2");
			jsonObject2.put("name","体征及生活方式调查问卷");
			jsonObject2.put("statue","1");//1已填写,2未填写
			jsonObject2.put("createtime",prescriptionFollowupContent1.getCreateTime());
			result.add(jsonObject2);
			jsonObject2.put("createtime",DateUtil.dateToStrLong(prescriptionFollowupContent2.getCreateTime()));
		}else{
			jsonObject2.put("type","2");
			jsonObject2.put("name","体征及生活方式调查问卷");
			jsonObject2.put("statue","2");//1已填写,2未填写
			jsonObject2.put("createtime","");
		}
		result.add(jsonObject2);
		
		return result;
	}
@ -248,7 +266,7 @@ public class PrescriptionFollowupContentService extends BaseService {
	 * @param prescriptioncode
	 * @param followup_id
	 */
	public void importPatientBloodSugarToFollowup(String prescriptioncode, String followup_id,boolean sendIM) throws Exception {
	public org.json.JSONArray importPatientBloodSugarToFollowup(String prescriptioncode, String followup_id,boolean sendIM) throws Exception {
		Long followupId = Long.valueOf(followup_id);
		
		Followup followup =followUpDao.findOne(followupId);
@ -271,9 +289,20 @@ public class PrescriptionFollowupContentService extends BaseService {
		
		org.json.JSONObject contentDoctor = new org.json.JSONObject();
		org.json.JSONObject contentPatient = new org.json.JSONObject();
		org.json.JSONArray resultJson = new org.json.JSONArray();
		String imBloodSugarValue = "";
		String imBloodSugarDate = "";
		
		int total = 0;
		String sql = "select sum(category_code) amount deviceType FROM wlyy_patient_device WHERE user='"+prescription.getPatient()+"'";
		List<Map<String,Object>> result =  jdbcTemplate.queryForList(sql);
		if (result != null && result.size() > 0) {
			total = (result.get(0).get("amount") != null ? Integer.parseInt(result.get(0).get("amount").toString()) : 0);
		}
		if(total != 1 || total != 3){
			contentDoctor.put("deviceMsg","您未绑定血糖智能设备,请手动上传体征数据,绑定设备后系统将会自动将您的体征数据上报给医生");
		}
		
		if(!list.isEmpty()){
			
			for (Object o: list) {
@ -306,15 +335,6 @@ public class PrescriptionFollowupContentService extends BaseService {
				contentDoctor.put("text", "请提供您最近一次的血糖检测数值及检测时间");
				contentDoctor.put("needupload",false);
				contentDoctor.put("type",2);
				int total = 0;
				String sql = "select sum(category_code) amount deviceType FROM wlyy_patient_device WHERE user="+prescription.getPatient();
				List<Map<String,Object>> result =  jdbcTemplate.queryForList(sql);
				if (result != null && result.size() > 0) {
					total = (result.get(0).get("amount") != null ? Integer.parseInt(result.get(0).get("amount").toString()) : 0);
				}
				if(total != 1 || total != 3){
					contentDoctor.put("deviceMsg","您未绑定血糖智能设备,请手动上传体征数据,绑定设备后系统将会自动将您的体征数据上报给医生");
				}
				
				//医生发送Im消息
				ImUtill.sendTopicIM(prescription.getDoctor(), prescription.getDoctorName(), prescription.getConsult(), "16", contentDoctor.toString(), null);
@ -333,13 +353,29 @@ public class PrescriptionFollowupContentService extends BaseService {
			//是否需要发送IM消息
			if(sendIM){
				//医生发送的消息
				contentDoctor.put("text", "居民近30天未上传血糖体征数据,已通知居民上传数据,请耐心等待");
				contentDoctor.put("text", "请提供您最近一次的血糖检测数值及检测时间");
				contentDoctor.put("needupload",true);
				contentDoctor.put("type",2);
				//医生发送Im消息
				ImUtill.sendTopicIM(prescription.getDoctor(), prescription.getDoctorName(), prescription.getConsult(), "16", contentDoctor.toString(), null);
				
				//患者发送的消息
				contentPatient.put("title", "【本消息为系统提醒】:");
				contentPatient.put("tzMsg", "体征记录:无");
				contentPatient.put("tzTime", "检测时间:");
				contentPatient.put("tzAlert","温馨提示:居民近30天未上传血糖体征数据,已通知居民上传数据,请耐心等待");
				contentPatient.put("type",2);
				
				//患者发送Im消息
				ImUtill.sendTopicIM(prescription.getPatient(), prescription.getPatientName(), prescription.getConsult(), "16", contentPatient.toString(), null);
			}else{
				throw new Exception("未找到30天内的血糖记录!");
			}
		}
		
		resultJson.put(contentDoctor);
		
		return resultJson;
	}
	
@ -349,7 +385,7 @@ public class PrescriptionFollowupContentService extends BaseService {
	 * @param followup_id
	 * @param sendIM 是否发送IM消息
	 */
	public void importPatientBloodPressureToFollowup(String prescriptioncode, String followup_id,boolean sendIM) throws Exception {
	public org.json.JSONArray importPatientBloodPressureToFollowup(String prescriptioncode, String followup_id,boolean sendIM) throws Exception {
		
		Long followupId = Long.valueOf(followup_id);
		
@ -372,6 +408,18 @@ public class PrescriptionFollowupContentService extends BaseService {
		org.json.JSONObject contentDoctor = new org.json.JSONObject();
		org.json.JSONObject contentPatient = new org.json.JSONObject();
		
		org.json.JSONArray resultJson = new org.json.JSONArray();
		
		int total = 0;
		String sql = "select sum(category_code) amount deviceType FROM wlyy_patient_device WHERE user='"+prescription.getPatient()+"'";
		List<Map<String,Object>> result =  jdbcTemplate.queryForList(sql);
		if (result != null && result.size() > 0) {
			total = (result.get(0).get("amount") != null ? Integer.parseInt(result.get(0).get("amount").toString()) : 0);
		}
		if(total != 2 || total != 3){
			contentDoctor.put("deviceMsg","您未绑定血压智能设备,请手动上传体征数据,绑定设备后系统将会自动将您的体征数据上报给医生");
		}
		
		if(jsonArray.length() > 0){
			
			org.json.JSONObject jsonObject = jsonArray.getJSONObject(0);
@ -386,16 +434,6 @@ public class PrescriptionFollowupContentService extends BaseService {
				contentDoctor.put("needUpload",false);
				contentDoctor.put("type",1);
				
				int total = 0;
				String sql = "select sum(category_code) amount deviceType FROM wlyy_patient_device WHERE user="+prescription.getPatient();
				List<Map<String,Object>> result =  jdbcTemplate.queryForList(sql);
				if (result != null && result.size() > 0) {
					total = (result.get(0).get("amount") != null ? Integer.parseInt(result.get(0).get("amount").toString()) : 0);
				}
				if(total != 2 || total != 3){
					contentDoctor.put("deviceMsg","您未绑定血压智能设备,请手动上传体征数据,绑定设备后系统将会自动将您的体征数据上报给医生");
				}
				
				//医生发送Im消息
				ImUtill.sendTopicIM(prescription.getDoctor(), prescription.getDoctorName(), prescription.getConsult(), "16", contentDoctor.toString(), null);
				
@ -412,14 +450,31 @@ public class PrescriptionFollowupContentService extends BaseService {
		}else{
			//是否需要发送IM消息
			if(sendIM){
				
				//医生发送的消息
				contentDoctor.put("text", "居民近30天未上传血压体征数据,已通知居民上传数据,请耐心等待");
				contentDoctor.put("needupload",true);
				contentDoctor.put("text", "请提供您最近一次的血压检测数值及检测时间");
				contentDoctor.put("needUpload",true);
				contentDoctor.put("type",1);
				//医生发送Im消息
				ImUtill.sendTopicIM(prescription.getDoctor(), prescription.getDoctorName(), prescription.getConsult(), "16", contentDoctor.toString(), null);
				
				//患者发送Im消息
				contentPatient.put("title", "【本消息为系统提醒】:");
				contentPatient.put("tzMsg", "体征记录:无");
				contentPatient.put("tzTime", "检测时间:");
				contentPatient.put("tzAlert","温馨提示:居民近30天未上传血压体征数据,已通知居民上传数据,请耐心等待");
				contentPatient.put("type",1);
				
				//患者发送Im消息
				ImUtill.sendTopicIM(prescription.getPatient(), prescription.getPatientName(), prescription.getConsult(), "16", contentPatient.toString(), null);
			}else{
				throw new Exception("未找到30天内的血压记录!");
			}
		}
		
		resultJson.put(contentDoctor);
		
		return resultJson;
	
	}
@ -486,7 +541,7 @@ public class PrescriptionFollowupContentService extends BaseService {
			List<PrescriptionFollowupContent>  list3 = prescriptionFollowupContentDao.findByPrescriptionCodeAndFollowupProject(prescriptioncode,"4");
			
			if(!list3.isEmpty()){
				for (PrescriptionFollowupContent prescriptionFollowupContent: list2) {
				for (PrescriptionFollowupContent prescriptionFollowupContent: list3) {
					datamap3.put(prescriptionFollowupContent.getFollowupKey(),prescriptionFollowupContent.getFollowupValue());
				}
			}

+ 9 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/prescription/PrescriptionInfoService.java

@ -10,6 +10,7 @@ import com.yihu.wlyy.entity.patient.prescription.*;
import com.yihu.wlyy.repository.dict.SystemDictDao;
import com.yihu.wlyy.repository.doctor.DoctorAdminTeamDao;
import com.yihu.wlyy.repository.doctor.DoctorDao;
import com.yihu.wlyy.repository.followup.FollowUpDao;
import com.yihu.wlyy.repository.message.MessageDao;
import com.yihu.wlyy.repository.patient.PatientDao;
import com.yihu.wlyy.repository.patient.SignFamilyDao;
@ -96,6 +97,8 @@ public class PrescriptionInfoService extends BaseService {
    private PrescriptionReviewedReasonDao prescriptionReviewedReasonDao;
    @Autowired
    private PrescriptionAdjustReasonDao prescriptionAdjustReasonDao;
    @Autowired
    private FollowUpDao followUpDao;
    private static final Logger logger = LoggerFactory.getLogger(HttpUtil.class);
@ -649,7 +652,10 @@ public class PrescriptionInfoService extends BaseService {
                //获取智业待结算接口,更新药品金额
                prescriptionService.getPerscriptionInfoCostFromPayInfo(p.getCode());
                
                //更新随访记录的状态为完成
                followUpDao.updateStatusByPrescriptionCode(p.getCode(),1);
                
                //发送Im消息
                JSONObject content = new JSONObject();
                content.put("title", "我已经审核您" + DateUtil.dateToStr(p.getCreateTime(), "yyyy-MM-dd") + "发起的续方申请");
@ -877,6 +883,8 @@ public class PrescriptionInfoService extends BaseService {
                p.setJwDeptCode(dept);
                p.setJwRegisterFee(registerFee);
                p.setJwGisterTypeCode(rateTypeCode);//挂号类型
                
                
            } else {
                //审核不通过
                p.setStatus(PrescriptionLog.PrescriptionLogStatus.no_reviewed.getValue());

+ 16 - 5
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/reply/DoctorQuickReplyService.java

@ -41,6 +41,7 @@ public class DoctorQuickReplyService extends BaseService {
        reply.setSort(sort);
        reply.setUpdateTime(new Date());
        reply.setType(Integer.parseInt(type));
        reply.setSystag(0);
        return quickReplyDao.save(reply);
    }
@ -95,18 +96,28 @@ public class DoctorQuickReplyService extends BaseService {
     * @param doctor
     * @return
     */
    public List<DoctorQuickReply> getDoctorReplyList(String doctor,String type) {
    public List<DoctorQuickReply> getDoctorReplyList(String doctor,String type) throws Exception{
        Sort sort = new Sort(Sort.Direction.DESC, "sort");
        List<DoctorQuickReply> replies = quickReplyDao.findDoctorRepliesByType(doctor, Integer.parseInt(type),sort);
        
        if("1".equals(type)){
        if(replies.isEmpty() && "1".equals(type)){
            //如果是续方咨询,拿到的列表为空,则默认添加系统消息
            List<DoctorQuickReply> defaults = quickReplyDao.findDoctorReplies("default",sort);
    
            List<DoctorQuickReply> newList = new ArrayList<>();
            
            for (DoctorQuickReply doctorQuickReply:defaults) {
                doctorQuickReply.setId(null);
                doctorQuickReply.setDoctor(doctor);
                DoctorQuickReply doctorQuickReplyThis = new DoctorQuickReply();
                doctorQuickReplyThis.setDoctor(doctor);
                doctorQuickReplyThis.setType(doctorQuickReply.getType());
                doctorQuickReplyThis.setContent(doctorQuickReply.getContent());
                doctorQuickReplyThis.setSort(doctorQuickReply.getSort());
                doctorQuickReplyThis.setSystag(doctorQuickReply.getSystag());
                doctorQuickReplyThis.setStatus(doctorQuickReply.getStatus());
                doctorQuickReplyThis.setUpdateTime(new Date());
                newList.add(doctorQuickReplyThis);
            }
            quickReplyDao.save(defaults);
            quickReplyDao.save(newList);
    
            replies = quickReplyDao.findDoctorRepliesByType(doctor, Integer.parseInt(type),sort);
        }

+ 1 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/statisticsES/StatisticsESService.java

@ -1587,7 +1587,7 @@ public class StatisticsESService {
     */
    public JSONArray getLowLevelIncrementDetail(String startDate, String endDate, String area, int level, String index, int sort, String low_level) throws Exception {
        List<Map<String, Object>> resultList = new ArrayList<>();
        List<SaveModel> esModelList = (List<SaveModel>) elasticsearchUtil.findListDateQuotaLevel0(startDate, endDate, area, level, index, SaveModel.timeLevel_ZL, low_level);
        List<SaveModel> esModelList = (List<SaveModel>) elasticsearchUtil.findListDateQuotaLevel0(startDate, endDate, area, level, index, SaveModel.timeLevel_DDL, low_level);
        if (esModelList != null && esModelList.size() > 0) {
            for (SaveModel one : esModelList) {

+ 4 - 4
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/consult/DoctorConsultController.java

@ -1155,8 +1155,8 @@ public class DoctorConsultController extends WeixinBaseController {
            @ApiParam(name = "followupid", value = "随访记录ID", defaultValue = "")
            @RequestParam(value = "followupid", required = true) String followupid){
        try{
            consultTeamService.addPrescriptionBloodStatusConsult(prescriptionCode,type,followupid);
            return write(200, "添加成功!");
            org.json.JSONArray result  = consultTeamService.addPrescriptionBloodStatusConsult(prescriptionCode,type,followupid);
            return write(200, "添加成功!","data",result);
        }catch (Exception e){
            error(e);
            return error(-1,"添加失败");
@ -1175,8 +1175,8 @@ public class DoctorConsultController extends WeixinBaseController {
            @ApiParam(name = "followupid", value = "随访记录ID", defaultValue = "")
            @RequestParam(value = "followupid", required = true) String followupid){
        try{
            consultTeamService.addPrescriptionFollowupContentConsult(prescriptionCode,type,followupid);
            return write(200, "添加成功!");
            org.json.JSONArray result = consultTeamService.addPrescriptionFollowupContentConsult(prescriptionCode,type,followupid);
            return write(200, "添加成功!","data",result);
        }catch (Exception e){
            error(e);
            return error(-1,"添加失败");

+ 2 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/reply/DoctorQuickReplyController.java

@ -158,7 +158,8 @@ public class DoctorQuickReplyController extends BaseController {
    public String replyList(@ApiParam(name = "type", value = "快捷回复类型(1为续方咨询)", defaultValue = "0")
                                @RequestParam(value = "type", required = false, defaultValue = "0") String type) {
        try {
            List<DoctorQuickReply> replies = quickReplyService.getDoctorReplyList(getUID(),type);
//            List<DoctorQuickReply> replies = quickReplyService.getDoctorReplyList(getUID(),type);
            List<DoctorQuickReply> replies = quickReplyService.getDoctorReplyList("xy201703150222",type);
            return write(200, "查询成功", "data", replies);
        } catch (Exception e) {
            e.printStackTrace();

+ 2 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/prescription/PatientPrescriptionFollowupContentController.java

@ -58,10 +58,10 @@ public class PatientPrescriptionFollowupContentController extends BaseController
	                       @RequestParam(value = "prescriptioncode", required = true) String prescriptioncode,
	                       @ApiParam(name = "followupProjectData", value = "调查分类数据", defaultValue = "[{\"followupProject\":\"1\",\"projectData\":{\"WEIGHT\":\"76\",\"WEIGHT_EXP\":\"60\",\"BMI\":\"11\"}}]")
	                       @RequestParam(value = "followupProjectData", required = true) String followupProjectData,
	                       @ApiParam(name = "sendIM", value = "是否发送IM消息", defaultValue = "false")
	                       @ApiParam(name = "sendIM", value = "是否发送IM消息", defaultValue ="false")
	                       @RequestParam(value = "sendIM", required = true) boolean sendIM){
		try {
			prescriptionFollowupContentService.saveInfo(prescriptioncode,followupProjectData,getUID(),false);
			prescriptionFollowupContentService.saveInfo(prescriptioncode,followupProjectData,getUID(),sendIM);
			return write(200, "请求成功!");
		}catch (Exception e){
			//日志文件中记录异常信息

+ 1 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/statistic/EsStatisticsController.java

@ -31,7 +31,7 @@ import java.util.TreeMap;
 * Created by chenweida on 2017/10/13.
 */
@Controller
@RequestMapping(value = "/statistics", produces = MediaType.APPLICATION_JSON_UTF8_VALUE, method = {RequestMethod.GET, RequestMethod.POST})
@RequestMapping(value = "/esstatistics", produces = MediaType.APPLICATION_JSON_UTF8_VALUE, method = {RequestMethod.GET, RequestMethod.POST})
@Api(description = "ES统计查询")
public class EsStatisticsController extends BaseController {

+ 1 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/statistic/StatisticsController.java

@ -29,7 +29,7 @@ import java.util.*;
 * Created by lyr on 2016/08/16.
 */
@Controller
@RequestMapping(value = "/old/statistics", produces = MediaType.APPLICATION_JSON_UTF8_VALUE,method = {RequestMethod.GET,RequestMethod.POST})
@RequestMapping(value = "/statistics", produces = MediaType.APPLICATION_JSON_UTF8_VALUE,method = {RequestMethod.GET,RequestMethod.POST})
@Api(description = "统计")
public class StatisticsController extends BaseController {