Commit 71ef7bdb56abdf99b029660a3e085e65d437d550
1 parent
6b4d0b401b
Exists in
master
and in
7 other branches
1
Showing 2 changed files with 39 additions and 7 deletions
platform-dal/src/main/java/com/lyms/platform/query/PatientCheckTicketQuery.java
View file @
71ef7bd
... | ... | @@ -14,6 +14,16 @@ |
14 | 14 | public class PatientCheckTicketQuery extends BaseQuery implements IConvertToNativeQuery { |
15 | 15 | |
16 | 16 | private String id; |
17 | + private String pid; | |
18 | + | |
19 | + public String getPid() { | |
20 | + return pid; | |
21 | + } | |
22 | + | |
23 | + public void setPid(String pid) { | |
24 | + this.pid = pid; | |
25 | + } | |
26 | + | |
17 | 27 | private String patientId; |
18 | 28 | private String hospitalId; |
19 | 29 | private String consumeHospitalId; |
... | ... | @@ -27,6 +37,9 @@ |
27 | 37 | } |
28 | 38 | if (!StringUtils.isEmpty(id)) { |
29 | 39 | condition = condition.and("id", id, MongoOper.IS); |
40 | + } | |
41 | + if (!StringUtils.isEmpty(pid)) { | |
42 | + condition = condition.and("pid", pid, MongoOper.IS); | |
30 | 43 | } |
31 | 44 | if (!StringUtils.isEmpty(patientId)) { |
32 | 45 | condition = condition.and("patientId", patientId, MongoOper.IS); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntenatalExaminationFacade.java
View file @
71ef7bd
... | ... | @@ -229,10 +229,19 @@ |
229 | 229 | } |
230 | 230 | |
231 | 231 | // 修改关联券的使用状态,如果已使用,则返回错误码 |
232 | + //初诊只能建一次 | |
232 | 233 | if (StringUtils.isNotBlank(model.getBarCode())) { |
233 | - String code = patientCheckTicketService.updateTicket(model.getBarCode(), 2, model.getHospitalId()); | |
234 | - if (code != null) { | |
235 | - return new BaseResponse().setErrorcode(ErrorCodeConstants.PARAMETER_ERROR).setErrormsg(code); | |
234 | + PatientCheckTicketQuery checkTicketQuery=new PatientCheckTicketQuery(); | |
235 | + checkTicketQuery.setPid(model.getPid()); | |
236 | + checkTicketQuery.setId(model.getBarCode()); | |
237 | + checkTicketQuery.setStatus(1); | |
238 | + if(patientCheckTicketService.queryTicketCount(checkTicketQuery)>0){ | |
239 | + String code = patientCheckTicketService.updateTicket(model.getBarCode(), 2, model.getHospitalId()); | |
240 | + if (code != null) { | |
241 | + return new BaseResponse().setErrorcode(ErrorCodeConstants.PARAMETER_ERROR).setErrormsg(code); | |
242 | + } | |
243 | + }else{ | |
244 | + return new BaseResponse().setErrorcode(ErrorCodeConstants.PARAMETER_ERROR).setErrormsg("该产检劵不属于本人"); | |
236 | 245 | } |
237 | 246 | } |
238 | 247 | Patients patients = patientsService.findOnePatientById(antExAddRequest.getParentId()); |
239 | 248 | |
... | ... | @@ -370,13 +379,23 @@ |
370 | 379 | antExChuQuery1.setParentId(excAddRequest.getParentId()); |
371 | 380 | antExChuQuery1.setYn(YnEnums.YES.getId()); |
372 | 381 | List<AntExChuModel> data1 = antenatalExaminationService.queryAntExChu(antExChuQuery1); |
382 | + | |
383 | + | |
373 | 384 | //初诊只能建一次 |
374 | 385 | // 修改关联券的使用状态,如果已使用,则返回错误码 |
375 | 386 | if (StringUtils.isNotBlank(antExChuModel.getBarCode())) { |
376 | - String code = patientCheckTicketService.updateTicket(antExChuModel.getBarCode(), 2, antExChuModel.getHospitalId()); | |
377 | - if (code != null) { | |
378 | - return new BaseResponse().setErrorcode(ErrorCodeConstants.PARAMETER_ERROR).setErrormsg(code); | |
379 | - } | |
387 | + PatientCheckTicketQuery checkTicketQuery=new PatientCheckTicketQuery(); | |
388 | + checkTicketQuery.setPid(antExChuModel.getPid()); | |
389 | + checkTicketQuery.setId(antExChuModel.getBarCode()); | |
390 | + checkTicketQuery.setStatus(1); | |
391 | + if(patientCheckTicketService.queryTicketCount(checkTicketQuery)>0){ | |
392 | + String code = patientCheckTicketService.updateTicket(antExChuModel.getBarCode(), 2, antExChuModel.getHospitalId()); | |
393 | + if (code != null) { | |
394 | + return new BaseResponse().setErrorcode(ErrorCodeConstants.PARAMETER_ERROR).setErrormsg(code); | |
395 | + } | |
396 | + }else{ | |
397 | + return new BaseResponse().setErrorcode(ErrorCodeConstants.PARAMETER_ERROR).setErrormsg("该产检劵不属于本人"); | |
398 | + } | |
380 | 399 | } |
381 | 400 | if (CollectionUtils.isEmpty(data1)) { |
382 | 401 | Patients patients = patientsService.findOnePatientById(excAddRequest.getParentId()); |