Commit 8b2bd34e98ea2a72db16544cbc0b3b342fd898a3

Authored by jiangjiazhi

Merge remote-tracking branch 'origin/master'

Showing 8 changed files

platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BabyBookbuildingController.java View file @ 8b2bd34
... ... @@ -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 @ 8b2bd34
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 @ 8b2bd34
... ... @@ -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 @ 8b2bd34
... ... @@ -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 @ 8b2bd34
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);
... ... @@ -255,6 +254,7 @@
255 254 result.setBookbuildDate(DateUtil.getyyyy_MM_dd(pat.getBookbuildingDate()));
256 255 result.setId(pat.getId());
257 256 result.setType(pat.getType());
  257 + result.setDueStatus(pat.getDueStatus());
258 258 results.add(result);
259 259 }
260 260 }
... ... @@ -573,6 +573,25 @@
573 573 objectResponse.setErrorcode(ErrorCodeConstants.SUCCESS);
574 574 objectResponse.setErrormsg("成功");
575 575 return objectResponse;
  576 + }
  577 +
  578 + /**
  579 + * 删除孕妇建档
  580 + * @param id
  581 + * @return
  582 + */
  583 + public BaseResponse deletePregnantById(String id) {
  584 + AntExChuQuery antExChuQuery = new AntExChuQuery();
  585 + antExChuQuery.setParentId(id);
  586 + antExChuQuery.setYn(YnEnums.YES.getId());
  587 + //获取初诊记录
  588 + List<AntExChuModel> antExChulist = antenatalExaminationService.queryAntExChu(antExChuQuery);
  589 + if (CollectionUtils.isNotEmpty(antExChulist))
  590 + {
  591 + return new BaseResponse().setErrorcode(ErrorCodeConstants.DONT_DELETE).setErrormsg("孕妇存在检查记录,不能删除建档");
  592 + }
  593 + yunBookbuildingService.deletePregnantById(id);
  594 + return new BaseResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功");
576 595 }
577 596 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/SmsConfigFacade.java View file @ 8b2bd34
... ... @@ -426,6 +426,7 @@
426 426 if (model != null && StringUtils.isNotEmpty(model.getId()))
427 427 {
428 428 model.setHighConfig(highConfig);
  429 + model.setRemark(remark);
429 430 smsConfigService.updateSmsConfig(model, model.getId());
430 431 isExist = true;
431 432 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/StopPregnancyFacade.java View file @ 8b2bd34
1 1 package com.lyms.platform.operate.web.facade;
2 2  
3   -import com.lyms.platform.biz.service.AntenatalExaminationService;
4   -import com.lyms.platform.biz.service.BasicConfigService;
5   -import com.lyms.platform.biz.service.PatientsService;
6   -import com.lyms.platform.biz.service.StopPregnancyService;
  3 +import com.lyms.platform.biz.service.*;
7 4 import com.lyms.platform.common.constants.ErrorCodeConstants;
8 5 import com.lyms.platform.common.enums.StopPregEnums;
9 6 import com.lyms.platform.common.enums.YnEnums;
... ... @@ -51,6 +48,9 @@
51 48 @Autowired
52 49 private BasicConfigService basicConfigService;
53 50  
  51 + @Autowired
  52 + private YunBookbuildingService yunBookbuildingService;
  53 +
54 54 /**
55 55 * 更新终止妊娠
56 56 * @param request
... ... @@ -60,7 +60,7 @@
60 60 StopPregModel model = getStopPregModel(request);
61 61 model.setModified(new Date());
62 62  
63   - stopPregnancyService.updateStopPreg(model,request.getId());
  63 + stopPregnancyService.updateStopPreg(model, request.getId());
64 64 BaseResponse objectResponse = new BaseResponse();
65 65 objectResponse.setErrorcode(ErrorCodeConstants.SUCCESS);
66 66 objectResponse.setErrormsg("成功");
... ... @@ -73,6 +73,27 @@
73 73 * @return
74 74 */
75 75 public BaseResponse addStopPreg(StopPregRequest request) {
  76 +
  77 +
  78 + PatientsQuery patientsQuery = new PatientsQuery();
  79 + patientsQuery.setYn(YnEnums.YES.getId());
  80 + patientsQuery.setType(1);
  81 + patientsQuery.setId(request.getId());
  82 + patientsQuery.setHospitalId(request.getHospitalId());
  83 +
  84 + List<Patients> patients = yunBookbuildingService.queryPregnantWithQuery(patientsQuery);
  85 + if (CollectionUtils.isNotEmpty(patients))
  86 + {
  87 + Patients patient = patients.get(0);
  88 + if (patient != null)
  89 + {
  90 + patient.setModified(new Date());
  91 + patient.setDueStatus(1);
  92 + //分娩状态 0未终止妊娠 1终止妊娠
  93 + yunBookbuildingService.updatePregnant(patient, request.getPid());
  94 + }
  95 +
  96 + }
76 97  
77 98 StopPregModel model = getStopPregModel(request);
78 99 model.setCreated(new Date());
platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/BookbuildingRecordResult.java View file @ 8b2bd34
... ... @@ -16,6 +16,18 @@
16 16 //1孕妇 3产妇
17 17 private Integer type;
18 18  
  19 +
  20 + //分娩状态 0未终止妊娠 1终止妊娠
  21 + private Integer dueStatus;
  22 +
  23 + public Integer getDueStatus() {
  24 + return dueStatus;
  25 + }
  26 +
  27 + public void setDueStatus(Integer dueStatus) {
  28 + this.dueStatus = dueStatus;
  29 + }
  30 +
19 31 public Integer getType() {
20 32 return type;
21 33 }