Commit e6b0b05d630a14d42d20374884df72fb15be1dd8
1 parent
7406c4ef88
Exists in
master
and in
6 other branches
update code
Showing 3 changed files with 82 additions and 21 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/TestController.java
View file @
e6b0b05
... | ... | @@ -76,6 +76,8 @@ |
76 | 76 | @Autowired |
77 | 77 | private BabyCheckService babyCheckService; |
78 | 78 | |
79 | + @Autowired | |
80 | + private PostReviewService postReviewService; | |
79 | 81 | |
80 | 82 | @Autowired |
81 | 83 | private BabyCheckFacade babyCheckFacade; |
... | ... | @@ -337,6 +339,52 @@ |
337 | 339 | |
338 | 340 | return "update finish"; |
339 | 341 | } |
342 | + | |
343 | + | |
344 | + /** | |
345 | + * 修正产后复查次数 | |
346 | + * @param hospitalId | |
347 | + * @return | |
348 | + */ | |
349 | + @RequestMapping(value = "/updatePostViewTimes", method = RequestMethod.GET) | |
350 | + @ResponseBody | |
351 | + public String updatePostViewTimes(@RequestParam(required = true) String hospitalId,@RequestParam(required = false) String patientId) { | |
352 | + PatientsQuery patientsQuery1 = new PatientsQuery(); | |
353 | + patientsQuery1.setYn(YnEnums.YES.getId()); | |
354 | + patientsQuery1.setHospitalId(hospitalId); | |
355 | + patientsQuery1.setType(3); //查询产妇 | |
356 | + patientsQuery1.setExtEnable(false); | |
357 | + patientsQuery1.setId(patientId); | |
358 | + List<Patients> pats = patientsService.queryPatient(patientsQuery1); | |
359 | + System.out.println("main="+pats.size()); | |
360 | + if (CollectionUtils.isNotEmpty(pats)) { | |
361 | + for (Patients pat : pats) { | |
362 | + if (StringUtils.isNotEmpty(pat.getPid())) | |
363 | + { | |
364 | + PostReviewQuery postReviewQuery = new PostReviewQuery(); | |
365 | + postReviewQuery.setPid(pat.getPid()); | |
366 | + postReviewQuery.setYn(YnEnums.YES.getId()); | |
367 | + List<PostReviewModel> postReviewModels = postReviewService.findWithList(postReviewQuery); | |
368 | + if (CollectionUtils.isNotEmpty(postReviewModels)) | |
369 | + { | |
370 | + System.out.println("postReviewModels="+postReviewModels.size()+";patientid="+pat.getId()); | |
371 | + for(PostReviewModel postReviewModel : postReviewModels) | |
372 | + { | |
373 | + Patients patients = patientsService.findOnePatientById(postReviewModel.getParentId()); | |
374 | + patients.setPostViewTimes(postReviewModels.size()); | |
375 | + patientsService.updatePatient(patients); | |
376 | + } | |
377 | + } | |
378 | + | |
379 | + } | |
380 | + | |
381 | + } | |
382 | + } | |
383 | + return "updatePostViewTimes finish"; | |
384 | + } | |
385 | + | |
386 | + | |
387 | + | |
340 | 388 | |
341 | 389 | @RequestMapping(value = "/rebuildDefaultRoles", method = RequestMethod.GET) |
342 | 390 | @ResponseBody |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PostReviewFacade.java
View file @
e6b0b05
... | ... | @@ -129,35 +129,49 @@ |
129 | 129 | |
130 | 130 | |
131 | 131 | //修改非主档案 同时修改主档案的产后复查次数增加 |
132 | - if (StringUtils.isNotEmpty(patients1.getSource())) | |
132 | + if (StringUtils.isNotEmpty(patients1.getPid())) | |
133 | 133 | { |
134 | - Patients mainPatients = patientsService.findOnePatientById(patients1.getSource()); | |
134 | + PatientsQuery patientsQuery1 = new PatientsQuery(); | |
135 | + patientsQuery1.setYn(YnEnums.YES.getId()); | |
136 | + patientsQuery1.setPid(patients1.getPid()); | |
135 | 137 | |
136 | - if (null != patients1.getPostViewTimes()) { | |
138 | + List<Patients> pats = patientsService.queryPatient(patientsQuery1); | |
139 | + | |
140 | + if (null != patients1.getPostViewTimes()) | |
141 | + { | |
137 | 142 | Patients patients2 = new Patients(); |
138 | 143 | patients2.setPostViewTimes(patients1.getPostViewTimes() + 1); |
139 | - patients2.setId(mainPatients.getId()); | |
140 | - patientsService.updatePatient(patients2); | |
141 | - } else { | |
144 | + for (Patients pat : pats) | |
145 | + { | |
146 | + patients2.setId(pat.getId()); | |
147 | + patientsService.updatePatient(patients2); | |
148 | + } | |
149 | + | |
150 | + } | |
151 | + else | |
152 | + { | |
142 | 153 | Patients patients2 = new Patients(); |
143 | 154 | patients2.setPostViewTimes(1); |
144 | - patients2.setId(mainPatients.getId()); | |
145 | - patientsService.updatePatient(patients2); | |
146 | - } | |
155 | + for (Patients pat : pats) | |
156 | + { | |
157 | + patients2.setId(pat.getId()); | |
158 | + patientsService.updatePatient(patients2); | |
159 | + } | |
147 | 160 | |
161 | + } | |
148 | 162 | } |
149 | 163 | |
150 | - if (null != patients1.getPostViewTimes()) { | |
151 | - Patients patients2 = new Patients(); | |
152 | - patients2.setPostViewTimes(patients1.getPostViewTimes() + 1); | |
153 | - patients2.setId(patients1.getId()); | |
154 | - patientsService.updatePatient(patients2); | |
155 | - } else { | |
156 | - Patients patients2 = new Patients(); | |
157 | - patients2.setPostViewTimes(1); | |
158 | - patients2.setId(patients1.getId()); | |
159 | - patientsService.updatePatient(patients2); | |
160 | - } | |
164 | +// if (null != patients1.getPostViewTimes()) { | |
165 | +// Patients patients2 = new Patients(); | |
166 | +// patients2.setPostViewTimes(patients1.getPostViewTimes() + 1); | |
167 | +// patients2.setId(patients1.getId()); | |
168 | +// patientsService.updatePatient(patients2); | |
169 | +// } else { | |
170 | +// Patients patients2 = new Patients(); | |
171 | +// patients2.setPostViewTimes(1); | |
172 | +// patients2.setId(patients1.getId()); | |
173 | +// patientsService.updatePatient(patients2); | |
174 | +// } | |
161 | 175 | |
162 | 176 | |
163 | 177 | patientsService.updateNextCheckTime(postReviewRequest.getNextCheckTime(),patients.getId()); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/SieveRecordFacade.java
View file @
e6b0b05
... | ... | @@ -397,7 +397,6 @@ |
397 | 397 | SieveRecordQuery query = new SieveRecordQuery(); |
398 | 398 | query.setYn(YnEnums.YES.getId()); |
399 | 399 | query.setId(id); |
400 | - query.setStatus(0); | |
401 | 400 | PregnantInfoResult result = new PregnantInfoResult(); |
402 | 401 | List<SieveRecordModel> list = sieveRecordService.query(query); |
403 | 402 | if (list != null && list.size() > 0) { |