|
@@ -2,6 +2,7 @@
|
|
using EyeSoft.Collections.Generic;
|
|
using EyeSoft.Collections.Generic;
|
|
using EyeSoft.Extensions;
|
|
using EyeSoft.Extensions;
|
|
using OASystem.Domain;
|
|
using OASystem.Domain;
|
|
|
|
+using OASystem.Domain.Dtos.Groups;
|
|
using OASystem.Domain.Dtos.Resource;
|
|
using OASystem.Domain.Dtos.Resource;
|
|
using OASystem.Domain.Entities.Groups;
|
|
using OASystem.Domain.Entities.Groups;
|
|
using OASystem.Domain.Entities.Resource;
|
|
using OASystem.Domain.Entities.Resource;
|
|
@@ -240,14 +241,7 @@ namespace OASystem.Infrastructure.Repositories.Resource
|
|
string[] CodeList = Regex.Split(blackCode.BlackCode, "\\d+\\.", RegexOptions.IgnoreCase)
|
|
string[] CodeList = Regex.Split(blackCode.BlackCode, "\\d+\\.", RegexOptions.IgnoreCase)
|
|
.Where(str => !string.IsNullOrWhiteSpace(str)).ToArray();
|
|
.Where(str => !string.IsNullOrWhiteSpace(str)).ToArray();
|
|
|
|
|
|
- var threeCodeList = new int[10].Select(x => new
|
|
|
|
- {
|
|
|
|
- code = "",
|
|
|
|
- startTime = DateTime.MinValue,
|
|
|
|
- endTime = DateTime.MinValue,
|
|
|
|
- country = ""
|
|
|
|
- }).ToArray();
|
|
|
|
-
|
|
|
|
|
|
+ var threeCodeList = new List<CountryDataTime>();
|
|
|
|
|
|
//读取单条黑屏代码
|
|
//读取单条黑屏代码
|
|
for (int j = 0; j < CodeList.Count(); j++)
|
|
for (int j = 0; j < CodeList.Count(); j++)
|
|
@@ -274,55 +268,55 @@ namespace OASystem.Infrastructure.Repositories.Resource
|
|
{
|
|
{
|
|
var start = threeCode.Substring(0, 3).ToLower();
|
|
var start = threeCode.Substring(0, 3).ToLower();
|
|
var end = threeCode.Substring(3, 3).ToLower();
|
|
var end = threeCode.Substring(3, 3).ToLower();
|
|
- if (!threeCodeList.Select(x => x.code).Contains(end)) {
|
|
|
|
|
|
+ if (!threeCodeList.Select(x => x.Code).Contains(end)) {
|
|
|
|
|
|
- var temp = threeCodeList[0] with
|
|
|
|
|
|
+ var temp = new CountryDataTime
|
|
{
|
|
{
|
|
- code = end,
|
|
|
|
- startTime = startTime,
|
|
|
|
- endTime = endTime,
|
|
|
|
- country = ""
|
|
|
|
|
|
+ Code = end,
|
|
|
|
+ StartTime = startTime,
|
|
|
|
+ EndTime = endTime,
|
|
|
|
+ Country = ""
|
|
};
|
|
};
|
|
|
|
|
|
- for (int i = 0; i < threeCodeList.Length; i++)
|
|
|
|
- {
|
|
|
|
- if (threeCodeList[i].code.IsNullOrWhiteSpace())
|
|
|
|
- {
|
|
|
|
- threeCodeList[i] = temp;
|
|
|
|
- break;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ threeCodeList.Add(temp);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
var dbThreeCode = _sqlSugar.Queryable<Res_ThreeCode>()
|
|
var dbThreeCode = _sqlSugar.Queryable<Res_ThreeCode>()
|
|
- .Where(x => x.IsDel == 0 && threeCodeList.Select(x => x.code).Contains(x.Three.ToLower()))
|
|
|
|
|
|
+ .Where(x => x.IsDel == 0 && threeCodeList.Select(x => x.Code).Contains(x.Three.ToLower()))
|
|
.ToList();
|
|
.ToList();
|
|
- var data = new ArrayList();
|
|
|
|
|
|
+ var data = new List<CountryDataTime>();
|
|
var info = new List<string>();
|
|
var info = new List<string>();
|
|
|
|
|
|
foreach (var code in dbThreeCode)
|
|
foreach (var code in dbThreeCode)
|
|
{
|
|
{
|
|
- for (int i = 0; i < threeCodeList.Length; i++)
|
|
|
|
|
|
+ for (int i = 0; i < threeCodeList.Count; i++)
|
|
{
|
|
{
|
|
- if (threeCodeList[i].code == code.Three.ToLower()) {
|
|
|
|
- threeCodeList[i] = threeCodeList[i] with
|
|
|
|
- {
|
|
|
|
- country = code.Country,
|
|
|
|
- };
|
|
|
|
|
|
+ if (threeCodeList[i].Code == code.Three.ToLower()) {
|
|
|
|
+ threeCodeList[i].Country = code.Country;
|
|
if (countryArr.Contains(code.Country))
|
|
if (countryArr.Contains(code.Country))
|
|
{
|
|
{
|
|
- data.Add(threeCodeList[i]);
|
|
|
|
|
|
+ var copy = new CountryDataTime
|
|
|
|
+ {
|
|
|
|
+ Code = threeCodeList[i].Code,
|
|
|
|
+ EndTime = threeCodeList[i].EndTime,
|
|
|
|
+ StartTime = threeCodeList[i].StartTime,
|
|
|
|
+ Country = threeCodeList[i].Country,
|
|
|
|
+ };
|
|
|
|
+
|
|
try
|
|
try
|
|
{
|
|
{
|
|
- info.Add($@"{code.Country} 抵达:{threeCodeList[i].endTime.ToString("yyyy-MM-dd HH:mm")} 离开:{threeCodeList[i + 1].startTime.ToString("yyyy-MM-dd HH:mm")} ");
|
|
|
|
|
|
+ threeCodeList[i].StartTime = threeCodeList[i].EndTime;
|
|
|
|
+ threeCodeList[i].EndTime = threeCodeList[i + 1].StartTime;
|
|
|
|
+ info.Add($@"{code.Country} 抵达:{threeCodeList[i].EndTime.ToString("yyyy-MM-dd HH:mm")} 离开:{threeCodeList[i + 1].StartTime.ToString("yyyy-MM-dd HH:mm")} ");
|
|
}
|
|
}
|
|
catch (Exception)
|
|
catch (Exception)
|
|
{
|
|
{
|
|
- info.Add($@"{code.Country} 抵达:{threeCodeList[i].endTime.ToString("yyyy-MM-dd HH:mm")} 离开: 未知 ");
|
|
|
|
|
|
+ threeCodeList[i] = copy;
|
|
|
|
+ info.Add($@"{code.Country} 抵达:{threeCodeList[i].EndTime.ToString("yyyy-MM-dd HH:mm")} 离开: 未知 ");
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+ data.Add(threeCodeList[i]);
|
|
}
|
|
}
|
|
break;
|
|
break;
|
|
}
|
|
}
|