Commit 098f2fec3c1d66afa9511c3200a4cfb92b0b6443

Authored by hujiaqi
1 parent 90c0f61838

修改儿童档案插入-添加高危原因

修改儿童档案查询-添加查询条件 建档医院和居住地

Showing 6 changed files with 142 additions and 34 deletions

platform-dal/src/main/java/com/lyms/platform/pojo/BabyModel.java View file @ 098f2fe
1 1 package com.lyms.platform.pojo;
2 2  
3   -import java.util.Date;
4   -import java.util.List;
5   -
  3 +import com.lyms.platform.common.result.BaseModel;
6 4 import org.springframework.data.mongodb.core.mapping.Document;
7 5 import org.springframework.data.mongodb.core.mapping.Field;
8 6  
9   -import com.lyms.platform.common.result.BaseModel;
  7 +import java.util.Date;
  8 +import java.util.List;
10 9  
11 10 /**
12 11 * 新生儿模型
... ... @@ -168,7 +167,7 @@
168 167 private Date vipEndTime;
169 168  
170 169 //高危因素
171   - //private String highRiskReason;
  170 + private String highRiskReason;
172 171  
173 172 //诊断
174 173 private String diagnose;
... ... @@ -758,13 +757,13 @@
758 757 this.week = week;
759 758 }
760 759  
761   -// public String getHighRiskReason() {
762   -// return highRiskReason;
763   -// }
764   -//
765   -// public void setHighRiskReason(String highRiskReason) {
766   -// this.highRiskReason = highRiskReason;
767   -// }
  760 + public String getHighRiskReason() {
  761 + return highRiskReason;
  762 + }
  763 +
  764 + public void setHighRiskReason(String highRiskReason) {
  765 + this.highRiskReason = highRiskReason;
  766 + }
768 767  
769 768  
770 769 public Integer getMalformation() {
platform-dal/src/main/java/com/lyms/platform/query/BabyModelQuery.java View file @ 098f2fe
... ... @@ -6,10 +6,8 @@
6 6 import com.lyms.platform.common.dao.operator.MongoOper;
7 7 import com.lyms.platform.common.dao.operator.MongoQuery;
8 8 import com.lyms.platform.common.utils.StringUtils;
9   -import org.bson.types.ObjectId;
10 9 import org.springframework.data.mongodb.core.query.Criteria;
11 10  
12   -import java.util.Arrays;
13 11 import java.util.Date;
14 12 import java.util.List;
15 13  
... ... @@ -197,6 +195,8 @@
197 195  
198 196 private String hospitalId;
199 197  
  198 + private List<String> hospitalIdList;
  199 +
200 200 private Integer serviceType;
201 201  
202 202 //诊断
... ... @@ -291,6 +291,15 @@
291 291 this.hospitalId = hospitalId;
292 292 }
293 293  
  294 +
  295 + public List<String> getHospitalIdList() {
  296 + return hospitalIdList;
  297 + }
  298 +
  299 + public void setHospitalIdList(List<String> hospitalIdList) {
  300 + this.hospitalIdList = hospitalIdList;
  301 + }
  302 +
294 303 public String getName() {
295 304 return name;
296 305 }
... ... @@ -408,8 +417,8 @@
408 417 condition = condition.and("vcCardNo", vcCardNo, MongoOper.IS);
409 418 }
410 419  
411   - if (null != hospitalId) {
412   - condition = condition.and("hospitalId", hospitalId, MongoOper.IS);
  420 + if (null != hospitalIdList) {
  421 + condition = condition.and("hospitalId", hospitalIdList, MongoOper.IN);
413 422 }
414 423 if (!StringUtils.isEmpty(lastDiagnose)) {
415 424 condition = condition.and("lastDiagnose", lastDiagnose, MongoOper.IN);
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BabyBuildController.java View file @ 098f2fe
... ... @@ -10,7 +10,13 @@
10 10 import com.lyms.platform.common.result.BaseResponse;
11 11 import com.lyms.platform.common.utils.StringUtils;
12 12 import com.lyms.platform.operate.web.facade.BabyBookbuildingFacade;
13   -import com.lyms.platform.operate.web.request.*;
  13 +import com.lyms.platform.operate.web.request.BabyBookbuildingAddRequest;
  14 +import com.lyms.platform.operate.web.request.BabyGuideSmsequest;
  15 +import com.lyms.platform.operate.web.request.BabyManageRequest;
  16 +import com.lyms.platform.operate.web.request.BookbuildingQueryRequest;
  17 +import com.lyms.platform.operate.web.result.QueryHospitalListRequest;
  18 +import com.lyms.platform.operate.web.result.QueryHospitalListResult;
  19 +import org.apache.log4j.Logger;
14 20 import org.springframework.beans.factory.annotation.Autowired;
15 21 import org.springframework.stereotype.Controller;
16 22 import org.springframework.web.bind.annotation.*;
... ... @@ -29,6 +35,7 @@
29 35 @Controller
30 36 public class BabyBuildController extends BaseController {
31 37  
  38 + private Logger log = Logger.getLogger(this.getClass());
32 39  
33 40 @Autowired
34 41 private BabyBookbuildingFacade babyBookbuildingFacade;
... ... @@ -179,7 +186,10 @@
179 186 @RequestParam(value = "diagnose", required = false) String diagnose,
180 187 @RequestParam(value = "dateRange", required = false) String dateRange,
181 188 @RequestParam("page") Integer page,
182   - @RequestParam("limit") Integer limit){
  189 + @RequestParam("limit") Integer limit,
  190 +
  191 + @RequestParam(value = "areaId",required = false) String areaId,
  192 + @RequestParam(value = "hospitalId",required = false) String hospitalId){
183 193 LoginContext loginState = (LoginContext) httpServletRequest.getAttribute("loginContext");
184 194 BabyManageRequest request = new BabyManageRequest();
185 195 request.setBcardNo(bcardNo);
... ... @@ -198,6 +208,12 @@
198 208 request.setPage(page);
199 209 request.setServiceStatus(serviceStatus);
200 210 request.setDateRange(dateRange);
  211 +
  212 + // 区/县
  213 + request.setAreaId(areaId);
  214 + // 建档医院
  215 + request.setHospitalId(hospitalId);
  216 +
201 217 return babyBookbuildingFacade.queryBabyList(request,loginState.getId());
202 218 }
203 219  
... ... @@ -298,5 +314,35 @@
298 314 public BaseResponse queryYunBaseInfo(@RequestParam(value = "cardNo", required = false) String cardNo,@RequestParam(value = "pid", required = false) String pid) {
299 315 return babyBookbuildingFacade.queryYunBaseInfo(cardNo,pid);
300 316 }
  317 +
  318 + /**
  319 + * @auther HuJiaqi
  320 + * @createTime 2016年11月24日 17时01分
  321 + * @discription 医院列表
  322 + */
  323 + @RequestMapping(method = RequestMethod.GET, value = "/queryHospitalList")
  324 + @ResponseBody
  325 + public BaseResponse queryHospitalList(@RequestParam(value = "provinceId", required = false) String provinceId,
  326 + @RequestParam(value = "cityId", required = false) String cityId,
  327 + @RequestParam(value = "areaId", required = false) String areaId) {
  328 + BaseListResponse baseListResponse;
  329 + try {
  330 + QueryHospitalListRequest queryHospitalListRequest = new QueryHospitalListRequest();
  331 + queryHospitalListRequest.setProvinceId(provinceId);
  332 + queryHospitalListRequest.setCityId(cityId);
  333 + queryHospitalListRequest.setAreaId(areaId);
  334 + QueryHospitalListResult queryHospitalListResult = babyBookbuildingFacade.queryHospitalList(queryHospitalListRequest);
  335 + if (queryHospitalListResult.getErrorcode() != ErrorCodeConstants.SUCCESS) {
  336 + baseListResponse = new BaseListResponse().setErrorcode(queryHospitalListResult.getErrorcode()).setErrormsg(queryHospitalListResult.getErrormsg());
  337 + return baseListResponse;
  338 + }
  339 + baseListResponse = new BaseListResponse().setErrorcode(queryHospitalListResult.getErrorcode()).setErrormsg(queryHospitalListResult.getErrormsg()).setData(queryHospitalListResult.getData()).setPageInfo(queryHospitalListResult.getPageInfo());
  340 + } catch (Exception e) {
  341 + baseListResponse = new BaseListResponse().setErrorcode(ErrorCodeConstants.SYSTEM_ERROR).setErrormsg(ErrorCodeConstants.SYSTEM_ERROR_DESCRIPTION);
  342 + log.error("queryHospitalList异常:" + e);
  343 + }
  344 + return baseListResponse;
  345 + }
  346 +
301 347 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyBookbuildingFacade.java View file @ 098f2fe
... ... @@ -10,7 +10,6 @@
10 10 import com.lyms.platform.common.result.BaseObjectResponse;
11 11 import com.lyms.platform.common.result.BaseResponse;
12 12 import com.lyms.platform.common.utils.*;
13   -import com.lyms.platform.common.utils.StringUtils;
14 13 import com.lyms.platform.operate.web.request.*;
15 14 import com.lyms.platform.operate.web.result.*;
16 15 import com.lyms.platform.operate.web.utils.MessageCenterService;
... ... @@ -22,7 +21,6 @@
22 21 import com.lyms.platform.pojo.*;
23 22 import com.lyms.platform.query.*;
24 23 import org.apache.commons.collections.CollectionUtils;
25   -import org.apache.commons.lang.*;
26 24 import org.springframework.beans.factory.annotation.Autowired;
27 25 import org.springframework.data.domain.Sort;
28 26 import org.springframework.stereotype.Component;
29 27  
30 28  
31 29  
... ... @@ -1433,19 +1431,33 @@
1433 1431 */
1434 1432 public BaseListResponse queryBabyList(BabyManageRequest request, Integer userId) {
1435 1433  
1436   - String hospitalId = "";
  1434 + // HuJiaqi注释开始
  1435 + // String hospitalId = "";
1437 1436  
1438 1437  
1439 1438 //得到当前登录的医院id
1440   - if (userId != null) {
1441   - Users dbuser = usersService.getUsers(userId);
1442   - if (dbuser != null) {
1443   - hospitalId = String.valueOf(dbuser.getOrgId());
  1439 + // if (userId != null) {
  1440 + // Users dbuser = usersService.getUsers(userId);
  1441 + // if (dbuser != null) {
  1442 + // hospitalId = String.valueOf(dbuser.getOrgId());
  1443 + // }
  1444 + // }
  1445 + // HuJiaqi注释结束
  1446 + // 更改原因-从一个医院更改为list
  1447 + List<String> hospitalIdList = new ArrayList<>();
  1448 + if(request.getHospitalId()==null){
  1449 + // 没有传入医院,取所有有权限的医院
  1450 + List<Organization> organizationList = organizationService.queryHospital();
  1451 + for (Organization organization : organizationList) {
  1452 + hospitalIdList.add(String.valueOf(organization.getId()));
1444 1453 }
  1454 + }else{
  1455 + // 传入了医院,取传入的医院
  1456 + hospitalIdList.add(request.getHospitalId());
1445 1457 }
1446 1458  
1447 1459 BabyModelQuery babyQuery = new BabyModelQuery();
1448   - babyQuery.setHospitalId(String.valueOf(hospitalId));
  1460 + babyQuery.setHospitalIdList(hospitalIdList);
1449 1461 List<BabyModel> models = getBabayListByCondition(request, true, babyQuery);
1450 1462 List<BabyManageListResult> list = new ArrayList<>();
1451 1463 if (CollectionUtils.isNotEmpty(models)) {
1452 1464  
... ... @@ -1604,8 +1616,11 @@
1604 1616 }
1605 1617 babyQuery.setBuildDateEnd(date);
1606 1618 }
1607   - }
  1619 + }
1608 1620  
  1621 + // 区/县
  1622 + babyQuery.setAreaId(request.getAreaId());
  1623 +
1609 1624 List<BabyModel> models = babyBookbuildingService.queryBabyBuildByCond(babyQuery, "modified", Sort.Direction.DESC);
1610 1625  
1611 1626 return models;
... ... @@ -1859,6 +1874,25 @@
1859 1874 } catch (IOException e) {
1860 1875 e.printStackTrace();
1861 1876 }
  1877 + }
  1878 +
  1879 + public QueryHospitalListResult queryHospitalList(QueryHospitalListRequest queryHospitalListRequest) {
  1880 + QueryHospitalListResult queryHospitalListResult = new QueryHospitalListResult();
  1881 + OrganizationQuery organizationQuery = new OrganizationQuery();
  1882 + BeanUtils.copy(queryHospitalListRequest,organizationQuery);
  1883 + List<Organization> organizationList = organizationService.queryOrganization(organizationQuery);
  1884 + List<HospitalQueryModel> hospitalQueryModelList = new ArrayList<>();
  1885 + if (organizationList!=null&&organizationList.size()>0){
  1886 + for (Organization organization : organizationList) {
  1887 + HospitalQueryModel hospitalQueryModel = new HospitalQueryModel();
  1888 + BeanUtils.copy(organization,hospitalQueryModel);
  1889 + hospitalQueryModelList.add(hospitalQueryModel);
  1890 + }
  1891 + }
  1892 + queryHospitalListResult.setData(hospitalQueryModelList);
  1893 + queryHospitalListResult.setErrorcode(ErrorCodeConstants.SUCCESS);
  1894 + queryHospitalListResult.setErrormsg(ErrorCodeConstants.SUCCESS_DESCRIPTION);
  1895 + return queryHospitalListResult;
1862 1896 }
1863 1897 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/BabyBookbuildingAddRequest.java View file @ 098f2fe
... ... @@ -149,7 +149,7 @@
149 149 private Integer expType;
150 150  
151 151 //高危因素
152   - //private String highRiskReason;
  152 + private String highRiskReason;
153 153  
154 154 //诊断
155 155 private List diagnose;
156 156  
... ... @@ -502,13 +502,13 @@
502 502 this.mremark = mremark;
503 503 }
504 504  
505   -// public String getHighRiskReason() {
506   -// return highRiskReason;
507   -// }
  505 + public String getHighRiskReason() {
  506 + return highRiskReason;
  507 + }
508 508  
509   -// public void setHighRiskReason(String highRiskReason) {
510   -// this.highRiskReason = highRiskReason;
511   -// }
  509 + public void setHighRiskReason(String highRiskReason) {
  510 + this.highRiskReason = highRiskReason;
  511 + }
512 512  
513 513  
514 514 public Integer getMalformation() {
platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/BabyManageRequest.java View file @ 098f2fe
... ... @@ -58,6 +58,10 @@
58 58  
59 59 private String dateRange;
60 60  
  61 + private String areaId;
  62 +
  63 + private String hospitalId;
  64 +
61 65 public String getDateRange() {
62 66 return dateRange;
63 67 }
... ... @@ -186,6 +190,22 @@
186 190  
187 191 public void setExpVip(Integer expVip) {
188 192 this.expVip = expVip;
  193 + }
  194 +
  195 + public String getAreaId() {
  196 + return areaId;
  197 + }
  198 +
  199 + public void setAreaId(String areaId) {
  200 + this.areaId = areaId;
  201 + }
  202 +
  203 + public String getHospitalId() {
  204 + return hospitalId;
  205 + }
  206 +
  207 + public void setHospitalId(String hospitalId) {
  208 + this.hospitalId = hospitalId;
189 209 }
190 210 }