Commit 642a26358423743d22f68fc6c4bf94652b3e93a0

Authored by jiangjiazhi
1 parent 403bff401f

分娩作废产检劵

Showing 1 changed file with 25 additions and 12 deletions

platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntenatalExaminationFacade.java View file @ 642a263
... ... @@ -77,10 +77,10 @@
77 77 */
78 78 public String handHideBuild(String pid, String parentId, Integer userId, int type) {
79 79 String hospitalId = autoMatchFacade.getHospitalId(userId);
80   - Patients patients=null;
  80 + Patients patients = null;
81 81 Patients patients1 = patientsService.findOnePatientById(parentId);
82   - if(StringUtils.isEmpty(pid)){
83   - pid=patients1.getPid();
  82 + if (StringUtils.isEmpty(pid)) {
  83 + pid = patients1.getPid();
84 84 }
85 85 List li = new ArrayList();
86 86 li.add(hospitalId);
... ... @@ -186,7 +186,7 @@
186 186 }
187 187 model.setParentId(parentId);
188 188 antExAddRequest.setParentId(parentId);
189   - Patients p=patientsService.findOnePatientById(parentId);
  189 + Patients p = patientsService.findOnePatientById(parentId);
190 190  
191 191 //加入产筛
192 192 patientsService.validata(p);
... ... @@ -347,7 +347,7 @@
347 347 antExChuModel.setParentId(parentId);
348 348 excAddRequest.setParentId(parentId);
349 349  
350   - Patients p=patientsService.findOnePatientById(parentId);
  350 + Patients p = patientsService.findOnePatientById(parentId);
351 351  
352 352 //加入产筛
353 353 patientsService.validata(p);
... ... @@ -793,7 +793,7 @@
793 793 patientsQuery.setPid(exListQueryRequest.getPid());
794 794 patientsQuery.setBuildType(1);
795 795 //在区域组的时候不用查询隐藏档案
796   - if(null!=groupsFacade.findByCurrentUserId(autoMatchFacade.getHospitalId(userId))){
  796 + if (null != groupsFacade.findByCurrentUserId(autoMatchFacade.getHospitalId(userId))) {
797 797 patientsQuery.setExtEnable(false);
798 798 }
799 799 //获取所有的建档记录
... ... @@ -850,7 +850,7 @@
850 850 patientsQuery1.setLastMensesEnd(end);
851 851 patientsQuery1.setBuildType(1);
852 852 //在区域组的时候不用查询隐藏档案
853   - if(null!=groupsFacade.findByCurrentUserId(autoMatchFacade.getHospitalId(userId))){
  853 + if (null != groupsFacade.findByCurrentUserId(autoMatchFacade.getHospitalId(userId))) {
854 854 patientsQuery1.setExtEnable(false);
855 855 }
856 856  
... ... @@ -1678,6 +1678,20 @@
1678 1678 return "0";
1679 1679 }
1680 1680  
  1681 +
  1682 + private String checkTicket(String id) {
  1683 + PatientCheckTicket ticket = patientCheckTicketService.getTicket(id);
  1684 + if (ticket == null) {
  1685 + return "当前免费券不存在";
  1686 + } else if (ticket.getStatus() == 2) {
  1687 + return "当前免费券已被使用";
  1688 + } else if (ticket.getStatus() == 3) {
  1689 + return "当前免费券已经失效";
  1690 + }
  1691 + return null;
  1692 + }
  1693 +
  1694 +
1681 1695 /**
1682 1696 * 查询产前检查
1683 1697 *
... ... @@ -1698,11 +1712,10 @@
1698 1712 patients = list.get(0);
1699 1713 }
1700 1714 } else if (StringUtils.isNotEmpty(queryRequest.getBarCode())) {
1701   - PatientCheckTicketQuery checkTicketQuery = new PatientCheckTicketQuery();
1702   - checkTicketQuery.setId(queryRequest.getBarCode());
1703   - checkTicketQuery.setStatus(1);
1704   - if (patientCheckTicketService.queryTicketCount(checkTicketQuery) ==0) {
1705   - return new BaseResponse().setErrorcode(ErrorCodeConstants.TICKET_USED).setErrormsg("不能使用.");
  1715 +
  1716 + String result = checkTicket(queryRequest.getBarCode());
  1717 + if (StringUtils.isNotEmpty(result)) {
  1718 + return new BaseResponse().setErrorcode(ErrorCodeConstants.TICKET_USED).setErrormsg(result);
1706 1719 }
1707 1720  
1708 1721 PatientCheckTicket checkTicket = patientCheckTicketService.getTicket(queryRequest.getBarCode());