package com.fs.task.service.impl;

import java.util.List;
import com.fs.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.fs.task.mapper.TaskDeliveryInfoMapper;
import com.fs.task.domain.TaskDeliveryInfo;
import com.fs.task.service.ITaskDeliveryInfoService;

/**
 * 交付物信息Service业务层处理
 * 
 * @author fs
 * @date 2026-01-04
 */
@Service
public class TaskDeliveryInfoServiceImpl implements ITaskDeliveryInfoService 
{
    @Autowired
    private TaskDeliveryInfoMapper taskDeliveryInfoMapper;

    /**
     * 查询交付物信息
     * 
     * @param id 交付物信息主键
     * @return 交付物信息
     */
    @Override
    public TaskDeliveryInfo selectTaskDeliveryInfoById(Long id)
    {
        return taskDeliveryInfoMapper.selectTaskDeliveryInfoById(id);
    }

    /**
     * 查询交付物信息列表
     * 
     * @param taskDeliveryInfo 交付物信息
     * @return 交付物信息
     */
    @Override
    public List<TaskDeliveryInfo> selectTaskDeliveryInfoList(TaskDeliveryInfo taskDeliveryInfo)
    {
        return taskDeliveryInfoMapper.selectTaskDeliveryInfoList(taskDeliveryInfo);
    }

    /**
     * 新增交付物信息
     * 
     * @param taskDeliveryInfo 交付物信息
     * @return 结果
     */
    @Override
    public int insertTaskDeliveryInfo(TaskDeliveryInfo taskDeliveryInfo)
    {
        taskDeliveryInfo.setCreateTime(DateUtils.getNowDate());
        return taskDeliveryInfoMapper.insertTaskDeliveryInfo(taskDeliveryInfo);
    }

    /**
     * 修改交付物信息
     * 
     * @param taskDeliveryInfo 交付物信息
     * @return 结果
     */
    @Override
    public int updateTaskDeliveryInfo(TaskDeliveryInfo taskDeliveryInfo)
    {
        taskDeliveryInfo.setUpdateTime(DateUtils.getNowDate());
        return taskDeliveryInfoMapper.updateTaskDeliveryInfo(taskDeliveryInfo);
    }

    /**
     * 批量删除交付物信息
     * 
     * @param ids 需要删除的交付物信息主键
     * @return 结果
     */
    @Override
    public int deleteTaskDeliveryInfoByIds(Long[] ids)
    {
        return taskDeliveryInfoMapper.deleteTaskDeliveryInfoByIds(ids);
    }

    /**
     * 删除交付物信息信息
     * 
     * @param id 交付物信息主键
     * @return 结果
     */
    @Override
    public int deleteTaskDeliveryInfoById(Long id)
    {
        return taskDeliveryInfoMapper.deleteTaskDeliveryInfoById(id);
    }


    @Override
    public TaskDeliveryInfo  getDeliveryInfoByTaskTypeAndDeliveryNo(TaskDeliveryInfo taskDeliveryInfo) {
        return taskDeliveryInfoMapper.getDeliveryInfoByTaskTypeAndDeliveryNo(taskDeliveryInfo);
    }
}
