Initial commit

This commit is contained in:
2021-04-20 07:59:36 +02:00
commit fb0247c874
21969 changed files with 11640044 additions and 0 deletions

View File

@@ -0,0 +1,214 @@
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[sp_edkb12]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[sp_edkb12]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[sp_edkb12_check]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[sp_edkb12_check]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[sp_edkb12_meldung]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[sp_edkb12_meldung]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[sp_edkb12_profil]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[sp_edkb12_profil]
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS OFF
GO
---------------------------------------------------------------------------------------------------------
-- Name: sp_edkb12
-- Desc: Funktion abhängig vom Funktionscode:
-- 1: Lesen des ersten zu bearbeitenden Datensatzes aus EDK_Data
-- 2: Update des Status in EDK_Data
-- Status 1: In Bearbeitung
-- 2: Fehlerhaft
-- 3: Erfolgreich
--
-- Autor Stefan Hutter
--
-- Remarks: EDOKA Rel. 4.02
-- Version : 1.0 / 17.08.2008
---------------------------------------------------------------------------------------------------------
CREATE PROCEDURE [dbo].sp_edkb12
@fnkt int,
@rowid int=0,
@status int=0
AS
-- Status 0: EDK-Verarbeitung pendent
-- Status 1: Verarbeitung gestartet
-- Status 2: Verarbeitung fehlerhaft beendet
-- Status 3: Verarbeitung erfolgreich beendet
-- fnkt 1: Alle pendenten EDK-Dateien auslesen
-- fnkt 2: Statusmutation
if @fnkt=1 begin
select top 1 * from edk_data where status=0 order by insert_timestamp
return
end
if @fnkt=2 begin
update edk_data set status=@status, status_timestamp=getdate() where rowid=@rowid
return
end
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS OFF
GO
---------------------------------------------------------------------------------------------------------
-- Name: sp_edkb12_check
-- Desc: Prüft in EDOKA, ob der Dokumenttyp für die Dokumenterstellung über EDKB12 gesetzt ist
--
-- Autor Stefan Hutter
--
-- Remarks: EDOKA Rel. 4.02
-- Version : 1.0 / 17.08.2008
---------------------------------------------------------------------------------------------------------
CREATE PROCEDURE [dbo].[sp_edkb12_check]
@idokumenttypnr int,
@odokumenttypnr int output
AS
declare @counter int
select @counter=count(*) from edk_data_doktype where dokumenttypnr=@idokumenttypnr - 900000000
set @odokumenttypnr=@counter
return
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS OFF
GO
---------------------------------------------------------------------------------------------------------
-- Name: sp_edkb12_meldung
-- Desc: Meldungsversand aus EDKB12
-- Bei OK oder im Fehlerfall wird ein Mail an den Besteller und an den Sysadmin geschickt
--
-- !!!Meldung an den Sysadmin unten mit fixer Sysadmin-Nr konfigurieren!!!
-- set @sysadmin=... (Mitarbeiternr des Systemadministrators)
--
-- Status-Beschreibung:
-- 2 = Fehlermeldung
-- 3 = OK-Meldung
-- -1 = Fehlermeldung fü Sysadmin
--
-- Autor Stefan Hutter
--
-- Remarks: EDOKA Rel. 4.02
-- Version : 1.0 / 17.08.2008
---------------------------------------------------------------------------------------------------------
CREATE PROCEDURE [dbo].[sp_edkb12_meldung]
@status int,
@mitarbeiter int=0,
@betreff varchar(256),
@meldung varchar(1024),
@dokumentid varchar(22)
AS
---- Sysadmin setzen: Mitarbeiternummer des Systemadministrators
declare @sysadmin int
set @sysadmin=1
---
declare @mailempfang int
declare @mailadresse varchar(255)
declare @sendmail1 int
declare @sendmail2 int
declare @edkmail int
declare @empfaenger int
select @sendmail2=MailDokumentrueckgang, @sendmail1=edokamesasge,
@mailempfang=mailempfang, @mailadresse=email, @edkmail=edoka_mail
from mitarbeiter where mitarbeiternr=@mitarbeiter
-- Meldung ueber Dokumenterstellung (OK, NOK)
if @status = 3 or @status = 2 begin
if @edkmail=1 begin
insert message (titel, meldung, absender, empfaenger, erstellt_am, mutiert_am, mutierer, aktiv, dokumentid)
values (@betreff, @meldung, 9999, @mitarbeiter, getdate(), getdate(), 9999, 1,@dokumentid)
end
if @mailempfang=1 begin
EXEC sp_sendmail @mailadresse,@betreff,@meldung
end
end
-- Meldung ueber Dokumenterstellung (OK, NOK) fuer Sysadmin
if @status = 3 or @status = 2 begin
select @sendmail2=MailDokumentrueckgang, @sendmail1=edokamesasge,
@mailempfang=mailempfang, @mailadresse=email, @edkmail=edoka_mail
from mitarbeiter where mitarbeiternr=@sysadmin
if @edkmail=1 begin
insert message (titel, meldung, absender, empfaenger, erstellt_am, mutiert_am, mutierer, aktiv, dokumentid)
values (@betreff, @meldung, 9999, @mitarbeiter, getdate(), getdate(), 9999, 1,@dokumentid)
end
if @mailempfang=1 begin
EXEC sp_sendmail @mailadresse,@betreff,@meldung
end
end
-- Fehlermeldung
if @status = -1 begin
select @sendmail2=MailDokumentrueckgang, @sendmail1=edokamesasge,
@mailempfang=mailempfang, @mailadresse=email, @edkmail=edoka_mail
from mitarbeiter where mitarbeiternr=@sysadmin
if @edkmail=1 begin
insert message (titel, meldung, absender, empfaenger, erstellt_am, mutiert_am, mutierer, aktiv, dokumentid)
values (@betreff, @meldung, 9999, @mitarbeiter, getdate(), getdate(), 9999, 1,@dokumentid)
end
if @mailempfang=1 begin
EXEC sp_sendmail @mailadresse,@betreff,@meldung
end
end
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS OFF
GO
---------------------------------------------------------------------------------------------------------
-- Name: sp_sp_edkb12_profil
-- Desc: Liest das erste (Standard-) Profil des verantwortlichen Mitarbeiters aus
--
-- Autor Stefan Hutter
--
-- Remarks: EDOKA Rel. 4.02
-- Version : 1.0 / 17.08.2008
---------------------------------------------------------------------------------------------------------
CREATE PROCEDURE [dbo].[sp_edkb12_profil]
@mitarbeiternr int
AS
SELECT TOP 100 PERCENT profilnr, standard, aktiv, mitarbeiternr, unterschriftlinks, unterschriftrechts
FROM dbo.profil
WHERE (mitarbeiternr = @mitarbeiternr) and aktiv=1
ORDER BY standard DESC
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO

View File

@@ -0,0 +1,42 @@
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[edk_data]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[edk_data]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[edk_data_doktype]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[edk_data_doktype]
GO
CREATE TABLE [dbo].[edk_data] (
[RowId] [int] IDENTITY (1, 1) NOT NULL ,
[TGNummer] [varchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[Insert_TimeStamp] [datetime] NULL ,
[Status] [int] NULL ,
[Status_TimeStamp] [datetime] NULL ,
[xmldata] [image] NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
CREATE TABLE [dbo].[edk_data_doktype] (
[Dokumenttypnr] [int] NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[edk_data] WITH NOCHECK ADD
CONSTRAINT [PK_edk_data] PRIMARY KEY CLUSTERED
(
[RowId]
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[edk_data_doktype] WITH NOCHECK ADD
CONSTRAINT [PK_edk_data_doktype] PRIMARY KEY CLUSTERED
(
[Dokumenttypnr]
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[edk_data] ADD
CONSTRAINT [DF_edk_data_Insert_TimeStamp] DEFAULT (getdate()) FOR [Insert_TimeStamp],
CONSTRAINT [DF_edk_data_Status_TimeStamp] DEFAULT (getdate()) FOR [Status_TimeStamp]
GO

Binary file not shown.