diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/AntexDoctorStatistController.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/AntexDoctorStatistController.java index 077d61c..2dfbd62 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/AntexDoctorStatistController.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/AntexDoctorStatistController.java @@ -76,18 +76,18 @@ public class AntexDoctorStatistController extends BaseController { public BaseObjectResponse doctorInfo(Date startDate, Date endDate, Integer childBirth, Integer number, String doctorId, Integer currentPage, Integer pageSize, HttpServletRequest request) { LoginContext loginState = (LoginContext) request.getAttribute("loginContext"); - if(pageSize==null){ + if (pageSize == null) { pageSize = 20; } - if(currentPage==null){ + if (currentPage == null) { currentPage = 1; } - if(number == null){ - number=1; + if (number == null) { + number = 1; } //获取患者信息 - List antextDoctorPatient = getPatientList(loginState.getId(), startDate, endDate, childBirth ,doctorId,number); + List antextDoctorPatient = getPatientList(loginState.getId(), startDate, endDate, childBirth, doctorId, number); //结果数据集合 Map resultInfo = new HashMap<>(); @@ -115,7 +115,7 @@ public class AntexDoctorStatistController extends BaseController { resultInfo.put(adp.getpId(), adp); } } - if(CollectionUtils.isNotEmpty(patientIds)){ + if (CollectionUtils.isNotEmpty(patientIds)) { getAllPatientList(patientIds, resultInfo); } @@ -124,15 +124,15 @@ public class AntexDoctorStatistController extends BaseController { for (Map.Entry adp : resultInfo.entrySet()) { AntextDoctorPatient antextDoctorPatient1 = adp.getValue(); - if(number==2){//2次及以上 - if(antextDoctorPatient1.getCjNum()>1){ + if (number == 2) {//2次及以上 + if (antextDoctorPatient1.getCjNum() > 1) { antextDoctorPatients.add(adp.getValue()); } - }else if(number==5){//5次及以上 - if(antextDoctorPatient1.getCjNum()>4){ + } else if (number == 5) {//5次及以上 + if (antextDoctorPatient1.getCjNum() > 4) { antextDoctorPatients.add(adp.getValue()); } - }else { + } else { antextDoctorPatients.add(adp.getValue()); } } @@ -142,16 +142,16 @@ public class AntexDoctorStatistController extends BaseController { pageInfo.setPage(currentPage); pageInfo.setCount(resultInfo.size()); - int startIndex = pageSize*(currentPage-1); + int startIndex = pageSize * (currentPage - 1); List resultData = new ArrayList<>(); - if(CollectionUtils.isNotEmpty(antextDoctorPatients)&&antextDoctorPatients.size()>startIndex){ - int size = startIndex+pageSize; - if(antextDoctorPatients.size() startIndex) { + int size = startIndex + pageSize; + if (antextDoctorPatients.size() < size) { size = antextDoctorPatients.size(); } - for(int i = startIndex;i getPatientList(Integer userId, Date startDate, Date endDate, Integer childBirth,String doctorId,Integer number) { + public List getPatientList(Integer userId, Date startDate, Date endDate, Integer childBirth, String doctorId, Integer number) { //根据当前登录人获取医院id String hospital = autoMatchFacade.getHospitalId(userId); @@ -222,8 +222,8 @@ public class AntexDoctorStatistController extends BaseController { //获取患者集合 List patientss = yunBookbuildingService.queryPregnantWithQuery(patientsQuery); - if(CollectionUtils.isEmpty(patientss)){ - return new ArrayList<>(); + if (CollectionUtils.isEmpty(patientss)) { + return new ArrayList<>(); } //患者id List pIds = new ArrayList<>(); @@ -237,7 +237,7 @@ public class AntexDoctorStatistController extends BaseController { AntExChuQuery antExChuQuery = new AntExChuQuery(); //患者集合 antExChuQuery.setParentIds(pIds); - if(StringUtils.isNotEmpty(doctorId)){ + if (StringUtils.isNotEmpty(doctorId)) { antExChuQuery.setCheckDoctor(doctorId); } antExChuQuery.setYn(1); @@ -245,7 +245,7 @@ public class AntexDoctorStatistController extends BaseController { //初诊集合列表 List antExChuModels = antExService.queryAntExChu(antExChuQuery); AntExQuery antExQuery = new AntExQuery(); - if(StringUtils.isNotEmpty(doctorId)){ + if (StringUtils.isNotEmpty(doctorId)) { antExQuery.setCheckDoctor(doctorId); } antExQuery.setHospitalId(hospital); @@ -288,26 +288,28 @@ public class AntexDoctorStatistController extends BaseController { List resultData = new ArrayList<>(); - if(number!=null){ - if(number == 2){ - for(AntextDoctorPatient ad :antextDoctorPatient){ - if(ad.getCjNum()>1){ + if (number != null) { + if (number == 2) { + for (AntextDoctorPatient ad : antextDoctorPatient) { + if (ad.getCjNum() > 1) { resultData.add(ad); } } - }else if(number == 5){ - for(AntextDoctorPatient ad :antextDoctorPatient){ - if(ad.getCjNum()>4){ + } else if (number == 5) { + for (AntextDoctorPatient ad : antextDoctorPatient) { + if (ad.getCjNum() > 4) { resultData.add(ad); } } - }else{ - for(AntextDoctorPatient ad :antextDoctorPatient){ - if(ad.getCjNum()>4){ - resultData.add(ad); - } + } else { + for (AntextDoctorPatient ad : antextDoctorPatient) { + resultData.add(ad); } } + } else { + for (AntextDoctorPatient ad : antextDoctorPatient) { + resultData.add(ad); + } } return resultData; } @@ -329,7 +331,7 @@ public class AntexDoctorStatistController extends BaseController { LoginContext loginState = (LoginContext) request.getAttribute("loginContext"); //获取患者信息 - List antextDoctorPatient = getPatientList(loginState.getId(), startDate, endDate, childBirth,null,null); + List antextDoctorPatient = getPatientList(loginState.getId(), startDate, endDate, childBirth, null, null); Map adr1 = new HashMap<>(); //医生ID+患者ID 用与医生对于产检人数 + 总人数:患者ID