Prechádzať zdrojové kódy

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

Conflicts:
	patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/statistic/EsStatisticsController.java
zd_123 8 rokov pred
rodič
commit
e0211c1de6
43 zmenil súbory, kde vykonal 1888 pridanie a 79 odobranie
  1. 159 4
      common/common-entity/src/main/java/com/yihu/wlyy/entity/job/QuartzJobConfig.java
  2. 162 0
      common/common-entity/src/main/java/com/yihu/wlyy/entity/oldpeople/OldPeoplePhysicalExaminationEntity.java
  3. 86 0
      common/common-entity/src/main/java/com/yihu/wlyy/entity/patient/PatientRemindRecordsEntity.java
  4. 9 0
      common/common-entity/src/main/java/com/yihu/wlyy/entity/patient/SignFamilyRenewLog.java
  5. 116 0
      common/common-entity/src/main/java/com/yihu/wlyy/entity/patient/prenatal/ChildImmuneDetailInfo.java
  6. 127 0
      common/common-entity/src/main/java/com/yihu/wlyy/entity/patient/prenatal/ChildImmuneInfo.java
  7. 157 0
      common/common-entity/src/main/java/com/yihu/wlyy/entity/patient/prenatal/ChildInfo.java
  8. 108 0
      common/common-entity/src/main/java/com/yihu/wlyy/entity/patient/prenatal/ImmuneDict.java
  9. 135 0
      common/common-entity/src/main/java/com/yihu/wlyy/entity/patient/prenatal/ImmuneHospitalDict.java
  10. 72 0
      common/common-entity/src/main/java/com/yihu/wlyy/entity/patient/prenatal/ImmuneMapping.java
  11. 72 0
      common/common-entity/src/main/java/com/yihu/wlyy/entity/patient/prenatal/ImmuneNeedle.java
  12. 92 0
      common/common-entity/src/main/java/com/yihu/wlyy/entity/wechat/WechatPushLog.java
  13. 1 1
      patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/controller/SignController.java
  14. 0 33
      patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/service/SignZYService.java
  15. 6 0
      patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/service/prescription/PrescriptionService.java
  16. 10 0
      patient-co-service/wlyy_sign/src/main/java/com/yihu/wlyy/sign/entity/SignFamilyRenewLog.java
  17. 2 0
      patient-co-service/wlyy_sign/src/main/java/com/yihu/wlyy/sign/service/SignZYService.java
  18. 11 0
      patient-co/patient-co-doctor-assistant/src/main/java/com/yihu/wlyy/repository/wechat/WechatPushLogDao.java
  19. 1 1
      patient-co/patient-co-doctor-assistant/src/main/java/com/yihu/wlyy/service/app/family/FamilyService.java
  20. 1 1
      patient-co/patient-co-doctor-assistant/src/main/java/com/yihu/wlyy/service/template/DoctorFeldsherTemplateService.java
  21. 2 2
      patient-co/patient-co-doctor-assistant/src/main/java/com/yihu/wlyy/web/third/gateway/controller/doctor/GcMessageController.java
  22. 24 1
      patient-co/patient-co-doctor-assistant/src/main/java/com/yihu/wlyy/wechat/util/WeiXinTempMsgSendUtils.java
  23. 1 1
      patient-co/patient-co-statistics-es/doc/es/统计新增索引.txt
  24. 1 4
      patient-co/patient-co-statistics-es/src/main/java/com/yihu/wlyy/statistics/etl/compute/ComputeHelper.java
  25. 54 0
      patient-co/patient-co-statistics-es/src/main/java/com/yihu/wlyy/statistics/etl/convert/wlyy/ServerTypeConvert.java
  26. 25 0
      patient-co/patient-co-statistics-es/src/main/java/com/yihu/wlyy/statistics/etl/convert/wlyy/model/ServerType.java
  27. 1 1
      patient-co/patient-co-statistics-es/src/main/java/com/yihu/wlyy/statistics/job/business/CurrentMysqlToEsQuotaJob.java
  28. 1 2
      patient-co/patient-co-statistics-es/src/main/java/com/yihu/wlyy/statistics/service/ExtractDataService.java
  29. 3 3
      patient-co/patient-co-statistics-es/src/main/java/com/yihu/wlyy/statistics/vo/DataModel.java
  30. 4 4
      patient-co/patient-co-statistics-es/src/main/java/com/yihu/wlyy/statistics/vo/SaveModel.java
  31. 1 1
      patient-co/patient-co-statistics/src/main/java/com/yihu/wlyy/statistics/job/business/signServer/RenewSignTownServerJob.java
  32. 11 0
      patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/repository/wechat/WechatPushLogDao.java
  33. 20 0
      patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/task/PushMsgTask.java
  34. 11 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/wechat/WechatPushLogDao.java
  35. 1 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/consult/ConsultTeamService.java
  36. 205 4
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/statisticsES/StatisticsESService.java
  37. 19 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/task/PushMsgTask.java
  38. 9 9
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/util/ElasticsearchUtil.java
  39. 53 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/prenatalInspector/ChildImmuneController.java
  40. 1 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/prenatalInspector/PrenatalInspectorContoller.java
  41. 3 3
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/quota/vo/SaveModel.java
  42. 109 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/statistic/EsStatisticsController.java
  43. 2 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/statistic/StatisticsController.java

+ 159 - 4
common/common-entity/src/main/java/com/yihu/wlyy/entity/job/QuartzJobConfig.java

@ -14,7 +14,7 @@ import org.hibernate.annotations.GenericGenerator;
@Table(name = "wlyy_job_config")
public class QuartzJobConfig implements java.io.Serializable {
    private String id;
    /*private String id;
    private String quotaId;//指标id
    private String jobName;//任务名称
    private String jobInfo;//任务描述
@ -24,12 +24,12 @@ public class QuartzJobConfig implements java.io.Serializable {
    private String status;//1 启动 0停止
    private String del;//是否删除 1正常 0删除
    /** minimal constructor */
    *//** minimal constructor *//*
    public QuartzJobConfig() {
    }
    /** full constructor */
    *//** full constructor *//*
    public QuartzJobConfig(String jobName, String jobInfo, String jobType,
                           String jobClass, String quartzCron, String status) {
        this.jobName = jobName;
@ -123,5 +123,160 @@ public class QuartzJobConfig implements java.io.Serializable {
    public void setDel(String del) {
        this.del = del;
    }
    }*/
    private String id;
	private String quotaId;//指标id
	private String jobName;//任务名称
	private String jobInfo;//任务描述
	private String jobType;//任务类型(0--单次执行  1--周期执行 2--监听任务)
	private String jobClass;//任务执行的class
	private String quartzCron;//quartz表达式
	private String status;//1 启动 0停止
	private String del;//是否删除 1正常 0删除
	private String sql;
	private String sqlCount;
	private String sqlDay;
	private String sqlYear;
	private String cacheKey;//缓存的key
	/** minimal constructor */
	public QuartzJobConfig() {
	}
	/** full constructor */
	public QuartzJobConfig(String jobName, String jobInfo, String jobType,
                           String jobClass, String quartzCron, String status) {
		this.jobName = jobName;
		this.jobInfo = jobInfo;
		this.jobType = jobType;
		this.jobClass = jobClass;
		this.quartzCron = quartzCron;
		this.status = status;
	}
	// Property accessors
	@GenericGenerator(name = "generator", strategy = "uuid")
	@Id
	@GeneratedValue(generator = "generator")
	@Column(name = "id", unique = true, nullable = false, length = 50)
	public String getId() {
		return this.id;
	}
	public void setId(String id) {
		this.id = id;
	}
	@Column(name = "job_name", length = 50)
	public String getJobName() {
		return this.jobName;
	}
	public void setJobName(String jobName) {
		this.jobName = jobName;
	}
	@Column(name = "job_info", length = 200)
	public String getJobInfo() {
		return this.jobInfo;
	}
	public void setJobInfo(String jobInfo) {
		this.jobInfo = jobInfo;
	}
	@Column(name = "job_type", length = 10)
	public String getJobType() {
		return this.jobType;
	}
	public void setJobType(String jobType) {
		this.jobType = jobType;
	}
	@Column(name = "job_class", length = 200)
	public String getJobClass() {
		return jobClass;
	}
	public void setJobClass(String jobClass) {
		this.jobClass = jobClass;
	}
	@Column(name = "quartz_cron", length = 200)
	public String getQuartzCron() {
		return this.quartzCron;
	}
	public void setQuartzCron(String quartzCron) {
		this.quartzCron = quartzCron;
	}
	@Column(name = "status", length = 1)
	public String getStatus() {
		return this.status;
	}
	public void setStatus(String status) {
		this.status = status;
	}
	@Column(name = "quota_id", length = 50)
	public String getQuotaId() {
		return quotaId;
	}
	public void setQuotaId(String quotaId) {
		this.quotaId = quotaId;
	}
	@Column(name = "del", length = 1)
	public String getDel() {
		return del;
	}
	public void setDel(String del) {
		this.del = del;
	}
	public String getSql() {
		return sql;
	}
	public void setSql(String sql) {
		this.sql = sql;
	}
	public String getSqlCount() {
		return sqlCount;
	}
	public void setSqlCount(String sqlCount) {
		this.sqlCount = sqlCount;
	}
	public String getSqlDay() {
		return sqlDay;
	}
	public void setSqlDay(String sqlDay) {
		this.sqlDay = sqlDay;
	}
	public String getSqlYear() {
		return sqlYear;
	}
	public void setSqlYear(String sqlYear) {
		this.sqlYear = sqlYear;
	}
	public String getCacheKey() {
		return cacheKey;
	}
	public void setCacheKey(String cacheKey) {
		this.cacheKey = cacheKey;
	}
}

+ 162 - 0
common/common-entity/src/main/java/com/yihu/wlyy/entity/oldpeople/OldPeoplePhysicalExaminationEntity.java

@ -0,0 +1,162 @@
package com.yihu.wlyy.entity.oldpeople;
import com.yihu.wlyy.entity.IdEntity;
import javax.persistence.*;
import java.io.Serializable;
import java.sql.Timestamp;
/**
 * @author huangwenjie
 * @date 2017/10/18 17:15
 */
@Entity
@Table(name = "wlyy_old_people_physical_examination",catalog = "")
public class OldPeoplePhysicalExaminationEntity extends IdEntity implements Serializable {
	private String code;
	private String medicalNo;
	private String patientName;
	private String patientCode;
	private String idCard;
	private String doctorCode;
	private String jwDoctorCode;
	private String orgCode;
	private String orgName;
	private Timestamp medicalTime;
	private Integer sex;
	private String homeAddres;
	private Timestamp createTime;
	
	private static final long serialVersionUID = 8358924836164389434L;
	
	@Basic
	@Column(name = "code")
	public String getCode() {
		return code;
	}
	
	public void setCode(String code) {
		this.code = code;
	}
	
	@Basic
	@Column(name = "medical_no")
	public String getMedicalNo() {
		return medicalNo;
	}
	
	public void setMedicalNo(String medicalNo) {
		this.medicalNo = medicalNo;
	}
	
	@Basic
	@Column(name = "patient_name")
	public String getPatientName() {
		return patientName;
	}
	
	public void setPatientName(String patientName) {
		this.patientName = patientName;
	}
	
	@Basic
	@Column(name = "patient_code")
	public String getPatientCode() {
		return patientCode;
	}
	
	public void setPatientCode(String patientCode) {
		this.patientCode = patientCode;
	}
	
	@Basic
	@Column(name = "id_card")
	public String getIdCard() {
		return idCard;
	}
	
	public void setIdCard(String idCard) {
		this.idCard = idCard;
	}
	
	@Basic
	@Column(name = "doctor_code")
	public String getDoctorCode() {
		return doctorCode;
	}
	
	public void setDoctorCode(String doctorCode) {
		this.doctorCode = doctorCode;
	}
	
	@Basic
	@Column(name = "jw_doctor_code")
	public String getJwDoctorCode() {
		return jwDoctorCode;
	}
	
	public void setJwDoctorCode(String jwDoctorCode) {
		this.jwDoctorCode = jwDoctorCode;
	}
	
	@Basic
	@Column(name = "org_code")
	public String getOrgCode() {
		return orgCode;
	}
	
	public void setOrgCode(String orgCode) {
		this.orgCode = orgCode;
	}
	
	@Basic
	@Column(name = "org_name")
	public String getOrgName() {
		return orgName;
	}
	
	public void setOrgName(String orgName) {
		this.orgName = orgName;
	}
	
	@Basic
	@Column(name = "medical_time")
	public Timestamp getMedicalTime() {
		return medicalTime;
	}
	
	public void setMedicalTime(Timestamp medicalTime) {
		this.medicalTime = medicalTime;
	}
	
	@Basic
	@Column(name = "sex")
	public Integer getSex() {
		return sex;
	}
	
	public void setSex(Integer sex) {
		this.sex = sex;
	}
	
	@Basic
	@Column(name = "home_addres")
	public String getHomeAddres() {
		return homeAddres;
	}
	
	public void setHomeAddres(String homeAddres) {
		this.homeAddres = homeAddres;
	}
	
	@Basic
	@Column(name = "create_time")
	public Timestamp getCreateTime() {
		return createTime;
	}
	
	public void setCreateTime(Timestamp createTime) {
		this.createTime = createTime;
	}
	
}

+ 86 - 0
common/common-entity/src/main/java/com/yihu/wlyy/entity/patient/PatientRemindRecordsEntity.java

@ -0,0 +1,86 @@
package com.yihu.wlyy.entity.patient;
import com.yihu.wlyy.entity.IdEntity;
import javax.persistence.*;
import java.io.Serializable;
import java.sql.Timestamp;
/**
 * @author huangwenjie
 * @date 2017/10/18 17:15
 */
@Entity
@Table(name = "wlyy_people_remind_records", catalog = "")
public class PatientRemindRecordsEntity extends IdEntity implements Serializable {
	private String code;
	private Integer type;
	private String patientCode;
	private String relationCode;
	private Timestamp remindTime;
	private Timestamp createTime;
	
	private static final long serialVersionUID = 8358924836164389434L;
	
	@Basic
	@Column(name = "code")
	public String getCode() {
		return code;
	}
	
	public void setCode(String code) {
		this.code = code;
	}
	
	@Basic
	@Column(name = "type")
	public Integer getType() {
		return type;
	}
	
	public void setType(Integer type) {
		this.type = type;
	}
	
	@Basic
	@Column(name = "patient_code")
	public String getPatientCode() {
		return patientCode;
	}
	
	public void setPatientCode(String patientCode) {
		this.patientCode = patientCode;
	}
	
	@Basic
	@Column(name = "relation_code")
	public String getRelationCode() {
		return relationCode;
	}
	
	public void setRelationCode(String relationCode) {
		this.relationCode = relationCode;
	}
	
	@Basic
	@Column(name = "remind_time")
	public Timestamp getRemindTime() {
		return remindTime;
	}
	
	public void setRemindTime(Timestamp remindTime) {
		this.remindTime = remindTime;
	}
	
	@Basic
	@Column(name = "create_time")
	public Timestamp getCreateTime() {
		return createTime;
	}
	
	public void setCreateTime(Timestamp createTime) {
		this.createTime = createTime;
	}
	
}

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

@ -36,6 +36,8 @@ public class SignFamilyRenewLog extends IdEntity {
    private String renewChangeReason;
    private String expensesStatus;
    private String patient;
    public String getSignCode() {
        return signCode;
    }
@ -211,4 +213,11 @@ public class SignFamilyRenewLog extends IdEntity {
    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }
    public String getPatient() {
        return patient;
    }
    public void setPatient(String patient) {
        this.patient = patient;
    }
}

+ 116 - 0
common/common-entity/src/main/java/com/yihu/wlyy/entity/patient/prenatal/ChildImmuneDetailInfo.java

@ -0,0 +1,116 @@
//package com.yihu.wlyy.entity.patient.prenatal;
//
//import com.fasterxml.jackson.annotation.JsonFormat;
//import com.yihu.wlyy.entity.IdEntity;
//
//import javax.persistence.Column;
//import javax.persistence.Entity;
//import javax.persistence.Table;
//import java.io.Serializable;
//import java.util.Date;
//
///**
// * 居民疫苗接种情况明细
// * Created by yeshijie on 2017/10/17.
// */
//@Entity
//@Table(name = "wlyy_child_immune_detail_info")
//public class ChildImmuneDetailInfo extends IdEntity implements Serializable {
//
//    private String childCode;//'新生儿code'
//    private String name;//'姓名'
//    private String idcard;//'身份证'
//    private String immuneDictCode;//'疫苗库code'
//    private Date startTime;//'预计接种开始时间'
//    private Date endTime;//'预计接种结束时间'
//    private Date immuneTime;//'接种时间'
//    private Integer status;//状态 超期-1>待接种0>已接种1>未到年龄2
//    private String needle;//'针数'
//    private Date createTime;//
//
//    public String getChildCode() {
//        return childCode;
//    }
//
//    public void setChildCode(String childCode) {
//        this.childCode = childCode;
//    }
//
//    public String getName() {
//        return name;
//    }
//
//    public void setName(String name) {
//        this.name = name;
//    }
//
//    public String getIdcard() {
//        return idcard;
//    }
//
//    public void setIdcard(String idcard) {
//        this.idcard = idcard;
//    }
//
//    public String getImmuneDictCode() {
//        return immuneDictCode;
//    }
//
//    public void setImmuneDictCode(String immuneDictCode) {
//        this.immuneDictCode = immuneDictCode;
//    }
//
//    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
//    @Column(name = "start_time")
//    public Date getStartTime() {
//        return startTime;
//    }
//
//    public void setStartTime(Date startTime) {
//        this.startTime = startTime;
//    }
//
//    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
//    @Column(name = "end_time")
//    public Date getEndTime() {
//        return endTime;
//    }
//
//    public void setEndTime(Date endTime) {
//        this.endTime = endTime;
//    }
//
//    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
//    @Column(name = "immune_time")
//    public Date getImmuneTime() {
//        return immuneTime;
//    }
//
//    public void setImmuneTime(Date immuneTime) {
//        this.immuneTime = immuneTime;
//    }
//
//    public Integer getStatus() {
//        return status;
//    }
//
//    public void setStatus(Integer status) {
//        this.status = status;
//    }
//
//    public String getNeedle() {
//        return needle;
//    }
//
//    public void setNeedle(String needle) {
//        this.needle = needle;
//    }
//
//    public Date getCreateTime() {
//        return createTime;
//    }
//
//    public void setCreateTime(Date createTime) {
//        this.createTime = createTime;
//    }
//}

+ 127 - 0
common/common-entity/src/main/java/com/yihu/wlyy/entity/patient/prenatal/ChildImmuneInfo.java

@ -0,0 +1,127 @@
//package com.yihu.wlyy.entity.patient.prenatal;
//
//import com.yihu.wlyy.entity.IdEntity;
//
//import javax.persistence.Entity;
//import javax.persistence.Table;
//import java.io.Serializable;
//import java.util.Date;
//
///**
// * 居民疫苗接种情况
// * Created by yeshijie on 2017/10/17.
// */
//@Entity
//@Table(name = "wlyy_child_immune_info")
//public class ChildImmuneInfo extends IdEntity implements Serializable {
//
//    private String code;//
//    private String childCode;//'新生儿code'
//    private String name;//'姓名'
//    private String idcard;//'身份证'
//    private String immuneDictCode;//'疫苗库code'
//    private String immuneName;//'疫苗名称'
//    private String immuneCode;//'疫苗code'
//    private String hospital;//'医院code'
//    private String hospitalName;//'医院名称'
//    private Integer status;//状态 超期-1>待接种0>已接种1>未到年龄2
//    private Integer del;//删除标志  0作废,1正常
//    private Date createTime;//
//
//
//    public String getChildCode() {
//        return childCode;
//    }
//
//    public void setChildCode(String childCode) {
//        this.childCode = childCode;
//    }
//
//    public String getName() {
//        return name;
//    }
//
//    public void setName(String name) {
//        this.name = name;
//    }
//
//    public String getIdcard() {
//        return idcard;
//    }
//
//    public void setIdcard(String idcard) {
//        this.idcard = idcard;
//    }
//
//    public String getImmuneDictCode() {
//        return immuneDictCode;
//    }
//
//    public void setImmuneDictCode(String immuneDictCode) {
//        this.immuneDictCode = immuneDictCode;
//    }
//
//    public Integer getStatus() {
//        return status;
//    }
//
//    public void setStatus(Integer status) {
//        this.status = status;
//    }
//
//    public String getCode() {
//        return code;
//    }
//
//    public void setCode(String code) {
//        this.code = code;
//    }
//
//    public String getImmuneName() {
//        return immuneName;
//    }
//
//    public void setImmuneName(String immuneName) {
//        this.immuneName = immuneName;
//    }
//
//    public String getImmuneCode() {
//        return immuneCode;
//    }
//
//    public void setImmuneCode(String immuneCode) {
//        this.immuneCode = immuneCode;
//    }
//
//    public String getHospital() {
//        return hospital;
//    }
//
//    public void setHospital(String hospital) {
//        this.hospital = hospital;
//    }
//
//    public String getHospitalName() {
//        return hospitalName;
//    }
//
//    public void setHospitalName(String hospitalName) {
//        this.hospitalName = hospitalName;
//    }
//
//    public Integer getDel() {
//        return del;
//    }
//
//    public void setDel(Integer del) {
//        this.del = del;
//    }
//
//    public Date getCreateTime() {
//        return createTime;
//    }
//
//    public void setCreateTime(Date createTime) {
//        this.createTime = createTime;
//    }
//}

+ 157 - 0
common/common-entity/src/main/java/com/yihu/wlyy/entity/patient/prenatal/ChildInfo.java

@ -0,0 +1,157 @@
//package com.yihu.wlyy.entity.patient.prenatal;
//
//import com.fasterxml.jackson.annotation.JsonFormat;
//import com.yihu.wlyy.entity.IdEntity;
//
//import javax.persistence.Column;
//import javax.persistence.Entity;
//import javax.persistence.Table;
//import java.io.Serializable;
//import java.util.Date;
//
///**
// * 新生儿信息
// * Created by yeshijie on 2017/10/17.
// */
//@Entity
//@Table(name = "wlyy_child_info")
//public class ChildInfo extends IdEntity implements Serializable {
//
//    private String code;//
//    private String name;//姓名
//    private String idcard;//新生儿身份证
//    private String photo;//头像
//    private String barcodeNo;//新生儿条形码
//    private String sickSex;//性别
//    private Date birthday;//出生日期
//    private String weight;//体重
//    private String height;//身长
//    private String deliverOrgName;//助产医院
//    private String deliverPerson;//接生人
//    private String cardNo;//产妇医保卡
//    private String sickName;//母亲姓名
//    private String identityCardNo;//母亲身份证
//    private Date createTime;//
//
//    public String getPhoto() {
//        return photo;
//    }
//
//    public void setPhoto(String photo) {
//        this.photo = photo;
//    }
//
//    public String getBarcodeNo() {
//        return barcodeNo;
//    }
//
//    public void setBarcodeNo(String barcodeNo) {
//        this.barcodeNo = barcodeNo;
//    }
//
//    public String getSickSex() {
//        return sickSex;
//    }
//
//    public void setSickSex(String sickSex) {
//        this.sickSex = sickSex;
//    }
//
//    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
//    @Column(name = "birthday")
//    public Date getBirthday() {
//        return birthday;
//    }
//
//    public void setBirthday(Date birthday) {
//        this.birthday = birthday;
//    }
//
//    public String getWeight() {
//        return weight;
//    }
//
//    public void setWeight(String weight) {
//        this.weight = weight;
//    }
//
//    public String getHeight() {
//        return height;
//    }
//
//    public void setHeight(String height) {
//        this.height = height;
//    }
//
//    public String getDeliverOrgName() {
//        return deliverOrgName;
//    }
//
//    public void setDeliverOrgName(String deliverOrgName) {
//        this.deliverOrgName = deliverOrgName;
//    }
//
//    public String getDeliverPerson() {
//        return deliverPerson;
//    }
//
//    public void setDeliverPerson(String deliverPerson) {
//        this.deliverPerson = deliverPerson;
//    }
//
//    public String getCardNo() {
//        return cardNo;
//    }
//
//    public void setCardNo(String cardNo) {
//        this.cardNo = cardNo;
//    }
//
//    public String getSickName() {
//        return sickName;
//    }
//
//    public void setSickName(String sickName) {
//        this.sickName = sickName;
//    }
//
//    public String getIdentityCardNo() {
//        return identityCardNo;
//    }
//
//    public void setIdentityCardNo(String identityCardNo) {
//        this.identityCardNo = identityCardNo;
//    }
//
//    public String getName() {
//        return name;
//    }
//
//    public void setName(String name) {
//        this.name = name;
//    }
//
//    public String getIdcard() {
//        return idcard;
//    }
//
//    public void setIdcard(String idcard) {
//        this.idcard = idcard;
//    }
//
//    public String getCode() {
//        return code;
//    }
//
//    public void setCode(String code) {
//        this.code = code;
//    }
//
//    public Date getCreateTime() {
//        return createTime;
//    }
//
//    public void setCreateTime(Date createTime) {
//        this.createTime = createTime;
//    }
//}

+ 108 - 0
common/common-entity/src/main/java/com/yihu/wlyy/entity/patient/prenatal/ImmuneDict.java

@ -0,0 +1,108 @@
//package com.yihu.wlyy.entity.patient.prenatal;
//
//import com.yihu.wlyy.entity.IdEntity;
//
//import javax.persistence.Entity;
//import javax.persistence.Table;
//import java.io.Serializable;
//import java.util.Date;
//
///**
// * 疫苗字典库表
// * Created by yeshijie on 2017/10/17.
// */
//@Entity
//@Table(name = "wlyy_immune_dict")
//public class ImmuneDict extends IdEntity implements Serializable {
//
//    private String code;//
//    private String immuneName;//疫苗名称
//    private String immuneCode;//疫苗code
//    private Integer immuneType;//疫苗类型(1一类疫苗,2二类疫苗)
//    private String price;//费用明细
//    private Integer priceType;//费用类型 1免费,2自费
//    private String remark;//说明
//    private Integer effectiveSign;//生效标志 0失效,1生效
//    private Integer del;//删除标志  0作废,1正常
//    private Date createTime;//
//
//    public Integer getImmuneType() {
//        return immuneType;
//    }
//
//    public void setImmuneType(Integer immuneType) {
//        this.immuneType = immuneType;
//    }
//
//    public String getPrice() {
//        return price;
//    }
//
//    public void setPrice(String price) {
//        this.price = price;
//    }
//
//    public Integer getPriceType() {
//        return priceType;
//    }
//
//    public void setPriceType(Integer priceType) {
//        this.priceType = priceType;
//    }
//
//    public String getRemark() {
//        return remark;
//    }
//
//    public void setRemark(String remark) {
//        this.remark = remark;
//    }
//
//    public Integer getEffectiveSign() {
//        return effectiveSign;
//    }
//
//    public void setEffectiveSign(Integer effectiveSign) {
//        this.effectiveSign = effectiveSign;
//    }
//
//    public String getCode() {
//        return code;
//    }
//
//    public void setCode(String code) {
//        this.code = code;
//    }
//
//    public String getImmuneName() {
//        return immuneName;
//    }
//
//    public void setImmuneName(String immuneName) {
//        this.immuneName = immuneName;
//    }
//
//    public String getImmuneCode() {
//        return immuneCode;
//    }
//
//    public void setImmuneCode(String immuneCode) {
//        this.immuneCode = immuneCode;
//    }
//
//    public Integer getDel() {
//        return del;
//    }
//
//    public void setDel(Integer del) {
//        this.del = del;
//    }
//
//    public Date getCreateTime() {
//        return createTime;
//    }
//
//    public void setCreateTime(Date createTime) {
//        this.createTime = createTime;
//    }
//}

+ 135 - 0
common/common-entity/src/main/java/com/yihu/wlyy/entity/patient/prenatal/ImmuneHospitalDict.java

@ -0,0 +1,135 @@
//package com.yihu.wlyy.entity.patient.prenatal;
//
//import com.yihu.wlyy.entity.IdEntity;
//
//import javax.persistence.Entity;
//import javax.persistence.Table;
//import java.io.Serializable;
//import java.util.Date;
//
///**
// * 社区疫苗字典库表
// * Created by yeshijie on 2017/10/17.
// */
//@Entity
//@Table(name = "wlyy_immune_hostpital_dict")
//public class ImmuneHospitalDict extends IdEntity implements Serializable {
//
//    private String code;//
//    private String immuneDictCode;//'字典库code'
//    private String immuneName;//疫苗名称
//    private String immuneCode;//疫苗code
//    private Integer immuneType;//疫苗类型(1一类疫苗,2二类疫苗)
//    private String hospital;//'医院code'
//    private String hospitalName;//'医院编码'
//    private String price;//费用明细
//    private Integer priceType;//费用类型 1免费,2自费
//    private String remark;//说明
//    private Integer effectiveSign;//生效标志 0失效,1生效
//    private Integer del;//删除标志  0作废,1正常
//    private Date createTime;//
//
//    public String getImmuneDictCode() {
//        return immuneDictCode;
//    }
//
//    public void setImmuneDictCode(String immuneDictCode) {
//        this.immuneDictCode = immuneDictCode;
//    }
//
//    public String getHospital() {
//        return hospital;
//    }
//
//    public void setHospital(String hospital) {
//        this.hospital = hospital;
//    }
//
//    public String getHospitalName() {
//        return hospitalName;
//    }
//
//    public void setHospitalName(String hospitalName) {
//        this.hospitalName = hospitalName;
//    }
//
//    public Integer getImmuneType() {
//        return immuneType;
//    }
//
//    public void setImmuneType(Integer immuneType) {
//        this.immuneType = immuneType;
//    }
//
//    public String getPrice() {
//        return price;
//    }
//
//    public void setPrice(String price) {
//        this.price = price;
//    }
//
//    public Integer getPriceType() {
//        return priceType;
//    }
//
//    public void setPriceType(Integer priceType) {
//        this.priceType = priceType;
//    }
//
//    public String getRemark() {
//        return remark;
//    }
//
//    public void setRemark(String remark) {
//        this.remark = remark;
//    }
//
//    public Integer getEffectiveSign() {
//        return effectiveSign;
//    }
//
//    public void setEffectiveSign(Integer effectiveSign) {
//        this.effectiveSign = effectiveSign;
//    }
//
//    public String getCode() {
//        return code;
//    }
//
//    public void setCode(String code) {
//        this.code = code;
//    }
//
//    public String getImmuneName() {
//        return immuneName;
//    }
//
//    public void setImmuneName(String immuneName) {
//        this.immuneName = immuneName;
//    }
//
//    public String getImmuneCode() {
//        return immuneCode;
//    }
//
//    public void setImmuneCode(String immuneCode) {
//        this.immuneCode = immuneCode;
//    }
//
//    public Integer getDel() {
//        return del;
//    }
//
//    public void setDel(Integer del) {
//        this.del = del;
//    }
//
//    public Date getCreateTime() {
//        return createTime;
//    }
//
//    public void setCreateTime(Date createTime) {
//        this.createTime = createTime;
//    }
//}

+ 72 - 0
common/common-entity/src/main/java/com/yihu/wlyy/entity/patient/prenatal/ImmuneMapping.java

@ -0,0 +1,72 @@
//package com.yihu.wlyy.entity.patient.prenatal;
//
//import com.yihu.wlyy.entity.IdEntity;
//
//import javax.persistence.Entity;
//import javax.persistence.Table;
//import java.io.Serializable;
//import java.util.Date;
//
///**
// * 二类疫苗代替一类对应表
// * Created by yeshijie on 2017/10/17.
// */
//@Entity
//@Table(name = "wlyy_immune_mapping")
//public class ImmuneMapping extends IdEntity implements Serializable {
//
//    private String code;//
//    private String twoImmuneDictCode;//'二类疫苗字典库code'
//    private String twoImmuneName;//'二类疫苗名称'
//    private String oneImmuneDictCode;//'一类疫苗字典库code'
//    private String oneImmuneName;//'一类疫苗名称'
//    private Date createTime;//
//
//    public String getCode() {
//        return code;
//    }
//
//    public void setCode(String code) {
//        this.code = code;
//    }
//
//    public String getTwoImmuneDictCode() {
//        return twoImmuneDictCode;
//    }
//
//    public void setTwoImmuneDictCode(String twoImmuneDictCode) {
//        this.twoImmuneDictCode = twoImmuneDictCode;
//    }
//
//    public String getTwoImmuneName() {
//        return twoImmuneName;
//    }
//
//    public void setTwoImmuneName(String twoImmuneName) {
//        this.twoImmuneName = twoImmuneName;
//    }
//
//    public String getOneImmuneDictCode() {
//        return oneImmuneDictCode;
//    }
//
//    public void setOneImmuneDictCode(String oneImmuneDictCode) {
//        this.oneImmuneDictCode = oneImmuneDictCode;
//    }
//
//    public String getOneImmuneName() {
//        return oneImmuneName;
//    }
//
//    public void setOneImmuneName(String oneImmuneName) {
//        this.oneImmuneName = oneImmuneName;
//    }
//
//    public Date getCreateTime() {
//        return createTime;
//    }
//
//    public void setCreateTime(Date createTime) {
//        this.createTime = createTime;
//    }
//}

+ 72 - 0
common/common-entity/src/main/java/com/yihu/wlyy/entity/patient/prenatal/ImmuneNeedle.java

@ -0,0 +1,72 @@
//package com.yihu.wlyy.entity.patient.prenatal;
//
//import com.yihu.wlyy.entity.IdEntity;
//
//import javax.persistence.Entity;
//import javax.persistence.Table;
//import java.io.Serializable;
//import java.util.Date;
//
///**
// * 疫苗字典库针数表
// * Created by yeshijie on 2017/10/17.
// */
//@Entity
//@Table(name = "wlyy_immune_needle")
//public class ImmuneNeedle extends IdEntity implements Serializable {
//
//    private String immuneDictCode;//疫苗库code
//    private String age;//儿童年龄
//    private String startMonths;//接种开始月份数
//    private String endMonths;//接种结束月份数
//    private String needle;//针数
//    private Date createTime;//
//
//    public String getAge() {
//        return age;
//    }
//
//    public void setAge(String age) {
//        this.age = age;
//    }
//
//    public String getImmuneDictCode() {
//        return immuneDictCode;
//    }
//
//    public void setImmuneDictCode(String immuneDictCode) {
//        this.immuneDictCode = immuneDictCode;
//    }
//
//    public String getStartMonths() {
//        return startMonths;
//    }
//
//    public void setStartMonths(String startMonths) {
//        this.startMonths = startMonths;
//    }
//
//    public String getEndMonths() {
//        return endMonths;
//    }
//
//    public void setEndMonths(String endMonths) {
//        this.endMonths = endMonths;
//    }
//
//    public String getNeedle() {
//        return needle;
//    }
//
//    public void setNeedle(String needle) {
//        this.needle = needle;
//    }
//
//    public Date getCreateTime() {
//        return createTime;
//    }
//
//    public void setCreateTime(Date createTime) {
//        this.createTime = createTime;
//    }
//}

+ 92 - 0
common/common-entity/src/main/java/com/yihu/wlyy/entity/wechat/WechatPushLog.java

@ -0,0 +1,92 @@
package com.yihu.wlyy.entity.wechat;
import com.yihu.wlyy.entity.IdEntity;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Date;
/**
 * 微信模板推送日志
 * Created by yeshijie on 2017/10/18.
 */
@Entity
@Table(name = "wlyy_wx_push_log")
public class WechatPushLog extends IdEntity {
    private Integer type;// '推送类型',
    //1:签约成功  2:签约失败  3:咨询回复通知  4:健康指导提醒  5:解约申请通知  6:预约挂号成功通知  7:预约取消通知 8 缴费提醒 9 健康教育  10 签约医生变更(信息变更通知)续方订单配送员已顺利取药
    //12.添加家人申请 13.添加家人申请成功 14.添加家人申请失败 16.续签家庭医生 17.医生评价 91.医生助手 92.医生助手项目gcMessageController发送
    //18 产检提醒和产检就诊提醒 19:续方审核结果通知(0.不通过 1.通过 2。调整处方并通过) 20:服务结果通知(续方订单已成功配送) 11.代办事项通知(完成配药)
    private String openid;
    private String patient;//'居民code',
    private String name;//'居民姓名',
    private String request;//'请求入参',
    private String response;// '返回值',
    private Integer status;//'状态(0失败,1成功)',
    private Date createTime;
    public Integer getType() {
        return type;
    }
    public void setType(Integer type) {
        this.type = type;
    }
    public String getOpenid() {
        return openid;
    }
    public void setOpenid(String openid) {
        this.openid = openid;
    }
    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;
    }
    public String getRequest() {
        return request;
    }
    public void setRequest(String request) {
        this.request = request;
    }
    public String getResponse() {
        return response;
    }
    public void setResponse(String response) {
        this.response = response;
    }
    public Integer getStatus() {
        return status;
    }
    public void setStatus(Integer status) {
        this.status = status;
    }
    public Date getCreateTime() {
        return createTime;
    }
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
}

+ 1 - 1
patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/controller/SignController.java

@ -107,7 +107,7 @@ public class SignController {
    public Result getSickMedicalSimpleListInfo (
            @ApiParam(name="TIME_START",value="修改的开始时间",defaultValue = "2012-2-6 00:00:00")
            @RequestParam(value="TIME_START",required = false) String TIME_START,
            @ApiParam(name="TIME_END",value="修改的开始时间",defaultValue = "2012-2-7 23:59:59")
            @ApiParam(name="TIME_END",value="修改的结束时间",defaultValue = "2012-2-7 23:59:59")
            @RequestParam(value="TIME_END",required = false) String TIME_END){
        try {
            String response = signZYService.getSickMedicalSimpleListInfo(TIME_START,TIME_END);

+ 0 - 33
patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/service/SignZYService.java

@ -17,49 +17,16 @@ import java.util.*;
@Service("SignZYService")
public class SignZYService {
    @Autowired
    private PatientDao patientDao;
    @Autowired
    private DoctorDao doctorDao;
    @Autowired
    private SignFamilyDao signFamilyDao;
    @Autowired
    private DoctorMappingDao doctorMappingDao;
    @Autowired
    private HospitalMappingDao hospitalMappingDao;
    @Autowired
    private AdminTeamDao adminTeamDao;
    @Autowired
    private DoctorTeamDao teamDao;
    @Autowired
    private DoctorTeamMemberDao teamMemberDao;
    @Autowired
    private MessageDao messageDao;
    @Autowired
    private ObjectMapper objectMapper;
    @Autowired
    private ZysoftService zysoftService;
    @Autowired
    private LogService logService;
    @Autowired
    private SystemDictService systemDictService;
    /**
     * 获取机构映射

+ 6 - 0
patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/service/prescription/PrescriptionService.java

@ -238,6 +238,8 @@ public class PrescriptionService extends ZysoftBaseService{
                    //新增续方日志
                    addPrescriptionLog(prescription,"接收线下处方调整完成消息-"+msg);
                }else{
                    error = "code:"+prescription.getCode()+",status:"+prescription.getStatus();
                }
            }
        }catch (JSONException ex){
@ -390,7 +392,11 @@ public class PrescriptionService extends ZysoftBaseService{
//                redisTemplate.watch(channelTopic);
                    redisTemplate.opsForList().leftPush(channelTopic,message.toString());
//                redisTemplate.unwatch();
                }else {
                    error = "code:"+prescription.getCode()+",status:"+prescription.getStatus();
                }
            }else{
                error = "code:"+code;
            }
        }catch (JSONException ex){

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

@ -34,6 +34,8 @@ public class SignFamilyRenewLog extends IdEntity {
	private Date createTime;
	private Date applyDate;//签约时间
	private String expensesStatus; //扣费状态【0未扣费 1已扣费 2已退费】
	
	private String patient;
	@Column(name = "apply_date")
	public Date getApplyDate() {
@ -206,4 +208,12 @@ public class SignFamilyRenewLog extends IdEntity {
	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}
	
	public String getPatient() {
		return patient;
	}
	
	public void setPatient(String patient) {
		this.patient = patient;
	}
}

+ 2 - 0
patient-co-service/wlyy_sign/src/main/java/com/yihu/wlyy/sign/service/SignZYService.java

@ -294,6 +294,8 @@ public class SignZYService {
            else{
                log.setExpensesStatus("0"); //扣费
            }
    
            log.setPatient(sign.getPatient());
            signFamilyRenewLogDao.save(log);

+ 11 - 0
patient-co/patient-co-doctor-assistant/src/main/java/com/yihu/wlyy/repository/wechat/WechatPushLogDao.java

@ -0,0 +1,11 @@
package com.yihu.wlyy.repository.wechat;
import com.yihu.wlyy.entity.wechat.WechatPushLog;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
 * Created by yeshijie on 2017/10/18.
 */
public interface WechatPushLogDao extends PagingAndSortingRepository<WechatPushLog, Long>, JpaSpecificationExecutor<WechatPushLog> {
}

+ 1 - 1
patient-co/patient-co-doctor-assistant/src/main/java/com/yihu/wlyy/service/app/family/FamilyService.java

@ -397,7 +397,7 @@ public class FamilyService {
        end.put("color", "#173177");
        json.put("remark", end);
        System.out.println("发送邀请信息:templateId:"+templateId+",openId:"+openId+",url:"+url+",json:"+json);
        weiXinTempMsgSendUtils.sendTemplateMessage(templateId, openId, url, json);
        weiXinTempMsgSendUtils.sendTemplateMessage(templateId, openId, url, json,doctor);
    }
    /**

+ 1 - 1
patient-co/patient-co-doctor-assistant/src/main/java/com/yihu/wlyy/service/template/DoctorFeldsherTemplateService.java

@ -119,7 +119,7 @@ public class DoctorFeldsherTemplateService extends BaseService {
            String doctorOpenId = doctor.getOpenid();
            businessType = parseBusinessType(businessType);
            JSONObject sendJson = weiXinTempMsgSendUtils.packageTemplate(businessType, remark, content, dateFormat.format(new Date()));
            Boolean flag = weiXinTempMsgSendUtils.sendTemplateMessage(templateId, doctorOpenId, url, sendJson);
            Boolean flag = weiXinTempMsgSendUtils.sendTemplateMessage(templateId, doctorOpenId, url, sendJson,doctor);
            logger.info("send wechat message param : " + doctorOpenId + " =======> " + content);
            logger.info("send wechat message retuen : " + flag + " =======> " + flag);
            logger.info("sendJson: " + sendJson);

+ 2 - 2
patient-co/patient-co-doctor-assistant/src/main/java/com/yihu/wlyy/web/third/gateway/controller/doctor/GcMessageController.java

@ -67,7 +67,7 @@ public class GcMessageController {
            for (String code : codeArr) {
                try {
                    Patient patient = patientService.findByCode(code);
                    weiXinTempMsgSendUtils.sendTemplateMessage(templateId, patient.getOpenid(), url, new JSONObject(teampolateJson));
                    weiXinTempMsgSendUtils.sendTemplateMessage(templateId, patient.getOpenid(), url, new JSONObject(teampolateJson),null);
                    success++;
                } catch (Exception e) {
                    logger.error("code " + code + "send Template error:" + e.getMessage());
@ -134,7 +134,7 @@ public class GcMessageController {
                try {
                    SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy年MM月dd日 HH:mm");
                    JSONObject sendJson = weiXinTempMsgSendUtils.packageTemplate("居民咨询请求", "请进入手机APP查看", content, dateFormat.format(new Date()));
                    Boolean flag = weiXinTempMsgSendUtils.sendTemplateMessage(templateId, openId, url, sendJson);
                    Boolean flag = weiXinTempMsgSendUtils.sendTemplateMessage(templateId, openId, url, sendJson,null);
                    logger.info("send wechat message param : " + openId+" =======> "+content);
                    logger.info("send wechat message retuen : " + openId+" =======> "+flag);
                    success++;

+ 24 - 1
patient-co/patient-co-doctor-assistant/src/main/java/com/yihu/wlyy/wechat/util/WeiXinTempMsgSendUtils.java

@ -1,11 +1,15 @@
package com.yihu.wlyy.wechat.util;
import com.yihu.wlyy.entity.doctor.profile.Doctor;
import com.yihu.wlyy.entity.wechat.WechatPushLog;
import com.yihu.wlyy.repository.wechat.WechatPushLogDao;
import com.yihu.wlyy.util.HttpUtil;
import org.apache.commons.lang3.StringUtils;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
@ -19,6 +23,8 @@ public class WeiXinTempMsgSendUtils {
    WeiXinAccessTokenUtils weiXinAccessTokenUtils;
    @Autowired
    private HttpUtil httpUtil;
    @Autowired
    private WechatPushLogDao wechatPushLogDao;
    // 模板消息发送接口URL
    private static String TEMP_MSG_SEND_URL = "https://api.weixin.qq.com/cgi-bin/message/template" +
@ -33,7 +39,7 @@ public class WeiXinTempMsgSendUtils {
     * @param data       模板数据
     * @return
     */
    public boolean sendTemplateMessage(String templateId, String toUser, String url, JSONObject data) throws Exception {
    public boolean sendTemplateMessage(String templateId, String toUser, String url, JSONObject data, Doctor doctor) throws Exception {
        // 参数
        JSONObject params = new JSONObject();
        String accessToken = weiXinAccessTokenUtils.getAccessToken();
@ -57,14 +63,31 @@ public class WeiXinTempMsgSendUtils {
        // 模板数据
        params.put("data", data);
        WechatPushLog log = new WechatPushLog();
        log.setCreateTime(new Date());
        log.setOpenid(toUser);
        if(doctor==null){
            log.setType(92);
        }else {
            log.setType(91);
            log.setName(doctor.getName());
            log.setPatient(doctor.getCode());
        }
        log.setRequest(params.toString());
        // 发送模板消息
        String result = httpUtil.sendPost(TEMP_MSG_SEND_URL + accessToken, params.toString());
        System.out.println("weixinReturn:" + result);
        log.setResponse(result);
        JSONObject jsonResult = new JSONObject(result);
        String returnCode = jsonResult.get("errcode").toString();
        if ("0".equals(returnCode)) {
            log.setStatus(1);
            wechatPushLogDao.save(log);
            return true;
        } else {
            log.setStatus(0);
            wechatPushLogDao.save(log);
            return false;
        }
    }

+ 1 - 1
patient-co/patient-co-statistics-es/doc/es/统计新增索引.txt

@ -84,7 +84,7 @@ POST http://172.19.103.68:9200/wlyy_quota_test/wlyy_quota_test/_mapping
                    "index": "not_analyzed"
                },
                "result1": {
                    "type": "integer"
                    "type": "double"
                },
                "result2": {
                    "type": "integer"

+ 1 - 4
patient-co/patient-co-statistics-es/src/main/java/com/yihu/wlyy/statistics/etl/compute/ComputeHelper.java

@ -2,9 +2,6 @@ package com.yihu.wlyy.statistics.etl.compute;
import com.yihu.wlyy.entity.dimension.WlyyDimensionQuota;
import com.yihu.wlyy.entity.doctor.team.admin.AdminTeam;
import com.yihu.wlyy.statistics.dao.DoctorAdminTeamDao;
import com.yihu.wlyy.statistics.dao.WlyyDimensionQuotaDao;
import com.yihu.wlyy.statistics.util.Contant;
import com.yihu.wlyy.statistics.util.DateUtil;
import com.yihu.wlyy.statistics.vo.*;
import org.springframework.beans.BeanUtils;
@ -189,7 +186,7 @@ public class ComputeHelper {
        for (Map.Entry<String, SaveModel> one : lastMaps.entrySet()) {
            if (countMap.containsKey(one.getKey())) {
                List<DataModel> dataModels = countMap.get(one.getKey());
                Integer result1 = 0;
                Double result1 = 0.0;
                Integer result2 = 0;
                for (int j = 0; j < dataModels.size(); j++) {
                    DataModel dataModel = dataModels.get(j);

+ 54 - 0
patient-co/patient-co-statistics-es/src/main/java/com/yihu/wlyy/statistics/etl/convert/wlyy/ServerTypeConvert.java

@ -0,0 +1,54 @@
package com.yihu.wlyy.statistics.etl.convert.wlyy;
import com.yihu.wlyy.entity.dimension.WlyyDimensionQuota;
import com.yihu.wlyy.statistics.etl.convert.Convert;
import com.yihu.wlyy.statistics.etl.convert.wlyy.model.HealthLable;
import com.yihu.wlyy.statistics.etl.convert.wlyy.model.ServerType;
import com.yihu.wlyy.statistics.vo.DataModel;
import org.springframework.beans.BeanUtils;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
 * Created by chenweida on 2017/10/18.
 * 服务类型转换器
 */
public class ServerTypeConvert implements Convert {
    @Override
    public List<DataModel> convert(JdbcTemplate jdbcTemplate, List<DataModel> oneList, String slaveLevel, WlyyDimensionQuota temp) {
        List<DataModel> returnList = new ArrayList<>();
        //得到患者的服务类型
        String sql = "select w.sign_code signCode,w.server_type serverType from wlyy_sign_family_server w ";
        List<ServerType> serverTypes = jdbcTemplate.query(sql, new BeanPropertyRowMapper(ServerType.class));
        //List转Map LIST key签约表code value是服务类型
        Map<String, List<String>> serverTypesMap = new HashMap<>();
        serverTypes.forEach(one -> {
            List<String> serverTypeList = serverTypesMap.get(one.getSignCode());
            if (serverTypeList == null) {
                serverTypeList = new ArrayList<String>();
            }
        });
        oneList.stream().forEach(one -> {
            List<String> serverTypeList = serverTypesMap.get(one.getBusinessId());
            if (serverTypeList != null) {
                for (int i = 0; i < serverTypeList.size(); i++) {
                    try {
                        DataModel dataModelTemp = new DataModel();
                        BeanUtils.copyProperties(one, dataModelTemp);
                        DataModel.class.getMethod("setSlaveKey" + slaveLevel, String.class).invoke(dataModelTemp, serverTypeList.get(i));
                        returnList.add(dataModelTemp);
                    } catch (Exception e) {
                        e.printStackTrace();
                    }
                }
            }
        });
        return returnList;
    }
}

+ 25 - 0
patient-co/patient-co-statistics-es/src/main/java/com/yihu/wlyy/statistics/etl/convert/wlyy/model/ServerType.java

@ -0,0 +1,25 @@
package com.yihu.wlyy.statistics.etl.convert.wlyy.model;
/**
 * Created by chenweida on 2017/10/18.
 */
public class ServerType {
    private String signCode;
    private String serverType;
    public String getSignCode() {
        return signCode;
    }
    public void setSignCode(String signCode) {
        this.signCode = signCode;
    }
    public String getServerType() {
        return serverType;
    }
    public void setServerType(String serverType) {
        this.serverType = serverType;
    }
}

+ 1 - 1
patient-co/patient-co-statistics-es/src/main/java/com/yihu/wlyy/statistics/job/business/CurrentMysqlToEsQuotaJob.java

@ -159,7 +159,7 @@ public class CurrentMysqlToEsQuotaJob implements Job {
                tjQuotaLog.setJobEndTime(new Date());
                tjQuotaLog.setJobContent(JSONArray.fromObject(filterModel.getErrorModels()).toString());
                saveLog(tjQuotaLog);
                logger.info("========================quotaCode:" + one.getId() + "," + DateUtil.dateToStr(quotaDate, "yyyy-MM-dd") + " start========================");
                logger.info("========================quotaCode:" + one.getId() + "," + DateUtil.dateToStr(quotaDate, "yyyy-MM-dd") + " end========================");
            } catch (Exception e) {
                e.printStackTrace();
            }

+ 1 - 2
patient-co/patient-co-statistics-es/src/main/java/com/yihu/wlyy/statistics/service/ExtractDataService.java

@ -6,7 +6,6 @@ import com.yihu.wlyy.statistics.etl.save.es.ElastricSearchSave;
import com.yihu.wlyy.statistics.vo.SaveModel;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.List;
@ -43,7 +42,7 @@ public class ExtractDataService {
                saveModelTemp.setHospitalName(one.getOrgName());
                saveModelTemp.setTeam(one.getQkdoctorCode());
                saveModelTemp.setTeamName(one.getQkdoctorName());
                saveModelTemp.setResult1(Integer.valueOf(one.getResult()));
                saveModelTemp.setResult1(Double.valueOf(one.getResult()));
                saveModelTemp.setResult2(Integer.valueOf(one.getResult()));
                saveModelTemp.setSlaveKey1(one.getLevel2Type());
                saveModelTemp.setSlaveKey1Name(one.getLevel2TypeName());

+ 3 - 3
patient-co/patient-co-statistics-es/src/main/java/com/yihu/wlyy/statistics/vo/DataModel.java

@ -21,7 +21,7 @@ public class DataModel {
    private String idcard;// 身份证
    private String serverType;//服务类型
    private String healthLable;//健康标签
    private Integer num=1;//分数 如果是累加的计算 默认是1 如果是分数从数据库拿
    private Double num=1.0;//分数 如果是累加的计算 默认是1 如果是分数从数据库拿
    public String getHealthLable() {
        return healthLable;
@ -127,11 +127,11 @@ public class DataModel {
        this.serverType = serverType;
    }
    public Integer getNum() {
    public Double getNum() {
        return num;
    }
    public void setNum(Integer num) {
    public void setNum(Double num) {
        this.num = num;
    }

+ 4 - 4
patient-co/patient-co-statistics-es/src/main/java/com/yihu/wlyy/statistics/vo/SaveModel.java

@ -74,7 +74,7 @@ public class SaveModel {
    private String slaveKey4Name;
    private Integer result1 = 0;//统计结果  总的累加结果 如果是平均分 那就是总分 其他指标都是和result2一样
    private Double result1 = 0.0;//统计结果  总的累加结果 如果是平均分 那就是总分 其他指标都是和result2一样
    private Integer result2 = 0;//统计结果  次数
@ -84,7 +84,7 @@ public class SaveModel {
    @JSONField(format = "yyyy-MM-dd'T'HH:mm:ssXX")
    private Date createTime;//创建时间
    private String timeLevel;// 1日 2年
    private String timeLevel;// 1增量 2到达量
    public Date getQuotaDate() {
        return quotaDate;
@ -159,11 +159,11 @@ public class SaveModel {
        this.slaveKey4 = slaveKey4;
    }
    public Integer getResult1() {
    public Double getResult1() {
        return result1;
    }
    public void setResult1(Integer result1) {
    public void setResult1(Double result1) {
        this.result1 = result1;
    }

+ 1 - 1
patient-co/patient-co-statistics/src/main/java/com/yihu/wlyy/statistics/job/business/signServer/RenewSignTownServerJob.java

@ -92,7 +92,7 @@ public class RenewSignTownServerJob implements Job {
            quartzJobLog.setJobId(wlyyJobConfig.getId());
            quartzJobLog.setJobName(wlyyJobConfig.getJobName());
            //从缓存取数据
            RenewCacheModel cacheModel=cachePool.getArriveRenewTotalTeamMapByDate(yesterday);
            RenewCacheModel cacheModel=cachePool.getArriveRenewTotalTownMapByDate(yesterday);
            //清洗數據
            FilterModel etlModels= signDataFilter.filter(cacheModel.getSignFamilies(),"3",null,cacheModel.getSql(),yesterday);
            //统计数据 1级维度

+ 11 - 0
patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/repository/wechat/WechatPushLogDao.java

@ -0,0 +1,11 @@
package com.yihu.wlyy.repository.wechat;
import com.yihu.wlyy.entity.wechat.WechatPushLog;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
 * Created by yeshijie on 2017/10/18.
 */
public interface WechatPushLogDao extends PagingAndSortingRepository<WechatPushLog, Long>, JpaSpecificationExecutor<WechatPushLog> {
}

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

@ -1,8 +1,10 @@
package com.yihu.wlyy.task;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.wlyy.entity.wechat.WechatPushLog;
import com.yihu.wlyy.entity.wechat.WechatTemplate;
import com.yihu.wlyy.entity.wechat.WechatTemplateData;
import com.yihu.wlyy.repository.wechat.WechatPushLogDao;
import com.yihu.wlyy.util.HttpUtil;
import org.apache.commons.lang3.StringUtils;
import org.json.JSONArray;
@ -14,6 +16,7 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import javax.annotation.PostConstruct;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.LinkedBlockingQueue;
@ -56,6 +59,9 @@ public class PushMsgTask {
    @Value("${wechat.message.template_doctor_service}")
    private String template_doctor_service;//服务结果通知
    @Autowired
    private WechatPushLogDao wechatPushLogDao;
    /**
     * 添加一条推送消息
     *
@ -225,13 +231,27 @@ public class PushMsgTask {
                    logger.error("参数错误!error");
                    return false;
                }
                WechatPushLog log = new WechatPushLog();
                log.setType(type);
                log.setCreateTime(new Date());
                log.setName(name);
                log.setOpenid(openid);
                if(!json.isNull("toUser")){
                    log.setPatient(json.getString("toUser"));
                }
                log.setRequest(json.toString());
                String result = httpUtil.sendPost(token_url, params);
                log.setResponse(result);
                JSONObject jsonResult = new JSONObject(result);
                if (Integer.parseInt(jsonResult.get("errcode").toString()) == 0) {
                    logger.info("微信信息推送成功!success");
                    log.setStatus(1);
                    wechatPushLogDao.save(log);
                    return true;
                } else {
                    logger.error("错误编码:" + jsonResult.get("errcode").toString() + "  错误提示:" + jsonResult.get("errmsg").toString());
                    log.setStatus(0);
                    wechatPushLogDao.save(log);
                    return false;
                }
            } else {

+ 11 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/wechat/WechatPushLogDao.java

@ -0,0 +1,11 @@
package com.yihu.wlyy.repository.wechat;
import com.yihu.wlyy.entity.wechat.WechatPushLog;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
 * Created by yeshijie on 2017/10/18.
 */
public interface WechatPushLogDao extends PagingAndSortingRepository<WechatPushLog, Long>, JpaSpecificationExecutor<WechatPushLog> {
}

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

@ -1130,7 +1130,7 @@ public class ConsultTeamService extends ConsultService {
        prescription.setPatientName(p.getName());
        prescription.setSsc(p.getSsc());
        prescription.setReason(reason);
        prescription.setType(PrescriptionLog.PrescriptionLogType.create.getValue());
        prescription.setType(2);
        prescription.setStatus(PrescriptionLog.PrescriptionLogStatus.revieweding.getValue());
        prescription.setConsult(ct.getConsult());
        prescription.setJwPayStatus(0);//处方结算状态,0为未结算,1为结算成功,默认为0

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

@ -57,6 +57,7 @@ public class StatisticsESService {
    private SystemDictService systemDictService;
    SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
    SimpleDateFormat dateFormat2 = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssXX");
    /**
     * 获取上次统计时间
     *
@ -1202,7 +1203,19 @@ public class StatisticsESService {
        String filesize = df.format(size);
        return Double.valueOf(filesize);
    }
    public double getRangeDouuble(Double first, int second, int i) {
        if (second == 0 && first > 0) {
            //如果分母为0 分子不为0 返回100%
            return 100;
        } else if (second == 0 && first == 0) {
            //如果分母为0 分子为0 返回0%
            return 0;
        }
        Double size = (first * 100) / second;
        DecimalFormat df = new DecimalFormat("0.00");//格式化小数,不足的补0
        String filesize = df.format(size);
        return Double.valueOf(filesize);
    }
    /**
     * 获取某个指标某一天某一level的值   到达量
     *
@ -1222,11 +1235,11 @@ public class StatisticsESService {
        if (esModelList != null && esModelList.size() > 0) {
            esModelList.stream().forEach(one -> {
                if (lowLevel.equals("3")) {
                    returnMap.put(one.getTown(), one.getResult1());
                    returnMap.put(one.getTown(), one.getResult1().intValue());
                } else if (lowLevel.equals("2")) {
                    returnMap.put(one.getHospital(), one.getResult1());
                    returnMap.put(one.getHospital(), one.getResult1().intValue());
                } else if (lowLevel.equals("1")) {
                    returnMap.put(one.getTeam(), one.getResult1());
                    returnMap.put(one.getTeam(),one.getResult1().intValue());
                }
            });
        }
@ -2000,4 +2013,192 @@ public class StatisticsESService {
        }
        return jo;
    }
    public JSONObject getRenewAnalysis(String switchIndex, String switchIndexReson, String signIn, String signOut, String level, String code) throws Exception{
        JSONObject jo = new JSONObject();
        //获取统计的最新事件
        String quotaDate = elasticsearchUtil.getQuotaTime();
        //获取转签人数
        int switchNum = getLevel1NumForRedis(switchIndex, level, code, quotaDate);
        //获取转签分布
        JSONArray switchJO = getLevel2JsonObjectForRedis(switchIndexReson, level, code, quotaDate);
        //获取签入人数
        int inNum = getLevel1NumForRedis(signIn, level, code, quotaDate);
        //获取签出人数
        int outNum = getLevel1NumForRedis(signOut, level, code, quotaDate);
        int changeTeam = getLevel1NumForRedis("31", level, code, quotaDate);//夸团队的数目
        int changeHospital = getLevel1NumForRedis("32", level, code, quotaDate);//夸社区的数目
        int changeTown = getLevel1NumForRedis("33", level, code, quotaDate);//夸社区的数目
        int allChangeCount = changeTeam + changeHospital + changeTown; //跨团队,跨社区 跨区的分母
        jo.put("inNum", inNum);//今年的签入量
        jo.put("outNum", outNum);//今年的签出量
        jo.put("thisYearSwithch", switchNum);//今年的转签量
        jo.put("switchHealth", switchJO);//今年的服务分布
        String changeTeamNum = getRangeNoLast(changeTeam, allChangeCount, 2);//跨团队转签率
        String changeHospNum = getRangeNoLast(changeHospital, allChangeCount, 2);//跨社区转签率
        String changeTownNum = "";
        //保留两位小数
        DecimalFormat df = new DecimalFormat("######0.00");
        if (changeTown == 0) {
            changeTownNum = "0";
        } else {
            changeTownNum = df.format(100 - Double.valueOf(changeTeamNum) - Double.valueOf(changeHospNum)) + "";//跨区转签率,解决算出来可能不是100%的问题 用扣的
        }
        jo.put("switchTeam", changeTeamNum + "%");//今年的转签量
        jo.put("switchHospital", changeHospNum + "%");//今年的转签量
        jo.put("switchTown", changeTownNum + "%");//今年的转签量
        return jo;
    }
    /**
     * 通用的方法 获取一级维度的数据
     *
     * @param index
     * @param level
     * @param code
     * @param timeKey
     * @return
     */
    private int getLevel1NumForRedis(String index, String level, String code, String timeKey) throws Exception{
        SaveModel saveModel = elasticsearchUtil.findOneDateQuotaLevel0(timeKey,code,Integer.parseInt(level),index,"2");
        return saveModel.getResult2();
    }
    /**
     * 通用的方法 获取二级维度的数据列表
     *
     * @param index
     * @param level
     * @param code
     * @param timeKey
     * @return
     */
    private JSONArray getLevel2JsonObjectForRedis(String index, String level, String code, String timeKey) throws Exception{
        List<SaveModel> list = elasticsearchUtil.findOneDateQuotaLevel1(timeKey,code,Integer.parseInt(level),index,"2");
//        JSONObject jo = new JSONObject();
        JSONArray switchJo = new JSONArray();
        list.stream().forEach(one->{
            Map<String,Object> map = new HashMap<>();
            map.put("date",new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(one.getQuotaDate()));
            if (SaveModel.teamLevel.equals(level)) {
                map.put("code",one.getTeam());
                map.put("name",one.getTeamName());
            } else if (SaveModel.OrgLevel.equals(level)) {
                map.put("code",one.getHospital());
                map.put("name",one.getHospitalName());
            } else if (SaveModel.townLevel.equals(level)) {
                map.put("code",one.getTown());
                map.put("name",one.getTownName());
            } else if (SaveModel.cityLevel.equals(level)) {
                map.put("code",one.getCity());
                map.put("name",one.getCityName());
            }
            map.put("num",one.getResult2());
            switchJo.put(map);
        });
        return switchJo;
    }
    public String getRangeNoLast(int first, int second, int i) {
        if (second == 0 && first > 0) {
            return "100";
        } else if (second == 0 && first == 0) {
            return "0";
        }
        float size = (float) (first * 100) / second;
        DecimalFormat df = new DecimalFormat("0.00");//格式化小数,不足的补0
        String filesize = df.format(size);
        return filesize;
    }
    /**
     * 查询某个级别的某个指标到达量(单条记录)
     *
     * @param date
     * @param area
     * @param level
     * @return
     * @throws Exception
     */
    public JSONObject getLowLevelTotalSingle2(String date, String area, int level) throws Exception {
//        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
        //获取微信关注的未交费
//        Map<String, Object> expenseStatus0 = getByIndexSingle(date, area, level, "49",dateFormat);
        SaveModel expenseStatus0 = elasticsearchUtil.findOneDateQuotaLevel0(date,area,level,"49","2");
        //获取微信关注的已交费
//        Map<String, Object> expenseStatus1 = getByIndexSingle(date, area, level, "50",dateFormat);
        SaveModel expenseStatus1 = elasticsearchUtil.findOneDateQuotaLevel0(date,area,level,"50","2");
        //获取已缴费的签约数
//        Map<String, Object> expenseStatus1Sigjn = getByIndexSingle(date, area, level, "1",dateFormat);
        SaveModel expenseStatus1Sigjn = elasticsearchUtil.findOneDateQuotaLevel0(date,area,level,"1","2");
        JSONObject jsonObject = new JSONObject();
        if (SaveModel.teamLevel.equals(level)) {
            jsonObject.put("name", expenseStatus1Sigjn.getTeamName());
        } else if (SaveModel.OrgLevel.equals(level)) {
            jsonObject.put("name", expenseStatus1Sigjn.getHospitalName());
        } else if (SaveModel.townLevel.equals(level)) {
            jsonObject.put("name", expenseStatus1Sigjn.getTownName());
        } else if (SaveModel.cityLevel.equals(level)) {
            jsonObject.put("name", expenseStatus1Sigjn.getCityName());
        }
        jsonObject.put("code", area);
        Long  weChatAmount0 =  Long.valueOf(expenseStatus0.getResult2().toString());
        Long  weChatAmount1 =  Long.valueOf(expenseStatus1.getResult2().toString());
        Long  signAccount =  Long.valueOf(expenseStatus1Sigjn.getResult2().toString());
        jsonObject.put("weChatAmount0", weChatAmount0);//微信关注未交费数
        jsonObject.put("weChatAmount1", weChatAmount1);//微信关注已交费数
        jsonObject.put("bindRate", getRangeDouuble(weChatAmount1.intValue(), signAccount.intValue(), 2));//微信关注率
        return jsonObject;
    }
    /**
     * 获取某个指标某一天某一level的值 到达量(单条记录)
     *
     * @param date
     * @param area
     * @param level
     * @param index
     * @param dateFormat
     * @return
     * @throws Exception
     */
    private Map<String,Object> getByIndexSingle(String date, String area, int level, String index, SimpleDateFormat dateFormat) throws Exception {
        Map<String,Object> map =null;
        if (date.compareTo(dateFormat.format(new Date())) >= 0) {
            map = getTodayLowLevelTotalSingle(date, area, level, index);
        }
        return map;
    }
    /**
     * 获取今天某个区域一级指标的下级统计(单条记录)
     *
     * @param area
     * @param level
     * @param index
     * @return
     */
    public Map<String, Object> getTodayLowLevelTotalSingle(String date, String area, int level, String index) throws Exception {
        Map<String, Object> data = new HashMap<>();
        String redisData = "";
        try {
//            redisData = redisTemplate.opsForValue().get("quota:" + index + ":" + level + ":" + area  + ":" + getQuotaTimeStamp());
        } catch (Exception e) {
            redisData = "";
        }
        if (!org.springframework.util.StringUtils.isEmpty(redisData)) {
            JSONObject json = new JSONObject(redisData);
            data.put("code", String.valueOf(json.get("code")));
            data.put("name", String.valueOf(json.get("name")));
            data.put("amount",String.valueOf(json.get("num")));
        } else {
            Calendar today = Calendar.getInstance();
            today.add(Calendar.DATE, -1);
            String preDate = new SimpleDateFormat("yyyy-MM-dd").format(today.getTime());
//            data = getTodayBeforeLowLevelTotalSingle(preDate, area, level, index);
        }
        return data;
    }
}

+ 19 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/task/PushMsgTask.java

@ -1,8 +1,10 @@
package com.yihu.wlyy.task;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.wlyy.entity.wechat.WechatPushLog;
import com.yihu.wlyy.entity.wechat.WechatTemplate;
import com.yihu.wlyy.entity.wechat.WechatTemplateData;
import com.yihu.wlyy.repository.wechat.WechatPushLogDao;
import com.yihu.wlyy.util.HttpUtil;
import org.apache.commons.lang3.StringUtils;
import org.json.JSONArray;
@ -15,6 +17,7 @@ import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Component;
import javax.annotation.PostConstruct;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.LinkedBlockingQueue;
@ -64,7 +67,8 @@ public class PushMsgTask {
    private String putMesType;
    @Autowired
    private StringRedisTemplate redisTemplate;
    @Autowired
    private WechatPushLogDao wechatPushLogDao;
    /**
     * 添加一条推送消息
@ -240,12 +244,26 @@ public class PushMsgTask {
                    logger.error("参数错误!error");
                    return false;
                }
                WechatPushLog log = new WechatPushLog();
                log.setType(type);
                log.setCreateTime(new Date());
                log.setName(name);
                log.setOpenid(openid);
                if(!json.isNull("toUser")){
                    log.setPatient(json.getString("toUser"));
                }
                log.setRequest(json.toString());
                String result = httpUtil.sendPost(token_url, params);
                JSONObject jsonResult = new JSONObject(result);
                log.setResponse(result);
                if (Integer.parseInt(jsonResult.get("errcode").toString()) == 0) {
                    logger.info("微信信息推送成功!success");
                    log.setStatus(1);
                    wechatPushLogDao.save(log);
                    return true;
                } else {
                    log.setStatus(0);
                    wechatPushLogDao.save(log);
                    logger.error("错误编码:" + jsonResult.get("errcode").toString() + "  错误提示:" + jsonResult.get("errmsg").toString());
                    return false;
                }

+ 9 - 9
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/util/ElasticsearchUtil.java

@ -243,10 +243,10 @@ public class ElasticsearchUtil {
            }
        }
        if (StringUtils.isNotEmpty(endDate)) {
            if(startDate.length()>10){
                startDate = changeTime(endDate);
            if(endDate.length()>10){
                endDate = changeTime(endDate);
            }else{
                startDate = changeDate(endDate);
                endDate = changeDate(endDate);
            }
        }
        StringBuffer sql = new StringBuffer();
@ -334,10 +334,10 @@ public class ElasticsearchUtil {
            }
        }
        if (StringUtils.isNotEmpty(endDate)) {
            if(startDate.length()>10){
                startDate = changeTime(endDate);
            if(endDate.length()>10){
                endDate = changeTime(endDate);
            }else{
                startDate = changeDate(endDate);
                endDate = changeDate(endDate);
            }
        }
        StringBuffer sql = new StringBuffer();
@ -425,10 +425,10 @@ public class ElasticsearchUtil {
            }
        }
        if (StringUtils.isNotEmpty(endDate)) {
            if(startDate.length()>10){
                startDate = changeTime(endDate);
            if(endDate.length()>10){
                endDate = changeTime(endDate);
            }else{
                startDate = changeDate(endDate);
                endDate = changeDate(endDate);
            }
        }
        StringBuffer sql = new StringBuffer();

+ 53 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/prenatalInspector/ChildImmuneController.java

@ -0,0 +1,53 @@
//package com.yihu.wlyy.web.patient.prenatalInspector;
//
//import com.alibaba.fastjson.JSONObject;
//import com.yihu.wlyy.web.BaseController;
//import io.swagger.annotations.Api;
//import io.swagger.annotations.ApiOperation;
//import io.swagger.annotations.ApiParam;
//import org.springframework.http.MediaType;
//import org.springframework.web.bind.annotation.RequestMapping;
//import org.springframework.web.bind.annotation.RequestMethod;
//import org.springframework.web.bind.annotation.RequestParam;
//import org.springframework.web.bind.annotation.RestController;
//
///**
// * Created by yeshijie on 2017/10/18.
// */
//@RestController
//@RequestMapping(value = "/patient/immune", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
//@Api(description = "患者端-免疫")
//public class ChildImmuneController extends BaseController{
//
//
//
//    @ApiOperation("获取儿童信息")
//    @RequestMapping(value = "findChildInfo", method = RequestMethod.GET)
//    public String findChildInfo(@ApiParam(name = "pregnancyNo", value = "产检号", defaultValue = "")
//                                                @RequestParam(value = "pregnancyNo", required = true) String pregnancyNo){
//        try {
//            JSONObject jsonObject = null;
//            return write(200, "查询成功!", "data", jsonObject);
//        }catch (Exception e){
//            error(e);
//            return error(-1,"查询失败");
//        }
//    }
//
//    @ApiOperation("绑定儿童关联")
//    @RequestMapping(value = "findChildInfo", method = RequestMethod.GET)
//    public String bindChildInfo(@ApiParam(name = "pregnancyNo", value = "产检号", defaultValue = "")
//                                @RequestParam(value = "pregnancyNo", required = true) String pregnancyNo){
//        try {
//            JSONObject jsonObject = null;
//
//
//
//            return write(200, "查询成功!", "data", jsonObject);
//        }catch (Exception e){
//            error(e);
//            return error(-1,"查询失败");
//        }
//    }
//
//}

+ 1 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/prenatalInspector/PrenatalInspectorContoller.java

@ -23,7 +23,7 @@ import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping(value = "/patient/prenatalnspector", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@Api(description = "患者端-产检")
public class PrenatalInspectorContoller extends BaseController{
public class PrenatalInspectorController extends BaseController{
    @Autowired
    private PrenatalInspectorPreCardService preCardService;

+ 3 - 3
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/quota/vo/SaveModel.java

@ -72,7 +72,7 @@ public class SaveModel {
    private String slaveKey4Name;
    private Integer result1 = 0;//统计结果
    private Double result1 = 0.0;//统计结果
    private Integer result2 = 0;//统计结果
@ -157,11 +157,11 @@ public class SaveModel {
        this.slaveKey4 = slaveKey4;
    }
    public Integer getResult1() {
    public Double getResult1() {
        return result1;
    }
    public void setResult1(Integer result1) {
    public void setResult1(Double result1) {
        this.result1 = result1;
    }

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

@ -6,7 +6,6 @@ import com.yihu.wlyy.service.app.statisticsES.StatisticsESService;
import com.yihu.wlyy.util.Constant;
import com.yihu.wlyy.util.ValueComparator;
import com.yihu.wlyy.web.BaseController;
import com.yihu.wlyy.web.quota.vo.SaveModel;
import io.swagger.annotations.Api;
import org.apache.commons.lang3.StringUtils;
import org.json.JSONArray;
@ -1394,6 +1393,115 @@ public class EsStatisticsController extends BaseController {
            return error(-1, "查询失败");
        }
    }
    /**
     * 获取转签人数,转签原因分析,转签分布
     * 前端:签约数据分析,团队转签详情
     *
     * @param level 等级  4 市  3区  2社区 1团队
     * @param code  市 默认是厦门市 350200  区 就是区的code  社区就是社区的code 团队就是团队的code
     * @return
     */
    @RequestMapping(value = "/getRenewAnalysis", method = RequestMethod.GET)
    @ResponseBody
    public String getRenewAnalysis(
            @RequestParam(required = true) String level,
            @RequestParam(required = true) String code) {
        try {
            String switchIndex = "";
            String switchIndexReson = "";
            String signIn = "";
            String signOut = "";
            if ("1".equals(level)) {
                //团队的转签人数
                switchIndex = "35";
                //团队的转签原因
                switchIndexReson = "30";
                //团队的签入
                signIn = "34";
                //团队的签出
                signOut = "35";
            } else if ("2".equals(level)) {
                //社区的转签人数
                switchIndex = "35";
                //社区的转签原因
                switchIndexReson = "30";
                //社区的签入
                signIn = "38";
                //社区的签出
                signOut = "39";
            } else {
                //区和市的转签人数
                switchIndex = "35";
                //区和市的转签原因
                switchIndexReson = "30";
                //区和市的签入
                signIn = "40";
                //区和市的签出
                signOut = "41";
            }
            return write(200, "查询成功", "data", statisticsESService.getRenewAnalysis(switchIndex, switchIndexReson, signIn, signOut, level, code));
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败");
        }
    }
    /**
     * 去年的签约量,续签量和续签率 列表
     *
     * @param index    42,43,44 (52,53,54 服务类型维度)
     * @param area     每个层级大的code  例如湖里区 350206  xx社区 3502060100
     * @param level    level1_type等级 1:团队 2社区机构 3区级 4市级
     * @param sort     0:升序 1:降序
     * @param lowLevel 只有可能是 1,2,3,不传默认是level-1;
     * @param year     不管根据当前时间找年度
     * @param lowCode  如果是服务类型维度code(老年人3,高血压4,糖尿病5)
     * @return
     */
    @RequestMapping("/lowlevel_all_sign_renew")
    @ResponseBody
    public String getIndexLowLevelTotalSignAndRenew(
            @RequestParam(required = true) String index,
            @RequestParam(required = true) String area,
            @RequestParam(required = true) int level,
            @RequestParam(required = true) int sort,
            @RequestParam(required = false) String lowLevel,
            @RequestParam(required = false) String year,
            @RequestParam(required = false) String lowCode) {
        try {
            JSONObject result = new JSONObject();
            //如果年度是空,按当前时间计算是年度是属于那个年度
            if (org.springframework.util.StringUtils.isEmpty(year)) {
                year = Constant.getNowYear();
            }
            //lowLevel不传默认是 level-1
            if (org.springframework.util.StringUtils.isEmpty(lowLevel)) {
                lowLevel = level - 1 + "";
            }
            result.put("index_"+index, statisticsAllService.getLevelTwoLowLevelTotalSignAndRenew(area, level, index, sort, lowLevel, year,lowCode));
            return write(200, "查询成功", "data", result);
        } catch (Exception e) {
            e.printStackTrace();
            return error(-1, "查询失败");
        }
    }
    @RequestMapping("/getLevelTotalSingle")
    @ResponseBody
    public String getLevelTotalSingle(@ApiParam(name="date", value="日期标识") @RequestParam(required = true)String date,
                                      @ApiParam(name="area", value="区域code") @RequestParam(required = true)String area,
                                      @ApiParam(name="level", value="级别") @RequestParam(required = true)int level){
        try{
            return write(200, "查询成功", "data", statisticsESService.getLowLevelTotalSingle2(date,area,level));
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败");
        }
    }
    /**
     * 将参数转换成需要的SaveModel里的标识

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

@ -1518,6 +1518,7 @@ public class StatisticsController extends BaseController {
     */
    @RequestMapping(value = "/getRenewAnalysis", method = RequestMethod.GET)
    @ResponseBody
    @Deprecated
    public String getRenewAnalysis(
            @RequestParam(required = true) String level,
            @RequestParam(required = true) String code) {
@ -1636,6 +1637,7 @@ public class StatisticsController extends BaseController {
    @RequestMapping("/getLevelTotalSingle")
    @ResponseBody
    @Deprecated
    public String getLevelTotalSingle(@ApiParam(name="date", value="日期标识") @RequestParam(required = true)String date,
                                      @ApiParam(name="area", value="区域code") @RequestParam(required = true)String area,
                                      @ApiParam(name="level", value="级别") @RequestParam(required = true)int level){