From 5abcab1ce449e3368303bd3d854ac7a2ec1b7044 Mon Sep 17 00:00:00 2001
From: wangxinhui <wangxinhui@hnkhzn.com>
Date: 星期五, 07 二月 2025 10:53:27 +0800
Subject: [PATCH] Merge branch 'master' of http://115.159.85.185:8098/r/MeiRuiAn/HuaiAn

---
 代码管理/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/054489bd-234b-4089-9947-38a13fcde750.vsidx |    0 
 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/BarcodeScanner.cs                                                |   56 ++++++++++++++++++++++++++++
 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/appsettings.json                                                |    4 +-
 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Program.cs                                                      |    3 +
 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/AssignLocation/LocationInfoService_BC.cs             |    2 
 代码管理/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/fb1ebcba-9e21-4a69-97c4-99bc37244eb9.vsidx |    0 
 代码管理/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/5d432982-08c1-4c2c-9cb4-199bb27be3a0.vsidx |    0 
 7 files changed, 62 insertions(+), 3 deletions(-)

diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/054489bd-234b-4089-9947-38a13fcde750.vsidx" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/054489bd-234b-4089-9947-38a13fcde750.vsidx"
new file mode 100644
index 0000000..64ba42e
--- /dev/null
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/054489bd-234b-4089-9947-38a13fcde750.vsidx"
Binary files differ
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/fb1ebcba-9e21-4a69-97c4-99bc37244eb9.vsidx" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/fb1ebcba-9e21-4a69-97c4-99bc37244eb9.vsidx"
new file mode 100644
index 0000000..a522fd9
--- /dev/null
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/fb1ebcba-9e21-4a69-97c4-99bc37244eb9.vsidx"
Binary files differ
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Program.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Program.cs"
index 4b51fd2..c8769f0 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Program.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Program.cs"
@@ -22,6 +22,7 @@
 using WIDESEAWCS_QuartzJob.QuartzExtensions;
 using Microsoft.AspNetCore.Builder;
 using WIDESEAWCS_Server.HostedService;
+using WIDESEAWCS_Tasks;
 
 var builder = WebApplication.CreateBuilder(args);
 
@@ -147,4 +148,6 @@
 
 app.MapControllers();
 
+BarcodeScanner.StartServer();
 app.Run();
+
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/BarcodeScanner.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/BarcodeScanner.cs"
new file mode 100644
index 0000000..f5bc0c2
--- /dev/null
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/BarcodeScanner.cs"
@@ -0,0 +1,56 @@
+锘縰sing HslCommunication;
+using OfficeOpenXml.FormulaParsing.Excel.Functions.Numeric;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Net;
+using System.Net.Sockets;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace WIDESEAWCS_Tasks
+{
+    public class BarcodeScanner
+    {
+        static Socket client ;
+        public static string barcode = "";
+        static byte[] buffers = new byte[1024];
+        public static void StartServer()
+        {
+            client = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
+            IPAddress iPAddress = IPAddress.Parse("10.30.102.56");
+            IPEndPoint endPoint = new IPEndPoint(iPAddress, 2002);
+            client.SendTimeout = 2000;
+            client.ReceiveTimeout = 2000;
+            client.Connect(endPoint);
+            client.BeginReceive(buffers, 0, buffers.Length, SocketFlags.None, new AsyncCallback(AsyncCallback), client);
+        }
+
+        public static void AsyncCallback(IAsyncResult ar)
+        {
+            try
+            {
+               
+                int length = client.EndReceive(ar);
+
+                byte[] result = buffers.SelectMiddle(0,length);
+
+                string resultStr = Encoding.Default.GetString(result);
+
+                Console.Out.WriteLine(resultStr);
+
+                if (resultStr.StartsWith(".BC"))
+                {
+                    barcode = resultStr.Replace(".", "").Replace("/", "");
+                    Console.Out.WriteLine($"鎵樼洏鍙凤細{barcode}");
+                }
+
+                client.BeginReceive(buffers, 0, buffers.Length, SocketFlags.None, new AsyncCallback(AsyncCallback), client);
+            }
+            catch (Exception ex)
+            {
+
+            }
+        }
+    }
+}
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/5d432982-08c1-4c2c-9cb4-199bb27be3a0.vsidx" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/5d432982-08c1-4c2c-9cb4-199bb27be3a0.vsidx"
new file mode 100644
index 0000000..99f5f88
--- /dev/null
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/5d432982-08c1-4c2c-9cb4-199bb27be3a0.vsidx"
Binary files differ
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/AssignLocation/LocationInfoService_BC.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/AssignLocation/LocationInfoService_BC.cs"
index 10837b1..2021323 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/AssignLocation/LocationInfoService_BC.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/AssignLocation/LocationInfoService_BC.cs"
@@ -156,7 +156,7 @@
                 if (emptyLocation.RoadwayNo != "SC01_BC" && emptyLocation.Column % 2 == 1)
                     nearLocation = locationInfos.FirstOrDefault(x => x.Row == emptyLocation.Row && x.Layer == emptyLocation.Layer && x.Depth == emptyLocation.Depth && x.Column == emptyLocation.Column + 1);
                 else if (emptyLocation.RoadwayNo == "SC01_BC" && emptyLocation.Column % 2 == 0)
-                    nearLocation = locationInfos.FirstOrDefault(x => x.Row == emptyLocation.Row && x.Layer == emptyLocation.Layer && x.Depth == emptyLocation.Depth && x.Column == emptyLocation.Column - 1);
+                    nearLocation = locationInfos.FirstOrDefault(x => x.Row == emptyLocation.Row && x.Layer == emptyLocation.Layer && x.Depth == emptyLocation.Depth && x.Column == emptyLocation.Column + 1);
                 if (nearLocation != null && DepthLocationIsEmpty_BC(locationInfos, nearLocation) != null)
                 {
                     Dt_LocationInfo? locationInfo = DepthLocationIsEmpty_BC(locationInfos, emptyLocation);
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/appsettings.json" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/appsettings.json"
index e2d1036..0896fa9 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/appsettings.json"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/appsettings.json"
@@ -12,8 +12,8 @@
   "MainDB": "DB_WIDESEA", //褰撳墠椤圭洰鐨勪富搴擄紝鎵�瀵瑰簲鐨勮繛鎺ュ瓧绗︿覆鐨凟nabled蹇呴』涓簍rue
   //杩炴帴瀛楃涓�
   //"ConnectionString": "HTI6FB1H05Krd07mNm9yBCNhofW6edA5zLs9TY~MNthRYW3kn0qKbMIsGp~3yyPDF1YZUCPBQx8U0Jfk4PH~ajNFXVIwlH85M3F~v_qKYQ3CeAz3q1mLVDn8O5uWt1~3Ut2V3KRkEwYHvW2oMDN~QIDXPxDgXN0R2oTIhc9dNu7QNaLEknblqmHhjaNSSpERdDVZIgHnMKejU_SL49tralBkZmDNi0hmkbL~837j1NWe37u9fJKmv91QPb~16JsuI9uu0EvNZ06g6PuZfOSAeFH9GMMIZiketdcJG3tHelo=",
-  "ConnectionString": "Data Source=.;Initial Catalog=WIDESEAWMS_HUAIAN;User ID=sa;Password=P@ssw0rd;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False",
-  //"ConnectionString": "Data Source=10.30.4.92;Initial Catalog=WMS_TC;User ID=sa;Password=duo123456;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False",
+  //"ConnectionString": "Data Source=.;Initial Catalog=WIDESEAWMS_HUAIAN;User ID=sa;Password=P@ssw0rd;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False",
+  "ConnectionString": "Data Source=10.30.4.92;Initial Catalog=WMS_TC;User ID=sa;Password=duo123456;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False",
   //鏃MS鏁版嵁搴撹繛鎺�
   //"TeConnectionString": "Data Source=10.30.4.92;Initial Catalog=TeChuang;User ID=sa;Password=duo123456;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False",
   //璺ㄥ煙

--
Gitblit v1.9.3