Browse Source

完善对象名---chenchen

chenchen 5 months ago
parent
commit
877a54bd14

+ 21 - 23
application-webadmin/src/main/java/com/tourism/webadmin/app/website/controller/TourismOrderController.java

@@ -1,21 +1,19 @@
 package com.tourism.webadmin.app.website.controller;
 
-import cn.dev33.satoken.annotation.SaIgnore;
 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.object.TokenData;
 import com.tourism.common.core.util.MyModelUtil;
 import com.tourism.common.core.util.MyPageUtil;
-import com.tourism.webadmin.back.dto.TourOderDto;
-import com.tourism.webadmin.back.model.JobProject;
-import com.tourism.webadmin.back.model.TourOder;
+import com.tourism.webadmin.back.dto.TourOrderDto;
+import com.tourism.webadmin.back.model.TourOrder;
 import com.tourism.webadmin.back.model.TourOrderPassenage;
 import com.tourism.webadmin.back.model.TourismProject;
-import com.tourism.webadmin.back.service.TourOderService;
 import com.tourism.webadmin.back.service.TourOrderPassenageService;
+import com.tourism.webadmin.back.service.TourOrderService;
 import com.tourism.webadmin.back.service.TourismProjectService;
-import com.tourism.webadmin.back.vo.TourOderVo;
+import com.tourism.webadmin.back.vo.TourOrderVo;
 import com.tourism.webadmin.back.vo.TourOrderPassenageVo;
 import com.tourism.webadmin.back.vo.TourismProjectVo;
 import io.swagger.v3.oas.annotations.tags.Tag;
@@ -41,7 +39,7 @@ import java.util.List;
 public class TourismOrderController {
 
     @Autowired
-    private TourOderService tourOderService;
+    private TourOrderService tourOrderService;
     @Autowired
     private TourOrderPassenageService tourOrderPassenageService;
     @Autowired
@@ -50,22 +48,22 @@ public class TourismOrderController {
     /**
      * 列出符合过滤条件个人订单列表。
      *
-     * @param tourOderDto 旅游订单Dto对象
+     * @param tourOrderDto 旅游订单Dto对象
      * @return 应答结果对象,包含查询结果集。
      */
     @GetMapping("/list")
-    public ResponseResult<MyPageData<TourOderVo>> list(TourOderDto tourOderDto){
-        TourOder tourOder = new TourOder();
-        if(tourOderDto.getOrderStatus() != null){
-            tourOder.setOrderStatus(tourOderDto.getOrderStatus());
+    public ResponseResult<MyPageData<TourOrderVo>> list(TourOrderDto tourOrderDto){
+        TourOrder tourOder = new TourOrder();
+        if(tourOrderDto.getOrderStatus() != null){
+            tourOder.setOrderStatus(tourOrderDto.getOrderStatus());
         }
         TokenData tokenData = TokenData.takeFromRequest();
         tourOder.setCustomerMobile(tokenData.getLoginName());
         MyOrderParam myOrderParam = new MyOrderParam();
         myOrderParam.add(new MyOrderParam.OrderInfo("createTime",false,null));
-        String orderBy = MyOrderParam.buildOrderBy(myOrderParam, TourOder.class);
-        List<TourOder> tourOderList = tourOderService.getTourOderList(tourOder, orderBy);
-        MyPageData<TourOderVo> tourOderVoMyPageData = MyPageUtil.makeResponseData(tourOderList, TourOderVo.class);
+        String orderBy = MyOrderParam.buildOrderBy(myOrderParam, TourOrder.class);
+        List<TourOrder> tourOderList = tourOrderService.getTourOrderList(tourOder, orderBy);
+        MyPageData<TourOrderVo> tourOderVoMyPageData = MyPageUtil.makeResponseData(tourOderList, TourOrderVo.class);
         return ResponseResult.success(tourOderVoMyPageData);
     }
 
@@ -76,23 +74,23 @@ public class TourismOrderController {
      * @return 应答结果对象,包含查询结果集。
      */
     @GetMapping("/detail")
-    public ResponseResult<TourOderVo> detail(@RequestParam Long orderId){
-        TourOder tourOder = new TourOder();
+    public ResponseResult<TourOrderVo> detail(@RequestParam Long orderId){
+        TourOrder tourOder = new TourOrder();
         tourOder.setId(orderId);
-        TourOder tourOder1 = tourOderService.getOne(tourOder);
+        TourOrder tourOder1 = tourOrderService.getOne(tourOder);
         TourOrderPassenage tourOrderPassenage = new TourOrderPassenage();
         tourOrderPassenage.setOrderId(orderId);
         List<TourOrderPassenage> tourOrderPassenageList = tourOrderPassenageService.getTourOrderPassenageListWithRelation(tourOrderPassenage, "");
-        TourOderVo tourOderVo = MyModelUtil.copyTo(tourOder1, TourOderVo.class);
+        TourOrderVo tourOrderVo = MyModelUtil.copyTo(tourOder1, TourOrderVo.class);
 
         TourismProject tourismProject = new TourismProject();
-        tourismProject.setId(tourOderVo.getProjectId());
+        tourismProject.setId(tourOrderVo.getProjectId());
         TourismProject tourismProject1 = tourismProjectService.getOne(tourismProject);
         TourismProjectVo tourismProjectVo = MyModelUtil.copyTo(tourismProject1, TourismProjectVo.class);
-        tourOderVo.setTourismProjectVo(tourismProjectVo);
+        tourOrderVo.setTourismProjectVo(tourismProjectVo);
         List<TourOrderPassenageVo> tourOrderPassenageVoList = MyModelUtil.copyCollectionTo(tourOrderPassenageList, TourOrderPassenageVo.class);
-        tourOderVo.setDetailList(tourOrderPassenageVoList);
-        return ResponseResult.success(tourOderVo);
+        tourOrderVo.setDetailList(tourOrderPassenageVoList);
+        return ResponseResult.success(tourOrderVo);
     }
 
 

+ 50 - 50
application-webadmin/src/main/java/com/tourism/webadmin/back/controller/TourOderController.java → application-webadmin/src/main/java/com/tourism/webadmin/back/controller/TourOrderController.java

@@ -29,76 +29,76 @@ import java.util.*;
 @Tag(name = "旅游订单管理接口")
 @Slf4j
 @RestController
-@RequestMapping("/admin/app/tourOder")
-public class TourOderController {
+@RequestMapping("/admin/app/tourOrder")
+public class TourOrderController {
 
     @Autowired
-    private TourOderService tourOderService;
+    private TourOrderService tourOrderService;
 
     /**
      * 新增旅游订单数据。
      *
-     * @param tourOderDto 新增对象。
+     * @param tourOrderDto 新增对象。
      * @return 应答结果对象,包含新增对象主键Id。
      */
     @ApiOperationSupport(ignoreParameters = {
-            "tourOderDto.id",
-            "tourOderDto.searchString",
-            "tourOderDto.departureDateStart",
-            "tourOderDto.departureDateEnd",
-            "tourOderDto.endDateStart",
-            "tourOderDto.endDateEnd"})
-    @SaCheckPermission("tourOder.add")
+            "tourOrderDto.id",
+            "tourOrderDto.searchString",
+            "tourOrderDto.departureDateStart",
+            "tourOrderDto.departureDateEnd",
+            "tourOrderDto.endDateStart",
+            "tourOrderDto.endDateEnd"})
+    @SaCheckPermission("tourOrder.add")
     @OperationLog(type = SysOperationLogType.ADD)
     @PostMapping("/add")
-    public ResponseResult<Long> add(@MyRequestBody TourOderDto tourOderDto) {
-        String errorMessage = MyCommonUtil.getModelValidationError(tourOderDto, false);
+    public ResponseResult<Long> add(@MyRequestBody TourOrderDto tourOrderDto) {
+        String errorMessage = MyCommonUtil.getModelValidationError(tourOrderDto, false);
         if (errorMessage != null) {
             return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATED_FAILED, errorMessage);
         }
-        TourOder tourOder = MyModelUtil.copyTo(tourOderDto, TourOder.class);
+        TourOrder tourOrder = MyModelUtil.copyTo(tourOrderDto, TourOrder.class);
         // 验证关联Id的数据合法性
-        CallResult callResult = tourOderService.verifyRelatedData(tourOder, null);
+        CallResult callResult = tourOrderService.verifyRelatedData(tourOrder, null);
         if (!callResult.isSuccess()) {
             return ResponseResult.errorFrom(callResult);
         }
-        tourOder = tourOderService.saveNew(tourOder);
-        return ResponseResult.success(tourOder.getId());
+        tourOrder = tourOrderService.saveNew(tourOrder);
+        return ResponseResult.success(tourOrder.getId());
     }
 
     /**
      * 更新旅游订单数据。
      *
-     * @param tourOderDto 更新对象。
+     * @param tourOrderDto 更新对象。
      * @return 应答结果对象。
      */
     @ApiOperationSupport(ignoreParameters = {
-            "tourOderDto.searchString",
-            "tourOderDto.departureDateStart",
-            "tourOderDto.departureDateEnd",
-            "tourOderDto.endDateStart",
-            "tourOderDto.endDateEnd"})
-    @SaCheckPermission("tourOder.update")
+            "tourOrderDto.searchString",
+            "tourOrderDto.departureDateStart",
+            "tourOrderDto.departureDateEnd",
+            "tourOrderDto.endDateStart",
+            "tourOrderDto.endDateEnd"})
+    @SaCheckPermission("tourOrder.update")
     @OperationLog(type = SysOperationLogType.UPDATE)
     @PostMapping("/update")
-    public ResponseResult<Void> update(@MyRequestBody TourOderDto tourOderDto) {
-        String errorMessage = MyCommonUtil.getModelValidationError(tourOderDto, true);
+    public ResponseResult<Void> update(@MyRequestBody TourOrderDto tourOrderDto) {
+        String errorMessage = MyCommonUtil.getModelValidationError(tourOrderDto, true);
         if (errorMessage != null) {
             return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATED_FAILED, errorMessage);
         }
-        TourOder tourOder = MyModelUtil.copyTo(tourOderDto, TourOder.class);
-        TourOder originalTourOder = tourOderService.getById(tourOder.getId());
-        if (originalTourOder == null) {
+        TourOrder tourOrder = MyModelUtil.copyTo(tourOrderDto, TourOrder.class);
+        TourOrder originalTourOrder = tourOrderService.getById(tourOrder.getId());
+        if (originalTourOrder == null) {
             // NOTE: 修改下面方括号中的话述
             errorMessage = "数据验证失败,当前 [数据] 并不存在,请刷新后重试!";
             return ResponseResult.error(ErrorCodeEnum.DATA_NOT_EXIST, errorMessage);
         }
         // 验证关联Id的数据合法性
-        CallResult callResult = tourOderService.verifyRelatedData(tourOder, originalTourOder);
+        CallResult callResult = tourOrderService.verifyRelatedData(tourOrder, originalTourOrder);
         if (!callResult.isSuccess()) {
             return ResponseResult.errorFrom(callResult);
         }
-        if (!tourOderService.update(tourOder, originalTourOder)) {
+        if (!tourOrderService.update(tourOrder, originalTourOrder)) {
             return ResponseResult.error(ErrorCodeEnum.DATA_NOT_EXIST);
         }
         return ResponseResult.success();
@@ -110,7 +110,7 @@ public class TourOderController {
      * @param id 删除对象主键Id。
      * @return 应答结果对象。
      */
-    @SaCheckPermission("tourOder.delete")
+    @SaCheckPermission("tourOrder.delete")
     @OperationLog(type = SysOperationLogType.DELETE)
     @PostMapping("/delete")
     public ResponseResult<Void> delete(@MyRequestBody Long id) {
@@ -126,7 +126,7 @@ public class TourOderController {
      * @param idList 待删除对象的主键Id列表。
      * @return 应答结果对象。
      */
-    @SaCheckPermission("tourOder.delete")
+    @SaCheckPermission("tourOrder.delete")
     @OperationLog(type = SysOperationLogType.DELETE_BATCH)
     @PostMapping("/deleteBatch")
     public ResponseResult<Void> deleteBatch(@MyRequestBody List<Long> idList) {
@@ -145,24 +145,24 @@ public class TourOderController {
     /**
      * 列出符合过滤条件的旅游订单列表。
      *
-     * @param tourOderDtoFilter 过滤对象。
+     * @param tourOrderDtoFilter 过滤对象。
      * @param orderParam 排序参数。
      * @param pageParam 分页参数。
      * @return 应答结果对象,包含查询结果集。
      */
-    @SaCheckPermission("tourOder.view")
+    @SaCheckPermission("tourOrder.view")
     @PostMapping("/list")
-    public ResponseResult<MyPageData<TourOderVo>> list(
-            @MyRequestBody TourOderDto tourOderDtoFilter,
+    public ResponseResult<MyPageData<TourOrderVo>> list(
+            @MyRequestBody TourOrderDto tourOrderDtoFilter,
             @MyRequestBody MyOrderParam orderParam,
             @MyRequestBody MyPageParam pageParam) {
         if (pageParam != null) {
             PageMethod.startPage(pageParam.getPageNum(), pageParam.getPageSize(), pageParam.getCount());
         }
-        TourOder tourOderFilter = MyModelUtil.copyTo(tourOderDtoFilter, TourOder.class);
-        String orderBy = MyOrderParam.buildOrderBy(orderParam, TourOder.class);
-        List<TourOder> tourOderList = tourOderService.getTourOderListWithRelation(tourOderFilter, orderBy);
-        return ResponseResult.success(MyPageUtil.makeResponseData(tourOderList, TourOderVo.class));
+        TourOrder tourOrderFilter = MyModelUtil.copyTo(tourOrderDtoFilter, TourOrder.class);
+        String orderBy = MyOrderParam.buildOrderBy(orderParam, TourOrder.class);
+        List<TourOrder> tourOrderList = tourOrderService.getTourOrderListWithRelation(tourOrderFilter, orderBy);
+        return ResponseResult.success(MyPageUtil.makeResponseData(tourOrderList, TourOrderVo.class));
     }
 
     /**
@@ -171,27 +171,27 @@ public class TourOderController {
      * @param id 指定对象主键Id。
      * @return 应答结果对象,包含对象详情。
      */
-    @SaCheckPermission("tourOder.view")
+    @SaCheckPermission("tourOrder.view")
     @GetMapping("/view")
-    public ResponseResult<TourOderVo> view(@RequestParam Long id) {
-        TourOder tourOder = tourOderService.getByIdWithRelation(id, MyRelationParam.full());
-        if (tourOder == null) {
+    public ResponseResult<TourOrderVo> view(@RequestParam Long id) {
+        TourOrder tourOrder = tourOrderService.getByIdWithRelation(id, MyRelationParam.full());
+        if (tourOrder == null) {
             return ResponseResult.error(ErrorCodeEnum.DATA_NOT_EXIST);
         }
-        TourOderVo tourOderVo = MyModelUtil.copyTo(tourOder, TourOderVo.class);
-        return ResponseResult.success(tourOderVo);
+        TourOrderVo tourOrderVo = MyModelUtil.copyTo(tourOrder, TourOrderVo.class);
+        return ResponseResult.success(tourOrderVo);
     }
 
     private ResponseResult<Void> doDelete(Long id) {
         String errorMessage;
         // 验证关联Id的数据合法性
-        TourOder originalTourOder = tourOderService.getById(id);
-        if (originalTourOder == null) {
+        TourOrder originalTourOrder = tourOrderService.getById(id);
+        if (originalTourOrder == null) {
             // NOTE: 修改下面方括号中的话述
             errorMessage = "数据验证失败,当前 [对象] 并不存在,请刷新后重试!";
             return ResponseResult.error(ErrorCodeEnum.DATA_NOT_EXIST, errorMessage);
         }
-        if (!tourOderService.remove(id)) {
+        if (!tourOrderService.remove(id)) {
             errorMessage = "数据操作失败,删除的对象不存在,请刷新后重试!";
             return ResponseResult.error(ErrorCodeEnum.DATA_NOT_EXIST, errorMessage);
         }

+ 7 - 7
application-webadmin/src/main/java/com/tourism/webadmin/back/dao/TourOderMapper.java → application-webadmin/src/main/java/com/tourism/webadmin/back/dao/TourOrderMapper.java

@@ -1,7 +1,7 @@
 package com.tourism.webadmin.back.dao;
 
 import com.tourism.common.core.base.dao.BaseDaoMapper;
-import com.tourism.webadmin.back.model.TourOder;
+import com.tourism.webadmin.back.model.TourOrder;
 import org.apache.ibatis.annotations.Param;
 
 import java.util.*;
@@ -12,22 +12,22 @@ import java.util.*;
  * @author 吃饭睡觉
  * @date 2024-09-06
  */
-public interface TourOderMapper extends BaseDaoMapper<TourOder> {
+public interface TourOrderMapper extends BaseDaoMapper<TourOrder> {
 
     /**
      * 批量插入对象列表。
      *
-     * @param tourOderList 新增对象列表。
+     * @param tourOrderList 新增对象列表。
      */
-    void insertList(List<TourOder> tourOderList);
+    void insertList(List<TourOrder> tourOrderList);
 
     /**
      * 获取过滤后的对象列表。
      *
-     * @param tourOderFilter 主表过滤对象。
+     * @param tourOrderFilter 主表过滤对象。
      * @param orderBy 排序字符串,order by从句的参数。
      * @return 对象列表。
      */
-    List<TourOder> getTourOderList(
-            @Param("tourOderFilter") TourOder tourOderFilter, @Param("orderBy") String orderBy);
+    List<TourOrder> getTourOrderList(
+            @Param("tourOrderFilter") TourOrder tourOrderFilter, @Param("orderBy") String orderBy);
 }

+ 29 - 29
application-webadmin/src/main/java/com/tourism/webadmin/back/dao/mapper/TourOderMapper.xml → application-webadmin/src/main/java/com/tourism/webadmin/back/dao/mapper/TourOrderMapper.xml

@@ -1,7 +1,7 @@
 <?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.TourOderMapper">
-    <resultMap id="BaseResultMap" type="com.tourism.webadmin.back.model.TourOder">
+<mapper namespace="com.tourism.webadmin.back.dao.TourOrderMapper">
+    <resultMap id="BaseResultMap" type="com.tourism.webadmin.back.model.TourOrder">
         <id column="id" jdbcType="BIGINT" property="id"/>
         <result column="order_no" jdbcType="VARCHAR" property="orderNo"/>
         <result column="departure_date" jdbcType="TIMESTAMP" property="departureDate"/>
@@ -80,51 +80,51 @@
     <!-- 如果有逻辑删除字段过滤,请写到这里 -->
     <sql id="filterRef">
         <!-- 这里必须加上全包名,否则当filterRef被其他Mapper.xml包含引用的时候,就会调用Mapper.xml中的该SQL片段 -->
-        <include refid="com.tourism.webadmin.back.dao.TourOderMapper.inputFilterRef"/>
+        <include refid="com.tourism.webadmin.back.dao.TourOrderMapper.inputFilterRef"/>
         AND tour_order.data_state = ${@com.tourism.common.core.constant.GlobalDeletedFlag@NORMAL}
     </sql>
 
     <!-- 这里仅包含调用接口输入的主表过滤条件 -->
     <sql id="inputFilterRef">
-        <if test="tourOderFilter != null">
-            <if test="tourOderFilter.departureDateStart != null and tourOderFilter.departureDateStart != ''">
-                AND tour_order.departure_date &gt;= #{tourOderFilter.departureDateStart}
+        <if test="tourOrderFilter != null">
+            <if test="tourOrderFilter.departureDateStart != null and tourOrderFilter.departureDateStart != ''">
+                AND tour_order.departure_date &gt;= #{tourOrderFilter.departureDateStart}
             </if>
-            <if test="tourOderFilter.departureDateEnd != null and tourOderFilter.departureDateEnd != ''">
-                AND tour_order.departure_date &lt;= #{tourOderFilter.departureDateEnd}
+            <if test="tourOrderFilter.departureDateEnd != null and tourOrderFilter.departureDateEnd != ''">
+                AND tour_order.departure_date &lt;= #{tourOrderFilter.departureDateEnd}
             </if>
-            <if test="tourOderFilter.endDateStart != null and tourOderFilter.endDateStart != ''">
-                AND tour_order.end_date &gt;= #{tourOderFilter.endDateStart}
+            <if test="tourOrderFilter.endDateStart != null and tourOrderFilter.endDateStart != ''">
+                AND tour_order.end_date &gt;= #{tourOrderFilter.endDateStart}
             </if>
-            <if test="tourOderFilter.endDateEnd != null and tourOderFilter.endDateEnd != ''">
-                AND tour_order.end_date &lt;= #{tourOderFilter.endDateEnd}
+            <if test="tourOrderFilter.endDateEnd != null and tourOrderFilter.endDateEnd != ''">
+                AND tour_order.end_date &lt;= #{tourOrderFilter.endDateEnd}
             </if>
-            <if test="tourOderFilter.orderStatus != null">
-                AND tour_order.order_status = #{tourOderFilter.orderStatus}
+            <if test="tourOrderFilter.orderStatus != null">
+                AND tour_order.order_status = #{tourOrderFilter.orderStatus}
             </if>
-            <if test="tourOderFilter.projectId != null">
-                AND tour_order.project_id = #{tourOderFilter.projectId}
+            <if test="tourOrderFilter.projectId != null">
+                AND tour_order.project_id = #{tourOrderFilter.projectId}
             </if>
-            <if test="tourOderFilter.projectResume != null and tourOderFilter.projectResume != ''">
-                <bind name = "safeTourOderProjectResume" value = "'%' + tourOderFilter.projectResume + '%'" />
-                AND tour_order.project_resume LIKE #{safeTourOderProjectResume}
+            <if test="tourOrderFilter.projectResume != null and tourOrderFilter.projectResume != ''">
+                <bind name = "safeTourOrderProjectResume" value = "'%' + tourOrderFilter.projectResume + '%'" />
+                AND tour_order.project_resume LIKE #{safeTourOrderProjectResume}
             </if>
-            <if test="tourOderFilter.customerName != null and tourOderFilter.customerName != ''">
-                <bind name = "safeTourOderCustomerName" value = "'%' + tourOderFilter.customerName + '%'" />
-                AND tour_order.customer_name LIKE #{safeTourOderCustomerName}
+            <if test="tourOrderFilter.customerName != null and tourOrderFilter.customerName != ''">
+                <bind name = "safeTourOrderCustomerName" value = "'%' + tourOrderFilter.customerName + '%'" />
+                AND tour_order.customer_name LIKE #{safeTourOrderCustomerName}
             </if>
-            <if test="tourOderFilter.customerMobile != null and tourOderFilter.customerMobile != ''">
-                <bind name = "safeTourOderCustomerMobile" value = "'%' + tourOderFilter.customerMobile + '%'" />
-                AND tour_order.customer_mobile LIKE #{safeTourOderCustomerMobile}
+            <if test="tourOrderFilter.customerMobile != null and tourOrderFilter.customerMobile != ''">
+                <bind name = "safeTourOrderCustomerMobile" value = "'%' + tourOrderFilter.customerMobile + '%'" />
+                AND tour_order.customer_mobile LIKE #{safeTourOrderCustomerMobile}
             </if>
-            <if test="tourOderFilter.searchString != null and tourOderFilter.searchString != ''">
-                <bind name = "safeTourOderSearchString" value = "'%' + tourOderFilter.searchString + '%'" />
-                AND CONCAT(IFNULL(tour_order.project_resume,''), IFNULL(tour_order.customer_name,''), IFNULL(tour_order.customer_mobile,'')) LIKE #{safeTourOderSearchString}
+            <if test="tourOrderFilter.searchString != null and tourOrderFilter.searchString != ''">
+                <bind name = "safeTourOrderSearchString" value = "'%' + tourOrderFilter.searchString + '%'" />
+                AND CONCAT(IFNULL(tour_order.project_resume,''), IFNULL(tour_order.customer_name,''), IFNULL(tour_order.customer_mobile,'')) LIKE #{safeTourOrderSearchString}
             </if>
         </if>
     </sql>
 
-    <select id="getTourOderList" resultMap="BaseResultMap" parameterType="com.tourism.webadmin.back.model.TourOder">
+    <select id="getTourOrderList" resultMap="BaseResultMap" parameterType="com.tourism.webadmin.back.model.TourOrder">
         SELECT * FROM tour_order
         <where>
             <include refid="filterRef"/>

+ 3 - 3
application-webadmin/src/main/java/com/tourism/webadmin/back/dto/TourOderDto.java → application-webadmin/src/main/java/com/tourism/webadmin/back/dto/TourOrderDto.java

@@ -16,9 +16,9 @@ import java.util.Date;
  * @author 吃饭睡觉
  * @date 2024-09-06
  */
-@Schema(description = "TourOderDto对象")
+@Schema(description = "TourOrderDto对象")
 @Data
-public class TourOderDto {
+public class TourOrderDto {
 
     /**
      * ID主键。
@@ -99,7 +99,7 @@ public class TourOderDto {
      * 订单状态。
      * NOTE: 可支持等于操作符的列表数据过滤。
      */
-    @Schema(description = "订单状态。0未完成;1已完成。")
+    @Schema(description = "订单状态。可支持等于操作符的列表数据过滤。")
     private Integer orderStatus;
 
     /**

+ 8 - 1
application-webadmin/src/main/java/com/tourism/webadmin/back/model/TourOder.java → application-webadmin/src/main/java/com/tourism/webadmin/back/model/TourOrder.java

@@ -20,7 +20,7 @@ import java.util.Map;
 @Data
 @EqualsAndHashCode(callSuper = true)
 @TableName(value = "tour_order")
-public class TourOder extends BaseModel {
+public class TourOrder extends BaseModel {
 
     /**
      * ID主键。
@@ -165,6 +165,13 @@ public class TourOder extends BaseModel {
         this.searchString = MyCommonUtil.replaceSqlWildcard(searchString);
     }
 
+    @RelationOneToOne(
+            masterIdField = "projectId",
+            slaveModelClass = TourismProject.class,
+            slaveIdField = "id")
+    @TableField(exist = false)
+    private TourismProject tourismProject;
+
     @RelationGlobalDict(
             masterIdField = "orderStatus",
             dictCode = "OrderStatus")

+ 12 - 12
application-webadmin/src/main/java/com/tourism/webadmin/back/service/TourOderService.java → application-webadmin/src/main/java/com/tourism/webadmin/back/service/TourOrderService.java

@@ -11,31 +11,31 @@ import java.util.*;
  * @author 吃饭睡觉
  * @date 2024-09-06
  */
-public interface TourOderService extends IBaseService<TourOder, Long> {
+public interface TourOrderService extends IBaseService<TourOrder, Long> {
 
     /**
      * 保存新增对象。
      *
-     * @param tourOder 新增对象。
+     * @param tourOrder 新增对象。
      * @return 返回新增对象。
      */
-    TourOder saveNew(TourOder tourOder);
+    TourOrder saveNew(TourOrder tourOrder);
 
     /**
      * 利用数据库的insertList语法,批量插入对象列表。
      *
-     * @param tourOderList 新增对象列表。
+     * @param tourOrderList 新增对象列表。
      */
-    void saveNewBatch(List<TourOder> tourOderList);
+    void saveNewBatch(List<TourOrder> tourOrderList);
 
     /**
      * 更新数据对象。
      *
-     * @param tourOder         更新的对象。
-     * @param originalTourOder 原有数据对象。
+     * @param tourOrder         更新的对象。
+     * @param originalTourOrder 原有数据对象。
      * @return 成功返回true,否则false。
      */
-    boolean update(TourOder tourOder, TourOder originalTourOder);
+    boolean update(TourOrder tourOrder, TourOrder originalTourOrder);
 
     /**
      * 删除指定数据。
@@ -47,22 +47,22 @@ public interface TourOderService extends IBaseService<TourOder, Long> {
 
     /**
      * 获取单表查询结果。由于没有关联数据查询,因此在仅仅获取单表数据的场景下,效率更高。
-     * 如果需要同时获取关联数据,请移步(getTourOderListWithRelation)方法。
+     * 如果需要同时获取关联数据,请移步(getTourOrderListWithRelation)方法。
      *
      * @param filter  过滤对象。
      * @param orderBy 排序参数。
      * @return 查询结果集。
      */
-    List<TourOder> getTourOderList(TourOder filter, String orderBy);
+    List<TourOrder> getTourOrderList(TourOrder filter, String orderBy);
 
     /**
      * 获取主表的查询结果,以及主表关联的字典数据和一对一从表数据,以及一对一从表的字典数据。
      * 该查询会涉及到一对一从表的关联过滤,或一对多从表的嵌套关联过滤,因此性能不如单表过滤。
-     * 如果仅仅需要获取主表数据,请移步(getTourOderList),以便获取更好的查询性能。
+     * 如果仅仅需要获取主表数据,请移步(getTourOrderList),以便获取更好的查询性能。
      *
      * @param filter 主表过滤对象。
      * @param orderBy 排序参数。
      * @return 查询结果集。
      */
-    List<TourOder> getTourOderListWithRelation(TourOder filter, String orderBy);
+    List<TourOrder> getTourOrderListWithRelation(TourOrder filter, String orderBy);
 }

+ 2 - 2
application-webadmin/src/main/java/com/tourism/webadmin/back/service/impl/TourOrderPassenageServiceImpl.java

@@ -39,7 +39,7 @@ public class TourOrderPassenageServiceImpl extends BaseService<TourOrderPassenag
     @Autowired
     private TourOrderPassenageMapper tourOrderPassenageMapper;
     @Autowired
-    private TourOderService tourOderService;
+    private TourOrderService tourOrderService;
 
     /**
      * 返回当前Service的主表Mapper对象。
@@ -110,7 +110,7 @@ public class TourOrderPassenageServiceImpl extends BaseService<TourOrderPassenag
         String errorMessageFormat = "数据验证失败,关联的%s并不存在,请刷新后重试!";
         //这里是一对多的验证
         if (this.needToVerify(tourOrderPassenage, originalTourOrderPassenage, TourOrderPassenage::getOrderId)
-                && !tourOderService.existId(tourOrderPassenage.getOrderId())) {
+                && !tourOrderService.existId(tourOrderPassenage.getOrderId())) {
             return CallResult.error(String.format(errorMessageFormat, "订单号信息"));
         }
         return CallResult.ok();

+ 37 - 31
application-webadmin/src/main/java/com/tourism/webadmin/back/service/impl/TourOderServiceImpl.java → application-webadmin/src/main/java/com/tourism/webadmin/back/service/impl/TourOrderServiceImpl.java

@@ -31,16 +31,18 @@ import java.util.*;
  */
 @Slf4j
 @MyDataSource(DataSourceType.MAIN)
-@Service("tourOderService")
-public class TourOderServiceImpl extends BaseService<TourOder, Long> implements TourOderService {
+@Service("tourOrderService")
+public class TourOrderServiceImpl extends BaseService<TourOrder, Long> implements TourOrderService {
 
     @Autowired
     private IdGeneratorWrapper idGenerator;
     @Autowired
-    private TourOderMapper tourOderMapper;
+    private TourOrderMapper tourOrderMapper;
     @Autowired
     private TourOrderPassenageService tourOrderPassenageService;
     @Autowired
+    private TourismProjectService tourismProjectService;
+    @Autowired
     private GlobalDictService globalDictService;
 
     /**
@@ -49,53 +51,58 @@ public class TourOderServiceImpl extends BaseService<TourOder, Long> implements
      * @return 主表Mapper对象。
      */
     @Override
-    protected BaseDaoMapper<TourOder> mapper() {
-        return tourOderMapper;
+    protected BaseDaoMapper<TourOrder> mapper() {
+        return tourOrderMapper;
     }
 
     @Transactional(rollbackFor = Exception.class)
     @Override
-    public TourOder saveNew(TourOder tourOder) {
-        tourOderMapper.insert(this.buildDefaultValue(tourOder));
-        return tourOder;
+    public TourOrder saveNew(TourOrder tourOrder) {
+        tourOrderMapper.insert(this.buildDefaultValue(tourOrder));
+        return tourOrder;
     }
 
     @Transactional(rollbackFor = Exception.class)
     @Override
-    public void saveNewBatch(List<TourOder> tourOderList) {
-        if (CollUtil.isNotEmpty(tourOderList)) {
-            tourOderList.forEach(this::buildDefaultValue);
-            tourOderMapper.insertList(tourOderList);
+    public void saveNewBatch(List<TourOrder> tourOrderList) {
+        if (CollUtil.isNotEmpty(tourOrderList)) {
+            tourOrderList.forEach(this::buildDefaultValue);
+            tourOrderMapper.insertList(tourOrderList);
         }
     }
 
     @Transactional(rollbackFor = Exception.class)
     @Override
-    public boolean update(TourOder tourOder, TourOder originalTourOder) {
-        MyModelUtil.fillCommonsForUpdate(tourOder, originalTourOder);
+    public boolean update(TourOrder tourOrder, TourOrder originalTourOrder) {
+        MyModelUtil.fillCommonsForUpdate(tourOrder, originalTourOrder);
         // 这里重点提示,在执行主表数据更新之前,如果有哪些字段不支持修改操作,请用原有数据对象字段替换当前数据字段。
-        UpdateWrapper<TourOder> uw = this.createUpdateQueryForNullValue(tourOder, tourOder.getId());
-        return tourOderMapper.update(tourOder, uw) == 1;
+        UpdateWrapper<TourOrder> uw = this.createUpdateQueryForNullValue(tourOrder, tourOrder.getId());
+        return tourOrderMapper.update(tourOrder, uw) == 1;
     }
 
     @Transactional(rollbackFor = Exception.class)
     @Override
     public boolean remove(Long id) {
-        if (tourOderMapper.deleteById(id) == 0) {
+        TourOrder tourOrder = tourOrderMapper.selectById(id);
+        if (tourOrder == null) {
+            return false;
+        }
+        if (tourOrderMapper.deleteById(id) == 0) {
             return false;
         }
+        tourismProjectService.remove(tourOrder.getProjectId());
         tourOrderPassenageService.removeByOrderId(id);
         return true;
     }
 
     @Override
-    public List<TourOder> getTourOderList(TourOder filter, String orderBy) {
-        return tourOderMapper.getTourOderList(filter, orderBy);
+    public List<TourOrder> getTourOrderList(TourOrder filter, String orderBy) {
+        return tourOrderMapper.getTourOrderList(filter, orderBy);
     }
 
     @Override
-    public List<TourOder> getTourOderListWithRelation(TourOder filter, String orderBy) {
-        List<TourOder> resultList = tourOderMapper.getTourOderList(filter, orderBy);
+    public List<TourOrder> getTourOrderListWithRelation(TourOrder filter, String orderBy) {
+        List<TourOrder> resultList = tourOrderMapper.getTourOrderList(filter, orderBy);
         // 在缺省生成的代码中,如果查询结果resultList不是Page对象,说明没有分页,那么就很可能是数据导出接口调用了当前方法。
         // 为了避免一次性的大量数据关联,规避因此而造成的系统运行性能冲击,这里手动进行了分批次读取,开发者可按需修改该值。
         int batchSize = resultList instanceof Page ? 0 : 1000;
@@ -104,23 +111,22 @@ public class TourOderServiceImpl extends BaseService<TourOder, Long> implements
     }
 
     @Override
-    public CallResult verifyRelatedData(TourOder tourOder, TourOder originalTourOder) {
+    public CallResult verifyRelatedData(TourOrder tourOrder, TourOrder originalTourOrder) {
         String errorMessageFormat = "数据验证失败,关联的%s并不存在,请刷新后重试!";
         //这里是基于字典的验证。
-        if (this.needToVerify(tourOder, originalTourOder, TourOder::getOrderStatus)
-                && !globalDictService.existDictItemFromCache("OrderStatus", tourOder.getOrderStatus())) {
+        if (this.needToVerify(tourOrder, originalTourOrder, TourOrder::getOrderStatus)
+                && !globalDictService.existDictItemFromCache("OrderStatus", tourOrder.getOrderStatus())) {
             return CallResult.error(String.format(errorMessageFormat, "订单状态"));
         }
         return CallResult.ok();
     }
 
-    private TourOder buildDefaultValue(TourOder tourOder) {
-        if (tourOder.getId() == null) {
-            tourOder.setId(idGenerator.nextLongId());
+    private TourOrder buildDefaultValue(TourOrder tourOrder) {
+        if (tourOrder.getId() == null) {
+            tourOrder.setId(idGenerator.nextLongId());
         }
-        tourOder.setOrderNo(tourOder.getId().toString());
-        MyModelUtil.fillCommonsForInsert(tourOder);
-        tourOder.setDataState(GlobalDeletedFlag.NORMAL);
-        return tourOder;
+        MyModelUtil.fillCommonsForInsert(tourOrder);
+        tourOrder.setDataState(GlobalDeletedFlag.NORMAL);
+        return tourOrder;
     }
 }

+ 1 - 2
application-webadmin/src/main/java/com/tourism/webadmin/back/vo/TourOderVo.java → application-webadmin/src/main/java/com/tourism/webadmin/back/vo/TourOrderVo.java

@@ -1,7 +1,6 @@
 package com.tourism.webadmin.back.vo;
 
 import com.tourism.common.core.base.vo.BaseVo;
-import com.tourism.webadmin.back.model.TourOder;
 import io.swagger.v3.oas.annotations.media.Schema;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
@@ -20,7 +19,7 @@ import java.util.Map;
 @Schema(description = "TourOderVO视图对象")
 @Data
 @EqualsAndHashCode(callSuper = true)
-public class TourOderVo extends BaseVo {
+public class TourOrderVo extends BaseVo {
 
     /**
      * ID主键。

+ 5 - 5
application-webadmin/src/main/resources/application-dev.yml

@@ -8,27 +8,27 @@ spring:
     druid:
       # 数据库链接 [主数据源]
       main:
-        url: jdbc:mysql://localhost:3306/tourism?characterEncoding=utf8&useSSL=true&serverTimezone=Asia/Shanghai
+        url: jdbc:mysql://192.168.1.204:3306/tourism?characterEncoding=utf8&useSSL=true&serverTimezone=Asia/Shanghai
         username: root
         password: lm8458
       # 默认生成的操作日志数据源配置。
       operation-log:
-        url: jdbc:mysql://localhost:3306/tourism?characterEncoding=utf8&useSSL=true&serverTimezone=Asia/Shanghai
+        url: jdbc:mysql://192.168.1.204:3306/tourism?characterEncoding=utf8&useSSL=true&serverTimezone=Asia/Shanghai
         username: root
         password: lm8458
       # 默认生成的全局编码字典数据源配置。
       global-dict:
-        url: jdbc:mysql://localhost:3306/tourism?characterEncoding=utf8&useSSL=true&serverTimezone=Asia/Shanghai
+        url: jdbc:mysql://192.168.1.204:3306/tourism?characterEncoding=utf8&useSSL=true&serverTimezone=Asia/Shanghai
         username: root
         password: lm8458
       # 默认生成的工作流及在线表单数据源配置。
       common-flow-online:
-        url: jdbc:mysql://localhost:3306/tourism?characterEncoding=utf8&useSSL=true&serverTimezone=Asia/Shanghai
+        url: jdbc:mysql://192.168.1.204:3306/tourism?characterEncoding=utf8&useSSL=true&serverTimezone=Asia/Shanghai
         username: root
         password: lm8458
       # 默认生成的统计打印模块的数据源配置。
       common-report:
-        url: jdbc:mysql://localhost:3306/tourism?characterEncoding=utf8&useSSL=true&serverTimezone=Asia/Shanghai
+        url: jdbc:mysql://192.168.1.204:3306/tourism?characterEncoding=utf8&useSSL=true&serverTimezone=Asia/Shanghai
         username: root
         password: lm8458
       driverClassName: com.mysql.cj.jdbc.Driver