Bläddra i källkod

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

wujunjie 7 år sedan
förälder
incheckning
00d58a00ad
17 ändrade filer med 392 tillägg och 102 borttagningar
  1. 194 0
      common/common-entity/src/main/java/com/yihu/wlyy/entity/imm/ChildInfoVO.java
  2. 1 1
      patient-co-service/wlyy_device/src/main/java/com/yihu/hos/device/model/DoctorSwitch.java
  3. 1 1
      patient-co-service/wlyy_device/src/main/java/com/yihu/hos/device/model/PatientAimBloodPressure.java
  4. 1 1
      patient-co-service/wlyy_device/src/main/java/com/yihu/hos/device/model/PatientAimBloodSugger.java
  5. 4 4
      patient-co-service/wlyy_device/src/main/java/com/yihu/hos/device/service/DeviceService.java
  6. 3 3
      patient-co-service/wlyy_device/src/main/resources/application.yml
  7. 63 60
      patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/activemq/HealthArtListener.java
  8. 7 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/express/SFExpressService.java
  9. 4 4
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/health/PatientHealthIndexService.java
  10. 8 8
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/scheme/DoctorSchemeService.java
  11. 2 6
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/sign/FamilyContractService.java
  12. 10 10
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/sign/SignWebService.java
  13. 2 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/imm/ChildFamilyImmuneService.java
  14. 31 2
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/imm/ChildInfoService.java
  15. 23 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/express/SFExpressController.java
  16. 6 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/family/FamilyMemberController.java
  17. 32 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/gateway/controller/express/SFExpressApiController.java

+ 194 - 0
common/common-entity/src/main/java/com/yihu/wlyy/entity/imm/ChildInfoVO.java

@ -0,0 +1,194 @@
package com.yihu.wlyy.entity.imm;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.util.Date;
/**
 * @author huangwenjie
 * @date 2018/1/19 16:37
 */
public class ChildInfoVO {
	private String code;
	private String name;                    //新生儿姓名
	private String idcard;                  //新生儿身份证
	private String ssc;                     //新生儿社保卡
	private String photo;                   //新生儿照片
	private String barcode;                 //新生儿免疫接种条码
	private String sex;                     //新生儿性别 男1.0 女2.0
	private String birthday;                //出生日期
	private String age;                     //年龄
	private String weight;                  //出生体重
	private String height;                  //出生身长
	private String deliverOrgname;          //助产医院
	private String deliverOrgcode;          //助产医院CODE
	private String deliverJworgcode;        //助产医院基卫CODE
	
	private String deliverPerson;           //接生人
	private String motherSsc;               //母亲社保卡
	private String motherName;              //母亲姓名
	private String motherIdcard;            //母亲身份证号
	private Date create_time;               //创建时间
	private Integer del;                    //0可用,1已删除
	
	public String getCode() {
		return code;
	}
	
	public void setCode(String code) {
		this.code = code;
	}
	
	public String getName() {
		return name;
	}
	
	public void setName(String name) {
		this.name = name;
	}
	
	public String getIdcard() {
		return idcard;
	}
	
	public void setIdcard(String idcard) {
		this.idcard = idcard;
	}
	
	public String getSsc() {
		return ssc;
	}
	
	public void setSsc(String ssc) {
		this.ssc = ssc;
	}
	
	public String getPhoto() {
		return photo;
	}
	
	public void setPhoto(String photo) {
		this.photo = photo;
	}
	
	public String getBarcode() {
		return barcode;
	}
	
	public void setBarcode(String barcode) {
		this.barcode = barcode;
	}
	
	public String getSex() {
		return sex;
	}
	
	public void setSex(String sex) {
		this.sex = sex;
	}
	
	public String getBirthday() {
		return birthday;
	}
	
	public void setBirthday(String birthday) {
		this.birthday = birthday;
	}
	
	public String getWeight() {
		return weight;
	}
	
	public void setWeight(String weight) {
		this.weight = weight;
	}
	
	public String getHeight() {
		return height;
	}
	
	public void setHeight(String height) {
		this.height = height;
	}
	
	public String getDeliverOrgname() {
		return deliverOrgname;
	}
	
	public void setDeliverOrgname(String deliverOrgname) {
		this.deliverOrgname = deliverOrgname;
	}
	
	public String getDeliverPerson() {
		return deliverPerson;
	}
	
	public void setDeliverPerson(String deliverPerson) {
		this.deliverPerson = deliverPerson;
	}
	
	public String getMotherSsc() {
		return motherSsc;
	}
	
	public void setMotherSsc(String motherSsc) {
		this.motherSsc = motherSsc;
	}
	
	public String getMotherName() {
		return motherName;
	}
	
	public void setMotherName(String motherName) {
		this.motherName = motherName;
	}
	
	public String getMotherIdcard() {
		return motherIdcard;
	}
	
	public void setMotherIdcard(String motherIdcard) {
		this.motherIdcard = motherIdcard;
	}
	
	public Date getCreate_time() {
		return create_time;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
	public void setCreate_time(Date create_time) {
		this.create_time = create_time;
	}
	
	public Integer getDel() {
		return del;
	}
	
	public void setDel(Integer del) {
		this.del = del;
	}
	
	public String getDeliverOrgcode() {
		return deliverOrgcode;
	}
	
	public void setDeliverOrgcode(String deliverOrgcode) {
		this.deliverOrgcode = deliverOrgcode;
	}
	
	public String getDeliverJworgcode() {
		return deliverJworgcode;
	}
	
	public void setDeliverJworgcode(String deliverJworgcode) {
		this.deliverJworgcode = deliverJworgcode;
	}
	
	public String getAge() {
		return age;
	}
	
	public void setAge(String age) {
		this.age = age;
	}
}

+ 1 - 1
patient-co-service/wlyy_device/src/main/java/com/yihu/hos/device/model/DoctorSwitch.java

@ -8,7 +8,7 @@ import java.util.Date;
 * Created by Trick on 2018/1/4.
 */
@Entity
@Table(name = "wlyy_doctor_switch")
@Table(name = "wlyy_doctor_switch",schema = "wlyy",catalog ="wlyy")
public class DoctorSwitch extends IdEntity{
    private String doctor;//关联医生

+ 1 - 1
patient-co-service/wlyy_device/src/main/java/com/yihu/hos/device/model/PatientAimBloodPressure.java

@ -14,7 +14,7 @@ import java.util.Date;
 * @date 2017/9/7 20:07
 */
@Entity
@Table(name = "wlyy_patient_aim_blood_pressure")
@Table(name = "wlyy_patient_aim_blood_pressure",schema = "wlyy",catalog ="wlyy")
public class PatientAimBloodPressure extends IdEntity {
    private String code;
    private String patientcode;

+ 1 - 1
patient-co-service/wlyy_device/src/main/java/com/yihu/hos/device/model/PatientAimBloodSugger.java

@ -12,7 +12,7 @@ import java.util.Date;
 * @date 2017/9/7 20:07
 */
@Entity
@Table(name = "wlyy_patient_aim_blood_sugger")
@Table(name = "wlyy_patient_aim_blood_sugger",schema = "wlyy",catalog ="wlyy")
public class PatientAimBloodSugger extends IdEntity {
    private String code;

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

@ -530,7 +530,7 @@ public class DeviceService extends BaseService{
                }
            }
            //连续3次异常,修改用户为预警状态
            if( (bloodPressureBbnormalCount >=3 || bloodSuggurBbnormalCount >=3) && (patient.getStandardStatus() == null || 0 == patient.getStandardStatus())){
            if( (bloodPressureBbnormalCount >=3 || bloodSuggurBbnormalCount >=3)){
                patient.setStandardStatus(1);
                //1.4.2加入重点关注逻辑
                setTrackPatientByDoctor(patientCode);
@ -549,19 +549,19 @@ public class DeviceService extends BaseService{
            //连续5次正常,修改用户为非预警状态
            if(StringUtils.isNotBlank(patientdisease)){
                if("1".equals(patientdisease)){
                    if(stdbloodPressureBbnormalCount==5&&0 == bloodPressureBbnormalCount && (patient.getStandardStatus() == null || 1 == patient.getStandardStatus())){
                    if(stdbloodPressureBbnormalCount==5&&0 == bloodPressureBbnormalCount){
                        patient.setStandardStatus(0);
                        //1.4.2加入重点关注逻辑
                        cancalTrackPatientByDoctor(patientCode);
                    }
                }else if("2".equals(patientdisease)){
                    if(stdbloodSuggurBbnormalCount==5&&0 == bloodSuggurBbnormalCount && (patient.getStandardStatus() == null || 1 == patient.getStandardStatus())){
                    if(stdbloodSuggurBbnormalCount==5&&0 == bloodSuggurBbnormalCount){
                        patient.setStandardStatus(0);
                        //1.4.2加入重点关注逻辑
                        cancalTrackPatientByDoctor(patientCode);
                    }
                }else if( "1,2".equals(patientdisease) || "2,1".equals(patientdisease)){
                    if(stdbloodSuggurBbnormalCount==5&&stdbloodPressureBbnormalCount==5&&0 == bloodSuggurBbnormalCount && 0 == bloodPressureBbnormalCount && (patient.getStandardStatus() == null || 1 == patient.getStandardStatus())){
                    if(stdbloodSuggurBbnormalCount==5&&stdbloodPressureBbnormalCount==5&&0 == bloodSuggurBbnormalCount && 0 == bloodPressureBbnormalCount){
                        patient.setStandardStatus(0);
                        //1.4.2加入重点关注逻辑
                        cancalTrackPatientByDoctor(patientCode);

+ 3 - 3
patient-co-service/wlyy_device/src/main/resources/application.yml

@ -66,9 +66,9 @@ systemConfig:
spring:
  profiles: test
  datasource:
    url: jdbc:mysql://172.19.103.85:3306/device?useUnicode=true&characterEncoding=utf-8&autoReconnect=true
    username: linzhou
    password: linzhou
    url: jdbc:mysql://172.17.110.160/device?useUnicode=true&characterEncoding=utf-8&autoReconnect=true
    username: ssgg
    password: ssgg
    driverClassName: com.mysql.jdbc.Driver
    maxTotal: 500
    maxIdle: 30

+ 63 - 60
patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/activemq/HealthArtListener.java

@ -47,19 +47,18 @@ public class HealthArtListener implements MessageListener {
    public void onMessage(Message message) {
        try {
            TextMessage textMessage = (TextMessage) message;
            HealthEduArticleES healthEduArticleES = new HealthEduArticleES();
            JSONObject obj = JSONObject.fromObject(textMessage.getText());
            if(obj.get("doctorCode")==null||obj.get("doctorName")==null){
                message.acknowledge();
                return ;
            if(obj.get("patientCode")==null){
                return;
            }
            HealthEduArticleES healthEduArticleES = new HealthEduArticleES();
            healthEduArticleES.setBatchNo(obj.get("batchNo")!=null?obj.get("batchNo").toString():null);
            healthEduArticleES.setPatientCode(obj.get("patientCode")!=null?obj.get("patientCode").toString():null);
            healthEduArticleES.setPatientName(obj.get("patientName")!=null?obj.get("patientName").toString():null);
            healthEduArticleES.setDoctorCode(obj.get("doctorCode")!=null?obj.get("doctorCode").toString():null);
            healthEduArticleES.setDoctorName(obj.get("doctorName")!=null?obj.get("doctorName").toString():null);
            healthEduArticleES.setSendPic(obj.get("sendPic")!=null?obj.get("sendPic").toString():null);
            healthEduArticleES.setSendSex(obj.get("sendSex")!=null?obj.get("sendSex").toString():null);
//            healthEduArticleES.setSendPic(obj.get("sendPic")!=null?obj.get("sendPic").toString():null);
//            healthEduArticleES.setSendSex(obj.get("sendSex")!=null?obj.get("sendSex").toString():null);
//            healthEduArticleES.setAdminTeamCode(obj.get("adminTeamCode")!=null?(Long)obj.get("adminTeamCode"):null);
//            healthEduArticleES.setAdminTeamName(obj.get("adminTeamName")!=null?obj.get("adminTeamCode").toString():null);
            healthEduArticleES.setHospital(obj.get("hospital")!=null?obj.get("hospital").toString():null);
@ -68,28 +67,29 @@ public class HealthArtListener implements MessageListener {
            healthEduArticleES.setTownName(obj.get("townName")!=null?obj.get("townName").toString():null);
//            healthEduArticleES.setCreateTime(obj.get("createTime")!=null?(Date)obj.get("createTime"):null);
            healthEduArticleES.setSendType(obj.get("sendType")!=null?(Integer)obj.get("sendType"):null);
            healthEduArticleES.setSendName(obj.get("sendName")!=null?obj.get("sendName").toString():null);
            healthEduArticleES.setSendLevel(obj.get("sendLevel")!=null?obj.get("sendLevel").toString():null);
            healthEduArticleES.setArticleId(obj.get("articleId")!=null?obj.get("articleId").toString():null);
            healthEduArticleES.setArticleTitle(obj.get("articleTitle")!=null?obj.get("articleTitle").toString():null);
            healthEduArticleES.setArticleCover(obj.get("articleCover")!=null?obj.get("articleCover").toString():null);
            healthEduArticleES.setArticleContent(obj.get("articleContent")!=null?obj.get("articleContent").toString():null);
            healthEduArticleES.setArticleCategoryId(obj.get("articleCategoryId")!=null?obj.get("articleCategoryId").toString():null);
            healthEduArticleES.setFirstLevelCategoryId(obj.get("firstLevelCategoryId")!=null?obj.get("firstLevelCategoryId").toString():null);
            healthEduArticleES.setFirstLevelCategoryName(obj.get("firstLevelCategoryName")!=null?obj.get("firstLevelCategoryName").toString():null);
            healthEduArticleES.setSecondLevelCategoryId(obj.get("secondLevelCategoryId")!=null?obj.get("secondLevelCategoryId").toString():null);
            healthEduArticleES.setSecondLevelCategoryName(obj.get("secondLevelCategoryName")!=null?obj.get("secondLevelCategoryName").toString():null);
//            healthEduArticleES.setFirstLevelCategoryId(obj.get("firstLevelCategoryId")!=null?obj.get("firstLevelCategoryId").toString():null);
//            healthEduArticleES.setFirstLevelCategoryName(obj.get("firstLevelCategoryName")!=null?obj.get("firstLevelCategoryName").toString():null);
//            healthEduArticleES.setSecondLevelCategoryId(obj.get("secondLevelCategoryId")!=null?obj.get("secondLevelCategoryId").toString():null);
//            healthEduArticleES.setSecondLevelCategoryName(obj.get("secondLevelCategoryName")!=null?obj.get("secondLevelCategoryName").toString():null);
            healthEduArticleES.setOperatorId(obj.get("operatorId")!=null?obj.get("operatorId").toString():null);
//            healthEduArticleES.setIsRead(obj.get("isRead")!=null?(Integer)obj.get("isRead"):null);
            healthEduArticleES.setArticleSource(obj.get("articleSource")!=null?obj.get("articleSource").toString():null);
//            healthEduArticleES.setArticleSource(obj.get("articleSource")!=null?obj.get("articleSource").toString():null);
//            healthEduArticleES.setRoleList(obj.get("roleList")!=null?(List)obj.get("roleList"):null);
            healthEduArticleES.setLeaveWords(obj.get("leaveWords")!=null?obj.get("leaveWords").toString():null);
            healthEduArticleES.setCurrentUserRoleCode(obj.get("currentUserRoleCode")!=null?obj.get("currentUserRoleCode").toString():null);
            healthEduArticleES.setCurrentUserRoleLevel(obj.get("currentUserRoleLevel")!=null?obj.get("currentUserRoleLevel").toString():null);
//            healthEduArticleES.setCurrentUserRoleCode(obj.get("currentUserRoleCode")!=null?obj.get("currentUserRoleCode").toString():null);
//            healthEduArticleES.setCurrentUserRoleLevel(obj.get("currentUserRoleLevel")!=null?obj.get("currentUserRoleLevel").toString():null);
            healthEduArticleES.setSendSource(obj.get("sendSource")!=null?(Integer)obj.get("sendSource"):null);
            healthEduArticleES.setAllCount(obj.get("allCount")!=null?(Integer)obj.get("allCount"):null);
//            healthEduArticleES.setAllCount(obj.get("allCount")!=null?(Integer)obj.get("allCount"):null);
//            healthEduArticleES.setReadNumber(obj.get("readNumber")!=null?(Long)obj.get("readNumber"):null);
            healthEduArticleES.setNewArricleFlag(obj.get("newArricleFlag")!=null?(Boolean)obj.get("newArricleFlag"):null);
            healthEduArticleES.setUserType(obj.get("userType")!=null?(Integer) obj.get("userType"):null);
//            healthEduArticleES.setUserType(obj.get("userType")!=null?(Integer) obj.get("userType"):null);
//            HealthEduArticleES one = (HealthEduArticleES)JSONObject.toBean(JSONObject.fromObject(textMessage.getText()),HealthEduArticleES.class);
//            logger.info(jo.toString());
//            System.out.printf(healthEduArticleES.toString());
@ -107,55 +107,58 @@ public class HealthArtListener implements MessageListener {
        String endMsg = "";//"为了您的健康," + doctor.getName() + "医生给您发送了一篇患教文章,请仔细查阅,如有问题,可随时咨询医生。";
//        healthEduArticlePatients.stream().forEach(one -> {
            Patient patient = patientService.findByCode(one.getPatientCode());
            try {
                //卫纪委发送不推IM
                if (1 == one.getSendType()) {
                    consultService.sendMucMessageBySingnType(one.getDoctorCode(), one.getDoctorName(), patient.getCode(), "{\"title\":\"" + one.getArticleTitle() + "\",\"type\":0,\"id\":\"" + one.getId() + "\",\"img\":\"" + one.getArticleCover() + "\",\"content\":\"为了您的健康,我给您发送了一篇文章,请咨询查阅,如有问题,可随时与我沟通\"}", "4", patient.getName());
                    if (StringUtils.isNotBlank(one.getLeaveWords())) {
                        //发送备注
                        consultService.sendMucMessageBySingnType(one.getDoctorCode(), one.getDoctorName(), patient.getCode(), one.getLeaveWords(), ImUtill.CONTENT_TYPE_TEXT, patient.getName());
                    }
                }
                // 推送消息给微信端
                org.json.JSONObject json = new org.json.JSONObject();
                json.put("first", patient.getName() + ",您好! " + one.getSendName() + (one.getSendType()==2 ? "卫计委":"医生") +"给您发来了一篇患教文章");
                json.put("toUser", patient.getCode());
                json.put("article", one.getArticleId() + "");
                json.put("title", one.getArticleTitle());
                json.put("doctorName", one.getDoctorName());
                json.put("represented", patient.getCode());//被代理人
                json.put("date", DateUtil.dateToStrLong(DateUtil.getNowDate()));
                json.put("remark", org.springframework.util.StringUtils.isEmpty(one.getLeaveWords()) ? "  " : one.getLeaveWords());
                json.put("newArricleFlag",one.getNewArricleFlag());
                if (StringUtils.isNotBlank(patient.getOpenid())) {
                    pushMsgTask.putWxMsg(weiXinAccessTokenUtils.getAccessToken(), 9,
                            patient.getOpenid(),
                            patient.getName(),
                            json);
        Patient patient = patientService.findByCode(one.getPatientCode());
        if(patient==null){
            return ;
        }
        try {
            //卫纪委发送不推IM
            if (1 == one.getSendType()) {
                consultService.sendMucMessageBySingnType(one.getDoctorCode(), one.getDoctorName(), one.getPatientCode(), "{\"title\":\"" + one.getArticleTitle() + "\",\"type\":0,\"id\":\"" + one.getId() + "\",\"img\":\"" + one.getArticleCover() + "\",\"content\":\"为了您的健康,我给您发送了一篇文章,请咨询查阅,如有问题,可随时与我沟通\"}", "4", patient.getName());
                if (StringUtils.isNotBlank(one.getLeaveWords())) {
                    //发送备注
                    consultService.sendMucMessageBySingnType(one.getDoctorCode(), one.getDoctorName(), one.getPatientCode(), one.getLeaveWords(), ImUtill.CONTENT_TYPE_TEXT, patient.getName());
                }
                //发送代理人
                JSONArray jsonArray = weiXinOpenIdUtils.getAgentOpenId(patient.getCode(), patient.getOpenid());
                if (jsonArray != null && jsonArray.length() > 0) {
                    for (int i = 0; i < jsonArray.length(); i++) {
                        org.json.JSONObject j = jsonArray.getJSONObject(i);
                        Patient member = (Patient) j.get("member");
                        json.remove("toUser");
                        json.put("toUser", member.getCode());
                        json.remove("first");
                        try {
                            json.put("first", weiXinOpenIdUtils.getTitleMes(patient, j.isNull("relation") ? 1 : j.getInt("relation"), patient.getName()));
                        } catch (Exception e) {
                            e.printStackTrace();
                        }
                        if (StringUtils.isNotBlank(member.getOpenid())) {
                            pushMsgTask.putWxMsg(weiXinAccessTokenUtils.getAccessToken(), 9, member.getOpenid(), patient.getName(), json);
                        }
            }
            // 推送消息给微信端
            org.json.JSONObject json = new org.json.JSONObject();
            json.put("first", one.getPatientName() + ",您好! " + one.getSendName() + (one.getSendType()==2 ? "":"医生") +"给您发来了一篇患教文章");
            json.put("toUser", one.getPatientCode());
            json.put("article", one.getArticleId() + "");
            json.put("title", one.getArticleTitle());
            json.put("doctorName", one.getDoctorName());
            json.put("represented", one.getPatientCode());//被代理人
            json.put("date", DateUtil.dateToStrLong(DateUtil.getNowDate()));
            json.put("remark", org.springframework.util.StringUtils.isEmpty(one.getLeaveWords()) ? "  " : one.getLeaveWords());
            json.put("newArricleFlag",one.getNewArricleFlag());
            if (StringUtils.isNotBlank(patient.getOpenid())) {
                pushMsgTask.putWxMsg(weiXinAccessTokenUtils.getAccessToken(), 9,
                        patient.getOpenid(),
                        patient.getName(),
                        json);
            }
            //发送代理人
            JSONArray jsonArray = weiXinOpenIdUtils.getAgentOpenId(patient.getCode(), patient.getOpenid());
            if (jsonArray != null && jsonArray.length() > 0) {
                for (int i = 0; i < jsonArray.length(); i++) {
                    org.json.JSONObject j = jsonArray.getJSONObject(i);
                    Patient member = (Patient) j.get("member");
                    json.remove("toUser");
                    json.put("toUser", member.getCode());
                    json.remove("first");
                    try {
                        json.put("first", weiXinOpenIdUtils.getTitleMes(patient, j.isNull("relation") ? 1 : j.getInt("relation"), patient.getName()));
                    } catch (Exception e) {
                        e.printStackTrace();
                    }
                    if (StringUtils.isNotBlank(member.getOpenid())) {
                        pushMsgTask.putWxMsg(weiXinAccessTokenUtils.getAccessToken(), 9, member.getOpenid(), patient.getName(), json);
                    }
                }
            } catch (Exception e) {
                logger.error("patient:" + patient.getCode() + "," + e.getMessage());
            }
        } catch (Exception e) {
            logger.error("patient:" + patient.getCode() + "," + e.getMessage());
        }
//        });
    }
}

+ 7 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/express/SFExpressService.java

@ -637,4 +637,11 @@ public class SFExpressService extends BaseService {
        return reslut;
    }
    
    public String getRoutInfosSearch(PrescriptionExpressage sfexpress_obj)throws Exception {
        String xml = SFUtils.getRoutInfos(sfexpress_obj,sf_code);
        String re = this.SFExpressPost(xml);
        
        return xml;
    }
}

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

@ -874,7 +874,7 @@ public class PatientHealthIndexService extends BaseService {
	
	
	    //连续3次异常,修改用户为预警状态
	    if ((bloodPressureBbnormalCount >= 3 || bloodSuggurBbnormalCount >= 3) && (patient.getStandardStatus() == null || 0 == patient.getStandardStatus())) {
	    if ((bloodPressureBbnormalCount >= 3 || bloodSuggurBbnormalCount >= 3)) {
		    p.setStandardStatus(1);
            //1.4.2加入重点关注逻辑
            setTrackPatientByDoctor(patientCode);
@ -893,19 +893,19 @@ public class PatientHealthIndexService extends BaseService {
	    //连续5次正常,修改用户为非预警状态
	    if (StringUtils.isNotBlank(patientdisease)) {
		    if ("1".equals(patientdisease)) {
			    if (stdbloodPressureBbnormalCount==5&&0 == bloodPressureBbnormalCount && (patient.getStandardStatus() == null || 1 == patient.getStandardStatus())) {
			    if (stdbloodPressureBbnormalCount==5&&0 == bloodPressureBbnormalCount) {
				    p.setStandardStatus(0);
                    //1.4.2加入重点关注逻辑
                    cancalTrackPatientByDoctor(patientCode);
			    }
		    } else if ("2".equals(patientdisease)) {
			    if (stdbloodSuggurBbnormalCount==5&&0 == bloodSuggurBbnormalCount && (patient.getStandardStatus() == null || 1 == patient.getStandardStatus())) {
			    if (stdbloodSuggurBbnormalCount==5&&0 == bloodSuggurBbnormalCount) {
				    p.setStandardStatus(0);
                    //1.4.2加入重点关注逻辑
                    cancalTrackPatientByDoctor(patientCode);
			    }
		    } else if ("1,2".equals(patientdisease) || "2,1".equals(patientdisease)) {
			    if (stdbloodPressureBbnormalCount==5&&stdbloodSuggurBbnormalCount==5&&0 == bloodSuggurBbnormalCount && 0 == bloodPressureBbnormalCount && (patient.getStandardStatus() == null || 1 == patient.getStandardStatus())) {
			    if (stdbloodPressureBbnormalCount==5&&stdbloodSuggurBbnormalCount==5&&0 == bloodSuggurBbnormalCount && 0 == bloodPressureBbnormalCount) {
				    p.setStandardStatus(0);
                    //1.4.2加入重点关注逻辑
                    cancalTrackPatientByDoctor(patientCode);

+ 8 - 8
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/scheme/DoctorSchemeService.java

@ -681,7 +681,7 @@ public class DoctorSchemeService extends BaseService{
                " i.type = '1' " +
                " AND i.del = '1' " +
                " AND i.value2 in(1,3,5,7) " +
                " AND i.value1 <= 4 " +
                " AND i.value1 < 4 " +
                " AND i.record_date >='"+startDate+"'" +
                " AND i.record_date <='"+endDate+"'" +
                " AND i.user ='"+patient+"'" +
@ -695,7 +695,7 @@ public class DoctorSchemeService extends BaseService{
                " i.type = '1' " +
                " AND i.del = '1' " +
                " AND i.value2 in(2,4,6) " +
                " AND i.value1 <= 4 " +
                " AND i.value1 < 4 " +
                " AND i.record_date >='"+startDate+"'" +
                " AND i.record_date <='"+endDate+"'" +
                " AND i.user ='"+patient+"'" +
@ -708,7 +708,7 @@ public class DoctorSchemeService extends BaseService{
                " WHERE " +
                " i.del = '1' " +
                " AND i.type = '2' " +
                " AND i.value1 >= 139 " +
                " AND i.value1 > 139 " +
                " AND i.record_date >='"+startDate+"'" +
                " AND i.record_date <='"+endDate+"'" +
                " AND i.user ='"+patient+"'";
@ -731,7 +731,7 @@ public class DoctorSchemeService extends BaseService{
                " WHERE " +
                " i.del = '1' " +
                " AND i.type = '2' " +
                " AND i.value1 <= 90 " +
                " AND i.value1 < 90 " +
                " AND i.record_date >='"+startDate+"'" +
                " AND i.record_date <='"+endDate+"'" +
                " AND i.user ='"+patient+"'";
@ -862,7 +862,7 @@ public class DoctorSchemeService extends BaseService{
                " i.type = '1' " +
                " AND i.del = '1' " +
                " AND i.value2 in(1,3,5,7) " +
                " AND i.value1 <= 4 " +
                " AND i.value1 < 4 " +
                " AND i.record_date >='"+startDate+"'" +
                " AND i.record_date <='"+endDate+"'" +
                " AND i.user IN (SELECT t.patient_code FROM wlyy.wlyy_track_patient t WHERE t.del='1' AND t.doctor_code ='"+doctor+"' AND t.team_code = " +teamCode+")" +
@ -876,7 +876,7 @@ public class DoctorSchemeService extends BaseService{
                " i.type = '1' " +
                " AND i.del = '1' " +
                " AND i.value2 in(2,4,6) " +
                " AND i.value1 <= 4 " +
                " AND i.value1 < 4 " +
                " AND i.record_date >='"+startDate+"'" +
                " AND i.record_date <='"+endDate+"'" +
                " AND i.user IN (SELECT t.patient_code FROM wlyy.wlyy_track_patient t WHERE t.del='1' AND t.doctor_code ='"+doctor+"' AND t.team_code = " +teamCode+")" +
@ -889,7 +889,7 @@ public class DoctorSchemeService extends BaseService{
                " WHERE " +
                " i.del = '1' " +
                " AND i.type = '2' " +
                " AND i.value1 >= 139 " +
                " AND i.value1 > 139 " +
                " AND i.record_date >='"+startDate+"'" +
                " AND i.record_date <='"+endDate+"'" +
                " AND i.user IN (SELECT t.patient_code FROM wlyy.wlyy_track_patient t WHERE t.del='1' AND t.doctor_code ='"+doctor+"' AND t.team_code = " +teamCode+")";
@ -912,7 +912,7 @@ public class DoctorSchemeService extends BaseService{
                " WHERE " +
                " i.del = '1' " +
                " AND i.type = '2' " +
                " AND i.value1 <= 90 " +
                " AND i.value1 < 90 " +
                " AND i.record_date >='"+startDate+"'" +
                " AND i.record_date <='"+endDate+"'" +
                " AND i.user IN (SELECT t.patient_code FROM wlyy.wlyy_track_patient t WHERE t.del='1' AND t.doctor_code ='"+doctor+"' AND t.team_code = " +teamCode+")";

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

@ -3631,11 +3631,7 @@ public class FamilyContractService extends BaseService {
        SignFamily sf = new SignFamily();
        Calendar cal = Calendar.getInstance();
        int year = cal.get(Calendar.YEAR);
        int month = cal.get(Calendar.MONTH) + 1;
        String sql = "SELECT t.doctor,t.team_code teamCode,t.admin_team_code adminTeamCode,t.mobile FROM wlyy_sign_family t WHERE t.patient ='" + patient + "' AND t.status=-4 AND t.expenses_status='1' AND t.sign_year ='" + (year - 1) + "'";
        String sql = "SELECT t.doctor,t.team_code teamCode,t.admin_team_code adminTeamCode,t.mobile FROM wlyy_sign_family t WHERE t.patient ='" + patient + "' AND t.status=-4 AND t.expenses_status='1' AND t.sign_year ='" + (DateUtil.getSignYear() - 1) + "'";
        List<Map<String, Object>> signs = jdbcTemplate.queryForList(sql);
        if (signs == null || signs.size() == 0) {
@ -3744,7 +3740,7 @@ public class FamilyContractService extends BaseService {
        //******************扣费接口**********************/
        sf.setExpensesStatus("0");   //扣费状态 【0未扣费 1已扣费 2已退费】
        sf.setSignYear(year + "");
        sf.setSignYear(DateUtil.getSignYear() + "");
        //sf.setBegin(DateUtil.stringToDate(DateUtil.getSignYear() + "-07-01 00:00:00", "yyyy-MM-dd HH:mmm:ss"));
        sf.setBegin(new Date());

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

@ -2677,21 +2677,21 @@ public class SignWebService extends BaseService {
            //获取智业团队签约上线
            String jwCode = one.getMappingCode();//智业服务团队的code
            try{
                String response = jwSignService.getSickFamilyDoctorSignLimit(jwCode);
                com.alibaba.fastjson.JSONObject json = com.alibaba.fastjson.JSONObject.parseObject(response);
                if(json.getInteger("status")==200){
                    com.alibaba.fastjson.JSONObject data = json.getJSONObject("data");
                    if("1".equals(data.getString("CODE"))&&data.getJSONArray("DATA").size()>0){
                        int sign_limit_number = data.getJSONArray("DATA").getJSONObject(0).getInteger("SIGN_LIMIT_NUMBER");//签约上线
                        limitTotal+=sign_limit_number;
                    }
                }
//                String response = jwSignService.getSickFamilyDoctorSignLimit(jwCode);
//                com.alibaba.fastjson.JSONObject json = com.alibaba.fastjson.JSONObject.parseObject(response);
//                if(json.getInteger("status")==200){
//                    com.alibaba.fastjson.JSONObject data = json.getJSONObject("data");
//                    if("1".equals(data.getString("CODE"))&&data.getJSONArray("DATA").size()>0){
//                        int sign_limit_number = data.getJSONArray("DATA").getJSONObject(0).getInteger("SIGN_LIMIT_NUMBER");//签约上线
//                        limitTotal+=sign_limit_number;
//                    }
//                }
            }catch (Exception e){
                e.printStackTrace();
            }
        }
        re.put("signTotal",signTotal);
        re.put("limitTotal",limitTotal);
        re.put("limitTotal",1500);
        return re;
    }

+ 2 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/imm/ChildFamilyImmuneService.java

@ -81,10 +81,11 @@ public class ChildFamilyImmuneService extends BaseService {
				"b.idcard as idcard," +
				"b.barcode as barcode," +
				"b.sex as sex," +
				"b.birthday as birthday," +
				"b.photo as photo " +
				"from wlyy_child_family_immune a " +
				"join wlyy_child_info b on b.code = a.child_code and b.del = 0 " +
				"where a.del = 0 and a.family_code = "+repUID;
				"where a.del = 0 and a.family_code = '"+repUID+"'";
		
		List<Map<String, Object>> rs = jdbcTemplate.queryForList(sql);
		return rs;

+ 31 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/imm/ChildInfoService.java

@ -2,9 +2,12 @@ package com.yihu.wlyy.service.imm;
import com.alibaba.fastjson.JSONObject;
import com.yihu.wlyy.entity.imm.ChildInfo;
import com.yihu.wlyy.entity.imm.ChildInfoVO;
import com.yihu.wlyy.repository.imm.ChildInfoDao;
import com.yihu.wlyy.service.BaseService;
import com.yihu.wlyy.service.third.guahao.ImmuneService;
import com.yihu.wlyy.util.DateUtil;
import org.apache.http.client.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -81,7 +84,33 @@ public class ChildInfoService extends BaseService {
	 * @param code
	 * @return
	 */
	public ChildInfo getChildInfoByCode(String code) throws Exception{
		return childInfoDao.findByCode(code);
	public ChildInfoVO getChildInfoVOByCode(String code) throws Exception{
		ChildInfo c = childInfoDao.findByCode(code);
		ChildInfoVO vo = new ChildInfoVO();
		vo.setCode(c.getCode());
		
		String birthday = c.getBirthday();
		Date brithdayDate = DateUtil.strToDate(birthday);
		String age = DateUtil.getChildAge(brithdayDate);
		
		vo.setAge(age);
		vo.setBarcode(c.getBarcode());
		vo.setBirthday(c.getBirthday());
		vo.setCreate_time(c.getCreate_time());
		vo.setDel(c.getDel());
		vo.setDeliverJworgcode(c.getDeliverJworgcode());
		vo.setDeliverOrgcode(c.getDeliverOrgcode());
		vo.setDeliverPerson(c.getDeliverPerson());
		vo.setHeight(c.getHeight());
		vo.setWeight(c.getWeight());
		vo.setDeliverOrgname(c.getDeliverOrgname());
		vo.setIdcard(c.getIdcard());
		vo.setName(c.getName());
		vo.setPhoto(c.getPhoto());
		vo.setMotherIdcard(c.getMotherIdcard());
		vo.setMotherName(c.getMotherName());
		vo.setMotherSsc(c.getMotherSsc());
		vo.setSex(c.getSex());
		return vo;
	}
}

+ 23 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/express/SFExpressController.java

@ -204,5 +204,28 @@ public class SFExpressController extends BaseController {
            return error(-1, "查询失败," + e.getMessage());
        }
    }
    
    @RequestMapping(value="/sfrouteserviceSearch",method = RequestMethod.POST)
    @ApiOperation("通过处方编码查询顺丰物流派送记录")
    @ObserverRequired
    public String SFRouteServiceSearch(
            @ApiParam(name="prescriptionCode", value="处方编号") @RequestParam(value = "prescriptionCode",required = true) String prescriptionCode){
        
        try {
            Prescription prescription = prescriptionService.findByCode(prescriptionCode);
//            List<PrescriptionExpressageLog> sfexpresslogList = prescriptionExpressageLogService.findByPrescriptionCode(prescriptionCode);
            PrescriptionExpressage sfexpress_obj = prescriptionExpressageService.findByPrescriptionCode(prescriptionCode);
            
            String result  = sfexpressService.getRoutInfosSearch(sfexpress_obj);
            
            return write(200, "查询成功","data",result);
        }catch (Exception e){
            //日志文件中记录异常信息
            error(e);
            //返回接口异常信息处理结果
            return error(-1, "查询失败,"+e.getMessage());
        }
        
    }
}

+ 6 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/family/FamilyMemberController.java

@ -1,6 +1,7 @@
package com.yihu.wlyy.web.patient.family;
import com.yihu.wlyy.entity.imm.ChildInfo;
import com.yihu.wlyy.entity.imm.ChildInfoVO;
import com.yihu.wlyy.entity.patient.Patient;
import com.yihu.wlyy.entity.patient.PatientFamilyMember;
import com.yihu.wlyy.repository.patient.PatientDao;
@ -493,6 +494,10 @@ public class FamilyMemberController extends WeixinBaseController {
    
            ChildInfo childInfo  = childInfoService.getByBarCode(barCode);
            
            if(StringUtils.isBlank(idcard) || StringUtils.isBlank(ssc)){
                return error(-1, "新生儿身份证和社保卡号不能为空!");
            }
            
            if(!idcard.equals(childInfo.getIdcard()) && StringUtils.isNotBlank(childInfo.getIdcard())){
                return error(-1, "新生儿身份证信息不一致,无法绑定");
            }
@ -535,7 +540,7 @@ public class FamilyMemberController extends WeixinBaseController {
                                  @RequestParam(value = "code", required = true) String code){
        try {
            
            ChildInfo childInfo = childInfoService.getChildInfoByCode(code);
            ChildInfoVO childInfo = childInfoService.getChildInfoVOByCode(code);
            return write(200,"查询成功!","data",childInfo);
        } catch (Exception e) {
            error(e);

+ 32 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/gateway/controller/express/SFExpressApiController.java

@ -1,7 +1,11 @@
package com.yihu.wlyy.web.third.gateway.controller.express;
import com.yihu.wlyy.aop.ObserverRequired;
import com.yihu.wlyy.entity.patient.prescription.Prescription;
import com.yihu.wlyy.entity.patient.prescription.PrescriptionExpressage;
import com.yihu.wlyy.service.app.express.SFExpressService;
import com.yihu.wlyy.service.app.prescription.PrescriptionExpressageService;
import com.yihu.wlyy.service.app.prescription.PrescriptionService;
import com.yihu.wlyy.web.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@ -25,6 +29,12 @@ public class SFExpressApiController extends BaseController {
    @Autowired
    private SFExpressService sfexpressService;
    
    @Autowired
    private PrescriptionExpressageService prescriptionExpressageService;
    
    @Autowired
    private PrescriptionService prescriptionService;
    private String successxml = "<Response service='RoutePushService'><Head>OK</Head></Response>";
@ -46,4 +56,26 @@ public class SFExpressApiController extends BaseController {
            return "<Response service='RoutePushService'><Head>ERR</Head><ERROR code='-1'>系统发生数据错误或运行时异常</ERROR></Response>";
        }
    }
    
    @RequestMapping(value="/sfrouteserviceSearch",method = RequestMethod.POST)
    @ApiOperation("通过处方编码查询顺丰物流派送记录")
    @ObserverRequired
    public String SFRouteServiceSearch(
            @ApiParam(name="prescriptionCode", value="处方编号") @RequestParam(value = "prescriptionCode",required = true) String prescriptionCode){
        
        try {
            Prescription prescription = prescriptionService.findByCode(prescriptionCode);
            PrescriptionExpressage sfexpress_obj = prescriptionExpressageService.findByPrescriptionCode(prescriptionCode);
            
            String result  = sfexpressService.getRoutInfosSearch(sfexpress_obj);
            
            return write(200, "查询成功","data",result);
        }catch (Exception e){
            //日志文件中记录异常信息
            error(e);
            //返回接口异常信息处理结果
            return error(-1, "查询失败,"+e.getMessage());
        }
        
    }
}