Jelajahi Sumber

[fix]
完善逻辑

chenchen 1 bulan lalu
induk
melakukan
c20d2a3176
18 mengubah file dengan 257 tambahan dan 111 penghapusan
  1. 19 19
      application-webadmin/src/main/java/com/tourism/webadmin/app/website/controller/WebSiteTourismTravelNotesPublishController.java
  2. 30 0
      application-webadmin/src/main/java/com/tourism/webadmin/app/website/dto/TourFourceEachFriendsDto.java
  3. 30 0
      application-webadmin/src/main/java/com/tourism/webadmin/app/website/dto/TourTakePartImGroupDto.java
  4. 30 0
      application-webadmin/src/main/java/com/tourism/webadmin/app/website/dto/TourTravelNotesTopicByNameDto.java
  5. 0 21
      application-webadmin/src/main/java/com/tourism/webadmin/app/website/model/TourShortTopic.java
  6. 0 22
      application-webadmin/src/main/java/com/tourism/webadmin/app/website/vo/TourShortTopicVo.java
  7. 52 1
      application-webadmin/src/main/java/com/tourism/webadmin/back/controller/TourismProjectTravelNotesWriteController.java
  8. 0 9
      application-webadmin/src/main/java/com/tourism/webadmin/back/dao/TourTravelNotesTopicMapper.java
  9. 11 21
      application-webadmin/src/main/java/com/tourism/webadmin/back/dao/mapper/TourTravelNotesTopicMapper.xml
  10. 21 0
      application-webadmin/src/main/java/com/tourism/webadmin/back/dto/TourTravelNotesTopicDto.java
  11. 6 0
      application-webadmin/src/main/java/com/tourism/webadmin/back/dto/TourismProjectTravelNotesWriteDto.java
  12. 18 0
      application-webadmin/src/main/java/com/tourism/webadmin/back/model/TourTravelNotesTopic.java
  13. 14 1
      application-webadmin/src/main/java/com/tourism/webadmin/back/model/TourismProjectTravelNotesWrite.java
  14. 0 8
      application-webadmin/src/main/java/com/tourism/webadmin/back/service/TourTravelNotesTopicService.java
  15. 0 8
      application-webadmin/src/main/java/com/tourism/webadmin/back/service/impl/TourTravelNotesTopicServiceImpl.java
  16. 1 1
      application-webadmin/src/main/java/com/tourism/webadmin/back/service/impl/TourismProjectTravelNotesWriteServiceImpl.java
  17. 6 0
      application-webadmin/src/main/java/com/tourism/webadmin/back/vo/TourTravelNotesTopicVo.java
  18. 19 0
      application-webadmin/src/main/java/com/tourism/webadmin/back/vo/TourismProjectTravelNotesWriteVo.java

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

@@ -16,11 +16,8 @@ import com.tourism.common.huaweicloud.obs.util.MergeAvatarsFlexUtils;
 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.app.website.dto.TourismProjectTravelNotesWriteToWebDto;
-import com.tourism.webadmin.app.website.dto.WebsiteTourUserDto;
+import com.tourism.webadmin.app.website.dto.*;
 import com.tourism.webadmin.app.website.model.TourShortImGroup;
-import com.tourism.webadmin.app.website.model.TourShortTopic;
 import com.tourism.webadmin.app.website.model.TourShortUser;
 import com.tourism.webadmin.app.website.service.TourTravelNotesPublishService;
 import com.tourism.webadmin.app.website.vo.*;
@@ -30,14 +27,10 @@ import com.tourism.webadmin.back.model.*;
 import com.tourism.webadmin.back.model.constant.AuditState;
 import com.tourism.webadmin.back.model.constant.UnmountState;
 import com.tourism.webadmin.back.service.*;
-import com.tourism.webadmin.back.vo.TourTravelNotesTopicVo;
 import com.tourism.webadmin.back.vo.TourismProjectTravelNotesWriteVo;
-import com.tourism.webadmin.back.vo.TourismTravelNotesContentWriteVo;
 import io.swagger.v3.oas.annotations.tags.Tag;
 import lombok.extern.slf4j.Slf4j;
-import ognl.Token;
 import org.apache.commons.collections4.CollectionUtils;
-import org.apache.poi.ss.formula.functions.T;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.validation.annotation.Validated;
@@ -169,6 +162,10 @@ public class WebSiteTourismTravelNotesPublishController {
         }
         TourismProjectTravelNotesWriteVo tourismProjectTravelNotesWriteVo = MyModelUtil.copyTo(tourismProjectTravelNotesWrite, TourismProjectTravelNotesWriteVo.class);
 
+        //填充图片
+
+        //填充关联话题
+        //填充关联用户
         return ResponseResult.success(tourismProjectTravelNotesWriteVo);
     }
 
@@ -404,11 +401,11 @@ public class WebSiteTourismTravelNotesPublishController {
      */
     @OperationLog(type = SysOperationLogType.LIST)
     @GetMapping("/getFouceEachFriendsByName")
-    public ResponseResult<List<TourShortUserVo>> getFouceEachFriendsByName(String name) {
+    public ResponseResult<List<TourShortUserVo>> getFouceEachFriendsByName(@Validated TourFourceEachFriendsDto tourFourceEachFriendsDto) {
         //limit20
-        PageMethod.startPage(1, 20, true);
+        PageMethod.startPage(tourFourceEachFriendsDto.getPageNum(), tourFourceEachFriendsDto.getPageSize(), true);
         Long userId = TokenData.takeFromRequest().getUserId();
-        List<TourShortUser> tourShortUserList = tourFansService.getFouceEachFriendsByName(userId, name);
+        List<TourShortUser> tourShortUserList = tourFansService.getFouceEachFriendsByName(userId, tourFourceEachFriendsDto.getName());
         List<TourShortUserVo> tourShortUserVoList = MyModelUtil.copyCollectionTo(tourShortUserList, TourShortUserVo.class);
         return ResponseResult.success(tourShortUserVoList);
     }
@@ -420,13 +417,16 @@ public class WebSiteTourismTravelNotesPublishController {
      */
     @OperationLog(type = SysOperationLogType.LIST)
     @GetMapping("/getTopicListByName")
-    public ResponseResult<List<TourShortTopicVo>> getTopicListByName(String name) {
+    public ResponseResult<List<TourTravelNotesTopic>> getTopicListByName(@Validated TourTravelNotesTopicByNameDto tourTravelNotesTopicByNameDto) {
         //limit20
-        PageMethod.startPage(1, 20, true);
+        PageMethod.startPage(tourTravelNotesTopicByNameDto.getPageNum(), tourTravelNotesTopicByNameDto.getPageSize(), true);
         TourTravelNotesTopic tourTravelNotesTopic = new TourTravelNotesTopic();
-        tourTravelNotesTopic.setName(name);
-        List<TourShortTopic> tourTravelNotesTopicListByName = tourTravelNotesTopicService.getTourTravelNotesTopicListByName(name);
-        List<TourShortTopicVo> tourTravelNotesTopicVoList = MyModelUtil.copyCollectionTo(tourTravelNotesTopicListByName, TourShortTopicVo.class);
+        tourTravelNotesTopic.setName(tourTravelNotesTopicByNameDto.getName());
+        MyOrderParam myOrderParam = new MyOrderParam();
+        String orderBy = MyOrderParam.buildOrderBy(myOrderParam, TourTravelNotesTopic.class);
+        myOrderParam.add(new MyOrderParam.OrderInfo("hotValue", false, null));
+        List<TourTravelNotesTopic> tourTravelNotesTopicList = tourTravelNotesTopicService.getTourTravelNotesTopicList(tourTravelNotesTopic,orderBy);
+        List<TourTravelNotesTopic> tourTravelNotesTopicVoList = MyModelUtil.copyCollectionTo(tourTravelNotesTopicList, TourTravelNotesTopic.class);
         return ResponseResult.success(tourTravelNotesTopicVoList);
     }
 
@@ -437,11 +437,11 @@ public class WebSiteTourismTravelNotesPublishController {
      */
     @OperationLog(type = SysOperationLogType.LIST)
     @GetMapping("/getTakePartImGroupListByName")
-    public ResponseResult<List<TourShortImGroupVo>> getTakePartImGroupListByName(String name) {
+    public ResponseResult<List<TourShortImGroupVo>> getTakePartImGroupListByName(@Validated TourTakePartImGroupDto tourTakePartImGroupDto) {
         //limit20
-        PageMethod.startPage(1, 20, true);
+        PageMethod.startPage(tourTakePartImGroupDto.getPageNum(), tourTakePartImGroupDto.getPageSize(), true);
         Long localUserId = TokenData.takeFromRequest().getUserId();
-        List<TourShortImGroup> takePartImGroupListByName = tourImGroupService.getTakePartImGroupListByName(localUserId,name);
+        List<TourShortImGroup> takePartImGroupListByName = tourImGroupService.getTakePartImGroupListByName(localUserId,tourTakePartImGroupDto.getName());
 
         //根据群聊id,填充每个群聊的人数以及每个群聊的头像
         Set<Long> set = new HashSet();

+ 30 - 0
application-webadmin/src/main/java/com/tourism/webadmin/app/website/dto/TourFourceEachFriendsDto.java

@@ -0,0 +1,30 @@
+package com.tourism.webadmin.app.website.dto;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import jakarta.validation.constraints.NotNull;
+import lombok.Data;
+
+@Schema(description = "获取互关好友Dto")
+@Data
+public class TourFourceEachFriendsDto {
+
+    /**
+     * 分页号码,从1开始计数。
+     */
+    @Schema(description = "分页号码。")
+    @NotNull(message = "分页号码不能为空,请提供有效的 pageSize 参数")
+    private Integer pageNum;
+
+    /**
+     * 每页大小。
+     */
+    @Schema(description = "每页大小。")
+    @NotNull(message = "每页大小不能为空,请提供有效的 pageSize 参数")
+    private Integer pageSize;
+
+    /**
+     * 名称。
+     */
+    @Schema(description = "名称。")
+    private String name;
+}

+ 30 - 0
application-webadmin/src/main/java/com/tourism/webadmin/app/website/dto/TourTakePartImGroupDto.java

@@ -0,0 +1,30 @@
+package com.tourism.webadmin.app.website.dto;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import jakarta.validation.constraints.NotNull;
+import lombok.Data;
+
+@Schema(description = "获取互关好友Dto")
+@Data
+public class TourTakePartImGroupDto {
+
+    /**
+     * 分页号码,从1开始计数。
+     */
+    @Schema(description = "分页号码。")
+    @NotNull(message = "分页号码不能为空,请提供有效的 pageSize 参数")
+    private Integer pageNum;
+
+    /**
+     * 每页大小。
+     */
+    @Schema(description = "每页大小。")
+    @NotNull(message = "每页大小不能为空,请提供有效的 pageSize 参数")
+    private Integer pageSize;
+
+    /**
+     * 名称。
+     */
+    @Schema(description = "名称。")
+    private String name;
+}

+ 30 - 0
application-webadmin/src/main/java/com/tourism/webadmin/app/website/dto/TourTravelNotesTopicByNameDto.java

@@ -0,0 +1,30 @@
+package com.tourism.webadmin.app.website.dto;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import jakarta.validation.constraints.NotNull;
+import lombok.Data;
+
+@Schema(description = "获取互关好友Dto")
+@Data
+public class TourTravelNotesTopicByNameDto {
+
+    /**
+     * 分页号码,从1开始计数。
+     */
+    @Schema(description = "分页号码。")
+    @NotNull(message = "分页号码不能为空,请提供有效的 pageSize 参数")
+    private Integer pageNum;
+
+    /**
+     * 每页大小。
+     */
+    @Schema(description = "每页大小。")
+    @NotNull(message = "每页大小不能为空,请提供有效的 pageSize 参数")
+    private Integer pageSize;
+
+    /**
+     * 名称。
+     */
+    @Schema(description = "名称。")
+    private String name;
+}

+ 0 - 21
application-webadmin/src/main/java/com/tourism/webadmin/app/website/model/TourShortTopic.java

@@ -1,21 +0,0 @@
-package com.tourism.webadmin.app.website.model;
-
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableName;
-import lombok.Data;
-
-@Data
-@TableName(value = "tour_travel_notes_topic")
-public class TourShortTopic {
-    /**
-     * 话题名称。
-     */
-    @TableId(value = "topic_name")
-    private String topicName;
-
-    /**
-     * 浏览量。
-     */
-    @TableId(value = "total_view_count")
-    private String totalViewCount;
-}

+ 0 - 22
application-webadmin/src/main/java/com/tourism/webadmin/app/website/vo/TourShortTopicVo.java

@@ -1,22 +0,0 @@
-package com.tourism.webadmin.app.website.vo;
-
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableName;
-import io.swagger.v3.oas.annotations.media.Schema;
-import lombok.Data;
-
-@Data
-@TableName(value = "tour_travel_notes_topic")
-public class TourShortTopicVo {
-    /**
-     * 话题名称。
-     */
-    @Schema(description = "话题名称")
-    private String topicName;
-
-    /**
-     * 浏览量。
-     */
-    @Schema(description = "浏览量")
-    private String totalViewCount;
-}

+ 52 - 1
application-webadmin/src/main/java/com/tourism/webadmin/back/controller/TourismProjectTravelNotesWriteController.java

@@ -12,6 +12,7 @@ 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.model.constant.AuditState;
+import com.tourism.webadmin.back.model.constant.Enable;
 import com.tourism.webadmin.back.vo.*;
 import com.tourism.webadmin.back.dto.*;
 import com.tourism.webadmin.back.model.*;
@@ -25,6 +26,7 @@ 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.apache.commons.collections4.CollectionUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.multipart.MultipartFile;
@@ -32,6 +34,7 @@ import org.springframework.web.multipart.MultipartFile;
 import jakarta.servlet.http.HttpServletResponse;
 import java.io.IOException;
 import java.util.*;
+import java.util.stream.Collectors;
 
 /**
  * 发布游记操作控制器类。
@@ -53,7 +56,10 @@ public class TourismProjectTravelNotesWriteController {
     private UpDownloaderFactory upDownloaderFactory;
     @Autowired
     private TourismProjectTravelNotesWriteService tourismProjectTravelNotesWriteService;
-
+    @Autowired
+    private TourTravelNotesTopicService tourTravelNotesTopicService;
+    @Autowired
+    private TourTravelNotesImgService tourTravelNotesImgService;
     /**
      * 新增发布游记数据。
      *
@@ -154,6 +160,29 @@ public class TourismProjectTravelNotesWriteController {
             return ResponseResult.error(ErrorCodeEnum.DATA_NOT_EXIST, errorMessage);
         }
 
+        //审核通过的话,则进行查询话题,查看是否话题是否存在
+        //话题不存在的话,则进行新增话题
+        if(tourismProjectTravelNotesWrite.getState() == 3) {
+            if (StringUtils.isNotBlank(tourismProjectTravelNotesWrite.getTourTravelNotesTopicRelationName())) {
+                String[] tourTravelNotesTopicRelationNameArray = tourismProjectTravelNotesWrite.getTourTravelNotesTopicRelationName().split(",");
+                Set<String> tourTravelNotesTopicRelationNameSet = new HashSet<>(Arrays.asList(tourTravelNotesTopicRelationNameArray));
+
+                //查询哪些是存在于数据库中的,反之获得哪些是不存在于数据库中
+                List<TourTravelNotesTopic> tourTravelNotesTopicServiceInList = tourTravelNotesTopicService.getInList("name", tourTravelNotesTopicRelationNameSet);
+                List<String> topicNameList = tourTravelNotesTopicServiceInList.stream().map(TourTravelNotesTopic::getName).toList();
+                tourTravelNotesTopicRelationNameSet.removeAll(topicNameList);
+
+                //对不存在数据库中的话题,进行新增话题
+                List<TourTravelNotesTopic> tourTravelNotesTopicList = new ArrayList<>();
+                tourTravelNotesTopicRelationNameSet.stream().forEach(item->{
+                    TourTravelNotesTopic tourTravelNotesTopic = new TourTravelNotesTopic();
+                    tourTravelNotesTopic.setName(item);
+                    tourTravelNotesTopic.setEnable(Enable.ENABLE_YES);
+                    tourTravelNotesTopicList.add(tourTravelNotesTopic);
+                });
+                tourTravelNotesTopicService.saveNewBatch(tourTravelNotesTopicList);
+            }
+        }
         tourismProjectTravelNotesWriteService.audit(tourismProjectTravelNotesWrite);
 //        if (!tourismProjectTravelNotesWriteService.update(tourismProjectTravelNotesWrite, originalTourismProjectTravelNotesWrite)) {
 //            return ResponseResult.error(ErrorCodeEnum.DATA_NOT_EXIST);
@@ -221,6 +250,15 @@ public class TourismProjectTravelNotesWriteController {
         String orderBy = MyOrderParam.buildOrderBy(orderParam, TourismProjectTravelNotesWrite.class);
         List<TourismProjectTravelNotesWrite> tourismProjectTravelNotesWriteList =
                 tourismProjectTravelNotesWriteService.getTourismProjectTravelNotesWriteListWithRelation(tourismProjectTravelNotesWriteFilter, orderBy);
+
+        tourismProjectTravelNotesWriteList.stream().forEach(item->{
+            if(CollectionUtils.isNotEmpty(item.getTourTravelNotesTopicRelationList())){
+                // 使用Stream API提取topicName并拼接成一个逗号分隔的字符串
+                item.setTourTravelNotesTopicRelationName(item.getTourTravelNotesTopicRelationList().stream()
+                        .map(TourTravelNotesTopicRelation::getTopicName) // 获取每个对象的topicName
+                        .collect(Collectors.joining(",")));
+            }
+        });
         return ResponseResult.success(MyPageUtil.makeResponseData(tourismProjectTravelNotesWriteList, TourismProjectTravelNotesWriteVo.class));
     }
 
@@ -237,7 +275,20 @@ public class TourismProjectTravelNotesWriteController {
         if (tourismProjectTravelNotesWrite == null) {
             return ResponseResult.error(ErrorCodeEnum.DATA_NOT_EXIST);
         }
+        if(CollectionUtils.isNotEmpty(tourismProjectTravelNotesWrite.getTourTravelNotesTopicRelationList())){
+            // 使用Stream API提取topicName并拼接成一个逗号分隔的字符串
+            tourismProjectTravelNotesWrite.setTourTravelNotesTopicRelationName(tourismProjectTravelNotesWrite.getTourTravelNotesTopicRelationList().stream()
+                    .map(TourTravelNotesTopicRelation::getTopicName) // 获取每个对象的topicName
+                    .collect(Collectors.joining(",")));
+        }
+
         TourismProjectTravelNotesWriteVo tourismProjectTravelNotesWriteVo = MyModelUtil.copyTo(tourismProjectTravelNotesWrite, TourismProjectTravelNotesWriteVo.class);
+
+        TourTravelNotesImg tourTravelNotesImg = new TourTravelNotesImg();
+        tourTravelNotesImg.setTravelNotesId(tourismProjectTravelNotesWrite.getId());
+        List<TourTravelNotesImg> tourTravelNotesImgList = tourTravelNotesImgService.getTourTravelNotesImgList(tourTravelNotesImg, "");
+        List<String> tourTravelNotesImgUrlList = tourTravelNotesImgList.stream().map(TourTravelNotesImg::getImgUrl).collect(Collectors.toList());
+        tourismProjectTravelNotesWriteVo.setTourTravelNotesImg(tourTravelNotesImgUrlList);
         return ResponseResult.success(tourismProjectTravelNotesWriteVo);
     }
 

+ 0 - 9
application-webadmin/src/main/java/com/tourism/webadmin/back/dao/TourTravelNotesTopicMapper.java

@@ -1,7 +1,6 @@
 package com.tourism.webadmin.back.dao;
 
 import com.tourism.common.core.base.dao.BaseDaoMapper;
-import com.tourism.webadmin.app.website.model.TourShortTopic;
 import com.tourism.webadmin.back.model.TourTravelNotesTopic;
 import org.apache.ibatis.annotations.Param;
 
@@ -32,12 +31,4 @@ public interface TourTravelNotesTopicMapper extends BaseDaoMapper<TourTravelNote
     List<TourTravelNotesTopic> getTourTravelNotesTopicList(
             @Param("tourTravelNotesTopicFilter") TourTravelNotesTopic tourTravelNotesTopicFilter, @Param("orderBy") String orderBy);
 
-    /**
-     * 获取过滤后的对象列表。
-     *
-     * @param name 话题名称。
-     * @return 对象列表。
-     */
-    List<TourShortTopic> getTourTravelNotesTopicListByName(
-            @Param("name") String name);
 }

+ 11 - 21
application-webadmin/src/main/java/com/tourism/webadmin/back/dao/mapper/TourTravelNotesTopicMapper.xml

@@ -10,6 +10,7 @@
         <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="hot_value" jdbcType="INTEGER" property="hotValue"/>
     </resultMap>
 
     <insert id="insertList">
@@ -21,7 +22,8 @@
             create_time,
             update_user_id,
             update_time,
-            data_state)
+            data_state,
+            hot_value)
         VALUES
         <foreach collection="list" index="index" item="item" separator="," >
             (#{item.id},
@@ -31,7 +33,8 @@
             #{item.createTime},
             #{item.updateUserId},
             #{item.updateTime},
-            #{item.dataState})
+            #{item.dataState},
+            #{item.hotValue})
         </foreach>
     </insert>
 
@@ -52,6 +55,12 @@
             <if test="tourTravelNotesTopicFilter.enable != null">
                 AND tour_travel_notes_topic.enable = #{tourTravelNotesTopicFilter.enable}
             </if>
+            <if test="tourTravelNotesTopicFilter.hotValueStart != null">
+                AND tour_travel_notes_topic.hot_value &gt;= #{tourTravelNotesTopicFilter.hotValueStart}
+            </if>
+            <if test="tourTravelNotesTopicFilter.hotValueEnd != null">
+                AND tour_travel_notes_topic.hot_value &lt;= #{tourTravelNotesTopicFilter.hotValueEnd}
+            </if>
         </if>
     </sql>
 
@@ -65,23 +74,4 @@
         </if>
     </select>
 
-    <select id="getTourTravelNotesTopicListByName" resultType="com.tourism.webadmin.app.website.model.TourShortTopic" parameterType="String">
-        SELECT
-        tnt.NAME AS topic_name,
-        COALESCE(SUM(tntp.page_view_count), 0) AS total_view_count
-        FROM
-        tour_travel_notes_topic tnt
-        LEFT JOIN tour_travel_notes_topic_relation tnttr ON tnt.id = tnttr.topic_id
-        LEFT JOIN tour_tourism_project_travel_notes tntp ON tnttr.travel_notes_id = tntp.id
-        where tnt.enable = 1 and tnt.data_state = 1
-        <where>
-            <if test="name != null and name != ''">
-            and tnt.name LIKE CONCAT('%', #{name}, '%')
-            </if>
-        </where>
-        GROUP BY
-            tnt.name
-        ORDER BY
-            total_view_count DESC
-    </select>
 </mapper>

+ 21 - 0
application-webadmin/src/main/java/com/tourism/webadmin/back/dto/TourTravelNotesTopicDto.java

@@ -40,4 +40,25 @@ public class TourTravelNotesTopicDto {
     @Schema(description = "是否启用,0否,1是。可支持等于操作符的列表数据过滤。")
     @ConstDictRef(constDictClass = Enable.class, message = "数据验证失败,是否启用,0否,1是为无效值!")
     private Integer enable;
+
+    /**
+     * 热度值。
+     * NOTE: 可支持等于操作符的列表数据过滤。
+     */
+    @Schema(description = "热度值。可支持等于操作符的列表数据过滤。")
+    private Integer hotValue;
+
+    /**
+     * hotValue 范围过滤起始值(>=)。
+     * NOTE: 可支持范围操作符的列表数据过滤。
+     */
+    @Schema(description = "hotValue 范围过滤起始值(>=)。可支持范围操作符的列表数据过滤。")
+    private Integer hotValueStart;
+
+    /**
+     * hotValue 范围过滤结束值(<=)。
+     * NOTE: 可支持范围操作符的列表数据过滤。
+     */
+    @Schema(description = "hotValue 范围过滤结束值(<=)。可支持范围操作符的列表数据过滤。")
+    private Integer hotValueEnd;
 }

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

@@ -235,4 +235,10 @@ public class TourismProjectTravelNotesWriteDto {
     @Schema(description = "群聊id。")
     private Long tourImGroupId;
 
+    /**
+     * 提及的话题。
+     */
+    @Schema(description = "提及的话题。")
+    private String tourTravelNotesTopicRelationName;
+
 }

+ 18 - 0
application-webadmin/src/main/java/com/tourism/webadmin/back/model/TourTravelNotesTopic.java

@@ -50,4 +50,22 @@ public class TourTravelNotesTopic extends BaseModel {
             constantDictClass = Enable.class)
     @TableField(exist = false)
     private Map<String, Object> enableDictMap;
+
+    /**
+     * 热度值。
+     */
+    @TableField(value = "hot_value")
+    private Integer hotValue;
+
+    /**
+     * hotValue 范围过滤起始值(>=)。
+     */
+    @TableField(exist = false)
+    private Integer hotValueStart;
+
+    /**
+     * hotValue 范围过滤结束值(<=)。
+     */
+    @TableField(exist = false)
+    private Integer hotValueEnd;
 }

+ 14 - 1
application-webadmin/src/main/java/com/tourism/webadmin/back/model/TourismProjectTravelNotesWrite.java

@@ -6,6 +6,7 @@ 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 io.swagger.v3.oas.annotations.media.Schema;
 import lombok.*;
 
 import java.util.Date;
@@ -66,7 +67,7 @@ public class TourismProjectTravelNotesWrite extends BaseModel {
     private String averageCost;
 
     /**
-     * 审核状态(0,未审核;1,审核通过;2、审核不通过)。
+     * 审核状态(0,草稿;1,待审核;2,审核不通过;3,审核通过;)
      */
     @TableField(value = "state")
     private Integer state;
@@ -283,4 +284,16 @@ public class TourismProjectTravelNotesWrite extends BaseModel {
             slaveIdField = "id")
     @TableField(exist = false)
     private TourImGroup tourImGroup;
+
+    @RelationOneToMany(
+            masterIdField = "id",
+            slaveModelClass = TourTravelNotesTopicRelation.class,
+            slaveIdField = "travelNotesId")
+    @TableField(exist = false)
+    private List<TourTravelNotesTopicRelation> tourTravelNotesTopicRelationList;
+    /**
+     * 拼接多个话题为字符串。
+     */
+    @TableField(exist = false)
+    private String tourTravelNotesTopicRelationName;
 }

+ 0 - 8
application-webadmin/src/main/java/com/tourism/webadmin/back/service/TourTravelNotesTopicService.java

@@ -1,6 +1,5 @@
 package com.tourism.webadmin.back.service;
 
-import com.tourism.webadmin.app.website.model.TourShortTopic;
 import com.tourism.webadmin.back.model.*;
 import com.tourism.common.core.base.service.IBaseService;
 
@@ -66,11 +65,4 @@ public interface TourTravelNotesTopicService extends IBaseService<TourTravelNote
      * @return 查询结果集。
      */
     List<TourTravelNotesTopic> getTourTravelNotesTopicListWithRelation(TourTravelNotesTopic filter, String orderBy);
-
-    /**
-     *
-     * @param name 话题名称。
-     * @return 查询结果集。
-     */
-    List<TourShortTopic> getTourTravelNotesTopicListByName(String name);
 }

+ 0 - 8
application-webadmin/src/main/java/com/tourism/webadmin/back/service/impl/TourTravelNotesTopicServiceImpl.java

@@ -2,12 +2,9 @@ package com.tourism.webadmin.back.service.impl;
 
 import cn.hutool.core.collection.CollUtil;
 import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
-import com.tourism.webadmin.app.website.model.TourShortTopic;
 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;
@@ -101,9 +98,4 @@ public class TourTravelNotesTopicServiceImpl extends BaseService<TourTravelNotes
         tourTravelNotesTopic.setDataState(GlobalDeletedFlag.NORMAL);
         return tourTravelNotesTopic;
     }
-
-    @Override
-    public List<TourShortTopic> getTourTravelNotesTopicListByName(String name) {
-        return tourTravelNotesTopicMapper.getTourTravelNotesTopicListByName(name);
-    }
 }

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

@@ -132,7 +132,7 @@ public class TourismProjectTravelNotesWriteServiceImpl extends BaseService<Touri
         // 在缺省生成的代码中,如果查询结果resultList不是Page对象,说明没有分页,那么就很可能是数据导出接口调用了当前方法。
         // 为了避免一次性的大量数据关联,规避因此而造成的系统运行性能冲击,这里手动进行了分批次读取,开发者可按需修改该值。
         int batchSize = resultList instanceof Page ? 0 : 1000;
-        this.buildRelationForDataList(resultList, MyRelationParam.normal(), batchSize);
+        this.buildRelationForDataList(resultList, MyRelationParam.full(), batchSize);
         return resultList;
     }
 

+ 6 - 0
application-webadmin/src/main/java/com/tourism/webadmin/back/vo/TourTravelNotesTopicVo.java

@@ -36,6 +36,12 @@ public class TourTravelNotesTopicVo extends BaseVo {
     private Integer enable;
 
     /**
+     * 热度值。
+     */
+    @Schema(description = "热度值")
+    private Integer hotValue;
+
+    /**
      * enable 常量字典关联数据。
      */
     @Schema(description = "enable 常量字典关联数据")

+ 19 - 0
application-webadmin/src/main/java/com/tourism/webadmin/back/vo/TourismProjectTravelNotesWriteVo.java

@@ -2,6 +2,7 @@ package com.tourism.webadmin.back.vo;
 
 import com.tourism.common.core.base.vo.BaseVo;
 import com.tourism.webadmin.back.model.TourImGroup;
+import com.tourism.webadmin.back.model.TourTravelNotesTopicRelation;
 import com.tourism.webadmin.back.model.TourismTravelNotesContentWrite;
 import io.swagger.v3.oas.annotations.media.Schema;
 import lombok.Data;
@@ -244,4 +245,22 @@ public class TourismProjectTravelNotesWriteVo extends BaseVo {
      */
     @Schema(description = "目的地区")
     private String endArea;
+
+    /**
+     * 游记关联的话题列表。
+     */
+    @Schema(description = "游记关联的话题列表")
+    private List<TourTravelNotesTopicRelation> tourTravelNotesTopicRelationList;
+
+    /**
+     * 拼接多个话题为字符串。
+     */
+    @Schema(description = "拼接多个话题为字符串")
+    private String tourTravelNotesTopicRelationName;
+
+    /**
+     * 多张图片路径。
+     */
+    @Schema(description = "多张图片路径")
+    private List<String> tourTravelNotesImg;
 }