Merge remote-tracking branch 'origin/dev' into zs
This commit is contained in:
commit
4eb037ad5d
|
|
@ -414,28 +414,20 @@ public class LoginService {
|
|||
@Transactional
|
||||
public Result upPhone(String openId, String phone, String shopId) {
|
||||
TbUserInfo userInfo = tbUserInfoMapper.selectByOpenId(openId);
|
||||
boolean isup = false;
|
||||
if(StringUtils.isNotBlank(userInfo.getTelephone())){
|
||||
List<TbShopUser> tbShopUsers = tbShopUserMapper.selectByPhone(userInfo.getTelephone());
|
||||
for (TbShopUser tbShopUser : tbShopUsers) {
|
||||
if (tbShopUser.getShopId().equals(shopId)) {
|
||||
isup = true;
|
||||
}
|
||||
tbShopUser.setTelephone(phone);
|
||||
tbShopUser.setUpdatedAt(System.currentTimeMillis());
|
||||
tbShopUserMapper.updateByPrimaryKey(tbShopUser);
|
||||
}
|
||||
if(!isup){
|
||||
registerShopUser(userInfo,shopId);
|
||||
}
|
||||
// 同一个手机号 同一个店 userId 不为空
|
||||
TbShopUser tbShopUserPC = tbShopUserMapper.selectPCByPhoneAndShopId(userInfo.getTelephone(),shopId);
|
||||
if (tbShopUserPC != null) {
|
||||
TbShopUser tbShopUserSM = tbShopUserMapper.selectByUserIdAndShopId(userInfo.getId().toString(),shopId);
|
||||
tbShopUserMapper.deleteByPrimaryKey(tbShopUserSM.getId());
|
||||
tbShopUserPC.setUserId(userInfo.getId().toString());
|
||||
tbShopUserMapper.updateByPrimaryKey(tbShopUserPC);
|
||||
}else {
|
||||
TbShopUser shopUser = tbShopUserMapper.selectByUserIdAndShopId(userInfo.getId().toString(), shopId);
|
||||
if (shopUser != null) {
|
||||
shopUser.setTelephone(phone);
|
||||
shopUser.setUpdatedAt(System.currentTimeMillis());
|
||||
tbShopUserMapper.updateByPrimaryKey(shopUser);
|
||||
}else {
|
||||
registerShopUser(userInfo,shopId);
|
||||
TbShopUser tbShopUserSM = tbShopUserMapper.selectByUserIdAndShopId(userInfo.getId().toString(),shopId);
|
||||
if (tbShopUserSM != null) {
|
||||
tbShopUserSM.setIsVip(Byte.parseByte("1"));
|
||||
tbShopUserSM.setTelephone(phone);
|
||||
tbShopUserSM.setUpdatedAt(System.currentTimeMillis());
|
||||
tbShopUserMapper.updateByPrimaryKey(tbShopUserSM);
|
||||
}
|
||||
}
|
||||
userInfo.setTelephone(phone);
|
||||
|
|
@ -454,7 +446,7 @@ public class LoginService {
|
|||
shopUser.setCode(dynamicCode);
|
||||
shopUser.setTelephone(userInfo.getTelephone());
|
||||
shopUser.setAmount(BigDecimal.ZERO);
|
||||
shopUser.setIsVip(Byte.parseByte("0"));
|
||||
shopUser.setIsVip(Byte.parseByte("1"));
|
||||
shopUser.setCreditAmount(BigDecimal.ZERO);
|
||||
shopUser.setConsumeAmount(BigDecimal.ZERO);
|
||||
shopUser.setConsumeNumber(0);
|
||||
|
|
|
|||
Loading…
Reference in New Issue