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

完善门户网站的旅游项目,门户菜单,接口以及swagger扫描设置

chenchen 6 сар өмнө
parent
commit
3cb0a7ae6e
17 өөрчлөгдсөн 404 нэмэгдсэн , 75 устгасан
  1. 6 1
      application-webadmin/src/main/java/com/tourism/webadmin/app/website/controller/BasicToWebController.java
  2. 1 1
      application-webadmin/src/main/java/com/tourism/webadmin/app/website/controller/LoginToWebsiteController.java
  3. 114 1
      application-webadmin/src/main/java/com/tourism/webadmin/back/controller/DirectoryInfoController.java
  4. 11 2
      application-webadmin/src/main/java/com/tourism/webadmin/back/dao/mapper/DirectoryInfoMapper.xml
  5. 1 2
      application-webadmin/src/main/java/com/tourism/webadmin/back/dao/mapper/JobProjectMapper.xml
  6. 41 23
      application-webadmin/src/main/java/com/tourism/webadmin/back/dao/mapper/TourismProjectMapper.xml
  7. 20 0
      application-webadmin/src/main/java/com/tourism/webadmin/back/dto/DirectoryInfoDto.java
  8. 20 18
      application-webadmin/src/main/java/com/tourism/webadmin/back/dto/JobProjectDto.java
  9. 43 6
      application-webadmin/src/main/java/com/tourism/webadmin/back/dto/TourismProjectDto.java
  10. 29 2
      application-webadmin/src/main/java/com/tourism/webadmin/back/model/DirectoryInfo.java
  11. 1 0
      application-webadmin/src/main/java/com/tourism/webadmin/back/model/JobProject.java
  12. 42 4
      application-webadmin/src/main/java/com/tourism/webadmin/back/model/TourismProject.java
  13. 7 0
      application-webadmin/src/main/java/com/tourism/webadmin/back/service/impl/DirectoryInfoServiceImpl.java
  14. 26 3
      application-webadmin/src/main/java/com/tourism/webadmin/back/vo/DirectoryInfoVo.java
  15. 0 5
      application-webadmin/src/main/java/com/tourism/webadmin/back/vo/JobProjectVo.java
  16. 40 5
      application-webadmin/src/main/java/com/tourism/webadmin/back/vo/TourismProjectVo.java
  17. 2 2
      common/common-swagger/src/main/java/com/tourism/common/swagger/config/SwaggerAutoConfiguration.java

+ 6 - 1
application-webadmin/src/main/java/com/tourism/webadmin/app/website/controller/BasicToWebController.java

@@ -5,6 +5,8 @@ import com.tourism.common.core.object.MyOrderParam;
 import com.tourism.common.core.object.MyPageData;
 import com.tourism.common.core.object.ResponseResult;
 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.webadmin.back.model.BannerInfo;
 import com.tourism.webadmin.back.model.CompanyInfo;
 import com.tourism.webadmin.back.model.DirectoryInfo;
@@ -18,6 +20,7 @@ import io.swagger.v3.oas.annotations.tags.Tag;
 import jakarta.validation.constraints.NotNull;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
 
@@ -27,8 +30,9 @@ import java.util.List;
 @Slf4j
 @RestController
 @SaIgnore
-@RequestMapping("/website/basic")
 @Validated
+@ConditionalOnProperty(name = "common-online.operationEnabled", havingValue = "true")
+@RequestMapping("/website/basic")
 public class BasicToWebController {
 
     @Autowired
@@ -42,6 +46,7 @@ public class BasicToWebController {
      * 列出符合过滤条件的banner管理列表。
      * @return 应答结果对象,包含查询结果集。
      */
+    @OperationLog(type = SysOperationLogType.ADD)
     @GetMapping("/bannerList")
     public ResponseResult<MyPageData<BannerInfoVo>> bannerInfoList(@NotNull(message = "所属分类(belongTab)不能为空") Long belongTab) {
         BannerInfo bannerInfoFilter = new BannerInfo();

+ 1 - 1
application-webadmin/src/main/java/com/tourism/webadmin/app/website/controller/LoginToWebsiteController.java

@@ -118,7 +118,7 @@ public class LoginToWebsiteController {
 
         redisCache.setCacheObject(verifyKey, code, Constants.CAPTCHA_EXPIRATION, TimeUnit.MINUTES);
         // 转换流信息写出
-        org.springframework.util.FastByteArrayOutputStream os = new FastByteArrayOutputStream();
+        FastByteArrayOutputStream os = new FastByteArrayOutputStream();
         try
         {
             ImageIO.write(image, "jpg", os);

+ 114 - 1
application-webadmin/src/main/java/com/tourism/webadmin/back/controller/DirectoryInfoController.java

@@ -1,7 +1,13 @@
 package com.tourism.webadmin.back.controller;
 
 import cn.dev33.satoken.annotation.SaCheckPermission;
+import cn.dev33.satoken.annotation.SaIgnore;
 import cn.hutool.core.util.ObjectUtil;
+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;
@@ -13,6 +19,7 @@ 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.webadmin.config.ApplicationConfig;
 import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
 import io.swagger.v3.oas.annotations.tags.Tag;
@@ -22,6 +29,7 @@ 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.*;
 
@@ -40,6 +48,10 @@ public class DirectoryInfoController {
     @Autowired
     private ApplicationConfig appConfig;
     @Autowired
+    private SessionCacheHelper cacheHelper;
+    @Autowired
+    private UpDownloaderFactory upDownloaderFactory;
+    @Autowired
     private DirectoryInfoService directoryInfoService;
 
     /**
@@ -240,7 +252,7 @@ public class DirectoryInfoController {
         // 导出文件的标题数组
         // NOTE: 下面的代码中仅仅导出了主表数据,主表聚合计算数据和主表关联字典的数据。
         // 一对一从表数据的导出,可根据需要自行添加。如:headerMap.put("slaveFieldName.xxxField", "标题名称")
-        Map<String, String> headerMap = new LinkedHashMap<>(11);
+        Map<String, String> headerMap = new LinkedHashMap<>(14);
         headerMap.put("id", "主键id");
         headerMap.put("parentIdDictMap.name", "父级id");
         headerMap.put("menuName", "菜单名称");
@@ -252,6 +264,9 @@ public class DirectoryInfoController {
         headerMap.put("updateUserId", "更新用户");
         headerMap.put("updateTime", "更新时间");
         headerMap.put("dataState", "删除标记(1: 正常 -1: 已删除)");
+        headerMap.put("isHotspotDictMap.name", "是否热点,0非热点,1热点");
+        headerMap.put("hotOrder", "热门排序");
+        headerMap.put("hotPictureUrl", "劳务图片");
         ExportUtil.doExport(resultList, headerMap, "directoryInfo.xlsx");
     }
 
@@ -273,6 +288,104 @@ public class DirectoryInfoController {
     }
 
     /**
+     * 附件文件下载。
+     * 这里将图片和其他类型的附件文件放到不同的父目录下,主要为了便于今后图片文件的迁移。
+     *
+     * @param id 附件所在记录的主键Id。
+     * @param fieldName 附件所属的字段名。
+     * @param filename  文件名。如果没有提供该参数,就从当前记录的指定字段中读取。
+     * @param asImage   下载文件是否为图片。
+     * @param response  Http 应答对象。
+     */
+    @SaIgnore
+    @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 {
+                DirectoryInfo directoryInfo = directoryInfoService.getById(id);
+                if (directoryInfo == null) {
+                    ResponseResult.output(HttpServletResponse.SC_NOT_FOUND);
+                    return;
+                }
+                String fieldJsonData = (String) ReflectUtil.getFieldValue(directoryInfo, 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(DirectoryInfo.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(),
+                    DirectoryInfo.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("directoryInfo.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(DirectoryInfo.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(), DirectoryInfo.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));
+    }
+
+    /**
      * 以字典形式返回全部门户菜单管理数据集合。字典的键值为[id, menuName]。
      * 白名单接口,登录用户均可访问。
      *

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

@@ -13,6 +13,9 @@
         <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="is_hotspot" jdbcType="TINYINT" property="isHotspot"/>
+        <result column="hot_order" jdbcType="TINYINT" property="hotOrder"/>
+        <result column="hot_picture_url" jdbcType="VARCHAR" property="hotPictureUrl"/>
     </resultMap>
 
     <insert id="insertList">
@@ -27,7 +30,10 @@
             create_time,
             update_user_id,
             update_time,
-            data_state)
+            data_state,
+            is_hotspot,
+            hot_order,
+            hot_picture_url)
         VALUES
         <foreach collection="list" index="index" item="item" separator="," >
             (#{item.id},
@@ -40,7 +46,10 @@
             #{item.createTime},
             #{item.updateUserId},
             #{item.updateTime},
-            #{item.dataState})
+            #{item.dataState},
+            #{item.isHotspot},
+            #{item.hotOrder},
+            #{item.hotPictureUrl})
         </foreach>
     </insert>
 

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

@@ -8,7 +8,7 @@
         <result column="belong_tab" jdbcType="BIGINT" property="belongTab"/>
         <result column="job_area" jdbcType="VARCHAR" property="jobArea"/>
         <result column="job_people" jdbcType="INTEGER" property="jobPeople"/>
-<!--        <result column="job_pay" jdbcType="VARCHAR" property="jobPay"/>-->
+        <result column="job_pay" jdbcType="VARCHAR" property="jobPay"/>
         <result column="job_education" jdbcType="VARCHAR" property="jobEducation"/>
         <result column="job_language" jdbcType="VARCHAR" property="jobLanguage"/>
         <result column="job_contract" jdbcType="VARCHAR" property="jobContract"/>
@@ -124,7 +124,6 @@
             <if test="jobProjectFilter.searchString != null and jobProjectFilter.searchString != ''">
                 <bind name = "safeJobProjectSearchString" value = "'%' + jobProjectFilter.searchString + '%'" />
                 AND (IFNULL(tour_job_project.job_title,'') LIKE #{safeJobProjectSearchString}
-                or IFNULL(tour_job_project.job_area,'') LIKE #{safeJobProjectSearchString})
             </if>
             <if test="jobProjectFilter.directoryInfoIds != null and jobProjectFilter.directoryInfoIds.size() > 0">
                 AND tour_job_project.belong_tab IN

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

@@ -12,7 +12,7 @@
         <result column="belong_tab" jdbcType="BIGINT" property="belongTab"/>
         <result column="start_place" jdbcType="VARCHAR" property="startPlace"/>
         <result column="end_place" jdbcType="VARCHAR" property="endPlace"/>
-        <result column="count_times" jdbcType="TINYINT" property="countTimes"/>
+        <result column="count_times" jdbcType="VARCHAR" property="countTimes"/>
         <result column="price" jdbcType="DECIMAL" property="price"/>
         <result column="tourism_url" jdbcType="VARCHAR" property="tourismUrl"/>
         <result column="create_user_id" jdbcType="BIGINT" property="createUserId"/>
@@ -21,30 +21,42 @@
         <result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
         <result column="data_state" jdbcType="TINYINT" property="dataState"/>
         <result column="price_unit" jdbcType="VARCHAR" property="priceUnit"/>
+        <result column="service_ensure" jdbcType="VARCHAR" property="serviceEnsure"/>
+        <result column="contact_number" jdbcType="VARCHAR" property="contactNumber"/>
+        <result column="selling_point" jdbcType="VARCHAR" property="sellingPoint"/>
+        <result column="short_title" jdbcType="VARCHAR" property="shortTitle"/>
+        <result column="short_description" jdbcType="VARCHAR" property="shortDescription"/>
+        <result column="home_hot_picture" jdbcType="VARCHAR" property="homeHotPicture"/>
     </resultMap>
 
     <insert id="insertList">
-        INSERT INTO tour_tourism_project
-        (id,
-        project_title,
-        remarks,
-        is_hotspot,
-        project_label,
-        show_order,
-        enable,
-        belong_tab,
-        start_place,
-        end_place,
-        count_times,
-        price,
-        tourism_url,
-        create_user_id,
-        create_time,
-        update_user_id,
-        update_time,
-        data_state,
-        price_unit)
-        VALUES
+            INSERT INTO tour_tourism_project
+            (id,
+            project_title,
+            remarks,
+            is_hotspot,
+            project_label,
+            show_order,
+            enable,
+            belong_tab,
+            start_place,
+            end_place,
+            count_times,
+            price,
+            tourism_url,
+            create_user_id,
+            create_time,
+            update_user_id,
+            update_time,
+            data_state,
+            price_unit,
+            service_ensure,
+            contact_number,
+            selling_point,
+            short_title,
+            short_description,
+            home_hot_picture)
+            VALUES
         <foreach collection="list" index="index" item="item" separator="," >
             (#{item.id},
             #{item.projectTitle},
@@ -64,7 +76,13 @@
             #{item.updateUserId},
             #{item.updateTime},
             #{item.dataState},
-            #{item.priceUnit})
+            #{item.priceUnit},
+            #{item.serviceEnsure},
+            #{item.contactNumber},
+            #{item.sellingPoint},
+            #{item.shortTitle},
+            #{item.shortDescription},
+            #{item.homeHotPicture})
         </foreach>
     </insert>
 

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

@@ -4,6 +4,7 @@ import com.tourism.common.core.validator.UpdateGroup;
 import com.tourism.common.core.validator.ConstDictRef;
 import com.tourism.webadmin.back.model.constant.Enable;
 import com.tourism.webadmin.back.model.constant.CompanyType;
+import com.tourism.webadmin.back.model.constant.Hotspot;
 
 import io.swagger.v3.oas.annotations.media.Schema;
 import lombok.Data;
@@ -66,6 +67,25 @@ public class DirectoryInfoDto {
     private Integer directoryType;
 
     /**
+     * 是否热点,0非热点,1热点。
+     */
+    @Schema(description = "是否热点,0非热点,1热点。")
+    @ConstDictRef(constDictClass = Hotspot.class, message = "数据验证失败,是否热点,0非热点,1热点为无效值!")
+    private Integer isHotspot;
+
+    /**
+     * 热门排序。
+     */
+    @Schema(description = "热门排序。")
+    private Integer hotOrder;
+
+    /**
+     * 劳务图片。
+     */
+    @Schema(description = "劳务图片。")
+    private String hotPictureUrl;
+
+    /**
      * menu_name LIKE搜索字符串。
      * NOTE: 可支持LIKE操作符的列表数据过滤。
      */

+ 20 - 18
application-webadmin/src/main/java/com/tourism/webadmin/back/dto/JobProjectDto.java

@@ -10,6 +10,7 @@ import lombok.Data;
 
 import jakarta.validation.constraints.*;
 
+import java.math.BigDecimal;
 import java.util.List;
 
 /**
@@ -67,24 +68,6 @@ public class JobProjectDto {
     private String jobPay;
 
     /**
-     * 工资上限。
-     */
-    @Schema(description = "工资上限")
-    private String salaryCap;
-
-    /**
-     * 工资下限。
-     */
-    @Schema(description = "工资下限")
-    private String salaryFloor;
-
-    /**
-     * 工资单位。
-     */
-    @Schema(description = "工资单位")
-    private String salaryUnit;
-
-    /**
      * 学历要求。
      */
     @Schema(description = "学历要求。")
@@ -171,6 +154,24 @@ public class JobProjectDto {
     private String remarks;
 
     /**
+     * 工资上限。
+     */
+    @Schema(description = "工资上限。")
+    private BigDecimal salaryCap;
+
+    /**
+     * 工资下限。
+     */
+    @Schema(description = "工资下限。")
+    private BigDecimal salaryFloor;
+
+    /**
+     * 工资单位。
+     */
+    @Schema(description = "工资单位。")
+    private String salaryUnit;
+
+    /**
      * job_title LIKE搜索字符串。
      * NOTE: 可支持LIKE操作符的列表数据过滤。
      */
@@ -180,5 +181,6 @@ public class JobProjectDto {
     /**
      * 菜单id。
      */
+    @Schema(description = "子级菜单ids")
     private List<Long> directoryInfoIds;
 }

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

@@ -2,14 +2,15 @@ package com.tourism.webadmin.back.dto;
 
 import com.tourism.common.core.validator.UpdateGroup;
 import com.tourism.common.core.validator.ConstDictRef;
-
-import com.tourism.webadmin.back.model.constant.Enable;
 import com.tourism.webadmin.back.model.constant.Hotspot;
+import com.tourism.webadmin.back.model.constant.Enable;
+
 import io.swagger.v3.oas.annotations.media.Schema;
-import jakarta.validation.constraints.NotBlank;
-import jakarta.validation.constraints.NotNull;
 import lombok.Data;
 
+import jakarta.validation.constraints.*;
+
+import java.math.BigDecimal;
 import java.util.List;
 
 /**
@@ -90,13 +91,13 @@ public class TourismProjectDto {
      * 总天数。
      */
     @Schema(description = "总天数。")
-    private Integer countTimes;
+    private String countTimes;
 
     /**
      * 项目价格。
      */
     @Schema(description = "项目价格。")
-    private String price;
+    private BigDecimal price;
 
     /**
      * 项目展示图片。
@@ -111,6 +112,42 @@ public class TourismProjectDto {
     private String priceUnit;
 
     /**
+     * 服务保障。
+     */
+    @Schema(description = "服务保障。")
+    private String serviceEnsure;
+
+    /**
+     * 联系电话。
+     */
+    @Schema(description = "联系电话。")
+    private String contactNumber;
+
+    /**
+     * 产品卖点。
+     */
+    @Schema(description = "产品卖点。")
+    private String sellingPoint;
+
+    /**
+     * 短标题。
+     */
+    @Schema(description = "短标题。")
+    private String shortTitle;
+
+    /**
+     * 短描述。
+     */
+    @Schema(description = "短描述。")
+    private String shortDescription;
+
+    /**
+     * 首页热门图片。
+     */
+    @Schema(description = "首页热门图片。")
+    private String homeHotPicture;
+
+    /**
      * project_title LIKE搜索字符串。
      * NOTE: 可支持LIKE操作符的列表数据过滤。
      */

+ 29 - 2
application-webadmin/src/main/java/com/tourism/webadmin/back/model/DirectoryInfo.java

@@ -1,11 +1,13 @@
 package com.tourism.webadmin.back.model;
 
 import com.baomidou.mybatisplus.annotation.*;
-import com.tourism.webadmin.back.model.constant.Enable;
-import com.tourism.webadmin.back.model.constant.CompanyType;
 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 com.tourism.webadmin.back.model.constant.CompanyType;
+import com.tourism.webadmin.back.model.constant.Enable;
+import com.tourism.webadmin.back.model.constant.Hotspot;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 
@@ -66,6 +68,25 @@ public class DirectoryInfo extends BaseModel {
     private Integer dataState;
 
     /**
+     * 是否热点,0非热点,1热点。
+     */
+    @TableField(value = "is_hotspot")
+    private Integer isHotspot;
+
+    /**
+     * 热门排序。
+     */
+    @TableField(value = "hot_order")
+    private Integer hotOrder;
+
+    /**
+     * 劳务图片。
+     */
+    @UploadFlagColumn(storeType = UploadStoreTypeEnum.HUAWEI_OBS_SYSTEM)
+    @TableField(value = "hot_picture_url")
+    private String hotPictureUrl;
+
+    /**
      * menu_name LIKE搜索字符串。
      */
     @TableField(exist = false)
@@ -94,4 +115,10 @@ public class DirectoryInfo extends BaseModel {
             constantDictClass = CompanyType.class)
     @TableField(exist = false)
     private Map<String, Object> directoryTypeDictMap;
+
+    @RelationConstDict(
+            masterIdField = "isHotspot",
+            constantDictClass = Hotspot.class)
+    @TableField(exist = false)
+    private Map<String, Object> isHotspotDictMap;
 }

+ 1 - 0
application-webadmin/src/main/java/com/tourism/webadmin/back/model/JobProject.java

@@ -224,5 +224,6 @@ public class JobProject extends BaseModel {
     /**
      * 菜单id。
      */
+    @TableField(exist = false)
     private List<Long> directoryInfoIds;
 }

+ 42 - 4
application-webadmin/src/main/java/com/tourism/webadmin/back/model/TourismProject.java

@@ -1,15 +1,16 @@
 package com.tourism.webadmin.back.model;
 
 import com.baomidou.mybatisplus.annotation.*;
+import com.tourism.webadmin.back.model.constant.Hotspot;
+import com.tourism.webadmin.back.model.constant.Enable;
 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 com.tourism.webadmin.back.model.constant.Enable;
-import com.tourism.webadmin.back.model.constant.Hotspot;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 
+import java.math.BigDecimal;
 import java.util.List;
 import java.util.Map;
 
@@ -88,13 +89,13 @@ public class TourismProject extends BaseModel {
      * 总天数。
      */
     @TableField(value = "count_times")
-    private Integer countTimes;
+    private String countTimes;
 
     /**
      * 项目价格。
      */
     @TableField(value = "price")
-    private String price;
+    private BigDecimal price;
 
     /**
      * 项目展示图片。
@@ -117,6 +118,43 @@ public class TourismProject extends BaseModel {
     private String priceUnit;
 
     /**
+     * 服务保障。
+     */
+    @TableField(value = "service_ensure")
+    private String serviceEnsure;
+
+    /**
+     * 联系电话。
+     */
+    @TableField(value = "contact_number")
+    private String contactNumber;
+
+    /**
+     * 产品卖点。
+     */
+    @TableField(value = "selling_point")
+    private String sellingPoint;
+
+    /**
+     * 短标题。
+     */
+    @TableField(value = "short_title")
+    private String shortTitle;
+
+    /**
+     * 短描述。
+     */
+    @TableField(value = "short_description")
+    private String shortDescription;
+
+    /**
+     * 首页热门图片。
+     */
+    @UploadFlagColumn(storeType = UploadStoreTypeEnum.HUAWEI_OBS_SYSTEM)
+    @TableField(value = "home_hot_picture")
+    private String homeHotPicture;
+
+    /**
      * project_title LIKE搜索字符串。
      */
     @TableField(exist = false)

+ 7 - 0
application-webadmin/src/main/java/com/tourism/webadmin/back/service/impl/DirectoryInfoServiceImpl.java

@@ -2,6 +2,7 @@ package com.tourism.webadmin.back.service.impl;
 
 import cn.hutool.core.collection.CollUtil;
 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.*;
@@ -30,6 +31,8 @@ import java.util.*;
 public class DirectoryInfoServiceImpl extends BaseService<DirectoryInfo, Long> implements DirectoryInfoService {
 
     @Autowired
+    private IdGeneratorWrapper idGenerator;
+    @Autowired
     private DirectoryInfoMapper directoryInfoMapper;
     @Autowired
     private DirectoryInfoService directoryInfoService;
@@ -158,8 +161,12 @@ public class DirectoryInfoServiceImpl extends BaseService<DirectoryInfo, Long> i
     }
 
     private DirectoryInfo buildDefaultValue(DirectoryInfo directoryInfo) {
+        if (directoryInfo.getId() == null) {
+            directoryInfo.setId(idGenerator.nextLongId());
+        }
         MyModelUtil.fillCommonsForInsert(directoryInfo);
         directoryInfo.setDataState(GlobalDeletedFlag.NORMAL);
         return directoryInfo;
     }
+
 }

+ 26 - 3
application-webadmin/src/main/java/com/tourism/webadmin/back/vo/DirectoryInfoVo.java

@@ -1,12 +1,11 @@
 package com.tourism.webadmin.back.vo;
 
-import com.fasterxml.jackson.databind.annotation.JsonSerialize;
-import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
 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;
 
 /**
@@ -30,7 +29,7 @@ public class DirectoryInfoVo extends BaseVo {
      * 父级id。
      */
     @Schema(description = "父级id")
-    private String parentId;
+    private Long parentId;
 
     /**
      * 菜单名称。
@@ -57,6 +56,24 @@ public class DirectoryInfoVo extends BaseVo {
     private Integer directoryType;
 
     /**
+     * 是否热点,0非热点,1热点。
+     */
+    @Schema(description = "是否热点,0非热点,1热点")
+    private Integer isHotspot;
+
+    /**
+     * 热门排序。
+     */
+    @Schema(description = "热门排序")
+    private Integer hotOrder;
+
+    /**
+     * 劳务图片。
+     */
+    @Schema(description = "劳务图片")
+    private String hotPictureUrl;
+
+    /**
      * parentId 字典关联数据。
      */
     @Schema(description = "parentId 字典关联数据")
@@ -73,4 +90,10 @@ public class DirectoryInfoVo extends BaseVo {
      */
     @Schema(description = "directoryType 常量字典关联数据")
     private Map<String, Object> directoryTypeDictMap;
+
+    /**
+     * isHotspot 常量字典关联数据。
+     */
+    @Schema(description = "isHotspot 常量字典关联数据")
+    private Map<String, Object> isHotspotDictMap;
 }

+ 0 - 5
application-webadmin/src/main/java/com/tourism/webadmin/back/vo/JobProjectVo.java

@@ -1,14 +1,9 @@
 package com.tourism.webadmin.back.vo;
 
-import com.baomidou.mybatisplus.annotation.TableField;
-import com.fasterxml.jackson.databind.annotation.JsonSerialize;
-import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
 import com.tourism.common.core.base.vo.BaseVo;
 import io.swagger.v3.oas.annotations.media.Schema;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
-
-import java.math.BigDecimal;
 import java.util.Map;
 
 /**

+ 40 - 5
application-webadmin/src/main/java/com/tourism/webadmin/back/vo/TourismProjectVo.java

@@ -1,12 +1,11 @@
 package com.tourism.webadmin.back.vo;
 
-import com.fasterxml.jackson.databind.annotation.JsonSerialize;
-import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
 import com.tourism.common.core.base.vo.BaseVo;
 import io.swagger.v3.oas.annotations.media.Schema;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 
+import java.math.BigDecimal;
 import java.util.Map;
 
 /**
@@ -66,7 +65,7 @@ public class TourismProjectVo extends BaseVo {
      * 所属分类。
      */
     @Schema(description = "所属分类")
-    private String belongTab;
+    private Long belongTab;
 
     /**
      * 出发地。
@@ -84,13 +83,13 @@ public class TourismProjectVo extends BaseVo {
      * 总天数。
      */
     @Schema(description = "总天数")
-    private Integer countTimes;
+    private String countTimes;
 
     /**
      * 项目价格。
      */
     @Schema(description = "项目价格")
-    private String price;
+    private BigDecimal price;
 
     /**
      * 项目展示图片。
@@ -105,6 +104,42 @@ public class TourismProjectVo extends BaseVo {
     private String priceUnit;
 
     /**
+     * 服务保障。
+     */
+    @Schema(description = "服务保障")
+    private String serviceEnsure;
+
+    /**
+     * 联系电话。
+     */
+    @Schema(description = "联系电话")
+    private String contactNumber;
+
+    /**
+     * 产品卖点。
+     */
+    @Schema(description = "产品卖点")
+    private String sellingPoint;
+
+    /**
+     * 短标题。
+     */
+    @Schema(description = "短标题")
+    private String shortTitle;
+
+    /**
+     * 短描述。
+     */
+    @Schema(description = "短描述")
+    private String shortDescription;
+
+    /**
+     * 首页热门图片。
+     */
+    @Schema(description = "首页热门图片")
+    private String homeHotPicture;
+
+    /**
      * id 的一对一关联数据对象,数据对应类型为TourismFileVo。
      */
     @Schema(description = "id 的一对一关联数据对象,数据对应类型为TourismFileVo")

+ 2 - 2
common/common-swagger/src/main/java/com/tourism/common/swagger/config/SwaggerAutoConfiguration.java

@@ -28,8 +28,8 @@ public class SwaggerAutoConfiguration {
 
     @Bean
     public GroupedOpenApi bizApi(SwaggerProperties p) {
-        String[] paths = {"/admin/app/**"};
-        String[] packagedToMatch = {p.getServiceBasePackage() + ".app.controller"};
+        String[] paths = {"/website/**/**"};
+        String[] packagedToMatch = {p.getServiceBasePackage() + ".app.website.controller"};
         return GroupedOpenApi.builder().group("业务应用分组接口")
                 .pathsToMatch(paths)
                 .packagesToScan(packagedToMatch).build();