Sfoglia il codice sorgente

fix 1.修改城市定位经纬度为bigDecimal 2.菜单管理删除精选目的地字段 3.增加旅游板块的排序
feat 项目管理新增精选目的地字段,默认不是

classic_blue 4 mesi fa
parent
commit
bed50e5e56

+ 25 - 22
application-webadmin/src/main/java/com/tourism/webadmin/app/wechat/controller/WechatTourismIndexController.java

@@ -145,10 +145,10 @@ public class WechatTourismIndexController {
         filter.setIsHotspot(1);
 
         MyOrderParam myOrderParam = new MyOrderParam();
-        new MyOrderParam.OrderInfo("createTime",false, null);
-        new MyOrderParam.OrderInfo("likeCount",false, null);
+        myOrderParam.add(new MyOrderParam.OrderInfo("createTime",false, null));
+        myOrderParam.add(new MyOrderParam.OrderInfo("likeCount",false, null));
 
-        String orderBy = MyOrderParam.buildOrderBy(myOrderParam, DirectoryInfo.class);
+        String orderBy = MyOrderParam.buildOrderBy(myOrderParam, TourismProject.class);
         List<TourismProject> list = tourismProjectService.getTourismProjectList(filter, orderBy);
 
         List<IndexHotDestinationVo> dataList = MyModelUtil.copyCollectionTo(list, IndexHotDestinationVo.class);
@@ -156,12 +156,8 @@ public class WechatTourismIndexController {
         dataList.forEach(o->{
             List<String> strings = UrlConvertUtils.urlConvert(applicationConfig.getHostIpPort(), o.getHomeHotPicture());
             o.setHomeHotPicturesAfterConvert(strings);
-            DirectoryInfo filter1 = new DirectoryInfo();
-            filter1.setEnable(1);
-            filter1.setDataState(1);
-            filter1.setId(o.getBelongTab());
-            List<DirectoryInfo> list1 = directoryInfoService.getDirectoryInfoList(filter1, null);
-            o.setMenuName(list1.get(0).getMenuName());
+            DirectoryInfo info = directoryInfoService.getById(o.getBelongTab());
+            o.setMenuName(info.getMenuName());
         });
 
         return  ResponseResult.success(dataList.stream().limit(3).collect(Collectors.toList()));
@@ -173,19 +169,26 @@ public class WechatTourismIndexController {
      * @return 应答结果对象。
      */
     @GetMapping("/queryIndexWinnowDestination")
-    public ResponseResult<DirectoryInfoVo> queryIndexWinnowDestination() {
+    public ResponseResult<IndexHotDestinationVo> queryIndexWinnowDestination() {
 
-        DirectoryInfo filter = new DirectoryInfo();
+        TourismProject filter = new TourismProject();
         filter.setDataState(1);
         filter.setEnable(1);
+        filter.setIsWinnowDestination(1);
 
-        DirectoryInfo info = directoryInfoService.getDirectoryInfoList(filter, "").get(0);
-        DirectoryInfoVo vo = MyModelUtil.copyTo(info, DirectoryInfoVo.class);
+        List<TourismProject> list = tourismProjectService.getTourismProjectList(filter, "tour_tourism_project.like_count");
 
-        List<String> strings = UrlConvertUtils.urlConvert(applicationConfig.getHostIpPort(), vo.getHotPictureUrl());
-        vo.setHotPictureUrlsAfterConvert(strings);
+        List<IndexHotDestinationVo> dataList = MyModelUtil.copyCollectionTo(list, IndexHotDestinationVo.class);
 
-        return  ResponseResult.success(vo);
+        IndexHotDestinationVo vo = null;
+        if (dataList!=null && !dataList.isEmpty()){
+            vo = dataList.get(0);
+            List<String> strings = UrlConvertUtils.urlConvert(applicationConfig.getHostIpPort(), vo.getHomeHotPicture());
+            vo.setHomeHotPicturesAfterConvert(strings);
+            DirectoryInfo menu = directoryInfoService.getById(vo.getBelongTab());
+            vo.setMenuName(menu.getMenuName());
+        }
+        return ResponseResult.success(vo);
     }
 
     /**
@@ -201,9 +204,9 @@ public class WechatTourismIndexController {
         filter.setIsHotspot(1);
 
         MyOrderParam myOrderParam = new MyOrderParam();
-        new MyOrderParam.OrderInfo("recommendationRate",true, null);
-        new MyOrderParam.OrderInfo("pageViewCount",true, null);
-        new MyOrderParam.OrderInfo("likeCount",true, null);
+        myOrderParam.add(new MyOrderParam.OrderInfo("recommendationRate",true, null));
+        myOrderParam.add(new MyOrderParam.OrderInfo("pageViewCount",true, null));
+        myOrderParam.add(new MyOrderParam.OrderInfo("likeCount",true, null));
         String orderBy = MyOrderParam.buildOrderBy(myOrderParam, TourismProject.class);
 
         System.out.println(orderBy);
@@ -283,9 +286,9 @@ public class WechatTourismIndexController {
         filter.setDataState(1);
 
         MyOrderParam myOrderParam = new MyOrderParam();
-        new MyOrderParam.OrderInfo("recommendationRate",true, null);
-        new MyOrderParam.OrderInfo("pageViewCount",true, null);
-        new MyOrderParam.OrderInfo("likeCount",true, null);
+        myOrderParam.add(new MyOrderParam.OrderInfo("recommendationRate",true, null));
+        myOrderParam.add(new MyOrderParam.OrderInfo("pageViewCount",true, null));
+        myOrderParam.add(new MyOrderParam.OrderInfo("likeCount",true, null));
         String orderBy = MyOrderParam.buildOrderBy(myOrderParam, TourismProject.class);
 
 

+ 8 - 6
application-webadmin/src/main/java/com/tourism/webadmin/back/dao/mapper/DirectoryInfoMapper.xml

@@ -16,7 +16,7 @@
         <result column="is_hotspot" jdbcType="TINYINT" property="isHotspot"/>
         <result column="hot_order" jdbcType="TINYINT" property="hotOrder"/>
         <result column="hot_picture_url" jdbcType="VARCHAR" property="hotPictureUrl"/>
-        <result column="is_winnow_destination" jdbcType="TINYINT" property="isWinnowDestination"/>
+<!--        <result column="is_winnow_destination" jdbcType="TINYINT" property="isWinnowDestination"/>-->
     </resultMap>
 
     <insert id="insertList">
@@ -35,7 +35,8 @@
             is_hotspot,
             hot_order,
             hot_picture_url,
-        is_winnow_destination)
+--         is_winnow_destination
+        )
 
         VALUES
         <foreach collection="list" index="index" item="item" separator="," >
@@ -53,7 +54,8 @@
             #{item.isHotspot},
             #{item.hotOrder},
             #{item.hotPictureUrl},
-            #{item.isWinnowDestination})
+            #{item.isWinnowDestination}
+            )
         </foreach>
     </insert>
 
@@ -90,9 +92,9 @@
             <if test="directoryInfoFilter.directoryId != null">
                 AND tour_directory_info.id &gt;= #{directoryInfoFilter.directoryId}
             </if>
-            <if test="directoryInfoFilter.isWinnowDestination != null">
-                AND tour_directory_info.is_winnow_destination = #{directoryInfoFilter.isWinnowDestination}
-            </if>
+<!--            <if test="directoryInfoFilter.isWinnowDestination != null">-->
+<!--                AND tour_directory_info.is_winnow_destination = #{directoryInfoFilter.isWinnowDestination}-->
+<!--            </if>-->
         </if>
     </sql>
 

+ 2 - 2
application-webadmin/src/main/java/com/tourism/webadmin/back/dao/mapper/TourMapDataMapper.xml

@@ -4,8 +4,8 @@
     <resultMap id="BaseResultMap" type="com.tourism.webadmin.back.model.TourMapData">
         <id column="id" jdbcType="VARCHAR" property="id"/>
         <result column="city_name" jdbcType="VARCHAR" property="cityName"/>
-        <result column="lon" jdbcType="VARCHAR" property="lon"/>
-        <result column="lat" jdbcType="VARCHAR" property="lat"/>
+        <result column="lon" jdbcType="DECIMAL" property="lon"/>
+        <result column="lat" jdbcType="DECIMAL" property="lat"/>
     </resultMap>
 
     <insert id="insertList">

+ 12 - 2
application-webadmin/src/main/java/com/tourism/webadmin/back/dao/mapper/TourismProjectMapper.xml

@@ -35,6 +35,8 @@
         <result column="departure_time" jdbcType="TIMESTAMP" property="departureTime"/>
         <result column="average_cost" jdbcType="VARCHAR" property="averageCost"/>
         <result column="recommendation_rate" jdbcType="TINYINT" property="recommendationRate"/>
+        <result column="is_winnow_destination" jdbcType="TINYINT" property="isWinnowDestination"/>
+
     </resultMap>
 
     <resultMap id="BaseResultMapWithTourTravelNotesProjectRelation" type="com.tourism.webadmin.back.model.TourismProject" extends="BaseResultMap">
@@ -76,7 +78,9 @@
             role,
             departure_time,
             average_cost,
-            recommendation_rate
+            recommendation_rate,
+        is_winnow_destination)
+
 
         VALUES
         <foreach collection="list" index="index" item="item" separator="," >
@@ -112,7 +116,10 @@
             #{item.role},
             #{item.departureTime},
             #{item.averageCost},
-            #{item.recommendationRate})
+            #{item.recommendationRate},
+            #{item.isWinnowDestination}
+
+            )
         </foreach>
     </insert>
 
@@ -162,6 +169,9 @@
                 <bind name = "safeTourismProjectRemarks" value = "'%' + tourismProjectFilter.remarks + '%'" />
                 AND tour_tourism_project.remarks LIKE #{safeTourismProjectRemarks}
             </if>
+            <if test="tourismProjectFilter.isWinnowDestination != null">
+                AND tour_tourism_project.is_winnow_destination = #{tourismProjectFilter.isWinnowDestination}
+            </if>
         </if>
     </sql>
 

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

@@ -85,12 +85,12 @@ public class DirectoryInfoDto {
     @Schema(description = "热点图片。")
     private String hotPictureUrl;
 
-    /**
-     * 精选目的地 1 是 2 不是。
-     * NOTE: 可支持等于操作符的列表数据过滤。
-     */
-    @Schema(description = "精选目的地 1 是 2 不是。可支持等于操作符的列表数据过滤。")
-    private Integer isWinnowDestination;
+//    /**
+//     * 精选目的地 1 是 2 不是。
+//     * NOTE: 可支持等于操作符的列表数据过滤。
+//     */
+//    @Schema(description = "精选目的地 1 是 2 不是。可支持等于操作符的列表数据过滤。")
+//    private Integer isWinnowDestination;
 
     /**
      * menu_name LIKE搜索字符串。

+ 4 - 2
application-webadmin/src/main/java/com/tourism/webadmin/back/dto/TourMapDataDto.java

@@ -7,6 +7,8 @@ import lombok.Data;
 
 import jakarta.validation.constraints.*;
 
+import java.math.BigDecimal;
+
 /**
  * 城市定位管理Dto对象。
  *
@@ -37,14 +39,14 @@ public class TourMapDataDto {
      * NOTE: 可支持等于操作符的列表数据过滤。
      */
     @Schema(description = "经度。可支持等于操作符的列表数据过滤。")
-    private String lon;
+    private BigDecimal lon;
 
     /**
      * 纬度。
      * NOTE: 可支持等于操作符的列表数据过滤。
      */
     @Schema(description = "纬度。可支持等于操作符的列表数据过滤。")
-    private String lat;
+    private BigDecimal lat;
 
     /**
      * city_name LIKE搜索字符串。

+ 7 - 0
application-webadmin/src/main/java/com/tourism/webadmin/back/dto/TourismProjectDto.java

@@ -208,4 +208,11 @@ public class TourismProjectDto {
      */
     @Schema(description = "LIKE模糊搜索字符串")
     private String searchString;
+
+    /**
+     * 精选目的地 1 是 2 不是。
+     * NOTE: 可支持等于操作符的列表数据过滤。
+     */
+    @Schema(description = "精选目的地 1 是 2 不是。可支持等于操作符的列表数据过滤。")
+    private Integer isWinnowDestination;
 }

+ 11 - 12
application-webadmin/src/main/java/com/tourism/webadmin/back/model/DirectoryInfo.java

@@ -8,7 +8,6 @@ import com.tourism.common.core.base.model.BaseModel;
 import com.tourism.webadmin.back.model.constant.CompanyType;
 import com.tourism.webadmin.back.model.constant.Enable;
 import com.tourism.webadmin.back.model.constant.Hotspot;
-import com.tourism.webadmin.back.model.constant.IsWinnowDestination;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 
@@ -86,12 +85,12 @@ public class DirectoryInfo extends BaseModel {
     @UploadFlagColumn(storeType = UploadStoreTypeEnum.HUAWEI_OBS_SYSTEM)
     @TableField(value = "hot_picture_url")
     private String hotPictureUrl;
-
-    /**
-     * 精选目的地 1 是 2 不是。
-     */
-    @TableField(value = "is_winnow_destination")
-    private Integer isWinnowDestination;
+//
+//    /**
+//     * 精选目的地 1 是 2 不是。
+//     */
+//    @TableField(value = "is_winnow_destination")
+//    private Integer isWinnowDestination;
 
     /**
      * menu_name LIKE搜索字符串。
@@ -130,11 +129,11 @@ public class DirectoryInfo extends BaseModel {
     private Map<String, Object> isHotspotDictMap;
 
 
-    @RelationConstDict(
-            masterIdField = "isWinnowDestination",
-            constantDictClass = IsWinnowDestination.class)
-    @TableField(exist = false)
-    private Map<String, Object> isWinnowDestinationDictMap;
+//    @RelationConstDict(
+//            masterIdField = "isWinnowDestination",
+//            constantDictClass = IsWinnowDestination.class)
+//    @TableField(exist = false)
+//    private Map<String, Object> isWinnowDestinationDictMap;
 
     /**
      * 根据directoryId的大小来获取对应级别的菜单。

+ 4 - 2
application-webadmin/src/main/java/com/tourism/webadmin/back/model/TourMapData.java

@@ -4,6 +4,8 @@ import com.baomidou.mybatisplus.annotation.*;
 import com.tourism.common.core.util.MyCommonUtil;
 import lombok.Data;
 
+import java.math.BigDecimal;
+
 /**
  * 城市定位管理实体对象。
  *
@@ -30,13 +32,13 @@ public class TourMapData {
      * 经度。
      */
     @TableField(value = "lon")
-    private String lon;
+    private BigDecimal lon;
 
     /**
      * 纬度。
      */
     @TableField(value = "lat")
-    private String lat;
+    private BigDecimal lat;
 
     /**
      * city_name LIKE搜索字符串。

+ 12 - 0
application-webadmin/src/main/java/com/tourism/webadmin/back/model/TourismProject.java

@@ -205,6 +205,13 @@ public class TourismProject extends BaseModel {
     @TableField(value = "recommendation_rate")
     private Integer recommendationRate;
 
+    /**
+     * 精选目的地 1 是 2 不是。
+     */
+    @TableField(value = "is_winnow_destination")
+    private Integer isWinnowDestination;
+
+
 //    /**
 //     * 上传的联系二维码。
 //     */
@@ -275,4 +282,9 @@ public class TourismProject extends BaseModel {
     @TableField(exist = false)
     private String content;
 
+    @RelationConstDict(
+            masterIdField = "isWinnowDestination",
+            constantDictClass = IsWinnowDestination.class)
+    @TableField(exist = false)
+    private Map<String, Object> isWinnowDestinationDictMap;
 }

+ 4 - 2
application-webadmin/src/main/java/com/tourism/webadmin/back/vo/TourMapDataVo.java

@@ -3,6 +3,8 @@ package com.tourism.webadmin.back.vo;
 import io.swagger.v3.oas.annotations.media.Schema;
 import lombok.Data;
 
+import java.math.BigDecimal;
+
 /**
  * 城市定位管理VO视图对象。
  *
@@ -29,11 +31,11 @@ public class TourMapDataVo {
      * 经度。
      */
     @Schema(description = "经度")
-    private String lon;
+    private BigDecimal lon;
 
     /**
      * 纬度。
      */
     @Schema(description = "纬度")
-    private String lat;
+    private BigDecimal lat;
 }

+ 12 - 0
application-webadmin/src/main/java/com/tourism/webadmin/back/vo/TourismProjectVo.java

@@ -195,6 +195,12 @@ public class TourismProjectVo extends BaseVo {
     private Integer recommendationRate;
 
     /**
+     * 精选目的地 1 是 2 不是。
+     */
+    @Schema(description = "精选目的地 1 是 2 不是")
+    private Integer isWinnowDestination;
+
+    /**
      * id 的一对一关联数据对象,数据对应类型为TourismFileVo。
      */
     @Schema(description = "id 的一对一关联数据对象,数据对应类型为TourismFileVo")
@@ -248,5 +254,11 @@ public class TourismProjectVo extends BaseVo {
     @Schema(description = "上传的联系二维码 contactCode转换后的图片对象")
     private String contactCodeConvert;
 
+    /**
+     * isWinnowDestination 常量字典关联数据。
+     */
+    @Schema(description = "isWinnowDestination 常量字典关联数据")
+    private Map<String, Object> isWinnowDestinationDictMap;
+
 
 }