Parcourir la source

优惠券每个月只能领取一次
优惠券固定为每个月10号发放
修改优惠券为长期订阅

xdd il y a 1 mois
Parent
commit
1063396691

+ 9 - 5
fs-service-system/src/main/java/com/fs/store/service/impl/FsCouponScheduleServiceImpl.java

@@ -71,7 +71,8 @@ public class FsCouponScheduleServiceImpl implements IFsCouponScheduleService
     /**
      * 小程序消息通知模板ID
      */
-    private final String WX_MINI_APP_NOTIFY_TEMPLATE_ID = "5ZSzz2nPmJo9EuenZa78mQPScoOMc84LnEfEpV0-i04";
+//    private final String WX_MINI_APP_NOTIFY_TEMPLATE_ID = "5ZSzz2nPmJo9EuenZa78mQPScoOMc84LnEfEpV0-i04";
+    private final String WX_MINI_APP_NOTIFY_TEMPLATE_ID = "K0RUbGggwYz7V4yjtJjFVXtthnx4hOJgHvr7RNOyRSE";
 
     /**
      * 查询定时发放优惠券队列
@@ -254,7 +255,7 @@ public class FsCouponScheduleServiceImpl implements IFsCouponScheduleService
                 if(ObjectUtil.isNotNull(fsStoreCoupon)){
                     String couponNameById = fsStoreCoupon.getTitle();
                     if(StringUtil.isNotEmpty(couponNameById)){
-                        couponName.setValue(couponNameById);
+                        couponName.setValue(String.format("优惠券 %s 已下发账户,请及时使用!",couponNameById));
                     }
                 }
 
@@ -286,10 +287,13 @@ public class FsCouponScheduleServiceImpl implements IFsCouponScheduleService
                     }
                 }
 
+//                data.put("thing1",couponName);
+//                data.put("time2",couponValidate);
+//                data.put("thing3",couponMark);
+//                data.put("amount4",couponPrice);
+
                 data.put("thing1",couponName);
-                data.put("time2",couponValidate);
-                data.put("thing3",couponMark);
-                data.put("amount4",couponPrice);
+                data.put("thing6",couponMark);
 
                 notifyTask.setData(JSON.toJSONString(data));
 

+ 1 - 1
fs-service-system/src/main/java/com/fs/store/service/impl/FsStoreCouponIssueServiceImpl.java

@@ -134,7 +134,7 @@ public class FsStoreCouponIssueServiceImpl implements IFsStoreCouponIssueService
         //判断用户是否领取过
         FsUser user= userMapper.selectFsUserById(Long.parseLong(userId));
         if(user.getLevel().equals(0)){
-            if(fsStoreCouponIssueUserMapper.checkReceive(userId,param.getId())>0){
+            if(fsStoreCouponIssueUserMapper.checkReceiveThisMonth(userId,param.getId())>0){
                 return R.error("已领取");
             }
         }

+ 2 - 1
fs-service-system/src/main/java/com/fs/store/service/impl/FsStoreOrderServiceImpl.java

@@ -1652,7 +1652,8 @@ public class FsStoreOrderServiceImpl implements IFsStoreOrderService
                     fsCouponSchedule.setOrderTime(LocalDateTime.now());
                     fsCouponSchedule.setUserId(order.getUserId());
                     // 如果上次发送时间为空,那么预计发送时间等于=下单时间+1月
-                    fsCouponSchedule.setSendTime(fsCouponSchedule.getOrderTime().plusMonths(1L));
+                    // 获取下个月10号
+                    fsCouponSchedule.setSendTime(fsCouponSchedule.getOrderTime().plusMonths(1L).withDayOfMonth(10));
                     fsCouponSchedule.setRetryCount(0);
 
                     fsCouponScheduleService.insertFsCouponSchedule(fsCouponSchedule);