Compare commits
10 Commits
90819d9241
...
d2d13320b7
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d2d13320b7 | ||
| fc17607567 | |||
| 23f658e76a | |||
| e8e9cdca3c | |||
| 83f1edcd9c | |||
| 0d9bb677c1 | |||
| 7aa49b9f84 | |||
| 111094fd75 | |||
| cb6acbfa08 | |||
| 5f1b51fd5f |
@@ -1,4 +0,0 @@
|
||||
[*.cs]
|
||||
|
||||
# CS0618: Type or member is obsolete
|
||||
dotnet_diagnostic.CS0618.severity = none
|
||||
3
FodyWeavers.xml
Normal file
3
FodyWeavers.xml
Normal file
@@ -0,0 +1,3 @@
|
||||
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd">
|
||||
<Costura />
|
||||
</Weavers>
|
||||
28
Log.cs
Normal file
28
Log.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
namespace SendNotify
|
||||
{
|
||||
internal class Log
|
||||
{
|
||||
private static object obj = new object();
|
||||
public static void Logger(string str)
|
||||
{
|
||||
lock (obj)
|
||||
{
|
||||
string outdir = Environment.CurrentDirectory + @"\logs\";
|
||||
if (!Directory.Exists(outdir)) Directory.CreateDirectory(outdir);
|
||||
string filename = $"{DateTime.Now.Day}_{DateTime.Now.Month}_{DateTime.Now.Year}_SendNotify";
|
||||
|
||||
foreach (FileInfo file in new DirectoryInfo(outdir).GetFiles())
|
||||
{
|
||||
if (Convert.ToDateTime(file.LastWriteTime) < DateTime.Now.AddDays(-30))
|
||||
file.Delete();
|
||||
}
|
||||
|
||||
using (FileStream aFile = new FileStream($@"{outdir}\{filename}.log", FileMode.Append, FileAccess.Write))
|
||||
using (StreamWriter sw = new StreamWriter(aFile))
|
||||
{
|
||||
sw.WriteLine(DateTime.Now + " - " + str);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
271
Program.cs
271
Program.cs
@@ -1,49 +1,117 @@
|
||||
using System.Data.SqlClient;
|
||||
using Microsoft.Data.SqlClient;
|
||||
using Oracle.ManagedDataAccess.Client;
|
||||
using SendNotify;
|
||||
using System.Net;
|
||||
using System.Net.Http.Json;
|
||||
using System.Text;
|
||||
|
||||
internal class Program
|
||||
{
|
||||
private static DateTime lastDate = DateTime.MinValue;
|
||||
private static DateTime startProgramDT = DateTime.MinValue;
|
||||
public static bool statusRemovingBillets = false;
|
||||
private static CancellationTokenSource? removalCts;
|
||||
private static object removalLock = new object();
|
||||
|
||||
private static void Main(string[] args)
|
||||
{
|
||||
startProgramDT = DateTime.Now;
|
||||
var RemovingBillets = new RemovingBillets();
|
||||
|
||||
while (true)
|
||||
{
|
||||
string? gotifyUrl = null;
|
||||
string? appToken_furnace250_l2 = null;
|
||||
string? appToken_izhstal = null;
|
||||
string? clientToken_izhstal = null;
|
||||
string? proxyUrl = null;
|
||||
string? proxyUsername = null;
|
||||
string? proxyPassword = null;
|
||||
string? checkNow = null;
|
||||
int targetPriority = -1;
|
||||
|
||||
var config = File.ReadAllLines("config.txt");
|
||||
|
||||
foreach (var line in config)
|
||||
{
|
||||
if (line.StartsWith("gotify_url="))
|
||||
gotifyUrl = line.Substring("gotify_url=".Length);
|
||||
else if (line.StartsWith("app_token_furnace250_l2="))
|
||||
appToken_furnace250_l2 = line.Substring("app_token_furnace250_l2=".Length);
|
||||
else if (line.StartsWith("app_token_izhstal="))
|
||||
appToken_izhstal = line.Substring("app_token_izhstal=".Length);
|
||||
else if (line.StartsWith("proxy_url="))
|
||||
proxyUrl = line.Substring("proxy_url=".Length);
|
||||
else if (line.StartsWith("proxy_username="))
|
||||
proxyUsername = line.Substring("proxy_username=".Length);
|
||||
else if (line.StartsWith("proxy_password="))
|
||||
proxyPassword = line.Substring("proxy_password=".Length);
|
||||
else if (line.StartsWith("check_now="))
|
||||
checkNow = line.Substring("check_now=".Length);
|
||||
else if (line.StartsWith("client_token_izhstal="))
|
||||
clientToken_izhstal = line.Substring("client_token_izhstal=".Length);
|
||||
else if (line.StartsWith("target_priority="))
|
||||
int.TryParse(line.Substring("target_priority=".Length), out targetPriority);
|
||||
}
|
||||
|
||||
if (gotifyUrl == null || appToken_furnace250_l2 == null || proxyUrl == null || proxyUsername == null || proxyPassword == null)
|
||||
if (gotifyUrl == null || appToken_izhstal == null || proxyUrl == null || proxyUsername == null ||
|
||||
proxyPassword == null || checkNow == null || clientToken_izhstal == null || targetPriority == -1)
|
||||
{
|
||||
Console.WriteLine("Ошибка: не все параметры указаны в config.txt");
|
||||
Log("Ошибка: не все параметры указаны в config.txt");
|
||||
|
||||
Log.Logger("Ошибка: не все параметры указаны в config.txt");
|
||||
}
|
||||
else
|
||||
CheckStatusAsync(gotifyUrl, appToken_furnace250_l2, proxyUrl, proxyUsername, proxyPassword);
|
||||
{
|
||||
NotifyPollingAsync(gotifyUrl, appToken_izhstal, proxyUrl, proxyUsername, proxyPassword, checkNow);
|
||||
var result = ReceiveMessagesAsync(gotifyUrl, clientToken_izhstal, proxyUrl, proxyUsername, proxyPassword, targetPriority).Result;
|
||||
|
||||
Thread.Sleep(10000);
|
||||
if (result.status && result.msg.Date > startProgramDT)
|
||||
{
|
||||
if (result.msg.Title?.ToLower() == "L2_REM".ToLower())
|
||||
{
|
||||
lock (removalLock)
|
||||
{
|
||||
if (result.msg.Message?.ToLower() == "ON".ToLower() && !statusRemovingBillets)
|
||||
{
|
||||
removalCts = new CancellationTokenSource();
|
||||
Task.Run(() => RemovingBillets.StartRemovalProcess(removalCts.Token));
|
||||
statusRemovingBillets = true;
|
||||
Log.Logger("Удаление заготовок: ЗАПУЩЕНО");
|
||||
}
|
||||
else if (result.msg.Message?.ToLower() == "OFF".ToLower() && statusRemovingBillets)
|
||||
{
|
||||
removalCts?.Cancel();
|
||||
statusRemovingBillets = false;
|
||||
Log.Logger("Удаление заготовок: ОСТАНОВЛЕНО");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Thread.Sleep(60000);
|
||||
}
|
||||
}
|
||||
|
||||
private static async void CheckStatusAsync(string url, string token, string proxyUrl, string proxyUsername, string proxyPassword)
|
||||
|
||||
|
||||
private static async void NotifyPollingAsync(string url, string token, string proxyUrl, string proxyUsername, string proxyPassword, string checkNow)
|
||||
{
|
||||
var result = CheckFurnace250Async().Result;
|
||||
#region test msg to check
|
||||
DateTime now = DateTime.Now;
|
||||
if ((now.Hour == 8 && now.Date != lastDate.Date) || checkNow.ToLower() == "yes")
|
||||
{
|
||||
var notification = new
|
||||
{
|
||||
title = "Test notify",
|
||||
message = "IS OK",
|
||||
priority = 3
|
||||
};
|
||||
await SendNotify(url, token, notification, proxyUrl, proxyUsername, proxyPassword);
|
||||
|
||||
if (checkNow.ToLower() != "yes")
|
||||
lastDate = now;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region check furnace 250
|
||||
var result = CheckFurnace250().Result;
|
||||
if (!result.status)
|
||||
{
|
||||
var notification = new
|
||||
@@ -54,50 +122,105 @@ internal class Program
|
||||
};
|
||||
await SendNotify(url, token, notification, proxyUrl, proxyUsername, proxyPassword);
|
||||
}
|
||||
Thread.Sleep(10000);
|
||||
#endregion
|
||||
|
||||
#region check billets 250
|
||||
result = CheckRoughToFinishedBilletCount().Result;
|
||||
if (!result.status)
|
||||
{
|
||||
var notification = new
|
||||
{
|
||||
title = "Статус мониторинга ст.250",
|
||||
message = result.msg,
|
||||
priority = 5
|
||||
};
|
||||
await SendNotify(url, token, notification, proxyUrl, proxyUsername, proxyPassword);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
||||
private static async Task<(bool status, string msg)> CheckFurnace250Async()
|
||||
private static async Task<(bool status, string msg)> CheckRoughToFinishedBilletCount()
|
||||
{
|
||||
int cntBillets = 0;
|
||||
const string sqlConn = "User Id=main;Password=main;Data Source=10.14.18.50:1521/izl2;";
|
||||
try
|
||||
{
|
||||
using (var conn = new OracleConnection(sqlConn))
|
||||
{
|
||||
await conn.OpenAsync();
|
||||
using (var command = conn.CreateCommand())
|
||||
{
|
||||
command.CommandText = "SELECT COUNT(*) FROM V_TRACKING_MILL";
|
||||
cntBillets = Convert.ToInt32(await command.ExecuteScalarAsync());
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return (false, ex.Message);
|
||||
}
|
||||
if (cntBillets > 9)
|
||||
{
|
||||
return (false, $"Заготовок в стане - {cntBillets}");
|
||||
}
|
||||
|
||||
return (true, "OK");
|
||||
}
|
||||
|
||||
|
||||
private static async Task<(bool status, string msg)> CheckFurnace250()
|
||||
{
|
||||
int cntEmptyPOID = 0;
|
||||
DateTime lastDT = DateTime.Now;
|
||||
const string sqlConn = @"Password=WonderUser;User ID=WonderUser;Initial Catalog=Furnace_l2;Data Source=10.14.18.38\IZHSTALSQLSRVER;TrustServerCertificate=true;Encrypt=true;";
|
||||
|
||||
try
|
||||
{
|
||||
string sqlConn = @"Password=WonderUser;User ID=WonderUser;Initial Catalog=Furnace_l2;Data Source=10.14.18.38\IZHSTALSQLSRVER;TrustServerCertificate=true;Encrypt=true;";
|
||||
using (var conn = new SqlConnection(sqlConn))
|
||||
{
|
||||
await conn.OpenAsync();
|
||||
string sqlQuery = @"SELECT COUNT(PO_ID) cnt_empty_poid, (SELECT top(1)
|
||||
CHARGING_TIME
|
||||
FROM [Furnace_l2].[dbo].[HIST_PIECES]
|
||||
where [IS_DISCHARGED] ='N' and
|
||||
datediff(day,CHARGING_TIME, Getdate()) < 1 AND
|
||||
RTRIM(LTRIM(PO_ID)) != ''
|
||||
order by CHARGING_TIME desc) last_dt
|
||||
FROM [Furnace_l2].[dbo].[HIST_PIECES]
|
||||
where [IS_DISCHARGED] ='N' and
|
||||
datediff(day,CHARGING_TIME, Getdate()) < 1 AND
|
||||
RTRIM(LTRIM(PO_ID)) = '';";
|
||||
string sqlQuery = @"SELECT
|
||||
COUNT(PO_ID) cnt_empty_poid,
|
||||
(
|
||||
SELECT
|
||||
top(1) CHARGING_TIME
|
||||
FROM
|
||||
[Furnace_l2].[dbo].[HIST_PIECES]
|
||||
WHERE
|
||||
[IS_DISCHARGED] = 'N'
|
||||
AND datediff(DAY, CHARGING_TIME, Getdate()) < 1
|
||||
AND RTRIM(LTRIM(PO_ID)) != ''
|
||||
ORDER BY
|
||||
CHARGING_TIME DESC
|
||||
) last_dt
|
||||
FROM
|
||||
[Furnace_l2].[dbo].[HIST_PIECES]
|
||||
WHERE
|
||||
[IS_DISCHARGED] = 'N'
|
||||
AND datediff(DAY, CHARGING_TIME, Getdate()) < 1
|
||||
AND RTRIM(LTRIM(PO_ID)) = '';";
|
||||
using (var command = new SqlCommand(sqlQuery, conn))
|
||||
using (var dbReader = await command.ExecuteReaderAsync())
|
||||
{
|
||||
while (await dbReader.ReadAsync())
|
||||
{
|
||||
cntEmptyPOID = Convert.ToInt32(dbReader.GetValue(0));
|
||||
lastDT = Convert.ToDateTime(dbReader.GetValue(1));
|
||||
if (dbReader.GetValue(0) != DBNull.Value && dbReader.GetValue(1) != DBNull.Value)
|
||||
{
|
||||
cntEmptyPOID = Convert.ToInt32(dbReader.GetValue(0));
|
||||
lastDT = Convert.ToDateTime(dbReader.GetValue(1));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch
|
||||
catch (Exception ex)
|
||||
{
|
||||
return (false, "Ошибка подключения к БД!");
|
||||
return (false, ex.Message);
|
||||
}
|
||||
|
||||
if (cntEmptyPOID > 15 && DateTime.Now - lastDT > new TimeSpan(0, 5, 0))
|
||||
{
|
||||
return (false, "Проблема с привязкой заготовок в ПШП.");
|
||||
return (false, $"Проблема с привязкой ID заготовок в ПШП. Не привязанных - {cntEmptyPOID}, время последней привязанной - {lastDT}");
|
||||
}
|
||||
|
||||
return (true, "OK");
|
||||
@@ -127,48 +250,100 @@ internal class Program
|
||||
|
||||
try
|
||||
{
|
||||
HttpResponseMessage response = await client.PostAsync(url, content);
|
||||
var requestUrl = $"{url}/message";
|
||||
HttpResponseMessage response = await client.PostAsync(requestUrl, content);
|
||||
|
||||
if (response.IsSuccessStatusCode)
|
||||
{
|
||||
Console.WriteLine($"{DateTime.Now} - Отправлено сообщение.");
|
||||
Log($"{DateTime.Now} - Отправлено сообщение.");
|
||||
Log.Logger($"Отправлено сообщение.");
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine($"Ошибка: {response.StatusCode} - {await response.Content.ReadAsStringAsync()}");
|
||||
Log($"Ошибка: {response.StatusCode} - {await response.Content.ReadAsStringAsync()}");
|
||||
Log.Logger($"Ошибка: {response.StatusCode} - {await response.Content.ReadAsStringAsync()}");
|
||||
}
|
||||
}
|
||||
catch (HttpRequestException ex)
|
||||
{
|
||||
Console.WriteLine($"Ошибка подключения: {ex.Message}");
|
||||
Log($"Ошибка подключения: {ex.Message}");
|
||||
Log.Logger($"Ошибка подключения: {ex.Message}");
|
||||
if (ex.InnerException != null)
|
||||
{
|
||||
Console.WriteLine($"Детали: {ex.InnerException.Message}");
|
||||
Log($"Детали: {ex.InnerException.Message}");
|
||||
Log.Logger($"Детали: {ex.InnerException.Message}");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void Log(string str)
|
||||
private static async Task<(bool status, GotifyMessage msg)> ReceiveMessagesAsync(
|
||||
string url,
|
||||
string token,
|
||||
string proxyUrl,
|
||||
string proxyUsername,
|
||||
string proxyPassword,
|
||||
int targetPriority)
|
||||
{
|
||||
string outdir = Environment.CurrentDirectory + @"\logs\";
|
||||
if (!Directory.Exists(outdir)) Directory.CreateDirectory(outdir);
|
||||
string filename = $"{DateTime.Now.Day}_{DateTime.Now.Month}_{DateTime.Now.Year}_SendNotify";
|
||||
|
||||
foreach (FileInfo file in new DirectoryInfo(outdir).GetFiles())
|
||||
var proxy = new WebProxy(new Uri(proxyUrl))
|
||||
{
|
||||
if (Convert.ToDateTime(file.LastWriteTime) < DateTime.Now.AddDays(-30))
|
||||
file.Delete();
|
||||
}
|
||||
Credentials = new NetworkCredential(proxyUsername, proxyPassword, "MECHEL")
|
||||
};
|
||||
|
||||
using (FileStream aFile = new FileStream($@"{outdir}\{filename}.log", FileMode.Append, FileAccess.Write))
|
||||
using (StreamWriter sw = new StreamWriter(aFile))
|
||||
var handler = new HttpClientHandler()
|
||||
{
|
||||
sw.WriteLine(DateTime.Now + " - " + str);
|
||||
Proxy = proxy,
|
||||
UseProxy = true,
|
||||
PreAuthenticate = true,
|
||||
UseDefaultCredentials = false
|
||||
};
|
||||
|
||||
using (var client = new HttpClient(handler))
|
||||
{
|
||||
client.DefaultRequestHeaders.Add("X-Gotify-Key", token);
|
||||
var requestUrl = $"{url}/message?limit=100";
|
||||
|
||||
try
|
||||
{
|
||||
var response = await client.GetAsync(requestUrl);
|
||||
if (response.IsSuccessStatusCode)
|
||||
{
|
||||
var messages = await response.Content.ReadFromJsonAsync<GotifyMessagesResponse>();
|
||||
|
||||
var filtered = messages.Messages?
|
||||
.Where(m => m.Priority == targetPriority)
|
||||
.OrderByDescending(m => m.Date)
|
||||
.ToList();
|
||||
|
||||
if (filtered?.Count > 0)
|
||||
{
|
||||
var lastMsg = filtered.First();
|
||||
return (true, lastMsg);
|
||||
}
|
||||
return (false, null);
|
||||
}
|
||||
|
||||
Console.WriteLine($"Ошибка HTTP: {response.StatusCode}");
|
||||
return (false, null);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine($"Ошибка: {ex.Message}");
|
||||
Log.Logger($"Ошибка получения сообщений: {ex.Message}");
|
||||
return (false, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class GotifyMessagesResponse
|
||||
{
|
||||
public required List<GotifyMessage> Messages { get; set; }
|
||||
}
|
||||
|
||||
public class GotifyMessage
|
||||
{
|
||||
public string? Title { get; set; }
|
||||
public string? Message { get; set; }
|
||||
public int Priority { get; set; }
|
||||
public DateTime Date { get; set; }
|
||||
}
|
||||
}
|
||||
11
Properties/launchSettings.json
Normal file
11
Properties/launchSettings.json
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"profiles": {
|
||||
"SendNotify": {
|
||||
"commandName": "Project"
|
||||
},
|
||||
"WSL": {
|
||||
"commandName": "WSL2",
|
||||
"distributionName": ""
|
||||
}
|
||||
}
|
||||
}
|
||||
140
RemovingBillets.cs
Normal file
140
RemovingBillets.cs
Normal file
@@ -0,0 +1,140 @@
|
||||
using Oracle.ManagedDataAccess.Client;
|
||||
using SendNotify;
|
||||
using System.Data;
|
||||
|
||||
public class RemovingBillets
|
||||
{
|
||||
private static readonly object _syncRoot = new object();
|
||||
private static bool _isProcessActive = false;
|
||||
private static DateTime _lastCheckTime = DateTime.MinValue;
|
||||
|
||||
public static async Task StartRemovalProcess(CancellationToken ct)
|
||||
{
|
||||
lock (_syncRoot)
|
||||
{
|
||||
if (_isProcessActive)
|
||||
{
|
||||
Log.Logger("Процесс удаления уже запущен");
|
||||
return;
|
||||
}
|
||||
_isProcessActive = true;
|
||||
}
|
||||
|
||||
Log.Logger("Процесс удаления: СТАРТ");
|
||||
|
||||
try
|
||||
{
|
||||
using (var periodicTimer = new PeriodicTimer(TimeSpan.FromSeconds(5)))
|
||||
{
|
||||
while (await periodicTimer.WaitForNextTickAsync(ct))
|
||||
{
|
||||
if (ct.IsCancellationRequested)
|
||||
break;
|
||||
|
||||
try
|
||||
{
|
||||
var result = await CheckAndSendAlerts(ct);
|
||||
|
||||
if (!result)
|
||||
{
|
||||
Log.Logger("Нет заготовок для удаления - остановка");
|
||||
break;
|
||||
}
|
||||
|
||||
_lastCheckTime = DateTime.Now;
|
||||
}
|
||||
catch (Exception ex) when (ex is not OperationCanceledException)
|
||||
{
|
||||
Log.Logger($"Ошибка в процессе удаления: {ex.Message}");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (OperationCanceledException)
|
||||
{
|
||||
Log.Logger("Процесс удаления: ОСТАНОВЛЕН ПО ТРЕБОВАНИЮ");
|
||||
}
|
||||
finally
|
||||
{
|
||||
lock (_syncRoot)
|
||||
{
|
||||
_isProcessActive = false;
|
||||
}
|
||||
Program.statusRemovingBillets = false;
|
||||
Log.Logger("Процесс удаления: ЗАКОНЧЕН");
|
||||
}
|
||||
}
|
||||
|
||||
private static async Task<bool> CheckAndSendAlerts(CancellationToken ct)
|
||||
{
|
||||
const string oracleConn = "User Id=main;Password=main;Data Source=10.14.18.50:1521/izl2;";
|
||||
|
||||
try
|
||||
{
|
||||
using var conn = new OracleConnection(oracleConn);
|
||||
await conn.OpenAsync(ct);
|
||||
|
||||
var products = await GetTrackedProducts(conn, ct);
|
||||
if (!products.Any()) return false;
|
||||
|
||||
foreach (var product in products)
|
||||
{
|
||||
ct.ThrowIfCancellationRequested();
|
||||
await SendToRoll(product.ProductId, conn, ct);
|
||||
Thread.Sleep(10000);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
private static async Task<List<ProductInfo>> GetTrackedProducts(OracleConnection conn, CancellationToken ct)
|
||||
{
|
||||
var result = new List<ProductInfo>();
|
||||
|
||||
using var cmd = conn.CreateCommand();
|
||||
cmd.CommandText = @"
|
||||
SELECT
|
||||
product_id,
|
||||
DISCHARGING_DATI
|
||||
FROM V_TRACKING_MILL
|
||||
WHERE DISCHARGING_DATI > :last_check";
|
||||
|
||||
cmd.Parameters.Add("last_check", OracleDbType.Date).Value = _lastCheckTime;
|
||||
|
||||
using var reader = await cmd.ExecuteReaderAsync(ct);
|
||||
while (await reader.ReadAsync(ct))
|
||||
{
|
||||
result.Add(new ProductInfo
|
||||
{
|
||||
ProductId = reader.GetInt32(0),
|
||||
CreatedDate = reader.GetDateTime(1)
|
||||
});
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
private static async Task SendToRoll(int productId, OracleConnection conn, CancellationToken ct)
|
||||
{
|
||||
using var cmd = conn.CreateCommand();
|
||||
cmd.CommandText = "dbms_alert.signal";
|
||||
cmd.CommandType = CommandType.StoredProcedure;
|
||||
|
||||
cmd.Parameters.Add(new OracleParameter("name", "UI_ALERT_IZH"));
|
||||
cmd.Parameters.Add(new OracleParameter("message", $"send_finish_mill {productId}"));
|
||||
|
||||
await cmd.ExecuteNonQueryAsync(ct);
|
||||
Log.Logger($"Отправлен сигнал удаления для ID: {productId}");
|
||||
}
|
||||
}
|
||||
|
||||
public class ProductInfo
|
||||
{
|
||||
public int ProductId { get; set; }
|
||||
public DateTime CreatedDate { get; set; }
|
||||
}
|
||||
@@ -5,6 +5,10 @@
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<Platforms>AnyCPU</Platforms>
|
||||
<BaseOutputPath></BaseOutputPath>
|
||||
<PublishAot>False</PublishAot>
|
||||
<PublishTrimmed>False</PublishTrimmed>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
||||
@@ -15,9 +19,15 @@
|
||||
<DebugType>embedded</DebugType>
|
||||
</PropertyGroup>
|
||||
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Costura.Fody" Version="6.0.0">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.Data.SqlClient" Version="6.0.1" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
||||
<PackageReference Include="System.Data.SqlClient" Version="4.9.0" />
|
||||
<PackageReference Include="Oracle.ManagedDataAccess.Core" Version="23.8.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 17
|
||||
VisualStudioVersion = 17.13.35818.85 d17.13
|
||||
VisualStudioVersion = 17.13.35818.85
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SendNotify", "SendNotify.csproj", "{2F5A67A3-67F9-4DC4-B502-C2B3EF8C4305}"
|
||||
EndProject
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
gotify_url=https://gtf.mysrvhateapple.duckdns.org/message
|
||||
app_token_furnace250_l2=A6i4cMWOMSikvsR
|
||||
gotify_url=https://gtf.mysrvhateapple.duckdns.org
|
||||
app_token_izhstal=A6i4cMWOMSikvsR
|
||||
proxy_url=http://10.14.0.14:3128
|
||||
proxy_username=KhasanovAM
|
||||
proxy_password=Prokatka49!
|
||||
proxy_password=Prokatka49!
|
||||
check_now=no
|
||||
client_token_izhstal=C3r-LxgBxnxyMH.
|
||||
target_priority=7
|
||||
Reference in New Issue
Block a user