reports-service http://jira.mfd.msk:8088/browse/CLS-497 ksRepCashRegisterSums fix
This commit is contained in:
parent
2d7a1f452e
commit
0db32aac36
2 changed files with 17 additions and 16 deletions
|
|
@ -78,23 +78,17 @@ public class KSRepCashRegisterSumsReportBuilder extends CSVReportBuilder<EmptyPa
|
||||||
pb.less("created", instantNow.plus(1, ChronoUnit.DAYS).truncatedTo(ChronoUnit.DAYS)),
|
pb.less("created", instantNow.plus(1, ChronoUnit.DAYS).truncatedTo(ChronoUnit.DAYS)),
|
||||||
pb.equals("inOutSDfType", InOutSDfType.type57.getKey()),
|
pb.equals("inOutSDfType", InOutSDfType.type57.getKey()),
|
||||||
pb.equals("operationStatus", OperationStatus.Executed.getKey())
|
pb.equals("operationStatus", OperationStatus.Executed.getKey())
|
||||||
// ,pb.notNull("amount")
|
|
||||||
);
|
);
|
||||||
Collection<Statement> statements = statementImdg.getCollectionObjectsByPredicate(finalPredicate);
|
Collection<Statement> statements = statementImdg.getCollectionObjectsByPredicate(finalPredicate);
|
||||||
rows = new ArrayList<>(statements.size());
|
rows = new ArrayList<>(statements.size());
|
||||||
for (Statement statement : statements) {
|
for (Statement statement : statements) {
|
||||||
|
if (statement.getAmount() == null) {
|
||||||
|
log.warn("Statement id={} has null amount, statement was skipped", statement.getId());
|
||||||
|
continue;
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
// Company company = companyImdg.getSingleObjectByID(statement.getAddresseeId());
|
boolean searchTCRAsInfo;
|
||||||
// if (company == null) {
|
if (Arrays.asList(1L, 2L).contains(statement.getAccountId())) {
|
||||||
// log.warn("For statement id = {} company with id = {} not found, statement was skipped",
|
|
||||||
// statement.getId(),
|
|
||||||
// statement.getAddresseeId());
|
|
||||||
// continue;
|
|
||||||
// }
|
|
||||||
// if (!WorkflowStatus.Active.equalsByKey(company.getWorkflowStatus())) continue;
|
|
||||||
// Long accountId = statement.getAccountId();
|
|
||||||
boolean searchTCRAsInfo=false;
|
|
||||||
if (Arrays.asList(1L,2L).contains(statement.getAccountId())) {
|
|
||||||
searchTCRAsInfo = true;
|
searchTCRAsInfo = true;
|
||||||
} else {
|
} else {
|
||||||
Account account = accountImdg.getSingleObjectByID(statement.getAccountId());
|
Account account = accountImdg.getSingleObjectByID(statement.getAccountId());
|
||||||
|
|
@ -110,7 +104,7 @@ public class KSRepCashRegisterSumsReportBuilder extends CSVReportBuilder<EmptyPa
|
||||||
if (i >= 0) {
|
if (i >= 0) {
|
||||||
code = code.substring(i + 3).trim();
|
code = code.substring(i + 3).trim();
|
||||||
}
|
}
|
||||||
if (i<0 || code.isBlank()) {
|
if (i < 0 || code.isBlank()) {
|
||||||
log.warn("For statement id = {} empty or unparseable code=\"{}\" (comment \"{}\"), statement was skipped",
|
log.warn("For statement id = {} empty or unparseable code=\"{}\" (comment \"{}\"), statement was skipped",
|
||||||
code, statement.getComment(), statement.getId());
|
code, statement.getComment(), statement.getId());
|
||||||
continue;
|
continue;
|
||||||
|
|
@ -145,7 +139,7 @@ public class KSRepCashRegisterSumsReportBuilder extends CSVReportBuilder<EmptyPa
|
||||||
|
|
||||||
Company company;
|
Company company;
|
||||||
if (searchTCRAsInfo) {
|
if (searchTCRAsInfo) {
|
||||||
company = companyImdg.getSingleObjectByID(tkr.getCompanyId());
|
company = companyImdg.getSingleObjectByID(tkr.getCompanyId());
|
||||||
if (company == null) {
|
if (company == null) {
|
||||||
log.warn("For statement id = {}, tcr.id={}, company with id = {} not found, statement was skipped",
|
log.warn("For statement id = {}, tcr.id={}, company with id = {} not found, statement was skipped",
|
||||||
statement.getId(),
|
statement.getId(),
|
||||||
|
|
@ -154,7 +148,7 @@ public class KSRepCashRegisterSumsReportBuilder extends CSVReportBuilder<EmptyPa
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
company = companyImdg.getSingleObjectByID(statement.getAddresseeId());
|
company = companyImdg.getSingleObjectByID(statement.getAddresseeId());
|
||||||
if (company == null) {
|
if (company == null) {
|
||||||
log.warn("For statement id = {}, company with id = {} not found, statement was skipped",
|
log.warn("For statement id = {}, company with id = {} not found, statement was skipped",
|
||||||
statement.getId(),
|
statement.getId(),
|
||||||
|
|
@ -206,7 +200,13 @@ public class KSRepCashRegisterSumsReportBuilder extends CSVReportBuilder<EmptyPa
|
||||||
KSRepCashRegisterSumsReport ksRepCashRegisterSumsReport = new KSRepCashRegisterSumsReport();
|
KSRepCashRegisterSumsReport ksRepCashRegisterSumsReport = new KSRepCashRegisterSumsReport();
|
||||||
ksRepCashRegisterSumsReport.setFirmId(company.getTradingCode());
|
ksRepCashRegisterSumsReport.setFirmId(company.getTradingCode());
|
||||||
if (searchTCRAsInfo) {
|
if (searchTCRAsInfo) {
|
||||||
ksRepCashRegisterSumsReport.setAccount(company.getTradingCode());
|
Account account = accountImdg.getSingleObjectByID(tkr.getMoneyAccountId());
|
||||||
|
if (account == null) {
|
||||||
|
log.debug("statement id={}, moneyAccount not found with id={}",
|
||||||
|
statement.getId(), tkr.getMoneyAccountId());
|
||||||
|
} else {
|
||||||
|
ksRepCashRegisterSumsReport.setAccount(account.getAccount());
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
ksRepCashRegisterSumsReport.setAccount(statement.getAccount());
|
ksRepCashRegisterSumsReport.setAccount(statement.getAccount());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -82,6 +82,7 @@ public class KSRepCashRegistersReportBuilder extends CSVReportBuilder<EmptyParam
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
Collection<Registry> registries = registryImdg.getCollectionObjectsByPredicate(finalPredicate);
|
Collection<Registry> registries = registryImdg.getCollectionObjectsByPredicate(finalPredicate);
|
||||||
|
log.trace("Found {} Registry by query: {}", registries.size(), finalPredicate);
|
||||||
rows = new ArrayList<>(registries.size());
|
rows = new ArrayList<>(registries.size());
|
||||||
for (Registry registry : registries) {
|
for (Registry registry : registries) {
|
||||||
try {
|
try {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue