Commit fa230732 authored by libin's avatar libin

用户身份信息修改

parent 25e0d6cc
......@@ -316,31 +316,36 @@ public class AppUserPositionTempBiz extends BaseBiz<AppUserPositionTempMapper, A
public void setPostionIdByPhone(String phone) {
try {
Example example = new Example(AppUserPositionTemp.class);
example.createCriteria().andEqualTo("phone", phone).andEqualTo("isDel", 0);
List<AppUserPositionTemp> list = selectByExample(example);
if (CollectionUtils.isEmpty(list)) {
log.info("----用户无身份----phone===" + phone);
return;
}
AppUserPositionTemp positionTemp = list.get(0);
if (positionTemp.getUserId() > 0) {
log.info("----用户已存在身份----phone===" + phone);
return;
}
//根据手机号查询userId
AppUserLogin userLogin = loginBiz.checkeUserLogin(phone);
Integer userId = userLogin.getId();
if (userLogin == null) {
log.info("----用户不存在----phone===" + phone);
return;
}
Integer userId = userLogin.getId();
positionTemp.setUserId(userId);
int num = updateSelectiveByIdRe(positionTemp);
if (num > 0) {
Integer postionId = positionTemp.getPositionId();
log.info("----用户---postionId====" + postionId + "----phone===" + phone);
detailBiz.updateUserPositionByUserId(userId, postionId);
Integer postionId = appShareholderDetailBiz.findShareholderByUserIdOrPhone(null, phone);
if(Objects.isNull(postionId)) {
Example example = new Example(AppUserPositionTemp.class);
example.createCriteria().andEqualTo("phone", phone).andEqualTo("isDel", 0);
List<AppUserPositionTemp> list = selectByExample(example);
if (CollectionUtils.isEmpty(list)) {
log.info("----用户无身份----phone===" + phone);
return;
}
AppUserPositionTemp positionTemp = list.get(0);
if (positionTemp.getUserId() > 0) {
log.info("----用户已存在身份----phone===" + phone);
return;
}
positionTemp.setUserId(userId);
int num = updateSelectiveByIdRe(positionTemp);
if (num > 0) {
postionId = positionTemp.getPositionId();
log.info("----用户---postionId====" + postionId + "----phone===" + phone);
detailBiz.updateUserPositionByUserId(userId, postionId);
}
}else {
detailBiz.updateUserPositionByUserId(userId,postionId);
}
} catch (Exception e) {
log.error(e.getMessage(), 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