|
@@ -110,14 +110,14 @@ namespace WingDeviceService.Service
|
|
|
var deviceDb = await _deviceInfoDBServiceProxy.FindDeviceInfoByCodeAsync(deviceCode);
|
|
|
if (deviceDb == null)
|
|
|
{
|
|
|
- throw new RpcException(1007, "Device not exist.", "Device not exist.");
|
|
|
+ throw new NoExistDeviceException();
|
|
|
}
|
|
|
foreach (var userCode in userCodes)
|
|
|
{
|
|
|
var existUser = await _userServiceProxy.FindUserByCodeAsync(userCode);
|
|
|
if (existUser == null)
|
|
|
{
|
|
|
- throw new RpcException(1007, " Users not exist.", " Users not exist.");
|
|
|
+ throw new NoExistUserException();
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -227,7 +227,7 @@ namespace WingDeviceService.Service
|
|
|
var deviceDb = await _deviceInfoDBServiceProxy.FindDeviceInfoByCodeAsync(deviceCode);
|
|
|
if (deviceDb == null)
|
|
|
{
|
|
|
- throw new RpcException(1007, "Device not exist.", "Device not exist.");
|
|
|
+ throw new NoExistDeviceException();
|
|
|
}
|
|
|
var updateUsers = new List<TableDataItem<UserPasswordDTO>>();
|
|
|
foreach (var userCode in userCodes)
|
|
@@ -323,12 +323,12 @@ namespace WingDeviceService.Service
|
|
|
var userInfoDO = await _userServiceProxy.FindUserByCodeAsync(userCode);
|
|
|
if (userInfoDO == null)
|
|
|
{
|
|
|
- throw new RpcException(1007, "User not exist.", "User not exist.");
|
|
|
+ throw new NoExistUserException();
|
|
|
}
|
|
|
//查询用户的医院是否存在
|
|
|
if (string.IsNullOrWhiteSpace(userInfoDO.OrganizationCode))
|
|
|
{
|
|
|
- throw new RpcException(1007, "User's organization not exist.", "User's organization not exist.");
|
|
|
+ throw new NoExistOrgException();
|
|
|
}
|
|
|
var deviceInfoDOList = new List<DeviceInfoDTO>();
|
|
|
if (!userInfoDO.IsDirector)
|
|
@@ -390,7 +390,7 @@ namespace WingDeviceService.Service
|
|
|
var userInfoDO = await _userServiceProxy.FindUserByCodeAsync(userCode);
|
|
|
if (userInfoDO == null)
|
|
|
{
|
|
|
- throw new RpcException(1007, "User not exist.", "User not exist.");
|
|
|
+ throw new NoExistUserException();
|
|
|
}
|
|
|
var deviceDb = await _deviceInfoDBServiceProxy.FindDeviceInfoByShortCodeAsync(request.ShortCode);
|
|
|
if (deviceDb == null)
|
|
@@ -617,13 +617,13 @@ namespace WingDeviceService.Service
|
|
|
var userInfoDO = await _userServiceProxy.FindUserByCodeAsync(userCode);
|
|
|
if (userInfoDO == null)
|
|
|
{
|
|
|
- throw new RpcException(1007, "User not exist.", "User not exist.");
|
|
|
+ throw new NoExistUserException();
|
|
|
}
|
|
|
var result = new List<SelectItemDTO>();
|
|
|
//查询用户的医院是否存在
|
|
|
if (string.IsNullOrEmpty(userInfoDO.OrganizationCode))
|
|
|
{
|
|
|
- throw new RpcException(1007, "User's organization not exist.", "User's organization not exist.");
|
|
|
+ throw new NoExistOrgException();
|
|
|
}
|
|
|
//查询用户绑定的设备
|
|
|
if (userInfoDO.BindDevices == null || userInfoDO.BindDevices.Count <= 0)
|
|
@@ -653,7 +653,7 @@ namespace WingDeviceService.Service
|
|
|
var deviceInfo = await _deviceInfoDBServiceProxy.FindDeviceInfoByCodeAsync(deviceCode);
|
|
|
if (deviceInfo == null || string.IsNullOrWhiteSpace(deviceInfo.DeviceCode))
|
|
|
{
|
|
|
- throw new RpcException(1007, "deviceInfo not find", "deviceInfo not find");
|
|
|
+ throw new NoExistDeviceException();
|
|
|
}
|
|
|
var org = new OrganizationDTO();
|
|
|
if (!string.IsNullOrWhiteSpace(deviceInfo.OrganizationCode))
|
|
@@ -843,7 +843,7 @@ namespace WingDeviceService.Service
|
|
|
var deviceDb = await _deviceInfoDBServiceProxy.FindDeviceInfoByCodeAsync(request.DeviceCode);
|
|
|
if (deviceDb == null)
|
|
|
{
|
|
|
- throw new RpcException(1007, "Device not exist.", "Device not exist.");
|
|
|
+ throw new NoExistDeviceException();
|
|
|
}
|
|
|
var userListResult = await _userServiceProxy.GetUsersByDeviceAsync(request.DeviceCode);
|
|
|
if (userListResult != null && userListResult.Count > 0)
|