package com.sw.mes.yb.production.service;

import com.sw.mes.core.base.BaseService;
import com.sw.mes.core.exception.BusinessException;
import com.sw.mes.core.response.Result;
import com.sw.mes.yb.accessory.dto.RecycledMaterialInDto;
import com.sw.mes.yb.production.dto.RecycledMaterialManageDto;
import com.sw.mes.yb.production.entity.RecycledMaterialManage;
import io.swagger.models.auth.In;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.math.BigDecimal;
import java.util.List;

/**
 * @Author: xushu
 * @Date: 2022/08/17/16:24
 * @Description:
 */
public interface RecycledMaterialManageService extends BaseService<RecycledMaterialManage> {
    void softDeleteById(Long id);


    void exportExcel(HttpServletRequest request, HttpServletResponse resp) throws Exception;

    Integer countTimeByParam(String key);


    BigDecimal findTiZhaGaiByLotNo(String lotNo);

    BigDecimal findTiJianLiaoByLotNo(String lotNo);

    BigDecimal findGuoDiLiaoByLotNo(String lotNo);

    BigDecimal findDunGuoLiaoByLotNo(String lotNo);


    /**
     * 回收料对接wms入库
     */
    void recycledMaterialIn(RecycledMaterialManageDto ecycledMaterialManageDto);

    String importExcel(MultipartFile file);

    void updateRecycledManageWeight(String materialBoxNo, BigDecimal weight);

    RecycledMaterialManage getByBoxNoAndStatus(String materialBoxNo);

    RecycledMaterialManage getByBoxNo(String boxNo);

    Result reportedErp(RecycledMaterialManageDto recycledMaterialManageDto);

    /**
     * 回收料对接 料理车间或者wms入库
     */
    void recycledMaterialIn(RecycledMaterialManageDto ecycledMaterialManageDto,String hasGone);

    String startSurplusWarehousing(RecycledMaterialManage recycledMaterialManage, String reason);

    String startSurplusToSeedWarehousing(RecycledMaterialManage recycledMaterialManage, String reason);

    RecycledMaterialManage getByProduceBatchNo(String produceBatchNo);

    String startSurplusToWMS(RecycledMaterialManage recycledMaterialManage, String desc);

    /**
     * 校验订单下是否超收
     * @param orderNo   订单号
     * @param workType  成本中心类型
     * @param addWeight 准备收集的订单重量
     * @return
     */
    Result checkOrderWeight(String orderNo, String  workType,BigDecimal addWeight);

    /**
     * 校验余料采集是否超收
     * @param dto
     * @return
     */
    Result checkRecycledMaterialManageDtoOrderWeight(RecycledMaterialManageDto dto);

    Result saveOrUpdateRecycledMaterial(RecycledMaterialManageDto dto);

    RecycledMaterialManage getRecycleMaterialByTrayNo(String trayNo);
    RecycledMaterialManage getRecycleMaterialByRecycleNo(String recycleNo);
}
