From ca14855e405083eddcb97d02543c66342003b6ac Mon Sep 17 00:00:00 2001 From: liquanyu Date: Tue, 2 Aug 2016 15:00:42 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E5=AD=95=E5=A6=87=E5=BB=BA?= =?UTF-8?q?=E6=A1=A3=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../platform/common/utils/PropertiesUtils.java | 43 ++++++++++++++++++++++ .../web/controller/BookbuildingController.java | 24 ++++++------ .../operate/web/facade/BabyBookbuildingFacade.java | 5 +-- .../operate/web/facade/BookbuildingFacade.java | 28 ++++++++++++++ .../src/main/resources/config.properties | 1 + 5 files changed, 84 insertions(+), 17 deletions(-) create mode 100644 platform-common/src/main/java/com/lyms/platform/common/utils/PropertiesUtils.java create mode 100644 platform-operate-api/src/main/resources/config.properties diff --git a/platform-common/src/main/java/com/lyms/platform/common/utils/PropertiesUtils.java b/platform-common/src/main/java/com/lyms/platform/common/utils/PropertiesUtils.java new file mode 100644 index 0000000..286f044 --- /dev/null +++ b/platform-common/src/main/java/com/lyms/platform/common/utils/PropertiesUtils.java @@ -0,0 +1,43 @@ +package com.lyms.platform.common.utils; + +import org.springframework.core.io.ClassPathResource; +import org.springframework.core.io.support.EncodedResource; +import org.springframework.core.io.support.PropertiesLoaderUtils; + +import java.io.IOException; +import java.util.Properties; + +/** + * Created by Administrator on 2016/8/2. + */ +public class PropertiesUtils { + + private static Properties props = new Properties(); + + private static final String FILE_PATH = "config.properties"; + + static{ + try { + props = PropertiesLoaderUtils.loadProperties(new EncodedResource(new ClassPathResource(FILE_PATH), "UTF8")); + } catch (IOException e) { + + } + } + + /** + * + * @param propertyKey 键名称 + * @return 键值 + */ + public static String getPropertyValue(String propertyKey){ + String propertyValue = ""; + if(StringUtils.isNotEmpty(propertyKey)){ + propertyValue = props.getProperty(propertyKey); + if (StringUtils.isNotEmpty(propertyValue)) + { + propertyValue = propertyValue.trim(); + } + } + return propertyValue; + } +} diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BookbuildingController.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BookbuildingController.java index 6b4ea8a..efca323 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BookbuildingController.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BookbuildingController.java @@ -40,19 +40,6 @@ public class BookbuildingController extends BaseController{ @Autowired private AntenatalExaminationFacade antenatalExaminationFacade; - /** - * 查询产妇信息 - * @param bookbuildingQueryRequest - * @return - */ - @ResponseBody - @RequestMapping(method = RequestMethod.GET, value = "/getBookbuildingInfo") - public BaseListResponse getBookbuildingInfo(@Valid BookbuildingQueryRequest bookbuildingQueryRequest) { - BaseListResponse baseListResponse = new BaseListResponse(); - baseListResponse.setErrorcode(ErrorCodeConstants.SUCCESS); - baseListResponse.setErrormsg("成功"); - return baseListResponse; - } /** @@ -141,4 +128,15 @@ public class BookbuildingController extends BaseController{ return bookbuildingFacade.getYunBuildBaseConfig(); } + /** + *查询孕妇建档基本信息 + * @return + */ + @RequestMapping(value = "/queryYunBuildInfo", method = RequestMethod.GET) + @ResponseBody + public BaseObjectResponse queryYunBuildInfo(@RequestParam(required = false) String cardNo,@RequestParam(required = false) String phone){ + BaseObjectResponse objectResponse = bookbuildingFacade.queryYunBuildInfo(cardNo,phone); + return objectResponse; + } + } \ No newline at end of file diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyBookbuildingFacade.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyBookbuildingFacade.java index a35da6f..15ddb28 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyBookbuildingFacade.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyBookbuildingFacade.java @@ -6,10 +6,7 @@ import com.lyms.platform.common.enums.*; import com.lyms.platform.common.result.BaseListResponse; import com.lyms.platform.common.result.BaseObjectResponse; import com.lyms.platform.common.result.BaseResponse; -import com.lyms.platform.common.utils.DateUtil; -import com.lyms.platform.common.utils.JsonUtil; -import com.lyms.platform.common.utils.StringUtils; -import com.lyms.platform.common.utils.SystemConfig; +import com.lyms.platform.common.utils.*; import com.lyms.platform.operate.web.request.*; import com.lyms.platform.operate.web.result.*; import com.lyms.platform.permission.model.Organization; diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BookbuildingFacade.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BookbuildingFacade.java index b01ee98..c031885 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BookbuildingFacade.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BookbuildingFacade.java @@ -694,4 +694,32 @@ public class BookbuildingFacade { yunBookbuildingService.deletePregnantById(id); return new BaseResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功"); } + + /** + * 查询孕妇基本信息 通过手机号码或者身份证 + * @param cardNo + * @param phone + * @return + */ + public BaseObjectResponse queryYunBuildInfo(String cardNo, String phone) { + Patients pat = null; + if (StringUtils.isNotEmpty(cardNo) || StringUtils.isNotEmpty(phone)) + { + PatientsQuery patientsQuery = new PatientsQuery(); + patientsQuery.setYn(YnEnums.YES.getId()); + patientsQuery.setCardNo(cardNo); + patientsQuery.setPhone(phone); + + List patients = yunBookbuildingService.queryPregnantWithQuery(patientsQuery); + if (CollectionUtils.isNotEmpty(patients)) + { + pat = patients.get(0); + } + } + BaseObjectResponse objectResponse = new BaseObjectResponse(); + objectResponse.setData(pat); + objectResponse.setErrorcode(ErrorCodeConstants.SUCCESS); + objectResponse.setErrormsg("成功"); + return objectResponse; + } } \ No newline at end of file diff --git a/platform-operate-api/src/main/resources/config.properties b/platform-operate-api/src/main/resources/config.properties new file mode 100644 index 0000000..0065f1c --- /dev/null +++ b/platform-operate-api/src/main/resources/config.properties @@ -0,0 +1 @@ +url=test.url \ No newline at end of file -- 1.8.3.1