this is 3.24 update
This commit is contained in:
parent
5d11ef86d2
commit
f6e62355c7
|
@ -20,6 +20,7 @@ import com.cultural.heritage.service.clothes.ClothesService;
|
|||
import com.cultural.heritage.service.common.CommonService;
|
||||
import com.cultural.heritage.service.good.CategoryService;
|
||||
import com.cultural.heritage.service.good.GoodService;
|
||||
import com.cultural.heritage.service.order.ClothesRentOrderService;
|
||||
import com.cultural.heritage.service.order.OrderService;
|
||||
import com.google.gson.Gson;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
@ -77,6 +78,11 @@ public class GlobalController {
|
|||
private CategoryService categoryService;
|
||||
|
||||
|
||||
@Resource
|
||||
private ClothesRentOrderService clothesRentOrderService;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
|
@ -161,6 +167,19 @@ public class GlobalController {
|
|||
map.put("全部已上架商品数量", isShelvesGoodList.size());
|
||||
map.put("全部已下架商品数量", isNoShelvesGoodList.size());
|
||||
|
||||
// 获取所有服装
|
||||
List<Clothes> clothesList = clothesService.list();
|
||||
map.put("全部服装数量", clothesList.size());
|
||||
List<Clothes> isShelvesClothesList = clothesList.stream().filter(clothes -> clothes.getIsShelves() == 1).toList();
|
||||
List<Clothes> isNoShelvesClothesList = clothesList.stream().filter(clothes -> clothes.getIsShelves() == 0).toList();
|
||||
map.put("全部已上架服装数量", isShelvesClothesList.size());
|
||||
map.put("全部已下架服装数量", isNoShelvesClothesList.size());
|
||||
QueryWrapper<ClothesRentOrder> clothesRentOrderQueryWrapper = new QueryWrapper<>();
|
||||
clothesRentOrderQueryWrapper.eq("orderStatus", OrderStatusConstant.PENDING_DELIVERY);
|
||||
List<ClothesRentOrder> clothesRentOrderList = clothesRentOrderService.list(clothesRentOrderQueryWrapper);
|
||||
map.put("已租赁订单数量", clothesRentOrderList.size());
|
||||
|
||||
|
||||
Gson gson = new Gson();
|
||||
String json = gson.toJson(map);
|
||||
Object obj = gson.fromJson(json, Object.class);
|
||||
|
|
Loading…
Reference in New Issue
Block a user