package com.hw.mes.service.impl;

import java.util.List;
import com.hw.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.hw.mes.mapper.MesPurchaseOrderMapper;
import com.hw.mes.domain.MesPurchaseOrder;
import com.hw.mes.service.IMesPurchaseOrderService;

/**
 * 采购订单信息Service业务层处理
 * 
 * @author Yinq
 * @date 2024-02-19
 */
@Service
public class MesPurchaseOrderServiceImpl implements IMesPurchaseOrderService 
{
    @Autowired
    private MesPurchaseOrderMapper mesPurchaseOrderMapper;

    /**
     * 查询采购订单信息
     * 
     * @param purchaseOrderId 采购订单信息主键
     * @return 采购订单信息
     */
    @Override
    public MesPurchaseOrder selectMesPurchaseOrderByPurchaseOrderId(Long purchaseOrderId)
    {
        return mesPurchaseOrderMapper.selectMesPurchaseOrderByPurchaseOrderId(purchaseOrderId);
    }

    /**
     * 查询采购订单信息列表
     * 
     * @param mesPurchaseOrder 采购订单信息
     * @return 采购订单信息
     */
    @Override
    public List<MesPurchaseOrder> selectMesPurchaseOrderList(MesPurchaseOrder mesPurchaseOrder)
    {
        return mesPurchaseOrderMapper.selectMesPurchaseOrderList(mesPurchaseOrder);
    }

    /**
     * 新增采购订单信息
     * 
     * @param mesPurchaseOrder 采购订单信息
     * @return 结果
     */
    @Override
    public int insertMesPurchaseOrder(MesPurchaseOrder mesPurchaseOrder)
    {
        mesPurchaseOrder.setCreateTime(DateUtils.getNowDate());
        return mesPurchaseOrderMapper.insertMesPurchaseOrder(mesPurchaseOrder);
    }

    /**
     * 修改采购订单信息
     * 
     * @param mesPurchaseOrder 采购订单信息
     * @return 结果
     */
    @Override
    public int updateMesPurchaseOrder(MesPurchaseOrder mesPurchaseOrder)
    {
        mesPurchaseOrder.setUpdateTime(DateUtils.getNowDate());
        return mesPurchaseOrderMapper.updateMesPurchaseOrder(mesPurchaseOrder);
    }

    /**
     * 批量删除采购订单信息
     * 
     * @param purchaseOrderIds 需要删除的采购订单信息主键
     * @return 结果
     */
    @Override
    public int deleteMesPurchaseOrderByPurchaseOrderIds(Long[] purchaseOrderIds)
    {
        return mesPurchaseOrderMapper.deleteMesPurchaseOrderByPurchaseOrderIds(purchaseOrderIds);
    }

    /**
     * 删除采购订单信息信息
     * 
     * @param purchaseOrderId 采购订单信息主键
     * @return 结果
     */
    @Override
    public int deleteMesPurchaseOrderByPurchaseOrderId(Long purchaseOrderId)
    {
        return mesPurchaseOrderMapper.deleteMesPurchaseOrderByPurchaseOrderId(purchaseOrderId);
    }
}
