package com.huimv.getdata.service.impl;


import com.huimv.getdata.entity.center.CaiGouJinE;
import com.huimv.getdata.entity.center.DangQianYvQi;
import com.huimv.getdata.entity.center.XiaoShouE;
import com.huimv.getdata.entity.center.YangMaoZhiCaiGouJinE;
import com.huimv.getdata.entity.kucun.*;
import com.huimv.getdata.mapper.ErpCenterMapper;
import com.huimv.getdata.mapper.ErpKuCunMapper;
import com.huimv.getdata.service.IErpCenterService;
import com.huimv.getdata.service.IErpKuCunService;
import com.sun.org.apache.xpath.internal.operations.Or;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

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

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author author
 * @since 2025-01-03
 */
@Service
public class ErpKuCunServiceImpl implements IErpKuCunService {

    @Autowired
    private ErpKuCunMapper erpKuCunMapper;


    @Override
    public List<YuanCaiLiaoKuCun> getYuanCaiLiaoCunLiang(String date) {
        return erpKuCunMapper.getYuanCaiLiaoCunLiang(date);
    }

    @Override
    public List<YangMaoZhiChuKu> getYangMaoZhiKuCun(String date) {
       return erpKuCunMapper.getYangMaoZhiKuCun(date);
    }

    @Override
    public List<YuanCaiLiaoDangRiRuKu> getYuanCaiLiaoDangRi(String date) {
        return erpKuCunMapper.getYuanCaiLiaoDangRi(date);
    }

    @Override
    public List<ChengPinRuKu> getChengPinDangRi(String date,String type) {
        if (type == null){
            return erpKuCunMapper.getChengPinDangRiAll(date);
        }
        if ("1".equals(type)){
            return erpKuCunMapper.getChengPinDangRi(date);
        }else if ("2".equals(type)){
            return erpKuCunMapper.getWuJinDangRi(date);
        }else if ("3".equals(type)){
            return erpKuCunMapper.getBaoCaiDangRi(date);
        }
        return null;
    }

    @Override
    public List<ChengPinRuKu> getYangMaoZhiDangRi(String date) {
       return erpKuCunMapper.getYangMaoZhiDangRi(date);
    }

    @Override
    public List<YuanCaiLiaoChuKu> getYuanCaiLiaoChuKu(String date) {
       return erpKuCunMapper.getYuanCaiLiaoChuKu(date);
    }

    @Override
    public List<ChenPinChuKu> getChengPinChuKu(String date, String type) {
        if (type == null){
            return erpKuCunMapper.getChengPinChuKuAll(date);
        }
        if ("1".equals(type)){
           return erpKuCunMapper.getChengPinChuKu(date);
        }else if ("2".equals(type)){
            return erpKuCunMapper.getWuJinChuKu(date);
        }
        else if ("3".equals(type)){
            return  erpKuCunMapper.getBaoCaiChuKu(date);
        }
       return null;
    }

    @Override
    public List<YangMaoZhiChuKu> getYangMaoZhiChuKu(String date) {
       return erpKuCunMapper.getYangMaoZhiChuKu(date);
    }

    @Override
    public List<KunCunQuShi> getKunCunQuShi(String date) {
       return erpKuCunMapper.getKunCunQuShi(date);
    }

    @Override
    public List<YangMaoZhiChuKu> getChuKuShuLiang(String date) {
       return erpKuCunMapper.getChuKuShuLiang(date);
    }

    @Override
    public List<WuLiaoKuMingXi> getWuLiaoMingXi(String date) {
       return erpKuCunMapper.getWuLiaoMingXi(date);
    }

    @Override
    public List<YangMaoZhiGongYingShang> getYangMaoZhiGongYingShang(String date) {
       return erpKuCunMapper.getYangMaoZhiGongYingShang(date);
    }

    @Override
    public List<YangMaoZhiGongYingShang> getYangMaoZhiGongYingShangLeiJi(String date) {
       return erpKuCunMapper.getYangMaoZhiGongYingShangLeiJi(date);
    }

    @Override
    public List<FSAFESTOCK> getFSAFESTOCK(String date, String type) {
        return erpKuCunMapper.getFSAFESTOCK();
    }
}
