Commit 255f2d8cbfa82197e92c446d9aac3f60b482c8c4

Authored by zhangxing
1 parent 5acfd68a

modify builder name

src/main/java/com/diligrp/xtrade/order/domain/builder/OrderResponseBuilder.java renamed to src/main/java/com/diligrp/xtrade/order/domain/builder/OrderDataBuilder.java
@@ -13,7 +13,7 @@ import com.diligrp.xtrade.order.domain.entity.OrderItemDo; @@ -13,7 +13,7 @@ import com.diligrp.xtrade.order.domain.entity.OrderItemDo;
13 * @author zhangxing 13 * @author zhangxing
14 * @date 2020年4月22日 14 * @date 2020年4月22日
15 */ 15 */
16 -public class OrderResponseBuilder { 16 +public class OrderDataBuilder {
17 17
18 /** 18 /**
19 * 构建基本的订单详情数据 TODO need modify because of change 19 * 构建基本的订单详情数据 TODO need modify because of change
src/main/java/com/diligrp/xtrade/order/service/impl/OrderServiceImpl.java
@@ -12,7 +12,7 @@ import org.springframework.transaction.annotation.Transactional; @@ -12,7 +12,7 @@ import org.springframework.transaction.annotation.Transactional;
12 import com.diligrp.xtrade.order.dao.OrderDao; 12 import com.diligrp.xtrade.order.dao.OrderDao;
13 import com.diligrp.xtrade.order.dao.OrderItemDao; 13 import com.diligrp.xtrade.order.dao.OrderItemDao;
14 import com.diligrp.xtrade.order.domain.builder.DefaultOrderCreator; 14 import com.diligrp.xtrade.order.domain.builder.DefaultOrderCreator;
15 -import com.diligrp.xtrade.order.domain.builder.OrderResponseBuilder; 15 +import com.diligrp.xtrade.order.domain.builder.OrderDataBuilder;
16 import com.diligrp.xtrade.order.domain.dto.AccountDto; 16 import com.diligrp.xtrade.order.domain.dto.AccountDto;
17 import com.diligrp.xtrade.order.domain.dto.OrderCreateRequestDto; 17 import com.diligrp.xtrade.order.domain.dto.OrderCreateRequestDto;
18 import com.diligrp.xtrade.order.domain.dto.OrderItemDto; 18 import com.diligrp.xtrade.order.domain.dto.OrderItemDto;
@@ -44,13 +44,13 @@ public class OrderServiceImpl implements OrderService { @@ -44,13 +44,13 @@ public class OrderServiceImpl implements OrderService {
44 @Transactional(rollbackFor = Exception.class) 44 @Transactional(rollbackFor = Exception.class)
45 public void createOrder(OrderCreateRequestDto orderCreateDto) { 45 public void createOrder(OrderCreateRequestDto orderCreateDto) {
46 46
47 - //获取相关信息 47 + // 获取相关信息
48 AccountDto saccountDto = accountResolver.getAccount(orderCreateDto.getSaccount()); 48 AccountDto saccountDto = accountResolver.getAccount(orderCreateDto.getSaccount());
49 49
50 - //构建订单创建者 50 + // 构建订单创建者
51 DefaultOrderCreator orderCreator = DefaultOrderCreator.builder(saccountDto, orderCreateDto, getOrderKey()); 51 DefaultOrderCreator orderCreator = DefaultOrderCreator.builder(saccountDto, orderCreateDto, getOrderKey());
52 52
53 - //初始化订单基本信息 53 + // 初始化订单基本信息
54 orderCreator.initializeOrderBaseData(); 54 orderCreator.initializeOrderBaseData();
55 55
56 // 订单详情数据封装 56 // 订单详情数据封装
@@ -58,10 +58,10 @@ public class OrderServiceImpl implements OrderService { @@ -58,10 +58,10 @@ public class OrderServiceImpl implements OrderService {
58 orderCreator.initializeItemData(getOrderItemKey(), orderItemDto); 58 orderCreator.initializeItemData(getOrderItemKey(), orderItemDto);
59 } 59 }
60 60
61 - //批量插入订单详情 61 + // 批量插入订单详情
62 orderItemDao.insertBatch(orderCreator.createOrderItems()); 62 orderItemDao.insertBatch(orderCreator.createOrderItems());
63 63
64 - //插入订单信息 64 + // 插入订单信息
65 orderDao.insertEntity(orderCreator.createOrder()); 65 orderDao.insertEntity(orderCreator.createOrder());
66 } 66 }
67 67
@@ -83,7 +83,7 @@ public class OrderServiceImpl implements OrderService { @@ -83,7 +83,7 @@ public class OrderServiceImpl implements OrderService {
83 // TODO need modify because of change 83 // TODO need modify because of change
84 @Override 84 @Override
85 public OrderQueryResponseDto orderDetail(Long orderId) { 85 public OrderQueryResponseDto orderDetail(Long orderId) {
86 - OrderQueryResponseDto orderQueryResponseDto = OrderResponseBuilder 86 + OrderQueryResponseDto orderQueryResponseDto = OrderDataBuilder
87 .buildOrderDetail(orderDao.selectEntityByOrderId(orderId), orderItemDao.selectItemsByOrderId(orderId)); 87 .buildOrderDetail(orderDao.selectEntityByOrderId(orderId), orderItemDao.selectItemsByOrderId(orderId));
88 return orderQueryResponseDto; 88 return orderQueryResponseDto;
89 } 89 }