|
@@ -10,19 +10,15 @@ import com.tourism.common.core.object.TokenData;
|
|
|
import com.tourism.common.core.util.MyModelUtil;
|
|
|
import com.tourism.common.core.util.MyPageUtil;
|
|
|
import com.tourism.webadmin.app.website.dto.TourismProjectTravelNotesToWebDto;
|
|
|
+import com.tourism.webadmin.app.website.dto.TourismTravelNotesWriteDto;
|
|
|
import com.tourism.webadmin.app.website.service.BasicToWebService;
|
|
|
-import com.tourism.webadmin.back.model.BannerInfo;
|
|
|
-import com.tourism.webadmin.back.model.DirectoryInfo;
|
|
|
-import com.tourism.webadmin.back.model.TourTourismProjectTravelNotes;
|
|
|
-import com.tourism.webadmin.back.model.TourUserLikeTravelNotes;
|
|
|
-import com.tourism.webadmin.back.service.BannerInfoService;
|
|
|
-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.model.*;
|
|
|
+import com.tourism.webadmin.back.service.*;
|
|
|
import com.tourism.webadmin.back.vo.BannerInfoVo;
|
|
|
import com.tourism.webadmin.back.vo.DirectoryInfoVo;
|
|
|
import com.tourism.webadmin.back.vo.TourTourismProjectTravelNotesVo;
|
|
|
import com.tourism.common.additional.config.ApplicationConfig;
|
|
|
+import com.tourism.webadmin.back.vo.TourismProjectTravelNotesWriteVo;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
@@ -53,6 +49,9 @@ public class BasicToWebServiceImpl implements BasicToWebService
|
|
|
@Autowired
|
|
|
private TourUserLikeTravelNotesService tourUserLikeTravelNotesService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private TourismProjectTravelNotesWriteService tourismProjectTravelNotesWriteService;
|
|
|
+
|
|
|
@Override
|
|
|
public MyPageData<BannerInfoVo> getBannerInfoList(Long belongTab) {
|
|
|
BannerInfo bannerInfoFilter = new BannerInfo();
|
|
@@ -127,32 +126,36 @@ public class BasicToWebServiceImpl implements BasicToWebService
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public MyPageData<TourTourismProjectTravelNotesVo> getTourTourismProjectTravelNotesList(TourismProjectTravelNotesToWebDto tourismProjectTravelNotesToWebDto){
|
|
|
-
|
|
|
- TourTourismProjectTravelNotes tourTourismProjectTravelNotesFilter = new TourTourismProjectTravelNotes();
|
|
|
- tourTourismProjectTravelNotesFilter.setEnable(1);
|
|
|
- tourTourismProjectTravelNotesFilter.setIsHotspot(1);
|
|
|
- if(tourismProjectTravelNotesToWebDto.getPageNum() != null && tourismProjectTravelNotesToWebDto.getPageSize() != null) {
|
|
|
- PageMethod.startPage(tourismProjectTravelNotesToWebDto.getPageNum(), tourismProjectTravelNotesToWebDto.getPageSize(), true);
|
|
|
+ public MyPageData<TourismProjectTravelNotesWriteVo> getTourTourismProjectTravelNotesList(TourismTravelNotesWriteDto tourismTravelNotesWriteDto){
|
|
|
+
|
|
|
+ TourismProjectTravelNotesWrite tourismProjectTravelNotesWriteFilter = new TourismProjectTravelNotesWrite();
|
|
|
+ tourismProjectTravelNotesWriteFilter.setUnmountState(1);
|
|
|
+ tourismProjectTravelNotesWriteFilter.setIsHotspot(1);
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ if(tourismTravelNotesWriteDto.getPageNum() != null && tourismTravelNotesWriteDto.getPageSize() != null) {
|
|
|
+ PageMethod.startPage(tourismTravelNotesWriteDto.getPageNum(), tourismTravelNotesWriteDto.getPageSize(), true);
|
|
|
}
|
|
|
MyOrderParam myOrderParam = new MyOrderParam();
|
|
|
myOrderParam.add(new MyOrderParam.OrderInfo("showOrder",true,null));
|
|
|
myOrderParam.add(new MyOrderParam.OrderInfo("updateTime",false,null));
|
|
|
String orderBy = MyOrderParam.buildOrderBy(myOrderParam, TourTourismProjectTravelNotes.class);
|
|
|
- List<TourTourismProjectTravelNotes> tourTourismProjectTravelNotesList = tourTourismProjectTravelNotesService.getTourTourismProjectTravelNotesList(tourTourismProjectTravelNotesFilter, orderBy);
|
|
|
- MyPageData<TourTourismProjectTravelNotesVo> tourTourismProjectTravelNotesVoMyPageData = MyPageUtil.makeResponseData(tourTourismProjectTravelNotesList, TourTourismProjectTravelNotesVo.class);
|
|
|
- List<TourTourismProjectTravelNotesVo> dataList = tourTourismProjectTravelNotesVoMyPageData.getDataList();
|
|
|
+ List<TourismProjectTravelNotesWrite> writeList = tourismProjectTravelNotesWriteService.getTourismProjectTravelNotesWriteList(tourismProjectTravelNotesWriteFilter, orderBy);
|
|
|
+
|
|
|
+ MyPageData<TourismProjectTravelNotesWriteVo> pageData = MyPageUtil.makeResponseData(writeList, TourismProjectTravelNotesWriteVo.class);
|
|
|
+ List<TourismProjectTravelNotesWriteVo> dataList = pageData.getDataList();
|
|
|
dataList.stream().forEach(item->{
|
|
|
- if (StringUtils.isNotEmpty(item.getHomeHotPicture())) {
|
|
|
- item.setHomeHotPicturesAfterConvert(UrlConvertUtils.urlConvert(applicationConfig.getHostIpPort(), item.getHomeHotPicture()));
|
|
|
+ if (StringUtils.isNotEmpty(item.getTourismUrl())) {
|
|
|
+ item.setHomeHotPicturesAfterConvert(UrlConvertUtils.urlConvert(applicationConfig.getHostIpPort(), item.getTourismUrl()));
|
|
|
}
|
|
|
});
|
|
|
|
|
|
- return tourTourismProjectTravelNotesVoMyPageData;
|
|
|
+ return pageData;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public MyPageData<TourTourismProjectTravelNotesVo> getTravelNotesPageList(TourismProjectTravelNotesToWebDto tourismProjectTravelNotesToWebDto){
|
|
|
+ public MyPageData<TourismProjectTravelNotesWriteVo> getTravelNotesPageList(TourismTravelNotesWriteDto dto){
|
|
|
|
|
|
MyOrderParam myOrderParam = new MyOrderParam();
|
|
|
myOrderParam.add(new MyOrderParam.OrderInfo("isHotspot",false,null));
|
|
@@ -160,41 +163,44 @@ public class BasicToWebServiceImpl implements BasicToWebService
|
|
|
myOrderParam.add(new MyOrderParam.OrderInfo("updateTime",false,null));
|
|
|
String orderBy = MyOrderParam.buildOrderBy(myOrderParam, TourTourismProjectTravelNotes.class);
|
|
|
|
|
|
- TourTourismProjectTravelNotes tourTourismProjectTravelNotes = new TourTourismProjectTravelNotes();
|
|
|
+ TourismProjectTravelNotesWrite tourismProjectTravelNotesWriteFilter = new TourismProjectTravelNotesWrite();
|
|
|
+
|
|
|
|
|
|
- if(StringUtils.isEmpty(tourismProjectTravelNotesToWebDto.getAreaId()) && StringUtils.isEmpty(tourismProjectTravelNotesToWebDto.getCountryId())){
|
|
|
+ if(StringUtils.isEmpty(dto.getAreaId()) && StringUtils.isEmpty(dto.getCountryId())){
|
|
|
|
|
|
- tourTourismProjectTravelNotes.setEnable(1);
|
|
|
- tourTourismProjectTravelNotes.setBelongTab(null);
|
|
|
- }else if(StringUtils.isNotEmpty(tourismProjectTravelNotesToWebDto.getAreaId()) && StringUtils.isEmpty(tourismProjectTravelNotesToWebDto.getCountryId())){
|
|
|
+ tourismProjectTravelNotesWriteFilter.setUnmountState(1);
|
|
|
+ tourismProjectTravelNotesWriteFilter.setEndPlace(null);
|
|
|
+ }else if(StringUtils.isNotEmpty(dto.getAreaId()) && StringUtils.isEmpty(dto.getCountryId())){
|
|
|
|
|
|
DirectoryInfo directoryInfo = new DirectoryInfo();
|
|
|
- directoryInfo.setParentId(Long.parseLong(tourismProjectTravelNotesToWebDto.getAreaId()));
|
|
|
+ directoryInfo.setParentId(Long.parseLong(dto.getAreaId()));
|
|
|
directoryInfo.setEnable(1);
|
|
|
List<DirectoryInfo> directoryInfoList =
|
|
|
directoryInfoService.getDirectoryInfoList(directoryInfo, "");
|
|
|
List<Long> directoryIdList =
|
|
|
directoryInfoList.stream().map(DirectoryInfo::getId).collect(Collectors.toList());
|
|
|
- tourTourismProjectTravelNotes.setBelongTab(null);
|
|
|
- tourTourismProjectTravelNotes.setDirectoryInfoIds(directoryIdList);
|
|
|
+ tourismProjectTravelNotesWriteFilter.setEndPlace(null);
|
|
|
+ tourismProjectTravelNotesWriteFilter.setDirectoryInfoIds(directoryIdList);
|
|
|
}else {
|
|
|
|
|
|
- if(StringUtils.isNotEmpty(tourismProjectTravelNotesToWebDto.getCountryId())) {
|
|
|
- tourTourismProjectTravelNotes.setBelongTab(Long.parseLong(tourismProjectTravelNotesToWebDto.getCountryId()));
|
|
|
+ if(StringUtils.isNotEmpty(dto.getCountryId())) {
|
|
|
+ tourismProjectTravelNotesWriteFilter.setEndPlace(Long.parseLong(dto.getCountryId()));
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- if(tourismProjectTravelNotesToWebDto.getPageNum() != null && tourismProjectTravelNotesToWebDto.getPageSize() != null) {
|
|
|
- PageMethod.startPage(tourismProjectTravelNotesToWebDto.getPageNum(), tourismProjectTravelNotesToWebDto.getPageSize(), true);
|
|
|
+ if(dto.getPageNum() != null && dto.getPageSize() != null) {
|
|
|
+ PageMethod.startPage(dto.getPageNum(), dto.getPageSize(), true);
|
|
|
}
|
|
|
|
|
|
- List<TourTourismProjectTravelNotes> tourTourismProjectTravelNotesList =
|
|
|
- tourTourismProjectTravelNotesService.getTourTourismProjectTravelNotesList(tourTourismProjectTravelNotes, orderBy);
|
|
|
+
|
|
|
+
|
|
|
+ List<TourismProjectTravelNotesWrite> writeList =
|
|
|
+ tourismProjectTravelNotesWriteService.getTourismProjectTravelNotesWriteList(tourismProjectTravelNotesWriteFilter, orderBy);
|
|
|
|
|
|
- MyPageData<TourTourismProjectTravelNotesVo> tourTourismProjectTravelNotesVoMyPageData =
|
|
|
- MyPageUtil.makeResponseData(tourTourismProjectTravelNotesList, TourTourismProjectTravelNotesVo.class);
|
|
|
+ MyPageData<TourismProjectTravelNotesWriteVo> pageData =
|
|
|
+ MyPageUtil.makeResponseData(writeList, TourismProjectTravelNotesWriteVo.class);
|
|
|
|
|
|
- List<TourTourismProjectTravelNotesVo> dataList = tourTourismProjectTravelNotesVoMyPageData.getDataList();
|
|
|
+ List<TourismProjectTravelNotesWriteVo> dataList = pageData.getDataList();
|
|
|
|
|
|
dataList.stream().forEach(item->{
|
|
|
if(StringUtils.isNotEmpty(item.getTourismUrl())){
|
|
@@ -202,31 +208,30 @@ public class BasicToWebServiceImpl implements BasicToWebService
|
|
|
}
|
|
|
});
|
|
|
|
|
|
- return tourTourismProjectTravelNotesVoMyPageData;
|
|
|
+ return pageData;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public TourTourismProjectTravelNotesVo travelNotesDetail(String id){
|
|
|
- TourTourismProjectTravelNotes tourTourismProjectTravelNotes =
|
|
|
- tourTourismProjectTravelNotesService.getByIdWithRelation(id, MyRelationParam.full());
|
|
|
+ public TourismProjectTravelNotesWriteVo travelNotesDetail(String id){
|
|
|
+ TourismProjectTravelNotesWrite writeDto = tourismProjectTravelNotesWriteService.getByIdWithRelation(Long.parseLong(id), MyRelationParam.full());
|
|
|
|
|
|
- TourTourismProjectTravelNotesVo tourTourismProjectTravelNotesVo =
|
|
|
- MyModelUtil.copyTo(tourTourismProjectTravelNotes, TourTourismProjectTravelNotesVo.class);
|
|
|
+ TourismProjectTravelNotesWriteVo writeVo =
|
|
|
+ MyModelUtil.copyTo(writeDto, TourismProjectTravelNotesWriteVo.class);
|
|
|
|
|
|
- if(tourTourismProjectTravelNotesVo != null) {
|
|
|
- if (StringUtils.isNotEmpty(tourTourismProjectTravelNotesVo.getTourismUrl())) {
|
|
|
- tourTourismProjectTravelNotesVo.setTourismUrlsAfterConvert(UrlConvertUtils.urlConvert(applicationConfig.getHostIpPort(), tourTourismProjectTravelNotesVo.getTourismUrl()));
|
|
|
+ if(writeVo != null) {
|
|
|
+ if (StringUtils.isNotEmpty(writeVo.getTourismUrl())) {
|
|
|
+ writeVo.setTourismUrlsAfterConvert(UrlConvertUtils.urlConvert(applicationConfig.getHostIpPort(), writeVo.getTourismUrl()));
|
|
|
}
|
|
|
|
|
|
- if (StringUtils.isNotEmpty(tourTourismProjectTravelNotesVo.getHomeHotPicture())) {
|
|
|
- tourTourismProjectTravelNotesVo.setHomeHotPicturesAfterConvert(UrlConvertUtils.urlConvert(applicationConfig.getHostIpPort(), tourTourismProjectTravelNotesVo.getHomeHotPicture()));
|
|
|
+ if (StringUtils.isNotEmpty(writeVo.getTourismUrl())) {
|
|
|
+ writeVo.setHomeHotPicturesAfterConvert(UrlConvertUtils.urlConvert(applicationConfig.getHostIpPort(), writeVo.getTourismUrl()));
|
|
|
}
|
|
|
|
|
|
- if (StringUtils.isNotEmpty(tourTourismProjectTravelNotesVo.getTravelNotesBanner())) {
|
|
|
- tourTourismProjectTravelNotesVo.setTravelNotesBannerAfterConvert(UrlConvertUtils.urlConvert(applicationConfig.getHostIpPort(), tourTourismProjectTravelNotesVo.getTravelNotesBanner()));
|
|
|
+ if (StringUtils.isNotEmpty(writeVo.getTravelNotesBanner())) {
|
|
|
+ writeVo.setTravelNotesBannerAfterConvert(UrlConvertUtils.urlConvert(applicationConfig.getHostIpPort(), writeVo.getTravelNotesBanner()));
|
|
|
}
|
|
|
}
|
|
|
- return tourTourismProjectTravelNotesVo;
|
|
|
+ return writeVo;
|
|
|
}
|
|
|
|
|
|
@Override
|