Commit 6056036badf522952b008bc12c26923701025b8f
1 parent
4ef93d44f3
Exists in
master
and in
8 other branches
修改儿童建档和孕妇建档删除接口
Showing 5 changed files with 46 additions and 21 deletions
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BabyBookbuildingController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BabyCheckController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BookbuildingController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyBookbuildingFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BookbuildingFacade.java
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BabyBookbuildingController.java
View file @
6056036
| ... | ... | @@ -62,8 +62,8 @@ |
| 62 | 62 | @RequestMapping(value = "/deleteBabyBuildById/{id}", method = RequestMethod.DELETE) |
| 63 | 63 | @ResponseBody |
| 64 | 64 | public BaseResponse deleteBabyBuildById(@PathVariable("id") String id) { |
| 65 | - babyBookbuildingFacade.deleteBabyBuildById(id); | |
| 66 | - return new BaseResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功"); | |
| 65 | + return babyBookbuildingFacade.deleteBabyBuildById(id); | |
| 66 | + | |
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BabyCheckController.java
View file @
6056036
| 1 | 1 | package com.lyms.platform.operate.web.controller; |
| 2 | 2 | |
| 3 | 3 | |
| 4 | -import com.lyms.platform.biz.service.BabyBookbuildingService; | |
| 5 | 4 | import com.lyms.platform.biz.service.BabyCheckService; |
| 6 | 5 | import com.lyms.platform.common.base.BaseController; |
| 7 | 6 | import com.lyms.platform.common.constants.ErrorCodeConstants; |
| 8 | 7 | import com.lyms.platform.common.result.BaseObjectResponse; |
| 9 | 8 | import com.lyms.platform.common.result.BaseResponse; |
| 10 | 9 | import com.lyms.platform.common.utils.StringUtils; |
| 11 | -import com.lyms.platform.operate.web.facade.BabyBookbuildingFacade; | |
| 12 | 10 | import com.lyms.platform.operate.web.facade.BabyCheckFacade; |
| 13 | -import com.lyms.platform.operate.web.request.BabyBookbuildingAddRequest; | |
| 14 | 11 | import com.lyms.platform.operate.web.request.BabyCheckRequest; |
| 15 | -import com.lyms.platform.operate.web.request.BookbuildingQueryRequest; | |
| 16 | 12 | import org.springframework.beans.factory.annotation.Autowired; |
| 17 | 13 | import org.springframework.stereotype.Controller; |
| 18 | 14 | import org.springframework.web.bind.annotation.*; |
| ... | ... | @@ -25,9 +21,7 @@ |
| 25 | 21 | */ |
| 26 | 22 | @Controller |
| 27 | 23 | public class BabyCheckController extends BaseController{ |
| 28 | - | |
| 29 | - @Autowired | |
| 30 | - private BabyCheckService babyCheckService; | |
| 24 | + | |
| 31 | 25 | |
| 32 | 26 | @Autowired |
| 33 | 27 | private BabyCheckFacade babyCheckFacade; |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BookbuildingController.java
View file @
6056036
| ... | ... | @@ -80,8 +80,7 @@ |
| 80 | 80 | @RequestMapping(value = "/deletePregnant/{id}", method = RequestMethod.DELETE) |
| 81 | 81 | @ResponseBody |
| 82 | 82 | public BaseResponse deletePregnantById(@PathVariable("id")String id){ |
| 83 | - yunBookbuildingService.deletePregnantById(id); | |
| 84 | - return new BaseResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功"); | |
| 83 | + return bookbuildingFacade.deletePregnantById(id); | |
| 85 | 84 | } |
| 86 | 85 | |
| 87 | 86 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyBookbuildingFacade.java
View file @
6056036
| ... | ... | @@ -61,6 +61,9 @@ |
| 61 | 61 | @Autowired |
| 62 | 62 | private SmsTemplateService smsTemplateService; |
| 63 | 63 | |
| 64 | + @Autowired | |
| 65 | + private BabyCheckService babyCheckService; | |
| 66 | + | |
| 64 | 67 | public BaseResponse getBabyBase(String babyId){ |
| 65 | 68 | //查询儿童的基本信息 |
| 66 | 69 | BabyBasicResult base = new BabyBasicResult(); |
| 67 | 70 | |
| ... | ... | @@ -423,8 +426,19 @@ |
| 423 | 426 | * |
| 424 | 427 | * @param id |
| 425 | 428 | */ |
| 426 | - public void deleteBabyBuildById(String id) { | |
| 429 | + public BaseResponse deleteBabyBuildById(String id) { | |
| 430 | + | |
| 431 | + BabyCheckModelQuery query = new BabyCheckModelQuery(); | |
| 432 | + query.setYn(YnEnums.YES.getId()); | |
| 433 | + query.setBuildId(id); | |
| 434 | + List<BabyCheckModel> checkModels = babyCheckService.queryBabyCheckRecord(query); | |
| 435 | + if (CollectionUtils.isNotEmpty(checkModels)) | |
| 436 | + { | |
| 437 | + return new BaseResponse().setErrorcode(ErrorCodeConstants.DONT_DELETE).setErrormsg("存在儿童检查记录,不能删除建档"); | |
| 438 | + } | |
| 439 | + | |
| 427 | 440 | babyBookbuildingService.deleteBabyById(id); |
| 441 | + return new BaseResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功"); | |
| 428 | 442 | } |
| 429 | 443 | |
| 430 | 444 | /** |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BookbuildingFacade.java
View file @
6056036
| 1 | 1 | package com.lyms.platform.operate.web.facade; |
| 2 | 2 | |
| 3 | 3 | import com.lyms.platform.biz.dal.IPersonDao; |
| 4 | -import com.lyms.platform.biz.service.BasicConfigService; | |
| 5 | -import com.lyms.platform.biz.service.PersonService; | |
| 6 | -import com.lyms.platform.biz.service.SmsTemplateService; | |
| 4 | +import com.lyms.platform.biz.service.*; | |
| 7 | 5 | import com.lyms.platform.common.enums.*; |
| 8 | 6 | import com.lyms.platform.common.result.BaseListResponse; |
| 7 | +import com.lyms.platform.common.result.BaseResponse; | |
| 9 | 8 | import com.lyms.platform.common.utils.JsonUtil; |
| 10 | 9 | import com.lyms.platform.common.utils.StringUtils; |
| 11 | 10 | import com.lyms.platform.common.utils.SystemConfig; |
| ... | ... | @@ -17,9 +16,8 @@ |
| 17 | 16 | import com.lyms.platform.operate.web.result.PregnantInfoResult; |
| 18 | 17 | import com.lyms.platform.permission.model.Organization; |
| 19 | 18 | import com.lyms.platform.permission.service.OrganizationService; |
| 20 | -import com.lyms.platform.pojo.BasicConfig; | |
| 21 | -import com.lyms.platform.pojo.PersonModel; | |
| 22 | -import com.lyms.platform.pojo.SmsTemplateModel; | |
| 19 | +import com.lyms.platform.pojo.*; | |
| 20 | +import com.lyms.platform.query.AntExChuQuery; | |
| 23 | 21 | import com.lyms.platform.query.BasicConfigQuery; |
| 24 | 22 | import com.lyms.platform.query.PatientsQuery; |
| 25 | 23 | import com.lyms.platform.query.SmsTemplateQuery; |
| 26 | 24 | |
| ... | ... | @@ -27,12 +25,10 @@ |
| 27 | 25 | import org.springframework.beans.factory.annotation.Autowired; |
| 28 | 26 | import org.springframework.stereotype.Component; |
| 29 | 27 | |
| 30 | -import com.lyms.platform.biz.service.YunBookbuildingService; | |
| 31 | 28 | import com.lyms.platform.common.constants.ErrorCodeConstants; |
| 32 | 29 | import com.lyms.platform.common.result.BaseObjectResponse; |
| 33 | 30 | import com.lyms.platform.common.utils.DateUtil; |
| 34 | 31 | import com.lyms.platform.operate.web.request.YunBookbuildingAddRequest; |
| 35 | -import com.lyms.platform.pojo.Patients; | |
| 36 | 32 | |
| 37 | 33 | import java.util.*; |
| 38 | 34 | |
| ... | ... | @@ -58,6 +54,9 @@ |
| 58 | 54 | @Autowired |
| 59 | 55 | private SmsTemplateService smsTemplateService; |
| 60 | 56 | |
| 57 | + | |
| 58 | + @Autowired | |
| 59 | + private AntenatalExaminationService antenatalExaminationService; | |
| 61 | 60 | /** |
| 62 | 61 | * 添加孕妇建档 |
| 63 | 62 | * @param yunRequest |
| ... | ... | @@ -198,7 +197,7 @@ |
| 198 | 197 | pmodel.setType(1); |
| 199 | 198 | pmodel.setYn(YnEnums.YES.getId()); |
| 200 | 199 | pmodel.setModified(new Date()); |
| 201 | - personService.updatePerson(pmodel,yunRequest.getPid()); | |
| 200 | + personService.updatePerson(pmodel, yunRequest.getPid()); | |
| 202 | 201 | } |
| 203 | 202 | |
| 204 | 203 | yunBookbuildingService.updatePregnant(patient, id); |
| ... | ... | @@ -573,6 +572,25 @@ |
| 573 | 572 | objectResponse.setErrorcode(ErrorCodeConstants.SUCCESS); |
| 574 | 573 | objectResponse.setErrormsg("成功"); |
| 575 | 574 | return objectResponse; |
| 575 | + } | |
| 576 | + | |
| 577 | + /** | |
| 578 | + * 删除孕妇建档 | |
| 579 | + * @param id | |
| 580 | + * @return | |
| 581 | + */ | |
| 582 | + public BaseResponse deletePregnantById(String id) { | |
| 583 | + AntExChuQuery antExChuQuery = new AntExChuQuery(); | |
| 584 | + antExChuQuery.setParentId(id); | |
| 585 | + antExChuQuery.setYn(YnEnums.YES.getId()); | |
| 586 | + //获取初诊记录 | |
| 587 | + List<AntExChuModel> antExChulist = antenatalExaminationService.queryAntExChu(antExChuQuery); | |
| 588 | + if (CollectionUtils.isNotEmpty(antExChulist)) | |
| 589 | + { | |
| 590 | + return new BaseResponse().setErrorcode(ErrorCodeConstants.DONT_DELETE).setErrormsg("孕妇存在检查记录,不能删除建档"); | |
| 591 | + } | |
| 592 | + yunBookbuildingService.deletePregnantById(id); | |
| 593 | + return new BaseResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功"); | |
| 576 | 594 | } |
| 577 | 595 | } |