package com.xisc.pm.app.service;

import com.xisc.pm.api.dto.PmCmdRecordDTO;
import com.xisc.pm.api.dto.PmCmdRecordResDTO;
import com.xisc.pm.domain.entity.MmSlab;
import com.xisc.pm.domain.entity.PmCmdLargePlt;
import com.xisc.pm.domain.entity.PmCompositeSlab;
import com.xisc.pm.domain.entity.PmCompositeSlabList;
import com.xisc.pm.domain.entity.PmPdSlabInfo;
import com.xisc.pm.infra.enums.PdMatType;
import io.choerodon.core.domain.Page;
import io.choerodon.mybatis.pagehelper.domain.PageRequest;

import java.util.List;
import java.util.Map;

/**
 * 板坯信息表(PmPdSlabInfo)应用服务
 *
 * @author 纪文桃 wentao.ji01@hand-china.com
 * @since 2024-08-12 14:59:22
 */
public interface PmPdSlabInfoService {

    /**
     * 查询数据
     *
     * @param pageRequest   分页参数
     * @param pmPdSlabInfos 查询条件
     * @return 返回值
     */
    Page<PmPdSlabInfo> selectList(PageRequest pageRequest, PmPdSlabInfo pmPdSlabInfos);

    /**
     * 保存数据
     *
     * @param pmPdSlabInfos 数据
     */
    void saveData(List<PmPdSlabInfo> pmPdSlabInfos);

    /**
     * 试样添加
     *
     * @param dto
     * @param organizationId
     * @return
     */
    Map<String, Object> sampleAdditionQuery(PmCmdLargePlt dto, Long organizationId, int page, int size);

    /**
     * 试样添加调用质量模块接口计算试验长度
     *
     * @param dtoList
     * @param organizationId
     */
    void sampleAddition(List<PmCmdLargePlt> dtoList, Long organizationId);
    
    /**
     * 试样添加
     * @param pdMatType
     * @param dtoList
     * @param organizationId
     */
    void sampleAddition(String pdMatType,List<PmCmdLargePlt> dtoList, Long organizationId);

    /**
     * 试样添加回退
     *
     * @param tmpSlapNoList
     * @param organizationId
     */
    void sampleAdditionRollBack(List<String> tmpSlapNoList, Long organizationId , PdMatType pdMatType);

    /**
     * 出钢材二次设计
     * @param dtoList
     * @param organizationId
     */
    void outSteelSecondaryDesign(List<PmCmdLargePlt> dtoList, Long organizationId);

    /**
     * 出钢材二次设计回退
     * @param dtoList
     * @param organizationId
     */
    void outSteelSecondaryDesignRollback(List<PmCmdLargePlt> dtoList, Long organizationId);

    /**
     * 余材钢板二次设计
     * @param dtoList
     * @param organizationId
     */
    void surplusSteelPlateSecondaryDesign(List<PmCmdLargePlt> dtoList, Long organizationId);

    /**
     * 余材钢板二次设计回退
     * @param dtoList
     * @param organizationId
     */
    void surplusSteelPlateSecondaryDesignRollback(List<PmCmdLargePlt> dtoList, Long organizationId);

    /**
     * 余材板坯二次设计
     * @param dtoList
     * @param organizationId
     */
    void surplusSlabSecondaryDesign(List<PmCmdLargePlt> dtoList, Long organizationId);

    /**
     * 余材板坯二次设计回退
     * @param dtoList
     * @param organizationId
     */
    void surplusSlabSecondaryDesignRollback(List<PmCmdLargePlt> dtoList, Long organizationId);

    /**
     * 出钢材命令作成
     * @param dtoList
     * @param organizationId
     */
    void outSteelCommandCreate(List<PmCmdLargePlt> dtoList, Long organizationId);

    /**
     * 余材钢板命令作成
     * @param dtoList
     * @param organizationId
     */
    void surplusSteelCommandCreate(List<PmCmdLargePlt> dtoList, Long organizationId);

    /**
     * 余材板坯命令作成
     * @param dtoList
     * @param organizationId
     */
    void surplusSlabCommandCreate(List<PmCmdLargePlt> dtoList, Long organizationId);

    /**
     * 创建复合板信息
     * @param mmSlab 板坯主数据
     * @param pmCompositeSlab 
     * @param pmCompositeSlabList
     * @param isFhb 是否是复合板，如果true 表示是，false表示未基材
     * @return
     */
    PmPdSlabInfo createFhbSlabInfo(MmSlab mmSlab, PmCompositeSlab pmCompositeSlab, PmCompositeSlabList pmCompositeSlabList, boolean isFhb);

    /**
     * 履历查询
     *
     * @param dto
     * @param pageRequest
     * @param tenantId
     * @return
     */
    Page<PmCmdRecordResDTO> queryCmdRecord(PmCmdRecordDTO dto,PageRequest pageRequest, Long tenantId);
}

