package com.fs.oms.service.impl;

import java.util.List;
import com.fs.common.utils.DateUtils;
import com.fs.oms.param.OmsInnerOrderParam;
import com.fs.oms.vo.OmsInnerOrderVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.fs.oms.mapper.OmsOrderMapper;
import com.fs.oms.domain.OmsOrder;
import com.fs.oms.service.IOmsOrderService;

/**
 * oms销售订单Service业务层处理
 *
 * @author fs
 * @date 2023-06-26
 */
@Service
public class OmsOrderServiceImpl implements IOmsOrderService
{
    @Autowired
    private OmsOrderMapper omsOrderMapper;

    /**
     * 查询oms销售订单
     *
     * @param id oms销售订单ID
     * @return oms销售订单
     */
    @Override
    public OmsOrder selectOmsOrderById(Long id)
    {
        return omsOrderMapper.selectOmsOrderById(id);
    }

    /**
     * 查询oms销售订单列表
     *
     * @param omsOrder oms销售订单
     * @return oms销售订单
     */
    @Override
    public List<OmsOrder> selectOmsOrderList(OmsOrder omsOrder)
    {
        return omsOrderMapper.selectOmsOrderList(omsOrder);
    }

    /**
     * 新增oms销售订单
     *
     * @param omsOrder oms销售订单
     * @return 结果
     */
    @Override
    public int insertOmsOrder(OmsOrder omsOrder)
    {
        omsOrder.setCreateTime(DateUtils.getNowDate());
        return omsOrderMapper.insertOmsOrder(omsOrder);
    }

    /**
     * 修改oms销售订单
     *
     * @param omsOrder oms销售订单
     * @return 结果
     */
    @Override
    public int updateOmsOrder(OmsOrder omsOrder)
    {
        omsOrder.setUpdateTime(DateUtils.getNowDate());
        return omsOrderMapper.updateOmsOrder(omsOrder);
    }

    /**
     * 批量删除oms销售订单
     *
     * @param ids 需要删除的oms销售订单ID
     * @return 结果
     */
    @Override
    public int deleteOmsOrderByIds(Long[] ids)
    {
        return omsOrderMapper.deleteOmsOrderByIds(ids);
    }

    /**
     * 删除oms销售订单信息
     *
     * @param id oms销售订单ID
     * @return 结果
     */
    @Override
    public int deleteOmsOrderById(Long id)
    {
        return omsOrderMapper.deleteOmsOrderById(id);
    }

    @Override
    public List<OmsInnerOrderVO> selectOmsInnerOrderListVO(OmsInnerOrderParam omsOrder) {
        return omsOrderMapper.selectOmsInnerOrderListVO(omsOrder);
    }
}
