Commit 88596271e6d30adea2339d32f14d2c2a07f9dbff

Authored by hujiaqi
1 parent 4dc1b824da

新生儿管理查询

Showing 6 changed files with 448 additions and 0 deletions

platform-dal/src/main/java/com/lyms/platform/query/BabyModelQuery.java View file @ 8859627
... ... @@ -43,6 +43,8 @@
43 43  
44 44 private Date buildDateEnd;
45 45  
  46 + private String dueType;
  47 +
46 48 public Date getBuildDateStart() {
47 49 return buildDateStart;
48 50 }
... ... @@ -443,6 +445,10 @@
443 445 condition = condition.and("vcCardNo", vcCardNo, MongoOper.IS);
444 446 }
445 447  
  448 + if (!StringUtils.isEmpty(dueType)) {
  449 + condition = condition.and("dueType", dueType, MongoOper.IS);
  450 + }
  451 +
446 452 if (null != hospitalIdList) {
447 453 condition = condition.and("hospitalId", hospitalIdList, MongoOper.IN);
448 454 }else if (null != hospitalId) {
... ... @@ -628,6 +634,14 @@
628 634  
629 635 public void setHighRisk(Integer highRisk) {
630 636 this.highRisk = highRisk;
  637 + }
  638 +
  639 + public String getDueType() {
  640 + return dueType;
  641 + }
  642 +
  643 + public void setDueType(String dueType) {
  644 + this.dueType = dueType;
631 645 }
632 646 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/MatDeliverController.java View file @ 8859627
... ... @@ -11,7 +11,9 @@
11 11 import com.lyms.platform.operate.web.request.ChildbirthManagerRequest;
12 12 import com.lyms.platform.operate.web.request.MatDeliverAddRequest;
13 13 import com.lyms.platform.operate.web.request.MatDeliverQueryRequest;
  14 +import com.lyms.platform.operate.web.request.NewBabyManagerRequest;
14 15 import com.lyms.platform.operate.web.result.ChildbirthManagerResult;
  16 +import com.lyms.platform.operate.web.result.NewBabyManagerResult;
15 17 import org.apache.commons.lang.StringUtils;
16 18 import org.springframework.beans.factory.annotation.Autowired;
17 19 import org.springframework.stereotype.Controller;
... ... @@ -122,6 +124,31 @@
122 124 } catch (Exception e) {
123 125 baseListResponse = new BaseListResponse().setErrorcode(ErrorCodeConstants.SYSTEM_ERROR).setErrormsg(ErrorCodeConstants.SYSTEM_ERROR_DESCRIPTION);
124 126 ExceptionUtils.catchException(e, "childbirthManager异常");
  127 + }
  128 + return baseListResponse;
  129 + }
  130 +
  131 + /**
  132 + * @auther HuJiaqi
  133 + * @createTime 2016年12月07日 17时50分
  134 + * @discription 新生儿管理
  135 + */
  136 + @TokenRequired
  137 + @ResponseBody
  138 + @RequestMapping(value = "newBabyManager", method = RequestMethod.POST)
  139 + public BaseListResponse newBabyManager(HttpServletRequest httpServletRequest, @RequestBody NewBabyManagerRequest newBabyManagerRequest) {
  140 + BaseListResponse baseListResponse;
  141 + try {
  142 + newBabyManagerRequest.setOperatorId(((LoginContext) httpServletRequest.getAttribute("loginContext")).getId());
  143 + NewBabyManagerResult newBabyManagerResult = matDeliverFacade.newBabyManager(newBabyManagerRequest);
  144 + if (newBabyManagerResult.getErrorcode() != ErrorCodeConstants.SUCCESS) {
  145 + baseListResponse = new BaseListResponse().setErrorcode(newBabyManagerResult.getErrorcode()).setErrormsg(newBabyManagerResult.getErrormsg());
  146 + return baseListResponse;
  147 + }
  148 + baseListResponse = new BaseListResponse().setErrorcode(newBabyManagerResult.getErrorcode()).setErrormsg(newBabyManagerResult.getErrormsg()).setData(newBabyManagerResult.getData()).setPageInfo(newBabyManagerResult.getPageInfo());
  149 + } catch (Exception e) {
  150 + baseListResponse = new BaseListResponse().setErrorcode(ErrorCodeConstants.SYSTEM_ERROR).setErrormsg(ErrorCodeConstants.SYSTEM_ERROR_DESCRIPTION);
  151 + ExceptionUtils.catchException(e, "newBabyManager异常");
125 152 }
126 153 return baseListResponse;
127 154 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/MatDeliverFacade.java View file @ 8859627
... ... @@ -11,6 +11,7 @@
11 11 import com.lyms.platform.operate.web.request.ChildbirthManagerRequest;
12 12 import com.lyms.platform.operate.web.request.MatDeliverAddRequest;
13 13 import com.lyms.platform.operate.web.request.MatDeliverQueryRequest;
  14 +import com.lyms.platform.operate.web.request.NewBabyManagerRequest;
14 15 import com.lyms.platform.operate.web.result.*;
15 16 import com.lyms.platform.permission.model.Organization;
16 17 import com.lyms.platform.permission.model.Users;
... ... @@ -26,6 +27,7 @@
26 27 import org.springframework.beans.factory.annotation.Autowired;
27 28 import org.springframework.stereotype.Component;
28 29  
  30 +import java.text.SimpleDateFormat;
29 31 import java.util.*;
30 32  
31 33 /**
... ... @@ -948,6 +950,7 @@
948 950 matDeliverQuery.setParentIdList(parentIdList);
949 951 matDeliverQuery.setPage(childbirthManagerRequest.getPage());
950 952 matDeliverQuery.setLimit(childbirthManagerRequest.getLimit());
  953 + matDeliverQuery.setNeed("Need");
951 954 List<MaternalDeliverModel> maternalDeliverModelList = matDeliverService.pageQuery(matDeliverQuery);
952 955 if (maternalDeliverModelList == null || maternalDeliverModelList.size() == 0) {
953 956 // 没有查到,直接抛出
... ... @@ -981,6 +984,54 @@
981 984 childbirthManagerResult.setErrormsg(ErrorCodeConstants.SUCCESS_DESCRIPTION);
982 985 return childbirthManagerResult;
983 986  
  987 + }
  988 +
  989 + public NewBabyManagerResult newBabyManager(NewBabyManagerRequest newBabyManagerRequest) {
  990 + NewBabyManagerResult newBabyManagerResult = new NewBabyManagerResult();
  991 +
  992 + BabyModelQuery babyModelQuery = new BabyModelQuery();
  993 + babyModelQuery.setYn(YnEnums.YES.getId());
  994 + babyModelQuery.setMname(newBabyManagerRequest.getMname());
  995 + babyModelQuery.setMcertNo(newBabyManagerRequest.getMcertNo());
  996 + babyModelQuery.setMphone(newBabyManagerRequest.getMphone());
  997 + babyModelQuery.setBirthStart(DateUtil.parseYMD(newBabyManagerRequest.getBirthStartDate()));
  998 + babyModelQuery.setBirthEnd(DateUtil.parseYMD(newBabyManagerRequest.getBirthEndDate()));
  999 + babyModelQuery.setDueType(newBabyManagerRequest.getDueType());
  1000 + babyModelQuery.setPage(newBabyManagerRequest.getPage());
  1001 + babyModelQuery.setLimit(newBabyManagerRequest.getLimit());
  1002 + // babyModelQuery.setHospitalId(autoMatchFacade.getHospitalId(newBabyManagerRequest.getOperatorId()));
  1003 + babyModelQuery.setNeed("Need");
  1004 +
  1005 + List<BabyModel> babyModelList = babyService.queryBabyWithQuery(babyModelQuery);
  1006 + List<NewBabyManagerQueryModel> newBabyManagerQueryModelList = new ArrayList<>();
  1007 + if (babyModelList != null && babyModelList.size() > 0) {
  1008 + for (BabyModel babyModel : babyModelList) {
  1009 + NewBabyManagerQueryModel newBabyManagerQueryModel = new NewBabyManagerQueryModel();
  1010 + BeanUtils.copy(babyModel, newBabyManagerQueryModel);
  1011 + newBabyManagerQueryModel.setAge(DateUtil.getAge(babyModel.getMbirth()));
  1012 + newBabyManagerQueryModel.setBirthYMD(DateUtil.getyyyy_MM_dd(babyModel.getBirth()));
  1013 + newBabyManagerQueryModel.setBirthHM(new SimpleDateFormat("HH:mm").format(babyModel.getBirth()));
  1014 + newBabyManagerQueryModel.setBirthDays(DateUtil.getDays(babyModel.getBirth(), new Date()));
  1015 + try {
  1016 + MatDeliverQuery matDeliverQuery = new MatDeliverQuery();
  1017 + matDeliverQuery.setYn(YnEnums.YES.getId());
  1018 + matDeliverQuery.setParentId(babyModel.getParentId());
  1019 + List<MaternalDeliverModel> maternalDeliverModelList = matDeliverService.query(matDeliverQuery);
  1020 + if (maternalDeliverModelList != null && maternalDeliverModelList.size() == 1) {
  1021 + newBabyManagerQueryModel.setDeliverDoctor(usersService.getUsers(Integer.valueOf(maternalDeliverModelList.get(0).getDeliverDoctor())).getName());
  1022 + }
  1023 + } catch (Exception e) {
  1024 + // 什么都不干
  1025 + }
  1026 + newBabyManagerQueryModelList.add(newBabyManagerQueryModel);
  1027 + }
  1028 + }
  1029 +
  1030 + newBabyManagerResult.setData(newBabyManagerQueryModelList);
  1031 + newBabyManagerResult.setPageInfo(babyModelQuery.getPageInfo());
  1032 + newBabyManagerResult.setErrorcode(ErrorCodeConstants.SUCCESS);
  1033 + newBabyManagerResult.setErrormsg(ErrorCodeConstants.SUCCESS_DESCRIPTION);
  1034 + return newBabyManagerResult;
984 1035 }
985 1036 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/NewBabyManagerRequest.java View file @ 8859627
  1 +package com.lyms.platform.operate.web.request;
  2 +
  3 +/**
  4 + * @auther HuJiaqi
  5 + * @createTime 2016年12月07日 17时49分
  6 + * @discription
  7 + */
  8 +public class NewBabyManagerRequest extends BasePageQueryRequest {
  9 +
  10 + /**
  11 + * @auther HuJiaqi
  12 + * @createTime 2016年12月08日 09时56分
  13 + * @discription 母亲姓名
  14 + */
  15 + private String mname;
  16 +
  17 + /**
  18 + * @auther HuJiaqi
  19 + * @createTime 2016年12月08日 09时56分
  20 + * @discription 母亲证件号
  21 + */
  22 + private String mcertNo;
  23 +
  24 + /**
  25 + * @auther HuJiaqi
  26 + * @createTime 2016年12月08日 09时57分
  27 + * @discription 母亲联系方式
  28 + */
  29 + private String mphone;
  30 +
  31 + /**
  32 + * @auther HuJiaqi
  33 + * @createTime 2016年12月08日 09时57分
  34 + * @discription 分娩日期开始
  35 + */
  36 + private String birthStartDate;
  37 +
  38 + /**
  39 + * @auther HuJiaqi
  40 + * @createTime 2016年12月08日 09时57分
  41 + * @discription 分娩日期结束
  42 + */
  43 + private String birthEndDate;
  44 +
  45 + /**
  46 + * @auther HuJiaqi
  47 + * @createTime 2016年12月08日 09时58分
  48 + * @discription 分娩方式
  49 + */
  50 + private String dueType;
  51 +
  52 + // TODO 条码号暂时不管
  53 +
  54 + private Integer operatorId;
  55 +
  56 + public String getMname() {
  57 + return mname;
  58 + }
  59 +
  60 + public void setMname(String mname) {
  61 + this.mname = mname;
  62 + }
  63 +
  64 + public String getMcertNo() {
  65 + return mcertNo;
  66 + }
  67 +
  68 + public void setMcertNo(String mcertNo) {
  69 + this.mcertNo = mcertNo;
  70 + }
  71 +
  72 + public String getMphone() {
  73 + return mphone;
  74 + }
  75 +
  76 + public void setMphone(String mphone) {
  77 + this.mphone = mphone;
  78 + }
  79 +
  80 + public String getBirthStartDate() {
  81 + return birthStartDate;
  82 + }
  83 +
  84 + public void setBirthStartDate(String birthStartDate) {
  85 + this.birthStartDate = birthStartDate;
  86 + }
  87 +
  88 + public String getBirthEndDate() {
  89 + return birthEndDate;
  90 + }
  91 +
  92 + public void setBirthEndDate(String birthEndDate) {
  93 + this.birthEndDate = birthEndDate;
  94 + }
  95 +
  96 + public String getDueType() {
  97 + return dueType;
  98 + }
  99 +
  100 + public void setDueType(String dueType) {
  101 + this.dueType = dueType;
  102 + }
  103 +
  104 + public Integer getOperatorId() {
  105 + return operatorId;
  106 + }
  107 +
  108 + public void setOperatorId(Integer operatorId) {
  109 + this.operatorId = operatorId;
  110 + }
  111 +}
platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/NewBabyManagerQueryModel.java View file @ 8859627
  1 +package com.lyms.platform.operate.web.result;
  2 +
  3 +/**
  4 + * @auther HuJiaqi
  5 + * @createTime 2016年12月07日 17时49分
  6 + * @discription
  7 + */
  8 +public class NewBabyManagerQueryModel {
  9 +
  10 + /**
  11 + * @auther HuJiaqi
  12 + * @createTime 2016年12月08日 10时51分
  13 + * @discription 分娩日期
  14 + */
  15 + private String birthYMD;
  16 +
  17 + /**
  18 + * @auther HuJiaqi
  19 + * @createTime 2016年12月08日 15时39分
  20 + * @discription
  21 + */
  22 + private String birthHM;
  23 +
  24 + /**
  25 + * @auther HuJiaqi
  26 + * @createTime 2016年12月08日 10时54分
  27 + * @discription 姓名
  28 + */
  29 + private String name;
  30 +
  31 + /**
  32 + * @auther HuJiaqi
  33 + * @createTime 2016年12月08日 10时54分
  34 + * @discription 性别
  35 + */
  36 + private Integer sex;
  37 +
  38 + /**
  39 + * @auther HuJiaqi
  40 + * @createTime 2016年12月08日 10时55分
  41 + * @discription 出生天数
  42 + */
  43 + private Integer birthDays;
  44 +
  45 + /**
  46 + * @auther HuJiaqi
  47 + * @createTime 2016年12月08日 10时56分
  48 + * @discription 是否高危
  49 + */
  50 + private Integer highRisk;
  51 +
  52 + /**
  53 + * @auther HuJiaqi
  54 + * @createTime 2016年12月08日 10时56分
  55 + * @discription 分娩孕周
  56 + */
  57 + private Integer dueWeek;
  58 +
  59 + /**
  60 + * @auther HuJiaqi
  61 + * @createTime 2016年12月08日 10时56分
  62 + * @discription 分娩方式
  63 + */
  64 + private String dueType;
  65 +
  66 + /**
  67 + * @auther HuJiaqi
  68 + * @createTime 2016年12月08日 10时56分
  69 + * @discription 出生身长,单位厘米
  70 + */
  71 + private String babyHeight;
  72 +
  73 + /**
  74 + * @auther HuJiaqi
  75 + * @createTime 2016年12月08日 10时57分
  76 + * @discription 出生体重,单位克
  77 + */
  78 + private String babyWeight;
  79 +
  80 + /**
  81 + * @auther HuJiaqi
  82 + * @createTime 2016年12月08日 10时57分
  83 + * @discription 母亲姓名
  84 + */
  85 + private String mname;
  86 +
  87 + /**
  88 + * @auther HuJiaqi
  89 + * @createTime 2016年12月08日 10时57分
  90 + * @discription 母亲年龄
  91 + */
  92 + private Integer age;
  93 +
  94 + /**
  95 + * @auther HuJiaqi
  96 + * @createTime 2016年12月08日 10时57分
  97 + * @discription 母亲证件号
  98 + */
  99 + private String mcertNo;
  100 +
  101 + /**
  102 + * @auther HuJiaqi
  103 + * @createTime 2016年12月08日 10时57分
  104 + * @discription 联系方式
  105 + */
  106 + private String mphone;
  107 +
  108 + /**
  109 + * @auther HuJiaqi
  110 + * @createTime 2016年12月08日 10时57分
  111 + * @discription 接生医生
  112 + */
  113 + private String deliverDoctor;
  114 +
  115 + public String getBirthYMD() {
  116 + return birthYMD;
  117 + }
  118 +
  119 + public void setBirthYMD(String birthYMD) {
  120 + this.birthYMD = birthYMD;
  121 + }
  122 +
  123 + public String getBirthHM() {
  124 + return birthHM;
  125 + }
  126 +
  127 + public void setBirthHM(String birthHM) {
  128 + this.birthHM = birthHM;
  129 + }
  130 +
  131 + public String getName() {
  132 + return name;
  133 + }
  134 +
  135 + public void setName(String name) {
  136 + this.name = name;
  137 + }
  138 +
  139 + public Integer getSex() {
  140 + return sex;
  141 + }
  142 +
  143 + public void setSex(Integer sex) {
  144 + this.sex = sex;
  145 + }
  146 +
  147 + public Integer getBirthDays() {
  148 + return birthDays;
  149 + }
  150 +
  151 + public void setBirthDays(Integer birthDays) {
  152 + this.birthDays = birthDays;
  153 + }
  154 +
  155 + public Integer getHighRisk() {
  156 + return highRisk;
  157 + }
  158 +
  159 + public void setHighRisk(Integer highRisk) {
  160 + this.highRisk = highRisk;
  161 + }
  162 +
  163 + public Integer getDueWeek() {
  164 + return dueWeek;
  165 + }
  166 +
  167 + public void setDueWeek(Integer dueWeek) {
  168 + this.dueWeek = dueWeek;
  169 + }
  170 +
  171 + public String getDueType() {
  172 + return dueType;
  173 + }
  174 +
  175 + public void setDueType(String dueType) {
  176 + this.dueType = dueType;
  177 + }
  178 +
  179 + public String getBabyHeight() {
  180 + return babyHeight;
  181 + }
  182 +
  183 + public void setBabyHeight(String babyHeight) {
  184 + this.babyHeight = babyHeight;
  185 + }
  186 +
  187 + public String getBabyWeight() {
  188 + return babyWeight;
  189 + }
  190 +
  191 + public void setBabyWeight(String babyWeight) {
  192 + this.babyWeight = babyWeight;
  193 + }
  194 +
  195 + public String getMname() {
  196 + return mname;
  197 + }
  198 +
  199 + public void setMname(String mname) {
  200 + this.mname = mname;
  201 + }
  202 +
  203 + public Integer getAge() {
  204 + return age;
  205 + }
  206 +
  207 + public void setAge(Integer age) {
  208 + this.age = age;
  209 + }
  210 +
  211 + public String getMcertNo() {
  212 + return mcertNo;
  213 + }
  214 +
  215 + public void setMcertNo(String mcertNo) {
  216 + this.mcertNo = mcertNo;
  217 + }
  218 +
  219 + public String getMphone() {
  220 + return mphone;
  221 + }
  222 +
  223 + public void setMphone(String mphone) {
  224 + this.mphone = mphone;
  225 + }
  226 +
  227 + public String getDeliverDoctor() {
  228 + return deliverDoctor;
  229 + }
  230 +
  231 + public void setDeliverDoctor(String deliverDoctor) {
  232 + this.deliverDoctor = deliverDoctor;
  233 + }
  234 +}
platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/NewBabyManagerResult.java View file @ 8859627
  1 +package com.lyms.platform.operate.web.result;
  2 +
  3 +import com.lyms.platform.common.result.BaseListResponse;
  4 +
  5 +/**
  6 + * @auther HuJiaqi
  7 + * @createTime 2016年12月07日 17时49分
  8 + * @discription
  9 + */
  10 +public class NewBabyManagerResult extends BaseListResponse {
  11 +}