clearing-service http://jira.mfd.msk:8088/browse/CLS-500
This commit is contained in:
parent
199d9b3c58
commit
5d7772d45e
2 changed files with 9 additions and 1 deletions
|
|
@ -47,12 +47,17 @@ public enum RefundDateValidationRule implements IValidationRule<ImdgValidationCo
|
||||||
Collection<Registry> rgss = rgsImdg.getCollectionObjectsByPredicate(prdct).stream()
|
Collection<Registry> rgss = rgsImdg.getCollectionObjectsByPredicate(prdct).stream()
|
||||||
.filter(rgs -> Objects.nonNull(rgs.getSettlementDate()))
|
.filter(rgs -> Objects.nonNull(rgs.getSettlementDate()))
|
||||||
.filter(rgs -> Objects.nonNull(rgs.getValueDate()))
|
.filter(rgs -> Objects.nonNull(rgs.getValueDate()))
|
||||||
.filter(rgs -> rgs.getValueDate().isBefore(rgs.getSettlementDate()))
|
.filter(rgs -> rgs.getRefundDate().equals(rgs.getSettlementDate()))
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
|
|
||||||
if (rgss.size() < 1) {
|
if (rgss.size() < 1) {
|
||||||
return of(ClearingError.RecordNotFound, "groupId=" + validatedObject.getGroupId());
|
return of(ClearingError.RecordNotFound, "groupId=" + validatedObject.getGroupId());
|
||||||
}
|
}
|
||||||
|
for (Registry rgs : rgss) {
|
||||||
|
if (!validatedObject.getRefundDate().isAfter(rgs.getValueDate())) {
|
||||||
|
return of(ClearingError.WrongFieldValue, "refundDate");
|
||||||
|
}
|
||||||
|
}
|
||||||
context.storeObject(ValidationStored.RefundDateChangeRegistries, rgss);
|
context.storeObject(ValidationStored.RefundDateChangeRegistries, rgss);
|
||||||
return empty();
|
return empty();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,9 @@ import java.util.Optional;
|
||||||
import java.util.concurrent.atomic.AtomicReference;
|
import java.util.concurrent.atomic.AtomicReference;
|
||||||
import java.util.function.BiFunction;
|
import java.util.function.BiFunction;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* LiabilitiesAndClaims
|
||||||
|
*/
|
||||||
@Service
|
@Service
|
||||||
@Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE)
|
@Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE)
|
||||||
public class RequirementsAndObligationCreation implements ISessionStage {
|
public class RequirementsAndObligationCreation implements ISessionStage {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue