Commit d7415b50918ec0ffaa7de8a5ac0d42cb6f52f7b9

Authored by zhangxing
1 parent 0371f735

细节调整

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