Browse Source

[fix]
1、发布游记的相关功能,增加上下架状态的字段变换

chenchen 4 months ago
parent
commit
10a5c4ce89

+ 10 - 0
application-webadmin/src/main/java/com/tourism/webadmin/app/website/controller/WebSiteTourismTravelNotesPublishController.java

@@ -79,12 +79,18 @@ public class WebSiteTourismTravelNotesPublishController {
 
         TourismProjectTravelNotesWrite tourismProjectTravelNotesWrite =
                 tourismProjectTravelNotesWriteService.getById(tourismProjectTravelNotesWriteDto.getId());
+
+
         //判断是新增还是更新
         if(tourismProjectTravelNotesWrite == null){
             TourismProjectTravelNotesWrite tourismProjectTravelNotesWriteSave =
                     MyModelUtil.copyTo(tourismProjectTravelNotesWriteDto,TourismProjectTravelNotesWrite.class);
+            //草稿为下架状态
+            tourismProjectTravelNotesWriteSave.setUnmountState(UnmountState.DELIST);
             tourismProjectTravelNotesWrite = tourismProjectTravelNotesWriteService.saveNew(tourismProjectTravelNotesWriteSave);
         }else {
+            //草稿为下架状态
+            tourismProjectTravelNotesWrite.setUnmountState(UnmountState.DELIST);
             tourismProjectTravelNotesWriteService.updateById(tourismProjectTravelNotesWrite);
         }
         //判断内容是否为空
@@ -125,6 +131,10 @@ public class WebSiteTourismTravelNotesPublishController {
         if(pageDto.getPageSize() != null && pageDto.getPageNum() != null){
             PageMethod.startPage(pageDto.getPageNum(), pageDto.getPageSize(), true);
         }
+        //查询已发布状态的状态,则需要state为3并且上下架状态为上架
+        if(pageDto.getType() == 3){
+            tourismProjectTravelNotesWrite.setUnmountState(UnmountState.LISTING);
+        }
         List<TourismProjectTravelNotesWrite> tourismProjectTravelNotesWriteList =
                 tourismProjectTravelNotesWriteService.getTourismProjectTravelNotesWriteList(tourismProjectTravelNotesWrite, orderBy);