Commit ca14855e405083eddcb97d02543c66342003b6ac

Authored by liquanyu
1 parent fd36e8f5b5

查询孕妇建档信息

Showing 5 changed files with 84 additions and 17 deletions

platform-common/src/main/java/com/lyms/platform/common/utils/PropertiesUtils.java View file @ ca14855
  1 +package com.lyms.platform.common.utils;
  2 +
  3 +import org.springframework.core.io.ClassPathResource;
  4 +import org.springframework.core.io.support.EncodedResource;
  5 +import org.springframework.core.io.support.PropertiesLoaderUtils;
  6 +
  7 +import java.io.IOException;
  8 +import java.util.Properties;
  9 +
  10 +/**
  11 + * Created by Administrator on 2016/8/2.
  12 + */
  13 +public class PropertiesUtils {
  14 +
  15 + private static Properties props = new Properties();
  16 +
  17 + private static final String FILE_PATH = "config.properties";
  18 +
  19 + static{
  20 + try {
  21 + props = PropertiesLoaderUtils.loadProperties(new EncodedResource(new ClassPathResource(FILE_PATH), "UTF8"));
  22 + } catch (IOException e) {
  23 +
  24 + }
  25 + }
  26 +
  27 + /**
  28 + *
  29 + * @param propertyKey 键名称
  30 + * @return 键值
  31 + */
  32 + public static String getPropertyValue(String propertyKey){
  33 + String propertyValue = "";
  34 + if(StringUtils.isNotEmpty(propertyKey)){
  35 + propertyValue = props.getProperty(propertyKey);
  36 + if (StringUtils.isNotEmpty(propertyValue))
  37 + {
  38 + propertyValue = propertyValue.trim();
  39 + }
  40 + }
  41 + return propertyValue;
  42 + }
  43 +}
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BookbuildingController.java View file @ ca14855
... ... @@ -40,19 +40,6 @@
40 40  
41 41 @Autowired
42 42 private AntenatalExaminationFacade antenatalExaminationFacade;
43   - /**
44   - * 查询产妇信息
45   - * @param bookbuildingQueryRequest
46   - * @return
47   - */
48   - @ResponseBody
49   - @RequestMapping(method = RequestMethod.GET, value = "/getBookbuildingInfo")
50   - public BaseListResponse getBookbuildingInfo(@Valid BookbuildingQueryRequest bookbuildingQueryRequest) {
51   - BaseListResponse baseListResponse = new BaseListResponse();
52   - baseListResponse.setErrorcode(ErrorCodeConstants.SUCCESS);
53   - baseListResponse.setErrormsg("成功");
54   - return baseListResponse;
55   - }
56 43  
57 44  
58 45 /**
... ... @@ -139,6 +126,17 @@
139 126 @ResponseBody
140 127 public BaseObjectResponse getBabyBuildBaseConfig(){
141 128 return bookbuildingFacade.getYunBuildBaseConfig();
  129 + }
  130 +
  131 + /**
  132 + *查询孕妇建档基本信息
  133 + * @return
  134 + */
  135 + @RequestMapping(value = "/queryYunBuildInfo", method = RequestMethod.GET)
  136 + @ResponseBody
  137 + public BaseObjectResponse queryYunBuildInfo(@RequestParam(required = false) String cardNo,@RequestParam(required = false) String phone){
  138 + BaseObjectResponse objectResponse = bookbuildingFacade.queryYunBuildInfo(cardNo,phone);
  139 + return objectResponse;
142 140 }
143 141  
144 142 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyBookbuildingFacade.java View file @ ca14855
... ... @@ -6,10 +6,7 @@
6 6 import com.lyms.platform.common.result.BaseListResponse;
7 7 import com.lyms.platform.common.result.BaseObjectResponse;
8 8 import com.lyms.platform.common.result.BaseResponse;
9   -import com.lyms.platform.common.utils.DateUtil;
10   -import com.lyms.platform.common.utils.JsonUtil;
11   -import com.lyms.platform.common.utils.StringUtils;
12   -import com.lyms.platform.common.utils.SystemConfig;
  9 +import com.lyms.platform.common.utils.*;
13 10 import com.lyms.platform.operate.web.request.*;
14 11 import com.lyms.platform.operate.web.result.*;
15 12 import com.lyms.platform.permission.model.Organization;
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BookbuildingFacade.java View file @ ca14855
... ... @@ -694,5 +694,33 @@
694 694 yunBookbuildingService.deletePregnantById(id);
695 695 return new BaseResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功");
696 696 }
  697 +
  698 + /**
  699 + * 查询孕妇基本信息 通过手机号码或者身份证
  700 + * @param cardNo
  701 + * @param phone
  702 + * @return
  703 + */
  704 + public BaseObjectResponse queryYunBuildInfo(String cardNo, String phone) {
  705 + Patients pat = null;
  706 + if (StringUtils.isNotEmpty(cardNo) || StringUtils.isNotEmpty(phone))
  707 + {
  708 + PatientsQuery patientsQuery = new PatientsQuery();
  709 + patientsQuery.setYn(YnEnums.YES.getId());
  710 + patientsQuery.setCardNo(cardNo);
  711 + patientsQuery.setPhone(phone);
  712 +
  713 + List<Patients> patients = yunBookbuildingService.queryPregnantWithQuery(patientsQuery);
  714 + if (CollectionUtils.isNotEmpty(patients))
  715 + {
  716 + pat = patients.get(0);
  717 + }
  718 + }
  719 + BaseObjectResponse objectResponse = new BaseObjectResponse();
  720 + objectResponse.setData(pat);
  721 + objectResponse.setErrorcode(ErrorCodeConstants.SUCCESS);
  722 + objectResponse.setErrormsg("成功");
  723 + return objectResponse;
  724 + }
697 725 }
platform-operate-api/src/main/resources/config.properties View file @ ca14855
  1 +url=test.url