Commit fd66dfefedf4db6a10e003153eed254b8e4dce5b

Authored by litao@lymsh.com
1 parent b11de20fec

update code

Showing 1 changed file with 30 additions and 1 deletions

platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/ReportServiceImpl.java View file @ fd66dfe
... ... @@ -550,7 +550,36 @@
550 550 Map<String, Object> titleMap = parseTitle(couponReport);
551 551 transNullToZero(couponReport, titleMap);
552 552  
553   - return RespBuilder.buildSuccess("couponReport", couponReport, "couponReportMap", titleMap, "reportModel", reportModel);
  553 + /** titlemap 排序 */
  554 + Map<String, Object> temp = new LinkedHashMap<>();
  555 + Set<String> keys = titleMap.keySet();
  556 + for (String key : keys) {
  557 + if(key.startsWith("7")) {
  558 + temp.put(key, titleMap.get(key));
  559 + }
  560 + }
  561 + for (String key : keys) {
  562 + if(key.startsWith("9")) {
  563 + temp.put(key, titleMap.get(key));
  564 + }
  565 + }
  566 + for (String key : keys) {
  567 + if(key.startsWith("8")) {
  568 + temp.put(key, titleMap.get(key));
  569 + }
  570 + }
  571 + for (String key : keys) {
  572 + if(key.startsWith("10")) {
  573 + temp.put(key, titleMap.get(key));
  574 + }
  575 + }
  576 + for (String s : keys) {
  577 + if(!s.startsWith("10")||!s.startsWith("9")||!s.startsWith("8")||!s.startsWith("7")) {
  578 + temp.put(s, titleMap.get(s));
  579 + }
  580 + }
  581 +
  582 + return RespBuilder.buildSuccess("couponReport", couponReport, "couponReportMap", temp, "reportModel", reportModel);
554 583 }
555 584  
556 585 private void setZeroDataByTemp(List<String> key, List<Map<String, Object>> couponReport) {