SDF21 пропуск operationDate не сегодня
This commit is contained in:
parent
6666c63fa5
commit
d0ca401ab1
1 changed files with 12 additions and 3 deletions
|
|
@ -134,6 +134,11 @@ public class Sdf21Executor extends AbstractExecutor<SDf21> {
|
|||
result.setChildGenerationId(generationIdForGroup);
|
||||
log.info("SDF21 execution: sdf21 number={}, groupId={}", sdf.size(), sdf.stream().findFirst().map(SDf21::getGenerationId).orElse(null));
|
||||
for (SDf21 sdf21 : sdf) {
|
||||
LocalDate opDt = operationDateParse(sdf21.getOperationDate());
|
||||
if (opDt == null || !opDt.equals(LocalDate.now())) {
|
||||
log.debug("skip sdf21.id={}, operation date {}", sdf21.getId(), sdf21.getOperationDate());
|
||||
continue;
|
||||
}
|
||||
IValidator validator = sDf21Validator.apply(sdf21);
|
||||
Optional<EnumMessage> error = validator.tillFirstError();
|
||||
if (error.isPresent()) {
|
||||
|
|
@ -270,7 +275,7 @@ public class Sdf21Executor extends AbstractExecutor<SDf21> {
|
|||
case DELFREE -> statement.setInOutDirection(InOutDirection.out.getKey());
|
||||
}
|
||||
}
|
||||
statement.setSettlementDate(payDate(sdf21.getOperationDate()));
|
||||
statement.setSettlementDate(operationDateParse(sdf21.getOperationDate()));
|
||||
statement.setAmount(TextUtil.isEmpty(sdf21.getQuantity()) ? null : new BigDecimal(sdf21.getQuantity()));
|
||||
statement.setOperationStatus(OperationStatus.Pending.getKey());
|
||||
statement.setInSDfId(sdf21.getId());
|
||||
|
|
@ -410,11 +415,15 @@ public class Sdf21Executor extends AbstractExecutor<SDf21> {
|
|||
|
||||
DateTimeFormatter payDateFormatter = DateTimeFormatter.ofPattern("yyyyMMdd");
|
||||
|
||||
private LocalDate payDate(String payDate) {
|
||||
private LocalDate operationDateParse(String payDate) {
|
||||
if (TextUtil.isEmpty(payDate)) {
|
||||
return null;
|
||||
}
|
||||
return LocalDate.parse(payDate, payDateFormatter);
|
||||
try {
|
||||
return LocalDate.parse(payDate, payDateFormatter);
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private static String getTkrCodeFromComment(String comment) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue