Commit 9a830fa90a0325531acb2b93b8993b9ee0d443df
Merge remote-tracking branch 'origin/master'
Showing
3 changed files
with
5 additions
and
21 deletions
src/main/java/com/diligrp/xtrade/order/domain/builder/DefaultOrderCreator.java
... | ... | @@ -67,7 +67,7 @@ public class DefaultOrderCreator { |
67 | 67 | orderDo.setOrderType(OrderType.NORMAL.getCode()); |
68 | 68 | orderDo.setTradeType(TradeType.NORMAL.getCode()); |
69 | 69 | orderDo.setMarketCode("SYDEV"); |
70 | - this.setOrderDo(orderDo); | |
70 | + this.orderDo = orderDo; | |
71 | 71 | } |
72 | 72 | |
73 | 73 | /** |
... | ... | @@ -118,32 +118,16 @@ public class DefaultOrderCreator { |
118 | 118 | return items; |
119 | 119 | } |
120 | 120 | |
121 | - public void setItems(List<OrderItemDo> items) { | |
122 | - this.items = items; | |
123 | - } | |
124 | - | |
125 | 121 | public OrderDo getOrderDo() { |
126 | 122 | return orderDo; |
127 | 123 | } |
128 | 124 | |
129 | - public void setOrderDo(OrderDo orderDo) { | |
130 | - this.orderDo = orderDo; | |
131 | - } | |
132 | - | |
133 | 125 | public AccountDto getSaccountDto() { |
134 | 126 | return saccountDto; |
135 | 127 | } |
136 | 128 | |
137 | - public void setSaccountDto(AccountDto saccountDto) { | |
138 | - this.saccountDto = saccountDto; | |
139 | - } | |
140 | - | |
141 | 129 | public OrderCreateRequestDto getOrderCreateDto() { |
142 | 130 | return orderCreateDto; |
143 | 131 | } |
144 | 132 | |
145 | - public void setOrderCreateDto(OrderCreateRequestDto orderCreateDto) { | |
146 | - this.orderCreateDto = orderCreateDto; | |
147 | - } | |
148 | - | |
149 | 133 | } | ... | ... |
src/main/java/com/diligrp/xtrade/order/service/impl/OrderServiceImpl.java
1 | 1 | package com.diligrp.xtrade.order.service.impl; |
2 | 2 | |
3 | -import java.math.BigDecimal; | |
4 | 3 | import java.util.ArrayList; |
5 | 4 | import java.util.List; |
6 | 5 | |
... | ... | @@ -20,7 +19,6 @@ import com.diligrp.xtrade.order.domain.dto.OrderQueryRequestDto; |
20 | 19 | import com.diligrp.xtrade.order.domain.dto.OrderQueryResponseDto; |
21 | 20 | import com.diligrp.xtrade.order.domain.emuns.IdGenerator; |
22 | 21 | import com.diligrp.xtrade.order.domain.entity.OrderDo; |
23 | -import com.diligrp.xtrade.order.domain.entity.OrderItemDo; | |
24 | 22 | import com.diligrp.xtrade.order.rpc.feign.AccountResolver; |
25 | 23 | import com.diligrp.xtrade.order.service.OrderService; |
26 | 24 | import com.diligrp.xtrade.shared.sequence.KeyGeneratorManager; |
... | ... | @@ -45,8 +43,10 @@ public class OrderServiceImpl implements OrderService { |
45 | 43 | @Transactional(rollbackFor = Exception.class) |
46 | 44 | public void createOrder(OrderCreateRequestDto orderCreateDto) { |
47 | 45 | |
46 | + //获取相关信息 | |
48 | 47 | AccountDto saccountDto = accountResolver.getAccount(orderCreateDto.getSaccount()); |
49 | 48 | |
49 | + //构建订单创建者 | |
50 | 50 | DefaultOrderCreator orderCreator = DefaultOrderCreator.builder(saccountDto, orderCreateDto, getOrderKey()); |
51 | 51 | |
52 | 52 | //初始化订单基本信息 |
... | ... | @@ -57,8 +57,10 @@ public class OrderServiceImpl implements OrderService { |
57 | 57 | orderCreator.initializeItemData(getOrderItemKey(), orderItemDto); |
58 | 58 | } |
59 | 59 | |
60 | + //批量插入订单详情 | |
60 | 61 | orderItemDao.insertBatch(orderCreator.createOrderItems()); |
61 | 62 | |
63 | + //插入订单信息 | |
62 | 64 | orderDao.insertEntity(orderCreator.createOrder()); |
63 | 65 | } |
64 | 66 | ... | ... |
src/main/java/com/diligrp/xtrade/product/controllor/CategoryController.java
... | ... | @@ -3,9 +3,7 @@ package com.diligrp.xtrade.product.controllor; |
3 | 3 | import java.util.List; |
4 | 4 | |
5 | 5 | import org.springframework.beans.factory.annotation.Autowired; |
6 | -import org.springframework.validation.annotation.Validated; | |
7 | 6 | import org.springframework.web.bind.annotation.PathVariable; |
8 | -import org.springframework.web.bind.annotation.RequestBody; | |
9 | 7 | import org.springframework.web.bind.annotation.RequestMapping; |
10 | 8 | import org.springframework.web.bind.annotation.RestController; |
11 | 9 | ... | ... |