Commit de79c554 authored by 王亮's avatar 王亮

fix some issues.

parent a900e14b
......@@ -4,6 +4,7 @@ import cn.quantgroup.xyqb.entity.User;
import cn.quantgroup.xyqb.entity.WechatUserInfo;
import cn.quantgroup.xyqb.repository.IUserRepository;
import cn.quantgroup.xyqb.repository.IWeChatUserRepository;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationListener;
......@@ -34,8 +35,10 @@ public class WechatBindingEventListener implements ApplicationListener<UserLogin
if (user != null && StringUtils.isNotEmpty(user.getPhoneNo())) {
List<WechatUserInfo> wechatUserInfoList = weChatUserRepository.findByPhoneNoAndTenantId(user.getPhoneNo(), user.getTenantId());
wechatUserInfoList.forEach(i -> i.setUserId(user.getId()));
if (CollectionUtils.isNotEmpty(wechatUserInfoList)) {
weChatUserRepository.save(wechatUserInfoList);
}
}
}
}
......
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