Commit c8e723758ec6abbe7724641c789a8b60c7151ab3
Exists in
master
and in
7 other branches
Merge remote-tracking branch 'origin/master'
Showing 10 changed files
- platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/CommonService.java
- platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/PatientCheckTicketService.java
- platform-common/src/main/java/com/lyms/platform/common/constants/ErrorCodeConstants.java
- platform-common/src/main/java/com/lyms/platform/common/utils/DateUtil.java
- platform-common/src/main/java/com/lyms/platform/common/utils/SystemConfig.java
- platform-dal/src/main/java/com/lyms/platform/query/PatientCheckTicketQuery.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/AntenatalExaminationController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntenatalExaminationFacade.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/facade/FolicAcidFacade.java
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/CommonService.java
View file @
c8e7237
... | ... | @@ -142,7 +142,7 @@ |
142 | 142 | int score=0; |
143 | 143 | List<String> levelList = new ArrayList<>() ; |
144 | 144 | for (int i = 0; i < riskList.size(); i++) { |
145 | - Objects obj =(Objects)riskList.get(i); | |
145 | + Object obj =riskList.get(i); | |
146 | 146 | if(null!=obj){ |
147 | 147 | BasicConfig basicConfig = basicConfigService.getOneBasicConfigById(obj.toString()); |
148 | 148 | if(null!=basicConfig){ |
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/PatientCheckTicketService.java
View file @
c8e7237
... | ... | @@ -32,9 +32,11 @@ |
32 | 32 | public String updateTicket(String id, Integer status, String cousumeHospitalId) { |
33 | 33 | PatientCheckTicket ticket = getTicket(id); |
34 | 34 | if (ticket == null) { |
35 | - return "免费产检券不存在"; | |
36 | - } else if (ticket.getStatus() != 1) { | |
37 | - return "免费产检券已被使用了"; | |
35 | + return "当前免费券不存在"; | |
36 | + } else if (ticket.getStatus() == 2) { | |
37 | + return "当前免费券已被使用"; | |
38 | + }else if (ticket.getStatus() == 3) { | |
39 | + return "当前免费券已经失效"; | |
38 | 40 | } |
39 | 41 | ticket.setStatus(status); |
40 | 42 | ticket.setConsumeHospitalId(cousumeHospitalId); |
platform-common/src/main/java/com/lyms/platform/common/constants/ErrorCodeConstants.java
View file @
c8e7237
... | ... | @@ -32,6 +32,9 @@ |
32 | 32 | // 参数错误 |
33 | 33 | public static final int PARAMETER_ERROR = 4097; |
34 | 34 | |
35 | + // 产检劵已使用 | |
36 | + public static final int TICKET_USED = 40971; | |
37 | + | |
35 | 38 | // 系统异常 |
36 | 39 | public static final int SYSTEM_ERROR = 4099; |
37 | 40 | public static final String SYSTEM_ERROR_DESCRIPTION = "系统异常"; |
platform-common/src/main/java/com/lyms/platform/common/utils/DateUtil.java
View file @
c8e7237
platform-common/src/main/java/com/lyms/platform/common/utils/SystemConfig.java
View file @
c8e7237
... | ... | @@ -75,7 +75,7 @@ |
75 | 75 | //女 |
76 | 76 | public static final String WOMAN_ID = "c23779f1-cb6e-44d0-9fc8-0a990bf6184c"; |
77 | 77 | //男 |
78 | - public static final String MAN_ID = "ac334aa6-b0f2-4b25-a231-cf968c14ef8b"; | |
78 | + public static final String MAN_ID = "5d0b782f-b61b-441b-b8c5-4bf55eece273"; | |
79 | 79 | |
80 | 80 | |
81 | 81 | } |
platform-dal/src/main/java/com/lyms/platform/query/PatientCheckTicketQuery.java
View file @
c8e7237
... | ... | @@ -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/controller/AntenatalExaminationController.java
View file @
c8e7237
... | ... | @@ -2,6 +2,7 @@ |
2 | 2 | |
3 | 3 | import com.lyms.hospitalapi.qhdfy.QhdfyHisService; |
4 | 4 | import com.lyms.hospitalapi.v1.HisService; |
5 | +import com.lyms.platform.biz.service.PatientCheckTicketService; | |
5 | 6 | import com.lyms.platform.common.annotation.TokenRequired; |
6 | 7 | import com.lyms.platform.common.base.BaseController; |
7 | 8 | import com.lyms.platform.common.base.LoginContext; |
... | ... | @@ -12,6 +13,7 @@ |
12 | 13 | import com.lyms.platform.common.utils.PropertiesUtils; |
13 | 14 | import com.lyms.platform.operate.web.facade.AntExRecordFacade; |
14 | 15 | import com.lyms.platform.operate.web.facade.AntenatalExaminationFacade; |
16 | +import com.lyms.platform.operate.web.facade.AutoMatchFacade; | |
15 | 17 | import com.lyms.platform.operate.web.request.*; |
16 | 18 | import org.apache.commons.lang.StringUtils; |
17 | 19 | import org.springframework.beans.factory.annotation.Autowired; |
18 | 20 | |
... | ... | @@ -45,9 +47,15 @@ |
45 | 47 | private QhdfyHisService qhdfyHisService; |
46 | 48 | @Autowired |
47 | 49 | private AntExRecordFacade antExRecordFacade; |
50 | + @Autowired | |
51 | + private PatientCheckTicketService checkTicketService; | |
48 | 52 | |
49 | 53 | public static final String HIS_VERSION = PropertiesUtils.getPropertyValue("his_version"); |
50 | 54 | |
55 | + | |
56 | + @Autowired | |
57 | + private AutoMatchFacade autoMatchFacade; | |
58 | + | |
51 | 59 | /** |
52 | 60 | * |
53 | 61 | * @return |
... | ... | @@ -226,6 +234,23 @@ |
226 | 234 | public void exportfindRegionAntEx(@Valid AntExManagerQueryRequest antExManagerQueryRequest,HttpServletRequest request,HttpServletResponse httpServletResponse){ |
227 | 235 | LoginContext loginState = (LoginContext) request.getAttribute("loginContext"); |
228 | 236 | antExRecordFacade.exportfindRegionAntEx(antExManagerQueryRequest, loginState.getId(), true, httpServletResponse); |
237 | + } | |
238 | + /** | |
239 | + * 产检劵检查验证 | |
240 | + * | |
241 | + * @return | |
242 | + */ | |
243 | + @RequestMapping(method = RequestMethod.GET, value = "/checkticket") | |
244 | + @TokenRequired | |
245 | + public BaseResponse checkTicket(String barCode,HttpServletRequest request){ | |
246 | + LoginContext loginState = (LoginContext) request.getAttribute("loginContext"); | |
247 | + if (StringUtils.isNotBlank(barCode)) { | |
248 | + String code = checkTicketService.updateTicket(barCode, 2, autoMatchFacade.getHospitalId(loginState.getId())); | |
249 | + if (code != null) { | |
250 | + return new BaseResponse().setErrorcode(ErrorCodeConstants.TICKET_USED).setErrormsg(code); | |
251 | + } | |
252 | + } | |
253 | + return new BaseResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg(ErrorCodeConstants.SUCCESS_DESCRIPTION); | |
229 | 254 | } |
230 | 255 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntenatalExaminationFacade.java
View file @
c8e7237
... | ... | @@ -227,6 +227,23 @@ |
227 | 227 | if (CollectionUtils.isNotEmpty(list)) { |
228 | 228 | return new BaseResponse().setErrorcode(ErrorCodeConstants.DATA_EXIST).setErrormsg("同一天只能建一次复诊"); |
229 | 229 | } |
230 | + | |
231 | + // 修改关联券的使用状态,如果已使用,则返回错误码 | |
232 | + //初诊只能建一次 | |
233 | + if (StringUtils.isNotBlank(model.getBarCode())) { | |
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("该产检劵不属于本人"); | |
245 | + } | |
246 | + } | |
230 | 247 | Patients patients = patientsService.findOnePatientById(antExAddRequest.getParentId()); |
231 | 248 | patients.setLastCheckEmployeeId(antExAddRequest.getCheckDoctor()); |
232 | 249 | |
233 | 250 | |
... | ... | @@ -237,14 +254,8 @@ |
237 | 254 | patientsService.updatePatient(patients); |
238 | 255 | patientsService.updatePatientOneCol(patients.getId(), com.lyms.platform.common.utils.StringUtils.isEmpty(antExAddRequest.getNextCheckTime()) == true ? null : DateUtil.parseYMD(antExAddRequest.getNextCheckTime())); |
239 | 256 | antenatalExaminationService.addOneBabyAnt(model); |
240 | - // 修改关联券的使用状态,如果已使用,则返回错误码 | |
241 | - if (StringUtils.isNotBlank(model.getBarCode())) { | |
242 | - String code = patientCheckTicketService.updateTicket(model.getBarCode(), 2, model.getHospitalId()); | |
243 | - if (code != null) { | |
244 | - return new BaseResponse().setErrorcode(ErrorCodeConstants.PARAMETER_ERROR).setErrormsg(code); | |
245 | - } | |
246 | - } | |
247 | 257 | |
258 | + | |
248 | 259 | //修改最后一次检查时间 |
249 | 260 | setLashCTimes(antExAddRequest.getParentId()); |
250 | 261 | //修改申请单状态 |
251 | 262 | |
... | ... | @@ -368,7 +379,24 @@ |
368 | 379 | antExChuQuery1.setParentId(excAddRequest.getParentId()); |
369 | 380 | antExChuQuery1.setYn(YnEnums.YES.getId()); |
370 | 381 | List<AntExChuModel> data1 = antenatalExaminationService.queryAntExChu(antExChuQuery1); |
382 | + | |
383 | + | |
371 | 384 | //初诊只能建一次 |
385 | + // 修改关联券的使用状态,如果已使用,则返回错误码 | |
386 | + if (StringUtils.isNotBlank(antExChuModel.getBarCode())) { | |
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 | + } | |
399 | + } | |
372 | 400 | if (CollectionUtils.isEmpty(data1)) { |
373 | 401 | Patients patients = patientsService.findOnePatientById(excAddRequest.getParentId()); |
374 | 402 | PatientsQuery patientsQuery = new PatientsQuery(); |
... | ... | @@ -392,13 +420,6 @@ |
392 | 420 | antExChuModel.setYn(YnEnums.YES.getId()); |
393 | 421 | antExChuModel.setHospitalId(autoMatchFacade.getHospitalId(userId)); |
394 | 422 | antenatalExaminationService.addOneAntEx(antExChuModel); |
395 | - // 修改关联券的使用状态,如果已使用,则返回错误码 | |
396 | - if (StringUtils.isNotBlank(antExChuModel.getBarCode())) { | |
397 | - String code = patientCheckTicketService.updateTicket(antExChuModel.getBarCode(), 2, antExChuModel.getHospitalId()); | |
398 | - if (code != null) { | |
399 | - return new BaseResponse().setErrorcode(ErrorCodeConstants.PARAMETER_ERROR).setErrormsg(code); | |
400 | - } | |
401 | - } | |
402 | 423 | //修改患者风险等级 |
403 | 424 | |
404 | 425 | patients.setLastCheckEmployeeId(excAddRequest.getProdDoctor()); |
... | ... | @@ -1659,6 +1680,12 @@ |
1659 | 1680 | patients = list.get(0); |
1660 | 1681 | } |
1661 | 1682 | } else if(StringUtils.isNotEmpty(queryRequest.getBarCode())){ |
1683 | + | |
1684 | + String code = patientCheckTicketService.updateTicket(queryRequest.getBarCode(), 2, hospitalId); | |
1685 | + if (code != null) { | |
1686 | + return new BaseResponse().setErrorcode(ErrorCodeConstants.TICKET_USED).setErrormsg(code); | |
1687 | + } | |
1688 | + | |
1662 | 1689 | PatientCheckTicket checkTicket =patientCheckTicketService.getTicket(queryRequest.getBarCode()); |
1663 | 1690 | if(null!=checkTicket){ |
1664 | 1691 | Patients patients1 = patientsService.findOnePatientById(checkTicket.getPatientId()); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BookbuildingFacade.java
View file @
c8e7237
... | ... | @@ -111,11 +111,12 @@ |
111 | 111 | |
112 | 112 | /** |
113 | 113 | * 根据患者的建档ID,查询还未使用的免费产检查券 |
114 | + * | |
114 | 115 | * @param patientId |
115 | 116 | * @return |
116 | 117 | */ |
117 | 118 | public BaseListResponse getTicketList(String patientId) { |
118 | - List<PatientCheckTicket> list = patientCheckTicketService.queryTicket(patientId,null,null,1); | |
119 | + List<PatientCheckTicket> list = patientCheckTicketService.queryTicket(patientId, null, null, 1); | |
119 | 120 | return new BaseListResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功").setData(list).setPageInfo(new PageInfo()); |
120 | 121 | } |
121 | 122 | |
... | ... | @@ -252,17 +253,20 @@ |
252 | 253 | createBuildSms(p); |
253 | 254 | } |
254 | 255 | |
255 | - // 建档成功后,给孕妇造五个条形码 | |
256 | - String ticketPid = autoIncermentService.nextPatientTicketId(); | |
257 | - for (Integer i=1;i<=5;i++) { | |
258 | - PatientCheckTicket ticket = new PatientCheckTicket(); | |
259 | - ticket.setStatus(1); | |
260 | - ticket.setHospitalId(p.getHospitalId()); | |
261 | - ticket.setPatientId(p.getId()); | |
262 | - ticket.setCreated(new Date()); | |
263 | - ticket.setId("0335" + ticketPid + i); | |
264 | - ticket.setPid(p.getPid()); | |
265 | - patientCheckTicketService.addTicket(ticket); | |
256 | + | |
257 | + if (p.getType()!=null&&p.getType() == 1) { | |
258 | + // 建档成功后,给孕妇造五个条形码 | |
259 | + String ticketPid = autoIncermentService.nextPatientTicketId(); | |
260 | + for (Integer i = 1; i <= 5; i++) { | |
261 | + PatientCheckTicket ticket = new PatientCheckTicket(); | |
262 | + ticket.setStatus(1); | |
263 | + ticket.setHospitalId(p.getHospitalId()); | |
264 | + ticket.setPatientId(p.getId()); | |
265 | + ticket.setCreated(new Date()); | |
266 | + ticket.setId("0335" + ticketPid + i); | |
267 | + ticket.setPid(p.getPid()); | |
268 | + patientCheckTicketService.addTicket(ticket); | |
269 | + } | |
266 | 270 | } |
267 | 271 | |
268 | 272 | br.setErrorcode(ErrorCodeConstants.SUCCESS); |
... | ... | @@ -527,7 +531,7 @@ |
527 | 531 | patientsQuery.setVcCardNo(bookbuildingQueryRequest.getVcCardNo()); |
528 | 532 | |
529 | 533 | //区域模式 |
530 | - patientsQuery.setHospitalList(groupsFacade.findGroupHospital(userId,false)); | |
534 | + patientsQuery.setHospitalList(groupsFacade.findGroupHospital(userId, false)); | |
531 | 535 | |
532 | 536 | List<Patients> patientsVc = yunBookbuildingService.queryPregnantWithQuery(patientsQuery); |
533 | 537 | if (CollectionUtils.isNotEmpty(patientsVc)) { |
534 | 538 | |
535 | 539 | |
... | ... | @@ -552,14 +556,14 @@ |
552 | 556 | typeMap.put("hisPatient", qhdfyHisService.getPatientInfoList(bookbuildingQueryRequest.getVcCardNo())); |
553 | 557 | } |
554 | 558 | } |
555 | - }else if(!StringUtils.isEmpty(bookbuildingQueryRequest.getId())){ | |
559 | + } else if (!StringUtils.isEmpty(bookbuildingQueryRequest.getId())) { | |
556 | 560 | // id,HuJiaqi添加,为了建档管理里面的查看单条使用 |
557 | 561 | patients.add(yunBookbuildingService.findOneById(bookbuildingQueryRequest.getId())); |
558 | - }else if(StringUtils.isNotEmpty(bookbuildingQueryRequest.getPid())){ | |
562 | + } else if (StringUtils.isNotEmpty(bookbuildingQueryRequest.getPid())) { | |
559 | 563 | patientsQuery.setPid(bookbuildingQueryRequest.getPid()); |
560 | 564 | |
561 | 565 | //区域模式 |
562 | - patientsQuery.setHospitalList(groupsFacade.findGroupHospital(userId,false)); | |
566 | + patientsQuery.setHospitalList(groupsFacade.findGroupHospital(userId, false)); | |
563 | 567 | |
564 | 568 | List<Patients> patientsVc = yunBookbuildingService.queryPregnantWithQuery(patientsQuery); |
565 | 569 | if (CollectionUtils.isNotEmpty(patientsVc)) { |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/FolicAcidFacade.java
View file @
c8e7237
... | ... | @@ -256,9 +256,10 @@ |
256 | 256 | List<FolicAcid> folicAcidList = folicAcidService.queryFolicAcidWithSort(folicAcidQuery, "drawTime", Sort.Direction.DESC); |
257 | 257 | if (CollectionUtils.isNotEmpty(folicAcidList)){ |
258 | 258 | |
259 | - //返回第一条数据 | |
260 | - folicAcid = folicAcidList.get(0); | |
261 | - | |
259 | + if (folicAcid==null){ | |
260 | + //返回第一条数据 | |
261 | + folicAcid = folicAcidList.get(0); | |
262 | + } | |
262 | 263 | for (FolicAcid data: folicAcidList){ |
263 | 264 | Map<String,Object> acidMap = new HashMap<>(); |
264 | 265 | if (data.getPregnancyType()!=null){ |