Commit 903e37e6bd566d6e999b268fdbd35b2cc254bfa3
1 parent
9321e796ab
Exists in
master
and in
7 other branches
1
Showing 5 changed files with 38 additions and 23 deletions
- platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/PatientCheckTicketService.java
- platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/PatientsService.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/MatDeliverFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/StopPregnancyFacade.java
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/PatientCheckTicketService.java
View file @
903e37e
| 1 | 1 | package com.lyms.platform.biz.service; |
| 2 | 2 | |
| 3 | +import com.lyms.platform.biz.dal.IPatientDao; | |
| 3 | 4 | import com.lyms.platform.biz.dal.PatientCheckTicketDao; |
| 4 | 5 | import com.lyms.platform.common.dao.operator.MongoQuery; |
| 5 | 6 | import com.lyms.platform.pojo.PatientCheckTicket; |
| 7 | +import com.lyms.platform.pojo.Patients; | |
| 6 | 8 | import com.lyms.platform.query.PatientCheckTicketQuery; |
| 7 | 9 | import org.apache.commons.lang.StringUtils; |
| 8 | 10 | import org.springframework.beans.factory.annotation.Autowired; |
| ... | ... | @@ -20,6 +22,8 @@ |
| 20 | 22 | |
| 21 | 23 | @Autowired |
| 22 | 24 | private PatientCheckTicketDao patientCheckTicketDao; |
| 25 | + @Autowired | |
| 26 | + private IPatientDao patientDao; | |
| 23 | 27 | |
| 24 | 28 | public PatientCheckTicket addTicket(PatientCheckTicket obj) { |
| 25 | 29 | return patientCheckTicketDao.addTicket(obj); |
| ... | ... | @@ -52,6 +56,25 @@ |
| 52 | 56 | public void findAndModify(PatientCheckTicketQuery query,PatientCheckTicket ticket){ |
| 53 | 57 | patientCheckTicketDao.findAndModify(query.convertToQuery(),ticket); |
| 54 | 58 | } |
| 59 | + | |
| 60 | + /** | |
| 61 | + * 作废产检劵 | |
| 62 | + * @param consumerHospitalId | |
| 63 | + * @param id | |
| 64 | + */ | |
| 65 | + public void cancelCheckTicket(String consumerHospitalId,String id){ | |
| 66 | + if(StringUtils.isNotEmpty(id)){ | |
| 67 | + PatientCheckTicketQuery patientCheckTicketQuery=new PatientCheckTicketQuery(); | |
| 68 | + Patients pa=patientDao.getPatient(id); | |
| 69 | + patientCheckTicketQuery.setStatus(1); | |
| 70 | + patientCheckTicketQuery.setPid(pa.getPid()); | |
| 71 | + PatientCheckTicket patientCheckTicket=new PatientCheckTicket(); | |
| 72 | + patientCheckTicket.setStatus(3); | |
| 73 | + patientCheckTicket.setConsumeHospitalId(consumerHospitalId); | |
| 74 | + findAndModify(patientCheckTicketQuery, patientCheckTicket); | |
| 75 | + } | |
| 76 | + } | |
| 77 | + | |
| 55 | 78 | |
| 56 | 79 | public PatientCheckTicket getTicket(String id) { |
| 57 | 80 | return patientCheckTicketDao.getTicket(id); |
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/PatientsService.java
View file @
903e37e
| ... | ... | @@ -36,6 +36,8 @@ |
| 36 | 36 | private PersonService personService; |
| 37 | 37 | @Autowired |
| 38 | 38 | private IAntExRecordDao iAntExRecordDao; |
| 39 | + @Autowired | |
| 40 | + private PatientCheckTicketService patientCheckTicketService; | |
| 39 | 41 | |
| 40 | 42 | public Patients addPatient(Patients obj) { |
| 41 | 43 | return iPatientDao.addPatient(obj); |
| ... | ... | @@ -252,6 +254,9 @@ |
| 252 | 254 | patients.setIsAutoFm(YnEnums.YES.getId()); |
| 253 | 255 | // hujiaqi添加结束 |
| 254 | 256 | updatePatient(patients); |
| 257 | + | |
| 258 | + //作废产检劵 | |
| 259 | + patientCheckTicketService.cancelCheckTicket(patients.getHospitalId(), patients.getId()); | |
| 255 | 260 | PersonModelQuery personYunModelQuery = new PersonModelQuery(); |
| 256 | 261 | personYunModelQuery.setYn(YnEnums.YES.getId()); |
| 257 | 262 | personYunModelQuery.setId(patients.getPid()); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyBookbuildingFacade.java
View file @
903e37e
| ... | ... | @@ -71,7 +71,7 @@ |
| 71 | 71 | private PatientsService patientsService; |
| 72 | 72 | |
| 73 | 73 | @Autowired |
| 74 | - private AntenatalExaminationService antenatalExaminationService; | |
| 74 | + private PatientCheckTicketService patientCheckTicketService; | |
| 75 | 75 | |
| 76 | 76 | @Autowired |
| 77 | 77 | private YunBookbuildingService yunBookbuildingService; |
| 78 | 78 | |
| ... | ... | @@ -410,10 +410,13 @@ |
| 410 | 410 | patientUpdate.setType(3); |
| 411 | 411 | patientUpdate.setFmDate(StringUtils.isEmpty(request.getDueDate()) ? DateUtil.parseYMD(request.getBabyBirthday()) : DateUtil.parseYMD(request.getDueDate())); |
| 412 | 412 | patientsService.updatePatientByPid(patientUpdate, pm.getId()); |
| 413 | + | |
| 414 | + | |
| 415 | + //作废产检劵 | |
| 416 | + patientCheckTicketService.cancelCheckTicket(patients.getHospitalId(), patients.getId()); | |
| 413 | 417 | if (!isUpdatePatStatus) { |
| 414 | 418 | isUpdatePatStatus = true; |
| 415 | 419 | } |
| 416 | - | |
| 417 | 420 | } |
| 418 | 421 | } |
| 419 | 422 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/MatDeliverFacade.java
View file @
903e37e
| ... | ... | @@ -262,14 +262,7 @@ |
| 262 | 262 | |
| 263 | 263 | |
| 264 | 264 | //作废产检劵 |
| 265 | - PatientCheckTicketQuery patientCheckTicketQuery=new PatientCheckTicketQuery(); | |
| 266 | - Patients pa=patientsService.findOnePatientById(deliverAddRequest.getParentId()); | |
| 267 | - patientCheckTicketQuery.setStatus(1); | |
| 268 | - patientCheckTicketQuery.setPid(pa.getPid()); | |
| 269 | - PatientCheckTicket patientCheckTicket=new PatientCheckTicket(); | |
| 270 | - patientCheckTicket.setStatus(3); | |
| 271 | - patientCheckTicket.setConsumeHospitalId(hospitalId); | |
| 272 | - patientCheckTicketService.findAndModify(patientCheckTicketQuery,patientCheckTicket); | |
| 265 | + patientCheckTicketService.cancelCheckTicket(hospitalId, deliverAddRequest.getParentId()); | |
| 273 | 266 | //修改 |
| 274 | 267 | } else if (StringUtils.isNotEmpty(deliverAddRequest.getId()) && StringUtils.isNotEmpty(deliverAddRequest.getParentId())) { |
| 275 | 268 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/StopPregnancyFacade.java
View file @
903e37e
| ... | ... | @@ -128,8 +128,8 @@ |
| 128 | 128 | // hospitalId = String.valueOf(dbuser.getOrgId()); |
| 129 | 129 | // } |
| 130 | 130 | // } |
| 131 | + String hospital = autoMatchFacade.getHospitalId(userId); | |
| 131 | 132 | |
| 132 | - | |
| 133 | 133 | PatientsQuery patientsQuery = new PatientsQuery(); |
| 134 | 134 | patientsQuery.setYn(YnEnums.YES.getId()); |
| 135 | 135 | patientsQuery.setType(1); |
| ... | ... | @@ -158,8 +158,8 @@ |
| 158 | 158 | |
| 159 | 159 | |
| 160 | 160 | String groupId = groupsFacade.findByCurrentUserId(request.getHospitalId()); |
| 161 | - List<String> hos = groupsFacade.findGroupHospital(userId,false); | |
| 162 | - String hospital = autoMatchFacade.getHospitalId(userId); | |
| 161 | + List<String> hos = groupsFacade.findGroupHospital(userId, false); | |
| 162 | + | |
| 163 | 163 | for (Patients patient : patients) { |
| 164 | 164 | if (patient != null) { |
| 165 | 165 | String hid = patient.getHospitalId(); |
| ... | ... | @@ -211,16 +211,7 @@ |
| 211 | 211 | stopPregnancyService.addStopPreg(model); |
| 212 | 212 | |
| 213 | 213 | //作废产检劵 |
| 214 | - PatientCheckTicketQuery patientCheckTicketQuery=new PatientCheckTicketQuery(); | |
| 215 | - Patients pa=patientsService.findOnePatientById(pat.getId()); | |
| 216 | - patientCheckTicketQuery.setStatus(1); | |
| 217 | - | |
| 218 | - patientCheckTicketQuery.setPid(pa.getPid()); | |
| 219 | - | |
| 220 | - PatientCheckTicket patientCheckTicket=new PatientCheckTicket(); | |
| 221 | - patientCheckTicket.setStatus(3); | |
| 222 | - patientCheckTicket.setConsumeHospitalId(autoMatchFacade.getHospitalId(userId)); | |
| 223 | - patientCheckTicketService.findAndModify(patientCheckTicketQuery,patientCheckTicket); | |
| 214 | + patientCheckTicketService.cancelCheckTicket(hospital, pat.getId()); | |
| 224 | 215 | |
| 225 | 216 | BaseResponse objectResponse = new BaseResponse(); |
| 226 | 217 | objectResponse.setErrorcode(ErrorCodeConstants.SUCCESS); |