|
|
|
|
@ -83,9 +83,9 @@ public class WxUserMemberServiceImpl implements IWxUserMemberService {
|
|
|
|
|
wxUserMember.setOpenid(wxCode2SessionRet.getOpenid());
|
|
|
|
|
wxUserMember.setUnionid(wxCode2SessionRet.getUnionid());
|
|
|
|
|
wxUserMember.setLoginTime(DateUtils.getNowDate());
|
|
|
|
|
wxUserMember.setCreateTime(DateUtils.getNowDate());
|
|
|
|
|
// 2.2、微信用户表注册
|
|
|
|
|
wxUserMemberMapper.insertWxUserMember(wxUserMember);
|
|
|
|
|
wxUserMember = wxUserMemberMapper.selectWxUserMemberById(wxUserMember.getId());
|
|
|
|
|
// 2.3、系统表注册
|
|
|
|
|
SysUser user = new SysUser();
|
|
|
|
|
user.setUserName(wxUserMember.getOpenid());
|
|
|
|
|
@ -95,23 +95,6 @@ public class WxUserMemberServiceImpl implements IWxUserMemberService {
|
|
|
|
|
user.setUserType("01");
|
|
|
|
|
user.setCreateBy(SecurityUtils.getUsername());
|
|
|
|
|
sysUserMapper.insertUser(user);
|
|
|
|
|
// 2.4、用户注册成功发送消息
|
|
|
|
|
WxScriptMessage wxScriptMessage = wxScriptMessageMapper.selectOneByMessageType(MessageTypeEnum.USER_REGISTRATION.getCode());
|
|
|
|
|
if (wxScriptMessage != null) {
|
|
|
|
|
WxUserScriptLog wxUserScriptLog = new WxUserScriptLog();
|
|
|
|
|
BeanUtils.copyProperties(wxScriptMessage, wxUserScriptLog);
|
|
|
|
|
wxUserScriptLog.setId(null);
|
|
|
|
|
wxUserScriptLog.setWxUserId(wxUserMember.getId());
|
|
|
|
|
wxUserScriptLog.setMessageType(WxUserIntegralMessageTypeEnum.USER_REGISTRATION.getCode());
|
|
|
|
|
wxUserScriptLog.setIsCustom(0);
|
|
|
|
|
wxUserScriptLog.setTitile(wxScriptMessage.getMessageTitle());
|
|
|
|
|
wxUserScriptLog.setContent(wxScriptMessage.getMessageContent());
|
|
|
|
|
wxUserScriptLog.setCreateTime(DateUtils.getNowDate());
|
|
|
|
|
wxUserScriptLog.setCreateBy(null);
|
|
|
|
|
wxUserScriptLog.setUpdateTime(null);
|
|
|
|
|
wxUserScriptLog.setUpdateBy(null);
|
|
|
|
|
wxUserScriptLogMapper.insertWxUserScriptLog(wxUserScriptLog);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
@ -169,6 +152,25 @@ public class WxUserMemberServiceImpl implements IWxUserMemberService {
|
|
|
|
|
throw new ServiceException("手机号码已注册!");
|
|
|
|
|
}
|
|
|
|
|
wxUserMemberMapper.upgradeMember(wxCode2PhoneRet.getPhoneInfo().getPhoneNumber(), SecurityUtils.getLoginUser().getWxUserMember().getId().intValue());
|
|
|
|
|
|
|
|
|
|
// 2.4、用户注册成功发送消息
|
|
|
|
|
WxScriptMessage wxScriptMessage = wxScriptMessageMapper.selectOneByMessageType(MessageTypeEnum.USER_REGISTRATION.getCode());
|
|
|
|
|
if (wxScriptMessage != null) {
|
|
|
|
|
WxUserScriptLog wxUserScriptLog = new WxUserScriptLog();
|
|
|
|
|
BeanUtils.copyProperties(wxScriptMessage, wxUserScriptLog);
|
|
|
|
|
wxUserScriptLog.setId(null);
|
|
|
|
|
wxUserScriptLog.setWxUserId(SecurityUtils.getLoginUser().getWxUserMember().getId());
|
|
|
|
|
wxUserScriptLog.setMessageType(WxUserIntegralMessageTypeEnum.USER_REGISTRATION.getCode());
|
|
|
|
|
wxUserScriptLog.setIsCustom(0);
|
|
|
|
|
wxUserScriptLog.setTitile(wxScriptMessage.getMessageTitle());
|
|
|
|
|
wxUserScriptLog.setContent(wxScriptMessage.getMessageContent());
|
|
|
|
|
wxUserScriptLog.setCreateTime(DateUtils.getNowDate());
|
|
|
|
|
wxUserScriptLog.setCreateBy(null);
|
|
|
|
|
wxUserScriptLog.setUpdateTime(null);
|
|
|
|
|
wxUserScriptLog.setUpdateBy(null);
|
|
|
|
|
wxUserScriptLogMapper.insertWxUserScriptLog(wxUserScriptLog);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* TODO: 新用户注册,需要对接数云,将用户信息传给数云
|
|
|
|
|
*/
|
|
|
|
|
|