|
@@ -3,6 +3,7 @@ package com.fs.live.service.impl;
|
|
|
import java.util.Collections;
|
|
import java.util.Collections;
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
import com.fs.common.utils.DateUtils;
|
|
import com.fs.common.utils.DateUtils;
|
|
|
|
|
+import com.fs.common.utils.StringUtils;
|
|
|
import com.fs.live.param.CouponPO;
|
|
import com.fs.live.param.CouponPO;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
@@ -57,9 +58,20 @@ public class LiveCouponUserServiceImpl implements ILiveCouponUserService
|
|
|
public int insertLiveCouponUser(LiveCouponUser liveCouponUser)
|
|
public int insertLiveCouponUser(LiveCouponUser liveCouponUser)
|
|
|
{
|
|
{
|
|
|
liveCouponUser.setCreateTime(DateUtils.getNowDate());
|
|
liveCouponUser.setCreateTime(DateUtils.getNowDate());
|
|
|
|
|
+ // 所有发放入口统一保证核销码落库(完课/观看奖励等历史路径曾漏写)
|
|
|
|
|
+ if (StringUtils.isEmpty(liveCouponUser.getVerifyCode())) {
|
|
|
|
|
+ liveCouponUser.setVerifyCode(generateVerifyCode());
|
|
|
|
|
+ }
|
|
|
return liveCouponUserMapper.insertLiveCouponUser(liveCouponUser);
|
|
return liveCouponUserMapper.insertLiveCouponUser(liveCouponUser);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 生成优惠券核销码(前缀 LC + 时间戳 + 随机数)。
|
|
|
|
|
+ */
|
|
|
|
|
+ private String generateVerifyCode() {
|
|
|
|
|
+ return "LC" + System.currentTimeMillis() + (int) (Math.random() * 1000);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 修改优惠券发放记录
|
|
* 修改优惠券发放记录
|
|
|
*
|
|
*
|