Merge branch 'master' into feature_rene_18_ai - kein kommentar...

# Conflicts:
#	BeWo/BeWo.csproj
#	BeWo/BeWoApp.xaml.cs
#	BeWo/ServiceProxy/GeneratedAiEnhancedService.cs
#	BeWo/Services/BeWoControlFactory.cs
#	BeWo/Services/BeWoWindowFactory.cs
#	BeWo/Services/BeWoWindowService.cs
#	BeWo/Services/IControlFactory.cs
#	BeWo/Services/IWindowFactory.cs
#	BeWo/Services/IWindowService.cs
#	BeWo/View/BeWoFileView.xaml
#	BeWo/View/Detail/Report/AbwesenheitsView.xaml
#	BeWo/View/Windows/AnimatedBeWoWindow.xaml.cs
#	BeWo/app.config
#	BeWoAllReports.sln
#	BeWoPlanerMobil.sln
#	BeWoPlanerMobil/.vs/BeWoPlanerMobil.csproj.dtbcache.json
#	BeWoTests.sln
#	Dakota/DakotaUtils.cs
#	Dakota/Logic/DakotaInfoCreator.cs
#	Dakota/Models/DakotaFile.cs
#	Data/Access/GenericDAO.cs
#	Data/Access/SearchDAO.cs
#	Data/Data.csproj
#	Host/Web.config
#	Server/Components/ServerUtils/ApiFacade/WebClientFacade.cs
#	Service/BeWoServiceEnums.cs
#	Service/Core/ServiceHelper.cs
#	Service/Core/ServiceValidator.cs
#	Service/Extensions/ServiceEnumExtension.cs
#	Service/Service.csproj
#	Service/ServiceContracts/Enhanced/IAiEnhancedService.cs
#	Service/ServiceContracts/Enhanced/IOperationsEnhancedService.cs
#	Service/ServiceImplementations/EmployeeServiceImp.cs
#	Service/ServiceImplementations/Enhanced/AiEnhancedServiceImp.cs
#	Service/ServiceImplementations/Enhanced/OperationsEnhancedServiceImp.cs
#	Service/ServiceProxy/OpenWebUIFacade.cs
#	Service/ServiceProxy/ServiceFacade.cs
#	Service/ServiceUtils/DistanceCalculator/GoogleDistanceMatrixAPI.cs
#	Shared/BeWoEntityEnums.cs
#	Shared/Core/AppError.cs
#	Shared/Core/Facade/WebClientFacade.cs
#	Shared/Core/WebClientFacade.cs
#	Shared/Shared.csproj
This commit is contained in:
2025-11-28 12:07:35 +01:00
1059 changed files with 112727 additions and 175550 deletions

View File

@@ -10,10 +10,14 @@ namespace BeWo.Service.ServiceProxy
{
public static class ServiceFacade
{
private static readonly Lazy<OpenWebApiClient> _OpenWebApiClient = new Lazy<OpenWebApiClient>(() => new OpenWebApiClient(MergedConfig.GetSetting("OpenWebUIUrl"), MergedConfig.GetSetting("OpenWebUIKey")));
private static readonly Lazy<OllamaApiClient> _OllamaApiClient = new Lazy<OllamaApiClient>(() => new OllamaApiClient(MergedConfig.GetSetting("OllamaUrl"), MergedConfig.GetSetting("OllamaKey")));
private static readonly Lazy<OpenWebApiClient> _OpenWebApiClient = new Lazy<OpenWebApiClient>(()
=> new OpenWebApiClient(MergedConfig.GetSetting(WebConfigSetting.OpenWebUIUrl), MergedConfig.GetSecretSetting(WebSecretConfigSetting.OpenWebUIKey)));
private static readonly Lazy<OllamaApiClient> _OllamaApiClient = new Lazy<OllamaApiClient>(()
=> new OllamaApiClient(MergedConfig.GetSetting(WebConfigSetting.OllamaWebUIUrl), MergedConfig.GetSecretSetting(WebSecretConfigSetting.OllamaWebUIKey)));
private static readonly Lazy<XRechnungApiClient> _XRechnungFacade = new Lazy<XRechnungApiClient>(() => new XRechnungApiClient());
public static OpenWebApiClient OpenWebApiClient => _OpenWebApiClient.Value;
public static OllamaApiClient OllamaApiClient => _OllamaApiClient.Value;
public static XRechnungApiClient XRechnung => _XRechnungFacade.Value;
}
}

View File

@@ -0,0 +1,60 @@
using BeWo.Data.Entities;
using BeWo.Service.Core;
using BeWo.Service.DCEntityMapper;
using BS.Shared.Core;
using BS.Shared.Core.Facade;
using BS.Shared.DataContracts;
using BS.Shared.DataContracts.Feature.AI;
using BS.Shared.DataContracts.Invoicing.XRechnung;
using DevExpress.XtraRichEdit.Model;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Security.Policy;
using System.Text;
using System.Threading.Tasks;
namespace BeWo.Service.ServiceProxy
{
public class XRechnungApiClient
{
private readonly JsonHttpClientFacade _JsonHttpClientFacade;
public XRechnungApiClient() : this(MergedConfig.GetSetting(WebConfigSetting.XRechnungApiUrl)) { }
public XRechnungApiClient(string base_url)
{
_JsonHttpClientFacade = new JsonHttpClientFacade(base_url);
}
public ApiResponse<byte[]> Create(object xrechnung)
{
_JsonHttpClientFacade.JsonObject = new
{
json = xrechnung
};
var bytes = _JsonHttpClientFacade.SendAsync("create").GetAwaiter().GetResult();
var response = ApiResponse<byte[]>.Parse(bytes);
return response;
}
public ApiResponse<byte[]> Create(object xrechnung, string url)
{
_JsonHttpClientFacade.JsonObject = new
{
json = xrechnung,
pdf = url
};
var bytes = _JsonHttpClientFacade.SendAsync("create").GetAwaiter().GetResult();
var response = ApiResponse<byte[]>.Parse(bytes);
return response;
}
}
}