From 73b8ac4998f8c9687ebe7c9887f86847d0493626 Mon Sep 17 00:00:00 2001 From: liquanyu Date: Wed, 30 May 2018 16:20:43 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=8B=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../web/controller/MeasureInfoController.java | 20 +++++ .../operate/web/facade/MeasureInfoFacade.java | 95 +++++++++++++++++++++- 2 files changed, 113 insertions(+), 2 deletions(-) diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/MeasureInfoController.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/MeasureInfoController.java index 2b6f824..1ab8391 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/MeasureInfoController.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/MeasureInfoController.java @@ -103,6 +103,26 @@ public class MeasureInfoController extends BaseController { /** + * 查询院内系统孕妇基本信息 只查询院内系统 + * @param certType + * @param certNo + * @param hospitalId + * @param request + * @return + */ + @RequestMapping(method = RequestMethod.GET, value = "/getSystemPatientBaseInfo") + @ResponseBody + public BaseObjectResponse getSystemPatientBaseInfo(@RequestParam(value = "certType", required = true) String certType, + @RequestParam(value = "certNo", required = true) String certNo, + @RequestParam(value = "hospitalId", required = true) String hospitalId, + HttpServletRequest request + ) + { + return measureInfoFacade.getSystemPatientBaseInfo(certType, certNo, hospitalId); + } + + + /** * 查询测量人的信息 * @param certType * @param certNo diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/MeasureInfoFacade.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/MeasureInfoFacade.java index 5093093..578659a 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/MeasureInfoFacade.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/MeasureInfoFacade.java @@ -93,7 +93,7 @@ public class MeasureInfoFacade { private static String[] blood_item = new String[]{"--","--","--","--","--","--","--","--","--"}; - private static Integer MAX_TODAY_COUNT = 5; + private static Integer MAX_TODAY_COUNT = 10000; public BaseListResponse queryMeasureInfoList(String queryNo, Integer valueType, String vcCardNo, @@ -195,6 +195,95 @@ public class MeasureInfoFacade { return objectResponse; } + + public BaseObjectResponse getSystemPatientBaseInfo(String certType, String certNo, String hospitalId) { + MeasureBaseInfoResult result = new MeasureBaseInfoResult(); + PatientsQuery patientsQuery = new PatientsQuery(); + patientsQuery.setHospitalId(hospitalId); + patientsQuery.setYn(YnEnums.YES.getId()); + + if ("1".equals(certType)) + { + patientsQuery.setVcCardNo(certNo); + } + else + { + patientsQuery.setPcerteTypeId(certType); + patientsQuery.setCardNo(certNo); + } + BaseObjectResponse objectResponse = new BaseObjectResponse(); + + List patientsList = patientsService.queryPatient(patientsQuery); + if (CollectionUtils.isNotEmpty(patientsList)) + { + Patients patients = patientsList.get(0); + + + //户籍地址 + String addressRegister = CommonsHelper.getResidence(patients.getProvinceRegisterId(), patients.getCityRegisterId(), + patients.getAreaRegisterId(), patients.getStreetRegisterId(), patients.getAddressRegister(), basicConfigService); + + MeasureUserInfoQuery query = new MeasureUserInfoQuery(); + query.setHospitalId(hospitalId); + query.setCertType(patients.getPcerteTypeId()); + query.setCertNo(patients.getCardNo()); + + + List models = mysqlMeasureUserInfoService.queryMeasureUserInfoList(query); + if (CollectionUtils.isNotEmpty(models)) + { + MeasureUserInfoModel userInfo = models.get(0); + userInfo.setVcCardNo(patients.getVcCardNo()); + userInfo.setModified(new Date()); + mysqlMeasureUserInfoService.updateMeasureUserInfo(userInfo); + } + else + { + MeasureUserInfoModel model = new MeasureUserInfoModel(); + + model.setUserName(patients.getUsername()); + model.setCertType(patients.getPcerteTypeId()); + model.setCertNo(patients.getCardNo()); + model.setHospitalId(patients.getHospitalId()); + model.setPhone(patients.getPhone()); + model.setSex(0); + if (patients.getBirth() != null) { + model.setAge(DateUtil.getAge(patients.getBirth(), new Date())+""); + } + model.setVcCardNo(patients.getVcCardNo()); + model.setAddress(addressRegister); + model.setCreated(new Date()); + model.setModified(new Date()); + mysqlMeasureUserInfoService.addMeasureUserInfo(model); + } + + result.setHospitalId(patients.getHospitalId()); + result.setUserName(patients.getUsername()); + result.setPhone(patients.getPhone()); + result.setVcCardNo(patients.getVcCardNo()); + result.setCertNo(patients.getCardNo()); + result.setCertType(patients.getPcerteTypeId()); + + result.setAddress(addressRegister); + result.setSex(String.valueOf(0)); + if (patients.getBirth() != null) { + result.setAge(DateUtil.getAge(patients.getBirth(), new Date())+""); + } + } + else + { + objectResponse.setErrorcode(ErrorCodeConstants.NO_DATA); + objectResponse.setErrormsg("没有建档,请建档后测量"); + return objectResponse; + } + + objectResponse.setData(result); + objectResponse.setErrorcode(ErrorCodeConstants.SUCCESS); + objectResponse.setErrormsg("成功"); + return objectResponse; + } + + public BaseObjectResponse getMeasureBaseInfo(String certType, String certNo, String hospitalId) { MeasureBaseInfoResult result = new MeasureBaseInfoResult(); MeasureUserInfoQuery query = new MeasureUserInfoQuery(); @@ -939,7 +1028,7 @@ public class MeasureInfoFacade { public BaseObjectResponse getFaceInfo(String patientId) { Patients patients = patientsService.findOnePatientById(patientId); Map faceData = new HashMap<>(); - faceData.put("face",patients.getFace() == null ? "" : patients.getFace()); + faceData.put("face", patients.getFace() == null ? "" : patients.getFace()); BaseObjectResponse objectResponse = new BaseObjectResponse(); objectResponse.setData(faceData); objectResponse.setErrorcode(ErrorCodeConstants.SUCCESS); @@ -1123,5 +1212,7 @@ public class MeasureInfoFacade { objectResponse.setErrormsg("成功"); return objectResponse; } + + } -- 1.8.3.1