商家注册增加邀请码可选参数
This commit is contained in:
parent
c7a7e041e7
commit
a7f2d2a02c
@ -257,8 +257,9 @@ public class LoginController extends BaseControllerImpl {
|
|||||||
String osType = paramJSON.getStr("os_type");
|
String osType = paramJSON.getStr("os_type");
|
||||||
// 用户类型:0-普通买家; 1-管理员;2-入驻商家;3-代理商;
|
// 用户类型:0-普通买家; 1-管理员;2-入驻商家;3-代理商;
|
||||||
Integer userType = paramJSON.getInt("user_type");
|
Integer userType = paramJSON.getInt("user_type");
|
||||||
|
String inviteCode = paramJSON.getStr("invite_code", "");
|
||||||
|
|
||||||
return accountUserBaseService.doMerchSmsRegisterAndLogin(userMobile, randKey, verifyCode, userType, cid, osType);
|
return accountUserBaseService.doMerchSmsRegisterAndLogin(userMobile, randKey, verifyCode, userType, cid, osType, inviteCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation(value = "微信用户一键登录与注册")
|
@ApiOperation(value = "微信用户一键登录与注册")
|
||||||
@ -294,7 +295,9 @@ public class LoginController extends BaseControllerImpl {
|
|||||||
paramJSON.getStr("rand_key"),
|
paramJSON.getStr("rand_key"),
|
||||||
paramJSON.getStr("verify_code"),
|
paramJSON.getStr("verify_code"),
|
||||||
paramJSON.getInt("user_type"),
|
paramJSON.getInt("user_type"),
|
||||||
paramJSON.getStr("cid"), paramJSON.getStr("os_type"));
|
paramJSON.getStr("cid"),
|
||||||
|
paramJSON.getStr("os_type"),
|
||||||
|
paramJSON.getStr("invite_code"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("退出登录")
|
@ApiOperation("退出登录")
|
||||||
|
|||||||
@ -145,9 +145,10 @@ public interface AccountUserBaseService extends IBaseService<AccountUserBase> {
|
|||||||
* @param userType 用户类型:0-普通买家; 1-管理员;2-入驻商家;3-代理商;
|
* @param userType 用户类型:0-普通买家; 1-管理员;2-入驻商家;3-代理商;
|
||||||
* @param cid 推送 cid
|
* @param cid 推送 cid
|
||||||
* @param osType 手机系统类型 :1-Android;2-iOS;3-微信小程序;
|
* @param osType 手机系统类型 :1-Android;2-iOS;3-微信小程序;
|
||||||
|
* @param inviteCode 代理商邀请码
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
CommonResult doMerchSmsRegisterAndLogin(String user_mobile, String rand_key, String verify_code, Integer userType, String cid, String osType);
|
CommonResult doMerchSmsRegisterAndLogin(String user_mobile, String rand_key, String verify_code, Integer userType, String cid, String osType, String inviteCode);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 微信小程序一键登录注册接口
|
* 微信小程序一键登录注册接口
|
||||||
|
|||||||
@ -87,9 +87,10 @@ public interface AccountUserBindConnectService extends IBaseService<AccountUserB
|
|||||||
* @param bindType
|
* @param bindType
|
||||||
* @param userId
|
* @param userId
|
||||||
* @param userType
|
* @param userType
|
||||||
|
* @param inviteCode
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
AccountUserBindConnect initAccountUserBindConnect(String bindId, Integer bindType, Integer userId, Integer userType);
|
AccountUserBindConnect initAccountUserBindConnect(String bindId, Integer bindType, Integer userId, Integer userType, String inviteCode);
|
||||||
|
|
||||||
List<AccountUserBindConnect> getAllBindPage(String bindTmpl, Integer pageNum, Integer pageSize);
|
List<AccountUserBindConnect> getAllBindPage(String bindTmpl, Integer pageNum, Integer pageSize);
|
||||||
|
|
||||||
@ -105,7 +106,7 @@ public interface AccountUserBindConnectService extends IBaseService<AccountUserB
|
|||||||
*/
|
*/
|
||||||
Integer isMerchantExists(String mobile);
|
Integer isMerchantExists(String mobile);
|
||||||
|
|
||||||
void saveBindCountSendNumber(Integer storeId,String mobile);
|
void saveBindCountSendNumber(Integer storeId, String mobile);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量保存accountUserBindConnect
|
* 批量保存accountUserBindConnect
|
||||||
|
|||||||
@ -1685,6 +1685,7 @@ public class AccountUserBaseServiceImpl extends BaseServiceImpl<AccountUserBaseM
|
|||||||
Integer userType = userIsAdmin; // 用户类型:0-普通买家; 1-管理员;2-入驻商家;3-代理商;
|
Integer userType = userIsAdmin; // 用户类型:0-普通买家; 1-管理员;2-入驻商家;3-代理商;
|
||||||
String user_email = (String) userInfo.get("user_email");
|
String user_email = (String) userInfo.get("user_email");
|
||||||
Integer bind_type = getParameter("bind_type", BindCode.MOBILE);
|
Integer bind_type = getParameter("bind_type", BindCode.MOBILE);
|
||||||
|
String inviteCode = Convert.toStr("invite_code", "");
|
||||||
|
|
||||||
if (StrUtil.isBlank(user_account)) {
|
if (StrUtil.isBlank(user_account)) {
|
||||||
throw new ApiException(_("请输入账号"));
|
throw new ApiException(_("请输入账号"));
|
||||||
@ -1719,7 +1720,6 @@ public class AccountUserBaseServiceImpl extends BaseServiceImpl<AccountUserBaseM
|
|||||||
throw new ApiException(_("账号已存在,请用另一账号名注册!"));
|
throw new ApiException(_("账号已存在,请用另一账号名注册!"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// 有手机参数,优先手机注册
|
// 有手机参数,优先手机注册
|
||||||
if (StrUtil.isNotBlank(user_mobile) && CheckUtil.isMobile(user_mobile, user_intl)) {
|
if (StrUtil.isNotBlank(user_mobile) && CheckUtil.isMobile(user_mobile, user_intl)) {
|
||||||
|
|
||||||
@ -1800,7 +1800,7 @@ public class AccountUserBaseServiceImpl extends BaseServiceImpl<AccountUserBaseM
|
|||||||
if (user_base_row != null) {
|
if (user_base_row != null) {
|
||||||
// 检测到 account_user_base 用户已经存在,是因为账号没有绑定,这时绑定账号即可
|
// 检测到 account_user_base 用户已经存在,是因为账号没有绑定,这时绑定账号即可
|
||||||
// 绑定基本关系
|
// 绑定基本关系
|
||||||
AccountUserBindConnect accountUserBindConnect = accountUserBindConnectService.initAccountUserBindConnect(user_mobile, bind_type, user_base_row.getUser_id(), userIsAdmin);
|
AccountUserBindConnect accountUserBindConnect = accountUserBindConnectService.initAccountUserBindConnect(user_mobile, bind_type, user_base_row.getUser_id(), userIsAdmin, inviteCode);
|
||||||
if (accountUserBindConnect == null) {
|
if (accountUserBindConnect == null) {
|
||||||
throw new ApiException(_("绑定账号失败"));
|
throw new ApiException(_("绑定账号失败"));
|
||||||
}
|
}
|
||||||
@ -1884,7 +1884,7 @@ public class AccountUserBaseServiceImpl extends BaseServiceImpl<AccountUserBaseM
|
|||||||
|
|
||||||
if (addUserBindConnect) {
|
if (addUserBindConnect) {
|
||||||
// 初始化绑用户定关系
|
// 初始化绑用户定关系
|
||||||
AccountUserBindConnect accountUserBindConnect = accountUserBindConnectService.initAccountUserBindConnect(user_mobile, bind_type, user_id, userIsAdmin);
|
AccountUserBindConnect accountUserBindConnect = accountUserBindConnectService.initAccountUserBindConnect(user_mobile, bind_type, user_id, userIsAdmin, inviteCode);
|
||||||
if (accountUserBindConnect == null) {
|
if (accountUserBindConnect == null) {
|
||||||
throw new ApiException(_("绑定账号失败"));
|
throw new ApiException(_("绑定账号失败"));
|
||||||
}
|
}
|
||||||
@ -2962,10 +2962,11 @@ public class AccountUserBaseServiceImpl extends BaseServiceImpl<AccountUserBaseM
|
|||||||
* @param userType 用户类型:0-普通买家; 1-管理员;2-入驻商家;3-代理商;
|
* @param userType 用户类型:0-普通买家; 1-管理员;2-入驻商家;3-代理商;
|
||||||
* @param cid 推送 cid
|
* @param cid 推送 cid
|
||||||
* @param osType 手机系统类型 :1-Android;2-iOS;3-微信小程序;
|
* @param osType 手机系统类型 :1-Android;2-iOS;3-微信小程序;
|
||||||
|
* @param inviteCode 代理商邀请码
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public CommonResult doMerchSmsRegisterAndLogin(String user_mobile, String rand_key, String verify_code, Integer userType, String cid, String osType) {
|
public CommonResult doMerchSmsRegisterAndLogin(String user_mobile, String rand_key, String verify_code, Integer userType, String cid, String osType, String inviteCode) {
|
||||||
// 流程:通过手机号检查是否有绑定关系?没有就直接注册,有就直接登录,返回登录后的所有信息,附加是否已经申请入驻标记?
|
// 流程:通过手机号检查是否有绑定关系?没有就直接注册,有就直接登录,返回登录后的所有信息,附加是否已经申请入驻标记?
|
||||||
// 商家入驻账号,都是需要手机号绑定的。账号组成:1000000+(数字加法)自增ID,密码随机6位数
|
// 商家入驻账号,都是需要手机号绑定的。账号组成:1000000+(数字加法)自增ID,密码随机6位数
|
||||||
if (StrUtil.isBlank(user_mobile) || StrUtil.isBlank(verify_code)) {
|
if (StrUtil.isBlank(user_mobile) || StrUtil.isBlank(verify_code)) {
|
||||||
@ -3000,7 +3001,7 @@ public class AccountUserBaseServiceImpl extends BaseServiceImpl<AccountUserBaseM
|
|||||||
|
|
||||||
// 找出手机对应的绑定用户
|
// 找出手机对应的绑定用户
|
||||||
// 是否为手机号注册,密码6位随机数
|
// 是否为手机号注册,密码6位随机数
|
||||||
return doMobileBindLogin(verifyMobile, userType, cid, osType);
|
return doMobileBindLogin(verifyMobile, userType, cid, osType, inviteCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -3263,13 +3264,14 @@ public class AccountUserBaseServiceImpl extends BaseServiceImpl<AccountUserBaseM
|
|||||||
* (商家版app)入驻商家手机号绑定登录
|
* (商家版app)入驻商家手机号绑定登录
|
||||||
*
|
*
|
||||||
* @param user_mobile 带+86的中国号码
|
* @param user_mobile 带+86的中国号码
|
||||||
* @param userType 用户类型:0-普通用户;1-管理员;2-入驻商户
|
* @param userType 用户类型:0-普通用户;1-管理员;2-入驻商户;3-代理商
|
||||||
* @param cid 推送 cid
|
* @param cid 推送 cid
|
||||||
* @param osType 手机系统类型 :1-Android;2-iOS;3-微信小程序;
|
* @param osType 手机系统类型 :1-Android;2-iOS;3-微信小程序;
|
||||||
|
* @param inviteCode 代理商的邀请码(商家注册时才用);
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public CommonResult doMobileBindLogin(String user_mobile, Integer userType, String cid, String osType) {
|
public CommonResult doMobileBindLogin(String user_mobile, Integer userType, String cid, String osType, String inviteCode) {
|
||||||
return doMobileBindLogin(user_mobile, "", userType, cid, osType);
|
return doMobileBindLogin(user_mobile, "", userType, cid, osType, inviteCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -3282,7 +3284,7 @@ public class AccountUserBaseServiceImpl extends BaseServiceImpl<AccountUserBaseM
|
|||||||
* @param osType
|
* @param osType
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public CommonResult doMobileBindLogin(String user_mobile, String regPwd, Integer userType, String cid, String osType) {
|
public CommonResult doMobileBindLogin(String user_mobile, String regPwd, Integer userType, String cid, String osType, String inviteCode) {
|
||||||
if (StrUtil.isBlank(user_mobile) || userType == null) {
|
if (StrUtil.isBlank(user_mobile) || userType == null) {
|
||||||
return CommonResult.failed("缺少必要参数!");
|
return CommonResult.failed("缺少必要参数!");
|
||||||
}
|
}
|
||||||
@ -3317,6 +3319,7 @@ public class AccountUserBaseServiceImpl extends BaseServiceImpl<AccountUserBaseM
|
|||||||
}
|
}
|
||||||
userInfo.put("user_password", user_password);
|
userInfo.put("user_password", user_password);
|
||||||
userInfo.put("is_admin", userType); // 商家入驻注册
|
userInfo.put("is_admin", userType); // 商家入驻注册
|
||||||
|
userInfo.put("invite_code", StrUtil.isNotBlank(inviteCode) ? inviteCode : ""); // 商家注册代理商的邀请码
|
||||||
|
|
||||||
// 注:注册商家账号,都是需要手机号绑定的。
|
// 注:注册商家账号,都是需要手机号绑定的。
|
||||||
accountUserBase = register(userInfo);
|
accountUserBase = register(userInfo);
|
||||||
@ -3373,7 +3376,7 @@ public class AccountUserBaseServiceImpl extends BaseServiceImpl<AccountUserBaseM
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 4. 执行手机号绑定登录(注册商家账号)
|
// 4. 执行手机号绑定登录(注册商家账号)
|
||||||
CommonResult result = doMobileBindLogin(convertedMobile, regPwd, CommonConstant.USER_TYPE_MCH, null, null);
|
CommonResult result = doMobileBindLogin(convertedMobile, regPwd, CommonConstant.USER_TYPE_MCH, null, null, "");
|
||||||
|
|
||||||
// 5. 检查注册结果
|
// 5. 检查注册结果
|
||||||
if (result == null || result.getCode() != ResultCode.SUCCESS.getCode()) {
|
if (result == null || result.getCode() != ResultCode.SUCCESS.getCode()) {
|
||||||
|
|||||||
@ -38,6 +38,7 @@ import org.springframework.data.redis.core.RedisTemplate;
|
|||||||
import org.springframework.scheduling.annotation.Async;
|
import org.springframework.scheduling.annotation.Async;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
|
|
||||||
@ -441,50 +442,50 @@ public class AccountUserBindConnectServiceImpl extends BaseServiceImpl<AccountUs
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void saveBindCountSendNumber(Integer storeId,String mobile) {
|
public void saveBindCountSendNumber(Integer storeId, String mobile) {
|
||||||
if (storeId == null) {
|
if (storeId == null) {
|
||||||
return ;
|
return;
|
||||||
}
|
}
|
||||||
UserDto userDto= ContextUtil.getCurrentUser();
|
UserDto userDto = ContextUtil.getCurrentUser();
|
||||||
assert userDto != null;
|
assert userDto != null;
|
||||||
Integer userId=userDto.getId();
|
Integer userId = userDto.getId();
|
||||||
|
|
||||||
String mapKey= RedisConstant.SUB_SEND_CACHE+userId;
|
String mapKey = RedisConstant.SUB_SEND_CACHE + userId;
|
||||||
//redisTemplate.opsForHash().increment(RedisConstant.SUB_SEND_CACHE,mapKey, 1);//todo 删除
|
//redisTemplate.opsForHash().increment(RedisConstant.SUB_SEND_CACHE,mapKey, 1);//todo 删除
|
||||||
if(redisTemplate.opsForHash().get(RedisConstant.SUB_SEND_CACHE,mapKey)!=null) {
|
if (redisTemplate.opsForHash().get(RedisConstant.SUB_SEND_CACHE, mapKey) != null) {
|
||||||
Integer integer = (Integer) redisTemplate.opsForHash().get(RedisConstant.SUB_SEND_CACHE, mapKey);
|
Integer integer = (Integer) redisTemplate.opsForHash().get(RedisConstant.SUB_SEND_CACHE, mapKey);
|
||||||
if(integer!=null&& integer >0){
|
if (integer != null && integer > 0) {
|
||||||
if(storeId>0){ //店铺推送订阅
|
if (storeId > 0) { //店铺推送订阅
|
||||||
ShopStoreMember params=new ShopStoreMember();
|
ShopStoreMember params = new ShopStoreMember();
|
||||||
params.setUserId(userId);
|
params.setUserId(userId);
|
||||||
params.setStoreId(storeId);
|
params.setStoreId(storeId);
|
||||||
List<ShopStoreMember> shopStoreMemberList=shopService.findShopStoreMemberList(params);
|
List<ShopStoreMember> shopStoreMemberList = shopService.findShopStoreMemberList(params);
|
||||||
if(shopStoreMemberList!=null&& !shopStoreMemberList.isEmpty()){
|
if (shopStoreMemberList != null && !shopStoreMemberList.isEmpty()) {
|
||||||
ShopStoreMember shopStoreMember= shopStoreMemberList.get(0);
|
ShopStoreMember shopStoreMember = shopStoreMemberList.get(0);
|
||||||
shopStoreMember.setSend_number(shopStoreMember.getSend_number()+1);
|
shopStoreMember.setSend_number(shopStoreMember.getSend_number() + 1);
|
||||||
ShopStoreMember resultShopStoreMember = shopService.saveShopStoreMember(shopStoreMember);
|
ShopStoreMember resultShopStoreMember = shopService.saveShopStoreMember(shopStoreMember);
|
||||||
if(resultShopStoreMember.getStore_member_id()!=null){
|
if (resultShopStoreMember.getStore_member_id() != null) {
|
||||||
redisTemplate.opsForHash().increment(RedisConstant.SUB_SEND_CACHE,mapKey, -1);//店铺扣除一次
|
redisTemplate.opsForHash().increment(RedisConstant.SUB_SEND_CACHE, mapKey, -1);//店铺扣除一次
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}else {//平台推送订阅
|
} else {//平台推送订阅
|
||||||
QueryWrapper<AccountUserBindConnect> queryWrapper = new QueryWrapper<>();
|
QueryWrapper<AccountUserBindConnect> queryWrapper = new QueryWrapper<>();
|
||||||
queryWrapper.eq("bind_id", "+86"+mobile)//+86的
|
queryWrapper.eq("bind_id", "+86" + mobile)//+86的
|
||||||
.eq("bind_type", BindCode.MOBILE)
|
.eq("bind_type", BindCode.MOBILE)
|
||||||
.eq("user_type", 0)
|
.eq("user_type", 0)
|
||||||
.eq("user_id", userId)
|
.eq("user_id", userId)
|
||||||
.eq("bind_active", CommonConstant.Enable)
|
.eq("bind_active", CommonConstant.Enable)
|
||||||
.orderByAsc("bind_time");
|
.orderByAsc("bind_time");
|
||||||
List<AccountUserBindConnect> accountUserBindConnectList = list(queryWrapper);
|
List<AccountUserBindConnect> accountUserBindConnectList = list(queryWrapper);
|
||||||
AccountUserBindConnect accountUserBindConnect= accountUserBindConnectList.get(0);
|
AccountUserBindConnect accountUserBindConnect = accountUserBindConnectList.get(0);
|
||||||
if (accountUserBindConnectList.isEmpty()){
|
if (accountUserBindConnectList.isEmpty()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
UpdateWrapper<AccountUserBindConnect> updateWrapper = new UpdateWrapper<>();
|
UpdateWrapper<AccountUserBindConnect> updateWrapper = new UpdateWrapper<>();
|
||||||
accountUserBindConnect.setSend_number(accountUserBindConnect.getSend_number()+1);
|
accountUserBindConnect.setSend_number(accountUserBindConnect.getSend_number() + 1);
|
||||||
getUpdateWrapper(updateWrapper, accountUserBindConnect);
|
getUpdateWrapper(updateWrapper, accountUserBindConnect);
|
||||||
if(update(updateWrapper)){
|
if (update(updateWrapper)) {
|
||||||
redisTemplate.opsForHash().increment(RedisConstant.SUB_SEND_CACHE,mapKey, -1);//店铺扣除一次
|
redisTemplate.opsForHash().increment(RedisConstant.SUB_SEND_CACHE, mapKey, -1);//店铺扣除一次
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -496,7 +497,7 @@ public class AccountUserBindConnectServiceImpl extends BaseServiceImpl<AccountUs
|
|||||||
|
|
||||||
boolean result = false;
|
boolean result = false;
|
||||||
if (!accountUserBindConnectList.isEmpty()) {
|
if (!accountUserBindConnectList.isEmpty()) {
|
||||||
UpdateWrapper<AccountUserBindConnect> updateWrapper= new UpdateWrapper<>();
|
UpdateWrapper<AccountUserBindConnect> updateWrapper = new UpdateWrapper<>();
|
||||||
try {
|
try {
|
||||||
for (AccountUserBindConnect accountUserBindConnect : accountUserBindConnectList) {
|
for (AccountUserBindConnect accountUserBindConnect : accountUserBindConnectList) {
|
||||||
updateWrapper.set("send_number", accountUserBindConnect.getSend_number());
|
updateWrapper.set("send_number", accountUserBindConnect.getSend_number());
|
||||||
@ -600,9 +601,10 @@ public class AccountUserBindConnectServiceImpl extends BaseServiceImpl<AccountUs
|
|||||||
* @param bindType 绑定类型
|
* @param bindType 绑定类型
|
||||||
* @param userId 用户ID
|
* @param userId 用户ID
|
||||||
* @param userType 用户类型
|
* @param userType 用户类型
|
||||||
|
* @param inviteCode 代理商邀请码
|
||||||
* @return 账户用户绑定连接对象,如果初始化失败则返回null
|
* @return 账户用户绑定连接对象,如果初始化失败则返回null
|
||||||
*/
|
*/
|
||||||
public AccountUserBindConnect initAccountUserBindConnect(String bindId, Integer bindType, Integer userId, Integer userType) {
|
public AccountUserBindConnect initAccountUserBindConnect(String bindId, Integer bindType, Integer userId, Integer userType, String inviteCode) {
|
||||||
// 1. 校验入参,任何一个为空直接返回null
|
// 1. 校验入参,任何一个为空直接返回null
|
||||||
if (StrUtil.isBlank(bindId)
|
if (StrUtil.isBlank(bindId)
|
||||||
|| ObjectUtil.isNull(bindType)
|
|| ObjectUtil.isNull(bindType)
|
||||||
@ -624,7 +626,7 @@ public class AccountUserBindConnectServiceImpl extends BaseServiceImpl<AccountUs
|
|||||||
.eq("user_id", userId)
|
.eq("user_id", userId)
|
||||||
.eq("bind_active", CommonConstant.Enable).orderByAsc("bind_time");
|
.eq("bind_active", CommonConstant.Enable).orderByAsc("bind_time");
|
||||||
|
|
||||||
AccountUserBindConnect existingBindConnect = findOne(queryWrapper);
|
AccountUserBindConnect existingBindConnect = getOne(queryWrapper, false);
|
||||||
if (existingBindConnect != null) {
|
if (existingBindConnect != null) {
|
||||||
log.info("账户用户绑定信息已存在,bindId={}, bindType={}, userId={}, userType={}", bindId, bindType, userId, userType);
|
log.info("账户用户绑定信息已存在,bindId={}, bindType={}, userId={}, userType={}", bindId, bindType, userId, userType);
|
||||||
return existingBindConnect;
|
return existingBindConnect;
|
||||||
@ -642,6 +644,7 @@ public class AccountUserBindConnectServiceImpl extends BaseServiceImpl<AccountUs
|
|||||||
newBindConnect.setBind_token_ttl(0);
|
newBindConnect.setBind_token_ttl(0);
|
||||||
newBindConnect.setBind_level(0);
|
newBindConnect.setBind_level(0);
|
||||||
newBindConnect.setBind_vip(0);
|
newBindConnect.setBind_vip(0);
|
||||||
|
newBindConnect.setInvite_code(inviteCode); // 代理商邀请码
|
||||||
|
|
||||||
// log.debug("准备创建新的账户用户绑定信息: {}", JSONUtil.toJsonStr(newBindConnect));
|
// log.debug("准备创建新的账户用户绑定信息: {}", JSONUtil.toJsonStr(newBindConnect));
|
||||||
|
|
||||||
@ -673,7 +676,7 @@ public class AccountUserBindConnectServiceImpl extends BaseServiceImpl<AccountUs
|
|||||||
.eq("user_type", CommonConstant.USER_TYPE_NORMAL)
|
.eq("user_type", CommonConstant.USER_TYPE_NORMAL)
|
||||||
.eq("bind_active", CommonConstant.Enable)
|
.eq("bind_active", CommonConstant.Enable)
|
||||||
.eq("bind_tmpl", bindTmpl)
|
.eq("bind_tmpl", bindTmpl)
|
||||||
.gt("send_number",0)
|
.gt("send_number", 0)
|
||||||
.orderByAsc("bind_time");
|
.orderByAsc("bind_time");
|
||||||
return this.lists(queryWrapper, pageNum, pageSize).getRecords();
|
return this.lists(queryWrapper, pageNum, pageSize).getRecords();
|
||||||
}
|
}
|
||||||
@ -722,8 +725,8 @@ public class AccountUserBindConnectServiceImpl extends BaseServiceImpl<AccountUs
|
|||||||
String templateId = object.getStr("TemplateId");//模板id
|
String templateId = object.getStr("TemplateId");//模板id
|
||||||
String SubscribeStatusString = object.getStr("SubscribeStatusString");//订阅结果(accept接收;reject拒收)参考地址https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/subscribe-message.html#%E8%AE%A2%E9%98%85%E6%B6%88%E6%81%AF%E8%AF%AD%E9%9F%B3%E6%8F%90%E9%86%92
|
String SubscribeStatusString = object.getStr("SubscribeStatusString");//订阅结果(accept接收;reject拒收)参考地址https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/subscribe-message.html#%E8%AE%A2%E9%98%85%E6%B6%88%E6%81%AF%E8%AF%AD%E9%9F%B3%E6%8F%90%E9%86%92
|
||||||
if (SubscribeStatusString.equals("accept")) {
|
if (SubscribeStatusString.equals("accept")) {
|
||||||
String mapKey= RedisConstant.SUB_SEND_CACHE+accountUserBindConnect.getUser_id();
|
String mapKey = RedisConstant.SUB_SEND_CACHE + accountUserBindConnect.getUser_id();
|
||||||
redisTemplate.opsForHash().increment(RedisConstant.SUB_SEND_CACHE,mapKey, 1);
|
redisTemplate.opsForHash().increment(RedisConstant.SUB_SEND_CACHE, mapKey, 1);
|
||||||
accountUserBindConnect.setBind_tmpl(templateId);
|
accountUserBindConnect.setBind_tmpl(templateId);
|
||||||
getUpdateWrapper(updateWrapper, accountUserBindConnect);
|
getUpdateWrapper(updateWrapper, accountUserBindConnect);
|
||||||
}
|
}
|
||||||
@ -732,8 +735,8 @@ public class AccountUserBindConnectServiceImpl extends BaseServiceImpl<AccountUs
|
|||||||
String templateId = object.getStr("TemplateId");//模板id
|
String templateId = object.getStr("TemplateId");//模板id
|
||||||
String SubscribeStatusString = object.getStr("SubscribeStatusString");
|
String SubscribeStatusString = object.getStr("SubscribeStatusString");
|
||||||
if (StringUtils.isNotEmpty(SubscribeStatusString) && SubscribeStatusString.equals("accept")) {
|
if (StringUtils.isNotEmpty(SubscribeStatusString) && SubscribeStatusString.equals("accept")) {
|
||||||
String mapKey= RedisConstant.SUB_SEND_CACHE+accountUserBindConnect.getUser_id();
|
String mapKey = RedisConstant.SUB_SEND_CACHE + accountUserBindConnect.getUser_id();
|
||||||
redisTemplate.opsForHash().increment(RedisConstant.SUB_SEND_CACHE,mapKey, 1);
|
redisTemplate.opsForHash().increment(RedisConstant.SUB_SEND_CACHE, mapKey, 1);
|
||||||
accountUserBindConnect.setBind_tmpl(templateId);
|
accountUserBindConnect.setBind_tmpl(templateId);
|
||||||
getUpdateWrapper(updateWrapper, accountUserBindConnect);
|
getUpdateWrapper(updateWrapper, accountUserBindConnect);
|
||||||
} else {
|
} else {
|
||||||
@ -749,7 +752,6 @@ public class AccountUserBindConnectServiceImpl extends BaseServiceImpl<AccountUs
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 封装相同参数的调用方法
|
* 封装相同参数的调用方法
|
||||||
*
|
*
|
||||||
@ -763,7 +765,7 @@ public class AccountUserBindConnectServiceImpl extends BaseServiceImpl<AccountUs
|
|||||||
updateWrapper.eq("bind_type", accountUserBindConnect.getBind_type());
|
updateWrapper.eq("bind_type", accountUserBindConnect.getBind_type());
|
||||||
updateWrapper.eq("user_id", accountUserBindConnect.getUser_id());
|
updateWrapper.eq("user_id", accountUserBindConnect.getUser_id());
|
||||||
updateWrapper.eq("user_type", accountUserBindConnect.getUser_type());
|
updateWrapper.eq("user_type", accountUserBindConnect.getUser_type());
|
||||||
updateWrapper.set("send_number",accountUserBindConnect.getSend_number());
|
updateWrapper.set("send_number", accountUserBindConnect.getSend_number());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user