WangHan
2025-04-02 a8ba678a3fe5a39da2c732014cebbb66e408e97c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
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<Map<String, Object>> 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<Map<String, Object>> goodsNumPrice = lWhGoodsService.getGoodsNumByMonth(Convert.toLong(tenantId, 0L));
        return ResponseValue.success(goodsNumPrice);
    }
}