package cn.ezhizao.project.business.service.impl;

import java.util.List;
import javax.annotation.Resource;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import cn.ezhizao.project.business.mapper.BizOutsourcedOrderDetailMapper;
import cn.ezhizao.project.business.domain.BizOutsourcedOrderDetail;
import cn.ezhizao.project.business.service.IBizOutsourcedOrderDetailService;

/**
 * 外协单从Service业务层处理
 *
 * @author ezhizao
 * @date 2024-04-26
 */
@Service
public class BizOutsourcedOrderDetailServiceImpl extends ServiceImpl<BizOutsourcedOrderDetailMapper, BizOutsourcedOrderDetail> implements IBizOutsourcedOrderDetailService {
    @Resource
    private BizOutsourcedOrderDetailMapper bizOutsourcedOrderDetailMapper;

    /**
     * 查询外协单从列表
     *
     * @param bizOutsourcedOrderDetail 外协单从
     * @return 外协单从
     */
    @Override
    public List<BizOutsourcedOrderDetail> getList(BizOutsourcedOrderDetail bizOutsourcedOrderDetail) {
        return bizOutsourcedOrderDetailMapper.getList(bizOutsourcedOrderDetail);
    }

    @Override
    public List<BizOutsourcedOrderDetail> getFinishedOutsourceDetailList(BizOutsourcedOrderDetail bizOutsourcedOrderDetail) {
        return bizOutsourcedOrderDetailMapper.getFinishedOutsourceDetailList(bizOutsourcedOrderDetail);
    }

    /**
     * 查询外协单从列表
     *
     * @param bizOutsourcedOrderDetail 外协单从表
     * @return 外协单从
     */
    @Override
    public List<BizOutsourcedOrderDetail> getListForReceipt(BizOutsourcedOrderDetail bizOutsourcedOrderDetail) {
        return bizOutsourcedOrderDetailMapper.getListForReceipt(bizOutsourcedOrderDetail);
    }

    /**
     * 获取内部报工未完成的外协明细id 所有未完成最后一道外协工序的内部报工都是未完成的外协
     * @param bizOutsourcedOrderDetail
     * @return
     */
    @Override
    public List<Long> getIdsForInterReturn(BizOutsourcedOrderDetail bizOutsourcedOrderDetail) {
        return bizOutsourcedOrderDetailMapper.getIdsForInterReturn(bizOutsourcedOrderDetail);
    }

    /**
     * 物理删除
     *
     * @param bizOutsourcedOrderDetail 待删除
     * @return 删除结果
     */
    @Override
    public int physicalDelete(BizOutsourcedOrderDetail bizOutsourcedOrderDetail) {
        return bizOutsourcedOrderDetailMapper.physicalDelete(bizOutsourcedOrderDetail);
    }

    ;

}
