diff --git a/.idea/.idea.DiunaBI/.idea/.gitignore b/.idea/.idea.DiunaBI/.idea/.gitignore
new file mode 100644
index 0000000..9fe0f10
--- /dev/null
+++ b/.idea/.idea.DiunaBI/.idea/.gitignore
@@ -0,0 +1,13 @@
+# Default ignored files
+/shelf/
+/workspace.xml
+# Rider ignored files
+/.idea.DiunaBI.iml
+/contentModel.xml
+/projectSettingsUpdater.xml
+/modules.xml
+# Editor-based HTTP Client requests
+/httpRequests/
+# Datasource local storage ignored files
+/dataSources/
+/dataSources.local.xml
diff --git a/.idea/.idea.DiunaBI/.idea/dataSources.xml b/.idea/.idea.DiunaBI/.idea/dataSources.xml
new file mode 100644
index 0000000..0cca57d
--- /dev/null
+++ b/.idea/.idea.DiunaBI/.idea/dataSources.xml
@@ -0,0 +1,13 @@
+
+
+
+
+ sqlserver.jb
+ true
+ true
+ com.jetbrains.jdbc.sqlserver.SqlServerDriver
+ Server=tcp:127.0.0.1,1433;Initial Catalog=diunabi-morska;Persist Security Info=False;User ID=SA;Password=v](8Lc|RfG;MultipleActiveResultSets=False;Encrypt=False;TrustServerCertificate=False;Connection Timeout=30;
+ $ProjectFileDir$
+
+
+
\ No newline at end of file
diff --git a/.idea/.idea.DiunaBI/.idea/encodings.xml b/.idea/.idea.DiunaBI/.idea/encodings.xml
new file mode 100644
index 0000000..df87cf9
--- /dev/null
+++ b/.idea/.idea.DiunaBI/.idea/encodings.xml
@@ -0,0 +1,4 @@
+
+
+
+
\ No newline at end of file
diff --git a/.idea/.idea.DiunaBI/.idea/indexLayout.xml b/.idea/.idea.DiunaBI/.idea/indexLayout.xml
new file mode 100644
index 0000000..7b08163
--- /dev/null
+++ b/.idea/.idea.DiunaBI/.idea/indexLayout.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/.idea.DiunaBI/.idea/vcs.xml b/.idea/.idea.DiunaBI/.idea/vcs.xml
new file mode 100644
index 0000000..35eb1dd
--- /dev/null
+++ b/.idea/.idea.DiunaBI/.idea/vcs.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/WebAPI/Controllers/LayersController.cs b/WebAPI/Controllers/LayersController.cs
index 927d730..853aaa6 100644
--- a/WebAPI/Controllers/LayersController.cs
+++ b/WebAPI/Controllers/LayersController.cs
@@ -267,12 +267,10 @@ namespace WebAPI.Controllers
}
string[] processTypes = new string[] {
- "T3-SingleSource",
- "T3-MultiSourceSummary",
+ "T3-SingleSource",
"T3-SourceYearSummary",
- "T3-MultiSourceYearSummary",
- "T3-MultiSourceCopySelectedCodes",
- "T3-MultiSourceCopySelectedCodesYearSummary",
+ "T3-MultiSourceSummary", // AA
+ "T3-MultiSourceYearSummary", // AA/13
"T3-R1"
};
diff --git a/WebAPI/Program.cs b/WebAPI/Program.cs
index dfda5ac..a343fb3 100644
--- a/WebAPI/Program.cs
+++ b/WebAPI/Program.cs
@@ -52,11 +52,6 @@ builder.Services.AddAuthentication(options =>
});
builder.Services.AddAuthentication();
-
-// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
-builder.Services.AddEndpointsApiExplorer();
-builder.Services.AddSwaggerGen();
-
builder.Services.AddSingleton(typeof(GoogleSheetsHelper));
builder.Services.AddSingleton(typeof(GoogleDriveHelper));
@@ -74,15 +69,6 @@ app.Use(async (context, next) =>
await next(context);
});
-
-// Configure the HTTP request pipeline.
-if (app.Environment.IsDevelopment())
-{
- app.UseSwagger();
- app.UseSwaggerUI();
-}
-
-// app.UseHttpsRedirection();
app.UseCors("CORSPolicy");
app.UseAuthentication();
diff --git a/WebAPI/Properties/launchSettings.json b/WebAPI/Properties/launchSettings.json
index 8f3b54d..d0e2c3c 100644
--- a/WebAPI/Properties/launchSettings.json
+++ b/WebAPI/Properties/launchSettings.json
@@ -1,31 +1,12 @@
{
"$schema": "https://json.schemastore.org/launchsettings.json",
- "iisSettings": {
- "windowsAuthentication": false,
- "anonymousAuthentication": true,
- "iisExpress": {
- "applicationUrl": "http://localhost:12241",
- "sslPort": 44358
- }
- },
"profiles": {
"WebAPI": {
"commandName": "Project",
- "launchBrowser": true,
- "launchUrl": "swagger",
- "applicationUrl": "https://localhost:7009;http://localhost:5183",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"dotnetRunMessages": true
- },
- "IIS Express": {
- "commandName": "IISExpress",
- "launchBrowser": true,
- "launchUrl": "swagger",
- "environmentVariables": {
- "ASPNETCORE_ENVIRONMENT": "Development"
- }
}
}
}
\ No newline at end of file
diff --git a/WebAPI/dataProcessors/t1.r1.processor.cs b/WebAPI/dataProcessors/t1.r1.processor.cs
index 8936222..21eee97 100644
--- a/WebAPI/dataProcessors/t1.r1.processor.cs
+++ b/WebAPI/dataProcessors/t1.r1.processor.cs
@@ -170,8 +170,8 @@ namespace WebAPI.dataProcessors
public void updateReport()
{
string sheetId = "1pph-XowjlK5CIaCEV_A5buK4ceJ0Z0YoUlDI4VMkhhA";
- string sheetName = "Raport_AB-AA_Eksport";
- SpreadsheetsResource.ValuesResource.GetRequest request = googleSheetValues.Get(sheetId, "D4:EX4");
+ string sheetName = "Raport_R1_Eksport";
+ SpreadsheetsResource.ValuesResource.GetRequest request = googleSheetValues.Get(sheetId, "C4:EX4");
var response = request.Execute();
Layer? R1 = db.Layers
@@ -179,7 +179,7 @@ namespace WebAPI.dataProcessors
.Include(x => x.Records)
.FirstOrDefault();
- int startRow = 16;
+ int startRow = 6;
var codesRow = response.Values[0];
for (int i = 1; i <= DateTime.UtcNow.Month; i++)
@@ -203,7 +203,7 @@ namespace WebAPI.dataProcessors
{
Values = new List> { values }
};
- SpreadsheetsResource.ValuesResource.UpdateRequest update = googleSheetValues.Update(ValueRange, sheetId, $"{sheetName}!D{row}:XZ{row}");
+ SpreadsheetsResource.ValuesResource.UpdateRequest update = googleSheetValues.Update(ValueRange, sheetId, $"{sheetName}!C{row}:XZ{row}");
update.ValueInputOption = SpreadsheetsResource.ValuesResource.UpdateRequest.ValueInputOptionEnum.USERENTERED;
update.Execute();
}
@@ -227,7 +227,7 @@ namespace WebAPI.dataProcessors
{
Values = new List> { valuesSum }
};
- SpreadsheetsResource.ValuesResource.UpdateRequest updateSum = googleSheetValues.Update(ValueRangeSum, sheetId, $"{sheetName}!D{rowSum}:XZ{rowSum}");
+ SpreadsheetsResource.ValuesResource.UpdateRequest updateSum = googleSheetValues.Update(ValueRangeSum, sheetId, $"{sheetName}!C{rowSum}:XZ{rowSum}");
updateSum.ValueInputOption = SpreadsheetsResource.ValuesResource.UpdateRequest.ValueInputOptionEnum.USERENTERED;
updateSum.Execute();
}
diff --git a/WebAPI/dataProcessors/t3.MultiSourceCopySelectedCodesYearSummary.processor.cs b/WebAPI/dataProcessors/t3.MultiSourceCopySelectedCodesYearSummary.processor.cs
index 8d8a384..6e1d26f 100644
--- a/WebAPI/dataProcessors/t3.MultiSourceCopySelectedCodesYearSummary.processor.cs
+++ b/WebAPI/dataProcessors/t3.MultiSourceCopySelectedCodesYearSummary.processor.cs
@@ -28,10 +28,10 @@ namespace WebAPI.dataProcessors
int year = int.Parse(processWorker!.Records?.SingleOrDefault(x => x.Code == "Year")?.Desc1!);
Layer? processedLayer = db.Layers
- .Where(x => x.ParentId == processWorker!.Id
- && !x.IsDeleted)
- .OrderByDescending(x => x.CreatedAt)
- .FirstOrDefault();
+ .Where(x => x.ParentId == processWorker!.Id
+ && !x.IsDeleted)
+ .OrderByDescending(x => x.CreatedAt)
+ .FirstOrDefault();
bool isNew = false;
if (processedLayer == null)
@@ -63,9 +63,9 @@ namespace WebAPI.dataProcessors
for (int i = 1; i < 13; i++)
{
Layer? dataSource = db.Layers.Where(x =>
- x.Type == LayerType.processed
- && !x.IsDeleted
- && x.Name != null && x.Name.Contains($"{year}/{i}-AB-T3"))
+ x.Type == LayerType.processed
+ && !x.IsDeleted
+ && x.Name != null && x.Name.Contains($"{year}/{i}-AB-T3"))
.Include(x => x.Records)
.FirstOrDefault();
if (dataSource != null)
@@ -96,6 +96,7 @@ namespace WebAPI.dataProcessors
ProcessHelper.setValue(processedRecord, i,
codeRecords.Sum(x => ProcessHelper.getValue(x, i)));
}
+
newRecords.Add(processedRecord);
}
@@ -107,259 +108,9 @@ namespace WebAPI.dataProcessors
{
db.Layers.Update(processedLayer);
}
+
controller.SaveRecords(processedLayer.Id, newRecords, Guid.Parse("F392209E-123E-4651-A5A4-0B1D6CF9FF9D"));
db.SaveChanges();
- updateReport();
- }
-
- public void updateReport()
- {
- string sheetId = "1pph-XowjlK5CIaCEV_A5buK4ceJ0Z0YoUlDI4VMkhhA";
- string sheetName = "Raport_AB-AA_Eksport";
- SpreadsheetsResource.ValuesResource.GetRequest request = googleSheetValues.Get(sheetId, "D4:EX4");
- var response = request.Execute();
-
- Layer? january = db.Layers
- .Where(x => x.Number == 572)
- .Include(x => x.Records)
- .FirstOrDefault();
-
- Layer? february = db.Layers
- .Where(x => x.Number == 742)
- .Include(x => x.Records)
- .FirstOrDefault();
-
- Layer? march = db.Layers
- .Where(x => x.Number == 822)
- .Include(x => x.Records)
- .FirstOrDefault();
-
- Layer? april = db.Layers
- .Where(x => x.Number == 1018)
- .Include(x => x.Records)
- .FirstOrDefault();
-
- Layer? may = db.Layers
- .Where(x => x.Number == 1172)
- .Include(x => x.Records)
- .FirstOrDefault();
-
- Layer? sum = db.Layers
- .Where(x => x.Number == 955)
- .Include(x => x.Records)
- .FirstOrDefault();
-
- //AA
- Layer? januaryAA = db.Layers
- .Where(x => x.Number == 568)
- .Include(x => x.Records)
- .FirstOrDefault();
-
- Layer? februaryAA = db.Layers
- .Where(x => x.Number == 741)
- .Include(x => x.Records)
- .FirstOrDefault();
-
- Layer? marchAA = db.Layers
- .Where(x => x.Number == 813)
- .Include(x => x.Records)
- .FirstOrDefault();
-
- Layer? aprilAA = db.Layers
- .Where(x => x.Number == 1017)
- .Include(x => x.Records)
- .FirstOrDefault();
-
- Layer? mayAA = db.Layers
- .Where(x => x.Number == 1171)
- .Include(x => x.Records)
- .FirstOrDefault();
-
- Layer? sumAA = db.Layers
- .Where(x => x.Number == 570)
- .Include(x => x.Records)
- .FirstOrDefault();
-
- List