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 | 50 | */ |
51 | 51 | @RequestMapping(value = "/orderDetail") |
52 | 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 | 1 | package com.diligrp.xtrade.order.service.impl; |
2 | 2 | |
3 | +import java.util.ArrayList; | |
3 | 4 | import java.util.List; |
4 | 5 | |
5 | 6 | import javax.annotation.Resource; |
... | ... | @@ -20,9 +21,11 @@ import com.diligrp.xtrade.shared.sequence.KeyGeneratorManager; |
20 | 21 | @Service("orderService") |
21 | 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 | 30 | @Override |
28 | 31 | public void createOrder(OrderCreateRequestDto orderCreateRequestDto) { |
... | ... | @@ -33,12 +36,21 @@ public class OrderServiceImpl implements OrderService { |
33 | 36 | |
34 | 37 | @Override |
35 | 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 | 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 | 54 | OrderQueryResponseDto queryResponseDto = new OrderQueryResponseDto(); |
43 | 55 | BeanUtils.copyProperties(order, queryResponseDto); |
44 | 56 | return queryResponseDto; | ... | ... |