Browse Source

[fix]
1、write表中的endPlace字段改为long类型

chenchen 4 months ago
parent
commit
bf3d36263b

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

@@ -14,29 +14,26 @@ 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.WebsiteTourUserDto;
+import com.tourism.webadmin.app.website.vo.TourWriteBelongTabVo;
 import com.tourism.webadmin.back.dto.TourismProjectTravelNotesWriteDto;
 import com.tourism.webadmin.back.dto.TourismTravelNotesContentWriteDto;
-import com.tourism.webadmin.back.model.TourTourismProjectTravelNotes;
-import com.tourism.webadmin.back.model.TourUser;
-import com.tourism.webadmin.back.model.TourismProjectTravelNotesWrite;
-import com.tourism.webadmin.back.model.TourismTravelNotesContentWrite;
+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.TourTourismProjectTravelNotesService;
-import com.tourism.webadmin.back.service.TourUserService;
-import com.tourism.webadmin.back.service.TourismProjectTravelNotesWriteService;
-import com.tourism.webadmin.back.service.TourismTravelNotesContentWriteService;
+import com.tourism.webadmin.back.service.*;
 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;
 import org.springframework.web.bind.annotation.*;
 
+import java.util.ArrayList;
 import java.util.List;
 import java.util.stream.Collectors;
 
@@ -56,6 +53,8 @@ public class WebSiteTourismTravelNotesPublishController {
     private TourTourismProjectTravelNotesService tourTourismProjectTravelNotesService;
     @Autowired
     private TourUserService tourUserService;
+    @Autowired
+    private DirectoryInfoService directoryInfoService;
 
     /**
      * 获取草稿id
@@ -369,11 +368,33 @@ public class WebSiteTourismTravelNotesPublishController {
      *
      * @return 应答结果对象,包含查询结果集。
      */
-//    @OperationLog(type = SysOperationLogType.LIST)
-//    @GetMapping("/getWriteBelongTab")
-//    public ResponseResult<Integer> getWriteBelongTab() {
-//
-//    }
+    @OperationLog(type = SysOperationLogType.LIST)
+    @GetMapping("/getWriteBelongTab")
+    public ResponseResult<List<TourWriteBelongTabVo>> getWriteBelongTab() {
+
+        DirectoryInfo directoryInfo  = new DirectoryInfo();
+        directoryInfo.setParentId(0L);
+        directoryInfo.setDirectoryType(1);
+        List<DirectoryInfo> directoryInfoList = directoryInfoService.getDirectoryInfoList(directoryInfo, "");
+
+        List<TourWriteBelongTabVo> tourWriteBelongTabVoList = MyModelUtil.copyCollectionTo(directoryInfoList, TourWriteBelongTabVo.class);
+        List<TourWriteBelongTabVo> newDirectoryInfoList = new ArrayList<>();
+        for(TourWriteBelongTabVo i : tourWriteBelongTabVoList){
+            if(i.getId() != 10L){
+                DirectoryInfo directoryInfo2  = new DirectoryInfo();
+                directoryInfo2.setParentId(i.getId());
+                directoryInfo2.setDirectoryType(1);
+                List<DirectoryInfo> bodyDirectoryInfoList = directoryInfoService.getDirectoryInfoList(directoryInfo2, "");
+
+                List<TourWriteBelongTabVo> bodyTourWriteBelongTabVoList = MyModelUtil.copyCollectionTo(bodyDirectoryInfoList, TourWriteBelongTabVo.class);
+                if(CollectionUtils.isNotEmpty(bodyDirectoryInfoList)){
+                    i.setTourWriteBelongTabVoList(bodyTourWriteBelongTabVoList);
+                }
+                newDirectoryInfoList.add(i);
+            }
+        }
+        return ResponseResult.success(newDirectoryInfoList);
+    }
 
 
 

+ 12 - 10
application-webadmin/src/main/java/com/tourism/webadmin/app/website/vo/TourWriteBelongTabVo.java

@@ -3,19 +3,21 @@ package com.tourism.webadmin.app.website.vo;
 import io.swagger.v3.oas.annotations.media.Schema;
 import lombok.Data;
 
+import java.util.List;
+
 /**
  * 门户网站中发布游记的选择所属分类(目的地)。
  *
  * @author 吃饭睡觉
  * @date 2024-10-12
  */
-//@Schema(description = "TourWriteBelongTabVo视图对象")
-//@Data
-//public class TourWriteBelongTabVo {
-//
-//    private Long id;
-//
-//    private String menuName;
-//
-//    private
-//}
+@Schema(description = "TourWriteBelongTabVo视图对象")
+@Data
+public class TourWriteBelongTabVo {
+
+    private Long id;
+
+    private String menuName;
+
+    private List<TourWriteBelongTabVo> tourWriteBelongTabVoList;
+}

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

@@ -27,7 +27,7 @@
         <result column="page_view_count" jdbcType="INTEGER" property="pageViewCount"/>
         <result column="hot_value" jdbcType="INTEGER" property="hotValue"/>
         <result column="is_original" jdbcType="TINYINT" property="isOriginal"/>
-        <result column="end_place" jdbcType="VARCHAR" property="endPlace"/>
+        <result column="end_place" jdbcType="BIGINT" property="endPlace"/>
     </resultMap>
 
     <insert id="insertList">

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

@@ -164,7 +164,7 @@ public class TourismProjectTravelNotesWriteDto {
      * NOTE: 可支持等于操作符的列表数据过滤。
      */
     @Schema(description = "目的地。可支持等于操作符的列表数据过滤。")
-    private String endPlace;
+    private Long endPlace;
 
     /**
      * departureTime 范围过滤起始值(>=)。

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

@@ -161,7 +161,7 @@ public class TourismProjectTravelNotesWrite extends BaseModel {
      * 目的地。
      */
     @TableField(value = "end_place")
-    private String endPlace;
+    private Long endPlace;
 
     /**
      * departureTime 范围过滤起始值(>=)。
@@ -197,6 +197,14 @@ public class TourismProjectTravelNotesWrite extends BaseModel {
         this.searchString = MyCommonUtil.replaceSqlWildcard(searchString);
     }
 
+    @RelationDict(
+            masterIdField = "endPlace",
+            slaveModelClass = DirectoryInfo.class,
+            slaveIdField = "id",
+            slaveNameField = "menuName")
+    @TableField(exist = false)
+    private Map<String, Object> endPlaceDictMap;
+
     @RelationConstDict(
             masterIdField = "state",
             constantDictClass = AuditState.class)

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

@@ -145,7 +145,13 @@ public class TourismProjectTravelNotesWriteVo extends BaseVo {
      * 目的地。
      */
     @Schema(description = "目的地")
-    private String endPlace;
+    private Long endPlace;
+
+    /**
+     * endPlace 字典关联数据。
+     */
+    @Schema(description = "endPlace 字典关联数据")
+    private Map<String, Object> endPlaceDictMap;
 
     /**
      * state 常量字典关联数据。