Commit c84bbb49 authored by shiyu's avatar shiyu

成交详情

parent 977cc5d7
......@@ -19,12 +19,15 @@ public class PageSearchResult<T> implements Entity {
private Object appendObject;
private Boolean isHasNextPage;
public PageSearchResult(){};
private PageSearchResult(PageInfo<T> pageInfo) {
this.total = pageInfo.getTotal();
this.pageSize = pageInfo.getPageSize();
this.pageIndex = pageInfo.getPageNum();
this.isHasNextPage = pageInfo.isHasNextPage();
this.dataList = pageInfo.getList();
}
......@@ -33,6 +36,7 @@ public class PageSearchResult<T> implements Entity {
this.total = pageInfo.getTotal();
this.pageSize = pageInfo.getPageSize();
this.pageIndex = pageInfo.getPageNum();
this.isHasNextPage = pageInfo.isHasNextPage();
this.dataList = list;
}
......
......@@ -78,7 +78,7 @@ public class ItemDaoImpl implements ItemDao {
ItemExample example = new ItemExample();
ItemExample.Criteria criteria = example.createCriteria();
if (StringUtils.hasLength(coinRequestDto.getSortColumn())) {
example.setOrderByClause(coinRequestDto.getSortColumn() + " asc");
example.setOrderByClause(coinRequestDto.getSortColumn() + " " + coinRequestDto.getOrder());
} else {
example.setOrderByClause("create_time asc");
}
......
......@@ -18,6 +18,7 @@ import com.wwdz.ch.wx.entity.request.QueryPriceRequestDto;
import com.wwdz.ch.wx.entity.vo.BidRecordVo;
import com.wwdz.ch.wx.entity.vo.CategoryVo;
import com.wwdz.ch.wx.service.QueryPriceService;
import com.wwdz.ch.wx.util.StringUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -109,7 +110,10 @@ public class QueryPriceServiceImpl implements QueryPriceService {
List<Item> itemList = itemDao.findListByPage(dto);
PageInfo pageInfo = PageInfo.of(itemList);
List<Map<String, Object>> mapList = new ArrayList<>();
itemList.stream().forEach(i -> {
for (Item i : itemList) {
if (i.getPrice() == 0) {
continue;
}
Map<String, Object> map = new HashMap<>();
if (StringUtils.isEmpty(i.getVideos())){
map.put("hasVideo", false);
......@@ -118,7 +122,7 @@ public class QueryPriceServiceImpl implements QueryPriceService {
}
map.put("id", i.getId());
map.put("bidTime", i.getBidTime());
map.put("price", Math.round(i.getPrice() / (double) 100));
map.put("price", StringUtil.formatAmount(String.valueOf(Math.round(i.getPrice() / (double) 100))));
map.put("platform", "电商平台");
map.put("detail", i.getDetail());
if (StringUtils.hasLength(i.getTopImage())) {
......@@ -127,7 +131,7 @@ public class QueryPriceServiceImpl implements QueryPriceService {
map.put("image", StringUtils.isEmpty(i.getImages())?"":i.getImages().split(";")[0]);
}
mapList.add(map);
});
}
return Result.success(PageSearchResult.of(pageInfo, mapList));
} catch (Exception e) {
logger.info("成交记录查询失败:{}", e);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment