futian.liu
2023-12-22 fd95223d9703b9c038ed3c782474c885052dda08
consum-base/src/main/java/com/consum/base/controller/LWhHomeStatisticsController.java
@@ -1,18 +1,22 @@
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 javax.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;
import io.swagger.annotations.Api;
/**
 * @ClassName LWhHomeStatisticsController
@@ -39,7 +43,19 @@
        /*当前登录人只能看到自己机构下的列表*/
        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));
    }
    @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);
    }
}