Commit a3e91f2e6029fe4db04dea38abf0b206c8d31716
1 parent
e3969a5b
订单基础方法 随后根据需要修改
Showing
2 changed files
with
18 additions
and
6 deletions
src/main/java/com/diligrp/xtrade/order/controllor/OrderApiController.java
@@ -50,6 +50,6 @@ public class OrderApiController { | @@ -50,6 +50,6 @@ public class OrderApiController { | ||
50 | */ | 50 | */ |
51 | @RequestMapping(value = "/orderDetail") | 51 | @RequestMapping(value = "/orderDetail") |
52 | public Message<OrderQueryResponseDto> orderDetail(@RequestBody @Validated OrderQueryRequestDto orderQueryRequestDto) { | 52 | public Message<OrderQueryResponseDto> orderDetail(@RequestBody @Validated OrderQueryRequestDto orderQueryRequestDto) { |
53 | - return Message.builder().success(orderservice.orderDetail(orderQueryRequestDto)); | 53 | + return Message.builder().success(orderservice.orderDetail(orderQueryRequestDto.getOrderId())); |
54 | } | 54 | } |
55 | } | 55 | } |
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.util.ArrayList; | ||
3 | import java.util.List; | 4 | import java.util.List; |
4 | 5 | ||
5 | import javax.annotation.Resource; | 6 | import javax.annotation.Resource; |
@@ -20,9 +21,11 @@ import com.diligrp.xtrade.shared.sequence.KeyGeneratorManager; | @@ -20,9 +21,11 @@ import com.diligrp.xtrade.shared.sequence.KeyGeneratorManager; | ||
20 | @Service("orderService") | 21 | @Service("orderService") |
21 | public class OrderServiceImpl implements OrderService { | 22 | public class OrderServiceImpl implements OrderService { |
22 | 23 | ||
23 | - @Resource private OrderDao orderDao; | 24 | + @Resource |
25 | + private OrderDao orderDao; | ||
24 | 26 | ||
25 | - @Resource KeyGeneratorManager keyGeneratorManager; | 27 | + @Resource |
28 | + KeyGeneratorManager keyGeneratorManager; | ||
26 | 29 | ||
27 | @Override | 30 | @Override |
28 | public void createOrder(OrderCreateRequestDto orderCreateRequestDto) { | 31 | public void createOrder(OrderCreateRequestDto orderCreateRequestDto) { |
@@ -33,12 +36,21 @@ public class OrderServiceImpl implements OrderService { | @@ -33,12 +36,21 @@ public class OrderServiceImpl implements OrderService { | ||
33 | 36 | ||
34 | @Override | 37 | @Override |
35 | public List<OrderQueryResponseDto> orderLists(OrderQueryRequestDto orderQueryRequestDto) { | 38 | public List<OrderQueryResponseDto> orderLists(OrderQueryRequestDto orderQueryRequestDto) { |
36 | - return null; | 39 | + OrderDo order = new OrderDo(); |
40 | + BeanUtils.copyProperties(orderQueryRequestDto, order); | ||
41 | + List<OrderDo> orderDos = orderDao.selectEntryList(order); | ||
42 | + List<OrderQueryResponseDto> roResponseDtos = new ArrayList<OrderQueryResponseDto>(); | ||
43 | + for (OrderDo orderDo : orderDos) { | ||
44 | + OrderQueryResponseDto orderQueryResponseDto = new OrderQueryResponseDto(); | ||
45 | + BeanUtils.copyProperties(orderDo, orderQueryResponseDto); | ||
46 | + roResponseDtos.add(orderQueryResponseDto); | ||
47 | + } | ||
48 | + return roResponseDtos; | ||
37 | } | 49 | } |
38 | 50 | ||
39 | @Override | 51 | @Override |
40 | - public OrderQueryResponseDto orderDetail(OrderQueryRequestDto orderQueryRequestDto) { | ||
41 | - OrderDo order = orderDao.selectEntityByOrderId(orderQueryRequestDto.getOrderId()); | 52 | + public OrderQueryResponseDto orderDetail(Long orderId) { |
53 | + OrderDo order = orderDao.selectEntityByOrderId(orderId); | ||
42 | OrderQueryResponseDto queryResponseDto = new OrderQueryResponseDto(); | 54 | OrderQueryResponseDto queryResponseDto = new OrderQueryResponseDto(); |
43 | BeanUtils.copyProperties(order, queryResponseDto); | 55 | BeanUtils.copyProperties(order, queryResponseDto); |
44 | return queryResponseDto; | 56 | return queryResponseDto; |