Protokoll wird erst nach erfolgreicher Erstellung gespeichert
This commit is contained in:
@@ -669,18 +669,18 @@ namespace BeWo.Service.ServiceImplementations
|
||||
}
|
||||
}
|
||||
|
||||
public List<long> UpdateServiceInvoices(List<ServiceInvoiceDC> invoices)
|
||||
{
|
||||
try
|
||||
{
|
||||
var acc = PluginLoader.FindClass<AccountingService>();
|
||||
return acc.UpdateServiceInvoices(invoices);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
throw Utils.CreateBeWoFaultException(e);
|
||||
}
|
||||
}
|
||||
public List<long> UpdateServiceInvoices(List<ServiceInvoiceDC> invoices)
|
||||
{
|
||||
try
|
||||
{
|
||||
var acc = PluginLoader.FindClass<AccountingService>();
|
||||
return acc.UpdateServiceInvoices(invoices);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
throw Utils.CreateBeWoFaultException(e);
|
||||
}
|
||||
}
|
||||
|
||||
public void UpdateSettlementInvoice(List<Settlement2DC> invoices)
|
||||
{
|
||||
@@ -928,24 +928,26 @@ namespace BeWo.Service.ServiceImplementations
|
||||
return response;
|
||||
}
|
||||
|
||||
var protokoll = new GkvTransferProtokoll
|
||||
var protokoll = CreateGkvTransferProtokoll(entity, out var error);
|
||||
if (error is object)
|
||||
{
|
||||
ErstelltAm = DateTime.Now,
|
||||
GkvAbrechnungOid = entity.Oid.Value
|
||||
};
|
||||
MailUtils.SendGkvModuleErrorMail("SendNewGkvAbrechnung - CreateGkvTransferProtokoll", error, Tenant);
|
||||
|
||||
response.TitleMessage = "Protokoll Erstellung";
|
||||
response.Message = error;
|
||||
return response;
|
||||
}
|
||||
|
||||
if (entity.GkvTransferProtokolle is null)
|
||||
entity.GkvTransferProtokolle = new List<GkvTransferProtokoll>();
|
||||
|
||||
entity.GkvTransferProtokolle.Add(protokoll);
|
||||
|
||||
// Protokoll braucht Oid
|
||||
DAOFactory.GenericDAO.Update(entity);
|
||||
|
||||
try
|
||||
{
|
||||
CreateGkvTransferProtokoll(oid, entity, protokoll);
|
||||
|
||||
entity.GkvTransferProtokolle.Add(protokoll);
|
||||
|
||||
// Protokoll braucht Oid
|
||||
DAOFactory.GenericDAO.Update(entity);
|
||||
|
||||
var app8_response = SendApp8SendNewRequest(protokoll);
|
||||
|
||||
var app8_protokoll = app8_response.GkvTransferProtokollDC;
|
||||
@@ -1006,7 +1008,7 @@ namespace BeWo.Service.ServiceImplementations
|
||||
{
|
||||
var orgas = DAOFactory.SearchDAO.GetAllOrganisationByIKKrankenkasse(req.IKKrankenkasse);
|
||||
|
||||
if(req.OrganisationOid is long oid)
|
||||
if (req.OrganisationOid is long oid)
|
||||
{
|
||||
orgas.RemoveAll(x => x.Oid == oid);
|
||||
}
|
||||
@@ -1026,8 +1028,16 @@ namespace BeWo.Service.ServiceImplementations
|
||||
}
|
||||
}
|
||||
|
||||
private void CreateGkvTransferProtokoll(long oid, GkvAbrechnung gkvAbrechnung, GkvTransferProtokoll protokoll)
|
||||
private GkvTransferProtokoll CreateGkvTransferProtokoll(GkvAbrechnung gkvAbrechnung, out string error)
|
||||
{
|
||||
var protokoll = new GkvTransferProtokoll
|
||||
{
|
||||
ErstelltAm = DateTime.Now,
|
||||
GkvAbrechnungOid = gkvAbrechnung.Oid.Value
|
||||
};
|
||||
|
||||
error = null;
|
||||
|
||||
try
|
||||
{
|
||||
ValidatorExtended.ValidateGkvAbrechnung(gkvAbrechnung, gkvAbrechnung.InvoiceBases);
|
||||
@@ -1046,9 +1056,6 @@ namespace BeWo.Service.ServiceImplementations
|
||||
var (datenaustauschreferenz, transfernummer) = GetNextDatenaustauschreferenzTransfernummer(gkvAbrechnung, datenannahmestelle);
|
||||
var (dat_short, tra_short) = ClearDatenaustauschreferenzTransfernummer(datenaustauschreferenz, transfernummer);
|
||||
|
||||
protokoll.Datenaustauschreferenz = datenaustauschreferenz;
|
||||
protokoll.Transfernummer = transfernummer;
|
||||
|
||||
var first_cost = gkvAbrechnung.InvoiceBases.First().CostBearer2SupportConcept.SupportConcept.Customer;
|
||||
|
||||
var plugin = PluginLoader.FindClass<AccountingService>();
|
||||
@@ -1106,8 +1113,6 @@ namespace BeWo.Service.ServiceImplementations
|
||||
// TEXT | 65,535(2^16−1) bytes = 64 KiB
|
||||
// MEDIUMTEXT | 16,777,215(2^24−1) bytes = 16 MiB
|
||||
// LONGTEXT | 4,294,967,295(2^32−1) bytes = 4 GiB
|
||||
|
||||
|
||||
if (nutzdatendatei.Length > 16777215)
|
||||
{
|
||||
var msg = $"nutzdatendatei - Länger als 16777215: {nutzdatendatei.Length}";
|
||||
@@ -1115,6 +1120,9 @@ namespace BeWo.Service.ServiceImplementations
|
||||
throw new GkvException(msg);
|
||||
}
|
||||
|
||||
protokoll.Datenaustauschreferenz = datenaustauschreferenz;
|
||||
protokoll.Transfernummer = transfernummer;
|
||||
|
||||
protokoll.IKDatenannahmestelle = file_from_manager.GetIKDatenannahmestelle();
|
||||
protokoll.IKKostentrager = file_from_manager.GetIKKostenträger();
|
||||
protokoll.IKLeistungserbringer = file_from_manager.GetIKLeistungserbringer();
|
||||
@@ -1131,22 +1139,19 @@ namespace BeWo.Service.ServiceImplementations
|
||||
|
||||
protokoll.AbsenderBezeichnung = "ownSoft GmbH";
|
||||
protokoll.EmpfangerBezeichnung = orgadc.BezDatenannahmestelle;
|
||||
|
||||
return protokoll;
|
||||
}
|
||||
catch (GkvException de)
|
||||
{
|
||||
if (string.IsNullOrEmpty(de.Title))
|
||||
de.Title = "Protokoll Erstellung";
|
||||
|
||||
MailUtils.SendGkvModuleErrorMail("CreateGkvTransferProtokoll", de, Tenant);
|
||||
|
||||
throw de;
|
||||
error = de.ToString();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
MailUtils.SendGkvModuleErrorMail("CreateGkvTransferProtokoll", e, Tenant);
|
||||
|
||||
throw new GkvException(e.Message, "Erstellung");
|
||||
error = e.ToString();
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private Tuple<int, int> GetNextDatenaustauschreferenzTransfernummer(GkvAbrechnung gkvAbrechnung, string datenannahmestelle)
|
||||
@@ -1239,7 +1244,7 @@ namespace BeWo.Service.ServiceImplementations
|
||||
|
||||
if (!response_app8.Success)
|
||||
throw new GkvException("Success false - " + response_app8.Message);
|
||||
|
||||
|
||||
if (response_app8.Results is null)
|
||||
throw new GkvException("Result null - " + response_app8.Message);
|
||||
|
||||
@@ -1284,7 +1289,7 @@ namespace BeWo.Service.ServiceImplementations
|
||||
protokolls.Add(protokoll);
|
||||
}
|
||||
|
||||
if(protokolls.Any())
|
||||
if (protokolls.Any())
|
||||
DAOFactory.GenericDAO.Update(protokolls);
|
||||
|
||||
var follows = results.Where(x => x.ResultType == GkvTransferResultType.FailFollowUp);
|
||||
@@ -1322,14 +1327,14 @@ namespace BeWo.Service.ServiceImplementations
|
||||
request.Password = user.BCryptPassword;
|
||||
request.Tenant = MultitenancyOperationContextExt.Current.Tenant;
|
||||
|
||||
if(request is GkvServerSendNewRequestDC send_new_req)
|
||||
if (request is GkvServerSendNewRequestDC send_new_req)
|
||||
{
|
||||
send_new_req.ApplicationUserOid = user.Oid.Value;
|
||||
}
|
||||
|
||||
return GkvSender.SendApp8Request<Req, Res>(request, request.Tenant);
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user