Explorar o código

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

trick9191 %!s(int64=7) %!d(string=hai) anos
pai
achega
301913e72a

+ 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;
	}
}

+ 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());
        }
//        });
    }
}

+ 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;
	}
}

+ 2 - 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;
@ -539,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);