fix 增加log
This commit is contained in:
@@ -307,6 +307,7 @@ public class DeviceUploadLogService : IDeviceUploadLogService
|
||||
var roomInfo = await _dormitoryRoomPowerSwitchApi.GetUserRoomInfoAsync<DormitoryResponse>(userCode);
|
||||
if (!roomInfo.MCB)
|
||||
{
|
||||
_logger.LogInformation("MCB未开启, userCode:{userCode} directionType:{directionType}", userCode, directionType);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -401,6 +402,7 @@ public class DeviceUploadLogService : IDeviceUploadLogService
|
||||
room.PowerSwitch = false; // 断电
|
||||
await _dbContext.UpdateAsync(room);
|
||||
await _dormitoryRoomPowerSwitchApi.SwitchAsync(new PowerSwitchRequest(room.RoomId, 0));
|
||||
_logger.LogInformation("房间下电{roomNo}", room.RoomNo);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -411,6 +413,7 @@ public class DeviceUploadLogService : IDeviceUploadLogService
|
||||
room.PowerSwitch = true; // 上电
|
||||
await _dbContext.UpdateAsync(room);
|
||||
await _dormitoryRoomPowerSwitchApi.SwitchAsync(new PowerSwitchRequest(room.RoomId, 1));
|
||||
_logger.LogInformation("房间上电{roomNo}", room.RoomNo);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user