AiPromptbaustein erster Wurf

This commit is contained in:
2025-10-20 12:06:25 +02:00
parent 017fa00a71
commit 9d08c20e99
19 changed files with 1180 additions and 8 deletions

View File

@@ -418,7 +418,7 @@ namespace BeWo.Service.ServiceImplementations
.Select(i => GenerateInitialSettlementDCForPeriod(i.CostBearerOids2CostBearerRelOids[pCostBearer], periodStart, periodEnd))
.ToList();
}
public Settlement2DC GenerateDifferenzSettlementDC(long pCostBearer2SupportConceptOid)
{
try
@@ -3524,6 +3524,122 @@ namespace BeWo.Service.ServiceImplementations
modulesToDelete.Add(textModule);
}
public IList<TextModuleDC> GetAllAiPromptbausteine()
{
try
{
var allAiPromptbausteine = DAOFactory.GenericDAO.GetAll<AiPromptbaustein>();
return null; // MapperFactory.AiPromptbausteinDC_AiPromptbaustein.CreateDcList(allAiPromptbausteine);
}
catch (Exception e)
{
throw Utils.CreateBeWoFaultException(e);
}
}
public IList<AiPromptbausteinDC> GetAiPromptbausteineForSelectedSupportConcept(bool shouldShowAllAiPromptbausteine, long employeeOid, bool hasRightToSeeAllAiPromptbausteine, bool isInAdministrationView, long? cb2scOid)
{
try
{
var s = PluginLoader.FindClass<OperationService>();
return null; // s.GetAiPromptbausteineForSelectedSupportConcept(shouldShowAllAiPromptbausteine, employeeOid, hasRightToSeeAllAiPromptbausteine, isInAdministrationView, cb2scOid);
}
catch (Exception e)
{
throw Utils.CreateBeWoFaultException(e);
}
}
public IList<AiPromptbausteinDC> GetAiPromptbausteine(bool shouldShowAllAiPromptbausteine, long employeeOid, bool hasRightToSeeAllAiPromptbausteine, bool isInAdministrationView)
{
try
{
var s = PluginLoader.FindClass<OperationService>();
return null; // s.GetAiPromptbausteine(shouldShowAllAiPromptbausteine, employeeOid, hasRightToSeeAllAiPromptbausteine, isInAdministrationView);
}
catch (Exception e)
{
throw Utils.CreateBeWoFaultException(e);
}
}
public IList<long> InsertNewAiPromptbausteine(IEnumerable<AiPromptbausteinDC> aiPromptbausteinDCs)
{
try
{
var aiPromptbausteine = MapperFactory.AiPromptbausteinDC_AiPromptbaustein.MapToNewEntities(aiPromptbausteinDCs);
foreach (var tm in aiPromptbausteine)
{
tm.IsActive = ActivationTypeId.Active;
}
DAOFactory.GenericDAO.Insert(aiPromptbausteine);
return aiPromptbausteine.Select(asb => asb.Oid.Value).ToList();
}
catch (Exception e)
{
throw Utils.CreateBeWoFaultException(e);
}
}
public void UpdateAiPromptbausteine(List<AiPromptbausteinDC> pTextbausteine)
{
try
{
var lOriginals = DAOFactory.GenericDAO.LoadByIDs<AiPromptbaustein>(pTextbausteine.Select(sc => sc.Oid.Value));
foreach (var item in pTextbausteine)
{
item.ActivationType = ActivationTypeId.Active;
}
MapperFactory.AiPromptbausteinDC_AiPromptbaustein.MergeWithEntitys(pTextbausteine, lOriginals);
DAOFactory.GenericDAO.Update(lOriginals);
}
catch (Exception e)
{
throw Utils.CreateBeWoFaultException(e);
}
}
public void DeleteAiPromptbausteine(Dictionary<long, long> pOid2Version)
{
try
{
var lOriginals = DAOFactory.GenericDAO.LoadByIDs<AiPromptbaustein>(pOid2Version.Select(e => e.Key));
lOriginals.DoForEach(or => MapperFactory.AiPromptbausteinDC_AiPromptbaustein.ConcurrencyCheck(pOid2Version[or.Oid.Value], or));
IList<AiPromptbaustein> modulesToDelete = new List<AiPromptbaustein>();
foreach (var aiPromptbaustein in lOriginals)
{
AddAiPromptbausteinAndChildsToList(aiPromptbaustein, modulesToDelete);
}
DAOFactory.GenericDAO.Delete(modulesToDelete);
}
catch (Exception e)
{
throw Utils.CreateBeWoFaultException(e);
}
}
private void AddAiPromptbausteinAndChildsToList(AiPromptbaustein aiPromptbaustein, IList<AiPromptbaustein> aiPromptbausteineToDelete)
{
var children = DAOFactory.SearchDAO.GetChildAiPromptbausteine(aiPromptbaustein);
foreach (var child in children)
{
AddAiPromptbausteinAndChildsToList(child, aiPromptbausteineToDelete);
}
aiPromptbausteineToDelete.Add(aiPromptbaustein);
}
public IList<ServiceRecordDC> FindServiceRecordsInSpan(long pCostBearer2SupportConceptOid, DateTimeSpan period)
{
try
@@ -9030,5 +9146,25 @@ namespace BeWo.Service.ServiceImplementations
throw Utils.CreateBeWoFaultException(e);
}
}
IList<TextModuleDC> IOperationsService.GetAiPromptbausteine(bool shouldShowAllAiPromptbausteine, long employeeOid, bool hasRightToSeeAllAiPromptbausteine, bool isInAdministrationView)
{
throw new NotImplementedException();
}
IList<TextModuleDC> IOperationsService.GetAiPromptbausteineForSelectedSupportConcept(bool shouldShowAllAiPromptbausteine, long employeeOid, bool hasRightToSeeAllAiPromptbausteine, bool isInAdministrationView, long? cb2scOid)
{
throw new NotImplementedException();
}
IList<long> IOperationsService.InsertNewAiPromptbausteine(IEnumerable<TextModuleDC> aiPromptbausteine)
{
throw new NotImplementedException();
}
void IOperationsService.UpdateAiPromptbausteine(List<TextModuleDC> aiPrompotBausteine)
{
throw new NotImplementedException();
}
}
}