From 0cb5c0283123f3b471ba0409f6a02d64d2fc39bb Mon Sep 17 00:00:00 2001 From: Lyndon Jetten Date: Wed, 23 Sep 2020 16:00:51 +0200 Subject: [PATCH] BeWoPlanerMobil: Fortschritt bei Quittierungsbelegunterschrift MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Qlik: Zeitraum hinzugefügt --- BeWo/ServiceProxy/Generated.cs | 66 +++++++++++++ .../Controllers/ReportController.cs | 14 +++ BeWoPlanerMobil/Models/AbstractModel.cs | 2 +- BeWoPlanerMobil/Models/ReportModel.cs | 12 ++- BeWoPlanerMobil/Scripts/signature.js | 14 +++ .../Scripts/view-scripts/report.js | 19 ++++ BeWoPlanerMobil/Views/Main/Main.cshtml | 14 --- BeWoPlanerMobil/Views/Report/Report.cshtml | 20 ++-- Data/Access/SearchDAO.cs | 35 +++++-- Data/Data.csproj | 2 + Data/Entities/ConfirmationReceiptSignature.cs | 52 ++++++++++ .../ConfirmationReceiptSignature.hbm.xml | 25 +++++ ...09_18_Quittierungsbelegsunterschriften.txt | 25 +++++ .../demo_reports/Export/QlikCsvExporter.cs | 26 +++-- ...ignatureDC_ConfirmationReceiptSignature.cs | 34 +++++++ Service/DCEntityMapper/MapperFactory.cs | 5 + Service/Plugins/PluginLoader.cs | 2 +- Service/Service.csproj | 1 + .../ServiceContracts/IOperationsService.cs | 24 +++++ .../OperationsServiceImp.cs | 94 +++++++++++++++++++ Shared/BeWoEntityEnums.cs | 7 +- .../ConfirmationReceiptSignatureDC.cs | 24 +++++ Shared/Shared.csproj | 1 + 23 files changed, 465 insertions(+), 53 deletions(-) create mode 100644 Data/Entities/ConfirmationReceiptSignature.cs create mode 100644 Data/Mappings/ConfirmationReceiptSignature.hbm.xml create mode 100644 Model/Changes_2020_09_18_Quittierungsbelegsunterschriften.txt create mode 100644 Service/DCEntityMapper/ConfirmationReceiptSignatureDC_ConfirmationReceiptSignature.cs create mode 100644 Shared/DataContracts/ConfirmationReceiptSignatureDC.cs diff --git a/BeWo/ServiceProxy/Generated.cs b/BeWo/ServiceProxy/Generated.cs index b4c79c239..056bdfa79 100644 --- a/BeWo/ServiceProxy/Generated.cs +++ b/BeWo/ServiceProxy/Generated.cs @@ -1535,6 +1535,8 @@ namespace BeWo.ServiceProxy [System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.List))] [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.DienstDC))] [System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.List))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.ConfirmationReceiptSignatureDC))] + [System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.List))] [System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.List))] [System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.BargeldkassenDC))] [System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.List))] @@ -4787,6 +4789,40 @@ namespace BeWo.ServiceProxy [System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IOperationsService/FetchServiceRecordRatingsBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")] System.Collections.Generic.List FetchServiceRecordRatings(System.Nullable supportConceptOid, System.Nullable costBearer2SupportConceptOid, System.Nullable supportConceptApprovalPeriodOid, System.Nullable serviceCategoryOid, System.Nullable start, System.Nullable end); + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IOperationsService/InsertConfirmationReceiptSignature", ReplyAction="http://tempuri.org/IOperationsService/InsertConfirmationReceiptSignatureResponse")] + [System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IOperationsService/InsertConfirmationReceiptSignatureBeWoFault" + + "Fault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")] + void InsertConfirmationReceiptSignature(BS.Shared.DataContracts.ConfirmationReceiptSignatureDC confirmationReceiptSignature); + + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IOperationsService/InsertConfirmationReceiptSignatures", ReplyAction="http://tempuri.org/IOperationsService/InsertConfirmationReceiptSignaturesResponse" + + "")] + [System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IOperationsService/InsertConfirmationReceiptSignaturesBeWoFaul" + + "tFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")] + void InsertConfirmationReceiptSignatures(System.Collections.Generic.List confirmationReceiptSignatures); + + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IOperationsService/DeleteConfirmationReceiptSignature", ReplyAction="http://tempuri.org/IOperationsService/DeleteConfirmationReceiptSignatureResponse")] + [System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IOperationsService/DeleteConfirmationReceiptSignatureBeWoFault" + + "Fault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")] + void DeleteConfirmationReceiptSignature(long confirmationReceiptSignatureOid); + + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IOperationsService/UpdateConfirmationReceiptSignature", ReplyAction="http://tempuri.org/IOperationsService/UpdateConfirmationReceiptSignatureResponse")] + [System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IOperationsService/UpdateConfirmationReceiptSignatureBeWoFault" + + "Fault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")] + BS.Shared.DataContracts.ConfirmationReceiptSignatureDC UpdateConfirmationReceiptSignature(BS.Shared.DataContracts.ConfirmationReceiptSignatureDC confirmationReceiptSignature); + + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IOperationsService/GetConfirmationReceiptSignaturesByEmployee", ReplyAction="http://tempuri.org/IOperationsService/GetConfirmationReceiptSignaturesByEmployeeR" + + "esponse")] + [System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IOperationsService/GetConfirmationReceiptSignaturesByEmployeeB" + + "eWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")] + System.Collections.Generic.List GetConfirmationReceiptSignaturesByEmployee(long employeeOid, BS.Shared.Core.DateTimeSpan timeSpan); + + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IOperationsService/GetConfirmationReceiptSignaturesByServiceRe" + + "cord", ReplyAction="http://tempuri.org/IOperationsService/GetConfirmationReceiptSignaturesByServiceRe" + + "cordResponse")] + [System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IOperationsService/GetConfirmationReceiptSignaturesByServiceRe" + + "cordBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")] + System.Collections.Generic.List GetConfirmationReceiptSignaturesByServiceRecord(long serviceRecordOid); + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IOperationsService/UpdateIsChatActiveCustomerAPPCodeDC", ReplyAction="http://tempuri.org/IOperationsService/UpdateIsChatActiveCustomerAPPCodeDCResponse" + "")] [System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IOperationsService/UpdateIsChatActiveCustomerAPPCodeDCBeWoFaul" + @@ -5807,6 +5843,36 @@ namespace BeWo.ServiceProxy return base.Channel.FetchServiceRecordRatings(supportConceptOid, costBearer2SupportConceptOid, supportConceptApprovalPeriodOid, serviceCategoryOid, start, end); } + public void InsertConfirmationReceiptSignature(BS.Shared.DataContracts.ConfirmationReceiptSignatureDC confirmationReceiptSignature) + { + base.Channel.InsertConfirmationReceiptSignature(confirmationReceiptSignature); + } + + public void InsertConfirmationReceiptSignatures(System.Collections.Generic.List confirmationReceiptSignatures) + { + base.Channel.InsertConfirmationReceiptSignatures(confirmationReceiptSignatures); + } + + public void DeleteConfirmationReceiptSignature(long confirmationReceiptSignatureOid) + { + base.Channel.DeleteConfirmationReceiptSignature(confirmationReceiptSignatureOid); + } + + public BS.Shared.DataContracts.ConfirmationReceiptSignatureDC UpdateConfirmationReceiptSignature(BS.Shared.DataContracts.ConfirmationReceiptSignatureDC confirmationReceiptSignature) + { + return base.Channel.UpdateConfirmationReceiptSignature(confirmationReceiptSignature); + } + + public System.Collections.Generic.List GetConfirmationReceiptSignaturesByEmployee(long employeeOid, BS.Shared.Core.DateTimeSpan timeSpan) + { + return base.Channel.GetConfirmationReceiptSignaturesByEmployee(employeeOid, timeSpan); + } + + public System.Collections.Generic.List GetConfirmationReceiptSignaturesByServiceRecord(long serviceRecordOid) + { + return base.Channel.GetConfirmationReceiptSignaturesByServiceRecord(serviceRecordOid); + } + public void UpdateIsChatActiveCustomerAPPCodeDC(long customerOid, int activeType) { base.Channel.UpdateIsChatActiveCustomerAPPCodeDC(customerOid, activeType); diff --git a/BeWoPlanerMobil/Controllers/ReportController.cs b/BeWoPlanerMobil/Controllers/ReportController.cs index 401caed33..32fb3b662 100644 --- a/BeWoPlanerMobil/Controllers/ReportController.cs +++ b/BeWoPlanerMobil/Controllers/ReportController.cs @@ -5,6 +5,7 @@ using BeWo.Report.ReportObjects; using BeWoPlanerMobil.Models; using BeWoPlanerMobil.Service; using BeWoPlanerMobil.Util; +using BS.Shared.Core; using BS.Shared.Extensions; namespace BeWoPlanerMobil.Controllers @@ -59,6 +60,8 @@ namespace BeWoPlanerMobil.Controllers Model.Customers = customers; + var test = OperationsService.GetConfirmationReceiptSignaturesByEmployee(1, new DateTimeSpan(new DateTime(2020, 1, 1), new DateTime(2020, 2, 1))); + return View(Model); } @@ -84,6 +87,8 @@ namespace BeWoPlanerMobil.Controllers return Report(); } + Model.QuittierungsbelegItems.Clear(); + var selectedCustomer = Model.Customers.FirstOrDefault(customer => customer.CustomerOid == customerOid); Model.SelectedCustomer = selectedCustomer; @@ -117,5 +122,14 @@ namespace BeWoPlanerMobil.Controllers return _LeerzeichenFuerGetMethoden; } + + [Authorize] + [HttpPost] + public ActionResult CreateEmployeeSignatureForServiceOverview(FormCollection formCollection) + { + + + return RedirectToActionPermanent("Report"); + } } } \ No newline at end of file diff --git a/BeWoPlanerMobil/Models/AbstractModel.cs b/BeWoPlanerMobil/Models/AbstractModel.cs index 8b19a7b88..ae2f01d23 100644 --- a/BeWoPlanerMobil/Models/AbstractModel.cs +++ b/BeWoPlanerMobil/Models/AbstractModel.cs @@ -34,6 +34,6 @@ namespace BeWoPlanerMobil.Models public static string TimeOfLastAction { get; set; } public static bool HasRightToInsertRessourceAppointments => MobileSessionFacade.CheckForUserRight(UserRightType.KalenderRessourcentermineAnlegen) || MobileSessionFacade.CheckForUserRight(UserRightType.CreateAll); - public static bool IsAllowedToSeeBills => false;//MobileSessionFacade.CheckForUserRight(UserRightType.Analysis_ServiceOverview_View); + public static bool IsAllowedToSeeBills => false;// MobileSessionFacade.CheckForUserRight(UserRightType.Analysis_ServiceOverview_View); } } \ No newline at end of file diff --git a/BeWoPlanerMobil/Models/ReportModel.cs b/BeWoPlanerMobil/Models/ReportModel.cs index 25513c754..9450e618c 100644 --- a/BeWoPlanerMobil/Models/ReportModel.cs +++ b/BeWoPlanerMobil/Models/ReportModel.cs @@ -43,7 +43,11 @@ namespace BeWoPlanerMobil.Models for(var i = 1; i < 13; i++) { - result.Add(new SelectListItem {Value = i.ToString(), Text = i.ToString()}); + result.Add(new SelectListItem + { + Value = i.ToString(), + Text = new DateTime(DateTime.Now.Year, i, 1).ToString("MMMM") + }); } return result; @@ -58,7 +62,11 @@ namespace BeWoPlanerMobil.Models for(var i = DateTime.Today.Year + 1; i > DateTime.Today.Year - 11; i--) { - result.Add(new SelectListItem {Value = i.ToString(), Text = i.ToString()}); + result.Add(new SelectListItem + { + Value = i.ToString(), + Text = i.ToString() + }); } return result; diff --git a/BeWoPlanerMobil/Scripts/signature.js b/BeWoPlanerMobil/Scripts/signature.js index 29ba4bb0f..4438db68e 100644 --- a/BeWoPlanerMobil/Scripts/signature.js +++ b/BeWoPlanerMobil/Scripts/signature.js @@ -215,4 +215,18 @@ function hideSignature() { var url = getResetSignatureImageUrl(); $.get(url); +} + +function resizeCanvas() { + if($("#sketch-pad").length !== 0) { + var rowWidth = $("#canvas-row").innerWidth(); + var canvasWidth = $("#sketch-pad").innerWidth(); + + var newWidth = rowWidth; + + if(newWidth !== canvasWidth) { + $("#sketch-pad").prop("width", newWidth); + new Signature(); + } + } } \ No newline at end of file diff --git a/BeWoPlanerMobil/Scripts/view-scripts/report.js b/BeWoPlanerMobil/Scripts/view-scripts/report.js index 2a7131dac..047fcafcf 100644 --- a/BeWoPlanerMobil/Scripts/view-scripts/report.js +++ b/BeWoPlanerMobil/Scripts/view-scripts/report.js @@ -2,9 +2,28 @@ $("#report-form-container").hide(); $("#report-signature-container").addClass("d-block"); + var customer = $("#customers-drop-down option:selected").text(); + var month = $("#month-select option:selected").text(); + var year = $("#year-select option:selected").text(); + + $("#report-info-column").html("Unterschrift für erbrachte Leistungen von " + customer + " im " + month + " " + year); + resizeCanvas(); } function saveReportSignature() { + // TODO: Meldung anzeigen +} +function confirmReportSignatureCancellation() { + showMessagePopupWithCallback("Unterschrift", "Sind Sie sicher, dass Sie die Unterschrift nicht speichern möchten?", + function() { + $("#report-signature-container").removeClass("d-block"); + $("#report-form-container").show(); + + var canvas = document.getElementById("sketch-pad"); + var context = canvas.getContext("2d"); + context.clearRect(0, 0, canvas.width, canvas.height); + + }, false); } \ No newline at end of file diff --git a/BeWoPlanerMobil/Views/Main/Main.cshtml b/BeWoPlanerMobil/Views/Main/Main.cshtml index 951cbc41e..9a40de2f3 100644 --- a/BeWoPlanerMobil/Views/Main/Main.cshtml +++ b/BeWoPlanerMobil/Views/Main/Main.cshtml @@ -141,20 +141,6 @@ resizeCanvas(); }); - function resizeCanvas() { - if($("#sketch-pad").length !== 0) { - var rowWidth = $("#canvas-row").innerWidth(); - var canvasWidth = $("#sketch-pad").innerWidth(); - - var newWidth = rowWidth; - - if (newWidth !== canvasWidth) { - $("#sketch-pad").prop("width", newWidth); - new Signature(); - } - } - } - function getSetServiceRecordEmployeeUrl() { return "@Url.Action("SetServiceRecordEmployee")"; } diff --git a/BeWoPlanerMobil/Views/Report/Report.cshtml b/BeWoPlanerMobil/Views/Report/Report.cshtml index 2587f05cb..973ed1905 100644 --- a/BeWoPlanerMobil/Views/Report/Report.cshtml +++ b/BeWoPlanerMobil/Views/Report/Report.cshtml @@ -14,7 +14,7 @@ Info: --> -
+
@using(Html.BeginForm("CreateServiceOverview", "Report", FormMethod.Post)) @@ -35,13 +35,13 @@ Info:
@Html.LabelFor(m => m.SelectedMonth) - @Html.DropDownListFor(m => m.SelectedMonth, Model.Months, new { @class = "form-control" }) + @Html.DropDownListFor(m => m.SelectedMonth, Model.Months, new { @class = "form-control", id = "month-select" })
@Html.LabelFor(m => m.SelectedYear) - @Html.DropDownListFor(m => m.SelectedYear, Model.Years, new { @class = "form-control" }) + @Html.DropDownListFor(m => m.SelectedYear, Model.Years, new { @class = "form-control", id = "year-select" })
@@ -119,7 +119,7 @@ Info:
- +
} @@ -129,19 +129,19 @@ Info:
-
+
-

Unterschrift

-
-
-
- +
+
+
diff --git a/Data/Access/SearchDAO.cs b/Data/Access/SearchDAO.cs index d42da4bf2..bbaac8c1e 100644 --- a/Data/Access/SearchDAO.cs +++ b/Data/Access/SearchDAO.cs @@ -3290,13 +3290,6 @@ namespace BeWo.Data.Access { var c = CreateCriteria("r").Add(Restrictions.Eq(nameof(BeWoEntityBase.IsActive), ActivationTypeId.Active)); - /* - * var detachedCriteria1 = DetachedCriteria.For() - .Add(Restrictions.In(Employee2SchedulerAppointment.PropertyName_Employee + ".Oid", pSelectedEmployees)) - .SetProjection(Projections.Property(Employee2SchedulerAppointment.PropertyName_SchedulerAppointment)); - var employee2SchedCrit = Subqueries.PropertyIn(BeWoEntityBase.PropertyName_Oid, detachedCriteria1); - */ - var sql = $"Oid NOT IN (SELECT Oid FROM resource WHERE isactive = 1 AND Oid NOT IN (SELECT resourceoid FROM resource2newschapp r2n WHERE r2n.newschappoid NOT IN (SELECT oid FROM newschedulerappointment WHERE startdate > '{start:yyyy-MM-dd HH:mm:ss}' OR enddate < '{end:yyyy-MM-dd HH:mm:ss}')))"; var criterion = Expression.Sql(sql); @@ -3438,5 +3431,33 @@ namespace BeWo.Data.Access return result; } + + public IList GetConfirmationReceiptSignaturesByEmployee(long employeeOid, DateTimeSpan timeSpan) + { + /* + * var detachedCriteria1 = DetachedCriteria.For() + .Add(Restrictions.In(Employee2SchedulerAppointment.PropertyName_Employee + ".Oid", pSelectedEmployees)) + .SetProjection(Projections.Property(Employee2SchedulerAppointment.PropertyName_SchedulerAppointment)); + var employee2SchedCrit = Subqueries.PropertyIn(BeWoEntityBase.PropertyName_Oid, detachedCriteria1); + */ + + var between = CreateBetweenDateTimesCriterion(timeSpan.StartDateTime, timeSpan.EndDateTime, nameof(ServiceRecord.Start), nameof(ServiceRecord.End)); + + var criteria = CreateCriteriaIsActive() + .Add(Restrictions.Eq(nameof(ConfirmationReceiptSignature.EmployeeOid), employeeOid)) + .CreateCriteria(nameof(ConfirmationReceiptSignature.ServiceRecords), JoinType.InnerJoin).Add(between); + + var mySql = ToSql(criteria); + + return criteria.List(); + } + + public List GetConfirmationReceiptSignaturesByServiceRecord(long serviceRecordOid) + { + var detachedCriteria = DetachedCriteria.For() + .Add(Subqueries.PropertyIn(nameof(ServiceRecord.Oid), DetachedCriteria.For().SetProjection(Projections.Property(nameof(ServiceRecord.Oid))))); + + return null; + } } } diff --git a/Data/Data.csproj b/Data/Data.csproj index c993b9a51..535612a0c 100644 --- a/Data/Data.csproj +++ b/Data/Data.csproj @@ -134,6 +134,7 @@ + @@ -606,6 +607,7 @@ Designer + Designer diff --git a/Data/Entities/ConfirmationReceiptSignature.cs b/Data/Entities/ConfirmationReceiptSignature.cs new file mode 100644 index 000000000..68b841c8b --- /dev/null +++ b/Data/Entities/ConfirmationReceiptSignature.cs @@ -0,0 +1,52 @@ +using System.Collections.Generic; + +namespace BeWo.Data.Entities +{ + public class ConfirmationReceiptSignature : BeWoEntityBase + { + private long? _EmployeeOid; + + private IList _ServiceRecords; + + private string _SignatureImage; + + public virtual long? EmployeeOid + { + get => _EmployeeOid; + + set + { + if(AreDifferent(_EmployeeOid, value)) + { + _EmployeeOid = value; + } + } + } + + public virtual IList ServiceRecords + { + get => _ServiceRecords; + + set + { + if(AreDifferent(_ServiceRecords, value)) + { + _ServiceRecords = value; + } + } + } + + public virtual string SignatureImage + { + get => _SignatureImage; + + set + { + if(AreDifferent(_SignatureImage, value)) + { + _SignatureImage = value; + } + } + } + } +} diff --git a/Data/Mappings/ConfirmationReceiptSignature.hbm.xml b/Data/Mappings/ConfirmationReceiptSignature.hbm.xml new file mode 100644 index 000000000..4230413de --- /dev/null +++ b/Data/Mappings/ConfirmationReceiptSignature.hbm.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Model/Changes_2020_09_18_Quittierungsbelegsunterschriften.txt b/Model/Changes_2020_09_18_Quittierungsbelegsunterschriften.txt new file mode 100644 index 000000000..68a628383 --- /dev/null +++ b/Model/Changes_2020_09_18_Quittierungsbelegsunterschriften.txt @@ -0,0 +1,25 @@ +CREATE TABLE `confirmationreceiptsignature` ( + `Oid` bigint(19) NOT NULL AUTO_INCREMENT, + `Tid` int(10) DEFAULT NULL, + `Notice` varchar(1024) DEFAULT NULL, + `InsTs` datetime DEFAULT NULL, + `InsUser` varchar(256) DEFAULT NULL, + `Version` bigint(19) DEFAULT NULL, + `UdpUser` varchar(256) DEFAULT NULL, + `IsActive` tinyint(4) DEFAULT NULL, + `SystemEntryID` int(10) DEFAULT NULL, + `SignatureImage` longtext, + `EmployeeOid` bigint(19) DEFAULT NULL, + PRIMARY KEY (`Oid`), + KEY `CONFIRMATIONRECEIPTSIGNATURE_EMPLOYEE_FK` (`EmployeeOid`), + CONSTRAINT `FK_CONFIRMATIONRECEIPTSIGNATURE2EMPLOYEE` FOREIGN KEY (`EmployeeOid`) REFERENCES `Employee` (`Oid`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +CREATE TABLE `confirmationsignature2servicerecord` ( + `ConfirmationSignatureOid` bigint(19) DEFAULT NULL, + `ServiceRecordOid` bigint(19) DEFAULT NULL, + KEY `CONFSIG2SERVREC_CONFSIG_FK` (`ConfirmationSignatureOid`), + CONSTRAINT `FK_CONFSIG2SERVREC_CONFSIG` FOREIGN KEY (`ConfirmationSignatureOid`) REFERENCES `confirmationreceiptsignature` (`Oid`), + KEY `CONFSIG2SERVREC_SERVREC_FK` (`ServiceRecordOid`), + CONSTRAINT `FK_CONFSIG2SERVREC_SERVREC` FOREIGN KEY (`ServiceRecordOid`) REFERENCES `servicerecord` (`Oid`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; \ No newline at end of file diff --git a/ReportImp/demo_reports/Export/QlikCsvExporter.cs b/ReportImp/demo_reports/Export/QlikCsvExporter.cs index 4aba28ca5..7656f9a7b 100644 --- a/ReportImp/demo_reports/Export/QlikCsvExporter.cs +++ b/ReportImp/demo_reports/Export/QlikCsvExporter.cs @@ -136,7 +136,9 @@ namespace demo_reports.Export MitarbeiterId = absenceTime.EmployeeOid, Beginn = $"{absenceTime.Start:yyyy-MM-dd}", Ende = $"{absenceTime.End:yyyy-MM-dd}", - Abwesenheitskategorie = absenceTime.AbsenceReason.Description + Abwesenheitskategorie = absenceTime.AbsenceReason.Description, + ZeitraumVon = $"{dateTimeSpan.StartDate:yyyy-MM-dd}", + ZeitraumBis = $"{dateTimeSpan.EndDate:yyyy-MM-dd}" }); } }); @@ -218,7 +220,9 @@ namespace demo_reports.Export FLSSoll = flsSoll, GesamtIst = gesamtIst, StundenSoll = stundenSoll, - IstFachkraft = employee.IsQualified ?? false + IstFachkraft = employee.IsQualified ?? false, + ZeitraumVon = $"{dateTimeSpan.StartDate:yyyy-MM-dd}", + ZeitraumBis = $"{dateTimeSpan.EndDate:yyyy-MM-dd}" }); } catch(Exception exception) @@ -228,16 +232,7 @@ namespace demo_reports.Export } }); - var stringWriter = new StringWriter(); - - - using(var csv = new CsvWriter(stringWriter, CreateCsvConfig())) - { - - csv.WriteRecords(resultList); - } - - return stringWriter.ToString(); + return CreateCsvString(resultList); } private static string GetCustomerCSV() @@ -279,7 +274,9 @@ namespace demo_reports.Export GerundeteGruppendauer = serviceRecord.GroupRoundedDuration, GruppenId = serviceRecord.GroupOid, Kategorie = serviceRecord.ServiceDescription.Name, - KostentraegerZuHilfeplanId = serviceRecord.CostBearer2SupportConceptOid + KostentraegerZuHilfeplanId = serviceRecord.CostBearer2SupportConceptOid, + ZeitraumVon = $"{dateTimeSpan.StartDate:yyyy-MM-dd}", + ZeitraumBis = $"{dateTimeSpan.EndDate:yyyy-MM-dd}" }); }); @@ -348,8 +345,7 @@ namespace demo_reports.Export private static CsvConfiguration CreateCsvConfig() { - var config = new CsvConfiguration(CultureInfo.GetCultureInfo("de-DE")); - config.Delimiter = ";"; + var config = new CsvConfiguration(CultureInfo.GetCultureInfo("de-DE")) {Delimiter = ";"}; return config; } diff --git a/Service/DCEntityMapper/ConfirmationReceiptSignatureDC_ConfirmationReceiptSignature.cs b/Service/DCEntityMapper/ConfirmationReceiptSignatureDC_ConfirmationReceiptSignature.cs new file mode 100644 index 000000000..b9fedd84f --- /dev/null +++ b/Service/DCEntityMapper/ConfirmationReceiptSignatureDC_ConfirmationReceiptSignature.cs @@ -0,0 +1,34 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using BeWo.Data.Entities; +using BS.Shared.DataContracts; + +namespace BeWo.Service.DCEntityMapper +{ + public class ConfirmationReceiptSignatureDC_ConfirmationReceiptSignature : AbstractIDCEntityMapper + { + public override ConfirmationReceiptSignatureDC MergeWithDC(ConfirmationReceiptSignature pEntity, ConfirmationReceiptSignatureDC pDataContract) + { + pDataContract.SignatureImage = pEntity.SignatureImage; + + pDataContract.EmployeeOid = pEntity.EmployeeOid; + + pDataContract.ServiceRecords = MapperFactory.ServiceRecordDC_ServiceRecord.MapToNewDCs(pEntity.ServiceRecords); + + return pDataContract; + } + + public override ConfirmationReceiptSignature MergeWithEntity(ConfirmationReceiptSignatureDC pDataContract, ConfirmationReceiptSignature pEntity) + { + throw new NotImplementedException(); + } + + protected override bool AreDCAndEntityEqual(ConfirmationReceiptSignatureDC pDC, ConfirmationReceiptSignature pEntity) + { + throw new NotImplementedException(); + } + } +} diff --git a/Service/DCEntityMapper/MapperFactory.cs b/Service/DCEntityMapper/MapperFactory.cs index df9d92350..f4aa4689e 100644 --- a/Service/DCEntityMapper/MapperFactory.cs +++ b/Service/DCEntityMapper/MapperFactory.cs @@ -268,6 +268,8 @@ namespace BeWo.Service.DCEntityMapper private static GoalRatingDC_GoalRating _GoalRatingDC_GoalRating; + private static ConfirmationReceiptSignatureDC_ConfirmationReceiptSignature _ConfirmationReceiptSignatureDC_ConfirmationReceiptSignature; + public static MedRecordDC_MedRecord MedRecordDC_MedRecord => _MedRecordDC_MedRecord ?? (_MedRecordDC_MedRecord = new MedRecordDC_MedRecord()); @@ -673,5 +675,8 @@ namespace BeWo.Service.DCEntityMapper public static RatingTypeDC_RatingType RatingTypeDC_RatingType => _RatingTypeDC_RatingType ?? (_RatingTypeDC_RatingType = new RatingTypeDC_RatingType()); + + public static ConfirmationReceiptSignatureDC_ConfirmationReceiptSignature ConfirmationReceiptSignatureDC_ConfirmationReceiptSignature => + _ConfirmationReceiptSignatureDC_ConfirmationReceiptSignature ?? (_ConfirmationReceiptSignatureDC_ConfirmationReceiptSignature = new ConfirmationReceiptSignatureDC_ConfirmationReceiptSignature()); } } \ No newline at end of file diff --git a/Service/Plugins/PluginLoader.cs b/Service/Plugins/PluginLoader.cs index ccfc16ce8..016eee679 100644 --- a/Service/Plugins/PluginLoader.cs +++ b/Service/Plugins/PluginLoader.cs @@ -19,7 +19,7 @@ namespace BeWo.Service.Plugins #if DEBUG var t = "demo"; - t = "irgendwaswasesnichtgibt"; + //t = "irgendwaswasesnichtgibt"; //t = "5473568546"; //Interner Chat //t = "2356097460"; // Lebenshilfe Würzburg //t = "1234567890"; // Präsentationsdatenbank diff --git a/Service/Service.csproj b/Service/Service.csproj index 68e5f4040..eae59aec4 100644 --- a/Service/Service.csproj +++ b/Service/Service.csproj @@ -166,6 +166,7 @@ + diff --git a/Service/ServiceContracts/IOperationsService.cs b/Service/ServiceContracts/IOperationsService.cs index 569834ec6..23f15d84c 100644 --- a/Service/ServiceContracts/IOperationsService.cs +++ b/Service/ServiceContracts/IOperationsService.cs @@ -907,5 +907,29 @@ namespace BeWo.Service.ServiceContracts [FaultContract(typeof(BeWoFault))] [OperationContract] List FetchServiceRecordRatings(long? supportConceptOid, long? costBearer2SupportConceptOid, long? supportConceptApprovalPeriodOid, long? serviceCategoryOid, DateTime? start, DateTime? end); + + [FaultContract(typeof(BeWoFault))] + [OperationContract] + void InsertConfirmationReceiptSignature(ConfirmationReceiptSignatureDC confirmationReceiptSignature); + + [FaultContract(typeof(BeWoFault))] + [OperationContract] + void InsertConfirmationReceiptSignatures(List confirmationReceiptSignatures); + + [FaultContract(typeof(BeWoFault))] + [OperationContract] + void DeleteConfirmationReceiptSignature(long confirmationReceiptSignatureOid); + + [FaultContract(typeof(BeWoFault))] + [OperationContract] + ConfirmationReceiptSignatureDC UpdateConfirmationReceiptSignature(ConfirmationReceiptSignatureDC confirmationReceiptSignature); + + [FaultContract(typeof(BeWoFault))] + [OperationContract] + List GetConfirmationReceiptSignaturesByEmployee(long employeeOid, DateTimeSpan timeSpan); + + [FaultContract(typeof(BeWoFault))] + [OperationContract] + List GetConfirmationReceiptSignaturesByServiceRecord(long serviceRecordOid); } } \ No newline at end of file diff --git a/Service/ServiceImplementations/OperationsServiceImp.cs b/Service/ServiceImplementations/OperationsServiceImp.cs index c8034c53c..eb0f2f9f7 100644 --- a/Service/ServiceImplementations/OperationsServiceImp.cs +++ b/Service/ServiceImplementations/OperationsServiceImp.cs @@ -5994,5 +5994,99 @@ namespace BeWo.Service.ServiceImplementations throw Utils.CreateBeWoFaultException(e); } } + + public void InsertConfirmationReceiptSignature(ConfirmationReceiptSignatureDC confirmationReceiptSignature) + { + try + { + var confRecSig = MapperFactory.ConfirmationReceiptSignatureDC_ConfirmationReceiptSignature.MapToNewEntity(confirmationReceiptSignature); + + DAOFactory.GenericDAO.Insert(confRecSig); + } + catch(Exception exception) + { + throw Utils.CreateBeWoFaultException(exception); + } + } + + public void InsertConfirmationReceiptSignatures(List confirmationReceiptSignatures) + { + try + { + var confRecSigs = MapperFactory.ConfirmationReceiptSignatureDC_ConfirmationReceiptSignature.MapToNewEntities(confirmationReceiptSignatures); + + DAOFactory.GenericDAO.Insert(confRecSigs); + } + catch(Exception exception) + { + throw Utils.CreateBeWoFaultException(exception); + } + } + + public void DeleteConfirmationReceiptSignature(long confirmationReceiptSignatureOid) + { + try + { + var confirmationReceiptSignatureToDelete = DAOFactory.GenericDAO.LoadByID(confirmationReceiptSignatureOid); + + DAOFactory.GenericDAO.Delete(confirmationReceiptSignatureToDelete); + } + catch(Exception exception) + { + throw Utils.CreateBeWoFaultException(exception); + } + } + + public ConfirmationReceiptSignatureDC UpdateConfirmationReceiptSignature(ConfirmationReceiptSignatureDC confirmationReceiptSignature) + { + try + { + var confirmationReceiptSignatureToUpdate = DAOFactory.GenericDAO.LoadByID(confirmationReceiptSignature.ConfirmationReceiptSignatureOid.Value); + + MapperFactory.ConfirmationReceiptSignatureDC_ConfirmationReceiptSignature.MergeWithEntity(confirmationReceiptSignature, confirmationReceiptSignatureToUpdate); + + DAOFactory.GenericDAO.Update(confirmationReceiptSignatureToUpdate); + + var updatedConfirmationReceiptSignature = DAOFactory.GenericDAO.LoadByID(confirmationReceiptSignature.ConfirmationReceiptSignatureOid.Value); + + return MapperFactory.ConfirmationReceiptSignatureDC_ConfirmationReceiptSignature.MapToNewDC(updatedConfirmationReceiptSignature); + } + catch(Exception exception) + { + throw Utils.CreateBeWoFaultException(exception); + } + } + + public List GetConfirmationReceiptSignaturesByEmployee(long employeeOid, DateTimeSpan timeSpan) + { + try + { + var signatures = DAOFactory.SearchDAO.GetConfirmationReceiptSignaturesByEmployee(employeeOid, timeSpan); + + var signatureDCs = MapperFactory.ConfirmationReceiptSignatureDC_ConfirmationReceiptSignature.MapToNewDCs(signatures); + + return signatureDCs; + } + catch(Exception exception) + { + throw Utils.CreateBeWoFaultException(exception); + } + } + + public List GetConfirmationReceiptSignaturesByServiceRecord(long serviceRecordOid) + { + try + { + var signatures = DAOFactory.SearchDAO.GetConfirmationReceiptSignaturesByServiceRecord(serviceRecordOid); + + var signatureDCs = MapperFactory.ConfirmationReceiptSignatureDC_ConfirmationReceiptSignature.MapToNewDCs(signatures); + + return signatureDCs; + } + catch(Exception exception) + { + throw Utils.CreateBeWoFaultException(exception); + } + } } } diff --git a/Shared/BeWoEntityEnums.cs b/Shared/BeWoEntityEnums.cs index afac9f019..8db353af7 100644 --- a/Shared/BeWoEntityEnums.cs +++ b/Shared/BeWoEntityEnums.cs @@ -148,9 +148,10 @@ namespace BS.Shared Arbeitszeit = 141, ArbeitszeitEintrag = 142, Dienst = 143, - RatingType = 144, - Rating = 145, - GoalRating = 146 + RatingType = 144, + Rating = 145, + GoalRating = 146, + ConfirmationReceiptSignature = 147 } public enum SystemEntryID diff --git a/Shared/DataContracts/ConfirmationReceiptSignatureDC.cs b/Shared/DataContracts/ConfirmationReceiptSignatureDC.cs new file mode 100644 index 000000000..c1d41e076 --- /dev/null +++ b/Shared/DataContracts/ConfirmationReceiptSignatureDC.cs @@ -0,0 +1,24 @@ +using System.Collections.Generic; +using System.Runtime.Serialization; + +namespace BS.Shared.DataContracts +{ + [DataContract] + public class ConfirmationReceiptSignatureDC : IDataContract + { + [DataMember] + public long? ConfirmationReceiptSignatureOid { get; set; } + + [DataMember] + public long? ConfirmationReceiptSignatureVersion { get; set; } + + [DataMember] + public string SignatureImage { get; set; } + + [DataMember] + public long? EmployeeOid { get; set; } + + [DataMember] + public List ServiceRecords { get; set; } + } +} diff --git a/Shared/Shared.csproj b/Shared/Shared.csproj index 4254298d6..605377e43 100644 --- a/Shared/Shared.csproj +++ b/Shared/Shared.csproj @@ -150,6 +150,7 @@ +