From 2f19dbfe2d75abdd583f2ecc1b5d03cc4f3be968 Mon Sep 17 00:00:00 2001
From: chenhaozhe <cgz@hz-kingdee.com>
Date: 星期四, 15 一月 2026 12:44:46 +0800
Subject: [PATCH] 新增 工作联系表 分页查询 接口 新增 WebSocket 服务端
---
MES/app.config | 21 ++
SyntacticSugar/obj/Debug/SyntacticSugar.csproj.FileListAbsolute.txt | 1
Kanban/Kanban.csproj | 3
WebAPI/Properties/PublishProfiles/FolderProfile.pubxml.user | 15 +
SQLHelper/obj/Release/SQLHelper.csproj.AssemblyReference.cache | 0
SelM/SelM.csproj | 3
WebAPI/Controllers/SCGL/Sc_MESTransFerWorkBillController.cs | 63 +++++++
WebAPI/Global.asax.cs | 10 +
NETERPNoWin/app.config | 25 ++
sdk_dingding/TopSdk/obj/Debug/TopSdk.csproj.AssemblyReference.cache | 0
SelM/app.config | 19 ++
WebAPI/WebSocketServer.cs | 179 ++++++++++++++++++++++
APSM/APSM.csproj | 3
sdk_dingding/TopSdk/bin/Debug/TopSdk.pdb | 0
WorkM/WorkM.csproj | 1
sdk_dingding/TopSdk/bin/Debug/TopSdk.dll | 0
APSM/app.config | 23 ++
WebAPI/packages.config | 1
sdk_dingding/TopSdk/obj/Debug/TopSdk.dll | 0
Model/obj/Release/Model.csproj.AssemblyReference.cache | 0
DBUtility/obj/Release/DBUtility.csproj.AssemblyReference.cache | 0
WorkM/app.config | 23 ++
Kanban/app.config | 23 ++
SyntacticSugar/obj/Debug/SyntacticSugar.csproj.AssemblyReference.cache | 0
sdk_dingding/TopSdk/obj/Debug/TopSdk.csproj.FileListAbsolute.txt | 1
sdk_dingding/TopSdk/obj/Debug/TopSdk.pdb | 0
WebAPI/Controllers/Sc_ProcessMangementController.cs | 12
WarM/app.config | 25 ++
WebAPI/WebAPI.csproj | 4
29 files changed, 436 insertions(+), 19 deletions(-)
diff --git a/APSM/APSM.csproj b/APSM/APSM.csproj
index 2ac8377..e0e8f11 100644
--- a/APSM/APSM.csproj
+++ b/APSM/APSM.csproj
@@ -685,6 +685,9 @@
<ItemGroup>
<Folder Include="鏈堝害璇勫\" />
</ItemGroup>
+ <ItemGroup>
+ <None Include="app.config" />
+ </ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
diff --git a/APSM/app.config b/APSM/app.config
new file mode 100644
index 0000000..7ca9f4c
--- /dev/null
+++ b/APSM/app.config
@@ -0,0 +1,23 @@
+锘�<?xml version="1.0" encoding="utf-8"?>
+<configuration>
+ <runtime>
+ <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
+ <dependentAssembly>
+ <assemblyIdentity name="ICSharpCode.SharpZipLib" publicKeyToken="1b03e6acf1164f73" culture="neutral" />
+ <bindingRedirect oldVersion="0.0.0.0-1.3.2.10" newVersion="1.3.2.10" />
+ </dependentAssembly>
+ <dependentAssembly>
+ <assemblyIdentity name="System.Net.Http.Formatting" publicKeyToken="31bf3856ad364e35" culture="neutral" />
+ <bindingRedirect oldVersion="0.0.0.0-5.2.7.0" newVersion="5.2.7.0" />
+ </dependentAssembly>
+ <dependentAssembly>
+ <assemblyIdentity name="System.Web.Http" publicKeyToken="31bf3856ad364e35" culture="neutral" />
+ <bindingRedirect oldVersion="0.0.0.0-5.2.7.0" newVersion="5.2.7.0" />
+ </dependentAssembly>
+ <dependentAssembly>
+ <assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" culture="neutral" />
+ <bindingRedirect oldVersion="0.0.0.0-1.5.2.14234" newVersion="1.5.2.14234" />
+ </dependentAssembly>
+ </assemblyBinding>
+ </runtime>
+</configuration>
\ No newline at end of file
diff --git a/DBUtility/obj/Release/DBUtility.csproj.AssemblyReference.cache b/DBUtility/obj/Release/DBUtility.csproj.AssemblyReference.cache
index 0c78907..ebedabc 100644
--- a/DBUtility/obj/Release/DBUtility.csproj.AssemblyReference.cache
+++ b/DBUtility/obj/Release/DBUtility.csproj.AssemblyReference.cache
Binary files differ
diff --git a/Kanban/Kanban.csproj b/Kanban/Kanban.csproj
index 4d4704a..c2d5a6a 100644
--- a/Kanban/Kanban.csproj
+++ b/Kanban/Kanban.csproj
@@ -514,6 +514,9 @@
<Install>false</Install>
</BootstrapperPackage>
</ItemGroup>
+ <ItemGroup>
+ <None Include="app.config" />
+ </ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
diff --git a/Kanban/app.config b/Kanban/app.config
new file mode 100644
index 0000000..7ca9f4c
--- /dev/null
+++ b/Kanban/app.config
@@ -0,0 +1,23 @@
+锘�<?xml version="1.0" encoding="utf-8"?>
+<configuration>
+ <runtime>
+ <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
+ <dependentAssembly>
+ <assemblyIdentity name="ICSharpCode.SharpZipLib" publicKeyToken="1b03e6acf1164f73" culture="neutral" />
+ <bindingRedirect oldVersion="0.0.0.0-1.3.2.10" newVersion="1.3.2.10" />
+ </dependentAssembly>
+ <dependentAssembly>
+ <assemblyIdentity name="System.Net.Http.Formatting" publicKeyToken="31bf3856ad364e35" culture="neutral" />
+ <bindingRedirect oldVersion="0.0.0.0-5.2.7.0" newVersion="5.2.7.0" />
+ </dependentAssembly>
+ <dependentAssembly>
+ <assemblyIdentity name="System.Web.Http" publicKeyToken="31bf3856ad364e35" culture="neutral" />
+ <bindingRedirect oldVersion="0.0.0.0-5.2.7.0" newVersion="5.2.7.0" />
+ </dependentAssembly>
+ <dependentAssembly>
+ <assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" culture="neutral" />
+ <bindingRedirect oldVersion="0.0.0.0-1.5.2.14234" newVersion="1.5.2.14234" />
+ </dependentAssembly>
+ </assemblyBinding>
+ </runtime>
+</configuration>
\ No newline at end of file
diff --git a/MES/app.config b/MES/app.config
index 51278a4..55fdf68 100644
--- a/MES/app.config
+++ b/MES/app.config
@@ -1,3 +1,20 @@
-<?xml version="1.0" encoding="utf-8"?>
+锘�<?xml version="1.0" encoding="utf-8"?>
<configuration>
-<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/></startup></configuration>
+<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" /></startup>
+ <runtime>
+ <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
+ <dependentAssembly>
+ <assemblyIdentity name="System.Net.Http.Formatting" publicKeyToken="31bf3856ad364e35" culture="neutral" />
+ <bindingRedirect oldVersion="0.0.0.0-5.2.7.0" newVersion="5.2.7.0" />
+ </dependentAssembly>
+ <dependentAssembly>
+ <assemblyIdentity name="System.Web.Http" publicKeyToken="31bf3856ad364e35" culture="neutral" />
+ <bindingRedirect oldVersion="0.0.0.0-5.2.7.0" newVersion="5.2.7.0" />
+ </dependentAssembly>
+ <dependentAssembly>
+ <assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" culture="neutral" />
+ <bindingRedirect oldVersion="0.0.0.0-1.5.2.14234" newVersion="1.5.2.14234" />
+ </dependentAssembly>
+ </assemblyBinding>
+ </runtime>
+</configuration>
diff --git a/Model/obj/Release/Model.csproj.AssemblyReference.cache b/Model/obj/Release/Model.csproj.AssemblyReference.cache
index cd5c9e7..4755e47 100644
--- a/Model/obj/Release/Model.csproj.AssemblyReference.cache
+++ b/Model/obj/Release/Model.csproj.AssemblyReference.cache
Binary files differ
diff --git a/NETERPNoWin/app.config b/NETERPNoWin/app.config
index 51278a4..8b8fb46 100644
--- a/NETERPNoWin/app.config
+++ b/NETERPNoWin/app.config
@@ -1,3 +1,24 @@
-<?xml version="1.0" encoding="utf-8"?>
+锘�<?xml version="1.0" encoding="utf-8"?>
<configuration>
-<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/></startup></configuration>
+<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" /></startup>
+ <runtime>
+ <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
+ <dependentAssembly>
+ <assemblyIdentity name="ICSharpCode.SharpZipLib" publicKeyToken="1b03e6acf1164f73" culture="neutral" />
+ <bindingRedirect oldVersion="0.0.0.0-1.3.2.10" newVersion="1.3.2.10" />
+ </dependentAssembly>
+ <dependentAssembly>
+ <assemblyIdentity name="System.Net.Http.Formatting" publicKeyToken="31bf3856ad364e35" culture="neutral" />
+ <bindingRedirect oldVersion="0.0.0.0-5.2.7.0" newVersion="5.2.7.0" />
+ </dependentAssembly>
+ <dependentAssembly>
+ <assemblyIdentity name="System.Web.Http" publicKeyToken="31bf3856ad364e35" culture="neutral" />
+ <bindingRedirect oldVersion="0.0.0.0-5.2.7.0" newVersion="5.2.7.0" />
+ </dependentAssembly>
+ <dependentAssembly>
+ <assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" culture="neutral" />
+ <bindingRedirect oldVersion="0.0.0.0-1.5.2.14234" newVersion="1.5.2.14234" />
+ </dependentAssembly>
+ </assemblyBinding>
+ </runtime>
+</configuration>
diff --git a/SQLHelper/obj/Release/SQLHelper.csproj.AssemblyReference.cache b/SQLHelper/obj/Release/SQLHelper.csproj.AssemblyReference.cache
index 24e73cf..a7bd542 100644
--- a/SQLHelper/obj/Release/SQLHelper.csproj.AssemblyReference.cache
+++ b/SQLHelper/obj/Release/SQLHelper.csproj.AssemblyReference.cache
Binary files differ
diff --git a/SelM/SelM.csproj b/SelM/SelM.csproj
index 8c39fc3..515de37 100644
--- a/SelM/SelM.csproj
+++ b/SelM/SelM.csproj
@@ -621,6 +621,9 @@
<Name>WorkM</Name>
</ProjectReference>
</ItemGroup>
+ <ItemGroup>
+ <None Include="app.config" />
+ </ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
diff --git a/SelM/app.config b/SelM/app.config
new file mode 100644
index 0000000..7075dd4
--- /dev/null
+++ b/SelM/app.config
@@ -0,0 +1,19 @@
+锘�<?xml version="1.0" encoding="utf-8"?>
+<configuration>
+ <runtime>
+ <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
+ <dependentAssembly>
+ <assemblyIdentity name="System.Net.Http.Formatting" publicKeyToken="31bf3856ad364e35" culture="neutral" />
+ <bindingRedirect oldVersion="0.0.0.0-5.2.7.0" newVersion="5.2.7.0" />
+ </dependentAssembly>
+ <dependentAssembly>
+ <assemblyIdentity name="System.Web.Http" publicKeyToken="31bf3856ad364e35" culture="neutral" />
+ <bindingRedirect oldVersion="0.0.0.0-5.2.7.0" newVersion="5.2.7.0" />
+ </dependentAssembly>
+ <dependentAssembly>
+ <assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" culture="neutral" />
+ <bindingRedirect oldVersion="0.0.0.0-1.5.2.14234" newVersion="1.5.2.14234" />
+ </dependentAssembly>
+ </assemblyBinding>
+ </runtime>
+</configuration>
\ No newline at end of file
diff --git a/SyntacticSugar/obj/Debug/SyntacticSugar.csproj.AssemblyReference.cache b/SyntacticSugar/obj/Debug/SyntacticSugar.csproj.AssemblyReference.cache
new file mode 100644
index 0000000..fea44e6
--- /dev/null
+++ b/SyntacticSugar/obj/Debug/SyntacticSugar.csproj.AssemblyReference.cache
Binary files differ
diff --git a/SyntacticSugar/obj/Debug/SyntacticSugar.csproj.FileListAbsolute.txt b/SyntacticSugar/obj/Debug/SyntacticSugar.csproj.FileListAbsolute.txt
index 6cc6882..86ecb4a 100644
--- a/SyntacticSugar/obj/Debug/SyntacticSugar.csproj.FileListAbsolute.txt
+++ b/SyntacticSugar/obj/Debug/SyntacticSugar.csproj.FileListAbsolute.txt
@@ -35,3 +35,4 @@
D:\WorkBench\MES-WEB-API\SyntacticSugar\obj\Debug\SyntacticSugar.csproj.CoreCompileInputs.cache
D:\WorkBench\MES-WEB-API\SyntacticSugar\obj\Debug\SyntacticSugar.dll
D:\WorkBench\MES-WEB-API\SyntacticSugar\obj\Debug\SyntacticSugar.pdb
+D:\WorkBench\MES-WEB-API\SyntacticSugar\obj\Debug\SyntacticSugar.csproj.AssemblyReference.cache
diff --git a/WarM/app.config b/WarM/app.config
index d9658be..cc86fd1 100644
--- a/WarM/app.config
+++ b/WarM/app.config
@@ -1,5 +1,26 @@
-<?xml version="1.0" encoding="utf-8"?>
+锘�<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
</configSections>
-<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/></startup></configuration>
+<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" /></startup>
+ <runtime>
+ <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
+ <dependentAssembly>
+ <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
+ <bindingRedirect oldVersion="0.0.0.0-13.0.0.0" newVersion="13.0.0.0" />
+ </dependentAssembly>
+ <dependentAssembly>
+ <assemblyIdentity name="System.Net.Http.Formatting" publicKeyToken="31bf3856ad364e35" culture="neutral" />
+ <bindingRedirect oldVersion="0.0.0.0-5.2.7.0" newVersion="5.2.7.0" />
+ </dependentAssembly>
+ <dependentAssembly>
+ <assemblyIdentity name="System.Web.Http" publicKeyToken="31bf3856ad364e35" culture="neutral" />
+ <bindingRedirect oldVersion="0.0.0.0-5.2.7.0" newVersion="5.2.7.0" />
+ </dependentAssembly>
+ <dependentAssembly>
+ <assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" culture="neutral" />
+ <bindingRedirect oldVersion="0.0.0.0-1.5.2.14234" newVersion="1.5.2.14234" />
+ </dependentAssembly>
+ </assemblyBinding>
+ </runtime>
+</configuration>
diff --git a/WebAPI/Controllers/SCGL/Sc_MESTransFerWorkBillController.cs b/WebAPI/Controllers/SCGL/Sc_MESTransFerWorkBillController.cs
index 83b8bcd..a11b7cc 100644
--- a/WebAPI/Controllers/SCGL/Sc_MESTransFerWorkBillController.cs
+++ b/WebAPI/Controllers/SCGL/Sc_MESTransFerWorkBillController.cs
@@ -6591,6 +6591,69 @@
}
#endregion
+ #region 宸ヤ綔鑱旂郴鍗曞垪琛� 鍒嗛〉
+ [Route("Sc_MESTransFerWorkBill/GetOA_WorkLinkBillListPage")]
+ [HttpGet]
+ public object GetOA_WorkLinkBillListPage(string sWhere, string user, int page, int size)
+ {
+ try
+ {
+ List<object> columnNameList = new List<object>();
+
+ //鏌ョ湅鏉冮檺
+ if (!DBUtility.ClsPub.Security_Log("OA_WorkLinkBillList", 1, false, user))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鏃犳煡鐪嬫潈闄愶紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ if (sWhere == null || sWhere.Equals(""))
+ {
+ string sql = $@"
+ select count(1) count from h_v_OA_WorkLinkBillAllList
+ select * from h_v_OA_WorkLinkBillAllList order by 鍗曟嵁鍙� desc
+ offset {(page - 1) * size} rows fetch next {size} rows only";
+ ds = oCN.RunProcReturn(sql, "h_v_OA_WorkLinkBillAllList");
+ }
+ else
+ {
+ string sql1 = $@"
+ select count(1) count from h_v_OA_WorkLinkBillAllList where 1 = 1 {sWhere}
+ select * from h_v_OA_WorkLinkBillAllList where 1 = 1
+ {sWhere} order by 鍗曟嵁鍙� desc
+ offset {(page - 1) * size} rows fetch next {size} rows only";
+ ds = oCN.RunProcReturn(sql1, "h_v_OA_WorkLinkBillAllList");
+ }
+
+ //娣诲姞鍒楀悕
+ foreach (DataColumn col in ds.Tables[1].Columns)
+ {
+ Type dataType = col.DataType;
+ string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
+ columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕
+ }
+
+ objJsonResult.code = "1";
+ objJsonResult.count = int.Parse(ds.Tables[0].Rows[0]["count"].ToString());
+ objJsonResult.Message = "Sucess锛�";
+ objJsonResult.data = ds.Tables[1];
+ objJsonResult.list = columnNameList;
+ return objJsonResult;
+ }
+ catch (Exception ex)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鏌ヨ鏁版嵁寮傚父锛岃涓庣鐞嗗憳鑱旂郴锛�" + ex.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ #endregion
+
#region 宸ヤ綔鑱旂郴鍗曠紪杈戣幏鍙栨暟鎹�
[Route("Sc_MESTransFerWorkBill/GetOA_WorkLinkBillListCheckDetai")]
[HttpGet]
diff --git a/WebAPI/Controllers/Sc_ProcessMangementController.cs b/WebAPI/Controllers/Sc_ProcessMangementController.cs
index 13dd4a1..24ff319 100644
--- a/WebAPI/Controllers/Sc_ProcessMangementController.cs
+++ b/WebAPI/Controllers/Sc_ProcessMangementController.cs
@@ -1708,8 +1708,8 @@
return objJsonResult;
}
- //if (oSystemParameter.omodel.WMS_CampanyName == "閿﹂殕")
- //{
+ if (oSystemParameter.omodel.WMS_CampanyName == "閿﹂殕")
+ {
string sql = @"select a.FID,a.FNUMBER Employee,d.FNUMBER Dept from Gy_Employee e
join JL20250716203240..T_HR_EMPINFO a on e.HNumber = a.FNUMBER
join JL20250716203240..T_BD_STAFFTEMP c on c.FID = a.FID
@@ -1726,7 +1726,7 @@
objJsonResult.data = null;
return objJsonResult;
}
- //}
+ }
@@ -1738,10 +1738,10 @@
model.Add("FSourceOrgId", new JObject() { ["Fnumber"] = HZJOrgNumber.ToString() }); //鏉ユ簮缁勭粐
//model.Add("FInspectDepId", new JObject() { ["Fnumber"] = ds.Tables[0].Rows[0]["Dept"].ToString() }); //璐ㄦ閮ㄩ棬
- //if (oSystemParameter.omodel.WMS_CampanyName == "閿﹂殕")
- //{
+ if (oSystemParameter.omodel.WMS_CampanyName == "閿﹂殕")
+ {
model.Add("FInspectorId", new JObject() { ["Fnumber"] = ds.Tables[0].Rows[0]["Employee"].ToString() }); //璐ㄦ鍛�
- //}
+ }
model.Add("FISSYNCED", "false");// 鏄惁宸插悓姝�
model.Add("F_PGKJ_Date", DateTime.Now.ToString("yyyy-MM-dd"));// 鎶ユ鏃ユ湡
model.Add("FBillNo", HBillNo);
diff --git a/WebAPI/Global.asax.cs b/WebAPI/Global.asax.cs
index 3e4bc83..54ba068 100644
--- a/WebAPI/Global.asax.cs
+++ b/WebAPI/Global.asax.cs
@@ -4,14 +4,22 @@
using System.Web;
using System.Web.Http;
using System.Web.Routing;
-
+using WebApiWithFleck;
namespace WebAPI
{
public class WebApiApplication : System.Web.HttpApplication
{
protected void Application_Start()
{
+ // webSocket 鏈嶅姟
+ WebSocketServer.Start();
GlobalConfiguration.Configure(WebApiConfig.Register);
}
+
+ // 搴旂敤鍏抽棴鏃讹紝鍋滄鏈嶅姟锛岄槻姝㈡硠闇�
+ protected void Application_End()
+ {
+ WebSocketServer.Stop();
+ }
}
}
diff --git a/WebAPI/Properties/PublishProfiles/FolderProfile.pubxml.user b/WebAPI/Properties/PublishProfiles/FolderProfile.pubxml.user
index a81266c..f51837e 100644
--- a/WebAPI/Properties/PublishProfiles/FolderProfile.pubxml.user
+++ b/WebAPI/Properties/PublishProfiles/FolderProfile.pubxml.user
@@ -4,7 +4,7 @@
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
- <History>True|2026-01-09T08:36:44.2830874Z;True|2026-01-09T16:21:05.9871545+08:00;True|2026-01-09T14:55:34.0836897+08:00;True|2026-01-09T14:42:10.5351820+08:00;True|2026-01-09T13:40:39.7710387+08:00;True|2026-01-09T13:09:07.1659040+08:00;False|2026-01-09T13:08:10.7966066+08:00;True|2026-01-07T16:57:09.8396720+08:00;True|2026-01-07T16:51:09.4832997+08:00;True|2026-01-07T08:33:25.1699359+08:00;False|2026-01-07T08:32:42.2399276+08:00;True|2026-01-06T15:42:14.9929597+08:00;False|2026-01-06T15:41:13.0031526+08:00;True|2026-01-05T23:26:15.9058534+08:00;True|2026-01-05T23:10:09.2125130+08:00;True|2026-01-05T23:05:18.2406265+08:00;False|2026-01-05T23:04:03.0504675+08:00;</History>
+ <History>True|2026-01-15T03:20:50.6475092Z;False|2026-01-15T11:19:59.7534646+08:00;True|2026-01-14T20:41:43.9883379+08:00;True|2026-01-14T20:22:48.8565101+08:00;True|2026-01-14T20:15:24.3086903+08:00;True|2026-01-14T20:02:51.1449573+08:00;True|2026-01-14T19:34:17.2207757+08:00;False|2026-01-14T19:33:23.4483176+08:00;True|2026-01-14T16:38:20.3556540+08:00;True|2026-01-14T16:00:52.4103661+08:00;True|2026-01-14T15:51:38.7850563+08:00;True|2026-01-14T15:39:44.6043907+08:00;True|2026-01-14T15:35:57.0927454+08:00;True|2026-01-14T15:21:50.6267386+08:00;True|2026-01-14T15:16:50.0467191+08:00;True|2026-01-14T15:07:50.8883990+08:00;True|2026-01-14T15:06:48.4113380+08:00;True|2026-01-14T14:56:38.9951358+08:00;True|2026-01-14T14:47:54.1709715+08:00;False|2026-01-14T14:47:18.6643968+08:00;True|2026-01-14T14:23:04.8458680+08:00;True|2026-01-14T12:46:17.8939526+08:00;True|2026-01-14T12:36:52.1574055+08:00;True|2026-01-14T11:09:25.0136169+08:00;False|2026-01-14T11:09:01.8893030+08:00;True|2026-01-14T10:17:49.2308483+08:00;False|2026-01-14T10:16:58.1687159+08:00;True|2026-01-13T16:45:58.5516225+08:00;True|2026-01-13T16:39:21.8005878+08:00;True|2026-01-13T16:33:54.0530482+08:00;True|2026-01-13T16:24:44.8972702+08:00;True|2026-01-13T16:21:20.7807839+08:00;True|2026-01-13T16:13:51.1240658+08:00;True|2026-01-13T16:07:20.6737800+08:00;True|2026-01-13T15:58:46.9059892+08:00;True|2026-01-13T15:49:02.1873905+08:00;True|2026-01-13T15:43:26.5884945+08:00;False|2026-01-13T15:42:53.4426774+08:00;True|2026-01-09T16:36:44.2830874+08:00;True|2026-01-09T16:21:05.9871545+08:00;True|2026-01-09T14:55:34.0836897+08:00;True|2026-01-09T14:42:10.5351820+08:00;True|2026-01-09T13:40:39.7710387+08:00;True|2026-01-09T13:09:07.1659040+08:00;False|2026-01-09T13:08:10.7966066+08:00;True|2026-01-07T16:57:09.8396720+08:00;True|2026-01-07T16:51:09.4832997+08:00;True|2026-01-07T08:33:25.1699359+08:00;False|2026-01-07T08:32:42.2399276+08:00;True|2026-01-06T15:42:14.9929597+08:00;False|2026-01-06T15:41:13.0031526+08:00;True|2026-01-05T23:26:15.9058534+08:00;True|2026-01-05T23:10:09.2125130+08:00;True|2026-01-05T23:05:18.2406265+08:00;False|2026-01-05T23:04:03.0504675+08:00;</History>
<_PublishTargetUrl>D:\缃戠珯鍙戝竷\鏅轰簯MESWMS\API</_PublishTargetUrl>
</PropertyGroup>
<ItemGroup>
@@ -67,6 +67,9 @@
</File>
<File Include="bin/DBUtility.pdb">
<publishTime>01/05/2026 23:04:18</publishTime>
+ </File>
+ <File Include="bin/Fleck.dll">
+ <publishTime>04/22/2021 11:48:12</publishTime>
</File>
<File Include="bin/Grpc.Core.Api.dll">
<publishTime>03/22/2022 13:17:26</publishTime>
@@ -294,13 +297,13 @@
<publishTime>11/24/2014 19:18:48</publishTime>
</File>
<File Include="bin/WebAPI.dll">
- <publishTime>01/09/2026 16:36:34</publishTime>
+ <publishTime>01/15/2026 11:20:26</publishTime>
</File>
<File Include="bin/WebAPI.pdb">
- <publishTime>01/09/2026 16:36:34</publishTime>
+ <publishTime>01/15/2026 11:20:26</publishTime>
</File>
<File Include="bin/WebAPI.XmlSerializers.dll">
- <publishTime>01/09/2026 16:36:42</publishTime>
+ <publishTime>01/15/2026 11:20:48</publishTime>
</File>
<File Include="bin/WebGrease.dll">
<publishTime>07/18/2013 01:03:52</publishTime>
@@ -390,7 +393,7 @@
<publishTime>04/21/2025 11:46:16</publishTime>
</File>
<File Include="packages.config">
- <publishTime>12/29/2025 09:02:47</publishTime>
+ <publishTime>01/13/2026 15:38:16</publishTime>
</File>
<File Include="Properties/PublishProfiles/JFAPI.pubxml.user">
<publishTime>12/07/2025 12:01:10</publishTime>
@@ -504,7 +507,7 @@
<publishTime>04/21/2025 11:46:17</publishTime>
</File>
<File Include="Web.config">
- <publishTime>01/05/2026 23:05:15</publishTime>
+ <publishTime>01/13/2026 15:43:26</publishTime>
</File>
</ItemGroup>
</Project>
\ No newline at end of file
diff --git a/WebAPI/WebAPI.csproj b/WebAPI/WebAPI.csproj
index af48005..b2d90d4 100644
--- a/WebAPI/WebAPI.csproj
+++ b/WebAPI/WebAPI.csproj
@@ -84,6 +84,9 @@
<Reference Include="Dapper, Version=1.50.2.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Dapper.1.50.2\lib\net45\Dapper.dll</HintPath>
</Reference>
+ <Reference Include="Fleck, Version=1.2.0.0, Culture=neutral, processorArchitecture=MSIL">
+ <HintPath>..\packages\Fleck.1.2.0\lib\net45\Fleck.dll</HintPath>
+ </Reference>
<Reference Include="Grpc.Core, Version=2.0.0.0, Culture=neutral, PublicKeyToken=d754f35622e28bad, processorArchitecture=MSIL">
<HintPath>..\packages\Grpc.Core.2.45.0\lib\net45\Grpc.Core.dll</HintPath>
</Reference>
@@ -1222,6 +1225,7 @@
<DependentUpon>Reference.map</DependentUpon>
</Compile>
<Compile Include="WebServer.cs" />
+ <Compile Include="WebSocketServer.cs" />
</ItemGroup>
<ItemGroup>
<Content Include="packages.config">
diff --git a/WebAPI/WebSocketServer.cs b/WebAPI/WebSocketServer.cs
new file mode 100644
index 0000000..3a53802
--- /dev/null
+++ b/WebAPI/WebSocketServer.cs
@@ -0,0 +1,179 @@
+锘縰sing Fleck;
+using Newtonsoft.Json;
+using Newtonsoft.Json.Linq;
+using System;
+using System.Collections.Concurrent;
+using System.Collections.Generic;
+using System.Collections.Specialized;
+using System.Data;
+using System.Web;
+using WebAPI;
+
+namespace WebApiWithFleck
+{
+ /// <summary>
+ /// Fleck WebSocket 鏈嶅姟灏佽
+ /// </summary>
+ public static class WebSocketServer
+ {
+ private static List<IWebSocketConnection> _connections = new List<IWebSocketConnection>();
+ private static ConcurrentDictionary<IWebSocketConnection, string> _NameConnectionDict = new ConcurrentDictionary<IWebSocketConnection, string>();
+ private static Fleck.WebSocketServer _server;
+ // 鍐呯疆瀹氭椂鍣紙鐢ㄤ簬瀹氭椂鏌ヨ鏁版嵁搴撳苟鎺ㄩ�侊級
+ private static System.Timers.Timer _pushTimer;
+ // 300000
+ private static readonly int _pushInterval = 10000;
+
+ /// <summary>
+ /// 鍚姩 WebSocket 鏈嶅姟锛堢洃鍚� 18080 绔彛锛�
+ /// </summary>
+ public static void Start()
+ {
+ // 閰嶇疆 WebSocket 鐩戝惉鍦板潃锛堢嫭绔嬬鍙� 8089锛�
+ var wsUrl = "ws://0.0.0.0:8089/ws"; // 0.0.0.0 鍏佽澶栭儴璁块棶
+ _server = new Fleck.WebSocketServer(wsUrl);
+
+ _pushTimer = new System.Timers.Timer(_pushInterval);
+ _pushTimer.AutoReset = false; // 闈炶嚜鍔ㄩ噸缃紝閬垮厤骞跺彂
+ _pushTimer.Elapsed += OnTimerElapsed; // 缁戝畾闈欐�佷簨浠�
+
+ // 閰嶇疆 Fleck 鏈嶅姟
+ _server.Start(connection =>
+ {
+ _pushTimer.Start();
+ // 瀹㈡埛绔繛鎺ュ缓绔嬫椂
+ connection.OnOpen = () =>
+ {
+ string userId = "";
+ string userName = "";
+ // 鑾峰彇鍙傛暟
+ string path = connection.ConnectionInfo.Path;
+ Uri dummyUri = new Uri($"http://localhost{path}");
+ var queryParams = HttpUtility.ParseQueryString(dummyUri.Query);
+
+ userId = queryParams["userId"];
+ userName = queryParams["userName"];
+
+ LogService.Write($"WebSocket 瀹㈡埛绔繛鎺ワ細{userId}_{userName}-{connection.ConnectionInfo.ClientIpAddress}");
+ _connections.Add(connection); // 淇濆瓨杩炴帴
+ _NameConnectionDict[connection] = $@"{userId}_{userName}";
+ };
+
+ // 鏀跺埌瀹㈡埛绔秷鎭椂
+ connection.OnMessage = message =>
+ {
+ Console.WriteLine($"鏀跺埌娑堟伅锛歿message}");
+
+ // TODO 蹇冭烦淇″彿
+ };
+
+ // 瀹㈡埛绔柇寮�杩炴帴鏃�
+ connection.OnClose = () =>
+ {
+ LogService.Write($"WebSocket 瀹㈡埛绔柇寮�锛歿connection.ConnectionInfo.ClientIpAddress}");
+
+ string success = "";
+ // 绉婚櫎杩炴帴
+ _NameConnectionDict.TryRemove(connection,out success);
+ // _connections.Remove(connection);
+ };
+
+ // 杩炴帴鍑洪敊鏃�
+ connection.OnError = ex =>
+ {
+ string success = "";
+ LogService.Write($"WebSocket 閿欒锛歿ex.Message}");
+ _NameConnectionDict.TryRemove(connection, out success);
+ };
+ });
+
+ LogService.Write($"Fleck WebSocket 鏈嶅姟宸插惎鍔紝鐩戝惉锛歿wsUrl}");
+ }
+
+ /// <summary>
+ /// 鍋滄 WebSocket 鏈嶅姟
+ /// </summary>
+ public static void Stop()
+ {
+ _server?.Dispose();
+ _pushTimer?.Stop();
+
+ Console.WriteLine("Fleck WebSocket 鏈嶅姟宸插仠姝�");
+ }
+
+
+ /// <summary>
+ /// 闈欐�佸畾鏃跺櫒瑙﹀彂浜嬩欢
+ /// </summary>
+ private static void OnTimerElapsed(object sender, System.Timers.ElapsedEventArgs e)
+ {
+ SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+ DataSet ds = new DataSet();
+ try
+ {
+ JObject NameMsgKVP = new JObject();
+ // 鑾峰彇鏁版嵁搴撲腑鏈璇诲彇鐨勬暟鎹�
+ ds = oCN.RunProcReturn("select * from h_v_OA_WorkLinkBillAllList where 鍗曟嵁鐘舵�� = '宸插鏍�' and 闃呰鐘舵�� = '鏈槄'", "h_v_OA_WorkLinkBillAllList");
+ // 鍒ゆ柇骞挎挱杩樻槸绉佸彂 锛岀粺璁℃暟鎹�
+ JArray dataTableJArray = JArray.Parse(JsonConvert.SerializeObject(ds.Tables[0]));
+ foreach (JToken row in dataTableJArray)
+ {
+ // 鎻愬墠鑾峰彇骞跺鐞嗚鏁版嵁锛堥伩鍏嶉噸澶嶈闂� row["鍒楀悕"]锛屼笖澶勭悊 null锛�
+ string receiver = row["鎺ユ敹浜�"]?.ToString() ?? string.Empty; // 涓� null 鏃惰繑鍥炵┖瀛楃涓�
+ string ccUsers = row["鎵�鏈夋妱閫佷汉"]?.ToString() ?? string.Empty;
+ string sendType = row["鍙戦�佺被鍨�"]?.ToString() ?? string.Empty;
+
+ // 璺宠繃鏃犳晥鏁版嵁琛岋紙涓夊垪鍧囦负绌烘椂锛屾棤闇�澶勭悊锛�
+ if (string.IsNullOrEmpty(receiver) && string.IsNullOrEmpty(ccUsers) && string.IsNullOrEmpty(sendType))
+ continue;
+
+ foreach (var dictOne in _NameConnectionDict)
+ {
+ string UName = dictOne.Value.Split('_')[1];
+ // 灏嗘帴鏀朵汉 鎶勯�佷汉 鑾峰彇 骞挎挱鐨勬秷鎭坊鍔犲埌娑堟伅缂撳瓨
+ if (string.Equals(row["鎺ユ敹浜�"].ToString(), UName)
+ || row["鎵�鏈夋妱閫佷汉"].ToString().Contains(UName)
+ || string.Equals(row["鍙戦�佺被鍨�"].ToString(), "鍏叡"))
+ {
+ string dictOneVal = dictOne.Value.ToString();
+ if (NameMsgKVP[dictOneVal] == null)
+ {
+ NameMsgKVP[dictOneVal] = new JArray();
+ }
+
+ var jArray = NameMsgKVP[dictOneVal] as JArray;
+
+ jArray.Add(row);
+ }
+ }
+ }
+ // 鏍规嵁鐢ㄦ埛ID鍒嗗彂鍒颁笉鍚岀殑瀹㈡埛绔�
+ foreach (var dictOne in _NameConnectionDict)
+ {
+ if(NameMsgKVP[dictOne.Value.ToString()] != null)
+ {
+ // 灏佽 websocket 淇℃伅
+ dictOne.Key.Send(new JObject{
+ ["Type"]="Message",
+ ["Content"]= NameMsgKVP[dictOne.Value.ToString()].ToString()
+ }.ToString());
+ }
+ }
+ LogService.Write("娑堟伅鎺ㄩ�佸畬鎴�...");
+ }
+ catch (Exception ex)
+ {
+ LogService.Write(ex.ToString());
+ return;
+ }
+ finally
+ {
+ // 闈欐�佸畾鏃跺櫒鎵嬪姩閲嶅惎
+ if (_pushTimer != null && !_pushTimer.Enabled)
+ {
+ _pushTimer.Start();
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/WebAPI/packages.config b/WebAPI/packages.config
index 01b9877..d706c30 100644
--- a/WebAPI/packages.config
+++ b/WebAPI/packages.config
@@ -12,6 +12,7 @@
<package id="Antlr" version="3.4.1.9004" targetFramework="net45" />
<package id="bootstrap" version="3.0.0" targetFramework="net45" />
<package id="Dapper" version="1.50.2" targetFramework="net45" />
+ <package id="Fleck" version="1.2.0" targetFramework="net45" />
<package id="Grpc.Core" version="2.45.0" targetFramework="net45" />
<package id="Grpc.Core.Api" version="2.45.0" targetFramework="net45" />
<package id="jQuery" version="1.10.2" targetFramework="net45" />
diff --git a/WorkM/WorkM.csproj b/WorkM/WorkM.csproj
index df12a27..cb7a58c 100644
--- a/WorkM/WorkM.csproj
+++ b/WorkM/WorkM.csproj
@@ -1462,6 +1462,7 @@
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
+ <None Include="app.config" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
diff --git a/WorkM/app.config b/WorkM/app.config
new file mode 100644
index 0000000..7ca9f4c
--- /dev/null
+++ b/WorkM/app.config
@@ -0,0 +1,23 @@
+锘�<?xml version="1.0" encoding="utf-8"?>
+<configuration>
+ <runtime>
+ <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
+ <dependentAssembly>
+ <assemblyIdentity name="ICSharpCode.SharpZipLib" publicKeyToken="1b03e6acf1164f73" culture="neutral" />
+ <bindingRedirect oldVersion="0.0.0.0-1.3.2.10" newVersion="1.3.2.10" />
+ </dependentAssembly>
+ <dependentAssembly>
+ <assemblyIdentity name="System.Net.Http.Formatting" publicKeyToken="31bf3856ad364e35" culture="neutral" />
+ <bindingRedirect oldVersion="0.0.0.0-5.2.7.0" newVersion="5.2.7.0" />
+ </dependentAssembly>
+ <dependentAssembly>
+ <assemblyIdentity name="System.Web.Http" publicKeyToken="31bf3856ad364e35" culture="neutral" />
+ <bindingRedirect oldVersion="0.0.0.0-5.2.7.0" newVersion="5.2.7.0" />
+ </dependentAssembly>
+ <dependentAssembly>
+ <assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" culture="neutral" />
+ <bindingRedirect oldVersion="0.0.0.0-1.5.2.14234" newVersion="1.5.2.14234" />
+ </dependentAssembly>
+ </assemblyBinding>
+ </runtime>
+</configuration>
\ No newline at end of file
diff --git a/sdk_dingding/TopSdk/bin/Debug/TopSdk.dll b/sdk_dingding/TopSdk/bin/Debug/TopSdk.dll
index 219cd56..4a3d24c 100644
--- a/sdk_dingding/TopSdk/bin/Debug/TopSdk.dll
+++ b/sdk_dingding/TopSdk/bin/Debug/TopSdk.dll
Binary files differ
diff --git a/sdk_dingding/TopSdk/bin/Debug/TopSdk.pdb b/sdk_dingding/TopSdk/bin/Debug/TopSdk.pdb
index a7e44f6..33a4b4e 100644
--- a/sdk_dingding/TopSdk/bin/Debug/TopSdk.pdb
+++ b/sdk_dingding/TopSdk/bin/Debug/TopSdk.pdb
Binary files differ
diff --git a/sdk_dingding/TopSdk/obj/Debug/TopSdk.csproj.AssemblyReference.cache b/sdk_dingding/TopSdk/obj/Debug/TopSdk.csproj.AssemblyReference.cache
new file mode 100644
index 0000000..d77c332
--- /dev/null
+++ b/sdk_dingding/TopSdk/obj/Debug/TopSdk.csproj.AssemblyReference.cache
Binary files differ
diff --git a/sdk_dingding/TopSdk/obj/Debug/TopSdk.csproj.FileListAbsolute.txt b/sdk_dingding/TopSdk/obj/Debug/TopSdk.csproj.FileListAbsolute.txt
index 9503220..f3f4299 100644
--- a/sdk_dingding/TopSdk/obj/Debug/TopSdk.csproj.FileListAbsolute.txt
+++ b/sdk_dingding/TopSdk/obj/Debug/TopSdk.csproj.FileListAbsolute.txt
@@ -9,3 +9,4 @@
D:\WorkBench\MES-WEB-API\sdk_dingding\TopSdk\obj\Debug\TopSdk.csproj.CoreCompileInputs.cache
D:\WorkBench\MES-WEB-API\sdk_dingding\TopSdk\obj\Debug\TopSdk.dll
D:\WorkBench\MES-WEB-API\sdk_dingding\TopSdk\obj\Debug\TopSdk.pdb
+D:\WorkBench\MES-WEB-API\sdk_dingding\TopSdk\obj\Debug\TopSdk.csproj.AssemblyReference.cache
diff --git a/sdk_dingding/TopSdk/obj/Debug/TopSdk.dll b/sdk_dingding/TopSdk/obj/Debug/TopSdk.dll
index 219cd56..4a3d24c 100644
--- a/sdk_dingding/TopSdk/obj/Debug/TopSdk.dll
+++ b/sdk_dingding/TopSdk/obj/Debug/TopSdk.dll
Binary files differ
diff --git a/sdk_dingding/TopSdk/obj/Debug/TopSdk.pdb b/sdk_dingding/TopSdk/obj/Debug/TopSdk.pdb
index a7e44f6..33a4b4e 100644
--- a/sdk_dingding/TopSdk/obj/Debug/TopSdk.pdb
+++ b/sdk_dingding/TopSdk/obj/Debug/TopSdk.pdb
Binary files differ
--
Gitblit v1.9.1