Просмотр исходного кода

设备号显示、报警显示

xu.lu 2 лет назад
Родитель
Сommit
fbaea894ed

Разница между файлами не показана из-за своего большого размера
+ 487 - 159
WCS_Client/Frm/MBtn_Monitor/Frm_YongGuanMontior.Designer.cs


+ 130 - 88
WCS_Client/Frm/MBtn_Monitor/Frm_YongGuanMontior.cs

@@ -88,6 +88,7 @@ namespace WCS_Client.Frm
                     ddjsatatus.DdjTotal_KM = (Label)FindControl("ddjTotal_KM" + index);
                     ddjsatatus.DdjPosFrom = (Label)FindControl("ddjPosFrom" + index);
                     ddjsatatus.DdjPosTo = (Label)FindControl("ddjPosTo" + index);
+                    ddjsatatus.DdjWarning = (Label)FindControl("lblDDJWarning" + index);
                     DDJSatatusSet.Add(ddjsatatus);
                 }
             }
@@ -174,6 +175,7 @@ namespace WCS_Client.Frm
                 }
                 else
                 {
+
                 }
             }
             catch (Exception ex)
@@ -191,11 +193,6 @@ namespace WCS_Client.Frm
                 var convdata = pack.StationDatas;//输送线数据
                 var rgvdata = pack.RGVDatas;//穿梭车数据
                 var scdata = pack.SCDatas;//堆垛机数据
-                // var robotdata = pack.RobotData;//机器人数据
-                //var pldata = pack.ProdLineData;//产线数据
-
-                //string startTime = DateTime.Now.ToString();
-
                 //SRM
                 foreach (var item in scdata.Datas)
                 {
@@ -204,57 +201,91 @@ namespace WCS_Client.Frm
                     //{
                     //    var oldItem = eqpData.oldDeviceDataPack.SCDatas.Datas.FirstOrDefault(p => p.Code == item.Code);
                     //    if (oldItem.ToString() == item.ToString()) return;
-                    //}
-
-                    
-
+                    //}                  
                     var ddjstatus = DDJSatatusSet.FirstOrDefault(v => v.SrmName == item.Code);
-                    if (item.Code != null)
-                    {
-                        ddjstatus.DdjPosCurr.Text = item.Code.ToString().Substring(3);
-                    }
-
                     if (ddjstatus != null)
                     {
-                        //模式
-                        ddjstatus.DdjMode.Text = item.D521.SRMMode.ToString();
+                        //报警信息
+                        if (item.D537.SCAlarm.ToString() == "无")
+                            ddjstatus.DdjWarning.Text = "";
+                        else {
+                            ddjstatus.DdjWarning.Text += item.D537.SCAlarm.ToString();//item.Info.Contains("接口调用") ? "" : item.Info;
+                        }
+                        
+                        if (item.Code != null)
+                        {
+                            ddjstatus.DdjPosCurr.Text = item.Code.ToString().Substring(3);
+                        }
+                        if (ddjstatus.DdjWarning.Text != "")
+                        {
+                            ddjstatus.G.Image = Properties.Resources.红;
+                        }
+                        else //(ddjstatus != null)
+                        {
+                            //模式
+                            ddjstatus.DdjMode.Text = item.D521.SRMMode.ToString();
 
-                        //if(item.D537.SCAlarm.ToString()=="无")
+                            if (!string.IsNullOrEmpty(ddjstatus.DdjMode.Text))
+                            {
+                                if (item.D521.SRMMode.ToString() == "远程")
+                                {
+                                    ddjstatus.G.Image = Properties.Resources.绿;
+                                }
+                                else if (item.D521.SRMMode.ToString() == "半自动" || item.D521.SRMMode.ToString() == "手动")
+                                {
+                                    ddjstatus.G.Image = Properties.Resources.黄;
+                                }
+                                else if (item.D521.SRMMode.ToString() == "维修")
+                                {
+                                    ddjstatus.G.Image = Properties.Resources.红;
+                                }
+                            }
+                            else
+                            {
+                                ddjstatus.DdjMode.Text = "无";
+                                ddjstatus.G.Image = Properties.Resources.黄;
+                            }                       
+                        }
+
+                        ////状态
+                        ddjstatus.DdjStatus.Text = item.D521.SRMStatus.ToString();
 
-                        if (item.D521.SRMMode.ToString() == "远程")
+                        int taskid = 100;
+                        if (item.D521.TaskID_1 > 10000 && item.D521.TaskID_2 > 10000)
                         {
-                            ddjstatus.G.Image = Properties.Resources.绿;
+                             taskid = item.D521.TaskID_1;
                         }
-                        else if (item.D521.SRMMode.ToString() == "半自动")
+                        else if (item.D521.TaskID_1 > 10000)
                         {
-                            ddjstatus.G.Image = Properties.Resources.黄;
+                            taskid = item.D521.TaskID_1;
                         }
-                        else if (item.D521.SRMMode.ToString() == "手动")
+                        else if (item.D521.TaskID_2 > 10000)
                         {
-                            ddjstatus.G.Image = Properties.Resources.黄;
+                            taskid = item.D521.TaskID_2;
                         }
-                        else if (item.D521.SRMMode.ToString() == "维修")
+                        else 
                         {
-                            ddjstatus.G.Image = Properties.Resources.红;
+                            taskid = item.D521.TaskID_1;
                         }
 
-                        ////状态
-                        ddjstatus.DdjStatus.Text = item.D521.SRMStatus.ToString();                      
-                        
-                        var task = SugarBase.DB.Queryable<WCS_TASK>().First(v => v.ID == item.D521.TaskID_1);
+                        //任务号
+                        ddjstatus.DdjOrdId.Text = taskid.ToString();
+                        var task = SugarBase.DB.Queryable<WCS_TASK>().First(v => v.ID == taskid);
                         if (task != null)
                         {
-                            //任务号
-                            ddjstatus.DdjOrdId.Text = item.D521.TaskID_1.ToString();
                             //任务类型
-                            ddjstatus.DdjOptType.Text = task.TYPE.ToString();                                                      
+                            ddjstatus.DdjOptType.Text = task.TYPE.ToString();
                             if (task.TYPE == TaskType.入库)
                             {
+
                                 ddjstatus.LblInStatus.BackColor = Color.Lime;
                                 ddjstatus.LblOutStatus.BackColor = Color.DarkGray;
+
+
                             }
                             else if (task.TYPE == TaskType.出库)
                             {
+
                                 ddjstatus.LblInStatus.BackColor = Color.DarkGray;
                                 ddjstatus.LblOutStatus.BackColor = Color.Lime;
                             }
@@ -266,13 +297,10 @@ namespace WCS_Client.Frm
                         }
                         else
                         {
-                            ddjstatus.DdjOrdId.Text = "0";
-                            ddjstatus.DdjOptType.Text = "无";
-
                             ddjstatus.LblInStatus.BackColor = Color.DarkGray;
-                            ddjstatus.LblOutStatus.BackColor = Color.DarkGray;                         
+                            ddjstatus.LblOutStatus.BackColor = Color.DarkGray;
                         }
-                        
+
                         ////运行时长
                         ddjstatus.DdjWorkTime.Text = item.D521.Runtime.ToString() + "h";
                         ////里程数
@@ -282,7 +310,8 @@ namespace WCS_Client.Frm
                         //目标位置
                         ddjstatus.DdjPosTo.Text = item.D521.SLine_1.ToString() + "-" + item.D521.SCol_1.ToString() + "-" + item.D521.SLayer_1.ToString();
                     }
-                }
+                    
+                    }
                 //RGV
                 foreach (var item in rgvdata.Datas)
                 {
@@ -351,7 +380,7 @@ namespace WCS_Client.Frm
                             //当前位置
                             //rgvstatus.RGVPosCurr.Text = item.D521.Position.ToString();
                             //起始位置
-                        rgvstatus.RGVPosFrom.Text = "0"; //item.D521.StartPosition_1.ToString();
+                        rgvstatus.RGVPosFrom.Text = item.D521.Position.ToString(); //item.D521.StartPosition_1.ToString();
                                                              //目标位置
                         rgvstatus.RGVPosTo.Text = item.D521.DestPosition_1.ToString();
 
@@ -383,54 +412,7 @@ namespace WCS_Client.Frm
                                     }
                                 }
                             }
-                        }
-
-
-                        //if (control != null)
-                        //{
-                        //    if (control is Conveyor6)
-                        //    {
-                        //        var con = (Conveyor6)control;
-                        //        con.button1.Text = item.Code;
-                        //        if (item.D521.PH_Status == true)
-                        //        {
-                        //            if (con.button1.Tag.ToString() != "pall")
-                        //            {
-                        //                con.button1.BackgroundImage = Image.FromFile("Resources/Rgv02.png");
-                        //                con.button1.Tag = "pall";
-                        //            }
-                        //        }
-                        //        else
-                        //        {
-                        //            if (con.button1.Tag.ToString() != "empty")
-                        //            {
-                        //                con.button1.BackgroundImage = Image.FromFile("Resources/shelf16UD.png");
-                        //                con.button1.Tag = "empty";
-                        //            }
-                        //        }
-                        //    }
-                        //    else if (control is Conveyor5)
-                        //    {
-                        //        var con = (Conveyor5)control;
-                        //        con.button1.Text = item.Code;
-                        //        if (item.D521.PH_Status == true)
-                        //        {
-                        //            if (con.button1.Tag.ToString() != "pall")
-                        //            {
-                        //                con.button1.BackgroundImage = Image.FromFile("Resources/rgv03.png");
-                        //                con.button1.Tag = "pall";
-                        //            }
-                        //        }
-                        //        else
-                        //        {
-                        //            if (con.button1.Tag.ToString() != "empty")
-                        //            {
-                        //                con.button1.BackgroundImage = Image.FromFile("Resources/shelf16UD1.png");
-                        //                con.button1.Tag = "empty";
-                        //            }
-                        //        }
-                        //    }
-                        //}
+                        }                    
                     }
                 }
                 //输送线
@@ -449,7 +431,15 @@ namespace WCS_Client.Frm
                             else if (item.D523.Status == 0) con.BackColor = Color.Yellow;
                             else con.BackColor = Color.FromArgb(0, 144, 154);
                             con.button1.Text = item.Code.ToString();
-                            if (item.D521.Status.HasFlag(WCS.Entity.Protocol.IstationStatus.光电状态)&&item.D521.Tasknum.ToString().Length>10000)
+                            if (item.D521.Status.HasFlag(WCS.Entity.Protocol.IstationStatus.光电状态))
+                            {
+                                if (con.button1.Tag.ToString() != "pall")
+                                {
+                                    con.button1.BackgroundImage = Image.FromFile("Resources/Conveyor.png");
+                                    con.button1.Tag = "pall";
+                                }
+                            }
+                            else if (item.D521.Tasknum.ToString().Length > 10000)
                             {
                                 if (con.button1.Tag.ToString() != "pall")
                                 {
@@ -714,7 +704,10 @@ namespace WCS_Client.Frm
         {
 
         }
+
         #endregion
+
+       
     }
 
     public class DDJSatatus
@@ -744,6 +737,9 @@ namespace WCS_Client.Frm
         /// </summary>
         public Label DdjMode { get; set; }
 
+        public Label DdjWarning { get; set; }
+
+
         /// <summary>
         /// 堆垛机工作状态
         /// </summary>
@@ -837,4 +833,50 @@ namespace WCS_Client.Frm
     {
         public new DateTime UPDATETIME { get; set; }
     }
+
+    /// <summary>
+    /// 提示 ToolTip
+    /// </summary>
+    public class MoveOverInfoTip
+    {
+
+        #region   基础参数
+        //信息提示组件
+        private static ToolTip _toolTip = new ToolTip();
+
+        #endregion
+
+        #region   公有方法
+
+
+        /// <summary>
+        /// 设置单个控件提示信息
+        /// </summary>
+        /// <typeparam name="T">组件类型</typeparam>
+        /// <param name="t">组件</param>
+        /// <param name="tipInfo">需要显示的提示信息</param>
+        public static void SettingSingleTipInfo<T>(T t, string tipInfo) where T : Control
+        {
+            _toolTip.SetToolTip(t, tipInfo);
+        }
+
+
+        /// <summary>
+        /// 设置多个同种类型的提示信息
+        /// </summary>
+        /// <typeparam name="T">组件类型</typeparam>
+        /// <param name="dic">组件和提示信息字典</param>
+        public static void SettingMutiTipInfo<T>(Dictionary<T, string> dic) where T : Control
+        {
+            if (dic == null || dic.Count <= 0) return;
+
+            foreach (var item in dic)
+            {
+                _toolTip.SetToolTip(item.Key, item.Value);
+            }
+
+        }
+
+        #endregion
+    }
 }

Разница между файлами не показана из-за своего большого размера
+ 658 - 146
WCS_Client/Frm/MBtn_Monitor/Frm_YongGuanMontior.resx


+ 1 - 0
WCS_Client/From/From_Montior/Conveyor.Designer.cs

@@ -50,6 +50,7 @@
             this.button1.TextAlign = System.Drawing.ContentAlignment.BottomCenter;
             this.button1.UseVisualStyleBackColor = true;
             this.button1.Click += new System.EventHandler(this.button1_Click);
+            this.button1.MouseMove += new System.Windows.Forms.MouseEventHandler(this.button1_MouseMove);
             // 
             // Conveyor
             // 

+ 11 - 8
WCS_Client/From/From_Montior/Conveyor.cs

@@ -29,14 +29,17 @@ namespace WCS_Client.From.From_Montior
                 string equname = Name.Substring(3);
                 FrmEquMsg_dtl Frm = new FrmEquMsg_dtl(equname);
                 Frm.Show();
-            }
-            //int index = Name.LastIndexOf('_');
-            //if (index > 0)
-            //{
-            //    string equname = Name.Substring(index+1);
-            //    Form_EquInfo equinfo = new Form_EquInfo(equname);
-            //    equinfo.Show();
-            //}
+            }          
+        }
+
+        readonly Dictionary<Button, string> dic = new Dictionary<Button, string>();
+        private void button1_MouseMove(object sender, MouseEventArgs e)
+        {
+            if (Name.Contains("_")) { return; }
+            dic.Clear();
+            string equname = Name.Substring(3);
+            dic.Add(button1, equname);
+            MoveOverInfoTip.SettingMutiTipInfo(dic);
         }
     }
 }

+ 1 - 0
WCS_Client/From/From_Montior/Conveyor3.Designer.cs

@@ -50,6 +50,7 @@
             this.button1.TextAlign = System.Drawing.ContentAlignment.BottomCenter;
             this.button1.UseVisualStyleBackColor = true;
             this.button1.Click += new System.EventHandler(this.button1_Click);
+
             // 
             // Conveyor3
             // 

+ 1 - 0
WCS_Client/From/From_Montior/Conveyor3_A.Designer.cs

@@ -50,6 +50,7 @@
             this.button1.TextAlign = System.Drawing.ContentAlignment.BottomCenter;
             this.button1.UseVisualStyleBackColor = true;
             this.button1.Click += new System.EventHandler(this.button1_Click);
+            this.button1.MouseMove += new System.Windows.Forms.MouseEventHandler(this.button1_MouseMove);
             // 
             // Conveyor3_A
             // 

+ 13 - 0
WCS_Client/From/From_Montior/Conveyor3_A.cs

@@ -39,5 +39,18 @@ namespace WCS_Client.From.From_Montior
             //    equinfo.Show();
             //}
         }
+
+        readonly Dictionary<Button, string> dic = new Dictionary<Button, string>();
+        private void button1_MouseMove(object sender, MouseEventArgs e)
+        {
+            button1.BackColor = Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(144)))), ((int)(((byte)(154)))));
+
+            if (Name.Contains("_")) { return; }
+            dic.Clear();
+            string equname = Name.Substring(3);
+            dic.Add(button1, equname);
+            MoveOverInfoTip.SettingMutiTipInfo(dic);
+
+        }
     }
 }

+ 1 - 0
WCS_Client/From/From_Montior/Conveyor3_B.Designer.cs

@@ -50,6 +50,7 @@
             this.button1.TextAlign = System.Drawing.ContentAlignment.BottomCenter;
             this.button1.UseVisualStyleBackColor = true;
             this.button1.Click += new System.EventHandler(this.button1_Click);
+            this.button1.MouseMove += new System.Windows.Forms.MouseEventHandler(this.button1_MouseMove);
             // 
             // Conveyor3_B
             // 

+ 13 - 0
WCS_Client/From/From_Montior/Conveyor3_B.cs

@@ -39,5 +39,18 @@ namespace WCS_Client.From.From_Montior
             //    equinfo.Show();
             //}
         }
+
+        readonly Dictionary<Button, string> dic = new Dictionary<Button, string>();
+        private void button1_MouseMove(object sender, MouseEventArgs e)
+        {
+            button1.BackColor = Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(144)))), ((int)(((byte)(154)))));
+
+            if (Name.Contains("_")) { return; }
+            dic.Clear();
+            string equname = Name.Substring(3);
+            dic.Add(button1, equname);
+            MoveOverInfoTip.SettingMutiTipInfo(dic);
+
+        }
     }
 }

+ 9 - 0
WCS_Client/From/From_Montior/Conveyor_L.cs

@@ -18,9 +18,16 @@ namespace WCS_Client.From.From_Montior
             InitializeComponent();
         }
 
+        readonly Dictionary<Button, string> dic = new Dictionary<Button, string>();
         private void button1_MouseMove(object sender, MouseEventArgs e)
         {
             button1.BackColor = Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(144)))), ((int)(((byte)(154)))));
+
+            if (Name.Contains("_")) { return; }
+            dic.Clear();
+            string equname = Name.Substring(3);
+            dic.Add(button1, equname);
+            MoveOverInfoTip.SettingMutiTipInfo(dic);
         }
 
         private void button1_MouseLeave(object sender, EventArgs e)
@@ -49,5 +56,7 @@ namespace WCS_Client.From.From_Montior
             //    equinfo.Show();
             //}
         }
+
+
     }
 }

+ 19 - 0
WCS_Client/From/From_Montior/Conveyor_R.cs

@@ -18,9 +18,26 @@ namespace WCS_Client.From.From_Montior
             InitializeComponent();
         }
 
+        readonly Dictionary<Button, string> dic = new Dictionary<Button, string>();
         private void button1_MouseMove(object sender, MouseEventArgs e)
         {
+            string equname = "";
             button1.BackColor = Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(144)))), ((int)(((byte)(154)))));
+           
+            if (Name.Contains("_")) { return; }
+            dic.Clear();
+            if (Name.Contains("RGV"))
+            {
+                equname = Name;
+            }
+            else 
+            {
+                equname = Name.Substring(3);
+            }
+                
+            dic.Add(button1, equname);
+            MoveOverInfoTip.SettingMutiTipInfo(dic);
+            
         }
 
         private void button1_MouseLeave(object sender, EventArgs e)
@@ -59,5 +76,7 @@ namespace WCS_Client.From.From_Montior
             //    equinfo.Show();
             //}
         }
+
+
     }
 }

+ 2 - 0
WCS_Client/From/From_Montior/TableCellLabel.Designer.cs

@@ -44,6 +44,8 @@
             this.Size = new System.Drawing.Size(63, 80);
             this.ResumeLayout(false);
 
+            
+
         }
 
         #endregion

+ 2 - 0
WCS_Client/From/From_Montior/TableCellLabel.cs

@@ -7,6 +7,7 @@ using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
 using System.Windows.Forms;
+using WCS_Client.Frm;
 
 namespace WCS_Client.From
 {
@@ -16,5 +17,6 @@ namespace WCS_Client.From
         {
             InitializeComponent();
         }
+             
     }
 }

+ 1 - 0
WCS_Client/From/From_Montior/srm.Designer.cs

@@ -72,6 +72,7 @@
             this.button1.Size = new System.Drawing.Size(73, 102);
             this.button1.TabIndex = 0;
             this.button1.UseVisualStyleBackColor = true;
+            this.button1.MouseMove += new System.Windows.Forms.MouseEventHandler(this.button1_MouseMove);
             // 
             // srm
             // 

+ 14 - 0
WCS_Client/From/From_Montior/srm.cs

@@ -7,6 +7,7 @@ using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
 using System.Windows.Forms;
+using WCS_Client.Frm;
 
 namespace WCS_Client.From.From_Montior
 {
@@ -16,5 +17,18 @@ namespace WCS_Client.From.From_Montior
         {
             InitializeComponent();
         }
+
+        readonly Dictionary<Button, string> dic = new Dictionary<Button, string>();
+        private void button1_MouseMove(object sender, MouseEventArgs e)
+        {
+            if (Name.Contains("_")) { return; }
+            dic.Clear();
+            string equnameIndex = Name.Replace("srm", "");
+            if (int.TryParse(equnameIndex, out var index))
+            {
+                dic.Add(button1, "堆垛机" + index);
+                MoveOverInfoTip.SettingMutiTipInfo(dic);
+            }
+        }
     }
 }

+ 110 - 4
WCS_Client/Workflow/BaseWorkflow.cs

@@ -4,8 +4,10 @@ using System.Collections.Generic;
 using System.Data;
 using System.Linq;
 using System.Text;
+using System.Windows.Forms;
 using WCS_Client.Frm;
 using WCS_Client.Models;
+using WCS_Client.UC;
 using WCS_Client.Utility;
 using WCS_Client.Workflow;
 using static WCS_Client.Frm.WCS_RGV521;
@@ -872,7 +874,94 @@ namespace WCS_Client
                 {
                     if (task.TYPE == WCS.Entity.TaskType.出库 && task.STATUS > 0 && task.STATUS < WCS.Entity.TaskStatus.已完成)
                     {
-                        if (db.Updateable<WCS_TASK>()
+                        string task_station = "G";
+                        if (task.STATUS == WCS.Entity.TaskStatus.堆垛机执行 && !string.IsNullOrEmpty(task.SRMSTATION))
+                        {
+                            #region switch
+                            //switch (task.ADDRNEXT)
+                            //{
+                            //    case "1561": task_next = "G1561"; break;
+                            //    case "1598": task_next = "G1561"; break;
+                            //    case "1538": task_next = "G1538"; break;
+                            //    case "1600": task_next = "G1538"; break;
+                            //    case "1574": task_next = "G1574"; break;
+                            //    case "1602": task_next = "G1574"; break;
+                            //    case "1509": task_next = "G1509"; break;
+                            //    case "1604": task_next = "G1509"; break;
+                            //};
+                            #endregion
+                            if (task.SRMSTATION == "1473" || task.SRMSTATION == "1476")
+                            {
+                                task_station = "G1473";
+                            }
+                            else if (task.SRMSTATION == "1474" || task.SRMSTATION == "1475")
+                            {
+                                task_station = "G1474";
+                            }
+                            else if (task.SRMSTATION == "1491" || task.SRMSTATION == "1492")
+                            {
+                                task_station = "G1491";
+                            }
+                            else if (task.SRMSTATION == "1493" || task.SRMSTATION == "1494")
+                            {
+                                task_station = "G1493";
+                            }
+                            else if (task.SRMSTATION == "1520" || task.SRMSTATION == "1521")
+                            {
+                                task_station = "G1520";
+                            }
+                            else if (task.SRMSTATION == "1522" || task.SRMSTATION == "1523")
+                            {
+                                task_station = "G1522";
+                            }
+                            else if (task.SRMSTATION == "1545" || task.SRMSTATION == "1546")
+                            {
+                                task_station = "G1545";
+                            }
+                            else if (task.SRMSTATION == "1283" || task.SRMSTATION == "1284")
+                            {
+                                task_station = "G1283";
+                            }
+                            else if (task.SRMSTATION == "1290" || task.SRMSTATION == "1291")
+                            {
+                                task_station = "G1290";
+                            }
+                            else if (task.SRMSTATION == "1292" || task.SRMSTATION == "1293")
+                            {
+                                task_station = "G1292";
+                            }
+                            else if (task.SRMSTATION == "1299" || task.SRMSTATION == "1300")
+                            {
+                                task_station = "G1299";
+                            }
+                            else if (task.SRMSTATION == "1301" || task.SRMSTATION == "1302")
+                            {
+                                task_station = "G1301";
+                            }
+                            else if (task.SRMSTATION == "1308" || task.SRMSTATION == "1309")
+                            {
+                                task_station = "G1308";
+                            }
+                            else if (task.SRMSTATION == "1310" || task.SRMSTATION == "1311")
+                            {
+                                task_station = "G1310";
+                            }                                                   
+                            if (task_station != "G")
+                            {
+                               if (db.Updateable<WCS_TASK>()
+                              .UpdateColumns(it => new WCS_TASK
+                              {
+                                  STATUS = 0,
+                                  SRMSTATION = task_station,
+                                  UPDATETIME = DateTime.Now
+                              })
+                              .Where(v => v.ID == task_no).ExecuteCommand() < 0)
+                                {
+                                    throw new Exception(string.Format("任务[{0}]重置失败", task_no));
+                                }
+                            }
+                        }
+                        else if (db.Updateable<WCS_TASK>()
                               .UpdateColumns(it => new WCS_TASK
                               {
                                   STATUS = 0,
@@ -937,12 +1026,29 @@ namespace WCS_Client
                 }
                 else
                 {
-                    if (task.TYPE == WCS.Entity.TaskType.入库 && task.TaskGroupKey.Contains('_'))
+                    if (task.TYPE == WCS.Entity.TaskType.入库 && (task.ADDRFROM == "1157" || task.ADDRFROM == "1158") && task.TaskGroupKey.Contains('_'))
                     {
                         var arr = task.TaskGroupKey.Split('_');
                         if (!string.IsNullOrEmpty(arr[1].ToString()))
-                        {                          
-                            throw new Exception(string.Format("该任务[{0}]为任务组任务,不可取消", task_no));
+                        {
+                            var result1 = MessageUtil.ShowYesNoAndWarning(string.Format("该任务[{0}]为任务组任务,确定要取消吗(请谨慎操作)?", task_no));
+                            if (result1 == DialogResult.Yes)
+                            {
+                                foreach (var item in arr)
+                                {
+                                    if (db.Updateable<WCS_TASK>()
+                                          .UpdateColumns(it => new WCS_TASK
+                                          {
+                                                STATUS = WCS.Entity.TaskStatus.已取消,
+                                                UPDATETIME = DateTime.Now
+                                          })
+                                          .Where(v => v.WMSTASK.ToString() == item).ExecuteCommand() < 0)
+                                    {
+                                             string message = "任务" + item + "取消失败";
+                                             MessageBox.Show(message, "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
+                                    }
+                                }
+                            }
                         }      
                     }
                     else if (task.STATUS < WCS.Entity.TaskStatus.已完成)

Некоторые файлы не были показаны из-за большого количества измененных файлов