From ca5d4849b29fbd5802e6855e47057c83bb41361d Mon Sep 17 00:00:00 2001 From: chen-xin-zhi <3588068430@qq.com> Date: Tue, 11 Mar 2025 10:23:15 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E4=BA=86=E5=86=99=E7=9C=9F?= =?UTF-8?q?=E9=A2=84=E7=BA=A6=E7=89=B9=E6=AE=8A=E4=BA=A7=E5=93=81=E5=A4=84?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../heritage/controller/global/GlobalController.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/cultural/heritage/controller/global/GlobalController.java b/src/main/java/com/cultural/heritage/controller/global/GlobalController.java index 00c10d4..415d713 100644 --- a/src/main/java/com/cultural/heritage/controller/global/GlobalController.java +++ b/src/main/java/com/cultural/heritage/controller/global/GlobalController.java @@ -13,6 +13,7 @@ import com.cultural.heritage.model.entity.Order; import com.cultural.heritage.service.book.AdvanceOrderService; import com.cultural.heritage.service.good.GoodService; import com.cultural.heritage.service.order.OrderService; +import com.google.gson.Gson; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; import jakarta.annotation.Resource; @@ -54,7 +55,7 @@ public class GlobalController { @PostMapping("/queryAll") @Operation(summary = "Web端管理员查看全局数据", description = "参数:无,权限:管理员(admin, boss),方法名:delAppointmentDateById") @AuthCheck(mustRole = UserConstant.ADMIN_ROLE) - public BaseResponse> getDashboardData() { + public BaseResponse getDashboardData() { List orderStatusList = List.of(OrderStatusConstant.PENDING_SHIPMENT, OrderStatusConstant.PENDING_DELIVERY, OrderStatusConstant.TRANSACTION_SUCCESSFUL); Map map = new HashMap<>(); @@ -129,7 +130,10 @@ public class GlobalController { map.put("全部已上架商品数量", isShelvesGoodList.size()); map.put("全部已下架商品数量", isNoShelvesGoodList.size()); - return ResultUtils.success(map); + Gson gson = new Gson(); + String json = gson.toJson(map); + Object obj = gson.fromJson(json, Object.class); + return ResultUtils.success(obj); }