package com.dgtly.wxportal.service.impl;

import com.dgtly.common.core.text.Convert;
import com.dgtly.common.utils.DateUtils;
import com.dgtly.wxportal.domain.OrderFile;
import com.dgtly.wxportal.mapper.OrderFileMapper;
import com.dgtly.wxportal.service.IOrderFileService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 订单签收文件Service业务层处理
 * 
 * @author qxm
 * @date 2020-10-15
 */
@Service
public class OrderFileServiceImpl implements IOrderFileService
{
    @Autowired
    private OrderFileMapper orderFileMapper;

    /**
     * 查询订单签收文件
     * 
     * @param orderId 订单签收文件ID
     * @return 订单签收文件
     */
    @Override
    public OrderFile selectOrderFileById(String orderId)
    {
        return orderFileMapper.selectOrderFileById(orderId);
    }

    /**
     * 查询订单签收文件
     *
     * @param flowId 订单签收文件ID
     * @return 订单签收文件
     */
    @Override
    public OrderFile selectOrderFileByFlowId(String flowId)
    {
        return orderFileMapper.selectOrderFileByFlowId(flowId);
    }

    /**
     * 查询订单签收文件列表
     * 
     * @param orderFile 订单签收文件
     * @return 订单签收文件
     */
    @Override
    public List<OrderFile> selectOrderFileList(OrderFile orderFile)
    {
        return orderFileMapper.selectOrderFileList(orderFile);
    }

    /**
     * 新增订单签收文件
     * 
     * @param orderFile 订单签收文件
     * @return 结果
     */
    @Override
    public int insertOrderFile(OrderFile orderFile)
    {
        orderFile.setCreateTime(DateUtils.getNowDate());
        return orderFileMapper.insertOrderFile(orderFile);
    }

    /**
     * 修改订单签收文件
     * 
     * @param orderFile 订单签收文件
     * @return 结果
     */
    @Override
    public int updateOrderFile(OrderFile orderFile)
    {
        orderFile.setUpdateTime(DateUtils.getNowDate());
        return orderFileMapper.updateOrderFile(orderFile);
    }

    /**
     * 删除订单签收文件对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteOrderFileByIds(String ids)
    {
        return orderFileMapper.deleteOrderFileByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除订单签收文件信息
     * 
     * @param orderId 订单签收文件ID
     * @return 结果
     */
    @Override
    public int deleteOrderFileById(String orderId)
    {
        return orderFileMapper.deleteOrderFileById(orderId);
    }

    @Override
    public int updateOrderFileByFlowId(OrderFile orderFile) {
        orderFile.setUpdateTime(DateUtils.getNowDate());
        return orderFileMapper.updateOrderFileByFlowId(orderFile);
    }

    @Override
    public OrderFile selectOrderFileByParam(String orderId, String deliveryNumber, String shipmentNumber, String customersCode) {
        return orderFileMapper.selectOrderFileByParam(orderId,deliveryNumber,shipmentNumber,customersCode);
    }
}
