Commit f4910d358249af767914de66e56a7801d0d48ce3
1 parent
bbda5b724b
Exists in
master
and in
6 other branches
新生儿访视-本辖区待访视新生儿列表自动呈现
Showing 6 changed files with 174 additions and 59 deletions
- platform-dal/src/main/java/com/lyms/platform/query/PatientsQuery.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/NewbornVisitControoler.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/MatDeliverFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/NewBabyManagerRequest.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/INewbornVisitService.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/NewbornServiceImpl.java
platform-dal/src/main/java/com/lyms/platform/query/PatientsQuery.java
View file @
f4910d3
... | ... | @@ -319,6 +319,13 @@ |
319 | 319 | |
320 | 320 | private List<String> childExtAddrs; |
321 | 321 | |
322 | + | |
323 | + private String addressPostRest; | |
324 | + private String provincePostRestId; | |
325 | + private String cityPostRestId; | |
326 | + private String areaPostRestId; | |
327 | + private String streetPostRestId; | |
328 | + | |
322 | 329 | public MongoQuery convertToQuery() { |
323 | 330 | MongoCondition condition = MongoCondition.newInstance(); |
324 | 331 | |
... | ... | @@ -451,6 +458,19 @@ |
451 | 458 | condition = condition.and("streetRegisterId", streetRegisterId, MongoOper.IS); |
452 | 459 | } |
453 | 460 | |
461 | + if (StringUtils.isNotEmpty(provincePostRestId)) { | |
462 | + condition = condition.and("provincePostRestId", provincePostRestId, MongoOper.IS); | |
463 | + } | |
464 | + if (StringUtils.isNotEmpty(cityPostRestId)) { | |
465 | + condition = condition.and("cityPostRestId", cityPostRestId, MongoOper.IS); | |
466 | + } | |
467 | + if (StringUtils.isNotEmpty(areaPostRestId)) { | |
468 | + condition = condition.and("areaPostRestId", areaPostRestId, MongoOper.IS); | |
469 | + } | |
470 | + if (StringUtils.isNotEmpty(streetPostRestId)) { | |
471 | + condition = condition.and("streetRegisterId", streetPostRestId, MongoOper.IS); | |
472 | + } | |
473 | + | |
454 | 474 | // 分娩信息 |
455 | 475 | |
456 | 476 | |
... | ... | @@ -957,6 +977,37 @@ |
957 | 977 | return condition.toMongoQuery(); |
958 | 978 | } |
959 | 979 | |
980 | + public String getProvincePostRestId() { | |
981 | + return provincePostRestId; | |
982 | + } | |
983 | + | |
984 | + public void setProvincePostRestId(String provincePostRestId) { | |
985 | + this.provincePostRestId = provincePostRestId; | |
986 | + } | |
987 | + | |
988 | + public String getCityPostRestId() { | |
989 | + return cityPostRestId; | |
990 | + } | |
991 | + | |
992 | + public void setCityPostRestId(String cityPostRestId) { | |
993 | + this.cityPostRestId = cityPostRestId; | |
994 | + } | |
995 | + | |
996 | + public String getAreaPostRestId() { | |
997 | + return areaPostRestId; | |
998 | + } | |
999 | + | |
1000 | + public void setAreaPostRestId(String areaPostRestId) { | |
1001 | + this.areaPostRestId = areaPostRestId; | |
1002 | + } | |
1003 | + | |
1004 | + public String getStreetPostRestId() { | |
1005 | + return streetPostRestId; | |
1006 | + } | |
1007 | + | |
1008 | + public void setStreetPostRestId(String streetPostRestId) { | |
1009 | + this.streetPostRestId = streetPostRestId; | |
1010 | + } | |
960 | 1011 | |
961 | 1012 | public List<String> getChildExtAddrs() { |
962 | 1013 | return childExtAddrs; |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/NewbornVisitControoler.java
View file @
f4910d3
... | ... | @@ -2,6 +2,7 @@ |
2 | 2 | |
3 | 3 | import com.lyms.platform.common.annotation.TokenRequired; |
4 | 4 | import com.lyms.platform.common.base.BaseController; |
5 | +import com.lyms.platform.common.result.BaseListResponse; | |
5 | 6 | import com.lyms.platform.common.result.BaseObjectResponse; |
6 | 7 | import com.lyms.platform.operate.web.service.INewbornVisitService; |
7 | 8 | import com.lyms.platform.pojo.NewbornVisit; |
... | ... | @@ -56,6 +57,25 @@ |
56 | 57 | @TokenRequired |
57 | 58 | public BaseObjectResponse query(HttpServletRequest request, String babyId) { |
58 | 59 | return visitService.query(getUserId(request), babyId); |
60 | + } | |
61 | + | |
62 | + | |
63 | + /** | |
64 | + * 区域待访视儿童 | |
65 | + * @return | |
66 | + */ | |
67 | + @RequestMapping(value = "/areaVisitList", method = RequestMethod.GET) | |
68 | + @ResponseBody | |
69 | + @TokenRequired | |
70 | + public BaseListResponse areaVisitList(HttpServletRequest request, | |
71 | + @RequestParam(value = "queryNo", required = false) String queryNo, | |
72 | + @RequestParam(value = "provinceId",required = false) String provinceId, | |
73 | + @RequestParam(value = "cityId",required = false) String cityId, | |
74 | + @RequestParam(value = "areaId",required = false) String areaId, | |
75 | + @RequestParam(value = "streetId",required = false) String streetId, | |
76 | + @RequestParam("page") Integer page, | |
77 | + @RequestParam("limit") Integer limit) { | |
78 | + return visitService.areaVisitList(getUserId(request), queryNo,provinceId,cityId,areaId,streetId,page,limit); | |
59 | 79 | } |
60 | 80 | |
61 | 81 | /** |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/MatDeliverFacade.java
View file @
f4910d3
... | ... | @@ -2157,53 +2157,9 @@ |
2157 | 2157 | babyModelQuery.setLimit(newBabyManagerRequest.getLimit()); |
2158 | 2158 | babyModelQuery.setNeed("Need"); |
2159 | 2159 | } |
2160 | - | |
2161 | 2160 | babyModelQuery.setBuildType(2); |
2162 | 2161 | babyModelQuery.setOrder("birth"); |
2163 | - | |
2164 | - if (newBabyManagerRequest.getVisitStatus() != null && newBabyManagerRequest.getVisitStatus() == 1) | |
2165 | - { | |
2166 | - String hospitalId = autoMatchFacade.getHospitalId(userId); | |
2167 | - PostVisitHospitalModelQuery postQuery = new PostVisitHospitalModelQuery(); | |
2168 | - postQuery.setPostHosptial(hospitalId); | |
2169 | - List<PostVisitHospitalModel> postVisitHospitalModel = postVisitHospitalService.queryPostVisitHospitalModel(postQuery); | |
2170 | - List<String> excData = new ArrayList<>(); | |
2171 | - if (CollectionUtils.isNotEmpty(postVisitHospitalModel)) { | |
2172 | - for (PostVisitHospitalModel phm : postVisitHospitalModel) { | |
2173 | - excData.addAll(phm.getAreaTiters()); | |
2174 | - } | |
2175 | - } | |
2176 | - | |
2177 | - //权限所有的医院 | |
2178 | - List<String> allHospitalList = new ArrayList<>(); | |
2179 | - DataPermissionsModelQuery dataPermissionsModelQuery = new DataPermissionsModelQuery(); | |
2180 | - dataPermissionsModelQuery.setUserId(userId); | |
2181 | - List<DataPermissionsModel> permissionsModels = dataPermissionService.queryPermission(dataPermissionsModelQuery); | |
2182 | - if (CollectionUtils.isNotEmpty(permissionsModels)) { | |
2183 | - Set<String> set = permissionsModels.get(0).getData().keySet(); | |
2184 | - Iterator<String> it = set.iterator(); | |
2185 | - while (it.hasNext()) { | |
2186 | - String id = it.next(); | |
2187 | - if (com.lyms.platform.common.utils.StringUtils.isNotEmpty(id)) { | |
2188 | - allHospitalList.add(id); | |
2189 | - } | |
2190 | - } | |
2191 | - } | |
2192 | - | |
2193 | - PatientsQuery patientsQuery = new PatientsQuery(); | |
2194 | - patientsQuery.setChildExtAddrs(excData); | |
2195 | - patientsQuery.setHospitalList(allHospitalList); | |
2196 | - List<Patients> patientsList = patientsService.queryPatient(patientsQuery); | |
2197 | - List<String> patientIds = new ArrayList<>(); | |
2198 | - for (Patients patients : patientsList) { | |
2199 | - patientIds.add(patients.getId()); | |
2200 | - } | |
2201 | - babyModelQuery.setParentIds(patientIds); | |
2202 | - babyModelQuery.setVisitstatus(VisitStatusEnums.VISITED.getId()); | |
2203 | - babyModelQuery.setHospitalIdList(allHospitalList); | |
2204 | - } else { | |
2205 | - babyModelQuery.setHospitalId(autoMatchFacade.getHospitalId(newBabyManagerRequest.getOperatorId())); | |
2206 | - } | |
2162 | + babyModelQuery.setHospitalId(autoMatchFacade.getHospitalId(newBabyManagerRequest.getOperatorId())); | |
2207 | 2163 | |
2208 | 2164 | List<BabyModel> babyModelList = babyService.queryBabyWithQuery(babyModelQuery); |
2209 | 2165 | if (CollectionUtils.isEmpty(babyModelList)) { |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/NewBabyManagerRequest.java
View file @
f4910d3
... | ... | @@ -36,16 +36,6 @@ |
36 | 36 | //畸形key |
37 | 37 | private String deformityKey; |
38 | 38 | |
39 | - //空或者0 全部 1 本辖区待 | |
40 | - private Integer visitStatus; | |
41 | - | |
42 | - public Integer getVisitStatus() { | |
43 | - return visitStatus; | |
44 | - } | |
45 | - | |
46 | - public void setVisitStatus(Integer visitStatus) { | |
47 | - this.visitStatus = visitStatus; | |
48 | - } | |
49 | 39 | |
50 | 40 | public String getDeformityKey() { |
51 | 41 | return deformityKey; |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/INewbornVisitService.java
View file @
f4910d3
1 | 1 | package com.lyms.platform.operate.web.service; |
2 | 2 | |
3 | +import com.lyms.platform.common.result.BaseListResponse; | |
3 | 4 | import com.lyms.platform.common.result.BaseObjectResponse; |
4 | 5 | import com.lyms.platform.pojo.NewbornVisit; |
5 | 6 | |
... | ... | @@ -23,5 +24,7 @@ |
23 | 24 | BaseObjectResponse delete(String id,Integer userId); |
24 | 25 | |
25 | 26 | BaseObjectResponse info(String id); |
27 | + | |
28 | + BaseListResponse areaVisitList(Integer userId, String queryNo, String provinceId, String cityId, String areaId, String streetId, Integer page, Integer limit); | |
26 | 29 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/NewbornServiceImpl.java
View file @
f4910d3
1 | 1 | package com.lyms.platform.operate.web.service.impl; |
2 | 2 | |
3 | 3 | import com.lyms.platform.biz.service.BabyService; |
4 | +import com.lyms.platform.biz.service.BasicConfigService; | |
4 | 5 | import com.lyms.platform.biz.service.DataPermissionService; |
6 | +import com.lyms.platform.biz.service.PatientsService; | |
7 | +import com.lyms.platform.common.constants.ErrorCodeConstants; | |
5 | 8 | import com.lyms.platform.common.enums.*; |
6 | -import com.lyms.platform.common.result.BaseObjectResponse; | |
7 | -import com.lyms.platform.common.result.PageResult; | |
8 | -import com.lyms.platform.common.result.RespBuilder; | |
9 | -import com.lyms.platform.common.result.ResponseCode; | |
9 | +import com.lyms.platform.common.result.*; | |
10 | 10 | import com.lyms.platform.common.utils.DateUtil; |
11 | 11 | import com.lyms.platform.common.utils.EnumUtil; |
12 | 12 | import com.lyms.platform.common.utils.MongoConvertHelper; |
13 | 13 | import com.lyms.platform.common.utils.ReflectionUtils; |
14 | +import com.lyms.platform.operate.web.facade.AreaCountFacade; | |
14 | 15 | import com.lyms.platform.operate.web.facade.AutoMatchFacade; |
15 | 16 | import com.lyms.platform.operate.web.facade.OperateLogFacade; |
16 | 17 | import com.lyms.platform.operate.web.facade.OrganizationGroupsFacade; |
17 | 18 | import com.lyms.platform.operate.web.service.INewbornVisitService; |
18 | 19 | import com.lyms.platform.operate.web.utils.CollectionUtils; |
20 | +import com.lyms.platform.operate.web.utils.CommonsHelper; | |
19 | 21 | import com.lyms.platform.operate.web.utils.MongoUtil; |
20 | 22 | import com.lyms.platform.operate.web.utils.ResponseUtil; |
21 | 23 | import com.lyms.platform.permission.dao.master.CouponMapper; |
22 | 24 | import com.lyms.platform.permission.service.CouponService; |
25 | +import com.lyms.platform.permission.service.OrganizationService; | |
23 | 26 | import com.lyms.platform.pojo.BabyModel; |
24 | 27 | import com.lyms.platform.pojo.NewbornVisit; |
25 | 28 | import com.lyms.platform.pojo.Patients; |
26 | 29 | import com.lyms.platform.pojo.PersonModel; |
30 | +import com.lyms.platform.query.BabyModelQuery; | |
31 | +import com.lyms.platform.query.PatientsQuery; | |
27 | 32 | import org.apache.commons.collections.map.HashedMap; |
28 | 33 | import org.apache.commons.lang.StringUtils; |
29 | 34 | import org.springframework.beans.factory.annotation.Autowired; |
... | ... | @@ -36,6 +41,7 @@ |
36 | 41 | import org.springframework.util.Assert; |
37 | 42 | |
38 | 43 | import javax.servlet.http.HttpServletResponse; |
44 | +import javax.xml.rpc.handler.HandlerChain; | |
39 | 45 | import java.util.*; |
40 | 46 | |
41 | 47 | /** |
... | ... | @@ -476,6 +482,95 @@ |
476 | 482 | } |
477 | 483 | return RespBuilder.buildSuccess(); |
478 | 484 | } |
485 | + | |
486 | + @Override | |
487 | + public BaseListResponse areaVisitList(Integer userId, String queryNo, String provinceId, String cityId, String areaId, String streetId, Integer page, Integer limit) { | |
488 | + | |
489 | + BabyModelQuery babyModelQuery = new BabyModelQuery(); | |
490 | + babyModelQuery.setQueryNo(StringUtils.isEmpty(queryNo) ? null : queryNo); | |
491 | + babyModelQuery.setDataStatus(false); | |
492 | + babyModelQuery.setNeed("Need"); | |
493 | + babyModelQuery.setPage(page); | |
494 | + babyModelQuery.setLimit(limit); | |
495 | + babyModelQuery.setBuildType(2); | |
496 | + babyModelQuery.setOrder("birth"); | |
497 | + babyModelQuery.setVisitstatus(VisitStatusEnums.VISITED.getId()); | |
498 | + //获取用户权限医院和筛选条件的交集 | |
499 | + List<String> currentUserHospPermissions = areaCountFacade.getCurrentUserHospPermissions(userId, provinceId, | |
500 | + cityId, areaId); | |
501 | + if (provinceId != null && cityId != null && areaId != null) | |
502 | + { | |
503 | + PatientsQuery patientsQuery = new PatientsQuery(); | |
504 | + patientsQuery.setHospitalList(currentUserHospPermissions); | |
505 | + patientsQuery.setYn(YnEnums.YES.getId()); | |
506 | + patientsQuery.setProvincePostRestId(provinceId); | |
507 | + patientsQuery.setCityPostRestId(cityId); | |
508 | + patientsQuery.setAreaPostRestId(areaId); | |
509 | + patientsQuery.setStreetPostRestId(streetId); | |
510 | + List<Patients> patientses = patientsService.queryPatient(patientsQuery); | |
511 | + List<String> parentIds = new ArrayList<>(); | |
512 | + if (CollectionUtils.isNotEmpty(patientses)) | |
513 | + { | |
514 | + for (Patients pat : patientses) | |
515 | + { | |
516 | + parentIds.add(pat.getId()); | |
517 | + } | |
518 | + } | |
519 | + if (parentIds.size() > 0) | |
520 | + { | |
521 | + babyModelQuery.setParentIds(parentIds); | |
522 | + } | |
523 | + } | |
524 | + | |
525 | + babyModelQuery.setHospitalIdList(currentUserHospPermissions); | |
526 | + List<BabyModel> babyModelList = babyService.queryBabyWithQuery(babyModelQuery); | |
527 | + List<Map> list = new ArrayList<>(); | |
528 | + if (CollectionUtils.isNotEmpty(babyModelList)) | |
529 | + { | |
530 | + for (BabyModel babyModel : babyModelList) | |
531 | + { | |
532 | + Map map = new HashMap(); | |
533 | + map.put("id", babyModel.getId()); | |
534 | + map.put("babyName", babyModel.getName()); | |
535 | + | |
536 | + if (babyModel.getParentId() != null) | |
537 | + { | |
538 | + Patients patients = patientsService.findOnePatientById(babyModel.getParentId()); | |
539 | + if (patients != null) | |
540 | + { | |
541 | + map.put("monthName", patients.getUsername()); | |
542 | + map.put("phone", patients.getPhone()); | |
543 | + map.put("fmDays", patients.getFmWeek()); | |
544 | + map.put("fmHospitalName", CommonsHelper.getHospitalName(babyModel.getHospitalId(), organizationService)); | |
545 | + map.put("postAddress", CommonsHelper.getResidence(patients.getProvincePostRestId(), patients.getCityPostRestId(), | |
546 | + patients.getAreaPostRestId(), patients.getStreetPostRestId(), patients.getAddressPostRest(), basicConfigService)); | |
547 | + map.put("cityName", CommonsHelper.getName1(patients.getCityPostRestId(), basicConfigService)); | |
548 | + map.put("areaName", CommonsHelper.getName1(patients.getAreaPostRestId(), basicConfigService)); | |
549 | + map.put("cardNo", patients.getCardNo()); | |
550 | + map.put("patientId", patients.getId()); | |
551 | + } | |
552 | + | |
553 | + } | |
554 | + list.add(map); | |
555 | + } | |
556 | + } | |
557 | + | |
558 | + | |
559 | + BaseListResponse objectResponse = new BaseListResponse(); | |
560 | + objectResponse.setErrorcode(ErrorCodeConstants.SUCCESS); | |
561 | + objectResponse.setData(list); | |
562 | + objectResponse.setPageInfo(babyModelQuery.getPageInfo()); | |
563 | + objectResponse.setErrormsg("成功"); | |
564 | + return objectResponse; | |
565 | + } | |
566 | + @Autowired | |
567 | + private OrganizationService organizationService; | |
568 | + @Autowired | |
569 | + private PatientsService patientsService; | |
570 | + @Autowired | |
571 | + private AreaCountFacade areaCountFacade; | |
572 | + @Autowired | |
573 | + private BasicConfigService basicConfigService; | |
479 | 574 | |
480 | 575 | } |