Browse Source

refactor(微信优惠券): 优化海报上传组件和优惠券逻辑

- 将imageUpload替换为oss-image-upload组件并限制上传数量
- 移除新用户优惠券的条件判断,使所有用户可见
- 修复WechatStockMapper中coupon_poster字段的SQL语法错误
- 调整字段顺序并修复重复的discount_percent映射
master
前端-胡立永 1 month ago
parent
commit
ed2cee0712
4 changed files with 7 additions and 5 deletions
  1. +1
    -1
      CatmDogd-Mall-Front-test/src/views/marketing/wechatStock/index.vue
  2. +2
    -2
      ruoyi-mall/src/main/java/com/cyl/h5/controller/H5CouponController.java
  3. +1
    -0
      ruoyi-mall/src/main/resources/mapper/marketing/WechatMemberCouponMapper.xml
  4. +3
    -2
      ruoyi-mall/src/main/resources/mapper/marketing/WechatStockMapper.xml

+ 1
- 1
CatmDogd-Mall-Front-test/src/views/marketing/wechatStock/index.vue View File

@ -271,7 +271,7 @@
</el-form-item> </el-form-item>
<el-form-item label="海报" prop="couponPoster"> <el-form-item label="海报" prop="couponPoster">
<imageUpload v-model="form.couponPoster"/>
<oss-image-upload v-model="form.couponPoster" :limit="1"></oss-image-upload>
</el-form-item> </el-form-item>
<!-- <el-form-item label="折扣类型" prop="discountType">--> <!-- <el-form-item label="折扣类型" prop="discountType">-->


+ 2
- 2
ruoyi-mall/src/main/java/com/cyl/h5/controller/H5CouponController.java View File

@ -82,13 +82,13 @@ public class H5CouponController extends BaseController
Integer integer = orderMapper.selectCount(Wrappers. Integer integer = orderMapper.selectCount(Wrappers.
<Order>lambdaQuery() <Order>lambdaQuery()
.eq(Order::getMemberId, member.getId())); .eq(Order::getMemberId, member.getId()));
if (integer == 0){
// if (integer == 0){
//新用户 //新用户
WechatStock newUserCoupon = h5CouponService.getNewUserCoupon(); WechatStock newUserCoupon = h5CouponService.getNewUserCoupon();
if (newUserCoupon != null){ if (newUserCoupon != null){
list.add(0, newUserCoupon); list.add(0, newUserCoupon);
} }
}
// }
for (WechatStock stock : list) { for (WechatStock stock : list) {
stock.setAlreadyReceived(wechatMemberCouponMapper.selectCount( stock.setAlreadyReceived(wechatMemberCouponMapper.selectCount(


+ 1
- 0
ruoyi-mall/src/main/resources/mapper/marketing/WechatMemberCouponMapper.xml View File

@ -56,6 +56,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="discountAmount" column="discount_amount"/> <result property="discountAmount" column="discount_amount"/>
<result property="transactionMinimum" column="transaction_minimum"/> <result property="transactionMinimum" column="transaction_minimum"/>
<result property="discountPercent" column="discount_percent"/> <result property="discountPercent" column="discount_percent"/>
<result property="discountPercent" column="discount_percent"/>
</resultMap> </resultMap>
<sql id="selectWechatMemberCouponVo"> <sql id="selectWechatMemberCouponVo">


+ 3
- 2
ruoyi-mall/src/main/resources/mapper/marketing/WechatStockMapper.xml View File

@ -105,8 +105,8 @@ create_by, create_time, update_by, update_time, send_type, discount_type, event_
<if test="sendType != null and sendType != ''">send_type,</if> <if test="sendType != null and sendType != ''">send_type,</if>
<if test="discountType != null and discountType != ''">discount_type,</if> <if test="discountType != null and discountType != ''">discount_type,</if>
<if test="eventType != null and eventType != ''">event_type,</if> <if test="eventType != null and eventType != ''">event_type,</if>
<if test="couponPoster != null and couponPoster != ''">coupon_poster,</if>
<if test="giveNum != null and giveNum != ''">give_num,</if> <if test="giveNum != null and giveNum != ''">give_num,</if>
<if test="couponPoster != null and couponPoster != ''">coupon_poster,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if> <if test="id != null">#{id},</if>
@ -135,8 +135,8 @@ create_by, create_time, update_by, update_time, send_type, discount_type, event_
<if test="sendType != null and sendType != ''">#{sendType},</if> <if test="sendType != null and sendType != ''">#{sendType},</if>
<if test="discountType != null and discountType != ''">#{discountType},</if> <if test="discountType != null and discountType != ''">#{discountType},</if>
<if test="eventType != null and eventType != ''">#{eventType},</if> <if test="eventType != null and eventType != ''">#{eventType},</if>
<if test="couponPoster != null and couponPoster != ''">couponPoster,</if>
<if test="giveNum != null and giveNum != ''">giveNum,</if> <if test="giveNum != null and giveNum != ''">giveNum,</if>
<if test="couponPoster != null and couponPoster != ''">#{couponPoster},</if>
</trim> </trim>
</insert> </insert>
@ -168,6 +168,7 @@ create_by, create_time, update_by, update_time, send_type, discount_type, event_
<if test="sendType != null and sendType != ''">send_type = #{sendType},</if> <if test="sendType != null and sendType != ''">send_type = #{sendType},</if>
<if test="discountType != null and discountType != ''">discount_type = #{discountType},</if> <if test="discountType != null and discountType != ''">discount_type = #{discountType},</if>
<if test="eventType != null and eventType != ''">event_type = #{eventType},</if> <if test="eventType != null and eventType != ''">event_type = #{eventType},</if>
<if test="couponPoster != null and couponPoster != ''">coupon_poster = #{couponPoster},</if>
</trim> </trim>
where id = #{id} where id = #{id}
</update> </update>


Loading…
Cancel
Save