| @@ -215,7 +215,7 @@ public class BaseController { | |||||
| } | } | ||||
| public Long saveToBasicInfoByCUser(String userPhone,String userName,String avatarUrl,Integer sex,Long userId) { | |||||
| public Long saveToBasicInfoByCUser(String userPhone,String userName,String avatarUrl,Integer sex,Long userId,Boolean isFirstPhone) { | |||||
| TenantEntity tenantEntity = getTenantInfo(); | TenantEntity tenantEntity = getTenantInfo(); | ||||
| if (StringUtils.isBlank(userPhone)) | if (StringUtils.isBlank(userPhone)) | ||||
| return null; | return null; | ||||
| @@ -243,6 +243,7 @@ public class BaseController { | |||||
| basicInfo.setSex(sex); | basicInfo.setSex(sex); | ||||
| wxCUserBasicInfoService.update(basicInfo); | wxCUserBasicInfoService.update(basicInfo); | ||||
| removeCacheMember(basicInfo.getId()); | removeCacheMember(basicInfo.getId()); | ||||
| isFirstPhone = false; | |||||
| return basicInfo.getId(); | return basicInfo.getId(); | ||||
| } else { | } else { | ||||
| if (byId != null) { | if (byId != null) { | ||||
| @@ -255,6 +256,7 @@ public class BaseController { | |||||
| byId.setSex(sex); | byId.setSex(sex); | ||||
| wxCUserBasicInfoService.update(byId); | wxCUserBasicInfoService.update(byId); | ||||
| removeCacheMember(basicInfo.getId()); | removeCacheMember(basicInfo.getId()); | ||||
| isFirstPhone = false; | |||||
| return byId.getId(); | return byId.getId(); | ||||
| } else { | } else { | ||||
| basicInfo = new WxCUserBasicInfo(); | basicInfo = new WxCUserBasicInfo(); | ||||
| @@ -75,8 +75,9 @@ public class WxMsgValidationcodeController extends BaseController { | |||||
| //wxMsgValidationcode.setAppid(user.getAppId()); | //wxMsgValidationcode.setAppid(user.getAppId()); | ||||
| ResultData rd = wxMsgValidationcodeService.hasvalidationcode(wxMsgValidationcode); | ResultData rd = wxMsgValidationcodeService.hasvalidationcode(wxMsgValidationcode); | ||||
| if (rd.code == Result.SUCCESS) { | if (rd.code == Result.SUCCESS) { | ||||
| boolean isFirstPhone = false; | |||||
| // 更新到basicinfo | // 更新到basicinfo | ||||
| Long basicUserId = saveToBasicInfoByCUser(phone, user.getNickName(), user.getAvatarUrl(), user.getGender(), user.getUserId()); | |||||
| Long basicUserId = saveToBasicInfoByCUser(phone, user.getNickName(), user.getAvatarUrl(), user.getGender(), user.getUserId(),isFirstPhone); | |||||
| if (null != basicUserId) { | if (null != basicUserId) { | ||||
| if(basicUserId.intValue() == -1){ | if(basicUserId.intValue() == -1){ | ||||
| return rd; | return rd; | ||||
| @@ -622,7 +622,7 @@ public class WxUserGrantController extends BaseController { | |||||
| phone = user.getVerifyCodePhone(); | phone = user.getVerifyCodePhone(); | ||||
| } | } | ||||
| // 更新到basicinfo | // 更新到basicinfo | ||||
| Long userBasicId = saveToBasicInfoByCUser(phone, user.getNickName(), user.getAvatarUrl(), user.getGender(), user.getUserId()); | |||||
| Long userBasicId = saveToBasicInfoByCUser(phone, user.getNickName(), user.getAvatarUrl(), user.getGender(), user.getUserId(),isFirstPhone); | |||||
| if (null != userBasicId) { | if (null != userBasicId) { | ||||
| if(userBasicId.intValue() == -1){ | if(userBasicId.intValue() == -1){ | ||||
| return new ResultData(ErrorCode.USER_PHONE_IS_FOUND); | return new ResultData(ErrorCode.USER_PHONE_IS_FOUND); | ||||