Commit 1b084fa41f33d831ada221e07bf9b5c44f77a68d
Exists in
master
and in
8 other branches
Merge remote-tracking branch 'origin/master'
Showing 3 changed files
- platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/BabyBookbuildingService.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BabyBookbuildingController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyBookbuildingFacade.java
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/BabyBookbuildingService.java
View file @
1b084fa
... | ... | @@ -46,7 +46,7 @@ |
46 | 46 | babyQuery.mysqlBuild(babyBookBuildingDao.queryBabyManageCount(babyQuery.convertToQuery())); |
47 | 47 | query.start(babyQuery.getOffset()).end(babyQuery.getLimit()); |
48 | 48 | } |
49 | - return babyBookBuildingDao.queryBabyWithQuery(query.addOrder(Sort.Direction.DESC, "buildDate")); | |
49 | + return babyBookBuildingDao.queryBabyWithQuery(query.addOrder(Sort.Direction.DESC, "created")); | |
50 | 50 | } |
51 | 51 | |
52 | 52 | public int queryBabyCount(BabyModelQuery babyQuery) { |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BabyBookbuildingController.java
View file @
1b084fa
... | ... | @@ -249,8 +249,8 @@ |
249 | 249 | */ |
250 | 250 | @RequestMapping(method = RequestMethod.GET, value = "/queryPatientBaseInfo") |
251 | 251 | @ResponseBody |
252 | - public BaseResponse queryYunBaseInfo(@RequestParam(value = "cardNo", required = true) String cardNo) { | |
253 | - return babyBookbuildingFacade.queryYunBaseInfo(cardNo); | |
252 | + public BaseResponse queryYunBaseInfo(@RequestParam(value = "cardNo", required = false) String cardNo,@RequestParam(value = "pid", required = false) String pid) { | |
253 | + return babyBookbuildingFacade.queryYunBaseInfo(cardNo,pid); | |
254 | 254 | } |
255 | 255 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyBookbuildingFacade.java
View file @
1b084fa
... | ... | @@ -1422,21 +1422,62 @@ |
1422 | 1422 | * @param cardNo |
1423 | 1423 | * @return |
1424 | 1424 | */ |
1425 | - public BaseResponse queryYunBaseInfo(String cardNo) { | |
1426 | - PatientsQuery patientsQuery = new PatientsQuery(); | |
1427 | - patientsQuery.setYn(YnEnums.YES.getId()); | |
1428 | - Patients obj = null; | |
1429 | - if (!StringUtils.isEmpty(cardNo)); | |
1425 | + public BaseResponse queryYunBaseInfo(String cardNo,String pid) { | |
1426 | + | |
1427 | + BabyBuildResult result = null; | |
1428 | + | |
1429 | + if (StringUtils.isNotEmpty(pid)) | |
1430 | 1430 | { |
1431 | - patientsQuery.setCardNo(cardNo); | |
1432 | - List<Patients> patients = yunBookbuildingService.queryPregnantWithQuery(patientsQuery); | |
1433 | - if (CollectionUtils.isNotEmpty(patients)) | |
1431 | + BabyModelQuery babyQuery = new BabyModelQuery(); | |
1432 | + babyQuery.setYn(YnEnums.YES.getId()); | |
1433 | + babyQuery.setPid(pid); | |
1434 | + //获取最近一次其他医院的建档记录 | |
1435 | + List<BabyModel> models = babyBookbuildingService.queryBabyBuildByCond(babyQuery); | |
1436 | + if (CollectionUtils.isNotEmpty(models)) | |
1434 | 1437 | { |
1435 | - obj = patients.get(0); | |
1438 | + BabyModel babyModel = models.get(0); | |
1439 | + if (babyModel != null) | |
1440 | + { | |
1441 | + result = getBabyBuildResult(babyModel); | |
1442 | + } | |
1436 | 1443 | } |
1437 | 1444 | } |
1445 | + else | |
1446 | + { | |
1447 | + PatientsQuery patientsQuery = new PatientsQuery(); | |
1448 | + patientsQuery.setYn(YnEnums.YES.getId()); | |
1449 | + | |
1450 | + if (!StringUtils.isEmpty(cardNo)); | |
1451 | + { | |
1452 | + patientsQuery.setCardNo(cardNo); | |
1453 | + List<Patients> patients = yunBookbuildingService.queryPregnantWithQuery(patientsQuery); | |
1454 | + if (CollectionUtils.isNotEmpty(patients)) | |
1455 | + { | |
1456 | + Patients patient = patients.get(0); | |
1457 | + if (patients != null) | |
1458 | + { | |
1459 | + | |
1460 | + result = new BabyBuildResult(); | |
1461 | + result.setMommyName(patient.getUsername()); | |
1462 | + result.setMommyCertificateTypeId(patient.getPcerteTypeId()); | |
1463 | + result.setMommyCertificateNum(patient.getCardNo()); | |
1464 | + result.setMommyBirthday(DateUtil.getyyyy_MM_dd(patient.getBirth())); | |
1465 | + | |
1466 | + result.setMommyProfessionTypeId(patient.getProvinceId()); | |
1467 | + result.setMommyPhone(patient.getPhone()); | |
1468 | + result.setFatherName(patient.getHusbandName()); | |
1469 | + result.setFatherPhone(patient.getHusbandPhone()); | |
1470 | + result.setFatherBirthday(DateUtil.getyyyy_MM_dd(patient.getHusbandBirth())); | |
1471 | + result.setFatherLevelId(patient.getHlevelTypeId()); | |
1472 | + | |
1473 | + result.setFatherProfessionTypeId(patient.getHprofessionTypeId()); | |
1474 | + } | |
1475 | + } | |
1476 | + } | |
1477 | + } | |
1478 | + | |
1438 | 1479 | BaseObjectResponse objectResponse = new BaseObjectResponse(); |
1439 | - objectResponse.setData(obj); | |
1480 | + objectResponse.setData(result); | |
1440 | 1481 | objectResponse.setErrorcode(ErrorCodeConstants.SUCCESS); |
1441 | 1482 | objectResponse.setErrormsg("成功"); |
1442 | 1483 | return objectResponse; |