Commit 277214aefae5940d4ff8fdd018a50f213cf65cf5

Authored by yangfei
1 parent dd48d53ad9

查询号bug修改

Showing 1 changed file with 36 additions and 34 deletions

platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/AntexDoctorStatistController.java View file @ 277214a
... ... @@ -76,18 +76,18 @@
76 76 public BaseObjectResponse doctorInfo(Date startDate, Date endDate, Integer childBirth, Integer number, String doctorId,
77 77 Integer currentPage, Integer pageSize, HttpServletRequest request) {
78 78 LoginContext loginState = (LoginContext) request.getAttribute("loginContext");
79   - if(pageSize==null){
  79 + if (pageSize == null) {
80 80 pageSize = 20;
81 81 }
82   - if(currentPage==null){
  82 + if (currentPage == null) {
83 83 currentPage = 1;
84 84 }
85   - if(number == null){
86   - number=1;
  85 + if (number == null) {
  86 + number = 1;
87 87 }
88 88  
89 89 //获取患者信息
90   - List<AntextDoctorPatient> antextDoctorPatient = getPatientList(loginState.getId(), startDate, endDate, childBirth ,doctorId,number);
  90 + List<AntextDoctorPatient> antextDoctorPatient = getPatientList(loginState.getId(), startDate, endDate, childBirth, doctorId, number);
91 91 //结果数据集合
92 92 Map<String, AntextDoctorPatient> resultInfo = new HashMap<>();
93 93  
... ... @@ -115,7 +115,7 @@
115 115 resultInfo.put(adp.getpId(), adp);
116 116 }
117 117 }
118   - if(CollectionUtils.isNotEmpty(patientIds)){
  118 + if (CollectionUtils.isNotEmpty(patientIds)) {
119 119 getAllPatientList(patientIds, resultInfo);
120 120 }
121 121  
122 122  
123 123  
... ... @@ -124,15 +124,15 @@
124 124  
125 125 for (Map.Entry<String, AntextDoctorPatient> adp : resultInfo.entrySet()) {
126 126 AntextDoctorPatient antextDoctorPatient1 = adp.getValue();
127   - if(number==2){//2次及以上
128   - if(antextDoctorPatient1.getCjNum()>1){
  127 + if (number == 2) {//2次及以上
  128 + if (antextDoctorPatient1.getCjNum() > 1) {
129 129 antextDoctorPatients.add(adp.getValue());
130 130 }
131   - }else if(number==5){//5次及以上
132   - if(antextDoctorPatient1.getCjNum()>4){
  131 + } else if (number == 5) {//5次及以上
  132 + if (antextDoctorPatient1.getCjNum() > 4) {
133 133 antextDoctorPatients.add(adp.getValue());
134 134 }
135   - }else {
  135 + } else {
136 136 antextDoctorPatients.add(adp.getValue());
137 137 }
138 138 }
139 139  
140 140  
... ... @@ -142,16 +142,16 @@
142 142 pageInfo.setPage(currentPage);
143 143 pageInfo.setCount(resultInfo.size());
144 144  
145   - int startIndex = pageSize*(currentPage-1);
  145 + int startIndex = pageSize * (currentPage - 1);
146 146  
147 147 List<AntextDoctorPatient> resultData = new ArrayList<>();
148 148  
149   - if(CollectionUtils.isNotEmpty(antextDoctorPatients)&&antextDoctorPatients.size()>startIndex){
150   - int size = startIndex+pageSize;
151   - if(antextDoctorPatients.size()<size){
  149 + if (CollectionUtils.isNotEmpty(antextDoctorPatients) && antextDoctorPatients.size() > startIndex) {
  150 + int size = startIndex + pageSize;
  151 + if (antextDoctorPatients.size() < size) {
152 152 size = antextDoctorPatients.size();
153 153 }
154   - for(int i = startIndex;i<size;i++){
  154 + for (int i = startIndex; i < size; i++) {
155 155 resultData.add(antextDoctorPatients.get(i));
156 156 }
157 157 }
... ... @@ -199,7 +199,7 @@
199 199 }
200 200  
201 201  
202   - public List<AntextDoctorPatient> getPatientList(Integer userId, Date startDate, Date endDate, Integer childBirth,String doctorId,Integer number) {
  202 + public List<AntextDoctorPatient> getPatientList(Integer userId, Date startDate, Date endDate, Integer childBirth, String doctorId, Integer number) {
203 203  
204 204 //根据当前登录人获取医院id
205 205 String hospital = autoMatchFacade.getHospitalId(userId);
... ... @@ -222,8 +222,8 @@
222 222 //获取患者集合
223 223 List<Patients> patientss = yunBookbuildingService.queryPregnantWithQuery(patientsQuery);
224 224  
225   - if(CollectionUtils.isEmpty(patientss)){
226   - return new ArrayList<>();
  225 + if (CollectionUtils.isEmpty(patientss)) {
  226 + return new ArrayList<>();
227 227 }
228 228 //患者id
229 229 List<String> pIds = new ArrayList<>();
... ... @@ -237,7 +237,7 @@
237 237 AntExChuQuery antExChuQuery = new AntExChuQuery();
238 238 //患者集合
239 239 antExChuQuery.setParentIds(pIds);
240   - if(StringUtils.isNotEmpty(doctorId)){
  240 + if (StringUtils.isNotEmpty(doctorId)) {
241 241 antExChuQuery.setCheckDoctor(doctorId);
242 242 }
243 243 antExChuQuery.setYn(1);
... ... @@ -245,7 +245,7 @@
245 245 //初诊集合列表
246 246 List<AntExChuModel> antExChuModels = antExService.queryAntExChu(antExChuQuery);
247 247 AntExQuery antExQuery = new AntExQuery();
248   - if(StringUtils.isNotEmpty(doctorId)){
  248 + if (StringUtils.isNotEmpty(doctorId)) {
249 249 antExQuery.setCheckDoctor(doctorId);
250 250 }
251 251 antExQuery.setHospitalId(hospital);
252 252  
253 253  
254 254  
... ... @@ -288,26 +288,28 @@
288 288  
289 289 List<AntextDoctorPatient> resultData = new ArrayList<>();
290 290  
291   - if(number!=null){
292   - if(number == 2){
293   - for(AntextDoctorPatient ad :antextDoctorPatient){
294   - if(ad.getCjNum()>1){
  291 + if (number != null) {
  292 + if (number == 2) {
  293 + for (AntextDoctorPatient ad : antextDoctorPatient) {
  294 + if (ad.getCjNum() > 1) {
295 295 resultData.add(ad);
296 296 }
297 297 }
298   - }else if(number == 5){
299   - for(AntextDoctorPatient ad :antextDoctorPatient){
300   - if(ad.getCjNum()>4){
  298 + } else if (number == 5) {
  299 + for (AntextDoctorPatient ad : antextDoctorPatient) {
  300 + if (ad.getCjNum() > 4) {
301 301 resultData.add(ad);
302 302 }
303 303 }
304   - }else{
305   - for(AntextDoctorPatient ad :antextDoctorPatient){
306   - if(ad.getCjNum()>4){
307   - resultData.add(ad);
308   - }
  304 + } else {
  305 + for (AntextDoctorPatient ad : antextDoctorPatient) {
  306 + resultData.add(ad);
309 307 }
310 308 }
  309 + } else {
  310 + for (AntextDoctorPatient ad : antextDoctorPatient) {
  311 + resultData.add(ad);
  312 + }
311 313 }
312 314 return resultData;
313 315 }
... ... @@ -329,7 +331,7 @@
329 331 LoginContext loginState = (LoginContext) request.getAttribute("loginContext");
330 332  
331 333 //获取患者信息
332   - List<AntextDoctorPatient> antextDoctorPatient = getPatientList(loginState.getId(), startDate, endDate, childBirth,null,null);
  334 + List<AntextDoctorPatient> antextDoctorPatient = getPatientList(loginState.getId(), startDate, endDate, childBirth, null, null);
333 335  
334 336 Map<String, AntextDoctorResult> adr1 = new HashMap<>();
335 337 //医生ID+患者ID 用与医生对于产检人数 + 总人数:患者ID