...
|
...
|
@@ -3,6 +3,7 @@ package com.yoho.ufo.order.service.impl; |
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
|
|
|
import org.apache.commons.collections.CollectionUtils;
|
|
|
import org.elasticsearch.common.collect.Lists;
|
|
|
import org.elasticsearch.common.collect.Maps;
|
|
|
import org.slf4j.Logger;
|
...
|
...
|
@@ -10,9 +11,14 @@ import org.slf4j.LoggerFactory; |
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import com.yoho.core.common.utils.DateUtil;
|
|
|
import com.yoho.order.dal.BuyerOrderMapper;
|
|
|
import com.yoho.order.model.BuyerOrder;
|
|
|
import com.yoho.ufo.order.constant.Constant;
|
|
|
import com.yoho.ufo.order.service.IBuyerOrderService;
|
|
|
import com.yohobuy.ufo.model.order.req.BuyerOrderListReq;
|
|
|
import com.yohobuy.ufo.model.order.resp.BuyerOrderResp;
|
|
|
import com.yohobuy.ufo.model.order.resp.PageResponseBO;
|
|
|
|
|
|
/**
|
|
|
* @author caoyan
|
...
|
...
|
@@ -43,5 +49,36 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService { |
|
|
|
|
|
return resultMap;
|
|
|
}
|
|
|
|
|
|
public PageResponseBO<BuyerOrderResp> queryOrderList(BuyerOrderListReq req) {
|
|
|
int total = buyerOrderMapper.selectTotalByCondition(req);
|
|
|
if(total == 0) {
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
List<BuyerOrder> orderList = buyerOrderMapper.selectByCondition(req);
|
|
|
if(CollectionUtils.isEmpty(orderList)) {
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
List<BuyerOrderResp> respList = Lists.newArrayList();
|
|
|
for(BuyerOrder item : orderList) {
|
|
|
BuyerOrderResp resp = new BuyerOrderResp();
|
|
|
resp.setOrderCode(item.getOrderCode());
|
|
|
resp.setStatus(item.getStatus());
|
|
|
resp.setCreateTimeStr(DateUtil.long2DateStr(item.getCreateTime()*1000, "yyyy-MM-dd HH:mm:ss"));
|
|
|
|
|
|
respList.add(resp);
|
|
|
}
|
|
|
|
|
|
PageResponseBO<BuyerOrderResp> result=new PageResponseBO<>();
|
|
|
result.setList(respList);
|
|
|
result.setPage(req.getPage());
|
|
|
result.setSize(req.getSize());
|
|
|
result.setTotal(total);
|
|
|
|
|
|
return result;
|
|
|
|
|
|
}
|
|
|
|
|
|
} |
...
|
...
|
|