Commit 699e884ea10fdd8909c63fc4dff18aba5f4cc358
1 parent
e12eecdc
[代码优化]
Showing
2 changed files
with
11 additions
and
2 deletions
src/main/java/com/diligrp/xtrade/order/domain/builder/DefaultOrderCreator.java
@@ -44,6 +44,14 @@ public class DefaultOrderCreator { | @@ -44,6 +44,14 @@ public class DefaultOrderCreator { | ||
44 | orderCreateDto.setOrderId(orderId); | 44 | orderCreateDto.setOrderId(orderId); |
45 | return new DefaultOrderCreator(saccountDto, orderCreateDto); | 45 | return new DefaultOrderCreator(saccountDto, orderCreateDto); |
46 | } | 46 | } |
47 | + | ||
48 | + public OrderDo createOrder() { | ||
49 | + return getOrderDo(); | ||
50 | + } | ||
51 | + | ||
52 | + public List<OrderItemDo> createOrderItems() { | ||
53 | + return getItems(); | ||
54 | + } | ||
47 | 55 | ||
48 | /** | 56 | /** |
49 | * 构建初始订单数据 TODO need modify because of change | 57 | * 构建初始订单数据 TODO need modify because of change |
src/main/java/com/diligrp/xtrade/order/service/impl/OrderServiceImpl.java
@@ -49,6 +49,7 @@ public class OrderServiceImpl implements OrderService { | @@ -49,6 +49,7 @@ public class OrderServiceImpl implements OrderService { | ||
49 | 49 | ||
50 | DefaultOrderCreator orderCreator = DefaultOrderCreator.builder(saccountDto, orderCreateDto, getOrderKey()); | 50 | DefaultOrderCreator orderCreator = DefaultOrderCreator.builder(saccountDto, orderCreateDto, getOrderKey()); |
51 | 51 | ||
52 | + //初始化订单基本信息 | ||
52 | orderCreator.initializeOrderBaseData(); | 53 | orderCreator.initializeOrderBaseData(); |
53 | 54 | ||
54 | for (OrderItemDto orderItemDto : orderCreateDto.getItems()) { | 55 | for (OrderItemDto orderItemDto : orderCreateDto.getItems()) { |
@@ -56,9 +57,9 @@ public class OrderServiceImpl implements OrderService { | @@ -56,9 +57,9 @@ public class OrderServiceImpl implements OrderService { | ||
56 | orderCreator.initializeItemData(getOrderItemKey(), orderItemDto); | 57 | orderCreator.initializeItemData(getOrderItemKey(), orderItemDto); |
57 | } | 58 | } |
58 | 59 | ||
59 | - orderItemDao.insertBatch(orderCreator.getItems()); | 60 | + orderItemDao.insertBatch(orderCreator.createOrderItems()); |
60 | 61 | ||
61 | - orderDao.insertEntity(orderCreator.getOrderDo()); | 62 | + orderDao.insertEntity(orderCreator.createOrder()); |
62 | } | 63 | } |
63 | 64 | ||
64 | // TODO need modify because of change | 65 | // TODO need modify because of change |