package com.prolog.cs.biz.outbound.funcflow;

import com.prolog.cs.biz.outbound.model.OmsDoBillHDO;
import com.prolog.cs.biz.outbound.model.dto.WaveDistributeDTO;
import com.prolog.cs.biz.outbound.model.dto.WavesCreateDTO;
import com.prolog.cs.biz.outbound.model.entity.OmsDoBillDDO;
import com.prolog.cs.biz.outbound.model.entity.WaveBillDO;
import com.prolog.cs.biz.outbound.model.entity.WaveDO;
import com.prolog.cs.biz.outbound.model.vo.WavePreCalResultVO;
import com.prolog.cs.biz.outbound.model.vo.WaveStatisticVO;
import com.prolog.framework.authority.core.dto.UserDTO;
import com.prolog.function.annotation.Func;
import com.prolog.upcloud.base.inventory.vo.InvStockWave;
import com.prolog.upcloud.base.inventory.vo.InvStockWaveBill;
import com.prolog.upcloud.base.inventory.vo.StockWaveResultDetailVO;
import com.prolog.upcloud.base.inventory.vo.StockWaveResultVO;

import java.util.Iterator;
import java.util.List;

public class WaveDistributeFunc {

    @Func(name = "波次下发入参校验", category = "出库/波次管理/波次下发", description = "波次下发入参校验")
    @FunctionalInterface
    public interface validDistributeParam {
        void validDistributeParam(WaveDistributeDTO vo);
    }

    @Func(name = "波次下发校验", category = "出库/波次管理/波次下发", description = "波次下发校验")
    @FunctionalInterface
    public interface validDistribute {
        WaveDO validDistribute(String wavesId,String billId, String type);
    }

    @Func(name = "构造波次任务VO", category = "出库/波次管理/波次下发", description = "构造波次任务VO")
    @FunctionalInterface
    public interface structStockWave {
        InvStockWave structStockWave(WaveDO waveDo);
    }

    @Func(name = "查询订单信息并更新", category = "出库/波次管理/波次下发", description = "查询订单信息并更新")
    @FunctionalInterface
    public interface queryBillInfoForUpdate {
        // 需要回传近效期商品信息 - by Huanglh 2022-02-21
        String queryBillInfoForUpdate(String wavesId,String billId, InvStockWave invStockWave);
    }

    @Func(name = "更新状态", category = "出库/波次管理/波次下发", description = "更新状态")
    @FunctionalInterface
    public interface updateStatus {
        void updateStatus(String wavesId,UserDTO userDTO);
    }

    @Func(name = "发送波次任务到库存服务", category = "出库/波次管理/波次下发", description = "发送波次任务到库存服务")
    @FunctionalInterface
    public interface sendWaveToStock {
        void sendWaveToStock(WaveDO waveDo,InvStockWave invStockWave,UserDTO userDTO);
    }

    @Func(name = "发送波次任务到库存服务", category = "出库/波次管理/任务试算", description = "发送波次任务到库存服务")
    @FunctionalInterface
    public interface sendInvStockWaveTrial {
        List<WavePreCalResultVO> sendInvStockWaveTrial(WaveDO waveDo, InvStockWave invStockWave, UserDTO userDTO,List<String> errorMsgList);
    }

    @Func(name = "查询波次监控", category = "出库/波次管理/波次监控", description = "查询波次监控")
    @FunctionalInterface
    public interface queryWaveMonitor {
        List<WaveBillDO> queryWaveMonitor(String waveId);
    }

    @Func(name = "计算波次监控数量", category = "出库/波次管理/波次监控", description = "计算波次监控数量")
    @FunctionalInterface
    public interface calculateMonitorQuantity {
        void calculateMonitorQuantity(WaveStatisticVO waveStatisticVO,String waveId,List<WaveBillDO> allBills);
    }

    @Func(name = "库存预占失败", category = "出库/波次管理/接收波次处理结构消息", description = "库存预占失败")
    @FunctionalInterface
    public interface stockWaveFail {
        void stockWaveFail(StockWaveResultVO waveResult);
    }

    @Func(name = "更新WAVE表状态", category = "出库/波次管理/接收波次处理结构消息", description = "更新WAVE表状态")
    @FunctionalInterface
    public interface updateWaveStatus {
        void updateWaveStatus(String waveId);
    }

    @Func(name = "更新WAVEBILL表状态", category = "出库/波次管理/接收波次处理结构消息", description = "更新WAVEBILL表状态")
    @FunctionalInterface
    public interface updateWaveBillStatus {
        void updateWaveBillStatus(Iterator<StockWaveResultDetailVO> it);
    }

    @Func(name = "更新集货区状态", category = "出库/波次管理/接收波次处理结构消息", description = "更新集货区状态")
    @FunctionalInterface
    public interface updateCollectionArea {
        void updateCollectionArea(String waveId);
    }

    @Func(name = "任务试算处理单据信息", category = "出库/波次管理/任务试算", description = "任务试算处理单据信息")
    @FunctionalInterface
    public interface processBillInfo {
        void processBillInfo(String wavesId, List<InvStockWaveBill> waveBills);
    }
}