forked from dyf/fys-Multi-tenant
Merge remote-tracking branch 'upstream/main'
This commit is contained in:
@ -59,6 +59,7 @@ public class AppSmsAuthStrategy implements IAuthStrategy {
|
|||||||
if (ObjectUtil.isNull(user)) {
|
if (ObjectUtil.isNull(user)) {
|
||||||
//新增Appuser
|
//新增Appuser
|
||||||
AppUser appUser = addAppUser(tenantId, phonenumber);
|
AppUser appUser = addAppUser(tenantId, phonenumber);
|
||||||
|
user = new AppUserVo();
|
||||||
MapstructUtils.convert(appUser, user);
|
MapstructUtils.convert(appUser, user);
|
||||||
// user = appUserMapper.selectVoOne(new LambdaQueryWrapper<AppUser>().eq(AppUser::getPhonenumber, phonenumber));
|
// user = appUserMapper.selectVoOne(new LambdaQueryWrapper<AppUser>().eq(AppUser::getPhonenumber, phonenumber));
|
||||||
// loginService.recordLogininfor(tenantId, phonenumber, Constants.LOGIN_FAIL, MessageUtils.message("user.not.exists", phonenumber));
|
// loginService.recordLogininfor(tenantId, phonenumber, Constants.LOGIN_FAIL, MessageUtils.message("user.not.exists", phonenumber));
|
||||||
@ -70,6 +71,7 @@ public class AppSmsAuthStrategy implements IAuthStrategy {
|
|||||||
});
|
});
|
||||||
loginUser.setClientKey(client.getClientKey());
|
loginUser.setClientKey(client.getClientKey());
|
||||||
loginUser.setDeviceType(client.getDeviceType());
|
loginUser.setDeviceType(client.getDeviceType());
|
||||||
|
loginUser.setUserType(UserType.APP_USER.getUserType());
|
||||||
SaLoginParameter model = new SaLoginParameter();
|
SaLoginParameter model = new SaLoginParameter();
|
||||||
model.setDeviceType(client.getDeviceType());
|
model.setDeviceType(client.getDeviceType());
|
||||||
// 自定义分配 不同用户体系 不同 token 授权时间 不设置默认走全局 yml 配置
|
// 自定义分配 不同用户体系 不同 token 授权时间 不设置默认走全局 yml 配置
|
||||||
|
@ -190,7 +190,8 @@ public class DeviceServiceImpl extends ServiceImpl<DeviceMapper, Device> impleme
|
|||||||
device.setPubTopic("A/" + device.getDeviceImei());
|
device.setPubTopic("A/" + device.getDeviceImei());
|
||||||
device.setSubTopic("B/" + device.getDeviceImei());
|
device.setSubTopic("B/" + device.getDeviceImei());
|
||||||
}
|
}
|
||||||
|
// 0 未绑定
|
||||||
|
device.setBindingStatus(0);
|
||||||
deviceMapper.insert(device);
|
deviceMapper.insert(device);
|
||||||
|
|
||||||
// 新增设备类型记录
|
// 新增设备类型记录
|
||||||
@ -303,7 +304,7 @@ public class DeviceServiceImpl extends ServiceImpl<DeviceMapper, Device> impleme
|
|||||||
throw new BadRequestException(device.getDeviceName() + ":设备已分配,请先解绑设备!!!");
|
throw new BadRequestException(device.getDeviceName() + ":设备已分配,请先解绑设备!!!");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (device.getBindingStatus().equals(1)){
|
if (device.getBindingStatus() != null && device.getBindingStatus().equals(1)) {
|
||||||
throw new BadRequestException(device.getDeviceName() + ":设备已绑定,请先解绑设备!!!");
|
throw new BadRequestException(device.getDeviceName() + ":设备已绑定,请先解绑设备!!!");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -312,6 +313,11 @@ public class DeviceServiceImpl extends ServiceImpl<DeviceMapper, Device> impleme
|
|||||||
invalidIds.add(deviceAssignment.getDeviceId());
|
invalidIds.add(deviceAssignment.getDeviceId());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 删除设备:分配记录
|
||||||
|
deviceAssignmentsMapper.delete(new LambdaQueryWrapper<DeviceAssignments>()
|
||||||
|
.eq(DeviceAssignments::getDeviceId, deviceAssignment.getDeviceId())
|
||||||
|
.eq(DeviceAssignments::getAssigneeId, deviceAssignment.getAssigneeId()));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
deviceAssignmentsMapper.deleteByIds(ids);
|
deviceAssignmentsMapper.deleteByIds(ids);
|
||||||
|
Reference in New Issue
Block a user