diff --git a/src/JiShe.IoT.Application/DeviceAggregation/DeviceAggregationService.cs b/src/JiShe.IoT.Application/DeviceAggregation/DeviceAggregationService.cs index 0aed703..5a08055 100644 --- a/src/JiShe.IoT.Application/DeviceAggregation/DeviceAggregationService.cs +++ b/src/JiShe.IoT.Application/DeviceAggregation/DeviceAggregationService.cs @@ -888,6 +888,8 @@ namespace JiShe.IoT.DeviceAggregation UpgradeSource = DeviceUpgradeSourceTypeEnum.AdminSystem, UpgradeIdentifier = Yitter.IdGenerator.YitIdHelper.NextId(), UpgradeDescription = input.UpgradeDescription, + UpgradeStatus = DeviceUpgradeStatusTypeEnum.NotUpgrade, + Id = GuidGenerator.Create() }; var md5HashRaw = $"{fileObject.Md5Hash}{productInfo.ProductAccesskey}{upgradeRecordInput.UpgradeIdentifier}{fileObject.FileSize}"; @@ -897,7 +899,7 @@ namespace JiShe.IoT.DeviceAggregation Length = fileObject.FileSize, UpgradeIdentifier = upgradeRecordInput.UpgradeIdentifier, SignatureValue = md5HashRaw.Md5Fun(), - FirmwareUrl = $"{serverApplicationOptions.DownloadDeviceFirmwareBasicUrl}", + FirmwareUrl = $"{serverApplicationOptions.DownloadDeviceFirmwareBasicUrl}{upgradeRecordInput.Id}", TimeOut = serverApplicationOptions.DownloadDeviceFirmwareTimeOut, }; @@ -944,6 +946,13 @@ namespace JiShe.IoT.DeviceAggregation } await redisPubSubService.PublishReliableAsync(DistributedMessageCenterConst.OneNETCommandIssuedEventName, packetTaskInfo); + + //更新状态为升级中 + await deviceUpgradeRecordService.UpdateAsync(new UpdateDeviceUpgradeRecordInput() + { + Id = deviceInfo.Id, + UpgradeStatus = DeviceUpgradeStatusTypeEnum.Upgrading, + }); return true; } catch (Exception)