手机号同步
This commit is contained in:
parent
2e1755404e
commit
00710c3ee8
|
|
@ -86,8 +86,8 @@ public class UserContoller {
|
|||
shopUser.setSex(tbUserInfo.getSex());
|
||||
shopUser.setBirthDay(tbUserInfo.getBirthDay());
|
||||
shopUser.setLevel(Byte.parseByte("1"));
|
||||
String code= RandomUtil.randomNumbers(6);
|
||||
shopUser.setCode(code);
|
||||
String dynamicCode = RandomUtil.randomNumbers(8);
|
||||
shopUser.setCode(dynamicCode);
|
||||
shopUser.setTelephone(tbUserInfo.getTelephone());
|
||||
shopUser.setAmount(BigDecimal.ZERO);
|
||||
shopUser.setIsVip(Byte.parseByte("1"));
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ public interface TbShopUserMapper {
|
|||
|
||||
|
||||
TbShopUser selectByUserIdAndShopId(@Param("userId") String userId,@Param("shopId") String shopId);
|
||||
List<TbShopUser> selectAllByUserId(@Param("userId") String userId);
|
||||
|
||||
|
||||
List<Map<String,Object>> selectByUserId(@Param("userId") String userId,@Param("shopId") String shopId);
|
||||
|
|
|
|||
|
|
@ -105,13 +105,13 @@ public class LoginService {
|
|||
userInfo.setUpdatedAt(System.currentTimeMillis());
|
||||
tbUserInfoMapper.updateByPrimaryKeySelective(userInfo);
|
||||
}
|
||||
}else {
|
||||
}
|
||||
else {
|
||||
String phone = userInfo.getTelephone();
|
||||
if (StringUtils.isBlank(phone) || !phone.equals(telephone)) {
|
||||
userInfo.setTelephone(telephone);
|
||||
tbUserInfoMapper.updateByPrimaryKeySelective(userInfo);
|
||||
}else {
|
||||
List<TbShopUser> tbShopUsers = tbShopUserMapper.selectByPhone(telephone);
|
||||
List<TbShopUser> tbShopUsers = tbShopUserMapper.selectAllByUserId(userInfo.getId().toString());
|
||||
for (TbShopUser tbShopUser : tbShopUsers) {
|
||||
tbShopUser.setTelephone(phone);
|
||||
tbShopUserMapper.updateByPrimaryKey(tbShopUser);
|
||||
|
|
@ -183,8 +183,8 @@ public class LoginService {
|
|||
userInfo.setSex(tbShopUser.getSex());
|
||||
userInfo.setBirthDay(tbShopUser.getBirthDay());
|
||||
tbShopUser.setLevel(Byte.parseByte("1"));
|
||||
String code= RandomUtil.randomNumbers(6);
|
||||
tbShopUser.setCode(code);
|
||||
String dynamicCode = RandomUtil.randomNumbers(8);
|
||||
tbShopUser.setCode(dynamicCode);
|
||||
tbShopUser.setUserId(userInfo.getId() + "");
|
||||
tbShopUserMapper.updateByPrimaryKey(tbShopUser);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -82,7 +82,7 @@ public class ProductService {
|
|||
tbShopUser.setSex(tbUserInfo.getSex());
|
||||
tbShopUser.setBirthDay(tbUserInfo.getBirthDay());
|
||||
tbShopUser.setLevel(Byte.parseByte("1"));
|
||||
tbShopUser.setCode(RandomUtil.randomNumbers(6));
|
||||
tbShopUser.setCode(RandomUtil.randomNumbers(8));
|
||||
tbShopUser.setTelephone(tbUserInfo.getTelephone());
|
||||
tbShopUser.setAmount(BigDecimal.ZERO);
|
||||
tbShopUser.setIsVip(Byte.parseByte("1"));
|
||||
|
|
|
|||
|
|
@ -384,6 +384,10 @@
|
|||
select * from tb_shop_user where user_id=#{userId} and shop_id=#{shopId}
|
||||
</select>
|
||||
|
||||
<select id="selectAllByUserId" resultMap="BaseResultMap">
|
||||
select * from tb_shop_user where user_id=#{userId}
|
||||
</select>
|
||||
|
||||
<select id="selectByOpenId" resultType="com.chaozhanggui.system.cashierservice.entity.TbShopUser">
|
||||
select * from tb_shop_user where mini_open_id = #{openId}
|
||||
</select>
|
||||
|
|
|
|||
Loading…
Reference in New Issue