Browse Source

feat 料站表更新下料功能

yhluo 1 month ago
parent
commit
7bd9ab47cc

+ 125 - 0
UAS_MES_BG/FunctionCode/Make/Make_UpdateDownLine.Designer.cs

@@ -0,0 +1,125 @@
+namespace UAS_MES_NEW.Make
+{
+    partial class Make_UpdateDownLine
+    {
+        /// <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.label1 = new System.Windows.Forms.Label();
+            this.Line = new System.Windows.Forms.ComboBox();
+            this.panel1 = new System.Windows.Forms.Panel();
+            this.Down = new System.Windows.Forms.Button();
+            this.DGV = new System.Windows.Forms.DataGridView();
+            this.panel1.SuspendLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.DGV)).BeginInit();
+            this.SuspendLayout();
+            // 
+            // label1
+            // 
+            this.label1.AutoSize = true;
+            this.label1.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label1.Location = new System.Drawing.Point(74, 94);
+            this.label1.Name = "label1";
+            this.label1.Size = new System.Drawing.Size(54, 28);
+            this.label1.TabIndex = 0;
+            this.label1.Text = "线体";
+            // 
+            // Line
+            // 
+            this.Line.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.Line.FormattingEnabled = true;
+            this.Line.Location = new System.Drawing.Point(156, 91);
+            this.Line.Name = "Line";
+            this.Line.Size = new System.Drawing.Size(254, 36);
+            this.Line.TabIndex = 1;
+            // 
+            // panel1
+            // 
+            this.panel1.Controls.Add(this.Down);
+            this.panel1.Controls.Add(this.label1);
+            this.panel1.Controls.Add(this.Line);
+            this.panel1.Dock = System.Windows.Forms.DockStyle.Top;
+            this.panel1.Location = new System.Drawing.Point(0, 0);
+            this.panel1.Name = "panel1";
+            this.panel1.Size = new System.Drawing.Size(1344, 220);
+            this.panel1.TabIndex = 2;
+            // 
+            // Down
+            // 
+            this.Down.Cursor = System.Windows.Forms.Cursors.Hand;
+            this.Down.Enabled = false;
+            this.Down.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.Down.Location = new System.Drawing.Point(450, 85);
+            this.Down.Name = "Down";
+            this.Down.Size = new System.Drawing.Size(146, 46);
+            this.Down.TabIndex = 2;
+            this.Down.Text = "确认下线";
+            this.Down.UseVisualStyleBackColor = true;
+            this.Down.Click += new System.EventHandler(this.Down_Click);
+            // 
+            // DGV
+            // 
+            this.DGV.AllowUserToAddRows = false;
+            this.DGV.AllowUserToDeleteRows = false;
+            this.DGV.BackgroundColor = System.Drawing.SystemColors.Control;
+            this.DGV.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
+            this.DGV.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.DGV.EditMode = System.Windows.Forms.DataGridViewEditMode.EditProgrammatically;
+            this.DGV.Location = new System.Drawing.Point(0, 220);
+            this.DGV.Name = "DGV";
+            this.DGV.ReadOnly = true;
+            this.DGV.RowHeadersWidth = 62;
+            this.DGV.RowTemplate.Height = 30;
+            this.DGV.Size = new System.Drawing.Size(1344, 492);
+            this.DGV.TabIndex = 3;
+            // 
+            // Make_UpdateDownLine
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 18F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.ClientSize = new System.Drawing.Size(1344, 712);
+            this.Controls.Add(this.DGV);
+            this.Controls.Add(this.panel1);
+            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
+            this.Name = "Make_UpdateDownLine";
+            this.Text = "Make_UpdateDownLine";
+            this.Load += new System.EventHandler(this.Make_UpdateDownLine_Load);
+            this.panel1.ResumeLayout(false);
+            this.panel1.PerformLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.DGV)).EndInit();
+            this.ResumeLayout(false);
+
+        }
+
+        #endregion
+
+        private System.Windows.Forms.Label label1;
+        private System.Windows.Forms.ComboBox Line;
+        private System.Windows.Forms.Panel panel1;
+        private System.Windows.Forms.Button Down;
+        private System.Windows.Forms.DataGridView DGV;
+    }
+}

+ 100 - 0
UAS_MES_BG/FunctionCode/Make/Make_UpdateDownLine.cs

@@ -0,0 +1,100 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.IO;
+using System.Linq;
+using System.Text;
+using System.Windows.Forms;
+using UAS_MES_NEW.DataOperate;
+using UAS_MES_NEW.Entity;
+
+namespace UAS_MES_NEW.Make
+{
+    public partial class Make_UpdateDownLine : Form
+    {
+        public Make_UpdateDownLine()
+        {
+            InitializeComponent();
+        }
+
+        StringBuilder SQL = new StringBuilder();
+
+        DataTable dt;
+        DataHelper dh;
+
+        bool authenticate;
+
+        private void Make_UpdateDownLine_Load(object sender, EventArgs e)
+        {
+            dh = SystemInf.dh;
+
+            SQL.Clear();
+            SQL.Append("SELECT dl_linecode FROM deviceline WHERE dl_type = 'SMT'");
+            dt = (DataTable)dh.ExecuteSql(SQL.ToString(), "select");
+            if (dt.Rows.Count > 0)
+            {
+                for(int i = dt.Rows.Count - 1; i >= 0; i--)
+                {
+                    Line.Items.Add(dt.Rows[i]["dl_linecode"]);
+                }
+                Down.Enabled = true;
+            }
+
+            SQL.Clear();
+            SQL.Append("SELECT * FROM deviceline_smt_log ORDER BY dl_indate DESC");
+            dt = (DataTable)dh.ExecuteSql(SQL.ToString(), "select");
+            if (dt.Rows.Count > 0)
+            {
+                DGV.DataSource = dt;
+            }
+
+            SQL.Clear();
+            SQL.Append($"select * from employee where em_type = 'admin' and em_name = '{User.UserName}'");
+            dt = (DataTable)dh.ExecuteSql(SQL.ToString(), "select");
+            if (dt.Rows.Count > 0)
+            {
+                authenticate = true;
+                Down.Enabled = true;
+            }
+        }
+
+        private void Down_Click(object sender, EventArgs e)
+        {
+            if (!authenticate)
+            {
+                return;
+            }
+
+            if (Line.SelectedIndex  == -1)
+            {
+                return;
+            }
+
+            DialogResult result = MessageBox.Show("确定是否下线在制工单","警告",MessageBoxButtons.OKCancel,MessageBoxIcon.Warning);
+            if(result != DialogResult.OK)
+            {
+                return;
+            }
+
+            string line = Line.Text;
+
+            SQL.Clear();
+            SQL.Append($"INSERT INTO DEVICELINE_SMT_LOG SELECT * FROM DEVICELINE WHERE DL_LINECODE = '{line}' AND DL_TYPE = 'SMT'");
+            dh.ExecuteSql(SQL.ToString(), "insert");
+
+            /*SQL.Clear();
+            SQL.Append($"DELETE DEVICELINE WHERE DL_TYPE = 'SMT' AND DL_LINECODE = '{line}'");
+            dh.ExecuteSql(SQL.ToString(), "delete");*/
+
+            SQL.Clear();
+            SQL.Append("SELECT * FROM deviceline_smt_log ORDER BY dl_indate DESC");
+            dt = (DataTable)dh.ExecuteSql(SQL.ToString(), "select");
+            if (dt.Rows.Count > 0)
+            {
+                DGV.DataSource = dt;
+            }
+        }
+    }
+}

+ 120 - 0
UAS_MES_BG/FunctionCode/Make/Make_UpdateDownLine.resx

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

+ 9 - 0
UAS_MES_BG/UAS_MES_BG.csproj

@@ -632,6 +632,12 @@
     <Compile Include="FunctionCode\Make\Make_ProcessIn.Designer.cs">
       <DependentUpon>Make_ProcessIn.cs</DependentUpon>
     </Compile>
+    <Compile Include="FunctionCode\Make\Make_UpdateDownLine.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="FunctionCode\Make\Make_UpdateDownLine.Designer.cs">
+      <DependentUpon>Make_UpdateDownLine.cs</DependentUpon>
+    </Compile>
     <Compile Include="FunctionCode\OQC\OQC_BatchResultJudge.cs">
       <SubType>Form</SubType>
     </Compile>
@@ -1384,6 +1390,9 @@
     <EmbeddedResource Include="FunctionCode\Make\Make_ProcessIn.resx">
       <DependentUpon>Make_ProcessIn.cs</DependentUpon>
     </EmbeddedResource>
+    <EmbeddedResource Include="FunctionCode\Make\Make_UpdateDownLine.resx">
+      <DependentUpon>Make_UpdateDownLine.cs</DependentUpon>
+    </EmbeddedResource>
     <EmbeddedResource Include="FunctionCode\OQC\OQC_BatchResultJudge.resx">
       <DependentUpon>OQC_BatchResultJudge.cs</DependentUpon>
     </EmbeddedResource>