package com.xisc.pm.infra.feign;

import com.xisc.pm.api.dto.ProdPonoSlabRequestDTO;
import com.xisc.pm.api.dto.ThickPlatePerformanceDeterminationDTO;
import com.xisc.pm.domain.vo.QeResvReplaceTriggerVO;
import com.xisc.pm.domain.vo.QeSampleAddtionRequestVO;
import com.xisc.pm.domain.vo.SlabNoCorrespondingBigLotVo;
import com.xisc.pm.infra.feign.fallback.QeApiFeignFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

/**
 * @author 纪文桃 wentao.ji01@hand-china.com
 * @date 2024/10/22 17:05
 * @description
 */
@FeignClient(value = "${xisc.service.qe.name:xisc-qe}", fallbackFactory = QeApiFeignFallbackFactory.class)
public interface QeApiFeign {

    /**
     * 会检证书删除
     *
     * @param organizationId 租户
     * @param plateIdList    钢板主键id
     * @return
     */
    @PostMapping("/v1/{organizationId}/api/inspection-certificate-delete-api")
    ResponseEntity<String> inspectionCertificateApi(@PathVariable Long organizationId,
                                                                            @RequestBody List<Long> plateIdList);
    
    /**
     * 试样添加
     *
     * @param organizationId 租户
     * @param matNoList      材料号
     * @return
     */
    @PostMapping("/v1/{organizationId}/tq-sample-gens/prod/sample")
    ResponseEntity<String> sampleAddtion(@PathVariable Long organizationId,@RequestBody List<QeSampleAddtionRequestVO> qeSampleAddtionRequestList);


    /**
     * 试样添加回退
     *
     * @param organizationId             租户
     * @param prodPonoSlabRequestDTOList 入参列表
     * @return
     */
    @PostMapping("/v1/{organizationId}/tq-sample-gens/prod/remove")
    ResponseEntity<String> sampleGensRemove(@PathVariable Long organizationId, @RequestBody List<ProdPonoSlabRequestDTO> prodPonoSlabRequestDTOList);

    /**
     * 厚板余材性能判定
     *
     * @param organizationId
     * @param dto
     * @return
     */
    @PostMapping("/v1/{organizationId}/api/thick-plate-performance-determination-api")
    ResponseEntity<String> thickPlatePerformanceDeterminationApi(@PathVariable Long organizationId,
                                                                 @RequestBody ThickPlatePerformanceDeterminationDTO dto);


    /**
     * 代预替代触发接口(批量)
     *
     * @param organizationId 组织id
     * @param dtoList dto列表
     * @return {@link ResponseEntity }<{@link String }>
     *
     */
    @PostMapping("/v1/{organizationId}/api/resv-replace-trigger-batch-api")
    ResponseEntity<String> resvReplaceTriggerBatchApi(@PathVariable Long organizationId,
                                                      @RequestBody List<QeResvReplaceTriggerVO> dtoList);


    /**
     * 命令确认
     *
     * @param organizationId
     * @param dtoList
     * @return
     */
    @PostMapping("/v1/{organizationId}/tq-sample-gens/prod/pono")
    ResponseEntity<String> tmpSlabNoUpdate(@PathVariable Long organizationId, @RequestBody List<ProdPonoSlabRequestDTO> dtoList);
    
    /**
     * 命令板坯号对应大LOT键查询
     *
     * @param organizationId
     * @param dtoList
     * @return
     */
    @PostMapping("/v1/{organizationId}/api/slab-no-corresponding-big-lot")
    ResponseEntity<String> slabNoCorrespondingBigLot(@PathVariable Long organizationId, @RequestBody List<SlabNoCorrespondingBigLotVo> dtoList);

}
