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

[fix]
重新设计关联关系

chenchen 3 сар өмнө
parent
commit
33c6c7bfce
20 өөрчлөгдсөн 180 нэмэгдсэн , 594 устгасан
  1. 10 0
      application-webadmin/src/main/java/com/tourism/webadmin/back/controller/TourProjectGroupPurchaseController.java
  2. 7 1
      application-webadmin/src/main/java/com/tourism/webadmin/back/controller/TourProjectGroupPurchaseDetailController.java
  3. 0 179
      application-webadmin/src/main/java/com/tourism/webadmin/back/controller/TourProjectGroupPurchaseProgressController.java
  4. 1 1
      application-webadmin/src/main/java/com/tourism/webadmin/back/dao/TourProjectGroupPurchaseDetailMapper.java
  5. 0 33
      application-webadmin/src/main/java/com/tourism/webadmin/back/dao/TourProjectGroupPurchaseProgressMapper.java
  6. 7 3
      application-webadmin/src/main/java/com/tourism/webadmin/back/dao/mapper/TourProjectGroupPurchaseDetailMapper.xml
  7. 17 2
      application-webadmin/src/main/java/com/tourism/webadmin/back/dao/mapper/TourProjectGroupPurchaseMapper.xml
  8. 0 69
      application-webadmin/src/main/java/com/tourism/webadmin/back/dao/mapper/TourProjectGroupPurchaseProgressMapper.xml
  9. 24 0
      application-webadmin/src/main/java/com/tourism/webadmin/back/dto/TourProjectGroupPurchaseDto.java
  10. 31 15
      application-webadmin/src/main/java/com/tourism/webadmin/back/model/TourProjectGroupPurchase.java
  11. 8 3
      application-webadmin/src/main/java/com/tourism/webadmin/back/model/TourProjectGroupPurchaseDetail.java
  12. 0 57
      application-webadmin/src/main/java/com/tourism/webadmin/back/model/TourProjectGroupPurchaseProgress.java
  13. 11 1
      application-webadmin/src/main/java/com/tourism/webadmin/back/service/TourProjectGroupPurchaseDetailService.java
  14. 0 68
      application-webadmin/src/main/java/com/tourism/webadmin/back/service/TourProjectGroupPurchaseProgressService.java
  15. 14 0
      application-webadmin/src/main/java/com/tourism/webadmin/back/service/impl/TourProjectGroupPurchaseDetailServiceImpl.java
  16. 0 103
      application-webadmin/src/main/java/com/tourism/webadmin/back/service/impl/TourProjectGroupPurchaseProgressServiceImpl.java
  17. 22 0
      application-webadmin/src/main/java/com/tourism/webadmin/back/service/impl/TourProjectGroupPurchaseServiceImpl.java
  18. 4 3
      application-webadmin/src/main/java/com/tourism/webadmin/back/vo/TourProjectGroupPurchaseDetailVo.java
  19. 0 49
      application-webadmin/src/main/java/com/tourism/webadmin/back/vo/TourProjectGroupPurchaseProgressVo.java
  20. 24 7
      application-webadmin/src/main/java/com/tourism/webadmin/back/vo/TourProjectGroupPurchaseVo.java

+ 10 - 0
application-webadmin/src/main/java/com/tourism/webadmin/back/controller/TourProjectGroupPurchaseController.java

@@ -64,6 +64,11 @@ public class TourProjectGroupPurchaseController {
             return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATED_FAILED, errorMessage);
         }
         TourProjectGroupPurchase tourProjectGroupPurchase = MyModelUtil.copyTo(tourProjectGroupPurchaseDto, TourProjectGroupPurchase.class);
+        // 验证关联Id的数据合法性
+        CallResult callResult = tourProjectGroupPurchaseService.verifyRelatedData(tourProjectGroupPurchase, null);
+        if (!callResult.isSuccess()) {
+            return ResponseResult.errorFrom(callResult);
+        }
         tourProjectGroupPurchase = tourProjectGroupPurchaseService.saveNew(tourProjectGroupPurchase);
         return ResponseResult.success(tourProjectGroupPurchase.getId());
     }
@@ -102,6 +107,11 @@ public class TourProjectGroupPurchaseController {
             errorMessage = "数据验证失败,当前 [数据] 并不存在,请刷新后重试!";
             return ResponseResult.error(ErrorCodeEnum.DATA_NOT_EXIST, errorMessage);
         }
+        // 验证关联Id的数据合法性
+        CallResult callResult = tourProjectGroupPurchaseService.verifyRelatedData(tourProjectGroupPurchase, originalTourProjectGroupPurchase);
+        if (!callResult.isSuccess()) {
+            return ResponseResult.errorFrom(callResult);
+        }
         if (!tourProjectGroupPurchaseService.update(tourProjectGroupPurchase, originalTourProjectGroupPurchase)) {
             return ResponseResult.error(ErrorCodeEnum.DATA_NOT_EXIST);
         }

+ 7 - 1
application-webadmin/src/main/java/com/tourism/webadmin/back/controller/TourProjectGroupPurchaseDetailController.java

@@ -142,7 +142,7 @@ public class TourProjectGroupPurchaseDetailController {
      * 列出符合过滤条件的拼团设置从表列表。
      *
      * @param tourProjectGroupPurchaseDetailDtoFilter 过滤对象。
-     * @param tourProjectGroupPurchaseDtoFilter 一对从表过滤对象。
+     * @param tourProjectGroupPurchaseDtoFilter 一对从表过滤对象。
      * @param orderParam 排序参数。
      * @param pageParam 分页参数。
      * @return 应答结果对象,包含查询结果集。
@@ -191,6 +191,12 @@ public class TourProjectGroupPurchaseDetailController {
             errorMessage = "数据验证失败,当前 [对象] 并不存在,请刷新后重试!";
             return ResponseResult.error(ErrorCodeEnum.DATA_NOT_EXIST, errorMessage);
         }
+        // NOTE: 如果该对象的删除前数据一致性验证和实际需求有偏差,可以根据需求调整验证字段,甚至也可以直接删除下面的验证。
+        // 删除前,先主动验证是否存在关联的从表数据。
+        CallResult callResult = tourProjectGroupPurchaseDetailService.verifyRelatedDataBeforeDelete(originalTourProjectGroupPurchaseDetail);
+        if (!callResult.isSuccess()) {
+            return ResponseResult.errorFrom(callResult);
+        }
         if (!tourProjectGroupPurchaseDetailService.remove(id)) {
             errorMessage = "数据操作失败,删除的对象不存在,请刷新后重试!";
             return ResponseResult.error(ErrorCodeEnum.DATA_NOT_EXIST, errorMessage);

+ 0 - 179
application-webadmin/src/main/java/com/tourism/webadmin/back/controller/TourProjectGroupPurchaseProgressController.java

@@ -1,179 +0,0 @@
-package com.tourism.webadmin.back.controller;
-
-import cn.dev33.satoken.annotation.SaCheckPermission;
-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.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 java.util.*;
-
-/**
- * 拼图的当前人数表操作控制器类。
- *
- * @author 吃饭睡觉
- * @date 2024-09-06
- */
-@Tag(name = "拼图的当前人数表管理接口")
-@Slf4j
-@RestController
-@RequestMapping("/admin/app/tourProjectGroupPurchaseProgress")
-public class TourProjectGroupPurchaseProgressController {
-
-    @Autowired
-    private TourProjectGroupPurchaseProgressService tourProjectGroupPurchaseProgressService;
-
-    /**
-     * 新增拼图的当前人数表数据。
-     *
-     * @param tourProjectGroupPurchaseProgressDto 新增对象。
-     * @return 应答结果对象,包含新增对象主键Id。
-     */
-    @ApiOperationSupport(ignoreParameters = {"tourProjectGroupPurchaseProgressDto.id"})
-    @SaCheckPermission("tourProjectGroupPurchaseProgress.add")
-    @OperationLog(type = SysOperationLogType.ADD)
-    @PostMapping("/add")
-    public ResponseResult<Long> add(@MyRequestBody TourProjectGroupPurchaseProgressDto tourProjectGroupPurchaseProgressDto) {
-        String errorMessage = MyCommonUtil.getModelValidationError(tourProjectGroupPurchaseProgressDto, false);
-        if (errorMessage != null) {
-            return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATED_FAILED, errorMessage);
-        }
-        TourProjectGroupPurchaseProgress tourProjectGroupPurchaseProgress = MyModelUtil.copyTo(tourProjectGroupPurchaseProgressDto, TourProjectGroupPurchaseProgress.class);
-        tourProjectGroupPurchaseProgress = tourProjectGroupPurchaseProgressService.saveNew(tourProjectGroupPurchaseProgress);
-        return ResponseResult.success(tourProjectGroupPurchaseProgress.getId());
-    }
-
-    /**
-     * 更新拼图的当前人数表数据。
-     *
-     * @param tourProjectGroupPurchaseProgressDto 更新对象。
-     * @return 应答结果对象。
-     */
-    @SaCheckPermission("tourProjectGroupPurchaseProgress.update")
-    @OperationLog(type = SysOperationLogType.UPDATE)
-    @PostMapping("/update")
-    public ResponseResult<Void> update(@MyRequestBody TourProjectGroupPurchaseProgressDto tourProjectGroupPurchaseProgressDto) {
-        String errorMessage = MyCommonUtil.getModelValidationError(tourProjectGroupPurchaseProgressDto, true);
-        if (errorMessage != null) {
-            return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATED_FAILED, errorMessage);
-        }
-        TourProjectGroupPurchaseProgress tourProjectGroupPurchaseProgress = MyModelUtil.copyTo(tourProjectGroupPurchaseProgressDto, TourProjectGroupPurchaseProgress.class);
-        TourProjectGroupPurchaseProgress originalTourProjectGroupPurchaseProgress = tourProjectGroupPurchaseProgressService.getById(tourProjectGroupPurchaseProgress.getId());
-        if (originalTourProjectGroupPurchaseProgress == null) {
-            // NOTE: 修改下面方括号中的话述
-            errorMessage = "数据验证失败,当前 [数据] 并不存在,请刷新后重试!";
-            return ResponseResult.error(ErrorCodeEnum.DATA_NOT_EXIST, errorMessage);
-        }
-        if (!tourProjectGroupPurchaseProgressService.update(tourProjectGroupPurchaseProgress, originalTourProjectGroupPurchaseProgress)) {
-            return ResponseResult.error(ErrorCodeEnum.DATA_NOT_EXIST);
-        }
-        return ResponseResult.success();
-    }
-
-    /**
-     * 删除拼图的当前人数表数据。
-     *
-     * @param id 删除对象主键Id。
-     * @return 应答结果对象。
-     */
-    @SaCheckPermission("tourProjectGroupPurchaseProgress.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("tourProjectGroupPurchaseProgress.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 tourProjectGroupPurchaseProgressDtoFilter 过滤对象。
-     * @param orderParam 排序参数。
-     * @param pageParam 分页参数。
-     * @return 应答结果对象,包含查询结果集。
-     */
-    @SaCheckPermission("tourProjectGroupPurchaseProgress.view")
-    @PostMapping("/list")
-    public ResponseResult<MyPageData<TourProjectGroupPurchaseProgressVo>> list(
-            @MyRequestBody TourProjectGroupPurchaseProgressDto tourProjectGroupPurchaseProgressDtoFilter,
-            @MyRequestBody MyOrderParam orderParam,
-            @MyRequestBody MyPageParam pageParam) {
-        if (pageParam != null) {
-            PageMethod.startPage(pageParam.getPageNum(), pageParam.getPageSize(), pageParam.getCount());
-        }
-        TourProjectGroupPurchaseProgress tourProjectGroupPurchaseProgressFilter = MyModelUtil.copyTo(tourProjectGroupPurchaseProgressDtoFilter, TourProjectGroupPurchaseProgress.class);
-        String orderBy = MyOrderParam.buildOrderBy(orderParam, TourProjectGroupPurchaseProgress.class);
-        List<TourProjectGroupPurchaseProgress> tourProjectGroupPurchaseProgressList =
-                tourProjectGroupPurchaseProgressService.getTourProjectGroupPurchaseProgressListWithRelation(tourProjectGroupPurchaseProgressFilter, orderBy);
-        return ResponseResult.success(MyPageUtil.makeResponseData(tourProjectGroupPurchaseProgressList, TourProjectGroupPurchaseProgressVo.class));
-    }
-
-    /**
-     * 查看指定拼图的当前人数表对象详情。
-     *
-     * @param id 指定对象主键Id。
-     * @return 应答结果对象,包含对象详情。
-     */
-    @SaCheckPermission("tourProjectGroupPurchaseProgress.view")
-    @GetMapping("/view")
-    public ResponseResult<TourProjectGroupPurchaseProgressVo> view(@RequestParam Long id) {
-        TourProjectGroupPurchaseProgress tourProjectGroupPurchaseProgress = tourProjectGroupPurchaseProgressService.getByIdWithRelation(id, MyRelationParam.full());
-        if (tourProjectGroupPurchaseProgress == null) {
-            return ResponseResult.error(ErrorCodeEnum.DATA_NOT_EXIST);
-        }
-        TourProjectGroupPurchaseProgressVo tourProjectGroupPurchaseProgressVo = MyModelUtil.copyTo(tourProjectGroupPurchaseProgress, TourProjectGroupPurchaseProgressVo.class);
-        return ResponseResult.success(tourProjectGroupPurchaseProgressVo);
-    }
-
-    private ResponseResult<Void> doDelete(Long id) {
-        String errorMessage;
-        // 验证关联Id的数据合法性
-        TourProjectGroupPurchaseProgress originalTourProjectGroupPurchaseProgress = tourProjectGroupPurchaseProgressService.getById(id);
-        if (originalTourProjectGroupPurchaseProgress == null) {
-            // NOTE: 修改下面方括号中的话述
-            errorMessage = "数据验证失败,当前 [对象] 并不存在,请刷新后重试!";
-            return ResponseResult.error(ErrorCodeEnum.DATA_NOT_EXIST, errorMessage);
-        }
-        if (!tourProjectGroupPurchaseProgressService.remove(id)) {
-            errorMessage = "数据操作失败,删除的对象不存在,请刷新后重试!";
-            return ResponseResult.error(ErrorCodeEnum.DATA_NOT_EXIST, errorMessage);
-        }
-        return ResponseResult.success();
-    }
-}

+ 1 - 1
application-webadmin/src/main/java/com/tourism/webadmin/back/dao/TourProjectGroupPurchaseDetailMapper.java

@@ -36,7 +36,7 @@ public interface TourProjectGroupPurchaseDetailMapper extends BaseDaoMapper<Tour
      * 获取过滤后的对象列表。同时支持基于一对一从表字段的过滤条件。
      *
      * @param tourProjectGroupPurchaseDetailFilter 主表过滤对象。
-     * @param tourProjectGroupPurchaseFilter 一对从表过滤对象。
+     * @param tourProjectGroupPurchaseFilter 一对从表过滤对象。
      * @param orderBy 排序字符串,order by从句的参数。
      * @return 对象列表。
      */

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

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

+ 7 - 3
application-webadmin/src/main/java/com/tourism/webadmin/back/dao/mapper/TourProjectGroupPurchaseDetailMapper.xml

@@ -100,11 +100,15 @@
             tour_project_group_purchase_detail.*
         FROM
             tour_project_group_purchase_detail
-        LEFT JOIN
-            tour_project_group_purchase ON tour_project_group_purchase_detail.group_purchase_id = tour_project_group_purchase.id AND tour_project_group_purchase.data_state = ${@com.tourism.common.core.constant.GlobalDeletedFlag@NORMAL}
         <where>
             <include refid="filterRef"/>
-            <include refid="com.tourism.webadmin.back.dao.TourProjectGroupPurchaseMapper.inputFilterRef"/>
+            <if test="tourProjectGroupPurchaseFilter != null">
+                AND EXISTS (SELECT * FROM tour_project_group_purchase
+                <where>
+                    tour_project_group_purchase_detail.group_purchase_id = tour_project_group_purchase.code
+                    <include refid="com.tourism.webadmin.back.dao.TourProjectGroupPurchaseMapper.filterRef"/>
+                </where>)
+            </if>
         </where>
         <if test="orderBy != null and orderBy != ''">
             ORDER BY ${orderBy}

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

@@ -17,6 +17,10 @@
         <result column="adult_price" jdbcType="DECIMAL" property="adultPrice"/>
         <result column="children_price" jdbcType="DECIMAL" property="childrenPrice"/>
         <result column="show_order" jdbcType="INTEGER" property="showOrder"/>
+        <result column="code" jdbcType="BIGINT" property="code"/>
+        <result column="now_count" jdbcType="INTEGER" property="nowCount"/>
+        <result column="success" jdbcType="TINYINT" property="success"/>
+        <result column="title" jdbcType="VARCHAR" property="title"/>
     </resultMap>
 
     <insert id="insertList">
@@ -35,7 +39,11 @@
             max_count,
             adult_price,
             children_price,
-            show_order)
+            show_order,
+            code,
+            now_count,
+            success,
+            title)
         VALUES
         <foreach collection="list" index="index" item="item" separator="," >
             (#{item.id},
@@ -52,7 +60,11 @@
             #{item.maxCount},
             #{item.adultPrice},
             #{item.childrenPrice},
-            #{item.showOrder})
+            #{item.showOrder},
+            #{item.code},
+            #{item.nowCount},
+            #{item.success},
+            #{item.title})
         </foreach>
     </insert>
 
@@ -108,6 +120,9 @@
             <if test="tourProjectGroupPurchaseFilter.childrenPriceEnd != null">
                 AND tour_project_group_purchase.children_price &lt;= #{tourProjectGroupPurchaseFilter.childrenPriceEnd}
             </if>
+            <if test="tourProjectGroupPurchaseFilter.code != null">
+                AND tour_project_group_purchase.code = #{tourProjectGroupPurchaseFilter.code}
+            </if>
         </if>
     </sql>
 

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

@@ -1,69 +0,0 @@
-<?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.TourProjectGroupPurchaseProgressMapper">
-    <resultMap id="BaseResultMap" type="com.tourism.webadmin.back.model.TourProjectGroupPurchaseProgress">
-        <id column="id" jdbcType="BIGINT" property="id"/>
-        <result column="group_purchase_id" jdbcType="BIGINT" property="groupPurchaseId"/>
-        <result column="now_count" jdbcType="INTEGER" property="nowCount"/>
-        <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="success" jdbcType="TINYINT" property="success"/>
-    </resultMap>
-
-    <insert id="insertList">
-        INSERT INTO tour_project_group_purchase_progress
-            (id,
-            group_purchase_id,
-            now_count,
-            create_user_id,
-            create_time,
-            update_user_id,
-            update_time,
-            data_state,
-            success)
-        VALUES
-        <foreach collection="list" index="index" item="item" separator="," >
-            (#{item.id},
-            #{item.groupPurchaseId},
-            #{item.nowCount},
-            #{item.createUserId},
-            #{item.createTime},
-            #{item.updateUserId},
-            #{item.updateTime},
-            #{item.dataState},
-            #{item.success})
-        </foreach>
-    </insert>
-
-    <!-- 如果有逻辑删除字段过滤,请写到这里 -->
-    <sql id="filterRef">
-        <!-- 这里必须加上全包名,否则当filterRef被其他Mapper.xml包含引用的时候,就会调用Mapper.xml中的该SQL片段 -->
-        <include refid="com.tourism.webadmin.back.dao.TourProjectGroupPurchaseProgressMapper.inputFilterRef"/>
-        AND tour_project_group_purchase_progress.data_state = ${@com.tourism.common.core.constant.GlobalDeletedFlag@NORMAL}
-    </sql>
-
-    <!-- 这里仅包含调用接口输入的主表过滤条件 -->
-    <sql id="inputFilterRef">
-        <if test="tourProjectGroupPurchaseProgressFilter != null">
-            <if test="tourProjectGroupPurchaseProgressFilter.groupPurchaseId != null">
-                AND tour_project_group_purchase_progress.group_purchase_id = #{tourProjectGroupPurchaseProgressFilter.groupPurchaseId}
-            </if>
-            <if test="tourProjectGroupPurchaseProgressFilter.success != null">
-                AND tour_project_group_purchase_progress.success = #{tourProjectGroupPurchaseProgressFilter.success}
-            </if>
-        </if>
-    </sql>
-
-    <select id="getTourProjectGroupPurchaseProgressList" resultMap="BaseResultMap" parameterType="com.tourism.webadmin.back.model.TourProjectGroupPurchaseProgress">
-        SELECT * FROM tour_project_group_purchase_progress
-        <where>
-            <include refid="filterRef"/>
-        </where>
-        <if test="orderBy != null and orderBy != ''">
-            ORDER BY ${orderBy}
-        </if>
-    </select>
-</mapper>

+ 24 - 0
application-webadmin/src/main/java/com/tourism/webadmin/back/dto/TourProjectGroupPurchaseDto.java

@@ -93,6 +93,30 @@ public class TourProjectGroupPurchaseDto {
     private Integer showOrder;
 
     /**
+     * 关联字段(与从表)。
+     */
+    @Schema(description = "关联字段(与从表)。")
+    private Long code;
+
+    /**
+     * 当前拼团的人数。
+     */
+    @Schema(description = "当前拼团的人数。")
+    private Integer nowCount;
+
+    /**
+     * 拼团是否成功(0.失败;1.成功)。
+     */
+    @Schema(description = "拼团是否成功(0.失败;1.成功)。")
+    private Integer success;
+
+    /**
+     * 拼团标题。
+     */
+    @Schema(description = "拼团标题。")
+    private String title;
+
+    /**
      * endTime 范围过滤起始值(>=)。
      * NOTE: 可支持范围操作符的列表数据过滤。
      */

+ 31 - 15
application-webadmin/src/main/java/com/tourism/webadmin/back/model/TourProjectGroupPurchase.java

@@ -9,7 +9,6 @@ import lombok.EqualsAndHashCode;
 
 import java.math.BigDecimal;
 import java.util.Date;
-import java.util.List;
 import java.util.Map;
 
 /**
@@ -91,6 +90,30 @@ public class TourProjectGroupPurchase extends BaseModel {
     private Integer showOrder;
 
     /**
+     * 关联字段(与从表)。
+     */
+    @TableField(value = "code")
+    private Long code;
+
+    /**
+     * 当前拼团的人数。
+     */
+    @TableField(value = "now_count")
+    private Integer nowCount;
+
+    /**
+     * 拼团是否成功(0.失败;1.成功)。
+     */
+    @TableField(value = "success")
+    private Integer success;
+
+    /**
+     * 拼团标题。
+     */
+    @TableField(value = "title")
+    private String title;
+
+    /**
      * endTime 范围过滤起始值(>=)。
      */
     @TableField(exist = false)
@@ -169,21 +192,14 @@ public class TourProjectGroupPurchase extends BaseModel {
     @TableField(exist = false)
     private TourismProject tourismProject;
 
-    @RelationOneToMany(
-            masterIdField = "id",
-            slaveModelClass = TourProjectGroupPurchaseProgress.class,
-            slaveIdField = "groupPurchaseId")
+    @RelationDict(
+            masterIdField = "projectId",
+            equalOneToOneRelationField = "tourismProject",
+            slaveModelClass = TourismProject.class,
+            slaveIdField = "id",
+            slaveNameField = "projectTitle")
     @TableField(exist = false)
-    private List<TourProjectGroupPurchaseProgress> TourProjectGroupPurchaseProgressList;
-
-//    @RelationDict(
-//            masterIdField = "projectId",
-//            equalOneToOneRelationField = "tourismProject",
-//            slaveModelClass = TourismProject.class,
-//            slaveIdField = "id",
-//            slaveNameField = "projectTitle")
-//    @TableField(exist = false)
-//    private Map<String, Object> projectIdDictMap;
+    private Map<String, Object> projectIdDictMap;
 
     @RelationConstDict(
             masterIdField = "state",

+ 8 - 3
application-webadmin/src/main/java/com/tourism/webadmin/back/model/TourProjectGroupPurchaseDetail.java

@@ -7,6 +7,7 @@ import lombok.Data;
 import lombok.EqualsAndHashCode;
 
 import java.math.BigDecimal;
+import java.util.List;
 
 /**
  * 拼团设置从表实体对象。
@@ -110,10 +111,14 @@ public class TourProjectGroupPurchaseDetail extends BaseModel {
     @TableField(exist = false)
     private Integer maxCountEnd;
 
-    @RelationOneToOne(
+    /**
+     * TourProjectGroupPurchase 的一对多关联表数据对象。
+     * 通常在一对多的关联中,我们基于从表数据过滤主表数据,此时需要先对从表数据进行嵌套子查询过滤,并将从表过滤数据列表集成到该字段。
+     */
+    @RelationOneToMany(
             masterIdField = "groupPurchaseId",
             slaveModelClass = TourProjectGroupPurchase.class,
-            slaveIdField = "id")
+            slaveIdField = "code")
     @TableField(exist = false)
-    private TourProjectGroupPurchase tourProjectGroupPurchase;
+    private List<TourProjectGroupPurchase> tourProjectGroupPurchaseList;
 }

+ 0 - 57
application-webadmin/src/main/java/com/tourism/webadmin/back/model/TourProjectGroupPurchaseProgress.java

@@ -1,57 +0,0 @@
-package com.tourism.webadmin.back.model;
-
-import com.baomidou.mybatisplus.annotation.*;
-import com.tourism.common.core.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_project_group_purchase_progress")
-public class TourProjectGroupPurchaseProgress extends BaseModel {
-
-    /**
-     * 主键id。
-     */
-    @TableId(value = "id")
-    private Long id;
-
-    /**
-     * 关联拼团设置的id。
-     */
-    @TableField(value = "group_purchase_id")
-    private Long groupPurchaseId;
-
-    /**
-     * 当前拼团的人数。
-     */
-    @TableField(value = "now_count")
-    private Integer nowCount;
-
-    /**
-     * 逻辑删除标记字段(1: 正常 -1: 已删除)。
-     */
-    @TableLogic
-    @TableField(value = "data_state")
-    private Integer dataState;
-
-    /**
-     * 拼团是否成功(0.失败;1.成功)。
-     */
-    @TableField(value = "success")
-    private Integer success;
-
-    @RelationOneToOne(
-            masterIdField = "groupPurchaseId",
-            slaveModelClass = TourProjectGroupPurchase.class,
-            slaveIdField = "id")
-    @TableField(exist = false)
-    private TourProjectGroupPurchase tourProjectGroupPurchase;
-}

+ 11 - 1
application-webadmin/src/main/java/com/tourism/webadmin/back/service/TourProjectGroupPurchaseDetailService.java

@@ -1,6 +1,7 @@
 package com.tourism.webadmin.back.service;
 
 import com.tourism.webadmin.back.model.*;
+import com.tourism.common.core.object.CallResult;
 import com.tourism.common.core.base.service.IBaseService;
 
 import java.util.*;
@@ -61,9 +62,18 @@ public interface TourProjectGroupPurchaseDetailService extends IBaseService<Tour
      * 如果仅仅需要获取主表数据,请移步(getTourProjectGroupPurchaseDetailList),以便获取更好的查询性能。
      *
      * @param filter 主表过滤对象。
-     * @param tourProjectGroupPurchaseFilter 一对从表过滤对象。
+     * @param tourProjectGroupPurchaseFilter 一对从表过滤对象。
      * @param orderBy 排序参数。
      * @return 查询结果集。
      */
     List<TourProjectGroupPurchaseDetail> getTourProjectGroupPurchaseDetailListWithRelation(TourProjectGroupPurchaseDetail filter, TourProjectGroupPurchase tourProjectGroupPurchaseFilter, String orderBy);
+
+    /**
+     * 判断从表数据是否存在,如果存在就不能删除主对象,否则可以删除主对象。
+     * 适用于主表对从表不是强制级联删除的场景。
+     *
+     * @param tourProjectGroupPurchaseDetail 主表对象。
+     * @return 没有关联数据返回true,否则false,同时返回具体的提示信息。
+     */
+    CallResult verifyRelatedDataBeforeDelete(TourProjectGroupPurchaseDetail tourProjectGroupPurchaseDetail);
 }

+ 0 - 68
application-webadmin/src/main/java/com/tourism/webadmin/back/service/TourProjectGroupPurchaseProgressService.java

@@ -1,68 +0,0 @@
-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 TourProjectGroupPurchaseProgressService extends IBaseService<TourProjectGroupPurchaseProgress, Long> {
-
-    /**
-     * 保存新增对象。
-     *
-     * @param tourProjectGroupPurchaseProgress 新增对象。
-     * @return 返回新增对象。
-     */
-    TourProjectGroupPurchaseProgress saveNew(TourProjectGroupPurchaseProgress tourProjectGroupPurchaseProgress);
-
-    /**
-     * 利用数据库的insertList语法,批量插入对象列表。
-     *
-     * @param tourProjectGroupPurchaseProgressList 新增对象列表。
-     */
-    void saveNewBatch(List<TourProjectGroupPurchaseProgress> tourProjectGroupPurchaseProgressList);
-
-    /**
-     * 更新数据对象。
-     *
-     * @param tourProjectGroupPurchaseProgress         更新的对象。
-     * @param originalTourProjectGroupPurchaseProgress 原有数据对象。
-     * @return 成功返回true,否则false。
-     */
-    boolean update(TourProjectGroupPurchaseProgress tourProjectGroupPurchaseProgress, TourProjectGroupPurchaseProgress originalTourProjectGroupPurchaseProgress);
-
-    /**
-     * 删除指定数据。
-     *
-     * @param id 主键Id。
-     * @return 成功返回true,否则false。
-     */
-    boolean remove(Long id);
-
-    /**
-     * 获取单表查询结果。由于没有关联数据查询,因此在仅仅获取单表数据的场景下,效率更高。
-     * 如果需要同时获取关联数据,请移步(getTourProjectGroupPurchaseProgressListWithRelation)方法。
-     *
-     * @param filter  过滤对象。
-     * @param orderBy 排序参数。
-     * @return 查询结果集。
-     */
-    List<TourProjectGroupPurchaseProgress> getTourProjectGroupPurchaseProgressList(TourProjectGroupPurchaseProgress filter, String orderBy);
-
-    /**
-     * 获取主表的查询结果,以及主表关联的字典数据和一对一从表数据,以及一对一从表的字典数据。
-     * 该查询会涉及到一对一从表的关联过滤,或一对多从表的嵌套关联过滤,因此性能不如单表过滤。
-     * 如果仅仅需要获取主表数据,请移步(getTourProjectGroupPurchaseProgressList),以便获取更好的查询性能。
-     *
-     * @param filter 主表过滤对象。
-     * @param orderBy 排序参数。
-     * @return 查询结果集。
-     */
-    List<TourProjectGroupPurchaseProgress> getTourProjectGroupPurchaseProgressListWithRelation(TourProjectGroupPurchaseProgress filter, String orderBy);
-}

+ 14 - 0
application-webadmin/src/main/java/com/tourism/webadmin/back/service/impl/TourProjectGroupPurchaseDetailServiceImpl.java

@@ -10,6 +10,7 @@ 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.object.CallResult;
 import com.tourism.common.core.base.service.BaseService;
 import com.tourism.common.core.util.MyModelUtil;
 import com.tourism.common.sequence.wrapper.IdGeneratorWrapper;
@@ -35,6 +36,8 @@ public class TourProjectGroupPurchaseDetailServiceImpl extends BaseService<TourP
     private IdGeneratorWrapper idGenerator;
     @Autowired
     private TourProjectGroupPurchaseDetailMapper tourProjectGroupPurchaseDetailMapper;
+    @Autowired
+    private TourProjectGroupPurchaseService tourProjectGroupPurchaseService;
 
     /**
      * 返回当前Service的主表Mapper对象。
@@ -93,6 +96,17 @@ public class TourProjectGroupPurchaseDetailServiceImpl extends BaseService<TourP
         return resultList;
     }
 
+    @Override
+    public CallResult verifyRelatedDataBeforeDelete(TourProjectGroupPurchaseDetail tourProjectGroupPurchaseDetail) {
+        TourProjectGroupPurchase tourProjectGroupPurchase = new TourProjectGroupPurchase();
+        tourProjectGroupPurchase.setCode(tourProjectGroupPurchaseDetail.getGroupPurchaseId());
+        if (tourProjectGroupPurchaseService.getCountByFilter(tourProjectGroupPurchase) > 0) {
+            // NOTE: 可以根据需求修改下面方括号中的提示信息。
+            return CallResult.error("数据验证失败,[TourProjectGroupPurchase] 存在关联数据!");
+        }
+        return CallResult.ok();
+    }
+
     private TourProjectGroupPurchaseDetail buildDefaultValue(TourProjectGroupPurchaseDetail tourProjectGroupPurchaseDetail) {
         if (tourProjectGroupPurchaseDetail.getId() == null) {
             tourProjectGroupPurchaseDetail.setId(idGenerator.nextLongId());

+ 0 - 103
application-webadmin/src/main/java/com/tourism/webadmin/back/service/impl/TourProjectGroupPurchaseProgressServiceImpl.java

@@ -1,103 +0,0 @@
-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.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("tourProjectGroupPurchaseProgressService")
-public class TourProjectGroupPurchaseProgressServiceImpl extends BaseService<TourProjectGroupPurchaseProgress, Long> implements TourProjectGroupPurchaseProgressService {
-
-    @Autowired
-    private IdGeneratorWrapper idGenerator;
-    @Autowired
-    private TourProjectGroupPurchaseProgressMapper tourProjectGroupPurchaseProgressMapper;
-
-    /**
-     * 返回当前Service的主表Mapper对象。
-     *
-     * @return 主表Mapper对象。
-     */
-    @Override
-    protected BaseDaoMapper<TourProjectGroupPurchaseProgress> mapper() {
-        return tourProjectGroupPurchaseProgressMapper;
-    }
-
-    @Transactional(rollbackFor = Exception.class)
-    @Override
-    public TourProjectGroupPurchaseProgress saveNew(TourProjectGroupPurchaseProgress tourProjectGroupPurchaseProgress) {
-        tourProjectGroupPurchaseProgressMapper.insert(this.buildDefaultValue(tourProjectGroupPurchaseProgress));
-        return tourProjectGroupPurchaseProgress;
-    }
-
-    @Transactional(rollbackFor = Exception.class)
-    @Override
-    public void saveNewBatch(List<TourProjectGroupPurchaseProgress> tourProjectGroupPurchaseProgressList) {
-        if (CollUtil.isNotEmpty(tourProjectGroupPurchaseProgressList)) {
-            tourProjectGroupPurchaseProgressList.forEach(this::buildDefaultValue);
-            tourProjectGroupPurchaseProgressMapper.insertList(tourProjectGroupPurchaseProgressList);
-        }
-    }
-
-    @Transactional(rollbackFor = Exception.class)
-    @Override
-    public boolean update(TourProjectGroupPurchaseProgress tourProjectGroupPurchaseProgress, TourProjectGroupPurchaseProgress originalTourProjectGroupPurchaseProgress) {
-        MyModelUtil.fillCommonsForUpdate(tourProjectGroupPurchaseProgress, originalTourProjectGroupPurchaseProgress);
-        // 这里重点提示,在执行主表数据更新之前,如果有哪些字段不支持修改操作,请用原有数据对象字段替换当前数据字段。
-        UpdateWrapper<TourProjectGroupPurchaseProgress> uw = this.createUpdateQueryForNullValue(tourProjectGroupPurchaseProgress, tourProjectGroupPurchaseProgress.getId());
-        return tourProjectGroupPurchaseProgressMapper.update(tourProjectGroupPurchaseProgress, uw) == 1;
-    }
-
-    @Transactional(rollbackFor = Exception.class)
-    @Override
-    public boolean remove(Long id) {
-        return tourProjectGroupPurchaseProgressMapper.deleteById(id) == 1;
-    }
-
-    @Override
-    public List<TourProjectGroupPurchaseProgress> getTourProjectGroupPurchaseProgressList(TourProjectGroupPurchaseProgress filter, String orderBy) {
-        return tourProjectGroupPurchaseProgressMapper.getTourProjectGroupPurchaseProgressList(filter, orderBy);
-    }
-
-    @Override
-    public List<TourProjectGroupPurchaseProgress> getTourProjectGroupPurchaseProgressListWithRelation(TourProjectGroupPurchaseProgress filter, String orderBy) {
-        List<TourProjectGroupPurchaseProgress> resultList = tourProjectGroupPurchaseProgressMapper.getTourProjectGroupPurchaseProgressList(filter, orderBy);
-        // 在缺省生成的代码中,如果查询结果resultList不是Page对象,说明没有分页,那么就很可能是数据导出接口调用了当前方法。
-        // 为了避免一次性的大量数据关联,规避因此而造成的系统运行性能冲击,这里手动进行了分批次读取,开发者可按需修改该值。
-        int batchSize = resultList instanceof Page ? 0 : 1000;
-        this.buildRelationForDataList(resultList, MyRelationParam.normal(), batchSize);
-        return resultList;
-    }
-
-    private TourProjectGroupPurchaseProgress buildDefaultValue(TourProjectGroupPurchaseProgress tourProjectGroupPurchaseProgress) {
-        if (tourProjectGroupPurchaseProgress.getId() == null) {
-            tourProjectGroupPurchaseProgress.setId(idGenerator.nextLongId());
-        }
-        MyModelUtil.fillCommonsForInsert(tourProjectGroupPurchaseProgress);
-        tourProjectGroupPurchaseProgress.setDataState(GlobalDeletedFlag.NORMAL);
-        return tourProjectGroupPurchaseProgress;
-    }
-}

+ 22 - 0
application-webadmin/src/main/java/com/tourism/webadmin/back/service/impl/TourProjectGroupPurchaseServiceImpl.java

@@ -10,6 +10,7 @@ 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.object.CallResult;
 import com.tourism.common.core.base.service.BaseService;
 import com.tourism.common.core.util.MyModelUtil;
 import com.tourism.common.sequence.wrapper.IdGeneratorWrapper;
@@ -35,6 +36,10 @@ public class TourProjectGroupPurchaseServiceImpl extends BaseService<TourProject
     private IdGeneratorWrapper idGenerator;
     @Autowired
     private TourProjectGroupPurchaseMapper tourProjectGroupPurchaseMapper;
+    @Autowired
+    private TourismProjectService tourismProjectService;
+    @Autowired
+    private TourProjectGroupPurchaseDetailService tourProjectGroupPurchaseDetailService;
 
     /**
      * 返回当前Service的主表Mapper对象。
@@ -92,12 +97,29 @@ public class TourProjectGroupPurchaseServiceImpl extends BaseService<TourProject
         return resultList;
     }
 
+    @Override
+    public CallResult verifyRelatedData(TourProjectGroupPurchase tourProjectGroupPurchase, TourProjectGroupPurchase originalTourProjectGroupPurchase) {
+        String errorMessageFormat = "数据验证失败,关联的%s并不存在,请刷新后重试!";
+        //这里是基于字典的验证。
+        if (this.needToVerify(tourProjectGroupPurchase, originalTourProjectGroupPurchase, TourProjectGroupPurchase::getProjectId)
+                && !tourismProjectService.existId(String.valueOf(tourProjectGroupPurchase.getProjectId()))) {
+            return CallResult.error(String.format(errorMessageFormat, "项目id"));
+        }
+        //这里是一对多的验证
+        if (this.needToVerify(tourProjectGroupPurchase, originalTourProjectGroupPurchase, TourProjectGroupPurchase::getCode)
+                && !tourProjectGroupPurchaseDetailService.existOne("groupPurchaseId", tourProjectGroupPurchase.getCode())) {
+            return CallResult.error(String.format(errorMessageFormat, "关联字段(与从表)"));
+        }
+        return CallResult.ok();
+    }
+
     private TourProjectGroupPurchase buildDefaultValue(TourProjectGroupPurchase tourProjectGroupPurchase) {
         if (tourProjectGroupPurchase.getId() == null) {
             tourProjectGroupPurchase.setId(idGenerator.nextLongId());
         }
         MyModelUtil.fillCommonsForInsert(tourProjectGroupPurchase);
         tourProjectGroupPurchase.setDataState(GlobalDeletedFlag.NORMAL);
+        MyModelUtil.setDefaultValue(tourProjectGroupPurchase, "title", "");
         return tourProjectGroupPurchase;
     }
 }

+ 4 - 3
application-webadmin/src/main/java/com/tourism/webadmin/back/vo/TourProjectGroupPurchaseDetailVo.java

@@ -7,6 +7,7 @@ import lombok.EqualsAndHashCode;
 
 import java.math.BigDecimal;
 import java.util.Map;
+import java.util.List;
 
 /**
  * 拼团设置从表VO视图对象。
@@ -56,8 +57,8 @@ public class TourProjectGroupPurchaseDetailVo extends BaseVo {
     private Integer maxCount;
 
     /**
-     * groupPurchaseId 的一对一关联数据对象,数据对应类型为TourProjectGroupPurchaseVo
+     * TourProjectGroupPurchase 的一对多关联表数据对象。数据对应类型为TourProjectGroupPurchase
      */
-    @Schema(description = "groupPurchaseId 的一对一关联数据对象,数据对应类型为TourProjectGroupPurchaseVo")
-    private Map<String, Object> tourProjectGroupPurchase;
+    @Schema(description = "TourProjectGroupPurchase 的一对多关联表数据对象。数据对应类型为TourProjectGroupPurchase")
+    private List<Map<String, Object>> tourProjectGroupPurchaseList;
 }

+ 0 - 49
application-webadmin/src/main/java/com/tourism/webadmin/back/vo/TourProjectGroupPurchaseProgressVo.java

@@ -1,49 +0,0 @@
-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.Map;
-
-/**
- * 拼图的当前人数表VO视图对象。
- *
- * @author 吃饭睡觉
- * @date 2024-09-06
- */
-@Schema(description = "拼图的当前人数表VO视图对象")
-@Data
-@EqualsAndHashCode(callSuper = true)
-public class TourProjectGroupPurchaseProgressVo extends BaseVo {
-
-    /**
-     * 主键id。
-     */
-    @Schema(description = "主键id")
-    private Long id;
-
-    /**
-     * 关联拼团设置的id。
-     */
-    @Schema(description = "关联拼团设置的id")
-    private Long groupPurchaseId;
-
-    /**
-     * 当前拼团的人数。
-     */
-    @Schema(description = "当前拼团的人数")
-    private Integer nowCount;
-
-    /**
-     * 拼团是否成功(0.失败;1.成功)。
-     */
-    @Schema(description = "拼团是否成功(0.失败;1.成功)")
-    private Integer success;
-
-    /**
-     * groupPurchaseId 的一对一关联数据对象,数据对应类型为TourProjectGroupPurchaseVo。
-     */
-    @Schema(description = "groupPurchaseId 的一对一关联数据对象,数据对应类型为TourProjectGroupPurchaseVo")
-    private Map<String, Object> tourProjectGroupPurchase;
-}

+ 24 - 7
application-webadmin/src/main/java/com/tourism/webadmin/back/vo/TourProjectGroupPurchaseVo.java

@@ -7,7 +7,6 @@ import lombok.EqualsAndHashCode;
 
 import java.math.BigDecimal;
 import java.util.Date;
-import java.util.List;
 import java.util.Map;
 
 /**
@@ -82,16 +81,34 @@ public class TourProjectGroupPurchaseVo extends BaseVo {
     private Integer showOrder;
 
     /**
-     * projectId 的一对一关联数据对象,数据对应类型为TourismProjectVo
+     * 关联字段(与从表)
      */
-    @Schema(description = "projectId 的一对一关联数据对象,数据对应类型为TourismProjectVo")
-    private Map<String, Object> tourismProject;
+    @Schema(description = "关联字段(与从表)")
+    private Long code;
+
+    /**
+     * 当前拼团的人数。
+     */
+    @Schema(description = "当前拼团的人数")
+    private Integer nowCount;
 
     /**
-     * id 的一对多关联数据对象,数据对应类型为TourProjectGroupPurchaseProgress。
+     * 拼团是否成功(0.失败;1.成功)
      */
-    @Schema(description = "id 的一对多关联数据对象,数据对应类型为TourismProjectVo")
-    private List<Map<String, Object>> TourProjectGroupPurchaseProgressList;
+    @Schema(description = "拼团是否成功(0.失败;1.成功)")
+    private Integer success;
+
+    /**
+     * 拼团标题。
+     */
+    @Schema(description = "拼团标题")
+    private String title;
+
+    /**
+     * projectId 的一对一关联数据对象,数据对应类型为TourismProjectVo。
+     */
+    @Schema(description = "projectId 的一对一关联数据对象,数据对应类型为TourismProjectVo")
+    private Map<String, Object> tourismProject;
 
     /**
      * projectId 字典关联数据。