Эх сурвалжийг харах

[fix]
1、将游记详情接口的出发时间改为年月日的格式

chenchen 4 сар өмнө
parent
commit
fdca5a2e70

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

@@ -248,15 +248,16 @@ public class WebSiteTourismTravelNotesPublishController {
         }
         TourismProjectTravelNotesWrite tourismProjectTravelNotesWrite = tourismProjectTravelNotesWriteService.getById(Long.valueOf(writeId));
         //判断状态是否为审核中
+        if(tourismProjectTravelNotesWrite == null){
+            return ResponseResult.error(ErrorCodeEnum.DATA_ACCESS_FAILED,"该游记内容不存在,请刷新重试!");
+        }
         if(!tourismProjectTravelNotesWrite.getState().equals(AuditState.UNAUDITSTATE)){
             return ResponseResult.error(ErrorCodeEnum.DATA_ACCESS_FAILED,"当前状态无法撤回");
         }else if(!tourismProjectTravelNotesWrite.getCreateUserId().equals(TokenData.takeFromRequest().getUserId())){
             return ResponseResult.error(ErrorCodeEnum.DATA_ACCESS_FAILED,"当前用户无法撤回");
         }else {
-            TourismProjectTravelNotesWrite tourismProjectTravelNotesWrite1 =
-                    MyModelUtil.copyTo(tourismProjectTravelNotesWrite, TourismProjectTravelNotesWrite.class);
             tourismProjectTravelNotesWrite.setState(AuditState.DRAFT);
-            tourismProjectTravelNotesWriteService.update(tourismProjectTravelNotesWrite,tourismProjectTravelNotesWrite1);
+            tourismProjectTravelNotesWriteService.updateById(tourismProjectTravelNotesWrite);
             return ResponseResult.success();
         }
     }
@@ -279,10 +280,9 @@ public class WebSiteTourismTravelNotesPublishController {
         }
         //校验数据状态是否允许下架状态
         if(tourismProjectTravelNotesWrite.getUnmountState().equals(UnmountState.LISTING) && tourismProjectTravelNotesWrite.getState().equals(AuditState.SUCCEEDAUDIT)){
-            TourismProjectTravelNotesWrite tourismProjectTravelNotesWrite1 = MyModelUtil.copyTo(tourismProjectTravelNotesWrite, TourismProjectTravelNotesWrite.class);
             tourismProjectTravelNotesWrite.setUnmountState(UnmountState.DELIST);
             tourismProjectTravelNotesWrite.setState(AuditState.DRAFT);
-            tourismProjectTravelNotesWriteService.update(tourismProjectTravelNotesWrite, tourismProjectTravelNotesWrite1);
+            tourismProjectTravelNotesWriteService.updateById(tourismProjectTravelNotesWrite);
             return ResponseResult.success();
         }else {
             return ResponseResult.error(ErrorCodeEnum.DATA_ACCESS_FAILED,"数据状态不允许下架");

+ 3 - 3
application-webadmin/src/main/java/com/tourism/webadmin/app/website/controller/WebsiteTourismProjectTravelNotesController.java

@@ -137,7 +137,7 @@ public class WebsiteTourismProjectTravelNotesController {
     @SaIgnore
     @OperationLog(type = SysOperationLogType.UPDATE)
     @PostMapping("/userLikeTravelNotesUpdate")
-    public ResponseResult<Void> userLikeTravelNotesUpdate(@RequestParam String travelNotesId) {
+    public ResponseResult<Void> userLikeTravelNotesUpdate(@RequestBody String travelNotesId) {
         TourismProjectTravelNotesWrite tourismProjectTravelNotesWrite = new TourismProjectTravelNotesWrite();
         tourismProjectTravelNotesWrite.setId(travelNotesId);
         TourismProjectTravelNotesWrite tourismProjectTravelNotesWrite1 = tourismProjectTravelNotesWriteService.getOne(tourismProjectTravelNotesWrite);
@@ -164,7 +164,7 @@ public class WebsiteTourismProjectTravelNotesController {
      */
     @OperationLog(type = SysOperationLogType.LIST)
     @GetMapping("/userCollectTravelNotesList")
-    public ResponseResult<MyPageData<TourUserLikeTravelNotes>> userCollectTravelNotesList(PageDto pageDto) {
+    public ResponseResult<MyPageData<TourismProjectTravelNotesWrite>> userCollectTravelNotesList(PageDto pageDto) {
 
         MyOrderParam myOrderParam = new MyOrderParam();
         myOrderParam.add(new MyOrderParam.OrderInfo("updateTime",false,null));
@@ -175,7 +175,7 @@ public class WebsiteTourismProjectTravelNotesController {
         if(pageDto.getPageSize() != null && pageDto.getPageNum() != null){
             PageMethod.startPage(pageDto.getPageNum(), pageDto.getPageSize(), true);
         }
-        List<TourUserLikeTravelNotes> tourUserLikeTravelNotesList = tourUserLikeTravelNotesService.getTourUserLikeTravelNotesWithRelationWriteList(filter, UnmountState.LISTING, orderBy);
+        List<TourismProjectTravelNotesWrite> tourUserLikeTravelNotesList = tourUserLikeTravelNotesService.getTourUserLikeTravelNotesWithRelationWriteList(filter, UnmountState.LISTING, orderBy);
 
         return ResponseResult.success(MyPageUtil.makeResponseData(tourUserLikeTravelNotesList));
     }

+ 1 - 1
application-webadmin/src/main/java/com/tourism/webadmin/back/dao/mapper/TourUserLikeTravelNotesMapper.xml

@@ -66,7 +66,7 @@
 
     <select id="getTourUserLikeTravelNotesWithRelationWriteList" resultMap="BaseResultMap" parameterType="com.tourism.webadmin.back.model.TourismProjectTravelNotesWrite">
         SELECT
-        tour_tourism_project_travel_notes_writer.*
+        a.*
         FROM
         tour_user_like_travel_notes
         inner JOIN (select * from tour_tourism_project_travel_notes_writer where tour_tourism_project_travel_notes_writer.unmount_state = ${unmountState}

+ 2 - 1
application-webadmin/src/main/java/com/tourism/webadmin/back/vo/TourismProjectTravelNotesWriteVo.java

@@ -6,6 +6,7 @@ import io.swagger.v3.oas.annotations.media.Schema;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 
+import java.time.LocalDate;
 import java.util.Date;
 import java.util.List;
 import java.util.Map;
@@ -37,7 +38,7 @@ public class TourismProjectTravelNotesWriteVo extends BaseVo {
      * 出发时间。
      */
     @Schema(description = "出发时间")
-    private Date departureTime;
+    private LocalDate departureTime;
 
     /**
      * 总天数。