Commit a15af830 authored by hanfeng's avatar hanfeng

修改官网旅游路线

parent 6dde545c
......@@ -372,26 +372,30 @@ public class TourGoodBiz extends BaseBiz<TourGoodMapper, TourGood> {
if (CollectionUtils.isEmpty(query.getTagIds())) {
setQueryTagIds(query);
}
List<TourGood> list = mapper.getList(query);
List<GoodDataVO> list = mapper.getList(query);
return handleResultList(list, query);
}
private List handleResultList(List<TourGood> list, WebsiteQuery query) {
private List handleResultList(List<GoodDataVO> list, WebsiteQuery query) {
int size=0;
if (list != null) {
size = list.size();
}
if (size!= query.getLimit()) {
List<Integer> ids = list.parallelStream().map(TourGood::getId).collect(Collectors.toList());
List<Integer> ids = list.parallelStream().map(GoodDataVO::getId).collect(Collectors.toList());
Example example =new Example(TourGood.class);
example.createCriteria().andNotIn("id",ids).andEqualTo("status",1).andEqualTo("isDel",0);
example.orderBy("rank").asc().orderBy("crtTime").desc();
PageHelper.startPage(1,query.getLimit()-size);
List<TourGood> tourGoods = mapper.selectByExample(example);
list.addAll(tourGoods);
for (TourGood tourGood : tourGoods) {
GoodDataVO goodDataVO = new GoodDataVO();
goodDataVO.setId(tourGood.getId());
goodDataVO.setName(tourGood.getName());
goodDataVO.setImgUrl(tourGood.getCover());
goodDataVO.setPrice(tourGood.getPrice().toString());
}
}
return list;
}
......
......@@ -38,7 +38,7 @@ public interface TourGoodMapper extends Mapper<TourGood> {
*/
List<GoodDataVO> findAllByHome(@Param("start") Integer start, @Param("size") Integer size);
List<TourGood> getList(WebsiteQuery query);
List<GoodDataVO> getList(WebsiteQuery query);
List newTour(Integer limit);
}
......@@ -123,7 +123,7 @@
ORDER BY g.rank DESC ,g.id DESC
</select>
<select id="getList" resultType="com.xxfc.platform.tour.entity.TourGood">
<select id="getList" resultType="com.github.wxiaoqi.security.common.vo.GoodDataVO">
SELECT
g.id AS `id`,
g. NAME AS `name`,
......
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