package com.zbf.system.service.impl;

import java.util.List;
import com.zbf.common.utils.DateUtils;
import com.zbf.system.domain.TMiStock;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; //添加
import com.zbf.system.mapper.TckOrderdetailBakMapper;
import com.zbf.system.domain.TckOrderdetailBak;
import com.zbf.system.service.ITckOrderdetailBakService;

/**
 * 出库物料明细Service业务层处理
 *
 * @author tony
 * @date 2024-09-09
 */
@Service
public class TckOrderdetailBakServiceImpl extends ServiceImpl<TckOrderdetailBakMapper, TckOrderdetailBak> implements ITckOrderdetailBakService //修改
{
    @Autowired
    private TckOrderdetailBakMapper tckOrderdetailBakMapper;

    /**
     * 查询出库物料明细
     *
     * @param id 出库物料明细主键
     * @return 出库物料明细
     */
    @Override
    public TckOrderdetailBak selectTckOrderdetailBakById(String id)
    {
        return tckOrderdetailBakMapper.selectTckOrderdetailBakById(id);
    }

    /**
     * 查询出库物料明细列表
     *
     * @param tckOrderdetailBak 出库物料明细
     * @return 出库物料明细
     */
    @Override
    public List<TckOrderdetailBak> selectTckOrderdetailBakList(TckOrderdetailBak tckOrderdetailBak)
    {
        return tckOrderdetailBakMapper.selectTckOrderdetailBakList(tckOrderdetailBak);
    }

    /**
     * 新增出库物料明细
     *
     * @param tckOrderdetailBak 出库物料明细
     * @return 结果
     */
    @Override
    public int insertTckOrderdetailBak(TckOrderdetailBak tckOrderdetailBak)
    {
        tckOrderdetailBak.setCreateTime(DateUtils.getNowDate());
        return tckOrderdetailBakMapper.insertTckOrderdetailBak(tckOrderdetailBak);
    }

    /**
     * 修改出库物料明细
     *
     * @param tckOrderdetailBak 出库物料明细
     * @return 结果
     */
    @Override
    public int updateTckOrderdetailBak(TckOrderdetailBak tckOrderdetailBak)
    {
                tckOrderdetailBak.setUpdateTime(DateUtils.getNowDate());
        return tckOrderdetailBakMapper.updateTckOrderdetailBak(tckOrderdetailBak);
    }

    /**
     * 批量删除出库物料明细
     *
     * @param ids 需要删除的出库物料明细主键
     * @return 结果
     */
    @Override
    public int deleteTckOrderdetailBakByIds(String[] ids)
    {
        return tckOrderdetailBakMapper.deleteTckOrderdetailBakByIds(ids);
    }

    /**
     * 删除出库物料明细信息
     *
     * @param id 出库物料明细主键
     * @return 结果
     */
    @Override
    public int deleteTckOrderdetailBakById(String id)
    {
        return tckOrderdetailBakMapper.deleteTckOrderdetailBakById(id);
    }


    /**
     * 批量禁用
     *
     * @param id 出库物料明细主键
     * @return 结果
     */
    @Override
    public int disabledTckOrderdetailBakByIds(String[] ids) {
        return tckOrderdetailBakMapper.disabledTckOrderdetailBakByIds(ids);
    }

    /**
     * 批量启用
     *
     * @param id 出库物料明细主键
     * @return 结果
     */
    @Override
    public int enableTckOrderdetailBakByIds(String[] ids) {
        return tckOrderdetailBakMapper.enableTckOrderdetailBakByIds(ids);
    }

    /**
     * 修改状态
     *
     * @param tckOrderdetailBak 工序管理主键
     * @return 结果
     */
    @Override
    public int updateStatus(TckOrderdetailBak tckOrderdetailBak) {
        return tckOrderdetailBakMapper.updateTckOrderdetailBak(tckOrderdetailBak);
    }

    @Override
    public List<TckOrderdetailBak> select(TckOrderdetailBak tckOrderdetailBak) {
        List<TckOrderdetailBak> tckOrderdetailBaks = tckOrderdetailBakMapper.selectTMiStockList(tckOrderdetailBak);
        return tckOrderdetailBaks;
    }

}
