Browse Source

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

liuwenbin 7 years ago
parent
commit
3ebb01637a

+ 14 - 0
common/common-entity/src/main/java/com/yihu/wlyy/entity/consult/ConsultTeam.java

@ -58,6 +58,8 @@ public class ConsultTeam extends IdEntity {
	private Date evaluateTime;
	private Date evaluateTime;
	private String relationCode;//关联业务表的code
	private String relationCode;//关联业务表的code
	
	private Integer healthindexType;//体征数据上传发送IM消息:1血压 2血糖 3血压+血糖
	public Integer getEvaluate() {
	public Integer getEvaluate() {
		return evaluate;
		return evaluate;
@ -325,4 +327,16 @@ public class ConsultTeam extends IdEntity {
	public void setRelationCode(String relationCode) {
	public void setRelationCode(String relationCode) {
		this.relationCode = relationCode;
		this.relationCode = relationCode;
	}
	}
	
	public static long getSerialVersionUID() {
		return serialVersionUID;
	}
	
	public Integer getHealthindexType() {
		return healthindexType;
	}
	
	public void setHealthindexType(Integer healthindexType) {
		this.healthindexType = healthindexType;
	}
}
}

+ 19 - 0
patient-co-service/wlyy_device/src/main/java/com/yihu/hos/device/common/dao/ConsultTeamDao.java

@ -0,0 +1,19 @@
/*******************************************************************************
 * Copyright (c) 2005, 2014 springside.github.io
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 *******************************************************************************/
package com.yihu.hos.device.common.dao;
import com.yihu.hos.device.model.ConsultTeam;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.List;
public interface ConsultTeamDao extends PagingAndSortingRepository<ConsultTeam, Long>, JpaSpecificationExecutor<ConsultTeam> {
	@Query("select a from ConsultTeam a where a.patient = ?1 and a.del = '1' and a.status = 0")
	List<ConsultTeam> findUnfinishedConsult(String patient);
}

+ 14 - 0
patient-co-service/wlyy_device/src/main/java/com/yihu/hos/device/common/util/DateUtil.java

@ -1544,4 +1544,18 @@ public class DateUtil {
            return null;
            return null;
        }
        }
    }
    }
    
    /**
     * 将长时间格式时间转换为字符串 yyyy-MM-dd HH:mm:ss
     *
     * @param dateDate
     * @return
     */
    public static String dateToStrLong(java.util.Date dateDate) {
        if (dateDate == null) {
            return "";
        }
        SimpleDateFormat formatter = new SimpleDateFormat(DEFAULT_YMDHMSDATE_FORMAT);
        return formatter.format(dateDate);
    }
}
}

+ 341 - 0
patient-co-service/wlyy_device/src/main/java/com/yihu/hos/device/model/ConsultTeam.java

@ -0,0 +1,341 @@
package com.yihu.hos.device.model;
import com.fasterxml.jackson.annotation.JsonFormat;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.util.Date;
/**
 * 三师咨询
 * @author George
 */
@Entity
@Table(name = "wlyy_consult_team")
public class ConsultTeam extends IdEntity {
	private static final long serialVersionUID = -7644448339473861513L;
	private String consult;         // 咨询标识
	private String doctor;          // 医生标识
	private String team;            // 三师团队标识
	private Integer type;           //  1、三师咨询,2、家庭医生咨询,6、患者名医咨询 7医生名医咨询 8续方咨询
	private String patient;         // 提问者标识
	private String name;            // 患者姓名
	private Integer sex;            // 患者性别
	private Date birthday;          // 患者生日
	private String photo;           // 患者头像
	private String when;            // 发病日期
	private String symptoms;        // 主要症状
	private Integer status;         // 咨询状态(0进行中,1已完成,-1患者取消,-2超时未响应自动关闭)
	private String images;          // 咨询图片URL,多图以逗号分隔
	private String voice;           // 咨询语音URL
	private String comment;         // 用户评价标识
	private String commentContent;  // 用户评价内容
	private Integer commentStar;    // 用户评价星级
	private Integer doctorRead;     // 医生未读数量
	private Integer patientRead;    // 患者未读数量
	private Date czrq;              // 咨询时间
	private String del;             // 作废标识,1正常,0作废
	private Long adminTeamId;//行政团队ID
	private Long guidance;   //关联指导
	private String doctorName;//醫生名字
	//起始消息id
	private String startMsgId;
	//结束消息id
	private String endMsgId;
	// 结束人
	private String endOperator;
	// 结束人类型
	private Integer endType;
	// 结束时间
	private Date endTime;
	//是否评价 1、已评价 0、未评价'
	private Integer evaluate;
	//评价时间
	private Date evaluateTime;
	private String relationCode;//关联业务表的code
	
	private Integer healthindexType;//体征数据上传发送IM消息:1血压 2血糖 3血压+血糖
	public Integer getEvaluate() {
		return evaluate;
	}
	public void setEvaluate(Integer evaluate) {
		this.evaluate = evaluate;
	}
	public Date getEvaluateTime() {
		return evaluateTime;
	}
	public void setEvaluateTime(Date evaluateTime) {
		this.evaluateTime = evaluateTime;
	}
	@Column(name = "admin_team_code")
	public Long getAdminTeamId() {
		return adminTeamId;
	}
	public void setAdminTeamId(Long adminTeamId) {
		this.adminTeamId = adminTeamId;
	}
	public String getConsult() {
		return consult;
	}
	public void setConsult(String consult) {
		this.consult = consult;
	}
	public ConsultTeam() {
	}
	public String getDoctor() {
		return doctor;
	}
	public void setDoctor(String doctor) {
		this.doctor = doctor;
	}
	public String getTeam() {
		return team;
	}
	public void setTeam(String team) {
		this.team = team;
	}
	public Integer getType() {
		return type;
	}
	public void setType(Integer type) {
		this.type = type;
	}
	public String getPatient() {
		return patient;
	}
	public void setPatient(String patient) {
		this.patient = patient;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+08:00")
	public Date getBirthday() {
		return birthday;
	}
	public void setBirthday(Date birthday) {
		this.birthday = birthday;
	}
	public String getPhoto() {
		return photo;
	}
	public void setPhoto(String photo) {
		this.photo = photo;
	}
	@Column(name = "fbsj")
	public String getWhen() {
		return when;
	}
	public void setWhen(String when) {
		this.when = when;
	}
	public Integer getStatus() {
		return status;
	}
	public void setStatus(Integer status) {
		this.status = status;
	}
	public String getImages() {
		return images;
	}
	public void setImages(String images) {
		this.images = images;
	}
	public String getVoice() {
		return voice;
	}
	public void setVoice(String voice) {
		this.voice = voice;
	}
	public String getComment() {
		return comment;
	}
	public void setComment(String comment) {
		this.comment = comment;
	}
	@Column(name = "comment_content")
	public String getCommentContent() {
		return commentContent;
	}
	public void setCommentContent(String commentContent) {
		this.commentContent = commentContent;
	}
	@Column(name = "comment_star")
	public Integer getCommentStar() {
		return commentStar;
	}
	public void setCommentStar(Integer commentStar) {
		this.commentStar = commentStar;
	}
	@Column(name = "doctor_read")
	public Integer getDoctorRead() {
		return doctorRead;
	}
	public void setDoctorRead(Integer doctorRead) {
		this.doctorRead = doctorRead;
	}
	@Column(name = "patient_read")
	public Integer getPatientRead() {
		return patientRead;
	}
	public void setPatientRead(Integer patientRead) {
		this.patientRead = patientRead;
	}
	// 设定JSON序列化时的日期格式
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
	public Date getCzrq() {
		return czrq;
	}
	public void setCzrq(Date czrq) {
		this.czrq = czrq;
	}
	// 设定JSON序列化时的日期格式
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
	public Date getEndTime() {
		return endTime;
	}
	public void setEndTime(Date endTime) {
		this.endTime = endTime;
	}
	public String getSymptoms() {
		return symptoms;
	}
	public void setSymptoms(String symptoms) {
		this.symptoms = symptoms;
	}
	public String getDel() {
		return del;
	}
	public void setDel(String del) {
		this.del = del;
	}
	public Integer getSex() {
		return sex;
	}
	public void setSex(Integer sex) {
		this.sex = sex;
	}
	@Transient
	public String getDoctorName() {
		return doctorName;
	}
	public void setDoctorName(String doctorName) {
		this.doctorName = doctorName;
	}
	public Long getGuidance() {
		return guidance;
	}
	public void setGuidance(Long guidance) {
		this.guidance = guidance;
	}
	public String getStartMsgId() {
		return startMsgId;
	}
	public void setStartMsgId(String startMsgId) {
		this.startMsgId = startMsgId;
	}
	public String getEndMsgId() {
		return endMsgId;
	}
	public void setEndMsgId(String endMsgId) {
		this.endMsgId = endMsgId;
	}
	public String getEndOperator() {
		return endOperator;
	}
	public void setEndOperator(String endOperator) {
		this.endOperator = endOperator;
	}
	public Integer getEndType() {
		return endType;
	}
	public void setEndType(Integer endType) {
		this.endType = endType;
	}
	public String getRelationCode() {
		return relationCode;
	}
	public void setRelationCode(String relationCode) {
		this.relationCode = relationCode;
	}
	
	public static long getSerialVersionUID() {
		return serialVersionUID;
	}
	
	public Integer getHealthindexType() {
		return healthindexType;
	}
	
	public void setHealthindexType(Integer healthindexType) {
		this.healthindexType = healthindexType;
	}
}

+ 53 - 7
patient-co-service/wlyy_device/src/main/java/com/yihu/hos/device/service/DeviceService.java

@ -7,10 +7,7 @@ import com.yihu.hos.device.common.dao.*;
import com.yihu.hos.device.common.http.HttpClientUtil;
import com.yihu.hos.device.common.http.HttpClientUtil;
import com.yihu.hos.device.common.http.HttpHelper;
import com.yihu.hos.device.common.http.HttpHelper;
import com.yihu.hos.device.common.http.HttpResponse;
import com.yihu.hos.device.common.http.HttpResponse;
import com.yihu.hos.device.common.util.DateUtil;
import com.yihu.hos.device.common.util.ETLConstantData;
import com.yihu.hos.device.common.util.MessageType;
import com.yihu.hos.device.common.util.StringUtil;
import com.yihu.hos.device.common.util.*;
import com.yihu.hos.device.model.*;
import com.yihu.hos.device.model.*;
import com.yihu.hos.device.task.PushMsgTask;
import com.yihu.hos.device.task.PushMsgTask;
import net.sf.json.JSONArray;
import net.sf.json.JSONArray;
@ -65,6 +62,10 @@ public class DeviceService {
    private PatientHealthTimeDao patientHealthTimeDao;
    private PatientHealthTimeDao patientHealthTimeDao;
    @Autowired
    @Autowired
    private PushMsgTask pushMsgTask;
    private PushMsgTask pushMsgTask;
    @Autowired
    private ConsultTeamDao consultTeamDao;
    @Autowired
    private ImUtill ImUtill;
    private ObjectMapper objectMapper = new ObjectMapper();
    private ObjectMapper objectMapper = new ObjectMapper();
    private Integer aStart;
    private Integer aStart;
@ -383,11 +384,19 @@ public class DeviceService {
            if (result == null) {
            if (result == null) {
                throw new Exception("This device is not relate patient!");
                throw new Exception("This device is not relate patient!");
            } else {
            } else {
    
                //患者信息
                String patientCode = result.getUser();
                Patient patient = patientDao.findByCode(patientCode);
                
                //血糖、血压数据需校验,如果超标,需要发送消息给医生
                //血糖、血压数据需校验,如果超标,需要发送消息给医生
                if (1 == deviceType || 2 == deviceType) {
                if (1 == deviceType || 2 == deviceType) {
                    verifyHealthIndex(result);
                    verifyHealthIndex(result);
                    //发送华三demo推送
                    //发送华三demo推送
//                    messagePush(result);
//                    messagePush(result);
                    
                    //判断是否有未结束的续方咨询,发送消息给对应的医生----huangwenjie--2017.11.06
                    sendPrescriptionHealthIndexMsgresult(result,patient);
                }
                }
                //指标数据上传基卫
                //指标数据上传基卫
@ -397,9 +406,6 @@ public class DeviceService {
                //连续5次体征值正常,则修改为非预警状态;连续5次异常,修改为预警状态-----START
                //连续5次体征值正常,则修改为非预警状态;连续5次异常,修改为预警状态-----START
                String patientCode = result.getUser();
                //患者信息
                Patient patient = patientDao.findByCode(patientCode);
                int bloodPressureBbnormalCount = 0;//血压异常次数
                int bloodPressureBbnormalCount = 0;//血压异常次数
                int bloodSuggurBbnormalCount = 0;//血糖异常次数
                int bloodSuggurBbnormalCount = 0;//血糖异常次数
@ -465,6 +471,7 @@ public class DeviceService {
        return Result.success("Device data incoming success");
        return Result.success("Device data incoming success");
    }
    }
    
    /**
    /**
     * 保存设备数据
     * 保存设备数据
     */
     */
@ -890,4 +897,43 @@ public class DeviceService {
            ex.printStackTrace();
            ex.printStackTrace();
        }
        }
    }
    }
    
    /**
     * 判断是否有未结束的续方咨询,发送消息给对应的医生
     * @param result
     * @param patient
     */
    private void sendPrescriptionHealthIndexMsgresult(PatientHealthIndex result, Patient patient) {
        
        List<ConsultTeam> consultTeams = consultTeamDao.findUnfinishedConsult(patient.getCode());
    
        if(1 == result.getType()){
            for (ConsultTeam consultTeam:consultTeams) {
                if(1 == consultTeam.getHealthindexType() || 3 == consultTeam.getHealthindexType()){
                    org.json.JSONObject contentPatient = new org.json.JSONObject();
                    //患者发送的消息
                    contentPatient.put("title", "【本消息为系统提醒】:");
                    contentPatient.put("tzMsg", "体征记录:血糖 "+result.getValue1());
                    contentPatient.put("tzTime", "检测时间:"+DateUtil.dateToStrLong(result.getRecordDate()));
                    contentPatient.put("tzAlert","温馨提示:本条体征为居民上传的健康体征数据,您可以自动填入本次随访记录");
                    //患者发送Im消息
                    ImUtill.sendTopicIM(patient.getCode(), patient.getName(), consultTeam.getConsult(), "16", contentPatient.toString(), null);
                }
            }
        }else if(2 == result.getType()){
            for (ConsultTeam consultTeam:consultTeams) {
                if(2 == consultTeam.getHealthindexType() || 3 == consultTeam.getHealthindexType()){
                    org.json.JSONObject contentPatient = new org.json.JSONObject();
                    //患者发送的消息
                    contentPatient.put("title", "【本消息为系统提醒】:");
                    contentPatient.put("tzMsg", "体征记录:血压 "+result.getValue1()+"/"+result.getValue2()+" mmHg");
                    contentPatient.put("tzTime", "检测时间:"+DateUtil.dateToStrLong(result.getRecordDate()));
                    contentPatient.put("tzAlert","温馨提示:本条体征为居民上传的健康体征数据,您可以自动填入本次随访记录");
                    //患者发送Im消息
                    ImUtill.sendTopicIM(patient.getCode(), patient.getName(), consultTeam.getConsult(), "16", contentPatient.toString(), null);
                }
            }
        }
    }
}
}

+ 47 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/health/PatientHealthIndexService.java

@ -3,6 +3,7 @@ package com.yihu.wlyy.service.app.health;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSON;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.device.entity.DevicePatientHealthIndex;
import com.yihu.device.entity.DevicePatientHealthIndex;
import com.yihu.wlyy.entity.consult.ConsultTeam;
import com.yihu.wlyy.entity.device.PatientDevice;
import com.yihu.wlyy.entity.device.PatientDevice;
import com.yihu.wlyy.entity.doctor.health.DoctorHealthStandard;
import com.yihu.wlyy.entity.doctor.health.DoctorHealthStandard;
import com.yihu.wlyy.entity.doctor.profile.Doctor;
import com.yihu.wlyy.entity.doctor.profile.Doctor;
@ -12,6 +13,7 @@ import com.yihu.wlyy.entity.patient.PatientAimSports;
import com.yihu.wlyy.entity.patient.PatientHealthStandard;
import com.yihu.wlyy.entity.patient.PatientHealthStandard;
import com.yihu.wlyy.entity.patient.SignFamily;
import com.yihu.wlyy.entity.patient.SignFamily;
import com.yihu.wlyy.health.repository.DevicePatientHealthIndexDao;
import com.yihu.wlyy.health.repository.DevicePatientHealthIndexDao;
import com.yihu.wlyy.repository.consult.ConsultTeamDao;
import com.yihu.wlyy.repository.doctor.DoctorDao;
import com.yihu.wlyy.repository.doctor.DoctorDao;
import com.yihu.wlyy.repository.doctor.health.DoctorHealthStandardDao;
import com.yihu.wlyy.repository.doctor.health.DoctorHealthStandardDao;
import com.yihu.wlyy.repository.message.MessageDao;
import com.yihu.wlyy.repository.message.MessageDao;
@ -86,6 +88,10 @@ public class PatientHealthIndexService extends BaseService {
    private String targetUrl;
    private String targetUrl;
    @Autowired
    @Autowired
    private HttpClientUtil httpClientUtil;
    private HttpClientUtil httpClientUtil;
    @Autowired
    private ImUtill ImUtill;
    @Autowired
    private ConsultTeamDao consultTeamDao;
    /**
    /**
     * 获取居民标准预警值
     * 获取居民标准预警值
@ -880,8 +886,8 @@ public class PatientHealthIndexService extends BaseService {
                    throw new Exception("暂不支持该指标!");
                    throw new Exception("暂不支持该指标!");
                }
                }
            }
            }
            patientHealthIndexDao.save(obj);
    
            obj = patientHealthIndexDao.save(obj);
            //保存完后上传基卫
            //保存完后上传基卫
            new Thread(new HealthIndexUploadTask(String.valueOf(obj.getId()))).start();
            new Thread(new HealthIndexUploadTask(String.valueOf(obj.getId()))).start();
@ -891,6 +897,45 @@ public class PatientHealthIndexService extends BaseService {
        return obj;
        return obj;
    }
    }
    
    /**
     * 判断是否有未结束的续方咨询,发送消息给对应的医生
     * @param result
     * @param patient
     */
    private void sendPrescriptionHealthIndexMsgresult(DevicePatientHealthIndex result, Patient patient) {
        
        List<ConsultTeam> consultTeams = consultTeamDao.findUnfinishedConsult(patient.getCode());
        
        if(1 == result.getType()){
            for (ConsultTeam consultTeam:consultTeams) {
                if(1 == consultTeam.getHealthindexType() || 3 == consultTeam.getHealthindexType()){
                    org.json.JSONObject contentPatient = new org.json.JSONObject();
                    //患者发送的消息
                    contentPatient.put("title", "【本消息为系统提醒】:");
                    contentPatient.put("tzMsg", "体征记录:血糖 "+result.getValue1());
                    contentPatient.put("tzTime", "检测时间:"+DateUtil.dateToStrLong(result.getRecordDate()));
                    contentPatient.put("tzAlert","温馨提示:本条体征为居民上传的健康体征数据,您可以自动填入本次随访记录");
                    //患者发送Im消息
                    ImUtill.sendTopicIM(patient.getCode(), patient.getName(), consultTeam.getConsult(), "16", contentPatient.toString(), null);
                }
            }
        }else if(2 == result.getType()){
            for (ConsultTeam consultTeam:consultTeams) {
                if(2 == consultTeam.getHealthindexType() || 3 == consultTeam.getHealthindexType()){
                    org.json.JSONObject contentPatient = new org.json.JSONObject();
                    //患者发送的消息
                    contentPatient.put("title", "【本消息为系统提醒】:");
                    contentPatient.put("tzMsg", "体征记录:血压 "+result.getValue1()+"/"+result.getValue2()+" mmHg");
                    contentPatient.put("tzTime", "检测时间:"+DateUtil.dateToStrLong(result.getRecordDate()));
                    contentPatient.put("tzAlert","温馨提示:本条体征为居民上传的健康体征数据,您可以自动填入本次随访记录");
                    //患者发送Im消息
                    ImUtill.sendTopicIM(patient.getCode(), patient.getName(), consultTeam.getConsult(), "16", contentPatient.toString(), null);
                }
            }
        }
        
    }
    /**
    /**
     * 判断居民的体征预警状态
     * 判断居民的体征预警状态

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

@ -19,6 +19,7 @@ import com.yihu.wlyy.service.app.health.PatientHealthIndexService;
import com.yihu.wlyy.util.DateUtil;
import com.yihu.wlyy.util.DateUtil;
import com.yihu.wlyy.util.ImUtill;
import com.yihu.wlyy.util.ImUtill;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang3.math.NumberUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Component;
@ -282,50 +283,20 @@ public class PrescriptionFollowupContentService extends BaseService {
				
				
				imBloodSugarDate = obj.getString("recordDate");
				imBloodSugarDate = obj.getString("recordDate");
				
				
				//餐前
				if(StringUtils.isNotBlank(obj.getString("value1"))){
					followupProjectData = "{'BS_FPG':'"+obj.getString("value1")+"'}";
				int index = Integer.valueOf(obj.getString("value2"));
				String value1 = obj.getString("value1");
				// 餐后
				if (index % 2 == 0) {
					if(StringUtils.isNotBlank(value1)){
						followupProjectData = "{'BS_FPG':'"+obj.getString("value1")+"'}";
						break;
					}
				} else { //餐前
					followupProjectData = "{'NO_BS_FPG':'"+obj.getString("value1")+"'}";
					imBloodSugarValue = obj.getString("value1");
					imBloodSugarValue = obj.getString("value1");
					break;
					break;
				}
				}
				
				if(StringUtils.isNotBlank(obj.getString("value3"))){
					followupProjectData = "{'BS_FPG':'"+obj.getString("value3")+"'}";
					imBloodSugarValue = obj.getString("value3");
					break;
				}
				
				if(StringUtils.isNotBlank(obj.getString("value5"))){
					followupProjectData = "{'BS_FPG':'"+obj.getString("value5")+"'}";
					imBloodSugarValue = obj.getString("value5");
					break;
				}
				//餐后
				if(StringUtils.isNotBlank(obj.getString("value2"))){
					followupProjectData = "{'NO_BS_FPG':'"+obj.getString("value2")+"'}";
					imBloodSugarValue = obj.getString("value2");
					break;
				}
				
				
				if(StringUtils.isNotBlank(obj.getString("value4"))){
					followupProjectData = "{'NO_BS_FPG':'"+obj.getString("value4")+"'}";
					imBloodSugarValue = obj.getString("value4");
					break;
				}
				
				if(StringUtils.isNotBlank(obj.getString("value6"))){
					followupProjectData = "{'NO_BS_FPG':'"+obj.getString("value6")+"'}";
					imBloodSugarValue = obj.getString("value6");
					break;
				}
				
				//随机血糖
				if(StringUtils.isNotBlank(obj.getString("value7"))){
					followupProjectData = "{'RANDOM_BLOOD_SUGAR':'"+obj.getString("value7")+"'}";
					imBloodSugarValue = obj.getString("value7");
					break;
				}
			}
			}
			
			
			followUpService.esSaveFollowupProjectData(followup_id, "3", followupProjectData);
			followUpService.esSaveFollowupProjectData(followup_id, "3", followupProjectData);

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

@ -2012,7 +2012,7 @@ public class StatisticsESService {
        String renewIndex =index;//续签index..
        String renewIndex =index;//续签index..
        String date = year + "-06-30";
        String date = year + "-06-30";
        try{
        try{
            if (level == 5) {
            if (level == 4) {
                //团队的转签
                //团队的转签
                if(StringUtils.isNoneBlank(lowCode)){
                if(StringUtils.isNoneBlank(lowCode)){
                    //服务类型维度
                    //服务类型维度
@ -2020,7 +2020,7 @@ public class StatisticsESService {
                }else{
                }else{
                    switchIndex = "35";
                    switchIndex = "35";
                }
                }
            } else if (level == 4) {
            } else if (level == 3) {
                //社区的转签
                //社区的转签
                if(StringUtils.isNoneBlank(lowCode)){
                if(StringUtils.isNoneBlank(lowCode)){
                    //服务类型维度
                    //服务类型维度
@ -2037,20 +2037,20 @@ public class StatisticsESService {
                    switchIndex = "35";
                    switchIndex = "35";
                }
                }
            }
            }
            //String timeKey = elasticsearchUtil.getQuotaTime();
            String timeKey = elasticsearchUtil.getQuotaTime();
            SaveModel renewSaveModel = new SaveModel();
            SaveModel renewSaveModel = new SaveModel();
            SaveModel switchSaveModel = new SaveModel();
            SaveModel switchSaveModel = new SaveModel();
            SaveModel signSaveModel = new SaveModel();
            SaveModel signSaveModel = new SaveModel();
            if (StringUtils.isNotBlank(lowCode)){
            if (StringUtils.isNotBlank(lowCode)){
                //续签量
                //续签量
                renewSaveModel = elasticsearchUtil.findOneDateQuotaLevel1(date,area,level,renewIndex,"2",lowCode);
                renewSaveModel = elasticsearchUtil.findOneDateQuotaLevel1(timeKey,area,level,renewIndex,"2",lowCode);
                //转签量
                //转签量
                switchSaveModel = elasticsearchUtil.findOneDateQuotaLevel1(date,area,level,switchIndex,"2",lowCode);
                switchSaveModel = elasticsearchUtil.findOneDateQuotaLevel1(timeKey,area,level,switchIndex,"2",lowCode);
            }else{
            }else{
                //续签量
                //续签量
                renewSaveModel=elasticsearchUtil.findOneDateQuotaLevel0(date,area,level,renewIndex,"2");
                renewSaveModel=elasticsearchUtil.findOneDateQuotaLevel0(timeKey,area,level,renewIndex,"2");
                //转签量
                //转签量
                switchSaveModel=elasticsearchUtil.findOneDateQuotaLevel0(date,area,level,switchIndex,"2");
                switchSaveModel=elasticsearchUtil.findOneDateQuotaLevel0(timeKey,area,level,switchIndex,"2");
            }
            }
            int renewNum = renewSaveModel.getResult2().intValue();
            int renewNum = renewSaveModel.getResult2().intValue();
            int switchNum = switchSaveModel.getResult2().intValue();
            int switchNum = switchSaveModel.getResult2().intValue();
@ -2277,7 +2277,7 @@ public class StatisticsESService {
     */
     */
    public JSONArray getLevelTwoLowLevelTotalSignAndRenew(String area, int level, String index, int sort, String lowLevel, String year, String lowCode) throws Exception {
    public JSONArray getLevelTwoLowLevelTotalSignAndRenew(String area, int level, String index, int sort, String lowLevel, String year, String lowCode) throws Exception {
        String lastDate = year + "-10-19";
        String lastDate = year + "-06-30";
        //String timeKey = elasticsearchUtil.getQuotaTime();
        //String timeKey = elasticsearchUtil.getQuotaTime();
        String low_level = String.valueOf(StringUtils.isEmpty(lowLevel) ? (level - 1) : lowLevel);
        String low_level = String.valueOf(StringUtils.isEmpty(lowLevel) ? (level - 1) : lowLevel);

+ 3 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/consult/ConsultController.java

@ -1001,6 +1001,9 @@ public class ConsultController extends WeixinBaseController {
            ConsultTeam consult = new ConsultTeam();
            ConsultTeam consult = new ConsultTeam();
            consult.setType(8);//续方咨询
            consult.setType(8);//续方咨询
            consult.setAdminTeamId(adminTeamId);
            consult.setAdminTeamId(adminTeamId);
            
            //增加体征数据上传发送IM消息标识:1血压 2血糖 3血压+血糖---huangwenjie 2017.11.06
            consult.setHealthindexType(type);
            // 保存到数据库
            // 保存到数据库
//            int res = consultTeamService.addPrescriptionConsult(jwCode, "b02f132bfbfc45d287bcde18ad342522","b02f132bfbfc45d287bcde18ad342522",doctor,consult,reason,type);
//            int res = consultTeamService.addPrescriptionConsult(jwCode, "b02f132bfbfc45d287bcde18ad342522","b02f132bfbfc45d287bcde18ad342522",doctor,consult,reason,type);
            int res = 0;
            int res = 0;