Date format different for two calls using Orika mapper
Asked Answered
A

0

1

I am getting different date formats for two web-service calls using same mapper.

By mapper I mean, map:162, ConfigurableMapper (ma.glasnost.orika.impl)


The OTB call to get orders i.e. OrdersController#getOrderForUserByCode() is showing the date as "date": "2018-12-22T20:42:31+0000".

My custom call to get orders i.e. IndReportController#createAdvancedOrderSearchReport() is showing the same date as "date": 1545511351000

I am using the same code as OTB to print OrderWsDTO i.e.
getDataMapper().map(orderData, OrderWsDTO.class, fields).

Interestingly, the stack trace of both the calls are also same.

Stacktrace:

setDate:186, PaymentTransactionEntryWsDTO (de.hybris.platform.commercewebservicescommons.dto.order)
mapAtoB:-1, Orika_PaymentTransactionEntryWsDTO_PaymentTransactionEntryData_Mapper103355414120758$116 (ma.glasnost.orika.generated)
map:77, UseCustomMapperStrategy (ma.glasnost.orika.impl.mapping.strategy)
map:254, MapperFacadeImpl (ma.glasnost.orika.impl)
mapElement:797, MapperFacadeImpl (ma.glasnost.orika.impl)
mapAsCollection:621, MapperFacadeImpl (ma.glasnost.orika.impl)
mapAsList:427, MapperFacadeImpl (ma.glasnost.orika.impl)
mapAtoB:-1, Orika_PaymentTransactionWsDTO_PaymentTransactionData_Mapper103354376799488$70 (ma.glasnost.orika.generated)
map:77, UseCustomMapperStrategy (ma.glasnost.orika.impl.mapping.strategy)
map:254, MapperFacadeImpl (ma.glasnost.orika.impl)
mapElement:797, MapperFacadeImpl (ma.glasnost.orika.impl)
mapAsCollection:621, MapperFacadeImpl (ma.glasnost.orika.impl)
mapAsList:427, MapperFacadeImpl (ma.glasnost.orika.impl)
mapAtoB:-1, Orika_OrderWsDTO_OrderData_Mapper103352769949289$41 (ma.glasnost.orika.generated)
map:77, UseCustomMapperStrategy (ma.glasnost.orika.impl.mapping.strategy)
map:671, MapperFacadeImpl (ma.glasnost.orika.impl)
map:162, ConfigurableMapper (ma.glasnost.orika.impl)
map:211, DefaultDataMapper (de.hybris.platform.webservicescommons.mapping.impl)
getOrder:100, OrdersController (com.myproject.core.v2.controller)

Please suggest how can I get the OTB date format in my custom call.

Andalusite answered 13/3, 2019 at 6:48 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.