package com.xisc.pm.app.service;

import com.xisc.pm.api.dto.PmBoardMatInfoDTO;
import com.xisc.pm.api.dto.PmDeleteFailureDTO;
import com.xisc.pm.api.dto.PmPlateConfigDTO;
import com.xisc.pm.api.dto.PmProContCanclePoolReqDTO;
import com.xisc.pm.api.dto.PmProContFilterRequestDTO;
import com.xisc.pm.api.dto.PmProContFilterResposeDTO;
import com.xisc.pm.api.dto.PmProContPoolRequestDTO;
import com.xisc.pm.api.dto.PmProContPoolResposeDTO;
import com.xisc.pm.api.dto.PmProContRequestDTO;
import com.xisc.pm.api.dto.PmProContResposeDTO;
import com.xisc.pm.api.dto.PmProContSelectionDTO;
import com.xisc.pm.api.dto.PmProContSelectionRequestDTO;
import com.xisc.pm.api.dto.PmProContSimpleDTO;
import com.xisc.pm.api.dto.PmProContYieldCopyRequestDTO;
import com.xisc.pm.api.dto.PmProContYieldRequestDTO;
import com.xisc.pm.api.dto.PmProContYieldResposeDTO;
import com.xisc.pm.domain.entity.PmPdCcSlab;
import io.choerodon.core.domain.Page;
import io.choerodon.mybatis.pagehelper.domain.PageRequest;

import java.util.List;
import java.util.Map;
/**
 * 生产合同主表应用服务
 *
 * @author 曾俊 jun.zeng@hand-china.com 2024-07-29 14:28:16
 */
public interface PmProContService {

    /**
     * 待收池的合同查询
     * @param pageRequest
     * @param pmProContPoolRequest
     * @param pageRequest 
     * @return
     */
    Page<PmProContPoolResposeDTO> poolList(PmProContPoolRequestDTO pmProContPoolRequest, PageRequest pageRequest);

    /**
     * 生产合同收池接口
     * @param organizationId
     * @param orderNoList
     * @return
     */
    void pool(PmProContPoolRequestDTO pmProContPoolRequestDTO);

    /**
     * 生产合同管理查询
     * @param pageRequest
     * @param pmProContRequest
     * @param pageRequest 
     * @return
     */
    Page<PmProContResposeDTO> list(PmProContRequestDTO pmProContRequest, PageRequest pageRequest);

    /**
     * 生产合同退池接口
     * @param pmProContPoolRequest
     */
    List<PmDeleteFailureDTO> delete(PmProContPoolRequestDTO pmProContPoolRequest);
    
    /**
     * 生产合同封锁
     * @param pmProContPoolRequest
     */
    void hold(PmProContPoolRequestDTO pmProContPoolRequest);

    /**
     * 生产合同释放
     * @param pmProContPoolRequest
     */
    void rel(PmProContPoolRequestDTO pmProContPoolRequest);

    /**
     * 组板释放
     * @param pmProContPoolRequest
     */
    void pdUnlock(PmProContPoolRequestDTO pmProContPoolRequest);

    /**
     * 合同抽取
     * @param pmProContFilterRequest
     * @return
     */
    Map<String , List<PmProContFilterResposeDTO>> contFilterList(PmProContFilterRequestDTO pmProContFilterRequest);

    /**
     * 轴合同与非轴合同筛选与检查
     * @param pmProContSelection
     * @return
     */
    List<PmProContSelectionDTO> contSelection(PmProContSelectionRequestDTO pmProContSelection);

    /**
     * 根据合同编排计算收得率
     * @param pmProContYield
     * @return
     */
    PmProContYieldResposeDTO contYieldCalc(PmProContYieldRequestDTO pmProContYield);

    /**
     * 合同组板执行接口
     * @param pmProContYield
     * @return
     */
    PmProContYieldResposeDTO contYieldExec(PmProContYieldRequestDTO pmProContYield);

    /**
     * 合同组板复制接口
     * @param pmProContYieldCopy
     * @return
     */
    List<PmPdCcSlab> contYieldCopy(PmProContYieldCopyRequestDTO pmProContYieldCopy);
    
    /**
     * 组板执行获取计算接口
     * @param pmProContYield
     * @param needCreatePmPdCcSlab
     * @return
     */
    PmProContYieldResposeDTO yiledCalcAndExec(PmProContYieldRequestDTO pmProContYield , Boolean needCreatePmPdCcSlab);

    /**
     * 通过轴合同编号查询
     * @param organizationId
     * @param axisOrderNo
     * @param mscLineNo 
     * @return
     */
    PmPlateConfigDTO contCombineLimit(Long organizationId, String axisOrderNo, String mscLineNo , String formPlateMode );

    /**
     * 查询合同简要信息
     * @param organizationId
     * @param orderNo
     * @param stNo
     * @return
     */
    List<PmProContSimpleDTO> selectProContSimpleList(Long organizationId, String orderNo, String stNo);

    /**
     * 按合同查询组板材料信息
     * @param organizationId 租户ID
     * @param orderNo 合同号
     * @param matDesignKind 材料设计类型
     * @return
     */
    List<PmBoardMatInfoDTO> boardMatList(Long organizationId, String orderNo, String matDesignKind);

    /**
     * 取消超投
     *
     * @param tenantId
     * @param dto
     */
    void cancleOver(Long tenantId, PmProContCanclePoolReqDTO dto);

    /**
     * 超投
     *
     * @param tenantId
     * @param dto
     */
    void orderOver(Long tenantId, PmProContCanclePoolReqDTO dto);
}
