Commit 6876993b199723c0da48bf3e0204f34c19654e4b
1 parent
2e40c47926
Exists in
master
and in
6 other branches
检查报告
Showing 3 changed files with 61 additions and 131 deletions
platform-operate-api/src/main/java/com/lyms/hospitalapi/pojo/CheckResponse.java
View file @
6876993
| ... | ... | @@ -21,8 +21,18 @@ |
| 21 | 21 | private String notice; |
| 22 | 22 | /* 1:检验报告,2:影像报告 */ |
| 23 | 23 | private Integer type; |
| 24 | + //检验报告类别名称 | |
| 25 | + private String lisTypeName; | |
| 24 | 26 | private String title; |
| 25 | 27 | private Date modified; |
| 28 | + | |
| 29 | + public String getLisTypeName() { | |
| 30 | + return lisTypeName; | |
| 31 | + } | |
| 32 | + | |
| 33 | + public void setLisTypeName(String lisTypeName) { | |
| 34 | + this.lisTypeName = lisTypeName; | |
| 35 | + } | |
| 26 | 36 | |
| 27 | 37 | private String hospitalName;//表示医院名称 |
| 28 | 38 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/LisFacade.java
View file @
6876993
| ... | ... | @@ -87,183 +87,95 @@ |
| 87 | 87 | * @return |
| 88 | 88 | */ |
| 89 | 89 | public BaseResponse getLisAndRisData(String vcCardNo,String phone,Integer sortType,Integer userId) { |
| 90 | + | |
| 90 | 91 | List<CheckByDate> checkByDate=new ArrayList<CheckByDate>(); |
| 91 | - if(1 == sortType){ | |
| 92 | - List<CheckResponse> result = new ArrayList<>(); | |
| 93 | - //获取lis数据 | |
| 94 | - result.addAll(queryLisCheckList(vcCardNo,phone,userId)); | |
| 92 | + List<CheckResponse> result = queryLisCheckList(vcCardNo,phone,userId); | |
| 95 | 93 | |
| 96 | - List<String> keyList = new ArrayList<>(); | |
| 97 | - // 排序 | |
| 98 | - Collections.sort(result, new Comparator() { | |
| 99 | - public int compare(Object a, Object b) { | |
| 100 | - if (((CheckResponse)a).getApplyDate() == null) { | |
| 101 | - return -1; | |
| 102 | - } | |
| 103 | - if (((CheckResponse)b).getApplyDate() == null) { | |
| 104 | - return -1; | |
| 105 | - } | |
| 106 | - if (((CheckResponse)a).getApplyDate().before(((CheckResponse)b).getApplyDate())) { | |
| 107 | - return 1; | |
| 108 | - } | |
| 109 | - return -1; | |
| 110 | - } | |
| 111 | - }); | |
| 94 | + //排序检查大项 | |
| 95 | + sortLis(result); | |
| 112 | 96 | |
| 97 | + if(1 == sortType){ | |
| 98 | + List<String> keyList = new ArrayList<>(); | |
| 113 | 99 | for (CheckResponse check:result) { |
| 100 | + //明细项排序 | |
| 114 | 101 | sortLisItems(check); |
| 115 | 102 | Date date = check.getApplyDate() == null ? check.getModified() : check.getApplyDate(); |
| 116 | 103 | String ymd = DateUtil.getyyyy_MM_dd(date); |
| 117 | 104 | if (!keyList.contains(ymd)) { |
| 118 | 105 | keyList.add(ymd); |
| 119 | 106 | } |
| 120 | - | |
| 121 | 107 | } |
| 122 | 108 | |
| 123 | - for(String time:keyList){ | |
| 109 | + for(String time : keyList){ | |
| 124 | 110 | List<CheckType> CheckType=new ArrayList<CheckType>(); |
| 125 | 111 | List<CheckResponse> result2=new ArrayList<>();//存放所有检验报告(type=1) |
| 126 | - List<CheckResponse> result3=new ArrayList<>();//存放所有影像报告(type=2) | |
| 127 | - List<CheckResponse> result4=new ArrayList<>();//存放所有其他报告 | |
| 128 | - CheckType jianyan=new CheckType(); | |
| 112 | + | |
| 113 | + CheckType jianyan = new CheckType(); | |
| 129 | 114 | jianyan.setType("检验报告"); |
| 130 | - CheckType yingxiang=new CheckType(); | |
| 131 | - yingxiang.setType("影像报告"); | |
| 132 | - CheckType other=new CheckType(); | |
| 133 | - other.setType("其它报告"); | |
| 134 | - for(CheckResponse chre:result){ | |
| 115 | + | |
| 116 | + for(CheckResponse chre : result){ | |
| 135 | 117 | if(time.equals(DateUtil.getyyyy_MM_dd(chre.getApplyDate()))){ |
| 136 | 118 | if(chre.getType() == 1){ |
| 137 | 119 | result2.add(chre); |
| 138 | - //jianyan.setTypeName(result2); | |
| 139 | - //CheckType.add(jianyan); | |
| 140 | - }else if(chre.getType() == 2){ | |
| 141 | - result3.add(chre); | |
| 142 | - //yingxiang.setTypeName(result3); | |
| 143 | - //CheckType.add(yingxiang); | |
| 144 | - }else{ | |
| 145 | - result4.add(chre); | |
| 146 | - //other.setTypeName(result4); | |
| 147 | - //CheckType.add(other); | |
| 148 | 120 | } |
| 149 | - | |
| 150 | 121 | } |
| 151 | 122 | } |
| 123 | + | |
| 152 | 124 | jianyan.setTypeName(result2); |
| 153 | 125 | CheckType.add(jianyan); |
| 154 | 126 | |
| 155 | - yingxiang.setTypeName(result3); | |
| 156 | - CheckType.add(yingxiang); | |
| 157 | - | |
| 158 | - other.setTypeName(result4); | |
| 159 | - CheckType.add(other); | |
| 160 | - | |
| 161 | 127 | CheckByDate CheckByDate1=new CheckByDate(); |
| 162 | 128 | CheckByDate1.setTime(time); |
| 163 | 129 | CheckByDate1.setTypes(CheckType); |
| 164 | 130 | checkByDate.add(CheckByDate1); |
| 165 | 131 | } |
| 166 | 132 | }else{ |
| 133 | + for (CheckResponse check : result) { | |
| 134 | + sortLisItems(check); | |
| 135 | + List<CheckType> checkType =new ArrayList<CheckType>(); | |
| 167 | 136 | |
| 168 | - List<CheckResponse> result = new ArrayList<CheckResponse>(); | |
| 137 | + List<CheckResponse> result2 = new ArrayList<>(); | |
| 169 | 138 | |
| 170 | - result.addAll(queryLisCheckList(vcCardNo,phone,userId)); | |
| 139 | + check.setTitle(check.getTitle()+" "+DateUtil.getyyyy_MM_dd(check.getApplyDate())); | |
| 140 | + CheckType CheckType1 = new CheckType(); | |
| 141 | + result2.add(check); | |
| 171 | 142 | |
| 172 | - List<String> keyList = new ArrayList<>(); | |
| 173 | - List<String> listtype=new ArrayList<>(); | |
| 174 | - List<CheckResponse> listt = new ArrayList<>(); | |
| 175 | - // 去重 | |
| 176 | - List<CheckResponse> list = new ArrayList<>(); | |
| 177 | - Integer num=0; | |
| 178 | - for(CheckResponse check:result){ | |
| 179 | - if(check.getType()!=null && check.getType()==num){ | |
| 180 | - continue; | |
| 143 | + if(result2.size() > 0){ | |
| 144 | + CheckType1.setType(check.getTitle()); | |
| 145 | + CheckType1.setTypeName(result2); | |
| 146 | + checkType.add(CheckType1); | |
| 181 | 147 | } |
| 182 | - list.add(check); | |
| 183 | - num=check.getType(); | |
| 148 | + | |
| 149 | + CheckByDate checkByItem = new CheckByDate(); | |
| 150 | + | |
| 151 | + checkByItem.setTime("检验报告"); | |
| 152 | + checkByItem.setTypes(checkType); | |
| 153 | + checkByDate.add(checkByItem); | |
| 184 | 154 | } |
| 185 | - String t=null; | |
| 186 | - for(CheckResponse check:result){ | |
| 187 | - if(check.getTitle()!=null && check.getTitle().equals(t)){ | |
| 188 | - continue; | |
| 189 | - } | |
| 190 | - listt.add(check); | |
| 191 | - t=check.getTitle(); | |
| 192 | - } | |
| 155 | + } | |
| 156 | + return new BaseObjectResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg(ErrorCodeConstants.SUCCESS_DESCRIPTION).setData(checkByDate); | |
| 157 | + } | |
| 193 | 158 | |
| 194 | - // 排序 | |
| 195 | - Collections.sort(list, new Comparator() { | |
| 159 | + // 排序 | |
| 160 | + private void sortLis(List<CheckResponse> result) | |
| 161 | + { | |
| 162 | + if (CollectionUtils.isNotEmpty(result)) | |
| 163 | + { | |
| 164 | + Collections.sort(result, new Comparator() { | |
| 196 | 165 | public int compare(Object a, Object b) { |
| 197 | - if (((CheckResponse) a).getApplyDate() == null) { | |
| 166 | + if (((CheckResponse)a).getApplyDate() == null) { | |
| 198 | 167 | return -1; |
| 199 | 168 | } |
| 200 | - if (((CheckResponse) b).getApplyDate() == null) { | |
| 169 | + if (((CheckResponse)b).getApplyDate() == null) { | |
| 201 | 170 | return -1; |
| 202 | 171 | } |
| 203 | - if (((CheckResponse) a).getApplyDate().before(((CheckResponse) a).getApplyDate())) { | |
| 172 | + if (((CheckResponse)a).getApplyDate().before(((CheckResponse)b).getApplyDate())) { | |
| 204 | 173 | return 1; |
| 205 | 174 | } |
| 206 | 175 | return -1; |
| 207 | 176 | } |
| 208 | 177 | }); |
| 209 | - | |
| 210 | - for (CheckResponse check:list) { | |
| 211 | - | |
| 212 | - sortLisItems(check); | |
| 213 | - | |
| 214 | - Integer ymd = check.getType(); | |
| 215 | - if (!keyList.contains(ymd.toString())) { | |
| 216 | - keyList.add(ymd.toString()); | |
| 217 | - } | |
| 218 | - | |
| 219 | - } | |
| 220 | - for(CheckResponse check:listt){ | |
| 221 | - String ty=check.getTitle(); | |
| 222 | - if(!listtype.contains(ty)){ | |
| 223 | - listtype.add(ty); | |
| 224 | - } | |
| 225 | - } | |
| 226 | - | |
| 227 | - for(String type:keyList){ | |
| 228 | - | |
| 229 | - List<CheckType> CheckType=new ArrayList<CheckType>(); | |
| 230 | - | |
| 231 | - for(String typ:listtype){ | |
| 232 | - List<CheckResponse> result2=new ArrayList<>(); | |
| 233 | - CheckType CheckType1=new CheckType(); | |
| 234 | - //CheckType1.setType(typ); | |
| 235 | - for(CheckResponse chre:result){ | |
| 236 | - if(type.equals(chre.getType().toString()) && typ.equals(chre.getTitle())){ | |
| 237 | - chre.setTitle(chre.getTitle()+" "+DateUtil.getyyyy_MM_dd(chre.getApplyDate())); | |
| 238 | - result2.add(chre); | |
| 239 | - } | |
| 240 | - | |
| 241 | - } | |
| 242 | - if(result2.size()>0){ | |
| 243 | - CheckType1.setType(typ); | |
| 244 | - CheckType1.setTypeName(result2); | |
| 245 | - CheckType.add(CheckType1); | |
| 246 | - } | |
| 247 | - } | |
| 248 | - | |
| 249 | - CheckByDate CheckByDate1=new CheckByDate(); | |
| 250 | - if("1".equals(type)){ | |
| 251 | - CheckByDate1.setTime("检验报告"); | |
| 252 | - CheckByDate1.setTypes(CheckType); | |
| 253 | - checkByDate.add(CheckByDate1); | |
| 254 | - }else if("2".equals(type)){ | |
| 255 | - CheckByDate1.setTime("影像报告"); | |
| 256 | - CheckByDate1.setTypes(CheckType); | |
| 257 | - checkByDate.add(CheckByDate1); | |
| 258 | - }else{ | |
| 259 | - CheckByDate1.setTime("其它报告"); | |
| 260 | - CheckByDate1.setTypes(CheckType); | |
| 261 | - checkByDate.add(CheckByDate1); | |
| 262 | - } | |
| 263 | - | |
| 264 | - } | |
| 265 | 178 | } |
| 266 | - return new BaseObjectResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg(ErrorCodeConstants.SUCCESS_DESCRIPTION).setData(checkByDate); | |
| 267 | 179 | } |
| 268 | 180 | |
| 269 | 181 | /** |
| ... | ... | @@ -376,6 +288,8 @@ |
| 376 | 288 | for (LisReportModel lis : lises) |
| 377 | 289 | { |
| 378 | 290 | CheckResponse check = new CheckResponse(); |
| 291 | + | |
| 292 | + check.setLisTypeName(lis.getType()); | |
| 379 | 293 | check.setModified(lis.getModified()); |
| 380 | 294 | check.setType(1); /* 1:检验报告,2:影像报告 */ |
| 381 | 295 | check.setName(lis.getName()); |
| ... | ... | @@ -410,7 +324,6 @@ |
| 410 | 324 | //排序 |
| 411 | 325 | sortLisReportItems(items); |
| 412 | 326 | |
| 413 | - //List<LisReportItemModel> items = lisService.queryLisItemByModel(query); | |
| 414 | 327 | if (CollectionUtils.isNotEmpty(items)) |
| 415 | 328 | { |
| 416 | 329 | for (LisReportItemModel checkItem : items) |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/utils/HttpClientUtil.java
View file @
6876993