|
|
@ -158,23 +158,31 @@ public class WechatController { |
|
|
|
highUserService.updateUser(user); |
|
|
|
highUserService.updateUser(user); |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
if (highUserService.findByPhone(phoneNoInfo.getPurePhoneNumber()) != null) { |
|
|
|
// 根据手机号查询用户
|
|
|
|
throw ErrorHelp.genException(SysCode.MiniProgram, ErrorCode.COMMON_ERROR, "手机号已被绑定,请更换后重新授权"); |
|
|
|
user = highUserService.findByPhone(phoneNoInfo.getPurePhoneNumber()); |
|
|
|
|
|
|
|
if (user == null) { |
|
|
|
|
|
|
|
user = new HighUser(); |
|
|
|
|
|
|
|
user.setName("用户" + IDGenerator.nextId(5)); |
|
|
|
|
|
|
|
user.setPhone(phoneNoInfo.getPurePhoneNumber()); |
|
|
|
|
|
|
|
user.setRegTime(new Date()); |
|
|
|
|
|
|
|
user.setGold(0); |
|
|
|
|
|
|
|
user.setOpenId(session.getOpenid()); |
|
|
|
|
|
|
|
user.setUnionId(session.getUnionid()); |
|
|
|
|
|
|
|
user.setStatus(1); |
|
|
|
|
|
|
|
// 用户信息完整状态
|
|
|
|
|
|
|
|
// 0:完整
|
|
|
|
|
|
|
|
// 1:需要填写用户信息
|
|
|
|
|
|
|
|
// 2:需要填写手机号
|
|
|
|
|
|
|
|
user.setInfoCompleteStatus(1); |
|
|
|
|
|
|
|
highUserService.insertUser(user); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
if (StringUtils.isBlank(user.getName())) { |
|
|
|
|
|
|
|
user.setName("用户" + IDGenerator.nextId(5)); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
user.setOpenId(session.getOpenid()); |
|
|
|
|
|
|
|
user.setUnionId(session.getUnionid()); |
|
|
|
|
|
|
|
highUserService.updateUser(user); |
|
|
|
} |
|
|
|
} |
|
|
|
user = new HighUser(); |
|
|
|
|
|
|
|
user.setName("用户" + IDGenerator.nextId(5)); |
|
|
|
|
|
|
|
user.setPhone(phoneNoInfo.getPurePhoneNumber()); |
|
|
|
|
|
|
|
user.setRegTime(new Date()); |
|
|
|
|
|
|
|
user.setGold(0); |
|
|
|
|
|
|
|
user.setOpenId(session.getOpenid()); |
|
|
|
|
|
|
|
user.setUnionId(session.getUnionid()); |
|
|
|
|
|
|
|
user.setStatus(1); |
|
|
|
|
|
|
|
// 用户信息完整状态
|
|
|
|
|
|
|
|
// 0:完整
|
|
|
|
|
|
|
|
// 1:需要填写用户信息
|
|
|
|
|
|
|
|
// 2:需要填写手机号
|
|
|
|
|
|
|
|
user.setInfoCompleteStatus(1); |
|
|
|
|
|
|
|
highUserService.insertUser(user); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 定义个人所有数据
|
|
|
|
// 定义个人所有数据
|
|
|
|