添加批量查询流程模版feign接口

This commit is contained in:
daiqy88
2026-02-10 21:07:20 +08:00
parent a613b7ae71
commit efbde5cf98
5 changed files with 72 additions and 0 deletions

View File

@@ -11,6 +11,7 @@ import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import java.util.List;
import java.util.Map;
@Slf4j
@Component
@@ -140,4 +141,19 @@ public class SimulationFlowFeignClientImpl implements ISimulationFlowFeignClient
return SdmResponse.failed("查询有效流程模板信息失败异常");
}
}
@Override
public SdmResponse<Map<String, FlowTemplateResp>> batchQueryFlowTemplate(List<String> templateCodes) {
SdmResponse<Map<String, FlowTemplateResp>> response;
try {
response = flowFeignClient.batchQueryFlowTemplate(templateCodes);
if (!response.isSuccess()) {
return SdmResponse.failed("查询有效流程模板信息失败");
}
return response;
} catch (Exception e) {
log.error("查询有效流程模板信息失败异常", e);
return SdmResponse.failed("查询有效流程模板信息失败异常");
}
}
}

View File

@@ -5,12 +5,14 @@ import com.sdm.common.entity.req.capability.FlowNodeDto;
import com.sdm.common.entity.req.system.LaunchApproveReq;
import com.sdm.common.entity.resp.capability.FlowTemplateResp;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
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;
import java.util.Map;
@FeignClient(name = "capability")
public interface ISimulationFlowFeignClient {
@@ -39,4 +41,7 @@ public interface ISimulationFlowFeignClient {
@GetMapping("/flow/queryValidFlowTemplate")
SdmResponse<List<FlowTemplateResp>> queryValidFlowTemplateInfo();
@PostMapping("/flow/batchQueryFlowTemplate")
SdmResponse<Map<String,FlowTemplateResp>> batchQueryFlowTemplate(@RequestBody @Validated List<String> templateCodes);
}