浏览代码

修改抽奖内容

码头薯片 5 月之前
父节点
当前提交
8643908f60

+ 34 - 21
ruoyi-framework/src/main/java/com/ruoyi/framework/recovery/domain/WxUserLottery.java

@@ -9,7 +9,7 @@ import com.ruoyi.common.core.domain.BaseEntity;
 
 /**
  * 微信中奖记录对象 wx_user_lottery
- * 
+ *
  * @author jin
  * @date 2024-12-17
  */
@@ -50,21 +50,24 @@ public class WxUserLottery extends BaseEntity
     @Excel(name = "更新时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
     private Date updateDate;
 
-    public void setId(Long id) 
+    @Excel(name = "奖品数量")
+    private Long lotteryNum;
+
+    public void setId(Long id)
     {
         this.id = id;
     }
 
-    public Long getId() 
+    public Long getId()
     {
         return id;
     }
-    public void setLotteryId(Long lotteryId) 
+    public void setLotteryId(Long lotteryId)
     {
         this.lotteryId = lotteryId;
     }
 
-    public Long getLotteryId() 
+    public Long getLotteryId()
     {
         return lotteryId;
     }
@@ -86,30 +89,30 @@ public class WxUserLottery extends BaseEntity
     {
         return openId;
     }
-    public void setMark(String mark) 
+    public void setMark(String mark)
     {
         this.mark = mark;
     }
 
-    public String getMark() 
+    public String getMark()
     {
         return mark;
     }
-    public void setCreateDate(Date createDate) 
+    public void setCreateDate(Date createDate)
     {
         this.createDate = createDate;
     }
 
-    public Date getCreateDate() 
+    public Date getCreateDate()
     {
         return createDate;
     }
-    public void setUpdateDate(Date updateDate) 
+    public void setUpdateDate(Date updateDate)
     {
         this.updateDate = updateDate;
     }
 
-    public Date getUpdateDate() 
+    public Date getUpdateDate()
     {
         return updateDate;
     }
@@ -122,17 +125,27 @@ public class WxUserLottery extends BaseEntity
         this.lotteryType = lotteryType;
     }
 
+    public Long getLotteryNum() {
+        return lotteryNum;
+    }
+
+    public void setLotteryNum(Long lotteryNum) {
+        this.lotteryNum = lotteryNum;
+    }
+
     @Override
     public String toString() {
-        return "WxUserLottery{" +
-                "id=" + id +
-                ", lotteryId=" + lotteryId +
-                ", lotteryNum='" + lotteryCode + '\'' +
-                ", userId=" + openId +
-                ", mark='" + mark + '\'' +
-                ", lotteryType='" + lotteryType + '\'' +
-                ", createDate=" + createDate +
-                ", updateDate=" + updateDate +
-                '}';
+        final StringBuffer sb = new StringBuffer("WxUserLottery{");
+        sb.append("id=").append(id);
+        sb.append(", lotteryId=").append(lotteryId);
+        sb.append(", lotteryCode='").append(lotteryCode).append('\'');
+        sb.append(", openId='").append(openId).append('\'');
+        sb.append(", mark='").append(mark).append('\'');
+        sb.append(", lotteryType='").append(lotteryType).append('\'');
+        sb.append(", createDate=").append(createDate);
+        sb.append(", updateDate=").append(updateDate);
+        sb.append(", lotteryNum=").append(lotteryNum);
+        sb.append('}');
+        return sb.toString();
     }
 }

+ 9 - 9
ruoyi-framework/src/main/java/com/ruoyi/framework/recovery/mapper/RecSaleInfoMapper.java

@@ -7,15 +7,15 @@ import org.apache.ibatis.annotations.Param;
 
 /**
  * 发售信息详情Mapper接口
- * 
+ *
  * @author jin
  * @date 2024-11-18
  */
-public interface RecSaleInfoMapper 
+public interface RecSaleInfoMapper
 {
     /**
      * 查询发售信息详情
-     * 
+     *
      * @param id 发售信息详情主键
      * @return 发售信息详情
      */
@@ -23,7 +23,7 @@ public interface RecSaleInfoMapper
 
     /**
      * 查询发售信息详情列表
-     * 
+     *
      * @param recSaleInfo 发售信息详情
      * @return 发售信息详情集合
      */
@@ -31,15 +31,15 @@ public interface RecSaleInfoMapper
 
     /**
      * 新增发售信息详情
-     * 
+     *
      * @param recSaleInfo 发售信息详情
      * @return 结果
      */
-    public int insertRecSaleInfo(RecSaleInfo recSaleInfo);
+    public int insertRecSaleInfo(@Param("info") RecSaleInfo recSaleInfo);
 
     /**
      * 修改发售信息详情
-     * 
+     *
      * @param recSaleInfo 发售信息详情
      * @return 结果
      */
@@ -47,7 +47,7 @@ public interface RecSaleInfoMapper
 
     /**
      * 删除发售信息详情
-     * 
+     *
      * @param id 发售信息详情主键
      * @return 结果
      */
@@ -55,7 +55,7 @@ public interface RecSaleInfoMapper
 
     /**
      * 批量删除发售信息详情
-     * 
+     *
      * @param ids 需要删除的数据主键集合
      * @return 结果
      */

+ 2 - 0
ruoyi-framework/src/main/java/com/ruoyi/framework/recovery/service/impl/RecSaleInfoServiceImpl.java

@@ -7,6 +7,7 @@ import cn.hutool.core.date.DateField;
 import cn.hutool.core.date.DateTime;
 import cn.hutool.core.date.DateUtil;
 import com.ruoyi.framework.recovery.domain.dto.RecSaleInfoDto;
+import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import com.ruoyi.framework.recovery.mapper.RecSaleInfoMapper;
@@ -60,6 +61,7 @@ public class RecSaleInfoServiceImpl implements IRecSaleInfoService {
             dto.setDurationOfTheActivity(1);
         }
         DateTime endTime = DateUtil.offsetDay(activityTime, dto.getDurationOfTheActivity());
+        BeanUtils.copyProperties(dto, recSaleInfo);
         recSaleInfo.setEventStartTime(activityTime);
         recSaleInfo.setEndTimeOfActivity(endTime);
         recSaleInfo.setCreateDate(new Date());

+ 26 - 26
ruoyi-system/src/main/resources/mapper/system/RecSaleInfoMapper.xml

@@ -49,34 +49,34 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <insert id="insertRecSaleInfo" parameterType="RecSaleInfo">
         insert into rec_sale_info
         <trim prefix="(" suffix=")" suffixOverrides=",">
-            <if test="id != null">id,</if>
-            <if test="saleName != null">sale_name,</if>
-            <if test="salePrice != null">sale_price,</if>
-            <if test="market != null">market,</if>
-            <if test="storeId != null">store_id,</if>
-            <if test="createBy != null">create_by,</if>
-            <if test="createDate != null">create_date,</if>
-            <if test="updateBy != null">update_by,</if>
-            <if test="updateDate != null">update_date,</if>
-            <if test="catalog != null">catalog,</if>
-            <if test="images != null">images,</if>
-            <if test="eventStartTime != null">event_start_time,</if>
-            <if test="endTimeOfActivity != null">end_time_of_activity,</if>
+            <if test="info.id != null">id,</if>
+            <if test="info.saleName != null">sale_name,</if>
+            <if test="info.salePrice != null">sale_price,</if>
+            <if test="info.market != null">market,</if>
+            <if test="info.storeId != null">store_id,</if>
+            <if test="info.createBy != null">create_by,</if>
+            <if test="info.createDate != null">create_date,</if>
+            <if test="info.updateBy != null">update_by,</if>
+            <if test="info.updateDate != null">update_date,</if>
+            <if test="info.catalog != null">catalog,</if>
+            <if test="info.images != null">images,</if>
+            <if test="info.eventStartTime != null">event_start_time,</if>
+            <if test="info.endTimeOfActivity != null">end_time_of_activity,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
-            <if test="id != null">#{id},</if>
-            <if test="saleName != null">#{saleName},</if>
-            <if test="salePrice != null">#{salePrice},</if>
-            <if test="market != null">#{market},</if>
-            <if test="storeId != null">#{storeId},</if>
-            <if test="createBy != null">#{createBy},</if>
-            <if test="createDate != null">#{createDate},</if>
-            <if test="updateBy != null">#{updateBy},</if>
-            <if test="updateDate != null">#{updateDate},</if>
-            <if test="catalog != null">#{catalog},</if>
-            <if test="images != null">#{images},</if>
-            <if test="eventStartTime != null">#{eventStartTime},</if>
-            <if test="endTimeOfActivity != null">#{endTimeOfActivity},</if>
+            <if test="info.id != null">#{info.id},</if>
+            <if test="info.saleName != null">#{info.saleName},</if>
+            <if test="info.salePrice != null">#{info.salePrice},</if>
+            <if test="info.market != null">#{info.market},</if>
+            <if test="info.storeId != null">#{info.storeId},</if>
+            <if test="info.createBy != null">#{info.createBy},</if>
+            <if test="info.createDate != null">#{info.createDate},</if>
+            <if test="info.updateBy != null">#{info.updateBy},</if>
+            <if test="info.updateDate != null">#{info.updateDate},</if>
+            <if test="info.catalog != null">#{info.catalog},</if>
+            <if test="info.images != null">#{info.images},</if>
+            <if test="info.eventStartTime != null">#{info.eventStartTime},</if>
+            <if test="info.endTimeOfActivity != null">#{info.endTimeOfActivity},</if>
          </trim>
     </insert>