fixed notification confirm from SEB client
This commit is contained in:
parent
c126056959
commit
0546b97b0a
1 changed files with 15 additions and 6 deletions
|
@ -210,17 +210,26 @@ public class ClientEventDAOImpl implements ClientEventDAO {
|
||||||
.selectByExample()
|
.selectByExample()
|
||||||
.where(ClientEventRecordDynamicSqlSupport.clientConnectionId, isEqualTo(clientConnectionId))
|
.where(ClientEventRecordDynamicSqlSupport.clientConnectionId, isEqualTo(clientConnectionId))
|
||||||
.and(ClientEventRecordDynamicSqlSupport.type, isEqualTo(EventType.NOTIFICATION.id))
|
.and(ClientEventRecordDynamicSqlSupport.type, isEqualTo(EventType.NOTIFICATION.id))
|
||||||
.and(
|
|
||||||
ClientEventRecordDynamicSqlSupport.numericValue,
|
|
||||||
isEqualTo(new BigDecimal(notificationValueId)))
|
|
||||||
.build()
|
.build()
|
||||||
.execute();
|
.execute();
|
||||||
|
|
||||||
if (records.size() != 1) {
|
if (log.isDebugEnabled()) {
|
||||||
log.warn("Expected one notification event log but found: ", records.size());
|
log.debug("Found notification for clientConnectionId: {} notification: {}",
|
||||||
|
clientConnectionId,
|
||||||
|
records);
|
||||||
}
|
}
|
||||||
|
|
||||||
return records.get(0);
|
return records.stream()
|
||||||
|
.filter(rec -> {
|
||||||
|
final BigDecimal numericValue = rec.getNumericValue();
|
||||||
|
if (numericValue == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return numericValue.longValue() == notificationValueId;
|
||||||
|
})
|
||||||
|
.findFirst()
|
||||||
|
.orElseThrow(() -> new IllegalStateException(
|
||||||
|
"Failed to find pending notification event for confirm:" + notificationValueId));
|
||||||
|
|
||||||
})
|
})
|
||||||
.flatMap(ClientEventDAOImpl::toClientNotificationModel);
|
.flatMap(ClientEventDAOImpl::toClientNotificationModel);
|
||||||
|
|
Loading…
Reference in a new issue