...
|
...
|
@@ -22,7 +22,9 @@ import com.yoho.unions.convert.TencentMktActivityConvert; |
|
|
import com.yoho.unions.dal.IMktMarketingUrlDAO;
|
|
|
import com.yoho.unions.dal.ITencentMktActivityDAO;
|
|
|
import com.yoho.unions.dal.ITencentMktCouponHistoryDAO;
|
|
|
import com.yoho.unions.dal.MktUnionCodeMapper;
|
|
|
import com.yoho.unions.dal.model.MktMarketingUrl;
|
|
|
import com.yoho.unions.dal.model.MktUnionCode;
|
|
|
import com.yoho.unions.dal.model.TencentMktActivity;
|
|
|
import com.yoho.unions.dal.model.TencentMktCouponHistory;
|
|
|
import com.yoho.unions.helper.*;
|
...
|
...
|
@@ -34,6 +36,7 @@ import org.apache.commons.collections.CollectionUtils; |
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import javax.annotation.Resource;
|
...
|
...
|
@@ -84,6 +87,9 @@ public class TencentMktServiceImpl implements ITencentMktService { |
|
|
|
|
|
@Resource
|
|
|
UserServiceHelper userServiceHelper;
|
|
|
|
|
|
@Autowired
|
|
|
MktUnionCodeMapper mktUnionCodeMapper;
|
|
|
|
|
|
@Resource
|
|
|
ITencentMktCouponHistoryDAO tencentMktCouponHistoryMapper;
|
...
|
...
|
@@ -91,7 +97,7 @@ public class TencentMktServiceImpl implements ITencentMktService { |
|
|
public static final String TENCENT_MKT__ACTIVITY_CACHEKEY = "yh:activity:tencentmkt:";
|
|
|
|
|
|
@Override
|
|
|
public ApiResponse sendSms(String area, String mobile, String activityCode) throws ServiceException {
|
|
|
public ApiResponse sendSms(String area, String mobile, String activityCode,String code) throws ServiceException {
|
|
|
log.info("sendSms with area={}, mobile={}, activityCode={}", area, mobile, activityCode);
|
|
|
// 检查参数
|
|
|
if (StringUtils.isEmpty(mobile)) {
|
...
|
...
|
@@ -104,6 +110,20 @@ public class TencentMktServiceImpl implements ITencentMktService { |
|
|
return new ApiResponse(503, "手机号码格式不对");
|
|
|
}
|
|
|
|
|
|
//新的活动链接,必须要带校验code
|
|
|
if(Long.valueOf(activityCode)>100000000008371L){
|
|
|
if(StringUtils.isEmpty(code)){
|
|
|
log.warn("call getUserprofileByEmailOrMobile. code is null");
|
|
|
return new ApiResponse(506, "校验失败");
|
|
|
}
|
|
|
//验证union_type和code能不能对应
|
|
|
MktUnionCode mktUnionCode =mktUnionCodeMapper.selectByCode(code);
|
|
|
if (null==mktUnionCode||!activityCode.equals(String.valueOf(mktUnionCode.getUnionType()))){
|
|
|
log.warn("call getUserprofileByEmailOrMobile. check error");
|
|
|
return new ApiResponse(506, "校验失败");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
// 验证新老用户
|
|
|
ProfileRequestBO bo = new ProfileRequestBO();
|
|
|
bo.setMobile(mobile);
|
...
|
...
|
@@ -180,8 +200,8 @@ public class TencentMktServiceImpl implements ITencentMktService { |
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public ApiResponse validCodeAndSendCode(String code, String area, String mobile, String client_id, String activityCode) throws ServiceException {
|
|
|
log.debug("validRegCodeAndSendCode with code={}, area={}, mobile={}, activityCode={}", code, area, mobile, activityCode);
|
|
|
public ApiResponse validCodeAndSendCode(String code, String area, String mobile, String client_id, String activityCode,String checkCode) throws ServiceException {
|
|
|
log.debug("validRegCodeAndSendCode with code={}, area={}, mobile={}, activityCode={},checkCode={}", code, area, mobile, activityCode,checkCode);
|
|
|
|
|
|
// 验证验证码
|
|
|
ApiResponse response = validRegCode(code, area, mobile);
|
...
|
...
|
@@ -191,6 +211,20 @@ public class TencentMktServiceImpl implements ITencentMktService { |
|
|
return response;
|
|
|
}
|
|
|
|
|
|
if(Long.valueOf(activityCode)>100000000008371L){
|
|
|
if(StringUtils.isEmpty(code)){
|
|
|
log.warn("call getUserprofileByEmailOrMobile. code is null");
|
|
|
return new ApiResponse(506, "校验失败");
|
|
|
}
|
|
|
//验证union_type和code能不能对应
|
|
|
MktUnionCode mktUnionCode =mktUnionCodeMapper.selectByCode(checkCode);
|
|
|
if (null==mktUnionCode||!activityCode.equals(String.valueOf(mktUnionCode.getUnionType()))){
|
|
|
log.warn("call getUserprofileByEmailOrMobile. check error");
|
|
|
return new ApiResponse(505, "校验失败");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
// 判断用户是否已经注册过,如果未注册,则调用注册接口
|
|
|
// 老用户则直接返回
|
|
|
//看一下这个活动是否设置了老用户也可以领取
|
...
|
...
|
|