林豪 左 3 жил өмнө
parent
commit
d451a8a9cb

+ 29 - 31
WCS_Client/Frm/FrmMain.cs

@@ -1,19 +1,14 @@
 using DevComponents.DotNetBar;
+using FreeRedis;
+using MessagePack;
+using MessagePack.Resolvers;
 using System;
 using System.Collections.Generic;
-using System.ComponentModel;
-using System.Data;
-using System.Drawing;
-using System.Linq;
-using FreeRedis;
 using System.Runtime.InteropServices;
-using System.Text;
 using System.Windows.Forms;
 using WCS_Client.Frm;
 using WCS_Client.UC;
 using WCS_Client.Utility;
-using MessagePack;
-using MessagePack.Resolvers;
 
 namespace WCS_Client
 {
@@ -24,8 +19,8 @@ namespace WCS_Client
             InitializeComponent();
             InitFrm();
             WCS_Client.Frm.Current.InitData("wcs_pvc");
-
         }
+
         private void InitFrm()
         {
             #region 初始化任务栏
@@ -39,21 +34,27 @@ namespace WCS_Client
                     case DayOfWeek.Sunday:
                         sX = "日";
                         break;
+
                     case DayOfWeek.Monday:
                         sX = "一";
                         break;
+
                     case DayOfWeek.Tuesday:
                         sX = "二";
                         break;
+
                     case DayOfWeek.Wednesday:
                         sX = "三";
                         break;
+
                     case DayOfWeek.Thursday:
                         sX = "四";
                         break;
+
                     case DayOfWeek.Friday:
                         sX = "五";
                         break;
+
                     case DayOfWeek.Saturday:
                         sX = "六";
                         break;
@@ -61,12 +62,12 @@ namespace WCS_Client
             }
             catch
             {
-
             }
             Btn_LoginUserTime.Text = string.Format("【{0}】【{1}】【{2}】【星期{3}】", CurrentHelper.User.Use_Name, CurrentHelper.User.Use_RoleName, CurrentHelper.User.Use_LoginTime, sX);
             Btn_Copyrignt.Text = "苏州博众精工科技有限公司版权所有";
 
-            #endregion
+            #endregion 初始化任务栏
+
             RefreshMenu();
             SetMdiForm("系统主页", "系统主页", typeof(FrmHome), false);
 
@@ -86,8 +87,8 @@ namespace WCS_Client
                 };
                 eqpData.init(Redis);
             }
-
         }
+
         private void RefreshMenu()
         {
             try
@@ -100,7 +101,7 @@ namespace WCS_Client
                 }
                 AddMenu("", "MBtn_Task", "任务管理", null, null);
                 AddMenu("", "MBtn_Monitor", "设备监控", null, null);
-                // AddMenu("", "MBtn_Sys", "系统管理", null, null);
+                AddMenu("", "MBtn_Sys", "系统管理", null, null);
                 AddMenu("", "MBtn_Help", "系统帮助", null, null);
 
                 //MBtn_File
@@ -113,7 +114,6 @@ namespace WCS_Client
                 if (CurrentHelper.User.Use_RoleId == 1)
                 {
                     AddMenu("MBtn_User", "MBtn_User_User", "用户管理", typeof(Frm.FrmUser), Btn_Click);
-                    //AddMenu("MBtn_User", "MBtn_User_RoleUser", "用户权限", null, null);
                 }
                 //MBtn_Task
                 AddMenu("MBtn_Task", "MBtn_CurrentTask", "当前任务管理", typeof(Frm.FrmWCS_Task), Btn_Click);
@@ -121,17 +121,13 @@ namespace WCS_Client
                 AddMenu("MBtn_Task", "MBtn_AgvTask", "Agv任务查询", typeof(Frm.MBtn_AgvTask), Btn_Click);
                 AddMenu("MBtn_Task", "MBtn_AgvTask_Dis", "Agv历史任务查询", typeof(Frm.MBtn_AgvTaskDis.MBtn_AgvTask_Dis), Btn_Click);
                 ////MBtn_Monitor
-                //AddMenu("MBtn_Monitor", "MBtn_SCANN", "扫码信息查询", typeof(Frm.MBtn_SCANN), Btn_Click);
-                //AddMenu("MBtn_Monitor", "MBtn_EQUMsg", "设备信号查询", typeof(Frm.FrmEquMsg), Btn_Click);
-                //AddMenu("MBtn_Monitor", "MBtn_ALARAMRE", "历史报警记录", typeof(Frm.Frm_ALARAMRE), Btn_Click);
-                //AddMenu("MBtn_Monitor", "MBtn_ALARAMERStatistics", "历史报警记录统计", typeof(Frm.Frm_ALARAMERStatistics), Btn_Click);
+                AddMenu("MBtn_Monitor", "MBtn_SCANN", "扫码信息查询", typeof(Frm.MBtn_SCANN), Btn_Click);
+
                 AddMenu("MBtn_Monitor", "MBtn_Mont", "设备监控查看", typeof(Frm.Frm_YongGuanMontior), Btn_Click);
 
                 //MBtn_Sys
-                //AddMenu("MBtn_Sys", "MBtn_Interface_OPOrder", "日志管理", typeof(Frm.FrmLog), Btn_Click);
-                //AddMenu("MBtn_Sys", "MBtn_Interface_OPUP", "系统设置", typeof(Frm.MBtn_Sys.FormSet), Btn_Click);
-                //AddMenu("MBtn_Sys", "MBtn_Interface_SrmInfoSet", "堆垛机出入口配置", typeof(Frm.FrmSrmInfoSet), Btn_Click);
-                //AddMenu("MBtn_Sys", "FrmPalletizingCode", "机械人码垛配置", typeof(Frm.FrmPalletizingCode), Btn_Click);
+                AddMenu("MBtn_Sys", "MBtn_Interface_OPOrder", "日志管理", typeof(Frm.FrmLog), Btn_Click);
+                AddMenu("MBtn_Sys", "MBtn_Interface_OPUP", "系统设置", typeof(Frm.MBtn_Sys.FormSet), Btn_Click);
             }
             catch (Exception ex)
             {
@@ -140,7 +136,8 @@ namespace WCS_Client
             }
         }
 
-        List<ButtonItem> mbtn = new List<ButtonItem>();
+        private List<ButtonItem> mbtn = new List<ButtonItem>();
+
         private void AddMenu(string PBtnName, string BtnName, string DisplayText, Type t, System.EventHandler BtnItem_Click)
         {
             ButtonItem BtnItem = mbtn.Find(a => a.Name == BtnName);
@@ -191,8 +188,9 @@ namespace WCS_Client
                 Proc = null;
             }
 
-            #endregion
+            #endregion [ 启动计算器 ]
         }
+
         #region [ API: 记事本 ]
 
         /// <summary>
@@ -222,7 +220,8 @@ namespace WCS_Client
         /// </summary>
         public const uint WM_SETTEXT = 0x000C;
 
-        #endregion
+        #endregion [ API: 记事本 ]
+
         private void Btn_Book_Click(object sender, EventArgs e)
         {
             #region [ 启动记事本 ]
@@ -245,7 +244,7 @@ namespace WCS_Client
                 Proc = null;
             }
 
-            #endregion
+            #endregion [ 启动记事本 ]
 
             #region [ 传递数据给记事本 ]
 
@@ -263,7 +262,7 @@ namespace WCS_Client
                 SendMessage(vHandle, WM_SETTEXT, 0, "");
             }
 
-            #endregion
+            #endregion [ 传递数据给记事本 ]
         }
 
         private void Btn_SysReset_Click(object sender, EventArgs e)
@@ -276,6 +275,7 @@ namespace WCS_Client
         {
             Application.Exit();
         }
+
         private void Btn_Click(object sender, EventArgs e)
         {
             ButtonItem BtnItem = sender as ButtonItem;
@@ -289,8 +289,8 @@ namespace WCS_Client
                 return;
             }
             SetMdiForm(BtnItem.Name, BtnItem.Text, t, true);
-
         }
+
         public void SetMdiForm(string TabName, string TabText, Type formType, bool CloseButtonVisible)
         {
             bool IsOpened = false;
@@ -322,9 +322,7 @@ namespace WCS_Client
                 STab_Main.SelectedTab = tabItem;
                 tabItem.CloseButtonVisible = CloseButtonVisible;
                 form.Dock = DockStyle.Fill;
-
             }
-
         }
     }
-}
+}

+ 11 - 31
WCS_Client/Frm/MBtn_AgvTask/MBtn_SCANN.cs

@@ -1,13 +1,7 @@
 using DevComponents.DotNetBar.Layout;
 using DevComponents.DotNetBar.SuperGrid;
-using System;
 using System.Collections.Generic;
-using System.ComponentModel;
 using System.Data;
-using System.Drawing;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
 using System.Windows.Forms;
 using WCS_Client.UC;
 using WCS_Client.Utility;
@@ -21,18 +15,14 @@ namespace WCS_Client.Frm
             InitializeComponent();
             InitFrm();
         }
+
         private void InitFrm()
         {
             List<GridColumn> GCList = new List<GridColumn>()
             {
-                SuperGridUtil.Get_GridColumn("SCANN_STATIONNO", "扫码输送线", 100),
-                SuperGridUtil.Get_GridColumn("SCANN_BARCODE", "当前扫码信息", 200),
-                SuperGridUtil.Get_GridColumn("SCANN_SEQUENCE", "顺序", 80),
-                SuperGridUtil.Get_GridColumn("SCANN_PLCNAME", "所属PLC", 80),
-                SuperGridUtil.Get_GridColumn("SCANN_STARTADDRESS", "扫码起点索引", 120),
-                SuperGridUtil.Get_GridColumn("SCANN_LENGTH", "扫码长度", 100),
-                //SuperGridUtil.Get_GridColumn("SCANN_VALIDTIMEINTERVAL", "扫码有效时长", 140),
-                SuperGridUtil.Get_GridColumn("SCANN_UPDATETIME", "扫码时间", 150)
+                SuperGridUtil.Get_GridColumn("DEVICECODE", "扫码输送线", 100),
+                SuperGridUtil.Get_GridColumn("CONTENT", "结果", 200),
+                SuperGridUtil.Get_GridColumn("UPDATETIME", "扫码时间", 150)
             };
             List<LayoutControlItem> LCIList = new List<LayoutControlItem>();
 
@@ -45,24 +35,16 @@ namespace WCS_Client.Frm
                 uC_QueryPage1.RefreshData(1, 0);
             }, null);
         }
+
         private PageData QueryPageDataMethods(int PageIndex, int PageSize)
         {
-            string _SQLText = @"SELECT TOP 1000 [SCANN_ID]
-      ,[SCANN_STATIONNO]
-      ,[SCANN_BARCODE]
-      ,[SCANN_SEQUENCE]
-      ,[SCANN_PLCNAME]
-      ,[SCANN_STARTADDRESS]
-      ,[SCANN_LENGTH]
-      ,[SCANN_DB_ID]
-      ,[SCANN_VALIDTIMEINTERVAL]
-      ,[SCANN_UPDATETIME]
-  FROM [YONGGUAN_WCS].[dbo].[WCS_SCANN] ";
-            string _Orderby = "SCANN_ID asc";
+            string _SQLText = @"SELECT [DEVICECODE],[CONTENT],[UPDATETIME] FROM [dbo].[WCS_BCR80] where CONTENT != ' ' ";
+            string _Orderby = "UPDATETIME desc ";
 
             PageData pd = BaseWorkflow.QueryPageData(_SQLText, _Orderby, uC_QueryPage1.GetQueryWhere(), PageIndex, PageSize);
             return pd;
         }
+
         private void SubmitMethods(string LCName)
         {
             if (LCName == "btn_QDB")
@@ -70,15 +52,13 @@ namespace WCS_Client.Frm
                 uC_QueryPage1.RefreshData();
             }
         }
+
         private void DoubleClikMethod(DataRow dr)
         {
-            //wcs_task_no = Convert.ToInt32(dr["TASK_NO"].ToString());
-            //FrmWCS_TaskDIS_DTL Frm = new FrmWCS_TaskDIS_DTL(wcs_task_no);
-            //Frm.Show();
         }
+
         private void RefreshRoleMethods(bool ChkValue)
         {
-
         }
     }
-}
+}

+ 16 - 18
WCS_Client/Frm/MBtn_Log/FrmLog.cs

@@ -26,25 +26,25 @@ namespace WCS_Client.Frm
             List<GridColumn> GCList = new List<GridColumn>()
             {
                 //SuperGridUtil.Get_GridColumn("LOG_WCSSYSTEM", "WCS系统", 80),
-                SuperGridUtil.Get_GridColumn("Log_Level", "消息等级", 80),
-                SuperGridUtil.Get_GridColumn("Log_Func", "消息函数", 150),
+                //SuperGridUtil.Get_GridColumn("Log_Level", "消息等级", 80),
+                //SuperGridUtil.Get_GridColumn("Log_Func", "消息函数", 150),
                 //SuperGridUtil.Get_GridColumn("Log_IPAdderss", "IP地址", 80),
-                SuperGridUtil.Get_GridColumn("Log_Info", "消息", 500),
-                SuperGridUtil.Get_GridColumn("Log_InfoDtl", "消息详情", 500),
-                SuperGridUtil.Get_GridColumn("Log_AddUserName", "创建用户", 80),
-                SuperGridUtil.Get_Datetime_GridColumn("Log_AddDateTime", "创建时间", 130),
-                SuperGridUtil.Get_GridColumn("Log_EditUserName", "修改用户", 80),
-                SuperGridUtil.Get_Datetime_GridColumn("Log_EditDateTime", "修改时间", 130)
+                SuperGridUtil.Get_GridColumn("MSG", "消息", 500),
+                //SuperGridUtil.Get_GridColumn("Log_InfoDtl", "消息详情", 500),
+                //SuperGridUtil.Get_GridColumn("Log_AddUserName", "创建用户", 80),
+                SuperGridUtil.Get_Datetime_GridColumn("STARTTIME", "创建时间", 130),
+                SuperGridUtil.Get_GridColumn("UPDATETIME", "结束时间", 80),
+                SuperGridUtil.Get_Datetime_GridColumn("TIMES", "次数", 130)
             };
             List<LayoutControlItem> LCIList = new List<LayoutControlItem>();
-            LCIList.Add(LCItemUtil.Add_TextboxX("Log_Level", "消息等级:", 20, SubmitMethods, null));
-            LCIList[LCIList.Count - 1].Tag = new LCWhereInfo() { QWhereText = "Log_Level like '%{0}%'" };
+            //LCIList.Add(LCItemUtil.Add_TextboxX("Log_Level", "消息等级:", 20, SubmitMethods, null));
+            //LCIList[LCIList.Count - 1].Tag = new LCWhereInfo() { QWhereText = "Log_Level like '%{0}%'" };
 
-            LCIList.Add(LCItemUtil.Add_TextboxX("Log_Func", "消息函数:", 20, SubmitMethods, null));
-            LCIList[LCIList.Count - 1].Tag = new LCWhereInfo() { QWhereText = "Log_Func like '%{0}%'" };
+            //LCIList.Add(LCItemUtil.Add_TextboxX("Log_Func", "消息函数:", 20, SubmitMethods, null));
+            //LCIList[LCIList.Count - 1].Tag = new LCWhereInfo() { QWhereText = "Log_Func like '%{0}%'" };
 
-            LCIList.Add(LCItemUtil.Add_TextboxX("Log_Info", "消息:", 20, SubmitMethods, null));
-            LCIList[LCIList.Count - 1].Tag = new LCWhereInfo() { QWhereText = "Log_Info like '%{0}%'" };
+            LCIList.Add(LCItemUtil.Add_TextboxX("MSG", "消息:", 20, SubmitMethods, null));
+            LCIList[LCIList.Count - 1].Tag = new LCWhereInfo() { QWhereText = "MSG like '%{0}%'" };
 
             LCIList.Add(LCItemUtil.Add_ButtonX("btn_QDB", "查询", 80, 30, SubmitMethods));
             LCIList.Add(LCItemUtil.Add_ButtonX("btn_QClear", "重置", 80, 30, SubmitMethods));
@@ -58,10 +58,8 @@ namespace WCS_Client.Frm
         }
         private PageData QueryPageDataMethods(int PageIndex, int PageSize)
         {
-            string _SQLText = @"SELECT [Log_Id],[LOG_WCSSYSTEM],[Log_Level],[Log_Func],[Log_IPAdderss],[Log_Info],[Log_InfoDtl]
-      ,[Log_AddUserNo],[Log_AddUserName],[Log_AddDateTime],[Log_EditUserNo],[Log_EditUserName],[Log_EditDateTime],[Log_Notes]
-  FROM [dbo].[WCS_LOG] where 1=1 ";
-            string _Orderby = "Log_EditDateTime desc ";
+            string _SQLText = @"SELECT [MSG],[STARTTIME],[UPDATETIME],[TIMES] FROM [dbo].[WCS_EXCEPTION] where 1=1 ";
+            string _Orderby = "UPDATETIME desc ";
 
             PageData pd = BaseWorkflow.QueryPageData(_SQLText, _Orderby, uC_QueryPage1.GetQueryWhere(), PageIndex, PageSize);
             return pd;

+ 6 - 189
WCS_Client/Frm/MBtn_Sys/FormSet.cs

@@ -1,16 +1,9 @@
-using System;
-using System.Collections.Generic;
-using System.ComponentModel;
-using System.Data;
-using System.Drawing;
+using Newtonsoft.Json.Linq;
+using System;
 using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
 using System.Windows.Forms;
-using Newtonsoft.Json.Linq;
 using WCS.Data.Models;
 using WCS_Client.UC;
-using WCS_Client;
 using WCS_Client.Utility;
 
 namespace WCS_Client.Frm.MBtn_Sys
@@ -22,6 +15,7 @@ namespace WCS_Client.Frm.MBtn_Sys
             InitializeComponent();
             Init();
         }
+
         private void Init()
         {
             string result = TryCachHelper.TryExecute((db) =>
@@ -123,74 +117,13 @@ namespace WCS_Client.Frm.MBtn_Sys
                 }
             });
         }
+
         /// <summary>
         /// 获取入库任务
         /// </summary>
         /// <param name="param"></param>
         public void CreateInTask(GetInTaskParam param)
         {
-            //WCS_TASK wcstask = null;
-            //string result = TryCachHelper.TryExecute((db) => {
-            //    wcstask = db.Queryable<WCS_TASK>().First(v => v.TASK_BOXBARCODE == param.ContainerBarCode);
-            //    if (wcstask == null)
-            //    {
-            //        var reply = I_WCS_GetInTask(param);
-            //        if (reply.ResType)
-            //        {
-            //            //添加wcs任务
-            //            wcstask = new WCS_TASK();
-            //            wcstask.TASK_WMSNO = reply.WMSTaskNum;
-            //            wcstask.TASK_COMTYPE = reply.TaskType;
-            //            wcstask.TASK_SYSTYPE = "WMS";
-            //            wcstask.TASK_POSIDFROM = param.EquipmentNo;//起点地址
-            //            wcstask.TASK_POSIDCUR = param.EquipmentNo;
-            //            wcstask.TASK_POSIDNEXT = param.EquipmentNo;
-            //            wcstask.TASK_POSIDMOVE = "";
-            //            wcstask.TASK_PRIORITY = reply.Priority;
-            //            wcstask.TASK_WKSTATUS = 0;
-            //            wcstask.TASK_WHID = reply.WareHouseName;
-            //            wcstask.TASK_ADDUSERNO = "WMS";
-            //            wcstask.TASK_ADDDATETIME = DateTime.Now;
-            //            wcstask.TASK_EDITUSERNO = "WMS";
-            //            wcstask.TASK_EDITDATETIME = DateTime.Now;
-            //            wcstask.TASK_NOTES = "";
-            //            wcstask.TASK_RGVNO = "";
-            //            wcstask.TASK_BOXBARCODE = param.ContainerBarCode;
-            //            if (string.IsNullOrWhiteSpace(reply.TunnelNum))
-            //            {
-            //                wcstask.TASK_POSIDTO = reply.EndPostion;
-            //                wcstask.TASK_SRMNO = reply.EndPostion;
-            //            }
-            //            //else
-            //            //{
-            //            //    wcstask.TASK_EndTunnelNum = ConveyorHelper.AssignSrm(param.EquipmentNo, reply.TunnelNum);
-            //            //    wcstask.TASK_POSIDTO = wcstask.TASK_EndTunnelNum;
-            //            //    wcstask.TASK_SRMNO = wcstask.TASK_EndTunnelNum;
-            //            //}
-            //            int id = db.Insertable(wcstask).ExecuteReturnIdentity();
-            //            if (id <= 0)
-            //            {
-            //                throw new Exception(string.Format("WMS任务[{0}]添加WCS任务失败", reply.WMSTaskNum));
-            //            }
-            //            else
-            //            {
-            //                wcstask.TASK_NO = id;
-            //            }
-            //        }
-            //        else
-            //        {
-            //            throw new Exception(reply.ResMessage);
-            //        }
-            //    }
-            //});
-            //if (string.IsNullOrWhiteSpace(result))
-            //{
-            //    MessageBox.Show("添加空盘入库任务成功");
-            //}
-            //else
-            //{
-            //    MessageBox.Show("添加空盘入库任务失败.原因:[{0}]", result);
-            //}
         }
 
         public GetInTaskReply I_WCS_GetInTask(GetInTaskParam param)
@@ -198,18 +131,15 @@ namespace WCS_Client.Frm.MBtn_Sys
             GetInTaskReply reply = null;
             try
             {
-                //Log4netHelper.Logger_Info.Info(string.Format("开始:WCS调用WMS接口函数I_WCS_GetInTask。参数:[{0}]", WebApiHelper.GetJson(param)));
                 JArray ja = new JArray();
                 ja.Add(WebApiHelper.GetJson(param));
                 //调用MES接口
                 JObject jobj = WebApiHelper.SendInfoToWebAPI("http://192.168.16.2:8081/api/Task/I_WCS_GetInTask", "", "Post", ja);
                 reply = WebApiHelper.ParseFromJson<GetInTaskReply>(jobj.ToString());
-                //Log4netHelper.Logger_Info.Info(string.Format("结束:WCS调用WMS接口函数I_WCS_GetInTask。参数:[{0}]反馈结果:[{1}]", WebApiHelper.GetJson(param), WebApiHelper.GetJson(reply)));
             }
             catch (Exception ex)
             {
                 MessageBox.Show(ex.ToString());
-                //Log4netHelper.Logger_Error.ErrorFormat(ex.ToString());
             }
             return reply;
         }
@@ -349,123 +279,10 @@ namespace WCS_Client.Frm.MBtn_Sys
                     MessageUtil.ShowTips(string.Format("配置修改失败,原因[{0}]", result));
                 }
             }
-            else 
+            else
             {
                 MessageBox.Show("请悉知,该操作只有管理员权限才能进行更改!");
             }
         }
-
-        //private void btnCreateOutInTask_Click(object sender, EventArgs e)
-        //{
-        //    string barcode = string.Empty;
-        //    string loc_no = string.Empty;
-        //    string srmno = string.Empty;
-        //    string fromTunnelNum = string.Empty;
-        //    if (radioButton1.Checked)
-        //    {
-        //        loc_no = "AR-14-1-1-1";
-        //        barcode = "TPA00001";
-        //        srmno = "srm05";
-        //        fromTunnelNum = "6";
-        //    }
-        //    else if (radioButton2.Checked)
-        //    {
-        //        loc_no = "AR-12-1-1-1";
-        //        barcode = "TPA00005";
-        //        srmno = "srm04";
-        //        fromTunnelNum = "5";
-        //    }
-        //    if (radioButton3.Checked)
-        //    {
-        //        loc_no = "AR-15-1-1-1";
-        //        barcode = "TPA00006";
-        //        srmno = "srm05";
-        //        fromTunnelNum = "6";
-        //    }
-        //    else if (radioButton4.Checked)
-        //    {
-        //        loc_no = "AR-13-1-1-1";
-        //        barcode = "TPA00007";
-        //        srmno = "srm04";
-        //        fromTunnelNum = "5";
-        //    }
-        //    if (radioButton5.Checked)
-        //    {
-        //        loc_no = "AR-14-2-1-1";
-        //        barcode = "TPA00008";
-        //        srmno = "srm05";
-        //        fromTunnelNum = "6";
-        //    }
-        //    else if (radioButton6.Checked)
-        //    {
-        //        loc_no = "AR-15-2-1-1";
-        //        barcode = "TPA00009";
-        //        srmno = "srm05";
-        //        fromTunnelNum = "6";
-        //    }
-
-        //    if (string.IsNullOrWhiteSpace(barcode))
-        //    {
-        //        MessageUtil.ShowTips("请选择要生成环线任务的条码");
-        //        return;
-        //    }
-
-        //    WCS_TASK wcstask = null;
-        //    string result = TryCachHelper.TryExecute((db) =>
-        //    {
-
-        //        var task = db.Queryable<WCS_TASK>().First(v => v.TASK_BOXBARCODE == barcode);
-        //        if (task == null)
-        //        {
-        //            //添加wcs任务
-        //            wcstask = new WCS_TASK();
-        //            wcstask.TASK_WMSNO = barcode;
-        //            wcstask.TASK_COMTYPE = 2;
-        //            wcstask.TASK_SYSTYPE = "WMS";
-        //            wcstask.TASK_POSIDFROM = loc_no;
-        //            wcstask.TASK_POSIDCUR = loc_no;
-        //            wcstask.TASK_POSIDNEXT = loc_no;
-        //            wcstask.TASK_POSIDTO = "1117";
-        //            wcstask.TASK_POSIDMOVE = "";
-        //            wcstask.TASK_PRIORITY = 1;
-        //            wcstask.TASK_WKSTATUS = 0;
-        //            wcstask.TASK_WHID = "PVC原膜立库";
-        //            wcstask.TASK_SRMNO = srmno;
-        //            wcstask.TASK_ADDUSERNO = "WMS";
-        //            wcstask.TASK_ADDDATETIME = DateTime.Now;
-        //            wcstask.TASK_EDITUSERNO = "WMS";
-        //            wcstask.TASK_EDITDATETIME = DateTime.Now;
-        //            wcstask.TASK_NOTES = "";
-        //            wcstask.TASK_RGVNO = "";
-        //            wcstask.TASK_BOXBARCODE = barcode;
-        //            wcstask.TASK_FromTunnelNum = fromTunnelNum;
-        //            wcstask.TASK_ITEM2 = "2";
-        //            wcstask.TASK_ITEM3 = "1";
-
-        //            int id = db.Insertable(wcstask).ExecuteReturnIdentity();
-        //            if (id <= 0)
-        //            {
-        //                throw new Exception(string.Format("条码[{0}]添加WCS任务出库失败", barcode));
-        //            }
-        //            else
-        //            {
-        //                wcstask.TASK_NO = id;
-        //            }
-        //        }
-        //        else
-        //        {
-        //            throw new Exception(string.Format("条码[{0}]存在环线任务。", barcode));
-        //        }
-        //    });
-        //    if (string.IsNullOrWhiteSpace(result))
-        //    {
-        //        MessageUtil.ShowTips("添加环线任务成功");
-        //    }
-        //    else
-        //    {
-        //        MessageUtil.ShowError(string.Format("添加环线任务失败.原因:[{0}]", result));
-        //    }
-        //}
     }
-
-}
+}

+ 32 - 0
WCS_Client/Models/Enums.cs

@@ -0,0 +1,32 @@
+namespace WCS_Client.Models
+{
+    public enum TaskStatusType
+    {
+        重下堆垛机 = 1,
+        重下输送机 = 2,
+        重下RGV上料 = 3,
+        重下RGV下料 = 4,
+        重下任务 = 5
+    }
+
+    public enum WkStatus
+    {
+        未下发 = 0,
+        未执行 = 1,
+        输送机执行 = 2,
+        RGV上料执行 = 3,
+        RGV下料执行 = 4,
+        堆垛机执行 = 5,
+        完成任务 = 99,
+        取消任务 = 106,
+        手动过账 = 109
+    }
+
+    public enum TaskType
+    {
+        组盘 = 0,
+        入库 = 1,
+        出库 = 2,
+        输送 = 5,
+    }
+}

+ 17 - 0
WCS_Client/Models/WCS_EQUIPMENTLOCK.cs

@@ -0,0 +1,17 @@
+using SqlSugar;
+using System;
+
+namespace WCS_Client.Models
+{
+    public class WCS_EQUIPMENTLOCK
+    {
+        [SugarColumn(IsPrimaryKey = true, IsIdentity = false)]
+        public string EQUIPMENTNO { get; set; }
+
+        public bool ISLOCK { get; set; }
+        public DateTime UPDATETIME { get; set; }
+        public string ISENABLEI_IN { get; set; }
+        public string ISENABLE_OUT { get; set; }
+        public string EQUTYPE { get; set; }
+    }
+}

+ 47 - 0
WCS_Client/Models/WCS_SCANN.cs

@@ -0,0 +1,47 @@
+using SqlSugar;
+using System;
+
+namespace WCS_Client.Models
+{
+    public class WCS_SCANN
+    {
+        [SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
+        public string SCANN_ID { get; set; }
+
+        /// <summary>
+        /// 扫描位置编号
+        /// </summary>
+        public string SCANN_STATIONNO { get; set; }
+
+        /// <summary>
+        /// 扫描到的条码
+        /// </summary>
+        public string SCANN_BARCODE { get; set; }
+
+        /// <summary>
+        /// 顺序
+        /// </summary>
+        public int SCANN_SEQUENCE { get; set; }
+
+        /// <summary>
+        /// PLC名称
+        /// </summary>
+        public string SCANN_PLCNAME { get; set; }
+
+        /// <summary>
+        /// 起点地址
+        /// </summary>
+        public int SCANN_STARTADDRESS { get; set; }
+
+        /// <summary>
+        /// 扫描长度
+        /// </summary>
+        public int SCANN_LENGTH { get; set; }
+
+        public int SCANN_DB_ID { get; set; }
+        public int SCANN_VALIDTIMEINTERVAL { get; set; }
+
+        public DateTime SCANN_UPDATETIME { get; set; }
+        public DateTime SYSDATE { get; set; }
+    }
+}

+ 25 - 25
WCS_Client/Models/WCS_TASK.cs

@@ -2,8 +2,6 @@
 using System;
 using System.Collections.Generic;
 using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
 using static WCS_Client.Utility.CurrentHelper;
 
 namespace WCS_Client.Models
@@ -15,6 +13,7 @@ namespace WCS_Client.Models
         /// </summary>
         [SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
         public int TASK_NO { get; set; }
+
         /// <summary>
         /// WMS任务号
         /// </summary>
@@ -33,6 +32,7 @@ namespace WCS_Client.Models
                 return (ComTypeEnum)TASK_COMTYPE;
             }
         }
+
         public string TASK_SYSTYPE { get; set; }
         public string TASK_POSIDFROM { get; set; }
         public string TASK_POSIDCUR { get; set; }
@@ -48,53 +48,66 @@ namespace WCS_Client.Models
         public DateTime TASK_EDITDATETIME { get; set; }
         public string TASK_NOTES { get; set; }
         public string TASK_SRMNO { get; set; }
+
         /// <summary>
         /// rgv编号
         /// </summary>
         public string TASK_RGVNO { get; set; }
+
         public int TASK_ORDERTYPE { get; set; }
         public string TASK_BOXBARCODE { get; set; }
+
         /// <summary>
         /// 起始巷道号
         /// </summary>
         public string TASK_FromTunnelNum { get; set; }
+
         /// <summary>
         /// 目标巷道号
         /// </summary>
         public string TASK_EndTunnelNum { get; set; }
+
         /// <summary>
         /// 熟化类型(0=不需熟化、1=熟化房熟化、2=小烘房熟化)
         /// </summary>
         public int TASK_MatureType { get; set; }
+
         /// <summary>
         /// 熟化时间(小时:10,16)
         /// </summary>
         public decimal TASK_MatureDate { get; set; }
+
         /// <summary>
         /// 熟化温度(小数)
         /// </summary>
         public decimal TASK_MatureTemperat { get; set; }
+
         /// <summary>
         /// 进入熟化房时间
         /// </summary>
         public DateTime TASK_InMatureRoomDate { get; set; }
+
         /// <summary>
         /// 离开熟化房时间
         /// </summary>
         public DateTime TASK_OutMatureRoomDate { get; set; }
+
         /// <summary>
         /// 机械手:子托盘的尺寸编码
         /// </summary>
         public string PalletizingSonTraySize { get; set; }
+
         /// <summary>
         /// 机械手:码垛的箱子尺寸编码
         /// </summary>
         public string PalletizingBoxSize { get; set; }
+
         /// <summary>
         /// 预分配堆垛机出口输送线编号
         /// </summary>
         //public string TASK_SRMOUTCONVNO { get; set; }
         public string TASK_ITEM1 { get; set; }
+
         public string TASK_ITEM2 { get; set; }
         public string TASK_ITEM3 { get; set; }
         public string TASK_ITEM4 { get; set; }
@@ -113,6 +126,7 @@ namespace WCS_Client.Models
                 return TASK_POSIDFROM.Split('-').ToList();
             }
         }
+
         [SugarColumn(IsIgnore = true)]
         public int FromRow
         {
@@ -121,6 +135,7 @@ namespace WCS_Client.Models
                 return Convert.ToInt32(FromLocation[1]);
             }
         }
+
         [SugarColumn(IsIgnore = true)]
         public int FromCol
         {
@@ -129,6 +144,7 @@ namespace WCS_Client.Models
                 return Convert.ToInt32(FromLocation[2]);
             }
         }
+
         [SugarColumn(IsIgnore = true)]
         public int FromLayer
         {
@@ -137,6 +153,7 @@ namespace WCS_Client.Models
                 return Convert.ToInt32(FromLocation[3]);
             }
         }
+
         [SugarColumn(IsIgnore = true)]
         public int FromDepth
         {
@@ -145,6 +162,7 @@ namespace WCS_Client.Models
                 return Convert.ToInt32(FromLocation[4]);
             }
         }
+
         [SugarColumn(IsIgnore = true)]
         public int FromSingleDepthRow
         {
@@ -162,6 +180,7 @@ namespace WCS_Client.Models
                 return TASK_POSIDTO.Split('-').ToList();
             }
         }
+
         [SugarColumn(IsIgnore = true)]
         public int ToRow
         {
@@ -170,6 +189,7 @@ namespace WCS_Client.Models
                 return Convert.ToInt32(ToLocation[1]);
             }
         }
+
         [SugarColumn(IsIgnore = true)]
         public int ToCol
         {
@@ -178,6 +198,7 @@ namespace WCS_Client.Models
                 return Convert.ToInt32(ToLocation[2]);
             }
         }
+
         [SugarColumn(IsIgnore = true)]
         public int ToLayer
         {
@@ -186,6 +207,7 @@ namespace WCS_Client.Models
                 return Convert.ToInt32(ToLocation[3]);
             }
         }
+
         [SugarColumn(IsIgnore = true)]
         public int ToDepth
         {
@@ -195,26 +217,4 @@ namespace WCS_Client.Models
             }
         }
     }
-    public class WCS_TASK_DTL
-    {
-        [SugarColumn(IsPrimaryKey = true, IsIdentity = false)]
-        public string ID { get; set; }
-        public int PARENTID { get; set; }
-        public string TASKNO { get; set; }
-        public string POSIDCUR { get; set; }
-        public string POSIDNEXT { get; set; }
-        public string DESCRIPTION { get; set; }
-        public string NOTES { get; set; }
-        public DateTime EXECUTEDATE { get; set; }
-    }
-    public class WCS_EQUIPMENTLOCK
-    {
-        [SugarColumn(IsPrimaryKey = true, IsIdentity = false)]
-        public string EQUIPMENTNO { get; set; }
-        public bool ISLOCK { get; set; }
-        public DateTime UPDATETIME { get; set; }
-        public string ISENABLEI_IN { get; set; }
-        public string ISENABLE_OUT { get; set; }
-        public string EQUTYPE { get; set; }
-    }
-}
+}

+ 19 - 0
WCS_Client/Models/WCS_TASK_DTL.cs

@@ -0,0 +1,19 @@
+using SqlSugar;
+using System;
+
+namespace WCS_Client.Models
+{
+    public class WCS_TASK_DTL
+    {
+        [SugarColumn(IsPrimaryKey = true, IsIdentity = false)]
+        public string ID { get; set; }
+
+        public int PARENTID { get; set; }
+        public string TASKNO { get; set; }
+        public string POSIDCUR { get; set; }
+        public string POSIDNEXT { get; set; }
+        public string DESCRIPTION { get; set; }
+        public string NOTES { get; set; }
+        public DateTime EXECUTEDATE { get; set; }
+    }
+}

+ 5 - 0
WCS_Client/WCS_Client.csproj

@@ -541,10 +541,14 @@
       <DependentUpon>LocationPostion2.cs</DependentUpon>
     </Compile>
     <Compile Include="Extensions\DataTableExtensions.cs" />
+    <Compile Include="Models\Enums.cs" />
     <Compile Include="Models\WCS_EQUIPMENTINFO.cs" />
+    <Compile Include="Models\WCS_EQUIPMENTLOCK.cs" />
     <Compile Include="Models\WCS_PalletizingCode.cs" />
     <Compile Include="Models\WCS_RGVOutInInfo.cs" />
+    <Compile Include="Models\WCS_SCANN.cs" />
     <Compile Include="Models\WCS_SRMOUTININFO.cs" />
+    <Compile Include="Models\WCS_TASK_DTL.cs" />
     <Compile Include="UC\Control\LC_DropChkList.cs">
       <SubType>Component</SubType>
     </Compile>
@@ -750,6 +754,7 @@
     <Compile Include="Utility\TableNames.cs" />
     <Compile Include="Utility\TryCachHelper.cs" />
     <Compile Include="Workflow\BaseWorkflow.cs" />
+    <Compile Include="Workflow\TaskWorkflow.cs" />
     <EmbeddedResource Include="Frm\FrmHome.resx">
       <DependentUpon>FrmHome.cs</DependentUpon>
     </EmbeddedResource>

+ 0 - 72
WCS_Client/Workflow/BaseWorkflow.cs

@@ -12,36 +12,6 @@ using WCS_TASK = WCS_Client.Models.WCS_TASK;
 
 namespace WCS_Client
 {
-    public enum TaskStatusType
-    {
-        重下堆垛机 = 1,
-        重下输送机 = 2,
-        重下RGV上料 = 3,
-        重下RGV下料 = 4,
-        重下任务 = 5
-    }
-
-    public enum WkStatus
-    {
-        未下发 = 0,
-        未执行 = 1,
-        输送机执行 = 2,
-        RGV上料执行 = 3,
-        RGV下料执行 = 4,
-        堆垛机执行 = 5,
-        完成任务 = 99,
-        取消任务 = 106,
-        手动过账 = 109
-    }
-
-    public enum TaskType
-    {
-        组盘 = 0,
-        入库 = 1,
-        出库 = 2,
-        输送 = 5,
-    }
-
     public class BaseWorkflow
     {
         public static bool Login(string use_No, string use_Pwd, out string errMsg)
@@ -1251,46 +1221,4 @@ namespace WCS_Client
             return result;
         }
     }
-
-    public class WCS_SCANN
-    {
-        [SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
-        public string SCANN_ID { get; set; }
-
-        /// <summary>
-        /// 扫描位置编号
-        /// </summary>
-        public string SCANN_STATIONNO { get; set; }
-
-        /// <summary>
-        /// 扫描到的条码
-        /// </summary>
-        public string SCANN_BARCODE { get; set; }
-
-        /// <summary>
-        /// 顺序
-        /// </summary>
-        public int SCANN_SEQUENCE { get; set; }
-
-        /// <summary>
-        /// PLC名称
-        /// </summary>
-        public string SCANN_PLCNAME { get; set; }
-
-        /// <summary>
-        /// 起点地址
-        /// </summary>
-        public int SCANN_STARTADDRESS { get; set; }
-
-        /// <summary>
-        /// 扫描长度
-        /// </summary>
-        public int SCANN_LENGTH { get; set; }
-
-        public int SCANN_DB_ID { get; set; }
-        public int SCANN_VALIDTIMEINTERVAL { get; set; }
-
-        public DateTime SCANN_UPDATETIME { get; set; }
-        public DateTime SYSDATE { get; set; }
-    }
 }

+ 15 - 0
WCS_Client/Workflow/TaskWorkflow.cs

@@ -0,0 +1,15 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace WCS_Client.Workflow
+{
+    /// <summary>
+    /// 任务相关
+    /// </summary>
+    public class TaskWorkflow
+    {
+    }
+}