package cn.ezhizao.project.business.service;

import cn.ezhizao.project.business.domain.*;
import cn.ezhizao.project.system.domain.SysDept;
import com.baomidou.mybatisplus.extension.service.IService;

import java.util.List;

/**
 * 报工记录Service接口
 *
 * @author ezhizao
 * @date 2023-12-04
 */
public interface IBizDayworkItemService extends IService<BizDayworkItem>
{
    /**
     * 查询报工记录列表
     *
     * @param bizDayworkItem 报工记录
     * @return 报工记录集合
     */
    public List<BizDayworkItem> getList(BizDayworkItem bizDayworkItem);
    public List<BizDayworkItem> getOutsourcesItemList(BizDayworkItem bizDayworkItem);

    public List<SysDept> getDeptInfo(BizDayworkItem bizDayworkItem);
    public List<BizDayworkItem> getListByDayworkIds(List<Long> ids);
    public List<BizDayworkItem> getListInfoByDayworkIds(List<Long> ids);
    public List<BizDayworkItem> getListByDayworkIdAndProcessStepNumber(BizDayworkItem bizDayworkItem);
    public List<BizDayworkItem> getListByDayworkItemIds(List<Long> ids);
//    public List<BizDayworkItem> getListByLotIds(List<Long> ids);
    List<BizDayworkItem> getListByDayworkIdsForOutsourced(List<Long> ids);
    /**
     * 物理删除
     * @param bizDayworkItem
     * @return 删除结果
     */
    public int physicalDelete(BizDayworkItem bizDayworkItem);
    /**
     * 获取设备信息
     * @param bizProductionResourceGroupDetail
     * @return
     */
    public BizProductionResourceGroupDetail getEquipmentInfo(BizProductionResourceGroupDetail bizProductionResourceGroupDetail);

    /**
     * 更新报工记录
     * @param bizDayworkItem
     */
    public void updateDayworkItem(BizDayworkItem bizDayworkItem);

    List<BizDayworkItem> getItemScreen(Long dayWorkId);

    List<BizDayworkItem> selectDayworkItemList(BizDayworkItem item);
    List<BizDayworkItem> getListByLotIds(List<Long> ids);

    int updateTechnologicalProcessDetailId(Long dayWorkId);

    List<BizDayworkItem> selectLatestItemByDayworkIds(List<Long> dayworkIds);
    List<BizDayworkItem> selectItemByOutsourcedDetailIds(List<Long> ids);

    void saveDayworkItemForOutsource(List<BizOutsourcedOrderDetail> outsourcedOrderDetails);
    List<BizDaywork> saveDayworkItemForInnerOutsource(List<BizOutsourcedOrderDetail> outsourcedOrderDetails, BizOutsourcedOrder outsourcedOrder);
    void updateDayworkItemForOutsource(List<BizOutsourcedOrderDetail> outsourcedOrderDetails,List<BizOutsourcedOrderDetail> oldOutsourcedOrderDetails);
    List<BizDaywork> updateDayworkItemForInnerOutsource(List<BizOutsourcedOrderDetail> outsourcedOrderDetails,List<BizOutsourcedOrderDetail> oldOutsourcedOrderDetails,BizOutsourcedOrder outsourcedOrder);
    void removeByOutsourceIds(List<Long> ids);

    Long getLatestDayworkItemId(BizDayworkItem bizDayworkItem);
    BizDayworkItem getLastItem(BizDayworkItem bizDayworkItem);

    List<BizDayworkItem> getLastFinished(BizDayworkItem dayworkItem);


    List<BizDayworkItem> getSpecialList(BizDayworkItem bizDayworkItem);

    List<Long> screenDayworkItem(List<BizDayworkItem> dayworkItemList, BizDayworkItem bizDayworkItem);

    List<BizDayworkItem> selectListOfspecial(List<BizDaywork> dayworks);

    List<BizDayworkItem> selectBydayworkId(List<Long> dayworkIds);


    int removeSpecial(List<Long> firstDayworkIds);

    List<BizDayworkItem> getListForLotTechnological(BizDayworkItem bizDayworkItem);

    /**
     * 保存工序结束时当前工序箱数
     * @param dayworkItems
     */
    void saveCarrierNum(List<BizDayworkItem> dayworkItems);
}
