package com.bonus.sgzb.material.service.impl;

import java.util.List;

import com.bonus.sgzb.material.domain.PurchaseCheckInfo;
import com.bonus.sgzb.material.domain.TmTask;
import com.bonus.sgzb.material.mapper.PurchaseCheckInfoMapper;
import com.bonus.sgzb.material.service.IPurchaseCheckInfoService;
import com.bonus.sgzb.common.core.utils.DateUtils;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * 新购验收任务Service业务层处理
 * 
 * @author bonus
 * @date 2023-12-10
 */
@Service
public class PurchaseCheckInfoServiceImpl implements IPurchaseCheckInfoService
{
    @Resource
    private PurchaseCheckInfoMapper purchaseCheckInfoMapper;

    /**
     * 查询新购验收任务
     * 
     * @param taskId 新购验收任务主键
     * @return 新购验收任务
     */
    @Override
    public PurchaseCheckInfo selectPurchaseCheckInfoByTaskId(Long taskId)
    {
        return purchaseCheckInfoMapper.selectPurchaseCheckInfoByTaskId(taskId);
    }

    /**
     * 查询新购验收任务列表
     * 
     * @param purchaseCheckInfo 新购验收任务
     * @return 新购验收任务
     */
    @Override
    public List<PurchaseCheckInfo> selectPurchaseCheckInfoList(PurchaseCheckInfo purchaseCheckInfo)
    {
        return purchaseCheckInfoMapper.selectPurchaseCheckInfoList(purchaseCheckInfo);
    }

    /**
     * 新增新购验收任务
     * 
     * @param purchaseCheckInfo 新购验收任务
     * @return 结果
     */
    @Override
    public int insertPurchaseCheckInfo(PurchaseCheckInfo purchaseCheckInfo)
    {
        TmTask task = new TmTask();

        purchaseCheckInfo.setCreateTime(DateUtils.getNowDate());
        return purchaseCheckInfoMapper.insertPurchaseCheckInfo(purchaseCheckInfo);
    }

    /**
     * 修改新购验收任务
     * 
     * @param purchaseCheckInfo 新购验收任务
     * @return 结果
     */
    @Override
    public int updatePurchaseCheckInfo(PurchaseCheckInfo purchaseCheckInfo)
    {
        purchaseCheckInfo.setUpdateTime(DateUtils.getNowDate());
        return purchaseCheckInfoMapper.updatePurchaseCheckInfo(purchaseCheckInfo);
    }

    /**
     * 批量删除新购验收任务
     * 
     * @param taskIds 需要删除的新购验收任务主键
     * @return 结果
     */
    @Override
    public int deletePurchaseCheckInfoByTaskIds(Long[] taskIds)
    {
        return purchaseCheckInfoMapper.deletePurchaseCheckInfoByTaskIds(taskIds);
    }

    /**
     * 删除新购验收任务信息
     * 
     * @param taskId 新购验收任务主键
     * @return 结果
     */
    @Override
    public int deletePurchaseCheckInfoByTaskId(Long taskId)
    {
        return purchaseCheckInfoMapper.deletePurchaseCheckInfoByTaskId(taskId);
    }
}
