TvScController.java 2.58 KB
package com.huaheng.api.tv.controller;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.huaheng.api.tv.service.TvSCService;
import com.huaheng.common.constant.QuantityConstant;
import com.huaheng.common.utils.DateUtils;
import com.huaheng.common.utils.StringUtils;
import com.huaheng.framework.web.controller.BaseController;
import com.huaheng.framework.web.domain.AjaxResult;
import com.huaheng.pc.config.location.domain.Location;
import com.huaheng.pc.config.location.service.LocationService;
import com.huaheng.pc.inventory.inventoryDetail.service.InventoryDetailService;
import com.huaheng.pc.inventory.inventoryTransaction.domain.InventoryTransaction;
import com.huaheng.pc.inventory.inventoryTransaction.service.InventoryTransactionService;
import com.huaheng.pc.task.taskHeader.domain.TaskHeader;
import com.huaheng.pc.task.taskHeader.service.TaskHeaderService;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

/**
 * 四川看板
 */
@RestController
@RequestMapping("/API/WMS/v2")
public class TvScController extends BaseController {

    @Resource
    private TaskHeaderService taskHeaderService;
    @Resource
    private LocationService locationService;
    @Resource
    private InventoryDetailService inventoryDetailService;
    @Resource
    private InventoryTransactionService inventoryTransactionService;
    @Resource
    private TvSCService tvSCService;


    /**
     * 顶部信息统计
     *
     * @param warehouseCode 仓库编码
     * @return
     */
    @GetMapping("tvTopNum")
    @ApiOperation("获取电视信息")
    @ResponseBody
    @CrossOrigin
    public AjaxResult tvTopNum(String warehouseCode) {
        if (StringUtils.isEmpty(warehouseCode)) {
            return AjaxResult.error("请填写仓库");
        }
        return tvSCService.getTopData(warehouseCode);
    }



    /**
     * 7天任务情况
     *
     * @param warehouseCode
     * @return
     */
    @GetMapping("taskByWeek")
    @ApiOperation("获取电视信息")
    @ResponseBody
    @CrossOrigin
    public AjaxResult taskByWeek(String warehouseCode) {
        if (StringUtils.isEmpty(warehouseCode)) {
            return AjaxResult.error("请填写仓库");
        }
        return tvSCService.taskOfWeek(warehouseCode);
    }
}