...
|
...
|
@@ -13,30 +13,32 @@ import org.slf4j.LoggerFactory; |
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.yoho.activity.common.ApiResponse;
|
|
|
import com.yoho.activity.common.bo.OrderShareActivityBO;
|
|
|
import com.yoho.activity.common.bo.OrderShareBO;
|
|
|
import com.yoho.activity.common.constatns.Constant;
|
|
|
import com.yoho.activity.common.convert.OrderShareActivityConvert;
|
|
|
import com.yoho.activity.common.helper.SendSMSHelper;
|
|
|
import com.yoho.activity.common.utils.DateUtils;
|
|
|
import com.yoho.activity.common.utils.RandomUtil;
|
|
|
import com.yoho.activity.service.ICouponActivityService;
|
|
|
import com.yoho.activity.service.IOrderShareActivityService;
|
|
|
import com.yoho.core.rest.client.ServiceCaller;
|
|
|
import com.yoho.core.rest.exception.ServiceNotAvaibleException;
|
|
|
import com.yoho.core.rest.exception.ServiceNotFoundException;
|
|
|
import com.yoho.coupon.dal.IOrderShareActivityDAO;
|
|
|
import com.yoho.coupon.dal.IOrderShareCouponDAO;
|
|
|
import com.yoho.coupon.dal.IUserCouponHistoryDAO;
|
|
|
import com.yoho.coupon.dal.IUserShareHistoryDAO;
|
|
|
import com.yoho.coupon.dal.model.OrderShareActivity;
|
|
|
import com.yoho.coupon.dal.model.OrderShareCoupon;
|
|
|
import com.yoho.coupon.dal.model.UserCouponHistory;
|
|
|
import com.yoho.coupon.dal.model.UserShareHistory;
|
|
|
import com.yoho.coupon.dal.model.UserShareHistoryRequest;
|
|
|
import com.yoho.error.exception.ServiceException;
|
|
|
import com.yoho.service.model.activity.drawline.response.DrawOrderShareCouponRespBO;
|
|
|
import com.yoho.service.model.promotion.CouponForm;
|
|
|
import com.yoho.service.model.request.ProfileRequestBO;
|
|
|
import com.yoho.service.model.request.RegisterReqBO;
|
|
|
import com.yoho.service.model.response.ProfileInfoRsp;
|
|
|
import com.yoho.service.model.response.RegisterRspBO;
|
|
|
|
|
|
@Service
|
|
|
public class OrderShareActivityServiceImpl implements IOrderShareActivityService {
|
...
|
...
|
@@ -44,13 +46,13 @@ public class OrderShareActivityServiceImpl implements IOrderShareActivityService |
|
|
static Logger log = LoggerFactory.getLogger(OrderShareActivityServiceImpl.class);
|
|
|
@Resource
|
|
|
private IOrderShareActivityDAO orderShareActivityDAO;
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
private IUserShareHistoryDAO userShareHistoryDAO;
|
|
|
|
|
|
@Resource
|
|
|
private IUserCouponHistoryDAO userCouponHistoryDAO;
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
ICouponActivityService couponActivityService;
|
|
|
|
...
|
...
|
@@ -63,10 +65,16 @@ public class OrderShareActivityServiceImpl implements IOrderShareActivityService |
|
|
// 老用户领券限制
|
|
|
@Value("${orderShare.recevied.maxNum}")
|
|
|
private int orderShareOldUserLimit;
|
|
|
|
|
|
|
|
|
@Value("${orderShare.shareUrl}")
|
|
|
private String shareUrl;
|
|
|
|
|
|
@Resource
|
|
|
IOrderShareCouponDAO orderShareCouponDAO;
|
|
|
|
|
|
@Resource
|
|
|
SendSMSHelper sendSMSHelper;
|
|
|
|
|
|
@Override
|
|
|
public OrderShareActivityBO getActivityInfoById() {
|
|
|
OrderShareActivity db = orderShareActivityDAO.selectOne();
|
...
|
...
|
@@ -79,13 +87,13 @@ public class OrderShareActivityServiceImpl implements IOrderShareActivityService |
|
|
@Override
|
|
|
public OrderShareBO getShareInfo(String ordercode, int uid) {
|
|
|
|
|
|
log.info("getShareInfo params is ordercode={},uid={}",ordercode,uid);
|
|
|
log.info("getShareInfo params is ordercode={},uid={}", ordercode, uid);
|
|
|
// 1、查询此活动
|
|
|
OrderShareBO bo = new OrderShareBO();
|
|
|
OrderShareActivity activitydb = orderShareActivityDAO.selectOne();
|
|
|
if (activitydb == null) {
|
|
|
// 活动不存在
|
|
|
log.warn("there is not activity,params is ordercode={},uid={},flag=2",ordercode,uid);
|
|
|
log.warn("there is not activity,params is ordercode={},uid={},flag=2", ordercode, uid);
|
|
|
bo.setFlag(2);
|
|
|
return bo;
|
|
|
}
|
...
|
...
|
@@ -94,13 +102,13 @@ public class OrderShareActivityServiceImpl implements IOrderShareActivityService |
|
|
int nowtime = DateUtils.getCurrentTimeSecond();
|
|
|
if (activitydb.getEndTime() < nowtime) {
|
|
|
// 活动已结束
|
|
|
log.warn("activity is over ,params is ordercode={},uid={},flag=3",ordercode,uid);
|
|
|
log.warn("activity is over ,params is ordercode={},uid={},flag=3", ordercode, uid);
|
|
|
bo.setFlag(3);
|
|
|
return bo;
|
|
|
}
|
|
|
if (activitydb.getBeginTime() > nowtime) {
|
|
|
// 活动未开始
|
|
|
log.warn("activity could not started ,params is ordercode={},uid={},flag=4",ordercode,uid);
|
|
|
log.warn("activity could not started ,params is ordercode={},uid={},flag=4", ordercode, uid);
|
|
|
bo.setFlag(4);
|
|
|
return bo;
|
|
|
}
|
...
|
...
|
@@ -147,32 +155,32 @@ public class OrderShareActivityServiceImpl implements IOrderShareActivityService |
|
|
newrecord.setNewUserNum(0);
|
|
|
newrecord.setOldUserNum(0);
|
|
|
userShareHistoryDAO.insert(newrecord);
|
|
|
log.info("getShareInfo,insert userShareHistory,params is {}",newrecord);
|
|
|
log.info("getShareInfo,insert userShareHistory,params is {}", newrecord);
|
|
|
} else {
|
|
|
// 已达到分享最大数
|
|
|
log.warn("share has been finished ,params is ordercode={},uid={},flag=5",ordercode,uid);
|
|
|
log.warn("share has been finished ,params is ordercode={},uid={},flag=5", ordercode, uid);
|
|
|
bo.setFlag(5);
|
|
|
return bo;
|
|
|
}
|
|
|
}
|
|
|
bo = OrderShareActivityConvert.db2boResponse(activitydb);
|
|
|
bo.setFlag(1);
|
|
|
bo.setShareUrl(shareUrl+"?ordercode="+ordercode+"&uid="+uid);
|
|
|
log.info("getShareInfo result is {}",bo);
|
|
|
bo.setShareUrl(shareUrl + "?ordercode=" + ordercode + "&uid=" + uid);
|
|
|
log.info("getShareInfo result is {}", bo);
|
|
|
return bo;
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 记录领券接口
|
|
|
*
|
|
|
* @param activityId
|
|
|
* @param uid
|
|
|
* @param orderCode
|
|
|
* @param couponId
|
|
|
* @param userType
|
|
|
*/
|
|
|
private void addCouponHistory(int activityId, int uid, String orderCode,String couponId, int userType){
|
|
|
log.info("start addCouponHistory with activityId is {}, uid is {}, orderCode is {}, couponId is {}, userType is {}",activityId,uid,orderCode,couponId, userType);
|
|
|
* @param userType
|
|
|
*/
|
|
|
private void addCouponHistory(int activityId, int uid, String orderCode, String couponId, int userType) {
|
|
|
log.info("start addCouponHistory with activityId is {}, uid is {}, orderCode is {}, couponId is {}, userType is {}", activityId, uid, orderCode, couponId, userType);
|
|
|
UserCouponHistory couponHistory = new UserCouponHistory();
|
|
|
couponHistory.setActivityId(activityId);
|
|
|
couponHistory.setCouponId(couponId);
|
...
|
...
|
@@ -185,28 +193,30 @@ public class OrderShareActivityServiceImpl implements IOrderShareActivityService |
|
|
|
|
|
/**
|
|
|
* 更新用户领取记录
|
|
|
*
|
|
|
* @param id
|
|
|
* @param userType
|
|
|
*/
|
|
|
private void updateShareHistory(int id, int userType){
|
|
|
log.info("start with updateShareHistory. id is {}, userType is {}",id , userType);
|
|
|
*/
|
|
|
private void updateShareHistory(int id, int userType) {
|
|
|
log.info("start with updateShareHistory. id is {}, userType is {}", id, userType);
|
|
|
userShareHistoryDAO.updateShareHistoryNum(id, userType);
|
|
|
log.info("end with updateShareHistory.");
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 发送优惠券
|
|
|
* 发送优惠券
|
|
|
*
|
|
|
* @param couponId
|
|
|
* @param uid
|
|
|
*/
|
|
|
private String sendCoupon(String couponId, String uid){
|
|
|
log.info("start with sendCoupon. couponId is {}, uid is {}",couponId , uid);
|
|
|
*/
|
|
|
private String sendCoupon(String couponId, String uid) {
|
|
|
log.info("start with sendCoupon. couponId is {}, uid is {}", couponId, uid);
|
|
|
CouponForm form = new CouponForm();
|
|
|
form.setCouponId(couponId);
|
|
|
form.setUid(uid);
|
|
|
String couponCode = "";
|
|
|
try {
|
|
|
couponCode = serviceCaller.call("promotion.sendCoupon",form,String.class);
|
|
|
couponCode = serviceCaller.call("promotion.sendCoupon", form, String.class);
|
|
|
} catch (Exception e) {
|
|
|
log.error("sendCoupon failed, ex: {}", e.getMessage());
|
|
|
}
|
...
|
...
|
@@ -214,78 +224,77 @@ public class OrderShareActivityServiceImpl implements IOrderShareActivityService |
|
|
return couponCode;
|
|
|
}
|
|
|
|
|
|
|
|
|
@Override
|
|
|
public DrawOrderShareCouponRespBO drawOrderShareCoupon(String mobile, long orderCode) {
|
|
|
|
|
|
|
|
|
DrawOrderShareCouponRespBO respBO = new DrawOrderShareCouponRespBO(mobile, orderCode);
|
|
|
//1、简单验证手机号
|
|
|
if(!validMobile(mobile)) {
|
|
|
// 1、简单验证手机号
|
|
|
if (!validMobile(mobile)) {
|
|
|
respBO.setReturnCode(Constant.ORDER_SHARE_MOBILE_ERROR);
|
|
|
respBO.setReturnMsg("手机号错误,请重新输入");
|
|
|
log.warn("mobile is invalid: {}", mobile);
|
|
|
return respBO;
|
|
|
}
|
|
|
|
|
|
//2、检查活动是否结束
|
|
|
|
|
|
// 2、检查活动是否结束
|
|
|
OrderShareActivityBO activityInfo = getActivityInfoById();
|
|
|
if(activityInfo == null || isAcitvityExpire(activityInfo)) {
|
|
|
if (activityInfo == null || isAcitvityExpire(activityInfo)) {
|
|
|
respBO.setReturnCode(Constant.ORDER_SHARE_ACTIVITY_EXPIRE);
|
|
|
respBO.setReturnMsg("活动已经过期");
|
|
|
log.warn("the acitivity is out of date, mobile: {}, activity: {}", mobile, activityInfo.getId());
|
|
|
return respBO;
|
|
|
}
|
|
|
|
|
|
//3、检查手机号是否注册过
|
|
|
}
|
|
|
|
|
|
// 3、检查手机号是否注册过
|
|
|
ProfileInfoRsp profileInfo = getRegisterUser(mobile);
|
|
|
if (profileInfo == null || profileInfo.getUid() == 0) {
|
|
|
// 新用户,发送验证码
|
|
|
couponActivityService.sendSms("86", mobile);
|
|
|
respBO.setReturnCode(Constant.ORDER_SHARE_USER_UNREGISTER);
|
|
|
respBO.setReturnMsg("该手机号没有注册,已发送注册验证码");
|
|
|
log.warn("unregister mobile: {}, sendSms for register", mobile);
|
|
|
return respBO;
|
|
|
}
|
|
|
|
|
|
//4、判断老用户是否达到分享限制
|
|
|
if(isUpToOrderShareLimit(orderCode, activityInfo.getId())) {
|
|
|
|
|
|
// 4、判断老用户是否达到分享限制
|
|
|
if (isUpToOrderShareLimit(orderCode, activityInfo.getId())) {
|
|
|
respBO.setReturnCode(Constant.ORDER_SHARE_OLDUSER_UPLIMIT);
|
|
|
respBO.setReturnMsg("优惠券已抢光");
|
|
|
log.warn("orderShare for Register user is over, orderCode: {}, activityId: {}", orderCode, activityInfo.getId());
|
|
|
return respBO;
|
|
|
}
|
|
|
|
|
|
|
|
|
// 发送优惠券
|
|
|
String couponCode = sendCoupon(activityInfo.getRegistCouponId(), String.valueOf(profileInfo.getUid()));
|
|
|
if(StringUtils.isEmpty(couponCode))
|
|
|
{
|
|
|
// 获取老人优惠券
|
|
|
OrderShareCoupon coupon = orderShareCouponDAO.selectCouponByDateAndType(DateUtils.getToday("yyyy-MM-dd"), 1);
|
|
|
String couponCode = sendCoupon(coupon.getCouponId(), String.valueOf(profileInfo.getUid()));
|
|
|
if (StringUtils.isEmpty(couponCode)) {
|
|
|
respBO.setReturnCode(Constant.ORDER_SHARE_SENDCOUPON_ERROR);
|
|
|
respBO.setReturnMsg("优惠券已发光");
|
|
|
log.error("orderShare sendCoupon failed, uid: {}, couponId: {}", activityInfo.getUnregistCouponId(), profileInfo.getUid());
|
|
|
log.error("orderShare sendCoupon failed, uid: {}, couponId: {}", profileInfo.getUid(), coupon.getCouponId());
|
|
|
return respBO;
|
|
|
}
|
|
|
|
|
|
//4、记录用户领券的记录
|
|
|
|
|
|
// 4、记录用户领券的记录
|
|
|
respBO.setCoupon(couponCode);
|
|
|
updateOrderShareRecord(activityInfo.getId(), profileInfo.getUid(), orderCode, activityInfo.getRegistCouponId(), 1);
|
|
|
|
|
|
updateOrderShareRecord(activityInfo.getId(), profileInfo.getUid(), orderCode, coupon.getCouponId(), 1);
|
|
|
|
|
|
return respBO;
|
|
|
}
|
|
|
|
|
|
|
|
|
@Override
|
|
|
public DrawOrderShareCouponRespBO registerAndSendCoupon(String mobile,
|
|
|
long orderCode, String identifyCode) {
|
|
|
public DrawOrderShareCouponRespBO registerAndSendCoupon(String mobile, long orderCode, String identifyCode) {
|
|
|
DrawOrderShareCouponRespBO respBO = new DrawOrderShareCouponRespBO(mobile, orderCode);
|
|
|
|
|
|
//1、检查活动是否结束
|
|
|
|
|
|
// 1、检查活动是否结束
|
|
|
OrderShareActivityBO activityInfo = getActivityInfoById();
|
|
|
if(activityInfo == null) {
|
|
|
if (activityInfo == null || isAcitvityExpire(activityInfo)) {
|
|
|
respBO.setReturnCode(Constant.ORDER_SHARE_ACTIVITY_EXPIRE);
|
|
|
respBO.setReturnMsg("活动已经过期");
|
|
|
log.warn("the acitivity not exists, activity: {}", activityInfo.getId());
|
|
|
return respBO;
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
// 1、验证验证码
|
|
|
ApiResponse identityResp = couponActivityService.validRegCode(identifyCode, "86", mobile);
|
|
|
if (Constant.CODE_SUCCESS != identityResp.getCode()) {
|
...
|
...
|
@@ -294,97 +303,111 @@ public class OrderShareActivityServiceImpl implements IOrderShareActivityService |
|
|
log.error("valid register code error, code: {}, mobile: {}", identifyCode, mobile);
|
|
|
return respBO;
|
|
|
}
|
|
|
|
|
|
|
|
|
// 2、用户注册
|
|
|
ApiResponse registerResp = couponActivityService.register("86", mobile, "web");
|
|
|
if (Constant.CODE_SUCCESS != registerResp.getCode()) {
|
|
|
|
|
|
RegisterReqBO registerReqBO = new RegisterReqBO();
|
|
|
registerReqBO.setArea("86");
|
|
|
registerReqBO.setProfile(mobile);
|
|
|
registerReqBO.setPassword(RandomUtil.getCharAndNumr(6, 2));
|
|
|
registerReqBO.setClient_type("h5");
|
|
|
RegisterRspBO model = null;
|
|
|
try {
|
|
|
model = serviceCaller.call("users.register", registerReqBO, RegisterRspBO.class);
|
|
|
log.info("call register result is {}", model);
|
|
|
} catch (Exception e) {
|
|
|
respBO.setReturnCode(Constant.ORDER_SHARE_REGISTER_ERROR);
|
|
|
respBO.setReturnMsg("用户注册失败");
|
|
|
log.error("user register error, mobile: {}", mobile);
|
|
|
return respBO;
|
|
|
}
|
|
|
|
|
|
JSONObject registerJSON = (JSONObject) registerResp.getData();
|
|
|
int uid = registerJSON.getIntValue("uid");
|
|
|
String password = registerJSON.getString("password");
|
|
|
|
|
|
//3、发送优惠券
|
|
|
String couponCode = sendCoupon(activityInfo.getUnregistCouponId(), String.valueOf(uid));
|
|
|
if(StringUtils.isEmpty(couponCode))
|
|
|
{
|
|
|
|
|
|
// 3、发送优惠券
|
|
|
// 获取新人优惠券
|
|
|
OrderShareCoupon coupon = orderShareCouponDAO.selectCouponByDateAndType(null, 0);
|
|
|
String couponCode = sendCoupon(coupon.getCouponId(), String.valueOf(model.getUid()));
|
|
|
if (StringUtils.isEmpty(couponCode)) {
|
|
|
respBO.setReturnCode(Constant.ORDER_SHARE_SENDCOUPON_ERROR);
|
|
|
respBO.setReturnMsg("优惠券已发光");
|
|
|
log.error("orderShare sendCoupon failed, uid: {}, couponId: {}", activityInfo.getUnregistCouponId(), uid);
|
|
|
log.error("orderShare sendCoupon failed, uid: {}, couponId: {}", coupon.getCouponId(), model.getUid());
|
|
|
return respBO;
|
|
|
}
|
|
|
//4、记录用户领券的记录
|
|
|
// 4、记录用户领券的记录
|
|
|
respBO.setCoupon(couponCode);
|
|
|
updateOrderShareRecord(activityInfo.getId(), uid, orderCode, activityInfo.getUnregistCouponId(), 0);
|
|
|
updateOrderShareRecord(activityInfo.getId(), model.getUid(), orderCode, coupon.getCouponId(), 0);
|
|
|
|
|
|
//发送短信
|
|
|
sendSMSHelper.sendNoticeSms(mobile, "【Yoho!Buy有货】恭喜您获得一张"+ coupon.getCouponName() +",您的登录账户是"+ mobile +",密码是"+ registerReqBO.getPassword() +";下载Yoho!Buy有货手机端http://a.app.qq.com/o/simple.jsp?pkgname=com.yoho,更多惊喜等着您!");
|
|
|
|
|
|
return respBO;
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 简单验证是否是11位手机号
|
|
|
*
|
|
|
* @param mobile
|
|
|
* @return
|
|
|
*/
|
|
|
private boolean validMobile(String mobile) {
|
|
|
if(mobile == null)
|
|
|
if (mobile == null)
|
|
|
return false;
|
|
|
|
|
|
if(mobile.length() != 11)
|
|
|
|
|
|
if (mobile.length() != 11)
|
|
|
return false;
|
|
|
|
|
|
|
|
|
return StringUtils.isNumeric(mobile);
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 根据手机号查注册用户
|
|
|
*
|
|
|
* @param mobile
|
|
|
* @return
|
|
|
*/
|
|
|
private ProfileInfoRsp getRegisterUser(String mobile) {
|
|
|
log.info("query register user by mobile: {}", mobile);
|
|
|
|
|
|
|
|
|
ProfileRequestBO reqBO = new ProfileRequestBO();
|
|
|
reqBO.setMobile(mobile);
|
|
|
reqBO.setArea("86");
|
|
|
reqBO.setCheckSSO(true);
|
|
|
|
|
|
|
|
|
ProfileInfoRsp respBO = serviceCaller.call("users.getUserprofileByEmailOrMobile", reqBO, ProfileInfoRsp.class);
|
|
|
log.info("user with mobile {} is: {}", mobile, respBO);
|
|
|
return respBO;
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 查询活动信息
|
|
|
*
|
|
|
* @param activityId
|
|
|
* @return
|
|
|
*/
|
|
|
private OrderShareActivity getActvivity(int activityId) {
|
|
|
log.info("query order share acitvity, activityId: {}", activityId);
|
|
|
//....补充缓存操作
|
|
|
//......
|
|
|
// ....补充缓存操作
|
|
|
// ......
|
|
|
OrderShareActivity activityInfo = orderShareActivityDAO.selectByPrimaryKey(activityId);
|
|
|
return activityInfo;
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 判断活动是否过期
|
|
|
*
|
|
|
* @param activityInfo
|
|
|
* @return
|
|
|
*/
|
|
|
private boolean isAcitvityExpire(OrderShareActivityBO activityInfo) {
|
|
|
if(activityInfo == null) {
|
|
|
if (activityInfo == null) {
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
|
|
|
return activityInfo.getEndTime() * 1000L < (new Date().getTime());
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 根据订单号和活动ID获取分享历史
|
|
|
*
|
|
|
* @param orderCode
|
|
|
* @param activityId
|
|
|
* @return
|
...
|
...
|
@@ -393,35 +416,36 @@ public class OrderShareActivityServiceImpl implements IOrderShareActivityService |
|
|
UserShareHistory shareHistoryInfo = userShareHistoryDAO.selectByOrderAndActivity(String.valueOf(orderCode), activityId);
|
|
|
return shareHistoryInfo;
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 检查老用户是否超出分享次数限制(默认限制5次)
|
|
|
* 检查老用户是否超出领取优惠券限制(默认限制5次)
|
|
|
*
|
|
|
* @param shareHistoryInfo
|
|
|
* @param userType
|
|
|
* @return
|
|
|
*/
|
|
|
private boolean isUpToOrderShareLimit(long orderCode, int activityId) {
|
|
|
UserShareHistory shareHistoryInfo = getShareHistoryByOrderAndActivity(orderCode, activityId);
|
|
|
if(shareHistoryInfo == null) {
|
|
|
if (shareHistoryInfo == null) {
|
|
|
log.error("None order share, orderCode: {}, activityId: {}", orderCode, activityId);
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
if(shareHistoryInfo.getOldUserNum() >= orderShareOldUserLimit) {
|
|
|
|
|
|
if (shareHistoryInfo.getOldUserNum() >= orderShareOldUserLimit) {
|
|
|
log.warn("Up to limit of orderShare for Register user");
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
private void updateOrderShareRecord(int activityId, int uid, long orderCode, String couponId, int userType) {
|
|
|
addCouponHistory(activityId, uid, String.valueOf(orderCode), couponId, userType);
|
|
|
UserShareHistory shareHistoryInfo = getShareHistoryByOrderAndActivity(orderCode, activityId);
|
|
|
if(shareHistoryInfo == null) {
|
|
|
if (shareHistoryInfo == null) {
|
|
|
log.error("None order share, orderCode: {}, activityId: {}", orderCode, activityId);
|
|
|
return;
|
|
|
}
|
|
|
}
|
|
|
updateShareHistory(shareHistoryInfo.getId(), userType);
|
|
|
}
|
|
|
} |
...
|
...
|
|