http://jira.mfd.msk:8088/browse/CLS-488 Sdf11#outDocument
This commit is contained in:
parent
de16808e25
commit
f75b262c75
1 changed files with 11 additions and 11 deletions
|
|
@ -43,7 +43,10 @@ import ru.spcex.platform.utils.validation.IValidator;
|
|||
import java.math.BigDecimal;
|
||||
import java.time.Instant;
|
||||
import java.time.LocalDate;
|
||||
import java.util.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
import java.util.function.Function;
|
||||
|
||||
@Service
|
||||
|
|
@ -109,8 +112,7 @@ public class Sdf10Executor {
|
|||
if (sdf10GroupId != null) {
|
||||
log.warn("currently awaiting gateway response for groupId: {}. skipping groupId {}", sdf10GroupId, groupId);
|
||||
sdfs.forEach(sdf10 -> {
|
||||
SDf11 errorSdf11 = createSdf11(sdf10, now, PREVIOUS_REQUEST_NOT_PROCESSED);
|
||||
errorSdf11.setGenerationId(sdf11GroupId);
|
||||
SDf11 errorSdf11 = createSdf11(sdf10, sdf11GroupId, now, PREVIOUS_REQUEST_NOT_PROCESSED);
|
||||
this.sdf11Imdg.insert(errorSdf11);
|
||||
});
|
||||
sendToExporter(sdf11GroupId);
|
||||
|
|
@ -134,8 +136,7 @@ public class Sdf10Executor {
|
|||
security != null ? security.getId() : null,
|
||||
validator.getStored(ValidationStored.Sdf10Account));
|
||||
}
|
||||
errorSdf11 = createSdf11(sDf10, now, errorResult);
|
||||
errorSdf11.setGenerationId(sdf11GroupId);
|
||||
errorSdf11 = createSdf11(sDf10, sdf11GroupId, now, errorResult);
|
||||
this.sdf11Imdg.insert(errorSdf11);
|
||||
sdf11WasCreated = true;
|
||||
if (stmt != null) {
|
||||
|
|
@ -204,8 +205,7 @@ public class Sdf10Executor {
|
|||
stmt.getId(),
|
||||
sDf10.getGenerationId(),
|
||||
sDf10.getId());
|
||||
SDf11 sdf11 = createSdf11(sDf10, time, OK);
|
||||
sdf11.setGenerationId(sdf11GenerationId);
|
||||
SDf11 sdf11 = createSdf11(sDf10, sdf11GenerationId, time, OK);
|
||||
sdf11Imdg.insert(sdf11);
|
||||
stmt.setOperationStatus(OperationStatus.Executed.getKey());
|
||||
stmt.setUpdated(time);
|
||||
|
|
@ -259,8 +259,7 @@ public class Sdf10Executor {
|
|||
statementId,
|
||||
sdf10.getGenerationId(),
|
||||
sdf10.getId());
|
||||
SDf11 sdf11 = createSdf11(sdf10, now, GATEWAY_REJECTED);
|
||||
sdf11.setGenerationId(sdf11GroupId);
|
||||
SDf11 sdf11 = createSdf11(sdf10, sdf11GroupId, now, GATEWAY_REJECTED);
|
||||
sdf11Imdg.insert(sdf11);
|
||||
stmt.setOperationStatus(OperationStatus.Rejected.getKey());
|
||||
stmt.setUpdated(updatedTime);
|
||||
|
|
@ -289,15 +288,16 @@ public class Sdf10Executor {
|
|||
kafkaSender.sendRequestToQueue(Consts.SWT_EXPORTER, swtReq);
|
||||
}
|
||||
|
||||
private SDf11 createSdf11(SDf10 sdf10, Instant time, String result) {
|
||||
private SDf11 createSdf11(SDf10 sdf10, Long generationId, Instant time, String result) {
|
||||
SDf11 sdf11 = new SDf11();
|
||||
sdf11.setOutDocument(UUID.randomUUID().toString());
|
||||
sdf11.setOutDocument(generationId.toString());
|
||||
sdf11.setInDocument(sdf10.getOutDocument());
|
||||
sdf11.setDepoCode(sdf10.getDepoCode());
|
||||
sdf11.setQuantity(sdf10.getQuantity());
|
||||
sdf11.setSecurityCode(sdf10.getSecurityCode());
|
||||
sdf11.setClientName(sdf10.getClientName());
|
||||
sdf11.setGenerationTime(time);
|
||||
sdf11.setGenerationId(generationId);
|
||||
sdf11.setResult(result);
|
||||
return sdf11;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue