Skip to content

Commit

Permalink
[MODAUD-174] - Fixed ZoneOffset
Browse files Browse the repository at this point in the history
  • Loading branch information
azizbekxm committed Nov 15, 2023
1 parent 26bcef4 commit 1f00735
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import static org.folio.util.DbUtils.formatDBTableName;

import java.time.LocalDateTime;
import java.time.ZoneId;
import java.time.ZoneOffset;
import java.util.Date;
import java.util.UUID;
Expand Down Expand Up @@ -89,8 +90,8 @@ private void makeSaveCall(Promise<RowSet<Row>> promise, String query, OrderAudit
orderAuditEvent.getAction(),
orderAuditEvent.getOrderId(),
orderAuditEvent.getUserId(),
LocalDateTime.ofInstant(orderAuditEvent.getEventDate().toInstant(), ZoneOffset.UTC),
LocalDateTime.ofInstant(orderAuditEvent.getActionDate().toInstant(), ZoneOffset.UTC),
LocalDateTime.ofInstant(orderAuditEvent.getEventDate().toInstant(), ZoneId.systemDefault()),
LocalDateTime.ofInstant(orderAuditEvent.getActionDate().toInstant(), ZoneId.systemDefault()),
JsonObject.mapFrom(orderAuditEvent.getOrderSnapshot())), promise);
} catch (Exception e) {
LOGGER.error("Failed to save record with id: {} for order id: {} in to table {}",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import static org.folio.util.DbUtils.formatDBTableName;

import java.time.LocalDateTime;
import java.time.ZoneId;
import java.time.ZoneOffset;
import java.util.Date;
import java.util.UUID;
Expand Down Expand Up @@ -92,8 +93,8 @@ private void makeSaveCall(Promise<RowSet<Row>> promise, String query, OrderLineA
orderLineAuditEvent.getOrderId(),
orderLineAuditEvent.getOrderLineId(),
orderLineAuditEvent.getUserId(),
LocalDateTime.ofInstant(orderLineAuditEvent.getEventDate().toInstant(), ZoneOffset.UTC),
LocalDateTime.ofInstant(orderLineAuditEvent.getActionDate().toInstant(), ZoneOffset.UTC),
LocalDateTime.ofInstant(orderLineAuditEvent.getEventDate().toInstant(), ZoneId.systemDefault()),
LocalDateTime.ofInstant(orderLineAuditEvent.getActionDate().toInstant(), ZoneId.systemDefault()),
JsonObject.mapFrom(orderLineAuditEvent.getOrderLineSnapshot())), promise);
} catch (Exception e) {
LOGGER.error("Failed to save record with id: {} for order line id: {} in to table {}",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import static org.folio.util.DbUtils.formatDBTableName;

import java.time.LocalDateTime;
import java.time.ZoneId;
import java.time.ZoneOffset;
import java.util.Date;
import java.util.UUID;
Expand Down Expand Up @@ -142,8 +143,8 @@ private void makeSaveCall(Promise<RowSet<Row>> promise, String query, PieceAudit
pieceAuditEvent.getAction(),
pieceAuditEvent.getPieceId(),
pieceAuditEvent.getUserId(),
LocalDateTime.ofInstant(pieceAuditEvent.getEventDate().toInstant(), ZoneOffset.UTC),
LocalDateTime.ofInstant(pieceAuditEvent.getActionDate().toInstant(), ZoneOffset.UTC),
LocalDateTime.ofInstant(pieceAuditEvent.getEventDate().toInstant(), ZoneId.systemDefault()),
LocalDateTime.ofInstant(pieceAuditEvent.getActionDate().toInstant(), ZoneId.systemDefault()),
JsonObject.mapFrom(pieceAuditEvent.getPieceSnapshot())),
promise);
} catch (Exception e) {
Expand Down

0 comments on commit 1f00735

Please sign in to comment.