From 63fe4e8b80d0ac82775a13007c4e83d47c1d5385 Mon Sep 17 00:00:00 2001 From: chenfei <18955928961@163.com> Date: Tue, 9 Aug 2022 17:53:02 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=8E=B7=E5=8F=96=E6=82=A3?= =?UTF-8?q?=E8=80=85=E5=8E=86=E5=8F=B2=E6=95=B0=E6=8D=AE=E5=9B=BE=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../web/controller/pc/TRecordController.java | 10 ++--- .../domain/resp/RecordHistoryDataResp.java | 38 +++++++++++++++---- 2 files changed, 34 insertions(+), 14 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/pc/TRecordController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/pc/TRecordController.java index b7214fc..1aa767c 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/pc/TRecordController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/pc/TRecordController.java @@ -146,7 +146,7 @@ public class TRecordController extends BaseController { RecordHistoryDataResp recordHistoryDataResp = new RecordHistoryDataResp(); - List dateList = records.stream().map(tRecord -> DateUtils.parseDateToStr("dd/MM/yyyy",tRecord.getCreateTime())).collect(Collectors.toList()); + List dateList = records.stream().map(TRecord::getCreateTime).collect(Collectors.toList()); recordHistoryDataResp.setDateList(dateList); List result = records.stream().map(tRecord -> { JSONObject jsonObject; @@ -157,7 +157,6 @@ public class TRecordController extends BaseController } return jsonObject; }).collect(Collectors.toList()); - Map> dataMap = new HashMap<>(); if (!CollectionUtils.isEmpty(result)){ List shezhiList = new LinkedList<>(); List shetaiList = new LinkedList<>(); @@ -170,11 +169,10 @@ public class TRecordController extends BaseController shetaiList.add(jsonObject.getJSONObject("data").getJSONObject("shetai").getInteger(key1)); shexiaList.add(jsonObject.getJSONObject("data").getJSONObject("shexia").getInteger(key2)); }); - dataMap.put("shezhi",shezhiList); - dataMap.put("shetai",shetaiList); - dataMap.put("shexia",shexiaList); + recordHistoryDataResp.setShezhiList(shezhiList); + recordHistoryDataResp.setShetaiList(shetaiList); + recordHistoryDataResp.setShexiaList(shexiaList); } - recordHistoryDataResp.setDataMap(dataMap); return recordHistoryDataResp; } } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/resp/RecordHistoryDataResp.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/resp/RecordHistoryDataResp.java index 0d71885..0241d7a 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/domain/resp/RecordHistoryDataResp.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/resp/RecordHistoryDataResp.java @@ -6,29 +6,51 @@ import java.util.Map; public class RecordHistoryDataResp { - private Map> dataMap; - private List dateList; + private List shezhiList; + private List shetaiList; + private List shexiaList; + private List dateList; public RecordHistoryDataResp() { } - public Map> getDataMap() + public List getShezhiList() { - return dataMap; + return shezhiList; } - public void setDataMap(Map> dataMap) + public void setShezhiList(List shezhiList) { - this.dataMap = dataMap; + this.shezhiList = shezhiList; } - public List getDateList() + public List getShetaiList() + { + return shetaiList; + } + + public void setShetaiList(List shetaiList) + { + this.shetaiList = shetaiList; + } + + public List getShexiaList() + { + return shexiaList; + } + + public void setShexiaList(List shexiaList) + { + this.shexiaList = shexiaList; + } + + public List getDateList() { return dateList; } - public void setDateList(List dateList) + public void setDateList(List dateList) { this.dateList = dateList; }