xu.lu пре 3 година
родитељ
комит
a95d44fe8b

+ 8 - 8
WCS_Client/Frm/FrmMain.Designer.cs

@@ -64,13 +64,13 @@
             this.Btn_Calc});
             this.Bar_ToolBar.ItemSpacing = 2;
             this.Bar_ToolBar.Location = new System.Drawing.Point(0, 24);
-            this.Bar_ToolBar.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.Bar_ToolBar.Margin = new System.Windows.Forms.Padding(4);
             this.Bar_ToolBar.Name = "Bar_ToolBar";
             this.Bar_ToolBar.PaddingBottom = 0;
             this.Bar_ToolBar.PaddingLeft = 0;
             this.Bar_ToolBar.PaddingRight = 0;
             this.Bar_ToolBar.PaddingTop = 0;
-            this.Bar_ToolBar.Size = new System.Drawing.Size(1088, 51);
+            this.Bar_ToolBar.Size = new System.Drawing.Size(1088, 47);
             this.Bar_ToolBar.Stretch = true;
             this.Bar_ToolBar.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
             this.Bar_ToolBar.TabIndex = 32;
@@ -136,7 +136,7 @@
             this.Bar_Menu.IsMaximized = false;
             this.Bar_Menu.ItemSpacing = 2;
             this.Bar_Menu.Location = new System.Drawing.Point(0, 0);
-            this.Bar_Menu.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.Bar_Menu.Margin = new System.Windows.Forms.Padding(4);
             this.Bar_Menu.MenuBar = true;
             this.Bar_Menu.Name = "Bar_Menu";
             this.Bar_Menu.PaddingBottom = 0;
@@ -163,14 +163,14 @@
             this.Btn_LoginUserTime,
             this.Btn_Copyrignt});
             this.Bar_Status.ItemSpacing = 2;
-            this.Bar_Status.Location = new System.Drawing.Point(0, 399);
-            this.Bar_Status.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.Bar_Status.Location = new System.Drawing.Point(0, 400);
+            this.Bar_Status.Margin = new System.Windows.Forms.Padding(4);
             this.Bar_Status.Name = "Bar_Status";
             this.Bar_Status.PaddingBottom = 0;
             this.Bar_Status.PaddingLeft = 0;
             this.Bar_Status.PaddingRight = 0;
             this.Bar_Status.PaddingTop = 0;
-            this.Bar_Status.Size = new System.Drawing.Size(1088, 31);
+            this.Bar_Status.Size = new System.Drawing.Size(1088, 30);
             this.Bar_Status.Stretch = true;
             this.Bar_Status.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
             this.Bar_Status.TabIndex = 33;
@@ -217,7 +217,7 @@
             this.STab_Main.ControlBox.MenuBox,
             this.STab_Main.ControlBox.CloseBox});
             this.STab_Main.Location = new System.Drawing.Point(0, 81);
-            this.STab_Main.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.STab_Main.Margin = new System.Windows.Forms.Padding(4);
             this.STab_Main.Name = "STab_Main";
             this.STab_Main.ReorderTabsEnabled = true;
             this.STab_Main.SelectedTabFont = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold);
@@ -242,7 +242,7 @@
             this.Controls.Add(this.Bar_Status);
             this.Controls.Add(this.STab_Main);
             this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
-            this.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.Margin = new System.Windows.Forms.Padding(4);
             this.Name = "FrmMain";
             this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
             this.Text = "OPP库WCS仓储物流调度系统";

+ 1 - 1
WCS_Client/Frm/FrmMain.cs

@@ -123,7 +123,7 @@ namespace WCS_Client
                 ////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_Mont", "设备监控查看", typeof(Frm.Frm_YongGuanMontior), 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);

+ 121 - 0
WCS_Client/Frm/MBtn_AgvTask/FrmCMByWorkShop.Designer.cs

@@ -0,0 +1,121 @@
+namespace WCS_Client.Frm
+{
+    partial class FrmCMByWorkShop
+    {
+        /// <summary>
+        /// Required designer variable.
+        /// </summary>
+        private System.ComponentModel.IContainer components = null;
+
+        /// <summary>
+        /// Clean up any resources being used.
+        /// </summary>
+        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+        protected override void Dispose(bool disposing)
+        {
+            if (disposing && (components != null))
+            {
+                components.Dispose();
+            }
+            base.Dispose(disposing);
+        }
+
+        #region Windows Form Designer generated code
+
+        /// <summary>
+        /// Required method for Designer support - do not modify
+        /// the contents of this method with the code editor.
+        /// </summary>
+        private void InitializeComponent()
+        {
+            this.lblWorkShopNO = new System.Windows.Forms.Label();
+            this.lblProLine = new System.Windows.Forms.Label();
+            this.cmbWorkShopNO = new System.Windows.Forms.ComboBox();
+            this.cmbProLine = new System.Windows.Forms.ComboBox();
+            this.btnSave = new System.Windows.Forms.Button();
+            this.btnCancel = new System.Windows.Forms.Button();
+            this.SuspendLayout();
+            // 
+            // lblWorkShopNO
+            // 
+            this.lblWorkShopNO.AutoSize = true;
+            this.lblWorkShopNO.Location = new System.Drawing.Point(82, 49);
+            this.lblWorkShopNO.Name = "lblWorkShopNO";
+            this.lblWorkShopNO.Size = new System.Drawing.Size(82, 15);
+            this.lblWorkShopNO.TabIndex = 0;
+            this.lblWorkShopNO.Text = "车间编号:";
+            // 
+            // lblProLine
+            // 
+            this.lblProLine.AutoSize = true;
+            this.lblProLine.Location = new System.Drawing.Point(82, 108);
+            this.lblProLine.Name = "lblProLine";
+            this.lblProLine.Size = new System.Drawing.Size(52, 15);
+            this.lblProLine.TabIndex = 1;
+            this.lblProLine.Text = "生产线";
+            // 
+            // cmbWorkShopNO
+            // 
+            this.cmbWorkShopNO.FormattingEnabled = true;
+            this.cmbWorkShopNO.Location = new System.Drawing.Point(167, 46);
+            this.cmbWorkShopNO.Name = "cmbWorkShopNO";
+            this.cmbWorkShopNO.Size = new System.Drawing.Size(202, 23);
+            this.cmbWorkShopNO.TabIndex = 2;
+            // 
+            // cmbProLine
+            // 
+            this.cmbProLine.FormattingEnabled = true;
+            this.cmbProLine.Location = new System.Drawing.Point(167, 105);
+            this.cmbProLine.Name = "cmbProLine";
+            this.cmbProLine.Size = new System.Drawing.Size(202, 23);
+            this.cmbProLine.TabIndex = 3;
+            this.cmbProLine.DropDown += new System.EventHandler(this.cmbProLine_DropDown);
+            // 
+            // btnSave
+            // 
+            this.btnSave.Location = new System.Drawing.Point(167, 185);
+            this.btnSave.Name = "btnSave";
+            this.btnSave.Size = new System.Drawing.Size(75, 23);
+            this.btnSave.TabIndex = 4;
+            this.btnSave.Text = "保存";
+            this.btnSave.UseVisualStyleBackColor = true;
+            this.btnSave.Click += new System.EventHandler(this.btnSave_Click);
+            // 
+            // btnCancel
+            // 
+            this.btnCancel.Location = new System.Drawing.Point(294, 185);
+            this.btnCancel.Name = "btnCancel";
+            this.btnCancel.Size = new System.Drawing.Size(75, 23);
+            this.btnCancel.TabIndex = 5;
+            this.btnCancel.Text = "取消";
+            this.btnCancel.UseVisualStyleBackColor = true;
+            this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
+            // 
+            // FrmCMByWorkShop
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.ClientSize = new System.Drawing.Size(522, 266);
+            this.Controls.Add(this.btnCancel);
+            this.Controls.Add(this.btnSave);
+            this.Controls.Add(this.cmbProLine);
+            this.Controls.Add(this.cmbWorkShopNO);
+            this.Controls.Add(this.lblProLine);
+            this.Controls.Add(this.lblWorkShopNO);
+            this.Name = "FrmCMByWorkShop";
+            this.Text = "FrmCMByWorkShop";
+            this.ResumeLayout(false);
+            this.PerformLayout();
+
+        }
+
+        #endregion
+
+        private System.Windows.Forms.Label lblWorkShopNO;
+        private System.Windows.Forms.Label lblProLine;
+        private System.Windows.Forms.ComboBox cmbWorkShopNO;
+        private System.Windows.Forms.ComboBox cmbProLine;
+        private System.Windows.Forms.Button btnSave;
+        private System.Windows.Forms.Button btnCancel;
+    }
+}

+ 53 - 0
WCS_Client/Frm/MBtn_AgvTask/FrmCMByWorkShop.cs

@@ -0,0 +1,53 @@
+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;
+
+namespace WCS_Client.Frm
+{
+    public partial class FrmCMByWorkShop : Form
+    {
+        public FrmCMByWorkShop()
+        {
+            InitializeComponent();
+        }
+
+        private void btnSave_Click(object sender, EventArgs e)
+        {
+            if (cmbWorkShopNO.Text == "" || cmbProLine.Text == "")
+            {
+                MessageUtil.ShowTips("车间编号和生产线不能为空!");
+                return;
+            }
+            string msg = BaseWorkflow.CMByWorkShop(cmbWorkShopNO.Text, cmbProLine.Text);
+            MessageUtil.ShowTips(msg);
+            this.Close();
+        }
+
+        private void btnCancel_Click(object sender, EventArgs e)
+        {
+            this.Close();
+        }
+
+        private void cmbProLine_DropDown(object sender, EventArgs e)
+        {
+            cmbWorkShopNO.Items.Clear();
+            TryCachHelper.TryExecute((db) =>
+            {
+                if (cmbWorkShopNO.Text == "1")
+                {
+                    cmbProLine.Items.Add("Mw_1_A");
+                    cmbProLine.Items.Add("Mw_1_B");
+                    cmbProLine.Items.Add("Mw_1_C");               
+                }
+               
+            });
+        }
+    }
+}

+ 120 - 0
WCS_Client/Frm/MBtn_AgvTask/FrmCMByWorkShop.resx

@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+</root>

+ 25 - 3
WCS_Client/Frm/MBtn_AgvTask/MBtn_AgvTask.cs

@@ -96,6 +96,10 @@ namespace WCS_Client.Frm
             {
                 LCIList.Add(LCItemUtil.Add_ButtonX("btn_CancelAgvTask", "AGV任务取消", 100, 30, SubmitMethods));
                 LCIList.Add(LCItemUtil.Add_ButtonX("btn_FinishAgvTask", "AGV任务完成", 100, 30, SubmitMethods));
+
+                //LCIList.Add(LCItemUtil.Add_ButtonX("btn_CancelAgvTask_F", "允许放货", 100, 30, SubmitMethods));
+                //LCIList.Add(LCItemUtil.Add_ButtonX("btn_CancelAgvTask_F", "允许放货", 100, 30, SubmitMethods));
+                //LCIList.Add(LCItemUtil.Add_ButtonX("btn_CMBYWorkShop", "车间叫料", 100, 30, SubmitMethods));
             }
             uC_QueryPage1.Init_QueryPage(60, true, true, "", GCList, LCIList, QueryPageDataMethods, RefreshRoleMethods, DoubleClikMethod, null, null);
             uC_QueryPage1.ClearLCItemValue();
@@ -110,7 +114,7 @@ namespace WCS_Client.Frm
             string _SQLText = @"SELECT a.*,b.MEP_MAPPINGCHNAME AgvTaskTypeCh,c.MEP_MAPPINGCHNAME StatusCh,d.MEP_MAPPINGCHNAME AgvStatusCh  FROM dbo.WCS_AGVTask a
                                 left join dbo.WCS_MAPPINGENTRY b on a.TaskType=b.MEP_MAPPINGNO and b.MEP_MAPPINGTYPE='TaskType'
                                 left join dbo.WCS_MAPPINGENTRY c on a.Status=c.MEP_MAPPINGNO and c.MEP_MAPPINGTYPE='AGVStatus'
-                                left join dbo.WCS_MAPPINGENTRY d on a.AGVStatus=d.MEP_MAPPINGNO and d.MEP_MAPPINGTYPE='AGVStatus' Where 1=1 and Status < 100 ";
+                                left join dbo.WCS_MAPPINGENTRY d on a.AGVStatus=d.MEP_MAPPINGNO and d.MEP_MAPPINGTYPE='AGVStatus' Where 1=1 and Status < (case when b.MEP_MAPPINGCHNAME='入库'  then 100 else 99 end) ";
             string _Orderby = "a.CreateTime desc";
 
             PageData pd = BaseWorkflow.QueryPageData(_SQLText, _Orderby, uC_QueryPage1.GetQueryWhere(), PageIndex, PageSize);
@@ -119,10 +123,12 @@ namespace WCS_Client.Frm
 
         private void SubmitMethods(string LCName)
         {
+            //查询
             if (LCName == "btn_QDB")
             {
                 uC_QueryPage1.RefreshData();
             }
+            //清除
             else if (LCName == "btn_QClear")
             {
                 uC_QueryPage1.ShowOpaqueLayer();
@@ -161,6 +167,7 @@ namespace WCS_Client.Frm
                     uC_QueryPage1.RefreshData(1, 0);
                 }
             }
+            //取消任务
             else if (LCName == "btn_CancelAgvTask")
             {
                 DataTable dt = this.uC_QueryPage1.SCGrid_GetChkRows();
@@ -191,6 +198,7 @@ namespace WCS_Client.Frm
                     uC_QueryPage1.RefreshData(1, 0);
                 }
             }
+            //完成任务
             else if (LCName == "btn_FinishAgvTask")
             {
                 DataTable dt = this.uC_QueryPage1.SCGrid_GetChkRows();
@@ -206,8 +214,16 @@ namespace WCS_Client.Frm
                     string msg = TryCachHelper.TryExecute((db) =>
                     {
                         var agvtask = db.Queryable<WCS_AGVTask>().First(v => v.ID == id);
-                        agvtask.Status = AGVTaskStatus.完成扫码;
-                        agvtask.AGVStatus = AGVTaskStatus.完成扫码;
+                        if (agvtask.TaskType == AGVTaskType.入库)
+                        {
+                            agvtask.Status = AGVTaskStatus.完成扫码;
+                            agvtask.AGVStatus = AGVTaskStatus.完成扫码;
+                        }
+                        else
+                        {
+                            agvtask.Status = AGVTaskStatus.完成;
+                            agvtask.AGVStatus = AGVTaskStatus.完成;
+                        }                        
                         agvtask.UpdateTime = DateTime.Now;
                         db.Updateable(agvtask).UpdateColumns(it => new { it.Status, it.AGVStatus, it.UpdateTime }).ExecuteCommand();
                     });
@@ -217,6 +233,12 @@ namespace WCS_Client.Frm
                     uC_QueryPage1.RefreshData(1, 0);
                 }
             }
+            else if (LCName == "btn_CMBYWorkShop")
+            {
+                var frmCMByWorkShop = new FrmCMByWorkShop();
+                frmCMByWorkShop.ShowDialog();
+                uC_QueryPage1.RefreshData(1, 0);
+            }
         }
 
         private void DoubleClikMethod(DataRow dr)

+ 9 - 0
WCS_Client/WCS_Client.csproj

@@ -246,6 +246,12 @@
     <Compile Include="Frm\MBtn_AgvTask\FrmAgvCachePostionInfo.Designer.cs">
       <DependentUpon>FrmAgvCachePostionInfo.cs</DependentUpon>
     </Compile>
+    <Compile Include="Frm\MBtn_AgvTask\FrmCMByWorkShop.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="Frm\MBtn_AgvTask\FrmCMByWorkShop.Designer.cs">
+      <DependentUpon>FrmCMByWorkShop.cs</DependentUpon>
+    </Compile>
     <Compile Include="Frm\MBtn_AgvTask\MBtn_AgvTask.cs">
       <SubType>Form</SubType>
     </Compile>
@@ -786,6 +792,9 @@
     <EmbeddedResource Include="Frm\MBtn_AgvTask\FrmAgvCachePostionInfo.resx">
       <DependentUpon>FrmAgvCachePostionInfo.cs</DependentUpon>
     </EmbeddedResource>
+    <EmbeddedResource Include="Frm\MBtn_AgvTask\FrmCMByWorkShop.resx">
+      <DependentUpon>FrmCMByWorkShop.cs</DependentUpon>
+    </EmbeddedResource>
     <EmbeddedResource Include="Frm\MBtn_AgvTask\MBtn_AgvTask.resx">
       <DependentUpon>MBtn_AgvTask.cs</DependentUpon>
     </EmbeddedResource>

+ 36 - 0
WCS_Client/Workflow/BaseWorkflow.cs

@@ -958,5 +958,41 @@ namespace WCS_Client
             }
             return result;
         }
+
+        public static string CMByWorkShop(string txtcbworkshopno, string txtcbprolineno)
+        {
+            string result = TryCachHelper.TryTranExecute((db) =>
+            {
+                //创建AGV任务
+                var agvtask = new Frm.WCS_AGVTask()
+                {
+                    AGVStatus = Frm.AGVTaskStatus.新建,
+                    Status = Frm.AGVTaskStatus.新建,
+                    Position = txtcbprolineno,
+                    TaskType = Frm.AGVTaskType.叫料,
+                    CreateTime = DateTime.Now,
+                    UpdateTime = DateTime.Now,
+                    Workshop = int.Parse(txtcbworkshopno) == 13 || int.Parse(txtcbworkshopno) == 14 ? 1314 : int.Parse(txtcbworkshopno),
+                };
+                if (agvtask.Workshop == 1)
+                    agvtask.Station = "2122";
+                else if (agvtask.Workshop == 2)
+                    agvtask.Station = "2131";
+                else if (agvtask.Workshop == 3)
+                    agvtask.Station = "2143 ";
+                else if (agvtask.Workshop == 1314)
+                    agvtask.Station = "2086";
+                int task_id = db.Insertable(agvtask).ExecuteReturnIdentity();
+                if (task_id <= 0)
+                {
+                    throw new Exception(string.Format("WCS任务[{0}]添加agv任务失败", task_id));
+                }
+            });
+            if (string.IsNullOrWhiteSpace(result))
+            {
+                result = string.Format("车间叫料成功!");
+            }
+            return result;
+        }
     }
 }