From 7f0563c88d8d190896464a981e9a1c5b7257555d Mon Sep 17 00:00:00 2001 From: ChenYi <296215406@outlook.com> Date: Wed, 31 Dec 2025 17:27:59 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=BE=E5=A4=87=E5=8D=87=E7=BA=A7=E6=8C=87?= =?UTF-8?q?=E4=BB=A4=EF=BC=8C=E9=9C=80=E8=A6=81=E5=8D=95=E7=8B=AC=E5=8F=91?= =?UTF-8?q?=E5=B8=83=E8=AE=A2=E9=98=85=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DeviceAggregation/DeviceAggregationService.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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)