Explorar el Código

Merge branch 'dev' of yeshijie/patient-co-management into dev

trick9191 hace 7 años
padre
commit
6ffd211055
Se han modificado 26 ficheros con 1766 adiciones y 142 borrados
  1. 85 0
      patient-co-wlyy/src/main/java/com/yihu/wlyy/entity/doctor/team/sign/SignLabel.java
  2. 10 0
      patient-co-wlyy/src/main/java/com/yihu/wlyy/entity/patient/PatientFamilyMember.java
  3. 135 0
      patient-co-wlyy/src/main/java/com/yihu/wlyy/entity/patient/prenatal/PrenatalInspectorPlan.java
  4. 107 0
      patient-co-wlyy/src/main/java/com/yihu/wlyy/entity/patient/prenatal/PrenatalInspectorPlanLibrary.java
  5. 442 0
      patient-co-wlyy/src/main/java/com/yihu/wlyy/entity/patient/prenatal/PrenatalInspectorPreCard.java
  6. 10 0
      patient-co-wlyy/src/main/java/com/yihu/wlyy/event/ApplicationEvent.java
  7. 30 0
      patient-co-wlyy/src/main/java/com/yihu/wlyy/job/PrenatalInspectorJob.java
  8. 17 0
      patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/doctor/SignLabelDao.java
  9. 20 0
      patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/patient/PrenatalInspectorPlanDao.java
  10. 20 0
      patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/patient/PrenatalInspectorPlanLibraryDao.java
  11. 17 0
      patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/patient/PrenatalInspectorPreCardDao.java
  12. 66 12
      patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/consult/ConsultTeamService.java
  13. 242 4
      patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/family/FamilyMemberService.java
  14. 239 0
      patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/prenatalInspector/PrenatalInspectorPreCardService.java
  15. 19 9
      patient-co-wlyy/src/main/java/com/yihu/wlyy/task/PushMsgTask.java
  16. 30 8
      patient-co-wlyy/src/main/java/com/yihu/wlyy/util/DateUtil.java
  17. 27 11
      patient-co-wlyy/src/main/java/com/yihu/wlyy/util/ImUtill.java
  18. 24 14
      patient-co-wlyy/src/main/java/com/yihu/wlyy/web/common/util/ManagerUtilController.java
  19. 12 16
      patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/consult/DoctorConsultController.java
  20. 13 15
      patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/account/PatientController.java
  21. 2 9
      patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/archives/PatientArchivesController.java
  22. 57 39
      patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/consult/ConsultController.java
  23. 2 2
      patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/device/PatientDeviceController.java
  24. 60 3
      patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/family/FamilyMemberController.java
  25. 78 0
      patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/prenatalInspector/PrenatalInspectorContoller.java
  26. 2 0
      patient-co-wlyy/src/main/resources/system.properties

+ 85 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/entity/doctor/team/sign/SignLabel.java

@ -0,0 +1,85 @@
package com.yihu.wlyy.entity.doctor.team.sign;
import com.yihu.wlyy.entity.IdEntity;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Date;
/**
 * Created by yeshijie on 2017/6/1.
 */
@Entity
@Table(name = "wlyy_sign_label")
public class SignLabel extends IdEntity {
    // 标签code
    private String label;
    // 标签名称
    private String name;
    // 是否系统标签
    private Integer isSystem;
    // 图标
    private String imgUrl;
    // 排序
    private Integer sort;
    // 状态 0:无效 1:有效
    private Integer status;
    // 操作日期
    private Date czrq;
    public String getLabel() {
        return label;
    }
    public void setLabel(String label) {
        this.label = label;
    }
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public Integer getIsSystem() {
        return isSystem;
    }
    public void setIsSystem(Integer isSystem) {
        this.isSystem = isSystem;
    }
    public String getImgUrl() {
        return imgUrl;
    }
    public void setImgUrl(String imgUrl) {
        this.imgUrl = imgUrl;
    }
    public Integer getSort() {
        return sort;
    }
    public void setSort(Integer sort) {
        this.sort = sort;
    }
    public Integer getStatus() {
        return status;
    }
    public void setStatus(Integer status) {
        this.status = status;
    }
    public Date getCzrq() {
        return czrq;
    }
    public void setCzrq(Date czrq) {
        this.czrq = czrq;
    }
}

+ 10 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/entity/patient/PatientFamilyMember.java

@ -20,6 +20,8 @@ public class PatientFamilyMember extends IdEntity {
    private String familyMember;
    // 家庭关系
    private Integer familyRelation;
    //是否授权0:未授权,1:已授权,默认为1
    private Integer isAuthorize;
    // 操作日期
    private Date czrq;
@ -44,6 +46,14 @@ public class PatientFamilyMember extends IdEntity {
        this.familyRelation = familyRelation;
    }
    public Integer getIsAuthorize() {
        return isAuthorize;
    }
    public void setIsAuthorize(Integer isAuthorize) {
        this.isAuthorize = isAuthorize;
    }
    public Date getCzrq() {
        return czrq;
    }

+ 135 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/entity/patient/prenatal/PrenatalInspectorPlan.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/6/6.
 */
@Entity
@Table(name = "wlyy_prenatal_inspector_plan")
public class PrenatalInspectorPlan extends IdEntity implements Serializable {
    private String inspectionCode;//产检code
    private String patient;//居民code
    private String name;//名称
    private Date inspectionTime;//产检时间
    private Date inspectionStartTime;//产检开始时间(系统计算)
    private Date inspectionEndTime;//产检结束时间(系统计算)
    private String thisFocus;//本次重点
    private String checkItem;//检查项目
    private String thisNote;//本次注意
    private String status;//产检状态(0未产检,1已产检)
    private String inspectionPhase;//检查阶段(1社区检查,2医院检查)
    private String signHospital;//签约医院code(已签约且社区检查阶段才有值)
    private Date czrq;//创建日期
    public String getInspectionCode() {
        return inspectionCode;
    }
    public void setInspectionCode(String inspectionCode) {
        this.inspectionCode = inspectionCode;
    }
    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 Date getInspectionTime() {
        return inspectionTime;
    }
    public void setInspectionTime(Date inspectionTime) {
        this.inspectionTime = inspectionTime;
    }
    public Date getInspectionStartTime() {
        return inspectionStartTime;
    }
    public void setInspectionStartTime(Date inspectionStartTime) {
        this.inspectionStartTime = inspectionStartTime;
    }
    public Date getInspectionEndTime() {
        return inspectionEndTime;
    }
    public void setInspectionEndTime(Date inspectionEndTime) {
        this.inspectionEndTime = inspectionEndTime;
    }
    public String getThisFocus() {
        return thisFocus;
    }
    public void setThisFocus(String thisFocus) {
        this.thisFocus = thisFocus;
    }
    public String getCheckItem() {
        return checkItem;
    }
    public void setCheckItem(String checkItem) {
        this.checkItem = checkItem;
    }
    public String getThisNote() {
        return thisNote;
    }
    public void setThisNote(String thisNote) {
        this.thisNote = thisNote;
    }
    public String getStatus() {
        return status;
    }
    public void setStatus(String status) {
        this.status = status;
    }
    public String getInspectionPhase() {
        return inspectionPhase;
    }
    public void setInspectionPhase(String inspectionPhase) {
        this.inspectionPhase = inspectionPhase;
    }
    public String getSignHospital() {
        return signHospital;
    }
    public void setSignHospital(String signHospital) {
        this.signHospital = signHospital;
    }
    public Date getCzrq() {
        return czrq;
    }
    public void setCzrq(Date czrq) {
        this.czrq = czrq;
    }
}

+ 107 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/entity/patient/prenatal/PrenatalInspectorPlanLibrary.java

@ -0,0 +1,107 @@
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;
/**
 * 产检计划库
 * Created by yeshijie on 2017/6/6.
 */
@Entity
@Table(name = "wlyy_prenatal_inspector_plan_library")
public class PrenatalInspectorPlanLibrary extends IdEntity implements Serializable {
    private String name;//名称
    private String thisFocus;//本次重点
    private String checkItem;//检查项目
    private String thisNote;//本次注意
    private String inspectionWeek;//产检孕周
    private String inspectionTimes;//产检次数
    private String inspectionPhase;//检查阶段
    private Long startDay;//开始天数(距怀孕天数)
    private Long endDay;//结束天数(距怀孕天数)
    private String czrq;//创建日期
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public String getThisFocus() {
        return thisFocus;
    }
    public void setThisFocus(String thisFocus) {
        this.thisFocus = thisFocus;
    }
    public String getCheckItem() {
        return checkItem;
    }
    public void setCheckItem(String checkItem) {
        this.checkItem = checkItem;
    }
    public String getThisNote() {
        return thisNote;
    }
    public void setThisNote(String thisNote) {
        this.thisNote = thisNote;
    }
    public String getInspectionWeek() {
        return inspectionWeek;
    }
    public void setInspectionWeek(String inspectionWeek) {
        this.inspectionWeek = inspectionWeek;
    }
    public String getInspectionTimes() {
        return inspectionTimes;
    }
    public void setInspectionTimes(String inspectionTimes) {
        this.inspectionTimes = inspectionTimes;
    }
    public String getInspectionPhase() {
        return inspectionPhase;
    }
    public void setInspectionPhase(String inspectionPhase) {
        this.inspectionPhase = inspectionPhase;
    }
    public Long getStartDay() {
        return startDay;
    }
    public void setStartDay(Long startDay) {
        this.startDay = startDay;
    }
    public Long getEndDay() {
        return endDay;
    }
    public void setEndDay(Long endDay) {
        this.endDay = endDay;
    }
    public String getCzrq() {
        return czrq;
    }
    public void setCzrq(String czrq) {
        this.czrq = czrq;
    }
}

+ 442 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/entity/patient/prenatal/PrenatalInspectorPreCard.java

@ -0,0 +1,442 @@
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/6/6.
 */
@Entity
@Table(name = "wlyy_prenatal_inspector_pre_card")
public class PrenatalInspectorPreCard extends IdEntity implements Serializable{
    private String code;//产检code
    private String patient;//居民code
    private String name;//居民姓名
    private String ssc;//医保卡号
    private Date birthday;//出生日期
    private String mobile;//手机号码
    private Date lastMenstrualDate;//末次月经时间
    private String allergyHistory;//过敏史
    private String maritalStatus;//婚姻情况(1未婚,2已婚,3再婚,4丧偶,5离婚,6分居)
    private String residentialAddress;//现居住址
    private String residentialProvince;//住址省份
    private String residentialCity;//住址城市
    private String residentialTown;//住址区(县)
    private String permanentAddress;//户籍地址
    private String permanentProvince;//户籍省份
    private String permanentCity;//户籍城市
    private String permanentTown;//户籍区(县)
    private Date marryDate;//结婚日期
    private String spouseName;//配偶姓名
    private Date spouseBirthday;//配偶生日
    private String spouseMobile;//配偶手机
    private String eatFolate;//服用叶酸(1是,0否)
    private String eatAcyeterion;//服避孕药(1是,0否)
    private String smoke;//吸烟(1是,0否)
    private String drink;//饮酒(1是,0否)
    private String eatOtherDrugs;//服用其他药物
    private String workUnit;//工作单位
    private String height;//身高(cm)
    private String weight;//体重(kg)
    private Integer vaginalDeliveryTimes;//阴道分娩次数(次)
    private Integer caesareanSectionTimes;//剖宫产次数(次)
    private Integer menarcheAge;//初潮(岁)
    private Integer menstrualPeriod;//经期(天)
    private Integer menstrualCycle;//周期(天)
    private String diseaseHistory;//疾病史
    private String operationHistory;//手术史
    private String otherInformation;//其他
    private String effective;//是否有效(1有效,0无效)
    private String status;//状态
    private Date dueDate;//预产期
    private String hospital;//医院
    private String hospitalName;//医院名称
    private String bedNo;//床位
    private String orderBedTime;//预约床位时间
    private String inspectionPhase;//检查阶段(1社区检查,2医院检查)
    private String del;//是否删除(1正常,0废弃)
    private Date czrq;//创建日期
    public String getCode() {
        return code;
    }
    public void setCode(String code) {
        this.code = code;
    }
    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 getSsc() {
        return ssc;
    }
    public void setSsc(String ssc) {
        this.ssc = ssc;
    }
    public Date getBirthday() {
        return birthday;
    }
    public void setBirthday(Date birthday) {
        this.birthday = birthday;
    }
    public String getMobile() {
        return mobile;
    }
    public void setMobile(String mobile) {
        this.mobile = mobile;
    }
    public Date getLastMenstrualDate() {
        return lastMenstrualDate;
    }
    public void setLastMenstrualDate(Date lastMenstrualDate) {
        this.lastMenstrualDate = lastMenstrualDate;
    }
    public String getAllergyHistory() {
        return allergyHistory;
    }
    public void setAllergyHistory(String allergyHistory) {
        this.allergyHistory = allergyHistory;
    }
    public String getMaritalStatus() {
        return maritalStatus;
    }
    public void setMaritalStatus(String maritalStatus) {
        this.maritalStatus = maritalStatus;
    }
    public String getResidentialAddress() {
        return residentialAddress;
    }
    public void setResidentialAddress(String residentialAddress) {
        this.residentialAddress = residentialAddress;
    }
    public String getResidentialProvince() {
        return residentialProvince;
    }
    public void setResidentialProvince(String residentialProvince) {
        this.residentialProvince = residentialProvince;
    }
    public String getResidentialCity() {
        return residentialCity;
    }
    public void setResidentialCity(String residentialCity) {
        this.residentialCity = residentialCity;
    }
    public String getResidentialTown() {
        return residentialTown;
    }
    public void setResidentialTown(String residentialTown) {
        this.residentialTown = residentialTown;
    }
    public String getPermanentAddress() {
        return permanentAddress;
    }
    public void setPermanentAddress(String permanentAddress) {
        this.permanentAddress = permanentAddress;
    }
    public String getPermanentProvince() {
        return permanentProvince;
    }
    public void setPermanentProvince(String permanentProvince) {
        this.permanentProvince = permanentProvince;
    }
    public String getPermanentCity() {
        return permanentCity;
    }
    public void setPermanentCity(String permanentCity) {
        this.permanentCity = permanentCity;
    }
    public String getPermanentTown() {
        return permanentTown;
    }
    public void setPermanentTown(String permanentTown) {
        this.permanentTown = permanentTown;
    }
    public Date getMarryDate() {
        return marryDate;
    }
    public void setMarryDate(Date marryDate) {
        this.marryDate = marryDate;
    }
    public String getSpouseName() {
        return spouseName;
    }
    public void setSpouseName(String spouseName) {
        this.spouseName = spouseName;
    }
    public Date getSpouseBirthday() {
        return spouseBirthday;
    }
    public void setSpouseBirthday(Date spouseBirthday) {
        this.spouseBirthday = spouseBirthday;
    }
    public String getSpouseMobile() {
        return spouseMobile;
    }
    public void setSpouseMobile(String spouseMobile) {
        this.spouseMobile = spouseMobile;
    }
    public String getEatFolate() {
        return eatFolate;
    }
    public void setEatFolate(String eatFolate) {
        this.eatFolate = eatFolate;
    }
    public String getEatAcyeterion() {
        return eatAcyeterion;
    }
    public void setEatAcyeterion(String eatAcyeterion) {
        this.eatAcyeterion = eatAcyeterion;
    }
    public String getSmoke() {
        return smoke;
    }
    public void setSmoke(String smoke) {
        this.smoke = smoke;
    }
    public String getDrink() {
        return drink;
    }
    public void setDrink(String drink) {
        this.drink = drink;
    }
    public String getEatOtherDrugs() {
        return eatOtherDrugs;
    }
    public void setEatOtherDrugs(String eatOtherDrugs) {
        this.eatOtherDrugs = eatOtherDrugs;
    }
    public String getWorkUnit() {
        return workUnit;
    }
    public void setWorkUnit(String workUnit) {
        this.workUnit = workUnit;
    }
    public String getHeight() {
        return height;
    }
    public void setHeight(String height) {
        this.height = height;
    }
    public String getWeight() {
        return weight;
    }
    public void setWeight(String weight) {
        this.weight = weight;
    }
    public Integer getVaginalDeliveryTimes() {
        return vaginalDeliveryTimes;
    }
    public void setVaginalDeliveryTimes(Integer vaginalDeliveryTimes) {
        this.vaginalDeliveryTimes = vaginalDeliveryTimes;
    }
    public Integer getCaesareanSectionTimes() {
        return caesareanSectionTimes;
    }
    public void setCaesareanSectionTimes(Integer caesareanSectionTimes) {
        this.caesareanSectionTimes = caesareanSectionTimes;
    }
    public Integer getMenarcheAge() {
        return menarcheAge;
    }
    public void setMenarcheAge(Integer menarcheAge) {
        this.menarcheAge = menarcheAge;
    }
    public Integer getMenstrualPeriod() {
        return menstrualPeriod;
    }
    public void setMenstrualPeriod(Integer menstrualPeriod) {
        this.menstrualPeriod = menstrualPeriod;
    }
    public Integer getMenstrualCycle() {
        return menstrualCycle;
    }
    public void setMenstrualCycle(Integer menstrualCycle) {
        this.menstrualCycle = menstrualCycle;
    }
    public String getDiseaseHistory() {
        return diseaseHistory;
    }
    public void setDiseaseHistory(String diseaseHistory) {
        this.diseaseHistory = diseaseHistory;
    }
    public String getOperationHistory() {
        return operationHistory;
    }
    public void setOperationHistory(String operationHistory) {
        this.operationHistory = operationHistory;
    }
    public String getOtherInformation() {
        return otherInformation;
    }
    public void setOtherInformation(String otherInformation) {
        this.otherInformation = otherInformation;
    }
    public String getEffective() {
        return effective;
    }
    public void setEffective(String effective) {
        this.effective = effective;
    }
    public String getStatus() {
        return status;
    }
    public void setStatus(String status) {
        this.status = status;
    }
    public Date getDueDate() {
        return dueDate;
    }
    public void setDueDate(Date dueDate) {
        this.dueDate = dueDate;
    }
    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 String getBedNo() {
        return bedNo;
    }
    public void setBedNo(String bedNo) {
        this.bedNo = bedNo;
    }
    public String getOrderBedTime() {
        return orderBedTime;
    }
    public void setOrderBedTime(String orderBedTime) {
        this.orderBedTime = orderBedTime;
    }
    public String getInspectionPhase() {
        return inspectionPhase;
    }
    public void setInspectionPhase(String inspectionPhase) {
        this.inspectionPhase = inspectionPhase;
    }
    public String getDel() {
        return del;
    }
    public void setDel(String del) {
        this.del = del;
    }
    public Date getCzrq() {
        return czrq;
    }
    public void setCzrq(Date czrq) {
        this.czrq = czrq;
    }
}

+ 10 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/event/ApplicationEvent.java

@ -1,5 +1,6 @@
package com.yihu.wlyy.event;
import com.yihu.wlyy.job.PrenatalInspectorJob;
import com.yihu.wlyy.job.QuartzHelper;
import com.yihu.wlyy.job.SignAgainJob;
import com.yihu.wlyy.job.SignEndJob;
@ -47,6 +48,15 @@ public class ApplicationEvent implements ApplicationListener<ContextRefreshedEve
            } else {
                System.out.println("sign_again_job exist");
            }
            //启动发送产检提醒模板消息
            if (!quartzHelper.isExistJob("prenatal_inspector_job")) {
                String trigger = SystemConf.getInstance().getSystemProperties().getProperty("prenatal_inspector_job_trigger");
                quartzHelper.addJob(PrenatalInspectorJob.class, trigger, "prenatal_inspector_job", new HashMap<String, Object>());
                System.out.println("prenatal_inspector_job start success");
            } else {
                System.out.println("prenatal_inspector_job exist");
            }
        } catch (Exception e) {
            System.out.println("sign end job start failed");
        }

+ 30 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/job/PrenatalInspectorJob.java

@ -0,0 +1,30 @@
package com.yihu.wlyy.job;
import com.yihu.wlyy.service.app.prenatalInspector.PrenatalInspectorPreCardService;
import com.yihu.wlyy.util.DateUtil;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.context.support.SpringBeanAutowiringSupport;
import java.util.Date;
/**
 * 产检提醒(1预约提醒,2就诊提醒)
 * Created by yeshijie on 2017/6/7.
 */
public class PrenatalInspectorJob implements Job{
    @Autowired
    private PrenatalInspectorPreCardService preCardService;
    @Override
    public void execute(JobExecutionContext context) throws JobExecutionException {
        SpringBeanAutowiringSupport.processInjectionBasedOnCurrentContext(this);
        System.out.print("prenatal inspector wx message sending...");
        String date = DateUtil.dateToStrShort(new Date());
        //发送产检微信模板提醒消息
        preCardService.sendPrenatalInspectorRemind();
    }
}

+ 17 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/doctor/SignLabelDao.java

@ -0,0 +1,17 @@
package com.yihu.wlyy.repository.doctor;
import com.yihu.wlyy.entity.doctor.team.sign.SignLabel;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.List;
/**
 * Created by yeshijie on 2017/6/1.
 */
public interface SignLabelDao extends PagingAndSortingRepository<SignLabel, Long>, JpaSpecificationExecutor<SignLabel> {
    @Query("select a from SignLabel a where a.status = 1 order by sort")
    List<SignLabel> findLabels();
}

+ 20 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/patient/PrenatalInspectorPlanDao.java

@ -0,0 +1,20 @@
package com.yihu.wlyy.repository.patient;
import com.yihu.wlyy.entity.patient.prenatal.PrenatalInspectorPlan;
import com.yihu.wlyy.entity.patient.prenatal.PrenatalInspectorPlanLibrary;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.List;
/**
 * Created by yeshijie on 2017/6/6.
 */
public interface PrenatalInspectorPlanDao extends PagingAndSortingRepository<PrenatalInspectorPlan, Long>{
    @Query("select a from PrenatalInspectorPlan a where a.inspectionCode = ?1 and a.status = '0' ")
    List<PrenatalInspectorPlan> findByCode(String inspectionCode);
    @Query("select a from PrenatalInspectorPlan a where a.inspectionTime is not null and a.status = '0' and ( TO_DAYS(a.inspectionTime)- TO_DAYS(NOW())=7 or TO_DAYS(a.inspectionTime)- TO_DAYS(NOW())=1 ) ")
    List<PrenatalInspectorPlan> findWxTipList();
}

+ 20 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/patient/PrenatalInspectorPlanLibraryDao.java

@ -0,0 +1,20 @@
package com.yihu.wlyy.repository.patient;
import com.yihu.wlyy.entity.patient.SignFamily;
import com.yihu.wlyy.entity.patient.prenatal.PrenatalInspectorPlanLibrary;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.List;
/**
 * Created by yeshijie on 2017/6/6.
 */
public interface PrenatalInspectorPlanLibraryDao extends PagingAndSortingRepository<PrenatalInspectorPlanLibrary, Long>{
    @Query("select a from PrenatalInspectorPlanLibrary a where a.endDay >= ?1 ")
    List<PrenatalInspectorPlanLibrary> findByDays(Long endDay);
}

+ 17 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/patient/PrenatalInspectorPreCardDao.java

@ -0,0 +1,17 @@
package com.yihu.wlyy.repository.patient;
import com.yihu.wlyy.entity.patient.prenatal.PrenatalInspectorPlanLibrary;
import com.yihu.wlyy.entity.patient.prenatal.PrenatalInspectorPreCard;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.List;
/**
 * Created by yeshijie on 2017/6/6.
 */
public interface PrenatalInspectorPreCardDao extends PagingAndSortingRepository<PrenatalInspectorPreCard, Long>{
    @Query("select a from PrenatalInspectorPreCard a where a.patient = ?1 and a.del='1' order by a.lastMenstrualDate desc")
    List<PrenatalInspectorPreCard> findByPatient(String patient);
}

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

@ -15,6 +15,7 @@ import com.yihu.wlyy.entity.doctor.team.sign.DoctorTeam;
import com.yihu.wlyy.entity.doctor.team.sign.DoctorTeamMember;
import com.yihu.wlyy.entity.education.HealthEduArticle;
import com.yihu.wlyy.entity.patient.Patient;
import com.yihu.wlyy.entity.patient.PatientFamilyMember;
import com.yihu.wlyy.entity.patient.SignFamily;
import com.yihu.wlyy.repository.consult.ConsultTeamDao;
import com.yihu.wlyy.repository.consult.ConsultTeamDoctorDao;
@ -22,6 +23,7 @@ import com.yihu.wlyy.repository.consult.ConsultTeamLogDao;
import com.yihu.wlyy.repository.doctor.DoctorPatientDao;
import com.yihu.wlyy.repository.doctor.DoctorTeamDao;
import com.yihu.wlyy.repository.doctor.DoctorTeamMemberDao;
import com.yihu.wlyy.repository.patient.PatientFamilyMemberDao;
import com.yihu.wlyy.repository.patient.SignFamilyDao;
import com.yihu.wlyy.service.app.health.HealthEduArticleService;
import com.yihu.wlyy.service.app.health.PatientHealthGuidanceService;
@ -49,6 +51,7 @@ import org.springside.modules.persistence.SearchFilter;
import org.springside.modules.persistence.SearchFilter.Operator;
import org.springside.modules.utils.Clock;
import javax.annotation.PostConstruct;
import java.text.SimpleDateFormat;
import java.util.*;
@ -84,7 +87,8 @@ public class ConsultTeamService extends ConsultService {
    private JdbcTemplate jdbcTemplate;
    @Autowired
    private PatientHealthGuidanceService guidanceService;
    @Autowired
    private PatientFamilyMemberDao familyMemberDao;
    @Autowired
    private HealthEduArticleService healthEduArticleService;
@ -96,6 +100,20 @@ public class ConsultTeamService extends ConsultService {
    @Autowired
    WeiXinAccessTokenUtils accessTokenUtils;
    Map<Integer, String> relations = new HashMap<>();
    @PostConstruct
    public void init() {
        relations.put(0, "其他");
        relations.put(1, "父亲");
        relations.put(2, "母亲");
        relations.put(3, "老公");
        relations.put(4, "老婆");
        relations.put(5, "儿子");
        relations.put(6, "女儿");
        relations.put(7, "未知");
    }
    /**
     * 查询患者是否还有未结束的三师咨询
     *
@ -665,8 +683,13 @@ public class ConsultTeamService extends ConsultService {
     * @return
     * @throws Exception
     */
    public int addTeamConsult(ConsultTeam ct, String patient) throws Exception {
    public int addTeamConsult(ConsultTeam ct, String patient,String agent) throws Exception {
        JSONObject users = new JSONObject();
        if(patient.equals(agent)){
            agent = null;
        }
        // 咨询三师
        if (ct.getType() == 1) {
            // 查询三师签约信息
@ -770,7 +793,7 @@ public class ConsultTeamService extends ConsultService {
        //推送给IM去创建议题,取得成员消息
//        JSONObject messages = ImUtill.getCreateTopicMessage(patient, tempPatient.getName(), consult.getTitle(), "咨询问题:"+consult.getSymptoms(), consult.getImages());
        JSONObject messages = ImUtill.getCreateTopicMessage(patient, tempPatient.getName(), consult.getTitle(), consult.getSymptoms(), consult.getImages());
        JSONObject messages = ImUtill.getCreateTopicMessage(patient, tempPatient.getName(), consult.getTitle(), consult.getSymptoms(), consult.getImages(),agent);
        users.put(patient, 0);//+ " "+(tempPatient.getSex()==1?"(男 ":"(女 ") + IdCardUtil.getAgeForIdcard(tempPatient.getIdcard())+")"
        JSONObject obj = ImUtill.createTopics(patient + "_" + ct.getTeam() + "_" + ct.getType(), consult.getCode(), tempPatient.getName(), users, messages, ImUtill.SESSION_TYPE_MUC);
        if (obj == null) {
@ -1299,6 +1322,35 @@ public class ConsultTeamService extends ConsultService {
        }
    }
    /**
     * 进入咨询
     * @param consult
     * @param patient
     * @param agent
     * @return
     */
    public int intoTopic(String consult,String patient,String agent) throws Exception{
        ConsultTeam ct = consultTeamDao.findByConsult(consult);
        if(ct.getStatus()!=0){
            return -1;
        }
        String content = "进入了咨询";
        Patient p = patientDao.findByCode(patient);
        String intoUserName = p.getName();
        if(patient.equals(agent)){
            content = intoUserName+content;
        }else {
            PatientFamilyMember familyMember = familyMemberDao.findByPatientAndFamilyMember(patient,agent);
            Patient member = patientDao.findByCode(agent);
            content = member.getName() + "("+relations.get(familyMember.getFamilyRelation())+")"+content;
        }
        ImUtill.sendIntoTopicIM(ct.getPatient(),ct.getPatient(),ct.getConsult(),content,agent,intoUserName);
        return 0;
    }
    /**
     * @param ct
     * @param uid
@ -1618,7 +1670,7 @@ public class ConsultTeamService extends ConsultService {
            qiuzuObj.put("old_consult_code", oldConsultCode);
            qiuzuObj.put("doctor", ct.getDoctor());
            qiuzuObj.put("doctor_name", doctorTemp.getName());
            ImUtill.sendTopicIM(doctor.getCode(), doctor.getName(), oldConsultCode, "5", qiuzuObj.toString());
            ImUtill.sendTopicIM(doctor.getCode(), doctor.getName(), oldConsultCode, "5", qiuzuObj.toString(),null);
        }
@ -1675,7 +1727,7 @@ public class ConsultTeamService extends ConsultService {
        // 添加医生咨询日志
        String content = addLogs(ct);
        if (StringUtils.isBlank(oldConsultCode)) {
            JSONObject messages = ImUtill.getCreateTopicMessage(doctorTemp.getCode(), doctorTemp.getName(), consult.getTitle(), content, consult.getImages());
            JSONObject messages = ImUtill.getCreateTopicMessage(doctorTemp.getCode(), doctorTemp.getName(), consult.getTitle(), content, consult.getImages(),null);
            JSONObject jsonObject = new JSONObject();
            jsonObject.put(ct.getPatient(), 0);
            jsonObject.put(ct.getDoctor(), 0);
@ -1691,7 +1743,7 @@ public class ConsultTeamService extends ConsultService {
            ConsultTeam consultTeam = consultTeamDao.findByConsult(oldConsultCode);
            ct.setTeam(oldConsultCode);
            if (oldConsult != null && isSend == 1) {
                JSONObject messages = ImUtill.getCreateTopicMessage(doctorTemp.getCode(), doctorTemp.getName(), consult.getTitle(), "居民问题:" + oldConsult.getSymptoms(), oldConsult.getImages());
                JSONObject messages = ImUtill.getCreateTopicMessage(doctorTemp.getCode(), doctorTemp.getName(), consult.getTitle(), "居民问题:" + oldConsult.getSymptoms(), oldConsult.getImages(),null);
                JSONObject jsonObject = new JSONObject();
                jsonObject.put(ct.getPatient(), 0);
                jsonObject.put(ct.getDoctor(), 0);
@ -1701,14 +1753,14 @@ public class ConsultTeamService extends ConsultService {
                }
                ct.setStartMsgId(obj.get("start_msg_id").toString());
                Thread.sleep(100);//消息发送顺序问题处理
                ImUtill.sendTopicIM(doctorTemp.getCode(), doctorTemp.getName(), consult.getCode(), "6", content);
                ImUtill.sendTopicIM(doctorTemp.getCode(), doctorTemp.getName(), consult.getCode(), "6", content, null);
                if (StringUtils.isNotBlank(consult.getImages())) {
                    String imgs[] = consult.getImages().split(",");
                    for (String url : imgs)
                        ImUtill.sendTopicIM(doctorTemp.getCode(), doctorTemp.getName(), consult.getCode(), "2", url);
                        ImUtill.sendTopicIM(doctorTemp.getCode(), doctorTemp.getName(), consult.getCode(), "2", url, null);
                }
            } else if (oldConsult != null && isSend == 0) {
                JSONObject messages = ImUtill.getCreateTopicMessage(doctorTemp.getCode(), doctorTemp.getName(), consult.getTitle(), content, oldConsult.getImages());
                JSONObject messages = ImUtill.getCreateTopicMessage(doctorTemp.getCode(), doctorTemp.getName(), consult.getTitle(), content, oldConsult.getImages(),null);
                JSONObject jsonObject = new JSONObject();
                jsonObject.put(ct.getPatient(), 0);
                jsonObject.put(ct.getDoctor(), 0);
@ -1723,7 +1775,7 @@ public class ConsultTeamService extends ConsultService {
            qiuzuObj.put("old_consult_code", oldConsultCode);
            qiuzuObj.put("doctor", ct.getDoctor());
            qiuzuObj.put("doctor_name", doctor.getName());
            ImUtill.sendTopicIM(doctorTemp.getCode(), doctorTemp.getName(), oldConsultCode, "5", qiuzuObj.toString());
            ImUtill.sendTopicIM(doctorTemp.getCode(), doctorTemp.getName(), oldConsultCode, "5", qiuzuObj.toString(), null);
        }
        consultTeamDao.save(ct);  // 保存医生咨询信息
        consultTeamDoctorDao.save(cd);
@ -1802,10 +1854,12 @@ public class ConsultTeamService extends ConsultService {
     * @param ct
     * @param uid
     * @param type 1患者 2医生
     * @param agent 代理人
     * @throws Exception
     */
    public JSONObject famousConsult(ConsultTeam ct, String uid, String type) throws Exception {
    public JSONObject famousConsult(ConsultTeam ct, String uid, String type,String agent) throws Exception {
        // 设置患者信息
        agent = uid.equals(agent)?null:agent;
        ct.setPatient(uid);
        String senderId = "";
        String senderName = "";
@ -1865,7 +1919,7 @@ public class ConsultTeamService extends ConsultService {
        jsonObject.put(ct.getPatient(), 0);
        jsonObject.put(ct.getDoctor(), 0);
        JSONObject messages = ImUtill.getCreateTopicMessage(senderId, senderName, senderName + "发起咨询", content, ct.getImages());
        JSONObject messages = ImUtill.getCreateTopicMessage(senderId, senderName, senderName + "发起咨询", content, ct.getImages(),agent);
        JSONObject obj = ImUtill.createTopics(null, consult.getCode(), consult.getSymptoms(), jsonObject, messages, ImUtill.SESSION_TYPE_P2P);
        if (obj == null) {

+ 242 - 4
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/family/FamilyMemberService.java

@ -25,10 +25,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.PostConstruct;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
/**
 * 家庭成员服务
@ -128,6 +125,7 @@ public class FamilyMemberService extends BaseService {
            fm.setFamilyMember(member);
        }
        fm.setFamilyRelation(relation);
        fm.setIsAuthorize(1);//默认授权
        fm.setCzrq(new Date());
        // 添加对方与自己的关系
@ -143,6 +141,7 @@ public class FamilyMemberService extends BaseService {
        int relationTrans = familyRelationTrans(p, relation);
        fmt.setFamilyRelation(relationTrans);
        fmt.setCzrq(new Date());
        fmt.setIsAuthorize(1);//默认授权
        memberDao.save(fm);
        memberDao.save(fmt);
@ -185,6 +184,25 @@ public class FamilyMemberService extends BaseService {
        return 1;
    }
    /**
     * 设置授权关系
     * @param patient
     * @param member
     * @param isAuthorize
     * @return
     * @throws Exception
     */
    public int authorizeMember(String patient, String member,Integer isAuthorize) throws Exception{
        PatientFamilyMember fm = memberDao.findByPatientAndFamilyMember(patient, member);
        if(fm==null){
            return -1;
        }
        fm.setIsAuthorize(isAuthorize);
        memberDao.save(fm);
        return 1;
    }
    /**
     * 修改家庭成员关系
@ -295,6 +313,125 @@ public class FamilyMemberService extends BaseService {
        return result;
    }
    public JSONObject getPatient(String patient){
        Patient p = patientDao.findByCode(patient);
        JSONObject obj = new JSONObject();
        List<SignFamily> signs = contractService.findAllSignByPatient(p.getCode());
        boolean ssSign = false;
        boolean jtSign = false;
        for (SignFamily sign : signs) {
            if (sign.getType() == 1 && sign.getStatus() > 0) {
                ssSign = true;
            } else if (sign.getType() == 2 && sign.getStatus() > 0) {
                jtSign = true;
            } else if (sign.getStatus() == 0) {
            }
        }
        obj.put("code", p.getCode());
        obj.put("name", p.getName());
        obj.put("sex", p.getSex());
        obj.put("birthday", p.getBirthday());
        obj.put("isAuthorize", 1);
        obj.put("idcard", StringUtils.isEmpty(p.getIdcard()) ? "" : p.getIdcard());
        obj.put("photo", StringUtils.isEmpty(p.getPhoto()) ? "" : p.getPhoto());
        obj.put("mobile", StringUtils.isEmpty(p.getMobile()) ? "" : p.getMobile());
        obj.put("address", StringUtils.isEmpty(p.getAddress()) ? "" : p.getAddress());
        obj.put("familyRelation", -1);
        obj.put("familyRelationName", "自己");
        obj.put("isAuthorize", 1);//0:未授权,1:已授权
        if (ssSign && jtSign) {
            obj.put("signType", 3);
        } else if (!ssSign && jtSign) {
            obj.put("signType", 2);
        } else if (ssSign && !jtSign) {
            obj.put("signType", 1);
        } else {
            obj.put("signType", 0);
        }
        return obj;
    }
    /**
     * 获取所有家庭成员,包括自己
     * @param patient
     * @return
     */
    public JSONArray getAllFamilyMembers(String patient){
        JSONArray resultArray = new JSONArray();
        resultArray.put(getPatient(patient));
        String sql = "select * " +
                " from " +
                "    wlyy_patient_family_member t1, " +
                "    wlyy_patient t2 " +
                " where " +
                "    t2.code in (select family_member from wlyy_patient_family_member where patient = ? ) " +
                "    and t1.patient = ? " +
                "    and t1.family_member = t2.code order by t1.family_relation ASC ";
        List<Map<String, Object>> result = jdbcTemplate.queryForList(sql, new Object[]{patient, patient});
        if (result != null && result.size() > 0) {
            JSONArray tem = new JSONArray();//存储其他
            for (Map<String, Object> map : result) {
                JSONObject obj = new JSONObject();
                List<SignFamily> signs = contractService.findAllSignByPatient(map.get("code").toString());
                boolean ssSign = false;
                boolean jtSign = false;
                for (SignFamily sign : signs) {
                    if (sign.getType() == 1 && sign.getStatus() > 0) {
                        ssSign = true;
                    } else if (sign.getType() == 2 && sign.getStatus() > 0) {
                        jtSign = true;
                    } else if (sign.getStatus() == 0) {
                    }
                }
                Integer family_relation = Integer.valueOf(map.get("family_relation").toString());
                obj.put("code", map.get("code"));
                obj.put("name", map.get("name"));
                obj.put("sex", map.get("sex"));
                obj.put("isAuthorize", map.get("is_authorize"));//0:未授权,1:已授权
                obj.put("birthday", map.get("birthday"));
                obj.put("idcard", StringUtils.isEmpty(String.valueOf(map.get("idcard"))) ? "" : map.get("idcard").toString());
                obj.put("photo", map.get("photo"));
                obj.put("mobile", map.get("mobile"));
                obj.put("address", StringUtils.isEmpty(String.valueOf(map.get("address"))) ? "" : map.get("address"));
                obj.put("familyRelation", family_relation);
                obj.put("familyRelationName", relations.get(map.get("family_relation")));
                if (ssSign && jtSign) {
                    obj.put("signType", 3);
                } else if (!ssSign && jtSign) {
                    obj.put("signType", 2);
                } else if (ssSign && !jtSign) {
                    obj.put("signType", 1);
                } else {
                    obj.put("signType", 0);
                }
                if(family_relation==0){
                    tem.put(obj);
                }else {
                    resultArray.put(obj);
                }
            }
            if(tem.length()>0){
                for(int i =0;i<tem.length();i++){
                    resultArray.put(tem.get(i));
                }
            }
        }
        return resultArray;
    }
    /**
     * 获取居民的家庭成员
     *
@ -345,6 +482,7 @@ public class FamilyMemberService extends BaseService {
                obj.put("code", map.get("code"));
                obj.put("name", map.get("name"));
                obj.put("sex", map.get("sex"));
                obj.put("isAuthorize", map.get("is_authorize"));//0:未授权,1:已授权
                obj.put("birthday", map.get("birthday"));
                obj.put("idcard", StringUtils.isEmpty(String.valueOf(map.get("idcard"))) ? "" : map.get("idcard").toString());
                obj.put("photo", map.get("photo"));
@ -378,6 +516,105 @@ public class FamilyMemberService extends BaseService {
        return resultArray;
    }
    /**
     * 是否授权,如果有授权就返回member的个人信息
     * @param patient
     * @param member
     * @return
     */
    public JSONObject isAuthorize(String patient,String member){
        JSONObject json = new JSONObject();
        PatientFamilyMember familyMember = memberDao.findByPatientAndFamilyMember(patient,member);
        if(familyMember==null||0==familyMember.getIsAuthorize()){
            return null;
        }
        Patient p = patientDao.findByCode(member);
        json.put("code", p.getCode());
        json.put("name", p.getName());
        return json;
    }
    /**
     * 获取有授权的家庭成员
     * @param patient
     * @return
     */
    public JSONArray getAuthorizeMembers(String patient){
        JSONArray resultArray = new JSONArray();
        resultArray.put(getPatient(patient));
        String sql = "select * " +
                " from " +
                "    wlyy_patient_family_member t1, " +
                "    wlyy_patient t2 " +
                " where " +
                "        t1.patient = ? " +
                "    and t1.is_authorize = 1 " +
                "    and t1.family_member = t2.code order by t1.family_relation ";
        List<Map<String, Object>> result = jdbcTemplate.queryForList(sql, new Object[]{patient});
        if (result != null && result.size() > 0) {
            JSONArray tem = new JSONArray();
            for (Map<String, Object> map : result) {
                JSONObject obj = new JSONObject();
                List<SignFamily> signs = contractService.findAllSignByPatient(map.get("code").toString());
                boolean ssSign = false;
                boolean jtSign = false;
                for (SignFamily sign : signs) {
                    if (sign.getType() == 1 && sign.getStatus() > 0) {
                        ssSign = true;
                    } else if (sign.getType() == 2 && sign.getStatus() > 0) {
                        jtSign = true;
                    } else if (sign.getStatus() == 0) {
                    }
                }
                Integer family_relation = Integer.valueOf(map.get("family_relation").toString());
                obj.put("code", map.get("code"));
                obj.put("name", map.get("name"));
                obj.put("sex", map.get("sex"));
                obj.put("isAuthorize", map.get("is_authorize"));//0:未授权,1:已授权
                obj.put("birthday", map.get("birthday"));
                String idCard = StringUtils.isEmpty(String.valueOf(map.get("idcard"))) ? "" : map.get("idcard").toString();
                obj.put("idcard", CommonUtil.getIdcardEncode(idCard));
                obj.put("photo", map.get("photo"));
                obj.put("mobile", map.get("mobile"));
                obj.put("ssc", map.get("ssc"));
                obj.put("familyRelation", family_relation);
                obj.put("familyRelationName", relations.get(map.get("family_relation")));
                if (ssSign && jtSign) {
                    obj.put("signType", 3);
                } else if (!ssSign && jtSign) {
                    obj.put("signType", 2);
                } else if (ssSign && !jtSign) {
                    obj.put("signType", 1);
                } else {
                    obj.put("signType", 0);
                }
                if(family_relation==0){
                    tem.put(obj);
                }else {
                    resultArray.put(obj);
                }
            }
            if(tem.length()>0){
                for(int i =0;i<tem.length();i++){
                    resultArray.put(tem.get(i));
                }
            }
        }
        return resultArray;
    }
    /**
     * 获取居民的家庭成员
@ -419,6 +656,7 @@ public class FamilyMemberService extends BaseService {
            obj.put("address", StringUtils.isEmpty(p.getAddress()) ? "" : p.getAddress());
            obj.put("familyRelation", "-1");
            obj.put("familyRelationName", "自己");
            obj.put("isAuthorize", 1);//0:未授权,1:已授权
            if (ssSign && jtSign) {
                obj.put("signType", 3);

+ 239 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/prenatalInspector/PrenatalInspectorPreCardService.java

@ -0,0 +1,239 @@
package com.yihu.wlyy.service.app.prenatalInspector;
import com.yihu.wlyy.entity.patient.Patient;
import com.yihu.wlyy.entity.patient.SignFamily;
import com.yihu.wlyy.entity.patient.prenatal.PrenatalInspectorPlan;
import com.yihu.wlyy.entity.patient.prenatal.PrenatalInspectorPlanLibrary;
import com.yihu.wlyy.entity.patient.prenatal.PrenatalInspectorPreCard;
import com.yihu.wlyy.repository.patient.PatientDao;
import com.yihu.wlyy.repository.patient.PrenatalInspectorPlanDao;
import com.yihu.wlyy.repository.patient.PrenatalInspectorPlanLibraryDao;
import com.yihu.wlyy.repository.patient.PrenatalInspectorPreCardDao;
import com.yihu.wlyy.service.BaseService;
import com.yihu.wlyy.service.app.sign.FamilyContractService;
import com.yihu.wlyy.task.PushMsgTask;
import com.yihu.wlyy.util.DateUtil;
import com.yihu.wlyy.wechat.util.WeiXinAccessTokenUtils;
import org.apache.commons.lang3.StringUtils;
import org.json.JSONArray;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
 * Created by yeshijie on 2017/6/6.
 */
@Component
@Transactional(rollbackFor = Exception.class)
public class PrenatalInspectorPreCardService extends BaseService {
    @Autowired
    private PrenatalInspectorPreCardDao prenatalInspectorPreCardDao;
    @Autowired
    private PrenatalInspectorPlanLibraryDao prenatalInspectorPlanLibraryDao;
    @Autowired
    private PrenatalInspectorPlanDao prenatalInspectorPlanDao;
    @Autowired
    private WeiXinAccessTokenUtils accessTokenUtils;
    @Autowired
    private PatientDao patientDao;
    @Autowired
    private FamilyContractService familyContractService;
    /**
     * 待产检计划
     * @param code
     * @return
     */
    public JSONArray planList(String code){
        JSONArray jsonArray = new JSONArray();
        List<PrenatalInspectorPlan> planList = prenatalInspectorPlanDao.findByCode(code);
        for (PrenatalInspectorPlan plan:planList){
            JSONObject json = new JSONObject();
            json.put("checkItem",plan.getCheckItem());
            json.put("name",plan.getName());
            json.put("thisFoucs",plan.getThisFocus());
            json.put("thisNote",plan.getThisNote());
            if(plan.getInspectionTime()==null){
                json.put("inspectionTime","");
            }else {
                json.put("inspectionTime",DateUtil.dateToStrShort(plan.getInspectionTime()));
            }
            json.put("inspectionEndTime",DateUtil.dateToStrShort(plan.getInspectionEndTime()));
            json.put("inspectionStartTime",DateUtil.dateToStrShort(plan.getInspectionStartTime()));
            jsonArray.put(json);
        }
        return jsonArray;
    }
    /**
     * 预建卡列表-孕检计划
     * @param patient
     * @return
     */
    public JSONArray preCardList(String patient){
        JSONArray jsonArray = new JSONArray();
        List<PrenatalInspectorPreCard> preCards = prenatalInspectorPreCardDao.findByPatient(patient);
        for (PrenatalInspectorPreCard preCard:preCards){
            JSONObject json = new JSONObject();
            json.put("code",preCard.getCode());
            json.put("dueDate",DateUtil.dateToStrShort(preCard.getDueDate()));//预产期
            Date date = new Date();
            Long dueDateDay = DateUtil.getDays(preCard.getDueDate(),date);
            if(dueDateDay>0){
                json.put("dueDateWeek",getWeek(dueDateDay.intValue()));//距离预产期周数
                json.put("dueDateDay",getDay(dueDateDay.intValue()));//距离预产期周数的余数
                Long pregnancyDay = DateUtil.getDays(date,preCard.getLastMenstrualDate());
                int week = getWeek(pregnancyDay.intValue());
                int day = getDay(pregnancyDay.intValue());
                String preDay = day==0?(week+"周"):(week+"周"+day+"天");//怀孕时间
                json.put("status",preDay);
            }else {
                json.put("dueDateWeek",0);//距离预产期周数
                json.put("dueDateDay",0);//距离预产期周数的余数
                json.put("status",preCard.getStatus());
            }
            json.put("hospitalName",preCard.getHospitalName());//预约床位医院
            json.put("orderBedTime",preCard.getOrderBedTime());//预约床位时间
            jsonArray.put(json);
        }
        return jsonArray;
    }
    /**
     * 把天数换算成周数
     * @param day
     * @return
     */
    private int getWeek(Integer day){
        return day/7;
    }
    /**
     * 把天数换算成周数的余数
     * @param day
     * @return
     */
    private int getDay(Integer day){
        return day%7;
    }
    /**
     * 新建产检预建卡
     */
    @Transactional
    public void addPrenatalInspectorPreCard(PrenatalInspectorPreCard preCard){
        //1、保存预建卡
        Date date = new Date();
        Date lastMenstrualDate = preCard.getLastMenstrualDate();
        preCard.setDel("1");
        preCard.setCode(getCode());
        preCard.setCzrq(date);
        preCard.setDueDate(DateUtil.getDueDate(preCard.getLastMenstrualDate()));//预产期
        preCard.setStatus("0");
        preCard.setEffective("");
        preCard.setInspectionPhase("1");//检查阶段
        prenatalInspectorPreCardDao.save(preCard);
        String patient = preCard.getPatient();
        //2、生成待产检计划
        Long days = DateUtil.getDays(date,lastMenstrualDate);
        List<PrenatalInspectorPlanLibrary> libraries = prenatalInspectorPlanLibraryDao.findByDays(days);
        List<PrenatalInspectorPlan> plans = new ArrayList<>();
        PrenatalInspectorPlan plan = null;
        for (PrenatalInspectorPlanLibrary library:libraries){
            plan = new PrenatalInspectorPlan();
            plan.setInspectionPhase(library.getInspectionPhase());
            plan.setStatus("0");
            plan.setPatient(patient);
            plan.setCzrq(date);
            plan.setCheckItem(library.getCheckItem());
            plan.setInspectionCode(preCard.getCode());
            plan.setInspectionEndTime(DateUtil.getPrenatalInspectorDate(lastMenstrualDate,library.getEndDay().intValue()));
            plan.setInspectionStartTime(DateUtil.getPrenatalInspectorDate(lastMenstrualDate,library.getStartDay().intValue()));
            plan.setName(library.getName());
            plan.setThisFocus(library.getThisFocus());
            plan.setThisNote(library.getThisNote());
            if("1".equals(plan.getInspectionPhase())){
                SignFamily jiating = familyContractService.findByPatientByType(patient, 2);
                if(jiating!=null){
                    plan.setSignHospital(jiating.getHospital());
                }
            }
            plans.add(plan);
        }
        if (plans.size()>0){
            prenatalInspectorPlanDao.save(plans);
        }
    }
    /**
     * 产检提醒(1预约提醒,2就诊提醒)
     * 1、当居民已有经医生确认过的下一次产检时间,则距离下一次产检前7天(保证居民可自行预约),发出产检预约提醒通知。点击该消息,进入预约页面
     * 2、当居民已有经医生确认过的下一次产检时间,则距离下一次产检前1天,发出产检就诊提醒,提醒居民就诊。点击该消息,进入预约记录页面
     */
    public void sendPrenatalInspectorRemind(){
        List<PrenatalInspectorPlan> planList = prenatalInspectorPlanDao.findWxTipList();
        for (PrenatalInspectorPlan plan:planList){
            try {
                Patient patient = patientDao.findByCode(plan.getPatient());
                String openId = patient.getOpenid();
                String name = patient.getName();
                String patientCode = patient.getCode();
                if(StringUtils.isNotBlank(openId)){
                    Long day = DateUtil.getDays(plan.getInspectionTime(),DateUtil.getNowDateShort());
                    JSONObject json = new JSONObject();
                    if(day==7){
                        //产检提醒
                        json.put("remark","产检内容以医生实际检查为准。点击进行预约");
                        json.put("first",name+",您好!您和您的宝宝需要进行产检啦~请及时预约产检,如已预约,请忽略");
                        if("1".equals(plan.getInspectionPhase())){
                            if(StringUtils.isNotBlank(plan.getSignHospital())){
                                json.put("url","wdyy/html/hospital-dept.html?openid="+openId+"&toUser="+patientCode+"&toName="+name+"&hospitalId="+plan.getSignHospital());
                            }else {
                                json.put("url","wdyy/html/appointment-register.html?openid="+openId+"&toUser="+patientCode+"&toName="+name+"&orderType=1");
                            }
                        }else {
                            json.put("url","wdyy/html/appointment-register.html?openid="+openId+"&toUser="+patientCode+"&toName="+name);
                        }
                        json.put("keyword1","产检提醒");
                        String keyword2 = DateUtil.getStringDateShort()+"\n产检内容:"+plan.getCheckItem();
                        json.put("keyword2",keyword2);
                        PushMsgTask.getInstance().sendWeixinMessage(accessTokenUtils.getAccessToken(), 18, openId, name, json);
                    }else if(day==1){
                        //产检就诊提醒
                        json.put("remark","产检内容以医生实际检查为准。点击查看预约记录");
                        json.put("first",name+",您好!您和您的宝宝即将进行产检啦~请按时就诊,如已就诊,请忽略");
                        json.put("url","wdyy/html/my-appointment.html?openid="+openId+"&toUser="+patientCode+"&toName="+name);
                        json.put("keyword1","产检就诊提醒");
                        String keyword2 = DateUtil.getStringDateShort()+"\n产检内容:"+plan.getCheckItem();
                        json.put("keyword2",keyword2);
                        PushMsgTask.getInstance().sendWeixinMessage(accessTokenUtils.getAccessToken(), 18, openId, name, json);
                    }
                }
            }catch (Exception e){
                System.out.println("微信提醒发送失败");
                e.printStackTrace();
            }
        }
    }
}

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

@ -1,9 +1,9 @@
package com.yihu.wlyy.task;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.LinkedBlockingQueue;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.wlyy.entity.wechat.WechatTemplate;
import com.yihu.wlyy.entity.wechat.WechatTemplateData;
import com.yihu.wlyy.util.HttpUtil;
import com.yihu.wlyy.util.SystemConf;
import io.swagger.annotations.Api;
import org.apache.commons.lang3.StringUtils;
@ -14,13 +14,11 @@ import org.slf4j.LoggerFactory;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.wlyy.entity.wechat.WechatTemplate;
import com.yihu.wlyy.entity.wechat.WechatTemplateData;
import com.yihu.wlyy.util.HttpUtil;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.LinkedBlockingQueue;
@Controller
@RequestMapping(value = "/pushMsgTask", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@ -181,6 +179,7 @@ public class PushMsgTask {
     * 发送微信模板消息
     *
     * @param type 1:签约成功  2:签约失败  3:咨询回复通知  4:健康指导提醒  5:解约申请通知  6:预约挂号成功通知  7:预约取消通知 8 缴费提醒 9 健康教育  10 签约医生变更
     *             18 产检提醒和产检就诊提醒
     * @param json 当type==1||type==2时:{"first":"消息主题",”doctor":"医生code","doctorName":"医生名","date":"签约时间","content":"签约内容","remark":"消息备注"}
     *             type==3时:{"first":"消息主题","consult":"医生咨询编号","consultcontent":"咨询内容","replycontent":"回复内容","doctorName":"医生名","remark":"消息备注"}
     *             type==4时:{"first":"消息主题","date":"指导时间","orgName":"指导机构","doctorName":"指导医生名","content":"指导内容","remark":"消息备注"}
@ -561,6 +560,17 @@ public class PushMsgTask {
                keyword2.setColor("#000000");
                keyword2.setValue(json.getString("keyword2"));
                m.put("keyword2", keyword2);
            } else if (type == 18) {
                temp.setUrl(url + json.getString("url"));
                temp.setTemplate_id(SystemConf.getInstance().getSystemProperties().getProperty("template_doctor_survey"));
                WechatTemplateData keyword1 = new WechatTemplateData();
                keyword1.setColor("#000000");
                keyword1.setValue(json.getString("keyword1"));
                m.put("keyword1", keyword1);
                WechatTemplateData keyword2 = new WechatTemplateData();
                keyword2.setColor("#000000");
                keyword2.setValue(json.getString("keyword2"));
                m.put("keyword2", keyword2);
            }
            temp.setData(m);

+ 30 - 8
patient-co-wlyy/src/main/java/com/yihu/wlyy/util/DateUtil.java

@ -1,16 +1,11 @@
package com.yihu.wlyy.util;
import java.sql.Time;
import org.apache.commons.lang3.StringUtils;
import java.text.DateFormat;
import java.text.ParsePosition;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.Locale;
import java.util.Random;
import org.apache.commons.lang3.StringUtils;
import java.util.*;
public class DateUtil {
@ -826,4 +821,31 @@ public class DateUtil {
		}
		return getNowYear()-1;
	}
	/**
	 * 计算预产期
	 * 末次月经开始日期(第一天),月份+9,日期+7
	 * @param date
	 * @return
	 */
	public static Date getDueDate(Date date){
		Calendar cal = Calendar.getInstance();
		cal.setTime(date);
		cal.add(Calendar.MONTH,9);
		cal.add(Calendar.DAY_OF_YEAR,7);
		return cal.getTime();
	}
	/**
	 * 计算产检时间
	 * @param date
	 * @param day
	 * @return
	 */
	public static Date getPrenatalInspectorDate(Date date,Integer day){
		Calendar cal = Calendar.getInstance();
		cal.setTime(date);
		cal.add(Calendar.DAY_OF_YEAR,day);
		return cal.getTime();
	}
}

+ 27 - 11
patient-co-wlyy/src/main/java/com/yihu/wlyy/util/ImUtill.java

@ -3,17 +3,12 @@ package com.yihu.wlyy.util;
import org.json.JSONArray;
import org.json.JSONObject;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
/**
 * Created by 卓 on 2017/1/13.
 */
public class ImUtill {
    
    private static final String im_host = SystemConf.getInstance().getImListGet();
    private static final String im_host = SystemConf.getInstance().getImListGet();
    /**
     * 获取医生统计数据
@ -124,14 +119,34 @@ public class ImUtill {
     * @param contentType 1文字 2图片消息
     * @param content     内容
     */
    public static String sendTopicIM(String from,String fromName, String topicId, String contentType, String content) {
    public static String sendTopicIM(String from,String fromName, String topicId, String contentType, String content,String agent) {
        String url = im_host + "api/v2/sessions/topic/"+topicId+"/messages";
        JSONObject params = new JSONObject();
        params.put("sender_id", from);
        params.put("sender_name", fromName);
        params.put("content_type", contentType);
        params.put("content", content);
        params.put("topic_id", topicId);;
        params.put("topic_id", topicId);
        params.put("agent", agent);
        String response = HttpClientUtil.postBody(url, params);
        return response;
    }
    /**
     * 发送进入im消息
     * @param from
     * @param sessionId
     * @param topicId
     * @return
     */
    public static String sendIntoTopicIM(String from,String sessionId,String topicId,String content,String intoUser,String intoUserName){
        String url = im_host + "api/v2/sessions/"+sessionId+"/topics/"+topicId+"/into";
        JSONObject params = new JSONObject();
        params.put("sender_id", from);
        params.put("topic_id", topicId);
        params.put("into_user", intoUser);
        params.put("into_user_name", intoUserName);
        params.put("content", content);
        String response = HttpClientUtil.postBody(url, params);
        return response;
    }
@ -228,15 +243,17 @@ public class ImUtill {
     * @param title
     * @param description
     * @param images
     * @param agent
     * @return
     */
    public static JSONObject getCreateTopicMessage(String senderId,String senderName,String title,String description,String images){
    public static JSONObject getCreateTopicMessage(String senderId,String senderName,String title,String description,String images,String agent){
        JSONObject messages = new JSONObject();
        messages.put("description",description);
        messages.put("title",title);
        messages.put("img",images);
        messages.put("sender_id",senderId);
        messages.put("sender_name",senderName);
        messages.put("agent",agent);
        return messages;
    }
@ -291,7 +308,7 @@ public class ImUtill {
                return obj;
            }
        }catch (Exception e){
           throw new RuntimeException("人员更换失败!");
            throw new RuntimeException("人员更换失败!");
        }
    }
@ -356,5 +373,4 @@ public class ImUtill {
    public  static final String SESSION_STATUS_END= "1";
    public  static final String CONTENT_TYPE_TEXT= "1";
}

+ 24 - 14
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/common/util/ManagerUtilController.java

@ -1,9 +1,6 @@
package com.yihu.wlyy.web.common.util;
import com.yihu.wlyy.job.QuartzHelper;
import com.yihu.wlyy.job.RenewToSignJob;
import com.yihu.wlyy.job.SignAgainJob;
import com.yihu.wlyy.job.SignEndJob;
import com.yihu.wlyy.job.*;
import com.yihu.wlyy.job.consult.EvaluateScoreJob;
import com.yihu.wlyy.job.consult.FamousConsultTimesJob;
import com.yihu.wlyy.repository.consult.ConsultTeamDoctorDao;
@ -14,25 +11,18 @@ import com.yihu.wlyy.service.common.util.ManageUtilService;
import com.yihu.wlyy.service.common.util.SignTeamAndGroupRunnable;
import com.yihu.wlyy.web.BaseController;
import io.swagger.annotations.Api;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.data.redis.hash.HashMapper;
import org.springframework.http.MediaType;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import java.io.BufferedWriter;
import java.io.FileOutputStream;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.math.BigDecimal;
import java.security.Signature;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.Date;
import java.util.HashMap;
import java.util.UUID;
/**
 * Created by lyr on 2016/09/13.
@ -333,4 +323,24 @@ public class ManagerUtilController extends BaseController {
            return error(-1, "启动失败");
        }
    }
    /**
     * 产检提醒
     *  每天早上六点
     * @return
     */
    @RequestMapping(value = "/start_prenatal_inspector_job")
    @ResponseBody
    public String startPrenatalInspectorJob() {
        try {
            if (!quartzHelper.isExistJob("prenatal_inspector_job")) {
                quartzHelper.addJob(PrenatalInspectorJob.class, "0 0 6 * * ?", "prenatal_inspector_job", new HashMap<String, Object>());
                return write(200, "启动成功");
            } else {
                return write(200, "任务已存在");
            }
        } catch (Exception e) {
            return error(-1, "启动失败");
        }
    }
}

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

@ -1,18 +1,22 @@
package com.yihu.wlyy.web.doctor.consult;
import java.util.List;
import java.util.Map;
import com.yihu.wlyy.entity.consult.Consult;
import com.yihu.wlyy.entity.consult.ConsultTeam;
import com.yihu.wlyy.entity.consult.ConsultTeamLog;
import com.yihu.wlyy.entity.discussion.WlyyTalkGroup;
import com.yihu.wlyy.entity.discussion.WlyyTalkGroupMember;
import com.yihu.wlyy.entity.doctor.profile.Doctor;
import com.yihu.wlyy.entity.patient.Patient;
import com.yihu.wlyy.service.app.account.DoctorInfoService;
import com.yihu.wlyy.service.app.account.PatientInfoService;
import com.yihu.wlyy.service.app.consult.ConsultService;
import com.yihu.wlyy.service.app.consult.ConsultTeamService;
import com.yihu.wlyy.service.app.health.PatientHealthGuidanceService;
import com.yihu.wlyy.service.app.scheduling.DoctorWorkTimeService;
import com.yihu.wlyy.service.app.talk.TalkGroupService;
import com.yihu.wlyy.service.app.team.AdminTeamService;
import com.yihu.wlyy.service.common.account.DoctorService;
import com.yihu.wlyy.task.PushMsgTask;
import com.yihu.wlyy.util.*;
import com.yihu.wlyy.web.WeixinBaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
@ -21,7 +25,6 @@ import org.json.JSONArray;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
@ -29,15 +32,8 @@ import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import com.yihu.wlyy.entity.consult.ConsultTeam;
import com.yihu.wlyy.entity.consult.ConsultTeamLog;
import com.yihu.wlyy.entity.doctor.profile.Doctor;
import com.yihu.wlyy.entity.patient.Patient;
import com.yihu.wlyy.service.app.account.DoctorInfoService;
import com.yihu.wlyy.service.app.account.PatientInfoService;
import com.yihu.wlyy.service.app.consult.ConsultTeamService;
import com.yihu.wlyy.task.PushMsgTask;
import com.yihu.wlyy.web.WeixinBaseController;
import java.util.List;
import java.util.Map;
/**
 * 医生端:三师咨询控制类
@ -680,7 +676,7 @@ public class DoctorConsultController extends WeixinBaseController {
            consult.setVoice(voice);
            consult.setDoctor(doctorCode);//设置专科医生
            // 保存到数据库
            JSONObject result = consultTeamService.famousConsult(consult, getUID(), "2");
            JSONObject result = consultTeamService.famousConsult(consult, getUID(), "2",null);
            // 推送消息给医生
            PushMsgTask.getInstance().put(consult.getDoctor(), MessageType.MESSAGE_TYPE_DOCTOR_NEW_FAMOUS_CONSULT_TEAM_DOCTOR.D_CT_04.name(), MessageType.MESSAGE_TYPE_DOCTOR_NEW_FAMOUS_CONSULT_TEAM_DOCTOR.名医咨询.name(), MessageType.MESSAGE_TYPE_DOCTOR_NEW_FAMOUS_CONSULT_TEAM_DOCTOR.您有新的名医咨询.name(), consult.getConsult());
            if (StringUtils.isNotEmpty(images)) {

+ 13 - 15
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/account/PatientController.java

@ -1,10 +1,7 @@
package com.yihu.wlyy.web.patient.account;
import com.sun.org.apache.regexp.internal.RE;
import com.yihu.wlyy.entity.dict.SystemDict;
import com.yihu.wlyy.entity.doctor.profile.Doctor;
import com.yihu.wlyy.entity.doctor.team.admin.AdminTeam;
import com.yihu.wlyy.entity.doctor.team.sign.DoctorTeamMember;
import com.yihu.wlyy.entity.patient.Patient;
import com.yihu.wlyy.entity.patient.SignFamily;
import com.yihu.wlyy.entity.security.Token;
@ -24,10 +21,8 @@ import org.apache.commons.lang3.StringUtils;
import org.json.JSONArray;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
@ -77,9 +72,12 @@ public class PatientController extends WeixinBaseController {
    @ResponseBody
    public String baseinfo() {
        try {
            Patient temp = patientInfoService.findByCode(getUID());
            SignFamily sanshi = familyContractService.findByPatientByType(getUID(), 1);
            SignFamily jiating = familyContractService.findByPatientByType(getUID(), 2);
//            Patient temp = patientInfoService.findByCode(getUID());
//            SignFamily sanshi = familyContractService.findByPatientByType(getUID(), 1);
//            SignFamily jiating = familyContractService.findByPatientByType(getUID(), 2);
            Patient temp = patientInfoService.findByCode(getRepUID());
            SignFamily sanshi = familyContractService.findByPatientByType(getRepUID(), 1);
            SignFamily jiating = familyContractService.findByPatientByType(getRepUID(), 2);
            int sign = 0;
            if (sanshi != null && jiating != null) {
                sign = 3;
@ -502,11 +500,11 @@ public class PatientController extends WeixinBaseController {
            Map<String, String> teamDoctors = new HashMap<>();
            Map<String, String> familyDoctors = new HashMap<>();
            Map<String,String> signDoctors = new HashMap<>();
            String id = getUID();
            String id = getRepUID();
//            String id = getUID();
            JSONObject json = new JSONObject();
            //查询家庭签约
            SignFamily jt = familyContractService.findByPatientYes(id);
            if (jt != null) {
                List<Doctor> doctors = doctorTeamService.findJiatingTeamDoctors(id);
                if (doctors != null) {
@ -523,7 +521,6 @@ public class PatientController extends WeixinBaseController {
                if(StringUtils.isNotBlank(jt.getDoctorHealth())&&StringUtils.isNotBlank(jt.getDoctorHealthName())){
                    signDoctors.put(jt.getDoctorHealth(), jt.getDoctorHealthName());
                }
            }
            // 查询三师医生
            SignFamily ss = familyContractService.findBySanshiPatientYes(id);
@ -538,7 +535,7 @@ public class PatientController extends WeixinBaseController {
                    }
                }
                json.put("teamCode_"+1,ss.getTeamCode());
                json.put("signCode_"+1,jt.getCode());
                json.put("signCode_"+1,ss.getCode());
            }
            // 未签约
            int sign = 0;
@ -577,7 +574,8 @@ public class PatientController extends WeixinBaseController {
        try {
            List<JSONObject> teamDoctors = new ArrayList<>();
            List<JSONObject> familyDoctors = new ArrayList<>();
            String id = getUID();
            String id = getRepUID();
//            String id = getUID();
            //查询家庭签约
            SignFamily jt = familyContractService.findByPatientYes(id);
            if (jt != null) {
@ -670,12 +668,12 @@ public class PatientController extends WeixinBaseController {
        try {
            JSONObject jsonObject = new JSONObject();
            //判断是否有三师签约
            SignFamily ss = familyContractService.findBySanshiPatient(getUID());  // -1 未签约  0 待签约 1 已签约 2待解约
            SignFamily ss = familyContractService.findBySanshiPatient(getRepUID());  // -1 未签约  0 待签约 1 已签约 2待解约
            if (ss != null) {
                return write(200, "获取签约状态成功!", "data", ss.getStatus());
            }
            //判断是否有家庭签约
            SignFamily sf = familyContractService.findByFamilySignPatient(getUID());
            SignFamily sf = familyContractService.findByFamilySignPatient(getRepUID());
            if (sf != null) {
                return write(200, "获取签约状态成功!", "data", sf.getStatus());
            }

+ 2 - 9
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/archives/PatientArchivesController.java

@ -9,12 +9,10 @@ import com.yihu.wlyy.service.common.account.PatientService;
import com.yihu.wlyy.service.third.jw.JwArchivesService;
import com.yihu.wlyy.util.SystemConf;
import com.yihu.wlyy.util.fastdfs.FastDFSUtil;
import com.yihu.wlyy.web.BaseController;
import com.yihu.wlyy.web.WeixinBaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.apache.commons.lang3.StringUtils;
import org.json.JSONArray;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
@ -24,14 +22,8 @@ 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.ResponseBody;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.ByteArrayInputStream;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
@ -67,7 +59,8 @@ public class PatientArchivesController extends WeixinBaseController {
                              @ApiParam(name="lastTime",value="最后一条时间",defaultValue = "2010-10-10 00:00:00")
                              @RequestParam(value="lastTime",required = false) String lastTime) {
        try {
            List<Map<String,String>> result = patientRecordService.getAllEvent(getUID(),type,page,pageSize,lastTime);
            List<Map<String,String>> result = patientRecordService.getAllEvent(getRepUID(),type,page,pageSize,lastTime);
            return write(200, "获取就诊记录成功!", "data", result);
        } catch (Exception e) {

+ 57 - 39
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/consult/ConsultController.java

@ -1,29 +1,28 @@
package com.yihu.wlyy.web.patient.consult;
import java.util.*;
import com.thoughtworks.xstream.mapper.Mapper;
import com.yihu.wlyy.entity.consult.Consult;
import com.yihu.wlyy.entity.consult.ConsultTeam;
import com.yihu.wlyy.entity.consult.ConsultTeamLog;
import com.yihu.wlyy.entity.discussion.WlyyTalkGroup;
import com.yihu.wlyy.entity.doctor.profile.Doctor;
import com.yihu.wlyy.entity.doctor.schedule.WlyyDoctorWorkTime;
import com.yihu.wlyy.entity.doctor.schedule.WlyyDoctorWorkWeek;
import com.yihu.wlyy.entity.patient.Patient;
import com.yihu.wlyy.logs.BusinessLogs;
import com.yihu.wlyy.repository.patient.PatientDao;
import com.yihu.wlyy.service.app.consult.ConsultTeamService;
import com.yihu.wlyy.service.app.consult.DoctorCommentService;
import com.yihu.wlyy.service.app.scheduling.DoctorWorkTimeService;
import com.yihu.wlyy.service.app.statistics.DoctorStatisticsService;
import com.yihu.wlyy.service.app.talk.TalkGroupService;
import com.yihu.wlyy.service.common.account.DoctorService;
import com.yihu.wlyy.task.DoctorStatisticsTask;
import com.yihu.wlyy.task.PushMsgTask;
import com.yihu.wlyy.util.*;
import com.yihu.wlyy.web.WeixinBaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;
import org.json.JSONArray;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.redis.listener.Topic;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
@ -31,14 +30,9 @@ import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import com.yihu.wlyy.service.app.consult.ConsultTeamService;
import com.yihu.wlyy.service.app.consult.DoctorCommentService;
import com.yihu.wlyy.service.app.statistics.DoctorStatisticsService;
import com.yihu.wlyy.service.app.talk.TalkGroupService;
import com.yihu.wlyy.service.common.account.DoctorService;
import com.yihu.wlyy.task.DoctorStatisticsTask;
import com.yihu.wlyy.task.PushMsgTask;
import com.yihu.wlyy.web.WeixinBaseController;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
 * 患者端:三师咨询控制类
@ -81,7 +75,7 @@ public class ConsultController extends WeixinBaseController {
            int pagesize) {
        try {
            JSONArray array = new JSONArray();
            Page<Object> data = consultTeamService.findConsultRecordByPatient(getUID(), id, pagesize, title);
            Page<Object> data = consultTeamService.findConsultRecordByPatient(getRepUID(), id, pagesize, title);
            if (data != null) {
                for (Object consult : data.getContent()) {
                    if (consult == null) {
@ -221,7 +215,8 @@ public class ConsultController extends WeixinBaseController {
    @ResponseBody
    public String getUnFinishedConsult() {
        try {
            List<ConsultTeam> unfinishedConsult = consultTeamService.getUnfinishedConsult(getUID());
//            List<ConsultTeam> unfinishedConsult = consultTeamService.getUnfinishedConsult(getUID());
            List<ConsultTeam> unfinishedConsult = consultTeamService.getUnfinishedConsult(getRepUID());
            JSONArray result = new JSONArray(unfinishedConsult);
            return write(200, "查询成功!", "data", result);
        } catch (Exception e) {
@ -241,7 +236,7 @@ public class ConsultController extends WeixinBaseController {
    public String isExistsUnfinishedConsult(@RequestParam(required = true) String doctor) {
        try {
            JSONObject result = new JSONObject();
            List<ConsultTeam> consults = consultTeamService.getUnfinishedConsult(getUID(), doctor);
            List<ConsultTeam> consults = consultTeamService.getUnfinishedConsult(getRepUID(), doctor);
            if (consults != null && consults.size() > 0) {
                return write(200, "查询成功", "data", consults.get(0).getConsult());
@ -282,7 +277,7 @@ public class ConsultController extends WeixinBaseController {
                return error(-1, "无效请求!");
            }
            try {
                if (consultTeamService.exist(getUID(), type)) {
                if (consultTeamService.exist(getRepUID(), type)) {
                    return error(-1, "还有咨询未结束,不允许再次提交咨询!");
                }
            } catch (Exception e) {
@ -319,7 +314,7 @@ public class ConsultController extends WeixinBaseController {
            System.out.println("guidance2="+guidance);
            // 保存到数据库
            int res = consultTeamService.addTeamConsult(consult, getUID());
            int res = consultTeamService.addTeamConsult(consult, getRepUID(),getUID());
            if (res == -1) {
                return error(-1, "家庭签约信息不存在或已过期,无法进行家庭医生咨询!");
            } else if (res == -2) {
@ -340,7 +335,7 @@ public class ConsultController extends WeixinBaseController {
            // 推送消息给医生
            PushMsgTask.getInstance().put(consult.getDoctor(), MessageType.MESSAGE_TYPE_DOCTOR_NEW_CONSULT_TEAM.D_CT_01.name(), MessageType.MESSAGE_TYPE_DOCTOR_NEW_CONSULT_TEAM.指定咨询.name(), MessageType.MESSAGE_TYPE_DOCTOR_NEW_CONSULT_TEAM.您有新的指定咨询.name(), consult.getConsult());
            BusinessLogs.info(BusinessLogs.BusinessType.consult, getUID(), getUID(), new JSONObject(consult));
            BusinessLogs.info(BusinessLogs.BusinessType.consult, getRepUID(), getUID(), new JSONObject(consult));
            return write(200, "提交成功", "data", consult);
        } catch (Exception ex) {
            error(ex);
@ -348,6 +343,26 @@ public class ConsultController extends WeixinBaseController {
        }
    }
    @RequestMapping(value = "intoTopic",method = RequestMethod.POST)
    @ResponseBody
    @ApiOperation("进入咨询")
    public String intoTopic(@RequestParam(required = true) String consult){
        try{
            int result = consultTeamService.intoTopic(consult,getRepUID(),getUID());
            if(result==-1){
                return error(-1,"该咨询不是进行中");
            }
            JSONObject json = new JSONObject();
            json.put("consult",consult);
            json.put("content","进入咨询");
            BusinessLogs.info(BusinessLogs.BusinessType.consult, getUID(), getRepUID(), json);
            return success("进入成功");
        }catch (Exception e){
            error(e);
            return error(-1,"请求失败");
        }
    }
    /**
     * 名医咨询添加接口
     *
@ -391,7 +406,7 @@ public class ConsultController extends WeixinBaseController {
                voice = CommonUtil.copyTempVoice(voice);
            }
            //判断是否已经存在还没有关闭的咨询
            if (consultTeamService.isExistConsult(getUID(), doctorCode)) {
            if (consultTeamService.isExistConsult(getRepUID(), doctorCode)) {
                return error(-1, "还有咨询未结束,不允许再次提交咨询!");
            }
            ConsultTeam consult = new ConsultTeam();
@ -407,14 +422,14 @@ public class ConsultController extends WeixinBaseController {
            consult.setVoice(voice);
            consult.setDoctor(doctorCode);//设置专科医生
            // 保存到数据库
            JSONObject object  = consultTeamService.famousConsult(consult, getUID(), "1");
            JSONObject object  = consultTeamService.famousConsult(consult, getRepUID(), "1",getUID());
            JSONObject resultConsult =  new JSONObject(consult);
            resultConsult.put("session_id",object.getString("session_id"));
            //名医咨询次数减一
            doctorWorkTimeService.setDoctorCurrentConsultTimesRemain(doctorCode);
            // 推送消息给医生
            PushMsgTask.getInstance().put(consult.getDoctor(), MessageType.MESSAGE_TYPE_DOCTOR_NEW_FAMOUS_CONSULT_TEAM.D_CT_03.name(), MessageType.MESSAGE_TYPE_DOCTOR_NEW_FAMOUS_CONSULT_TEAM.名医咨询.name(), MessageType.MESSAGE_TYPE_DOCTOR_NEW_FAMOUS_CONSULT_TEAM.您有新的名医咨询.name(), consult.getConsult());
            BusinessLogs.info(BusinessLogs.BusinessType.consult, getUID(), getUID(), new JSONObject(consult));
            BusinessLogs.info(BusinessLogs.BusinessType.consult, getRepUID(), getUID(), new JSONObject(consult));
            return write(200, "提交成功", "data", resultConsult);
        } catch (Exception ex) {
            error(ex);
@ -516,7 +531,7 @@ public class ConsultController extends WeixinBaseController {
    @ResponseBody
    public String list(int status, long id, int pagesize) {
        try {
            Page<ConsultTeam> consults = consultTeamService.findByPatient(getUID(), status, id, pagesize);
            Page<ConsultTeam> consults = consultTeamService.findByPatient(getRepUID(), status, id, pagesize);
            JSONArray jsonArray = new JSONArray();
            if (consults != null) {
                for (ConsultTeam consult : consults) {
@ -585,7 +600,7 @@ public class ConsultController extends WeixinBaseController {
    @ResponseBody
    public String finish(@RequestParam(required = true) String code) {
        try {
            int row = consultTeamService.finishConsult(code, getUID(), 1);
            int row = consultTeamService.finishConsult(code, getRepUID(), 1);
            if (row > 0) {
                return success("操作成功!");
            } else {
@ -670,12 +685,15 @@ public class ConsultController extends WeixinBaseController {
                arr = new String[]{content};
            }
            Patient patient = patientDao.findByCode(getUID());
//            Patient patient = patientDao.findByCode(getUID());
            Patient patient = patientDao.findByCode(getRepUID());
            int i = 0;
            List<String> failed = new ArrayList<>();
            String agent = getUID()==getRepUID()?null:getUID();
            for (ConsultTeamLog log : logs) {
                String response = ImUtill.sendTopicIM(getUID(), patient.getName(), consult, String.valueOf(log.getType()), log.getContent());
//                String response = ImUtill.sendTopicIM(getUID(), patient.getName(), consult, String.valueOf(log.getType()), log.getContent());
                String response = ImUtill.sendTopicIM(getRepUID(), patient.getName(), consult, String.valueOf(log.getType()), log.getContent(),agent);
                if (StringUtils.isNotEmpty(response)) {
                    JSONObject resObj = new JSONObject(response);
                    if (resObj.getInt("status") == -1) {
@ -707,10 +725,10 @@ public class ConsultController extends WeixinBaseController {
            if (consultModel == null) {
                return error(-1, "咨询记录不存在!");
            }
            JSONObject messageObj = ImUtill.getTopicMessage(consultModel.getConsult(), consultModel.getStartMsgId(), consultModel.getEndMsgId(), page, pagesize, getUID());
            JSONObject messageObj = ImUtill.getTopicMessage(consultModel.getConsult(), consultModel.getStartMsgId(), consultModel.getEndMsgId(), page, pagesize, getRepUID());
            //过滤续签
            consultTeamService.removeRenewPerson(messageObj,getUID());
            consultTeamService.removeRenewPerson(messageObj,getRepUID());
            return write(200, "查询成功", "list", messageObj);
        } catch (Exception e) {
@ -729,7 +747,7 @@ public class ConsultController extends WeixinBaseController {
    @ResponseBody
    public String logs(@RequestParam String sessionId,@RequestParam(required = false) String startMsgId,@RequestParam(required = false) String endMsgId, @RequestParam int page, @RequestParam int pagesize) {
        try {
            JSONArray messageArray = ImUtill.getSessionMessage(sessionId, startMsgId, endMsgId, page, pagesize, getUID());
            JSONArray messageArray = ImUtill.getSessionMessage(sessionId, startMsgId, endMsgId, page, pagesize, getRepUID());
            return write(200, "查询成功", "list", messageArray);
        } catch (Exception e) {
            error(e);
@ -744,7 +762,7 @@ public class ConsultController extends WeixinBaseController {
            JSONArray participants = ImUtill.getSessions(sessionId);
            //过滤续签
            consultTeamService.removeRenewPerson(participants,getUID());
            consultTeamService.removeRenewPerson(participants,getRepUID());
            return write(200, "查询成功", "list", participants);
        } catch (Exception e) {
@ -786,7 +804,7 @@ public class ConsultController extends WeixinBaseController {
            JSONObject json = new JSONObject();
            json.put("id", obj.getInt("id"));
            if (!obj.getString("from").equals(getUID())) {
            if (!obj.getString("from").equals(getRepUID())) {
                Doctor doc = doctorService.findDoctorByCode(obj.getString("from"));
                // 设置回复医生姓名
                json.put("doctorName", doc.getName());
@ -805,7 +823,7 @@ public class ConsultController extends WeixinBaseController {
            // 设置记录类型:1文字,2图片,3语音
            json.put("msgType", obj.getInt("contentType"));
            // 设置类型:0患者问,1医生回复,2患者追问,3患者评价
            if (!obj.getString("from").equals(getUID())) {
            if (!obj.getString("from").equals(getRepUID())) {
                json.put("type", 1);
            } else {
                json.put("type", obj.getInt("contentType") == 6 ? 0 : 2);
@ -832,7 +850,7 @@ public class ConsultController extends WeixinBaseController {
    public String comment(String consult, String content, int star) {
        try {
            // 保存评价
            JSONArray array = doctorCommentService.consultComment(getUID(), consult, content, star, 2);
            JSONArray array = doctorCommentService.consultComment(getRepUID(), consult, content, star, 2);
            // 添加到统计队列
            if (array != null) {
                DoctorStatisticsTask.getInstance(doctorStatisticsService).put(array);
@ -844,7 +862,7 @@ public class ConsultController extends WeixinBaseController {
            log.setChatType(1);
            log.setDel("1");
            log.setType(3);
            log = consultTeamService.reply(log, getUID(), null, log.getType());
            log = consultTeamService.reply(log, getRepUID(), null, log.getType());
            return success("感谢您的评价!");
        } catch (Exception e) {
            error(e);

+ 2 - 2
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/device/PatientDeviceController.java

@ -22,7 +22,6 @@ import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@ -172,7 +171,8 @@ public class PatientDeviceController extends BaseController {
                                     @ApiParam(name = "pagesize", value = "每页条数", defaultValue = "10")
                                     @RequestParam(value = "pagesize", required = true) int pagesize) {
        try {
            Page<PatientDevice> list = patientDeviceService.findByPatient(getUID(), id, pagesize);
//            Page<PatientDevice> list = patientDeviceService.findByPatient(getUID(), id, pagesize);
            Page<PatientDevice> list = patientDeviceService.findByPatient(getRepUID(), id, pagesize);
            return write(200, "查询成功", "data", list);
        } catch (Exception ex) {

+ 60 - 3
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/family/FamilyMemberController.java

@ -1,11 +1,12 @@
package com.yihu.wlyy.web.patient.family;
import com.yihu.wlyy.repository.patient.PatientFamilyMemberDao;
import com.yihu.wlyy.service.app.family.FamilyMemberService;
import com.yihu.wlyy.task.PushMsgTask;
import com.yihu.wlyy.util.MD5;
import com.yihu.wlyy.web.WeixinBaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.apache.commons.lang3.StringUtils;
import org.json.JSONArray;
import org.json.JSONObject;
@ -27,6 +28,8 @@ public class FamilyMemberController extends WeixinBaseController {
    @Autowired
    FamilyMemberService familyMemberService;
    @Autowired
    PatientFamilyMemberDao familyMemberDao;
    /**
     * 添加成员
@ -138,9 +141,28 @@ public class FamilyMemberController extends WeixinBaseController {
        }
    }
    @RequestMapping(value = "/member_authorize", method = RequestMethod.POST)
    @ApiOperation(value = "家庭成员授权")
    public String authorizeMember(@ApiParam(name = "familyMember", value = "家人code", defaultValue ="1555c32c626343e7aaa62e9cf76c97f2")
                                  @RequestParam(value = "familyMember", required = true) String familyMember,
                                  @ApiParam(name = "isAuthorize", value = "是否授权(0:未授权,1:已授权)", defaultValue ="1")
                                  @RequestParam(value = "isAuthorize", required = true) Integer isAuthorize){
        try {
            int result = familyMemberService.authorizeMember(getUID(),familyMember,isAuthorize);
            if(result==0){
                return error(-1, "与该成员的关系不存在");
            }
            return write(200, "授权成功");
        }catch (Exception e){
            return error(-1,"授权失败");
        }
    }
    /**
     * 家庭成员查询
     *
     * @param patient
     * @return
     */
    @RequestMapping(value = "/members", method = RequestMethod.GET)
@ -150,7 +172,7 @@ public class FamilyMemberController extends WeixinBaseController {
            JSONArray result = new JSONArray();
            if (StringUtils.isNotEmpty(patient)) {
                result = familyMemberService.getPatientMembers(patient, "", true, getUID());
            } else {
            } else  {
                result = familyMemberService.getPatientFamilyMembers(getUID(), "");
            }
            return write(200, "查询成功", "data", result);
@ -160,6 +182,41 @@ public class FamilyMemberController extends WeixinBaseController {
        }
    }
    @RequestMapping(value = "/authorize_members", method = RequestMethod.GET)
    @ApiOperation(value = "家庭成员(有授权)查询")
    public String getAuthorizeFamilyMembers(){
        try {
            JSONArray result = familyMemberService.getAuthorizeMembers(getUID());
            return write(200, "查询成功", "data", result);
        } catch (Exception e) {
            e.printStackTrace();
            return error(-1, "查询失败");
        }
    }
    @RequestMapping(value = "/is_authorize", method = RequestMethod.GET)
    @ApiOperation(value = "是否授权查询")
    public String isAuthorize(@ApiParam(name = "patient", value = "居民code", defaultValue = "")
                              @RequestParam(value = "patient", required = true) String patient,
                              @ApiParam(name = "familyMember", value = "家人code", defaultValue = "")
                              @RequestParam(value = "familyMember", required = true) String familyMember){
        try {
            if(patient.equals(familyMember)){
                return success("查询成功");
            }
            JSONObject json = familyMemberService.isAuthorize(patient,familyMember);
            if(json==null){
                return error(-1,"未授权");
            }
            return write(200, "查询成功", "data", json);
        } catch (Exception e) {
            e.printStackTrace();
            return error(-1, "查询失败");
        }
    }
    /**
     * 根据身份证号查询居民是否注册
     *

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 78 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/prenatalInspector/PrenatalInspectorContoller.java


+ 2 - 0
patient-co-wlyy/src/main/resources/system.properties

@ -70,6 +70,8 @@ sign_end_job_trigger= 0 0 0 1 7 ?
sign_again_job_trigger=59 59 23 7/7 * ?
# 续签提醒JOB停止时间
sign_again_job_end=2017-10-1 00:00:00
# 产检提醒JOB触发时间 (每天6点一次)
prenatal_inspector_job_trigger=0 0 6 * * ?
evaluate_score_job = 0 0 */2 * * ?