Ziele und Maßnahmen mit Bewertungen lokal gespeichert.

This commit is contained in:
2025-10-22 13:22:31 +02:00
parent dc56abcdc3
commit 3de300db6d
14 changed files with 329 additions and 161 deletions

View File

@@ -417,10 +417,10 @@ namespace BeWoPlanerMobil.Controllers
Model.SelectedSupportConcept = Model.SupportConcepts.FirstOrDefault(sc => sc.CostBearerRelOids.Any(a => a.Equals(Model.SelectedCostBearerSupportConceptOid)));
}
// Im Einzelbuchungsmodus entweder nichts oder "Hilfeplan auswählen" (-1) ausgewählt.
if(istEinzelBuchung && (!cb2ScOid.HasValue || cb2ScOid.Value == -1))
{
// Im Einzelmodus entweder nichts oder "Hilfeplan auswählen" (-1) ausgewählt.
Model.Categories2Descriptions = new Dictionary<ServiceCategoryDC, List<ServiceDescriptionDC>>();
Model.SelectedGoalOids = new List<long>();
}
@@ -432,7 +432,7 @@ namespace BeWoPlanerMobil.Controllers
{
allC2SOids = Model.GroupBookingSelectedCostBearerSupportConceptOids;
}
else if(cb2ScOid.HasValue && cb2ScOid.Value > 0)
else if(cb2ScOid > 0)
{
allC2SOids.Add(cb2ScOid.Value);
}
@@ -5172,7 +5172,14 @@ namespace BeWoPlanerMobil.Controllers
var selectedGoalOidsInputValue = formCollection[FormCollectionConstants.SelectedGoalOids];
var goalOids = string.IsNullOrWhiteSpace(selectedGoalOidsInputValue) ? new List<long>() : selectedGoalOidsInputValue.Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries).Select(long.Parse).ToList();
var goals2Ratings = string.IsNullOrWhiteSpace(selectedGoalOidsInputValue) ? new Dictionary<long, long?>() : Utils.JsonMap2Dictionary(selectedGoalOidsInputValue);
var goalOids = new List<long>();
foreach(var goal2Rating in goals2Ratings)
{
goalOids.AddIfNotIn(goal2Rating.Key);
}
var isStartDateValid = DateTime.TryParse(dateInputValue, out var startDate);
if(false == isStartDateValid)
@@ -5246,8 +5253,6 @@ namespace BeWoPlanerMobil.Controllers
}
}
// ToDo für den 13.10.2025: Ziele noch einbauen
if(isEndDateValid == false)
{
endDate = startDate;
@@ -5266,6 +5271,61 @@ namespace BeWoPlanerMobil.Controllers
serviceRecord.Employee = Model.AllEmployees.FirstOrDefault(f => f.EmployeeOid == sbEmployeeOid) ?? Model.LoggedInUser.Employee;
}
var scOids = new List<long>();
if(bookingMode is BookingMode.GroupBookingMode || bookingMode is BookingMode.MultiBookingMode)
{
scOids = Model.GroupBookingSelectedCostBearerSupportConcepts.Select(sc2Cb => sc2Cb.SupportConcept.SupportConceptOid).ToList();
}
else
{
scOids.Add(Model.SelectedSupportConcept.SupportConceptOid);
}
var infos = OperationsService.GetSupportConceptTreeNodeDetailInfos(scOids);
LoadGoals(infos);
Model.SelectedGoalOids = new List<long>();
var allGoalOids = Model.AllGoals.Where(w => w.ValueListEntryOid.HasValue).Select(s => s.ValueListEntryOid.Value);
var selectedGoalOids = allGoalOids.Intersect(goalOids).ToList();
Model.SelectedGoalOids = selectedGoalOids;
foreach(var goalOid in Model.SelectedGoalOids)
{
var goal = Model.AllGoals.FirstOrDefault(f => f.ValueListEntryOid.HasValue && f.ValueListEntryOid.Equals(goalOid));
if(goal is null)
{
continue;
}
Model.SelectedGoals.Add(DcToMokMapper.CreateZiel(goal));
}
foreach(var goalOid2RatingOid in goals2Ratings)
{
var goalOid = goalOid2RatingOid.Key;
var ratingTypeOid = goalOid2RatingOid.Value;
if(false == Model.SelectedGoalOids.Contains(goalOid))
{
continue;
}
var goal = Model.SelectedGoals.FirstOrDefault(f => f.ValueListEntryOid.HasValue && f.ValueListEntryOid.Equals(goalOid));
if(goal is null)
{
continue;
}
goal.RatingTypeOid = ratingTypeOid;
}
if(Model.NumberOfDokuTypes == 0)
{
serviceRecord.Notice = doku6;
@@ -5281,7 +5341,7 @@ namespace BeWoPlanerMobil.Controllers
serviceRecord.DistanceInMeter = null;
serviceRecord.DistanceInMeterDecimal = distance;
Model.SelectedServiceRecord = serviceRecord;
TempData[TempDataConstants.AfterRestoreKey] = true;