Commit a248dbbf62fa5ab699d7e88ed48f1fb9214cd78a
1 parent
de3e99fee8
Exists in
master
and in
6 other branches
update code
Showing 2 changed files with 56 additions and 3 deletions
platform-operate-api/src/main/java/com/lyms/hospitalapi/pojo/CheckItemResponse.java
View file @
a248dbb
| ... | ... | @@ -11,6 +11,15 @@ |
| 11 | 11 | private String refer; |
| 12 | 12 | private String unit; |
| 13 | 13 | private String special; |
| 14 | + private String printOrder; | |
| 15 | + | |
| 16 | + public String getPrintOrder() { | |
| 17 | + return printOrder; | |
| 18 | + } | |
| 19 | + | |
| 20 | + public void setPrintOrder(String printOrder) { | |
| 21 | + this.printOrder = printOrder; | |
| 22 | + } | |
| 14 | 23 | |
| 15 | 24 | public String getName() { |
| 16 | 25 | return name; |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/LisFacade.java
View file @
a248dbb
| ... | ... | @@ -108,6 +108,7 @@ |
| 108 | 108 | }); |
| 109 | 109 | |
| 110 | 110 | for (CheckResponse check:result) { |
| 111 | + sortLisItems(check); | |
| 111 | 112 | Date date = check.getApplyDate() == null ? check.getModified() : check.getApplyDate(); |
| 112 | 113 | String ymd = DateUtil.getyyyy_MM_dd(date); |
| 113 | 114 | if (!keyList.contains(ymd)) { |
| 114 | 115 | |
| 115 | 116 | |
| 116 | 117 | |
| 117 | 118 | |
| ... | ... | @@ -201,20 +202,25 @@ |
| 201 | 202 | // 排序 |
| 202 | 203 | Collections.sort(list, new Comparator() { |
| 203 | 204 | public int compare(Object a, Object b) { |
| 204 | - if (((CheckResponse)a).getApplyDate() == null) { | |
| 205 | + if (((CheckResponse) a).getApplyDate() == null) { | |
| 205 | 206 | return -1; |
| 206 | 207 | } |
| 207 | - if (((CheckResponse)b).getApplyDate() == null) { | |
| 208 | + if (((CheckResponse) b).getApplyDate() == null) { | |
| 208 | 209 | return -1; |
| 209 | 210 | } |
| 210 | - if (((CheckResponse)a).getApplyDate().before(((CheckResponse)a).getApplyDate())) { | |
| 211 | + if (((CheckResponse) a).getApplyDate().before(((CheckResponse) a).getApplyDate())) { | |
| 211 | 212 | return 1; |
| 212 | 213 | } |
| 213 | 214 | return -1; |
| 214 | 215 | } |
| 215 | 216 | }); |
| 216 | 217 | |
| 218 | + | |
| 219 | + | |
| 217 | 220 | for (CheckResponse check:list) { |
| 221 | + | |
| 222 | + sortLisItems(check); | |
| 223 | + | |
| 218 | 224 | Integer ymd = check.getType(); |
| 219 | 225 | if (!keyList.contains(ymd.toString())) { |
| 220 | 226 | keyList.add(ymd.toString()); |
| 221 | 227 | |
| ... | ... | @@ -270,7 +276,44 @@ |
| 270 | 276 | return new BaseObjectResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg(ErrorCodeConstants.SUCCESS_DESCRIPTION).setData(checkByDate); |
| 271 | 277 | } |
| 272 | 278 | |
| 279 | + /** | |
| 280 | + * 排序检查详情 | |
| 281 | + * @param check | |
| 282 | + */ | |
| 283 | + private void sortLisItems(CheckResponse check) | |
| 284 | + { | |
| 285 | + List<CheckItemResponse> items = check.getItemList(); | |
| 286 | + if (CollectionUtils.isNotEmpty(items)) | |
| 287 | + { | |
| 288 | + Collections.sort(items, new Comparator() { | |
| 289 | + public int compare(Object a, Object b) { | |
| 290 | + String orderA = ((CheckItemResponse) a).getPrintOrder(); | |
| 291 | + String orderB = ((CheckItemResponse) b).getPrintOrder(); | |
| 273 | 292 | |
| 293 | + if (com.lyms.platform.common.utils.StringUtils.isEmpty(orderA)) { | |
| 294 | + return -1; | |
| 295 | + } | |
| 296 | + if (com.lyms.platform.common.utils.StringUtils.isEmpty(orderB)) { | |
| 297 | + return -1; | |
| 298 | + } | |
| 299 | + if (com.lyms.platform.common.utils.StringUtils.isNum(orderA) && | |
| 300 | + com.lyms.platform.common.utils.StringUtils.isNum(orderB)) | |
| 301 | + { | |
| 302 | + int sortNum1 = Integer.parseInt(orderA); | |
| 303 | + int sortNum2 = Integer.parseInt(orderA); | |
| 304 | + if (sortNum1 < sortNum2) { | |
| 305 | + return 1; | |
| 306 | + } | |
| 307 | + } | |
| 308 | + | |
| 309 | + return -1; | |
| 310 | + } | |
| 311 | + }); | |
| 312 | + } | |
| 313 | + check.setItemList(items); | |
| 314 | + } | |
| 315 | + | |
| 316 | + | |
| 274 | 317 | /** |
| 275 | 318 | * 1、首先根据就诊卡号和医院id查询到这个孕妇的pid |
| 276 | 319 | * 2、再根据pid查询到这个孕妇在区域所有的建档记录 |
| ... | ... | @@ -389,6 +432,7 @@ |
| 389 | 432 | } |
| 390 | 433 | item.setUnit(checkItem.getUnit()); |
| 391 | 434 | item.setSpecial(checkItem.getResultFlag()); |
| 435 | + item.setPrintOrder(checkItem.getPrintOrder()); | |
| 392 | 436 | itemList.add(item); |
| 393 | 437 | } |
| 394 | 438 | check.setItemList(itemList); |