Przeglądaj źródła

新生儿详情增加年龄字段

huangwenjie 7 lat temu
rodzic
commit
8634028942

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

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