WangHan
2025-04-02 a8ba678a3fe5a39da2c732014cebbb66e408e97c
consum-base/src/main/java/com/consum/base/controller/LWhHomeStatisticsController.java
@@ -1,18 +1,21 @@
package com.consum.base.controller;
import cn.hutool.core.convert.Convert;
import com.consum.base.BaseController;
import com.consum.base.service.LWhGoodsService;
import com.consum.model.po.FinSysTenantUser;
import com.walker.web.ResponseValue;
import io.swagger.annotations.Api;
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 javax.annotation.Resource;
import java.util.List;
import java.util.Map;
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
@@ -24,7 +27,7 @@
@RestController
@RequestMapping("/pc/warehouse/homeStatistics")
@Api(value = "首页统计", tags = "首页统计")
// @Api(value = "首页统计", tags = "首页统计")
public class LWhHomeStatisticsController extends BaseController {
    @Resource
    private LWhGoodsService lWhGoodsService;
@@ -39,7 +42,10 @@
        /*当前登录人只能看到自己机构下的列表*/
        FinSysTenantUser sysInfo = this.getSysInfo();
        String tenantId = sysInfo.getTenantId();
        List<Map<String, Object>> goodsNumPrice = lWhGoodsService.getGoodsNumPrice(Convert.toLong(tenantId, 0l));
        List<Map<String, Object>> goodsNumPrice = lWhGoodsService.getGoodsNumPrice(Convert.toLong(tenantId, 0L));
        if (CollectionUtils.isEmpty(goodsNumPrice)){
            return ResponseValue.success();
        }
        return ResponseValue.success(goodsNumPrice.get(0));
    }
@@ -48,7 +54,7 @@
        /*当前登录人只能看到自己机构下的列表*/
        FinSysTenantUser sysInfo = this.getSysInfo();
        String tenantId = sysInfo.getTenantId();
        List<Map<String, Object>> goodsNumPrice = lWhGoodsService.getGoodsNumByMonth(Convert.toLong(tenantId, 0l));
        List<Map<String, Object>> goodsNumPrice = lWhGoodsService.getGoodsNumByMonth(Convert.toLong(tenantId, 0L));
        return ResponseValue.success(goodsNumPrice);
    }
}