Commit 303f201af2d3ba23d0ec24bd698b173045465c2f
1 parent
607a08df
update...
Showing
1 changed file
with
43 additions
and
1 deletions
src/main/java/com/bsth/data/summary/service/impl/DestroySituationServiceImpl.java
| ... | ... | @@ -29,6 +29,34 @@ public class DestroySituationServiceImpl extends BaseServiceImpl<DestroySituatio |
| 29 | 29 | Logger logger = LoggerFactory.getLogger(this.getClass()); |
| 30 | 30 | |
| 31 | 31 | @Override |
| 32 | + public Iterable<DestroySituation> list(Map<String, Object> map) { | |
| 33 | + List<DestroySituation> list = (List<DestroySituation>) super.list(map); | |
| 34 | + | |
| 35 | + //排序 | |
| 36 | + Collections.sort(list, new Comparator<DestroySituation>() { | |
| 37 | + @Override | |
| 38 | + public int compare(DestroySituation o1, DestroySituation o2) { | |
| 39 | + int i = o1.getRq().compareTo(o2.getRq()); | |
| 40 | + if(i != 0) | |
| 41 | + return i; | |
| 42 | + | |
| 43 | + i = o1.getLineName().compareTo(o2.getLineName()); | |
| 44 | + if(i != 0) | |
| 45 | + return i; | |
| 46 | + | |
| 47 | + i = (int) (o1.getT() - o2.getT()); | |
| 48 | + if(i != 0) | |
| 49 | + return i; | |
| 50 | + | |
| 51 | + i = o1.getReason().compareTo(o2.getReason()); | |
| 52 | + | |
| 53 | + return i; | |
| 54 | + } | |
| 55 | + }); | |
| 56 | + return list; | |
| 57 | + } | |
| 58 | + | |
| 59 | + @Override | |
| 32 | 60 | public void excel(Map<String, Object> map, HttpServletRequest request, HttpServletResponse response) { |
| 33 | 61 | try { |
| 34 | 62 | map.put("rq_le", CustomStringUtils.maxEndTime(map.get("rq_ge").toString() |
| ... | ... | @@ -46,7 +74,21 @@ public class DestroySituationServiceImpl extends BaseServiceImpl<DestroySituatio |
| 46 | 74 | Collections.sort(list, new Comparator<DestroySituation>() { |
| 47 | 75 | @Override |
| 48 | 76 | public int compare(DestroySituation o1, DestroySituation o2) { |
| 49 | - return (int) (o1.getT() - o2.getT()); | |
| 77 | + int i = o1.getRq().compareTo(o2.getRq()); | |
| 78 | + if(i != 0) | |
| 79 | + return i; | |
| 80 | + | |
| 81 | + i = o1.getLineName().compareTo(o2.getLineName()); | |
| 82 | + if(i != 0) | |
| 83 | + return i; | |
| 84 | + | |
| 85 | + i = (int) (o1.getT() - o2.getT()); | |
| 86 | + if(i != 0) | |
| 87 | + return i; | |
| 88 | + | |
| 89 | + i = o1.getReason().compareTo(o2.getReason()); | |
| 90 | + | |
| 91 | + return i; | |
| 50 | 92 | } |
| 51 | 93 | }); |
| 52 | 94 | ... | ... |