From 6bd89520e09dc1c2d3fab72a80c3d01f2df93490 Mon Sep 17 00:00:00 2001
From: schangxiang@126.com <schangxiang@126.com>
Date: 周二, 02 9月 2025 15:55:02 +0800
Subject: [PATCH] 2222

---
 wcs/yunneiWCS/yunneiWCS/ThreadTask/mesStockDataForRealMes.cs |   98 ++++---------
 wcs/yunneiWCS/yunneiWCS/Form1.Designer.cs                    |   71 +++++++---
 wcs/yunneiWCS/yunneiWCS/log4net_iWare.config                 |   34 ++++
 wcs/yunneiWCS/yunneiWCS/ORM/v_srmStockdetails.cs             |   66 +++++++++
 wcs/yunneiWCS/yunneiWCS/yunneiWCS.csproj                     |    1 
 wcs/yunneiWCS/yunneiWCS/ORM/dbmodel.cs                       |   41 +++++
 wcs/yunneiWCS/yunneiWCS/ExtendFunction/SystemWarningMsg.cs   |    3 
 sql/DBScript/01_DDL/03_DDL_VIEW_YunNeiDongLi.sql             |   42 +++--
 wcs/yunneiWCS/yunneiWCS/log4net_iWare -编辑版.config            |   16 +-
 wcs/yunneiWCS/yunneiWCS/Form1.cs                             |    5 
 10 files changed, 257 insertions(+), 120 deletions(-)

diff --git a/sql/DBScript/01_DDL/03_DDL_VIEW_YunNeiDongLi.sql b/sql/DBScript/01_DDL/03_DDL_VIEW_YunNeiDongLi.sql
index 2649e60..9f683ae 100644
--- a/sql/DBScript/01_DDL/03_DDL_VIEW_YunNeiDongLi.sql
+++ b/sql/DBScript/01_DDL/03_DDL_VIEW_YunNeiDongLi.sql
@@ -90,17 +90,13 @@
 GO
 
 
-
-
-
-
  /**
  ** 绔嬩綋搴撳簱瀛�
  **/
-IF EXISTS(SELECT 1 FROM sys.views WHERE name='v_srmStock') 
-   DROP VIEW v_srmStock 
+IF EXISTS(SELECT 1 FROM sys.views WHERE name='VproductStock') 
+   DROP VIEW VproductStock 
 GO 
-CREATE VIEW v_srmStock
+CREATE VIEW VproductStock
 AS
 
 SELECT   dbo.productStock.stockId, dbo.position.positionName, dbo.position.isLock, dbo.position.isfree, 
@@ -108,39 +104,45 @@
                 dbo.productStock.status, dbo.productStock.createTime, dbo.productStock.updateTime, dbo.position.enable, 
                 dbo.productStock.positionId, dbo.productStock.materialId, dbo.productStock.productCode, 
                 dbo.productStock.containerCode, dbo.position.positionType, dbo.productStock.supplier, dbo.material.version
-FROM      dbo.position LEFT  JOIN
-                dbo.productStock ON dbo.position.positionId = dbo.productStock.positionId LEFT JOIN
+FROM      dbo.position INNER JOIN
+                dbo.productStock ON dbo.position.positionId = dbo.productStock.positionId INNER JOIN
                 dbo.material ON dbo.productStock.materialId = dbo.material.materialId
-   WHERE [position].row=1 OR  [position].row=2
-
    
 
 GO
 
 
 
+
+
+
+
+
+
 /**
- ** 绔嬩綋搴撳簱瀛樻槑缁嗭紙绮剧‘鍒版祦姘村彿锛�
+ ** 绔嬩綋搴撳簱瀛樻槑缁嗭紙绮剧‘鍒版祦姘村彿锛� [Editby shaocx,2025-09-02]
  **/
-IF EXISTS(SELECT 1 FROM sys.views WHERE name='v_srmStock_details') 
-   DROP VIEW v_srmStock_details 
+IF EXISTS(SELECT 1 FROM sys.views WHERE name='v_srmStockdetails') 
+   DROP VIEW v_srmStockdetails 
 GO 
-CREATE VIEW v_srmStock_details
+CREATE VIEW v_srmStockdetails
 AS
 
-SELECT  prodList.productName,prodList.serialNumber,
+SELECT  prodList.stockListId,prodList.productName,prodList.serialNumber,
 
     dbo.productStock.stockId, dbo.position.positionName, dbo.position.isLock, dbo.position.isfree, 
                 dbo.material.materialCode, dbo.material.materialName, dbo.productStock.quantity, dbo.productStock.taskType, 
                 dbo.productStock.status, dbo.productStock.createTime, dbo.productStock.updateTime, dbo.position.enable, 
                 dbo.productStock.positionId, dbo.productStock.materialId, dbo.productStock.productCode, 
                 dbo.productStock.containerCode, dbo.position.positionType, dbo.productStock.supplier, dbo.material.version
-FROM      dbo.position LEFT  JOIN
-                dbo.productStock ON dbo.position.positionId = dbo.productStock.positionId 
-				LEFT JOIN productStockList as prodList on prodList.stockId=dbo.productStock.positionId
+FROM      productStockList as prodList 
+				LEFT JOIN dbo.position on prodList.stockId=dbo.position.positionId
+			    LEFT  JOIN dbo.productStock ON dbo.position.positionId = dbo.productStock.positionId 
+				
 				LEFT JOIN dbo.material ON dbo.productStock.materialId = dbo.material.materialId
    WHERE [position].row=1 OR  [position].row=2
+    and prodList.stockListId is not null
 
    
 
-GO
+GO
\ No newline at end of file
diff --git a/wcs/yunneiWCS/yunneiWCS/ExtendFunction/SystemWarningMsg.cs b/wcs/yunneiWCS/yunneiWCS/ExtendFunction/SystemWarningMsg.cs
index c4f5c24..d5caa6a 100644
--- a/wcs/yunneiWCS/yunneiWCS/ExtendFunction/SystemWarningMsg.cs
+++ b/wcs/yunneiWCS/yunneiWCS/ExtendFunction/SystemWarningMsg.cs
@@ -71,5 +71,8 @@
         /// MES鏁版嵁鎺ㄩ�佺嚎绋嬫秷鎭�
         /// </summary>
         public static string msg_mesDataTranfficForRealMes = "";
+
+
+        public static string mesStockDataForRealMes = "";
     }
 }
diff --git a/wcs/yunneiWCS/yunneiWCS/Form1.Designer.cs b/wcs/yunneiWCS/yunneiWCS/Form1.Designer.cs
index 2938dfb..c49a926 100644
--- a/wcs/yunneiWCS/yunneiWCS/Form1.Designer.cs
+++ b/wcs/yunneiWCS/yunneiWCS/Form1.Designer.cs
@@ -33,6 +33,8 @@
             this.label_PLC = new System.Windows.Forms.Label();
             this.pictureBox1 = new System.Windows.Forms.PictureBox();
             this.panel1 = new System.Windows.Forms.Panel();
+            this.lbl_msg_mesDataTranffic_V2 = new System.Windows.Forms.Label();
+            this.label2 = new System.Windows.Forms.Label();
             this.lbl_ClearDataMsg = new System.Windows.Forms.Label();
             this.lbl_Thread_lbl_shouEntity_Srm = new System.Windows.Forms.Label();
             this.label35 = new System.Windows.Forms.Label();
@@ -59,8 +61,8 @@
             this.label3 = new System.Windows.Forms.Label();
             this.lbl_sendTask_errMsg = new System.Windows.Forms.Label();
             this.label1 = new System.Windows.Forms.Label();
-            this.label2 = new System.Windows.Forms.Label();
-            this.lbl_msg_mesDataTranffic_V2 = new System.Windows.Forms.Label();
+            this.lbl_msg_mesStockDataForRealMes = new System.Windows.Forms.Label();
+            this.label14 = new System.Windows.Forms.Label();
             ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
             this.panel1.SuspendLayout();
             this.SuspendLayout();
@@ -91,7 +93,7 @@
             this.pictureBox1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom;
             this.pictureBox1.Dock = System.Windows.Forms.DockStyle.Top;
             this.pictureBox1.Location = new System.Drawing.Point(0, 0);
-            this.pictureBox1.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.pictureBox1.Margin = new System.Windows.Forms.Padding(2);
             this.pictureBox1.Name = "pictureBox1";
             this.pictureBox1.Size = new System.Drawing.Size(782, 149);
             this.pictureBox1.TabIndex = 2;
@@ -99,6 +101,8 @@
             // 
             // panel1
             // 
+            this.panel1.Controls.Add(this.lbl_msg_mesStockDataForRealMes);
+            this.panel1.Controls.Add(this.label14);
             this.panel1.Controls.Add(this.lbl_msg_mesDataTranffic_V2);
             this.panel1.Controls.Add(this.label2);
             this.panel1.Controls.Add(this.lbl_ClearDataMsg);
@@ -129,10 +133,31 @@
             this.panel1.Controls.Add(this.label1);
             this.panel1.Dock = System.Windows.Forms.DockStyle.Bottom;
             this.panel1.Location = new System.Drawing.Point(0, 222);
-            this.panel1.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.panel1.Margin = new System.Windows.Forms.Padding(2);
             this.panel1.Name = "panel1";
             this.panel1.Size = new System.Drawing.Size(782, 425);
             this.panel1.TabIndex = 3;
+            // 
+            // lbl_msg_mesDataTranffic_V2
+            // 
+            this.lbl_msg_mesDataTranffic_V2.AutoSize = true;
+            this.lbl_msg_mesDataTranffic_V2.ForeColor = System.Drawing.Color.Red;
+            this.lbl_msg_mesDataTranffic_V2.Location = new System.Drawing.Point(156, 365);
+            this.lbl_msg_mesDataTranffic_V2.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
+            this.lbl_msg_mesDataTranffic_V2.Name = "lbl_msg_mesDataTranffic_V2";
+            this.lbl_msg_mesDataTranffic_V2.Size = new System.Drawing.Size(53, 12);
+            this.lbl_msg_mesDataTranffic_V2.TabIndex = 27;
+            this.lbl_msg_mesDataTranffic_V2.Text = "閿欒娑堟伅";
+            // 
+            // label2
+            // 
+            this.label2.AutoSize = true;
+            this.label2.Location = new System.Drawing.Point(9, 365);
+            this.label2.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
+            this.label2.Name = "label2";
+            this.label2.Size = new System.Drawing.Size(149, 12);
+            this.label2.TabIndex = 26;
+            this.label2.Text = "鎺ㄩ�佺粰MES鍑哄叆搴撴暟鎹�(V2):";
             // 
             // lbl_ClearDataMsg
             // 
@@ -407,26 +432,26 @@
             this.label1.TabIndex = 0;
             this.label1.Text = "娑堣垂宸蹭笅鍙戠殑浠诲姟绾跨▼:";
             // 
-            // label2
+            // lbl_msg_mesStockDataForRealMes
             // 
-            this.label2.AutoSize = true;
-            this.label2.Location = new System.Drawing.Point(9, 365);
-            this.label2.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
-            this.label2.Name = "label2";
-            this.label2.Size = new System.Drawing.Size(113, 12);
-            this.label2.TabIndex = 26;
-            this.label2.Text = "鎺ㄩ�佺粰MES鏁版嵁(V2):";
+            this.lbl_msg_mesStockDataForRealMes.AutoSize = true;
+            this.lbl_msg_mesStockDataForRealMes.ForeColor = System.Drawing.Color.Red;
+            this.lbl_msg_mesStockDataForRealMes.Location = new System.Drawing.Point(148, 391);
+            this.lbl_msg_mesStockDataForRealMes.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
+            this.lbl_msg_mesStockDataForRealMes.Name = "lbl_msg_mesStockDataForRealMes";
+            this.lbl_msg_mesStockDataForRealMes.Size = new System.Drawing.Size(53, 12);
+            this.lbl_msg_mesStockDataForRealMes.TabIndex = 29;
+            this.lbl_msg_mesStockDataForRealMes.Text = "閿欒娑堟伅";
             // 
-            // lbl_msg_mesDataTranffic_V2
+            // label14
             // 
-            this.lbl_msg_mesDataTranffic_V2.AutoSize = true;
-            this.lbl_msg_mesDataTranffic_V2.ForeColor = System.Drawing.Color.Red;
-            this.lbl_msg_mesDataTranffic_V2.Location = new System.Drawing.Point(135, 365);
-            this.lbl_msg_mesDataTranffic_V2.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
-            this.lbl_msg_mesDataTranffic_V2.Name = "lbl_msg_mesDataTranffic_V2";
-            this.lbl_msg_mesDataTranffic_V2.Size = new System.Drawing.Size(53, 12);
-            this.lbl_msg_mesDataTranffic_V2.TabIndex = 27;
-            this.lbl_msg_mesDataTranffic_V2.Text = "閿欒娑堟伅";
+            this.label14.AutoSize = true;
+            this.label14.Location = new System.Drawing.Point(9, 391);
+            this.label14.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
+            this.label14.Name = "label14";
+            this.label14.Size = new System.Drawing.Size(137, 12);
+            this.label14.TabIndex = 28;
+            this.label14.Text = "鎺ㄩ�佺粰MES搴撳瓨鏁版嵁(V2):";
             // 
             // Form1
             // 
@@ -441,7 +466,7 @@
             this.ForeColor = System.Drawing.SystemColors.ActiveCaptionText;
             this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
             this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
-            this.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.Margin = new System.Windows.Forms.Padding(2);
             this.Name = "Form1";
             this.Text = "浼熸湰鏅鸿兘WCS";
             this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Form1_FormClosing);
@@ -487,6 +512,8 @@
         private System.Windows.Forms.Label label36;
         private System.Windows.Forms.Label label2;
         private System.Windows.Forms.Label lbl_msg_mesDataTranffic_V2;
+        private System.Windows.Forms.Label lbl_msg_mesStockDataForRealMes;
+        private System.Windows.Forms.Label label14;
     }
 }
 
diff --git a/wcs/yunneiWCS/yunneiWCS/Form1.cs b/wcs/yunneiWCS/yunneiWCS/Form1.cs
index 4145fa9..ae6593d 100644
--- a/wcs/yunneiWCS/yunneiWCS/Form1.cs
+++ b/wcs/yunneiWCS/yunneiWCS/Form1.cs
@@ -142,6 +142,8 @@
 
             new Thread(mesDataTranfficForRealMes.Handler).Start();
 
+            new Thread(mesStockDataForRealMes.Handler).Start();
+
             new Thread(RefershData).Start();
 
 
@@ -2338,7 +2340,7 @@
 
         }
 
-     
+
         private void Form1_FormClosing(object sender, FormClosingEventArgs e)
         {
             Environment.Exit(0);//閫�鍑烘湰杩涚▼鎵�鏈夌嚎绋�
@@ -2832,6 +2834,7 @@
 
                     this.lbl_msg_mesDataTranffic.Text = showNowTime + SystemWarningMsg.msg_mesDataTranffic;
                     this.lbl_msg_mesDataTranffic_V2.Text = showNowTime + SystemWarningMsg.msg_mesDataTranfficForRealMes;
+                    this.lbl_msg_mesStockDataForRealMes.Text = showNowTime + SystemWarningMsg.mesStockDataForRealMes;
 
                     this.lbl_sendTaskForPick_ErrMsg.Text = showNowTime + SystemWarningMsg.Thread_sendTaskForPick_ErrMsg;
                     this.lbl_ClearDataMsg.Text = showNowTime + SystemWarningMsg.Thread_lbl_ClearDataMsg;
diff --git a/wcs/yunneiWCS/yunneiWCS/ORM/dbmodel.cs b/wcs/yunneiWCS/yunneiWCS/ORM/dbmodel.cs
index 5935d54..c678b6a 100644
--- a/wcs/yunneiWCS/yunneiWCS/ORM/dbmodel.cs
+++ b/wcs/yunneiWCS/yunneiWCS/ORM/dbmodel.cs
@@ -1,7 +1,4 @@
-using System;
-using System.ComponentModel.DataAnnotations.Schema;
 using System.Data.Entity;
-using System.Linq;
 
 namespace yunneiWCS.ORM
 {
@@ -11,7 +8,7 @@
             : base("name=dbmodel")
         {
         }
-
+        public virtual DbSet<v_srmStockdetails> v_srmStockdetails { get; set; }
         public virtual DbSet<BasicDataSet> BasicDataSet { get; set; }
         public virtual DbSet<inStockOrder> inStockOrder { get; set; }
         public virtual DbSet<inStockOrderList> inStockOrderList { get; set; }
@@ -43,6 +40,42 @@
 
         protected override void OnModelCreating(DbModelBuilder modelBuilder)
         {
+            modelBuilder.Entity<v_srmStockdetails>()
+               .Property(e => e.productName)
+               .IsUnicode(false);
+
+            modelBuilder.Entity<v_srmStockdetails>()
+                .Property(e => e.serialNumber)
+                .IsUnicode(false);
+
+            modelBuilder.Entity<v_srmStockdetails>()
+                .Property(e => e.positionName)
+                .IsUnicode(false);
+
+            modelBuilder.Entity<v_srmStockdetails>()
+                .Property(e => e.materialCode)
+                .IsUnicode(false);
+
+            modelBuilder.Entity<v_srmStockdetails>()
+                .Property(e => e.materialName)
+                .IsUnicode(false);
+
+            modelBuilder.Entity<v_srmStockdetails>()
+                .Property(e => e.productCode)
+                .IsUnicode(false);
+
+            modelBuilder.Entity<v_srmStockdetails>()
+                .Property(e => e.containerCode)
+                .IsUnicode(false);
+
+            modelBuilder.Entity<v_srmStockdetails>()
+                .Property(e => e.supplier)
+                .IsUnicode(false);
+
+            modelBuilder.Entity<v_srmStockdetails>()
+                .Property(e => e.version)
+                .IsUnicode(false);
+
             modelBuilder.Entity<BasicDataSet>()
                 .Property(e => e.BasicDataType)
                 .IsFixedLength()
diff --git a/wcs/yunneiWCS/yunneiWCS/ORM/v_srmStockdetails.cs b/wcs/yunneiWCS/yunneiWCS/ORM/v_srmStockdetails.cs
new file mode 100644
index 0000000..383f051
--- /dev/null
+++ b/wcs/yunneiWCS/yunneiWCS/ORM/v_srmStockdetails.cs
@@ -0,0 +1,66 @@
+namespace yunneiWCS.ORM
+{
+    using System;
+    using System.Collections.Generic;
+    using System.ComponentModel.DataAnnotations;
+    using System.ComponentModel.DataAnnotations.Schema;
+    using System.Data.Entity.Spatial;
+
+    public partial class v_srmStockdetails
+    {
+        [Key]
+        [DatabaseGenerated(DatabaseGeneratedOption.None)]
+        public long stockListId { get; set; }
+
+        [StringLength(50)]
+        public string productName { get; set; }
+
+        [StringLength(50)]
+        public string serialNumber { get; set; }
+
+        public long? stockId { get; set; }
+
+        [StringLength(10)]
+        public string positionName { get; set; }
+
+        public bool? isLock { get; set; }
+
+        public bool? isfree { get; set; }
+
+        [StringLength(50)]
+        public string materialCode { get; set; }
+
+        [StringLength(50)]
+        public string materialName { get; set; }
+
+        public int? quantity { get; set; }
+
+        public int? taskType { get; set; }
+
+        public int? status { get; set; }
+
+        public DateTime? createTime { get; set; }
+
+        public DateTime? updateTime { get; set; }
+
+        public bool? enable { get; set; }
+
+        public long? positionId { get; set; }
+
+        public long? materialId { get; set; }
+
+        [StringLength(50)]
+        public string productCode { get; set; }
+
+        [StringLength(50)]
+        public string containerCode { get; set; }
+
+        public byte? positionType { get; set; }
+
+        [StringLength(50)]
+        public string supplier { get; set; }
+
+        [StringLength(50)]
+        public string version { get; set; }
+    }
+}
diff --git a/wcs/yunneiWCS/yunneiWCS/ThreadTask/mesStockDataForRealMes.cs b/wcs/yunneiWCS/yunneiWCS/ThreadTask/mesStockDataForRealMes.cs
index 62de875..80cee00 100644
--- a/wcs/yunneiWCS/yunneiWCS/ThreadTask/mesStockDataForRealMes.cs
+++ b/wcs/yunneiWCS/yunneiWCS/ThreadTask/mesStockDataForRealMes.cs
@@ -24,92 +24,60 @@
             {
                 try
                 {
-                    Thread.Sleep(5000);
+
                     //Log4NetHelper.WriteErrorLog(_logType, "娴嬭瘯鍟婂晩鍟婂晩 ");
                     //Log4NetHelper.WriteInfoLog(_logType, "娴嬭瘯鍟婂晩鍟婂晩 ");
                     using (dbmodel mod = new dbmodel())
                     {
-                        List<Wms_outInStockRecord_V2_Mes> sendMesData = mod.Wms_outInStockRecord_V2_Mes.Where(x => x.isSendToMes == 0).ToList();
+                        List<v_srmStockdetails> sendMesData = mod.v_srmStockdetails.OrderBy(x => x.positionName).ToList();
 
                         if (sendMesData.Count > 0)
                         {
+                            ApiResponse<object> ret = null;
+                            List<InboundStockInfoToMes> pushData = new List<InboundStockInfoToMes>();
                             foreach (var itemTask in sendMesData)
                             {
-                                try
+                                pushData.Add(new InboundStockInfoToMes()
                                 {
-                                    ApiResponse<object> ret = null;
+                                    containerCode = itemTask.containerCode,
+                                    createTime = itemTask.createTime?.ToString("yyyy-MM-dd HH:mm:ss"),
+                                    materialCode = itemTask.productCode,
+                                    materialName = itemTask.productName,
+                                    positionName = itemTask.positionName,
+                                    productName = itemTask.materialName,
+                                    serialNumber = itemTask.serialNumber,
+                                    supplier = itemTask.supplier,
+                                    version = itemTask.version,
 
-                                    //鑾峰彇淇℃伅鏄庣粏
-                                    var details = mod.Wms_outInStockRecord_Details_V2_Mes.Where(x => x.mainId == itemTask.ID).ToList();
-                                    List<InboundStockInfoToMes> pushData = new List<InboundStockInfoToMes>();
-                                    foreach (var de in details)
-                                    {
-                                        pushData.Add(new InboundStockInfoToMes()
-                                        {
-                                            containerCode = itemTask.containerCode,
-                                            createTime = itemTask.CreateTime?.ToString("yyyy-MM-dd HH:mm:ss"),
-                                            materialCode = de.productCode,
-                                            materialName = de.productName,
-                                            positionName = itemTask.sourcePlace,
-                                            productName = itemTask.materialName,
-                                            serialNumber = de.serialNumber,
-                                            supplier = itemTask.supplier,
-                                            version = itemTask.version,
-                                        });
-                                    }
+                                });
 
-                                    if (Form1.isvirtual)
-                                    {//妯℃嫙鐜
-                                        ret = new ApiResponse<object>();
-                                        ret.Success = true;
-                                        ret.Message = "绯荤粺妯℃嫙瀹屾垚";
-                                    }
-                                    else
-                                    {
-                                        switch (itemTask.outInFlag)
-                                        {
-                                            case (int)OutInFlag.鍏ュ簱:
-                                                ret = PushMesHandler.Mes_InStockSend(pushData, itemTask.ID.ToString(), _logType);
-                                                break;
-                                            case (int)OutInFlag.鍑哄簱:
-                                                ret = PushMesHandler.Mes_OutStockSend(pushData, itemTask.ID.ToString(), _logType);
-                                                break;
-                                            default:
-                                                break;
-                                        }
-                                    }
-
-                                    if (ret.Success)
-                                    {
-                                        itemTask.isSendToMes = 1;
-                                    }
-                                    else
-                                    {
-                                        itemTask.isSendToMes = 0;
-                                    }
-                                    itemTask.SendToMesTime = DateTime.Now;
-                                    itemTask.MesRet = ret.Message;
-                                    itemTask.SendToMesCount = (itemTask.SendToMesCount ?? 0) + 1;
-                                    mod.SaveChanges();
-
-                                }
-                                catch (Exception ex)
-                                {
-                                    SystemWarningMsg.msg_mesDataTranfficForRealMes = "鎺ㄩ�佺粰MES鏁版嵁寮傚父:" + JsonConvert.SerializeObject(ex);
-                                    Log4NetHelper.WriteErrorLog(_logType, SystemWarningMsg.msg_mesDataTranfficForRealMes, ex);
-                                }
+                            }
+                            if (Form1.isvirtual)
+                            {//妯℃嫙鐜
+                                ret = new ApiResponse<object>();
+                                ret.Success = true;
+                                ret.Message = "绯荤粺妯℃嫙瀹屾垚";
+                            }
+                            else
+                            {
+                                ret = PushMesHandler.Mes_StockSend(pushData, _logType);
                             }
                         }
                         else
                         {
-                            SystemWarningMsg.msg_mesDataTranfficForRealMes = "娌℃湁鏁版嵁瑕佹帹閫佺粰MES!";
+                            SystemWarningMsg.mesStockDataForRealMes = "娌℃湁鏁版嵁瑕佹帹閫佺粰MES!";
                         }
                     }
                 }
                 catch (Exception ex)
                 {
-                    SystemWarningMsg.msg_mesDataTranfficForRealMes = "鏁版嵁瑕佹帹閫佺粰MES鍑虹幇寮傚父:" + ex.Message;
-                    Log4NetHelper.WriteErrorLog(_logType, SystemWarningMsg.msg_mesDataTranfficForRealMes, ex);
+                    SystemWarningMsg.mesStockDataForRealMes = "鏁版嵁瑕佹帹閫佺粰MES鍑虹幇寮傚父:" + ex.Message;
+                    Log4NetHelper.WriteErrorLog(_logType, SystemWarningMsg.mesStockDataForRealMes, ex);
+                }
+                finally
+                {
+                    //Thread.Sleep(5000);//姝e紡闇�瑕�5鍒嗛挓鎺ㄩ�佷竴娆�
+                    Thread.Sleep(5 * 60 * 1000);//姝e紡闇�瑕�5鍒嗛挓鎺ㄩ�佷竴娆�
                 }
             }
         }
diff --git "a/wcs/yunneiWCS/yunneiWCS/log4net_iWare -\347\274\226\350\276\221\347\211\210.config" "b/wcs/yunneiWCS/yunneiWCS/log4net_iWare -\347\274\226\350\276\221\347\211\210.config"
index 018e852..72c7f5f 100644
--- "a/wcs/yunneiWCS/yunneiWCS/log4net_iWare -\347\274\226\350\276\221\347\211\210.config"
+++ "b/wcs/yunneiWCS/yunneiWCS/log4net_iWare -\347\274\226\350\276\221\347\211\210.config"
@@ -6,8 +6,8 @@
   </appSettings>
   <log4net>
     <!--  閲嶆柊鑾峰彇鍙戝姩鏈轰俊鎭�愪俊鎭�戞棩蹇�-->
-    <appender name="DataProcess_RobotBuffer_ForceOutbound_Info" type="log4net.Appender.RollingFileAppender">
-      <file value="d:\\Log\\YuNei\\WCS\\DataProcess_RobotBuffer_ForceOutbound_Info\\" />
+    <appender name="mesStockDataForRealMes_Info" type="log4net.Appender.RollingFileAppender">
+      <file value="d:\\Log\\YuNei\\WCS\\mesStockDataForRealMes_Info\\" />
       <appendToFile value="true" />
       <rollingStyle value="Date" />
       <staticLogFileName value="false" />
@@ -17,13 +17,13 @@
         <param name="ConversionPattern" value="%n娑堟伅鏃堕棿锛�%d [%t] %n娑堟伅绾у埆锛�%-5p %n娑� 鎭� 绫伙細%c [%x] %n%m %n "/>
       </layout>
       <filter type="log4net.Filter.LoggerMatchFilter">
-        <loggerToMatch value="DataProcess_RobotBuffer_ForceOutbound_Info" />
+        <loggerToMatch value="mesStockDataForRealMes_Info" />
       </filter>
       <filter type="log4net.Filter.DenyAllFilter" />
     </appender>
     <!--閲嶆柊鑾峰彇鍙戝姩鏈轰俊鎭�愰敊璇�戞棩蹇�-->
-    <appender name="DataProcess_RobotBuffer_ForceOutbound_Error" type="log4net.Appender.RollingFileAppender">
-      <file value="d:\\Log\\YuNei\\WCS\\DataProcess_RobotBuffer_ForceOutbound_Error\\" />
+    <appender name="mesStockDataForRealMes_Error" type="log4net.Appender.RollingFileAppender">
+      <file value="d:\\Log\\YuNei\\WCS\\mesStockDataForRealMes_Error\\" />
       <appendToFile value="true" />
       <rollingStyle value="Date" />
       <staticLogFileName value="false" />
@@ -33,14 +33,14 @@
         <param name="ConversionPattern" value="%n寮傚父鏃堕棿锛�%d [%t] %n寮傚父绾у埆锛�%-5p %n寮� 甯� 绫伙細%c [%x] %n%m %n "/>
       </layout>
       <filter type="log4net.Filter.LoggerMatchFilter">
-        <loggerToMatch value="DataProcess_RobotBuffer_ForceOutbound_Error" />
+        <loggerToMatch value="mesStockDataForRealMes_Error" />
       </filter>
       <filter type="log4net.Filter.DenyAllFilter" />
     </appender>
     <root>
       <level value="ALL"/>
-      <appender-ref ref="DataProcess_RobotBuffer_ForceOutbound_Info"/>
-      <appender-ref ref="DataProcess_RobotBuffer_ForceOutbound_Error"/>
+      <appender-ref ref="mesStockDataForRealMes_Info"/>
+      <appender-ref ref="mesStockDataForRealMes_Error"/>
     </root>
   </log4net>
 </configuration>
\ No newline at end of file
diff --git a/wcs/yunneiWCS/yunneiWCS/log4net_iWare.config b/wcs/yunneiWCS/yunneiWCS/log4net_iWare.config
index 662a512..05cd86f 100644
--- a/wcs/yunneiWCS/yunneiWCS/log4net_iWare.config
+++ b/wcs/yunneiWCS/yunneiWCS/log4net_iWare.config
@@ -37,10 +37,44 @@
       </filter>
       <filter type="log4net.Filter.DenyAllFilter" />
     </appender>
+    <!--  閲嶆柊鑾峰彇鍙戝姩鏈轰俊鎭�愪俊鎭�戞棩蹇�-->
+    <appender name="mesStockDataForRealMes_Info" type="log4net.Appender.RollingFileAppender">
+      <file value="d:\\Log\\YuNei\\WCS\\mesStockDataForRealMes_Info\\" />
+      <appendToFile value="true" />
+      <rollingStyle value="Date" />
+      <staticLogFileName value="false" />
+      <datePattern value="yyyy-MM-dd.LOG" />
+      <layout type="log4net.Layout.PatternLayout">
+        <!--杈撳嚭鏍煎紡-->
+        <param name="ConversionPattern" value="%n娑堟伅鏃堕棿锛�%d [%t] %n娑堟伅绾у埆锛�%-5p %n娑� 鎭� 绫伙細%c [%x] %n%m %n "/>
+      </layout>
+      <filter type="log4net.Filter.LoggerMatchFilter">
+        <loggerToMatch value="mesStockDataForRealMes_Info" />
+      </filter>
+      <filter type="log4net.Filter.DenyAllFilter" />
+    </appender>
+    <!--閲嶆柊鑾峰彇鍙戝姩鏈轰俊鎭�愰敊璇�戞棩蹇�-->
+    <appender name="mesStockDataForRealMes_Error" type="log4net.Appender.RollingFileAppender">
+      <file value="d:\\Log\\YuNei\\WCS\\mesStockDataForRealMes_Error\\" />
+      <appendToFile value="true" />
+      <rollingStyle value="Date" />
+      <staticLogFileName value="false" />
+      <datePattern value="yyyy-MM-dd.LOG" />
+      <layout type="log4net.Layout.PatternLayout">
+        <!--杈撳嚭鏍煎紡-->
+        <param name="ConversionPattern" value="%n寮傚父鏃堕棿锛�%d [%t] %n寮傚父绾у埆锛�%-5p %n寮� 甯� 绫伙細%c [%x] %n%m %n "/>
+      </layout>
+      <filter type="log4net.Filter.LoggerMatchFilter">
+        <loggerToMatch value="mesStockDataForRealMes_Error" />
+      </filter>
+      <filter type="log4net.Filter.DenyAllFilter" />
+    </appender>
     <root>
       <level value="ALL"/>
       <appender-ref ref="mesDataTranfficForRealMes_Info"/>
       <appender-ref ref="mesDataTranfficForRealMes_Error"/>
+      <appender-ref ref="mesStockDataForRealMes_Info"/>
+      <appender-ref ref="mesStockDataForRealMes_Error"/>
     </root>
   </log4net>
 </configuration>
\ No newline at end of file
diff --git a/wcs/yunneiWCS/yunneiWCS/yunneiWCS.csproj b/wcs/yunneiWCS/yunneiWCS/yunneiWCS.csproj
index 935fe67..a172f2b 100644
--- a/wcs/yunneiWCS/yunneiWCS/yunneiWCS.csproj
+++ b/wcs/yunneiWCS/yunneiWCS/yunneiWCS.csproj
@@ -161,6 +161,7 @@
     <Compile Include="TestForm.Designer.cs">
       <DependentUpon>TestForm.cs</DependentUpon>
     </Compile>
+    <Compile Include="ORM\v_srmStockdetails.cs" />
     <Compile Include="ThreadTask\mesStockDataForRealMes.cs" />
     <Compile Include="ThreadTask\mesDataTranfficForRealMes.cs" />
     <Compile Include="Utils\Log4Net\C_LogWriter.cs" />

--
Gitblit v1.9.3