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

import java.util.List;

import com.bonus.sgzb.material.domain.PurchaseCheckDetails;
import com.bonus.sgzb.material.mapper.PurchaseCheckDetailsMapper;
import com.bonus.sgzb.material.service.IPurchaseCheckDetailsService;
import com.bonus.sgzb.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 新购验收任务详细purchase_check_detailsService业务层处理
 * 
 * @author bonus
 * @date 2023-12-10
 */
@Service
public class PurchaseCheckDetailsServiceImpl implements IPurchaseCheckDetailsService
{
    @Autowired
    private PurchaseCheckDetailsMapper purchaseCheckDetailsMapper;

    /**
     * 查询新购验收任务详细purchase_check_details
     * 
     * @param taskId 新购验收任务详细purchase_check_details主键
     * @return 新购验收任务详细purchase_check_details
     */
    @Override
    public PurchaseCheckDetails selectPurchaseCheckDetailsByTaskId(Long taskId)
    {
        return purchaseCheckDetailsMapper.selectPurchaseCheckDetailsByTaskId(taskId);
    }

    /**
     * 查询新购验收任务详细purchase_check_details列表
     * 
     * @param purchaseCheckDetails 新购验收任务详细purchase_check_details
     * @return 新购验收任务详细purchase_check_details
     */
    @Override
    public List<PurchaseCheckDetails> selectPurchaseCheckDetailsList(PurchaseCheckDetails purchaseCheckDetails)
    {
        return purchaseCheckDetailsMapper.selectPurchaseCheckDetailsList(purchaseCheckDetails);
    }

    /**
     * 新增新购验收任务详细purchase_check_details
     * 
     * @param purchaseCheckDetailsList 新购验收任务详细purchase_check_details
     * @return 结果
     */
    @Override
    public int insertPurchaseCheckDetails(List<PurchaseCheckDetails> purchaseCheckDetailsList)
    {
//        purchaseCheckDetails.setCreateTime(DateUtils.getNowDate());
//        return purchaseCheckDetailsMapper.insertPurchaseCheckDetails(purchaseCheckDetails);
        return purchaseCheckDetailsMapper.insertPurchaseCheckDetailsList(purchaseCheckDetailsList);
    }

    /**
     * 修改新购验收任务详细purchase_check_details
     * 
     * @param purchaseCheckDetails 新购验收任务详细purchase_check_details
     * @return 结果
     */
    @Override
    public int updatePurchaseCheckDetails(PurchaseCheckDetails purchaseCheckDetails)
    {
        purchaseCheckDetails.setUpdateTime(DateUtils.getNowDate());
        return purchaseCheckDetailsMapper.updatePurchaseCheckDetails(purchaseCheckDetails);
    }

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

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