From 4862490837e93ec1647acc537a4d79afb847be90 Mon Sep 17 00:00:00 2001
From: huanghongfeng <huanghongfeng@hnkhzn.com>
Date: 星期一, 24 三月 2025 10:03:21 +0800
Subject: [PATCH] 1

---
 项目代码/WCS/WIDESEAWCS_Server/WIDESEAWCS_SystemServices/OrderDetailsService.cs                   |   22 +++++++++-------------
 项目代码/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/appsettings.json                                 |    2 +-
 项目代码/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/System/OrderDetailsController.cs     |    2 +-
 项目代码/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Properties/PublishProfiles/FolderProfile3.pubxml |   17 +++++++++++++++++
 项目代码/WCS/WIDESEAWCS_Server/WIDESEAWCS_ISystemServices/IOrderDetailsService.cs                 |    2 +-
 项目代码/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs          |    6 ++++--
 6 files changed, 33 insertions(+), 18 deletions(-)

diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_ISystemServices/IOrderDetailsService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_ISystemServices/IOrderDetailsService.cs"
index a0376a0..7b1e2c3 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_ISystemServices/IOrderDetailsService.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_ISystemServices/IOrderDetailsService.cs"
@@ -35,7 +35,7 @@
     public interface IOrderDetailsService : IService<OrderDetails>
     {
         int GetOrderDetails(string Barcodes);
-        bool ToMesBarc(int Barcodes);
+        ToMesBarcRes ToMesBarc(int Barcodes);
     }
 
     public class ToMesBarc
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/System/OrderDetailsController.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/System/OrderDetailsController.cs"
index 346e30b..a09a71f 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/System/OrderDetailsController.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/System/OrderDetailsController.cs"
@@ -22,7 +22,7 @@
         }
 
         [HttpPost,Route("ToMesBarc"), AllowAnonymous]
-        public bool ToMesBarc(int Barcodes)
+        public ToMesBarcRes ToMesBarc(int Barcodes)
         {
             return Service.ToMesBarc(Barcodes);
         }
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Properties/PublishProfiles/FolderProfile3.pubxml" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Properties/PublishProfiles/FolderProfile3.pubxml"
new file mode 100644
index 0000000..36847ea
--- /dev/null
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Properties/PublishProfiles/FolderProfile3.pubxml"
@@ -0,0 +1,17 @@
+锘�<?xml version="1.0" encoding="utf-8"?>
+<!--
+https://go.microsoft.com/fwlink/?LinkID=208121.
+-->
+<Project>
+  <PropertyGroup>
+    <DeleteExistingFiles>false</DeleteExistingFiles>
+    <ExcludeApp_Data>false</ExcludeApp_Data>
+    <LaunchSiteAfterPublish>true</LaunchSiteAfterPublish>
+    <LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
+    <LastUsedPlatform>Any CPU</LastUsedPlatform>
+    <PublishProvider>FileSystem</PublishProvider>
+    <PublishUrl>bin\Release\net6.0\publish\</PublishUrl>
+    <WebPublishMethod>FileSystem</WebPublishMethod>
+    <_TargetId>Folder</_TargetId>
+  </PropertyGroup>
+</Project>
\ No newline at end of file
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/appsettings.json" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/appsettings.json"
index c1ce3eb..fa69a35 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/appsettings.json"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/appsettings.json"
@@ -7,7 +7,7 @@
     }
   },
   "dics": "deviceType,devicePlcType,jobAssembly,jobClassName,deviceStatus,taskType,taskState,inOutType,agvStationEnum,agvareaEnum",
-  "ToMesScan_sync": "/api/product/batchProcess/scan_sync",
+  "ToMesScan_sync": "http://47.110.241.74:3000/mock/164/api/product/batchProcess/scan_sync", //娴�
   "AllowedHosts": "*",
   "ConnectionStringsEncryption": false,
   "MainDB": "DB_WIDESEA", //褰撳墠椤圭洰鐨勪富搴擄紝鎵�瀵瑰簲鐨勮繛鎺ュ瓧绗︿覆鐨凟nabled蹇呴』涓簍rue
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_SystemServices/OrderDetailsService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_SystemServices/OrderDetailsService.cs"
index 302e205..ea82c21 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_SystemServices/OrderDetailsService.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_SystemServices/OrderDetailsService.cs"
@@ -55,17 +55,19 @@
         {
             
         }
+
+        private static bool toggle = false;
         public int GetOrderDetails(string Barcodes)
         {
             OrderDetails orderDetails = BaseDal.QueryData(x=>x.Orderdetails_outid == Barcodes).FirstOrDefault();
             if(orderDetails != null)
             {
-                if (orderDetails.Orderdetails_cutLength <= 800 && orderDetails.Orderdetails_cutLength>=50)
+                if (orderDetails.Orderdetails_width <= 800 && orderDetails.Orderdetails_width>=50)
                 {
-                    Random random = new Random();
-                    return random.Next(0, 2) == 0 ? 2 : 3;
+                    toggle = !toggle; // 鍒囨崲鐘舵��
+                    return toggle ? 2 : 3;
                 }
-                else if (orderDetails.Orderdetails_cutLength >= 800 && orderDetails.Orderdetails_cutLength <= 1220)
+                else if (orderDetails.Orderdetails_width >= 800 && orderDetails.Orderdetails_width <= 1220)
                 {
                     return 2;
                 }
@@ -83,7 +85,7 @@
         
         public string ToMesScan_sync = WIDESEAWCS_Core.Helper.AppSettings.Configuration["ToMesScan_sync"];
 
-        public bool ToMesBarc(int Barcodes)
+        public ToMesBarcRes ToMesBarc(int Barcodes)
         {
             ToMesBarc toMes = new ToMesBarc()
             {
@@ -91,14 +93,8 @@
                 type = "1",
             };
             ToMesBarcRes toMesBarc=HttpHelper.Post<ToMesBarcRes>($"{ToMesScan_sync}", toMes);
-            if (toMesBarc.code == 1)
-            {
-                return true;
-            }
-            else
-            {
-                return false;
-            }
+
+            return toMesBarc;
         }
 
         
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs"
index dc71f27..7982e18 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs"
@@ -73,13 +73,15 @@
                                 conveyorLine.Communicator.Write("DB7.3022", (int)toplc);   //鍐欏叆鍘诲悜
                                 conveyorLine.Communicator.Write("DB7.3028.0", (bool)true);    //鍐欏叆鍙嶉
                                 WriteLog.Write_Log("鎵爜鏋�", "鎵爜绔欏彴", "鎴愬姛", new { 淇℃伅 = $"鏉$爜锛歿barcodeNumber}锛屽啓鍏ュ幓鍚憑toplc}" });
-                                if (conveyorLine.Communicator.Read<bool>("DB7.2986"))
+                                if (conveyorLine.Communicator.Read<bool>("DB7.3116"))
                                 {
                                     conveyorLine.Communicator.Write("DB7.3022", (int)0);   //娓呴櫎鍐欏叆鍘诲悜
                                     conveyorLine.Communicator.Write("DB7.3028.0", (bool)false);   //娓呴櫎鍐欏叆鍙嶉
                                     WriteLog.Write_Log("鎵爜鏋�", "鎵爜绔欏彴", "鎴愬姛", new { 淇℃伅 = $"鏉$爜锛歿barcodeNumber}锛屾竻闄よ緭閫佺嚎鍙嶉鎴愬姛" });
                                     //璋冨彇鍙嶉MES鎵樼洏鏉$爜
-                                    if (_OrderDetailsService.ToMesBarc(int.Parse(barcodeNumber)))
+
+                                   var datast= _OrderDetailsService.ToMesBarc(int.Parse(barcodeNumber));
+                                    if (datast.code==1)
                                     {
                                         WriteLog.Write_Log("ToMes", "鏉$爜鍙嶉Mes", "鎴愬姛", new { 淇℃伅 = $"鏉$爜锛歿barcodeNumber}锛屽弽棣堟垚鍔�" });
                                     }

--
Gitblit v1.9.3