Former-commit-id: 7155d32c2fb8561e3d93b8266e583a236b088e1c
Former-commit-id: 118c3936e6c3425cb521f193b8dc9445953fe4fd
1.0
wanggang 4 years ago
parent 12b37f3e33
commit cd8df2e728

@ -8,7 +8,6 @@ using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Globalization; using System.Globalization;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
@ -139,7 +138,6 @@ namespace IoTNode.DeviceServices.LiChuang
{ {
ex.PrintStack(); ex.PrintStack();
} }
}); });
} }
} }
@ -355,12 +353,12 @@ namespace IoTNode.DeviceServices.LiChuang
Ip = ip, Ip = ip,
IoTGatewayId = iotNode.Id, IoTGatewayId = iotNode.Id,
IoTProductId = product.Id, IoTProductId = product.Id,
IsOnline=true, IsOnline = true,
}; };
deviceRepo.Add(device); deviceRepo.Add(device);
deviceRepo.SaveChanges(); deviceRepo.SaveChanges();
this.UpdateIoTData(device.Id,DataKeys.Hardware, hardware); this.UpdateIoTData(device.Id, DataKeys.Hardware, hardware);
this.UpdateIoTData(device.Id,DataKeys.Period, period); this.UpdateIoTData(device.Id, DataKeys.Period, period);
} }
} }
catch (Exception ex) catch (Exception ex)
@ -490,7 +488,7 @@ namespace IoTNode.DeviceServices.LiChuang
var dataKey = GetKey(equipidex); var dataKey = GetKey(equipidex);
var unit = this.GetUnit(name)?.ToString(); var unit = this.GetUnit(name)?.ToString();
var dataName = $"{dataKey.GetDisplayName():unit}"; var dataName = $"{dataKey.GetDisplayName():unit}";
this.UpdateIoTData(deviceId.Value, dataKey, value,name:dataName,unit:unit); this.UpdateIoTData(deviceId.Value, dataKey, value, name: dataName, unit: unit);
} }
} }
@ -656,4 +654,4 @@ namespace IoTNode.DeviceServices.LiChuang
} }
} }
} }
} }
Loading…
Cancel
Save