user增加邀请人id,通过邀请码获取用户修改为id获取
This commit is contained in:
@@ -178,6 +178,11 @@ public class UserEntity implements Serializable {
|
|||||||
*/
|
*/
|
||||||
private String qdCode;
|
private String qdCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 邀请人id
|
||||||
|
*/
|
||||||
|
private Long inviterUserId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 是否是新用户 1否
|
* 是否是新用户 1否
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -233,4 +233,6 @@ public interface UserService extends IService<UserEntity> {
|
|||||||
* 用户行为
|
* 用户行为
|
||||||
*/
|
*/
|
||||||
void addBlackUser(Long userId,String behavior);
|
void addBlackUser(Long userId,String behavior);
|
||||||
|
|
||||||
|
UserEntity queryByInvitationCodeOrUserId(Long inviterUserId, String invitationCode);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -473,7 +473,8 @@ public class UserServiceImpl extends ServiceImpl<UserDao, UserEntity> implements
|
|||||||
if (StringUtils.isEmpty(userInfo1.getInviterCode())) {
|
if (StringUtils.isEmpty(userInfo1.getInviterCode())) {
|
||||||
userInfo1.setInviterCode(commonInfoService.findOne(88).getValue());
|
userInfo1.setInviterCode(commonInfoService.findOne(88).getValue());
|
||||||
}
|
}
|
||||||
UserEntity userEntity = queryByInvitationCode(userInfo1.getInviterCode());
|
UserEntity userEntity = queryByInvitationCodeOrUserId(userInfo1.getInviterUserId(), userInfo1.getInviterCode());
|
||||||
|
// UserEntity userEntity = queryByInvitationCode(userInfo1.getInviterCode());
|
||||||
if (userEntity != null && StringUtils.isEmpty(userInfo1.getQdCode())) {
|
if (userEntity != null && StringUtils.isEmpty(userInfo1.getQdCode())) {
|
||||||
userInfo1.setQdCode(userEntity.getQdCode());
|
userInfo1.setQdCode(userEntity.getQdCode());
|
||||||
}
|
}
|
||||||
@@ -763,7 +764,8 @@ public class UserServiceImpl extends ServiceImpl<UserDao, UserEntity> implements
|
|||||||
if (StringUtils.isEmpty(userInfo1.getInviterCode())) {
|
if (StringUtils.isEmpty(userInfo1.getInviterCode())) {
|
||||||
userInfo1.setInviterCode(commonInfoService.findOne(88).getValue());
|
userInfo1.setInviterCode(commonInfoService.findOne(88).getValue());
|
||||||
}
|
}
|
||||||
UserEntity userEntity = queryByInvitationCode(userInfo1.getInviterCode());
|
UserEntity userEntity = queryByInvitationCodeOrUserId(userInfo1.getInviterUserId(), userInfo1.getInviterCode());
|
||||||
|
// UserEntity userEntity = queryByInvitationCode(userInfo1.getInviterCode());
|
||||||
//没有则生成新账号
|
//没有则生成新账号
|
||||||
userInfo1.setCreateTime(date);
|
userInfo1.setCreateTime(date);
|
||||||
userInfo1.setPlatform("抖音");
|
userInfo1.setPlatform("抖音");
|
||||||
@@ -858,7 +860,8 @@ public class UserServiceImpl extends ServiceImpl<UserDao, UserEntity> implements
|
|||||||
if (StringUtils.isEmpty(userInfo1.getInviterCode())) {
|
if (StringUtils.isEmpty(userInfo1.getInviterCode())) {
|
||||||
userInfo1.setInviterCode(commonInfoService.findOne(88).getValue());
|
userInfo1.setInviterCode(commonInfoService.findOne(88).getValue());
|
||||||
}
|
}
|
||||||
UserEntity userEntity = queryByInvitationCode(userInfo1.getInviterCode());
|
UserEntity userEntity = queryByInvitationCodeOrUserId(userInfo1.getInviterUserId(), userInfo1.getInviterCode());
|
||||||
|
// UserEntity userEntity = queryByInvitationCode(userInfo1.getInviterCode());
|
||||||
//没有则生成新账号
|
//没有则生成新账号
|
||||||
userInfo1.setCreateTime(date);
|
userInfo1.setCreateTime(date);
|
||||||
userInfo1.setPlatform("快手");
|
userInfo1.setPlatform("快手");
|
||||||
@@ -957,7 +960,8 @@ public class UserServiceImpl extends ServiceImpl<UserDao, UserEntity> implements
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
userInfo.setInviterCode(commonInfoService.findOne(88).getValue());
|
userInfo.setInviterCode(commonInfoService.findOne(88).getValue());
|
||||||
userEntity = queryByInvitationCode(userInfo.getInviterCode());
|
userEntity = queryByInvitationCodeOrUserId(userInfo.getInviterUserId(), userInfo.getInviterCode());
|
||||||
|
// userEntity = queryByInvitationCode(userInfo.getInviterCode());
|
||||||
}
|
}
|
||||||
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||||
String time = simpleDateFormat.format(new Date());
|
String time = simpleDateFormat.format(new Date());
|
||||||
@@ -1673,4 +1677,13 @@ public class UserServiceImpl extends ServiceImpl<UserDao, UserEntity> implements
|
|||||||
.set(UserEntity::getPlatform, behavior)
|
.set(UserEntity::getPlatform, behavior)
|
||||||
.set(UserEntity::getUpdateTime,DateUtil.now()));
|
.set(UserEntity::getUpdateTime,DateUtil.now()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public UserEntity queryByInvitationCodeOrUserId(Long inviterUserId, String invitationCode) {
|
||||||
|
if (inviterUserId == null) {
|
||||||
|
return baseMapper.selectOne(new QueryWrapper<UserEntity>().eq("invitation_code", invitationCode));
|
||||||
|
}
|
||||||
|
|
||||||
|
return baseMapper.selectOne(new LambdaQueryWrapper<UserEntity>().eq(UserEntity::getUserId, inviterUserId));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -189,7 +189,8 @@ public class InviteServiceImpl extends ServiceImpl<InviteDao, Invite> implements
|
|||||||
invite.setUserType(1);
|
invite.setUserType(1);
|
||||||
inviteDao.insert(invite);
|
inviteDao.insert(invite);
|
||||||
//同步二级
|
//同步二级
|
||||||
UserEntity two = userService.queryByInvitationCode(userEntity.getInviterCode());
|
UserEntity two = userService.queryByInvitationCodeOrUserId(userEntity.getInviterUserId(), userEntity.getInviterCode());
|
||||||
|
// UserEntity two = userService.queryByInvitationCode(userEntity.getInviterCode());
|
||||||
if (two != null) {
|
if (two != null) {
|
||||||
invite = new Invite();
|
invite = new Invite();
|
||||||
invite.setState(0);
|
invite.setState(0);
|
||||||
@@ -203,6 +204,7 @@ public class InviteServiceImpl extends ServiceImpl<InviteDao, Invite> implements
|
|||||||
UserEntity user = new UserEntity();
|
UserEntity user = new UserEntity();
|
||||||
user.setUserId(userId);
|
user.setUserId(userId);
|
||||||
user.setInviterCode(userEntity.getInvitationCode());
|
user.setInviterCode(userEntity.getInvitationCode());
|
||||||
|
user.setInviterUserId(userEntity.getUserId());
|
||||||
userService.updateById(user);
|
userService.updateById(user);
|
||||||
|
|
||||||
// 金币
|
// 金币
|
||||||
@@ -318,7 +320,8 @@ public class InviteServiceImpl extends ServiceImpl<InviteDao, Invite> implements
|
|||||||
result.put("oneUserId", userEntity.getUserId());
|
result.put("oneUserId", userEntity.getUserId());
|
||||||
result.put("oneMoney", money);
|
result.put("oneMoney", money);
|
||||||
}
|
}
|
||||||
UserEntity two = userService.queryByInvitationCode(userEntity.getInviterCode());
|
UserEntity two = userService.queryByInvitationCodeOrUserId(userEntity.getInviterUserId(), userEntity.getInviterCode());
|
||||||
|
// UserEntity two = userService.queryByInvitationCode(userEntity.getInviterCode());
|
||||||
if (two != null) {
|
if (two != null) {
|
||||||
Invite invite2 = inviteDao.selectInviteByUser(two.getUserId(), userId, 2);
|
Invite invite2 = inviteDao.selectInviteByUser(two.getUserId(), userId, 2);
|
||||||
if (invite2 == null) {
|
if (invite2 == null) {
|
||||||
|
|||||||
@@ -162,7 +162,8 @@ public class TempOrdersTask {
|
|||||||
ordersService.insertOrders(order);
|
ordersService.insertOrders(order);
|
||||||
|
|
||||||
UserEntity user = userService.selectUserById(order.getUserId());
|
UserEntity user = userService.selectUserById(order.getUserId());
|
||||||
UserEntity byUser = userService.queryByInvitationCode(user.getInviterCode());
|
UserEntity byUser = userService.queryByInvitationCodeOrUserId(user.getInviterUserId(), user.getInviterCode());
|
||||||
|
// UserEntity byUser = userService.queryByInvitationCode(user.getInviterCode());
|
||||||
if (byUser != null) {
|
if (byUser != null) {
|
||||||
InviteAchievement inviteAchievement = inviteAchievementService.getByUserId(user.getUserId());
|
InviteAchievement inviteAchievement = inviteAchievementService.getByUserId(user.getUserId());
|
||||||
if (inviteAchievement == null) {
|
if (inviteAchievement == null) {
|
||||||
|
|||||||
@@ -122,7 +122,8 @@ public class AliPayController {
|
|||||||
orders.setPayTime(DateUtils.format(new Date()));
|
orders.setPayTime(DateUtils.format(new Date()));
|
||||||
|
|
||||||
UserEntity user = userService.selectUserById(orders.getUserId());
|
UserEntity user = userService.selectUserById(orders.getUserId());
|
||||||
UserEntity byUser = userService.queryByInvitationCode(user.getInviterCode());
|
UserEntity byUser = userService.queryByInvitationCodeOrUserId(user.getInviterUserId(), user.getInviterCode());
|
||||||
|
// UserEntity byUser = userService.queryByInvitationCode(user.getInviterCode());
|
||||||
Map map = inviteService.updateInvite(byUser, format, user.getUserId(), orders.getPayMoney());
|
Map map = inviteService.updateInvite(byUser, format, user.getUserId(), orders.getPayMoney());
|
||||||
Object oneUserId = map.get("oneUserId");
|
Object oneUserId = map.get("oneUserId");
|
||||||
if (oneUserId != null) {
|
if (oneUserId != null) {
|
||||||
|
|||||||
@@ -415,7 +415,8 @@ public class DyServiceImpl implements DyService {
|
|||||||
ordersService.fillSysUserId(orders);
|
ordersService.fillSysUserId(orders);
|
||||||
ordersService.updateById(orders);
|
ordersService.updateById(orders);
|
||||||
UserEntity user = userService.selectUserById(orders.getUserId());
|
UserEntity user = userService.selectUserById(orders.getUserId());
|
||||||
UserEntity byUser = userService.queryByInvitationCode(user.getInviterCode());
|
UserEntity byUser = userService.queryByInvitationCodeOrUserId(user.getInviterUserId(), user.getInviterCode());
|
||||||
|
// UserEntity byUser = userService.queryByInvitationCode(user.getInviterCode());
|
||||||
Map map = inviteService.updateInvite(byUser, format, user.getUserId(), orders.getPayMoney());
|
Map map = inviteService.updateInvite(byUser, format, user.getUserId(), orders.getPayMoney());
|
||||||
Object oneUserId = map.get("oneUserId");
|
Object oneUserId = map.get("oneUserId");
|
||||||
if(oneUserId!=null){
|
if(oneUserId!=null){
|
||||||
@@ -507,7 +508,8 @@ public class DyServiceImpl implements DyService {
|
|||||||
ordersService.fillSysUserId(orders);
|
ordersService.fillSysUserId(orders);
|
||||||
ordersService.updateById(orders);
|
ordersService.updateById(orders);
|
||||||
UserEntity user = userService.selectUserById(orders.getUserId());
|
UserEntity user = userService.selectUserById(orders.getUserId());
|
||||||
UserEntity byUser = userService.queryByInvitationCode(user.getInviterCode());
|
UserEntity byUser = userService.queryByInvitationCodeOrUserId(user.getInviterUserId(), user.getInviterCode());
|
||||||
|
// UserEntity byUser = userService.queryByInvitationCode(user.getInviterCode());
|
||||||
Map map = inviteService.updateInvite(byUser, format, user.getUserId(), orders.getPayMoney());
|
Map map = inviteService.updateInvite(byUser, format, user.getUserId(), orders.getPayMoney());
|
||||||
Object oneUserId = map.get("oneUserId");
|
Object oneUserId = map.get("oneUserId");
|
||||||
if(oneUserId!=null){
|
if(oneUserId!=null){
|
||||||
|
|||||||
@@ -191,7 +191,8 @@ public class KsServiceImpl implements KsService {
|
|||||||
ordersService.fillSysUserId(orders);
|
ordersService.fillSysUserId(orders);
|
||||||
ordersService.updateById(orders);
|
ordersService.updateById(orders);
|
||||||
UserEntity user = userService.selectUserById(orders.getUserId());
|
UserEntity user = userService.selectUserById(orders.getUserId());
|
||||||
UserEntity byUser = userService.queryByInvitationCode(user.getInviterCode());
|
UserEntity byUser = userService.queryByInvitationCodeOrUserId(user.getInviterUserId(), user.getInviterCode());
|
||||||
|
// UserEntity byUser = userService.queryByInvitationCode(user.getInviterCode());
|
||||||
Map map = inviteService.updateInvite(byUser, format, user.getUserId(), orders.getPayMoney());
|
Map map = inviteService.updateInvite(byUser, format, user.getUserId(), orders.getPayMoney());
|
||||||
Object oneUserId = map.get("oneUserId");
|
Object oneUserId = map.get("oneUserId");
|
||||||
if(oneUserId!=null){
|
if(oneUserId!=null){
|
||||||
|
|||||||
@@ -286,7 +286,8 @@ public class WxServiceImpl implements WxService {
|
|||||||
orders.setStatus(1);
|
orders.setStatus(1);
|
||||||
orders.setPayTime(DateUtils.format(new Date()));
|
orders.setPayTime(DateUtils.format(new Date()));
|
||||||
UserEntity user = userService.selectUserById(orders.getUserId());
|
UserEntity user = userService.selectUserById(orders.getUserId());
|
||||||
UserEntity byUser = userService.queryByInvitationCode(user.getInviterCode());
|
UserEntity byUser = userService.queryByInvitationCodeOrUserId(user.getInviterUserId(), user.getInviterCode());
|
||||||
|
// UserEntity byUser = userService.queryByInvitationCode(user.getInviterCode());
|
||||||
Map map = inviteService.updateInvite(byUser, format, user.getUserId(), orders.getPayMoney());
|
Map map = inviteService.updateInvite(byUser, format, user.getUserId(), orders.getPayMoney());
|
||||||
Object oneUserId = map.get("oneUserId");
|
Object oneUserId = map.get("oneUserId");
|
||||||
if(oneUserId!=null){
|
if(oneUserId!=null){
|
||||||
@@ -367,7 +368,8 @@ public class WxServiceImpl implements WxService {
|
|||||||
orders.setPayTime(DateUtils.format(new Date()));
|
orders.setPayTime(DateUtils.format(new Date()));
|
||||||
|
|
||||||
UserEntity user = userService.selectUserById(orders.getUserId());
|
UserEntity user = userService.selectUserById(orders.getUserId());
|
||||||
UserEntity byUser = userService.queryByInvitationCode(user.getInviterCode());
|
UserEntity byUser = userService.queryByInvitationCodeOrUserId(user.getInviterUserId(), user.getInviterCode());
|
||||||
|
// UserEntity byUser = userService.queryByInvitationCode(user.getInviterCode());
|
||||||
Map map = inviteService.updateInvite(byUser, format, user.getUserId(), orders.getPayMoney());
|
Map map = inviteService.updateInvite(byUser, format, user.getUserId(), orders.getPayMoney());
|
||||||
Object oneUserId = map.get("oneUserId");
|
Object oneUserId = map.get("oneUserId");
|
||||||
if(oneUserId!=null){
|
if(oneUserId!=null){
|
||||||
|
|||||||
Reference in New Issue
Block a user