package com.huimv.getdata.controller;

import com.huimv.getdata.entity.caigou.CaiGouRuKu;
import com.huimv.getdata.entity.kucun.*;
import com.huimv.getdata.service.IErpCaiGouService;
import com.huimv.getdata.service.IErpKuCunService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Date;
import java.util.List;

@RestController
@RequestMapping("/erp-kucun")
public class ErpKuCunController {

    @Autowired
    IErpKuCunService iErpKuCunService;

    @RequestMapping(value = "/getYuanCaiLiaoCunLiang",method = RequestMethod.GET)
    public List<YuanCaiLiaoKuCun> getYuanCaiLiaoCunLiang(@RequestParam(value = "date" ,required = false) String date){
        return iErpKuCunService.getYuanCaiLiaoCunLiang(date);
    }

    @RequestMapping(value = "/getYangMaoZhiKuCun",method = RequestMethod.GET)
    public List<YangMaoZhiChuKu> getYangMaoZhiKuCun(@RequestParam(value = "date" ,required = false) String date){
        return iErpKuCunService.getYangMaoZhiKuCun(date);
    }

    @RequestMapping(value = "/getYangMaoZhiGongYingShang",method = RequestMethod.GET)
    public List<YangMaoZhiGongYingShang> getYangMaoZhiGongYingShang(@RequestParam(value = "date" ,required = false) String date){
        return iErpKuCunService.getYangMaoZhiGongYingShang(date);
    }

    @RequestMapping(value = "/getYuanCaiLiaoDangRi",method = RequestMethod.GET)
    public List<YuanCaiLiaoDangRiRuKu> getYuanCaiLiaoDangRi(@RequestParam(value = "date" ,required = false) String date){
        return iErpKuCunService.getYuanCaiLiaoDangRi(date);
    }


    @RequestMapping(value = "/getChengPinDangRi",method = RequestMethod.GET)
    public List<ChengPinRuKu> getChengPinDangRi(@RequestParam(value = "date" ,required = false) String date ,
                                                @RequestParam(value = "type",required = false) String type ){
        return iErpKuCunService.getChengPinDangRi(date,type);
    }
    @RequestMapping(value = "/getFSAFESTOCK",method = RequestMethod.GET)
    public List<FSAFESTOCK> getFSAFESTOCK(@RequestParam(value = "date" ,required = false) String date ,
                                                @RequestParam(value = "type",required = false) String type ){
        return iErpKuCunService.getFSAFESTOCK(date,type);
    }

    @RequestMapping(value = "/getYangMaoZhiDangRi",method = RequestMethod.GET)
    public List<ChengPinRuKu> getYangMaoZhiDangRi(@RequestParam(value = "date" ,required = false) String date){
        return iErpKuCunService.getYangMaoZhiDangRi(date);
    }


    @RequestMapping(value = "/getYuanCaiLiaoChuKu",method = RequestMethod.GET)
    public List<YuanCaiLiaoChuKu> getYuanCaiLiaoChuKu(@RequestParam(value = "date" ,required = false) String date){
        return iErpKuCunService.getYuanCaiLiaoChuKu(date);
    }

    @RequestMapping(value = "/getChengPinChuKu",method = RequestMethod.GET)
    public List<ChenPinChuKu> getChengPinChuKu(@RequestParam(value = "date" ,required = false) String date,
                                               @RequestParam(value = "type",required = false) String type){
        return iErpKuCunService.getChengPinChuKu(date,type);
    }


    @RequestMapping(value = "/getYangMaoZhiChuKu",method = RequestMethod.GET)
    public List<YangMaoZhiChuKu> getYangMaoZhiChuKu(@RequestParam(value = "date" ,required = false) String date){
        return iErpKuCunService.getYangMaoZhiChuKu(date);
    }

    @RequestMapping(value = "/getKunCunQuShi",method = RequestMethod.GET)
    public List<KunCunQuShi> getKunCunQuShi(@RequestParam(value = "date" ,required = false) String date){
        return iErpKuCunService.getKunCunQuShi(date);
    }

    @RequestMapping(value = "/getChuKuShuLiang",method = RequestMethod.GET)
    public List<YangMaoZhiChuKu> getChuKuShuLiang(@RequestParam(value = "date" ,required = false) String date){
        return iErpKuCunService.getChuKuShuLiang(date);
    }

    @RequestMapping(value = "/getWuLiaoMingXi",method = RequestMethod.GET)
    public List<WuLiaoKuMingXi> getWuLiaoMingXi(@RequestParam(value = "date" ,required = false) String date){
        return iErpKuCunService.getWuLiaoMingXi(date);
    }

    @RequestMapping(value = "/getYangMaoZhiGongYingShangLeiJi",method = RequestMethod.GET)
    public List<YangMaoZhiGongYingShang> getYangMaoZhiGongYingShangLeiJi(@RequestParam(value = "date" ,required = false) String date){
        return iErpKuCunService.getYangMaoZhiGongYingShangLeiJi(date);
    }
}
