Browse Source

Merge repos.ubtob.net:usoft/mes-client

callm 5 days ago
parent
commit
b30969bc5d

+ 460 - 0
UAS_MES_HYSX/FunctionCode/Make/Make_HandFeedRegistration.Designer.cs

@@ -0,0 +1,460 @@
+namespace UAS_MES_NEW.Make
+{
+    partial class Make_HandFeedRegistration
+    {
+        /// <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.SNDetails = new UAS_MES_NEW.CustomControl.GroupBoxWithBorder.GroupBoxWithBorder();
+            this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
+            this.productName = new System.Windows.Forms.Label();
+            this.productCode = new System.Windows.Forms.Label();
+            this.workOrder = new System.Windows.Forms.Label();
+            this.label4 = new System.Windows.Forms.Label();
+            this.label1 = new System.Windows.Forms.Label();
+            this.label3 = new System.Windows.Forms.Label();
+            this.label2 = new System.Windows.Forms.Label();
+            this.serialNumber = new System.Windows.Forms.Label();
+            this.containerBox = new System.Windows.Forms.Panel();
+            this.dgv = new System.Windows.Forms.DataGridView();
+            this.executeBox = new System.Windows.Forms.Panel();
+            this.handCount = new System.Windows.Forms.Label();
+            this.submit = new System.Windows.Forms.Button();
+            this.query = new System.Windows.Forms.Button();
+            this.machineVal = new System.Windows.Forms.ComboBox();
+            this.machineLab = new System.Windows.Forms.Label();
+            this.snVal = new System.Windows.Forms.TextBox();
+            this.snLab = new System.Windows.Forms.Label();
+            this.rn = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.isHandReel = new System.Windows.Forms.DataGridViewCheckBoxColumn();
+            this.ms_sncode = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.ps_linecode = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.ps_processcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.ps_table = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.psl_location = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.psl_bomlocation = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.psl_prodcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.psl_baseqty = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.SNDetails.SuspendLayout();
+            this.tableLayoutPanel1.SuspendLayout();
+            this.containerBox.SuspendLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.dgv)).BeginInit();
+            this.executeBox.SuspendLayout();
+            this.SuspendLayout();
+            // 
+            // SNDetails
+            // 
+            this.SNDetails.BorderColor = System.Drawing.Color.Black;
+            this.SNDetails.Controls.Add(this.tableLayoutPanel1);
+            this.SNDetails.Dock = System.Windows.Forms.DockStyle.Top;
+            this.SNDetails.Font = new System.Drawing.Font("微软雅黑", 12F);
+            this.SNDetails.Location = new System.Drawing.Point(0, 0);
+            this.SNDetails.Name = "SNDetails";
+            this.SNDetails.Size = new System.Drawing.Size(1600, 123);
+            this.SNDetails.TabIndex = 27;
+            this.SNDetails.TabStop = false;
+            this.SNDetails.Text = "产品序列信息";
+            this.SNDetails.TextColor = System.Drawing.Color.Black;
+            // 
+            // tableLayoutPanel1
+            // 
+            this.tableLayoutPanel1.ColumnCount = 8;
+            this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 6.451613F));
+            this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 12.09677F));
+            this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 6.451613F));
+            this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 12.09677F));
+            this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 6.451613F));
+            this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 13.19F));
+            this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 6.451613F));
+            this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 36.81F));
+            this.tableLayoutPanel1.Controls.Add(this.productName, 7, 0);
+            this.tableLayoutPanel1.Controls.Add(this.productCode, 5, 0);
+            this.tableLayoutPanel1.Controls.Add(this.workOrder, 3, 0);
+            this.tableLayoutPanel1.Controls.Add(this.label4, 6, 0);
+            this.tableLayoutPanel1.Controls.Add(this.label1, 0, 0);
+            this.tableLayoutPanel1.Controls.Add(this.label3, 4, 0);
+            this.tableLayoutPanel1.Controls.Add(this.label2, 2, 0);
+            this.tableLayoutPanel1.Controls.Add(this.serialNumber, 1, 0);
+            this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Bottom;
+            this.tableLayoutPanel1.Location = new System.Drawing.Point(3, 37);
+            this.tableLayoutPanel1.Name = "tableLayoutPanel1";
+            this.tableLayoutPanel1.RowCount = 1;
+            this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
+            this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 83F));
+            this.tableLayoutPanel1.Size = new System.Drawing.Size(1594, 83);
+            this.tableLayoutPanel1.TabIndex = 0;
+            // 
+            // productName
+            // 
+            this.productName.AutoSize = true;
+            this.productName.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.productName.Location = new System.Drawing.Point(1005, 0);
+            this.productName.Name = "productName";
+            this.productName.Size = new System.Drawing.Size(586, 83);
+            this.productName.TabIndex = 7;
+            this.productName.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+            // 
+            // productCode
+            // 
+            this.productCode.AutoSize = true;
+            this.productCode.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.productCode.Location = new System.Drawing.Point(693, 0);
+            this.productCode.Name = "productCode";
+            this.productCode.Size = new System.Drawing.Size(204, 83);
+            this.productCode.TabIndex = 6;
+            this.productCode.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+            // 
+            // workOrder
+            // 
+            this.workOrder.AutoSize = true;
+            this.workOrder.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.workOrder.Location = new System.Drawing.Point(399, 0);
+            this.workOrder.Name = "workOrder";
+            this.workOrder.Size = new System.Drawing.Size(186, 83);
+            this.workOrder.TabIndex = 5;
+            this.workOrder.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+            // 
+            // label4
+            // 
+            this.label4.AutoSize = true;
+            this.label4.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.label4.Location = new System.Drawing.Point(903, 0);
+            this.label4.Name = "label4";
+            this.label4.Size = new System.Drawing.Size(96, 83);
+            this.label4.TabIndex = 3;
+            this.label4.Text = "产品名称: ";
+            this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+            // 
+            // label1
+            // 
+            this.label1.AutoSize = true;
+            this.label1.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.label1.Location = new System.Drawing.Point(3, 0);
+            this.label1.Name = "label1";
+            this.label1.Size = new System.Drawing.Size(96, 83);
+            this.label1.TabIndex = 0;
+            this.label1.Text = "序列号: ";
+            this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+            // 
+            // label3
+            // 
+            this.label3.AutoSize = true;
+            this.label3.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.label3.Location = new System.Drawing.Point(591, 0);
+            this.label3.Name = "label3";
+            this.label3.Size = new System.Drawing.Size(96, 83);
+            this.label3.TabIndex = 2;
+            this.label3.Text = "产品编号: ";
+            this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+            // 
+            // label2
+            // 
+            this.label2.AutoSize = true;
+            this.label2.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.label2.Location = new System.Drawing.Point(297, 0);
+            this.label2.Name = "label2";
+            this.label2.Size = new System.Drawing.Size(96, 83);
+            this.label2.TabIndex = 1;
+            this.label2.Text = "工单: ";
+            this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+            // 
+            // serialNumber
+            // 
+            this.serialNumber.AutoSize = true;
+            this.serialNumber.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.serialNumber.Location = new System.Drawing.Point(105, 0);
+            this.serialNumber.Name = "serialNumber";
+            this.serialNumber.Size = new System.Drawing.Size(186, 83);
+            this.serialNumber.TabIndex = 4;
+            this.serialNumber.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+            // 
+            // containerBox
+            // 
+            this.containerBox.Controls.Add(this.executeBox);
+            this.containerBox.Controls.Add(this.dgv);
+            this.containerBox.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.containerBox.Location = new System.Drawing.Point(0, 123);
+            this.containerBox.Name = "containerBox";
+            this.containerBox.Size = new System.Drawing.Size(1600, 777);
+            this.containerBox.TabIndex = 28;
+            // 
+            // dgv
+            // 
+            this.dgv.AllowUserToAddRows = false;
+            this.dgv.AllowUserToDeleteRows = false;
+            this.dgv.AllowUserToResizeRows = false;
+            this.dgv.BackgroundColor = System.Drawing.SystemColors.Control;
+            this.dgv.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
+            this.dgv.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
+            this.rn,
+            this.isHandReel,
+            this.ms_sncode,
+            this.ps_linecode,
+            this.ps_processcode,
+            this.ps_table,
+            this.psl_location,
+            this.psl_bomlocation,
+            this.psl_prodcode,
+            this.psl_baseqty});
+            this.dgv.Dock = System.Windows.Forms.DockStyle.Top;
+            this.dgv.Location = new System.Drawing.Point(0, 0);
+            this.dgv.Name = "dgv";
+            this.dgv.RowHeadersVisible = false;
+            this.dgv.RowHeadersWidth = 62;
+            this.dgv.RowTemplate.Height = 30;
+            this.dgv.Size = new System.Drawing.Size(1600, 641);
+            this.dgv.TabIndex = 1;
+            this.dgv.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgv_CellClick);
+            // 
+            // executeBox
+            // 
+            this.executeBox.Controls.Add(this.handCount);
+            this.executeBox.Controls.Add(this.submit);
+            this.executeBox.Controls.Add(this.query);
+            this.executeBox.Controls.Add(this.machineVal);
+            this.executeBox.Controls.Add(this.machineLab);
+            this.executeBox.Controls.Add(this.snVal);
+            this.executeBox.Controls.Add(this.snLab);
+            this.executeBox.Dock = System.Windows.Forms.DockStyle.Bottom;
+            this.executeBox.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.executeBox.Location = new System.Drawing.Point(0, 647);
+            this.executeBox.Name = "executeBox";
+            this.executeBox.Size = new System.Drawing.Size(1600, 130);
+            this.executeBox.TabIndex = 0;
+            // 
+            // handCount
+            // 
+            this.handCount.AutoSize = true;
+            this.handCount.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.handCount.Location = new System.Drawing.Point(935, 24);
+            this.handCount.Name = "handCount";
+            this.handCount.Size = new System.Drawing.Size(117, 28);
+            this.handCount.TabIndex = 6;
+            this.handCount.Text = "补料数量:";
+            // 
+            // submit
+            // 
+            this.submit.Cursor = System.Windows.Forms.Cursors.Hand;
+            this.submit.Location = new System.Drawing.Point(1033, 18);
+            this.submit.Name = "submit";
+            this.submit.Size = new System.Drawing.Size(140, 32);
+            this.submit.TabIndex = 5;
+            this.submit.Text = "提交手补料";
+            this.submit.UseVisualStyleBackColor = true;
+            this.submit.Click += new System.EventHandler(this.submit_Click);
+            // 
+            // query
+            // 
+            this.query.Cursor = System.Windows.Forms.Cursors.Hand;
+            this.query.Location = new System.Drawing.Point(837, 18);
+            this.query.Name = "query";
+            this.query.Size = new System.Drawing.Size(80, 32);
+            this.query.TabIndex = 4;
+            this.query.Text = "查询";
+            this.query.UseVisualStyleBackColor = true;
+            this.query.Click += new System.EventHandler(this.query_Click);
+            // 
+            // machineVal
+            // 
+            this.machineVal.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.machineVal.FormattingEnabled = true;
+            this.machineVal.Location = new System.Drawing.Point(492, 20);
+            this.machineVal.Name = "machineVal";
+            this.machineVal.Size = new System.Drawing.Size(327, 32);
+            this.machineVal.TabIndex = 3;
+            // 
+            // machineLab
+            // 
+            this.machineLab.AutoSize = true;
+            this.machineLab.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.machineLab.Location = new System.Drawing.Point(397, 20);
+            this.machineLab.Name = "machineLab";
+            this.machineLab.Size = new System.Drawing.Size(101, 28);
+            this.machineLab.TabIndex = 2;
+            this.machineLab.Text = "机台名称:";
+            // 
+            // snVal
+            // 
+            this.snVal.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.snVal.Location = new System.Drawing.Point(114, 20);
+            this.snVal.Name = "snVal";
+            this.snVal.Size = new System.Drawing.Size(263, 31);
+            this.snVal.TabIndex = 1;
+            this.snVal.KeyDown += new System.Windows.Forms.KeyEventHandler(this.snVal_KeyDown);
+            // 
+            // snLab
+            // 
+            this.snLab.AutoSize = true;
+            this.snLab.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.snLab.Location = new System.Drawing.Point(38, 20);
+            this.snLab.Name = "snLab";
+            this.snLab.Size = new System.Drawing.Size(80, 28);
+            this.snLab.TabIndex = 0;
+            this.snLab.Text = "序列号:";
+            // 
+            // rn
+            // 
+            this.rn.DataPropertyName = "rn";
+            this.rn.HeaderText = "序号";
+            this.rn.MinimumWidth = 8;
+            this.rn.Name = "rn";
+            this.rn.Width = 60;
+            // 
+            // isHandReel
+            // 
+            this.isHandReel.HeaderText = "是否手补料";
+            this.isHandReel.MinimumWidth = 8;
+            this.isHandReel.Name = "isHandReel";
+            this.isHandReel.Width = 80;
+            // 
+            // ms_sncode
+            // 
+            this.ms_sncode.DataPropertyName = "ms_sncode";
+            this.ms_sncode.HeaderText = "序列号";
+            this.ms_sncode.MinimumWidth = 8;
+            this.ms_sncode.Name = "ms_sncode";
+            this.ms_sncode.ReadOnly = true;
+            this.ms_sncode.Width = 130;
+            // 
+            // ps_linecode
+            // 
+            this.ps_linecode.DataPropertyName = "ps_linecode";
+            this.ps_linecode.HeaderText = "线体";
+            this.ps_linecode.MinimumWidth = 8;
+            this.ps_linecode.Name = "ps_linecode";
+            this.ps_linecode.ReadOnly = true;
+            // 
+            // ps_processcode
+            // 
+            this.ps_processcode.DataPropertyName = "ps_processcode";
+            this.ps_processcode.HeaderText = "机台名称";
+            this.ps_processcode.MinimumWidth = 8;
+            this.ps_processcode.Name = "ps_processcode";
+            this.ps_processcode.ReadOnly = true;
+            this.ps_processcode.Width = 190;
+            // 
+            // ps_table
+            // 
+            this.ps_table.DataPropertyName = "ps_table";
+            this.ps_table.HeaderText = "面别";
+            this.ps_table.MinimumWidth = 8;
+            this.ps_table.Name = "ps_table";
+            this.ps_table.ReadOnly = true;
+            this.ps_table.Width = 80;
+            // 
+            // psl_location
+            // 
+            this.psl_location.DataPropertyName = "psl_location";
+            this.psl_location.HeaderText = "站位编号";
+            this.psl_location.MinimumWidth = 8;
+            this.psl_location.Name = "psl_location";
+            this.psl_location.ReadOnly = true;
+            this.psl_location.Width = 90;
+            // 
+            // psl_bomlocation
+            // 
+            this.psl_bomlocation.DataPropertyName = "psl_bomlocation";
+            this.psl_bomlocation.HeaderText = "元件位置";
+            this.psl_bomlocation.MinimumWidth = 8;
+            this.psl_bomlocation.Name = "psl_bomlocation";
+            this.psl_bomlocation.ReadOnly = true;
+            this.psl_bomlocation.Width = 210;
+            // 
+            // psl_prodcode
+            // 
+            this.psl_prodcode.DataPropertyName = "psl_prodcode";
+            this.psl_prodcode.HeaderText = "物料编号";
+            this.psl_prodcode.MinimumWidth = 8;
+            this.psl_prodcode.Name = "psl_prodcode";
+            this.psl_prodcode.ReadOnly = true;
+            this.psl_prodcode.Width = 140;
+            // 
+            // psl_baseqty
+            // 
+            this.psl_baseqty.DataPropertyName = "psl_baseqty";
+            this.psl_baseqty.HeaderText = "单位用量";
+            this.psl_baseqty.MinimumWidth = 8;
+            this.psl_baseqty.Name = "psl_baseqty";
+            this.psl_baseqty.ReadOnly = true;
+            // 
+            // Make_HandFeedRegistration
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(11F, 24F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.ClientSize = new System.Drawing.Size(1600, 900);
+            this.Controls.Add(this.containerBox);
+            this.Controls.Add(this.SNDetails);
+            this.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
+            this.Margin = new System.Windows.Forms.Padding(4);
+            this.Name = "Make_HandFeedRegistration";
+            this.Text = "Make_HandFeedRegistration";
+            this.Load += new System.EventHandler(this.Make_HandFeedRegistration_Load);
+            this.SNDetails.ResumeLayout(false);
+            this.tableLayoutPanel1.ResumeLayout(false);
+            this.tableLayoutPanel1.PerformLayout();
+            this.containerBox.ResumeLayout(false);
+            ((System.ComponentModel.ISupportInitialize)(this.dgv)).EndInit();
+            this.executeBox.ResumeLayout(false);
+            this.executeBox.PerformLayout();
+            this.ResumeLayout(false);
+
+        }
+
+        #endregion
+
+        private CustomControl.GroupBoxWithBorder.GroupBoxWithBorder SNDetails;
+        private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
+        private System.Windows.Forms.Label productName;
+        private System.Windows.Forms.Label productCode;
+        private System.Windows.Forms.Label workOrder;
+        private System.Windows.Forms.Label label4;
+        private System.Windows.Forms.Label label1;
+        private System.Windows.Forms.Label label3;
+        private System.Windows.Forms.Label label2;
+        private System.Windows.Forms.Label serialNumber;
+        private System.Windows.Forms.Panel containerBox;
+        private System.Windows.Forms.DataGridView dgv;
+        private System.Windows.Forms.Panel executeBox;
+        private System.Windows.Forms.Label snLab;
+        private System.Windows.Forms.TextBox snVal;
+        private System.Windows.Forms.Label machineLab;
+        private System.Windows.Forms.ComboBox machineVal;
+        private System.Windows.Forms.Button query;
+        private System.Windows.Forms.Button submit;
+        private System.Windows.Forms.Label handCount;
+        private System.Windows.Forms.DataGridViewTextBoxColumn rn;
+        private System.Windows.Forms.DataGridViewCheckBoxColumn isHandReel;
+        private System.Windows.Forms.DataGridViewTextBoxColumn ms_sncode;
+        private System.Windows.Forms.DataGridViewTextBoxColumn ps_linecode;
+        private System.Windows.Forms.DataGridViewTextBoxColumn ps_processcode;
+        private System.Windows.Forms.DataGridViewTextBoxColumn ps_table;
+        private System.Windows.Forms.DataGridViewTextBoxColumn psl_location;
+        private System.Windows.Forms.DataGridViewTextBoxColumn psl_bomlocation;
+        private System.Windows.Forms.DataGridViewTextBoxColumn psl_prodcode;
+        private System.Windows.Forms.DataGridViewTextBoxColumn psl_baseqty;
+    }
+}

+ 253 - 0
UAS_MES_HYSX/FunctionCode/Make/Make_HandFeedRegistration.cs

@@ -0,0 +1,253 @@
+using DevComponents.DotNetBar.Controls;
+using NPOI.SS.Formula.Eval;
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Data.SqlClient;
+using System.Drawing;
+using System.IO;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+using UAS_MES_NEW.DataOperate;
+using UAS_MES_NEW.Entity;
+
+namespace UAS_MES_NEW.Make
+{
+    public partial class Make_HandFeedRegistration : Form
+    {
+        public Make_HandFeedRegistration()
+        {
+            InitializeComponent();
+        }
+
+        StringBuilder SQL = new StringBuilder();
+        DataTable dt;
+        DataHelper dh;
+        int checkedCount = 0;
+
+        private void Make_HandFeedRegistration_Load(object sender, EventArgs e)
+        {
+            dh = SystemInf.dh;
+            snVal.Focus();
+            snVal.SelectAll();
+
+            submit.Enabled = false;
+
+            handCount.Text = $"补料数量: {checkedCount}";
+        }
+
+        private void snVal_KeyDown(object sender, KeyEventArgs e)
+        {
+            if (e.KeyCode != Keys.Enter) return;
+
+            snVal.Text = snVal.Text.Replace(";", ";").Trim();
+
+            SQL.Clear();
+            //SQL.Append($@"SELECT * FROM (SELECT ms_makecode,ms_prodcode,ps_linecode,ps_processcode,
+            //    ps_table,ROW_NUMBER() OVER(PARTITION BY ps_processcode ORDER BY ps_auditdate DESC) AS rn
+            //    FROM makeserial a,productsmt b WHERE a.ms_sncode = '{snVal.Text}' AND a.ms_prodcode = b.ps_prodcode
+            //    AND instr(ps_linecode, a.ms_linecode) > 0) WHERE rn = 1 ORDER BY ps_processcode");
+            SQL.Append($@"SELECT ps_processcode FROM makeserial a,productsmt b 
+                WHERE a.ms_sncode = '{snVal.Text}' AND a.ms_prodcode = b.ps_prodcode");
+            dt = (DataTable)dh.ExecuteSql(SQL.ToString(), "select");
+            if (dt.Rows.Count > 0)
+            {
+                machineVal.Items.Clear();
+                foreach (DataRow dr in dt.Rows)
+                {
+                    machineVal.Items.Add(dr["ps_processcode"].ToString());
+                }
+
+                machineVal.SelectedIndex = 0;
+                machineVal.SelectAll();
+
+                UpdateSN("L", snVal.Text);
+                query_Click(null, null);
+            }
+            else
+            {
+                UpdateSN("C");
+                machineVal.Items.Clear();
+                machineVal.SelectedIndex = -1;
+                snVal.Focus();
+                snVal.SelectAll();
+                MessageBox.Show("该序列号没有对应机台", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
+            }
+        }
+
+        private void query_Click(object sender, EventArgs e)
+        {
+            if (string.IsNullOrEmpty(snVal.Text))
+            {
+                MessageBox.Show("请扫描序列号", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
+                snVal.Focus();
+                snVal.SelectAll();
+                return;
+            }
+
+            if (string.IsNullOrEmpty(machineVal.Text))
+            {
+                MessageBox.Show("请选择机台名称", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
+                machineVal.SelectAll();
+                return;
+            }
+
+            SQL.Clear();
+            SQL.Append($@"SELECT rownum rn,ms_sncode,ps_linecode,
+                ps_processcode,ps_table,psl_location,psl_bomlocation,psl_prodcode,psl_baseqty 
+                FROM makeserial a,productsmt b,productsmtlocation c
+                WHERE a.ms_sncode = '{snVal.Text}' AND b.ps_processcode = '{machineVal.Text}'
+                AND a.ms_prodcode = b.ps_prodcode AND b.ps_id = c.psl_psid ORDER BY psl_detno");
+            dt = (DataTable)dh.ExecuteSql(SQL.ToString(), "select");
+            if (dt.Rows.Count > 0)
+            {
+                dgv.DataSource = dt;
+                checkedCount = 0;
+                handCount.Text = $"补料数量: {checkedCount}";
+                submit.Enabled = true;
+            }
+
+        }
+
+        private void dgv_CellClick(object sender, DataGridViewCellEventArgs e)
+        {
+            if (e.RowIndex < 0 || e.ColumnIndex < 0) return;
+
+            var column = dgv.Columns[e.ColumnIndex];
+
+            if (column is DataGridViewCheckBoxColumn)
+            {
+                var cell = dgv[e.ColumnIndex, e.RowIndex] as DataGridViewCheckBoxCell;
+
+                if (cell != null && !cell.ReadOnly)
+                {
+                    bool currentValue = false;
+                    if (cell.Value != null && cell.Value != DBNull.Value)
+                    {
+                        currentValue = Convert.ToBoolean(cell.Value);
+                    }
+
+                    cell.Value = !currentValue;
+                    dgv.CommitEdit(DataGridViewDataErrorContexts.Commit);
+                    dgv.EndEdit();
+
+                    var row = dgv.Rows[e.RowIndex];
+
+                    if (currentValue)
+                    {
+                        row.DefaultCellStyle.BackColor = dgv.DefaultCellStyle.BackColor;
+                        row.DefaultCellStyle.ForeColor = dgv.DefaultCellStyle.ForeColor;
+                        checkedCount--;
+                    }
+                    else
+                    {
+                        row.DefaultCellStyle.BackColor = Color.LightSkyBlue;
+                        row.DefaultCellStyle.ForeColor = Color.Black;
+                        checkedCount++;
+                    }
+
+                    handCount.Text = $"补料数量: {checkedCount}";
+
+                    if (checkedCount > 0)
+                    {
+                        submit.Enabled = true;
+                    }
+                    else
+                    {
+                        submit.Enabled = false;
+                    }
+                }
+            }
+        }
+
+        private void submit_Click(object sender, EventArgs e)
+        {
+            if (checkedCount == 0)
+            {
+                MessageBox.Show("请勾选所补物料对应站位信息", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
+                return;
+            }
+
+            DataTable upLoadDatas = new DataTable();
+            upLoadDatas.Columns.Add(new DataColumn("rn"));
+            upLoadDatas.Columns.Add(new DataColumn("ms_sncode"));
+            upLoadDatas.Columns.Add(new DataColumn("ps_linecode"));
+            upLoadDatas.Columns.Add(new DataColumn("ps_processcode"));
+            upLoadDatas.Columns.Add(new DataColumn("ps_table"));
+            upLoadDatas.Columns.Add(new DataColumn("psl_location"));
+            upLoadDatas.Columns.Add(new DataColumn("psl_bomlocation"));
+            upLoadDatas.Columns.Add(new DataColumn("psl_prodcode"));
+            upLoadDatas.Columns.Add(new DataColumn("psl_baseqty"));
+
+            foreach (DataGridViewRow item in dgv.Rows)
+            {
+                var checkCell = item.Cells["isHandReel"] as DataGridViewCheckBoxCell;
+                if (Convert.ToBoolean(checkCell.Value))
+                {
+                    upLoadDatas.Rows.Add(item.Cells["rn"].Value, item.Cells["ms_sncode"].Value, item.Cells["ps_linecode"].Value, 
+                        item.Cells["ps_processcode"].Value, item.Cells["ps_table"].Value, item.Cells["psl_location"].Value,
+                        item.Cells["psl_bomlocation"].Value, item.Cells["psl_prodcode"].Value, item.Cells["psl_baseqty"].Value);
+                }
+            }
+            dgv.DataSource = upLoadDatas;
+
+            foreach (DataGridViewRow rw in dgv.Rows)
+            {
+                var checkCell = rw.Cells["isHandReel"] as DataGridViewCheckBoxCell;
+                checkCell.Value = true;
+
+                try
+                {
+                    SQL.Clear();
+                    SQL.Append($@"INSERT INTO smt_handreel_log (serial_number,line_name,machine_name,side,
+                    position,reel_position, part_no, reel_qty, 
+                    update_time, update_name) VALUES 
+                    ( '{rw.Cells["ms_sncode"].Value}','{rw.Cells["ps_linecode"].Value}','{rw.Cells["ps_processcode"].Value}','{rw.Cells["ps_table"].Value}',
+                    '{rw.Cells["psl_location"].Value}','{rw.Cells["psl_bomlocation"].Value}','{rw.Cells["psl_prodcode"].Value}','{rw.Cells["psl_baseqty"].Value}',
+                    sysdate,'{User.UserName}' )");
+                    dh.ExecuteSql(SQL.ToString(), "insert");
+                }
+                catch (Exception ex)
+                {
+                    MessageBox.Show($"提交手补料异常{ex.Message}", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
+                    return;
+                }
+            }
+
+            MessageBox.Show("已提交手补料记录", "提示", MessageBoxButtons.OK, MessageBoxIcon.None);
+            submit.Enabled = false;
+        }
+
+        private void UpdateSN(string type, string sn = "")
+        {
+            if (type == "C")
+            {
+                serialNumber.Text = "";
+                workOrder.Text = "";
+                productCode.Text = "";
+                productName.Text = "";
+            }
+            else if (type == "L")
+            {
+                SQL.Clear();
+                SQL.Append($@"SELECT ms_sncode,ma_code,pr_code,pr_spec FROM makeserial,make,product
+                        WHERE ms_sncode = '{sn}' AND ms_makecode = ma_code AND ms_prodcode = pr_code");
+                dt = (DataTable)dh.ExecuteSql(SQL.ToString(), "select");
+                if (dt.Rows.Count > 0)
+                {
+                    serialNumber.Text = dt.Rows[0]["ms_sncode"].ToString();
+                    workOrder.Text = dt.Rows[0]["ma_code"].ToString();
+                    productCode.Text = dt.Rows[0]["pr_code"].ToString();
+                    productName.Text = dt.Rows[0]["pr_spec"].ToString();
+                }
+                else
+                {
+                    UpdateSN("C", sn);
+                }
+            }
+        }
+    }
+}

+ 150 - 0
UAS_MES_HYSX/FunctionCode/Make/Make_HandFeedRegistration.resx

@@ -0,0 +1,150 @@
+<?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="rn.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="isHandReel.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="ms_sncode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="ps_linecode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="ps_processcode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="ps_table.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="psl_location.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="psl_bomlocation.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="psl_prodcode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="psl_baseqty.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+</root>

+ 4 - 4
UAS_MES_HYSX/FunctionCode/Make/Make_SocketClient.Designer.cs → UAS_MES_HYSX/FunctionCode/Make/Make_TcpClient.Designer.cs

@@ -1,6 +1,6 @@
 namespace UAS_MES_NEW.FunctionCode.Make
 {
-    partial class Make_SocketClient
+    partial class Make_TcpClient
     {
         /// <summary>
         /// Required designer variable.
@@ -30,13 +30,13 @@
         {
             this.SuspendLayout();
             // 
-            // Make_SocketClient
+            // Make_TcpClient
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 18F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.ClientSize = new System.Drawing.Size(800, 450);
-            this.Name = "Make_SocketClient";
-            this.Text = "Make_SocketClient";
+            this.Name = "Make_TcpClient";
+            this.Text = "Make_TcpClient.cs";
             this.Load += new System.EventHandler(this.Make_SocketClient_Load);
             this.ResumeLayout(false);
 

+ 2 - 2
UAS_MES_HYSX/FunctionCode/Make/Make_SocketClient.cs → UAS_MES_HYSX/FunctionCode/Make/Make_TcpClient.cs

@@ -14,9 +14,9 @@ using System.Windows.Forms;
 
 namespace UAS_MES_NEW.FunctionCode.Make
 {
-    public partial class Make_SocketClient : Form
+    public partial class Make_TcpClient : Form
     {
-        public Make_SocketClient()
+        public Make_TcpClient()
         {
             InitializeComponent();
         }

+ 0 - 0
UAS_MES_HYSX/FunctionCode/Make/Make_SocketClient.resx → UAS_MES_HYSX/FunctionCode/Make/Make_TcpClient.resx


+ 14 - 5
UAS_MES_HYSX/UAS_MES_HYSX.csproj

@@ -569,6 +569,12 @@
     <Compile Include="FunctionCode\Make\Make_CollectElec.Designer.cs">
       <DependentUpon>Make_CollectElec.cs</DependentUpon>
     </Compile>
+    <Compile Include="FunctionCode\Make\Make_HandFeedRegistration.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="FunctionCode\Make\Make_HandFeedRegistration.Designer.cs">
+      <DependentUpon>Make_HandFeedRegistration.cs</DependentUpon>
+    </Compile>
     <Compile Include="FunctionCode\Make\Make_ImeiCheckZX.cs">
       <SubType>Form</SubType>
     </Compile>
@@ -749,11 +755,11 @@
     <Compile Include="FunctionCode\Make\Make_SmtTestCollection.Designer.cs">
       <DependentUpon>Make_SmtTestCollection.cs</DependentUpon>
     </Compile>
-    <Compile Include="FunctionCode\Make\Make_SocketClient.cs">
+    <Compile Include="FunctionCode\Make\Make_TcpClient.cs">
       <SubType>Form</SubType>
     </Compile>
-    <Compile Include="FunctionCode\Make\Make_SocketClient.Designer.cs">
-      <DependentUpon>Make_SocketClient.cs</DependentUpon>
+    <Compile Include="FunctionCode\Make\Make_TcpClient.Designer.cs">
+      <DependentUpon>Make_TcpClient.cs</DependentUpon>
     </Compile>
     <Compile Include="FunctionCode\Make\Make_StencilPrint.cs">
       <SubType>Form</SubType>
@@ -1702,6 +1708,9 @@
     <EmbeddedResource Include="FunctionCode\Make\Make_CollectElec.resx">
       <DependentUpon>Make_CollectElec.cs</DependentUpon>
     </EmbeddedResource>
+    <EmbeddedResource Include="FunctionCode\Make\Make_HandFeedRegistration.resx">
+      <DependentUpon>Make_HandFeedRegistration.cs</DependentUpon>
+    </EmbeddedResource>
     <EmbeddedResource Include="FunctionCode\Make\Make_ImeiCheckZX.resx">
       <DependentUpon>Make_ImeiCheckZX.cs</DependentUpon>
     </EmbeddedResource>
@@ -1794,8 +1803,8 @@
     <EmbeddedResource Include="FunctionCode\Make\Make_SmtTestCollection.resx">
       <DependentUpon>Make_SmtTestCollection.cs</DependentUpon>
     </EmbeddedResource>
-    <EmbeddedResource Include="FunctionCode\Make\Make_SocketClient.resx">
-      <DependentUpon>Make_SocketClient.cs</DependentUpon>
+    <EmbeddedResource Include="FunctionCode\Make\Make_TcpClient.resx">
+      <DependentUpon>Make_TcpClient.cs</DependentUpon>
     </EmbeddedResource>
     <EmbeddedResource Include="FunctionCode\Make\Make_StencilPrint.resx">
       <DependentUpon>Make_StencilPrint.cs</DependentUpon>