瀏覽代碼

百度特殊报表导出

callm 5 年之前
父節點
當前提交
505c99dc88

+ 112 - 0
UAS_MES_ODLF/FunctionCode/Query/Query_DateRate.Designer.cs

@@ -0,0 +1,112 @@
+namespace UAS_MES_NEW.Query
+{
+    partial class Query_DateRate
+    {
+        /// <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()
+        {
+            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Query_DateRate));
+            this.folderBrowserDialog1 = new System.Windows.Forms.FolderBrowserDialog();
+            this.BeginDate = new System.Windows.Forms.DateTimePicker();
+            this.EndDate = new System.Windows.Forms.DateTimePicker();
+            this.label3 = new System.Windows.Forms.Label();
+            this.Export = new UAS_MES_NEW.CustomControl.ButtonUtil.NormalButton();
+            this.SuspendLayout();
+            // 
+            // BeginDate
+            // 
+            this.BeginDate.Location = new System.Drawing.Point(325, 173);
+            this.BeginDate.Name = "BeginDate";
+            this.BeginDate.Size = new System.Drawing.Size(353, 35);
+            this.BeginDate.TabIndex = 13;
+            this.BeginDate.Value = new System.DateTime(2020, 8, 24, 0, 0, 0, 0);
+            // 
+            // EndDate
+            // 
+            this.EndDate.Location = new System.Drawing.Point(684, 173);
+            this.EndDate.Name = "EndDate";
+            this.EndDate.Size = new System.Drawing.Size(353, 35);
+            this.EndDate.TabIndex = 14;
+            // 
+            // label3
+            // 
+            this.label3.AutoSize = true;
+            this.label3.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label3.Location = new System.Drawing.Point(139, 168);
+            this.label3.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.label3.Name = "label3";
+            this.label3.Size = new System.Drawing.Size(82, 41);
+            this.label3.TabIndex = 15;
+            this.label3.Text = "日期";
+            // 
+            // Export
+            // 
+            this.Export.AllPower = null;
+            this.Export.BackColor = System.Drawing.Color.Transparent;
+            this.Export.DownImage = ((System.Drawing.Image)(resources.GetObject("Export.DownImage")));
+            this.Export.Image = null;
+            this.Export.IsShowBorder = true;
+            this.Export.Location = new System.Drawing.Point(325, 515);
+            this.Export.Margin = new System.Windows.Forms.Padding(6);
+            this.Export.MoveImage = ((System.Drawing.Image)(resources.GetObject("Export.MoveImage")));
+            this.Export.Name = "Export";
+            this.Export.NormalImage = ((System.Drawing.Image)(resources.GetObject("Export.NormalImage")));
+            this.Export.Power = null;
+            this.Export.Size = new System.Drawing.Size(150, 56);
+            this.Export.TabIndex = 0;
+            this.Export.Text = "导出";
+            this.Export.UseVisualStyleBackColor = false;
+            this.Export.Click += new System.EventHandler(this.Export_Click);
+            // 
+            // Query_DateRate
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 24F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.ClientSize = new System.Drawing.Size(1494, 1075);
+            this.Controls.Add(this.label3);
+            this.Controls.Add(this.EndDate);
+            this.Controls.Add(this.BeginDate);
+            this.Controls.Add(this.Export);
+            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
+            this.Margin = new System.Windows.Forms.Padding(6);
+            this.Name = "Query_DateRate";
+            this.Tag = "Query!DateRate";
+            this.Text = "Query_DateRate";
+            this.Load += new System.EventHandler(this.Query_SpecialReport_Load);
+            this.ResumeLayout(false);
+            this.PerformLayout();
+
+        }
+
+        #endregion
+
+        private CustomControl.ButtonUtil.NormalButton Export;
+        private System.Windows.Forms.FolderBrowserDialog folderBrowserDialog1;
+        private System.Windows.Forms.DateTimePicker BeginDate;
+        private System.Windows.Forms.DateTimePicker EndDate;
+        private System.Windows.Forms.Label label3;
+    }
+}

+ 60 - 0
UAS_MES_ODLF/FunctionCode/Query/Query_DateRate.cs

@@ -0,0 +1,60 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Windows.Forms;
+using UAS_MES_NEW.DataOperate;
+using UAS_MES_NEW.Entity;
+using UAS_MES_NEW.PublicMethod;
+
+namespace UAS_MES_NEW.Query
+{
+    public partial class Query_DateRate : Form
+    {
+
+        DataHelper dh = SystemInf.dh;
+
+
+        public Query_DateRate()
+        {
+            InitializeComponent();
+        }
+
+        private void Export_Click(object sender, EventArgs e)
+        {
+            if (EndDate.Value < BeginDate.Value)
+            {
+                MessageBox.Show("结束日期不能小于起始日期");
+            }
+            ExcelExport("");
+        }
+
+        //选择导出Excel时是选择导出数据的还是模板
+        private void ExcelExport(string DataOrTemplet)
+        {
+            folderBrowserDialog1.Description = "选择导出的路径";
+            DialogResult result = folderBrowserDialog1.ShowDialog();
+            if (result == DialogResult.OK)
+            {
+                LogStringBuilder sql = new LogStringBuilder();
+                sql.Append("select * from MES_OKNG_DATE where sp_date between ");
+                sql.Append("to_date('" + BeginDate.Value.ToString("yyyy-MM-dd") + "','yyyy-mm-dd') and ");
+                sql.Append("to_date('" + EndDate.Value.ToString("yyyy-MM-dd") + "','yyyy-mm-dd') order by sp_date");
+                DataTable dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
+                string FolderPath = folderBrowserDialog1.SelectedPath;
+                ExcelHandler eh = new ExcelHandler();
+                string begindate = BeginDate.Value.ToString("yyyy-mm-dd");
+                string enddate = EndDate.Value.ToString("yyyy-mm-dd");
+                eh.ExportExcel_BAIDU(dt, BeginDate.Value, (EndDate.Value - BeginDate.Value).Days+1, FolderPath);
+            }
+        }
+
+        private void Query_SpecialReport_Load(object sender, EventArgs e)
+        {
+
+        }
+    }
+}

+ 162 - 0
UAS_MES_ODLF/FunctionCode/Query/Query_DateRate.resx

@@ -0,0 +1,162 @@
+<?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>
+  <metadata name="folderBrowserDialog1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>17, 17</value>
+  </metadata>
+  <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+  <data name="Export.DownImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+    <value>
+        iVBORw0KGgoAAAANSUhEUgAAAEUAAAAWCAYAAACWl1FwAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m
+        dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAFcSURBVFhH5di7UsJAFMbxtDT6QMI76IAFT0npIE0K
+        GcRORxHklpAIBHLfbILV8XxeNsMznJ35F5vu+82kWYuILD4N7oq75roCw27sb/x5WBdc27btntY64o/i
+        DnZjPxy4S6A0R6PHO1WUNHc9ep4uxIXd2D8eP/XZowWUThBG+n3p0stsKbbJ0qFDFFfscQuUbpzm9Pqx
+        Eh8c4PGLkuX0Nl+LDw4GJckUTRaO+OBQo+SKpitXfHAwKClfZuuN+OBgUDJV0NzxxAeHM5TFxhffGUpe
+        aFp5n+KDg0FRfHH8nfjgUKPoktztXnxwMCgFX7xdID441ChlRf7+ID44GBTNl21wFB8capSqot0xFB8c
+        /lE6Wa70IU5oH0Ziw/5cFebpoPUwHPbL04nCJKUgisWF3dgPB3gABc9v7fvBoBcnaVKdvkha2I39cPjx
+        oPrhusndcPinpIXd2N8gIusbTaFspKtR2SQAAAAASUVORK5CYII=
+</value>
+  </data>
+  <data name="Export.MoveImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+    <value>
+        iVBORw0KGgoAAAANSUhEUgAAAEUAAAAWCAYAAACWl1FwAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m
+        dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAFzSURBVFhH5djNSgJRGMZxL2P2gTfQFbZvHSEZFBEW
+        CEIQBEIgVFiS9qXWoDmp4/fHzDmjM2a+vU/QqUVX0DvwXxxn9fwYXJwYEcXWNzIWt83dcq7AsBv7LXgA
+        ZI0r71/aaqjCJf8o7sFu7IcDFwdK4vimrv1oSZXRnArdQFzYjf3pQkOzRxIoVWc6X5X6M7ruBGIr9mbU
+        9MIVe9hAcXvBO125WnxwgMcXSpcPF20tPjgYlI5eUK6lxAcHg9Lmw3nTFx8cDEpLLSjr+OKDg0FpqojO
+        Gp744GBQ3vyITutT8cHBoDheRCe1ifjgYFBe+ZCxJ+KDg0GpT0NKv4zFBweDUpuEdFQdiQ8OBsXmw2Fl
+        JD44/KCM53TwNBQfHAzKMx/2Hgfig8M3SrXYUasUfz67DwOxYf9dV5urg+RWzta4aEnxn83OfV9c2I39
+        cIAHUOJceTNbUfmW94GX0sJu7IcDPH5fXCe4EvfXxe5/D7ux3yKi2CfkPhTy27lqkwAAAABJRU5ErkJg
+        gg==
+</value>
+  </data>
+  <data name="Export.NormalImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+    <value>
+        iVBORw0KGgoAAAANSUhEUgAAAEUAAAAWCAYAAACWl1FwAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m
+        dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAGVSURBVFhH5di7agJRFIXhDSKoYBQEC8FCECwEQRBE
+        4uUVEtTiPKVlom2wttM6IfF+15njXHRnL19jD/zFmanWV8zAEDNTp9OJS6/Sm2QUht3YH4cHtdvtF6k7
+        mUwG1tqd3FR3YTf2w0FKUVOu6XT68Xgw3+8PtWH/bDYbCkeLGo1Gz/d9JwzvrL0gCKx49KlerxtIBUGo
+        PjjAg2q1mqDc2fN99cEBHlStVk0oB+t56oMDPKhSqZggDNm1N/XBAR5ULpeNvGD46rrqgwM8qFQqGV8O
+        56ujPjjAg4rFosFL5ni5qA8O8KBCoWBuns/701l9cIAH5fN5QfF4dzipDw7woFwuZ+zN483+oD44wIOy
+        2azB52i13asPDvCgTCZjHGt5sdmqDw7woHQ6bRzX8ny1UR8c4EHJZNJc5fC7XKsPDvCgRCLR2x9Pzt9q
+        zT+Lpdqw/3A6W/HoUywWa32Nx8OL4zwffM8X6sJu7IcDPCgajaak7udoNNjsdgc81BZ2Yz8c4PH8cR2J
+        ROJSU3qXjMKwG/vjzEz/skOI3Zqgv7AAAAAASUVORK5CYII=
+</value>
+  </data>
+</root>

+ 5 - 8
UAS_MES_ODLF/FunctionCode/Query/Query_SpecialReport.Designer.cs

@@ -47,7 +47,7 @@
             this.Export.Image = null;
             this.Export.IsShowBorder = true;
             this.Export.Location = new System.Drawing.Point(305, 371);
-            this.Export.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6);
+            this.Export.Margin = new System.Windows.Forms.Padding(6);
             this.Export.MoveImage = ((System.Drawing.Image)(resources.GetObject("Export.MoveImage")));
             this.Export.Name = "Export";
             this.Export.NormalImage = ((System.Drawing.Image)(resources.GetObject("Export.NormalImage")));
@@ -86,7 +86,7 @@
             this.Num.BackColor = System.Drawing.Color.White;
             this.Num.ID = null;
             this.Num.Location = new System.Drawing.Point(305, 161);
-            this.Num.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6);
+            this.Num.Margin = new System.Windows.Forms.Padding(6);
             this.Num.Name = "Num";
             this.Num.Power = null;
             this.Num.Size = new System.Drawing.Size(388, 35);
@@ -94,7 +94,6 @@
             this.Num.Str1 = null;
             this.Num.Str2 = null;
             this.Num.TabIndex = 5;
-            this.Num.Text = "10";
             // 
             // BeginMac
             // 
@@ -102,7 +101,7 @@
             this.BeginMac.BackColor = System.Drawing.Color.White;
             this.BeginMac.ID = null;
             this.BeginMac.Location = new System.Drawing.Point(305, 242);
-            this.BeginMac.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6);
+            this.BeginMac.Margin = new System.Windows.Forms.Padding(6);
             this.BeginMac.Name = "BeginMac";
             this.BeginMac.Power = null;
             this.BeginMac.Size = new System.Drawing.Size(388, 35);
@@ -110,7 +109,6 @@
             this.BeginMac.Str1 = null;
             this.BeginMac.Str2 = null;
             this.BeginMac.TabIndex = 6;
-            this.BeginMac.Text = "D46075F8C89E";
             // 
             // ma_code
             // 
@@ -118,7 +116,7 @@
             this.ma_code.BackColor = System.Drawing.Color.White;
             this.ma_code.ID = null;
             this.ma_code.Location = new System.Drawing.Point(305, 88);
-            this.ma_code.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6);
+            this.ma_code.Margin = new System.Windows.Forms.Padding(6);
             this.ma_code.Name = "ma_code";
             this.ma_code.Power = null;
             this.ma_code.Size = new System.Drawing.Size(388, 35);
@@ -126,7 +124,6 @@
             this.ma_code.Str1 = null;
             this.ma_code.Str2 = null;
             this.ma_code.TabIndex = 12;
-            this.ma_code.Text = "1111111";
             // 
             // label5
             // 
@@ -152,7 +149,7 @@
             this.Controls.Add(this.label1);
             this.Controls.Add(this.Export);
             this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
-            this.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6);
+            this.Margin = new System.Windows.Forms.Padding(6);
             this.Name = "Query_SpecialReport";
             this.Tag = "Query!SpecialReport";
             this.Text = "Query_SpecialReport";

+ 12 - 0
UAS_MES_ODLF/FunctionCode/Query/Query_SpecialReport.cs

@@ -32,6 +32,18 @@ namespace UAS_MES_NEW.Query
         {
             //Data表示导出数据
             //Templet表示导出模板
+            if (ma_code.Text == "")
+            {
+                MessageBox.Show("请输入工单号");
+            }
+            if (Num.Text == "")
+            {
+                MessageBox.Show("请输入数量");
+            }
+            if (BeginMac.Text == "")
+            {
+                MessageBox.Show("请输入起始地址号");
+            }
             folderBrowserDialog1.Description = "选择导出的路径";
             DialogResult result = folderBrowserDialog1.ShowDialog();
             if (result == DialogResult.OK)

+ 62 - 56
UAS_MES_ODLF/FunctionCode/Warehouse/Warehouse_FinishedProductOut.cs

@@ -482,34 +482,34 @@ namespace UAS_MES_NEW.Warehouse
                                         sql.Append("select cn,outqty,outqty-nvl((select count(1) from prodiomac where pim_inoutno='" + pi_inoutno.Text + "' and pim_prodcode='" + dtms.Rows[0]["ms_prodcode"].ToString() + "'),0)ungetqty from");
                                         sql.Append("(select nvl(sum(pd_outqty),0) outqty  ,count(1)cn from prodiodetail where pd_piid=" + pi_id.Text + " and pd_ordercode='" + dtms.Rows[0]["ms_salecode"].ToString() + "' and pd_prodcode='" + dtms.Rows[0]["ms_prodcode"].ToString() + "')");
                                         dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
-                                        if (dt.Rows[0]["cn"].ToString() == "0")
-                                        {
-                                            OperateResult.AppendText("序列号" + input.Text + "所属产品:" + dtms.Rows[0]["ms_prodcode"].ToString() + ",合同号:" + dtms.Rows[0]["ms_salecode"].ToString() + ",不在出货单" + pi_inoutno.Text + "中\n", Color.Red, input);
-                                            return;
-                                        }
-                                        else if (int.Parse(dt.Rows[0]["cn"].ToString()) > 0 && int.Parse(dt.Rows[0]["ungetqty"].ToString()) <= 0)
-                                        {
-                                            OperateResult.AppendText("出货单产品" + dtms.Rows[0]["ms_prodcode"].ToString() + "+合同" + dtms.Rows[0]["ms_salecode"].ToString() + ",已经完成出货采集\n", Color.Red, input);
-                                            return;
-                                        }
+                                        //if (dt.Rows[0]["cn"].ToString() == "0")
+                                        //{
+                                        //    OperateResult.AppendText("序列号" + input.Text + "所属产品:" + dtms.Rows[0]["ms_prodcode"].ToString() + ",合同号:" + dtms.Rows[0]["ms_salecode"].ToString() + ",不在出货单" + pi_inoutno.Text + "中\n", Color.Red, input);
+                                        //    return;
+                                        //}
+                                        //else if (int.Parse(dt.Rows[0]["cn"].ToString()) > 0 && int.Parse(dt.Rows[0]["ungetqty"].ToString()) <= 0)
+                                        //{
+                                        //    OperateResult.AppendText("出货单产品" + dtms.Rows[0]["ms_prodcode"].ToString() + "+合同" + dtms.Rows[0]["ms_salecode"].ToString() + ",已经完成出货采集\n", Color.Red, input);
+                                        //    return;
+                                        //}
                                         updatesn(ms_id);
                                     }
                                     else
                                     {
-                                        sql.Clear();
-                                        sql.Append("select cn,outqty,outqty-nvl((select count(1) from prodiomac where pim_inoutno='" + pi_inoutno.Text + "' and pim_prodcode='" + dtms.Rows[0]["ms_prodcode"].ToString() + "'),0)ungetqty from");
-                                        sql.Append("(select nvl(sum(pd_outqty),0) outqty  ,count(1)cn from prodiodetail where pd_piid=" + pi_id.Text + " and pd_prodcode='" + dtms.Rows[0]["ms_prodcode"].ToString() + "')");
-                                        dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
-                                        if (dt.Rows[0]["cn"].ToString() == "0")
-                                        {
-                                            OperateResult.AppendText("序列号" + input.Text + "所属产品:" + dtms.Rows[0]["ms_prodcode"].ToString() + ",不在出货单" + pi_inoutno.Text + "中\n", Color.Red, input);
-                                            return;
-                                        }
-                                        else if (int.Parse(dt.Rows[0]["cn"].ToString()) > 0 && int.Parse(dt.Rows[0]["ungetqty"].ToString()) <= 0)
-                                        {
-                                            OperateResult.AppendText("出货单产品" + dtms.Rows[0]["ms_prodcode"].ToString() + "已经完成出货采集\n", Color.Red, input);
-                                            return;
-                                        }
+                                        //sql.Clear();
+                                        //sql.Append("select cn,outqty,outqty-nvl((select count(1) from prodiomac where pim_inoutno='" + pi_inoutno.Text + "' and pim_prodcode='" + dtms.Rows[0]["ms_prodcode"].ToString() + "'),0)ungetqty from");
+                                        //sql.Append("(select nvl(sum(pd_outqty),0) outqty  ,count(1)cn from prodiodetail where pd_piid=" + pi_id.Text + " and pd_prodcode='" + dtms.Rows[0]["ms_prodcode"].ToString() + "')");
+                                        //dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
+                                        //if (dt.Rows[0]["cn"].ToString() == "0")
+                                        //{
+                                        //    OperateResult.AppendText("序列号" + input.Text + "所属产品:" + dtms.Rows[0]["ms_prodcode"].ToString() + ",不在出货单" + pi_inoutno.Text + "中\n", Color.Red, input);
+                                        //    return;
+                                        //}
+                                        //else if (int.Parse(dt.Rows[0]["cn"].ToString()) > 0 && int.Parse(dt.Rows[0]["ungetqty"].ToString()) <= 0)
+                                        //{
+                                        //    OperateResult.AppendText("出货单产品" + dtms.Rows[0]["ms_prodcode"].ToString() + "已经完成出货采集\n", Color.Red, input);
+                                        //    return;
+                                        //}
                                         updatesn(ms_id);
                                     }
                                 }
@@ -783,22 +783,24 @@ namespace UAS_MES_NEW.Warehouse
                     sql.Append("and ms_outno is null group by ms_prodcode,ms_salecode) left join (select pd_ordercode,pd_prodcode,outqty-nvl((select count(1) from prodiomac where pim_inoutno='" + pi_inoutno.Text + "' and pim_prodcode=pd_prodcode),0)ungetqty");
                     sql.Append(" from (select pd_ordercode,pd_prodcode,sum(pd_outqty)outqty from prodiodetail where pd_piid=" + pi_id.Text + " group by pd_prodcode,pd_ordercode))  on 1=1 where ms_prodcode<>pd_prodcode or ms_salecode<>pd_ordercode  or (cn>nvl(ungetqty,0))");
                     DataTable dtAA = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
-                    if (dtAA.Rows.Count > 0)
-                    {
-                        string badmessgae = "";
-                        for (int i = 0; i < dtAA.Rows.Count; i++)
-                        {
-                            badmessgae += "产品号:" + dtAA.Rows[i]["ms_prodcode"].ToString() + ",订单号:" + dtAA.Rows[i]["ms_salecode"].ToString() + ",数量:" + dtAA.Rows[i]["cn"].ToString() + "\n";
-                        }
-                        OperateResult.AppendText(type + input.Text + "内的序列号中的产品+订单不在出货单中或者所装的序列号的数量大于剩余出货数," + badmessgae, Color.Red, input);
-                        return false;
-                    }
-                    else
-                    {
-                        //插入prodiomac表
-                        insertprodiomac(type);
-                        return true;
-                    }
+                    //if (dtAA.Rows.Count > 0)
+                    //{
+                    //    //string badmessgae = "";
+                    //    //for (int i = 0; i < dtAA.Rows.Count; i++)
+                    //    //{
+                    //    //    badmessgae += "产品号:" + dtAA.Rows[i]["ms_prodcode"].ToString() + ",订单号:" + dtAA.Rows[i]["ms_salecode"].ToString() + ",数量:" + dtAA.Rows[i]["cn"].ToString() + "\n";
+                    //    //}
+                    //    //OperateResult.AppendText(type + input.Text + "内的序列号中的产品+订单不在出货单中或者所装的序列号的数量大于剩余出货数," + badmessgae, Color.Red, input);
+                    //    //return false;
+                    //}
+                    //else
+                    //{
+                    //    //插入prodiomac表
+                    //    insertprodiomac(type);
+                    //    return true;
+                    //}
+                    insertprodiomac(type);
+                    return true;
                 }
                 else
                 {
@@ -807,22 +809,26 @@ namespace UAS_MES_NEW.Warehouse
                     sql.Append("and ms_outno is null group by ms_prodcode) left join (select pd_prodcode,outqty-nvl((select count(1) from prodiomac where pim_inoutno='" + pi_inoutno.Text + "' and pim_prodcode=pd_prodcode),0)ungetqty");
                     sql.Append(" from (select pd_prodcode,sum(pd_outqty)outqty from prodiodetail where pd_piid=" + pi_id.Text + " group by pd_prodcode))  on 1=1 where ms_prodcode<>pd_prodcode   or (cn>nvl(ungetqty,0))");
                     DataTable dtAA = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
-                    if (dtAA.Rows.Count > 0)
-                    {
-                        string badmessgae = "";
-                        for (int i = 0; i < dtAA.Rows.Count; i++)
-                        {
-                            badmessgae += "产品号:" + dtAA.Rows[i]["ms_prodcode"].ToString() + ",数量:" + dtAA.Rows[i]["cn"].ToString() + "\n";
-                        }
-                        OperateResult.AppendText(type + input.Text + "内的序列号中的产品不在出货单中或者所装的序列号的数量大于剩余出货数," + badmessgae, Color.Red, input);
-                        return false;
-                    }
-                    else
-                    {
-                        //插入prodiomac表
-                        insertprodiomac(type);
-                        return true;
-                    }
+                    //if (dtAA.Rows.Count > 0)
+                    //{
+                    //    //string badmessgae = "";
+                    //    //for (int i = 0; i < dtAA.Rows.Count; i++)
+                    //    //{
+                    //    //    badmessgae += "产品号:" + dtAA.Rows[i]["ms_prodcode"].ToString() + ",数量:" + dtAA.Rows[i]["cn"].ToString() + "\n";
+                    //    //}
+                    //    //OperateResult.AppendText(type + input.Text + "内的序列号中的产品不在出货单中或者所装的序列号的数量大于剩余出货数," + badmessgae, Color.Red, input);
+                    //    //return false;
+                    //    insertprodiomac(type);
+                    //    return true;
+                    //}
+                    //else
+                    //{
+                    //    //插入prodiomac表
+                    //    insertprodiomac(type);
+                    //    return true;
+                    //}
+                    insertprodiomac(type);
+                    return true;
                 }
             }
             else if (dta.Rows[0]["pi_type"].ToString() == "自由出货")