Commit e8a5f9baa7a2bf5e2cd841eaaa47f9495a3948d9
1 parent
895068dc4f
Exists in
master
and in
6 other branches
update
Showing 5 changed files with 67 additions and 7 deletions
- platform-dal/src/main/java/com/lyms/platform/query/BabyModelQuery.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BabyBuildController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyBookbuildingFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyEarFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/BookbuildingQueryRequest.java
platform-dal/src/main/java/com/lyms/platform/query/BabyModelQuery.java
View file @
e8a5f9b
... | ... | @@ -20,8 +20,10 @@ |
20 | 20 | */ |
21 | 21 | public class BabyModelQuery extends BaseQuery implements IConvertToNativeQuery { |
22 | 22 | // 编码唯一,通过编码获取档案信息,编码格式20200721001 |
23 | - private boolean encoded; | |
23 | + private String encoded; | |
24 | 24 | |
25 | + private boolean encodedNe; | |
26 | + | |
25 | 27 | private String id; |
26 | 28 | |
27 | 29 | private Boolean hasBlno; |
... | ... | @@ -368,6 +370,14 @@ |
368 | 370 | private String asphyxiaMStart; |
369 | 371 | private String asphyxiaMEnd; |
370 | 372 | |
373 | + public boolean isEncodedNe() { | |
374 | + return encodedNe; | |
375 | + } | |
376 | + | |
377 | + public void setEncodedNe(boolean encodedNe) { | |
378 | + this.encodedNe = encodedNe; | |
379 | + } | |
380 | + | |
371 | 381 | public String getAsphyxiaMStart() { |
372 | 382 | return asphyxiaMStart; |
373 | 383 | } |
374 | 384 | |
... | ... | @@ -746,11 +756,11 @@ |
746 | 756 | this.lastHighRisk = lastHighRisk; |
747 | 757 | } |
748 | 758 | |
749 | - public boolean isEncoded() { | |
759 | + public String getEncoded() { | |
750 | 760 | return encoded; |
751 | 761 | } |
752 | 762 | |
753 | - public void setEncoded(boolean encoded) { | |
763 | + public void setEncoded(String encoded) { | |
754 | 764 | this.encoded = encoded; |
755 | 765 | } |
756 | 766 | |
... | ... | @@ -920,6 +930,12 @@ |
920 | 930 | condition = condition.and("endCase", endCase, MongoOper.IS); |
921 | 931 | } |
922 | 932 | |
933 | + if (null != encoded) { | |
934 | + condition = condition.and("encoded", encoded, MongoOper.IS); | |
935 | + } | |
936 | + if (encodedNe) { | |
937 | + condition = condition.and("encoded", null, MongoOper.NE); | |
938 | + } | |
923 | 939 | |
924 | 940 | if (null != hasBlno) { |
925 | 941 | condition = condition.and("blNo", hasBlno, MongoOper.EXISTS); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BabyBuildController.java
View file @
e8a5f9b
... | ... | @@ -143,8 +143,9 @@ |
143 | 143 | @RequestMapping(value = "/queryBabyBuildRecord", method = RequestMethod.GET) |
144 | 144 | @ResponseBody |
145 | 145 | @TokenRequired |
146 | - public BaseObjectResponse queryBabyBuildRecord(HttpServletRequest request, @RequestParam(required = false) String cardNo, @RequestParam(required = false) String vcCardNo, @RequestParam(required = false) String hospitalId) { | |
146 | + public BaseObjectResponse queryBabyBuildRecord(HttpServletRequest request, @RequestParam(required = false) String cardNo, @RequestParam(required = false) String encoded, @RequestParam(required = false) String vcCardNo, @RequestParam(required = false) String hospitalId) { | |
147 | 147 | BookbuildingQueryRequest param = new BookbuildingQueryRequest(); |
148 | + param.setEncoded(encoded); | |
148 | 149 | param.setCardNo(cardNo); |
149 | 150 | param.setVcCardNo(vcCardNo); |
150 | 151 | param.setHospitalId(hospitalId); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyBookbuildingFacade.java
View file @
e8a5f9b
... | ... | @@ -1341,13 +1341,13 @@ |
1341 | 1341 | * @Author: 武涛涛 |
1342 | 1342 | * @Date: 2020/7/21 16:07 |
1343 | 1343 | */ |
1344 | - private String getEncodedUtil() { | |
1344 | + public String getEncodedUtil() { | |
1345 | 1345 | try { |
1346 | 1346 | BabyModelQuery babyQuery = new BabyModelQuery(); |
1347 | 1347 | babyQuery.setYn(YnEnums.YES.getId()); |
1348 | 1348 | babyQuery.setCreatedTimeStart(DateUtil.getDayFirstSecond(new Date())); |
1349 | 1349 | babyQuery.setCreatedTimeEnd(DateUtil.getDayLastSecond(new Date())); |
1350 | - babyQuery.setEncoded(true); | |
1350 | + babyQuery.setEncodedNe(true); | |
1351 | 1351 | MongoQuery query = babyQuery.convertToQuery(); |
1352 | 1352 | List<BabyModel> list = babyBookBuildingDao.queryBabyWithQuery(query.addOrder(Sort.Direction.DESC, "created")); |
1353 | 1353 | if (CollectionUtils.isNotEmpty(list)) { |
... | ... | @@ -1757,6 +1757,8 @@ |
1757 | 1757 | */ |
1758 | 1758 | public BaseObjectResponse queryBabyBuildRecord(BookbuildingQueryRequest param, Integer userId) { |
1759 | 1759 | |
1760 | + //编码获取手机号获取档案信息 | |
1761 | + setEncodedCardNo(param, userId); | |
1760 | 1762 | |
1761 | 1763 | Map<String, Object> map = new HashMap<>(); |
1762 | 1764 | |
... | ... | @@ -2051,6 +2053,34 @@ |
2051 | 2053 | objectResponse.setData(map); |
2052 | 2054 | objectResponse.setErrormsg("成功"); |
2053 | 2055 | return objectResponse; |
2056 | + } | |
2057 | + | |
2058 | + /** | |
2059 | + * 秦皇岛儿童建档要求使用编码可以查询到档案信息,保存那会只给lyms_baby加编码了所以这里先查 | |
2060 | + * | |
2061 | + * @param param | |
2062 | + * @param userId | |
2063 | + * @Author: 武涛涛 | |
2064 | + * @Date: 2020/7/22 20:32 | |
2065 | + */ | |
2066 | + private void setEncodedCardNo(BookbuildingQueryRequest param, Integer userId) { | |
2067 | + | |
2068 | + if(StringUtils.isNotEmpty(param.getEncoded())){ | |
2069 | + BabyModelQuery babyQuery1 = new BabyModelQuery(); | |
2070 | + babyQuery1.setEncoded(param.getEncoded()); | |
2071 | + babyQuery1.setYn(YnEnums.YES.getId()); | |
2072 | + if (org.apache.commons.lang.StringUtils.isNotEmpty(groupsFacade.findByCurrentUserId(autoMatchFacade.getHospitalId(userId)))) { | |
2073 | + List list = new ArrayList(); | |
2074 | + list.add("1"); | |
2075 | + list.add("2"); | |
2076 | + babyQuery1.setEnableListNot(list); | |
2077 | + } | |
2078 | + List<BabyModel> build1 = babyBookbuildingService.queryBabyBuildByCond(babyQuery1, "created", Sort.Direction.DESC); | |
2079 | + if(CollectionUtils.isNotEmpty(build1)){ | |
2080 | + BabyModel babyModel = build1.get(0); | |
2081 | + param.setCardNo(babyModel.getMphone()); | |
2082 | + } | |
2083 | + } | |
2054 | 2084 | } |
2055 | 2085 | |
2056 | 2086 | private boolean isNotExist(List<Map<String, String>> list, String id) { |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyEarFacade.java
View file @
e8a5f9b
... | ... | @@ -519,6 +519,10 @@ |
519 | 519 | baby.setYn(1); |
520 | 520 | baby.setBuildType(1); |
521 | 521 | baby.setCreated(new Date()); |
522 | + // 编码,新增时候增加修改不做处理 | |
523 | + if (StringUtils.isEmpty(baby.getId())) { | |
524 | + baby.setEncoded(babyBookbuildingFacade.getEncodedUtil()); | |
525 | + } | |
522 | 526 | babyPatientId = babyService.addOneBaby(baby).getId(); |
523 | 527 | babyBookbuildingFacade.createBuildMsg(baby); |
524 | 528 | //建档开通增值服务 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/BookbuildingQueryRequest.java
View file @
e8a5f9b
... | ... | @@ -15,7 +15,8 @@ |
15 | 15 | private String vcCardNo; |
16 | 16 | //建档类型 |
17 | 17 | private String bookbuildingType; |
18 | - | |
18 | + // 编码唯一,通过编码获取档案信息,编码格式20200721001 | |
19 | + private String encoded; | |
19 | 20 | private String pid; |
20 | 21 | |
21 | 22 | public String getPid() { |
... | ... | @@ -28,6 +29,14 @@ |
28 | 29 | |
29 | 30 | //医院ID |
30 | 31 | private String hospitalId; |
32 | + | |
33 | + public String getEncoded() { | |
34 | + return encoded; | |
35 | + } | |
36 | + | |
37 | + public void setEncoded(String encoded) { | |
38 | + this.encoded = encoded; | |
39 | + } | |
31 | 40 | |
32 | 41 | public String getId() { |
33 | 42 | return id; |