|
@@ -1,12 +1,18 @@
|
|
|
package com.tourism.webadmin.app.website.controller;
|
|
|
|
|
|
import cn.dev33.satoken.annotation.SaIgnore;
|
|
|
+import com.tourism.common.core.object.MyOrderParam;
|
|
|
import com.tourism.common.core.object.MyPageData;
|
|
|
import com.tourism.common.core.object.ResponseResult;
|
|
|
import com.tourism.common.log.annotation.OperationLog;
|
|
|
import com.tourism.common.log.model.constant.SysOperationLogType;
|
|
|
import com.tourism.webadmin.app.website.dto.TourismProjectTravelNotesToWebDto;
|
|
|
import com.tourism.webadmin.app.website.service.BasicToWebService;
|
|
|
+import com.tourism.webadmin.app.website.vo.TourTravelNotesDirectoryCountryVo;
|
|
|
+import com.tourism.webadmin.app.website.vo.TourTravelNotesDirectoryVo;
|
|
|
+import com.tourism.webadmin.back.model.CompanyInfo;
|
|
|
+import com.tourism.webadmin.back.model.DirectoryInfo;
|
|
|
+import com.tourism.webadmin.back.service.DirectoryInfoService;
|
|
|
import com.tourism.webadmin.back.service.TourTourismProjectTravelNotesService;
|
|
|
import com.tourism.webadmin.back.service.TourUserLikeTravelNotesService;
|
|
|
import com.tourism.webadmin.back.vo.TourTourismProjectTravelNotesVo;
|
|
@@ -19,6 +25,9 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
@Tag(name = "门户网站旅游游记接口")
|
|
|
@Slf4j
|
|
|
@RestController
|
|
@@ -30,7 +39,7 @@ public class WebsiteTourismProjectTravelNotesController {
|
|
|
@Autowired
|
|
|
private BasicToWebService basicToWebServicel;
|
|
|
@Autowired
|
|
|
- private TourTourismProjectTravelNotesService tourTourismProjectTravelNotesService;
|
|
|
+ private DirectoryInfoService directoryInfoService;
|
|
|
|
|
|
|
|
|
/**
|
|
@@ -105,4 +114,50 @@ public class WebsiteTourismProjectTravelNotesController {
|
|
|
basicToWebServicel.travelNotesViewCountAdd(travelNotesId);
|
|
|
return ResponseResult.success();
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 游记菜单列表(二维数组)
|
|
|
+ * param
|
|
|
+ * @return 应答结果对象,包含查询结果集。
|
|
|
+ */
|
|
|
+ @OperationLog(type = SysOperationLogType.ADD)
|
|
|
+ @GetMapping("/travelNotesDirectoryList")
|
|
|
+ public ResponseResult<List<TourTravelNotesDirectoryVo>> travelNotesDirectoryList() {
|
|
|
+
|
|
|
+ //设置排序
|
|
|
+ MyOrderParam myOrderParam = new MyOrderParam();
|
|
|
+ MyOrderParam.OrderInfo orderInfo = new MyOrderParam.OrderInfo();
|
|
|
+ orderInfo.setAsc(true);
|
|
|
+ orderInfo.setFieldName("showOrder");
|
|
|
+ myOrderParam.add(orderInfo);
|
|
|
+ String orderBy = MyOrderParam.buildOrderBy(myOrderParam, DirectoryInfo.class);
|
|
|
+
|
|
|
+ //查询一级菜单
|
|
|
+ DirectoryInfo directoryInfo = new DirectoryInfo();
|
|
|
+ directoryInfo.setParentId(0L);
|
|
|
+ directoryInfo.setEnable(1);
|
|
|
+ List<DirectoryInfo> directoryInfoList = directoryInfoService.getDirectoryInfoList(directoryInfo, orderBy);
|
|
|
+ List<TourTravelNotesDirectoryVo> tourTravelNotesDirectoryVoList= new ArrayList<>();
|
|
|
+ TourTravelNotesDirectoryVo tourTravelNotesDirectoryVo = new TourTravelNotesDirectoryVo();
|
|
|
+ TourTravelNotesDirectoryCountryVo tourTravelNotesDirectoryCountryVo = new TourTravelNotesDirectoryCountryVo();
|
|
|
+ directoryInfoList.stream().forEach(item->{
|
|
|
+ tourTravelNotesDirectoryVo.setAreaId(item.getId().toString());
|
|
|
+ tourTravelNotesDirectoryVo.setAreaName(item.getMenuName());
|
|
|
+
|
|
|
+ DirectoryInfo directoryInfo1 = new DirectoryInfo();
|
|
|
+ directoryInfo1.setEnable(1);
|
|
|
+ directoryInfo1.setParentId(item.getId());
|
|
|
+ List<DirectoryInfo> countryList = directoryInfoService.getDirectoryInfoList(directoryInfo1,orderBy);
|
|
|
+ List<TourTravelNotesDirectoryCountryVo> tourTravelNotesDirectoryCountryVoList = new ArrayList<>();
|
|
|
+ for(DirectoryInfo country:countryList){
|
|
|
+ tourTravelNotesDirectoryCountryVo.setCountryId(country.getId().toString());
|
|
|
+ tourTravelNotesDirectoryCountryVo.setCountryName(country.getMenuName().toString());
|
|
|
+ tourTravelNotesDirectoryCountryVoList.add(tourTravelNotesDirectoryCountryVo);
|
|
|
+ }
|
|
|
+ tourTravelNotesDirectoryVo.setChildren(tourTravelNotesDirectoryCountryVoList);
|
|
|
+ tourTravelNotesDirectoryVoList.add(tourTravelNotesDirectoryVo);
|
|
|
+ });
|
|
|
+ return ResponseResult.success(tourTravelNotesDirectoryVoList);
|
|
|
+ }
|
|
|
}
|