InternalException added, JSON body fixed
This commit is contained in:
parent
b73ecd8635
commit
e81c5e1dcf
70 changed files with 232 additions and 114 deletions
|
|
@ -12,6 +12,7 @@ import java.util.Map;
|
|||
import java.util.Optional;
|
||||
import org.apache.commons.lang3.mutable.MutableLong;
|
||||
import org.springframework.stereotype.Component;
|
||||
import ru.nbch.indicsearchservice.exception.InternalException;
|
||||
import ru.nbch.indicsearchservice.util.IndicSearchCommon;
|
||||
import ru.nbch.indicsearchservice.util.MovableBufferedReader;
|
||||
|
||||
|
|
@ -108,7 +109,7 @@ public class FileAggregatorCommon {
|
|||
|
||||
Optional<String> foundRuUidSerialNum = IndicSearchCommon.getRowValue(lineList, "SERIAL_NUM");
|
||||
if (foundRuUidSerialNum.isEmpty()) {
|
||||
throw new RuntimeException("SERIAL_NUM was not found!");
|
||||
throw new InternalException("SERIAL_NUM was not found in line " + ruUidLine);
|
||||
}
|
||||
Long ruUidSerialNum = Long.parseLong(foundRuUidSerialNum.get());
|
||||
|
||||
|
|
@ -124,7 +125,7 @@ public class FileAggregatorCommon {
|
|||
List<String> childLineList = Arrays.asList(childLine.split("%%%"));
|
||||
Optional<String> foundChildAccSerialNum = IndicSearchCommon.getRowValue(childLineList, "ACC_SERIAL_NUM");
|
||||
if (foundChildAccSerialNum.isEmpty()) {
|
||||
throw new RuntimeException("ACC_SERIAL_NUM was not found in table " + childTableName);
|
||||
throw new InternalException("ACC_SERIAL_NUM was not found in table " + childTableName + " in line " + childLine);
|
||||
}
|
||||
Long childAccSerialNum = Long.parseLong(foundChildAccSerialNum.get());
|
||||
|
||||
|
|
@ -133,7 +134,7 @@ public class FileAggregatorCommon {
|
|||
childLineList = Arrays.asList(childLine.split("%%%"));
|
||||
foundChildAccSerialNum = IndicSearchCommon.getRowValue(childLineList, "ACC_SERIAL_NUM");
|
||||
if (foundChildAccSerialNum.isEmpty()) {
|
||||
throw new RuntimeException("ACC_SERIAL_NUM was not found in table " + childTableName);
|
||||
throw new InternalException("ACC_SERIAL_NUM was not found in table " + childTableName + " in line " + childLine);
|
||||
}
|
||||
childAccSerialNum = Long.parseLong(foundChildAccSerialNum.get());
|
||||
|
||||
|
|
@ -164,7 +165,7 @@ public class FileAggregatorCommon {
|
|||
childLineList = Arrays.asList(childLine.split("%%%"));
|
||||
foundChildAccSerialNum = IndicSearchCommon.getRowValue(childLineList, "ACC_SERIAL_NUM");
|
||||
if (foundChildAccSerialNum.isEmpty()) {
|
||||
throw new RuntimeException("ACC_SERIAL_NUM was not found in table " + childTableName);
|
||||
throw new InternalException("ACC_SERIAL_NUM was not found in table " + childTableName + " in line " + childLine);
|
||||
}
|
||||
childAccSerialNum = Long.parseLong(foundChildAccSerialNum.get());
|
||||
|
||||
|
|
@ -190,7 +191,7 @@ public class FileAggregatorCommon {
|
|||
br.getReader().close();
|
||||
}
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
throw new InternalException(e);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -212,7 +213,7 @@ public class FileAggregatorCommon {
|
|||
|
||||
Optional<String> foundParentSerialNum = IndicSearchCommon.getRowValue(parentLineList, "SERIAL_NUM");
|
||||
if (foundParentSerialNum.isEmpty()) {
|
||||
throw new RuntimeException("SERIAL_NUM was not found!");
|
||||
throw new InternalException("SERIAL_NUM was not found in line " + parentLine);
|
||||
}
|
||||
Long parentSerialNum = Long.parseLong(foundParentSerialNum.get());
|
||||
|
||||
|
|
@ -224,7 +225,7 @@ public class FileAggregatorCommon {
|
|||
List<String> childLineList = Arrays.asList(blocksLine.split("%%%"));
|
||||
Optional<String> foundChildParentSerialNum = IndicSearchCommon.getRowValue(childLineList, "PARENT_SERIAL_NUM");
|
||||
if (foundChildParentSerialNum.isEmpty()) {
|
||||
throw new RuntimeException("PARENT_SERIAL_NUM was not found!");
|
||||
throw new InternalException("PARENT_SERIAL_NUM was not found in line " + blocksLine);
|
||||
}
|
||||
Long blocksParentSerialNum = Long.parseLong(foundChildParentSerialNum.get());
|
||||
|
||||
|
|
@ -233,7 +234,7 @@ public class FileAggregatorCommon {
|
|||
childLineList = Arrays.asList(blocksLine.split("%%%"));
|
||||
foundChildParentSerialNum = IndicSearchCommon.getRowValue(childLineList, "PARENT_SERIAL_NUM");
|
||||
if (foundChildParentSerialNum.isEmpty()) {
|
||||
throw new RuntimeException("PARENT_SERIAL_NUM was not found!");
|
||||
throw new InternalException("PARENT_SERIAL_NUM was not found in line " + blocksLine);
|
||||
}
|
||||
blocksParentSerialNum = Long.parseLong(foundChildParentSerialNum.get());
|
||||
|
||||
|
|
@ -256,7 +257,7 @@ public class FileAggregatorCommon {
|
|||
childLineList = Arrays.asList(blocksLine.split("%%%"));
|
||||
foundChildParentSerialNum = IndicSearchCommon.getRowValue(childLineList, "PARENT_SERIAL_NUM");
|
||||
if (foundChildParentSerialNum.isEmpty()) {
|
||||
throw new RuntimeException("PARENT_SERIAL_NUM was not found!");
|
||||
throw new InternalException("PARENT_SERIAL_NUM was not found in line " + blocksLine);
|
||||
}
|
||||
blocksParentSerialNum = Long.parseLong(foundChildParentSerialNum.get());
|
||||
|
||||
|
|
@ -273,7 +274,7 @@ public class FileAggregatorCommon {
|
|||
}
|
||||
}
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
throw new InternalException(e);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -333,7 +334,7 @@ public class FileAggregatorCommon {
|
|||
rowCounter.increment();
|
||||
|
||||
if (foundAccountSerialNum.isEmpty()) {
|
||||
throw new RuntimeException("SERIAL_NUM was not found!");
|
||||
throw new InternalException("SERIAL_NUM was not found in line " + accountLine);
|
||||
}
|
||||
Long accountSerialNum = Long.parseLong(foundAccountSerialNum.get());
|
||||
|
||||
|
|
@ -349,7 +350,7 @@ public class FileAggregatorCommon {
|
|||
List<String> childLineList = Arrays.asList(childLine.split("%%%"));
|
||||
Optional<String> foundChildAccSerialNum = IndicSearchCommon.getRowValue(childLineList, "ACC_SERIAL_NUM");
|
||||
if (foundChildAccSerialNum.isEmpty()) {
|
||||
throw new RuntimeException("ACC_SERIAL_NUM was not found in table " + childTableName);
|
||||
throw new InternalException("ACC_SERIAL_NUM was not found in table " + childTableName + " in line " + childLine);
|
||||
}
|
||||
Long childAccSerialNum = Long.parseLong(foundChildAccSerialNum.get());
|
||||
|
||||
|
|
@ -358,7 +359,7 @@ public class FileAggregatorCommon {
|
|||
childLineList = Arrays.asList(childLine.split("%%%"));
|
||||
foundChildAccSerialNum = IndicSearchCommon.getRowValue(childLineList, "ACC_SERIAL_NUM");
|
||||
if (foundChildAccSerialNum.isEmpty()) {
|
||||
throw new RuntimeException("ACC_SERIAL_NUM was not found in table " + childTableName);
|
||||
throw new InternalException("ACC_SERIAL_NUM was not found in table " + childTableName + " in line " + childLine);
|
||||
}
|
||||
childAccSerialNum = Long.parseLong(foundChildAccSerialNum.get());
|
||||
|
||||
|
|
@ -381,7 +382,7 @@ public class FileAggregatorCommon {
|
|||
childLineList = Arrays.asList(childLine.split("%%%"));
|
||||
foundChildAccSerialNum = IndicSearchCommon.getRowValue(childLineList, "ACC_SERIAL_NUM");
|
||||
if (foundChildAccSerialNum.isEmpty()) {
|
||||
throw new RuntimeException("ACC_SERIAL_NUM was not found in table " + childTableName);
|
||||
throw new InternalException("ACC_SERIAL_NUM was not found in table " + childTableName + " in line " + childLine);
|
||||
}
|
||||
childAccSerialNum = Long.parseLong(foundChildAccSerialNum.get());
|
||||
|
||||
|
|
@ -403,7 +404,7 @@ public class FileAggregatorCommon {
|
|||
br.getReader().close();
|
||||
}
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
throw new InternalException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ import java.util.UUID;
|
|||
import org.apache.commons.lang3.mutable.MutableLong;
|
||||
import org.springframework.stereotype.Component;
|
||||
import ru.nbch.indicsearchservice.config.settings.ApplicationSettings;
|
||||
import ru.nbch.indicsearchservice.exception.InternalException;
|
||||
import ru.nbch.indicsearchservice.model.enums.DataType;
|
||||
import ru.nbch.indicsearchservice.model.enums.SearchParameter;
|
||||
import ru.nbch.indicsearchservice.util.IndicSearchCommon;
|
||||
|
|
@ -73,14 +74,14 @@ public class GutdfFidPassportOgrnFileAggregator implements FileAggregator {
|
|||
rowCounter.increment();
|
||||
}
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
throw new InternalException("Failed to read file " + tableFileMap.get(tableName) + " " + e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
aggregatedFileWriter.write("EOF");
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
throw new InternalException(e);
|
||||
}
|
||||
|
||||
return aggregatedFile;
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ import java.util.UUID;
|
|||
import org.apache.commons.lang3.mutable.MutableLong;
|
||||
import org.springframework.stereotype.Component;
|
||||
import ru.nbch.indicsearchservice.config.settings.ApplicationSettings;
|
||||
import ru.nbch.indicsearchservice.exception.InternalException;
|
||||
import ru.nbch.indicsearchservice.model.enums.DataType;
|
||||
import ru.nbch.indicsearchservice.model.enums.SearchParameter;
|
||||
import ru.nbch.indicsearchservice.util.IndicSearchCommon;
|
||||
|
|
@ -65,7 +66,7 @@ public class GutdfRuApplicationFileAggregator implements FileAggregator {
|
|||
|
||||
aggregatedFileWriter.write("EOF");
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
throw new InternalException("Failed to read file " + tableFileMap.get("RU_APPLICATION") + " " + e);
|
||||
}
|
||||
|
||||
return aggregatedFile;
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ import java.util.UUID;
|
|||
import org.apache.commons.lang3.mutable.MutableLong;
|
||||
import org.springframework.stereotype.Component;
|
||||
import ru.nbch.indicsearchservice.config.settings.ApplicationSettings;
|
||||
import ru.nbch.indicsearchservice.exception.InternalException;
|
||||
import ru.nbch.indicsearchservice.model.enums.DataType;
|
||||
import ru.nbch.indicsearchservice.model.enums.SearchParameter;
|
||||
|
||||
|
|
@ -39,7 +40,7 @@ public class GutdfRuUidFileAggregator implements FileAggregator {
|
|||
|
||||
aggregatedFileWriter.write("EOF");
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
throw new InternalException("Failed to write file " + aggregatedFile + " " + e);
|
||||
}
|
||||
|
||||
return aggregatedFile;
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ import java.util.UUID;
|
|||
import org.apache.commons.lang3.mutable.MutableLong;
|
||||
import org.springframework.stereotype.Component;
|
||||
import ru.nbch.indicsearchservice.config.settings.ApplicationSettings;
|
||||
import ru.nbch.indicsearchservice.exception.InternalException;
|
||||
import ru.nbch.indicsearchservice.model.enums.DataType;
|
||||
import ru.nbch.indicsearchservice.model.enums.SearchParameter;
|
||||
|
||||
|
|
@ -41,7 +42,7 @@ public class TutdfAccountFileAggregator implements FileAggregator {
|
|||
|
||||
aggregatedFileWriter.write("EOF");
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
throw new InternalException("Failed to write file " + aggregatedFile + " " + e);
|
||||
}
|
||||
|
||||
return aggregatedFile;
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ import java.util.UUID;
|
|||
import org.apache.commons.lang3.mutable.MutableLong;
|
||||
import org.springframework.stereotype.Component;
|
||||
import ru.nbch.indicsearchservice.config.settings.ApplicationSettings;
|
||||
import ru.nbch.indicsearchservice.exception.InternalException;
|
||||
import ru.nbch.indicsearchservice.model.enums.DataType;
|
||||
import ru.nbch.indicsearchservice.model.enums.SearchParameter;
|
||||
import ru.nbch.indicsearchservice.util.IndicSearchCommon;
|
||||
|
|
@ -68,14 +69,14 @@ public class TutdfFidPassportOgrnFileAggregator implements FileAggregator {
|
|||
rowCounter.increment();
|
||||
}
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
throw new InternalException("Failed to read file " + tableFileMap.get(tableName) + " " + e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
aggregatedFileWriter.write("EOF");
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
throw new InternalException("Failed to write file " + aggregatedFile + " " + e);
|
||||
}
|
||||
|
||||
return aggregatedFile;
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ import java.util.UUID;
|
|||
import org.apache.commons.lang3.mutable.MutableLong;
|
||||
import org.springframework.stereotype.Component;
|
||||
import ru.nbch.indicsearchservice.config.settings.ApplicationSettings;
|
||||
import ru.nbch.indicsearchservice.exception.InternalException;
|
||||
import ru.nbch.indicsearchservice.model.enums.DataType;
|
||||
import ru.nbch.indicsearchservice.model.enums.SearchParameter;
|
||||
import ru.nbch.indicsearchservice.util.IndicSearchCommon;
|
||||
|
|
@ -63,7 +64,7 @@ public class TutdfInformationFileAggregator implements FileAggregator {
|
|||
|
||||
aggregatedFileWriter.write("EOF");
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
throw new InternalException("Failed to read file " + tableFileMap.get("INFORMATION") + " " + e);
|
||||
}
|
||||
|
||||
return aggregatedFile;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,8 @@
|
|||
package ru.nbch.indicsearchservice.dto.response;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
@Schema(description = "Internal exception response data transfer object")
|
||||
public record InternalExceptionResponseDto(
|
||||
@Schema(description = "Error message", example = "При обработке запроса произошла ошибка.") String message) {
|
||||
}
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
package ru.nbch.indicsearchservice.exception;
|
||||
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.converter.HttpMessageNotReadableException;
|
||||
import org.springframework.web.bind.annotation.ExceptionHandler;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.bind.annotation.ResponseStatus;
|
||||
import org.springframework.web.bind.annotation.RestControllerAdvice;
|
||||
import ru.nbch.indicsearchservice.dto.response.InternalExceptionResponseDto;
|
||||
|
||||
@RestControllerAdvice
|
||||
public class ExceptionHandlerAdvice {
|
||||
@ExceptionHandler(InternalException.class)
|
||||
@ResponseStatus(HttpStatus.BAD_REQUEST)
|
||||
public @ResponseBody InternalExceptionResponseDto handleInternalException(InternalException ex) {
|
||||
return ex.getInternalExceptionResponseDto();
|
||||
}
|
||||
|
||||
@ExceptionHandler(HttpMessageNotReadableException.class)
|
||||
@ResponseStatus(HttpStatus.BAD_REQUEST)
|
||||
public @ResponseBody InternalExceptionResponseDto handleHttpMessageNotReadableException(HttpMessageNotReadableException ex) {
|
||||
return new InternalExceptionResponseDto("Invalid JSON " + ex);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,5 +1,7 @@
|
|||
package ru.nbch.indicsearchservice.exception;
|
||||
|
||||
import ru.nbch.indicsearchservice.dto.response.InternalExceptionResponseDto;
|
||||
|
||||
public class InternalException extends RuntimeException {
|
||||
private final String message;
|
||||
|
||||
|
|
@ -7,4 +9,13 @@ public class InternalException extends RuntimeException {
|
|||
super(message);
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
public InternalException(Throwable cause) {
|
||||
super(cause);
|
||||
this.message = cause.getMessage();
|
||||
}
|
||||
|
||||
public InternalExceptionResponseDto getInternalExceptionResponseDto() {
|
||||
return new InternalExceptionResponseDto(this.message);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -45,6 +45,9 @@ public class JsonExporter implements Exporter {
|
|||
|
||||
try (BufferedReader reader = Files.newBufferedReader(aggregatedFile);
|
||||
JsonGenerator jsonGenerator = jsonMapper.createGenerator(Files.newOutputStream(jsonFile))) {
|
||||
jsonGenerator.writeStartObject();
|
||||
jsonGenerator.writeName("datasheets");
|
||||
jsonGenerator.writeStartArray();
|
||||
jsonGenerator.writeStartArray();
|
||||
|
||||
Iterator<String> iterator = reader.lines().iterator();
|
||||
|
|
@ -74,6 +77,8 @@ public class JsonExporter implements Exporter {
|
|||
}
|
||||
|
||||
jsonGenerator.writeEndArray();
|
||||
jsonGenerator.writeEndArray();
|
||||
jsonGenerator.writeEndObject();
|
||||
} catch (IOException e) {
|
||||
log.error(e.getMessage(), e);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ import java.util.Set;
|
|||
import java.util.UUID;
|
||||
import org.apache.ibatis.cursor.Cursor;
|
||||
import org.springframework.stereotype.Component;
|
||||
import ru.nbch.indicsearchservice.exception.InternalException;
|
||||
import ru.nbch.indicsearchservice.loader.subtable.AccountSubTableLoader;
|
||||
import ru.nbch.indicsearchservice.model.TableMetaData;
|
||||
import ru.nbch.indicsearchservice.model.enums.DataType;
|
||||
|
|
@ -71,7 +72,7 @@ public class AccountTableLoader implements FirstLevelTableLoader, TableLoaderFor
|
|||
tableFileMap.put(getTableName(), indicSearchUtils.writeRowsToFile(taskId, getTableName(), cursor, foundFids, tableMetaDataMap));
|
||||
accountSubTableLoaders.parallelStream().forEach(tl -> tl.searchByAccountFid(taskId, foundFids, tableFileMap, tableMetaDataMap));
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
throw new InternalException("Failed to read cursor " + e);
|
||||
}
|
||||
} else if (searchParameter == SearchParameter.FID) {
|
||||
Set<Integer> fids = Set.of(Integer.parseInt(searchValue));
|
||||
|
|
@ -80,7 +81,7 @@ public class AccountTableLoader implements FirstLevelTableLoader, TableLoaderFor
|
|||
tableFileMap.put(getTableName(), indicSearchUtils.writeRowsToFile(taskId, getTableName(), cursor, tableMetaDataMap));
|
||||
accountSubTableLoaders.parallelStream().forEach(tl -> tl.searchByAccountFid(taskId, fids, tableFileMap, tableMetaDataMap));
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
throw new InternalException("Failed to read cursor " + e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -99,7 +100,7 @@ public class AccountTableLoader implements FirstLevelTableLoader, TableLoaderFor
|
|||
try (Cursor<LinkedHashMap<String, Object>> cursor = mapperHolder.getIndicMapper().findAllByFidsFromAccount(fids)) {
|
||||
tableFileMap.put(getTableName(), indicSearchUtils.writeRowsToFile(taskId, getTableName(), cursor, tableMetaDataMap));
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
throw new InternalException("Failed to read cursor " + e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import java.util.UUID;
|
|||
import org.apache.ibatis.cursor.Cursor;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import ru.nbch.indicsearchservice.exception.InternalException;
|
||||
import ru.nbch.indicsearchservice.model.TableMetaData;
|
||||
import ru.nbch.indicsearchservice.model.enums.DataType;
|
||||
import ru.nbch.indicsearchservice.model.enums.SearchParameter;
|
||||
|
|
@ -59,7 +60,7 @@ public class BankruptcyTableLoader implements FirstLevelTableLoader, TableLoader
|
|||
try (Cursor<LinkedHashMap<String, Object>> cursor = mapperHolder.getIndicMapper().findAllByFidsFromBankruptcy(fids)) {
|
||||
tableFileMap.put(getTableName(), indicSearchUtils.writeRowsToFile(taskId, getTableName(), cursor, tableMetaDataMap));
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
throw new InternalException("Failed to read cursor " + e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -79,7 +80,7 @@ public class BankruptcyTableLoader implements FirstLevelTableLoader, TableLoader
|
|||
try (Cursor<LinkedHashMap<String, Object>> cursor = mapperHolder.getIndicMapper().findAllByFidsFromBankruptcy(fids)) {
|
||||
tableFileMap.put(getTableName(), indicSearchUtils.writeRowsToFile(taskId, getTableName(), cursor, tableMetaDataMap));
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
throw new InternalException("Failed to read cursor " + e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import java.util.UUID;
|
|||
import org.apache.ibatis.cursor.Cursor;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import ru.nbch.indicsearchservice.exception.InternalException;
|
||||
import ru.nbch.indicsearchservice.model.TableMetaData;
|
||||
import ru.nbch.indicsearchservice.model.enums.DataType;
|
||||
import ru.nbch.indicsearchservice.model.enums.SearchParameter;
|
||||
|
|
@ -59,7 +60,7 @@ public class ConsumerBankruptcyTableLoader implements FirstLevelTableLoader, Tab
|
|||
try (Cursor<LinkedHashMap<String, Object>> cursor = mapperHolder.getIndicMapper().findAllByFidsFromConsumerBankruptcy(fids)) {
|
||||
tableFileMap.put(getTableName(), indicSearchUtils.writeRowsToFile(taskId, getTableName(), cursor, tableMetaDataMap));
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
throw new InternalException("Failed to read cursor " + e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -79,7 +80,7 @@ public class ConsumerBankruptcyTableLoader implements FirstLevelTableLoader, Tab
|
|||
try (Cursor<LinkedHashMap<String, Object>> cursor = mapperHolder.getIndicMapper().findAllByFidsFromConsumerBankruptcy(fids)) {
|
||||
tableFileMap.put(getTableName(), indicSearchUtils.writeRowsToFile(taskId, getTableName(), cursor, tableMetaDataMap));
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
throw new InternalException("Failed to read cursor " + e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ import java.util.UUID;
|
|||
import org.apache.ibatis.cursor.Cursor;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import ru.nbch.indicsearchservice.exception.InternalException;
|
||||
import ru.nbch.indicsearchservice.model.TableMetaData;
|
||||
import ru.nbch.indicsearchservice.model.enums.DataType;
|
||||
import ru.nbch.indicsearchservice.model.enums.SearchParameter;
|
||||
|
|
@ -81,7 +82,7 @@ public class IdTableLoader implements FirstLevelTableLoader {
|
|||
}
|
||||
}
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
throw new InternalException("Failed to read cursor " + e);
|
||||
}
|
||||
|
||||
tableLoaders.parallelStream().forEach(tl -> tl.searchById(
|
||||
|
|
@ -114,7 +115,7 @@ public class IdTableLoader implements FirstLevelTableLoader {
|
|||
}
|
||||
}
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
throw new InternalException("Failed to read cursor " + e);
|
||||
}
|
||||
|
||||
tableLoaders.parallelStream().forEach(tl -> tl.searchById(
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import java.util.UUID;
|
|||
import org.apache.ibatis.cursor.Cursor;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import ru.nbch.indicsearchservice.exception.InternalException;
|
||||
import ru.nbch.indicsearchservice.model.TableMetaData;
|
||||
import ru.nbch.indicsearchservice.model.enums.DataType;
|
||||
import ru.nbch.indicsearchservice.model.enums.SearchParameter;
|
||||
|
|
@ -59,7 +60,7 @@ public class InformationTableLoader implements FirstLevelTableLoader, TableLoade
|
|||
try (Cursor<LinkedHashMap<String, Object>> cursor = mapperHolder.getIndicMapper().findAllByMemberCodeFromInformation(memberCode)) {
|
||||
tableFileMap.put(getTableName(), indicSearchUtils.writeRowsToFile(taskId, getTableName(), cursor, tableMetaDataMap));
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
throw new InternalException("Failed to read cursor " + e);
|
||||
}
|
||||
} else if (searchParameter == SearchParameter.FID) {
|
||||
Set<Integer> fids = Set.of(Integer.parseInt(searchValue));
|
||||
|
|
@ -67,7 +68,7 @@ public class InformationTableLoader implements FirstLevelTableLoader, TableLoade
|
|||
try (Cursor<LinkedHashMap<String, Object>> cursor = mapperHolder.getIndicMapper().findAllByFidsFromInformation(fids)) {
|
||||
tableFileMap.put(getTableName(), indicSearchUtils.writeRowsToFile(taskId, getTableName(), cursor, tableMetaDataMap));
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
throw new InternalException("Failed to read cursor " + e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -87,7 +88,7 @@ public class InformationTableLoader implements FirstLevelTableLoader, TableLoade
|
|||
try (Cursor<LinkedHashMap<String, Object>> cursor = mapperHolder.getIndicMapper().findAllByFidsFromInformation(fids)) {
|
||||
tableFileMap.put(getTableName(), indicSearchUtils.writeRowsToFile(taskId, getTableName(), cursor, tableMetaDataMap));
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
throw new InternalException("Failed to read cursor " + e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import java.util.UUID;
|
|||
import org.apache.ibatis.cursor.Cursor;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import ru.nbch.indicsearchservice.exception.InternalException;
|
||||
import ru.nbch.indicsearchservice.model.TableMetaData;
|
||||
import ru.nbch.indicsearchservice.model.enums.DataType;
|
||||
import ru.nbch.indicsearchservice.model.enums.SearchParameter;
|
||||
|
|
@ -59,7 +60,7 @@ public class LegalTableLoader implements FirstLevelTableLoader, TableLoaderForId
|
|||
try (Cursor<LinkedHashMap<String, Object>> cursor = mapperHolder.getIndicMapper().findAllByFidsFromLegal(fids)) {
|
||||
tableFileMap.put(getTableName(), indicSearchUtils.writeRowsToFile(taskId, getTableName(), cursor, tableMetaDataMap));
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
throw new InternalException("Failed to read cursor " + e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -79,7 +80,7 @@ public class LegalTableLoader implements FirstLevelTableLoader, TableLoaderForId
|
|||
try (Cursor<LinkedHashMap<String, Object>> cursor = mapperHolder.getIndicMapper().findAllByFidsFromLegal(fids)) {
|
||||
tableFileMap.put(getTableName(), indicSearchUtils.writeRowsToFile(taskId, getTableName(), cursor, tableMetaDataMap));
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
throw new InternalException("Failed to read cursor " + e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import java.util.UUID;
|
|||
import org.apache.ibatis.cursor.Cursor;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import ru.nbch.indicsearchservice.exception.InternalException;
|
||||
import ru.nbch.indicsearchservice.model.TableMetaData;
|
||||
import ru.nbch.indicsearchservice.model.enums.DataType;
|
||||
import ru.nbch.indicsearchservice.model.enums.SearchParameter;
|
||||
|
|
@ -59,7 +60,7 @@ public class RuApplicationTableLoader implements FirstLevelTableLoader, TableLoa
|
|||
try (Cursor<LinkedHashMap<String, Object>> cursor = mapperHolder.getIndicMapper().findAllByMemberCodeFromRuApplication(memberCode)) {
|
||||
tableFileMap.put(getTableName(), indicSearchUtils.writeRowsToFile(taskId, getTableName(), cursor, tableMetaDataMap));
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
throw new InternalException("Failed to read cursor " + e);
|
||||
}
|
||||
} else if (searchParameter == SearchParameter.FID) {
|
||||
Set<Integer> fids = Set.of(Integer.parseInt(searchValue));
|
||||
|
|
@ -67,7 +68,7 @@ public class RuApplicationTableLoader implements FirstLevelTableLoader, TableLoa
|
|||
try (Cursor<LinkedHashMap<String, Object>> cursor = mapperHolder.getIndicMapper().findAllByFidsFromRuApplication(fids)) {
|
||||
tableFileMap.put(getTableName(), indicSearchUtils.writeRowsToFile(taskId, getTableName(), cursor, tableMetaDataMap));
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
throw new InternalException("Failed to read cursor " + e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -87,7 +88,7 @@ public class RuApplicationTableLoader implements FirstLevelTableLoader, TableLoa
|
|||
try (Cursor<LinkedHashMap<String, Object>> cursor = mapperHolder.getIndicMapper().findAllByFidsFromRuApplication(fids)) {
|
||||
tableFileMap.put(getTableName(), indicSearchUtils.writeRowsToFile(taskId, getTableName(), cursor, tableMetaDataMap));
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
throw new InternalException("Failed to read cursor " + e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import java.util.UUID;
|
|||
import org.apache.ibatis.cursor.Cursor;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import ru.nbch.indicsearchservice.exception.InternalException;
|
||||
import ru.nbch.indicsearchservice.model.TableMetaData;
|
||||
import ru.nbch.indicsearchservice.model.enums.DataType;
|
||||
import ru.nbch.indicsearchservice.model.enums.SearchParameter;
|
||||
|
|
@ -59,7 +60,7 @@ public class RuBankruptcyTableLoader implements FirstLevelTableLoader, TableLoad
|
|||
try (Cursor<LinkedHashMap<String, Object>> cursor = mapperHolder.getIndicMapper().findAllByFidsFromRuBankruptcy(fids)) {
|
||||
tableFileMap.put(getTableName(), indicSearchUtils.writeRowsToFile(taskId, getTableName(), cursor, tableMetaDataMap));
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
throw new InternalException("Failed to read cursor " + e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -79,7 +80,7 @@ public class RuBankruptcyTableLoader implements FirstLevelTableLoader, TableLoad
|
|||
try (Cursor<LinkedHashMap<String, Object>> cursor = mapperHolder.getIndicMapper().findAllByFidsFromRuBankruptcy(fids)) {
|
||||
tableFileMap.put(getTableName(), indicSearchUtils.writeRowsToFile(taskId, getTableName(), cursor, tableMetaDataMap));
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
throw new InternalException("Failed to read cursor " + e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import java.util.UUID;
|
|||
import org.apache.ibatis.cursor.Cursor;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import ru.nbch.indicsearchservice.exception.InternalException;
|
||||
import ru.nbch.indicsearchservice.model.TableMetaData;
|
||||
import ru.nbch.indicsearchservice.model.enums.DataType;
|
||||
import ru.nbch.indicsearchservice.model.enums.SearchParameter;
|
||||
|
|
@ -59,7 +60,7 @@ public class RuCapabilityTableLoader implements FirstLevelTableLoader, TableLoad
|
|||
try (Cursor<LinkedHashMap<String, Object>> cursor = mapperHolder.getIndicMapper().findAllByFidsFromRuCapability(fids)) {
|
||||
tableFileMap.put(getTableName(), indicSearchUtils.writeRowsToFile(taskId, getTableName(), cursor, tableMetaDataMap));
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
throw new InternalException("Failed to read cursor " + e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -79,7 +80,7 @@ public class RuCapabilityTableLoader implements FirstLevelTableLoader, TableLoad
|
|||
try (Cursor<LinkedHashMap<String, Object>> cursor = mapperHolder.getIndicMapper().findAllByFidsFromRuCapability(fids)) {
|
||||
tableFileMap.put(getTableName(), indicSearchUtils.writeRowsToFile(taskId, getTableName(), cursor, tableMetaDataMap));
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
throw new InternalException("Failed to read cursor " + e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import java.util.UUID;
|
|||
import org.apache.ibatis.cursor.Cursor;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import ru.nbch.indicsearchservice.exception.InternalException;
|
||||
import ru.nbch.indicsearchservice.model.TableMetaData;
|
||||
import ru.nbch.indicsearchservice.model.enums.DataType;
|
||||
import ru.nbch.indicsearchservice.model.enums.SearchParameter;
|
||||
|
|
@ -59,7 +60,7 @@ public class RuDebtBurdenInfoTableLoader implements FirstLevelTableLoader, Table
|
|||
try (Cursor<LinkedHashMap<String, Object>> cursor = mapperHolder.getIndicMapper().findAllByFidsFromRuDebtBurdenInfo(fids)) {
|
||||
tableFileMap.put(getTableName(), indicSearchUtils.writeRowsToFile(taskId, getTableName(), cursor, tableMetaDataMap));
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
throw new InternalException("Failed to read cursor " + e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -79,7 +80,7 @@ public class RuDebtBurdenInfoTableLoader implements FirstLevelTableLoader, Table
|
|||
try (Cursor<LinkedHashMap<String, Object>> cursor = mapperHolder.getIndicMapper().findAllByFidsFromRuDebtBurdenInfo(fids)) {
|
||||
tableFileMap.put(getTableName(), indicSearchUtils.writeRowsToFile(taskId, getTableName(), cursor, tableMetaDataMap));
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
throw new InternalException("Failed to read cursor " + e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import java.util.UUID;
|
|||
import org.apache.ibatis.cursor.Cursor;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import ru.nbch.indicsearchservice.exception.InternalException;
|
||||
import ru.nbch.indicsearchservice.model.TableMetaData;
|
||||
import ru.nbch.indicsearchservice.model.enums.DataType;
|
||||
import ru.nbch.indicsearchservice.model.enums.SearchParameter;
|
||||
|
|
@ -59,7 +60,7 @@ public class RuObligPartTakeTableLoader implements FirstLevelTableLoader, TableL
|
|||
try (Cursor<LinkedHashMap<String, Object>> cursor = mapperHolder.getIndicMapper().findAllByFidsFromRuObligPartTake(fids)) {
|
||||
tableFileMap.put(getTableName(), indicSearchUtils.writeRowsToFile(taskId, getTableName(), cursor, tableMetaDataMap));
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
throw new InternalException("Failed to read cursor " + e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -79,7 +80,7 @@ public class RuObligPartTakeTableLoader implements FirstLevelTableLoader, TableL
|
|||
try (Cursor<LinkedHashMap<String, Object>> cursor = mapperHolder.getIndicMapper().findAllByFidsFromRuObligPartTake(fids)) {
|
||||
tableFileMap.put(getTableName(), indicSearchUtils.writeRowsToFile(taskId, getTableName(), cursor, tableMetaDataMap));
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
throw new InternalException("Failed to read cursor " + e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import java.util.UUID;
|
|||
import org.apache.ibatis.cursor.Cursor;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import ru.nbch.indicsearchservice.exception.InternalException;
|
||||
import ru.nbch.indicsearchservice.model.TableMetaData;
|
||||
import ru.nbch.indicsearchservice.model.enums.DataType;
|
||||
import ru.nbch.indicsearchservice.model.enums.SearchParameter;
|
||||
|
|
@ -59,7 +60,7 @@ public class RuOtherLegalTableLoader implements FirstLevelTableLoader, TableLoad
|
|||
try (Cursor<LinkedHashMap<String, Object>> cursor = mapperHolder.getIndicMapper().findAllByFidsFromRuOtherLegal(fids)) {
|
||||
tableFileMap.put(getTableName(), indicSearchUtils.writeRowsToFile(taskId, getTableName(), cursor, tableMetaDataMap));
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
throw new InternalException("Failed to read cursor " + e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -79,7 +80,7 @@ public class RuOtherLegalTableLoader implements FirstLevelTableLoader, TableLoad
|
|||
try (Cursor<LinkedHashMap<String, Object>> cursor = mapperHolder.getIndicMapper().findAllByFidsFromRuOtherLegal(fids)) {
|
||||
tableFileMap.put(getTableName(), indicSearchUtils.writeRowsToFile(taskId, getTableName(), cursor, tableMetaDataMap));
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
throw new InternalException("Failed to read cursor " + e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import java.util.UUID;
|
|||
import org.apache.ibatis.cursor.Cursor;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import ru.nbch.indicsearchservice.exception.InternalException;
|
||||
import ru.nbch.indicsearchservice.model.TableMetaData;
|
||||
import ru.nbch.indicsearchservice.model.enums.DataType;
|
||||
import ru.nbch.indicsearchservice.model.enums.SearchParameter;
|
||||
|
|
@ -59,7 +60,7 @@ public class RuSettledTableLoader implements FirstLevelTableLoader, TableLoaderF
|
|||
try (Cursor<LinkedHashMap<String, Object>> cursor = mapperHolder.getIndicMapper().findAllByFidsFromRuSettled(fids)) {
|
||||
tableFileMap.put(getTableName(), indicSearchUtils.writeRowsToFile(taskId, getTableName(), cursor, tableMetaDataMap));
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
throw new InternalException("Failed to read cursor " + e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -79,7 +80,7 @@ public class RuSettledTableLoader implements FirstLevelTableLoader, TableLoaderF
|
|||
try (Cursor<LinkedHashMap<String, Object>> cursor = mapperHolder.getIndicMapper().findAllByFidsFromRuSettled(fids)) {
|
||||
tableFileMap.put(getTableName(), indicSearchUtils.writeRowsToFile(taskId, getTableName(), cursor, tableMetaDataMap));
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
throw new InternalException("Failed to read cursor " + e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ import java.util.UUID;
|
|||
import org.apache.ibatis.cursor.Cursor;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import ru.nbch.indicsearchservice.exception.InternalException;
|
||||
import ru.nbch.indicsearchservice.loader.subtable.RuUidSubTableLoader;
|
||||
import ru.nbch.indicsearchservice.model.TableMetaData;
|
||||
import ru.nbch.indicsearchservice.model.enums.DataType;
|
||||
|
|
@ -72,7 +73,7 @@ public class RuUidTableLoader implements FirstLevelTableLoader, TableLoaderForId
|
|||
tableFileMap.put(getTableName(), indicSearchUtils.writeRowsToFile(taskId, getTableName(), cursor, foundFids, tableMetaDataMap));
|
||||
ruUidSubTableLoaders.parallelStream().forEach(tl -> tl.searchByRuUidFid(taskId, foundFids, tableFileMap, tableMetaDataMap));
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
throw new InternalException("Failed to read cursor " + e);
|
||||
}
|
||||
} else if (searchParameter == SearchParameter.FID) {
|
||||
Set<Integer> fids = Set.of(Integer.parseInt(searchValue));
|
||||
|
|
@ -81,7 +82,7 @@ public class RuUidTableLoader implements FirstLevelTableLoader, TableLoaderForId
|
|||
tableFileMap.put(getTableName(), indicSearchUtils.writeRowsToFile(taskId, getTableName(), cursor, tableMetaDataMap));
|
||||
ruUidSubTableLoaders.parallelStream().forEach(tl -> tl.searchByRuUidFid(taskId, fids, tableFileMap, tableMetaDataMap));
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
throw new InternalException("Failed to read cursor " + e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -101,7 +102,7 @@ public class RuUidTableLoader implements FirstLevelTableLoader, TableLoaderForId
|
|||
try (Cursor<LinkedHashMap<String, Object>> cursor = mapperHolder.getIndicMapper().findAllByFidsFromRuUid(fids)) {
|
||||
tableFileMap.put(getTableName(), indicSearchUtils.writeRowsToFile(taskId, getTableName(), cursor, tableMetaDataMap));
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
throw new InternalException("Failed to read cursor " + e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import java.util.UUID;
|
|||
import org.apache.ibatis.cursor.Cursor;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import ru.nbch.indicsearchservice.exception.InternalException;
|
||||
import ru.nbch.indicsearchservice.model.TableMetaData;
|
||||
import ru.nbch.indicsearchservice.util.IndicSearchUtils;
|
||||
import ru.nbch.indicsearchservice.util.MapperHolder;
|
||||
|
|
@ -38,7 +39,7 @@ public class AccountAmendTableLoader implements AccountSubTableLoader {
|
|||
try (Cursor<LinkedHashMap<String, Object>> cursor = mapperHolder.getIndicMapper().findAllByFidsFromAccountAmend(fids)) {
|
||||
tableFileMap.put(getTableName(), indicSearchUtils.writeRowsToFile(taskId, getTableName(), cursor, tableMetaDataMap));
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
throw new InternalException("Failed to read cursor " + e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import java.util.UUID;
|
|||
import org.apache.ibatis.cursor.Cursor;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import ru.nbch.indicsearchservice.exception.InternalException;
|
||||
import ru.nbch.indicsearchservice.model.TableMetaData;
|
||||
import ru.nbch.indicsearchservice.util.IndicSearchUtils;
|
||||
import ru.nbch.indicsearchservice.util.MapperHolder;
|
||||
|
|
@ -38,7 +39,7 @@ public class BankGuaranteeTableLoader implements AccountSubTableLoader {
|
|||
try (Cursor<LinkedHashMap<String, Object>> cursor = mapperHolder.getIndicMapper().findAllByFidsFromBankGuarantee(fids)) {
|
||||
tableFileMap.put(getTableName(), indicSearchUtils.writeRowsToFile(taskId, getTableName(), cursor, tableMetaDataMap));
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
throw new InternalException("Failed to read cursor " + e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import java.util.UUID;
|
|||
import org.apache.ibatis.cursor.Cursor;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import ru.nbch.indicsearchservice.exception.InternalException;
|
||||
import ru.nbch.indicsearchservice.model.TableMetaData;
|
||||
import ru.nbch.indicsearchservice.util.IndicSearchUtils;
|
||||
import ru.nbch.indicsearchservice.util.MapperHolder;
|
||||
|
|
@ -38,7 +39,7 @@ public class CollateralTableLoader implements AccountSubTableLoader {
|
|||
try (Cursor<LinkedHashMap<String, Object>> cursor = mapperHolder.getIndicMapper().findAllByFidsFromCollateral(fids)) {
|
||||
tableFileMap.put(getTableName(), indicSearchUtils.writeRowsToFile(taskId, getTableName(), cursor, tableMetaDataMap));
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
throw new InternalException("Failed to read cursor " + e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import java.util.UUID;
|
|||
import org.apache.ibatis.cursor.Cursor;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import ru.nbch.indicsearchservice.exception.InternalException;
|
||||
import ru.nbch.indicsearchservice.model.TableMetaData;
|
||||
import ru.nbch.indicsearchservice.util.IndicSearchUtils;
|
||||
import ru.nbch.indicsearchservice.util.MapperHolder;
|
||||
|
|
@ -38,7 +39,7 @@ public class GuarantorTableLoader implements AccountSubTableLoader {
|
|||
try (Cursor<LinkedHashMap<String, Object>> cursor = mapperHolder.getIndicMapper().findAllByFidsFromGuarantor(fids)) {
|
||||
tableFileMap.put(getTableName(), indicSearchUtils.writeRowsToFile(taskId, getTableName(), cursor, tableMetaDataMap));
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
throw new InternalException("Failed to read cursor " + e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import java.util.UUID;
|
|||
import org.apache.ibatis.cursor.Cursor;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import ru.nbch.indicsearchservice.exception.InternalException;
|
||||
import ru.nbch.indicsearchservice.model.TableMetaData;
|
||||
import ru.nbch.indicsearchservice.util.IndicSearchUtils;
|
||||
import ru.nbch.indicsearchservice.util.MapperHolder;
|
||||
|
|
@ -38,7 +39,7 @@ public class PaymentTableLoader implements AccountSubTableLoader {
|
|||
try (Cursor<LinkedHashMap<String, Object>> cursor = mapperHolder.getIndicMapper().findAllByFidsFromPayment(fids)) {
|
||||
tableFileMap.put(getTableName(), indicSearchUtils.writeRowsToFile(taskId, getTableName(), cursor, tableMetaDataMap));
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
throw new InternalException("Failed to read cursor " + e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import java.util.UUID;
|
|||
import org.apache.ibatis.cursor.Cursor;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import ru.nbch.indicsearchservice.exception.InternalException;
|
||||
import ru.nbch.indicsearchservice.model.TableMetaData;
|
||||
import ru.nbch.indicsearchservice.util.IndicSearchUtils;
|
||||
import ru.nbch.indicsearchservice.util.MapperHolder;
|
||||
|
|
@ -38,7 +39,7 @@ public class RuAccountAmtTableLoader implements RuUidSubTableLoader {
|
|||
try (Cursor<LinkedHashMap<String, Object>> cursor = mapperHolder.getIndicMapper().findAllByFidsFromRuAccountAmt(fids)) {
|
||||
tableFileMap.put(getTableName(), indicSearchUtils.writeRowsToFile(taskId, getTableName(), cursor, tableMetaDataMap));
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
throw new InternalException("Failed to read cursor " + e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import java.util.UUID;
|
|||
import org.apache.ibatis.cursor.Cursor;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import ru.nbch.indicsearchservice.exception.InternalException;
|
||||
import ru.nbch.indicsearchservice.model.TableMetaData;
|
||||
import ru.nbch.indicsearchservice.util.IndicSearchUtils;
|
||||
import ru.nbch.indicsearchservice.util.MapperHolder;
|
||||
|
|
@ -38,7 +39,7 @@ public class RuAcquirerIndividTableLoader implements RuUidSubTableLoader {
|
|||
try (Cursor<LinkedHashMap<String, Object>> cursor = mapperHolder.getIndicMapper().findAllByFidsFromRuAcquirerIndivid(fids)) {
|
||||
tableFileMap.put(getTableName(), indicSearchUtils.writeRowsToFile(taskId, getTableName(), cursor, tableMetaDataMap));
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
throw new InternalException("Failed to read cursor " + e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import java.util.UUID;
|
|||
import org.apache.ibatis.cursor.Cursor;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import ru.nbch.indicsearchservice.exception.InternalException;
|
||||
import ru.nbch.indicsearchservice.model.TableMetaData;
|
||||
import ru.nbch.indicsearchservice.util.IndicSearchUtils;
|
||||
import ru.nbch.indicsearchservice.util.MapperHolder;
|
||||
|
|
@ -38,7 +39,7 @@ public class RuAcquirerLegalTableLoader implements RuUidSubTableLoader {
|
|||
try (Cursor<LinkedHashMap<String, Object>> cursor = mapperHolder.getIndicMapper().findAllByFidsFromRuAcquirerLegal(fids)) {
|
||||
tableFileMap.put(getTableName(), indicSearchUtils.writeRowsToFile(taskId, getTableName(), cursor, tableMetaDataMap));
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
throw new InternalException("Failed to read cursor " + e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import java.util.UUID;
|
|||
import org.apache.ibatis.cursor.Cursor;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import ru.nbch.indicsearchservice.exception.InternalException;
|
||||
import ru.nbch.indicsearchservice.model.TableMetaData;
|
||||
import ru.nbch.indicsearchservice.util.IndicSearchUtils;
|
||||
import ru.nbch.indicsearchservice.util.MapperHolder;
|
||||
|
|
@ -38,7 +39,7 @@ public class RuAllArrearsTableLoader implements RuUidSubTableLoader {
|
|||
try (Cursor<LinkedHashMap<String, Object>> cursor = mapperHolder.getIndicMapper().findAllByFidsFromRuAllArrears(fids)) {
|
||||
tableFileMap.put(getTableName(), indicSearchUtils.writeRowsToFile(taskId, getTableName(), cursor, tableMetaDataMap));
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
throw new InternalException("Failed to read cursor " + e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import java.util.UUID;
|
|||
import org.apache.ibatis.cursor.Cursor;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import ru.nbch.indicsearchservice.exception.InternalException;
|
||||
import ru.nbch.indicsearchservice.model.TableMetaData;
|
||||
import ru.nbch.indicsearchservice.util.IndicSearchUtils;
|
||||
import ru.nbch.indicsearchservice.util.MapperHolder;
|
||||
|
|
@ -38,7 +39,7 @@ public class RuAmendmentTableLoader implements RuUidSubTableLoader {
|
|||
try (Cursor<LinkedHashMap<String, Object>> cursor = mapperHolder.getIndicMapper().findAllByFidsFromRuAmendment(fids)) {
|
||||
tableFileMap.put(getTableName(), indicSearchUtils.writeRowsToFile(taskId, getTableName(), cursor, tableMetaDataMap));
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
throw new InternalException("Failed to read cursor " + e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import java.util.UUID;
|
|||
import org.apache.ibatis.cursor.Cursor;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import ru.nbch.indicsearchservice.exception.InternalException;
|
||||
import ru.nbch.indicsearchservice.model.TableMetaData;
|
||||
import ru.nbch.indicsearchservice.util.IndicSearchUtils;
|
||||
import ru.nbch.indicsearchservice.util.MapperHolder;
|
||||
|
|
@ -38,7 +39,7 @@ public class RuAmountInfoTableLoader implements RuUidSubTableLoader {
|
|||
try (Cursor<LinkedHashMap<String, Object>> cursor = mapperHolder.getIndicMapper().findAllByFidsFromRuAmountInfo(fids)) {
|
||||
tableFileMap.put(getTableName(), indicSearchUtils.writeRowsToFile(taskId, getTableName(), cursor, tableMetaDataMap));
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
throw new InternalException("Failed to read cursor " + e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import java.util.UUID;
|
|||
import org.apache.ibatis.cursor.Cursor;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import ru.nbch.indicsearchservice.exception.InternalException;
|
||||
import ru.nbch.indicsearchservice.model.TableMetaData;
|
||||
import ru.nbch.indicsearchservice.util.IndicSearchUtils;
|
||||
import ru.nbch.indicsearchservice.util.MapperHolder;
|
||||
|
|
@ -38,7 +39,7 @@ public class RuArrearTableLoader implements RuUidSubTableLoader {
|
|||
try (Cursor<LinkedHashMap<String, Object>> cursor = mapperHolder.getIndicMapper().findAllByFidsFromRuArrear(fids)) {
|
||||
tableFileMap.put(getTableName(), indicSearchUtils.writeRowsToFile(taskId, getTableName(), cursor, tableMetaDataMap));
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
throw new InternalException("Failed to read cursor " + e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import java.util.UUID;
|
|||
import org.apache.ibatis.cursor.Cursor;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import ru.nbch.indicsearchservice.exception.InternalException;
|
||||
import ru.nbch.indicsearchservice.model.TableMetaData;
|
||||
import ru.nbch.indicsearchservice.util.IndicSearchUtils;
|
||||
import ru.nbch.indicsearchservice.util.MapperHolder;
|
||||
|
|
@ -38,7 +39,7 @@ public class RuBankruptcyBlocksTableLoader implements RuUidSubTableLoader {
|
|||
try (Cursor<LinkedHashMap<String, Object>> cursor = mapperHolder.getIndicMapper().findAllByFidsFromRuBankruptcyBlocks(fids)) {
|
||||
tableFileMap.put(getTableName(), indicSearchUtils.writeRowsToFile(taskId, getTableName(), cursor, tableMetaDataMap));
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
throw new InternalException("Failed to read cursor " + e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import java.util.UUID;
|
|||
import org.apache.ibatis.cursor.Cursor;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import ru.nbch.indicsearchservice.exception.InternalException;
|
||||
import ru.nbch.indicsearchservice.model.TableMetaData;
|
||||
import ru.nbch.indicsearchservice.util.IndicSearchUtils;
|
||||
import ru.nbch.indicsearchservice.util.MapperHolder;
|
||||
|
|
@ -38,7 +39,7 @@ public class RuCoborrowerTableLoader implements RuUidSubTableLoader {
|
|||
try (Cursor<LinkedHashMap<String, Object>> cursor = mapperHolder.getIndicMapper().findAllByFidsFromRuCoborrower(fids)) {
|
||||
tableFileMap.put(getTableName(), indicSearchUtils.writeRowsToFile(taskId, getTableName(), cursor, tableMetaDataMap));
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
throw new InternalException("Failed to read cursor " + e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import java.util.UUID;
|
|||
import org.apache.ibatis.cursor.Cursor;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import ru.nbch.indicsearchservice.exception.InternalException;
|
||||
import ru.nbch.indicsearchservice.model.TableMetaData;
|
||||
import ru.nbch.indicsearchservice.util.IndicSearchUtils;
|
||||
import ru.nbch.indicsearchservice.util.MapperHolder;
|
||||
|
|
@ -38,7 +39,7 @@ public class RuCollatInsuredTableLoader implements RuUidSubTableLoader {
|
|||
try (Cursor<LinkedHashMap<String, Object>> cursor = mapperHolder.getIndicMapper().findAllByFidsFromRuCollatInsured(fids)) {
|
||||
tableFileMap.put(getTableName(), indicSearchUtils.writeRowsToFile(taskId, getTableName(), cursor, tableMetaDataMap));
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
throw new InternalException("Failed to read cursor " + e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import java.util.UUID;
|
|||
import org.apache.ibatis.cursor.Cursor;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import ru.nbch.indicsearchservice.exception.InternalException;
|
||||
import ru.nbch.indicsearchservice.model.TableMetaData;
|
||||
import ru.nbch.indicsearchservice.util.IndicSearchUtils;
|
||||
import ru.nbch.indicsearchservice.util.MapperHolder;
|
||||
|
|
@ -38,7 +39,7 @@ public class RuCollatRepayTableLoader implements RuUidSubTableLoader {
|
|||
try (Cursor<LinkedHashMap<String, Object>> cursor = mapperHolder.getIndicMapper().findAllByFidsFromRuCollatRepay(fids)) {
|
||||
tableFileMap.put(getTableName(), indicSearchUtils.writeRowsToFile(taskId, getTableName(), cursor, tableMetaDataMap));
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
throw new InternalException("Failed to read cursor " + e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import java.util.UUID;
|
|||
import org.apache.ibatis.cursor.Cursor;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import ru.nbch.indicsearchservice.exception.InternalException;
|
||||
import ru.nbch.indicsearchservice.model.TableMetaData;
|
||||
import ru.nbch.indicsearchservice.util.IndicSearchUtils;
|
||||
import ru.nbch.indicsearchservice.util.MapperHolder;
|
||||
|
|
@ -38,7 +39,7 @@ public class RuCollateralBlocksTableLoader implements RuUidSubTableLoader {
|
|||
try (Cursor<LinkedHashMap<String, Object>> cursor = mapperHolder.getIndicMapper().findAllByFidsFromRuCollateralBlocks(fids)) {
|
||||
tableFileMap.put(getTableName(), indicSearchUtils.writeRowsToFile(taskId, getTableName(), cursor, tableMetaDataMap));
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
throw new InternalException("Failed to read cursor " + e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import java.util.UUID;
|
|||
import org.apache.ibatis.cursor.Cursor;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import ru.nbch.indicsearchservice.exception.InternalException;
|
||||
import ru.nbch.indicsearchservice.model.TableMetaData;
|
||||
import ru.nbch.indicsearchservice.util.IndicSearchUtils;
|
||||
import ru.nbch.indicsearchservice.util.MapperHolder;
|
||||
|
|
@ -38,7 +39,7 @@ public class RuCollateralTableLoader implements RuUidSubTableLoader {
|
|||
try (Cursor<LinkedHashMap<String, Object>> cursor = mapperHolder.getIndicMapper().findAllByFidsFromRuCollateral(fids)) {
|
||||
tableFileMap.put(getTableName(), indicSearchUtils.writeRowsToFile(taskId, getTableName(), cursor, tableMetaDataMap));
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
throw new InternalException("Failed to read cursor " + e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import java.util.UUID;
|
|||
import org.apache.ibatis.cursor.Cursor;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import ru.nbch.indicsearchservice.exception.InternalException;
|
||||
import ru.nbch.indicsearchservice.model.TableMetaData;
|
||||
import ru.nbch.indicsearchservice.util.IndicSearchUtils;
|
||||
import ru.nbch.indicsearchservice.util.MapperHolder;
|
||||
|
|
@ -38,7 +39,7 @@ public class RuContractTermsChangesTableLoader implements RuUidSubTableLoader {
|
|||
try (Cursor<LinkedHashMap<String, Object>> cursor = mapperHolder.getIndicMapper().findAllByFidsFromRuContractTermsChanges(fids)) {
|
||||
tableFileMap.put(getTableName(), indicSearchUtils.writeRowsToFile(taskId, getTableName(), cursor, tableMetaDataMap));
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
throw new InternalException("Failed to read cursor " + e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import java.util.UUID;
|
|||
import org.apache.ibatis.cursor.Cursor;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import ru.nbch.indicsearchservice.exception.InternalException;
|
||||
import ru.nbch.indicsearchservice.model.TableMetaData;
|
||||
import ru.nbch.indicsearchservice.util.IndicSearchUtils;
|
||||
import ru.nbch.indicsearchservice.util.MapperHolder;
|
||||
|
|
@ -38,7 +39,7 @@ public class RuDueArrearTableLoader implements RuUidSubTableLoader {
|
|||
try (Cursor<LinkedHashMap<String, Object>> cursor = mapperHolder.getIndicMapper().findAllByFidsFromRuDueArrear(fids)) {
|
||||
tableFileMap.put(getTableName(), indicSearchUtils.writeRowsToFile(taskId, getTableName(), cursor, tableMetaDataMap));
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
throw new InternalException("Failed to read cursor " + e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import java.util.UUID;
|
|||
import org.apache.ibatis.cursor.Cursor;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import ru.nbch.indicsearchservice.exception.InternalException;
|
||||
import ru.nbch.indicsearchservice.model.TableMetaData;
|
||||
import ru.nbch.indicsearchservice.util.IndicSearchUtils;
|
||||
import ru.nbch.indicsearchservice.util.MapperHolder;
|
||||
|
|
@ -38,7 +39,7 @@ public class RuFundDateTableLoader implements RuUidSubTableLoader {
|
|||
try (Cursor<LinkedHashMap<String, Object>> cursor = mapperHolder.getIndicMapper().findAllByFidsFromRuFundDate(fids)) {
|
||||
tableFileMap.put(getTableName(), indicSearchUtils.writeRowsToFile(taskId, getTableName(), cursor, tableMetaDataMap));
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
throw new InternalException("Failed to read cursor " + e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import java.util.UUID;
|
|||
import org.apache.ibatis.cursor.Cursor;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import ru.nbch.indicsearchservice.exception.InternalException;
|
||||
import ru.nbch.indicsearchservice.model.TableMetaData;
|
||||
import ru.nbch.indicsearchservice.util.IndicSearchUtils;
|
||||
import ru.nbch.indicsearchservice.util.MapperHolder;
|
||||
|
|
@ -38,7 +39,7 @@ public class RuGuaranteeRepayTableLoader implements RuUidSubTableLoader {
|
|||
try (Cursor<LinkedHashMap<String, Object>> cursor = mapperHolder.getIndicMapper().findAllByFidsFromRuGuaranteeRepay(fids)) {
|
||||
tableFileMap.put(getTableName(), indicSearchUtils.writeRowsToFile(taskId, getTableName(), cursor, tableMetaDataMap));
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
throw new InternalException("Failed to read cursor " + e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import java.util.UUID;
|
|||
import org.apache.ibatis.cursor.Cursor;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import ru.nbch.indicsearchservice.exception.InternalException;
|
||||
import ru.nbch.indicsearchservice.model.TableMetaData;
|
||||
import ru.nbch.indicsearchservice.util.IndicSearchUtils;
|
||||
import ru.nbch.indicsearchservice.util.MapperHolder;
|
||||
|
|
@ -38,7 +39,7 @@ public class RuGuarantorTableLoader implements RuUidSubTableLoader {
|
|||
try (Cursor<LinkedHashMap<String, Object>> cursor = mapperHolder.getIndicMapper().findAllByFidsFromRuGuarantor(fids)) {
|
||||
tableFileMap.put(getTableName(), indicSearchUtils.writeRowsToFile(taskId, getTableName(), cursor, tableMetaDataMap));
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
throw new InternalException("Failed to read cursor " + e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import java.util.UUID;
|
|||
import org.apache.ibatis.cursor.Cursor;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import ru.nbch.indicsearchservice.exception.InternalException;
|
||||
import ru.nbch.indicsearchservice.model.TableMetaData;
|
||||
import ru.nbch.indicsearchservice.util.IndicSearchUtils;
|
||||
import ru.nbch.indicsearchservice.util.MapperHolder;
|
||||
|
|
@ -38,7 +39,7 @@ public class RuIndepGuarantorTableLoader implements RuUidSubTableLoader {
|
|||
try (Cursor<LinkedHashMap<String, Object>> cursor = mapperHolder.getIndicMapper().findAllByFidsFromRuIndepGuarantor(fids)) {
|
||||
tableFileMap.put(getTableName(), indicSearchUtils.writeRowsToFile(taskId, getTableName(), cursor, tableMetaDataMap));
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
throw new InternalException("Failed to read cursor " + e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import java.util.UUID;
|
|||
import org.apache.ibatis.cursor.Cursor;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import ru.nbch.indicsearchservice.exception.InternalException;
|
||||
import ru.nbch.indicsearchservice.model.TableMetaData;
|
||||
import ru.nbch.indicsearchservice.util.IndicSearchUtils;
|
||||
import ru.nbch.indicsearchservice.util.MapperHolder;
|
||||
|
|
@ -38,7 +39,7 @@ public class RuLegalRecordTableLoader implements RuUidSubTableLoader {
|
|||
try (Cursor<LinkedHashMap<String, Object>> cursor = mapperHolder.getIndicMapper().findAllByFidsFromRuLegalRecord(fids)) {
|
||||
tableFileMap.put(getTableName(), indicSearchUtils.writeRowsToFile(taskId, getTableName(), cursor, tableMetaDataMap));
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
throw new InternalException("Failed to read cursor " + e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import java.util.UUID;
|
|||
import org.apache.ibatis.cursor.Cursor;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import ru.nbch.indicsearchservice.exception.InternalException;
|
||||
import ru.nbch.indicsearchservice.model.TableMetaData;
|
||||
import ru.nbch.indicsearchservice.util.IndicSearchUtils;
|
||||
import ru.nbch.indicsearchservice.util.MapperHolder;
|
||||
|
|
@ -38,7 +39,7 @@ public class RuMonthAverPaymtTableLoader implements RuUidSubTableLoader {
|
|||
try (Cursor<LinkedHashMap<String, Object>> cursor = mapperHolder.getIndicMapper().findAllByFidsFromRuMonthAverPaymt(fids)) {
|
||||
tableFileMap.put(getTableName(), indicSearchUtils.writeRowsToFile(taskId, getTableName(), cursor, tableMetaDataMap));
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
throw new InternalException("Failed to read cursor " + e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import java.util.UUID;
|
|||
import org.apache.ibatis.cursor.Cursor;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import ru.nbch.indicsearchservice.exception.InternalException;
|
||||
import ru.nbch.indicsearchservice.model.TableMetaData;
|
||||
import ru.nbch.indicsearchservice.util.IndicSearchUtils;
|
||||
import ru.nbch.indicsearchservice.util.MapperHolder;
|
||||
|
|
@ -38,7 +39,7 @@ public class RuObligAccountTableLoader implements RuUidSubTableLoader {
|
|||
try (Cursor<LinkedHashMap<String, Object>> cursor = mapperHolder.getIndicMapper().findAllByFidsFromRuObligAccount(fids)) {
|
||||
tableFileMap.put(getTableName(), indicSearchUtils.writeRowsToFile(taskId, getTableName(), cursor, tableMetaDataMap));
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
throw new InternalException("Failed to read cursor " + e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import java.util.UUID;
|
|||
import org.apache.ibatis.cursor.Cursor;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import ru.nbch.indicsearchservice.exception.InternalException;
|
||||
import ru.nbch.indicsearchservice.model.TableMetaData;
|
||||
import ru.nbch.indicsearchservice.util.IndicSearchUtils;
|
||||
import ru.nbch.indicsearchservice.util.MapperHolder;
|
||||
|
|
@ -38,7 +39,7 @@ public class RuObligTerminationTableLoader implements RuUidSubTableLoader {
|
|||
try (Cursor<LinkedHashMap<String, Object>> cursor = mapperHolder.getIndicMapper().findAllByFidsFromRuObligTermination(fids)) {
|
||||
tableFileMap.put(getTableName(), indicSearchUtils.writeRowsToFile(taskId, getTableName(), cursor, tableMetaDataMap));
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
throw new InternalException("Failed to read cursor " + e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import java.util.UUID;
|
|||
import org.apache.ibatis.cursor.Cursor;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import ru.nbch.indicsearchservice.exception.InternalException;
|
||||
import ru.nbch.indicsearchservice.model.TableMetaData;
|
||||
import ru.nbch.indicsearchservice.util.IndicSearchUtils;
|
||||
import ru.nbch.indicsearchservice.util.MapperHolder;
|
||||
|
|
@ -38,7 +39,7 @@ public class RuObligsRcBankruptTableLoader implements RuUidSubTableLoader {
|
|||
try (Cursor<LinkedHashMap<String, Object>> cursor = mapperHolder.getIndicMapper().findAllByFidsFromRuObligsRcBankrupt(fids)) {
|
||||
tableFileMap.put(getTableName(), indicSearchUtils.writeRowsToFile(taskId, getTableName(), cursor, tableMetaDataMap));
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
throw new InternalException("Failed to read cursor " + e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import java.util.UUID;
|
|||
import org.apache.ibatis.cursor.Cursor;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import ru.nbch.indicsearchservice.exception.InternalException;
|
||||
import ru.nbch.indicsearchservice.model.TableMetaData;
|
||||
import ru.nbch.indicsearchservice.util.IndicSearchUtils;
|
||||
import ru.nbch.indicsearchservice.util.MapperHolder;
|
||||
|
|
@ -38,7 +39,7 @@ public class RuObligsRcLiquidTableLoader implements RuUidSubTableLoader {
|
|||
try (Cursor<LinkedHashMap<String, Object>> cursor = mapperHolder.getIndicMapper().findAllByFidsFromRuObligsRcLiquid(fids)) {
|
||||
tableFileMap.put(getTableName(), indicSearchUtils.writeRowsToFile(taskId, getTableName(), cursor, tableMetaDataMap));
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
throw new InternalException("Failed to read cursor " + e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import java.util.UUID;
|
|||
import org.apache.ibatis.cursor.Cursor;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import ru.nbch.indicsearchservice.exception.InternalException;
|
||||
import ru.nbch.indicsearchservice.model.TableMetaData;
|
||||
import ru.nbch.indicsearchservice.util.IndicSearchUtils;
|
||||
import ru.nbch.indicsearchservice.util.MapperHolder;
|
||||
|
|
@ -39,7 +40,7 @@ public class RuOverallvalTableLoader implements RuUidSubTableLoader {
|
|||
try (Cursor<LinkedHashMap<String, Object>> cursor = mapperHolder.getIndicMapper().findAllByFidsFromRuOverallval(fids)) {
|
||||
tableFileMap.put(getTableName(), indicSearchUtils.writeRowsToFile(taskId, getTableName(), cursor, tableMetaDataMap));
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
throw new InternalException("Failed to read cursor " + e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import java.util.UUID;
|
|||
import org.apache.ibatis.cursor.Cursor;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import ru.nbch.indicsearchservice.exception.InternalException;
|
||||
import ru.nbch.indicsearchservice.model.TableMetaData;
|
||||
import ru.nbch.indicsearchservice.util.IndicSearchUtils;
|
||||
import ru.nbch.indicsearchservice.util.MapperHolder;
|
||||
|
|
@ -38,7 +39,7 @@ public class RuPastDueArrearTableLoader implements RuUidSubTableLoader {
|
|||
try (Cursor<LinkedHashMap<String, Object>> cursor = mapperHolder.getIndicMapper().findAllByFidsFromRuPastDueArrear(fids)) {
|
||||
tableFileMap.put(getTableName(), indicSearchUtils.writeRowsToFile(taskId, getTableName(), cursor, tableMetaDataMap));
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
throw new InternalException("Failed to read cursor " + e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import java.util.UUID;
|
|||
import org.apache.ibatis.cursor.Cursor;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import ru.nbch.indicsearchservice.exception.InternalException;
|
||||
import ru.nbch.indicsearchservice.model.TableMetaData;
|
||||
import ru.nbch.indicsearchservice.util.IndicSearchUtils;
|
||||
import ru.nbch.indicsearchservice.util.MapperHolder;
|
||||
|
|
@ -38,7 +39,7 @@ public class RuPaymtConditionTableLoader implements RuUidSubTableLoader {
|
|||
try (Cursor<LinkedHashMap<String, Object>> cursor = mapperHolder.getIndicMapper().findAllByFidsFromRuPaymtCondition(fids)) {
|
||||
tableFileMap.put(getTableName(), indicSearchUtils.writeRowsToFile(taskId, getTableName(), cursor, tableMetaDataMap));
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
throw new InternalException("Failed to read cursor " + e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import java.util.UUID;
|
|||
import org.apache.ibatis.cursor.Cursor;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import ru.nbch.indicsearchservice.exception.InternalException;
|
||||
import ru.nbch.indicsearchservice.model.TableMetaData;
|
||||
import ru.nbch.indicsearchservice.util.IndicSearchUtils;
|
||||
import ru.nbch.indicsearchservice.util.MapperHolder;
|
||||
|
|
@ -38,7 +39,7 @@ public class RuPaymtTableLoader implements RuUidSubTableLoader {
|
|||
try (Cursor<LinkedHashMap<String, Object>> cursor = mapperHolder.getIndicMapper().findAllByFidsFromRuPaymt(fids)) {
|
||||
tableFileMap.put(getTableName(), indicSearchUtils.writeRowsToFile(taskId, getTableName(), cursor, tableMetaDataMap));
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
throw new InternalException("Failed to read cursor " + e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import java.util.UUID;
|
|||
import org.apache.ibatis.cursor.Cursor;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import ru.nbch.indicsearchservice.exception.InternalException;
|
||||
import ru.nbch.indicsearchservice.model.TableMetaData;
|
||||
import ru.nbch.indicsearchservice.util.IndicSearchUtils;
|
||||
import ru.nbch.indicsearchservice.util.MapperHolder;
|
||||
|
|
@ -38,7 +39,7 @@ public class RuServiceCoTableLoader implements RuUidSubTableLoader {
|
|||
try (Cursor<LinkedHashMap<String, Object>> cursor = mapperHolder.getIndicMapper().findAllByFidsFromRuServiceCo(fids)) {
|
||||
tableFileMap.put(getTableName(), indicSearchUtils.writeRowsToFile(taskId, getTableName(), cursor, tableMetaDataMap));
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
throw new InternalException("Failed to read cursor " + e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import java.util.UUID;
|
|||
import org.apache.ibatis.cursor.Cursor;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import ru.nbch.indicsearchservice.exception.InternalException;
|
||||
import ru.nbch.indicsearchservice.model.TableMetaData;
|
||||
import ru.nbch.indicsearchservice.util.IndicSearchUtils;
|
||||
import ru.nbch.indicsearchservice.util.MapperHolder;
|
||||
|
|
@ -38,7 +39,7 @@ public class RuSourceNonMonetObligTableLoader implements RuUidSubTableLoader {
|
|||
try (Cursor<LinkedHashMap<String, Object>> cursor = mapperHolder.getIndicMapper().findAllByFidsFromRuSourceNonMonetOblig(fids)) {
|
||||
tableFileMap.put(getTableName(), indicSearchUtils.writeRowsToFile(taskId, getTableName(), cursor, tableMetaDataMap));
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
throw new InternalException("Failed to read cursor " + e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import java.util.UUID;
|
|||
import org.apache.ibatis.cursor.Cursor;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import ru.nbch.indicsearchservice.exception.InternalException;
|
||||
import ru.nbch.indicsearchservice.model.TableMetaData;
|
||||
import ru.nbch.indicsearchservice.util.IndicSearchUtils;
|
||||
import ru.nbch.indicsearchservice.util.MapperHolder;
|
||||
|
|
@ -38,7 +39,7 @@ public class RuSubjectNonMonetObligTableLoader implements RuUidSubTableLoader {
|
|||
try (Cursor<LinkedHashMap<String, Object>> cursor = mapperHolder.getIndicMapper().findAllByFidsFromRuSubjectNonMonetOblig(fids)) {
|
||||
tableFileMap.put(getTableName(), indicSearchUtils.writeRowsToFile(taskId, getTableName(), cursor, tableMetaDataMap));
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
throw new InternalException("Failed to read cursor " + e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import java.util.UUID;
|
|||
import org.apache.ibatis.cursor.Cursor;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import ru.nbch.indicsearchservice.exception.InternalException;
|
||||
import ru.nbch.indicsearchservice.model.TableMetaData;
|
||||
import ru.nbch.indicsearchservice.util.IndicSearchUtils;
|
||||
import ru.nbch.indicsearchservice.util.MapperHolder;
|
||||
|
|
@ -38,7 +39,7 @@ public class RuSubmitHoldTableLoader implements RuUidSubTableLoader {
|
|||
try (Cursor<LinkedHashMap<String, Object>> cursor = mapperHolder.getIndicMapper().findAllByFidsFromRuSubmitHold(fids)) {
|
||||
tableFileMap.put(getTableName(), indicSearchUtils.writeRowsToFile(taskId, getTableName(), cursor, tableMetaDataMap));
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
throw new InternalException("Failed to read cursor " + e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import java.util.UUID;
|
|||
import org.apache.ibatis.cursor.Cursor;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import ru.nbch.indicsearchservice.exception.InternalException;
|
||||
import ru.nbch.indicsearchservice.model.TableMetaData;
|
||||
import ru.nbch.indicsearchservice.util.IndicSearchUtils;
|
||||
import ru.nbch.indicsearchservice.util.MapperHolder;
|
||||
|
|
@ -38,7 +39,7 @@ public class RuTradeTableLoader implements RuUidSubTableLoader {
|
|||
try (Cursor<LinkedHashMap<String, Object>> cursor = mapperHolder.getIndicMapper().findAllByFidsFromRuTrade(fids)) {
|
||||
tableFileMap.put(getTableName(), indicSearchUtils.writeRowsToFile(taskId, getTableName(), cursor, tableMetaDataMap));
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
throw new InternalException("Failed to read cursor " + e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package ru.nbch.indicsearchservice.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
|
@ -9,6 +10,8 @@ import java.util.Objects;
|
|||
public class TableData {
|
||||
private String tableName;
|
||||
private List<FieldData> fieldData = new ArrayList<>();
|
||||
|
||||
@JsonProperty("related_data")
|
||||
private List<TableData> relatedTableData = new ArrayList<>();
|
||||
|
||||
public TableData() {
|
||||
|
|
@ -58,7 +61,7 @@ public class TableData {
|
|||
'}';
|
||||
}
|
||||
|
||||
public record FieldData(String columnName,
|
||||
Object columnValue) {
|
||||
public record FieldData(@JsonProperty("key") String columnName,
|
||||
@JsonProperty("value") Object columnValue) {
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@ import ru.nbch.indicsearchservice.aggregator.FileAggregator;
|
|||
import ru.nbch.indicsearchservice.dto.request.AddSearchJobRequestDto;
|
||||
import ru.nbch.indicsearchservice.dto.response.AddSearchJobResponseDto;
|
||||
import ru.nbch.indicsearchservice.dto.response.JobStatusResponseDto;
|
||||
import ru.nbch.indicsearchservice.exception.InternalException;
|
||||
import ru.nbch.indicsearchservice.exporter.ExcelExporter;
|
||||
import ru.nbch.indicsearchservice.exporter.JsonExporter;
|
||||
import ru.nbch.indicsearchservice.loader.FirstLevelTableLoader;
|
||||
|
|
@ -42,7 +43,7 @@ import ru.nbch.indicsearchservice.util.MapperHolder;
|
|||
public class IndicSearchService {
|
||||
private static final Logger log = LoggerFactory.getLogger(IndicSearchService.class);
|
||||
|
||||
private static final boolean IS_EXPORT_AS_EXCEL = true;
|
||||
private static final boolean IS_EXPORT_AS_EXCEL = false;
|
||||
|
||||
private final List<FirstLevelTableLoader> tableLoaders;
|
||||
private final List<FileAggregator> fileAggregators;
|
||||
|
|
@ -133,7 +134,7 @@ public class IndicSearchService {
|
|||
try {
|
||||
Files.deleteIfExists(tableFilePath);
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
throw new InternalException("Failed to delete file " + tableFilePath + " " + e);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -151,11 +152,13 @@ public class IndicSearchService {
|
|||
sw.stop();
|
||||
log.info(sw.prettyPrint());
|
||||
|
||||
// try {
|
||||
// Files.deleteIfExists(aggregatedFile);
|
||||
// } catch (IOException e) {
|
||||
// throw new RuntimeException(e);
|
||||
// }
|
||||
try {
|
||||
if (aggregatedFile != null) {
|
||||
Files.deleteIfExists(aggregatedFile);
|
||||
}
|
||||
} catch (IOException e) {
|
||||
throw new InternalException("Failed to delete file " + aggregatedFile + " " + e);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ import org.springframework.context.ApplicationEventPublisher;
|
|||
import org.springframework.stereotype.Service;
|
||||
import ru.nbch.indicsearchservice.config.settings.ApplicationSettings;
|
||||
import ru.nbch.indicsearchservice.event.DataSourceChangedEvent;
|
||||
import ru.nbch.indicsearchservice.exception.InternalException;
|
||||
import ru.nbch.indicsearchservice.model.Settings;
|
||||
import ru.nbch.indicsearchservice.repository.bank.SettingsMapper;
|
||||
import ru.nbch.indicsearchservice.util.DataSourceUpdater;
|
||||
|
|
@ -32,7 +33,7 @@ public class SettingsService {
|
|||
|
||||
public String getSettingsValueByName(String name) {
|
||||
return settingsMapper.findByName(name)
|
||||
.orElseThrow(() -> new RuntimeException("Setting with key: " + name + " was not found in database!"))
|
||||
.orElseThrow(() -> new InternalException("Setting with key: " + name + " was not found in database!"))
|
||||
.getValue();
|
||||
}
|
||||
|
||||
|
|
@ -75,7 +76,7 @@ public class SettingsService {
|
|||
try {
|
||||
Files.createDirectories(Paths.get(newStorageDirectory.get()));
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
throw new InternalException("Failed to create directory " + newStorageDirectory.get() + " " + e);
|
||||
}
|
||||
localSettings.setStorageDirectory(new File(newStorageDirectory.get()));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ import org.springframework.stereotype.Component;
|
|||
import ru.nbch.indicsearchservice.config.settings.ApplicationSettings;
|
||||
import ru.nbch.indicsearchservice.config.settings.DataSourceSettings;
|
||||
import ru.nbch.indicsearchservice.event.DataSourceChangedEvent;
|
||||
import ru.nbch.indicsearchservice.exception.InternalException;
|
||||
import ru.nbch.indicsearchservice.repository.MyBatisRepository;
|
||||
import ru.nbch.indicsearchservice.repository.indic.IndicMapper;
|
||||
import ru.nbch.indicsearchservice.service.SettingsService;
|
||||
|
|
@ -175,13 +176,13 @@ public class DataSourceUpdater {
|
|||
|
||||
SqlSessionFactory sessionFactory = sqlSessionFactoryBean.getObject();
|
||||
if (sessionFactory == null) {
|
||||
throw new IllegalStateException("Failed to create SqlSessionFactory");
|
||||
throw new InternalException("Failed to create SqlSessionFactory");
|
||||
}
|
||||
|
||||
return sessionFactory;
|
||||
} catch (Exception e) {
|
||||
log.error("Failed to build SqlSessionFactory", e);
|
||||
throw new RuntimeException("Failed to build SqlSessionFactory", e);
|
||||
throw new InternalException("Failed to build SqlSessionFactory " + e);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -217,10 +218,10 @@ public class DataSourceUpdater {
|
|||
));
|
||||
|
||||
DataSourceSettings dataSourceSettings = new DataSourceSettings();
|
||||
dataSourceSettings.setDriver(fetchedSettings.get("datasource." + key + ".driver").orElseThrow(() -> new RuntimeException("Required SETTINGS not found!")));
|
||||
dataSourceSettings.setUrl(fetchedSettings.get("datasource." + key + ".url").orElseThrow(() -> new RuntimeException("Required SETTINGS not found!")));
|
||||
dataSourceSettings.setUsername(fetchedSettings.get("datasource." + key + ".username").orElseThrow(() -> new RuntimeException("Required SETTINGS not found!")));
|
||||
dataSourceSettings.setPassword(fetchedSettings.get("datasource." + key + ".password").orElseThrow(() -> new RuntimeException("Required SETTINGS not found!")));
|
||||
dataSourceSettings.setDriver(fetchedSettings.get("datasource." + key + ".driver").orElseThrow(() -> new InternalException("Key datasource." + key + ".driver" + " was not found in SETTINGS!")));
|
||||
dataSourceSettings.setUrl(fetchedSettings.get("datasource." + key + ".url").orElseThrow(() -> new InternalException("Key datasource." + key + ".url" + " was not found in SETTINGS!")));
|
||||
dataSourceSettings.setUsername(fetchedSettings.get("datasource." + key + ".username").orElseThrow(() -> new InternalException("Key datasource." + key + ".username" + " was not found in SETTINGS!")));
|
||||
dataSourceSettings.setPassword(fetchedSettings.get("datasource." + key + ".password").orElseThrow(() -> new InternalException("Key datasource." + key + ".password" + " was not found in SETTINGS!")));
|
||||
|
||||
dataSourceSettings.setConnectionTimeout(Long.valueOf(fetchedSettings.get("datasource." + key + ".connection-timeout").orElse("30000")));
|
||||
dataSourceSettings.setValidationTimeout(Long.valueOf(fetchedSettings.get("datasource." + key + ".validation-timeout").orElse("5000")));
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ import java.util.UUID;
|
|||
import org.apache.ibatis.cursor.Cursor;
|
||||
import org.springframework.stereotype.Component;
|
||||
import ru.nbch.indicsearchservice.config.settings.ApplicationSettings;
|
||||
import ru.nbch.indicsearchservice.exception.InternalException;
|
||||
import ru.nbch.indicsearchservice.model.LocalizationObject;
|
||||
import ru.nbch.indicsearchservice.model.TableMetaData;
|
||||
import ru.nbch.indicsearchservice.repository.bank.LocalizationObjectMapper;
|
||||
|
|
@ -94,7 +95,7 @@ public class IndicSearchUtils {
|
|||
writer.newLine();
|
||||
}
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
throw new InternalException("Failed to write file " + resultFile + " " + e);
|
||||
}
|
||||
|
||||
return resultFile;
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import java.io.BufferedReader;
|
|||
import java.io.Closeable;
|
||||
import java.io.IOException;
|
||||
import java.util.Objects;
|
||||
import ru.nbch.indicsearchservice.exception.InternalException;
|
||||
|
||||
public class MovableBufferedReader implements Closeable {
|
||||
private final BufferedReader reader;
|
||||
|
|
@ -14,7 +15,7 @@ public class MovableBufferedReader implements Closeable {
|
|||
try {
|
||||
this.currentLine = reader.readLine();
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
throw new InternalException("Failed to read next line in file " + e);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -22,7 +23,7 @@ public class MovableBufferedReader implements Closeable {
|
|||
try {
|
||||
this.currentLine = reader.readLine();
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
throw new InternalException("Failed to read next line in file " + e);
|
||||
}
|
||||
return this.currentLine;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue