...
|
...
|
@@ -122,37 +122,40 @@ public class TencentMktServiceImpl implements ITencentMktService { |
|
|
log.warn("call sendSms. user is exist. and have get coupon. area={}, mobile={}, activityCode={}", area, mobile, activityCode);
|
|
|
return new ApiResponse(503, "您已经领取过了!");
|
|
|
}
|
|
|
|
|
|
// 只有未注册过的用户 才可以领取优惠券
|
|
|
if (activity.getUserNotOrder() == null || activity.getUserNotOrder() == 0) {
|
|
|
|
|
|
// 配置了弹框 则走弹框的流程
|
|
|
if (StringUtils.isNotBlank(activity.getOldUserPopupContent())
|
|
|
&& StringUtils.isNotBlank(activity.getOldUserButtonName())
|
|
|
&& StringUtils.isNotBlank(activity.getOldUserButtonLink())){
|
|
|
log.warn("olderUserConfig exist. user is exist. area={}, mobile={}, activityCode={}", area, mobile, activityCode);
|
|
|
return new ApiResponse(505, "弹框显示错误消息!");
|
|
|
}
|
|
|
|
|
|
//配置不允许老用户领取
|
|
|
log.warn("call getUserprofileByEmailOrMobile. user is exist. area={}, mobile={}, activityCode={}", area, mobile, activityCode);
|
|
|
return new ApiResponse(502, "仅限新用户领取哦!");
|
|
|
}
|
|
|
|
|
|
//判断是否购买过
|
|
|
CountBO count = userServiceHelper.getOrderCountByUid(result.getUid());
|
|
|
if (count.getCount() > 0) {
|
|
|
//如果运营配置了老用户可以领,那就不用校验新客了
|
|
|
if (!(activity.getOldUser() != null && activity.getOldUser() == 1)) {
|
|
|
// 只有未注册过的用户 才可以领取优惠券
|
|
|
if (activity.getUserNotOrder() == null || activity.getUserNotOrder() == 0) {
|
|
|
|
|
|
// 配置了弹框 则走弹框的流程
|
|
|
if (StringUtils.isNotBlank(activity.getOldUserPopupContent())
|
|
|
&& StringUtils.isNotBlank(activity.getOldUserButtonName())
|
|
|
&& StringUtils.isNotBlank(activity.getOldUserButtonLink())) {
|
|
|
log.warn("olderUserConfig exist. user is exist. area={}, mobile={}, activityCode={}", area, mobile, activityCode);
|
|
|
return new ApiResponse(505, "弹框显示错误消息!");
|
|
|
}
|
|
|
|
|
|
// 配置了弹框 则走弹框的流程
|
|
|
if (StringUtils.isNotBlank(activity.getOldUserPopupContent())
|
|
|
&& StringUtils.isNotBlank(activity.getOldUserButtonName())
|
|
|
&& StringUtils.isNotBlank(activity.getOldUserButtonLink())){
|
|
|
log.warn("olderUserConfig exist. user is exist. area={}, mobile={}, activityCode={}", area, mobile, activityCode);
|
|
|
return new ApiResponse(505, "弹框显示错误消息!");
|
|
|
//配置不允许老用户领取
|
|
|
log.warn("call getUserprofileByEmailOrMobile. user is exist. area={}, mobile={}, activityCode={}", area, mobile, activityCode);
|
|
|
return new ApiResponse(502, "仅限新用户领取哦!");
|
|
|
}
|
|
|
|
|
|
log.warn("user have order list. area={}, mobile={}, activityCode={}, uid={}", area, mobile, activityCode, result.getUid());
|
|
|
return new ApiResponse(504, "仅限新用户领取哦!");
|
|
|
//判断是否购买过
|
|
|
CountBO count = userServiceHelper.getOrderCountByUid(result.getUid());
|
|
|
if (count.getCount() > 0) {
|
|
|
|
|
|
// 配置了弹框 则走弹框的流程
|
|
|
if (StringUtils.isNotBlank(activity.getOldUserPopupContent())
|
|
|
&& StringUtils.isNotBlank(activity.getOldUserButtonName())
|
|
|
&& StringUtils.isNotBlank(activity.getOldUserButtonLink())) {
|
|
|
log.warn("olderUserConfig exist. user is exist. area={}, mobile={}, activityCode={}", area, mobile, activityCode);
|
|
|
return new ApiResponse(505, "弹框显示错误消息!");
|
|
|
}
|
|
|
|
|
|
log.warn("user have order list. area={}, mobile={}, activityCode={}, uid={}", area, mobile, activityCode, result.getUid());
|
|
|
return new ApiResponse(504, "仅限新用户领取哦!");
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
...
|
...
|
@@ -189,11 +192,13 @@ public class TencentMktServiceImpl implements ITencentMktService { |
|
|
|
|
|
// 判断用户是否已经注册过,如果未注册,则调用注册接口
|
|
|
// 老用户则直接返回
|
|
|
response = register(area, mobile, "web");
|
|
|
|
|
|
//已注册的用户,再去判断是否是未购买的用户
|
|
|
//看一下这个活动是否设置了老用户也可以领取
|
|
|
//根据活动id,获取活动详情
|
|
|
TencentMktActivityBO bo = getActivityInfoByUnionType(activityCode);
|
|
|
response = register(area, mobile, "web",bo);
|
|
|
|
|
|
//已注册的用户,再去判断是否是未购买的用户
|
|
|
|
|
|
if (!checkUser(response, bo)) {
|
|
|
log.warn("validCodeAndSendCode error register error with code={}, area={}, mobile={}, activityCode={}", code, area, mobile, activityCode);
|
|
|
return response;
|
...
|
...
|
@@ -426,7 +431,7 @@ public class TencentMktServiceImpl implements ITencentMktService { |
|
|
|
|
|
|
|
|
@Override
|
|
|
public ApiResponse register(String area, String mobile, String client_type) throws ServiceException {
|
|
|
public ApiResponse register(String area, String mobile, String client_type,TencentMktActivityBO tencentMktActivityBO) throws ServiceException {
|
|
|
|
|
|
log.debug("register with area={}, mobile={},client_type={}", area, mobile, client_type);
|
|
|
|
...
|
...
|
@@ -476,11 +481,13 @@ public class TencentMktServiceImpl implements ITencentMktService { |
|
|
|
|
|
json.put("uid", model.getUid());
|
|
|
}
|
|
|
// 3.已注册用户,则返回,提示该用户已经注册过了
|
|
|
// 3.已注册用户,则返回,提示该用户已经注册过了--如果运营设置了,老用户也可以领,就让他领取
|
|
|
else {
|
|
|
log.warn("call getUserprofileByEmailOrMobile. result={}", result);
|
|
|
json.put("uid", result.getUid());
|
|
|
return new ApiResponse(502, "该用户已经注册过了", json);
|
|
|
if(!(tencentMktActivityBO.getOldUser()!=null &&tencentMktActivityBO.getOldUser()==1)){
|
|
|
return new ApiResponse(502, "该用户已经注册过了", json);
|
|
|
}
|
|
|
}
|
|
|
return new ApiResponse(json);
|
|
|
}
|
...
|
...
|
|