Date format different for two calls using Orika mapper

假如想象 提交于 2019-12-11 08:18:04

问题


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.

来源:https://stackoverflow.com/questions/55135936/date-format-different-for-two-calls-using-orika-mapper

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!