package com.fs.oms.service.impl;

import java.util.List;
import com.fs.common.utils.DateUtils;
import com.fs.oms.mapper.OmsSupplierProductMapper;
import com.fs.oms.vo.OmsSupplierGoodsListVO;
import com.fs.oms.vo.OmsSupplierProductVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.fs.oms.mapper.OmsSupplierGoodsMapper;
import com.fs.oms.domain.OmsSupplierGoods;
import com.fs.oms.service.IOmsSupplierGoodsService;

/**
 * 供应商商品Service业务层处理
 *
 * @author fs
 * @date 2023-06-14
 */
@Service
public class OmsSupplierGoodsServiceImpl implements IOmsSupplierGoodsService
{
    @Autowired
    private OmsSupplierGoodsMapper omsSupplierGoodsMapper;

    @Autowired
    private OmsSupplierProductMapper omsSupplierProductMapper;

    /**
     * 查询供应商商品
     *
     * @param id 供应商商品ID
     * @return 供应商商品
     */
    @Override
    public OmsSupplierGoods selectOmsSupplierGoodsById(Long id)
    {
        return omsSupplierGoodsMapper.selectOmsSupplierGoodsById(id);
    }

    /**
     * 查询供应商商品列表
     *
     * @param omsSupplierGoods 供应商商品
     * @return 供应商商品
     */
//    @Override
//    public List<OmsSupplierGoods> selectOmsSupplierGoodsList(OmsSupplierGoods omsSupplierGoods)
//    {
//        return omsSupplierGoodsMapper.selectOmsSupplierGoodsList(omsSupplierGoods);
//    }

    /**
     * 新增供应商商品
     *
     * @param omsSupplierGoods 供应商商品
     * @return 结果
     */
    @Override
    public int insertOmsSupplierGoods(OmsSupplierGoods omsSupplierGoods)
    {
        omsSupplierGoods.setCreateTime(DateUtils.getNowDate());
        return omsSupplierGoodsMapper.insertOmsSupplierGoods(omsSupplierGoods);
    }

    /**
     * 修改供应商商品
     *
     * @param omsSupplierGoods 供应商商品
     * @return 结果
     */
    @Override
    public int updateOmsSupplierGoods(OmsSupplierGoods omsSupplierGoods)
    {
        omsSupplierGoods.setUpdateTime(DateUtils.getNowDate());
        return omsSupplierGoodsMapper.updateOmsSupplierGoods(omsSupplierGoods);
    }

    /**
     * 批量删除供应商商品
     *
     * @param ids 需要删除的供应商商品ID
     * @return 结果
     */
    @Override
    public int deleteOmsSupplierGoodsByIds(Long[] ids)
    {
        return omsSupplierGoodsMapper.deleteOmsSupplierGoodsByIds(ids);
    }

    /**
     * 删除供应商商品信息
     *
     * @param id 供应商商品ID
     * @return 结果
     */
    @Override
    public int deleteOmsSupplierGoodsById(Long id)
    {
        return omsSupplierGoodsMapper.deleteOmsSupplierGoodsById(id);
    }

    @Override
    public List<OmsSupplierGoodsListVO> selectOmsSupplierListVO(OmsSupplierGoods omsSupplierGoods) {
        return omsSupplierGoodsMapper.selectOmsSupplierListVO(omsSupplierGoods);
    }

    @Override
    public List<OmsSupplierProductVO> selectOmsProductList(OmsSupplierProductVO omsSupplierProductVO) {
        return omsSupplierProductMapper.selectOmsSupplierProduct(omsSupplierProductVO);
    }
}
