package com.zehong.system.service.impl;

import java.util.List;
import com.zehong.common.utils.DateUtils;
import com.zehong.common.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zehong.system.mapper.TProductLogisticsMapper;
import com.zehong.system.domain.TProductLogistics;
import com.zehong.system.service.ITProductLogisticsService;

/**
 * 出货物流Service业务层处理
 * 
 * @author zehong
 * @date 2024-08-30
 */
@Service
public class TProductLogisticsServiceImpl implements ITProductLogisticsService 
{
    @Autowired
    private TProductLogisticsMapper tProductLogisticsMapper;

    /**
     * 查询出货物流
     * 
     * @param id 出货物流ID
     * @return 出货物流
     */
    @Override
    public TProductLogistics selectTProductLogisticsById(Long id)
    {
        return tProductLogisticsMapper.selectTProductLogisticsById(id);
    }

    /**
     * 查询出货物流列表
     * 
     * @param tProductLogistics 出货物流
     * @return 出货物流
     */
    @Override
    public List<TProductLogistics> selectTProductLogisticsList(TProductLogistics tProductLogistics)
    {
        return tProductLogisticsMapper.selectTProductLogisticsList(tProductLogistics);
    }

    /**
     * 新增出货物流
     * 
     * @param tProductLogistics 出货物流
     * @return 结果
     */
    @Override
    public int insertTProductLogistics(TProductLogistics tProductLogistics)
    {
        tProductLogistics.setCreateTime(DateUtils.getNowDate());
        tProductLogistics.setCreateId(SecurityUtils.getLoginUser().getUser().getUserId());
        return tProductLogisticsMapper.insertTProductLogistics(tProductLogistics);
    }

    /**
     * 修改出货物流
     * 
     * @param tProductLogistics 出货物流
     * @return 结果
     */
    @Override
    public int updateTProductLogistics(TProductLogistics tProductLogistics)
    {
        return tProductLogisticsMapper.updateTProductLogistics(tProductLogistics);
    }

    /**
     * 批量删除出货物流
     * 
     * @param ids 需要删除的出货物流ID
     * @return 结果
     */
    @Override
    public int deleteTProductLogisticsByIds(Long[] ids)
    {
        return tProductLogisticsMapper.deleteTProductLogisticsByIds(ids);
    }

    /**
     * 删除出货物流信息
     * 
     * @param id 出货物流ID
     * @return 结果
     */
    @Override
    public int deleteTProductLogisticsById(Long id)
    {
        return tProductLogisticsMapper.deleteTProductLogisticsById(id);
    }
}
