callm пре 5 година
родитељ
комит
5e119786ca

+ 69 - 0
UAS_MES_ODLF/CustomControl/TextBoxWithIcon/SourceStepCountPre.Designer.cs

@@ -0,0 +1,69 @@
+namespace UAS_MES_NEW.CustomControl.TextBoxWithIcon
+{
+    partial class SourceStepCountPre
+    {
+        /// <summary> 
+        /// 必需的设计器变量。
+        /// </summary>
+        private System.ComponentModel.IContainer components = null;
+
+        /// <summary> 
+        /// 清理所有正在使用的资源。
+        /// </summary>
+        /// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
+        protected override void Dispose(bool disposing)
+        {
+            if (disposing && (components != null))
+            {
+                components.Dispose();
+            }
+            base.Dispose(disposing);
+        }
+
+        #region 组件设计器生成的代码
+
+        /// <summary> 
+        /// 设计器支持所需的方法 - 不要修改
+        /// 使用代码编辑器修改此方法的内容。
+        /// </summary>
+        private void InitializeComponent()
+        {
+            this.Count = new System.Windows.Forms.Label();
+            this.CountRefresh = new System.Windows.Forms.Timer();
+            this.SuspendLayout();
+            // 
+            // Count
+            // 
+            this.Count.AutoSize = true;
+            this.Count.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.Count.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.Count.Location = new System.Drawing.Point(0, 0);
+            this.Count.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
+            this.Count.Name = "Count";
+            this.Count.Size = new System.Drawing.Size(0, 21);
+            this.Count.TabIndex = 0;
+            // 
+            // CountRefresh
+            // 
+            this.CountRefresh.Tick += new System.EventHandler(this.CountRefresh_Tick);
+            // 
+            // SourceStepCount
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.Controls.Add(this.Count);
+            this.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.Name = "SourceStepCount";
+            this.Size = new System.Drawing.Size(88, 22);
+            this.Load += new System.EventHandler(this.SourceStepCount_Load);
+            this.ResumeLayout(false);
+            this.PerformLayout();
+
+        }
+
+        #endregion
+
+        private System.Windows.Forms.Label Count;
+        private System.Windows.Forms.Timer CountRefresh;
+    }
+}

+ 122 - 0
UAS_MES_ODLF/CustomControl/TextBoxWithIcon/SourceStepCountPre.cs

@@ -0,0 +1,122 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Drawing;
+using System.Data;
+using System.Linq;
+using System.Text;
+using System.Windows.Forms;
+using UAS_MES_NEW.DataOperate;
+using UAS_MES_NEW.Entity;
+
+namespace UAS_MES_NEW.CustomControl.TextBoxWithIcon
+{
+    public partial class SourceStepCountPre : UserControl
+    {
+        DataHelper dh;
+
+        string Source1;
+
+        public string Source
+        {
+            get
+            {
+                return Source1;
+            }
+
+            set
+            {
+                Source1 = value;
+            }
+        }
+
+        string StepCode1;
+
+        public string StepCode
+        {
+            get
+            {
+                return StepCode1;
+            }
+
+            set
+            {
+                StepCode1 = value;
+            }
+        }
+
+        string LineCode1;
+
+        public string LineCode
+        {
+            get
+            {
+                return LineCode1;
+            }
+
+            set
+            {
+                LineCode1 = value;
+            }
+        }
+
+        internal DataHelper Dh
+        {
+            get
+            {
+                return dh;
+            }
+
+            set
+            {
+                dh = value;
+            }
+        }
+
+        public string Tag1
+        {
+            get
+            {
+                return tag;
+            }
+
+            set
+            {
+                tag = value;
+            }
+        }
+
+        string tag;
+
+        public SourceStepCountPre()
+        {
+            InitializeComponent();
+        }
+
+        private void SourceStepCount_Load(object sender, EventArgs e)
+        {
+            //五分钟刷新一次
+            CountRefresh.Interval = 60000;
+        }
+
+        public void Start()
+        {
+            string SQL = "select count(1) from commandlog where cl_caller='" + tag + "' and cl_date>trunc(sysdate) and cl_linecode='" + User.UserLineCode + "'";
+            DataTable dt = (DataTable)Dh.ExecuteSql(SQL, "select");
+            Count.Text = "计数:" + dt.Rows[0][0].ToString();
+            CountRefresh.Start();
+        }
+
+        public void Close()
+        {
+            CountRefresh.Stop();
+        }
+
+        private void CountRefresh_Tick(object sender, EventArgs e)
+        {
+            string SQL = "select count(1) from commandlog where cl_caller='" + tag + "' and cl_date>trunc(sysdate)  and cl_linecode='" + User.UserLineCode + "'";
+            DataTable dt = (DataTable)Dh.ExecuteSql(SQL, "select");
+            Count.Text = "计数:" + dt.Rows[0][0].ToString();
+        }
+    }
+}

+ 123 - 0
UAS_MES_ODLF/CustomControl/TextBoxWithIcon/SourceStepCountPre.resx

@@ -0,0 +1,123 @@
+<?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="CountRefresh.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>17, 17</value>
+  </metadata>
+</root>

+ 21 - 0
UAS_MES_ODLF/FunctionCode/Make/Make_FeedingCollectionCombineFix.cs

@@ -202,6 +202,13 @@ namespace UAS_MES_NEW.Make
                                     }
                                     else
                                     {
+                                        sql.Clear();
+                                        sql.Append("select mcd_inqty,ma_qty-mcd_inqty mcd_remainqty ");
+                                        sql.Append("from make left join makecraftdetail on mcd_macode=ma_code where ");
+                                        sql.Append("ma_code='" + ma_code.Text + "' and mcd_stepcode='" + User.CurrentStepCode + "'");
+                                        DataTable dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
+                                        if (dt.Rows.Count > 0)
+                                            BaseUtil.SetFormValue(Controls, dt);
                                         //提示正确返回时传递的信息
                                         if (ErrorMessage.Contains("AFTERSUCCESS"))
                                             OperateResult.AppendText(">>" + ErrorMessage + "\n");
@@ -305,6 +312,13 @@ namespace UAS_MES_NEW.Make
                                         }
                                         else
                                         {
+                                            sql.Clear();
+                                            sql.Append("select mcd_inqty,ma_qty-mcd_inqty mcd_remainqty ");
+                                            sql.Append("from make left join makecraftdetail on mcd_macode=ma_code where ");
+                                            sql.Append("ma_code='" + ma_code.Text + "' and mcd_stepcode='" + User.CurrentStepCode + "'");
+                                            DataTable dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
+                                            if (dt.Rows.Count > 0)
+                                                BaseUtil.SetFormValue(Controls, dt);
                                             //提示正确返回时传递的信息
                                             if (ErrorMessage.Contains("AFTERSUCCESS"))
                                                 OperateResult.AppendText(">>" + ErrorMessage + "\n");
@@ -545,6 +559,13 @@ namespace UAS_MES_NEW.Make
                     //提示正确返回时传递的信息
                     if (ErrorMessage.Contains("AFTERSUCCESS"))
                         OperateResult.AppendText(">>" + ErrorMessage + "\n");
+                    sql.Clear();
+                    sql.Append("select mcd_inqty,ma_qty-mcd_inqty mcd_remainqty ");
+                    sql.Append("from make left join makecraftdetail on mcd_macode=ma_code where ");
+                    sql.Append("ma_code='" + ma_code.Text + "' and mcd_stepcode='" + User.CurrentStepCode + "'");
+                    DataTable dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
+                    if (dt.Rows.Count > 0)
+                        BaseUtil.SetFormValue(Controls, dt);
                     OperateResult.AppendText(">>序列号" + sn_code.Text + "采集成功!\n", Color.Green);
                 }
                 code.Text = "";

+ 78 - 79
UAS_MES_ODLF/FunctionCode/Make/Make_PreFeedingCollection.Designer.cs

@@ -42,6 +42,12 @@
             this.ma_craftcode = new System.Windows.Forms.Label();
             this.NoteForChange = new System.Windows.Forms.CheckBox();
             this.LabelDataGridView = new System.Windows.Forms.DataGridView();
+            this.序号 = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.cm_makecode = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pr_detail_ = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.cm_soncode = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.cm_barcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.BarCode = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.label1 = new System.Windows.Forms.Label();
             this.ClearSn_code = new System.Windows.Forms.PictureBox();
             this.dataGridViewTextBoxColumn1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
@@ -51,13 +57,7 @@
             this.dataGridViewTextBoxColumn5 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.dataGridViewTextBoxColumn6 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.mainbarcode = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.SnCollectionBox();
-            this.序号 = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.cm_makecode = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pr_detail_ = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.cm_soncode = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.cm_barcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.BarCode = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.StepCount = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.SourceStepCount();
+            this.StepCount = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.SourceStepCountPre();
             this.ma_code = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.MaCodeSearchTextBox();
             this.LockMakeCode = new UAS_MES_NEW.CustomControl.CustomCheckBox.LockCheckBox();
             this.ma_prodcode = new UAS_MES_NEW.CustomControl.ValueLabel.ValueLabel();
@@ -80,23 +80,25 @@
             // 
             this.mcd_restqty_label.AutoSize = true;
             this.mcd_restqty_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.mcd_restqty_label.Location = new System.Drawing.Point(1170, 122);
+            this.mcd_restqty_label.Location = new System.Drawing.Point(1194, 122);
             this.mcd_restqty_label.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.mcd_restqty_label.Name = "mcd_restqty_label";
             this.mcd_restqty_label.Size = new System.Drawing.Size(146, 41);
             this.mcd_restqty_label.TabIndex = 59;
             this.mcd_restqty_label.Text = "待采集数";
+            this.mcd_restqty_label.Visible = false;
             // 
             // mcd_inqty_label
             // 
             this.mcd_inqty_label.AutoSize = true;
             this.mcd_inqty_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.mcd_inqty_label.Location = new System.Drawing.Point(622, 122);
+            this.mcd_inqty_label.Location = new System.Drawing.Point(1413, 244);
             this.mcd_inqty_label.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.mcd_inqty_label.Name = "mcd_inqty_label";
             this.mcd_inqty_label.Size = new System.Drawing.Size(146, 41);
             this.mcd_inqty_label.TabIndex = 56;
             this.mcd_inqty_label.Text = "已采集数";
+            this.mcd_inqty_label.Visible = false;
             // 
             // ma_qty_label
             // 
@@ -196,7 +198,7 @@
             // 
             this.ma_craftcode.AutoSize = true;
             this.ma_craftcode.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ma_craftcode.Location = new System.Drawing.Point(1508, 122);
+            this.ma_craftcode.Location = new System.Drawing.Point(1532, 122);
             this.ma_craftcode.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.ma_craftcode.Name = "ma_craftcode";
             this.ma_craftcode.Size = new System.Drawing.Size(0, 41);
@@ -237,6 +239,65 @@
             this.LabelDataGridView.Size = new System.Drawing.Size(1282, 454);
             this.LabelDataGridView.TabIndex = 193;
             // 
+            // 序号
+            // 
+            this.序号.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
+            this.序号.DataPropertyName = "sp_detno";
+            this.序号.HeaderText = "序号";
+            this.序号.Name = "序号";
+            this.序号.ReadOnly = true;
+            this.序号.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
+            this.序号.Width = 70;
+            // 
+            // cm_makecode
+            // 
+            this.cm_makecode.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
+            this.cm_makecode.DataPropertyName = "sp_fsoncode";
+            this.cm_makecode.HeaderText = "上料料号";
+            this.cm_makecode.Name = "cm_makecode";
+            this.cm_makecode.ReadOnly = true;
+            this.cm_makecode.Width = 151;
+            // 
+            // pr_detail_
+            // 
+            this.pr_detail_.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
+            this.pr_detail_.DataPropertyName = "pr_detail";
+            this.pr_detail_.HeaderText = "上料名称";
+            this.pr_detail_.Name = "pr_detail_";
+            this.pr_detail_.ReadOnly = true;
+            this.pr_detail_.Width = 151;
+            // 
+            // cm_soncode
+            // 
+            this.cm_soncode.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
+            this.cm_soncode.DataPropertyName = "sp_prefix";
+            this.cm_soncode.HeaderText = "前缀";
+            this.cm_soncode.Name = "cm_soncode";
+            this.cm_soncode.ReadOnly = true;
+            this.cm_soncode.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
+            this.cm_soncode.Width = 64;
+            // 
+            // cm_barcode
+            // 
+            this.cm_barcode.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
+            this.cm_barcode.DataPropertyName = "sp_length";
+            this.cm_barcode.HeaderText = "长度";
+            this.cm_barcode.Name = "cm_barcode";
+            this.cm_barcode.ReadOnly = true;
+            this.cm_barcode.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
+            this.cm_barcode.Width = 64;
+            // 
+            // BarCode
+            // 
+            this.BarCode.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
+            this.BarCode.DataPropertyName = "bhp_barcode";
+            this.BarCode.HeaderText = "条码号";
+            this.BarCode.MinimumWidth = 300;
+            this.BarCode.Name = "BarCode";
+            this.BarCode.ReadOnly = true;
+            this.BarCode.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
+            this.BarCode.Width = 300;
+            // 
             // label1
             // 
             this.label1.AutoSize = true;
@@ -277,7 +338,6 @@
             this.dataGridViewTextBoxColumn2.HeaderText = "上料名称";
             this.dataGridViewTextBoxColumn2.Name = "dataGridViewTextBoxColumn2";
             this.dataGridViewTextBoxColumn2.ReadOnly = true;
-            this.dataGridViewTextBoxColumn2.Width = 151;
             // 
             // dataGridViewTextBoxColumn3
             // 
@@ -287,7 +347,6 @@
             this.dataGridViewTextBoxColumn3.Name = "dataGridViewTextBoxColumn3";
             this.dataGridViewTextBoxColumn3.ReadOnly = true;
             this.dataGridViewTextBoxColumn3.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
-            this.dataGridViewTextBoxColumn3.Width = 151;
             // 
             // dataGridViewTextBoxColumn4
             // 
@@ -297,7 +356,6 @@
             this.dataGridViewTextBoxColumn4.Name = "dataGridViewTextBoxColumn4";
             this.dataGridViewTextBoxColumn4.ReadOnly = true;
             this.dataGridViewTextBoxColumn4.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
-            this.dataGridViewTextBoxColumn4.Width = 64;
             // 
             // dataGridViewTextBoxColumn5
             // 
@@ -308,7 +366,6 @@
             this.dataGridViewTextBoxColumn5.Name = "dataGridViewTextBoxColumn5";
             this.dataGridViewTextBoxColumn5.ReadOnly = true;
             this.dataGridViewTextBoxColumn5.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
-            this.dataGridViewTextBoxColumn5.Width = 64;
             // 
             // dataGridViewTextBoxColumn6
             // 
@@ -319,7 +376,6 @@
             this.dataGridViewTextBoxColumn6.Name = "dataGridViewTextBoxColumn6";
             this.dataGridViewTextBoxColumn6.ReadOnly = true;
             this.dataGridViewTextBoxColumn6.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
-            this.dataGridViewTextBoxColumn6.Width = 300;
             // 
             // mainbarcode
             // 
@@ -338,69 +394,10 @@
             this.mainbarcode.TabIndex = 194;
             this.mainbarcode.Tag = "IfRead";
             // 
-            // 序号
-            // 
-            this.序号.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
-            this.序号.DataPropertyName = "sp_detno";
-            this.序号.HeaderText = "序号";
-            this.序号.Name = "序号";
-            this.序号.ReadOnly = true;
-            this.序号.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
-            this.序号.Width = 70;
-            // 
-            // cm_makecode
-            // 
-            this.cm_makecode.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
-            this.cm_makecode.DataPropertyName = "sp_fsoncode";
-            this.cm_makecode.HeaderText = "上料料号";
-            this.cm_makecode.Name = "cm_makecode";
-            this.cm_makecode.ReadOnly = true;
-            this.cm_makecode.Width = 151;
-            // 
-            // pr_detail_
-            // 
-            this.pr_detail_.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
-            this.pr_detail_.DataPropertyName = "pr_detail";
-            this.pr_detail_.HeaderText = "上料名称";
-            this.pr_detail_.Name = "pr_detail_";
-            this.pr_detail_.ReadOnly = true;
-            this.pr_detail_.Width = 151;
-            // 
-            // cm_soncode
-            // 
-            this.cm_soncode.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
-            this.cm_soncode.DataPropertyName = "sp_prefix";
-            this.cm_soncode.HeaderText = "前缀";
-            this.cm_soncode.Name = "cm_soncode";
-            this.cm_soncode.ReadOnly = true;
-            this.cm_soncode.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
-            this.cm_soncode.Width = 64;
-            // 
-            // cm_barcode
-            // 
-            this.cm_barcode.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
-            this.cm_barcode.DataPropertyName = "sp_length";
-            this.cm_barcode.HeaderText = "长度";
-            this.cm_barcode.Name = "cm_barcode";
-            this.cm_barcode.ReadOnly = true;
-            this.cm_barcode.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
-            this.cm_barcode.Width = 64;
-            // 
-            // BarCode
-            // 
-            this.BarCode.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
-            this.BarCode.DataPropertyName = "bhp_barcode";
-            this.BarCode.HeaderText = "条码号";
-            this.BarCode.MinimumWidth = 300;
-            this.BarCode.Name = "BarCode";
-            this.BarCode.ReadOnly = true;
-            this.BarCode.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
-            this.BarCode.Width = 300;
-            // 
             // StepCount
             // 
             this.StepCount.LineCode = null;
-            this.StepCount.Location = new System.Drawing.Point(920, 688);
+            this.StepCount.Location = new System.Drawing.Point(622, 122);
             this.StepCount.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.StepCount.Name = "StepCount";
             this.StepCount.Size = new System.Drawing.Size(160, 44);
@@ -471,25 +468,27 @@
             this.mcd_remainqty.AutoSize = true;
             this.mcd_remainqty.CutLength = null;
             this.mcd_remainqty.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.mcd_remainqty.Location = new System.Drawing.Point(1348, 122);
+            this.mcd_remainqty.Location = new System.Drawing.Point(1372, 122);
             this.mcd_remainqty.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.mcd_remainqty.MaximumSize = new System.Drawing.Size(300, 0);
             this.mcd_remainqty.Name = "mcd_remainqty";
             this.mcd_remainqty.Size = new System.Drawing.Size(0, 41);
             this.mcd_remainqty.TabIndex = 97;
             this.mcd_remainqty.Tag = "mcd_remainqty";
+            this.mcd_remainqty.Visible = false;
             // 
             // mcd_inqty
             // 
             this.mcd_inqty.AutoSize = true;
             this.mcd_inqty.CutLength = null;
             this.mcd_inqty.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.mcd_inqty.Location = new System.Drawing.Point(802, 122);
+            this.mcd_inqty.Location = new System.Drawing.Point(1593, 244);
             this.mcd_inqty.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.mcd_inqty.MaximumSize = new System.Drawing.Size(300, 0);
             this.mcd_inqty.Name = "mcd_inqty";
             this.mcd_inqty.Size = new System.Drawing.Size(0, 41);
             this.mcd_inqty.TabIndex = 96;
+            this.mcd_inqty.Visible = false;
             // 
             // ma_qty
             // 
@@ -626,7 +625,7 @@
             this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
             this.Margin = new System.Windows.Forms.Padding(6);
             this.Name = "Make_PreFeedingCollection";
-            this.Tag = "Make!FeedingCollection";
+            this.Tag = "Make!PreFeedingCollection";
             this.Text = "上料采集";
             this.Load += new System.EventHandler(this.Make_FeedingCollection_Load);
             this.SizeChanged += new System.EventHandler(this.Make_FeedingCollection_SizeChanged);
@@ -678,7 +677,7 @@
         private System.Windows.Forms.DataGridViewTextBoxColumn cm_soncode;
         private System.Windows.Forms.DataGridViewTextBoxColumn cm_barcode;
         private System.Windows.Forms.DataGridViewTextBoxColumn BarCode;
-        private CustomControl.TextBoxWithIcon.SourceStepCount StepCount;
+        private CustomControl.TextBoxWithIcon.SourceStepCountPre StepCount;
         private System.Windows.Forms.NumericUpDown ProdNum;
         private System.Windows.Forms.Label label2;
     }

+ 2 - 0
UAS_MES_ODLF/FunctionCode/Make/Make_PreFeedingCollection.cs

@@ -69,6 +69,7 @@ namespace UAS_MES_NEW.Make
             StepCount.Source = User.UserSourceCode;
             StepCount.LineCode = User.UserLineCode;
             StepCount.Dh = dh;
+            StepCount.Tag1 = Tag.ToString();
             StepCount.Start();
         }
 
@@ -201,6 +202,7 @@ namespace UAS_MES_NEW.Make
                                 CollectCount = CollectCount + 1;
                                 if (CollectCount == ProdNum.Value || RemainIndex == LabelDataGridView.Rows.Count - 1)
                                 {
+                                    LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, ma_code.Text, User.UserLineCode, User.UserSourceCode, "预加工采集", "上料物料" + mainbarcode.Text, "", "");
                                     mainbarcode.Text = "";
                                     CollectCount = 0;
                                     SetCheck set = new SetCheck("OK", Color.Green);

+ 20 - 28
UAS_MES_ODLF/FunctionCode/Make/Make_RePrintLabel.cs

@@ -25,14 +25,10 @@ namespace UAS_MES_NEW.Make
 
         ApplicationClass lbl;
 
-        Document doc;
-
         Thread InitPrint;//实例化打印进程
 
         DataTable dt;
 
-        ftpOperater ftp;
-
         DataTable listA;
 
         string getlabel = "";
@@ -41,10 +37,6 @@ namespace UAS_MES_NEW.Make
 
         String TSN = "";//记录第一次输入的SN
 
-        DataTable infoc;
-
-        string re_ms_id = "";
-
         string ms_id = "";
 
         DataTable formValue;//界面赋值
@@ -215,12 +207,12 @@ namespace UAS_MES_NEW.Make
                     OperateResult.AppendText("<<序列号错误,不存在或已经发生转号\n", Color.Red);
                     return;
                 }
-                ////如果ms_outboxcode 不为空,则提示用户,已经装箱不允许单独打印
-                //if (mapB.Rows[0]["ms_outboxcode"].ToString() != "")
-                //{
-                //    OperateResult.AppendText("<<SN:" + inputValue.Text + "已经装箱" + mapB.Rows[0]["ms_outboxcode"].ToString() + "不允许单独补打\n", Color.Red);
-                //    return;
-                //}
+                //如果ms_outboxcode 不为空,则提示用户,已经装箱不允许单独打印
+                if (mapB.Rows[0]["ms_outboxcode"].ToString() != "")
+                {
+                    OperateResult.AppendText("<<SN:" + inputValue.Text + "已经装箱" + mapB.Rows[0]["ms_outboxcode"].ToString() + "不允许单独补打\n", Color.Red);
+                    return;
+                }
                 //判定通过进行打印 
                 //doc = lbl.Documents.Open(PrintLabel.Text);
                 if (Print.CodeSoft(Tag.ToString(), ref lbl, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), Printer.Text, inputValue.Text, int.Parse(printNum.Text), ms_makecode.Text, pr_code.Text, giftBox.Checked ? "彩盒标" : "机身标", "-1", out errorMessage))
@@ -234,13 +226,13 @@ namespace UAS_MES_NEW.Make
                 }
                 //打印成功,记录日志commandlog , cl_operate彩盒或者机身标补打印,cl_result补打印成功
                 LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, ms_makecode.Text, User.UserLineCode, User.UserSourceCode, giftBox.Checked ? "彩盒标补打印" : "机身标补打印", "补打印成功", inputValue.Text, "");
-                ////如果ms_downstatus<>0,则更新ms_downstatus=-1 where ms_id=?id,同时插入记录至表 MAKEDOWN
-                //if (mapB.Rows[0]["ms_downstatus"].ToString() == "0")
-                //{
-                //    dh.ExecuteSql("update makeserial set ms_downstatus='-1' where ms_id='" + ms_id + "'", "update");
-                //    //插入数据
-                //    putInfo2MakeDown();
-                //}
+                //如果ms_downstatus<>0,则更新ms_downstatus=-1 where ms_id=?id,同时插入记录至表 MAKEDOWN
+                if (mapB.Rows[0]["ms_downstatus"].ToString() == "0")
+                {
+                    dh.ExecuteSql("update makeserial set ms_downstatus='-1' where ms_id='" + ms_id + "'", "update");
+                    //插入数据
+                    putInfo2MakeDown();
+                }
             }
             //打印类型为卡通箱标签
             else if (CartonBox.Checked)
@@ -265,13 +257,13 @@ namespace UAS_MES_NEW.Make
                 }
                 //打印成功,记录日志commandlog , cl_operate彩盒或者机身标补打印,cl_result补打印成功
                 LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, ms_makecode.Text, User.UserLineCode, User.UserSourceCode, "卡通箱标签补打印,箱号:" + inputValue.Text, "补打印成功", inputValue.Text, "");
-                ////如果pa_downstatus<>0,则更新pa_downstatus=-1 where pa_outboxcode=?code,同时插入记录至表 MAKEDOWN
-                //if (mapB.Rows[0]["pa_downstatus"].ToString() == "0")
-                //{
-                //    dh.ExecuteSql("update package set pa_downstatus='-1' where pa_outboxcode='" + inputValue.Text + "'", "update");
-                //    //插入MakeDown表
-                //    putInfo2MakeDown();
-                //}
+                //如果pa_downstatus<>0,则更新pa_downstatus=-1 where pa_outboxcode=?code,同时插入记录至表 MAKEDOWN
+                if (mapB.Rows[0]["pa_downstatus"].ToString() == "0")
+                {
+                    dh.ExecuteSql("update package set pa_downstatus='-1' where pa_outboxcode='" + inputValue.Text + "'", "update");
+                    //插入MakeDown表
+                    putInfo2MakeDown();
+                }
             }
         }
 

+ 35 - 3
UAS_MES_ODLF/FunctionCode/Query/Query_SN.Designer.cs

@@ -49,6 +49,8 @@
             this.label8 = new System.Windows.Forms.Label();
             this.ma_code = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.label9 = new System.Windows.Forms.Label();
+            this.currentSerial = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.EnterTextBox();
+            this.label10 = new System.Windows.Forms.Label();
             this.SuspendLayout();
             // 
             // label1
@@ -129,7 +131,7 @@
             // 
             this.label7.AutoSize = true;
             this.label7.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label7.Location = new System.Drawing.Point(106, 525);
+            this.label7.Location = new System.Drawing.Point(106, 526);
             this.label7.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.label7.Name = "label7";
             this.label7.Size = new System.Drawing.Size(126, 41);
@@ -141,7 +143,7 @@
             this.num.AllPower = null;
             this.num.BackColor = System.Drawing.Color.White;
             this.num.ID = null;
-            this.num.Location = new System.Drawing.Point(305, 526);
+            this.num.Location = new System.Drawing.Point(305, 527);
             this.num.Margin = new System.Windows.Forms.Padding(6);
             this.num.Name = "num";
             this.num.Power = null;
@@ -237,7 +239,7 @@
             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(305, 659);
+            this.Export.Location = new System.Drawing.Point(305, 742);
             this.Export.Margin = new System.Windows.Forms.Padding(6);
             this.Export.MoveImage = ((System.Drawing.Image)(resources.GetObject("Export.MoveImage")));
             this.Export.Name = "Export";
@@ -301,11 +303,39 @@
             this.label9.TabIndex = 23;
             this.label9.Text = "工单号";
             // 
+            // currentSerial
+            // 
+            this.currentSerial.AllPower = null;
+            this.currentSerial.BackColor = System.Drawing.Color.White;
+            this.currentSerial.ID = null;
+            this.currentSerial.Location = new System.Drawing.Point(305, 672);
+            this.currentSerial.Margin = new System.Windows.Forms.Padding(6);
+            this.currentSerial.Name = "currentSerial";
+            this.currentSerial.Power = null;
+            this.currentSerial.Size = new System.Drawing.Size(388, 35);
+            this.currentSerial.Str = null;
+            this.currentSerial.Str1 = null;
+            this.currentSerial.Str2 = null;
+            this.currentSerial.TabIndex = 26;
+            // 
+            // label10
+            // 
+            this.label10.AutoSize = true;
+            this.label10.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label10.Location = new System.Drawing.Point(106, 669);
+            this.label10.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.label10.Name = "label10";
+            this.label10.Size = new System.Drawing.Size(146, 41);
+            this.label10.TabIndex = 25;
+            this.label10.Text = "当前流水";
+            // 
             // Query_SN
             // 
             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.currentSerial);
+            this.Controls.Add(this.label10);
             this.Controls.Add(this.ma_code);
             this.Controls.Add(this.label9);
             this.Controls.Add(this.BeginMac);
@@ -358,5 +388,7 @@
         private System.Windows.Forms.Label label8;
         private CustomControl.TextBoxWithIcon.EnterTextBox ma_code;
         private System.Windows.Forms.Label label9;
+        private CustomControl.TextBoxWithIcon.EnterTextBox currentSerial;
+        private System.Windows.Forms.Label label10;
     }
 }

+ 17 - 17
UAS_MES_ODLF/PublicMethod/Print.cs

@@ -110,23 +110,23 @@ namespace UAS_MES_NEW.PublicMethod
         {
             ErrorMessage = "";
             DataTable dt = new DataTable();
-            //if (IfRePrint != "-1")
-            //{
-            //    if (LabelType == "卡通箱标" || LabelType == "大箱标" || LabelType == "栈板标")
-            //    {
-            //        dt = (DataTable)dh.ExecuteSql("select lpl_id from labelprintlog where lpl_value='" + SnCode + "' and lpl_type='" + LabelType + "' and lpl_stepcode='" + User.CurrentStepCode + "'", "select");
-            //    }
-            //    else
-            //    {
-            //        dt = (DataTable)dh.ExecuteSql("select lpl_id from labelprintlog where lpl_value='" + SnCode + "' and lpl_makecode='" + MakeCode + "' and lpl_type='" + LabelType + "' and lpl_stepcode='" + User.CurrentStepCode + "'", "select");
-            //    }
-            //    ////如果已经打印过了,则不允许再打印
-            //    if (dt.Rows.Count > 0)
-            //    {
-            //        ErrorMessage = SnCode + LabelType + "已打印";
-            //        return false;
-            //    }
-            //}
+            if (IfRePrint != "-1")
+            {
+                if (LabelType == "卡通箱标" || LabelType == "大箱标" || LabelType == "栈板标")
+                {
+                    dt = (DataTable)dh.ExecuteSql("select lpl_id from labelprintlog where lpl_value='" + SnCode + "' and lpl_type='" + LabelType + "' and lpl_stepcode='" + User.CurrentStepCode + "'", "select");
+                }
+                else
+                {
+                    dt = (DataTable)dh.ExecuteSql("select lpl_id from labelprintlog where lpl_value='" + SnCode + "' and lpl_makecode='" + MakeCode + "' and lpl_type='" + LabelType + "' and lpl_stepcode='" + User.CurrentStepCode + "'", "select");
+                }
+                ////如果已经打印过了,则不允许再打印
+                if (dt.Rows.Count > 0)
+                {
+                    ErrorMessage = SnCode + LabelType + "已打印";
+                    return false;
+                }
+            }
             string filelastwritetime = dh.getFieldDataByCondition("label", "la_lastwritetime", "la_id = '" + LaID + "'").ToString();
             FileInfo PrintFile = new FileInfo(LabelName);
             //打开模板路径

+ 9 - 0
UAS_MES_ODLF/UAS_MES_ODLF.csproj

@@ -410,6 +410,12 @@
     <Compile Include="CustomControl\TextBoxWithIcon\SnCollectionBox.Designer.cs">
       <DependentUpon>SnCollectionBox.cs</DependentUpon>
     </Compile>
+    <Compile Include="CustomControl\TextBoxWithIcon\SourceStepCountPre.cs">
+      <SubType>UserControl</SubType>
+    </Compile>
+    <Compile Include="CustomControl\TextBoxWithIcon\SourceStepCountPre.Designer.cs">
+      <DependentUpon>SourceStepCountPre.cs</DependentUpon>
+    </Compile>
     <Compile Include="CustomControl\TextBoxWithIcon\SourceStepCount.cs">
       <SubType>UserControl</SubType>
     </Compile>
@@ -1204,6 +1210,9 @@
     <EmbeddedResource Include="CustomControl\TextBoxWithIcon\SnCollectionBox.resx">
       <DependentUpon>SnCollectionBox.cs</DependentUpon>
     </EmbeddedResource>
+    <EmbeddedResource Include="CustomControl\TextBoxWithIcon\SourceStepCountPre.resx">
+      <DependentUpon>SourceStepCountPre.cs</DependentUpon>
+    </EmbeddedResource>
     <EmbeddedResource Include="CustomControl\TextBoxWithIcon\SourceStepCount.resx">
       <DependentUpon>SourceStepCount.cs</DependentUpon>
     </EmbeddedResource>