台账修改推送东胜

服务守护模块
optimize
wanghaomei 1 year ago
parent d678dce418
commit bfa9585206

@ -1037,6 +1037,9 @@ namespace Myshipping.Application
//记录修改日志
await SaveLog(order, orderCompare);
//推送东胜
await SendBookingOrder(new long[] { order.Id });
}
/// <summary>

@ -15,6 +15,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Myshipping.FlowCenter", "My
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Myshipping.Report", "Myshipping.Report\Myshipping.Report.csproj", "{66E98A13-17A5-4B2A-B78A-A3FC87D2645A}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ServiceDeamon", "ServiceDeamon\ServiceDeamon.csproj", "{A0F9B98D-6466-465F-B2D1-278B7284C11E}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -45,6 +47,10 @@ Global
{66E98A13-17A5-4B2A-B78A-A3FC87D2645A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{66E98A13-17A5-4B2A-B78A-A3FC87D2645A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{66E98A13-17A5-4B2A-B78A-A3FC87D2645A}.Release|Any CPU.Build.0 = Release|Any CPU
{A0F9B98D-6466-465F-B2D1-278B7284C11E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A0F9B98D-6466-465F-B2D1-278B7284C11E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A0F9B98D-6466-465F-B2D1-278B7284C11E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A0F9B98D-6466-465F-B2D1-278B7284C11E}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<add key="ServiceName" value=""/>
</appSettings>
</configuration>

@ -0,0 +1,28 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.ServiceProcess;
using System.Text;
using System.Threading.Tasks;
namespace ServiceDeamon
{
public class CheckServiceHelper
{
private static ServiceController servCtl;
public static void CheckStatus(string servName)
{
if (servCtl == null || servCtl.ServiceName != servName)
{
servCtl = new ServiceController(servName);
}
if (servCtl != null && servCtl.Status == ServiceControllerStatus.Stopped)
{
servCtl.Start();
}
}
}
}

@ -0,0 +1,13 @@
using ServiceDeamon;
using System.Configuration;
using System.ServiceProcess;
var servName = ConfigurationManager.AppSettings["ServiceName"];
//Timer t = new System.Threading.Timer((sta) =>
//{
// CheckServiceHelper.CheckStatus(servName);
//});
//t.Change(1000,)

@ -0,0 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="System.ServiceProcess.ServiceController" Version="7.0.1" />
</ItemGroup>
</Project>
Loading…
Cancel
Save