MH: AWO Münster KannAllesWeißAlles

This commit is contained in:
2023-08-22 14:20:17 +02:00
parent 44f8beebac
commit d7b469f671
3 changed files with 44 additions and 12 deletions

View File

@@ -10,6 +10,7 @@ namespace AWOMuensterlandRecklinghausen.Reporting
public OrganisationDC Schule { get; set; } // Klientenorganisation, bei der Rolle "Schule" enthält
public OrganisationDC Kostentraeger { get; set; } // Klientenorganisation, bei der Rolle "KT" enthält
public SupportConceptDC Hilfeplan { get; set; }
public string HilfeplanPausenabzug { get; set; }
public CostBearer2SupportConcept cb2sc { get; set; }
public string Bewilligungsbezeichnungen { get; set; }
public Dictionary<CostBearer2SupportConcept, List<SupportConceptApprovalPeriod>> Bewilligungen { get; set; }

View File

@@ -13,7 +13,7 @@ using DevExpress.XtraReports.UI;
namespace AWOMuensterlandRecklinghausen.Reporting
{
public class KannAllesWeissAllesRO
public class KannAllesWeissAllesRO
{
public DateTime Berichtsdatum { get; set; }
public List<CustomerRelations> AllCustomerRelations { get; set; }
@@ -53,7 +53,7 @@ namespace AWOMuensterlandRecklinghausen.Reporting
allCustomerOids.Add(c.CustomerOid.Value);
}
//var allSupportConcepts = MapperFactory.SupportConceptDC_SupportConcept.MapToNewDCs(DAOFactory.SearchDAO.GetAllActiveSupportConceptsByCustomers(allCustomerOids, false));
var allSupportConcepts = DAOFactory.GenericDAO.GetAllActive<CostBearer2SupportConcept>();
var allCb2Sc = DAOFactory.GenericDAO.GetAllActive<CostBearer2SupportConcept>();
// 2. Für jeden einzelnen Customer alle Infos suchen und ins Dictionary speichern
foreach (var customer in allCustomers)
@@ -129,7 +129,7 @@ namespace AWOMuensterlandRecklinghausen.Reporting
if (customer.CustomerVarFields.Count >= 10)
cr.Klienteninformationen.NotizZurPlanDB = VarfieldHelper.GetKlientenVarfields(customer, 23);
if (customer.CustomerVarFields.Count >= 11)
cr.Klienteninformationen.PlanSchule= VarfieldHelper.GetKlientenVarfields(customer, 24);
cr.Klienteninformationen.PlanSchule = VarfieldHelper.GetKlientenVarfields(customer, 24);
if (customer.CustomerVarFields.Count >= 12)
cr.Klienteninformationen.GeplanteStunden = VarfieldHelper.GetKlientenVarfields(customer, 25);
if (customer.CustomerVarFields.Count >= 13)
@@ -260,7 +260,7 @@ namespace AWOMuensterlandRecklinghausen.Reporting
if (cr.Schulbegleitung.EmployeeVarFields.Count >= 4)
cr.SchulbegleitungKontaktdaten.SchulungenG42 = VarfieldHelper.GetSchulbegleitungVarfields(cr.Schulbegleitung, 60);
if (cr.Schulbegleitung.EmployeeVarFields.Count >= 5)
cr.SchulbegleitungKontaktdaten.SchulungenG42NaechsterTermin= VarfieldHelper.GetSchulbegleitungVarfields(cr.Schulbegleitung, 61);
cr.SchulbegleitungKontaktdaten.SchulungenG42NaechsterTermin = VarfieldHelper.GetSchulbegleitungVarfields(cr.Schulbegleitung, 61);
if (cr.Schulbegleitung.EmployeeVarFields.Count >= 6)
cr.SchulbegleitungKontaktdaten.SchulungenDS = VarfieldHelper.GetSchulbegleitungVarfields(cr.Schulbegleitung, 62);
if (cr.Schulbegleitung.EmployeeVarFields.Count >= 7)
@@ -499,13 +499,23 @@ namespace AWOMuensterlandRecklinghausen.Reporting
Console.WriteLine("Test");
// 6 Hilfeplan und Bewilligungen setzen
var hp = allSupportConcepts.OrderByDescending(sc => sc.StartDate).FirstOrDefault(sc => sc.SupportConcept.Customer.Oid == customer.CustomerOid);
var hp = allCb2Sc.OrderByDescending(sc => sc.StartDate).FirstOrDefault(sc => sc.SupportConcept.IsActive == BS.Shared.ActivationTypeId.Active && sc.SupportConcept.Customer.Oid == customer.CustomerOid);
if (hp != null)
{
cr.cb2sc = hp;
cr.Hilfeplaninfo = hp.AuswahlBezeichnung;
cr.Bewilligungsbezeichnungen = "";
// Varfields raussuchen und setzen
if (hp.SupportConcept != null)
{
var sc = MapperFactory.SupportConceptDC_SupportConcept.MapToNewDC(hp.SupportConcept);
if (sc != null)
{
if (sc.VarFields.Count >= 1)
cr.HilfeplanPausenabzug = VarfieldHelper.GetHilfeplanVarfields(sc, 90);
}
}
// 6.1 Ansprechpartner raussuchen
if (hp.CostBearerContactPerson != null)
{
@@ -521,7 +531,7 @@ namespace AWOMuensterlandRecklinghausen.Reporting
Contact fax = null;
if (kostentraegerKontaktperson.Contacts != null && kostentraegerKontaktperson.Contacts.Count > 0)
{
mail = kostentraegerKontaktperson.Contacts.FirstOrDefault(c => c.Type == BS.Shared.ContactType.private_Mail );
mail = kostentraegerKontaktperson.Contacts.FirstOrDefault(c => c.Type == BS.Shared.ContactType.private_Mail);
telefon = kostentraegerKontaktperson.Contacts.FirstOrDefault(c => c.Type == BS.Shared.ContactType.private_Phone);
mobil = kostentraegerKontaktperson.Contacts.FirstOrDefault(c => c.Type == BS.Shared.ContactType.private_MobilePhone);
mail = kostentraegerKontaktperson.Contacts.FirstOrDefault(c => c.Type == BS.Shared.ContactType.private_Mail);
@@ -579,18 +589,19 @@ namespace AWOMuensterlandRecklinghausen.Reporting
ro.AllCustomerRelations.Add(cr);
}
// 7.0 am Ende noch alle Mitarbeitenden, die keine Klientenzuordnung haben, als Springer einfügen (CustomerRelations leer außer MA)
// 7.0 am Ende noch alle Mitarbeitenden, die keine Klientenzuordnung haben oder Springer sind, als Springer einfügen (CustomerRelations leer außer MA)
var mitarbeiterOhneKlienten = MapperFactory.EmployeeDC_Employee.MapToNewDCs(DAOFactory.GenericDAO.GetAllActive<Employee>()).OrderBy(e => e.LastName).ToList()
.Where(e => e.RelatedCustomers == null || e.RelatedCustomers != null && e.RelatedCustomers.Count == 0).ToList();
.Where(e => e.RelatedCustomers == null || e.RelatedCustomers != null && e.RelatedCustomers.Count == 0
|| e.RelatedCustomers.Any(c => c.RelationRole.DisplayName.ToLower().Contains("springer"))).ToList();
foreach (var emp in mitarbeiterOhneKlienten)
{
ro.AllCustomerRelations.Add(new CustomerRelations()
{
Schulbegleitung = emp,
Schulbegleiterinfo = emp.Notice2
});
});
}
return ro;

View File

@@ -18,7 +18,7 @@ namespace AWOMuensterlandRecklinghausen.Reporting
if (customer.LastName == "Coerdt" && varFieldDefOid == 14)
Console.WriteLine("Test");
if (customer.CustomerVarFields != null && customer.CustomerVarFields.Count > 0)
if (customer.CustomerVarFields != null && customer.CustomerVarFields.Count > 0)
{
var vv = customer.CustomerVarFields.FirstOrDefault(v => v.VarFieldDefOid == varFieldDefOid);
@@ -138,7 +138,27 @@ namespace AWOMuensterlandRecklinghausen.Reporting
}
}
return valueAsString;
}
public static string GetHilfeplanVarfields(SupportConceptDC supportConcept, long? varFieldDefOid)
{
string valueAsString = "";
if (supportConcept.VarFields != null && supportConcept.VarFields.Count > 0)
{
var vv = supportConcept.VarFields.FirstOrDefault(v => v.VarFieldDefOid == varFieldDefOid);
if (vv.VarFieldValue != null || varFieldDefOid == 90)
{
switch (varFieldDefOid)
{
case 90: // Pausenabzug
valueAsString = vv.VarFieldValue as bool? == true ? "Ja" : "Nein";
break;
}
}
}
return valueAsString;
}