use of com.actionworks.flashsale.app.model.result.OrderTaskHandleResult in project flash-sale by ThoughtsBeta.
the class DefaultFlashOrderAppService method getPlaceOrderTaskResult.
@Override
public AppSimpleResult<OrderTaskHandleResult> getPlaceOrderTaskResult(Long userId, Long itemId, String placeOrderTaskId) {
if (userId == null || itemId == null || StringUtils.isEmpty(placeOrderTaskId)) {
throw new BizException(INVALID_PARAMS);
}
if (placeOrderService instanceof QueuedPlaceOrderService) {
QueuedPlaceOrderService queuedPlaceOrderService = (QueuedPlaceOrderService) placeOrderService;
OrderTaskHandleResult orderTaskHandleResult = queuedPlaceOrderService.getPlaceOrderResult(userId, itemId, placeOrderTaskId);
if (!orderTaskHandleResult.isSuccess()) {
return AppSimpleResult.failed(orderTaskHandleResult.getCode(), orderTaskHandleResult.getMessage(), orderTaskHandleResult);
}
return AppSimpleResult.ok(orderTaskHandleResult);
} else {
return AppSimpleResult.failed(ORDER_TYPE_NOT_SUPPORT);
}
}
Aggregations