package com.xisc.pm.infra.feign;

import com.xisc.pm.api.dto.PmUpdateSlabDTO;
import com.xisc.pm.domain.vo.MatStatusModifyVO;
import com.xisc.pm.domain.vo.MmAutoHeatPlanVO;
import com.xisc.pm.domain.vo.MmCutSeqVO;
import com.xisc.pm.infra.feign.fallback.MmApiFeignFallbackFactory;
import io.choerodon.swagger.annotation.Permission;
import io.swagger.annotations.ApiOperation;
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 org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient(value = "${xisc.service.mm.name:xisc-mm}", fallbackFactory = MmApiFeignFallbackFactory.class)
public interface MmApiFeign {

    @ApiOperation(value = "材料状态变更")
    @Permission(permissionLogin = true)
    @PostMapping("/v1/{organizationId}/mat/status/modify")
    ResponseEntity<String> matStatusModify(@PathVariable Long organizationId, @RequestParam String eventModeCode,
                                                  @RequestParam String serviceName, @RequestBody MatStatusModifyVO matStatusModifyVO);

    @ApiOperation(value = "材料状态变更")
    @Permission(permissionLogin = true)
    @PostMapping("/v1/{organizationId}/mat/status/batch/modify")
    ResponseEntity<String> batchMatStatusModify(@PathVariable Long organizationId, @RequestParam String eventModeCode,
                                                       @RequestParam String serviceName, @RequestBody List<MatStatusModifyVO> matStatusModifyVOList);

    @ApiOperation(value = "代预替代完成，重新生成剪切指令")
    @PostMapping("/v1/{organizationId}/internal-interface/update/cutSeq")
    ResponseEntity<String> batchUpdateCutSeq(@PathVariable Long organizationId, @RequestBody List<MmCutSeqVO> updateCutSeqDTOList);

    @ApiOperation(value = "产线变更，更新轧钢产线信息")
    @PostMapping("/v1/{organizationId}/internal-interface/update/prod-line")
    ResponseEntity<String> batchUpdateMscLineNo(@PathVariable Long organizationId, @RequestBody List<PmUpdateSlabDTO> updateCutSeqDTOList);

    
    @ApiOperation(value = "撤销热送热装计划")
    @PostMapping("/v1/{organizationId}/roll-plan-dess/revoke/heatPlan")
    ResponseEntity<String> autoHeatPlan(@PathVariable Long organizationId,
                                                @RequestBody List<MmAutoHeatPlanVO> autoHeatPlanDTOList);

    @ApiOperation(value = "获取已完成并且合格的工序")
    @PostMapping("/v1/{organizationId}/internal-interface/get/pass/qualified/pro")
    ResponseEntity<String> getPassQualifiedPro(@PathVariable Long organizationId,
                                                                  @RequestBody List<Long> plateIds);


}
