Config all processors for using two digits month number.
This commit is contained in:
@@ -71,7 +71,7 @@ public class T1R1Processor(
|
||||
var dataSource = db.Layers.Where(x =>
|
||||
x.Type == LayerType.Processed &&
|
||||
!x.IsDeleted &&
|
||||
x.Name != null && x.Name.Contains($"{year}/{monthCopy}-{source.Desc1}-T3")
|
||||
x.Name != null && x.Name.Contains($"{year}/{monthCopy:D2}-{source.Desc1}-T3")
|
||||
).Include(x => x.Records)
|
||||
.FirstOrDefault();
|
||||
|
||||
@@ -159,7 +159,7 @@ public class T1R1Processor(
|
||||
newRecords.AddRange(records.Select(x => new Record
|
||||
{
|
||||
Id = Guid.NewGuid(),
|
||||
Code = x.Code + month.ToString("D2"),
|
||||
Code = $"{x.Code}{month:D2}",
|
||||
CreatedAt = DateTime.UtcNow,
|
||||
ModifiedAt = DateTime.UtcNow,
|
||||
Value1 = x.Value32
|
||||
@@ -194,8 +194,6 @@ public class T1R1Processor(
|
||||
.Include(x => x.Records)
|
||||
.FirstOrDefault();
|
||||
|
||||
const int startRow = 6;
|
||||
|
||||
var codesRow = response.Values[0];
|
||||
|
||||
var valueRange = new ValueRange
|
||||
@@ -206,11 +204,9 @@ public class T1R1Processor(
|
||||
for (var i = 1; i <= 12; i++)
|
||||
{
|
||||
var values = new List<object>();
|
||||
var month = i < 10 ? $"0{i}" : i.ToString();
|
||||
var row = (startRow + i).ToString();
|
||||
foreach (string code in codesRow)
|
||||
{
|
||||
var record = r1!.Records?.SingleOrDefault(x => x.Code == $"{code}{month}");
|
||||
var record = r1!.Records?.SingleOrDefault(x => x.Code == $"{code}{i:D2}");
|
||||
if (record != null)
|
||||
{
|
||||
values.Add(record.Value1!.Value);
|
||||
@@ -226,8 +222,6 @@ public class T1R1Processor(
|
||||
// sum
|
||||
var valuesSum = new List<object>();
|
||||
var emptyRow = new List<object>();
|
||||
var rowEmpty = (startRow + 13).ToString();
|
||||
var rowSum = (startRow + 14).ToString();
|
||||
foreach (string code in codesRow)
|
||||
{
|
||||
var record = r1!.Records?.SingleOrDefault(x => x.Code == $"{code}13");
|
||||
|
||||
Reference in New Issue
Block a user