|
@@ -1476,6 +1476,8 @@ public class TOrderServiceImpl extends ServiceImpl<TOrderMapper, TOrder> impleme
|
|
|
|
|
|
|
|
String activityId = activity.getId();
|
|
String activityId = activity.getId();
|
|
|
|
|
|
|
|
|
|
+ String activityUrl = activity.getActivityUrl();
|
|
|
|
|
+
|
|
|
// 用户获取的最大抽奖次数
|
|
// 用户获取的最大抽奖次数
|
|
|
Integer productUserMaxNum = activity.getProductUserMaxNum();
|
|
Integer productUserMaxNum = activity.getProductUserMaxNum();
|
|
|
|
|
|
|
@@ -1504,7 +1506,7 @@ public class TOrderServiceImpl extends ServiceImpl<TOrderMapper, TOrder> impleme
|
|
|
|
|
|
|
|
if (actualLotteryNumToGrant > 0) {
|
|
if (actualLotteryNumToGrant > 0) {
|
|
|
// 发放计算后的数量
|
|
// 发放计算后的数量
|
|
|
- saveLotteryLog(user, activityId, actualLotteryNumToGrant, 2);
|
|
|
|
|
|
|
+ saveLotteryLog(user, activityId, activityUrl, actualLotteryNumToGrant, 2);
|
|
|
}
|
|
}
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
@@ -1558,7 +1560,7 @@ public class TOrderServiceImpl extends ServiceImpl<TOrderMapper, TOrder> impleme
|
|
|
int actualLotteryNumToGrant = calculateActualGrant(hasLimit, userLotteryCount, requestedLotteryNum, productUserMaxNum);
|
|
int actualLotteryNumToGrant = calculateActualGrant(hasLimit, userLotteryCount, requestedLotteryNum, productUserMaxNum);
|
|
|
|
|
|
|
|
if (actualLotteryNumToGrant > 0) {
|
|
if (actualLotteryNumToGrant > 0) {
|
|
|
- saveLotteryLog(user, activityId, actualLotteryNumToGrant, 3);
|
|
|
|
|
|
|
+ saveLotteryLog(user, activityId, activityUrl, actualLotteryNumToGrant, 3);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -1588,7 +1590,7 @@ public class TOrderServiceImpl extends ServiceImpl<TOrderMapper, TOrder> impleme
|
|
|
/**
|
|
/**
|
|
|
* 统一保存抽奖次数日志
|
|
* 统一保存抽奖次数日志
|
|
|
*/
|
|
*/
|
|
|
- private void saveLotteryLog(TWxUser user, String activityId, Integer lotteryNum, Integer activityType) {
|
|
|
|
|
|
|
+ private void saveLotteryLog(TWxUser user, String activityId, String activityUrl, Integer lotteryNum, Integer activityType) {
|
|
|
LotteryCountLog log = new LotteryCountLog();
|
|
LotteryCountLog log = new LotteryCountLog();
|
|
|
log.setOpenId(user.getcOpenid());
|
|
log.setOpenId(user.getcOpenid());
|
|
|
log.setUserId(user.getId());
|
|
log.setUserId(user.getId());
|
|
@@ -1601,15 +1603,17 @@ public class TOrderServiceImpl extends ServiceImpl<TOrderMapper, TOrder> impleme
|
|
|
log.setStatus(0); // 未同步
|
|
log.setStatus(0); // 未同步
|
|
|
log.setIsLottery(0);
|
|
log.setIsLottery(0);
|
|
|
log.setType(1);
|
|
log.setType(1);
|
|
|
|
|
+ log.setActivityUrl(activityUrl);
|
|
|
lotteryCountLogService.save(log);
|
|
lotteryCountLogService.save(log);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 根据已有次数、请求发放次数和最大次数限制,计算实际可发放的次数
|
|
* 根据已有次数、请求发放次数和最大次数限制,计算实际可发放的次数
|
|
|
- * @param hasLimit 是否有限制
|
|
|
|
|
- * @param currentCount 当前已获得次数
|
|
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param hasLimit 是否有限制
|
|
|
|
|
+ * @param currentCount 当前已获得次数
|
|
|
* @param requestedCount 请求发放次数
|
|
* @param requestedCount 请求发放次数
|
|
|
- * @param maxCount 最大次数限制
|
|
|
|
|
|
|
+ * @param maxCount 最大次数限制
|
|
|
* @return 实际可发放次数
|
|
* @return 实际可发放次数
|
|
|
*/
|
|
*/
|
|
|
private int calculateActualGrant(boolean hasLimit, Integer currentCount, Integer requestedCount, Integer maxCount) {
|
|
private int calculateActualGrant(boolean hasLimit, Integer currentCount, Integer requestedCount, Integer maxCount) {
|