This commit is contained in:
2025-06-10 14:29:34 +02:00
parent 08963fe2f9
commit 3ec64dfc86
30 changed files with 816 additions and 583 deletions

View File

@@ -27,7 +27,7 @@ namespace BeWo.Service.ServiceImplementations
var identity = WindowsIdentity.GetCurrent();
var message = $"{identity.Name} - {identity.IsAuthenticated} - {identity.AuthenticationType}";
ServiceHelper.WriteLogFile("ApiServiceTest", message);
ServiceHelper.CoreLogger.Log(BS.Shared.LogLevel.Debug, message, $"{nameof(ApiServiceImp)}.{nameof(Test)}");
return ApiResponse<string>.SuccessResponse("Hello World!");
}

View File

@@ -3,6 +3,7 @@ using BeWo.Data.Access;
using BeWo.Data.Entities;
using BeWo.Data.Models.XRechnung;
using BeWo.Data.Security;
using BeWo.Service.Core;
using BeWo.Service.DCEntityMapper;
using BeWo.Service.ServiceContracts.Enhanced;
using BeWo.Service.ServiceProxy;
@@ -12,7 +13,9 @@ using BS.Shared.DataContracts;
using BS.Shared.DataContracts.Feature.AI;
using BS.Shared.DataContracts.Invoicing.XRechnung;
using BS.Shared.DataContracts.MikePHPContracts;
using DevExpress.CodeParser;
using DevExpress.Entity.Model.Metadata;
using DevExpress.XtraRichEdit.Model;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
@@ -28,11 +31,23 @@ namespace BeWo.Service.ServiceImplementations.Enhanced
[ServiceBehavior(InstanceContextMode = InstanceContextMode.PerCall, ConcurrencyMode = ConcurrencyMode.Single)]
public class AccountingEnhancedServiceImp : IAccountingEnhancedService
{
public XRechnungResponse CreateXRechnung(long invoice_base_oid, int report_type, string report_url)
public ApiResponse<byte[]> GetXRechnung(long invoice_base_oid, int report_type, string report_url)
{
if (string.IsNullOrWhiteSpace(report_url))
throw new ArgumentNullException(nameof(report_url));
// Hole Parameter
var lStoragePath = MergedConfig.GetSetting(WebConfigSetting.StoredTenantFilesFolderPath);
var lStorage = DAOFactory.GetLocalTenantFileStorage(lStoragePath);
var lFileName = lStorage.GetXRechnungFileName(invoice_base_oid);
var lFile = lStorage.GetFileInfo(BWPFeature.XRechnung, lFileName);
if (lFile is object)
{
}
// Berechne XRechnung
var str = ServiceConfigReader.GetInvoiceTestJsonString();
@@ -42,6 +57,27 @@ namespace BeWo.Service.ServiceImplementations.Enhanced
var response = ServiceFacade.XRechnung.Create(str, token_url);
if (response.Success)
{
//try
//{
// var file = storage.SaveXRechnungPdf(tenant, invoice_base_oid, response.ResponseBytes);
// ServiceHelper.CoreLogger.Log(LogLevel.Info, $"Tenant: {tenant}, FilePath: {file.FilePath}", $"{nameof(LocalFileStorageDAO)}.{nameof(storage.SaveXRechnungPdf)}");
//}
//catch (Exception ex)
//{
// try
// {
// ServiceHelper.CoreLogger.LogError(ex, nameof(GetXRechnung));
// }
// catch(Exception ex2)
// {
// response.Errors.Add("AccountingEnhancedServiceImp: " + ex2.ToString());
// }
// response.Errors.Add("AccountingEnhancedServiceImp: " + ex.ToString());
//}
}
return response;
}
}