update 20250205
This commit is contained in:
@@ -46,7 +46,7 @@ namespace API_NetFramework.Controllers
|
||||
slow = 2,
|
||||
docupload = 3
|
||||
}
|
||||
|
||||
|
||||
public class ArchivController : ApiController
|
||||
{
|
||||
// GET: OnBase
|
||||
@@ -61,7 +61,7 @@ namespace API_NetFramework.Controllers
|
||||
string sql = "Insert OnDoc_IL_Log (dokumentid, ilresponse,error, erstellt_am) values ('" + dokumentid + "',";
|
||||
sql = sql + "'" + ilr.response.ToString() + "',";
|
||||
if (ilr.senderror != 0) { sql = sql + "1,"; } else { sql = sql + "0,"; }
|
||||
sql = sql +"getdate() )";
|
||||
sql = sql + "getdate() )";
|
||||
dB.Exec_SQL(sql);
|
||||
dB = null;
|
||||
APILogging.Log((HttpRequestMessage)Request, "Ende Update IL_Log: DokumentID:" + dokumentid, LogLevelType.Debug);
|
||||
@@ -144,7 +144,7 @@ namespace API_NetFramework.Controllers
|
||||
APILogging.Log((HttpRequestMessage)Request, "Start ArchiveDocFromDatabase: DokumentID:" + DokumentID, LogLevelType.Debug);
|
||||
DB db = new DB(connectionstring);
|
||||
|
||||
db.Get_Tabledata("Select dokumenttypnr, dokumentname from dokument where dokumentid='" + DokumentID+"'", false, true);
|
||||
db.Get_Tabledata("Select dokumenttypnr, dokumentname from dokument where dokumentid='" + DokumentID + "'", false, true);
|
||||
extension = System.IO.Path.GetExtension(db.dsdaten.Tables[0].Rows[0]["dokumentname"].ToString());
|
||||
doktypnr = db.dsdaten.Tables[0].Rows[0][0].ToString();
|
||||
db.clear_parameter();
|
||||
@@ -154,7 +154,7 @@ namespace API_NetFramework.Controllers
|
||||
|
||||
DocGet dg = new DocGet(connectionstring);
|
||||
clsdok dok = new clsdok("", "", "");
|
||||
|
||||
|
||||
string[] officeformat = System.Configuration.ConfigurationManager.AppSettings["ArchivierungOfficeFormat"].ToString().Split(',');
|
||||
string[] excelconvert = System.Configuration.ConfigurationManager.AppSettings["ExcelDokType"].ToString().Split(',');
|
||||
string excelvaluefile = System.Configuration.ConfigurationManager.AppSettings["ExcelValueFile"].ToString();
|
||||
@@ -202,12 +202,13 @@ namespace API_NetFramework.Controllers
|
||||
db.Get_Tabledata("[sp_Get_OnDoc_Parameters]", true, false);
|
||||
|
||||
}
|
||||
if (officeformat.Contains(doktypnr) || extension.ToUpper()=="PDF")
|
||||
if (officeformat.Contains(doktypnr) || extension.ToUpper() == "PDF")
|
||||
{
|
||||
dg.GetDoc(DokumentID);
|
||||
extension = extension.ToUpper().Replace(".", "");
|
||||
}
|
||||
else {
|
||||
else
|
||||
{
|
||||
dok = dg.GetDocAsPDF(DokumentID);
|
||||
extension = "PDF";
|
||||
}
|
||||
@@ -260,7 +261,7 @@ namespace API_NetFramework.Controllers
|
||||
APILogging.Log((HttpRequestMessage)Request, "Ende ArchiveDocFromDatabase: DokumentID:" + DokumentID, LogLevelType.Debug);
|
||||
|
||||
//Log nachführen
|
||||
Update_IL_Log(ref ilr,DokumentID);
|
||||
Update_IL_Log(ref ilr, DokumentID);
|
||||
if (ilr.senderror == 1)
|
||||
{
|
||||
return Content(HttpStatusCode.InternalServerError, ilr.response);
|
||||
@@ -282,7 +283,7 @@ namespace API_NetFramework.Controllers
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
[HttpPost]
|
||||
[Route("API/ArchivDocFromIRIS")]
|
||||
@@ -306,18 +307,34 @@ namespace API_NetFramework.Controllers
|
||||
db.clear_parameter();
|
||||
db.add_parameter("@dokumentid", dokumentid);
|
||||
db.Get_Tabledata("[OnDoc_IRIS_Archivierung]", true, false);
|
||||
string returnmessage = db.dsdaten.Tables[0].Rows[0][0].ToString();
|
||||
switch (db.dsdaten.Tables[0].Rows[0][1].ToString())
|
||||
{
|
||||
case "1":
|
||||
case "2":
|
||||
case "3":
|
||||
APILogging.Log((HttpRequestMessage)Request, db.dsdaten.Tables[0].Rows[0].ToString() + dokumentid, LogLevelType.Debug);
|
||||
return Content(HttpStatusCode.NotFound, returnmessage);
|
||||
case "0":
|
||||
return (ArchivDocFromDatabase(dokumentid));
|
||||
default:
|
||||
break;
|
||||
string returnmessage = db.dsdaten.Tables[0].Rows[0][0].ToString();
|
||||
switch (db.dsdaten.Tables[0].Rows[0][1].ToString())
|
||||
{
|
||||
case "1":
|
||||
APILogging.Log((HttpRequestMessage)Request, dokumentid + " Image des Dokuments nicht vorhanden", LogLevelType.Error);
|
||||
return Content(HttpStatusCode.NotFound, dokumentid);
|
||||
break;
|
||||
case "2":
|
||||
APILogging.Log((HttpRequestMessage)Request, dokumentid + " nicht vorhanden", LogLevelType.Error);
|
||||
return Content(HttpStatusCode.NotFound, dokumentid);
|
||||
break;
|
||||
case "3":
|
||||
APILogging.Log((HttpRequestMessage)Request, db.dsdaten.Tables[0].Rows[0][0].ToString() + dokumentid, LogLevelType.Debug);
|
||||
return Content(HttpStatusCode.NotFound, returnmessage);
|
||||
case "0":
|
||||
return (ArchivDocFromDatabase(dokumentid));
|
||||
case "4":
|
||||
APILogging.Log((HttpRequestMessage)Request, "Dokumentarchivierung von Iris ausgelöst" + dokumentid, LogLevelType.Info);
|
||||
break;
|
||||
case "5":
|
||||
APILogging.Log((HttpRequestMessage)Request, "Dokument bereit zur Ausgangsarchivierung" + dokumentid, LogLevelType.Info);
|
||||
break;
|
||||
case "6":
|
||||
APILogging.Log((HttpRequestMessage)Request, "Dokument in EDOKA abgeschlossen" + dokumentid, LogLevelType.Info);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
};
|
||||
|
||||
}
|
||||
@@ -334,8 +351,8 @@ namespace API_NetFramework.Controllers
|
||||
}
|
||||
[HttpPost]
|
||||
[Route("API/ArchivSBDoc")]
|
||||
|
||||
public IHttpActionResult ArchivSBDoc(string sbnr, string intid, int partnernr, string dokumentid )
|
||||
|
||||
public IHttpActionResult ArchivSBDoc(string sbnr, string intid, int partnernr, string dokumentid)
|
||||
{
|
||||
if (SecuringWebApiUsingApiKey.Middleware.ApiKeyMiddleware.Authorized((HttpRequestMessage)Request, tokenfunction) == false)
|
||||
{
|
||||
@@ -362,15 +379,15 @@ namespace API_NetFramework.Controllers
|
||||
IHttpActionResult transferResult = null;
|
||||
if (SendToOnBase != "Yes")
|
||||
{
|
||||
transferResult = Transfer_OnBase(uploadtype.slow, ref jsonstring, ref ilr);
|
||||
transferResult = Transfer_OnBase(uploadtype.slow, ref jsonstring, ref ilr);
|
||||
if (SendToFile == "Yes")
|
||||
{
|
||||
if (debugfilename != "")
|
||||
{
|
||||
debugfilename=debugfilename+ sbnr.ToString() + "_" + intid.ToString() + "_" + partnernr.ToString() + ".json";
|
||||
debugfilename = debugfilename + sbnr.ToString() + "_" + intid.ToString() + "_" + partnernr.ToString() + ".json";
|
||||
System.IO.File.WriteAllText(debugfilename, jsonstring);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -388,10 +405,11 @@ namespace API_NetFramework.Controllers
|
||||
WebRequest request;
|
||||
APILogging.Log((HttpRequestMessage)Request, "Start Transfer to OnBase", LogLevelType.Debug);
|
||||
|
||||
string url ="";
|
||||
switch (utype){
|
||||
string url = "";
|
||||
switch (utype)
|
||||
{
|
||||
case uploadtype.fast:
|
||||
url= System.Configuration.ConfigurationManager.AppSettings["ILFast"];
|
||||
url = System.Configuration.ConfigurationManager.AppSettings["ILFast"];
|
||||
break;
|
||||
case uploadtype.slow:
|
||||
url = System.Configuration.ConfigurationManager.AppSettings["ILSlow"];
|
||||
@@ -423,7 +441,7 @@ namespace API_NetFramework.Controllers
|
||||
}
|
||||
ilr.StatusCode = 0;
|
||||
ilr.senderror = 0;
|
||||
ilr.response=response;
|
||||
ilr.response = response;
|
||||
APILogging.Log((HttpRequestMessage)Request, "Ende Transfer to OnBase", LogLevelType.Debug);
|
||||
return Content(HttpStatusCode.OK, ilr);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user