Commit 17d17d70f08d6455a0e7b7ff6b6aa68cad1b1ec5
1 parent
6375238f2a
Exists in
master
修改产检删除
Showing 7 changed files with 313 additions and 17 deletions
- platform-dal/src/main/java/com/lyms/platform/pojo/AntExRecordModel.java
- platform-dal/src/main/java/com/lyms/platform/query/AntExRecordQuery.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/AntenatalExaminationController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntExRecordFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PatientFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/AntExManagerQueryRequest.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/AntExManagerResult.java
platform-dal/src/main/java/com/lyms/platform/pojo/AntExRecordModel.java
View file @
17d17d7
... | ... | @@ -64,6 +64,53 @@ |
64 | 64 | //下次产检时间 |
65 | 65 | private Date nextCheckTime; |
66 | 66 | |
67 | + private String addressRegister; | |
68 | + private String provinceRegisterId; | |
69 | + private String cityRegisterId; | |
70 | + private String areaRegisterId; | |
71 | + private String streetRegisterId; | |
72 | + | |
73 | + | |
74 | + public String getAddressRegister() { | |
75 | + return addressRegister; | |
76 | + } | |
77 | + | |
78 | + public void setAddressRegister(String addressRegister) { | |
79 | + this.addressRegister = addressRegister; | |
80 | + } | |
81 | + | |
82 | + public String getProvinceRegisterId() { | |
83 | + return provinceRegisterId; | |
84 | + } | |
85 | + | |
86 | + public void setProvinceRegisterId(String provinceRegisterId) { | |
87 | + this.provinceRegisterId = provinceRegisterId; | |
88 | + } | |
89 | + | |
90 | + public String getCityRegisterId() { | |
91 | + return cityRegisterId; | |
92 | + } | |
93 | + | |
94 | + public void setCityRegisterId(String cityRegisterId) { | |
95 | + this.cityRegisterId = cityRegisterId; | |
96 | + } | |
97 | + | |
98 | + public String getAreaRegisterId() { | |
99 | + return areaRegisterId; | |
100 | + } | |
101 | + | |
102 | + public void setAreaRegisterId(String areaRegisterId) { | |
103 | + this.areaRegisterId = areaRegisterId; | |
104 | + } | |
105 | + | |
106 | + public String getStreetRegisterId() { | |
107 | + return streetRegisterId; | |
108 | + } | |
109 | + | |
110 | + public void setStreetRegisterId(String streetRegisterId) { | |
111 | + this.streetRegisterId = streetRegisterId; | |
112 | + } | |
113 | + | |
67 | 114 | public Date getNextCheckTime() { |
68 | 115 | return nextCheckTime; |
69 | 116 | } |
platform-dal/src/main/java/com/lyms/platform/query/AntExRecordQuery.java
View file @
17d17d7
... | ... | @@ -9,6 +9,7 @@ |
9 | 9 | import org.springframework.data.mongodb.core.query.Criteria; |
10 | 10 | |
11 | 11 | import java.util.Date; |
12 | +import java.util.List; | |
12 | 13 | |
13 | 14 | /** |
14 | 15 | * Created by Administrator on 2016/6/21 0021. |
... | ... | @@ -47,6 +48,7 @@ |
47 | 48 | |
48 | 49 | //创建时间 |
49 | 50 | private String hospitalId; |
51 | + private List hospitalList; | |
50 | 52 | //孕妇状态 |
51 | 53 | private Integer status; |
52 | 54 | private String levelId; |
... | ... | @@ -61,6 +63,14 @@ |
61 | 63 | private Date gteCreated; |
62 | 64 | private String pid; |
63 | 65 | |
66 | + public List getHospitalList() { | |
67 | + return hospitalList; | |
68 | + } | |
69 | + | |
70 | + public void setHospitalList(List hospitalList) { | |
71 | + this.hospitalList = hospitalList; | |
72 | + } | |
73 | + | |
64 | 74 | public String getfId() { |
65 | 75 | return fId; |
66 | 76 | } |
... | ... | @@ -190,6 +200,10 @@ |
190 | 200 | if (null != hospitalId) { |
191 | 201 | condition = condition.and("hospitalId", hospitalId, MongoOper.IS); |
192 | 202 | } |
203 | + if (null != hospitalList) { | |
204 | + condition = condition.and("hospitalId", hospitalList, MongoOper.IN); | |
205 | + } | |
206 | + | |
193 | 207 | if (null != pid) { |
194 | 208 | condition = condition.and("pid", pid, MongoOper.IS); |
195 | 209 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/AntenatalExaminationController.java
View file @
17d17d7
... | ... | @@ -181,7 +181,20 @@ |
181 | 181 | @TokenRequired |
182 | 182 | public BaseResponse findAntEx(@Valid AntExManagerQueryRequest antExManagerQueryRequest,HttpServletRequest request){ |
183 | 183 | LoginContext loginState = (LoginContext) request.getAttribute("loginContext"); |
184 | - return antExRecordFacade.findList(antExManagerQueryRequest,loginState.getId()); | |
184 | + return antExRecordFacade.findList(antExManagerQueryRequest, loginState.getId(), false); | |
185 | + } | |
186 | + | |
187 | + /** | |
188 | + * 产检区域管理接口 | |
189 | + * | |
190 | + * @return | |
191 | + */ | |
192 | + @RequestMapping(method = RequestMethod.GET, value = "/antex/rantexrecordlist") | |
193 | + @ResponseBody | |
194 | + @TokenRequired | |
195 | + public BaseResponse findRegionAntEx(@Valid AntExManagerQueryRequest antExManagerQueryRequest,HttpServletRequest request){ | |
196 | + LoginContext loginState = (LoginContext) request.getAttribute("loginContext"); | |
197 | + return antExRecordFacade.findList(antExManagerQueryRequest,loginState.getId(),true); | |
185 | 198 | } |
186 | 199 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntExRecordFacade.java
View file @
17d17d7
... | ... | @@ -16,16 +16,14 @@ |
16 | 16 | import com.lyms.platform.operate.web.result.CjStatisticsListResult; |
17 | 17 | import com.lyms.platform.operate.web.result.CjStatisticsResult; |
18 | 18 | import com.lyms.platform.operate.web.result.HighScoreResult; |
19 | +import com.lyms.platform.operate.web.utils.CommonsHelper; | |
20 | +import com.lyms.platform.permission.model.Organization; | |
21 | +import com.lyms.platform.permission.model.OrganizationQuery; | |
19 | 22 | import com.lyms.platform.permission.model.Users; |
23 | +import com.lyms.platform.permission.service.OrganizationService; | |
20 | 24 | import com.lyms.platform.permission.service.UsersService; |
21 | -import com.lyms.platform.pojo.AntExRecordModel; | |
22 | -import com.lyms.platform.pojo.AntenatalExaminationModel; | |
23 | -import com.lyms.platform.pojo.BasicConfig; | |
24 | -import com.lyms.platform.pojo.Patients; | |
25 | -import com.lyms.platform.query.AntExChuQuery; | |
26 | -import com.lyms.platform.query.AntExQuery; | |
27 | -import com.lyms.platform.query.AntExRecordQuery; | |
28 | -import com.lyms.platform.query.PatientsQuery; | |
25 | +import com.lyms.platform.pojo.*; | |
26 | +import com.lyms.platform.query.*; | |
29 | 27 | import org.apache.commons.collections.CollectionUtils; |
30 | 28 | import org.apache.commons.lang.math.NumberUtils; |
31 | 29 | import org.springframework.beans.factory.annotation.Autowired; |
32 | 30 | |
33 | 31 | |
34 | 32 | |
35 | 33 | |
36 | 34 | |
37 | 35 | |
... | ... | @@ -55,26 +53,96 @@ |
55 | 53 | private CommonService commonService; |
56 | 54 | @Autowired |
57 | 55 | private AntenatalExaminationService antExService; |
56 | + @Autowired | |
57 | + private OrganizationService organizationService; | |
58 | + @Autowired | |
59 | + private DataPermissionService dataPermissionService; | |
58 | 60 | |
59 | 61 | public void syncAntRecordToList(String hospitalId) { |
60 | 62 | recordService.syncAntRecordToList(hospitalId); |
61 | 63 | } |
62 | 64 | |
65 | + | |
63 | 66 | /** |
64 | - * 产检管理 | |
67 | + * 组合查询请求 | |
65 | 68 | * |
66 | - * @return | |
69 | + * @param userId | |
70 | + * @param antExManagerQueryRequest | |
71 | + * @param isRegion | |
67 | 72 | */ |
68 | - public BaseResponse findList(AntExManagerQueryRequest antExManagerQueryRequest, Integer userId) { | |
69 | - String hospitalId = autoMatchFacade.getHospitalId(userId); | |
73 | + private AntExRecordQuery complayRequest(Integer userId,AntExManagerQueryRequest antExManagerQueryRequest,boolean isRegion){ | |
74 | + | |
70 | 75 | AntExRecordQuery antExRecordQuery = new AntExRecordQuery(); |
71 | - antExRecordQuery.setHospitalId(hospitalId); | |
72 | 76 | antExRecordQuery.setNeed("1"); |
73 | 77 | antExRecordQuery.setPage(antExManagerQueryRequest.getPage()); |
74 | 78 | antExRecordQuery.setLimit(antExManagerQueryRequest.getLimit()); |
75 | 79 | antExRecordQuery.setName(antExManagerQueryRequest.getName()); |
76 | 80 | antExRecordQuery.setPhone(antExManagerQueryRequest.getPhone()); |
77 | 81 | |
82 | + //区域范围内孕妇 | |
83 | + if (isRegion) { | |
84 | + List<String> hospitalList = null; | |
85 | + //王平说的 必须要给区域医院权限,不然他就是蠢逼 201611124 16:41 | |
86 | + hospitalList = new ArrayList<>(); | |
87 | + String hospital = autoMatchFacade.getHospitalId(userId); | |
88 | + if(null!=hospital){ | |
89 | + hospitalList.add(hospital); | |
90 | + } | |
91 | + DataPermissionsModelQuery dataPermissionsModelQuery = new DataPermissionsModelQuery(); | |
92 | + dataPermissionsModelQuery.setUserId(userId); | |
93 | + List<DataPermissionsModel> permissionsModels = dataPermissionService.queryPermission(dataPermissionsModelQuery); | |
94 | + if (CollectionUtils.isNotEmpty(permissionsModels)) { | |
95 | + Set<String> set = permissionsModels.get(0).getData().keySet(); | |
96 | + Iterator<String> it = set.iterator(); | |
97 | + while (it.hasNext()) { | |
98 | + String id = it.next(); | |
99 | + if (com.lyms.platform.common.utils.StringUtils.isNotEmpty(id) && !hospitalList.contains(id)) { | |
100 | + hospitalList.add(id); | |
101 | + } | |
102 | + } | |
103 | + } | |
104 | + | |
105 | + if (org.apache.commons.lang.StringUtils.isNotEmpty(antExManagerQueryRequest.gethId())) { | |
106 | + List<String> orgId = new ArrayList<>(); | |
107 | + orgId.add(antExManagerQueryRequest.gethId()); | |
108 | + hospitalList.retainAll(orgId); | |
109 | + } else if (com.lyms.platform.common.utils.StringUtils.isNotEmpty(antExManagerQueryRequest.getCprovinceId())) { | |
110 | + OrganizationQuery organizationQuery = new OrganizationQuery(); | |
111 | + organizationQuery.setYn(YnEnums.YES.getId()); | |
112 | + organizationQuery.setProvinceId(antExManagerQueryRequest.getCprovinceId()); | |
113 | + if (com.lyms.platform.common.utils.StringUtils.isNotEmpty(antExManagerQueryRequest.getCcityId())) { | |
114 | + organizationQuery.setCityId(antExManagerQueryRequest.getCcityId()); | |
115 | + if (com.lyms.platform.common.utils.StringUtils.isNotEmpty(antExManagerQueryRequest.getCareaId())) { | |
116 | + organizationQuery.setAreaId(antExManagerQueryRequest.getCareaId()); | |
117 | + } | |
118 | + } | |
119 | + List<String> orgId = new ArrayList<>(); | |
120 | + List<Organization> organizations = organizationService.queryOrganization(organizationQuery); | |
121 | + if (CollectionUtils.isNotEmpty(organizations)) { | |
122 | + for (Organization org : organizations) { | |
123 | + if (null != org.getId()) { | |
124 | + orgId.add(org.getId() + ""); | |
125 | + } | |
126 | + } | |
127 | + } | |
128 | + hospitalList.retainAll(orgId); | |
129 | + } | |
130 | + antExRecordQuery.setHospitalList(hospitalList); | |
131 | + } else { | |
132 | + String hospital = autoMatchFacade.getHospitalId(userId); | |
133 | + antExRecordQuery.setHospitalId(hospital); | |
134 | + } | |
135 | + return antExRecordQuery; | |
136 | + } | |
137 | + | |
138 | + /** | |
139 | + * 产检管理 | |
140 | + * | |
141 | + * @return | |
142 | + */ | |
143 | + public BaseResponse findList(AntExManagerQueryRequest antExManagerQueryRequest, Integer userId,boolean isRegion) { | |
144 | + AntExRecordQuery antExRecordQuery =complayRequest(userId,antExManagerQueryRequest,isRegion); | |
145 | + String hospital = autoMatchFacade.getHospitalId(userId); | |
78 | 146 | List<AntExManagerResult> data = new ArrayList<>(); |
79 | 147 | List<AntExRecordModel> antExRecordModelList = recordService.queryAntExRecords(antExRecordQuery); |
80 | 148 | if (CollectionUtils.isNotEmpty(antExRecordModelList)) { |
... | ... | @@ -83,6 +151,20 @@ |
83 | 151 | for (AntExRecordModel e : antExRecordModelList) { |
84 | 152 | AntExManagerResult antExManagerResult = new AntExManagerResult(); |
85 | 153 | antExManagerResult.convertToResult(e); |
154 | + if(isRegion){ | |
155 | + //产检医院 | |
156 | + if(StringUtils.isNotEmpty(e.getHospitalId())){ | |
157 | + Organization org = organizationService.getOrganization(Integer.valueOf(e.getHospitalId())); | |
158 | + if(null!=org){ | |
159 | + antExManagerResult.setCheckHospital(org.getName()); | |
160 | + }else{ | |
161 | + antExManagerResult.setCheckHospital(e.getHospitalId()); | |
162 | + } | |
163 | + } | |
164 | + antExManagerResult.setAddr(CommonsHelper.getResidence(e.getProvinceRegisterId(), e.getCityRegisterId(), e.getAreaRegisterId(), e.getStreetRegisterId(), e.getAddressRegister(), basicConfigService)); | |
165 | + } | |
166 | + | |
167 | + | |
86 | 168 | //登记人 |
87 | 169 | if (org.apache.commons.lang.StringUtils.isNotEmpty(e.getBuildDoctor())) { |
88 | 170 | if (NumberUtils.isNumber(e.getBuildDoctor())) { |
89 | 171 | |
... | ... | @@ -121,10 +203,10 @@ |
121 | 203 | int i = antExService.queryAntenatalExaminationCount(antExQuery.convertToQuery()); |
122 | 204 | antExChuQuery.setHospitalId(null); |
123 | 205 | int b = antExService.queryAntExChuCount(antExChuQuery.convertToQuery()); |
124 | - antExQuery.setHospitalId(hospitalId); | |
206 | + antExQuery.setHospitalId(hospital); | |
125 | 207 | //本院的复诊记录 |
126 | 208 | int chi = antExService.queryAntenatalExaminationCount(antExQuery.convertToQuery()); |
127 | - antExChuQuery.setHospitalId(hospitalId); | |
209 | + antExChuQuery.setHospitalId(hospital); | |
128 | 210 | //本院的初诊记录 |
129 | 211 | int chb = antExService.queryAntExChuCount(antExChuQuery.convertToQuery()); |
130 | 212 | antExManagerResult.settTimes(i + b); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PatientFacade.java
View file @
17d17d7
... | ... | @@ -461,7 +461,7 @@ |
461 | 461 | patientsQuery.setId(patientQueryRequest.getId()); |
462 | 462 | patientsQuery.setPhone(patientQueryRequest.getPhone()); |
463 | 463 | patientsQuery.setCardNo(patientQueryRequest.getCardNo()); |
464 | - String hospital = autoMatchFacade.getHospitalId(userId); | |
464 | + | |
465 | 465 | Patients patients = antenatalExaminationFacade.findOnePatient(patientQueryRequest.getCardNo(), null, patientQueryRequest.getId(), groupsFacade.findGroupHospital(userId), -1, false, patientQueryRequest.getPid(),false); |
466 | 466 | PatientBaseResult patientBaseResult = new PatientBaseResult(); |
467 | 467 | if (null != patients) { |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/AntExManagerQueryRequest.java
View file @
17d17d7
... | ... | @@ -15,12 +15,131 @@ |
15 | 15 | private String phone; |
16 | 16 | //产检日期 |
17 | 17 | private String cTime; |
18 | + //建档时间 | |
19 | + private String bTime; | |
20 | + //预产期 | |
21 | + private String dueTime; | |
18 | 22 | //高危等级 |
19 | 23 | private String level; |
20 | 24 | //高危因素 |
21 | 25 | private String riskFactorId; |
22 | 26 | //条码 |
23 | 27 | private String barCode; |
28 | + | |
29 | + | |
30 | + //户籍id | |
31 | + private String provinceRegisterId; | |
32 | + private String cityRegisterId; | |
33 | + private String areaRegisterId; | |
34 | + | |
35 | + //居住地 | |
36 | + private String provinceId; | |
37 | + private String cityId; | |
38 | + private String areaId; | |
39 | + | |
40 | + //产检医院 | |
41 | + private String cprovinceId; | |
42 | + private String ccityId; | |
43 | + private String careaId; | |
44 | + // 医院id | |
45 | + private String hId; | |
46 | + | |
47 | + | |
48 | + public String getProvinceRegisterId() { | |
49 | + return provinceRegisterId; | |
50 | + } | |
51 | + | |
52 | + public void setProvinceRegisterId(String provinceRegisterId) { | |
53 | + this.provinceRegisterId = provinceRegisterId; | |
54 | + } | |
55 | + | |
56 | + public String getCityRegisterId() { | |
57 | + return cityRegisterId; | |
58 | + } | |
59 | + | |
60 | + public void setCityRegisterId(String cityRegisterId) { | |
61 | + this.cityRegisterId = cityRegisterId; | |
62 | + } | |
63 | + | |
64 | + public String getAreaRegisterId() { | |
65 | + return areaRegisterId; | |
66 | + } | |
67 | + | |
68 | + public void setAreaRegisterId(String areaRegisterId) { | |
69 | + this.areaRegisterId = areaRegisterId; | |
70 | + } | |
71 | + | |
72 | + public String getProvinceId() { | |
73 | + return provinceId; | |
74 | + } | |
75 | + | |
76 | + public void setProvinceId(String provinceId) { | |
77 | + this.provinceId = provinceId; | |
78 | + } | |
79 | + | |
80 | + public String getCityId() { | |
81 | + return cityId; | |
82 | + } | |
83 | + | |
84 | + public void setCityId(String cityId) { | |
85 | + this.cityId = cityId; | |
86 | + } | |
87 | + | |
88 | + public String getAreaId() { | |
89 | + return areaId; | |
90 | + } | |
91 | + | |
92 | + public void setAreaId(String areaId) { | |
93 | + this.areaId = areaId; | |
94 | + } | |
95 | + | |
96 | + public String getCprovinceId() { | |
97 | + return cprovinceId; | |
98 | + } | |
99 | + | |
100 | + public void setCprovinceId(String cprovinceId) { | |
101 | + this.cprovinceId = cprovinceId; | |
102 | + } | |
103 | + | |
104 | + public String getCcityId() { | |
105 | + return ccityId; | |
106 | + } | |
107 | + | |
108 | + public void setCcityId(String ccityId) { | |
109 | + this.ccityId = ccityId; | |
110 | + } | |
111 | + | |
112 | + public String getCareaId() { | |
113 | + return careaId; | |
114 | + } | |
115 | + | |
116 | + public void setCareaId(String careaId) { | |
117 | + this.careaId = careaId; | |
118 | + } | |
119 | + | |
120 | + public String gethId() { | |
121 | + return hId; | |
122 | + } | |
123 | + | |
124 | + public void sethId(String hId) { | |
125 | + this.hId = hId; | |
126 | + } | |
127 | + | |
128 | + public String getDueTime() { | |
129 | + return dueTime; | |
130 | + } | |
131 | + | |
132 | + public void setDueTime(String dueTime) { | |
133 | + this.dueTime = dueTime; | |
134 | + } | |
135 | + | |
136 | + public String getbTime() { | |
137 | + return bTime; | |
138 | + } | |
139 | + | |
140 | + public void setbTime(String bTime) { | |
141 | + this.bTime = bTime; | |
142 | + } | |
24 | 143 | |
25 | 144 | public String getName() { |
26 | 145 | return name; |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/AntExManagerResult.java
View file @
17d17d7
... | ... | @@ -51,6 +51,27 @@ |
51 | 51 | //联系电话 |
52 | 52 | private String phone; |
53 | 53 | |
54 | + private String checkHospital; | |
55 | + | |
56 | + private String addr; | |
57 | + | |
58 | + | |
59 | + public String getAddr() { | |
60 | + return addr; | |
61 | + } | |
62 | + | |
63 | + public void setAddr(String addr) { | |
64 | + this.addr = addr; | |
65 | + } | |
66 | + | |
67 | + public String getCheckHospital() { | |
68 | + return checkHospital; | |
69 | + } | |
70 | + | |
71 | + public void setCheckHospital(String checkHospital) { | |
72 | + this.checkHospital = checkHospital; | |
73 | + } | |
74 | + | |
54 | 75 | public List<Map> getrLevel() { |
55 | 76 | return rLevel; |
56 | 77 | } |