Skip to content

Commit 311e742

Browse files
committed
Merge branch 'stable' of github.com:microting/eform-backendconfiguration-plugin into stable
2 parents 5c99cc0 + e4b0d9b commit 311e742

File tree

2 files changed

+27
-20
lines changed

2 files changed

+27
-20
lines changed

eFormAPI/Plugins/BackendConfiguration.Pn/BackendConfiguration.Pn/BackendConfiguration.Pn.csproj

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -219,14 +219,14 @@
219219
<PackageReference Include="Google.Apis.Sheets.v4" Version="1.70.0.3819" />
220220
<PackageReference Include="HtmlToOpenXml.dll" Version="3.2.8" />
221221
<PackageReference Include="Ical.Net" Version="5.1.1" />
222-
<PackageReference Include="Microting.eForm" Version="9.0.66" />
223-
<PackageReference Include="Microting.EformAngularFrontendBase" Version="9.0.53" />
224-
<PackageReference Include="Microting.eFormApi.BasePn" Version="9.0.58" />
222+
<PackageReference Include="Microting.eForm" Version="9.0.67" />
223+
<PackageReference Include="Microting.EformAngularFrontendBase" Version="9.0.54" />
224+
<PackageReference Include="Microting.eFormApi.BasePn" Version="9.0.59" />
225225
<PackageReference Include="McMaster.NETCore.Plugins" Version="2.0.0" />
226226
<PackageReference Include="Microting.EformBackendConfigurationBase" Version="9.0.1" />
227-
<PackageReference Include="Microting.eFormCaseTemplateBase" Version="8.0.116" />
228-
<PackageReference Include="Microting.ItemsPlanningBase" Version="8.0.116" />
229-
<PackageReference Include="Microting.TimePlanningBase" Version="9.0.59" />
227+
<PackageReference Include="Microting.eFormCaseTemplateBase" Version="8.0.117" />
228+
<PackageReference Include="Microting.ItemsPlanningBase" Version="8.0.117" />
229+
<PackageReference Include="Microting.TimePlanningBase" Version="9.0.60" />
230230
<PackageReference Include="QuestPDF" Version="2025.7.3" />
231231
<PackageReference Include="HarfBuzzSharp.NativeAssets.Linux" Version="8.3.1.2" />
232232
<PackageReference Include="SkiaSharp.NativeAssets.Linux.NoDependencies" Version="3.119.1" />

eFormAPI/Plugins/BackendConfiguration.Pn/BackendConfiguration.Pn/Infrastructure/Helpers/BackendConfigurationTaskTrackerHelper.cs

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,10 @@ public static async Task<OperationDataResult<List<TaskTrackerModel>>> Index(
7575
.ToListAsync();
7676

7777

78-
var newDate = DateTime.Now;
78+
// var newDate = DateTime.Now;
7979
// var currentDate = new DateTime(newDate.Year, newDate.Month, newDate.Day, 0, 0, 0);
8080
// var endDate = currentDate.AddDays(28);
81-
var weeks = new List<TaskTrackerWeeksListModel>();
81+
// var weeks = new List<TaskTrackerWeeksListModel>();
8282
// var localCurrentDate = currentDate;
8383
// while (localCurrentDate < endDate) // get week numbers
8484
// {
@@ -142,6 +142,25 @@ public static async Task<OperationDataResult<List<TaskTrackerModel>>> Index(
142142
{
143143
continue;
144144
}
145+
var deadlineDate = compliance.Deadline.AddDays(-1);
146+
147+
var areaRulePlanningQuery = backendConfigurationPnDbContext.AreaRulePlannings
148+
.Include(x => x.AreaRulePlanningTags)
149+
.Where(x => x.WorkflowState != Constants.WorkflowStates.Removed)
150+
.Where(x => x.ItemPlanningId == compliance.PlanningId);
151+
152+
var areaRulePlanning = await areaRulePlanningQuery
153+
.Select(x => new { x.AreaRuleId, x.StartDate, x.Id, x.ComplianceEnabled })
154+
.FirstOrDefaultAsync();
155+
156+
if (areaRulePlanning == null) continue;
157+
158+
if (deadlineDate> dateTimeNow && !areaRulePlanning.ComplianceEnabled)
159+
{
160+
var comp = await backendConfigurationPnDbContext.Compliances.FirstAsync(x => x.Id == compliance.Id);
161+
await comp.Delete(backendConfigurationPnDbContext);
162+
continue;
163+
}
145164

146165
var planningSiteIds = await itemsPlanningPnDbContext.PlanningSites
147166
.Where(x => x.PlanningId == compliance.PlanningId)
@@ -183,24 +202,12 @@ public static async Task<OperationDataResult<List<TaskTrackerModel>>> Index(
183202
.ToList();
184203

185204
var workerIds = sitesWithNames.Select(x => x.Key).ToList();
186-
187-
var areaRulePlanningQuery = backendConfigurationPnDbContext.AreaRulePlannings
188-
.Include(x => x.AreaRulePlanningTags)
189-
.Where(x => x.WorkflowState != Constants.WorkflowStates.Removed)
190-
.Where(x => x.ItemPlanningId == compliance.PlanningId);
191-
192-
var areaRulePlanning = await areaRulePlanningQuery
193-
.Select(x => new { x.AreaRuleId, x.StartDate, x.Id })
194-
.FirstOrDefaultAsync();
195-
196-
if (areaRulePlanning == null) continue;
197205
var areaRuleCreatedInWizard = await backendConfigurationPnDbContext.AreaRules
198206
.Where(x => x.Id == areaRulePlanning.AreaRuleId)
199207
.Select(x => x.CreatedInGuide)
200208
.FirstOrDefaultAsync();
201209

202210
var startDate = areaRulePlanning.StartDate ?? planning.StartDate;
203-
var deadlineDate = compliance.Deadline.AddDays(-1);
204211

205212
// var listWithDateTasks = planning.RepeatType switch
206213
// {

0 commit comments

Comments
 (0)