弟弟
This commit is contained in:
parent
c01227dcc1
commit
5aa415d2f3
@ -1,6 +0,0 @@
|
||||
C:\Users\tangl\Desktop\Git\YD_AllHeartRates.Api\YD_AllHeartRates.Api\Fakes\YD_AllHeartRates.Commons.fakes : warning : 无法为 YD_AllHeartRates.Commons.Dto.ResponseMsg 生成存根: 类型没有对程序集可见的构造函数。构造函数本身或参数可能不可见。。
|
||||
C:\Users\tangl\Desktop\Git\YD_AllHeartRates.Api\YD_AllHeartRates.Api\Fakes\YD_AllHeartRates.Commons.fakes : warning : 无法为 YD_AllHeartRates.Commons.MemoryCaches.MemoryCacheSetup 生成存根: 类型没有对程序集可见的构造函数。构造函数本身或参数可能不可见。。
|
||||
C:\Users\tangl\Desktop\Git\YD_AllHeartRates.Api\YD_AllHeartRates.Api\Fakes\YD_AllHeartRates.Commons.fakes : warning : 无法为 YD_AllHeartRates.Commons.Middlewares.SystemExceptionApplicationBuilderExtensions 生成存根: 类型没有对程序集可见的构造函数。构造函数本身或参数可能不可见。。
|
||||
C:\Users\tangl\Desktop\Git\YD_AllHeartRates.Api\YD_AllHeartRates.Api\Fakes\YD_AllHeartRates.Commons.fakes : warning : 无法为 YD_AllHeartRates.Commons.Utils.Util 生成存根: 类型没有对程序集可见的构造函数。构造函数本身或参数可能不可见。。
|
||||
C:\Users\tangl\Desktop\Git\YD_AllHeartRates.Api\YD_AllHeartRates.Api\Fakes\YD_AllHeartRates.Commons.fakes : warning : 正在跳过 method System.Int32 YD_AllHeartRates.Commons.Utils.Util.GetRank(!!0 score),method System.Int32 YD_AllHeartRates.Commons.Utils.Util.GetRank(!!0 score) unstubbable: 无法同时指定类约束和 "class" 或 "struct" 约束
|
||||
C:\Users\tangl\Desktop\Git\YD_AllHeartRates.Api\YD_AllHeartRates.Api\Fakes\YD_AllHeartRates.Commons.fakes : warning : 正在跳过 method System.String YD_AllHeartRates.Commons.Utils.Util.GetRankStr(!!0 score),method System.String YD_AllHeartRates.Commons.Utils.Util.GetRankStr(!!0 score) unstubbable: 无法同时指定类约束和 "class" 或 "struct" 约束
|
@ -111,10 +111,12 @@ namespace YD_AllHeartRates.Api.Mqtt
|
||||
await foreach (var batch in ReadBatchesAsync(stoppingToken))
|
||||
{
|
||||
var heartRateEntities = new ConcurrentBag<HeartRateData>();
|
||||
var jumpRopeEntities = new ConcurrentBag<JumpRopeData>();
|
||||
|
||||
var deviceMap = _devices.ToDictionary(x => x.Code, x => x.StudentNo);
|
||||
var studentMap = _studentList.ToDictionary(x => x.StudentNo, x => x);
|
||||
var jumpRopeEntities = new ConcurrentBag<JumpRopeData>();
|
||||
|
||||
var deviceHMap = _devices.Where(x => x.DeviceType == 1).ToDictionary(x => x.Code, x => x.StudentNo);
|
||||
var deviceJMap = _devices.Where(x => x.DeviceType == 2).ToDictionary(x => x.Code, x => x.StudentNo);
|
||||
|
||||
var studentMap = _studentList.GroupBy(x => x.StudentNo).ToDictionary(g => g.Key, g => g.First());
|
||||
|
||||
Parallel.ForEach(batch, new ParallelOptions { MaxDegreeOfParallelism = Environment.ProcessorCount }, msg =>
|
||||
{
|
||||
@ -127,8 +129,6 @@ namespace YD_AllHeartRates.Api.Mqtt
|
||||
var scoreTime = DateTime.ParseExact(payload.send_time, "yyyy-MM-dd HH:mm:ss", CultureInfo.InvariantCulture);
|
||||
foreach (var ble in payload.devices)
|
||||
{
|
||||
if (!deviceMap.TryGetValue(ble.bs_name, out var studentNo)) continue;
|
||||
if (!studentMap.TryGetValue(studentNo, out var student)) continue;
|
||||
if (string.IsNullOrWhiteSpace(ble.Broadcast_data)) continue;
|
||||
|
||||
var data = ParseHexData(ble.Broadcast_data);
|
||||
@ -136,6 +136,9 @@ namespace YD_AllHeartRates.Api.Mqtt
|
||||
|
||||
if (ble.bs_name.Contains("GTY0"))
|
||||
{
|
||||
if (!deviceHMap.TryGetValue(ble.bs_name, out var studentNo)) continue;
|
||||
if (!studentMap.TryGetValue(studentNo, out var student)) continue;
|
||||
|
||||
int cd = Array.IndexOf(data, (byte)0xCD);
|
||||
if (cd < 0 || data.Length < cd + 9) continue;
|
||||
|
||||
@ -167,6 +170,9 @@ namespace YD_AllHeartRates.Api.Mqtt
|
||||
|
||||
else if (ble.bs_name.Contains("RS207"))
|
||||
{
|
||||
if (!deviceJMap.TryGetValue(ble.bs_name, out var studentNo)) continue;
|
||||
if (!studentMap.TryGetValue(studentNo, out var student)) continue;
|
||||
|
||||
int mfIndex = IndexOfSequence(data, new byte[] { 0xFF, 0x04, 0xFF, 0xCF });
|
||||
if (mfIndex < 0 || data.Length < mfIndex + 10) continue;
|
||||
|
||||
|
@ -43,6 +43,6 @@
|
||||
"Host": "8.153.108.90",
|
||||
"Port": 1883,
|
||||
"Topic": "heartrates/topic",
|
||||
"BatchSize": 1
|
||||
"BatchSize": 5
|
||||
}
|
||||
}
|
||||
|
@ -14,7 +14,7 @@ using System.Reflection;
|
||||
[assembly: System.Reflection.AssemblyCompanyAttribute("YD_AllHeartRates.Api")]
|
||||
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
|
||||
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
|
||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+ac45401a00234bcfe5b0bc7e4b43ab7a3e737f16")]
|
||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+c01227dcc153e3533d4428f5edc7c1f1bf5bf552")]
|
||||
[assembly: System.Reflection.AssemblyProductAttribute("YD_AllHeartRates.Api")]
|
||||
[assembly: System.Reflection.AssemblyTitleAttribute("YD_AllHeartRates.Api")]
|
||||
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
||||
|
@ -1 +1 @@
|
||||
2a88393a86ca30e91023931fadfc25c17abd0bd7e8685dbc1401c11194e83ca9
|
||||
6784db23a965b9ae2a3dfdaab50ae94c643a7dee1fcca8b9d9cb873fd2636867
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -14,7 +14,7 @@ using System.Reflection;
|
||||
[assembly: System.Reflection.AssemblyCompanyAttribute("YD_AllHeartRates.Commons")]
|
||||
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
|
||||
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
|
||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+e2e455beb818072bf47a3f72e7c28aee0d81f2f6")]
|
||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+c01227dcc153e3533d4428f5edc7c1f1bf5bf552")]
|
||||
[assembly: System.Reflection.AssemblyProductAttribute("YD_AllHeartRates.Commons")]
|
||||
[assembly: System.Reflection.AssemblyTitleAttribute("YD_AllHeartRates.Commons")]
|
||||
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
||||
|
@ -1 +1 @@
|
||||
d4eff73a2911c0cbe9ff04273cfb472f883159a5cf526451a0da84701a7237c0
|
||||
463029ebc318895442edb6fb3984092082e0f3a1f95e6c3cf59e09e021c6eec2
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user