Commit fe42c782d4cf3ca1bb1f11421f49b7ad68b617a4
1 parent
73f3d391d9
Exists in
master
and in
6 other branches
排序
Showing 1 changed file with 39 additions and 32 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/ReportServiceImpl.java
View file @
fe42c78
| ... | ... | @@ -549,37 +549,37 @@ |
| 549 | 549 | Map<String, Object> titleMap = parseTitle(couponReport); |
| 550 | 550 | transNullToZero(couponReport, titleMap); |
| 551 | 551 | |
| 552 | - /** titlemap 排序 */ | |
| 553 | - Map<String, Object> temp = new LinkedHashMap<>(); | |
| 554 | - Set<String> keys = titleMap.keySet(); | |
| 555 | - for (String key : keys) { | |
| 556 | - if(key.startsWith("7")) { | |
| 557 | - temp.put(key, titleMap.get(key)); | |
| 558 | - } | |
| 559 | - } | |
| 560 | - for (String key : keys) { | |
| 561 | - if(key.startsWith("9")) { | |
| 562 | - temp.put(key, titleMap.get(key)); | |
| 563 | - } | |
| 564 | - } | |
| 565 | - for (String key : keys) { | |
| 566 | - if(key.startsWith("8")) { | |
| 567 | - temp.put(key, titleMap.get(key)); | |
| 568 | - } | |
| 569 | - } | |
| 570 | - for (String key : keys) { | |
| 571 | - if(key.startsWith("10")) { | |
| 572 | - temp.put(key, titleMap.get(key)); | |
| 573 | - } | |
| 574 | - } | |
| 575 | - for (String s : keys) { | |
| 576 | - if(!s.startsWith("10")||!s.startsWith("9")||!s.startsWith("8")||!s.startsWith("7")) { | |
| 577 | - temp.put(s, titleMap.get(s)); | |
| 578 | - } | |
| 579 | - } | |
| 552 | +// /** titlemap 排序 */ | |
| 553 | +// Map<String, Object> temp = new LinkedHashMap<>(); | |
| 554 | +// Set<String> keys = titleMap.keySet(); | |
| 555 | +// for (String key : keys) { | |
| 556 | +// if(key.startsWith("7")) { | |
| 557 | +// temp.put(key, titleMap.get(key)); | |
| 558 | +// } | |
| 559 | +// } | |
| 560 | +// for (String key : keys) { | |
| 561 | +// if(key.startsWith("9")) { | |
| 562 | +// temp.put(key, titleMap.get(key)); | |
| 563 | +// } | |
| 564 | +// } | |
| 565 | +// for (String key : keys) { | |
| 566 | +// if(key.startsWith("8")) { | |
| 567 | +// temp.put(key, titleMap.get(key)); | |
| 568 | +// } | |
| 569 | +// } | |
| 570 | +// for (String key : keys) { | |
| 571 | +// if(key.startsWith("10")) { | |
| 572 | +// temp.put(key, titleMap.get(key)); | |
| 573 | +// } | |
| 574 | +// } | |
| 575 | +// for (String s : keys) { | |
| 576 | +// if(!s.startsWith("10")||!s.startsWith("9")||!s.startsWith("8")||!s.startsWith("7")) { | |
| 577 | +// temp.put(s, titleMap.get(s)); | |
| 578 | +// } | |
| 579 | +// } | |
| 580 | 580 | |
| 581 | 581 | List<Map<String, Object>> couponReportMap = new ArrayList<>(); |
| 582 | - Set<Map.Entry<String, Object>> entries = temp.entrySet(); | |
| 582 | + Set<Map.Entry<String, Object>> entries = titleMap.entrySet(); | |
| 583 | 583 | for (Map.Entry<String, Object> entry : entries) { |
| 584 | 584 | Map<String, Object> m = new HashMap<>(); |
| 585 | 585 | m.put("name", entry.getValue()); |
| ... | ... | @@ -599,7 +599,7 @@ |
| 599 | 599 | } |
| 600 | 600 | } |
| 601 | 601 | |
| 602 | - if(CollectionUtils.isNotEmpty(couponReport)) { | |
| 602 | + /* if(CollectionUtils.isNotEmpty(couponReport)) { | |
| 603 | 603 | Map<String, Object> map = couponReport.get(0); |
| 604 | 604 | // 类型排序:儿童建档券-新生儿访视券-儿保检查券-血红蛋白检查券 (7 9 8 10) |
| 605 | 605 | Map<String, Object> temp = new LinkedHashMap<>(); |
| ... | ... | @@ -630,7 +630,7 @@ |
| 630 | 630 | } |
| 631 | 631 | } |
| 632 | 632 | couponReport.set(0, temp); |
| 633 | - } | |
| 633 | + }*/ | |
| 634 | 634 | } |
| 635 | 635 | |
| 636 | 636 | private Map<String, Object> packCouponMap(Map<String, Object> sendInfo, Map<String, Object> usedInfo, Map<String, Object> hNameMap, String hid, List<String> xAxis, Map<String, Object> param) { |
| 637 | 637 | |
| 638 | 638 | |
| ... | ... | @@ -746,11 +746,18 @@ |
| 746 | 746 | temp.put(key, titleMap.get(key)); |
| 747 | 747 | } |
| 748 | 748 | } |
| 749 | + Map<String, Object> sortTemp = new TreeMap<>( | |
| 750 | + new Comparator<String>() { | |
| 751 | + public int compare(String obj1, String obj2) { | |
| 752 | + return obj1.compareTo(obj2); | |
| 753 | + } | |
| 754 | + }); | |
| 749 | 755 | for (String key : keys) { |
| 750 | 756 | if(key.startsWith("10")) { |
| 751 | - temp.put(key, titleMap.get(key)); | |
| 757 | + sortTemp.put(key, titleMap.get(key)); | |
| 752 | 758 | } |
| 753 | 759 | } |
| 760 | + temp.putAll(sortTemp); | |
| 754 | 761 | for (String s : keys) { |
| 755 | 762 | if(!s.startsWith("10")||!s.startsWith("9")||!s.startsWith("8")||!s.startsWith("7")) { |
| 756 | 763 | temp.put(s, titleMap.get(s)); |