package com.foreverwin.mesnac.dispatch.service;

import com.foreverwin.mesnac.dispatch.dto.RouterDTO;
import com.foreverwin.mesnac.dispatch.model.ShopOrderRelease;
import com.foreverwin.mesnac.meapi.model.Sfc;
import com.foreverwin.mesnac.meapi.model.ShopOrder;

import java.util.List;

/**
 *
 * ClassName: ShopOrderReleaseService
 *
 * @author Leon
 *
 * Copyright (C) 2018-2019 上海昊声电子信息技术有限公司.
 *
 * All Rights Reserved
 *
 * http://www.foreverwin.com.cn
 *
 * Create Time: 2021/06/02
 */

public interface ShopOrderReleaseService {

    /**
     * 查询工艺路线工艺步骤
     *
     * @param routerBo
     * @return
     */
    List<RouterDTO> selectShopOrderRouter(String routerBo);

    /**
     * 查询工单信息
     *
     * @param shopOrderRelease
     * @return
     */
    List<ShopOrderRelease> findShopOrderList(ShopOrderRelease shopOrderRelease);

    /**
     * 工单整理- 更新工单BOM组件数据
     *
     * 1.校验数据是否已更新
     * 2.将未更新的数据进行更新
     *
     * @param site
     * @param user
     * @param shopOrderList
     */
    void shopOrderBomComponentUpdate(String site, String user, List<ShopOrderRelease> shopOrderList);

    /**
     * 工单整理- 下达
     *
     * 1.工单下达
     * 2.写入派工表数据
     *
     * @param site
     * @param user
     * @param shopOrderRelease
     */
    Boolean shopOrderRelease(String site, String user,StringBuffer message, ShopOrderRelease shopOrderRelease);

    /**
     * 工单整理- 刷新派工单
     *
     * 1.只允许操作已下达的工单
     * 2.新建状态的派工单重新计算
     * 3.其他状态的派工数据做更新
     *
     * @param site
     * @param user
     * @param shopOrderList
     */
    void dispatchRefresh(String site, String user, List<ShopOrderRelease> shopOrderList);

    /**
     * 保存派工数据
     *
     * @param site
     * @param user
     * @param shopOrderModel
     * @param sfcModel
     * @param routerList
     */
    void sfcDispatch(String site, String user, ShopOrder shopOrderModel, Sfc sfcModel, List<RouterDTO> routerList);
}
