修改代码

parent 5b3ad19f
......@@ -222,8 +222,7 @@ public class UserController implements IBaseController {
LOGGER.info("用户快速注册失败,短信验证码错误, registerFrom:{}, phoneNo:{}, verificationCode:{}", registerFrom, phoneNo, verificationCode);
return JsonResult.buildErrorStateResult("短信验证码错误", null);
}
User user=userService.register(phoneNo, password, registerFrom, getIp(), channelId,btRegisterChannelId);
if (null==user) {
if (!userService.register(phoneNo, password, registerFrom, getIp(), channelId,btRegisterChannelId)) {
LOGGER.info("用户快速注册失败,请稍后重试, registerFrom:{}, phoneNo:{}", registerFrom, phoneNo);
return JsonResult.buildErrorStateResult("注册失败,请稍后重试", null);
}
......@@ -272,14 +271,11 @@ public class UserController implements IBaseController {
LOGGER.info("用户注册失败,短信验证码错误, registerFrom:{}, phoneNo:{}, verificationCode:{}", registerFrom, phoneNo, verificationCode);
return JsonResult.buildErrorStateResult("短信验证码错误", null);
}
User user=userService.register(phoneNo, password, registerFrom, getIp(), channelId,btRegisterChannelId);
if (null==user) {
if (!userService.register(phoneNo, password, registerFrom, getIp(), channelId,btRegisterChannelId)) {
LOGGER.info("用户快速注册失败,请稍后重试, registerFrom:{}, phoneNo:{}", registerFrom, phoneNo);
return JsonResult.buildErrorStateResult("注册失败,请稍后重试", null);
}
//增加登陆统计发送
UserStatistics statistics=new UserStatistics(user,null,3);
MqUtils.sendLoanVest(statistics);
LOGGER.info("用户注册成功, registerFrom:{}, phoneNo:{}", registerFrom, phoneNo);
return JsonResult.buildSuccessResult(null, null);
......
......@@ -32,7 +32,7 @@ public interface IUserService {
User findById(Long userId);
User register(String phoneNo, String password, Long registerFrom, String ip, Long channelId, Long btRegisterChannelId);
boolean register(String phoneNo, String password, Long registerFrom, String ip, Long channelId, Long btRegisterChannelId);
List<User> findByPhones(List<String> phones);
User registerAndReturn(String phoneNo, String password, Long registerFrom, Long btRegisterChannelId);
......
......@@ -6,6 +6,7 @@ import cn.quantgroup.xyqb.entity.*;
import cn.quantgroup.xyqb.model.IdCardInfo;
import cn.quantgroup.xyqb.model.IdType;
import cn.quantgroup.xyqb.model.JsonResult;
import cn.quantgroup.xyqb.model.UserStatistics;
import cn.quantgroup.xyqb.repository.IAddressRepository;
import cn.quantgroup.xyqb.repository.IContactRepository;
import cn.quantgroup.xyqb.repository.IUserBtRegisterRepository;
......@@ -16,6 +17,7 @@ import cn.quantgroup.xyqb.service.user.ILkbUserService;
import cn.quantgroup.xyqb.service.user.IUserBtRegisterService;
import cn.quantgroup.xyqb.service.user.IUserDetailService;
import cn.quantgroup.xyqb.service.user.IUserService;
import cn.quantgroup.xyqb.util.MqUtils;
import cn.quantgroup.xyqb.util.PasswordUtil;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.TypeReference;
......@@ -150,7 +152,7 @@ public class UserServiceImpl implements IUserService {
@Override
public User register(String phoneNo, String password, Long registerFrom, String ip, Long channelId, Long btRegisterChannelId) {
public boolean register(String phoneNo, String password, Long registerFrom, String ip, Long channelId, Long btRegisterChannelId) {
String uuid = lkbUserService.registerApp(phoneNo, password);
Timestamp currentTime = new Timestamp(System.currentTimeMillis());
......@@ -170,15 +172,24 @@ public class UserServiceImpl implements IUserService {
//user.setRegisteredFrom(registerFrom);
user = userRepository.save(user);
boolean registerSuccess=false;
if(null != user){
UserBtRegister userBtRegister = new UserBtRegister();
userBtRegister.setUserId(user.getId());
userBtRegister.setRegisterBtMerchantId(btRegisterChannelId);
userBtRegisterService.save(userBtRegister);
log.info("白条注册渠道信息保存完成");
registerSuccess=true;
}
smsService.sendAfterRegister(phoneNo);
return user;
if(registerSuccess){
//增加登陆统计发送
UserStatistics statistics=new UserStatistics(user,null,3);
MqUtils.sendLoanVest(statistics);
}
return registerSuccess;
}
......
......@@ -18,7 +18,7 @@ public class MqUtils {
IVestService mqService = ApplicationContextHolder.getBean("loanVestMQService");
mqService.send(vest);
} catch (Exception e) {
log.error("[MQUtils][MQUtils_exception]发送马甲信息,vest={},error={}",
log.error("[MQUtils][MQUtils_exception]发送用户统计信息,vest={},error={}",
vest, e);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment