sdf20, sdf21
This commit is contained in:
parent
8b54b86ae9
commit
d81c4b7040
2 changed files with 7 additions and 3 deletions
|
|
@ -115,15 +115,16 @@ public class Sdf20Executor {
|
|||
rgsImdg.insert(assets.a__b());
|
||||
}
|
||||
if (ds_t == null) {
|
||||
log.debug("DS*T were not found for sdf20.id={} creating", sDf20.getId());
|
||||
ds_t = assets.a__t().clone();
|
||||
RegistryManager.zeroState(ds_t);
|
||||
ds_t.setBalance(quantity);
|
||||
ds_t.setRegistryDesignation(RegistryDesignation.D.getKey());
|
||||
ds_t.setRegistryCode(RegistryUtil.clearingCode(ds_t));
|
||||
rgsImdg.insert(ds_t);
|
||||
log.debug("created DS*T.id={} for sdf20.id={}", ds_t.getId(), sDf20.getId());
|
||||
} else {
|
||||
log.debug("DS*T.id={} found for sdf20.id={}", ds_t.getId(), sDf20.getId());
|
||||
//защита от повторной обработки
|
||||
log.debug("DS*T.id={} found for sdf20.id={}. skipping sdf20", ds_t.getId(), sDf20.getId());
|
||||
return;
|
||||
}
|
||||
Registry as_t = assets.a__t();
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
package ru.spcex.clearing.service.validation;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import ru.clearing.classes.statics.data.account.Account;
|
||||
import ru.clearing.classes.statics.data.registry.Registry;
|
||||
import ru.clearing.classes.statics.data.sdf.SDf21;
|
||||
|
|
@ -58,12 +60,13 @@ public enum Sdf21ValidationRule implements IValidationRule<ImdgValidationContext
|
|||
}
|
||||
Registry ds_t = rgsImdg.getFirstObjectByPredicate(prdct);
|
||||
if (ds_t != null) {
|
||||
log.debug("sdf21.id={} found DS*T.id={}", sdf21.getId(), ds_t.getId());
|
||||
return of(ClearingError.SuchRecordAlreadyExists);
|
||||
}
|
||||
return empty();
|
||||
}
|
||||
};
|
||||
|
||||
private final static Logger log = LoggerFactory.getLogger(Sdf21ValidationRule.class);
|
||||
@Override
|
||||
public String ruleName() {
|
||||
return "Sdf21ValidationRule." + name();
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue