Enable FK2 import
This commit is contained in:
12
.idea/.idea.DiunaBI/.idea/inspectionProfiles/Project_Default.xml
generated
Normal file
12
.idea/.idea.DiunaBI/.idea/inspectionProfiles/Project_Default.xml
generated
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
<component name="InspectionProjectProfileManager">
|
||||||
|
<profile version="1.0">
|
||||||
|
<option name="myName" value="Project Default" />
|
||||||
|
<inspection_tool class="IncorrectHttpHeaderInspection" enabled="true" level="WARNING" enabled_by_default="true">
|
||||||
|
<option name="customHeaders">
|
||||||
|
<set>
|
||||||
|
<option value="D-BI-AUTH" />
|
||||||
|
</set>
|
||||||
|
</option>
|
||||||
|
</inspection_tool>
|
||||||
|
</profile>
|
||||||
|
</component>
|
||||||
@@ -160,6 +160,7 @@ namespace WebAPI.Controllers
|
|||||||
.Where(x =>
|
.Where(x =>
|
||||||
x.Records!.Any(x => x.Code == "Type" && x.Desc1 == "ImportWorker") &&
|
x.Records!.Any(x => x.Code == "Type" && x.Desc1 == "ImportWorker") &&
|
||||||
x.Records!.Any(x => x.Code == "IsEnabled" && x.Desc1 == "True")
|
x.Records!.Any(x => x.Code == "IsEnabled" && x.Desc1 == "True")
|
||||||
|
//&& x.Records!.Any(x => x.Code == "ImportType" && x.Desc1 == "FK2")
|
||||||
)
|
)
|
||||||
.OrderBy(x => x.CreatedAt)
|
.OrderBy(x => x.CreatedAt)
|
||||||
.ToList();
|
.ToList();
|
||||||
@@ -199,22 +200,28 @@ namespace WebAPI.Controllers
|
|||||||
Message = "Success",
|
Message = "Success",
|
||||||
CreatedAt = DateTime.UtcNow
|
CreatedAt = DateTime.UtcNow
|
||||||
});
|
});
|
||||||
return Ok();
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
string? startDate = importWorker.Records!.FirstOrDefault(x => x.Code == "StartDate")?.Desc1;
|
string? startDate = importWorker.Records!.FirstOrDefault(x => x.Code == "StartDate")?.Desc1;
|
||||||
if (startDate == null)
|
if (startDate == null)
|
||||||
{
|
{
|
||||||
throw new Exception("StartDate record nod found");
|
throw new Exception("StartDate record nod found");
|
||||||
}
|
}
|
||||||
|
|
||||||
string? endDate = importWorker.Records!.Where(x => x.Code == "EndDate").First().Desc1;
|
string? endDate = importWorker.Records!.Where(x => x.Code == "EndDate").First().Desc1;
|
||||||
if (endDate == null)
|
if (endDate == null)
|
||||||
{
|
{
|
||||||
throw new Exception("EndDate record nod found");
|
throw new Exception("EndDate record nod found");
|
||||||
}
|
}
|
||||||
|
|
||||||
var startDateParsed = DateTime.ParseExact(startDate!, "yyyy.MM.dd", null);
|
var startDateParsed = DateTime.ParseExact(startDate!, "yyyy.MM.dd", null);
|
||||||
var endDateParsed = DateTime.ParseExact(endDate!, "yyyy.MM.dd", null);
|
var endDateParsed = DateTime.ParseExact(endDate!, "yyyy.MM.dd", null);
|
||||||
if (startDateParsed.Date <= DateTime.UtcNow.Date && endDateParsed.Date >= DateTime.UtcNow.Date)
|
if (startDateParsed.Date <= DateTime.UtcNow.Date &&
|
||||||
|
endDateParsed.Date >= DateTime.UtcNow.Date)
|
||||||
{
|
{
|
||||||
MorskaImporter importer = new MorskaImporter(db, googleSheetValues, this);
|
MorskaImporter importer = new MorskaImporter(db, googleSheetValues, this);
|
||||||
importer.import(importWorker);
|
importer.import(importWorker);
|
||||||
@@ -256,6 +263,7 @@ namespace WebAPI.Controllers
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
logsController.AddEntry(new LogEntry
|
logsController.AddEntry(new LogEntry
|
||||||
|
|||||||
Reference in New Issue
Block a user