Commit 7c1770295d3b7519aead5b7f8bf01604580d6b0f

Authored by miaoguoxin
2 parents 589fb3fa 4948df24

Merge remote-tracking branch 'origin/master'

src/main/java/com/diligrp/xtrade/order/domain/dto/OrderQueryResponseDto.java
@@ -82,6 +82,9 @@ public class OrderQueryResponseDto { @@ -82,6 +82,9 @@ public class OrderQueryResponseDto {
82 //支付时间 82 //支付时间
83 private LocalDateTime payTime; 83 private LocalDateTime payTime;
84 84
  85 + //创建时间
  86 + private LocalDateTime createdTime;
  87 +
85 //订单详情 88 //订单详情
86 private List<OrderItemDto> items = new ArrayList<OrderItemDto>(); 89 private List<OrderItemDto> items = new ArrayList<OrderItemDto>();
87 90
@@ -280,5 +283,13 @@ public class OrderQueryResponseDto { @@ -280,5 +283,13 @@ public class OrderQueryResponseDto {
280 public void setOrderType(Integer orderType) { 283 public void setOrderType(Integer orderType) {
281 this.orderType = orderType; 284 this.orderType = orderType;
282 } 285 }
  286 +
  287 + public LocalDateTime getCreatedTime() {
  288 + return createdTime;
  289 + }
  290 +
  291 + public void setCreatedTime(LocalDateTime createdTime) {
  292 + this.createdTime = createdTime;
  293 + }
283 294
284 } 295 }
src/main/java/com/diligrp/xtrade/order/service/OrderService.java
1 package com.diligrp.xtrade.order.service; 1 package com.diligrp.xtrade.order.service;
2 2
3 -import java.util.List;  
4 -  
5 import com.diligrp.xtrade.order.domain.dto.OrderCreateRequestDto; 3 import com.diligrp.xtrade.order.domain.dto.OrderCreateRequestDto;
6 import com.diligrp.xtrade.order.domain.dto.OrderQueryRequestDto; 4 import com.diligrp.xtrade.order.domain.dto.OrderQueryRequestDto;
7 import com.diligrp.xtrade.order.domain.dto.OrderQueryResponseDto; 5 import com.diligrp.xtrade.order.domain.dto.OrderQueryResponseDto;
  6 +import com.diligrp.xtrade.shared.domain.Page;
8 7
9 /** 8 /**
10 * 9 *
@@ -25,7 +24,7 @@ public interface OrderService { @@ -25,7 +24,7 @@ public interface OrderService {
25 * @Title orderLists 24 * @Title orderLists
26 * @Description 获取订单列表 25 * @Description 获取订单列表
27 */ 26 */
28 - List<OrderQueryResponseDto> orderLists(OrderQueryRequestDto orderQueryRequestDto); 27 + Page<OrderQueryResponseDto> orderLists(OrderQueryRequestDto orderQueryRequestDto);
29 28
30 /** 29 /**
31 * @Title orderDetail 30 * @Title orderDetail
src/main/java/com/diligrp/xtrade/order/service/impl/OrderServiceImpl.java
@@ -22,6 +22,7 @@ import com.diligrp.xtrade.order.domain.emuns.IdGenerator; @@ -22,6 +22,7 @@ import com.diligrp.xtrade.order.domain.emuns.IdGenerator;
22 import com.diligrp.xtrade.order.domain.entity.OrderDo; 22 import com.diligrp.xtrade.order.domain.entity.OrderDo;
23 import com.diligrp.xtrade.order.rpc.feign.AccountResolver; 23 import com.diligrp.xtrade.order.rpc.feign.AccountResolver;
24 import com.diligrp.xtrade.order.service.OrderService; 24 import com.diligrp.xtrade.order.service.OrderService;
  25 +import com.diligrp.xtrade.shared.domain.Page;
25 import com.diligrp.xtrade.shared.sequence.KeyGeneratorManager; 26 import com.diligrp.xtrade.shared.sequence.KeyGeneratorManager;
26 27
27 @Service("orderService") 28 @Service("orderService")
@@ -67,17 +68,23 @@ public class OrderServiceImpl implements OrderService { @@ -67,17 +68,23 @@ public class OrderServiceImpl implements OrderService {
67 68
68 // TODO need modify because of change 69 // TODO need modify because of change
69 @Override 70 @Override
70 - public List<OrderQueryResponseDto> orderLists(OrderQueryRequestDto orderQueryRequestDto) { 71 + public Page<OrderQueryResponseDto> orderLists(OrderQueryRequestDto orderQueryRequestDto) {
  72 + Page<OrderQueryResponseDto> orderPage = new Page<OrderQueryResponseDto>();
  73 + List<OrderQueryResponseDto> roResponseDtos = new ArrayList<OrderQueryResponseDto>();
  74 + orderPage.setData(roResponseDtos);
71 OrderDo order = new OrderDo(); 75 OrderDo order = new OrderDo();
72 BeanUtils.copyProperties(orderQueryRequestDto, order); 76 BeanUtils.copyProperties(orderQueryRequestDto, order);
  77 + int total = orderDao.selectEntryListCount(order);
  78 + if (total == 0) {
  79 + return orderPage;
  80 + }
73 List<OrderDo> orderDos = orderDao.selectEntryList(order); 81 List<OrderDo> orderDos = orderDao.selectEntryList(order);
74 - List<OrderQueryResponseDto> roResponseDtos = new ArrayList<OrderQueryResponseDto>();  
75 for (OrderDo orderDo : orderDos) { 82 for (OrderDo orderDo : orderDos) {
76 OrderQueryResponseDto orderQueryResponseDto = new OrderQueryResponseDto(); 83 OrderQueryResponseDto orderQueryResponseDto = new OrderQueryResponseDto();
77 BeanUtils.copyProperties(orderDo, orderQueryResponseDto); 84 BeanUtils.copyProperties(orderDo, orderQueryResponseDto);
78 roResponseDtos.add(orderQueryResponseDto); 85 roResponseDtos.add(orderQueryResponseDto);
79 } 86 }
80 - return roResponseDtos; 87 + return orderPage;
81 } 88 }
82 89
83 // TODO need modify because of change 90 // TODO need modify because of change