Commit e144b9a7671acef9b9c6d937fef509aebb0e7e0b

Authored by zhangxing
1 parent 26e8940c

去掉set操作 不允许set

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