|
@@ -145,10 +145,10 @@ public class WechatTourismIndexController {
|
|
|
filter.setIsHotspot(1);
|
|
|
|
|
|
MyOrderParam myOrderParam = new MyOrderParam();
|
|
|
- new MyOrderParam.OrderInfo("createTime",false, null);
|
|
|
- new MyOrderParam.OrderInfo("likeCount",false, null);
|
|
|
+ myOrderParam.add(new MyOrderParam.OrderInfo("createTime",false, null));
|
|
|
+ myOrderParam.add(new MyOrderParam.OrderInfo("likeCount",false, null));
|
|
|
|
|
|
- String orderBy = MyOrderParam.buildOrderBy(myOrderParam, DirectoryInfo.class);
|
|
|
+ String orderBy = MyOrderParam.buildOrderBy(myOrderParam, TourismProject.class);
|
|
|
List<TourismProject> list = tourismProjectService.getTourismProjectList(filter, orderBy);
|
|
|
|
|
|
List<IndexHotDestinationVo> dataList = MyModelUtil.copyCollectionTo(list, IndexHotDestinationVo.class);
|
|
@@ -156,12 +156,8 @@ public class WechatTourismIndexController {
|
|
|
dataList.forEach(o->{
|
|
|
List<String> strings = UrlConvertUtils.urlConvert(applicationConfig.getHostIpPort(), o.getHomeHotPicture());
|
|
|
o.setHomeHotPicturesAfterConvert(strings);
|
|
|
- DirectoryInfo filter1 = new DirectoryInfo();
|
|
|
- filter1.setEnable(1);
|
|
|
- filter1.setDataState(1);
|
|
|
- filter1.setId(o.getBelongTab());
|
|
|
- List<DirectoryInfo> list1 = directoryInfoService.getDirectoryInfoList(filter1, null);
|
|
|
- o.setMenuName(list1.get(0).getMenuName());
|
|
|
+ DirectoryInfo info = directoryInfoService.getById(o.getBelongTab());
|
|
|
+ o.setMenuName(info.getMenuName());
|
|
|
});
|
|
|
|
|
|
return ResponseResult.success(dataList.stream().limit(3).collect(Collectors.toList()));
|
|
@@ -173,19 +169,26 @@ public class WechatTourismIndexController {
|
|
|
* @return 应答结果对象。
|
|
|
*/
|
|
|
@GetMapping("/queryIndexWinnowDestination")
|
|
|
- public ResponseResult<DirectoryInfoVo> queryIndexWinnowDestination() {
|
|
|
+ public ResponseResult<IndexHotDestinationVo> queryIndexWinnowDestination() {
|
|
|
|
|
|
- DirectoryInfo filter = new DirectoryInfo();
|
|
|
+ TourismProject filter = new TourismProject();
|
|
|
filter.setDataState(1);
|
|
|
filter.setEnable(1);
|
|
|
+ filter.setIsWinnowDestination(1);
|
|
|
|
|
|
- DirectoryInfo info = directoryInfoService.getDirectoryInfoList(filter, "").get(0);
|
|
|
- DirectoryInfoVo vo = MyModelUtil.copyTo(info, DirectoryInfoVo.class);
|
|
|
+ List<TourismProject> list = tourismProjectService.getTourismProjectList(filter, "tour_tourism_project.like_count");
|
|
|
|
|
|
- List<String> strings = UrlConvertUtils.urlConvert(applicationConfig.getHostIpPort(), vo.getHotPictureUrl());
|
|
|
- vo.setHotPictureUrlsAfterConvert(strings);
|
|
|
+ List<IndexHotDestinationVo> dataList = MyModelUtil.copyCollectionTo(list, IndexHotDestinationVo.class);
|
|
|
|
|
|
- return ResponseResult.success(vo);
|
|
|
+ IndexHotDestinationVo vo = null;
|
|
|
+ if (dataList!=null && !dataList.isEmpty()){
|
|
|
+ vo = dataList.get(0);
|
|
|
+ List<String> strings = UrlConvertUtils.urlConvert(applicationConfig.getHostIpPort(), vo.getHomeHotPicture());
|
|
|
+ vo.setHomeHotPicturesAfterConvert(strings);
|
|
|
+ DirectoryInfo menu = directoryInfoService.getById(vo.getBelongTab());
|
|
|
+ vo.setMenuName(menu.getMenuName());
|
|
|
+ }
|
|
|
+ return ResponseResult.success(vo);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -201,9 +204,9 @@ public class WechatTourismIndexController {
|
|
|
filter.setIsHotspot(1);
|
|
|
|
|
|
MyOrderParam myOrderParam = new MyOrderParam();
|
|
|
- new MyOrderParam.OrderInfo("recommendationRate",true, null);
|
|
|
- new MyOrderParam.OrderInfo("pageViewCount",true, null);
|
|
|
- new MyOrderParam.OrderInfo("likeCount",true, null);
|
|
|
+ myOrderParam.add(new MyOrderParam.OrderInfo("recommendationRate",true, null));
|
|
|
+ myOrderParam.add(new MyOrderParam.OrderInfo("pageViewCount",true, null));
|
|
|
+ myOrderParam.add(new MyOrderParam.OrderInfo("likeCount",true, null));
|
|
|
String orderBy = MyOrderParam.buildOrderBy(myOrderParam, TourismProject.class);
|
|
|
|
|
|
System.out.println(orderBy);
|
|
@@ -283,9 +286,9 @@ public class WechatTourismIndexController {
|
|
|
filter.setDataState(1);
|
|
|
|
|
|
MyOrderParam myOrderParam = new MyOrderParam();
|
|
|
- new MyOrderParam.OrderInfo("recommendationRate",true, null);
|
|
|
- new MyOrderParam.OrderInfo("pageViewCount",true, null);
|
|
|
- new MyOrderParam.OrderInfo("likeCount",true, null);
|
|
|
+ myOrderParam.add(new MyOrderParam.OrderInfo("recommendationRate",true, null));
|
|
|
+ myOrderParam.add(new MyOrderParam.OrderInfo("pageViewCount",true, null));
|
|
|
+ myOrderParam.add(new MyOrderParam.OrderInfo("likeCount",true, null));
|
|
|
String orderBy = MyOrderParam.buildOrderBy(myOrderParam, TourismProject.class);
|
|
|
|
|
|
|