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

[fix]
拼团增加排序字段,修改projectId的数据类型为Long

chenchen 3 сар өмнө
parent
commit
5d089b5531

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

@@ -119,7 +119,7 @@ public class TourismOrderController {
         TourOrderVo tourOrderVo = MyModelUtil.copyTo(tourOder1, TourOrderVo.class);
 
         TourismProject tourismProject = new TourismProject();
-        tourismProject.setId(tourOrderVo.getProjectId());
+        tourismProject.setId(Long.parseLong(tourOrderVo.getProjectId()));
         TourismProject tourismProject1 = tourismProjectService.getOne(tourismProject);
         TourismProjectVo tourismProjectVo = MyModelUtil.copyTo(tourismProject1, TourismProjectVo.class);
         tourOrderVo.setTourismProjectVo(tourismProjectVo);

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

@@ -268,7 +268,7 @@ public class ExtraController {
         if(tourismProjectDto.getEnable() == 1) {
             //查看该项目是否设置日历;设置日历,则允许修改项目状态;若未设置日历,则不允许修改项目状态
             TourismDatePrice tourismDatePrice = new TourismDatePrice();
-            tourismDatePrice.setProjectId(tourismProject.getId());
+            tourismDatePrice.setProjectId(String.valueOf(tourismProject.getId()));
             tourismDatePrice.setNowDate(new Date());
             List<TourismDatePrice> listByFilter = tourismDatePriceService.getTourismDatePriceList(tourismDatePrice,"");
             if (listByFilter.isEmpty()) {

+ 2 - 2
application-webadmin/src/main/java/com/tourism/webadmin/back/controller/TourismProjectController.java

@@ -69,7 +69,7 @@ public class TourismProjectController {
     @SaCheckPermission("tourismProject.add")
     @OperationLog(type = SysOperationLogType.ADD)
     @PostMapping("/add")
-    public ResponseResult<String> add(
+    public ResponseResult<Long> add(
             @MyRequestBody TourismProjectDto tourismProjectDto,
             @MyRequestBody TourismFileDto tourismFileDto,
             @MyRequestBody TourismContentDto tourismContentDto) throws Exception {
@@ -96,7 +96,7 @@ public class TourismProjectController {
     @SaCheckPermission("tourismProject.update")
     @OperationLog(type = SysOperationLogType.UPDATE)
     @PostMapping("/update")
-    public ResponseResult<String> update(
+    public ResponseResult<Long> update(
             @MyRequestBody TourismProjectDto tourismProjectDto,
             @MyRequestBody TourismFileDto tourismFileDto,
             @MyRequestBody TourismContentDto tourismContentDto) throws Exception {

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

@@ -16,6 +16,7 @@
         <result column="max_count" jdbcType="INTEGER" property="maxCount"/>
         <result column="adult_price" jdbcType="DECIMAL" property="adultPrice"/>
         <result column="children_price" jdbcType="DECIMAL" property="childrenPrice"/>
+        <result column="show_order" jdbcType="INTEGER" property="showOrder"/>
     </resultMap>
 
     <insert id="insertList">
@@ -33,7 +34,8 @@
             data_state,
             max_count,
             adult_price,
-            children_price)
+            children_price,
+            show_order)
         VALUES
         <foreach collection="list" index="index" item="item" separator="," >
             (#{item.id},
@@ -49,7 +51,8 @@
             #{item.dataState},
             #{item.maxCount},
             #{item.adultPrice},
-            #{item.childrenPrice})
+            #{item.childrenPrice},
+            #{item.showOrder})
         </foreach>
     </insert>
 

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

@@ -87,6 +87,12 @@ public class TourProjectGroupPurchaseDto {
     private BigDecimal childrenPrice;
 
     /**
+     * 显示顺序。
+     */
+    @Schema(description = "显示顺序。")
+    private Integer showOrder;
+
+    /**
      * endTime 范围过滤起始值(>=)。
      * NOTE: 可支持范围操作符的列表数据过滤。
      */

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

@@ -84,6 +84,12 @@ public class TourProjectGroupPurchase extends BaseModel {
     private BigDecimal childrenPrice;
 
     /**
+     * 显示顺序。
+     */
+    @TableField(value = "show_order")
+    private Integer showOrder;
+
+    /**
      * endTime 范围过滤起始值(>=)。
      */
     @TableField(exist = false)
@@ -162,6 +168,15 @@ public class TourProjectGroupPurchase extends BaseModel {
     @TableField(exist = false)
     private TourismProject tourismProject;
 
+//    @RelationDict(
+//            masterIdField = "projectId",
+//            equalOneToOneRelationField = "tourismProject",
+//            slaveModelClass = TourismProject.class,
+//            slaveIdField = "id",
+//            slaveNameField = "projectTitle")
+//    @TableField(exist = false)
+//    private Map<String, Object> projectIdDictMap;
+
     @RelationConstDict(
             masterIdField = "state",
             constantDictClass = Enable.class)

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

@@ -31,7 +31,7 @@ public class TourismProject extends BaseModel {
      * 主键id。
      */
     @TableId(value = "id")
-    private String id;
+    private Long id;
 
     /**
      * 项目标题。

+ 4 - 4
application-webadmin/src/main/java/com/tourism/webadmin/back/service/impl/TourismProjectServiceImpl.java

@@ -129,7 +129,7 @@ public class TourismProjectServiceImpl extends BaseService<TourismProject, Strin
     public boolean update(TourismProject tourismProject, TourismProject originalTourismProject) {
         MyModelUtil.fillCommonsForUpdate(tourismProject, originalTourismProject);
         // 这里重点提示,在执行主表数据更新之前,如果有哪些字段不支持修改操作,请用原有数据对象字段替换当前数据字段。
-        UpdateWrapper<TourismProject> uw = this.createUpdateQueryForNullValue(tourismProject, tourismProject.getId());
+        UpdateWrapper<TourismProject> uw = this.createUpdateQueryForNullValue(tourismProject, String.valueOf(tourismProject.getId()));
         return tourismProjectMapper.update(tourismProject, uw) == 1;
     }
 
@@ -149,13 +149,13 @@ public class TourismProjectServiceImpl extends BaseService<TourismProject, Strin
         // 对于一对一新增或更新,如果主键值为空就新增,否则就更新,同时更新updateTime和updateUserId。
         TourismFile tourismFile = relationData.getObject("tourismFile", TourismFile.class);
         if (tourismFile != null) {
-            tourismFile.setAssociationTableId(tourismProject.getId());
+            tourismFile.setAssociationTableId(String.valueOf(tourismProject.getId()));
             tourismFileService.saveNewOrUpdate(tourismFile,
                     tourismFileService::saveNew, tourismFileService::update);
         }
         TourismContent tourismContent = relationData.getObject("tourismContent", TourismContent.class);
         if (tourismContent != null) {
-            tourismContent.setAssociationId(tourismProject.getId());
+            tourismContent.setAssociationId(String.valueOf(tourismProject.getId()));
             tourismContentService.saveNewOrUpdate(tourismContent,
                     tourismContentService::saveNew, tourismContentService::update);
         }
@@ -270,7 +270,7 @@ public class TourismProjectServiceImpl extends BaseService<TourismProject, Strin
 
     private TourismProject buildDefaultValue(TourismProject tourismProject) {
         if (tourismProject.getId() == null) {
-            tourismProject.setId(idGenerator.nextStringId());
+            tourismProject.setId(idGenerator.nextLongId());
         }
         MyModelUtil.fillCommonsForInsert(tourismProject);
         tourismProject.setDataState(GlobalDeletedFlag.NORMAL);

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

@@ -75,12 +75,24 @@ public class TourProjectGroupPurchaseVo extends BaseVo {
     private BigDecimal childrenPrice;
 
     /**
+     * 显示顺序。
+     */
+    @Schema(description = "显示顺序")
+    private Integer showOrder;
+
+    /**
      * projectId 的一对一关联数据对象,数据对应类型为TourismProjectVo。
      */
     @Schema(description = "projectId 的一对一关联数据对象,数据对应类型为TourismProjectVo")
     private Map<String, Object> tourismProject;
 
     /**
+     * projectId 字典关联数据。
+     */
+    @Schema(description = "projectId 字典关联数据")
+    private Map<String, Object> projectIdDictMap;
+
+    /**
      * state 常量字典关联数据。
      */
     @Schema(description = "state 常量字典关联数据")