Merge pull request 'shp 파일 생성 수정' (#263) from feat/infer_dev_260107 into develop
Reviewed-on: https://kamco.gitea.gs.dabeeo.com/dabeeo/kamco-dabeeo-backoffice/pulls/263
This commit is contained in:
@@ -29,7 +29,7 @@ public class HelloApiController {
|
||||
|
||||
@GetMapping("/shp")
|
||||
public void shp(
|
||||
@Parameter(description = "jar 경로", example = "jar/makesample-1.0.0.jar") @RequestParam
|
||||
@Parameter(description = "jar 경로", example = "jar/makeshp-1.0.0.jar") @RequestParam
|
||||
String jarPath,
|
||||
@Parameter(description = "batchIds", example = "252,253,257") @RequestParam String batchIds,
|
||||
@Parameter(description = "32길이 문자열 값", example = "") @RequestParam(required = false)
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.kamco.cd.kamcoback.common.service;
|
||||
|
||||
import com.kamco.cd.kamcoback.inference.dto.InferenceResultsTestingDto;
|
||||
import com.kamco.cd.kamcoback.postgres.core.InferenceResultCoreService;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.InputStreamReader;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
@@ -15,7 +17,28 @@ import org.springframework.stereotype.Component;
|
||||
@RequiredArgsConstructor
|
||||
public class ExternalJarRunner {
|
||||
|
||||
private final InferenceResultCoreService inferenceResultCoreService;
|
||||
|
||||
public void run(String jarPath, String batchIds, String inferenceId, String mapIds) {
|
||||
|
||||
List<Long> batch = new ArrayList<>();
|
||||
batch.add(285L);
|
||||
batch.add(286L);
|
||||
batch.add(287L);
|
||||
List<InferenceResultsTestingDto.ShpDto> resultList =
|
||||
inferenceResultCoreService.getInferenceResults(batch);
|
||||
StringBuilder sb = new StringBuilder();
|
||||
mapIds = sb.toString();
|
||||
for (InferenceResultsTestingDto.ShpDto dto : resultList) {
|
||||
if (dto.getMapId() == null) {
|
||||
continue;
|
||||
}
|
||||
if (!sb.isEmpty()) {
|
||||
sb.append(",");
|
||||
}
|
||||
sb.append("\"").append(dto.getMapId()).append("\"");
|
||||
}
|
||||
|
||||
StringBuilder out = new StringBuilder();
|
||||
|
||||
try {
|
||||
|
||||
@@ -238,6 +238,8 @@ public class MapSheetInferenceJobService {
|
||||
String batchId = sheet.getM1BatchId() + "," + sheet.getM2BatchId() + "," + sheet.getM3BatchId();
|
||||
|
||||
externalJarRunner.run(jarPath, batchId, inferenceId, mapIds);
|
||||
|
||||
externalJarRunner.run(jarPath, batchId, inferenceId, "");
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user