diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntenatalExaminationFacade.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntenatalExaminationFacade.java index 2fef918..d070d2a 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntenatalExaminationFacade.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntenatalExaminationFacade.java @@ -75,7 +75,7 @@ public class AntenatalExaminationFacade { * @param userId * @return */ - public String handHideBuild(String pid, String parentId, Integer userId,int type) { + public String handHideBuild(String pid, String parentId, Integer userId, int type) { String hospitalId = autoMatchFacade.getHospitalId(userId); List li = new ArrayList(); @@ -86,9 +86,9 @@ public class AntenatalExaminationFacade { return patients.getId(); } - Patients patients1= patientsService.findOnePatientById(parentId); + Patients patients1 = patientsService.findOnePatientById(parentId); - if(patients1.getHospitalId().equals(hospitalId)){ + if (patients1.getHospitalId().equals(hospitalId)) { return patients1.getId(); } @@ -180,7 +180,7 @@ public class AntenatalExaminationFacade { AntenatalExaminationModel model = antExAddRequest.convertToDataModel(); //表示区域的 if (StringUtils.isNotEmpty(groupsFacade.findByCurrentUserId(hospitalId))) { - String parentId = handHideBuild(antExAddRequest.getPid(), antExAddRequest.getParentId(), userId,1); + String parentId = handHideBuild(antExAddRequest.getPid(), antExAddRequest.getParentId(), userId, 1); if (StringUtils.isEmpty(parentId)) { //打印日志 } @@ -231,16 +231,16 @@ public class AntenatalExaminationFacade { // 修改关联券的使用状态,如果已使用,则返回错误码 //初诊只能建一次 if (StringUtils.isNotBlank(model.getBarCode())) { - PatientCheckTicketQuery checkTicketQuery=new PatientCheckTicketQuery(); + PatientCheckTicketQuery checkTicketQuery = new PatientCheckTicketQuery(); checkTicketQuery.setPid(model.getPid()); checkTicketQuery.setId(model.getBarCode()); checkTicketQuery.setStatus(1); - if(patientCheckTicketService.queryTicketCount(checkTicketQuery)>0){ + if (patientCheckTicketService.queryTicketCount(checkTicketQuery) > 0) { String code = patientCheckTicketService.updateTicket(model.getBarCode(), 2, model.getHospitalId()); if (code != null) { return new BaseResponse().setErrorcode(ErrorCodeConstants.PARAMETER_ERROR).setErrormsg(code); } - }else{ + } else { return new BaseResponse().setErrorcode(ErrorCodeConstants.PARAMETER_ERROR).setErrormsg("该产检劵不属于本人"); } } @@ -336,7 +336,7 @@ public class AntenatalExaminationFacade { //表示区域的 if (StringUtils.isNotEmpty(groupsFacade.findByCurrentUserId(hospitalId))) { - String parentId = handHideBuild(excAddRequest.getPid(), excAddRequest.getParentId(), userId,1); + String parentId = handHideBuild(excAddRequest.getPid(), excAddRequest.getParentId(), userId, 1); if (StringUtils.isEmpty(parentId)) { //打印日志 } @@ -384,18 +384,18 @@ public class AntenatalExaminationFacade { //初诊只能建一次 // 修改关联券的使用状态,如果已使用,则返回错误码 if (StringUtils.isNotBlank(antExChuModel.getBarCode())) { - PatientCheckTicketQuery checkTicketQuery=new PatientCheckTicketQuery(); + PatientCheckTicketQuery checkTicketQuery = new PatientCheckTicketQuery(); checkTicketQuery.setPid(antExChuModel.getPid()); checkTicketQuery.setId(antExChuModel.getBarCode()); checkTicketQuery.setStatus(1); - if(patientCheckTicketService.queryTicketCount(checkTicketQuery)>0){ - String code = patientCheckTicketService.updateTicket(antExChuModel.getBarCode(), 2, antExChuModel.getHospitalId()); - if (code != null) { - return new BaseResponse().setErrorcode(ErrorCodeConstants.PARAMETER_ERROR).setErrormsg(code); - } - }else{ - return new BaseResponse().setErrorcode(ErrorCodeConstants.PARAMETER_ERROR).setErrormsg("该产检劵不属于本人"); - } + if (patientCheckTicketService.queryTicketCount(checkTicketQuery) > 0) { + String code = patientCheckTicketService.updateTicket(antExChuModel.getBarCode(), 2, antExChuModel.getHospitalId()); + if (code != null) { + return new BaseResponse().setErrorcode(ErrorCodeConstants.PARAMETER_ERROR).setErrormsg(code); + } + } else { + return new BaseResponse().setErrorcode(ErrorCodeConstants.PARAMETER_ERROR).setErrormsg("该产检劵不属于本人"); + } } if (CollectionUtils.isEmpty(data1)) { Patients patients = patientsService.findOnePatientById(excAddRequest.getParentId()); @@ -794,7 +794,7 @@ public class AntenatalExaminationFacade { if (CollectionUtils.isNotEmpty(list)) { // Patients patients2 = findOnePatient(null, null, null, hospital, -1, true, exListQueryRequest.getPid(),false); - Patients patients2 = findOnePatient(null, null, null, groupsFacade.findGroupHospital(userId,true), -1, true, exListQueryRequest.getPid(), false); + Patients patients2 = findOnePatient(null, null, null, groupsFacade.findGroupHospital(userId, true), -1, true, exListQueryRequest.getPid(), false); antexListResult.convertToResult(null, patients2, null); HighScoreResult highScoreResult = findLastRisk(list.get(0).getPid(), false); @@ -984,14 +984,14 @@ public class AntenatalExaminationFacade { Date currentDate = DateUtil.formatDate(new Date()); - if ((date.getTime() <= currentDate.getTime() || patients.getBuildType() == 2)||patients.getType()==3&&patients.getFmDate()!=null) { + if ((date.getTime() <= currentDate.getTime() || patients.getBuildType() == 2) || patients.getType() == 3 && patients.getFmDate() != null) { //建档记录 if (null != patients.getHospitalId()) { organization = organizationService.getOrganization(Integer.valueOf(patients.getHospitalId())); } pid = patients.getPid(); //当主档案的医院不在group组里需要显示本来的隐藏档案 - if(!"2".equals(patients.getEnable())){ + if (!"2".equals(patients.getEnable())) { listData.add(new AntData(patients, null != organization ? organization.getName() : "")); } @@ -1060,7 +1060,7 @@ public class AntenatalExaminationFacade { } PostReviewQuery postReviewQuery = new PostReviewQuery(); - if (list.size() - 1 >i) { + if (list.size() - 1 > i) { postReviewQuery.setStart(dueDate); if (CollectionUtils.isNotEmpty(listDate)) { //下次建档记录前都是产后复查,如果没有下个产程的数据就直接显示 @@ -1075,7 +1075,7 @@ public class AntenatalExaminationFacade { //产后复查记录 List reviewModels = postReviewService.findWithList(postReviewQuery); if (CollectionUtils.isNotEmpty(reviewModels)) { - if(CollectionUtils.isNotEmpty(listData)){ + if (CollectionUtils.isNotEmpty(listData)) { for (PostReviewModel postReviewModel : reviewModels) { if (postReviewModel.getYn() == YnEnums.YES.getId()) { if (null != postReviewModel.getHospitalId()) { @@ -1088,7 +1088,7 @@ public class AntenatalExaminationFacade { } } iterator.remove(); - if(CollectionUtils.isNotEmpty(listData)){ + if (CollectionUtils.isNotEmpty(listData)) { sort(listData); updateEditEnable(listData, sortList); sortList.add(listData); @@ -1158,7 +1158,7 @@ public class AntenatalExaminationFacade { organization = organizationService.getOrganization(Integer.valueOf(patients.getHospitalId())); } pid = patients.getPid(); - if(!"2".equals(patients.getEnable())) { + if (!"2".equals(patients.getEnable())) { listData.add(new AntData(patients, null != organization ? organization.getName() : "")); } } @@ -1679,26 +1679,27 @@ public class AntenatalExaminationFacade { if (CollectionUtils.isNotEmpty(list)) { patients = list.get(0); } - } else if(StringUtils.isNotEmpty(queryRequest.getBarCode())){ - - String code = patientCheckTicketService.updateTicket(queryRequest.getBarCode(), 2, hospitalId); - if (code != null) { - return new BaseResponse().setErrorcode(ErrorCodeConstants.TICKET_USED).setErrormsg(code); + } else if (StringUtils.isNotEmpty(queryRequest.getBarCode())) { + PatientCheckTicketQuery checkTicketQuery = new PatientCheckTicketQuery(); + checkTicketQuery.setId(queryRequest.getBarCode()); + checkTicketQuery.setStatus(1); + if (patientCheckTicketService.queryTicketCount(checkTicketQuery) ==0) { + return new BaseResponse().setErrorcode(ErrorCodeConstants.TICKET_USED).setErrormsg(ErrorCodeConstants.SUCCESS_DESCRIPTION); } - PatientCheckTicket checkTicket =patientCheckTicketService.getTicket(queryRequest.getBarCode()); - if(null!=checkTicket){ + PatientCheckTicket checkTicket = patientCheckTicketService.getTicket(queryRequest.getBarCode()); + if (null != checkTicket) { Patients patients1 = patientsService.findOnePatientById(checkTicket.getPatientId()); - if(null!=patients1){ - if(StringUtils.isNotEmpty(patients1.getSource())){ - patients= patientsService.findOnePatientById(patients1.getSource()); - }else{ - patients=patients1; + if (null != patients1) { + if (StringUtils.isNotEmpty(patients1.getSource())) { + patients = patientsService.findOnePatientById(patients1.getSource()); + } else { + patients = patients1; } } } - }else { - patients = findOnePatient(queryRequest.getCardNo(), queryRequest.getVcCardNo(), null, groupsFacade.findGroupHospital(userId,false), 1, false, null, og.getbStatus() == 1); + } else { + patients = findOnePatient(queryRequest.getCardNo(), queryRequest.getVcCardNo(), null, groupsFacade.findGroupHospital(userId, false), 1, false, null, og.getbStatus() == 1); //查询产妇数据 // patients = findOnePatient(queryRequest.getCardNo(), queryRequest.getVcCardNo(), null, hospitalId, 1, false, null, false); } @@ -1711,7 +1712,7 @@ public class AntenatalExaminationFacade { // //查询是否还有其他记录 // patients = findOnePatient(queryRequest.getCardNo(), queryRequest.getVcCardNo(), null, hospitalId, 3, false, null, false); // } - patients = findOnePatient(queryRequest.getCardNo(), queryRequest.getVcCardNo(), null, groupsFacade.findGroupHospital(userId,false), 3, false, null, og.getbStatus() == 1); + patients = findOnePatient(queryRequest.getCardNo(), queryRequest.getVcCardNo(), null, groupsFacade.findGroupHospital(userId, false), 3, false, null, og.getbStatus() == 1); //原来单机 if (null != patients) { @@ -1794,7 +1795,7 @@ public class AntenatalExaminationFacade { AntExChuQuery antExChuQuery1 = new AntExChuQuery(); antExChuQuery1.setPid(patients.getPid()); // antExChuQuery1.setHospitalId(hospitalId); - antExChuQuery1.setHospitalList(groupsFacade.findGroupHospital(userId,false)); + antExChuQuery1.setHospitalList(groupsFacade.findGroupHospital(userId, false)); antExChuQuery1.setYn(YnEnums.YES.getId()); antExChuQuery1.setStart(max); @@ -1808,7 +1809,7 @@ public class AntenatalExaminationFacade { patientsQuery1.setYn(YnEnums.YES.getId()); patientsQuery1.setPid(patients.getPid()); // patientsQuery1.setHospitalId(hospitalId); - patientsQuery1.setHospitalList(groupsFacade.findGroupHospital(userId,false)); + patientsQuery1.setHospitalList(groupsFacade.findGroupHospital(userId, false)); List patientses = patientsService.queryPatient(patientsQuery1); if (CollectionUtils.isNotEmpty(patientses)) {