فهرست منبع

[fix]
1、增加发布游记的相关接口

chenchen 4 ماه پیش
والد
کامیت
e47ed82356
32فایلهای تغییر یافته به همراه1873 افزوده شده و 110 حذف شده
  1. 169 0
      application-webadmin/src/main/java/com/tourism/webadmin/app/website/controller/WebSiteTourismTravelNotesPublishController.java
  2. 38 0
      application-webadmin/src/main/java/com/tourism/webadmin/app/website/dto/TourismProjectTravelNotesWriteDetailPageDto.java
  3. 75 0
      application-webadmin/src/main/java/com/tourism/webadmin/back/controller/TourismProjectTravelNotesContentDraftController.java
  4. 293 0
      application-webadmin/src/main/java/com/tourism/webadmin/back/controller/TourismProjectTravelNotesDraftController.java
  5. 33 0
      application-webadmin/src/main/java/com/tourism/webadmin/back/dao/TourismProjectTravelNotesContentDraftMapper.java
  6. 33 0
      application-webadmin/src/main/java/com/tourism/webadmin/back/dao/TourismProjectTravelNotesDraftMapper.java
  7. 33 0
      application-webadmin/src/main/java/com/tourism/webadmin/back/dao/TourismTravelNotesContentWriteMapper.java
  8. 69 0
      application-webadmin/src/main/java/com/tourism/webadmin/back/dao/mapper/TourismProjectTravelNotesContentDraftMapper.xml
  9. 86 0
      application-webadmin/src/main/java/com/tourism/webadmin/back/dao/mapper/TourismProjectTravelNotesDraftMapper.xml
  10. 18 19
      application-webadmin/src/main/java/com/tourism/webadmin/back/dao/mapper/TourismProjectTravelNotesWriteMapper.xml
  11. 18 13
      application-webadmin/src/main/java/com/tourism/webadmin/back/dao/mapper/TourismTravelNotesContentWriteMapper.xml
  12. 49 0
      application-webadmin/src/main/java/com/tourism/webadmin/back/dto/TourismProjectTravelNotesContentDraftDto.java
  13. 97 0
      application-webadmin/src/main/java/com/tourism/webadmin/back/dto/TourismProjectTravelNotesDraftDto.java
  14. 11 11
      application-webadmin/src/main/java/com/tourism/webadmin/back/dto/TourismProjectTravelNotesWriteDto.java
  15. 18 6
      application-webadmin/src/main/java/com/tourism/webadmin/back/dto/TourismTravelNotesContentWriteDto.java
  16. 55 0
      application-webadmin/src/main/java/com/tourism/webadmin/back/model/TourismProjectTravelNotesContentDraft.java
  17. 103 0
      application-webadmin/src/main/java/com/tourism/webadmin/back/model/TourismProjectTravelNotesDraft.java
  18. 10 21
      application-webadmin/src/main/java/com/tourism/webadmin/back/model/TourismProjectTravelNotesWrite.java
  19. 18 6
      application-webadmin/src/main/java/com/tourism/webadmin/back/model/TourismTravelNotesContentWrite.java
  20. 11 6
      application-webadmin/src/main/java/com/tourism/webadmin/back/model/constant/AuditState.java
  21. 76 0
      application-webadmin/src/main/java/com/tourism/webadmin/back/service/TourismProjectTravelNotesContentDraftService.java
  22. 88 0
      application-webadmin/src/main/java/com/tourism/webadmin/back/service/TourismProjectTravelNotesDraftService.java
  23. 20 0
      application-webadmin/src/main/java/com/tourism/webadmin/back/service/TourismProjectTravelNotesWriteService.java
  24. 106 0
      application-webadmin/src/main/java/com/tourism/webadmin/back/service/impl/TourismProjectTravelNotesContentDraftServiceImpl.java
  25. 140 0
      application-webadmin/src/main/java/com/tourism/webadmin/back/service/impl/TourismProjectTravelNotesDraftServiceImpl.java
  26. 32 1
      application-webadmin/src/main/java/com/tourism/webadmin/back/service/impl/TourismProjectTravelNotesWriteServiceImpl.java
  27. 2 0
      application-webadmin/src/main/java/com/tourism/webadmin/back/service/impl/TourismTravelNotesContentWriteServiceImpl.java
  28. 59 0
      application-webadmin/src/main/java/com/tourism/webadmin/back/vo/TourismProjectTravelNotesContentDraftVo.java
  29. 81 0
      application-webadmin/src/main/java/com/tourism/webadmin/back/vo/TourismProjectTravelNotesDraftVo.java
  30. 13 21
      application-webadmin/src/main/java/com/tourism/webadmin/back/vo/TourismProjectTravelNotesWriteVo.java
  31. 17 5
      application-webadmin/src/main/java/com/tourism/webadmin/back/vo/TourismTravelNotesContentWriteVo.java
  32. 2 1
      common/common-core/src/main/java/com/tourism/common/core/constant/ErrorCodeEnum.java

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

@@ -0,0 +1,169 @@
+package com.tourism.webadmin.app.website.controller;
+
+import com.github.pagehelper.page.PageMethod;
+import com.tourism.common.core.annotation.MyRequestBody;
+import com.tourism.common.core.constant.ErrorCodeEnum;
+import com.tourism.common.core.object.*;
+import com.tourism.common.core.util.MyCommonUtil;
+import com.tourism.common.core.util.MyModelUtil;
+import com.tourism.common.core.util.MyPageUtil;
+import com.tourism.common.log.annotation.OperationLog;
+import com.tourism.common.log.model.constant.SysOperationLogType;
+import com.tourism.common.sequence.wrapper.IdGeneratorWrapper;
+import com.tourism.webadmin.app.website.dto.TourismProjectTravelNotesWriteDetailPageDto;
+import com.tourism.webadmin.back.dto.TourismProjectTravelNotesWriteDto;
+import com.tourism.webadmin.back.dto.TourismTravelNotesContentWriteDto;
+import com.tourism.webadmin.back.model.*;
+import com.tourism.webadmin.back.model.constant.AuditState;
+import com.tourism.webadmin.back.service.TourismProjectTravelNotesWriteService;
+import com.tourism.webadmin.back.service.TourismTravelNotesContentWriteService;
+import com.tourism.webadmin.back.vo.TourismProjectTravelNotesWriteVo;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+@Tag(name = "门户网站发布游记接口")
+@Slf4j
+@RestController
+@RequestMapping("/website/tourism/publishTravelNotes")
+public class WebSiteTourismTravelNotesPublishController {
+
+    @Autowired
+    private IdGeneratorWrapper idGenerator;
+    @Autowired
+    private TourismProjectTravelNotesWriteService tourismProjectTravelNotesWriteService;
+    @Autowired
+    private TourismTravelNotesContentWriteService tourismTravelNotesContentWriteService;
+
+    /**
+     * 获取草稿id
+     *
+     * @return 应答结果对象,包含查询结果集。
+     */
+    @OperationLog(type = SysOperationLogType.LIST)
+    @GetMapping("/getDraftId")
+    public ResponseResult<String> getDraftId() {
+        return ResponseResult.success(String.valueOf(idGenerator.nextLongId()));
+    }
+
+    /**
+     * 存为草稿
+     *
+     * @return 应答结果对象,包含查询结果集。
+     */
+    @OperationLog(type = SysOperationLogType.UPDATE)
+    @PostMapping("/saveDraft")
+    public ResponseResult<Void> saveDraft(@MyRequestBody TourismProjectTravelNotesWriteDto tourismProjectTravelNotesWriteDto) {
+
+
+        TourismProjectTravelNotesWrite tourismProjectTravelNotesWrite =
+                tourismProjectTravelNotesWriteService.getById(tourismProjectTravelNotesWriteDto.getId());
+
+        TourismProjectTravelNotesWrite tourismProjectTravelNotesWriteSave =
+                MyModelUtil.copyTo(tourismProjectTravelNotesWriteDto,TourismProjectTravelNotesWrite.class);
+        //判断是新增还是更新
+        if(tourismProjectTravelNotesWrite == null){
+            tourismProjectTravelNotesWrite = tourismProjectTravelNotesWriteService.saveNew(tourismProjectTravelNotesWriteSave);
+        }else {
+            tourismProjectTravelNotesWriteService.update(tourismProjectTravelNotesWriteSave,tourismProjectTravelNotesWrite);
+        }
+        //判断内容是否为空
+        if(tourismProjectTravelNotesWriteDto.getTravelNotesContent() != null) {
+            List<TourismTravelNotesContentWriteDto> travelNotesContentWriteList = tourismProjectTravelNotesWriteDto.getTravelNotesContent();
+            List<TourismTravelNotesContentWrite> tourismTravelNotesContentWriteList = MyModelUtil.copyCollectionTo(travelNotesContentWriteList, TourismTravelNotesContentWrite.class);
+            for (TourismTravelNotesContentWrite item : tourismTravelNotesContentWriteList) {
+                item.setAssociationId(tourismProjectTravelNotesWrite.getId());
+            }
+            tourismTravelNotesContentWriteService.removeByAssociationId(tourismProjectTravelNotesWrite.getId());
+            //查询关联数据的id,根据id进行更新数据表的数据
+            tourismTravelNotesContentWriteService.saveNewBatch(tourismTravelNotesContentWriteList);
+        }
+        return ResponseResult.success();
+    }
+
+
+    /**
+     * 获取草稿列表
+     *
+     * @return 应答结果对象,包含查询结果集。
+     */
+    @OperationLog(type = SysOperationLogType.LIST)
+    @GetMapping("/getDraftList")
+    public ResponseResult<MyPageData<TourismProjectTravelNotesWriteVo>> getDraftList(@Validated TourismProjectTravelNotesWriteDetailPageDto pageDto) {
+        if (pageDto.getType() == null) {
+            return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATED_FAILED);
+        }
+        Long userId = TokenData.takeFromRequest().getUserId();
+        TourismProjectTravelNotesWrite tourismProjectTravelNotesWrite = new TourismProjectTravelNotesWrite();
+        tourismProjectTravelNotesWrite.setCreateUserId(userId);
+        tourismProjectTravelNotesWrite.setState(AuditState.DRAFT);
+        MyOrderParam myOrderParam = new MyOrderParam();
+        myOrderParam.add(new MyOrderParam.OrderInfo("updateTime",false,null));
+        String orderBy = MyOrderParam.buildOrderBy(myOrderParam, TourismProjectTravelNotesWrite.class);
+        if(pageDto.getPageSize() != null && pageDto.getPageNum() != null){
+            PageMethod.startPage(pageDto.getPageNum(), pageDto.getPageSize(), true);
+        }
+        List<TourismProjectTravelNotesWrite> tourismProjectTravelNotesWriteList =
+                tourismProjectTravelNotesWriteService.getTourismProjectTravelNotesWriteList(tourismProjectTravelNotesWrite, orderBy);
+
+        return ResponseResult.success(MyPageUtil.makeResponseData(tourismProjectTravelNotesWriteList, TourismProjectTravelNotesWriteVo.class));
+    }
+
+    /**
+     * 根据草稿id,获取草稿详情
+     *
+     * @return 应答结果对象,包含查询结果集。
+     */
+    @OperationLog(type = SysOperationLogType.LIST)
+    @GetMapping("/getDraftDetail")
+    public ResponseResult<TourismProjectTravelNotesWriteVo> getDraftDetail(@RequestParam Long writeId) {
+
+        TourismProjectTravelNotesWrite tourismProjectTravelNotesWrite = tourismProjectTravelNotesWriteService.getByIdWithRelation(writeId,MyRelationParam.full());
+        if(tourismProjectTravelNotesWrite == null){
+            return ResponseResult.error(ErrorCodeEnum.DATA_NOT_FOUND);
+        }
+        TourismProjectTravelNotesWriteVo tourismProjectTravelNotesWriteVo = MyModelUtil.copyTo(tourismProjectTravelNotesWrite, TourismProjectTravelNotesWriteVo.class);
+        return ResponseResult.success(tourismProjectTravelNotesWriteVo);
+    }
+
+    /**
+     * 根据草稿id,删除草稿
+     *
+     * @return 应答结果对象,包含查询结果集。
+     */
+    @OperationLog(type = SysOperationLogType.DELETE)
+    @PostMapping("/removeByDraftId")
+    public ResponseResult<Void> removeByDraftId(@MyRequestBody Long writeId) {
+        tourismProjectTravelNotesWriteService.remove(writeId);
+        tourismTravelNotesContentWriteService.removeByAssociationId(writeId);
+        return ResponseResult.success();
+    }
+
+    /**
+     * 草稿发布接口
+     *
+     * @return 应答结果对象,包含查询结果集。
+     */
+    @OperationLog(type = SysOperationLogType.PUBLISH)
+    @PostMapping("/publishDraft")
+    public ResponseResult<Void> publishDraft(@MyRequestBody TourismProjectTravelNotesWriteDto tourismProjectTravelNotesWriteDto) {
+        String errorMessage = MyCommonUtil.getModelValidationError(tourismProjectTravelNotesWriteDto);
+        if (errorMessage != null) {
+            return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATED_FAILED, errorMessage);
+        }
+        TourismProjectTravelNotesWrite tourismProjectTravelNotesWrite =
+                MyModelUtil.copyTo(tourismProjectTravelNotesWriteDto, TourismProjectTravelNotesWrite.class);
+        tourismProjectTravelNotesWrite.setState(AuditState.UNAUDITSTATE);
+        tourismProjectTravelNotesWriteService.update(tourismProjectTravelNotesWrite,MyModelUtil.copyTo(tourismProjectTravelNotesWriteDto,TourismProjectTravelNotesWrite.class));
+        tourismTravelNotesContentWriteService.removeByAssociationId(tourismProjectTravelNotesWriteDto.getId());
+        tourismTravelNotesContentWriteService.saveNewBatch(MyModelUtil.copyCollectionTo(tourismProjectTravelNotesWriteDto.getTravelNotesContent(),TourismTravelNotesContentWrite.class));
+        return ResponseResult.success();
+    }
+
+
+
+}

+ 38 - 0
application-webadmin/src/main/java/com/tourism/webadmin/app/website/dto/TourismProjectTravelNotesWriteDetailPageDto.java

@@ -0,0 +1,38 @@
+package com.tourism.webadmin.app.website.dto;
+
+import com.tourism.common.core.validator.UpdateGroup;
+import io.swagger.v3.oas.annotations.media.Schema;
+import jakarta.validation.constraints.NotNull;
+import lombok.Data;
+
+import static io.lettuce.core.pubsub.PubSubOutput.Type.message;
+
+@Data
+public class TourismProjectTravelNotesWriteDetailPageDto {
+
+    @Schema(description = "游记ID")
+    @NotNull(message = "草稿id不允许为空!",groups = {UpdateGroup.class})
+    private Long travelNotesId;
+
+    @Schema(description = "类型(0,草稿;1,待审核;2,审核未通过;3,审核通过")
+    @NotNull(message = "类型不允许为空!",groups = {UpdateGroup.class})
+    private Integer type;
+
+    /**
+     * 分页号码,从1开始计数。
+     */
+    @Schema(description = "分页号码。")
+    private Integer pageNum;
+
+    /**
+     * 每页大小。
+     */
+    @Schema(description = "每页大小。")
+    private Integer pageSize;
+
+    /**
+     * 是否统计totalCount。
+     */
+    @Schema(description = "是否统计totalCount。")
+    private Boolean count;
+}

+ 75 - 0
application-webadmin/src/main/java/com/tourism/webadmin/back/controller/TourismProjectTravelNotesContentDraftController.java

@@ -0,0 +1,75 @@
+package com.tourism.webadmin.back.controller;
+
+import cn.dev33.satoken.annotation.SaCheckPermission;
+import com.github.pagehelper.page.PageMethod;
+import com.tourism.webadmin.back.vo.*;
+import com.tourism.webadmin.back.dto.*;
+import com.tourism.webadmin.back.model.*;
+import com.tourism.webadmin.back.service.*;
+import com.tourism.common.core.object.*;
+import com.tourism.common.core.util.*;
+import com.tourism.common.core.constant.*;
+import com.tourism.common.core.annotation.MyRequestBody;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.*;
+
+/**
+ * 发布游记的草稿的文本框操作控制器类。
+ *
+ * @author 吃饭睡觉
+ * @date 2024-09-06
+ */
+@Tag(name = "发布游记的草稿的文本框管理接口")
+@Slf4j
+@RestController
+@RequestMapping("/admin/app/tourismProjectTravelNotesContentDraft")
+public class TourismProjectTravelNotesContentDraftController {
+
+    @Autowired
+    private TourismProjectTravelNotesContentDraftService tourismProjectTravelNotesContentDraftService;
+
+    /**
+     * 列出符合过滤条件的发布游记的草稿的文本框列表。
+     *
+     * @param tourismProjectTravelNotesContentDraftDtoFilter 过滤对象。
+     * @param orderParam 排序参数。
+     * @param pageParam 分页参数。
+     * @return 应答结果对象,包含查询结果集。
+     */
+    @SaCheckPermission("tourismProjectTravelNotesContentDraft.view")
+    @PostMapping("/list")
+    public ResponseResult<MyPageData<TourismProjectTravelNotesContentDraftVo>> list(
+            @MyRequestBody TourismProjectTravelNotesContentDraftDto tourismProjectTravelNotesContentDraftDtoFilter,
+            @MyRequestBody MyOrderParam orderParam,
+            @MyRequestBody MyPageParam pageParam) {
+        if (pageParam != null) {
+            PageMethod.startPage(pageParam.getPageNum(), pageParam.getPageSize(), pageParam.getCount());
+        }
+        TourismProjectTravelNotesContentDraft tourismProjectTravelNotesContentDraftFilter = MyModelUtil.copyTo(tourismProjectTravelNotesContentDraftDtoFilter, TourismProjectTravelNotesContentDraft.class);
+        String orderBy = MyOrderParam.buildOrderBy(orderParam, TourismProjectTravelNotesContentDraft.class);
+        List<TourismProjectTravelNotesContentDraft> tourismProjectTravelNotesContentDraftList =
+                tourismProjectTravelNotesContentDraftService.getTourismProjectTravelNotesContentDraftListWithRelation(tourismProjectTravelNotesContentDraftFilter, orderBy);
+        return ResponseResult.success(MyPageUtil.makeResponseData(tourismProjectTravelNotesContentDraftList, TourismProjectTravelNotesContentDraftVo.class));
+    }
+
+    /**
+     * 查看指定发布游记的草稿的文本框对象详情。
+     *
+     * @param id 指定对象主键Id。
+     * @return 应答结果对象,包含对象详情。
+     */
+    @SaCheckPermission("tourismProjectTravelNotesContentDraft.view")
+    @GetMapping("/view")
+    public ResponseResult<TourismProjectTravelNotesContentDraftVo> view(@RequestParam Long id) {
+        TourismProjectTravelNotesContentDraft tourismProjectTravelNotesContentDraft = tourismProjectTravelNotesContentDraftService.getByIdWithRelation(id, MyRelationParam.full());
+        if (tourismProjectTravelNotesContentDraft == null) {
+            return ResponseResult.error(ErrorCodeEnum.DATA_NOT_EXIST);
+        }
+        TourismProjectTravelNotesContentDraftVo tourismProjectTravelNotesContentDraftVo = MyModelUtil.copyTo(tourismProjectTravelNotesContentDraft, TourismProjectTravelNotesContentDraftVo.class);
+        return ResponseResult.success(tourismProjectTravelNotesContentDraftVo);
+    }
+}

+ 293 - 0
application-webadmin/src/main/java/com/tourism/webadmin/back/controller/TourismProjectTravelNotesDraftController.java

@@ -0,0 +1,293 @@
+package com.tourism.webadmin.back.controller;
+
+import cn.dev33.satoken.annotation.SaCheckPermission;
+import cn.hutool.core.util.ReflectUtil;
+import com.tourism.common.core.upload.BaseUpDownloader;
+import com.tourism.common.core.upload.UpDownloaderFactory;
+import com.tourism.common.core.upload.UploadResponseInfo;
+import com.tourism.common.core.upload.UploadStoreInfo;
+import com.tourism.common.log.annotation.OperationLog;
+import com.tourism.common.log.model.constant.SysOperationLogType;
+import com.github.pagehelper.page.PageMethod;
+import com.tourism.webadmin.back.vo.*;
+import com.tourism.webadmin.back.dto.*;
+import com.tourism.webadmin.back.model.*;
+import com.tourism.webadmin.back.service.*;
+import com.tourism.common.core.object.*;
+import com.tourism.common.core.util.*;
+import com.tourism.common.core.constant.*;
+import com.tourism.common.core.annotation.MyRequestBody;
+import com.tourism.common.redis.cache.SessionCacheHelper;
+import com.tourism.common.additional.config.ApplicationConfig;
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+import jakarta.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.util.*;
+
+/**
+ * 发布游记的草稿操作控制器类。
+ *
+ * @author 吃饭睡觉
+ * @date 2024-09-06
+ */
+@Tag(name = "发布游记的草稿管理接口")
+@Slf4j
+@RestController
+@RequestMapping("/admin/app/tourismProjectTravelNotesDraft")
+public class TourismProjectTravelNotesDraftController {
+
+    @Autowired
+    private ApplicationConfig appConfig;
+    @Autowired
+    private SessionCacheHelper cacheHelper;
+    @Autowired
+    private UpDownloaderFactory upDownloaderFactory;
+    @Autowired
+    private TourismProjectTravelNotesDraftService tourismProjectTravelNotesDraftService;
+
+    /**
+     * 新增发布游记的草稿数据。
+     *
+     * @param tourismProjectTravelNotesDraftDto 新增对象。
+     * @return 应答结果对象,包含新增对象主键Id。
+     */
+    @ApiOperationSupport(ignoreParameters = {"tourismProjectTravelNotesDraftDto.id", "tourismProjectTravelNotesDraftDto.searchString"})
+    @SaCheckPermission("tourismProjectTravelNotesDraft.add")
+    @OperationLog(type = SysOperationLogType.ADD)
+    @PostMapping("/add")
+    public ResponseResult<Long> add(@MyRequestBody TourismProjectTravelNotesDraftDto tourismProjectTravelNotesDraftDto) {
+        String errorMessage = MyCommonUtil.getModelValidationError(tourismProjectTravelNotesDraftDto, false);
+        if (errorMessage != null) {
+            return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATED_FAILED, errorMessage);
+        }
+        TourismProjectTravelNotesDraft tourismProjectTravelNotesDraft = MyModelUtil.copyTo(tourismProjectTravelNotesDraftDto, TourismProjectTravelNotesDraft.class);
+        tourismProjectTravelNotesDraft = tourismProjectTravelNotesDraftService.saveNew(tourismProjectTravelNotesDraft);
+        return ResponseResult.success(tourismProjectTravelNotesDraft.getId());
+    }
+
+    /**
+     * 更新发布游记的草稿数据。
+     *
+     * @param tourismProjectTravelNotesDraftDto 更新对象。
+     * @return 应答结果对象。
+     */
+    @ApiOperationSupport(ignoreParameters = {"tourismProjectTravelNotesDraftDto.searchString"})
+    @SaCheckPermission("tourismProjectTravelNotesDraft.update")
+    @OperationLog(type = SysOperationLogType.UPDATE)
+    @PostMapping("/update")
+    public ResponseResult<Void> update(@MyRequestBody TourismProjectTravelNotesDraftDto tourismProjectTravelNotesDraftDto) {
+        String errorMessage = MyCommonUtil.getModelValidationError(tourismProjectTravelNotesDraftDto, true);
+        if (errorMessage != null) {
+            return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATED_FAILED, errorMessage);
+        }
+        TourismProjectTravelNotesDraft tourismProjectTravelNotesDraft = MyModelUtil.copyTo(tourismProjectTravelNotesDraftDto, TourismProjectTravelNotesDraft.class);
+        TourismProjectTravelNotesDraft originalTourismProjectTravelNotesDraft = tourismProjectTravelNotesDraftService.getById(tourismProjectTravelNotesDraft.getId());
+        if (originalTourismProjectTravelNotesDraft == null) {
+            // NOTE: 修改下面方括号中的话述
+            errorMessage = "数据验证失败,当前 [数据] 并不存在,请刷新后重试!";
+            return ResponseResult.error(ErrorCodeEnum.DATA_NOT_EXIST, errorMessage);
+        }
+        if (!tourismProjectTravelNotesDraftService.update(tourismProjectTravelNotesDraft, originalTourismProjectTravelNotesDraft)) {
+            return ResponseResult.error(ErrorCodeEnum.DATA_NOT_EXIST);
+        }
+        return ResponseResult.success();
+    }
+
+    /**
+     * 删除发布游记的草稿数据。
+     *
+     * @param id 删除对象主键Id。
+     * @return 应答结果对象。
+     */
+    @SaCheckPermission("tourismProjectTravelNotesDraft.delete")
+    @OperationLog(type = SysOperationLogType.DELETE)
+    @PostMapping("/delete")
+    public ResponseResult<Void> delete(@MyRequestBody Long id) {
+        if (MyCommonUtil.existBlankArgument(id)) {
+            return ResponseResult.error(ErrorCodeEnum.ARGUMENT_NULL_EXIST);
+        }
+        return this.doDelete(id);
+    }
+
+    /**
+     * 批量删除发布游记的草稿数据。
+     *
+     * @param idList 待删除对象的主键Id列表。
+     * @return 应答结果对象。
+     */
+    @SaCheckPermission("tourismProjectTravelNotesDraft.delete")
+    @OperationLog(type = SysOperationLogType.DELETE_BATCH)
+    @PostMapping("/deleteBatch")
+    public ResponseResult<Void> deleteBatch(@MyRequestBody List<Long> idList) {
+        if (MyCommonUtil.existBlankArgument(idList)) {
+            return ResponseResult.error(ErrorCodeEnum.ARGUMENT_NULL_EXIST);
+        }
+        for (Long id : idList) {
+            ResponseResult<Void> responseResult = this.doDelete(id);
+            if (!responseResult.isSuccess()) {
+                return responseResult;
+            }
+        }
+        return ResponseResult.success();
+    }
+
+    /**
+     * 列出符合过滤条件的发布游记的草稿列表。
+     *
+     * @param tourismProjectTravelNotesDraftDtoFilter 过滤对象。
+     * @param orderParam 排序参数。
+     * @param pageParam 分页参数。
+     * @return 应答结果对象,包含查询结果集。
+     */
+    @SaCheckPermission("tourismProjectTravelNotesDraft.view")
+    @PostMapping("/list")
+    public ResponseResult<MyPageData<TourismProjectTravelNotesDraftVo>> list(
+            @MyRequestBody TourismProjectTravelNotesDraftDto tourismProjectTravelNotesDraftDtoFilter,
+            @MyRequestBody MyOrderParam orderParam,
+            @MyRequestBody MyPageParam pageParam) {
+        if (pageParam != null) {
+            PageMethod.startPage(pageParam.getPageNum(), pageParam.getPageSize(), pageParam.getCount());
+        }
+        TourismProjectTravelNotesDraft tourismProjectTravelNotesDraftFilter = MyModelUtil.copyTo(tourismProjectTravelNotesDraftDtoFilter, TourismProjectTravelNotesDraft.class);
+        String orderBy = MyOrderParam.buildOrderBy(orderParam, TourismProjectTravelNotesDraft.class);
+        List<TourismProjectTravelNotesDraft> tourismProjectTravelNotesDraftList =
+                tourismProjectTravelNotesDraftService.getTourismProjectTravelNotesDraftListWithRelation(tourismProjectTravelNotesDraftFilter, orderBy);
+        return ResponseResult.success(MyPageUtil.makeResponseData(tourismProjectTravelNotesDraftList, TourismProjectTravelNotesDraftVo.class));
+    }
+
+    /**
+     * 查看指定发布游记的草稿对象详情。
+     *
+     * @param id 指定对象主键Id。
+     * @return 应答结果对象,包含对象详情。
+     */
+    @SaCheckPermission("tourismProjectTravelNotesDraft.view")
+    @GetMapping("/view")
+    public ResponseResult<TourismProjectTravelNotesDraftVo> view(@RequestParam Long id) {
+        TourismProjectTravelNotesDraft tourismProjectTravelNotesDraft = tourismProjectTravelNotesDraftService.getByIdWithRelation(id, MyRelationParam.full());
+        if (tourismProjectTravelNotesDraft == null) {
+            return ResponseResult.error(ErrorCodeEnum.DATA_NOT_EXIST);
+        }
+        TourismProjectTravelNotesDraftVo tourismProjectTravelNotesDraftVo = MyModelUtil.copyTo(tourismProjectTravelNotesDraft, TourismProjectTravelNotesDraftVo.class);
+        return ResponseResult.success(tourismProjectTravelNotesDraftVo);
+    }
+
+    /**
+     * 附件文件下载。
+     * 这里将图片和其他类型的附件文件放到不同的父目录下,主要为了便于今后图片文件的迁移。
+     *
+     * @param id 附件所在记录的主键Id。
+     * @param fieldName 附件所属的字段名。
+     * @param filename  文件名。如果没有提供该参数,就从当前记录的指定字段中读取。
+     * @param asImage   下载文件是否为图片。
+     * @param response  Http 应答对象。
+     */
+//    @SaCheckPermission("tourismProjectTravelNotesDraft.view")
+    @OperationLog(type = SysOperationLogType.DOWNLOAD, saveResponse = false)
+    @GetMapping("/download")
+    public void download(
+            @RequestParam(required = false) Long id,
+            @RequestParam String fieldName,
+            @RequestParam String filename,
+            @RequestParam Boolean asImage,
+            HttpServletResponse response) {
+        if (MyCommonUtil.existBlankArgument(fieldName, filename, asImage)) {
+            response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
+            return;
+        }
+        // 使用try来捕获异常,是为了保证一旦出现异常可以返回500的错误状态,便于调试。
+        // 否则有可能给前端返回的是200的错误码。
+        try {
+            // 如果请求参数中没有包含主键Id,就判断该文件是否为当前session上传的。
+            if (id == null) {
+                if (!cacheHelper.existSessionUploadFile(filename)) {
+                    ResponseResult.output(HttpServletResponse.SC_FORBIDDEN);
+                    return;
+                }
+            } else {
+                TourismProjectTravelNotesDraft tourismProjectTravelNotesDraft = tourismProjectTravelNotesDraftService.getById(id);
+                if (tourismProjectTravelNotesDraft == null) {
+                    ResponseResult.output(HttpServletResponse.SC_NOT_FOUND);
+                    return;
+                }
+                String fieldJsonData = (String) ReflectUtil.getFieldValue(tourismProjectTravelNotesDraft, fieldName);
+                if (fieldJsonData == null && !cacheHelper.existSessionUploadFile(filename)) {
+                    ResponseResult.output(HttpServletResponse.SC_BAD_REQUEST);
+                    return;
+                }
+                if (!BaseUpDownloader.containFile(fieldJsonData, filename)
+                        && !cacheHelper.existSessionUploadFile(filename)) {
+                    ResponseResult.output(HttpServletResponse.SC_FORBIDDEN);
+                    return;
+                }
+            }
+            UploadStoreInfo storeInfo = MyModelUtil.getUploadStoreInfo(TourismProjectTravelNotesDraft.class, fieldName);
+            if (!storeInfo.isSupportUpload()) {
+                ResponseResult.output(HttpServletResponse.SC_NOT_IMPLEMENTED,
+                        ResponseResult.error(ErrorCodeEnum.INVALID_UPLOAD_FIELD));
+                return;
+            }
+            BaseUpDownloader upDownloader = upDownloaderFactory.get(storeInfo.getStoreType());
+            upDownloader.doDownload(appConfig.getUploadFileBaseDir(),
+                    TourismProjectTravelNotesDraft.class.getSimpleName(), fieldName, filename, asImage, response);
+        } catch (Exception e) {
+            response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
+            log.error(e.getMessage(), e);
+        }
+    }
+
+    /**
+     * 文件上传操作。
+     *
+     * @param fieldName  上传文件名。
+     * @param asImage    是否作为图片上传。如果是图片,今后下载的时候无需权限验证。否则就是附件上传,下载时需要权限验证。
+     * @param uploadFile 上传文件对象。
+     */
+//    @SaCheckPermission("tourismProjectTravelNotesDraft.view")
+    @OperationLog(type = SysOperationLogType.UPLOAD, saveResponse = false)
+    @PostMapping("/upload")
+    public void upload(
+            @RequestParam String fieldName,
+            @RequestParam Boolean asImage,
+            @RequestParam("uploadFile") MultipartFile uploadFile) throws IOException {
+        UploadStoreInfo storeInfo = MyModelUtil.getUploadStoreInfo(TourismProjectTravelNotesDraft.class, fieldName);
+        // 这里就会判断参数中指定的字段,是否支持上传操作。
+        if (!storeInfo.isSupportUpload()) {
+            ResponseResult.output(HttpServletResponse.SC_FORBIDDEN,
+                    ResponseResult.error(ErrorCodeEnum.INVALID_UPLOAD_FIELD));
+            return;
+        }
+        // 根据字段注解中的存储类型,通过工厂方法获取匹配的上传下载实现类,从而解耦。
+        BaseUpDownloader upDownloader = upDownloaderFactory.get(storeInfo.getStoreType());
+        UploadResponseInfo responseInfo = upDownloader.doUpload(null,
+                appConfig.getUploadFileBaseDir(), TourismProjectTravelNotesDraft.class.getSimpleName(), fieldName, asImage, uploadFile);
+        if (Boolean.TRUE.equals(responseInfo.getUploadFailed())) {
+            ResponseResult.output(HttpServletResponse.SC_FORBIDDEN,
+                    ResponseResult.error(ErrorCodeEnum.UPLOAD_FAILED, responseInfo.getErrorMessage()));
+            return;
+        }
+        cacheHelper.putSessionUploadFile(responseInfo.getFilename());
+        ResponseResult.output(ResponseResult.success(responseInfo));
+    }
+
+    private ResponseResult<Void> doDelete(Long id) {
+        String errorMessage;
+        // 验证关联Id的数据合法性
+        TourismProjectTravelNotesDraft originalTourismProjectTravelNotesDraft = tourismProjectTravelNotesDraftService.getById(id);
+        if (originalTourismProjectTravelNotesDraft == null) {
+            // NOTE: 修改下面方括号中的话述
+            errorMessage = "数据验证失败,当前 [对象] 并不存在,请刷新后重试!";
+            return ResponseResult.error(ErrorCodeEnum.DATA_NOT_EXIST, errorMessage);
+        }
+        if (!tourismProjectTravelNotesDraftService.remove(id)) {
+            errorMessage = "数据操作失败,删除的对象不存在,请刷新后重试!";
+            return ResponseResult.error(ErrorCodeEnum.DATA_NOT_EXIST, errorMessage);
+        }
+        return ResponseResult.success();
+    }
+}

+ 33 - 0
application-webadmin/src/main/java/com/tourism/webadmin/back/dao/TourismProjectTravelNotesContentDraftMapper.java

@@ -0,0 +1,33 @@
+package com.tourism.webadmin.back.dao;
+
+import com.tourism.common.core.base.dao.BaseDaoMapper;
+import com.tourism.webadmin.back.model.TourismProjectTravelNotesContentDraft;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.*;
+
+/**
+ * 发布游记的草稿的文本框数据操作访问接口。
+ *
+ * @author 吃饭睡觉
+ * @date 2024-09-06
+ */
+public interface TourismProjectTravelNotesContentDraftMapper extends BaseDaoMapper<TourismProjectTravelNotesContentDraft> {
+
+    /**
+     * 批量插入对象列表。
+     *
+     * @param tourismProjectTravelNotesContentDraftList 新增对象列表。
+     */
+    void insertList(List<TourismProjectTravelNotesContentDraft> tourismProjectTravelNotesContentDraftList);
+
+    /**
+     * 获取过滤后的对象列表。
+     *
+     * @param tourismProjectTravelNotesContentDraftFilter 主表过滤对象。
+     * @param orderBy 排序字符串,order by从句的参数。
+     * @return 对象列表。
+     */
+    List<TourismProjectTravelNotesContentDraft> getTourismProjectTravelNotesContentDraftList(
+            @Param("tourismProjectTravelNotesContentDraftFilter") TourismProjectTravelNotesContentDraft tourismProjectTravelNotesContentDraftFilter, @Param("orderBy") String orderBy);
+}

+ 33 - 0
application-webadmin/src/main/java/com/tourism/webadmin/back/dao/TourismProjectTravelNotesDraftMapper.java

@@ -0,0 +1,33 @@
+package com.tourism.webadmin.back.dao;
+
+import com.tourism.common.core.base.dao.BaseDaoMapper;
+import com.tourism.webadmin.back.model.TourismProjectTravelNotesDraft;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.*;
+
+/**
+ * 发布游记的草稿数据操作访问接口。
+ *
+ * @author 吃饭睡觉
+ * @date 2024-09-06
+ */
+public interface TourismProjectTravelNotesDraftMapper extends BaseDaoMapper<TourismProjectTravelNotesDraft> {
+
+    /**
+     * 批量插入对象列表。
+     *
+     * @param tourismProjectTravelNotesDraftList 新增对象列表。
+     */
+    void insertList(List<TourismProjectTravelNotesDraft> tourismProjectTravelNotesDraftList);
+
+    /**
+     * 获取过滤后的对象列表。
+     *
+     * @param tourismProjectTravelNotesDraftFilter 主表过滤对象。
+     * @param orderBy 排序字符串,order by从句的参数。
+     * @return 对象列表。
+     */
+    List<TourismProjectTravelNotesDraft> getTourismProjectTravelNotesDraftList(
+            @Param("tourismProjectTravelNotesDraftFilter") TourismProjectTravelNotesDraft tourismProjectTravelNotesDraftFilter, @Param("orderBy") String orderBy);
+}

+ 33 - 0
application-webadmin/src/main/java/com/tourism/webadmin/back/dao/TourismTravelNotesContentWriteMapper.java

@@ -0,0 +1,33 @@
+package com.tourism.webadmin.back.dao;
+
+import com.tourism.common.core.base.dao.BaseDaoMapper;
+import com.tourism.webadmin.back.model.TourismTravelNotesContentWrite;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.*;
+
+/**
+ * 发布游记的文本框数据操作访问接口。
+ *
+ * @author 吃饭睡觉
+ * @date 2024-09-06
+ */
+public interface TourismTravelNotesContentWriteMapper extends BaseDaoMapper<TourismTravelNotesContentWrite> {
+
+    /**
+     * 批量插入对象列表。
+     *
+     * @param tourismTravelNotesContentWriteList 新增对象列表。
+     */
+    void insertList(List<TourismTravelNotesContentWrite> tourismTravelNotesContentWriteList);
+
+    /**
+     * 获取过滤后的对象列表。
+     *
+     * @param tourismTravelNotesContentWriteFilter 主表过滤对象。
+     * @param orderBy 排序字符串,order by从句的参数。
+     * @return 对象列表。
+     */
+    List<TourismTravelNotesContentWrite> getTourismTravelNotesContentWriteList(
+            @Param("tourismTravelNotesContentWriteFilter") TourismTravelNotesContentWrite tourismTravelNotesContentWriteFilter, @Param("orderBy") String orderBy);
+}

+ 69 - 0
application-webadmin/src/main/java/com/tourism/webadmin/back/dao/mapper/TourismProjectTravelNotesContentDraftMapper.xml

@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.tourism.webadmin.back.dao.TourismProjectTravelNotesContentDraftMapper">
+    <resultMap id="BaseResultMap" type="com.tourism.webadmin.back.model.TourismProjectTravelNotesContentDraft">
+        <id column="id" jdbcType="BIGINT" property="id"/>
+        <result column="association_id" jdbcType="BIGINT" property="associationId"/>
+        <result column="create_user_id" jdbcType="BIGINT" property="createUserId"/>
+        <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
+        <result column="update_user_id" jdbcType="BIGINT" property="updateUserId"/>
+        <result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
+        <result column="data_state" jdbcType="TINYINT" property="dataState"/>
+        <result column="type" jdbcType="VARCHAR" property="type"/>
+        <result column="content" jdbcType="VARCHAR" property="content"/>
+        <result column="cover" jdbcType="TINYINT" property="cover"/>
+    </resultMap>
+
+    <insert id="insertList">
+        INSERT INTO tour_tourism_travel_notes_content_draft
+        (id,
+        association_id,
+        create_user_id,
+        create_time,
+        update_user_id,
+        update_time,
+        data_state,
+        type,
+        content,
+        cover)
+        VALUES
+        <foreach collection="list" index="index" item="item" separator="," >
+            (#{item.id},
+            #{item.associationId},
+            #{item.createUserId},
+            #{item.createTime},
+            #{item.updateUserId},
+            #{item.updateTime},
+            #{item.dataState},
+            #{item.type},
+            #{item.content},
+            #{item.cover})
+        </foreach>
+    </insert>
+
+    <!-- 如果有逻辑删除字段过滤,请写到这里 -->
+    <sql id="filterRef">
+        <!-- 这里必须加上全包名,否则当filterRef被其他Mapper.xml包含引用的时候,就会调用Mapper.xml中的该SQL片段 -->
+        <include refid="com.tourism.webadmin.back.dao.TourismProjectTravelNotesContentDraftMapper.inputFilterRef"/>
+        AND tour_tourism_travel_notes_content_draft.data_state = ${@com.tourism.common.core.constant.GlobalDeletedFlag@NORMAL}
+    </sql>
+
+    <!-- 这里仅包含调用接口输入的主表过滤条件 -->
+    <sql id="inputFilterRef">
+        <if test="tourismProjectTravelNotesContentDraftFilter != null">
+            <if test="tourismProjectTravelNotesContentDraftFilter.associationId != null">
+                AND tour_tourism_travel_notes_content_draft.association_id = #{tourismProjectTravelNotesContentDraftFilter.associationId}
+            </if>
+        </if>
+    </sql>
+
+    <select id="getTourismProjectTravelNotesContentDraftList" resultMap="BaseResultMap" parameterType="com.tourism.webadmin.back.model.TourismProjectTravelNotesContentDraft">
+        SELECT * FROM tour_tourism_travel_notes_content_draft
+        <where>
+            <include refid="filterRef"/>
+        </where>
+        <if test="orderBy != null and orderBy != ''">
+            ORDER BY ${orderBy}
+        </if>
+    </select>
+</mapper>

+ 86 - 0
application-webadmin/src/main/java/com/tourism/webadmin/back/dao/mapper/TourismProjectTravelNotesDraftMapper.xml

@@ -0,0 +1,86 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.tourism.webadmin.back.dao.TourismProjectTravelNotesDraftMapper">
+    <resultMap id="BaseResultMap" type="com.tourism.webadmin.back.model.TourismProjectTravelNotesDraft">
+        <id column="id" jdbcType="BIGINT" property="id"/>
+        <result column="project_title" jdbcType="VARCHAR" property="projectTitle"/>
+        <result column="departure_time" jdbcType="DATE" property="departureTime"/>
+        <result column="count_times" jdbcType="VARCHAR" property="countTimes"/>
+        <result column="role" jdbcType="VARCHAR" property="role"/>
+        <result column="recommendation_rate" jdbcType="TINYINT" property="recommendationRate"/>
+        <result column="average_cost" jdbcType="VARCHAR" property="averageCost"/>
+        <result column="create_user_id" jdbcType="BIGINT" property="createUserId"/>
+        <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
+        <result column="update_user_id" jdbcType="BIGINT" property="updateUserId"/>
+        <result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
+        <result column="data_state" jdbcType="TINYINT" property="dataState"/>
+        <result column="tourism_tavel_notes_url" jdbcType="VARCHAR" property="tourismTavelNotesUrl"/>
+        <result column="travel_notes_banner_url" jdbcType="VARCHAR" property="travelNotesBannerUrl"/>
+    </resultMap>
+
+    <insert id="insertList">
+        INSERT INTO tour_tourism_project_travel_notes_draft
+            (id,
+            project_title,
+            departure_time,
+            count_times,
+            role,
+            recommendation_rate,
+            average_cost,
+            create_user_id,
+            create_time,
+            update_user_id,
+            update_time,
+            data_state,
+            tourism_tavel_notes_url,
+            travel_notes_banner_url)
+        VALUES
+        <foreach collection="list" index="index" item="item" separator="," >
+            (#{item.id},
+            #{item.projectTitle},
+            #{item.departureTime},
+            #{item.countTimes},
+            #{item.role},
+            #{item.recommendationRate},
+            #{item.averageCost},
+            #{item.createUserId},
+            #{item.createTime},
+            #{item.updateUserId},
+            #{item.updateTime},
+            #{item.dataState},
+            #{item.tourismTavelNotesUrl},
+            #{item.travelNotesBannerUrl})
+        </foreach>
+    </insert>
+
+    <!-- 如果有逻辑删除字段过滤,请写到这里 -->
+    <sql id="filterRef">
+        <!-- 这里必须加上全包名,否则当filterRef被其他Mapper.xml包含引用的时候,就会调用Mapper.xml中的该SQL片段 -->
+        <include refid="com.tourism.webadmin.back.dao.TourismProjectTravelNotesDraftMapper.inputFilterRef"/>
+        AND tour_tourism_project_travel_notes_draft.data_state = ${@com.tourism.common.core.constant.GlobalDeletedFlag@NORMAL}
+    </sql>
+
+    <!-- 这里仅包含调用接口输入的主表过滤条件 -->
+    <sql id="inputFilterRef">
+        <if test="tourismProjectTravelNotesDraftFilter != null">
+            <if test="tourismProjectTravelNotesDraftFilter.projectTitle != null and tourismProjectTravelNotesDraftFilter.projectTitle != ''">
+                <bind name = "safeTourismProjectTravelNotesDraftProjectTitle" value = "'%' + tourismProjectTravelNotesDraftFilter.projectTitle + '%'" />
+                AND tour_tourism_project_travel_notes_draft.project_title LIKE #{safeTourismProjectTravelNotesDraftProjectTitle}
+            </if>
+            <if test="tourismProjectTravelNotesDraftFilter.searchString != null and tourismProjectTravelNotesDraftFilter.searchString != ''">
+                <bind name = "safeTourismProjectTravelNotesDraftSearchString" value = "'%' + tourismProjectTravelNotesDraftFilter.searchString + '%'" />
+                AND IFNULL(tour_tourism_project_travel_notes_draft.project_title,'') LIKE #{safeTourismProjectTravelNotesDraftSearchString}
+            </if>
+        </if>
+    </sql>
+
+    <select id="getTourismProjectTravelNotesDraftList" resultMap="BaseResultMap" parameterType="com.tourism.webadmin.back.model.TourismProjectTravelNotesDraft">
+        SELECT * FROM tour_tourism_project_travel_notes_draft
+        <where>
+            <include refid="filterRef"/>
+        </where>
+        <if test="orderBy != null and orderBy != ''">
+            ORDER BY ${orderBy}
+        </if>
+    </select>
+</mapper>

+ 18 - 19
application-webadmin/src/main/java/com/tourism/webadmin/back/dao/mapper/TourismProjectTravelNotesWriteMapper.xml

@@ -12,33 +12,32 @@
         <result column="state" jdbcType="TINYINT" property="state"/>
         <result column="reason" jdbcType="VARCHAR" property="reason"/>
         <result column="create_user_id" jdbcType="BIGINT" property="createUserId"/>
-        <result column="tourism_url" jdbcType="VARCHAR" property="tourismUrl"/>
+        <result column="travel_notes_banner_url" jdbcType="VARCHAR" property="travelNotesBannerUrl"/>
         <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
         <result column="update_user_id" jdbcType="BIGINT" property="updateUserId"/>
         <result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
         <result column="data_state" jdbcType="TINYINT" property="dataState"/>
         <result column="tourism_tavel_notes_url" jdbcType="VARCHAR" property="tourismTavelNotesUrl"/>
-<!--        <result column="is_complete" jdbcType="TINYINT" property="isComplete"/>-->
     </resultMap>
 
     <insert id="insertList">
         INSERT INTO tour_tourism_project_travel_notes_writer
-            (id,
-            project_title,
-            departure_time,
-            count_times,
-            role,
-            recommendation_rate,
-            average_cost,
-            state,
-            reason,
-            create_user_id,
-            tourism_url,
-            create_time,
-            update_user_id,
-            update_time,
-            data_state,
-            tourism_tavel_notes_url)
+        (id,
+        project_title,
+        departure_time,
+        count_times,
+        role,
+        recommendation_rate,
+        average_cost,
+        state,
+        reason,
+        create_user_id,
+        travel_notes_banner_url,
+        create_time,
+        update_user_id,
+        update_time,
+        data_state,
+        tourism_tavel_notes_url)
         VALUES
         <foreach collection="list" index="index" item="item" separator="," >
             (#{item.id},
@@ -51,7 +50,7 @@
             #{item.state},
             #{item.reason},
             #{item.createUserId},
-            #{item.tourismUrl},
+            #{item.travelNotesBannerUrl},
             #{item.createTime},
             #{item.updateUserId},
             #{item.updateTime},

+ 18 - 13
application-webadmin/src/main/java/com/tourism/webadmin/back/dao/mapper/TourismTravelNotesContentWriteMapper.xml

@@ -3,35 +3,38 @@
 <mapper namespace="com.tourism.webadmin.back.dao.TourismTravelNotesContentWriteMapper">
     <resultMap id="BaseResultMap" type="com.tourism.webadmin.back.model.TourismTravelNotesContentWrite">
         <id column="id" jdbcType="BIGINT" property="id"/>
-        <result column="content" jdbcType="LONGVARCHAR" property="content"/>
         <result column="association_id" jdbcType="BIGINT" property="associationId"/>
         <result column="create_user_id" jdbcType="BIGINT" property="createUserId"/>
         <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
         <result column="update_user_id" jdbcType="BIGINT" property="updateUserId"/>
         <result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
-        <result column="data_state" jdbcType="TINYINT" property="dataState"/>
+        <result column="type" jdbcType="VARCHAR" property="type"/>
+        <result column="content" jdbcType="VARCHAR" property="content"/>
+        <result column="cover" jdbcType="TINYINT" property="cover"/>
     </resultMap>
 
     <insert id="insertList">
         INSERT INTO tour_tourism_travel_notes_content_writer
-            (id,
-            content,
-            association_id,
-            create_user_id,
-            create_time,
-            update_user_id,
-            update_time,
-            data_state)
+        (id,
+        association_id,
+        create_user_id,
+        create_time,
+        update_user_id,
+        update_time,
+        type,
+        content,
+        cover)
         VALUES
         <foreach collection="list" index="index" item="item" separator="," >
             (#{item.id},
-            #{item.content},
             #{item.associationId},
             #{item.createUserId},
             #{item.createTime},
             #{item.updateUserId},
             #{item.updateTime},
-            #{item.dataState})
+            #{item.type},
+            #{item.content},
+            #{item.cover})
         </foreach>
     </insert>
 
@@ -39,12 +42,14 @@
     <sql id="filterRef">
         <!-- 这里必须加上全包名,否则当filterRef被其他Mapper.xml包含引用的时候,就会调用Mapper.xml中的该SQL片段 -->
         <include refid="com.tourism.webadmin.back.dao.TourismTravelNotesContentWriteMapper.inputFilterRef"/>
-        AND tour_tourism_travel_notes_content_writer.data_state = ${@com.tourism.common.core.constant.GlobalDeletedFlag@NORMAL}
     </sql>
 
     <!-- 这里仅包含调用接口输入的主表过滤条件 -->
     <sql id="inputFilterRef">
         <if test="tourismTravelNotesContentWriteFilter != null">
+            <if test="tourismTravelNotesContentWriteFilter.associationId != null">
+                AND tour_tourism_travel_notes_content_writer.association_id = #{tourismTravelNotesContentWriteFilter.associationId}
+            </if>
         </if>
     </sql>
 

+ 49 - 0
application-webadmin/src/main/java/com/tourism/webadmin/back/dto/TourismProjectTravelNotesContentDraftDto.java

@@ -0,0 +1,49 @@
+package com.tourism.webadmin.back.dto;
+
+import com.tourism.common.core.validator.UpdateGroup;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+import jakarta.validation.constraints.*;
+
+/**
+ * 发布游记的草稿的文本框Dto对象。
+ *
+ * @author 吃饭睡觉
+ * @date 2024-09-06
+ */
+@Schema(description = "发布游记的草稿的文本框Dto对象")
+@Data
+public class TourismProjectTravelNotesContentDraftDto {
+
+    /**
+     * 主键id。
+     */
+    @Schema(description = "主键id。", requiredMode = Schema.RequiredMode.REQUIRED)
+    @NotNull(message = "数据验证失败,主键id不能为空!", groups = {UpdateGroup.class})
+    private Long id;
+
+    /**
+     * 关联表id。
+     */
+    @Schema(description = "关联表id。", requiredMode = Schema.RequiredMode.REQUIRED)
+    @NotNull(message = "数据验证失败,关联表id不能为空!", groups = {UpdateGroup.class})
+    private Long associationId;
+
+    /**
+     * 类型。
+     */
+    @Schema(description = "类型。")
+    private String type;
+
+    /**
+     * 内容。
+     */
+    @Schema(description = "内容。")
+    private String content;
+
+    /**
+     * 是否为封面图。
+     */
+    @Schema(description = "是否为封面图。")
+    private Integer cover;
+}

+ 97 - 0
application-webadmin/src/main/java/com/tourism/webadmin/back/dto/TourismProjectTravelNotesDraftDto.java

@@ -0,0 +1,97 @@
+package com.tourism.webadmin.back.dto;
+
+import com.tourism.common.core.validator.UpdateGroup;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+import jakarta.validation.constraints.*;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 发布游记的草稿Dto对象。
+ *
+ * @author 吃饭睡觉
+ * @date 2024-09-06
+ */
+@Schema(description = "发布游记的草稿Dto对象")
+@Data
+public class TourismProjectTravelNotesDraftDto {
+
+    /**
+     * 主键id。
+     */
+    @Schema(description = "主键id。", requiredMode = Schema.RequiredMode.REQUIRED)
+    @NotNull(message = "数据验证失败,主键id不能为空!", groups = {UpdateGroup.class})
+    private Long id;
+
+    /**
+     * 游记标题。
+     * NOTE: 可支持等于操作符的列表数据过滤。
+     */
+    @Schema(description = "游记标题。可支持等于操作符的列表数据过滤。")
+    @NotNull(message = "数据验证失败,主键id不能为空!", groups = {UpdateGroup.class})
+    private String projectTitle;
+
+    /**
+     * 出发时间。
+     */
+    @Schema(description = "出发时间。")
+    @NotNull(message = "数据验证失败,主键id不能为空!", groups = {UpdateGroup.class})
+    private Date departureTime;
+
+    /**
+     * 出行天数。
+     */
+    @Schema(description = "出行天数。")
+    @NotNull(message = "数据验证失败,主键id不能为空!", groups = {UpdateGroup.class})
+    private String countTimes;
+
+    /**
+     * 人物关系。
+     */
+    @Schema(description = "人物关系。")
+    @NotNull(message = "数据验证失败,主键id不能为空!", groups = {UpdateGroup.class})
+    private String role;
+
+    /**
+     * 推荐指数。
+     */
+    @Schema(description = "推荐指数。")
+    @NotNull(message = "数据验证失败,主键id不能为空!", groups = {UpdateGroup.class})
+    private Integer recommendationRate;
+
+    /**
+     * 人均费用。
+     */
+    @Schema(description = "人均费用。")
+    @NotNull(message = "数据验证失败,主键id不能为空!", groups = {UpdateGroup.class})
+    private String averageCost;
+
+//    /**
+//     * 游记内容中的图片。
+//     */
+//    @Schema(description = "游记内容中的图片。")
+//    private String tourismTavelNotesUrl;
+
+    /**
+     * 发布游记的banner图。
+     */
+    @Schema(description = "发布游记的banner图。")
+    @NotNull(message = "数据验证失败,主键id不能为空!", groups = {UpdateGroup.class})
+    private String travelNotesBannerUrl;
+
+    /**
+     * 游记内容。
+     */
+    @Schema(description = "游记内容。")
+    @NotNull(message = "数据验证失败,主键id不能为空!", groups = {UpdateGroup.class})
+    private List<TourismProjectTravelNotesContentDraftDto> travelNotesContent;
+
+    /**
+     * project_title LIKE搜索字符串。
+     * NOTE: 可支持LIKE操作符的列表数据过滤。
+     */
+    @Schema(description = "LIKE模糊搜索字符串")
+    private String searchString;
+
+}

+ 11 - 11
application-webadmin/src/main/java/com/tourism/webadmin/back/dto/TourismProjectTravelNotesWriteDto.java

@@ -10,6 +10,7 @@ import lombok.Data;
 import jakarta.validation.constraints.*;
 
 import java.util.Date;
+import java.util.List;
 
 /**
  * 发布游记Dto对象。
@@ -86,10 +87,10 @@ public class TourismProjectTravelNotesWriteDto {
     private String reason;
 
     /**
-     * 项目展示图片
+     * 发布游记的banner图
      */
-    @Schema(description = "项目展示图片。")
-    private String tourismUrl;
+    @Schema(description = "发布游记的banner图。")
+    private String travelNotesBannerUrl;
 
     /**
      * 游记内容中的图片。
@@ -97,14 +98,6 @@ public class TourismProjectTravelNotesWriteDto {
     @Schema(description = "游记内容中的图片。")
     private String tourismTavelNotesUrl;
 
-//    /**
-//     * 是否完成(0,草稿;1,成稿)。
-//     * NOTE: 可支持等于操作符的列表数据过滤。
-//     */
-//    @Schema(description = "是否完成(0,草稿;1,成稿)。可支持等于操作符的列表数据过滤。")
-//    @ConstDictRef(constDictClass = IsComplete.class, message = "数据验证失败,是否完成(0,草稿;1,成稿)为无效值!")
-//    private Integer isComplete;
-
     /**
      * departureTime 范围过滤起始值(>=)。
      * NOTE: 可支持范围操作符的列表数据过滤。
@@ -139,4 +132,11 @@ public class TourismProjectTravelNotesWriteDto {
      */
     @Schema(description = "LIKE模糊搜索字符串")
     private String searchString;
+
+    /**
+     * 游记内容。
+     */
+    @Schema(description = "游记内容。")
+    @NotNull(message = "数据验证失败,主键id不能为空!", groups = {UpdateGroup.class})
+    private List<TourismTravelNotesContentWriteDto> travelNotesContent;
 }

+ 18 - 6
application-webadmin/src/main/java/com/tourism/webadmin/back/dto/TourismTravelNotesContentWriteDto.java

@@ -25,15 +25,27 @@ public class TourismTravelNotesContentWriteDto {
     private Long id;
 
     /**
-     * 富文本内容。
-     */
-    @Schema(description = "富文本内容。")
-    private String content;
-
-    /**
      * 关联表id。
      */
     @Schema(description = "关联表id。", requiredMode = Schema.RequiredMode.REQUIRED)
     @NotNull(message = "数据验证失败,关联表id不能为空!", groups = {UpdateGroup.class})
     private Long associationId;
+
+    /**
+     * 类型。
+     */
+    @Schema(description = "类型。")
+    private String type;
+
+    /**
+     * 内容。
+     */
+    @Schema(description = "内容。")
+    private String content;
+
+    /**
+     * 是否为封面图。
+     */
+    @Schema(description = "是否为封面图。")
+    private Integer cover;
 }

+ 55 - 0
application-webadmin/src/main/java/com/tourism/webadmin/back/model/TourismProjectTravelNotesContentDraft.java

@@ -0,0 +1,55 @@
+package com.tourism.webadmin.back.model;
+
+import com.baomidou.mybatisplus.annotation.*;
+import com.tourism.common.core.base.model.BaseModel;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 发布游记的草稿的文本框实体对象。
+ *
+ * @author 吃饭睡觉
+ * @date 2024-09-06
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@TableName(value = "tour_tourism_travel_notes_content_draft")
+public class TourismProjectTravelNotesContentDraft extends BaseModel {
+
+    /**
+     * 主键id。
+     */
+    @TableId(value = "id", type = IdType.AUTO)
+    private Long id;
+
+    /**
+     * 关联表id。
+     */
+    @TableField(value = "association_id")
+    private Long associationId;
+
+    /**
+     * 逻辑删除标记字段(1: 正常 -1: 已删除)。
+     */
+    @TableLogic
+    @TableField(value = "data_state")
+    private Integer dataState;
+
+    /**
+     * 类型。
+     */
+    @TableField(value = "type")
+    private String type;
+
+    /**
+     * 内容。
+     */
+    @TableField(value = "content")
+    private String content;
+
+    /**
+     * 是否为封面图。
+     */
+    @TableField(value = "cover")
+    private Integer cover;
+}

+ 103 - 0
application-webadmin/src/main/java/com/tourism/webadmin/back/model/TourismProjectTravelNotesDraft.java

@@ -0,0 +1,103 @@
+package com.tourism.webadmin.back.model;
+
+import com.baomidou.mybatisplus.annotation.*;
+import com.tourism.common.core.util.MyCommonUtil;
+import com.tourism.common.core.upload.UploadStoreTypeEnum;
+import com.tourism.common.core.annotation.*;
+import com.tourism.common.core.base.model.BaseModel;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 发布游记的草稿实体对象。
+ *
+ * @author 吃饭睡觉
+ * @date 2024-09-06
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@TableName(value = "tour_tourism_project_travel_notes_draft")
+public class TourismProjectTravelNotesDraft extends BaseModel {
+
+    /**
+     * 主键id。
+     */
+    @TableId(value = "id")
+    private Long id;
+
+    /**
+     * 游记标题。
+     */
+    @TableField(value = "project_title")
+    private String projectTitle;
+
+    /**
+     * 出发时间。
+     */
+    @TableField(value = "departure_time")
+    private Date departureTime;
+
+    /**
+     * 出行天数。
+     */
+    @TableField(value = "count_times")
+    private String countTimes;
+
+    /**
+     * 人物关系。
+     */
+    @TableField(value = "role")
+    private String role;
+
+    /**
+     * 推荐指数。
+     */
+    @TableField(value = "recommendation_rate")
+    private Integer recommendationRate;
+
+    /**
+     * 人均费用。
+     */
+    @TableField(value = "average_cost")
+    private String averageCost;
+
+    /**
+     * 逻辑删除标记字段(1: 正常 -1: 已删除)。
+     */
+    @TableLogic
+    @TableField(value = "data_state")
+    private Integer dataState;
+
+    /**
+     * 游记内容中的图片。
+     */
+    @UploadFlagColumn(storeType = UploadStoreTypeEnum.HUAWEI_OBS_SYSTEM)
+    @TableField(value = "tourism_tavel_notes_url")
+    private String tourismTavelNotesUrl;
+
+    /**
+     * 发布游记的banner图。
+     */
+    @UploadFlagColumn(storeType = UploadStoreTypeEnum.HUAWEI_OBS_SYSTEM)
+    @TableField(value = "travel_notes_banner_url")
+    private String travelNotesBannerUrl;
+
+    /**
+     * project_title LIKE搜索字符串。
+     */
+    @TableField(exist = false)
+    private String searchString;
+
+    public void setSearchString(String searchString) {
+        this.searchString = MyCommonUtil.replaceSqlWildcard(searchString);
+    }
+
+    @RelationOneToMany(
+            masterIdField = "id",
+            slaveModelClass = TourismProjectTravelNotesContentDraft.class,
+            slaveIdField = "associationId")
+    @TableField(exist = false)
+    private List<TourismProjectTravelNotesContentDraft> tourismProjectTravelNotesContentDraft;
+}

+ 10 - 21
application-webadmin/src/main/java/com/tourism/webadmin/back/model/TourismProjectTravelNotesWrite.java

@@ -10,6 +10,7 @@ import lombok.Data;
 import lombok.EqualsAndHashCode;
 
 import java.util.Date;
+import java.util.List;
 import java.util.Map;
 
 /**
@@ -78,11 +79,11 @@ public class TourismProjectTravelNotesWrite extends BaseModel {
     private String reason;
 
     /**
-     * 项目展示图片
+     * 发布游记的banner图
      */
     @UploadFlagColumn(storeType = UploadStoreTypeEnum.HUAWEI_OBS_SYSTEM)
-    @TableField(value = "tourism_url")
-    private String tourismUrl;
+    @TableField(value = "travel_notes_banner_url")
+    private String travelNotesBannerUrl;
 
     /**
      * 逻辑删除标记字段(1: 正常 -1: 已删除)。
@@ -98,12 +99,6 @@ public class TourismProjectTravelNotesWrite extends BaseModel {
     @TableField(value = "tourism_tavel_notes_url")
     private String tourismTavelNotesUrl;
 
-//    /**
-//     * 是否完成(0,草稿;1,成稿)。
-//     */
-//    @TableField(value = "is_complete")
-//    private Integer isComplete;
-
     /**
      * departureTime 范围过滤起始值(>=)。
      */
@@ -138,22 +133,16 @@ public class TourismProjectTravelNotesWrite extends BaseModel {
         this.searchString = MyCommonUtil.replaceSqlWildcard(searchString);
     }
 
-    @RelationOneToOne(
-            masterIdField = "id",
-            slaveModelClass = TourismTravelNotesContentWrite.class,
-            slaveIdField = "associationId")
-    @TableField(exist = false)
-    private TourismTravelNotesContentWrite tourismTravelNotesContentWrite;
-
     @RelationConstDict(
             masterIdField = "state",
             constantDictClass = AuditState.class)
     @TableField(exist = false)
     private Map<String, Object> stateDictMap;
 
-//    @RelationConstDict(
-//            masterIdField = "isComplete",
-//            constantDictClass = IsComplete.class)
-//    @TableField(exist = false)
-//    private Map<String, Object> isCompleteDictMap;
+    @RelationOneToMany(
+            masterIdField = "id",
+            slaveModelClass = TourismProjectTravelNotesContentDraft.class,
+            slaveIdField = "associationId")
+    @TableField(exist = false)
+    private List<TourismProjectTravelNotesContentDraft> tourismProjectTravelNotesContentDraft;
 }

+ 18 - 6
application-webadmin/src/main/java/com/tourism/webadmin/back/model/TourismTravelNotesContentWrite.java

@@ -23,12 +23,6 @@ public class TourismTravelNotesContentWrite extends BaseModel {
     private Long id;
 
     /**
-     * 富文本内容。
-     */
-    @TableField(value = "content")
-    private String content;
-
-    /**
      * 关联表id。
      */
     @TableField(value = "association_id")
@@ -40,4 +34,22 @@ public class TourismTravelNotesContentWrite extends BaseModel {
     @TableLogic
     @TableField(value = "data_state")
     private Integer dataState;
+
+    /**
+     * 类型。
+     */
+    @TableField(value = "type")
+    private String type;
+
+    /**
+     * 内容。
+     */
+    @TableField(value = "content")
+    private String content;
+
+    /**
+     * 是否为封面图。
+     */
+    @TableField(value = "cover")
+    private Integer cover;
 }

+ 11 - 6
application-webadmin/src/main/java/com/tourism/webadmin/back/model/constant/AuditState.java

@@ -12,23 +12,28 @@ import java.util.Map;
 public final class AuditState {
 
     /**
-     * 审核。
+     * 审核。
      */
-    public static final int UNAUDITSTATE = 0;
+    public static final int UNAUDITSTATE = 1;
     /**
      * 审核未通过。
      */
-    public static final int FAILAUDIT = 1;
+    public static final int FAILAUDIT = 2;
     /**
      * 审核通过。
      */
-    public static final int SUCCEEDAUDIT = 2;
+    public static final int SUCCEEDAUDIT = 3;
+    /**
+     * 草稿。
+     */
+    public static final int DRAFT = 0;
 
-    private static final Map<Object, String> DICT_MAP = new HashMap<>(3);
+    private static final Map<Object, String> DICT_MAP = new HashMap<>(4);
     static {
-        DICT_MAP.put(UNAUDITSTATE, "未审核");
+        DICT_MAP.put(UNAUDITSTATE, "审核");
         DICT_MAP.put(FAILAUDIT, "审核未通过");
         DICT_MAP.put(SUCCEEDAUDIT, "审核通过");
+        DICT_MAP.put(DRAFT, "草稿");
     }
 
     /**

+ 76 - 0
application-webadmin/src/main/java/com/tourism/webadmin/back/service/TourismProjectTravelNotesContentDraftService.java

@@ -0,0 +1,76 @@
+package com.tourism.webadmin.back.service;
+
+import com.tourism.webadmin.back.model.*;
+import com.tourism.common.core.base.service.IBaseService;
+
+import java.util.*;
+
+/**
+ * 发布游记的草稿的文本框数据操作服务接口。
+ *
+ * @author 吃饭睡觉
+ * @date 2024-09-06
+ */
+public interface TourismProjectTravelNotesContentDraftService extends IBaseService<TourismProjectTravelNotesContentDraft, Long> {
+
+    /**
+     * 保存新增对象。
+     *
+     * @param tourismProjectTravelNotesContentDraft 新增对象。
+     * @return 返回新增对象。
+     */
+    TourismProjectTravelNotesContentDraft saveNew(TourismProjectTravelNotesContentDraft tourismProjectTravelNotesContentDraft);
+
+    /**
+     * 利用数据库的insertList语法,批量插入对象列表。
+     *
+     * @param tourismProjectTravelNotesContentDraftList 新增对象列表。
+     */
+    void saveNewBatch(List<TourismProjectTravelNotesContentDraft> tourismProjectTravelNotesContentDraftList);
+
+    /**
+     * 更新数据对象。
+     *
+     * @param tourismProjectTravelNotesContentDraft         更新的对象。
+     * @param originalTourismProjectTravelNotesContentDraft 原有数据对象。
+     * @return 成功返回true,否则false。
+     */
+    boolean update(TourismProjectTravelNotesContentDraft tourismProjectTravelNotesContentDraft, TourismProjectTravelNotesContentDraft originalTourismProjectTravelNotesContentDraft);
+
+    /**
+     * 删除指定数据。
+     *
+     * @param id 主键Id。
+     * @return 成功返回true,否则false。
+     */
+    boolean remove(Long id);
+
+    /**
+     * 当前服务的支持表为从表,根据主表的关联Id,删除一对多的从表数据。
+     *
+     * @param associationId 从表关联字段。
+     * @return 删除数量。
+     */
+    int removeByAssociationId(Long associationId);
+
+    /**
+     * 获取单表查询结果。由于没有关联数据查询,因此在仅仅获取单表数据的场景下,效率更高。
+     * 如果需要同时获取关联数据,请移步(getTourismProjectTravelNotesContentDraftListWithRelation)方法。
+     *
+     * @param filter  过滤对象。
+     * @param orderBy 排序参数。
+     * @return 查询结果集。
+     */
+    List<TourismProjectTravelNotesContentDraft> getTourismProjectTravelNotesContentDraftList(TourismProjectTravelNotesContentDraft filter, String orderBy);
+
+    /**
+     * 获取主表的查询结果,以及主表关联的字典数据和一对一从表数据,以及一对一从表的字典数据。
+     * 该查询会涉及到一对一从表的关联过滤,或一对多从表的嵌套关联过滤,因此性能不如单表过滤。
+     * 如果仅仅需要获取主表数据,请移步(getTourismProjectTravelNotesContentDraftList),以便获取更好的查询性能。
+     *
+     * @param filter 主表过滤对象。
+     * @param orderBy 排序参数。
+     * @return 查询结果集。
+     */
+    List<TourismProjectTravelNotesContentDraft> getTourismProjectTravelNotesContentDraftListWithRelation(TourismProjectTravelNotesContentDraft filter, String orderBy);
+}

+ 88 - 0
application-webadmin/src/main/java/com/tourism/webadmin/back/service/TourismProjectTravelNotesDraftService.java

@@ -0,0 +1,88 @@
+package com.tourism.webadmin.back.service;
+
+import com.alibaba.fastjson.JSONObject;
+import com.tourism.webadmin.back.model.*;
+import com.tourism.common.core.base.service.IBaseService;
+
+import java.util.*;
+
+/**
+ * 发布游记的草稿数据操作服务接口。
+ *
+ * @author 吃饭睡觉
+ * @date 2024-09-06
+ */
+public interface TourismProjectTravelNotesDraftService extends IBaseService<TourismProjectTravelNotesDraft, Long> {
+
+    /**
+     * 保存新增对象。
+     *
+     * @param tourismProjectTravelNotesDraft 新增对象。
+     * @return 返回新增对象。
+     */
+    TourismProjectTravelNotesDraft saveNew(TourismProjectTravelNotesDraft tourismProjectTravelNotesDraft);
+
+    /**
+     * 利用数据库的insertList语法,批量插入对象列表。
+     *
+     * @param tourismProjectTravelNotesDraftList 新增对象列表。
+     */
+    void saveNewBatch(List<TourismProjectTravelNotesDraft> tourismProjectTravelNotesDraftList);
+
+    /**
+     * 保存新增主表对象及关联对象。
+     *
+     * @param tourismProjectTravelNotesDraft 新增主表对象。
+     * @param relationData 全部关联从表数据。
+     * @return 返回新增主表对象。
+     */
+    TourismProjectTravelNotesDraft saveNewWithRelation(TourismProjectTravelNotesDraft tourismProjectTravelNotesDraft, JSONObject relationData);
+
+    /**
+     * 更新数据对象。
+     *
+     * @param tourismProjectTravelNotesDraft         更新的对象。
+     * @param originalTourismProjectTravelNotesDraft 原有数据对象。
+     * @return 成功返回true,否则false。
+     */
+    boolean update(TourismProjectTravelNotesDraft tourismProjectTravelNotesDraft, TourismProjectTravelNotesDraft originalTourismProjectTravelNotesDraft);
+
+    /**
+     * 更新主表对象及关联对象。
+     *
+     * @param tourismProjectTravelNotesDraft 主表对象新数据。
+     * @param originalTourismProjectTravelNotesDraft 主表对象源数据。
+     * @param relationData 全部关联从表数据。
+     * @return 修改成功返回true,否则false。
+     */
+    boolean updateWithRelation(TourismProjectTravelNotesDraft tourismProjectTravelNotesDraft, TourismProjectTravelNotesDraft originalTourismProjectTravelNotesDraft, JSONObject relationData);
+
+    /**
+     * 删除指定数据。
+     *
+     * @param id 主键Id。
+     * @return 成功返回true,否则false。
+     */
+    boolean remove(Long id);
+
+    /**
+     * 获取单表查询结果。由于没有关联数据查询,因此在仅仅获取单表数据的场景下,效率更高。
+     * 如果需要同时获取关联数据,请移步(getTourismProjectTravelNotesDraftListWithRelation)方法。
+     *
+     * @param filter  过滤对象。
+     * @param orderBy 排序参数。
+     * @return 查询结果集。
+     */
+    List<TourismProjectTravelNotesDraft> getTourismProjectTravelNotesDraftList(TourismProjectTravelNotesDraft filter, String orderBy);
+
+    /**
+     * 获取主表的查询结果,以及主表关联的字典数据和一对一从表数据,以及一对一从表的字典数据。
+     * 该查询会涉及到一对一从表的关联过滤,或一对多从表的嵌套关联过滤,因此性能不如单表过滤。
+     * 如果仅仅需要获取主表数据,请移步(getTourismProjectTravelNotesDraftList),以便获取更好的查询性能。
+     *
+     * @param filter 主表过滤对象。
+     * @param orderBy 排序参数。
+     * @return 查询结果集。
+     */
+    List<TourismProjectTravelNotesDraft> getTourismProjectTravelNotesDraftListWithRelation(TourismProjectTravelNotesDraft filter, String orderBy);
+}

+ 20 - 0
application-webadmin/src/main/java/com/tourism/webadmin/back/service/TourismProjectTravelNotesWriteService.java

@@ -1,5 +1,6 @@
 package com.tourism.webadmin.back.service;
 
+import com.alibaba.fastjson.JSONObject;
 import com.tourism.webadmin.back.model.*;
 import com.tourism.common.core.base.service.IBaseService;
 
@@ -29,6 +30,15 @@ public interface TourismProjectTravelNotesWriteService extends IBaseService<Tour
     void saveNewBatch(List<TourismProjectTravelNotesWrite> tourismProjectTravelNotesWriteList);
 
     /**
+     * 保存新增主表对象及关联对象。
+     *
+     * @param tourismProjectTravelNotesWrite 新增主表对象。
+     * @param relationData 全部关联从表数据。
+     * @return 返回新增主表对象。
+     */
+    TourismProjectTravelNotesWrite saveNewWithRelation(TourismProjectTravelNotesWrite tourismProjectTravelNotesWrite, JSONObject relationData);
+
+    /**
      * 更新数据对象。
      *
      * @param tourismProjectTravelNotesWrite         更新的对象。
@@ -38,6 +48,16 @@ public interface TourismProjectTravelNotesWriteService extends IBaseService<Tour
     boolean update(TourismProjectTravelNotesWrite tourismProjectTravelNotesWrite, TourismProjectTravelNotesWrite originalTourismProjectTravelNotesWrite);
 
     /**
+     * 更新主表对象及关联对象。
+     *
+     * @param tourismProjectTravelNotesWrite 主表对象新数据。
+     * @param originalTourismProjectTravelNotesWrite 主表对象源数据。
+     * @param relationData 全部关联从表数据。
+     * @return 修改成功返回true,否则false。
+     */
+    boolean updateWithRelation(TourismProjectTravelNotesWrite tourismProjectTravelNotesWrite, TourismProjectTravelNotesWrite originalTourismProjectTravelNotesWrite, JSONObject relationData);
+
+    /**
      * 删除指定数据。
      *
      * @param id 主键Id。

+ 106 - 0
application-webadmin/src/main/java/com/tourism/webadmin/back/service/impl/TourismProjectTravelNotesContentDraftServiceImpl.java

@@ -0,0 +1,106 @@
+package com.tourism.webadmin.back.service.impl;
+
+import cn.hutool.core.collection.CollUtil;
+import com.baomidou.mybatisplus.core.conditions.query.*;
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
+import com.tourism.webadmin.back.service.*;
+import com.tourism.webadmin.back.dao.*;
+import com.tourism.webadmin.back.model.*;
+import com.tourism.webadmin.config.DataSourceType;
+import com.tourism.common.core.annotation.MyDataSource;
+import com.tourism.common.core.base.dao.BaseDaoMapper;
+import com.tourism.common.core.constant.GlobalDeletedFlag;
+import com.tourism.common.core.object.MyRelationParam;
+import com.tourism.common.core.base.service.BaseService;
+import com.tourism.common.core.util.MyModelUtil;
+import com.github.pagehelper.Page;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.*;
+
+/**
+ * 发布游记的草稿的文本框数据操作服务类。
+ *
+ * @author 吃饭睡觉
+ * @date 2024-09-06
+ */
+@Slf4j
+@Service("tourismProjectTravelNotesContentDraftService")
+public class TourismProjectTravelNotesContentDraftServiceImpl extends BaseService<TourismProjectTravelNotesContentDraft, Long> implements TourismProjectTravelNotesContentDraftService {
+
+    @Autowired
+    private TourismProjectTravelNotesContentDraftMapper tourismProjectTravelNotesContentDraftMapper;
+
+    /**
+     * 返回当前Service的主表Mapper对象。
+     *
+     * @return 主表Mapper对象。
+     */
+    @Override
+    protected BaseDaoMapper<TourismProjectTravelNotesContentDraft> mapper() {
+        return tourismProjectTravelNotesContentDraftMapper;
+    }
+
+    @Transactional(rollbackFor = Exception.class)
+    @Override
+    public TourismProjectTravelNotesContentDraft saveNew(TourismProjectTravelNotesContentDraft tourismProjectTravelNotesContentDraft) {
+        tourismProjectTravelNotesContentDraftMapper.insert(this.buildDefaultValue(tourismProjectTravelNotesContentDraft));
+        return tourismProjectTravelNotesContentDraft;
+    }
+
+    @Transactional(rollbackFor = Exception.class)
+    @Override
+    public void saveNewBatch(List<TourismProjectTravelNotesContentDraft> tourismProjectTravelNotesContentDraftList) {
+        if (CollUtil.isNotEmpty(tourismProjectTravelNotesContentDraftList)) {
+            tourismProjectTravelNotesContentDraftList.forEach(this::buildDefaultValue);
+            tourismProjectTravelNotesContentDraftMapper.insertList(tourismProjectTravelNotesContentDraftList);
+        }
+    }
+
+    @Transactional(rollbackFor = Exception.class)
+    @Override
+    public boolean update(TourismProjectTravelNotesContentDraft tourismProjectTravelNotesContentDraft, TourismProjectTravelNotesContentDraft originalTourismProjectTravelNotesContentDraft) {
+        MyModelUtil.fillCommonsForUpdate(tourismProjectTravelNotesContentDraft, originalTourismProjectTravelNotesContentDraft);
+        // 这里重点提示,在执行主表数据更新之前,如果有哪些字段不支持修改操作,请用原有数据对象字段替换当前数据字段。
+        UpdateWrapper<TourismProjectTravelNotesContentDraft> uw = this.createUpdateQueryForNullValue(tourismProjectTravelNotesContentDraft, tourismProjectTravelNotesContentDraft.getId());
+        return tourismProjectTravelNotesContentDraftMapper.update(tourismProjectTravelNotesContentDraft, uw) == 1;
+    }
+
+    @Transactional(rollbackFor = Exception.class)
+    @Override
+    public boolean remove(Long id) {
+        return tourismProjectTravelNotesContentDraftMapper.deleteById(id) == 1;
+    }
+
+    @Transactional(rollbackFor = Exception.class)
+    @Override
+    public int removeByAssociationId(Long associationId) {
+        TourismProjectTravelNotesContentDraft deletedObject = new TourismProjectTravelNotesContentDraft();
+        deletedObject.setAssociationId(associationId);
+        return tourismProjectTravelNotesContentDraftMapper.delete(new QueryWrapper<>(deletedObject));
+    }
+
+    @Override
+    public List<TourismProjectTravelNotesContentDraft> getTourismProjectTravelNotesContentDraftList(TourismProjectTravelNotesContentDraft filter, String orderBy) {
+        return tourismProjectTravelNotesContentDraftMapper.getTourismProjectTravelNotesContentDraftList(filter, orderBy);
+    }
+
+    @Override
+    public List<TourismProjectTravelNotesContentDraft> getTourismProjectTravelNotesContentDraftListWithRelation(TourismProjectTravelNotesContentDraft filter, String orderBy) {
+        List<TourismProjectTravelNotesContentDraft> resultList = tourismProjectTravelNotesContentDraftMapper.getTourismProjectTravelNotesContentDraftList(filter, orderBy);
+        // 在缺省生成的代码中,如果查询结果resultList不是Page对象,说明没有分页,那么就很可能是数据导出接口调用了当前方法。
+        // 为了避免一次性的大量数据关联,规避因此而造成的系统运行性能冲击,这里手动进行了分批次读取,开发者可按需修改该值。
+        int batchSize = resultList instanceof Page ? 0 : 1000;
+        this.buildRelationForDataList(resultList, MyRelationParam.normal(), batchSize);
+        return resultList;
+    }
+
+    private TourismProjectTravelNotesContentDraft buildDefaultValue(TourismProjectTravelNotesContentDraft tourismProjectTravelNotesContentDraft) {
+        MyModelUtil.fillCommonsForInsert(tourismProjectTravelNotesContentDraft);
+        tourismProjectTravelNotesContentDraft.setDataState(GlobalDeletedFlag.NORMAL);
+        return tourismProjectTravelNotesContentDraft;
+    }
+}

+ 140 - 0
application-webadmin/src/main/java/com/tourism/webadmin/back/service/impl/TourismProjectTravelNotesDraftServiceImpl.java

@@ -0,0 +1,140 @@
+package com.tourism.webadmin.back.service.impl;
+
+import cn.hutool.core.collection.CollUtil;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
+import com.tourism.webadmin.back.service.*;
+import com.tourism.webadmin.back.dao.*;
+import com.tourism.webadmin.back.model.*;
+import com.tourism.webadmin.config.DataSourceType;
+import com.tourism.common.core.annotation.MyDataSource;
+import com.tourism.common.core.base.dao.BaseDaoMapper;
+import com.tourism.common.core.constant.GlobalDeletedFlag;
+import com.tourism.common.core.object.MyRelationParam;
+import com.tourism.common.core.base.service.BaseService;
+import com.tourism.common.core.util.MyModelUtil;
+import com.tourism.common.sequence.wrapper.IdGeneratorWrapper;
+import com.github.pagehelper.Page;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.*;
+
+/**
+ * 发布游记的草稿数据操作服务类。
+ *
+ * @author 吃饭睡觉
+ * @date 2024-09-06
+ */
+@Slf4j
+@Service("tourismProjectTravelNotesDraftService")
+public class TourismProjectTravelNotesDraftServiceImpl extends BaseService<TourismProjectTravelNotesDraft, Long> implements TourismProjectTravelNotesDraftService {
+
+    @Autowired
+    private IdGeneratorWrapper idGenerator;
+    @Autowired
+    private TourismProjectTravelNotesDraftMapper tourismProjectTravelNotesDraftMapper;
+    @Autowired
+    private TourismProjectTravelNotesContentDraftService tourismProjectTravelNotesContentDraftService;
+
+    /**
+     * 返回当前Service的主表Mapper对象。
+     *
+     * @return 主表Mapper对象。
+     */
+    @Override
+    protected BaseDaoMapper<TourismProjectTravelNotesDraft> mapper() {
+        return tourismProjectTravelNotesDraftMapper;
+    }
+
+    @Transactional(rollbackFor = Exception.class)
+    @Override
+    public TourismProjectTravelNotesDraft saveNew(TourismProjectTravelNotesDraft tourismProjectTravelNotesDraft) {
+        tourismProjectTravelNotesDraftMapper.insert(this.buildDefaultValue(tourismProjectTravelNotesDraft));
+        return tourismProjectTravelNotesDraft;
+    }
+
+    @Transactional(rollbackFor = Exception.class)
+    @Override
+    public void saveNewBatch(List<TourismProjectTravelNotesDraft> tourismProjectTravelNotesDraftList) {
+        if (CollUtil.isNotEmpty(tourismProjectTravelNotesDraftList)) {
+            tourismProjectTravelNotesDraftList.forEach(this::buildDefaultValue);
+            tourismProjectTravelNotesDraftMapper.insertList(tourismProjectTravelNotesDraftList);
+        }
+    }
+
+    @Transactional(rollbackFor = Exception.class)
+    @Override
+    public TourismProjectTravelNotesDraft saveNewWithRelation(TourismProjectTravelNotesDraft tourismProjectTravelNotesDraft, JSONObject relationData) {
+        this.saveNew(tourismProjectTravelNotesDraft);
+        this.saveOrUpdateOneToOneRelationData(tourismProjectTravelNotesDraft, relationData);
+        return tourismProjectTravelNotesDraft;
+    }
+
+    @Transactional(rollbackFor = Exception.class)
+    @Override
+    public boolean update(TourismProjectTravelNotesDraft tourismProjectTravelNotesDraft, TourismProjectTravelNotesDraft originalTourismProjectTravelNotesDraft) {
+        MyModelUtil.fillCommonsForUpdate(tourismProjectTravelNotesDraft, originalTourismProjectTravelNotesDraft);
+        // 这里重点提示,在执行主表数据更新之前,如果有哪些字段不支持修改操作,请用原有数据对象字段替换当前数据字段。
+        UpdateWrapper<TourismProjectTravelNotesDraft> uw = this.createUpdateQueryForNullValue(tourismProjectTravelNotesDraft, tourismProjectTravelNotesDraft.getId());
+        return tourismProjectTravelNotesDraftMapper.update(tourismProjectTravelNotesDraft, uw) == 1;
+    }
+
+    @Transactional(rollbackFor = Exception.class)
+    @Override
+    public boolean updateWithRelation(
+            TourismProjectTravelNotesDraft tourismProjectTravelNotesDraft, TourismProjectTravelNotesDraft originalTourismProjectTravelNotesDraft, JSONObject relationData) {
+        // tourismProjectTravelNotesDraft 为空的时候,无需修改主表数据。
+        if (tourismProjectTravelNotesDraft != null && !this.update(tourismProjectTravelNotesDraft, originalTourismProjectTravelNotesDraft)) {
+            return false;
+        }
+        this.saveOrUpdateOneToOneRelationData(originalTourismProjectTravelNotesDraft, relationData);
+        return true;
+    }
+
+    private void saveOrUpdateOneToOneRelationData(TourismProjectTravelNotesDraft tourismProjectTravelNotesDraft, JSONObject relationData) {
+        // 对于一对一新增或更新,如果主键值为空就新增,否则就更新,同时更新updateTime和updateUserId。
+        TourismProjectTravelNotesContentDraft tourismProjectTravelNotesContentDraft = relationData.getObject("tourismProjectTravelNotesContentDraft", TourismProjectTravelNotesContentDraft.class);
+        if (tourismProjectTravelNotesContentDraft != null) {
+            tourismProjectTravelNotesContentDraft.setAssociationId(tourismProjectTravelNotesDraft.getId());
+            tourismProjectTravelNotesContentDraftService.saveNewOrUpdate(tourismProjectTravelNotesContentDraft,
+                    tourismProjectTravelNotesContentDraftService::saveNew, tourismProjectTravelNotesContentDraftService::update);
+        }
+    }
+
+    @Transactional(rollbackFor = Exception.class)
+    @Override
+    public boolean remove(Long id) {
+        if (tourismProjectTravelNotesDraftMapper.deleteById(id) == 0) {
+            return false;
+        }
+        tourismProjectTravelNotesContentDraftService.removeByAssociationId(id);
+        return true;
+    }
+
+    @Override
+    public List<TourismProjectTravelNotesDraft> getTourismProjectTravelNotesDraftList(TourismProjectTravelNotesDraft filter, String orderBy) {
+        return tourismProjectTravelNotesDraftMapper.getTourismProjectTravelNotesDraftList(filter, orderBy);
+    }
+
+    @Override
+    public List<TourismProjectTravelNotesDraft> getTourismProjectTravelNotesDraftListWithRelation(TourismProjectTravelNotesDraft filter, String orderBy) {
+        List<TourismProjectTravelNotesDraft> resultList = tourismProjectTravelNotesDraftMapper.getTourismProjectTravelNotesDraftList(filter, orderBy);
+        // 在缺省生成的代码中,如果查询结果resultList不是Page对象,说明没有分页,那么就很可能是数据导出接口调用了当前方法。
+        // 为了避免一次性的大量数据关联,规避因此而造成的系统运行性能冲击,这里手动进行了分批次读取,开发者可按需修改该值。
+        int batchSize = resultList instanceof Page ? 0 : 1000;
+        this.buildRelationForDataList(resultList, MyRelationParam.normal(), batchSize);
+        return resultList;
+    }
+
+    private TourismProjectTravelNotesDraft buildDefaultValue(TourismProjectTravelNotesDraft tourismProjectTravelNotesDraft) {
+        if (tourismProjectTravelNotesDraft.getId() == null) {
+            tourismProjectTravelNotesDraft.setId(idGenerator.nextLongId());
+        }
+        MyModelUtil.fillCommonsForInsert(tourismProjectTravelNotesDraft);
+        tourismProjectTravelNotesDraft.setDataState(GlobalDeletedFlag.NORMAL);
+        return tourismProjectTravelNotesDraft;
+    }
+}

+ 32 - 1
application-webadmin/src/main/java/com/tourism/webadmin/back/service/impl/TourismProjectTravelNotesWriteServiceImpl.java

@@ -1,6 +1,7 @@
 package com.tourism.webadmin.back.service.impl;
 
 import cn.hutool.core.collection.CollUtil;
+import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.tourism.webadmin.back.model.constant.AuditState;
 import com.tourism.webadmin.back.service.*;
@@ -67,6 +68,14 @@ public class TourismProjectTravelNotesWriteServiceImpl extends BaseService<Touri
 
     @Transactional(rollbackFor = Exception.class)
     @Override
+    public TourismProjectTravelNotesWrite saveNewWithRelation(TourismProjectTravelNotesWrite tourismProjectTravelNotesWrite, JSONObject relationData) {
+        this.saveNew(tourismProjectTravelNotesWrite);
+        this.saveOrUpdateOneToOneRelationData(tourismProjectTravelNotesWrite, relationData);
+        return tourismProjectTravelNotesWrite;
+    }
+
+    @Transactional(rollbackFor = Exception.class)
+    @Override
     public boolean update(TourismProjectTravelNotesWrite tourismProjectTravelNotesWrite, TourismProjectTravelNotesWrite originalTourismProjectTravelNotesWrite) {
         MyModelUtil.fillCommonsForUpdate(tourismProjectTravelNotesWrite, originalTourismProjectTravelNotesWrite);
         // 这里重点提示,在执行主表数据更新之前,如果有哪些字段不支持修改操作,请用原有数据对象字段替换当前数据字段。
@@ -76,6 +85,28 @@ public class TourismProjectTravelNotesWriteServiceImpl extends BaseService<Touri
 
     @Transactional(rollbackFor = Exception.class)
     @Override
+    public boolean updateWithRelation(
+            TourismProjectTravelNotesWrite tourismProjectTravelNotesWrite, TourismProjectTravelNotesWrite originalTourismProjectTravelNotesWrite, JSONObject relationData) {
+        // tourismProjectTravelNotesWrite 为空的时候,无需修改主表数据。
+        if (tourismProjectTravelNotesWrite != null && !this.update(tourismProjectTravelNotesWrite, originalTourismProjectTravelNotesWrite)) {
+            return false;
+        }
+        this.saveOrUpdateOneToOneRelationData(originalTourismProjectTravelNotesWrite, relationData);
+        return true;
+    }
+
+    private void saveOrUpdateOneToOneRelationData(TourismProjectTravelNotesWrite tourismProjectTravelNotesWrite, JSONObject relationData) {
+        // 对于一对一新增或更新,如果主键值为空就新增,否则就更新,同时更新updateTime和updateUserId。
+        TourismTravelNotesContentWrite tourismTravelNotesContentWrite = relationData.getObject("tourismTravelNotesContentWrite", TourismTravelNotesContentWrite.class);
+        if (tourismTravelNotesContentWrite != null) {
+            tourismTravelNotesContentWrite.setAssociationId(tourismProjectTravelNotesWrite.getId());
+            tourismTravelNotesContentWriteService.saveNewOrUpdate(tourismTravelNotesContentWrite,
+                    tourismTravelNotesContentWriteService::saveNew, tourismTravelNotesContentWriteService::update);
+        }
+    }
+
+    @Transactional(rollbackFor = Exception.class)
+    @Override
     public boolean remove(Long id) {
         if (tourismProjectTravelNotesWriteMapper.deleteById(id) == 0) {
             return false;
@@ -106,7 +137,7 @@ public class TourismProjectTravelNotesWriteServiceImpl extends BaseService<Touri
         MyModelUtil.fillCommonsForInsert(tourismProjectTravelNotesWrite);
         tourismProjectTravelNotesWrite.setDataState(GlobalDeletedFlag.NORMAL);
         MyModelUtil.setDefaultValue(tourismProjectTravelNotesWrite, "reason", "");
-        MyModelUtil.setDefaultValue(tourismProjectTravelNotesWrite, "tourismUrl", "");
+        MyModelUtil.setDefaultValue(tourismProjectTravelNotesWrite, "travelNotesBannerUrl", "");
         MyModelUtil.setDefaultValue(tourismProjectTravelNotesWrite, "tourismTavelNotesUrl", "");
         MyModelUtil.setDefaultValue(tourismProjectTravelNotesWrite, "state", AuditState.UNAUDITSTATE);
         return tourismProjectTravelNotesWrite;

+ 2 - 0
application-webadmin/src/main/java/com/tourism/webadmin/back/service/impl/TourismTravelNotesContentWriteServiceImpl.java

@@ -1,8 +1,10 @@
 package com.tourism.webadmin.back.service.impl;
 
 import cn.hutool.core.collection.CollUtil;
+import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.*;
 import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
+import com.tourism.common.sequence.wrapper.IdGeneratorWrapper;
 import com.tourism.webadmin.back.service.*;
 import com.tourism.webadmin.back.dao.*;
 import com.tourism.webadmin.back.model.*;

+ 59 - 0
application-webadmin/src/main/java/com/tourism/webadmin/back/vo/TourismProjectTravelNotesContentDraftVo.java

@@ -0,0 +1,59 @@
+package com.tourism.webadmin.back.vo;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableLogic;
+import com.tourism.common.core.base.vo.BaseVo;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 发布游记的草稿的文本框VO视图对象。
+ *
+ * @author 吃饭睡觉
+ * @date 2024-09-06
+ */
+@Schema(description = "发布游记的草稿的文本框VO视图对象")
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class TourismProjectTravelNotesContentDraftVo extends BaseVo {
+
+    /**
+     * 主键id。
+     */
+    @TableId(value = "id", type = IdType.AUTO)
+    private Long id;
+
+    /**
+     * 关联表id。
+     */
+    @TableField(value = "association_id")
+    private Long associationId;
+
+    /**
+     * 逻辑删除标记字段(1: 正常 -1: 已删除)。
+     */
+    @TableLogic
+    @TableField(value = "data_state")
+    private Integer dataState;
+
+    /**
+     * 类型。
+     */
+    @TableField(value = "type")
+    private String type;
+
+    /**
+     * 内容。
+     */
+    @TableField(value = "content")
+    private String content;
+
+    /**
+     * 是否为封面图。
+     */
+    @TableField(value = "cover")
+    private Integer cover;
+}

+ 81 - 0
application-webadmin/src/main/java/com/tourism/webadmin/back/vo/TourismProjectTravelNotesDraftVo.java

@@ -0,0 +1,81 @@
+package com.tourism.webadmin.back.vo;
+
+import com.tourism.common.core.base.vo.BaseVo;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.util.Date;
+import java.util.Map;
+
+/**
+ * 发布游记的草稿VO视图对象。
+ *
+ * @author 吃饭睡觉
+ * @date 2024-09-06
+ */
+@Schema(description = "发布游记的草稿VO视图对象")
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class TourismProjectTravelNotesDraftVo extends BaseVo {
+
+    /**
+     * 主键id。
+     */
+    @Schema(description = "主键id")
+    private Long id;
+
+    /**
+     * 游记标题。
+     */
+    @Schema(description = "游记标题")
+    private String projectTitle;
+
+    /**
+     * 出发时间。
+     */
+    @Schema(description = "出发时间")
+    private Date departureTime;
+
+    /**
+     * 出行天数。
+     */
+    @Schema(description = "出行天数")
+    private String countTimes;
+
+    /**
+     * 人物关系。
+     */
+    @Schema(description = "人物关系")
+    private String role;
+
+    /**
+     * 推荐指数。
+     */
+    @Schema(description = "推荐指数")
+    private Integer recommendationRate;
+
+    /**
+     * 人均费用。
+     */
+    @Schema(description = "人均费用")
+    private String averageCost;
+
+    /**
+     * 游记内容中的图片。
+     */
+    @Schema(description = "游记内容中的图片")
+    private String tourismTavelNotesUrl;
+
+    /**
+     * 发布游记的banner图。
+     */
+    @Schema(description = "发布游记的banner图")
+    private String travelNotesBannerUrl;
+
+    /**
+     * id 的一对一关联数据对象,数据对应类型为TourismProjectTravelNotesContentDraftVo。
+     */
+    @Schema(description = "id 的一对一关联数据对象,数据对应类型为TourismProjectTravelNotesContentDraftVo")
+    private Map<String, Object> tourismProjectTravelNotesContentDraft;
+}

+ 13 - 21
application-webadmin/src/main/java/com/tourism/webadmin/back/vo/TourismProjectTravelNotesWriteVo.java

@@ -1,11 +1,15 @@
 package com.tourism.webadmin.back.vo;
 
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.tourism.common.core.annotation.RelationOneToMany;
 import com.tourism.common.core.base.vo.BaseVo;
+import com.tourism.webadmin.back.model.TourismProjectTravelNotesContentDraft;
 import io.swagger.v3.oas.annotations.media.Schema;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 
 import java.util.Date;
+import java.util.List;
 import java.util.Map;
 
 /**
@@ -23,7 +27,7 @@ public class TourismProjectTravelNotesWriteVo extends BaseVo {
      * 主键id。
      */
     @Schema(description = "主键id")
-    private Long id;
+    private String id;
 
     /**
      * 项目标题。
@@ -74,10 +78,10 @@ public class TourismProjectTravelNotesWriteVo extends BaseVo {
     private String reason;
 
     /**
-     * 项目展示图片
+     * 发布游记的banner图
      */
-    @Schema(description = "项目展示图片")
-    private String tourismUrl;
+    @Schema(description = "发布游记的banner图")
+    private String travelNotesBannerUrl;
 
     /**
      * 游记内容中的图片。
@@ -85,27 +89,15 @@ public class TourismProjectTravelNotesWriteVo extends BaseVo {
     @Schema(description = "游记内容中的图片")
     private String tourismTavelNotesUrl;
 
-//    /**
-//     * 是否完成(0,草稿;1,成稿)。
-//     */
-//    @Schema(description = "是否完成(0,草稿;1,成稿)")
-//    private Integer isComplete;
-
-    /**
-     * id 的一对一关联数据对象,数据对应类型为TourismTravelNotesContentWriteVo。
-     */
-    @Schema(description = "id 的一对一关联数据对象,数据对应类型为TourismTravelNotesContentWriteVo")
-    private Map<String, Object> tourismTravelNotesContentWrite;
-
     /**
      * state 常量字典关联数据。
      */
     @Schema(description = "state 常量字典关联数据")
     private Map<String, Object> stateDictMap;
 
-//    /**
-//     * isComplete 常量字典关联数据
-//     */
-//    @Schema(description = "isComplete 常量字典关联数据")
-//    private Map<String, Object> isCompleteDictMap;
+    /**
+     * tourismProjectTravelNotesContentDraft 游记内容。
+     */
+    @Schema(description = "tourismProjectTravelNotesContentDraft 游记内容")
+    private List<TourismProjectTravelNotesContentDraft> tourismProjectTravelNotesContentDraft;
 }

+ 17 - 5
application-webadmin/src/main/java/com/tourism/webadmin/back/vo/TourismTravelNotesContentWriteVo.java

@@ -23,14 +23,26 @@ public class TourismTravelNotesContentWriteVo extends BaseVo {
     private Long id;
 
     /**
-     * 富文本内容。
+     * 关联表id。
+     */
+    @Schema(description = "关联表id")
+    private Long associationId;
+
+    /**
+     * 类型。
      */
-    @Schema(description = "富文本内容")
+    @Schema(description = "类型")
+    private String type;
+
+    /**
+     * 内容。
+     */
+    @Schema(description = "内容")
     private String content;
 
     /**
-     * 关联表id。
+     * 是否为封面图
      */
-    @Schema(description = "关联表id")
-    private Long associationId;
+    @Schema(description = "是否为封面图")
+    private Integer cover;
 }

+ 2 - 1
common/common-core/src/main/java/com/tourism/common/core/constant/ErrorCodeEnum.java

@@ -73,7 +73,8 @@ public enum ErrorCodeEnum {
     DATE_OVERLAP("日期重叠,请重新选择!"),
     PRICE_ERROR("价格错误,请重新填写!"),
     PROJECT_NOT_EXIST("该项目不存在,请重新选择!"),
-    DATE_PRICE_NOTEXIST("请先编辑日历价格!");
+    DATE_PRICE_NOTEXIST("请先编辑日历价格!"),
+    DATA_NOT_FOUND("数据不存在,请联系管理员!");
     // 下面的枚举值为特定枚举值,即开发者可以根据自己的项目需求定义更多的非通用枚举值
 
     /**