Commit b940fe608a23317bb474378add54a8d9f05d2033
1 parent
bd60bc19a4
Exists in
master
and in
6 other branches
产检追访数据处理
Showing 2 changed files with 44 additions and 0 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/TrackDownController.java
View file @
b940fe6
| ... | ... | @@ -211,5 +211,18 @@ |
| 211 | 211 | return downFacade.getTrackCount(orderTime, getUserId(request)); |
| 212 | 212 | } |
| 213 | 213 | |
| 214 | + | |
| 215 | + /** | |
| 216 | + * 处理产检追访的数据问题 | |
| 217 | + * @param hospitalId | |
| 218 | + * @param request | |
| 219 | + * @return | |
| 220 | + */ | |
| 221 | + @RequestMapping(value = "/handleData", method = RequestMethod.GET) | |
| 222 | + @ResponseBody | |
| 223 | + public BaseResponse handleData(@RequestParam String hospitalId,@RequestParam String handle,HttpServletRequest request) { | |
| 224 | + return downFacade.handleData(hospitalId,handle); | |
| 225 | + } | |
| 226 | + | |
| 214 | 227 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/TrackDownFacade.java
View file @
b940fe6
| ... | ... | @@ -248,6 +248,37 @@ |
| 248 | 248 | |
| 249 | 249 | return str; |
| 250 | 250 | } |
| 251 | + | |
| 252 | + public BaseResponse handleData(String hospitalId,String handle) { | |
| 253 | + | |
| 254 | + TrackDownRecordQuery downRecordQuery = new TrackDownRecordQuery(); | |
| 255 | + downRecordQuery.setNeed(null); | |
| 256 | + downRecordQuery.setHospitalId(hospitalId); | |
| 257 | + downRecordQuery.setTrackType(5); | |
| 258 | + downRecordQuery.setLastMensesStart(DateUtil.addMonth(new Date(),-9)); | |
| 259 | + downRecordQuery.setLastMensesEnd(new Date()); | |
| 260 | + | |
| 261 | + List<TrackDownRecord> downRecordList = trackDownRecordService.queryTrackDown(downRecordQuery); | |
| 262 | + if (CollectionUtils.isNotEmpty(downRecordList)) | |
| 263 | + { | |
| 264 | + for (TrackDownRecord record : downRecordList) { | |
| 265 | + Patients patients = patientsService.findOnePatientById(record.getParentId()); | |
| 266 | + | |
| 267 | + if (patients != null && patients.getType() == 1 && DateUtil.addDay(patients.getDueDate(),-21).getTime() > new Date().getTime()) | |
| 268 | + { | |
| 269 | + System.out.println("cardno========"+record.getCardNo()); | |
| 270 | + if (handle.equals("true")) | |
| 271 | + { | |
| 272 | + record.setTrackType(3); | |
| 273 | + trackDownRecordService.updateTrackDown(record,record.getId()); | |
| 274 | + } | |
| 275 | + } | |
| 276 | + } | |
| 277 | + } | |
| 278 | + | |
| 279 | + return new BaseObjectResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功"); | |
| 280 | + } | |
| 281 | + | |
| 251 | 282 | /** |
| 252 | 283 | * 构建返回字段 |
| 253 | 284 | */ |