package com.shkj.wms.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.shkj.wms.domain.BusinDataTaskGoods;
import com.shkj.wms.mapper.BusinDataTaskGoodsMapper;
import com.shkj.wms.service.IBusinDataTaskGoodsService;
import com.shkj.wms.vo.BusinDataTaskGoodsVo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 任务物料替换明细Service业务层处理
 *
 * @author zjx
 * @date 2023-04-07
 */
@Slf4j
@Service
@Transactional(rollbackFor = Exception.class)
public class BusinDataTaskGoodsServiceImpl extends ServiceImpl<BusinDataTaskGoodsMapper, BusinDataTaskGoods> implements IBusinDataTaskGoodsService
{
    @Autowired
    private BusinDataTaskGoodsMapper businDataTaskGoodsMapper;

    /**
     * 查询任务物料替换明细d
     *
     * @param id 任务物料替换明细主键
     * @return 任务物料替换明细
     */
    @Override
    public BusinDataTaskGoods selectBusinTaskGoodsById(Long id)
    {
        return businDataTaskGoodsMapper.selectBusinTaskGoodsById(id);
    }

    /**
     * 根据任务ID获取物料明细
     *
     * @param taskCode 任务物料替换明细主键
     * @return 物料明细
     */
    @Override
    public List<BusinDataTaskGoodsVo> selectBusinTaskGoodsByTaskCode(Long taskCode) {
        return businDataTaskGoodsMapper.selectBusinTaskGoodsByTaskCode(taskCode);
    }

    /**
     * 根据任务ID获取出库库物料明细
     * @param  taskId
     * @return
     */
    @Override
    public List<BusinDataTaskGoodsVo> getTaskGoodsByTaskCodeForOut(Long taskId) {
        return businDataTaskGoodsMapper.getTaskGoodsByTaskCodeForOut(taskId);
    }


}
