temp
This commit is contained in:
@@ -98,6 +98,7 @@
|
||||
<Compile Include="Converter\AddressToStringConverter.cs" />
|
||||
<Compile Include="Converter\Features\AiConversationMessageSystemConverter.cs" />
|
||||
<Compile Include="Converter\NewlineConverter.cs" />
|
||||
<Compile Include="ServiceProxy\GeneratedAccountingEnhancedService.cs" />
|
||||
<Compile Include="ServiceProxy\GeneratedAiEnhancedService.cs" />
|
||||
<Compile Include="Services\BeWoControlFactory.cs" />
|
||||
<Compile Include="Services\BeWoWindowFactory.cs" />
|
||||
|
||||
@@ -2045,19 +2045,6 @@ namespace BeWo.Core
|
||||
BeWoApp.MainControl.EndWaiting();
|
||||
}
|
||||
|
||||
public static void ShowPdfWindow(byte[] bytes)
|
||||
=> ShowPdfWindow(new MemoryStream(bytes));
|
||||
public static void ShowPdfWindow(MemoryStream ms)
|
||||
{
|
||||
var control = new PdfViewer();
|
||||
|
||||
control.PdfData = ms;
|
||||
|
||||
var window = BeWoWindowBuilder.GetBeWoWindow("eRechnung", control);
|
||||
|
||||
window.Show();
|
||||
}
|
||||
|
||||
public static PasswortSecurityStrength CheckPasswordSecurity(string paswd)
|
||||
{
|
||||
PasswortSicherheit pwS = new PasswortSicherheit();
|
||||
|
||||
33
BeWo/Scripts/ServiceReferences_AccountingEnhancedService.bat
Normal file
33
BeWo/Scripts/ServiceReferences_AccountingEnhancedService.bat
Normal file
@@ -0,0 +1,33 @@
|
||||
..\svcutil.exe /noConfig /noLogo /edb /n:*,BeWo.ServiceProxy /out:..\ServiceProxy\GeneratedAccountingEnhancedService.cs /ct:System.Collections.Generic.List`1 /r:..\..\Shared\bin\Debug\BS.Shared.dll http://localhost:3777/Host/AccountingEnhancedService.svc?wsdl
|
||||
|
||||
@echo off
|
||||
setlocal EnableDelayedExpansion
|
||||
|
||||
set "input=..\ServiceProxy\GeneratedAccountingEnhancedService.cs"
|
||||
set "output=temp.txt"
|
||||
set /a start=12
|
||||
set /a end=162
|
||||
set /a line=0
|
||||
|
||||
REM Zeilen zählen
|
||||
set /a total=0
|
||||
for /f "usebackq delims=" %%A in ("%input%") do (
|
||||
set /a total+=1
|
||||
)
|
||||
|
||||
REM Nur löschen, wenn genug Zeilen vorhanden
|
||||
if %total% leq %end% (
|
||||
echo Datei hat nur %total% Zeilen – nichts wird gelöscht.
|
||||
copy /y "%input%" "%input2%"
|
||||
goto :eof
|
||||
)
|
||||
|
||||
> "%output%" (
|
||||
for /f "usebackq delims=" %%A in ("%input%") do (
|
||||
set /a line+=1
|
||||
if !line! lss %start% echo(%%A
|
||||
if !line! gtr %end% echo(%%A
|
||||
)
|
||||
)
|
||||
|
||||
move /y "%output%" "%input%"
|
||||
@@ -0,0 +1,23 @@
|
||||
@echo off
|
||||
REM Diese Batch-Datei führt eine andere Batch-Datei aus und schreibt das Ergebnis in eine Log-Datei
|
||||
|
||||
REM Pfad zur anderen Batch-Datei
|
||||
set "SCRIPT_PATH=ServiceReferences_AccountingEnhancedService.bat"
|
||||
|
||||
REM Pfad zur Log-Datei
|
||||
set "LOG_FILE=ServiceReferences_AccountingEnhancedService_Log.log.txt"
|
||||
|
||||
REM Leere die Log-Datei vor dem Start
|
||||
echo. > %LOG_FILE%
|
||||
|
||||
REM Führe die andere Batch-Datei aus und leite die Ausgabe in die Log-Datei um
|
||||
call %SCRIPT_PATH% >> %LOG_FILE% 2>&1
|
||||
|
||||
REM Überprüfe, ob die Ausführung erfolgreich war
|
||||
if %errorlevel% equ 0 (
|
||||
echo Die Ausführung von %SCRIPT_PATH% war erfolgreich. >> %LOG_FILE%
|
||||
) else (
|
||||
echo Die Ausführung von %SCRIPT_PATH% ist fehlgeschlagen. >> %LOG_FILE%
|
||||
)
|
||||
|
||||
echo Log wurde in %LOG_FILE% geschrieben.
|
||||
61
BeWo/ServiceProxy/GeneratedAccountingEnhancedService.cs
Normal file
61
BeWo/ServiceProxy/GeneratedAccountingEnhancedService.cs
Normal file
@@ -0,0 +1,61 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// Dieser Code wurde von einem Tool generiert.
|
||||
// Laufzeitversion:4.0.30319.42000
|
||||
//
|
||||
// Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn
|
||||
// der Code erneut generiert wird.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
namespace BeWo.ServiceProxy
|
||||
{
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
|
||||
[System.ServiceModel.ServiceContractAttribute(ConfigurationName="BeWo.ServiceProxy.IAccountingEnhancedService")]
|
||||
public interface IAccountingEnhancedService
|
||||
{
|
||||
|
||||
[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IAccountingEnhancedService/CreateXRechnung", ReplyAction="http://tempuri.org/IAccountingEnhancedService/CreateXRechnungResponse")]
|
||||
[System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IAccountingEnhancedService/CreateXRechnungBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")]
|
||||
byte[] CreateXRechnung(long invoice_base_oid, int report_type, string report_url);
|
||||
}
|
||||
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
|
||||
public interface IAccountingEnhancedServiceChannel : BeWo.ServiceProxy.IAccountingEnhancedService, System.ServiceModel.IClientChannel
|
||||
{
|
||||
}
|
||||
|
||||
[System.Diagnostics.DebuggerStepThroughAttribute()]
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
|
||||
public partial class AccountingEnhancedServiceClient : System.ServiceModel.ClientBase<BeWo.ServiceProxy.IAccountingEnhancedService>, BeWo.ServiceProxy.IAccountingEnhancedService
|
||||
{
|
||||
|
||||
public AccountingEnhancedServiceClient()
|
||||
{
|
||||
}
|
||||
|
||||
public AccountingEnhancedServiceClient(string endpointConfigurationName) :
|
||||
base(endpointConfigurationName)
|
||||
{
|
||||
}
|
||||
|
||||
public AccountingEnhancedServiceClient(string endpointConfigurationName, string remoteAddress) :
|
||||
base(endpointConfigurationName, remoteAddress)
|
||||
{
|
||||
}
|
||||
|
||||
public AccountingEnhancedServiceClient(string endpointConfigurationName, System.ServiceModel.EndpointAddress remoteAddress) :
|
||||
base(endpointConfigurationName, remoteAddress)
|
||||
{
|
||||
}
|
||||
|
||||
public AccountingEnhancedServiceClient(System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) :
|
||||
base(binding, remoteAddress)
|
||||
{
|
||||
}
|
||||
|
||||
public byte[] CreateXRechnung(long invoice_base_oid, int report_type, string report_url)
|
||||
{
|
||||
return base.Channel.CreateXRechnung(invoice_base_oid, report_type, report_url);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -20,9 +20,7 @@ namespace BeWo.ServiceProxy
|
||||
|
||||
[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IOperationsEnhancedService/CreateXRechnung", ReplyAction="http://tempuri.org/IOperationsEnhancedService/CreateXRechnungResponse")]
|
||||
[System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IOperationsEnhancedService/CreateXRechnungBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")]
|
||||
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(BeWo.ServiceProxy.BeWoFault))]
|
||||
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(BeWo.ServiceProxy.BeWoFaultType))]
|
||||
object CreateXRechnung(long invoice_base_oid, int report_type, string report_url);
|
||||
byte[] CreateXRechnung(long invoice_base_oid, int report_type, string report_url);
|
||||
}
|
||||
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
|
||||
@@ -64,7 +62,7 @@ namespace BeWo.ServiceProxy
|
||||
base.Channel.HelloWorld();
|
||||
}
|
||||
|
||||
public object CreateXRechnung(long invoice_base_oid, int report_type, string report_url)
|
||||
public byte[] CreateXRechnung(long invoice_base_oid, int report_type, string report_url)
|
||||
{
|
||||
return base.Channel.CreateXRechnung(invoice_base_oid, report_type, report_url);
|
||||
}
|
||||
|
||||
@@ -65,7 +65,8 @@ namespace BeWo.ServiceProxy
|
||||
{ typeof(IAccountingService), new EndpointAddress(_ServerName + "AccountingService.svc") },
|
||||
{ typeof(IGkvAccountingService), new EndpointAddress(_ServerName + "GkvAccountingService.svc") },
|
||||
{ typeof(IReportService), new EndpointAddress(_ServerName + "ReportService.svc") },
|
||||
{ typeof(IAiEnhancedService), new EndpointAddress(_ServerName + "AiEnhancedService.svc") }
|
||||
{ typeof(IAiEnhancedService), new EndpointAddress(_ServerName + "AiEnhancedService.svc") },
|
||||
{ typeof(IAccountingEnhancedService), new EndpointAddress(_ServerName + "AccountingEnhancedService.svc") }
|
||||
};
|
||||
|
||||
}
|
||||
@@ -75,6 +76,17 @@ namespace BeWo.ServiceProxy
|
||||
_ProxyCache = new Dictionary<Type, object>();
|
||||
}
|
||||
|
||||
#region AccountingEnhancedService
|
||||
public static void DoAccountingEnhancedServiceSnyc(Action<IAccountingEnhancedService> pAction)
|
||||
=> DoSync<AccountingEnhancedServiceClient, IAccountingEnhancedService>(pAction);
|
||||
public static T DoAccountingEnhancedServiceSnyc<T>(Func<IAccountingEnhancedService, T> pFunc)
|
||||
=> DoSync<AccountingEnhancedServiceClient, IAccountingEnhancedService, T>(pFunc);
|
||||
public static void DoAccountingEnhancedServiceAsnyc(Action<IAccountingEnhancedService> pAction, Action pCallback = null, Action<Exception> pErrorCallback = null, bool showWaitDialog = true, UserControl caller = null)
|
||||
=> DoAsync<AccountingEnhancedServiceClient, IAccountingEnhancedService>(pAction, pCallback, pErrorCallback, showWaitDialog, caller?.Dispatcher);
|
||||
public static void DoAccountingEnhancedServiceAsnyc<T>(Func<IAccountingEnhancedService, T> pFunc, Action<T> pCallback = null, Action<Exception> pErrorCallback = null, bool showWaitDialog = true, UserControl caller = null)
|
||||
=> DoAsync<AccountingEnhancedServiceClient, IAccountingEnhancedService, T>(pFunc, pCallback, pErrorCallback, showWaitDialog, caller?.Dispatcher);
|
||||
#endregion
|
||||
|
||||
#region AiEnhancedService
|
||||
public static void DoAiEnhancedServiceSnyc(Action<IAiEnhancedService> pAction)
|
||||
=> DoSync<AiEnhancedServiceClient, IAiEnhancedService>(pAction);
|
||||
|
||||
@@ -9,17 +9,25 @@ using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Controls.Primitives;
|
||||
|
||||
namespace BeWo.Services
|
||||
{
|
||||
internal class BeWoWindowFactory : IWindowFactory
|
||||
{
|
||||
public AnimatedBeWoWindow GetAnimatedBeWoWindow(string title, Control control, double height, double width)
|
||||
public AnimatedBeWoWindow GetAnimatedBeWoWindow(string title, Control control, double? height, double? width)
|
||||
{
|
||||
var beWoWindow = new AnimatedBeWoWindow();
|
||||
|
||||
beWoWindow.Height = height;
|
||||
beWoWindow.Width = width;
|
||||
if (height is double h)
|
||||
beWoWindow.Height = h;
|
||||
else
|
||||
beWoWindow.Height = double.NaN;
|
||||
|
||||
if (width is double w)
|
||||
beWoWindow.Width = w;
|
||||
else
|
||||
beWoWindow.Width = double.NaN;
|
||||
|
||||
beWoWindow.WindowStartupLocation = WindowStartupLocation.CenterOwner;
|
||||
beWoWindow.Owner = BeWoApp.CurrentBeWo.MainWindow;
|
||||
|
||||
@@ -52,6 +52,13 @@ namespace BeWo.Services
|
||||
height, width);
|
||||
}
|
||||
|
||||
public void ShowERechnungWindow(MemoryStream pdf)
|
||||
{
|
||||
ShowWindowDialog(
|
||||
"E-Rechnung",
|
||||
cf => cf.GetPdfViewer(pdf));
|
||||
}
|
||||
|
||||
public void ShowERechnungModalViewWindow(MemoryStream pdf)
|
||||
{
|
||||
ShowModalViewWindow(
|
||||
@@ -67,6 +74,19 @@ namespace BeWo.Services
|
||||
height, width);
|
||||
}
|
||||
|
||||
public void ShowPdfViewerWindow(string title, MemoryStream pdf, double height = 900, double width = 600)
|
||||
{
|
||||
ShowWindowDialog(title,
|
||||
cf => cf.GetPdfViewer(pdf),
|
||||
height, width);
|
||||
}
|
||||
|
||||
public void ShowPdfViewerModalViewWindow(string title, MemoryStream pdf)
|
||||
{
|
||||
ShowModalViewWindow(title,
|
||||
cf => cf.GetPdfViewer(pdf));
|
||||
}
|
||||
|
||||
public void ShowGkvAbrechnungDetailWindow(GkvAbrechnungVM vm, CancelEventHandler cancelEvent, double height, double width)
|
||||
{
|
||||
// Kleiner Hack
|
||||
@@ -80,45 +100,31 @@ namespace BeWo.Services
|
||||
|
||||
private void ShowWindow(Func<IWindowFactory, string> getTitle, Func<IControlFactory, Control> getControl, double height, double width)
|
||||
=> ShowWindow(getTitle(_windowFactory), getControl, height, width);
|
||||
private void ShowWindowDialog(Func<IWindowFactory, string> getTitle, Func<IControlFactory, Control> getControl, double height, double width)
|
||||
private void ShowWindowDialog(Func<IWindowFactory, string> getTitle, Func<IControlFactory, Control> getControl, double? height = null, double? width = null)
|
||||
=> ShowWindowDialog(getTitle(_windowFactory), getControl, height, width);
|
||||
private void ShowModalViewWindow(Func<IWindowFactory, string> getTitle, Func<IControlFactory, Control> getControl)
|
||||
=> ShowModalViewWindow(getTitle(_windowFactory), getControl);
|
||||
private void ShowModalViewWindow(Func<IWindowFactory, string> getTitle, Func<IControlFactory, Control> getControl, double height, double width)
|
||||
private void ShowModalViewWindow(Func<IWindowFactory, string> getTitle, Func<IControlFactory, Control> getControl, double? height = null, double? width = null)
|
||||
=> ShowModalViewWindow(getTitle(_windowFactory), getControl, height, width);
|
||||
|
||||
private void ShowWindow(string title, Func<IControlFactory, Control> getControl, double height, double width)
|
||||
private void ShowWindow(string title, Func<IControlFactory, Control> getControl, double? height = null, double? width = null)
|
||||
{
|
||||
var control = getControl(_controlFactory);
|
||||
var window = _windowFactory.GetAnimatedBeWoWindow(title, control, height, width);
|
||||
window.Show();
|
||||
}
|
||||
|
||||
private void ShowWindowDialog(string title, Func<IControlFactory, Control> getControl, double height, double width)
|
||||
private void ShowWindowDialog(string title, Func<IControlFactory, Control> getControl, double? height = null, double? width = null)
|
||||
{
|
||||
var control = getControl(_controlFactory);
|
||||
var window = _windowFactory.GetAnimatedBeWoWindow(title, control, height, width);
|
||||
window.ShowDialog();
|
||||
}
|
||||
|
||||
private void ShowModalViewWindow(string title, Func<IControlFactory, Control> getControl)
|
||||
{
|
||||
var control = getControl(_controlFactory);
|
||||
var window = _windowFactory.GetGenericModalViewWindow(title, control);
|
||||
window.CommandBindings.Add(new CommandBinding(ApplicationCommands.Close, (s, e) => BeWoApp.MainControl.CloseCurrentPopUp()));
|
||||
BeWoApp.MainControl.ShowControlAsModalPopup(window);
|
||||
}
|
||||
|
||||
private void ShowModalViewWindow(string title, Func<IControlFactory, Control> getControl, double height, double width)
|
||||
private void ShowModalViewWindow(string title, Func<IControlFactory, Control> getControl, double? height = null, double? width = null)
|
||||
{
|
||||
var control = getControl(_controlFactory);
|
||||
var window = _windowFactory.GetGenericModalViewWindow(title, control, height, width);
|
||||
window.CommandBindings.Add(new CommandBinding(ApplicationCommands.Close, (s, e) => BeWoApp.MainControl.CloseCurrentPopUp()));
|
||||
BeWoApp.MainControl.ShowControlAsModalPopup(window);
|
||||
}
|
||||
public void ShowTest(string str)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace BeWo.Services
|
||||
{
|
||||
internal interface IWindowFactory
|
||||
{
|
||||
AnimatedBeWoWindow GetAnimatedBeWoWindow(string title, Control control, double height, double width);
|
||||
AnimatedBeWoWindow GetAnimatedBeWoWindow(string title, Control control, double? height = null, double? width = null);
|
||||
Control GetGenericModalViewWindow(string title, Control control, double? height = null, double? width = null);
|
||||
|
||||
string GetAiTitle(UIContext context);
|
||||
|
||||
@@ -14,13 +14,23 @@ namespace BeWo.Services
|
||||
{
|
||||
internal interface IWindowService
|
||||
{
|
||||
#region special
|
||||
void ShowAiConversationWindow(UIContext uIContext, Dictionary<TableID, long[]> bewoObjects, long? reference_oid = null, double height = 600, double width = 1200);
|
||||
void ShowAiConversationModalViewWindow(UIContext uIContext, Dictionary<TableID, long[]> bewoObjects, long? reference_oid = null, double height = 600, double width = 1200);
|
||||
|
||||
void ShowERechnungModalViewWindow(MemoryStream pdf);
|
||||
void ShowGkvAbrechnungDetailWindow(GkvAbrechnungVM vm, CancelEventHandler cancelEvent, double height = 900, double width = 600);
|
||||
#endregion
|
||||
|
||||
#region base extended
|
||||
void ShowERechnungWindow(MemoryStream pdf);
|
||||
void ShowERechnungModalViewWindow(MemoryStream pdf);
|
||||
#endregion
|
||||
|
||||
#region base
|
||||
void ShowTextViewerWindow(string title, string text, double height = 900, double width = 600);
|
||||
|
||||
void ShowGkvAbrechnungDetailWindow(GkvAbrechnungVM vm, CancelEventHandler cancelEvent, double height = 900, double width = 600);
|
||||
void ShowPdfViewerWindow(string title, MemoryStream pdf, double height = 900, double width = 600);
|
||||
void ShowPdfViewerModalViewWindow(string title, MemoryStream pdf);
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,7 +27,8 @@
|
||||
BorderThickness="1"
|
||||
Foreground="Black"
|
||||
IsReadOnly="True"
|
||||
VerticalScrollBarVisibility="Auto" />
|
||||
VerticalScrollBarVisibility="Auto"
|
||||
HorizontalScrollBarVisibility="Auto"/>
|
||||
</Grid>
|
||||
|
||||
<Button
|
||||
|
||||
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Security.Policy;
|
||||
using System.Text;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Documents;
|
||||
@@ -656,8 +657,26 @@ namespace BeWo.View.Detail.Accounting
|
||||
var report_link = vm.ReportLink;
|
||||
|
||||
ServiceFacade.DoOperationsEnhancedServiceAsnyc(
|
||||
x => x.CreateXRechnung(invoice_base_oid, invoice_type, report_link),
|
||||
cb => BeWoApp.MainControl.WindowService.ShowTextViewerWindow("Debug", cb as string));
|
||||
x => x.CreateXRechnung(invoice_base_oid, invoice_type, report_link),
|
||||
cb =>
|
||||
{
|
||||
|
||||
|
||||
if (cb is byte[] bytes)
|
||||
{
|
||||
File.WriteAllBytes(@"C:\Users\ownSoft\Desktop\XRechnung\test.pdf", bytes);
|
||||
|
||||
var t = Encoding.ASCII.GetString(bytes);
|
||||
|
||||
File.WriteAllText(@"C:\Users\ownSoft\Desktop\XRechnung\test2.pdf", t);
|
||||
|
||||
BeWoApp.MainControl.WindowService.ShowTextViewerWindow("Test", t);
|
||||
|
||||
//BeWoApp.MainControl.WindowService.ShowERechnungWindow(new MemoryStream(bytes));
|
||||
}
|
||||
else
|
||||
MessageBox.Show("cb is null");
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using BS.Shared.Interface;
|
||||
using System;
|
||||
|
||||
namespace BeWo.Data.Access
|
||||
{
|
||||
@@ -23,5 +24,10 @@ namespace BeWo.Data.Access
|
||||
public static ScriptDAO ScriptDAO => _ScriptDAO.Value;
|
||||
public static SearchDAO SearchDAO => _SearchDAO.Value;
|
||||
public static UserDAO UserDAO => _UserDAO.Value;
|
||||
|
||||
public static IFileStorageDAO GetLocalFileStorage(string rootpath)
|
||||
{
|
||||
return new LocalFileStorageDAO(rootpath);
|
||||
}
|
||||
}
|
||||
}
|
||||
66
Data/Access/LocalFileStorageDAO.cs
Normal file
66
Data/Access/LocalFileStorageDAO.cs
Normal file
@@ -0,0 +1,66 @@
|
||||
using BS.Shared;
|
||||
using BS.Shared.Interface;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace BeWo.Data.Access
|
||||
{
|
||||
public class LocalFileStorageDAO : IFileStorageDAO
|
||||
{
|
||||
private readonly string _rootPath;
|
||||
|
||||
public LocalFileStorageDAO(string rootPath)
|
||||
{
|
||||
_rootPath = rootPath;
|
||||
}
|
||||
|
||||
private string GetFilePath(string customerId, BWPFeature feature, string fileName)
|
||||
{
|
||||
return Path.Combine(_rootPath, customerId, feature.ToString(), fileName);
|
||||
}
|
||||
|
||||
public async Task SaveFileAsync(string customerId, BWPFeature feature, string fileName, Stream content, CancellationToken cancellationToken = default)
|
||||
{
|
||||
var path = GetFilePath(customerId, feature, fileName);
|
||||
var directory = Path.GetDirectoryName(path);
|
||||
Directory.CreateDirectory(directory);
|
||||
|
||||
using (var stream = File.Create(path))
|
||||
{
|
||||
await content.CopyToAsync(stream, bufferSize: 81920, cancellationToken).ConfigureAwait(true);
|
||||
};
|
||||
}
|
||||
|
||||
public Task<bool> FileExistsAsync(string customerId, BWPFeature feature, string fileName, CancellationToken cancellationToken = default)
|
||||
{
|
||||
return Task.FromResult(File.Exists(GetFilePath(customerId, feature, fileName)));
|
||||
}
|
||||
|
||||
public Task<Stream> GetFileAsync(string customerId, BWPFeature feature, string fileName, CancellationToken cancellationToken = default)
|
||||
{
|
||||
var path = GetFilePath(customerId, feature, fileName);
|
||||
if (!File.Exists(path))
|
||||
return Task.FromResult<Stream>(null);
|
||||
|
||||
Stream stream = File.OpenRead(path);
|
||||
return Task.FromResult(stream);
|
||||
}
|
||||
|
||||
public Task<bool> DeleteFileAsync(string customerId, BWPFeature feature, string fileName, CancellationToken cancellationToken = default)
|
||||
{
|
||||
var path = GetFilePath(customerId, feature, fileName);
|
||||
if (File.Exists(path))
|
||||
{
|
||||
File.Delete(path);
|
||||
return Task.FromResult(true);
|
||||
}
|
||||
|
||||
return Task.FromResult(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -212,6 +212,7 @@
|
||||
<Compile Include="Access\DAOFactory.cs" />
|
||||
<Compile Include="Access\GenericDAO.cs" />
|
||||
<Compile Include="Access\FinanceDAO.cs" />
|
||||
<Compile Include="Access\LocalFileStorageDAO.cs" />
|
||||
<Compile Include="Access\OrganisationDAO.cs" />
|
||||
<Compile Include="Access\ScriptDAO.cs" />
|
||||
<Compile Include="Access\SearchDAO.cs" />
|
||||
|
||||
1
Host/AccountingEnhancedService.svc
Normal file
1
Host/AccountingEnhancedService.svc
Normal file
@@ -0,0 +1 @@
|
||||
<%@ ServiceHost Language="C#" Debug="true" Service="BeWo.Service.ServiceImplementations.Enhanced.AccountingEnhancedServiceImp" %>
|
||||
@@ -1 +1 @@
|
||||
<%@ ServiceHost Language="C#" Debug="true" Service="BeWo.Service.ServiceImplementations.AiEnhancedServiceImp" %>
|
||||
<%@ ServiceHost Language="C#" Debug="true" Service="BeWo.Service.ServiceImplementations.Enhanced.AiEnhancedServiceImp" %>
|
||||
|
||||
@@ -426,6 +426,7 @@
|
||||
<Content Include="GkvAbrechnungClient.aspx" />
|
||||
<Content Include="GkvAbrechnungServer.aspx" />
|
||||
<Content Include="AiEnhancedService.svc" />
|
||||
<Content Include="AccountingEnhancedService.svc" />
|
||||
<Content Include="OperationsEnhancedService.svc" />
|
||||
<Content Include="ReportService.svc" />
|
||||
<Content Include="EmployeeService.svc" />
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
using BeWo.Data;
|
||||
using BeWo.Data.Access;
|
||||
using BeWo.Service.ServiceImplementations;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
@@ -1 +1 @@
|
||||
<%@ ServiceHost Language="C#" Debug="true" Service="BeWo.Service.ServiceImplementations.OperationsEnhancedServiceImp" %>
|
||||
<%@ ServiceHost Language="C#" Debug="true" Service="BeWo.Service.ServiceImplementations.Enhanced.OperationsEnhancedServiceImp" %>
|
||||
|
||||
@@ -13,7 +13,6 @@ using BeWo.Data;
|
||||
using BeWo.Data.Access;
|
||||
using BeWo.Data.Entities;
|
||||
using BeWo.Service.DCEntityMapper;
|
||||
using BeWo.Service.ServiceImplementations;
|
||||
|
||||
using BS.Shared;
|
||||
using BS.Shared.Extensions;
|
||||
|
||||
@@ -10,5 +10,5 @@
|
||||
<add key="GetGkvSumApiKey" value=""/>
|
||||
<add key="DownloadReportApiKey" value=""/>
|
||||
<add key="OpenrouteServiceApiKey" value="" />
|
||||
<add key="GoogleDistanceMatrixApiKey" value="" />
|
||||
<add key="GoogleDistanceMatrixApiKey" value="" />
|
||||
</appSettings>
|
||||
@@ -184,11 +184,14 @@
|
||||
<service behaviorConfiguration="returnFaults" name="BeWo.Service.ServiceImplementations.ApiStreamServiceImp">
|
||||
<endpoint behaviorConfiguration="webHttpBehaviorConfig" binding="webHttpBinding" bindingConfiguration="webHttpStreamBindingConfig" name="ApiStreamServiceEndpoint" contract="BeWo.Service.ServiceContracts.IApiStreamService" />
|
||||
</service>
|
||||
<service behaviorConfiguration="returnFaults" name="BeWo.Service.ServiceImplementations.OperationsEnhancedServiceImp">
|
||||
<endpoint behaviorConfiguration="SecurityAndSessionAndWCFErrorBehavior" binding="basicHttpBinding" bindingConfiguration="TransportSecurity" name="OperationsEnhancedServiceEndpoint" contract="BeWo.Service.ServiceContracts.IOperationsEnhancedService" />
|
||||
<service behaviorConfiguration="returnFaults" name="BeWo.Service.ServiceImplementations.Enhanced.OperationsEnhancedServiceImp">
|
||||
<endpoint behaviorConfiguration="SecurityAndSessionAndWCFErrorBehavior" binding="basicHttpBinding" bindingConfiguration="TransportSecurity" name="OperationsEnhancedServiceEndpoint" contract="BeWo.Service.ServiceContracts.Enhanced.IOperationsEnhancedService" />
|
||||
</service>
|
||||
<service behaviorConfiguration="returnFaults" name="BeWo.Service.ServiceImplementations.AiEnhancedServiceImp">
|
||||
<endpoint behaviorConfiguration="SecurityAndSessionAndWCFErrorBehavior" binding="basicHttpBinding" bindingConfiguration="TransportSecurity" name="AiEnhancedServiceEndpoint" contract="BeWo.Service.ServiceContracts.IAiEnhancedService" />
|
||||
<service behaviorConfiguration="returnFaults" name="BeWo.Service.ServiceImplementations.Enhanced.AccountingEnhancedServiceImp">
|
||||
<endpoint behaviorConfiguration="SecurityAndSessionAndWCFErrorBehavior" binding="basicHttpBinding" bindingConfiguration="TransportSecurity" name="AccountingEnhancedServiceEndpoint" contract="BeWo.Service.ServiceContracts.Enhanced.IAccountingEnhancedService" />
|
||||
</service>
|
||||
<service behaviorConfiguration="returnFaults" name="BeWo.Service.ServiceImplementations.Enhanced.AiEnhancedServiceImp">
|
||||
<endpoint behaviorConfiguration="SecurityAndSessionAndWCFErrorBehavior" binding="basicHttpBinding" bindingConfiguration="TransportSecurity" name="AiEnhancedServiceEndpoint" contract="BeWo.Service.ServiceContracts.Enhanced.IAiEnhancedService" />
|
||||
</service>
|
||||
</services>
|
||||
<bindings>
|
||||
|
||||
@@ -6,7 +6,6 @@ using BeWo.Data.Entities;
|
||||
using BeWo.Data.Access;
|
||||
using BeWo.Service.DCEntityMapper;
|
||||
using BeWo.Service.Plugins;
|
||||
using BeWo.Service.ServiceImplementations;
|
||||
using BS.Shared.Core;
|
||||
using BS.Shared;
|
||||
using BS.Shared.Extensions;
|
||||
|
||||
@@ -6,7 +6,6 @@ using BeWo.Report;
|
||||
using BeWo.Data.Entities;
|
||||
using BeWo.Data.Access;
|
||||
using BeWo.Service.Configuration;
|
||||
using BeWo.Service.ServiceImplementations;
|
||||
using BS.Shared;
|
||||
using BS.Shared.Core;
|
||||
using BS.Shared.Extensions;
|
||||
|
||||
@@ -6,7 +6,6 @@ using BeWo.Data.Access;
|
||||
using BeWo.Data.Entities;
|
||||
using BeWo.Service.Plugins;
|
||||
using BS.Shared.DataContracts;
|
||||
using BeWo.Service.ServiceImplementations;
|
||||
|
||||
namespace BeWo.Service.DCEntityMapper
|
||||
{
|
||||
|
||||
@@ -3,7 +3,6 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using BeWo.Data.Access;
|
||||
using BeWo.Data.Entities;
|
||||
using BeWo.Service.ServiceImplementations;
|
||||
using BS.Shared;
|
||||
using BS.Shared.DataContracts;
|
||||
using BS.Shared.Extensions;
|
||||
|
||||
@@ -7,7 +7,6 @@ using BeWo.Data.Access;
|
||||
using BeWo.Data.Entities;
|
||||
using BeWo.Service.DCEntityMapper;
|
||||
using BeWo.Service.Plugins;
|
||||
using BeWo.Service.ServiceImplementations;
|
||||
|
||||
using BS.Shared;
|
||||
using BS.Shared.Core;
|
||||
|
||||
@@ -7,7 +7,6 @@ using BeWo.Data.Access;
|
||||
using BeWo.Data.Entities;
|
||||
using BeWo.Service.DCEntityMapper;
|
||||
using BeWo.Service.Plugins;
|
||||
using BeWo.Service.ServiceImplementations;
|
||||
|
||||
using BS.Shared;
|
||||
using BS.Shared.Core;
|
||||
|
||||
@@ -10,7 +10,6 @@ using BeWo.Service.Configuration;
|
||||
using BeWo.Service.Core;
|
||||
using BeWo.Service.DCEntityMapper;
|
||||
using BeWo.Service.Invoicing;
|
||||
using BeWo.Service.ServiceContracts;
|
||||
using BS.Shared;
|
||||
using BS.Shared.Core;
|
||||
using BS.Shared.DataContracts;
|
||||
|
||||
@@ -10,7 +10,6 @@ using BeWo.Data.Entities;
|
||||
using BeWo.Service.Core;
|
||||
using BeWo.Service.DCEntityMapper;
|
||||
using BeWo.Service.Invoicing;
|
||||
using BeWo.Service.ServiceContracts;
|
||||
using BS.Shared;
|
||||
using BS.Shared.Core;
|
||||
using BS.Shared.DataContracts;
|
||||
|
||||
@@ -12,7 +12,6 @@ using BeWo.Data;
|
||||
using BeWo.Data.Access;
|
||||
using BeWo.Data.Entities;
|
||||
using BeWo.Service.Core;
|
||||
using BeWo.Service.ServiceContracts;
|
||||
using BeWo.Service.ServiceUtils;
|
||||
using BS.Shared.Attributes;
|
||||
using BS.Shared.Extensions;
|
||||
|
||||
@@ -520,6 +520,7 @@
|
||||
<Compile Include="ServiceBehavior\WCFError\WCFErrorBehaviorExtension.cs" />
|
||||
<Compile Include="ServiceBehavior\WCFError\WCFErrorHandler.cs" />
|
||||
<Compile Include="ServiceContracts\BeWoFault.cs" />
|
||||
<Compile Include="ServiceContracts\Enhanced\IAccountingEnhancedService.cs" />
|
||||
<Compile Include="ServiceContracts\IAccountingService.cs" />
|
||||
<Compile Include="ServiceContracts\IAdminService.cs" />
|
||||
<Compile Include="ServiceContracts\IAnalysisService.cs" />
|
||||
@@ -527,8 +528,8 @@
|
||||
<Compile Include="ServiceContracts\IApiService.cs" />
|
||||
<Compile Include="ServiceContracts\IGkvAccountingService.cs" />
|
||||
<Compile Include="ServiceContracts\IMailService.cs" />
|
||||
<Compile Include="ServiceContracts\IAiEnhancedService.cs" />
|
||||
<Compile Include="ServiceContracts\IOperationsEnhancedService.cs" />
|
||||
<Compile Include="ServiceContracts\Enhanced\IAiEnhancedService.cs" />
|
||||
<Compile Include="ServiceContracts\Enhanced\IOperationsEnhancedService.cs" />
|
||||
<Compile Include="ServiceContracts\IOperationsService.cs" />
|
||||
<Compile Include="ServiceContracts\IDownloadService.cs" />
|
||||
<Compile Include="ServiceContracts\IEmployeeService.cs" />
|
||||
@@ -543,10 +544,11 @@
|
||||
<Compile Include="ServiceImplementations\ApiServiceImp.cs" />
|
||||
<Compile Include="ServiceImplementations\AdminServiceImp.cs" />
|
||||
<Compile Include="ServiceImplementations\AnalysisServiceImp.cs" />
|
||||
<Compile Include="ServiceImplementations\Enhanced\AccountingEnhancedServiceImp.cs" />
|
||||
<Compile Include="ServiceImplementations\GkvAccountingServiceImp.cs" />
|
||||
<Compile Include="ServiceImplementations\MailServiceImp.cs" />
|
||||
<Compile Include="ServiceImplementations\AiEnhancedServiceImp.cs" />
|
||||
<Compile Include="ServiceImplementations\OperationsEnhancedServiceImp.cs" />
|
||||
<Compile Include="ServiceImplementations\Enhanced\AiEnhancedServiceImp.cs" />
|
||||
<Compile Include="ServiceImplementations\Enhanced\OperationsEnhancedServiceImp.cs" />
|
||||
<Compile Include="ServiceImplementations\OperationsServiceImp.cs" />
|
||||
<Compile Include="ServiceImplementations\QueryServiceImp.cs" />
|
||||
<Compile Include="ServiceImplementations\SearchServiceImp.cs" />
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
using BeWo.Data.Entities;
|
||||
using BS.Shared;
|
||||
using BS.Shared.Attributes;
|
||||
using BS.Shared.DataContracts;
|
||||
using BS.Shared.DataContracts.Feature.AI;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.ServiceModel;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace BeWo.Service.ServiceContracts.Enhanced
|
||||
{
|
||||
[ServiceContract]
|
||||
public interface IAccountingEnhancedService : IService
|
||||
{
|
||||
[FaultContract(typeof(BeWoFault))]
|
||||
[OperationContract]
|
||||
byte[] CreateXRechnung(long invoice_base_oid, int report_type, string report_url);
|
||||
}
|
||||
}
|
||||
@@ -10,7 +10,7 @@ using System.ServiceModel;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace BeWo.Service.ServiceContracts
|
||||
namespace BeWo.Service.ServiceContracts.Enhanced
|
||||
{
|
||||
[ServiceContract]
|
||||
public interface IAiEnhancedService : IService
|
||||
@@ -10,17 +10,13 @@ using System.ServiceModel;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace BeWo.Service.ServiceContracts
|
||||
namespace BeWo.Service.ServiceContracts.Enhanced
|
||||
{
|
||||
[ServiceContract]
|
||||
public interface IOperationsEnhancedService : IService
|
||||
{
|
||||
[FaultContract(typeof(BeWoFault))]
|
||||
[OperationContract]
|
||||
void HelloWorld();
|
||||
|
||||
[FaultContract(typeof(BeWoFault))]
|
||||
[OperationContract]
|
||||
object CreateXRechnung(long invoice_base_oid, int report_type, string report_url);
|
||||
string HelloWorld();
|
||||
}
|
||||
}
|
||||
@@ -24,17 +24,5 @@ namespace BeWo.Service.ServiceContracts
|
||||
[WebInvoke(UriTemplate = "/GetGkvSum", Method = "POST", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
|
||||
[RequireApiKey("GetGkvSumApiKey")]
|
||||
ApiResponse<decimal> GetGkvAbrechnungSumme(AdminServiceSumReqDC request);
|
||||
|
||||
[OperationContract]
|
||||
[WebInvoke(UriTemplate = "/DownloadReport", Method = "POST", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
|
||||
[RequireApiKey("DownloadReportApiKey")]
|
||||
[RequireNoTenant]
|
||||
ApiResponse<byte[]> DownloadReport();
|
||||
|
||||
[OperationContract]
|
||||
[WebGet(UriTemplate = "/DownloadReport", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
|
||||
[RequireApiKey("DownloadReportApiKey")]
|
||||
[RequireNoTenant]
|
||||
ApiResponse<byte[]> DownloadReport2();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ namespace BeWo.Service.ServiceContracts
|
||||
public interface IApiStreamService
|
||||
{
|
||||
[OperationContract]
|
||||
[WebInvoke(UriTemplate = "/DownloadReport", Method = "POST", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
|
||||
[WebGet(UriTemplate = "/DownloadReport", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
|
||||
[RequireApiKey("DownloadReportApiKey")]
|
||||
[RequireNoTenant]
|
||||
Stream DownloadReport();
|
||||
|
||||
@@ -45,25 +45,5 @@ namespace BeWo.Service.ServiceImplementations
|
||||
|
||||
return ApiResponse<decimal>.SuccessResponse(sum ?? 0);
|
||||
}
|
||||
|
||||
public ApiResponse<byte[]> DownloadReport()
|
||||
{
|
||||
string filename = "xrechnung.pdf";
|
||||
|
||||
string filePath = Path.Combine(@"C:\Users\ownSoft\Desktop\XRechnung\", filename);
|
||||
if (!File.Exists(filePath))
|
||||
throw new FileNotFoundException("Datei nicht gefunden");
|
||||
|
||||
// Setze die Header
|
||||
WebOperationContext.Current.OutgoingResponse.ContentType = "application/pdf";
|
||||
WebOperationContext.Current.OutgoingResponse.Headers.Add(
|
||||
"Content-Disposition", $"attachment; filename=\"{filename}\"");
|
||||
|
||||
var data = File.ReadAllBytes(filePath);
|
||||
|
||||
return ApiResponse<byte[]>.SuccessResponse(data);
|
||||
}
|
||||
|
||||
public ApiResponse<byte[]> DownloadReport2() => DownloadReport();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,23 +32,18 @@ namespace BeWo.Service.ServiceImplementations
|
||||
WebOperationContext.Current.OutgoingResponse.Headers.Add(
|
||||
"Content-Disposition", $"attachment; filename=\"{filename}\"");
|
||||
|
||||
return new FileStream(filePath, FileMode.Open, FileAccess.Read);
|
||||
}
|
||||
|
||||
public Stream DownloadReport2()
|
||||
{
|
||||
string filename = "xrechnung.pdf";
|
||||
|
||||
string filePath = Path.Combine(@"C:\Users\ownSoft\Desktop\XRechnung\", filename);
|
||||
if (!File.Exists(filePath))
|
||||
throw new FileNotFoundException("Datei nicht gefunden");
|
||||
|
||||
// Setze die Header
|
||||
WebOperationContext.Current.OutgoingResponse.ContentType = "application/pdf";
|
||||
WebOperationContext.Current.OutgoingResponse.Headers.Add(
|
||||
"Content-Disposition", $"attachment; filename=\"{filename}\"");
|
||||
|
||||
return new FileStream(filePath, FileMode.Open, FileAccess.Read);
|
||||
FileStream f = new FileStream(filePath, FileMode.Open);
|
||||
int length = (int)f.Length;
|
||||
WebOperationContext.Current.OutgoingResponse.ContentLength = length;
|
||||
byte[] buffer = new byte[length];
|
||||
int sum = 0;
|
||||
int count;
|
||||
while ((count = f.Read(buffer, sum, length - sum)) > 0)
|
||||
{
|
||||
sum += count;
|
||||
}
|
||||
f.Close();
|
||||
return new MemoryStream(buffer);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ using BeWo.Data.Entities;
|
||||
using BeWo.Data.Models.XRechnung;
|
||||
using BeWo.Data.Security;
|
||||
using BeWo.Service.DCEntityMapper;
|
||||
using BeWo.Service.ServiceContracts;
|
||||
using BeWo.Service.ServiceContracts.Enhanced;
|
||||
using BeWo.Service.ServiceProxy;
|
||||
using BeWo.Service.ServiceUtils;
|
||||
using BeWo.Service.ServiceUtils.XRechnung;
|
||||
@@ -24,17 +24,12 @@ using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace BeWo.Service.ServiceImplementations
|
||||
namespace BeWo.Service.ServiceImplementations.Enhanced
|
||||
{
|
||||
[ServiceBehavior(InstanceContextMode = InstanceContextMode.PerCall, ConcurrencyMode = ConcurrencyMode.Single)]
|
||||
public class OperationsEnhancedServiceImp : IOperationsEnhancedService
|
||||
public class AccountingEnhancedServiceImp : IAccountingEnhancedService
|
||||
{
|
||||
public void HelloWorld()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public object CreateXRechnung(long invoice_base_oid, int report_type, string report_url)
|
||||
public byte[] CreateXRechnung(long invoice_base_oid, int report_type, string report_url)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(report_url))
|
||||
throw new ArgumentNullException(nameof(report_url));
|
||||
@@ -4,7 +4,7 @@ using BeWo.Data.Entities;
|
||||
using BeWo.Data.Security;
|
||||
using BeWo.Service.AI;
|
||||
using BeWo.Service.DCEntityMapper;
|
||||
using BeWo.Service.ServiceContracts;
|
||||
using BeWo.Service.ServiceContracts.Enhanced;
|
||||
using BeWo.Service.ServiceProxy;
|
||||
using BeWo.Service.ServiceUtils;
|
||||
using BS.Shared;
|
||||
@@ -27,7 +27,7 @@ using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Interop;
|
||||
|
||||
namespace BeWo.Service.ServiceImplementations
|
||||
namespace BeWo.Service.ServiceImplementations.Enhanced
|
||||
{
|
||||
[ServiceBehavior(InstanceContextMode = InstanceContextMode.PerCall, ConcurrencyMode = ConcurrencyMode.Single)]
|
||||
public class AiEnhancedServiceImp : IAiEnhancedService
|
||||
@@ -0,0 +1,37 @@
|
||||
using BeWo.Data;
|
||||
using BeWo.Data.Access;
|
||||
using BeWo.Data.Entities;
|
||||
using BeWo.Data.Models.XRechnung;
|
||||
using BeWo.Data.Security;
|
||||
using BeWo.Service.DCEntityMapper;
|
||||
using BeWo.Service.ServiceContracts.Enhanced;
|
||||
using BeWo.Service.ServiceProxy;
|
||||
using BeWo.Service.ServiceUtils;
|
||||
using BeWo.Service.ServiceUtils.XRechnung;
|
||||
using BS.Shared;
|
||||
using BS.Shared.DataContracts;
|
||||
using BS.Shared.DataContracts.Feature.AI;
|
||||
using BS.Shared.DataContracts.Invoicing.XRechnung;
|
||||
using BS.Shared.DataContracts.MikePHPContracts;
|
||||
using DevExpress.Entity.Model.Metadata;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Security.Cryptography;
|
||||
using System.ServiceModel;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace BeWo.Service.ServiceImplementations.Enhanced
|
||||
{
|
||||
[ServiceBehavior(InstanceContextMode = InstanceContextMode.PerCall, ConcurrencyMode = ConcurrencyMode.Single)]
|
||||
public class OperationsEnhancedServiceImp : IOperationsEnhancedService
|
||||
{
|
||||
public string HelloWorld()
|
||||
{
|
||||
return "OperationEnhancedService: Hello World!";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -16,7 +16,7 @@ namespace BeWo.Service.ServiceProxy
|
||||
{
|
||||
public class XRechnungFacade : WebClientFacade
|
||||
{
|
||||
public string Create(object xrechnung, string url)
|
||||
public byte[] Create(object xrechnung, string url)
|
||||
{
|
||||
var sub_url = "create";
|
||||
|
||||
@@ -26,7 +26,7 @@ namespace BeWo.Service.ServiceProxy
|
||||
pdf = url
|
||||
};
|
||||
|
||||
var test = SendPostUploadValues<object, string>(sub_url, payload);
|
||||
var test = SendPostUploadValues<object, byte[]>(sub_url, payload);
|
||||
|
||||
return test;
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ namespace BeWo.Service.ServiceUtils.DistanceCalculator
|
||||
}
|
||||
|
||||
private string Key { get; set; }
|
||||
private string GeoKey { get; set; }
|
||||
private string GeoUrl { get; set; }
|
||||
private string Url { get; set; }
|
||||
|
||||
private AddressRouteMatrix Matrix { get; set; }
|
||||
@@ -63,11 +63,11 @@ namespace BeWo.Service.ServiceUtils.DistanceCalculator
|
||||
Key = MergedConfig.GetSecretSetting("OpenrouteServiceApiKey");
|
||||
if (string.IsNullOrEmpty(Key))
|
||||
{
|
||||
throw new Exception("OpenrouteServiceApiKey is not set in AppSettings.");
|
||||
throw new Exception("OpenrouteServiceApiKey is not set.");
|
||||
}
|
||||
|
||||
GeoKey = appSettings["OpenrouteServiceApiUrlGeocode"];
|
||||
if (string.IsNullOrEmpty(GeoKey))
|
||||
GeoUrl = appSettings["OpenrouteServiceApiUrlGeocode"];
|
||||
if (string.IsNullOrEmpty(GeoUrl))
|
||||
{
|
||||
throw new Exception("OpenrouteServiceApiUrlGeocode is not set in AppSettings.");
|
||||
}
|
||||
@@ -208,7 +208,7 @@ namespace BeWo.Service.ServiceUtils.DistanceCalculator
|
||||
private string GetGeocodeUrl(Address address)
|
||||
{
|
||||
var html = HttpUtility.UrlEncode(AddressRouteManager.AddressToString(address));
|
||||
return $"{GeoKey}?api_key={Key}&text={html}&sources=openstreetmap&size=1";
|
||||
return $"{GeoUrl}?api_key={Key}&text={html}&sources=openstreetmap&size=1";
|
||||
}
|
||||
|
||||
private string GetMatrixBodyContentString()
|
||||
|
||||
@@ -9,7 +9,6 @@ using System.ServiceModel.Channels;
|
||||
using System.ServiceModel.Dispatcher;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using BeWo.Service.ServiceContracts;
|
||||
using BS.Shared.Attributes;
|
||||
using BS.Shared.Extensions;
|
||||
using NHibernate.Hql.Ast.ANTLR.Tree;
|
||||
|
||||
@@ -1365,4 +1365,11 @@ namespace BS.Shared
|
||||
Assistent,
|
||||
User
|
||||
}
|
||||
|
||||
public enum BWPFeature
|
||||
{
|
||||
XRechnung = 10,
|
||||
GkvAbrechnung = 11,
|
||||
AiConversation = 12,
|
||||
}
|
||||
}
|
||||
@@ -26,6 +26,11 @@ namespace BS.Shared.Core
|
||||
InnerErrors = innerErrors;
|
||||
}
|
||||
|
||||
public AppError()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
//public static readonly AppError Example = new AppError("Code", "Message");
|
||||
|
||||
public static readonly Func<OrganisationDC, AppError> GkvDatenannahmestelleAdresseNotFound = (dc) => new AppError("GKV.70001", $"Unbekannte Datenannahmestelle. Bitte neu in der Organisation {dc.Name} ermitteln");
|
||||
|
||||
@@ -154,11 +154,14 @@ namespace BS.Shared.Core
|
||||
private T deserialize<T>(string input)
|
||||
{
|
||||
if (string.IsNullOrEmpty(input))
|
||||
return default(T);
|
||||
return default;
|
||||
|
||||
if (typeof(T) == typeof(String))
|
||||
if (typeof(T) == typeof(string))
|
||||
return (T)(object)input;
|
||||
|
||||
if (typeof(T) == typeof(byte[]))
|
||||
return (T)(object)Encoding.UTF8.GetBytes(input);
|
||||
|
||||
var t = JsonConvert.DeserializeObject<T>(input);
|
||||
|
||||
return t;
|
||||
|
||||
18
Shared/Interface/IFileStorageDAO.cs
Normal file
18
Shared/Interface/IFileStorageDAO.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace BS.Shared.Interface
|
||||
{
|
||||
public interface IFileStorageDAO
|
||||
{
|
||||
Task SaveFileAsync(string tenant, BWPFeature feature, string fileName, Stream content, CancellationToken cancellationToken = default);
|
||||
Task<Stream> GetFileAsync(string tenant, BWPFeature feature, string fileName, CancellationToken cancellationToken = default);
|
||||
Task<bool> DeleteFileAsync(string tenant, BWPFeature feature, string fileName, CancellationToken cancellationToken = default);
|
||||
Task<bool> FileExistsAsync(string tenant, BWPFeature feature, string fileName, CancellationToken cancellationToken = default);
|
||||
}
|
||||
}
|
||||
@@ -401,6 +401,7 @@
|
||||
<Compile Include="Extensions\ICollectionExtensions.cs" />
|
||||
<Compile Include="Extensions\IDictionaryTExtensions.cs" />
|
||||
<Compile Include="Extensions\TimeIntervalExtensions.cs" />
|
||||
<Compile Include="Interface\IFileStorageDAO.cs" />
|
||||
<Compile Include="Interface\IGkvAbrechnung.cs" />
|
||||
<Compile Include="Interface\IGkvTransferProtokoll.cs" />
|
||||
<Compile Include="Interface\IInvoiceBase.cs" />
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
@@ -67,7 +68,7 @@
|
||||
<Name>Data</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\Service\Service.csproj">
|
||||
<Project>{094331C3-ECEE-4C89-BBFD-4C9DED89F0EF}</Project>
|
||||
<Project>{094331c3-ecee-4c89-bbfd-4c9ded89f0ef}</Project>
|
||||
<Name>Service</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\Shared\Shared.csproj">
|
||||
|
||||
Reference in New Issue
Block a user