package com.consum.base.controller; import java.util.List; import java.util.Map; import jakarta.annotation.Resource; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import com.consum.base.BaseController; import com.consum.base.service.LWhGoodsService; import com.consum.model.po.FinSysTenantUser; import com.walker.infrastructure.utils.CollectionUtils; import com.walker.web.ResponseValue; import cn.hutool.core.convert.Convert; /** * @ClassName LWhHomeStatisticsController * @Author cy * @Date 2023/11/27 * @Description * @Version 1.0 **/ @RestController @RequestMapping("/pc/warehouse/homeStatistics") // @Api(value = "首页统计", tags = "首页统计") public class LWhHomeStatisticsController extends BaseController { @Resource private LWhGoodsService lWhGoodsService; /** * 物品数量金额统计 * * @return */ @GetMapping("getGoodsNumPrice") public ResponseValue goodsNumPrice() { /*当前登录人只能看到自己机构下的列表*/ FinSysTenantUser sysInfo = this.getSysInfo(); String tenantId = sysInfo.getTenantId(); List> goodsNumPrice = lWhGoodsService.getGoodsNumPrice(Convert.toLong(tenantId, 0L)); if (CollectionUtils.isEmpty(goodsNumPrice)){ return ResponseValue.success(); } return ResponseValue.success(goodsNumPrice.get(0)); } @GetMapping("getGoodsNumByMonth") public ResponseValue getGoodsNumByMonth() { /*当前登录人只能看到自己机构下的列表*/ FinSysTenantUser sysInfo = this.getSysInfo(); String tenantId = sysInfo.getTenantId(); List> goodsNumPrice = lWhGoodsService.getGoodsNumByMonth(Convert.toLong(tenantId, 0L)); return ResponseValue.success(goodsNumPrice); } }