use of com.stardata.starshop2.ordercontext.command.domain.order.Order in project starshop by beautautumn.
the class OrderAppService method autoConfirm.
public void autoConfirm() {
List<Order> orders = managingService.getConfirmExpired();
for (Order order : orders) {
managingService.closeOrder(order);
OrderClosedEvent orderEvent = new OrderClosedEvent(order);
orderEventPublisher.publish(orderEvent);
}
}
use of com.stardata.starshop2.ordercontext.command.domain.order.Order in project starshop by beautautumn.
the class OrderAppService method create.
public OrderResponse create(SessionUser loginUser, Long shopId, OrderSubmitRequest request) {
Order order = request.toOrder(loginUser.getId(), shopId);
managingService.submitOrder(LongIdentity.from(loginUser.getId()), order);
return OrderResponse.from(order);
}
use of com.stardata.starshop2.ordercontext.command.domain.order.Order in project starshop by beautautumn.
the class OrderAppService method handleWxPayNotify.
public String handleWxPayNotify(OrderPayResultRequest request) {
try {
WxPayResult wxPayResult = request.toWxPayResult();
Order order = managingService.makeOrderEffectively(wxPayResult);
OrderPaidEvent orderEvent = new OrderPaidEvent(order);
orderEventPublisher.publish(orderEvent);
return WxPayNotifyResponse.success("成功");
} catch (Exception e) {
return WxPayNotifyResponse.fail(e.getMessage());
}
}
use of com.stardata.starshop2.ordercontext.command.domain.order.Order in project starshop by beautautumn.
the class OrderManagingService method getConfirmExpired.
public List<Order> getConfirmExpired() {
BizParameter parameter = parameterRepository.instanceOf("max_minutes_remain_toconfirm");
int maxMinutes = parameter.toInteger();
return orderRepository.findConfirmExpired(maxMinutes);
}
use of com.stardata.starshop2.ordercontext.command.domain.order.Order in project starshop by beautautumn.
the class OrderManagingService method getPayExpired.
public List<Order> getPayExpired() {
BizParameter parameter = parameterRepository.instanceOf("max_minutes_remain_topay");
int maxMinutes = parameter.toInteger();
return orderRepository.findPayExpired(maxMinutes);
}
Aggregations