AiVoice Status wird gespeichert
This commit is contained in:
@@ -48,7 +48,7 @@
|
||||
Width="32"
|
||||
Height="32"
|
||||
Margin="0,0,10,0"/>
|
||||
<TextBlock Grid.Column="1" x:Name="ButtonText" VerticalAlignment="Center" Text="Aufnahme initiieren"/>
|
||||
<TextBlock Grid.Column="1" x:Name="ButtonText" VerticalAlignment="Center" Text="{t:Translate Aufnahme initiieren}"/>
|
||||
<Viewbox Grid.Column="2" x:Name="VBPlay" Width="40" Height="40" Visibility="Visible">
|
||||
<Grid Width="100" Height="100">
|
||||
<Ellipse
|
||||
|
||||
@@ -35,7 +35,7 @@ namespace BeWo.AI.View
|
||||
public event EventHandler CancelClicked;
|
||||
|
||||
|
||||
bool cancel = false;
|
||||
bool timerActive = false;
|
||||
AiVoiceDataDC currentVoiceData = null;
|
||||
|
||||
public AiTranskriptionView()
|
||||
@@ -55,7 +55,7 @@ namespace BeWo.AI.View
|
||||
|
||||
private void StartAufnahme()
|
||||
{
|
||||
cancel = false;
|
||||
timerActive = true;
|
||||
//lblStatus.Content = "Um die Aufnahme zu starten, klicken Sie auf den Link, den Sie in ownChat erhalten haben.";
|
||||
StartTimer();
|
||||
|
||||
@@ -69,7 +69,7 @@ namespace BeWo.AI.View
|
||||
|
||||
private void StopAufnahme()
|
||||
{
|
||||
cancel = true;
|
||||
timerActive = false;
|
||||
|
||||
VBPlay.Visibility = Visibility.Visible;
|
||||
VBStop.Visibility = Visibility.Hidden;
|
||||
@@ -79,14 +79,17 @@ namespace BeWo.AI.View
|
||||
private void StartTimer()
|
||||
{
|
||||
var sec = BeWoApp.AppSettings.AiVoiceRequestInterval;
|
||||
|
||||
if (sec <= 0)
|
||||
{
|
||||
sec = 10;
|
||||
}
|
||||
new DispatcherTimer(
|
||||
TimeSpan.FromMilliseconds(10000),
|
||||
TimeSpan.FromMilliseconds(sec * 1000),
|
||||
DispatcherPriority.Background,
|
||||
(s1, e1) =>
|
||||
{
|
||||
CheckTranskriptionStatus();
|
||||
if (cancel)
|
||||
if (!timerActive)
|
||||
{
|
||||
((DispatcherTimer)s1).Stop();
|
||||
|
||||
@@ -132,8 +135,8 @@ namespace BeWo.AI.View
|
||||
|
||||
private void ButtonStartStop_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
|
||||
if (ButtonText.Text.Contains("Aufnahme"))
|
||||
|
||||
if (!timerActive)
|
||||
{
|
||||
StartAufnahme();
|
||||
}
|
||||
|
||||
@@ -810,8 +810,12 @@ namespace BeWo.Data.Access
|
||||
var c = CreateCriteria<ServiceRecord>()
|
||||
.Add(Restrictions.Eq(ServiceRecord.PropertyName_CostBearer2SupportConceptOid, costbearer2SupportConcept));
|
||||
|
||||
|
||||
var max = ende.Date.AddDays(1);
|
||||
var max = ende.Date;
|
||||
if (ende.Date < DateTime.MaxValue.AddDays(-1))
|
||||
{
|
||||
max = max.AddDays(1);
|
||||
}
|
||||
|
||||
|
||||
c.Add(Restrictions.Ge(ServiceRecord.PropertyName_Start, start.Date))
|
||||
.Add(Restrictions.Lt(ServiceRecord.PropertyName_Start, max.Date));
|
||||
|
||||
@@ -234,6 +234,7 @@
|
||||
<Compile Include="Access\UserDAO.cs" />
|
||||
<Compile Include="ASPHibernateSessionManager.cs" />
|
||||
<Compile Include="DefaultHibernateSessionManager.cs" />
|
||||
<Compile Include="Entities\AiVoiceData.cs" />
|
||||
<Compile Include="Entities\OvertimeHistory.cs" />
|
||||
<Compile Include="Entities\AiConversation.cs" />
|
||||
<Compile Include="Entities\AiConversationMessage.cs" />
|
||||
@@ -861,6 +862,7 @@
|
||||
<EmbeddedResource Include="Mappings\OvertimeHistory.hbm.xml">
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Mappings\AiVoiceData.hbm.xml" />
|
||||
<Content Include="Mappings\Timesheet2Mail.hbm.xml" />
|
||||
<EmbeddedResource Include="Mappings\ContactHistory.hbm.xml">
|
||||
<SubType>Designer</SubType>
|
||||
|
||||
22
Data/Entities/AiVoiceData.cs
Normal file
22
Data/Entities/AiVoiceData.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using BS.Shared;
|
||||
using System;
|
||||
|
||||
namespace BeWo.Data.Entities
|
||||
{
|
||||
public class AiVoiceData : BeWoEntityBase
|
||||
{
|
||||
public AiVoiceData()
|
||||
{
|
||||
this._Tid = TableID.AiVoiceData;
|
||||
}
|
||||
|
||||
public virtual String Result { get; set; }
|
||||
public virtual String Status { get; set; }
|
||||
public virtual String StatusMessage { get; set; }
|
||||
public virtual String Error { get; set; }
|
||||
public virtual String TranskriptionText { get; set; }
|
||||
public virtual String Token { get; set; }
|
||||
public virtual String UploadUrl { get; set; }
|
||||
public virtual String ResultUrl { get; set; }
|
||||
}
|
||||
}
|
||||
26
Data/Mappings/AiVoiceData.hbm.xml
Normal file
26
Data/Mappings/AiVoiceData.hbm.xml
Normal file
@@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
|
||||
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2">
|
||||
<class name="BeWo.Data.Entities.AiVoiceData, BeWo.Data" table="AiVoiceData">
|
||||
<id name="Oid" column="Oid" type="Int64" unsaved-value="null">
|
||||
<generator class="identity" />
|
||||
</id>
|
||||
<version type="Int64" column="Version" name="Version" />
|
||||
<property column="Tid" type="BS.Shared.TableID, BS.Shared" name="_Tid" access="field" />
|
||||
<property column="Notice" type="String" name="Notice" length="1024" />
|
||||
<property column="InsTs" type="DateTime" name="InsTs" />
|
||||
<property column="InsUser" type="String" name="InsUser" length="256" />
|
||||
<property column="UpdTs" type="DateTime" name="UpdTs" />
|
||||
<property column="UdpUser" type="String" name="UdpUser" length="256" />
|
||||
<property column="IsActive" type="BS.Shared.ActivationTypeId, BS.Shared" name="IsActive" />
|
||||
<property column="SystemEntryID" type="BS.Shared.SystemEntryID, BS.Shared" name="SystemEntryID" />
|
||||
<property name="Result" />
|
||||
<property name="Status" />
|
||||
<property name="StatusMessage" />
|
||||
<property name="Error" />
|
||||
<property name="TranskriptionText" />
|
||||
<property name="Token" />
|
||||
<property name="UploadUrl" />
|
||||
<property name="ResultUrl" />
|
||||
</class>
|
||||
</hibernate-mapping>
|
||||
21
Model/Changes_2026-02-10_AiVoiceData.txt
Normal file
21
Model/Changes_2026-02-10_AiVoiceData.txt
Normal file
@@ -0,0 +1,21 @@
|
||||
CREATE TABLE IF NOT EXISTS `AiVoiceData` (
|
||||
`Oid` bigint NOT NULL AUTO_INCREMENT,
|
||||
`Tid` int NOT NULL,
|
||||
`Notice` varchar(1024) DEFAULT NULL,
|
||||
`InsTs` datetime DEFAULT NULL,
|
||||
`InsUser` varchar(256) DEFAULT NULL,
|
||||
`Version` bigint DEFAULT NULL,
|
||||
`UdpUser` varchar(256) DEFAULT NULL,
|
||||
`UpdTs` datetime DEFAULT NULL,
|
||||
`IsActive` tinyint DEFAULT NULL,
|
||||
`SystemEntryID` int DEFAULT NULL,
|
||||
`Result` varchar(1024) DEFAULT NULL,
|
||||
`Status` varchar(1024) DEFAULT NULL,
|
||||
`StatusMessage` varchar(1024) DEFAULT NULL,
|
||||
`Error` varchar(1024) DEFAULT NULL,
|
||||
`Token` varchar(1024) DEFAULT NULL,
|
||||
`UploadUrl` varchar(1024) DEFAULT NULL,
|
||||
`ResultUrl` varchar(1024) DEFAULT NULL,
|
||||
`TranskriptionText` MEDIUMTEXT DEFAULT NULL,
|
||||
PRIMARY KEY (`Oid`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
|
||||
@@ -1795,14 +1795,14 @@ CREATE TABLE IF NOT EXISTS `AiVoiceData` (
|
||||
`UpdTs` datetime DEFAULT NULL,
|
||||
`IsActive` tinyint DEFAULT NULL,
|
||||
`SystemEntryID` int DEFAULT NULL,
|
||||
|
||||
|
||||
`ChangeType` tinyint NULL DEFAULT NULL,
|
||||
`OvertimeOid` bigint NULL DEFAULT NULL,
|
||||
`OvertimeEmployeeOid` bigint DEFAULT NULL,
|
||||
`OvertimeDatum` datetime DEFAULT NULL,
|
||||
`OvertimeBetrag` decimal(18,10) DEFAULT NULL,
|
||||
`OvertimeAuszahlungsartOid` bigint DEFAULT NULL,
|
||||
`Result` varchar(1024) DEFAULT NULL,
|
||||
`Status` varchar(1024) DEFAULT NULL,
|
||||
`StatusMessage` varchar(1024) DEFAULT NULL,
|
||||
`Error` varchar(1024) DEFAULT NULL,
|
||||
`Token` varchar(1024) DEFAULT NULL,
|
||||
`UploadUrl` varchar(1024) DEFAULT NULL,
|
||||
`ResultUrl` varchar(1024) DEFAULT NULL,
|
||||
`TranskriptionText` MEDIUMTEXT DEFAULT NULL,
|
||||
PRIMARY KEY (`Oid`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
|
||||
|
||||
|
||||
@@ -222,7 +222,6 @@
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="AI\AiVoiceData.cs" />
|
||||
<Compile Include="AI\TranscriptionService.cs" />
|
||||
<Compile Include="Attributes\RequireWcfAuthorizationAttribute.cs" />
|
||||
<Compile Include="Attributes\RequireApiAuthorizationAttribute.cs" />
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace BeWo.Service.AI
|
||||
{
|
||||
public class AiVoiceData
|
||||
{
|
||||
public String Result { get; set; }
|
||||
public String Status { get; set; }
|
||||
public String StatusMessage { get; set; }
|
||||
public String Error { get; set; }
|
||||
public String TranskriptionText { get; set; }
|
||||
public String Token { get; set; }
|
||||
public String UploadUrl { get; set; }
|
||||
public String ResultUrl { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,6 @@
|
||||
using BeWo.Data.Security;
|
||||
using BeWo.Data.Access;
|
||||
using BeWo.Data.Entities;
|
||||
using BeWo.Data.Security;
|
||||
using BeWo.Service.OwnChat;
|
||||
using BS.Shared.DataContracts;
|
||||
using Newtonsoft.Json;
|
||||
@@ -17,9 +19,18 @@ namespace BeWo.Service.AI
|
||||
{
|
||||
public AiVoiceData StartTranskription(String tenant, String sprache = "de")
|
||||
{
|
||||
|
||||
AiVoiceData avd = null;
|
||||
|
||||
try
|
||||
{
|
||||
|
||||
//avd = new AiVoiceData();
|
||||
//avd.StatusMessage = "1";
|
||||
//DAOFactory.GenericDAO.Update(avd);
|
||||
|
||||
//return avd;
|
||||
|
||||
avd = GetTranskriptionToken(tenant, sprache);
|
||||
|
||||
if (!String.IsNullOrEmpty(avd.Token))
|
||||
@@ -48,6 +59,12 @@ namespace BeWo.Service.AI
|
||||
|
||||
try
|
||||
{
|
||||
//if (!String.IsNullOrEmpty(avd.StatusMessage) && Int32.TryParse(avd.StatusMessage, out var test))
|
||||
//{
|
||||
// test++;
|
||||
// avd.StatusMessage = String.Format("{0}", test);
|
||||
//}
|
||||
|
||||
if (!String.IsNullOrEmpty(avd.ResultUrl))
|
||||
{
|
||||
if (CheckValidUrl(avd.ResultUrl))
|
||||
@@ -83,10 +100,12 @@ namespace BeWo.Service.AI
|
||||
else if (json.result == "0" && json.state == "30")
|
||||
{
|
||||
avd.StatusMessage = "Transkription erfolgreich abgeschlossen";
|
||||
DAOFactory.GenericDAO.Update(avd);
|
||||
}
|
||||
else
|
||||
{
|
||||
avd.StatusMessage = String.Format("Es ist leider ein Fehler aufgetreten: Result = {0}, Status = {1}", json.result, json.state);
|
||||
DAOFactory.GenericDAO.Update(avd);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -113,7 +132,6 @@ namespace BeWo.Service.AI
|
||||
private AiVoiceData GetTranskriptionToken(String tenant, String sprache)
|
||||
{
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
var serverUrl = OwnChatHelper.ErmittleServerURL("4", tenant);
|
||||
|
||||
@@ -192,7 +192,8 @@ namespace BS.Shared
|
||||
AiConfig = 182,
|
||||
StoredFile = 183,
|
||||
Person2Team = 184,
|
||||
OvertimeHistory = 185
|
||||
OvertimeHistory = 185,
|
||||
AiVoiceData = 186
|
||||
}
|
||||
|
||||
public enum SystemEntryID
|
||||
|
||||
Reference in New Issue
Block a user