package com.sw.common.accessory.server.interfaces.out;

import com.sw.common.accessory.server.dto.AccessoryMaterialInfo;
import com.sw.common.accessory.server.dto.ApplyAccessoryParam;
import com.sw.common.accessory.server.dto.EquipmentInfo;
import com.sw.common.accessory.server.entity.Accessory;
import com.sw.common.accessory.server.entity.DeterminationEchnology;
import com.sw.common.accessory.server.entity.DeterminationQuality;
import com.sw.common.core.exception.BusinessException;
import org.springframework.stereotype.Service;

/**
 * @author zhaowenjie
 */
@Service
public interface AccyOutService {

    /**
     * 获取设备信息
     *
     * @param equipmentCode 设备号
     * @return 设备信息
     */
    default EquipmentInfo getEquipmentInfo(String equipmentCode) {
        throw new BusinessException("请实现【获取设备信息】的接口，需对接设备模块");
    }

    /**
     * 向仓库推送退库申请
     *
     * @param accessory 辅料信息
     * @param reason    退库原因
     * @return 返回申请单号
     */
    default String stockReturnApply(Accessory accessory, String reason) {
        throw new BusinessException("请实现【向仓库推送退库申请】的接口，需对接仓库系统");
    }

    /**
     * 判定是否报废发起退库申请
     * @param accessory
     * @param reason
     * @param determinationEchnology
     * @return
     */
    default String stockEchnologyReturnOutApply(Accessory accessory, String reason, DeterminationEchnology determinationEchnology) {
        throw new BusinessException("请实现【向仓库推送退库申请】的接口，需对接仓库系统");
    }
    default String stockQualityReturnOutApply(Accessory accessory, String reason, DeterminationQuality determinationQuality) {
        throw new BusinessException("请实现【向仓库推送退库申请】的接口，需对接仓库系统");
    }
    /**
     * 取消向仓库推送退库申请
     *
     * @param code 退库申请单号
     */
    default void cancelStockReturnApply(String code) {
        throw new BusinessException("请实现【取消向仓库推送退库申请】的接口，需对接仓库系统");
    }

    /**
     * 辅材申请
     *
     * @param applyAccessoryParam 申请物料信息
     * @return 返回申请单号
     */
    default String applyAccessory(ApplyAccessoryParam applyAccessoryParam) {
        throw new BusinessException("请实现【辅材申请】的接 口，需对接仓库系统");
    }

    /**
     * 取消辅材申请
     *
     * @param code 申请单号
     */
    default void cancelApplyAccessory(String code) {
        throw new BusinessException("请实现【取消辅材申请】的接口，需对接仓库系统");
    }

    /**
     * 获取热场模型信息
     * @param materialId 热场模型id
     * @return 热场数据
     */
    default AccessoryMaterialInfo getById(Long materialId) {
        throw new BusinessException("请实现【获取辅材信息】的接口");
    }
    /**
     * 获取热场模型信息
     * @param materialCode 热场模型id
     * @return 热场数据
     */
    default AccessoryMaterialInfo getByMaterialCode(String materialCode) {
        throw new BusinessException("请实现【获取辅材信息】的接口");
    }
    /**
     * 获取热场模型信息
     * @param materialCode 热场模型id
     * @return 热场数据
     */
    default AccessoryMaterialInfo getByMaterialCodes(String materialCode) {
        throw new BusinessException("请实现【获取辅材信息】的接口");
    }
}
