Browse Source

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

Conflicts:
	patient-co/patient-co-wlyy/src/main/resources/application.yml
chenweida 7 years ago
parent
commit
6eafabf8cd
32 changed files with 1611 additions and 56 deletions
  1. 12 3
      common/common-entity/src/main/java/com/yihu/device/entity/DevicePatientHealthIndex.java
  2. 205 0
      common/common-entity/src/main/java/com/yihu/wlyy/entity/doctor/scheme/DoctorSchemeBloodPressure.java
  3. 248 0
      common/common-entity/src/main/java/com/yihu/wlyy/entity/doctor/scheme/DoctorSchemeBloodSugger.java
  4. 9 0
      common/common-entity/src/main/java/com/yihu/wlyy/entity/patient/Patient.java
  5. 105 0
      common/common-entity/src/main/java/com/yihu/wlyy/entity/patient/PatientAimBloodPressure.java
  6. 94 0
      common/common-entity/src/main/java/com/yihu/wlyy/entity/patient/PatientAimBloodSugger.java
  7. 84 0
      common/common-entity/src/main/java/com/yihu/wlyy/entity/patient/PatientAimSports.java
  8. 84 0
      common/common-entity/src/main/java/com/yihu/wlyy/entity/patient/PatientSchemeList.java
  9. 16 16
      patient-co-manage/wlyy-manage/src/main/resources/application.yml
  10. 6 0
      patient-co-service/wlyy_device/src/main/java/com/yihu/hos/device/model/Patient.java
  11. 13 3
      patient-co-service/wlyy_device/src/main/java/com/yihu/hos/device/model/PatientHealthIndex.java
  12. 10 0
      patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/entity/Patient.java
  13. 14 4
      patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/entity/device/PatientHealthIndex.java
  14. 1 1
      patient-co-service/wlyy_service/src/main/webapp/prescription_consulting/js/prescription_consulting_info.js
  15. 10 0
      patient-co-service/wlyy_sign/src/main/java/com/yihu/wlyy/sign/entity/Patient.java
  16. 0 8
      patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/job/consult/FamousConsultTimesJob.java
  17. 26 2
      patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/redis/RedisThread.java
  18. 0 2
      patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/service/app/scheduling/DoctorWorkTimeService.java
  19. 4 0
      patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/task/PushMsgTask.java
  20. 1 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/config/SwaggerConfig.java
  21. 20 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/account/PatientInfoService.java
  22. 6 2
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/consult/ConsultTeamService.java
  23. 183 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/prescription/PrescriptionInfoService.java
  24. 92 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/sign/SignWebService.java
  25. 20 2
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/task/PushMsgTask.java
  26. 2 2
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/common/account/LoginController.java
  27. 14 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/patient/PatientInfoController.java
  28. 58 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/prescription/PrescriptionInfoController.java
  29. 11 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/sign/DoctorSignController.java
  30. 36 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/wx/WechatMenuController.java
  31. 218 11
      patient-co/patient-co-wlyy/src/main/resources/application.yml
  32. 9 0
      patient-co/patient-co-wlyy/src/main/resources/wechat/weixin_menu_feldsher.txt

+ 12 - 3
common/common-entity/src/main/java/com/yihu/device/entity/DevicePatientHealthIndex.java

@ -23,9 +23,9 @@ public class DevicePatientHealthIndex extends IdEntity {
	private String intervene;
	// 血糖/收缩压/体重/腰围/早餐前空腹
	private String value1;
	// 舒张压/早餐后空腹
	// 舒张压/早餐后空腹/身高
	private String value2;
	// 午餐空腹
	// 午餐空腹/身高
	private String value3;
	// 午餐后
	private String value4;
@ -35,7 +35,7 @@ public class DevicePatientHealthIndex extends IdEntity {
	private String value6;
	// 睡前
	private String value7;
	// 健康指标类型(1血糖,2血压,3体重,4腰围)
	// 健康指标类型(1血糖,2血压,3体重/身高/BMI,4腰围)
	private int type;
	// 记录时间
@ -51,6 +51,8 @@ public class DevicePatientHealthIndex extends IdEntity {
	//设备编号
	private String deviceSn;
	private Short status;//状态:0为标准,1为异常
	public String getUser() {
		return user;
	}
@ -186,4 +188,11 @@ public class DevicePatientHealthIndex extends IdEntity {
		this.deviceSn = deviceSn;
	}
	public Short getStatus() {
		return status;
	}
	public void setStatus(Short status) {
		this.status = status;
	}
}

+ 205 - 0
common/common-entity/src/main/java/com/yihu/wlyy/entity/doctor/scheme/DoctorSchemeBloodPressure.java

@ -0,0 +1,205 @@
package com.yihu.wlyy.entity.doctor.scheme;
import com.yihu.wlyy.entity.IdEntity;
import javax.persistence.*;
import java.sql.Time;
import java.sql.Timestamp;
/**
 * 医生监测方案-血压
 * @author huangwenjie
 * @date 2017/9/7 20:14
 */
@Entity
@Table(name = "wlyy_doctor_scheme_blood_pressure")
public class DoctorSchemeBloodPressure extends IdEntity {
    private String name;
    private String code;
    private String doctorcode;
    private short dayofweek;
    private Short earlyMorning;
    private Time earlyMorningTime;
    private Short morning;
    private Time morningTime;
    private Short noon;
    private Time noonTime;
    private Short afterNoon;
    private Time afterNoonTime;
    private Short night;
    private Time nightTime;
    private Timestamp createTime;
    private Short alertTag;
    private String content;
    @Basic
    @Column(name = "name")
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    @Basic
    @Column(name = "code")
    public String getCode() {
        return code;
    }
    public void setCode(String code) {
        this.code = code;
    }
    @Basic
    @Column(name = "doctorcode")
    public String getDoctorcode() {
        return doctorcode;
    }
    public void setDoctorcode(String doctorcode) {
        this.doctorcode = doctorcode;
    }
    @Basic
    @Column(name = "dayofweek")
    public short getDayofweek() {
        return dayofweek;
    }
    public void setDayofweek(short dayofweek) {
        this.dayofweek = dayofweek;
    }
    @Basic
    @Column(name = "early_morning")
    public Short getEarlyMorning() {
        return earlyMorning;
    }
    public void setEarlyMorning(Short earlyMorning) {
        this.earlyMorning = earlyMorning;
    }
    @Basic
    @Column(name = "early_morning_time")
    public Time getEarlyMorningTime() {
        return earlyMorningTime;
    }
    public void setEarlyMorningTime(Time earlyMorningTime) {
        this.earlyMorningTime = earlyMorningTime;
    }
    @Basic
    @Column(name = "morning")
    public Short getMorning() {
        return morning;
    }
    public void setMorning(Short morning) {
        this.morning = morning;
    }
    @Basic
    @Column(name = "morning_time")
    public Time getMorningTime() {
        return morningTime;
    }
    public void setMorningTime(Time morningTime) {
        this.morningTime = morningTime;
    }
    @Basic
    @Column(name = "noon")
    public Short getNoon() {
        return noon;
    }
    public void setNoon(Short noon) {
        this.noon = noon;
    }
    @Basic
    @Column(name = "noon_time")
    public Time getNoonTime() {
        return noonTime;
    }
    public void setNoonTime(Time noonTime) {
        this.noonTime = noonTime;
    }
    @Basic
    @Column(name = "after_noon")
    public Short getAfterNoon() {
        return afterNoon;
    }
    public void setAfterNoon(Short afterNoon) {
        this.afterNoon = afterNoon;
    }
    @Basic
    @Column(name = "after_noon_time")
    public Time getAfterNoonTime() {
        return afterNoonTime;
    }
    public void setAfterNoonTime(Time afterNoonTime) {
        this.afterNoonTime = afterNoonTime;
    }
    @Basic
    @Column(name = "night")
    public Short getNight() {
        return night;
    }
    public void setNight(Short night) {
        this.night = night;
    }
    @Basic
    @Column(name = "night_time")
    public Time getNightTime() {
        return nightTime;
    }
    public void setNightTime(Time nightTime) {
        this.nightTime = nightTime;
    }
    @Basic
    @Column(name = "create_time")
    public Timestamp getCreateTime() {
        return createTime;
    }
    public void setCreateTime(Timestamp createTime) {
        this.createTime = createTime;
    }
    @Basic
    @Column(name = "alert_tag")
    public Short getAlertTag() {
        return alertTag;
    }
    public void setAlertTag(Short alertTag) {
        this.alertTag = alertTag;
    }
    @Basic
    @Column(name = "content")
    public String getContent() {
        return content;
    }
    public void setContent(String content) {
        this.content = content;
    }
}

+ 248 - 0
common/common-entity/src/main/java/com/yihu/wlyy/entity/doctor/scheme/DoctorSchemeBloodSugger.java

@ -0,0 +1,248 @@
package com.yihu.wlyy.entity.doctor.scheme;
import com.yihu.wlyy.entity.IdEntity;
import javax.persistence.*;
import java.sql.Time;
import java.sql.Timestamp;
/**
 * 医生监测方案-血糖
 * @author huangwenjie
 * @date 2017/9/7 20:14
 */
@Entity
@Table(name = "wlyy_doctor_scheme_blood_sugger")
public class DoctorSchemeBloodSugger extends IdEntity {
    private String name;
    private String code;
    private String doctorcode;
    private Short dayofweek;
    private Short beforeBreakfast;
    private Time beforeBreakfastTime;
    private Short afterBreakfast;
    private Time afterBreakfastTime;
    private Short beforeLunch;
    private Time beforeLunchTime;
    private Short afterLunch;
    private Time afterLunchTime;
    private Short beforeDinner;
    private Time beforeDinnerTime;
    private Short afterDinner;
    private Time afterDinnerTime;
    private Short beforeSleep;
    private Time beforeSleepTime;
    private Timestamp createTime;
    private Short alertTag;
    private String content;
    @Basic
    @Column(name = "name")
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    @Basic
    @Column(name = "code")
    public String getCode() {
        return code;
    }
    public void setCode(String code) {
        this.code = code;
    }
    @Basic
    @Column(name = "doctorcode")
    public String getDoctorcode() {
        return doctorcode;
    }
    public void setDoctorcode(String doctorcode) {
        this.doctorcode = doctorcode;
    }
    @Basic
    @Column(name = "dayofweek")
    public Short getDayofweek() {
        return dayofweek;
    }
    public void setDayofweek(Short dayofweek) {
        this.dayofweek = dayofweek;
    }
    @Basic
    @Column(name = "before_breakfast")
    public Short getBeforeBreakfast() {
        return beforeBreakfast;
    }
    public void setBeforeBreakfast(Short beforeBreakfast) {
        this.beforeBreakfast = beforeBreakfast;
    }
    @Basic
    @Column(name = "before_breakfast_time")
    public Time getBeforeBreakfastTime() {
        return beforeBreakfastTime;
    }
    public void setBeforeBreakfastTime(Time beforeBreakfastTime) {
        this.beforeBreakfastTime = beforeBreakfastTime;
    }
    @Basic
    @Column(name = "after_breakfast")
    public Short getAfterBreakfast() {
        return afterBreakfast;
    }
    public void setAfterBreakfast(Short afterBreakfast) {
        this.afterBreakfast = afterBreakfast;
    }
    @Basic
    @Column(name = "after_breakfast_time")
    public Time getAfterBreakfastTime() {
        return afterBreakfastTime;
    }
    public void setAfterBreakfastTime(Time afterBreakfastTime) {
        this.afterBreakfastTime = afterBreakfastTime;
    }
    @Basic
    @Column(name = "before_lunch")
    public Short getBeforeLunch() {
        return beforeLunch;
    }
    public void setBeforeLunch(Short beforeLunch) {
        this.beforeLunch = beforeLunch;
    }
    @Basic
    @Column(name = "before_lunch_time")
    public Time getBeforeLunchTime() {
        return beforeLunchTime;
    }
    public void setBeforeLunchTime(Time beforeLunchTime) {
        this.beforeLunchTime = beforeLunchTime;
    }
    @Basic
    @Column(name = "after_lunch")
    public Short getAfterLunch() {
        return afterLunch;
    }
    public void setAfterLunch(Short afterLunch) {
        this.afterLunch = afterLunch;
    }
    @Basic
    @Column(name = "after_lunch_time")
    public Time getAfterLunchTime() {
        return afterLunchTime;
    }
    public void setAfterLunchTime(Time afterLunchTime) {
        this.afterLunchTime = afterLunchTime;
    }
    @Basic
    @Column(name = "before_dinner")
    public Short getBeforeDinner() {
        return beforeDinner;
    }
    public void setBeforeDinner(Short beforeDinner) {
        this.beforeDinner = beforeDinner;
    }
    @Basic
    @Column(name = "before_dinner_time")
    public Time getBeforeDinnerTime() {
        return beforeDinnerTime;
    }
    public void setBeforeDinnerTime(Time beforeDinnerTime) {
        this.beforeDinnerTime = beforeDinnerTime;
    }
    @Basic
    @Column(name = "after_dinner")
    public Short getAfterDinner() {
        return afterDinner;
    }
    public void setAfterDinner(Short afterDinner) {
        this.afterDinner = afterDinner;
    }
    @Basic
    @Column(name = "after_dinner_time")
    public Time getAfterDinnerTime() {
        return afterDinnerTime;
    }
    public void setAfterDinnerTime(Time afterDinnerTime) {
        this.afterDinnerTime = afterDinnerTime;
    }
    @Basic
    @Column(name = "before_sleep")
    public Short getBeforeSleep() {
        return beforeSleep;
    }
    public void setBeforeSleep(Short beforeSleep) {
        this.beforeSleep = beforeSleep;
    }
    @Basic
    @Column(name = "before_sleep_time")
    public Time getBeforeSleepTime() {
        return beforeSleepTime;
    }
    public void setBeforeSleepTime(Time beforeSleepTime) {
        this.beforeSleepTime = beforeSleepTime;
    }
    @Basic
    @Column(name = "create_time")
    public Timestamp getCreateTime() {
        return createTime;
    }
    public void setCreateTime(Timestamp createTime) {
        this.createTime = createTime;
    }
    @Basic
    @Column(name = "alert_tag")
    public Short getAlertTag() {
        return alertTag;
    }
    public void setAlertTag(Short alertTag) {
        this.alertTag = alertTag;
    }
    @Basic
    @Column(name = "content")
    public String getContent() {
        return content;
    }
    public void setContent(String content) {
        this.content = content;
    }
}

+ 9 - 0
common/common-entity/src/main/java/com/yihu/wlyy/entity/patient/Patient.java

@ -98,6 +98,8 @@ public class Patient extends IdEntity implements Serializable {
	private Integer isWxtag;
	//微信iagId
	private Integer wxtagid;
	//居民预警状态:0为标准,1为预警状态
	private Integer standardStatus;
	public Integer getSicardStatus() {
@ -430,4 +432,11 @@ public class Patient extends IdEntity implements Serializable {
		}
	}
	public Integer getStandardStatus() {
		return standardStatus;
	}
	public void setStandardStatus(Integer standardStatus) {
		this.standardStatus = standardStatus;
	}
}

+ 105 - 0
common/common-entity/src/main/java/com/yihu/wlyy/entity/patient/PatientAimBloodPressure.java

@ -0,0 +1,105 @@
package com.yihu.wlyy.entity.patient;
import com.yihu.wlyy.entity.IdEntity;
import javax.persistence.*;
import java.sql.Timestamp;
/**
 * 患者监测目标-血压
 * @author huangwenjie
 * @date 2017/9/7 20:07
 */
@Entity
@Table(name = "wlyy_patient_aim_blood_pressure")
public class PatientAimBloodPressure extends IdEntity {
    private String code;
    private String patientcode;
    private String sbp;
    private String dbp;
    private String sbpMin;
    private String dbpMin;
    private String unit;
    private Timestamp createTime;
    @Basic
    @Column(name = "code")
    public String getCode() {
        return code;
    }
    public void setCode(String code) {
        this.code = code;
    }
    @Basic
    @Column(name = "patientcode")
    public String getPatientcode() {
        return patientcode;
    }
    public void setPatientcode(String patientcode) {
        this.patientcode = patientcode;
    }
    @Basic
    @Column(name = "sbp")
    public String getSbp() {
        return sbp;
    }
    public void setSbp(String sbp) {
        this.sbp = sbp;
    }
    @Basic
    @Column(name = "dbp")
    public String getDbp() {
        return dbp;
    }
    public void setDbp(String dbp) {
        this.dbp = dbp;
    }
    @Basic
    @Column(name = "sbp_min")
    public String getSbpMin() {
        return sbpMin;
    }
    public void setSbpMin(String sbpMin) {
        this.sbpMin = sbpMin;
    }
    @Basic
    @Column(name = "dbp_min")
    public String getDbpMin() {
        return dbpMin;
    }
    public void setDbpMin(String dbpMin) {
        this.dbpMin = dbpMin;
    }
    @Basic
    @Column(name = "unit")
    public String getUnit() {
        return unit;
    }
    public void setUnit(String unit) {
        this.unit = unit;
    }
    @Basic
    @Column(name = "create_time")
    public Timestamp getCreateTime() {
        return createTime;
    }
    public void setCreateTime(Timestamp createTime) {
        this.createTime = createTime;
    }
}

+ 94 - 0
common/common-entity/src/main/java/com/yihu/wlyy/entity/patient/PatientAimBloodSugger.java

@ -0,0 +1,94 @@
package com.yihu.wlyy.entity.patient;
import com.yihu.wlyy.entity.IdEntity;
import javax.persistence.*;
import java.sql.Timestamp;
/**
 * 患者监测目标-血糖
 * @author huangwenjie
 * @date 2017/9/7 20:07
 */
@Entity
@Table(name = "wlyy_patient_aim_blood_sugger")
public class PatientAimBloodSugger extends IdEntity {
    private String code;
    private String patientcode;
    private String fbg;
    private String hpg;
    private String minimum;
    private String unit;
    private Timestamp createTime;
    @Basic
    @Column(name = "code")
    public String getCode() {
        return code;
    }
    public void setCode(String code) {
        this.code = code;
    }
    @Basic
    @Column(name = "patientcode")
    public String getPatientcode() {
        return patientcode;
    }
    public void setPatientcode(String patientcode) {
        this.patientcode = patientcode;
    }
    @Basic
    @Column(name = "fbg")
    public String getFbg() {
        return fbg;
    }
    public void setFbg(String fbg) {
        this.fbg = fbg;
    }
    @Basic
    @Column(name = "hpg")
    public String getHpg() {
        return hpg;
    }
    public void setHpg(String hpg) {
        this.hpg = hpg;
    }
    @Basic
    @Column(name = "minimum")
    public String getMinimum() {
        return minimum;
    }
    public void setMinimum(String minimum) {
        this.minimum = minimum;
    }
    @Basic
    @Column(name = "unit")
    public String getUnit() {
        return unit;
    }
    public void setUnit(String unit) {
        this.unit = unit;
    }
    @Basic
    @Column(name = "create_time")
    public Timestamp getCreateTime() {
        return createTime;
    }
    public void setCreateTime(Timestamp createTime) {
        this.createTime = createTime;
    }
}

+ 84 - 0
common/common-entity/src/main/java/com/yihu/wlyy/entity/patient/PatientAimSports.java

@ -0,0 +1,84 @@
package com.yihu.wlyy.entity.patient;
import com.yihu.wlyy.entity.IdEntity;
import javax.persistence.*;
import java.sql.Timestamp;
/**
 * 患者监测目标-运动
 * @author huangwenjie
 * @date 2017/9/7 20:07
 */
@Entity
@Table(name = "wlyy_patient_aim_sports")
public class PatientAimSports extends IdEntity {
    private String code;
    private String patientcode;
    private Integer dailyStepCount;
    private String bmiMax;
    private String bmiMin;
    private Timestamp createTime;
    @Basic
    @Column(name = "code")
    public String getCode() {
        return code;
    }
    public void setCode(String code) {
        this.code = code;
    }
    @Basic
    @Column(name = "patientcode")
    public String getPatientcode() {
        return patientcode;
    }
    public void setPatientcode(String patientcode) {
        this.patientcode = patientcode;
    }
    @Basic
    @Column(name = "daily_step_count")
    public Integer getDailyStepCount() {
        return dailyStepCount;
    }
    public void setDailyStepCount(Integer dailyStepCount) {
        this.dailyStepCount = dailyStepCount;
    }
    @Basic
    @Column(name = "bmi_max")
    public String getBmiMax() {
        return bmiMax;
    }
    public void setBmiMax(String bmiMax) {
        this.bmiMax = bmiMax;
    }
    @Basic
    @Column(name = "bmi_min")
    public String getBmiMin() {
        return bmiMin;
    }
    public void setBmiMin(String bmiMin) {
        this.bmiMin = bmiMin;
    }
    @Basic
    @Column(name = "create_time")
    public Timestamp getCreateTime() {
        return createTime;
    }
    public void setCreateTime(Timestamp createTime) {
        this.createTime = createTime;
    }
}

+ 84 - 0
common/common-entity/src/main/java/com/yihu/wlyy/entity/patient/PatientSchemeList.java

@ -0,0 +1,84 @@
package com.yihu.wlyy.entity.patient;
import com.yihu.wlyy.entity.IdEntity;
import javax.persistence.*;
import java.sql.Timestamp;
/**
 * 患者-医生监测方案关联关系表
 * @author huangwenjie
 * @date 2017/9/7 20:07
 */
@Entity
@Table(name = "wlyy_patient_scheme_list")
public class PatientSchemeList extends IdEntity {
    private String code;
    private String patientcode;
    private String schemecode;
    private Short type;
    private String doctorcode;
    private Timestamp createTime;
    @Basic
    @Column(name = "code")
    public String getCode() {
        return code;
    }
    public void setCode(String code) {
        this.code = code;
    }
    @Basic
    @Column(name = "patientcode")
    public String getPatientcode() {
        return patientcode;
    }
    public void setPatientcode(String patientcode) {
        this.patientcode = patientcode;
    }
    @Basic
    @Column(name = "schemecode")
    public String getSchemecode() {
        return schemecode;
    }
    public void setSchemecode(String schemecode) {
        this.schemecode = schemecode;
    }
    @Basic
    @Column(name = "type")
    public Short getType() {
        return type;
    }
    public void setType(Short type) {
        this.type = type;
    }
    @Basic
    @Column(name = "doctorcode")
    public String getDoctorcode() {
        return doctorcode;
    }
    public void setDoctorcode(String doctorcode) {
        this.doctorcode = doctorcode;
    }
    @Basic
    @Column(name = "create_time")
    public Timestamp getCreateTime() {
        return createTime;
    }
    public void setCreateTime(Timestamp createTime) {
        this.createTime = createTime;
    }
}

+ 16 - 16
patient-co-manage/wlyy-manage/src/main/resources/application.yml

@ -1,6 +1,6 @@
server:
  port: 8180
  context-path: /wlyy_admin
  context-path: /wlyy_manager
  session-timeout: 3000000
spring:
@ -51,13 +51,13 @@ spring:
  profiles: dev
  datasource:
    wlyy:
      url: jdbc:mysql://172.19.103.85:3306/wlyy?useUnicode=true&characterEncoding=utf-8&autoReconnect=true
      username: linzhou
      password: linzhou
      url: jdbc:mysql://172.19.103.77:3306/wlyy?useUnicode=true&characterEncoding=utf-8&autoReconnect=true
      username: root
      password: 123456
    device:
      url: jdbc:mysql://172.19.103.85:3306/device?useUnicode=true&characterEncoding=utf-8&autoReconnect=true
      username: linzhou
      password: linzhou
      url: jdbc:mysql://172.19.103.77:3306/device?useUnicode=true&characterEncoding=utf-8&autoReconnect=true
      username: root
      password: 123456
    medicine:
      url: jdbc:mysql://172.19.103.77:3306/medicine?useUnicode=true&characterEncoding=utf-8&autoReconnect=true
      username: root
@ -79,9 +79,9 @@ spring:
  profiles: test
  datasource:
    wlyy:
      url: jdbc:mysql://172.19.103.77:3306/wlyy?useUnicode=true&characterEncoding=utf-8&autoReconnect=true
      username: root
      password: 123456
      url: jdbc:mysql://172.17.110.160/wlyy?useUnicode:true&characterEncoding=utf-8&autoReconnect=true
      username: ssgg
      password: ssgg
    device:
      url: jdbc:mysql://172.19.103.77:3306/device?useUnicode=true&characterEncoding=utf-8&autoReconnect=true
      username: root
@ -109,17 +109,17 @@ spring:
  profiles: prod
  datasource:
    wlyy:
      url: jdbc:mysql://59.61.92.94:3306/wlyy?useUnicode=true&characterEncoding=utf-8&autoReconnect=true
      url: jdbc:mysql://59.61.92.90:8079/wlyy?useUnicode=true&characterEncoding=utf-8&autoReconnect=true
      username: wlyy
      password: jkzlehr@123
    device:
      url: jdbc:mysql://59.61.92.94:3306/device?useUnicode=true&characterEncoding=utf-8&autoReconnect=true
      url: jdbc:mysql://59.61.92.90:8079/device?useUnicode=true&characterEncoding=utf-8&autoReconnect=true
      username: wlyy
      password: jkzlehr@123
    medicine:
      url: jdbc:mysql://172.19.103.77:3306/medicine?useUnicode=true&characterEncoding=utf-8&autoReconnect=true
      username: root
      password: 123456
      url: jdbc:mysql://59.61.92.90:8079/medicine?useUnicode=true&characterEncoding=utf-8&autoReconnect=true
      username: wlyy
      password: jkzlehr@123
  sms: # SMS短信配置
    yihu_sms_url: https://smsapi.ums86.com:9600/sms/Api/Send.do
    yihu_sms_code: 229336
@ -128,6 +128,6 @@ spring:
service-gateway:
  update-team-url: http://59.61.92.90:8072/wlyy_service/third/doctor/LoadTeamInfo
im-service:
  im_service_url: http://120.41.253.95:3000/api/v2
  im_service_url: http://27.155.101.77:3000/api/v2
yueren:
  api: http://120.77.209.211:8080

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

@ -81,6 +81,8 @@ public class Patient extends IdEntity implements Serializable {
	private String openid;
	// 用户状态:1正常,0禁用,-1恶意注册,2审核中
	private Integer status;
	//居民预警状态:0为标准,1为预警状态
	private Integer standardStatus;
	public Patient(Long id) {
@ -319,4 +321,8 @@ public class Patient extends IdEntity implements Serializable {
	public void setStatus(Integer status) {
		this.status = status;
	}
	public static long getSerialVersionUID() {
		return serialVersionUID;
	}
}

+ 13 - 3
patient-co-service/wlyy_device/src/main/java/com/yihu/hos/device/model/PatientHealthIndex.java

@ -21,9 +21,9 @@ public class PatientHealthIndex extends IdEntity {
	private String intervene;
	// 血糖/收缩压/体重/腰围/早餐前空腹
	private String value1;
	// 舒张压/早餐后空腹
	// 舒张压/早餐后空腹/身高
	private String value2;
	// 午餐空腹
	// 午餐空腹/身高
	private String value3;
	// 午餐后
	private String value4;
@ -33,7 +33,7 @@ public class PatientHealthIndex extends IdEntity {
	private String value6;
	// 睡前
	private String value7;
	// 健康指标类型(1血糖,2血压,3体重,4腰围)
	// 健康指标类型(1血糖,2血压,3体重/身高/BMI,4腰围)
	private int type;
	// 记录时间
	private Date recordDate;
@ -48,6 +48,8 @@ public class PatientHealthIndex extends IdEntity {
	//设备编号
	private String deviceSn;
	private int status;//状态:0为标准,1为异常
	public String getUser() {
		return user;
	}
@ -182,4 +184,12 @@ public class PatientHealthIndex extends IdEntity {
	public void setDeviceSn(String deviceSn) {
		this.deviceSn = deviceSn;
	}
	public int getStatus() {
		return status;
	}
	public void setStatus(int status) {
		this.status = status;
	}
}

+ 10 - 0
patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/entity/Patient.java

@ -74,6 +74,8 @@ public class Patient extends IdEntity {
	private Integer status;
	// 用户手机备注
	private String mobileRemarks;
	//居民预警状态:0为标准,1为预警状态
	private Integer standardStatus;
	public Patient() {
	}
@ -312,4 +314,12 @@ public class Patient extends IdEntity {
	public void setMobileRemarks(String mobileRemarks) {
		this.mobileRemarks = mobileRemarks;
	}
	public Integer getStandardStatus() {
		return standardStatus;
	}
	public void setStandardStatus(Integer standardStatus) {
		this.standardStatus = standardStatus;
	}
}

+ 14 - 4
patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/entity/device/PatientHealthIndex.java

@ -21,11 +21,11 @@ public class PatientHealthIndex extends IdEntity {
	private String user;
	// 干预标志
	private String intervene;
	// 血糖/收缩压/体重/腰围/早餐前空腹/身高/BMI
	// 血糖/收缩压/体重/腰围/早餐前空腹
	private String value1;
	// 舒张压/早餐后空腹
	// 舒张压/早餐后空腹/身高
	private String value2;
	// 午餐空腹
	// 午餐空腹/BMI
	private String value3;
	// 午餐后
	private String value4;
@ -35,7 +35,7 @@ public class PatientHealthIndex extends IdEntity {
	private String value6;
	// 睡前
	private String value7;
	// 健康指标类型(1血糖,2血压,3体重,4腰围,5身高,6BMI)
	// 健康指标类型(1血糖,2血压,3体重/身高/BMI,4腰围)
	private int type;
	// 记录时间
	private Date recordDate;
@ -50,6 +50,8 @@ public class PatientHealthIndex extends IdEntity {
	//设备编号
	private String deviceSn;
	private int status;//状态:0为标准,1为异常
	public String getUser() {
		return user;
	}
@ -184,4 +186,12 @@ public class PatientHealthIndex extends IdEntity {
	public void setDeviceSn(String deviceSn) {
		this.deviceSn = deviceSn;
	}
	public int getStatus() {
		return status;
	}
	public void setStatus(int status) {
		this.status = status;
	}
}

+ 1 - 1
patient-co-service/wlyy_service/src/main/webapp/prescription_consulting/js/prescription_consulting_info.js

@ -6,7 +6,7 @@ var request = GetRequest(),
    prepend =  false; 
//var server = "http://192.168.131.24:8081/";//本地
//var server = "http://172.19.103.88:8011/wlyy_service";//测试
var server = "http://59.61.92.90:8072/wlyy_service";//正式
var server = "http://10.95.22.10:8011/wlyy_service";//正式
$(function(){
    dialroll = iscrollAssist.newVerScrollForPull($('.pull-iscroll-wrap'), pulldownAction, null);

+ 10 - 0
patient-co-service/wlyy_sign/src/main/java/com/yihu/wlyy/sign/entity/Patient.java

@ -76,6 +76,8 @@ public class Patient extends IdEntity {
	private String mobileRemarks;
	// 居委会
	private String sickVillage;
	//居民预警状态:0为标准,1为预警状态
	private Integer standardStatus;
	public Patient() {
	}
@ -322,4 +324,12 @@ public class Patient extends IdEntity {
	public void setMobileRemarks(String mobileRemarks) {
		this.mobileRemarks = mobileRemarks;
	}
	public Integer getStandardStatus() {
		return standardStatus;
	}
	public void setStandardStatus(Integer standardStatus) {
		this.standardStatus = standardStatus;
	}
}

+ 0 - 8
patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/job/consult/FamousConsultTimesJob.java

@ -1,23 +1,15 @@
package com.yihu.wlyy.job.consult;
import com.yihu.wlyy.entity.doctor.profile.Doctor;
import com.yihu.wlyy.entity.doctor.schedule.DoctorFamousConsultTimesRemain;
import com.yihu.wlyy.repository.doctor.DoctorDao;
import com.yihu.wlyy.repository.doctor.FamousDoctorTimesRemainDao;
import com.yihu.wlyy.service.app.account.DoctorInfoService;
import com.yihu.wlyy.service.app.scheduling.DoctorWorkTimeService;
import org.json.JSONObject;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.context.support.SpringBeanAutowiringSupport;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
/**
 * Created by lyr on 2016/9/21.

+ 26 - 2
patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/redis/RedisThread.java

@ -1,6 +1,8 @@
package com.yihu.wlyy.redis;
import com.alibaba.fastjson.JSONObject;
import com.yihu.wlyy.service.app.prescription.PrescriptionService;
import com.yihu.wlyy.task.PushMsgTask;
import com.yihu.wlyy.util.SystemConf;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
@ -30,7 +32,8 @@ public class RedisThread implements Runnable {
    private StringRedisTemplate redisTemplate;
    @Autowired
    private PrescriptionService prescriptionService;
    @Autowired
    private PushMsgTask pushMsgTask;
    @Override
    public void run() {
@ -55,7 +58,7 @@ public class RedisThread implements Runnable {
                if(StringUtils.isEmpty(message)){
                    Thread.sleep(1000L);//如果没有读取到记录,等待1秒
                }else {
                    prescriptionService.redisMessage(message);
                    redisMessage(message);
                }
            }catch (Exception e){
                e.printStackTrace();
@ -64,4 +67,25 @@ public class RedisThread implements Runnable {
        }
    }
    public void redisMessage(String message){
        logger.info("redis_onMessage...:"+message);
        //this.unsubscribe();
        try{
            JSONObject json = JSONObject.parseObject(message);
            String title =  json.getString("title");
            if("dispensingComplete".equals(title)){//配药完成
                //药品配送完成,提醒取药
                String prescriptionCode = json.getString("prescription");
                prescriptionService.dispensingComplete(prescriptionCode);
            }else if("wechat".equals(title)){
                String data = json.getString("value");
                pushMsgTask.getQueue().put(new org.json.JSONObject(data));
            }else{
            }
        }catch (Exception e){
            logger.error("redis_error...",e);
        }
    }
}

+ 0 - 2
patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/service/app/scheduling/DoctorWorkTimeService.java

@ -10,13 +10,11 @@ import com.yihu.wlyy.repository.doctor.DoctorWorkWeekDao;
import com.yihu.wlyy.repository.doctor.FamousDoctorTimesRemainDao;
import com.yihu.wlyy.service.BaseService;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.ss.formula.eval.StringValueEval;
import org.json.JSONArray;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.print.Doc;
import javax.transaction.Transactional;
import java.text.SimpleDateFormat;
import java.util.*;

+ 4 - 0
patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/task/PushMsgTask.java

@ -80,6 +80,10 @@ public class PushMsgTask {
        }
    }
    public static LinkedBlockingQueue<JSONObject> getQueue() {
        return queue;
    }
    /**
     * 添加微信消息
     *

+ 1 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/config/SwaggerConfig.java

@ -175,6 +175,7 @@ public class SwaggerConfig {
                        regex("/wechat/.*"),
                        regex("/nofilter/.*"),
                        regex("/idc10/.*"),
                        regex("/version/.*"),
                        regex("/express/.*")
                ))

File diff suppressed because it is too large
+ 20 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/account/PatientInfoService.java


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

@ -2297,11 +2297,15 @@ public class ConsultTeamService extends ConsultService {
                json.put("represented",p.getCode());//被代理人
                json.put("remark", "");
                json.put("consult", consult);
                String first = endName + ",您好!您有1条";;
                String first = name + ",您好!您有1条";;
                if(consultTeam.getType()==8){
                    first += "续方";
                }
                first += "咨询已结束,请及时对咨询医生进行评价。";
                if (endOperator.equals("admin")) {
                    first += "咨询超时未回复,系统自动关闭,请及时对咨询医生进行评价。";
                }else {
                    first += "咨询已结束,请及时对咨询医生进行评价。";
                }
                json.put("first", first);
                if(StringUtils.isNotBlank(p.getOpenid())){
                    pushMsgTask.putWxMsg(accessTokenUtils.getAccessToken(), 17, openId, p.getName(), json);

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

@ -588,6 +588,74 @@ public class PrescriptionInfoService extends BaseService {
        }
    }
    public void setTotalSQL(StringBuffer pre_sql, List<Object> params, Integer teamCode, String state, String startDate, String endDate, String nameKeyword, String patient) {
        if (teamCode != null && teamCode > 0) {
            pre_sql.append(" AND pr.admin_team_id =?");
        }
        params.add(teamCode);
        if (StringUtils.isNotBlank(state)) {
            pre_sql.append(" AND pr.status IN (" + state + ") ");
        }
        if (StringUtils.isNotBlank(startDate)) {
            pre_sql.append(" AND pr.create_time >= ? ");
            params.add(startDate+" 00:00:00");
        }
        if (StringUtils.isNotBlank(endDate)) {
            pre_sql.append(" AND pr.create_time <= ? ");
            params.add(endDate+" 23:59:59");
        }
        if (StringUtils.isNotBlank(nameKeyword)) {
            pre_sql.append(" AND pr.patient_name like ? ");
            params.add("%" + nameKeyword + "%");
        }
        if (StringUtils.isNotBlank(patient)) {
            pre_sql.append(" AND pr.patient = ?");
            params.add(patient);
        }
    }
    /**
     * 获取处方详情总数
     * @param teamCode
     * @param state
     * @param diseases
     * @param startDate
     * @param endDate
     * @param nameKeyword
     * @param patient
     * @return
     */
    public JSONObject getDoctorPrescriptionTotal(Integer teamCode, String state, String diseases, String startDate, String endDate, String nameKeyword, String patient) {
        StringBuffer pre_sql = new StringBuffer("SELECT count(1) AS total" +
                " FROM " +
                " wlyy_prescription pr " +
                " LEFT JOIN wlyy_patient p ON pr.patient = p.`code` ");
        List<Object> params = new ArrayList<>();
        //先判断疾病类型是否为空
        if (StringUtils.isNotBlank(diseases)) {
            //疾病类型不为空,关联查询疾病类型表
            pre_sql.append(" ,wlyy_prescription_diagnosis s " +
                    " WHERE s.prescription_code = pr.code " +
                    " AND s.health_problem = ?");
            params.add(diseases);
            setTotalSQL(pre_sql, params, teamCode, state, startDate, endDate, nameKeyword, patient);
        } else {
            //查询所有疾病类型表
            pre_sql.append(" WHERE 1=1 ");
            setTotalSQL(pre_sql, params, teamCode, state, startDate, endDate, nameKeyword, patient);
        }
        List<Map<String, Object>> rs = jdbcTemplate.queryForList(pre_sql.toString(), params.toArray());
        JSONObject jsonRs = new JSONObject();
        if(rs!=null && rs.size()>0){
            jsonRs.put("total",rs.get(0).get("total"));
        }else{
            jsonRs.put("total",0);
        }
        return jsonRs;
    }
    /**
     * 获取续方信息
     *
@ -855,6 +923,26 @@ public class PrescriptionInfoService extends BaseService {
        return new JSONArray(rs);
    }
    public JSONObject getHDoctorPrescriptionExpressageTotal(String teamCode, String type, String doctor, String nameKey, String startDate, String endDate, String hospital, String state) {
        StringBuffer pre_sql = new StringBuffer("SELECT count(1) AS total " +
                " FROM " +
                " wlyy_prescription pr " +
                " LEFT JOIN wlyy_patient p ON pr.patient = p.`code` " +
                " JOIN wlyy_prescription_expressage e ON pr.code = e.prescription_code " +
                " WHERE 1=1 AND pr.status >="+PrescriptionLog.PrescriptionLogStatus.pay_success.getValue()+" ");
        List<Object> params = new ArrayList<>();
        setExpressageTotalSql(pre_sql, params, teamCode, type, doctor, nameKey, startDate, endDate, hospital, state);
        List<Map<String, Object>> rs = jdbcTemplate.queryForList(pre_sql.toString(), params.toArray());
        JSONObject jsonRs=new JSONObject();
        if(rs!=null&&rs.size()>0){
            jsonRs.put("total",rs.get(0).get("total"));
        }else{
            jsonRs.put("total",0);
        }
        return jsonRs;
    }
    public void setExpressageSql(StringBuffer pre_sql, List<Object> param, String teamCode, String type, String doctor, String nameKey, String startDate, String endDate, String hospital, String state, Integer page, Integer size) {
        if (StringUtils.isNotBlank(type)) {
@ -896,6 +984,43 @@ public class PrescriptionInfoService extends BaseService {
        }
    }
    public void setExpressageTotalSql(StringBuffer pre_sql, List<Object> param, String teamCode, String type, String doctor, String nameKey, String startDate, String endDate, String hospital, String state) {
        if (StringUtils.isNotBlank(type)) {
            if ("1".equals(type)) {
                pre_sql.append(" AND e.expressage_Code = ?");
                param.add(doctor);
            } else {
                pre_sql.append(" AND e.accept_Code = ?");
                param.add(doctor);
            }
        }
        if (StringUtils.isNotBlank(teamCode)) {
            pre_sql.append(" AND pr.admin_team_id = ? ");
            param.add(teamCode);
        }
        if (StringUtils.isNotBlank(nameKey)) {
            pre_sql.append(" AND p.name LIKE ? ");
            param.add("%" + nameKey + "%");
        }
        if (StringUtils.isNotBlank(startDate)) {
            pre_sql.append(" AND pr.create_time >= ? ");
            param.add(startDate + " 00:00:00");
        }
        if (StringUtils.isNotBlank(endDate)) {
            pre_sql.append(" AND pr.create_time <= ? ");
            param.add(endDate + " 23:59:59");
        }
        if (StringUtils.isNotBlank(hospital)) {
            pre_sql.append(" AND e.hospital_code = ? ");
            param.add(hospital);
        }
        if (StringUtils.isNotBlank(state)) {
            pre_sql.append(" AND pr.status = ? ");
            param.add(state);
        }
    }
    /**
     * 获取订单跟踪下拉列表
     * @param doctor
@ -1076,6 +1201,27 @@ public class PrescriptionInfoService extends BaseService {
        return new JSONArray(rs);
    }
    public JSONObject getDoctorPrescriptionExpressageTotal(Integer teamCode, String nameKey, String startDate, String endDate, String hospital, String state, String dispensaryType, String AllocationType) {
        StringBuffer pre_sql = new StringBuffer("SELECT count(1) AS total " +
                " FROM " +
                " wlyy_prescription pr " +
                " LEFT JOIN wlyy_patient p ON pr.patient = p.`code` " +
                " JOIN wlyy_prescription_expressage e ON pr.code = e.prescription_code " +
                " JOIN wlyy_prescription_reviewed r ON pr.code = r.prescription_code " +
                " WHERE r.status=1 AND pr.status >="+PrescriptionLog.PrescriptionLogStatus.pay_success.getValue()+" ");
        List<Object> params = new ArrayList<>();
        setDoctorExpressageTotalSql(pre_sql, params, teamCode, nameKey, startDate, endDate, hospital, state, dispensaryType, AllocationType);
        List<Map<String, Object>> rs = jdbcTemplate.queryForList(pre_sql.toString(), params.toArray());
        JSONObject jsonRs = new JSONObject();
        if(rs!=null && rs.size()>0){
            jsonRs.put("total",rs.get(0).get("total"));
        }else{
            jsonRs.put("total",0);
        }
        return jsonRs;
    }
    public void setDoctorExpressageSql(StringBuffer pre_sql, List<Object> param, Integer teamCode, String nameKey, String startDate, String endDate, String hospital, String state, String dispensaryType, String AllocationType, Integer page, Integer size) {
        if (StringUtils.isNotBlank(nameKey)) {
            pre_sql.append(" AND p.name LIKE ? ");
@ -1118,6 +1264,43 @@ public class PrescriptionInfoService extends BaseService {
        }
    }
    public void setDoctorExpressageTotalSql(StringBuffer pre_sql, List<Object> param, Integer teamCode, String nameKey, String startDate, String endDate, String hospital, String state, String dispensaryType, String AllocationType) {
        if (StringUtils.isNotBlank(nameKey)) {
            pre_sql.append(" AND p.name LIKE ? ");
            param.add("%" + nameKey + "%");
        }
        if (teamCode != null && teamCode > 0) {
            pre_sql.append(" AND pr.admin_team_id = ? ");
            param.add(teamCode);
        }
        if (StringUtils.isNotBlank(startDate)) {
            pre_sql.append(" AND pr.create_time >= ? ");
            param.add(startDate + " 00:00:00");
        }
        if (StringUtils.isNotBlank(endDate)) {
            pre_sql.append(" AND pr.create_time <= ? ");
            param.add(endDate + " 23:59:59");
        }
        if (StringUtils.isNotBlank(hospital)) {
            pre_sql.append(" AND e.hospital_code = ? ");
            param.add(hospital);
        }
        if (StringUtils.isNotBlank(state)) {
            pre_sql.append(" AND pr.status = ? ");
            param.add(state);
        }
        if (StringUtils.isNotBlank(dispensaryType)) {
            pre_sql.append(" AND pr.dispensary_type = ? ");
            param.add(dispensaryType);
        }
        if (StringUtils.isNotBlank(AllocationType)) {
            //1为未分配建管师列表
            if ("1".equals(AllocationType)) {
                pre_sql.append(" AND e.expressage_code IS NULL ");
            }
        }
    }
    public JSONObject getCountExpressage(String teamCode) {
        StringBuffer pre_sql = new StringBuffer("SELECT " +
                " count(1) AS count  " +

+ 92 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/sign/SignWebService.java

@ -281,6 +281,98 @@ public class SignWebService extends BaseService {
        return patients;
    }
    /**
     * 获取区签约居民数目
     * @param doctor
     * @return
     */
    public JSONObject getSignWebByDoctorCount(String doctor) {
        Doctor d = doctorDao.findByCode(doctor);
        String sql ;
        if (d != null && d.getLevel() == 3) {
             sql ="SELECT  " +
                    "( " +
                    " SELECT " +
                    "  count(1) " +
                    " FROM " +
                    "  wlyy_sign_family " +
                    " WHERE " +
                    "  doctor_health = '"+doctor+"' " +
                    " AND doctor IS NULL " +
                    " AND STATUS = 0 " +
                    " AND type = 2 " +
                    " AND expenses_status = '0' " +
                    " ) AS waitSignCount, " +
                    "( " +
                    " SELECT " +
                    "  count(1) " +
                    " FROM " +
                    "  wlyy_sign_family " +
                    " WHERE " +
                    "  (doctor = '"+doctor+"' or doctor_health = '"+doctor+"') " +
                    " AND STATUS > 0 " +
                    " AND type = 2 " +
                    " AND expenses_status = '0'  " +
                    " ) AS waitPayCount, " +
                    "( " +
                    " SELECT " +
                    " count(1) " +
                    " FROM " +
                    " wlyy_sign_family " +
                    " WHERE " +
                    " (doctor = '"+doctor+"' or doctor_health = '"+doctor+"') " +
                    " AND STATUS = 1 " +
                    " AND type = 2 " +
                    " AND expenses_status = '1'  " +
                    " ) AS signCount";
        }else{
             sql ="SELECT  " +
                    "( " +
                    " SELECT " +
                    "  count(1) " +
                    " FROM " +
                    "  wlyy_sign_family " +
                    " WHERE " +
                    "  doctor = '"+doctor+"' " +
                    " AND STATUS = 0 " +
                    " AND type = 2 " +
                    " AND expenses_status = '0' " +
                    " ) AS waitSignCount, " +
                    "( " +
                    " SELECT " +
                    "  count(1) " +
                    " FROM " +
                    "  wlyy_sign_family " +
                    " WHERE " +
                    "  (doctor = '"+doctor+"' or doctor_health = '"+doctor+"') " +
                    " AND STATUS > 0 " +
                    " AND type = 2 " +
                    " AND expenses_status = '0'  " +
                    " ) AS waitPayCount, " +
                    "( " +
                    " SELECT " +
                    " count(1) " +
                    " FROM " +
                    " wlyy_sign_family " +
                    " WHERE " +
                    " (doctor = '"+doctor+"' or doctor_health = '"+doctor+"') " +
                    " AND STATUS = 1 " +
                    " AND type = 2 " +
                    " AND expenses_status = '1'  " +
                    " ) AS signCount";
        }
        List<Map<String,Object>> list = jdbcTemplate.queryForList(sql);
        if(list!=null&&list.size()>0){
            return new JSONObject(list.get(0));
        }
        return new JSONObject();
    }
    /**
     * 查询家庭签约已缴费未关注人数
     *

+ 20 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/task/PushMsgTask.java

@ -11,6 +11,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Component;
import javax.annotation.PostConstruct;
@ -55,6 +56,15 @@ public class PushMsgTask {
    private String template_doctor_audit;//审核结果通知
    @Value("${wechat.message.template_doctor_service}")
    private String template_doctor_service;//服务结果通知
    @Value("${pushMes.method}")
    private String putMesMethod;
    @Value("${pushMes.redis_prescription_title}")
    private String redisQueue;
    @Value("${putMesType.wechat}")
    private String putMesType;
    @Autowired
    private StringRedisTemplate redisTemplate;
    /**
     * 添加一条推送消息
@ -95,8 +105,16 @@ public class PushMsgTask {
            json.put("openid", openid);
            json.put("name", name);
            json.put("data", data);
            queue.put(json);
            String str = "";
            //如果是内网推送到redis,如果是外网推送到内存队列
            if(putMesMethod.equals("1")){
                JSONObject mes = new JSONObject();
                mes.put("title",putMesType);
                mes.put("value",json.toString());
                redisTemplate.opsForList().leftPush(redisQueue,mes.toString());
            }else{
                queue.put(json);
            }
        } catch (Exception e) {
            logger.error("添加到微信消息列队列失败!", e);
            e.printStackTrace();

+ 2 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/common/account/LoginController.java

@ -143,7 +143,7 @@ public class LoginController extends BaseController {
                if (loginPassword.equals(doctor.getPassword())) {
                    Token token = tokenService.findDoctorToken(doctor.getCode());
                    if (token != null && platform == 4) {
                    if (token != null && platform == 4 && getIMEI().equals(token.getImei())) {
                        //pc版本要做单点登陆 所以如果platform =4 并且 token存在直接返回之前的token
                    } else {
@ -213,7 +213,7 @@ public class LoginController extends BaseController {
                    loginLog.setUserCode(doctor.getCode());
                    // 用户校验通过,生成token
                    Token token = tokenService.findDoctorToken(doctor.getCode());
                    if (token != null && platform == 4) {
                    if (token != null && platform == 4 && getIMEI().equals(token.getImei())) {
                        //pc版本要做单点登陆 所以如果platform =4 并且 token存在直接返回之前的token
                    } else {

+ 14 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/patient/PatientInfoController.java

@ -61,4 +61,18 @@ public class PatientInfoController extends BaseController {
            return invalidUserException(e, -1, "获取患者信息失败!");
        }
    }
    @RequestMapping(value = "initPatientNation")
    @ResponseBody
    @ApiOperation("初始化民族字典")
    public String initPatientNation(){
        try {
            // 获取医生下的患者
            int rs = patientInfoService.initPatientNation();
            return write(200, "初始化成功!", "data", rs);
        } catch (Exception e) {
            error(e);
            return invalidUserException(e, -1, "获取患者信息失败!");
        }
    }
}

+ 58 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/prescription/PrescriptionInfoController.java

@ -80,6 +80,23 @@ public class PrescriptionInfoController extends BaseController {
            return error(-1, "查询失败!");
        }
    }
    @RequestMapping(value = "/getDoctorPrescriptionTotal", method = RequestMethod.GET)
    @ApiOperation(value = "获取全科医生数目/建管师续方列表数目/搜索数目")
    public String getDoctorPrescriptionTotal(@RequestParam(required = false) @ApiParam(value = "团队code", name = "teamCode") Integer teamCode,
                                        @RequestParam(required = false) @ApiParam(value = "续方状态", name = "state") String state,
                                        @RequestParam(required = false) @ApiParam(value = "所有诊断:1 糖尿病 2高血压", name = "dispensary") String diseases,
                                        @RequestParam(required = false) @ApiParam(name = "startDate", value = "开始时间") String startDate,
                                        @RequestParam(required = false) @ApiParam(name = "endDate", value = "结束时间") String endDate,
                                        @RequestParam(required = false) @ApiParam(name = "nameKeyword", value = "患者姓名模糊匹配") String nameKeyword,
                                        @RequestParam(required = false) @ApiParam(name = "patient", value = "患者Code") String patient) {
        try {
            return write(200, "查询成功!", "data", prescriptionInfoService.getDoctorPrescriptionTotal(teamCode, state, diseases, startDate, endDate, nameKeyword, patient));
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败!");
        }
    }
    @RequestMapping(value = "/getContinuedPrescriptionAsDoctor", method = RequestMethod.GET)
    @ApiOperation(value = "续方详情")
@ -239,6 +256,24 @@ public class PrescriptionInfoController extends BaseController {
        }
    }
    @RequestMapping(value = "/getHDoctorPrescriptionExpressageTotal", method = RequestMethod.GET)
    @ApiOperation(value = "获取健康管理师续方订单列表数目")
    public String getHDoctorPrescriptionExpressageTotal
            (@RequestParam(required = false) @ApiParam(value = "团队Code", name = "teamCode") String teamCode,
             @RequestParam(required = false) @ApiParam(value = "1:需跟踪;2:已接收", name = "type") String type,
             @RequestParam(required = false) @ApiParam(value = "患者姓名关键字", name = "nameKey") String nameKey,
             @RequestParam(required = false) @ApiParam(value = "开始时间", name = "startDate") String startDate,
             @RequestParam(required = false) @ApiParam(value = "结束时间", name = "endDate") String endDate,
             @RequestParam(required = false) @ApiParam(value = "服务站", name = "hospital") String hospital,
             @RequestParam(required = false) @ApiParam(value = "配送状态", name = "state") String state) {
        try {
            return write(200, "操作成功!", "data", prescriptionInfoService.getHDoctorPrescriptionExpressageTotal(teamCode, type, getRepUID(), nameKey, startDate, endDate, hospital, state));
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败!");
        }
    }
    @RequestMapping(value = "/getPrescriptionExpressageFilter", method = RequestMethod.GET)
    @ApiOperation(value = "获取健康管理师续方订单列表过滤条件")
    public String getPrescriptionExpressageFilter() {
@ -286,6 +321,29 @@ public class PrescriptionInfoController extends BaseController {
        }
    }
    @RequestMapping(value = "/getDoctorPrescriptionExpressageTotal", method = RequestMethod.GET)
    @ApiOperation(value = "获取全科医生续方订单列表数目")
    public String getDoctorPrescriptionExpressageTotal
            (@RequestParam(required = false) @ApiParam(value = "团队Code", name = "teamCode") Integer teamCode,
             @RequestParam(required = false) @ApiParam(value = "居民搜素关键字", name = "nameKey") String nameKey,
             @RequestParam(required = false) @ApiParam(value = "开始时间", name = "startDate") String startDate,
             @RequestParam(required = false) @ApiParam(value = "结束时间", name = "endDate") String endDate,
             @RequestParam(required = false) @ApiParam(value = "机构", name = "hospital") String hospital,
             @RequestParam(required = false) @ApiParam(value = "配送状态", name = "state") String state,
             @RequestParam(required = false) @ApiParam(value = "配送方式:1 自取 2快递配送 3健管师配送", name = "dispensaryType") String
                     dispensaryType,
             @RequestParam(required = false) @ApiParam(value = "传1为未分配健管师", name = "AllocationType") String
                     allocationType) {
        try {
            return write(200, "操作成功!", "data",
                    prescriptionInfoService.
                            getDoctorPrescriptionExpressageTotal(teamCode, nameKey, startDate, endDate, hospital, state, dispensaryType, allocationType));
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败!");
        }
    }
    @RequestMapping(value = "/getCountExpressage", method = RequestMethod.GET)
    @ApiOperation(value = "获取指定团队未分配建管师订单数目")
    public String getCountExpressage

+ 11 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/sign/DoctorSignController.java

@ -335,6 +335,17 @@ public class DoctorSignController extends WeixinBaseController {
        }
    }
    @RequestMapping("/sign_info_count")
    @ApiOperation(value = "签约居民数目")
    public String getSignWebByDoctorCount(){
        try{
            //hxmD201703150222
            return write(200,"查询成功","data",signWebService.getSignWebByDoctorCount(getUID()));
        }catch (Exception e){
            return error(-1,"查询失败");
        }
    }
    /**
     * 查询今天是否全部提醒关注
     *

+ 36 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/wx/WechatMenuController.java

@ -116,4 +116,40 @@ public class WechatMenuController extends BaseController {
            return error(-1, "创建失败");
        }
    }
    /**
     * 医生助手微信菜单创建
     *
     * @return
     */
    @ApiOperation(value = "医生助手微信菜单创建")
    @RequestMapping(value = "/menu/create/feldsher", method = RequestMethod.POST)
    public String createMenuTestFeldsher() {
        try {
            String filePath = WechatCoreController.class.getResource("/").getPath() +
                    File.separator + "wechat" + File.separator + "weixin_menu_feldsher.txt";
            String url = " https://api.weixin.qq.com/cgi-bin/menu/create?access_token=" + weiXinAccessTokenUtils.getAccessToken();
            // 读取微信菜单配置文件
            InputStreamReader reader = new InputStreamReader(new FileInputStream(filePath), "utf-8");
            BufferedReader bufferedReader = new BufferedReader(reader);
            String params = "";
            String readTxt = "";
            // 读取微信菜单
            while ((readTxt = bufferedReader.readLine()) != null) {
                System.out.println(readTxt);
                params += readTxt;
            }
            bufferedReader.close();
            reader.close();
            // 替换服务器地址、APPID
            params = params.replaceAll("server_url", wechat_base_url);
            params = params.replaceAll("appId", appId);
            // 请求微信接口创建菜单
            String jsonStr = HttpUtil.sendPost(url, params);
            return write(200, "创建成功!", "data", jsonStr);
        } catch (Exception e) {
            return error(-1, "创建失败");
        }
    }
}

+ 218 - 11
patient-co/patient-co-wlyy/src/main/resources/application.yml

@ -91,11 +91,9 @@ interceptor:
  accesstoken:
    status: 1 ###  1开启 0 关闭
    time: 2 ##对外接的accesstoken生命周期 2小时
putMesType:
  #推送到redis消息类型
  wechat: wechat
---
##测试的配置
spring:
@ -187,6 +185,11 @@ express:
#  sf_url: https://bsp-ois.sit.sf-express.com:9443/bsp-ois/sfexpressServic
  sf_code: SDDF
  sf_check_word: ttzlgGyOQu4L
pushMes:
# 1为推送redis,0为推送消息队列
  method: 0
  # redis队列名称
  redis_prescription_title: redisPrescription
es:
  index:
@ -294,6 +297,11 @@ express:
#  sf_url: https://bsp-ois.sit.sf-express.com:9443/bsp-ois/sfexpressServic
  sf_code: sddf
  sf_check_word: PqFN0ADkTwnvXArMhqGxVduag44vyDQ7
pushMes:
# 1为推送redis,0为推送消息队列
  method: 0
  # redis队列名称
  redis_prescription_title: redisPrescription
es:
@ -403,6 +411,11 @@ express:
#  sf_url: https://bsp-ois.sit.sf-express.com:9443/bsp-ois/sfexpressServic
  sf_code: SDDF
  sf_check_word: ttzlgGyOQu4L
pushMes:
  # 1为推送redis,0为推送消息队列
  method: 0
  # redis队列名称
  redis_prescription_title: redisPrescription
es:
  index:
@ -503,8 +516,11 @@ express:
#  sf_url: https://bsp-ois.sit.sf-express.com:9443/bsp-ois/sfexpressServic
  sf_code: SDDF
  sf_check_word: ttzlgGyOQu4L
pushMes:
# 1为推送redis,0为推送消息队列
  method: 0
  # redis队列名称
  redis_prescription_title: redisPrescription
es:
  index:
    HealthEduArticlePatient: health_edu_article_patient_test
@ -514,10 +530,201 @@ es:
  port: 9200
  tPort: 9300
  clusterName: jkzl
---
##内网环境连测试环境
spring:
  profiles: local_test
  datasource:
    wlyy:
      url: jdbc:mysql://172.19.103.85/wlyy?useUnicode:true&amp;characterEncoding=utf-8&amp;autoReconnect=true
      username: linzhou
      password: linzhou
    health:
      url: jdbc:mysql://172.19.103.85/device?useUnicode=true&amp;characterEncoding=utf-8&amp;autoReconnect=true
      username: linzhou
      password: linzhou
  redis:
    host: 172.19.103.88 # Redis server host.
    port: 6379 # Redis server port.
#    password: jkzl_ehr
server:
  server_url: http://ehr.yihu.com/wlyy/
im:
  im_list_get: http://172.19.103.88:3000/
  data_base_name: im_new
wechat:
  appId: wx1f129f7b51701428
  appSecret: 988f005d8309ed1795939e0f042431fb
  wechat_token: 27eb3bb24f149a7760cf1bb154b08040
  wechat_base_url: http%3a%2f%2fehr.yihu.com%2fwlyy
  accId: gh_ffd64560fb21
  message:
    ##医生追加建议提醒 --签约邀请
    doctor_invitel_template:  uXdBJVbrhKG-WLaCG4s8C4SXSr2kknQ94vKFt-3rIiA
    #咨询回复
    template_consult_notice: dr4QNyFoRvVsf8uWxXMC1dRyjwnbUuJwJ21vBLhf18
    #签约成功
    template_sign_success: VYGj8OUKj6FH4i4_nZS2UAHurJxQHx-7_OBPILIdB8s
    #签约失败
    template_sign_failed: m221Jrkm0UUY00ExTCpQNTB8t_1U_V4LR9Bg8BgH9-o
    #健康指导提醒
    template_health_notice: 5Nts8lA_at9Cd1JuTK-qDxx95lchpcmUfPTEwYDgXYQ
    #解约提醒
    template_termination:  qZm1NwSueAsbHaOf9DrnLoSj0X5gZuh9W7aDYzLWNds
    #预约成功
    template_appoint_success:  vU5x2tGyk1zUngBrEqMfnFqqMa6M8J98w8k5MCSUYM
    #预约取消
    template_appoint_failed:  r-bVEKgXVyl8O96saoJXlLd7DX1zW7fXA4a0PZHxiQM
    #缴费提醒
    template_expenses_remind:  pZby4Mz3H5angmjGTuvXzo9lwlaVfEiqORwI8soI-5E
    #健康教育
    template_healthy_article: aO_qqk5nAXaGXhsikPVLNelqzwlrp1LTPfIQ1qRMpxo
    #医生变更
    template_doctor_change:  V5h0F84t972kUzQvWy8qYrgdaYGJVj10pFeFVl19Nb8
    #问卷调查
    template_doctor_survey:  OqQXrb-e43_TJpq_70_K_y6vYJgY5mpjFYY4c5RWFP4
    #审核结果通知
    template_doctor_audit:  lCtOgJgL1tBJbAytqN7cn-FgCH_Usg99FENEy2TrC08
    #服务结果通知
    template_doctor_service: i34rq3xFLnpf_VN2Jor9n2YlQqJMM7oXyYvuctriISw
yihu:
  yihu_OpenPlatform_url: http://ssotest.yihu.cn/OpenPlatform/cgiBin/1.0/
  yihu_OpenPlatform_appId: 9000276
  yihu_OpenPlatform_secret: OKC8BS1KGXTDE9GPP1EO4VYLUXF8DJ7QUP72H613ZXA
fastDFS:
  fastdfs_file_url: http://172.19.103.54:80/
images:
  path: /var/local/upload/images
  renew_path: /usr/local/apache-tomcat-8.0.36/webapps/wlyy/images/renew.png
  sign_path: /usr/local/apache-tomcat-8.0.36/webapps/wlyy/images/familycontract.png
activemq:
  username:
  password:
  url:
sign:
  check_upload: http://172.19.103.88:8011/wlyy_service
express:
  sf_url: http://218.17.248.244:11080/bsp-oisp/sfexpressService
#  sf_url: https://bsp-ois.sit.sf-express.com:9443/bsp-ois/sfexpressServic
  sf_code: SDDF
  sf_check_word: ttzlgGyOQu4L
pushMes:
# 1为推送redis,0为推送消息队列
  method: 1
  # redis队列名称
  redis_prescription_title: redisPrescription
---
##内网环境
spring:
  profiles: local
  datasource:
    wlyy:
      url: jdbc:mysql://172.19.103.85/wlyy?useUnicode:true&amp;characterEncoding=utf-8&amp;autoReconnect=true
      username: linzhou
      password: linzhou
    health:
      url: jdbc:mysql://172.19.103.85/device?useUnicode=true&amp;characterEncoding=utf-8&amp;autoReconnect=true
      username: linzhou
      password: linzhou
  redis:
    host: 172.19.103.88 # Redis server host.
    port: 6379 # Redis server port.
#    password: jkzl_ehr
server:
  server_url: http://ehr.yihu.com/wlyy/
im:
  im_list_get: http://172.19.103.88:3000/
  data_base_name: im_new
wechat:
  appId: wx1f129f7b51701428
  appSecret: 988f005d8309ed1795939e0f042431fb
  wechat_token: 27eb3bb24f149a7760cf1bb154b08040
  wechat_base_url: http%3a%2f%2fehr.yihu.com%2fwlyy
  accId: gh_ffd64560fb21
  message:
    ##医生追加建议提醒 --签约邀请
    doctor_invitel_template:  uXdBJVbrhKG-WLaCG4s8C4SXSr2kknQ94vKFt-3rIiA
    #咨询回复
    template_consult_notice: dr4QNyFoRvVsf8uWxXMC1dRyjwnbUuJwJ21vBLhf18
    #签约成功
    template_sign_success: VYGj8OUKj6FH4i4_nZS2UAHurJxQHx-7_OBPILIdB8s
    #签约失败
    template_sign_failed: m221Jrkm0UUY00ExTCpQNTB8t_1U_V4LR9Bg8BgH9-o
    #健康指导提醒
    template_health_notice: 5Nts8lA_at9Cd1JuTK-qDxx95lchpcmUfPTEwYDgXYQ
    #解约提醒
    template_termination:  qZm1NwSueAsbHaOf9DrnLoSj0X5gZuh9W7aDYzLWNds
    #预约成功
    template_appoint_success:  vU5x2tGyk1zUngBrEqMfnFqqMa6M8J98w8k5MCSUYM
    #预约取消
    template_appoint_failed:  r-bVEKgXVyl8O96saoJXlLd7DX1zW7fXA4a0PZHxiQM
    #缴费提醒
    template_expenses_remind:  pZby4Mz3H5angmjGTuvXzo9lwlaVfEiqORwI8soI-5E
    #健康教育
    template_healthy_article: aO_qqk5nAXaGXhsikPVLNelqzwlrp1LTPfIQ1qRMpxo
    #医生变更
    template_doctor_change:  V5h0F84t972kUzQvWy8qYrgdaYGJVj10pFeFVl19Nb8
    #问卷调查
    template_doctor_survey:  OqQXrb-e43_TJpq_70_K_y6vYJgY5mpjFYY4c5RWFP4
    #审核结果通知
    template_doctor_audit:  lCtOgJgL1tBJbAytqN7cn-FgCH_Usg99FENEy2TrC08
    #服务结果通知
    template_doctor_service: i34rq3xFLnpf_VN2Jor9n2YlQqJMM7oXyYvuctriISw
yihu:
  yihu_OpenPlatform_url: http://ssotest.yihu.cn/OpenPlatform/cgiBin/1.0/
  yihu_OpenPlatform_appId: 9000276
  yihu_OpenPlatform_secret: OKC8BS1KGXTDE9GPP1EO4VYLUXF8DJ7QUP72H613ZXA
fastDFS:
  fastdfs_file_url: http://172.19.103.54:80/
images:
  path: /var/local/upload/images
  renew_path: /usr/local/apache-tomcat-8.0.36/webapps/wlyy/images/renew.png
  sign_path: /usr/local/apache-tomcat-8.0.36/webapps/wlyy/images/familycontract.png
sign:
  check_upload: http://172.19.103.88:8011/wlyy_service
express:
  sf_url: http://218.17.248.244:11080/bsp-oisp/sfexpressService
#  sf_url: https://bsp-ois.sit.sf-express.com:9443/bsp-ois/sfexpressServic
  sf_code: SDDF
  sf_check_word: ttzlgGyOQu4L
pushMes:
  # 1为推送redis,0为推送消息队列
  method: 1
  # redis队列名称
  redis_prescription_title: redisPrescription
es:
  index:
    HealthEduArticlePatient: health_edu_article_patient_test
  type:
    HealthEduArticlePatient: health_edu_article_patient_test
  host: 172.19.103.68
  port: 9200
  tPort: 9300
  clusterName: jkzl

+ 9 - 0
patient-co/patient-co-wlyy/src/main/resources/wechat/weixin_menu_feldsher.txt

@ -0,0 +1,9 @@
{
    "button": [
        {
            "name": "我的资料",
            "type": "view",
		    "url":"https://open.weixin.qq.com/connect/oauth2/authorize?appid=appId&redirect_uri=server_url%2fwx%2fhtml%2fgrzx%2fhtml%2fmy-detail.html&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect"
        }
    ]
}