diff --git a/Sln.Iot.Business/StatusBusiness.cs b/Sln.Iot.Business/StatusBusiness.cs index d2330a4..c821402 100644 --- a/Sln.Iot.Business/StatusBusiness.cs +++ b/Sln.Iot.Business/StatusBusiness.cs @@ -81,7 +81,8 @@ namespace Sln.Iot.Business closeTime = DateTime.Now, useState = '0' }; - var res = _deviceRecordService.UpdateCloseTime(deviceRecord,out List resIds); + var res = _deviceRecordService.UpdateCloseTime(deviceRecord,out List resIds,out int infoRes); + _logger.Info($"锁具:{idsStr};记录数据更新{(res ? "成功":"失败")},基础数据更新{(infoRes > 0 ? "成功":"失败")}"); } } diff --git a/Sln.Iot.Business/bin/Debug/netstandard2.1/Sln.Iot.Business.dll b/Sln.Iot.Business/bin/Debug/netstandard2.1/Sln.Iot.Business.dll index da308e7..8c2b5dd 100644 Binary files a/Sln.Iot.Business/bin/Debug/netstandard2.1/Sln.Iot.Business.dll and b/Sln.Iot.Business/bin/Debug/netstandard2.1/Sln.Iot.Business.dll differ diff --git a/Sln.Iot.Business/bin/Debug/netstandard2.1/Sln.Iot.Business.pdb b/Sln.Iot.Business/bin/Debug/netstandard2.1/Sln.Iot.Business.pdb index 2812110..b3a0997 100644 Binary files a/Sln.Iot.Business/bin/Debug/netstandard2.1/Sln.Iot.Business.pdb and b/Sln.Iot.Business/bin/Debug/netstandard2.1/Sln.Iot.Business.pdb differ diff --git a/Sln.Iot.Business/bin/Debug/netstandard2.1/Sln.Iot.Repository.dll b/Sln.Iot.Business/bin/Debug/netstandard2.1/Sln.Iot.Repository.dll index 7f424bd..d2f09b1 100644 Binary files a/Sln.Iot.Business/bin/Debug/netstandard2.1/Sln.Iot.Repository.dll and b/Sln.Iot.Business/bin/Debug/netstandard2.1/Sln.Iot.Repository.dll differ diff --git a/Sln.Iot.Business/bin/Debug/netstandard2.1/Sln.Iot.Repository.pdb b/Sln.Iot.Business/bin/Debug/netstandard2.1/Sln.Iot.Repository.pdb index 007c2c0..ffb558f 100644 Binary files a/Sln.Iot.Business/bin/Debug/netstandard2.1/Sln.Iot.Repository.pdb and b/Sln.Iot.Business/bin/Debug/netstandard2.1/Sln.Iot.Repository.pdb differ diff --git a/Sln.Iot.Business/obj/Debug/netstandard2.1/Sln.Iot.Business.csproj.AssemblyReference.cache b/Sln.Iot.Business/obj/Debug/netstandard2.1/Sln.Iot.Business.csproj.AssemblyReference.cache index 84b161e..dbfb425 100644 Binary files a/Sln.Iot.Business/obj/Debug/netstandard2.1/Sln.Iot.Business.csproj.AssemblyReference.cache and b/Sln.Iot.Business/obj/Debug/netstandard2.1/Sln.Iot.Business.csproj.AssemblyReference.cache differ diff --git a/Sln.Iot.Business/obj/Debug/netstandard2.1/Sln.Iot.Business.dll b/Sln.Iot.Business/obj/Debug/netstandard2.1/Sln.Iot.Business.dll index da308e7..8c2b5dd 100644 Binary files a/Sln.Iot.Business/obj/Debug/netstandard2.1/Sln.Iot.Business.dll and b/Sln.Iot.Business/obj/Debug/netstandard2.1/Sln.Iot.Business.dll differ diff --git a/Sln.Iot.Business/obj/Debug/netstandard2.1/Sln.Iot.Business.pdb b/Sln.Iot.Business/obj/Debug/netstandard2.1/Sln.Iot.Business.pdb index 2812110..b3a0997 100644 Binary files a/Sln.Iot.Business/obj/Debug/netstandard2.1/Sln.Iot.Business.pdb and b/Sln.Iot.Business/obj/Debug/netstandard2.1/Sln.Iot.Business.pdb differ diff --git a/Sln.Iot.Repository/bin/Debug/netstandard2.1/Sln.Iot.Repository.dll b/Sln.Iot.Repository/bin/Debug/netstandard2.1/Sln.Iot.Repository.dll index 7f424bd..d2f09b1 100644 Binary files a/Sln.Iot.Repository/bin/Debug/netstandard2.1/Sln.Iot.Repository.dll and b/Sln.Iot.Repository/bin/Debug/netstandard2.1/Sln.Iot.Repository.dll differ diff --git a/Sln.Iot.Repository/bin/Debug/netstandard2.1/Sln.Iot.Repository.pdb b/Sln.Iot.Repository/bin/Debug/netstandard2.1/Sln.Iot.Repository.pdb index 007c2c0..ffb558f 100644 Binary files a/Sln.Iot.Repository/bin/Debug/netstandard2.1/Sln.Iot.Repository.pdb and b/Sln.Iot.Repository/bin/Debug/netstandard2.1/Sln.Iot.Repository.pdb differ diff --git a/Sln.Iot.Repository/obj/Debug/netstandard2.1/Sln.Iot.Repository.dll b/Sln.Iot.Repository/obj/Debug/netstandard2.1/Sln.Iot.Repository.dll index 7f424bd..d2f09b1 100644 Binary files a/Sln.Iot.Repository/obj/Debug/netstandard2.1/Sln.Iot.Repository.dll and b/Sln.Iot.Repository/obj/Debug/netstandard2.1/Sln.Iot.Repository.dll differ diff --git a/Sln.Iot.Repository/obj/Debug/netstandard2.1/Sln.Iot.Repository.pdb b/Sln.Iot.Repository/obj/Debug/netstandard2.1/Sln.Iot.Repository.pdb index 007c2c0..ffb558f 100644 Binary files a/Sln.Iot.Repository/obj/Debug/netstandard2.1/Sln.Iot.Repository.pdb and b/Sln.Iot.Repository/obj/Debug/netstandard2.1/Sln.Iot.Repository.pdb differ diff --git a/Sln.Iot.Repository/service/IDeviceRecordService.cs b/Sln.Iot.Repository/service/IDeviceRecordService.cs index f3454b7..ceb0f09 100644 --- a/Sln.Iot.Repository/service/IDeviceRecordService.cs +++ b/Sln.Iot.Repository/service/IDeviceRecordService.cs @@ -32,6 +32,6 @@ namespace Sln.Iot.Repository.service public interface IDeviceRecordService:IBaseService { - bool UpdateCloseTime(DeviceRecord deviceRecord,out List resIds); + bool UpdateCloseTime(DeviceRecord deviceRecord,out List resIds,out int infoRes); } } \ No newline at end of file diff --git a/Sln.Iot.Repository/service/Impl/DeviceRecordServiceImpl.cs b/Sln.Iot.Repository/service/Impl/DeviceRecordServiceImpl.cs index d99ff5c..e76672f 100644 --- a/Sln.Iot.Repository/service/Impl/DeviceRecordServiceImpl.cs +++ b/Sln.Iot.Repository/service/Impl/DeviceRecordServiceImpl.cs @@ -38,10 +38,10 @@ namespace Sln.Iot.Repository.service.Impl { } - public bool UpdateCloseTime(DeviceRecord deviceRecord, out List resIds) + public bool UpdateCloseTime(DeviceRecord deviceRecord, out List resIds,out int infoRes) { resIds = new List(); - + infoRes = 0; var info = _rep.GetList(x=> x.deviceCode == deviceRecord.deviceCode && x.useState == '1').FirstOrDefault(); if (info != null) { @@ -49,7 +49,27 @@ namespace Sln.Iot.Repository.service.Impl info.closeTime = deviceRecord.closeTime; info.useState = deviceRecord.useState; info.useTime = CalculateHoursDifference(info.openTime, deviceRecord.closeTime); - _rep.Update(info); + var res = _rep.Update(info); + + if (!res) + { + throw new ArgumentNullException($"锁具:{deviceRecord.deviceCode};记录数据更新失败"); + } + + var dt = new Dictionary(); + dt.Add("device_code", info.deviceCode); + dt.Add("use_state", deviceRecord.useState); + infoRes = _rep.Context.Updateable(dt).AS("device_base_info").WhereColumns("device_code").ExecuteCommand(); + + if (infoRes < 1) + { + throw new ArgumentNullException($"锁具:{deviceRecord.deviceCode};基础数据更新失败"); + } + + } + else + { + throw new ArgumentNullException($"锁具:{deviceRecord.deviceCode};不存在已上锁的锁具记录"); } return false; } diff --git a/Sln.Iot/bin/Debug/net6.0/Sln.Iot.Business.dll b/Sln.Iot/bin/Debug/net6.0/Sln.Iot.Business.dll index da308e7..8c2b5dd 100644 Binary files a/Sln.Iot/bin/Debug/net6.0/Sln.Iot.Business.dll and b/Sln.Iot/bin/Debug/net6.0/Sln.Iot.Business.dll differ diff --git a/Sln.Iot/bin/Debug/net6.0/Sln.Iot.Business.pdb b/Sln.Iot/bin/Debug/net6.0/Sln.Iot.Business.pdb index 2812110..b3a0997 100644 Binary files a/Sln.Iot/bin/Debug/net6.0/Sln.Iot.Business.pdb and b/Sln.Iot/bin/Debug/net6.0/Sln.Iot.Business.pdb differ diff --git a/Sln.Iot/bin/Debug/net6.0/Sln.Iot.Repository.dll b/Sln.Iot/bin/Debug/net6.0/Sln.Iot.Repository.dll index 7f424bd..d2f09b1 100644 Binary files a/Sln.Iot/bin/Debug/net6.0/Sln.Iot.Repository.dll and b/Sln.Iot/bin/Debug/net6.0/Sln.Iot.Repository.dll differ diff --git a/Sln.Iot/bin/Debug/net6.0/Sln.Iot.Repository.pdb b/Sln.Iot/bin/Debug/net6.0/Sln.Iot.Repository.pdb index 007c2c0..ffb558f 100644 Binary files a/Sln.Iot/bin/Debug/net6.0/Sln.Iot.Repository.pdb and b/Sln.Iot/bin/Debug/net6.0/Sln.Iot.Repository.pdb differ diff --git a/Sln.Iot/bin/Debug/net6.0/Sln.Iot.dll b/Sln.Iot/bin/Debug/net6.0/Sln.Iot.dll index 489a3d4..eac0c5e 100644 Binary files a/Sln.Iot/bin/Debug/net6.0/Sln.Iot.dll and b/Sln.Iot/bin/Debug/net6.0/Sln.Iot.dll differ diff --git a/Sln.Iot/bin/Debug/net6.0/Sln.Iot.pdb b/Sln.Iot/bin/Debug/net6.0/Sln.Iot.pdb index a7bd869..29a0a73 100644 Binary files a/Sln.Iot/bin/Debug/net6.0/Sln.Iot.pdb and b/Sln.Iot/bin/Debug/net6.0/Sln.Iot.pdb differ diff --git a/Sln.Iot/obj/Debug/net6.0/Sln.Iot.csproj.AssemblyReference.cache b/Sln.Iot/obj/Debug/net6.0/Sln.Iot.csproj.AssemblyReference.cache index 2d1ed55..4f0c7c3 100644 Binary files a/Sln.Iot/obj/Debug/net6.0/Sln.Iot.csproj.AssemblyReference.cache and b/Sln.Iot/obj/Debug/net6.0/Sln.Iot.csproj.AssemblyReference.cache differ diff --git a/Sln.Iot/obj/Debug/net6.0/Sln.Iot.dll b/Sln.Iot/obj/Debug/net6.0/Sln.Iot.dll index 489a3d4..eac0c5e 100644 Binary files a/Sln.Iot/obj/Debug/net6.0/Sln.Iot.dll and b/Sln.Iot/obj/Debug/net6.0/Sln.Iot.dll differ diff --git a/Sln.Iot/obj/Debug/net6.0/Sln.Iot.pdb b/Sln.Iot/obj/Debug/net6.0/Sln.Iot.pdb index a7bd869..29a0a73 100644 Binary files a/Sln.Iot/obj/Debug/net6.0/Sln.Iot.pdb and b/Sln.Iot/obj/Debug/net6.0/Sln.Iot.pdb differ