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); }