Commit 960c6cb0ab8d4d5df020bd781343879ccdd3f228
1 parent
221d0648e4
Exists in
master
and in
8 other branches
修改新电子病历
Showing 1 changed file with 35 additions and 10 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PostReviewFacade.java
View file @
960c6cb
... | ... | @@ -23,10 +23,8 @@ |
23 | 23 | import com.lyms.platform.permission.model.Users; |
24 | 24 | import com.lyms.platform.permission.service.OrganizationService; |
25 | 25 | import com.lyms.platform.permission.service.UsersService; |
26 | -import com.lyms.platform.pojo.MaternalDeliverModel; | |
27 | -import com.lyms.platform.pojo.Patients; | |
28 | -import com.lyms.platform.pojo.PostReviewModel; | |
29 | -import com.lyms.platform.pojo.ReferralApplyOrderModel; | |
26 | +import com.lyms.platform.pojo.*; | |
27 | +import com.lyms.platform.query.AntExQuery; | |
30 | 28 | import com.lyms.platform.query.MatDeliverQuery; |
31 | 29 | import com.lyms.platform.query.PostReviewQuery; |
32 | 30 | import com.lyms.platform.query.ReferralApplyOrderQuery; |
... | ... | @@ -268,12 +266,39 @@ |
268 | 266 | * @param id |
269 | 267 | * @return |
270 | 268 | */ |
271 | - public BaseResponse updateOnePost(String id){ | |
272 | - PostReviewModel postReviewModel=new PostReviewModel(); | |
273 | - postReviewModel.setYn(YnEnums.NO.getId()); | |
274 | - postReviewModel.setId(id); | |
275 | - postReviewService.updatePostById(postReviewModel,id); | |
276 | - return new BaseResponse().setErrormsg("成功").setErrorcode(ErrorCodeConstants.SUCCESS); | |
269 | + public BaseResponse updateOnePost(String id,Integer userId){ | |
270 | + String hospital = autoMatchFacade.getHospitalId(userId); | |
271 | + PostReviewQuery antExQuery = new PostReviewQuery(); | |
272 | + antExQuery.setId(id); | |
273 | + antExQuery.setYn(YnEnums.YES.getId()); | |
274 | + antExQuery.setHospitalId(hospital); | |
275 | + | |
276 | + List<PostReviewModel> list = postReviewService.findWithList(antExQuery.convertToQuery()); | |
277 | + //TODO 需要根据时间去查询是否是本院最后一条记录 | |
278 | + if (CollectionUtils.isNotEmpty(list)) { | |
279 | + antExQuery.setStart(new Date(list.get(0).getCheckTime().getTime() + 40000)); | |
280 | + antExQuery.setParentId(list.get(0).getParentId()); | |
281 | + } | |
282 | + antExQuery.setId(null); | |
283 | + | |
284 | + list =postReviewService.findWithList(antExQuery.convertToQuery()); | |
285 | + if(CollectionUtils.isNotEmpty(list)){ | |
286 | + for(int i=0;i<list.size();i++){ | |
287 | + if(list.get(i).getId().equals(id)){ | |
288 | + list.remove(i); | |
289 | + } | |
290 | + } | |
291 | + } | |
292 | + | |
293 | + if(CollectionUtils.isNotEmpty(list)){ | |
294 | + PostReviewModel postReviewModel=new PostReviewModel(); | |
295 | + postReviewModel.setYn(YnEnums.NO.getId()); | |
296 | + postReviewModel.setId(id); | |
297 | + postReviewService.updatePostById(postReviewModel,id); | |
298 | + return new BaseResponse().setErrormsg("成功").setErrorcode(ErrorCodeConstants.SUCCESS); | |
299 | + }else{ | |
300 | + return new BaseResponse().setErrorcode(ErrorCodeConstants.BUSINESS_ERROR).setErrormsg("当前复查记录不是本院最新的复查记录,不能删除"); | |
301 | + } | |
277 | 302 | } |
278 | 303 | } |