rename report type

This commit is contained in:
etreschenkov 2025-09-04 18:55:53 +03:00
parent 95f7c54376
commit 7f2ad9d699
3 changed files with 6 additions and 18 deletions

View file

@ -242,12 +242,11 @@ public class GatewayService extends QueueConsumer implements InitializingBean {
return;
}
String finalReportKey = defineExtTypeName(reportType);
Map<String, Object> content = new HashMap<>();
reportRequest.getReports().forEach(reportPart -> makeContentByReportRequest(content, reportPart));
OutboundRequest outboundRequest = OutboundRequestBuilder.builder()
.section(reportType == ReportType.REPORT_KS_VALUE ? Section.CURR.getKey() : Section.FOND.getKey())
.type(finalReportKey)
.section(reportType == ReportType.REPORT_KS_VALUE_OUTER ? Section.CURR.getKey() : Section.FOND.getKey())
.type(reportType.getKey())
.clearingSystem(clearingSystemValue)
.content(content).build();
@ -370,16 +369,4 @@ public class GatewayService extends QueueConsumer implements InitializingBean {
httpHeaders.setAccept(Collections.singletonList(MediaType.APPLICATION_JSON));
return new HttpEntity<>(outboundRequest, httpHeaders);
}
private String defineExtTypeName(ReportType reportType) {
String finalReportKey = reportType.getKey();
if (!clearingSystemValue.equals("SPVB")) {
if (reportType == ReportType.REPORT_KS_FINAL) {
finalReportKey = "REPORT_KS_OUTER";
} else if (reportType == ReportType.REPORT_KS_VALUE) {
finalReportKey = "REPORT_KS_VALUE_OUTER";
}
}
return finalReportKey;
}
}

View file

@ -346,7 +346,7 @@ public class ReportService extends QueueConsumerV2 implements InitializingBean {
Map<File, ReportInfo> outFiles = createReportsForTask(List.of(), reportBuildersForGREC.values());
sendReportsToGateway(List.of(), outFiles, ReportType.REPORT_KS_VALUE.getKey());
sendReportsToGateway(List.of(), outFiles, ReportType.REPORT_KS_OUTER.getKey());
sendFilesToSftp(outFiles.keySet());
} catch (Exception e) {
log.error("Unexpected exception", e);
@ -364,7 +364,7 @@ public class ReportService extends QueueConsumerV2 implements InitializingBean {
Map<File, ReportInfo> outFiles = createReportsForTask(List.of(), reportBuildersForCX84.values());
sendReportsToGateway(List.of(), outFiles, ReportType.REPORT_KS_VALUE.getKey());
sendReportsToGateway(List.of(), outFiles, ReportType.REPORT_KS_VALUE_OUTER.getKey());
sendFilesToSftp(outFiles.keySet());
} catch (Exception e) {
log.error("Unexpected exception", e);

View file

@ -11,7 +11,8 @@ public enum ReportType implements IEnumKey {
PFX65("PFX65"),
REPORT_KS_TMP("REPORT_KS_TMP"),
REPORT_KS_FINAL("REPORT_KS_FINAL"),
REPORT_KS_VALUE("REPORT_KS_VALUE"),
REPORT_KS_VALUE_OUTER("REPORT_KS_VALUE_OUTER"),
REPORT_KS_OUTER("REPORT_KS_OUTER"),
;