浏览代码

添加老化新界面

callm 1 月之前
父节点
当前提交
98ae451b99

+ 311 - 0
UAS_MES_ZT/FunctionCode/Make/Make_AgingCopy.Designer.cs

@@ -0,0 +1,311 @@
+namespace UAS_MES_NEW.Make
+{
+    partial class Make_AgingCopy
+    {
+        /// <summary>
+        /// Required designer variable.
+        /// </summary>
+        private System.ComponentModel.IContainer components = null;
+
+        /// <summary>
+        /// Clean up any resources being used.
+        /// </summary>
+        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+        protected override void Dispose(bool disposing)
+        {
+            if (disposing && (components != null))
+            {
+                components.Dispose();
+            }
+            base.Dispose(disposing);
+        }
+
+        #region Windows Form Designer generated code
+
+        /// <summary>
+        /// Required method for Designer support - do not modify
+        /// the contents of this method with the code editor.
+        /// </summary>
+        private void InitializeComponent()
+        {
+            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Make_AgingCopy));
+            this.pr_detail_label = new System.Windows.Forms.Label();
+            this.sncode_label = new System.Windows.Forms.Label();
+            this.pr_code_label = new System.Windows.Forms.Label();
+            this.ms_makecode_label = new System.Windows.Forms.Label();
+            this.confirm = new UAS_MES_NEW.CustomControl.ButtonUtil.NormalButton();
+            this.ms_makecode = new UAS_MES_NEW.CustomControl.ValueLabel.ValueLabel();
+            this.ms_prodcode = new UAS_MES_NEW.CustomControl.ValueLabel.ValueLabel();
+            this.pr_detail = new UAS_MES_NEW.CustomControl.ValueLabel.ValueLabel();
+            this.sncode = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.SnCollectionBox();
+            this.OperateResult = new UAS_MES_NEW.CustomControl.RichText.RichTextAutoBottom();
+            this.label1 = new System.Windows.Forms.Label();
+            this.agcode = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.SnCollectionBox();
+            this.checkBox1 = new System.Windows.Forms.CheckBox();
+            this.quxiao = new System.Windows.Forms.CheckBox();
+            this.agsum = new UAS_MES_NEW.CustomControl.ValueLabel.ValueLabel();
+            this.label2 = new System.Windows.Forms.Label();
+            this.SuspendLayout();
+            // 
+            // pr_detail_label
+            // 
+            this.pr_detail_label.AutoSize = true;
+            this.pr_detail_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.pr_detail_label.Location = new System.Drawing.Point(904, 24);
+            this.pr_detail_label.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0);
+            this.pr_detail_label.Name = "pr_detail_label";
+            this.pr_detail_label.Size = new System.Drawing.Size(146, 41);
+            this.pr_detail_label.TabIndex = 191;
+            this.pr_detail_label.Text = "产品名称";
+            // 
+            // sncode_label
+            // 
+            this.sncode_label.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
+            | System.Windows.Forms.AnchorStyles.Left)));
+            this.sncode_label.AutoSize = true;
+            this.sncode_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.sncode_label.Location = new System.Drawing.Point(28, 844);
+            this.sncode_label.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0);
+            this.sncode_label.Name = "sncode_label";
+            this.sncode_label.Size = new System.Drawing.Size(114, 41);
+            this.sncode_label.TabIndex = 190;
+            this.sncode_label.Text = "录入框";
+            // 
+            // pr_code_label
+            // 
+            this.pr_code_label.AutoSize = true;
+            this.pr_code_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.pr_code_label.Location = new System.Drawing.Point(472, 24);
+            this.pr_code_label.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0);
+            this.pr_code_label.Name = "pr_code_label";
+            this.pr_code_label.Size = new System.Drawing.Size(146, 41);
+            this.pr_code_label.TabIndex = 185;
+            this.pr_code_label.Text = "产品编号";
+            // 
+            // ms_makecode_label
+            // 
+            this.ms_makecode_label.AutoSize = true;
+            this.ms_makecode_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.ms_makecode_label.Location = new System.Drawing.Point(12, 24);
+            this.ms_makecode_label.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0);
+            this.ms_makecode_label.Name = "ms_makecode_label";
+            this.ms_makecode_label.Size = new System.Drawing.Size(146, 41);
+            this.ms_makecode_label.TabIndex = 184;
+            this.ms_makecode_label.Text = "工单编号";
+            // 
+            // confirm
+            // 
+            this.confirm.AllPower = null;
+            this.confirm.BackColor = System.Drawing.Color.Transparent;
+            this.confirm.DownImage = ((System.Drawing.Image)(resources.GetObject("confirm.DownImage")));
+            this.confirm.Image = null;
+            this.confirm.IsShowBorder = true;
+            this.confirm.Location = new System.Drawing.Point(901, 88);
+            this.confirm.Margin = new System.Windows.Forms.Padding(5, 4, 5, 4);
+            this.confirm.MoveImage = ((System.Drawing.Image)(resources.GetObject("confirm.MoveImage")));
+            this.confirm.Name = "confirm";
+            this.confirm.NormalImage = ((System.Drawing.Image)(resources.GetObject("confirm.NormalImage")));
+            this.confirm.Power = null;
+            this.confirm.Size = new System.Drawing.Size(149, 56);
+            this.confirm.TabIndex = 199;
+            this.confirm.Text = "开始老化";
+            this.confirm.UseVisualStyleBackColor = false;
+            this.confirm.Click += new System.EventHandler(this.deleteButton1_Click);
+            // 
+            // ms_makecode
+            // 
+            this.ms_makecode.AutoSize = true;
+            this.ms_makecode.CutLength = null;
+            this.ms_makecode.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.ms_makecode.Location = new System.Drawing.Point(184, 24);
+            this.ms_makecode.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.ms_makecode.MaximumSize = new System.Drawing.Size(400, 0);
+            this.ms_makecode.Name = "ms_makecode";
+            this.ms_makecode.Size = new System.Drawing.Size(0, 41);
+            this.ms_makecode.TabIndex = 198;
+            // 
+            // ms_prodcode
+            // 
+            this.ms_prodcode.AutoSize = true;
+            this.ms_prodcode.CutLength = null;
+            this.ms_prodcode.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.ms_prodcode.Location = new System.Drawing.Point(636, 24);
+            this.ms_prodcode.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0);
+            this.ms_prodcode.MaximumSize = new System.Drawing.Size(400, 0);
+            this.ms_prodcode.Name = "ms_prodcode";
+            this.ms_prodcode.Size = new System.Drawing.Size(0, 41);
+            this.ms_prodcode.TabIndex = 193;
+            // 
+            // pr_detail
+            // 
+            this.pr_detail.AutoSize = true;
+            this.pr_detail.CutLength = null;
+            this.pr_detail.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.pr_detail.Location = new System.Drawing.Point(1084, 24);
+            this.pr_detail.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0);
+            this.pr_detail.MaximumSize = new System.Drawing.Size(400, 0);
+            this.pr_detail.Name = "pr_detail";
+            this.pr_detail.Size = new System.Drawing.Size(0, 41);
+            this.pr_detail.TabIndex = 192;
+            // 
+            // sncode
+            // 
+            this.sncode.AllPower = "ifall";
+            this.sncode.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
+            | System.Windows.Forms.AnchorStyles.Left)));
+            this.sncode.BackColor = System.Drawing.Color.White;
+            this.sncode.ID = null;
+            this.sncode.Location = new System.Drawing.Point(196, 848);
+            this.sncode.Margin = new System.Windows.Forms.Padding(5, 4, 5, 4);
+            this.sncode.Name = "sncode";
+            this.sncode.Power = null;
+            this.sncode.Size = new System.Drawing.Size(388, 35);
+            this.sncode.Str = null;
+            this.sncode.Str1 = null;
+            this.sncode.Str2 = null;
+            this.sncode.TabIndex = 189;
+            this.sncode.Tag = "ifread";
+            this.sncode.KeyDown += new System.Windows.Forms.KeyEventHandler(this.sncode_KeyDown);
+            // 
+            // OperateResult
+            // 
+            this.OperateResult.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.OperateResult.Location = new System.Drawing.Point(1183, 148);
+            this.OperateResult.Margin = new System.Windows.Forms.Padding(5, 4, 5, 4);
+            this.OperateResult.Name = "OperateResult";
+            this.OperateResult.Size = new System.Drawing.Size(281, 677);
+            this.OperateResult.TabIndex = 188;
+            this.OperateResult.Text = "";
+            // 
+            // label1
+            // 
+            this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
+            | System.Windows.Forms.AnchorStyles.Left)));
+            this.label1.AutoSize = true;
+            this.label1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label1.Location = new System.Drawing.Point(12, 91);
+            this.label1.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0);
+            this.label1.Name = "label1";
+            this.label1.Size = new System.Drawing.Size(146, 41);
+            this.label1.TabIndex = 202;
+            this.label1.Text = "老化编号";
+            // 
+            // agcode
+            // 
+            this.agcode.AllPower = "ifall";
+            this.agcode.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
+            | System.Windows.Forms.AnchorStyles.Left)));
+            this.agcode.BackColor = System.Drawing.Color.White;
+            this.agcode.ID = null;
+            this.agcode.Location = new System.Drawing.Point(196, 95);
+            this.agcode.Margin = new System.Windows.Forms.Padding(5, 4, 5, 4);
+            this.agcode.Name = "agcode";
+            this.agcode.Power = null;
+            this.agcode.Size = new System.Drawing.Size(388, 35);
+            this.agcode.Str = null;
+            this.agcode.Str1 = null;
+            this.agcode.Str2 = null;
+            this.agcode.TabIndex = 201;
+            this.agcode.Tag = "ifread";
+            this.agcode.KeyDown += new System.Windows.Forms.KeyEventHandler(this.snCollectionBox1_KeyDown);
+            // 
+            // checkBox1
+            // 
+            this.checkBox1.AutoSize = true;
+            this.checkBox1.Checked = true;
+            this.checkBox1.CheckState = System.Windows.Forms.CheckState.Checked;
+            this.checkBox1.Location = new System.Drawing.Point(656, 101);
+            this.checkBox1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.checkBox1.Name = "checkBox1";
+            this.checkBox1.Size = new System.Drawing.Size(138, 28);
+            this.checkBox1.TabIndex = 203;
+            this.checkBox1.Text = "自动生成";
+            this.checkBox1.UseVisualStyleBackColor = true;
+            // 
+            // quxiao
+            // 
+            this.quxiao.AutoSize = true;
+            this.quxiao.Location = new System.Drawing.Point(656, 856);
+            this.quxiao.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.quxiao.Name = "quxiao";
+            this.quxiao.Size = new System.Drawing.Size(138, 28);
+            this.quxiao.TabIndex = 204;
+            this.quxiao.Text = "取消采集";
+            this.quxiao.UseVisualStyleBackColor = true;
+            // 
+            // agsum
+            // 
+            this.agsum.AutoSize = true;
+            this.agsum.CutLength = null;
+            this.agsum.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.agsum.Location = new System.Drawing.Point(200, 785);
+            this.agsum.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.agsum.MaximumSize = new System.Drawing.Size(400, 0);
+            this.agsum.Name = "agsum";
+            this.agsum.Size = new System.Drawing.Size(0, 41);
+            this.agsum.TabIndex = 206;
+            // 
+            // label2
+            // 
+            this.label2.AutoSize = true;
+            this.label2.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label2.Location = new System.Drawing.Point(28, 785);
+            this.label2.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0);
+            this.label2.Name = "label2";
+            this.label2.Size = new System.Drawing.Size(82, 41);
+            this.label2.TabIndex = 205;
+            this.label2.Text = "数量";
+            // 
+            // Make_AgingCopy
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 24F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.ClientSize = new System.Drawing.Size(1483, 908);
+            this.Controls.Add(this.agsum);
+            this.Controls.Add(this.label2);
+            this.Controls.Add(this.quxiao);
+            this.Controls.Add(this.checkBox1);
+            this.Controls.Add(this.label1);
+            this.Controls.Add(this.agcode);
+            this.Controls.Add(this.confirm);
+            this.Controls.Add(this.ms_makecode);
+            this.Controls.Add(this.ms_prodcode);
+            this.Controls.Add(this.pr_detail);
+            this.Controls.Add(this.pr_detail_label);
+            this.Controls.Add(this.sncode_label);
+            this.Controls.Add(this.sncode);
+            this.Controls.Add(this.OperateResult);
+            this.Controls.Add(this.pr_code_label);
+            this.Controls.Add(this.ms_makecode_label);
+            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
+            this.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.Name = "Make_AgingCopy";
+            this.Tag = "Make!Aging";
+            this.Text = "老化采集";
+            this.Activated += new System.EventHandler(this.Make_CollectNetCode_Activated);
+            this.Load += new System.EventHandler(this.Make_CollectNetCode_Load);
+            this.SizeChanged += new System.EventHandler(this.Make_CollectNetCode_SizeChanged);
+            this.ResumeLayout(false);
+            this.PerformLayout();
+
+        }
+
+        #endregion
+        private CustomControl.ValueLabel.ValueLabel ms_prodcode;
+        private CustomControl.ValueLabel.ValueLabel pr_detail;
+        private System.Windows.Forms.Label pr_detail_label;
+        private System.Windows.Forms.Label sncode_label;
+        private CustomControl.TextBoxWithIcon.SnCollectionBox sncode;
+        private CustomControl.RichText.RichTextAutoBottom OperateResult;
+        private System.Windows.Forms.Label pr_code_label;
+        private System.Windows.Forms.Label ms_makecode_label;
+        private CustomControl.ValueLabel.ValueLabel ms_makecode;
+        private CustomControl.ButtonUtil.NormalButton confirm;
+        private System.Windows.Forms.Label label1;
+        private CustomControl.TextBoxWithIcon.SnCollectionBox agcode;
+        private System.Windows.Forms.CheckBox checkBox1;
+        private System.Windows.Forms.CheckBox quxiao;
+        private CustomControl.ValueLabel.ValueLabel agsum;
+        private System.Windows.Forms.Label label2;
+    }
+}

+ 315 - 0
UAS_MES_ZT/FunctionCode/Make/Make_AgingCopy.cs

@@ -0,0 +1,315 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Windows.Forms;
+using UAS_MES_NEW.DataOperate;
+using UAS_MES_NEW.Entity;
+using UAS_MES_NEW.PublicMethod;
+
+namespace UAS_MES_NEW.Make
+{
+    public partial class Make_AgingCopy : Form
+    {
+        DataHelper dh;
+        AutoSizeFormClass asc = new AutoSizeFormClass();
+        LogStringBuilder sql = new LogStringBuilder();
+        DataTable dt;
+
+        //当前序列号记录
+        string sn_code;
+        //制造单号
+        string macode;
+        //采集网标号
+        float net_code;
+        //网标查询条件ms_id
+        string oMsID;
+        //打印计数
+        int printcount = 0;
+        int ma_unlimitin;
+
+        string ErrorMessage = "";
+        string LastSncode;
+
+        public Make_AgingCopy()
+        {
+            InitializeComponent();
+        }
+
+        private void Make_CollectNetCode_Load(object sender, EventArgs e)
+        {
+            asc.controllInitializeSize(this);
+            sncode.Focus();
+            dh = SystemInf.dh;
+        }
+
+        private void sncode_KeyDown(object sender, KeyEventArgs e)
+        {
+            if (e.KeyCode == Keys.Enter)
+            {
+                string ErrorMessage2;
+                string oMakeCode;
+                //采集序列号
+
+                if (sncode.Text == "")
+                {
+                    OperateResult.AppendText(">>序列号不能为空\n", Color.Red);
+                    return;
+                }
+                if (!quxiao.Checked)
+                {
+                    if (LogicHandler.CheckStepAttribute(Tag.ToString(), User.UserSourceCode, out ErrorMessage2))
+                    {
+                        //判断界面工单是否为空时的序列号是否自动归属工单
+                        string oStatus = "";
+                        if (!LogicHandler.GetMakeInfo(sncode.Text, out oMakeCode, out oStatus, out ErrorMessage2))
+                        {
+                            if (ms_makecode.Text == "")
+                            {
+                                OperateResult.AppendText(">>" + ErrorMessage2 + "\n", Color.Red, sncode);
+                                return;
+                            }
+                        }
+                        //OperateResult.AppendText("<<" + sncode.Text + "\n", Color.Black);
+                        dt = (DataTable)dh.ExecuteSql("select ms_status,ms_id,ms_makecode,ms_nextstepcode,ms_craftcode,ms_prodcode from makeserial left join product on ms_prodcode = pr_code where ms_sncode ='" + sncode.Text + "' order by ms_id desc", "select");
+                        if (dt.Rows.Count == 0)
+                        {
+                            OperateResult.AppendText(">>SN:" + sncode.Text + "不存在\n", Color.Red, sncode);
+                            return;
+                        }
+
+                        //判断工单工序
+                        // 获取工单归属工单下一工序是否正确
+                        if (LogicHandler.CheckStepSNAndMacode(ms_makecode.Text == "" ? oMakeCode : ms_makecode.Text, User.UserSourceCode, sncode.Text, User.UserCode, out oMakeCode, out oMsID, out ErrorMessage2) || (dt.Rows.Count > 0 && dt.Rows[0]["ms_status"].ToString() == "1"))
+                        {
+                            if (oMsID == "" || oMsID == "null" || oMsID == "0")
+                            {
+                                oMsID = dt.Rows[0]["ms_id"].ToString();
+                                oMakeCode = dt.Rows[0]["ms_makecode"].ToString();
+                            }
+                            sql.Clear();
+                            sql.Append("select ms_makecode,ms_prodcode,pr_detail,ms_craftcode from makeserial left join product on ");
+                            sql.Append(" ms_prodcode = pr_code where ms_id  = '" + oMsID + "'");
+                            dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
+                            BaseUtil.SetFormValue(this.Controls, dt);
+                            sn_code = sncode.Text;
+                        }
+                        else
+                        {
+                            OperateResult.AppendText(">>" + ErrorMessage2 + "\n", Color.Red, sncode);
+                            return;
+                        }
+
+                        if (agcode.Text == "")
+                        {
+                            if (checkBox1.Checked)
+                            {
+                                agcode.Text = LogicHandler.GetAGCode();
+                                fildgv();
+                            }
+                            else
+                            {
+
+                                DataTable dtc = (DataTable)dh.ExecuteSql("select ag_code,ag_status from ageingdetail left join ageing on agd_agid = ag_id where  agd_sncode = '" + sncode.Text + "' order by agd_id desc", "select");
+                                if (dtc.Rows.Count > 0)
+                                {
+                                    if (dtc.Rows[0]["ag_status"].ToString().Contains("0"))
+                                    {
+                                        agcode.Text = dtc.Rows[0]["ag_code"].ToString();
+                                        fildgv();
+                                        sncode.Text = "";
+                                        return;
+                                    }
+                                    else if (dtc.Rows[0]["ag_status"].ToString().Contains("1"))
+                                    {
+
+                                        OperateResult.AppendText(">>SN:" + sncode.Text + "处于老化中老化批:" + dtc.Rows[0]["ag_code"].ToString() + "中,无法采集进新批\n", Color.Red, sncode);
+                                        return;
+                                    }
+                                    else if (dtc.Rows[0]["ag_status"].ToString().Contains("2"))
+                                    {
+
+                                        OperateResult.AppendText(">>SN:" + sncode.Text + "处于老化结束批:" + dtc.Rows[0]["ag_code"].ToString() + "中,无法采集进新批\n", Color.Red, sncode);
+                                        return;
+                                    }
+                                }
+                                else
+                                {
+                                    OperateResult.AppendText(">>SN:" + sncode.Text + "未采集老化,老化编号不可为空\n", Color.Red, sncode);
+                                    return;
+                                }
+                            }
+                        }
+                        else
+                        {
+                            fildgv();
+                        }
+                        DataTable dtB = (DataTable)dh.ExecuteSql("select ag_code from ageingdetail left join ageing on agd_agid = ag_id where  agd_sncode = '" + sncode.Text + "' and ag_status <>2", "select");
+                        if (dtB.Rows.Count > 0)
+                        {
+                            OperateResult.AppendText(">>SN:" + sncode.Text + "处于未结束老化批:" + dtB.Rows[0]["ag_code"].ToString() + "中,无法采集进新批\n", Color.Red, sncode);
+                            return;
+                        }
+
+                        if (dh.CheckExist("craft left join craftdetail on cr_id = cd_crid", "cr_code = '" + dt.Rows[0]["ms_craftcode"].ToString() + "' and cr_prodcode = '" + dt.Rows[0]["ms_prodcode"].ToString() + "' and cd_stepcode = 'Aging'"))
+                        {
+                            if (LogicHandler.CheckStepSNAndMacode(ms_makecode.Text == "" ? oMakeCode : ms_makecode.Text, User.UserSourceCode, sncode.Text, User.UserCode, out oMakeCode, out oMsID, out ErrorMessage2))
+                            {
+                                //良品信息采集
+                                if (LogicHandler.SetStepResult(ms_makecode.Text, User.UserSourceCode, sncode.Text, "NOWIN", "采集成功", User.UserCode, out ErrorMessage))
+                                {
+                                    //提示正确返回时传递的信息
+                                    if (ErrorMessage.Contains("AFTERSUCCESS"))
+                                        OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red);
+                                    LastSncode = sncode.Text;
+                                }
+                                else
+                                {
+                                    OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red, sncode);
+                                    return;
+                                }
+                            }
+                            else
+                            {
+                                OperateResult.AppendText(">>" + ErrorMessage2 + "\n", Color.Red, sncode);
+                                return;
+                            }
+                        }
+                        else
+                        {
+                            LastSncode = sncode.Text;
+                        }
+                        if (!dh.CheckExist("ageing", "ag_code = '" + agcode.Text + "'"))
+                        {
+                            dh.ExecuteSql("insert into ageing(ag_id,ag_code,ag_indate,ag_status) values(ageing_seq.nextval,'" + agcode.Text + "',sysdate,0)", "insert");
+                        }
+                        if (dh.CheckExist("ageingdetail", "agd_sncode='" + sncode.Text + "' and agd_makecode='" + ms_makecode.Text + "'"))
+                        {
+                            OperateResult.AppendText(">>" + sncode.Text + "已经进入老化,不允许重复采集\n", Color.Red, sncode);
+                            return;
+                        }
+                        dh.ExecuteSql("insert into ageingdetail(agd_id,agd_agid,agd_agcode,agd_makecode,agd_sncode,agd_indate) select ageingdetail_seq.nextval,ag_id,ag_code,'" + ms_makecode.Text + "','" + sncode.Text + "',sysdate from ageing where ag_code = '" + agcode.Text + "'", "insert");
+                        LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, ms_makecode.Text, User.UserLineCode, User.UserSourceCode, "老化采集" + agcode.Text, "采集成功", LastSncode, "");
+                        OperateResult.AppendText(">>" + sncode.Text + "老化采集成功\n", Color.Green, sncode);
+                        fildgv();
+                    }
+                    else OperateResult.AppendText(">>" + ErrorMessage2 + "\n", Color.Red, sncode);
+                }
+                else
+                {
+                    if (agcode.Text == "")
+                    {
+                        OperateResult.AppendText(">>老化编号不可为空\n", Color.Red, sncode);
+                        return;
+                    }
+                    else
+                    {
+                        fildgv();
+                    }
+                    DataTable dtB = (DataTable)dh.ExecuteSql("select ag_code from ageingdetail left join ageing on agd_agid = ag_id where agd_agcode = '" + agcode.Text + "' and agd_sncode = '" + sncode.Text + "' and ag_status =0", "select");
+                    if (dtB.Rows.Count > 0)
+                    {
+                        dh.ExecuteSql("delete ageingdetail where agd_agcode = '" + agcode.Text + "' and agd_sncode = '" + sncode.Text + "' ", "delete");
+                        LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, ms_makecode.Text, User.UserLineCode, User.UserSourceCode, "取消老化采集" + agcode.Text, "取消采集成功", sncode.Text, "");
+                        OperateResult.AppendText(">>SN:" + sncode.Text + "取消采集老化批:" + dtB.Rows[0]["ag_code"].ToString() + "成功\n", Color.Green, sncode);
+                        fildgv();
+                        return;
+                    }
+                    else
+                    {
+                        OperateResult.AppendText(">>SN:" + sncode.Text + "未处于在录入老化批:" + agcode.Text + "中,无法取消采集\n", Color.Red, sncode);
+                        return;
+                    }
+
+                }
+            }
+        }
+
+        private void Make_CollectNetCode_SizeChanged(object sender, EventArgs e)
+        {
+            asc.controlAutoSize(this);
+        }
+
+        private void Make_CollectNetCode_Activated(object sender, EventArgs e)
+        {
+            sncode.Focus();
+        }
+
+
+        private void deleteButton1_Click(object sender, EventArgs e)
+        {
+            string Seal = MessageBox.Show(this.ParentForm, "是否确认老化?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question).ToString();
+            if (Seal == "Yes")
+            {
+                fildgv();
+                if (agcode.Text != "")
+                {
+                    dt = (DataTable)dh.ExecuteSql("select * from ageing where ag_code = '" + agcode.Text + "' and ag_status <>0 ", "select");
+                    if (dt.Rows.Count > 0)
+                    {
+                        OperateResult.AppendText(">>老化编号" + agcode.Text + "已开始或结束老化\n", Color.Red, agcode);
+                        return;
+                    }
+                    else
+                    {
+                        dh.ExecuteSql("update ageing set ag_startdate = sysdate,ag_status = 1 where ag_code = '" + agcode.Text + "'", "update");
+                        LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, ms_makecode.Text, User.UserLineCode, User.UserSourceCode, "老化开始" + agcode.Text, "采集开始", agcode.Text, "");
+                        OperateResult.AppendText(">>" + agcode.Text + "老化批次开始\n", Color.CornflowerBlue, agcode);
+                        BaseUtil.CleanControls(this.Controls);
+                        if (!checkBox1.Checked)
+                        {
+                            agcode.Focus();
+                        }
+                        else
+                        {
+                            sncode.Focus();
+                        }
+                    }
+                }
+                else
+                {
+                    OperateResult.AppendText(">>老化编号" + agcode.Text + "不可为空\n", Color.Red, agcode);
+                    return;
+                }
+            }
+        }
+
+        private void checkBox1_CheckedChanged(object sender, EventArgs e)
+        {
+
+        }
+
+        void fildgv()
+        {
+            //DataTable dtc;
+            //if (agcode.Text != "")
+            //{
+            //    dtc = (DataTable)dh.ExecuteSql("select * from ageingdetail left join ageing on agd_agid = ag_id where ag_code = '" + agcode.Text + "' and ag_status <>0 ", "select");
+            //    if (dtc.Rows.Count > 0)
+            //    {
+            //        OperateResult.AppendText(">>老化编号" + agcode.Text + "已开始或结束老化\n", Color.Red, agcode);
+            //        return;
+            //    }
+            //    else
+            //    {
+            //        dtc = (DataTable)dh.ExecuteSql("select * from ageingdetail left join ageing on agd_agid = ag_id where ag_code = '" + agcode.Text + "'  ", "select");
+            //        agsum.Text = dh.getFieldDataByCondition("ageingdetail", "count(1) cn", " agd_agcode = '" + agcode.Text + "'").ToString();
+            //    }
+            //    BaseUtil.FillDgvWithDataTable(LabelDataGridView, dtc);
+            //}
+        }
+
+        private void snCollectionBox1_KeyDown(object sender, KeyEventArgs e)
+        {
+            if (e.KeyCode == Keys.Enter)
+            {
+                fildgv();
+                sncode.Focus();
+                sncode.SelectAll();
+            }
+        }
+    }
+}

+ 159 - 0
UAS_MES_ZT/FunctionCode/Make/Make_AgingCopy.resx

@@ -0,0 +1,159 @@
+<?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>
+  <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+  <data name="confirm.DownImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+    <value>
+        iVBORw0KGgoAAAANSUhEUgAAAEUAAAAWCAYAAACWl1FwAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m
+        dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAFfSURBVFhH5dhNTsJgFIXhM2WiCxL2oAEHrJKhQSYM
+        JIgzjSLIX0sRKPSPtl+Lo2uOgVbWcJu8CzhP8nVwISIAUAFwA+AWQFNh3M39lZMHrgDUu91uyxjji8KP
+        u7mfDgCuiVLt958fkjSTie3I62iqLu7m/sHgpQ2gRpSG6/nmc2bL23imtuHMkp0f5ADuidIMoljev+bq
+        o8PpH4NmcIjlY7JQHx0KlPCQyHBqqY8OJUqcyGhuq48OBUoUJzJeLNVHhwLlkKQysRz10eECZbpcqe8C
+        JU6NzJ1v9dGhQElSI9Zqoz46lCgmE3u9VR8dCpTUZOJsXPXRoUTJclltd+qjQ4FislzW7l59dChR8lw2
+        e099dDijNA5xYnZBKFvPVxv3x0lanA5qT71eOzsexQsjcf1AXdzN/XQ4H5l4fqs/djqtIIzC/Pgj2uJu
+        7i/Okf8O11UAd6c3pS3u5v6/w/UvTaFspAxAMh4AAAAASUVORK5CYII=
+</value>
+  </data>
+  <data name="confirm.MoveImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+    <value>
+        iVBORw0KGgoAAAANSUhEUgAAAEUAAAAWCAYAAACWl1FwAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m
+        dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAF3SURBVFhH5djbSgJRFMbxHsP7wBfYT7jvu46QDIoI
+        C4QNQRAIgVBRSdpxpgZN83wYx5nZOjNqrvgEd73DGvhfzdX3g32ztohoS0iVElLtCakehVQdhmE39qfg
+        AZBtIdX70Y0TjsJ4SQw/7MZ+OAip0kDJnD3UdJAsyXIjKvWm7MJu7M+X6lpIlQWK3ZhEq8pgRvfdKdvK
+        /Rk1/XglpHKA0ulPF3Tb0eyDAzzWKL3pgq7bmn1wMChdPadiK2QfHAxKW8/pqhmwDw4GpRXOqdAI2AcH
+        g9IME7qs++yDg0H5DhK6qE3YBweD0vATOq967IODQfnyE1KOxz44GJTaJKb855h9cDAoVS+mU9tlHxwM
+        iuPFdGK57IPDH8o4ouO3EfvgYFA+xhEdvg7ZB4cNil3uhquc5dLBy5Bt2P/U0+Z0kN0tOhqHlpzt0v7z
+        gF3Yjf1w2ByZ0jjD7RSs8K7l/+Ant7Ab+8058t/hOiOkquBNMQy7sX99uP4F5D4U8hdr4uMAAAAASUVO
+        RK5CYII=
+</value>
+  </data>
+  <data name="confirm.NormalImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+    <value>
+        iVBORw0KGgoAAAANSUhEUgAAAEUAAAAWCAYAAACWl1FwAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m
+        dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAGpSURBVFhH5dg/ayJBGMfxB4YFXTARBAvBQhAsBEEQ
+        ZLnNzFu4I6aYV5kyF9tgbad1jrsYY9T4Z3fcnV2f45e38Sx8q6l+n2IWhpiZjDFVY8wPY8xPY4wVGHZj
+        fxUepLW+0Vrfz+fzR+fclgV+2I39cNBa31Icx/FisXi6XpnL8io27F8ul89xHN9RFEWTPM+ToihZet57
+        F0XRA43HYwsp7wvxwQEeNBqNbFmWnOW5+OAADxoOh7YoS3ZZJj44wIMGg4H1RcGpu4gPDvCgfr9vvfd8
+        TlPxwQEe1Ov1bO49H8+J+OAAD+p2uxaXzNfpJD44wIM6nY69ZDnvDkfxwQEe1G637SXLeLs/iA8O8KBW
+        q2XdJePNbi8+OMCDms2mxe9o/bkTHxzgQY1GwybO8WrzKT44wIPq9bpNUsdv64344AAPqtVq9pw6/vv+
+        IT44wIPCMJzsvg7Jv/UH/1m9iw3794ejC8PwgSqVyt3LbPZ8SpLvg9e3lbiwG/vhAA8KguA2CIL739Pp
+        42a73eNQWtiN/XCAB+GhVilVVUrFSqlfSikrMOzG/u+H6/+yQ4jdXN8e9AAAAABJRU5ErkJggg==
+</value>
+  </data>
+</root>

+ 4 - 4
UAS_MES_ZT/PublicMethod/LogicHandler.cs

@@ -732,7 +732,7 @@ namespace UAS_MES_NEW.PublicMethod
         public static bool SetStepResult(string iMakeCode, string iSourceCode, string iSN, string iMPKind, string iResult, string iUserCode, out string oErrorMessage)
         {
             bool result = CS_SetResult(iMakeCode, iSourceCode, iSN, iUserCode, iResult, out oErrorMessage);
-            if (result)
+            if (result && iMPKind != "NOWIN")
             {
                 SetCheck set = new SetCheck("OK", Color.Green);
                 BaseUtil.SetFormCenter(set);
@@ -750,7 +750,7 @@ namespace UAS_MES_NEW.PublicMethod
         public static bool SetStepResult2(string iMakeCode, string iSourceCode, string iSN, string iMPKind, string iResult, string iUserCode, out string oErrorMessage)
         {
             bool result = CS_SetResult(iMakeCode, iSourceCode, iSN, iUserCode, iResult, out oErrorMessage);
-           
+
             return result;
         }
 
@@ -841,7 +841,7 @@ namespace UAS_MES_NEW.PublicMethod
             sql.Append("insert into makebad(mb_id,mb_makecode,mb_mscode,mb_sncode,mb_inman,mb_indate,mb_stepcode");
             sql.Append(",mb_sourcecode,mb_badcode,mb_bgcode,mb_badtable,mb_status,mb_badremark,mb_bgname,mb_badname,mb_type,MB_DUTYSTEPCODE,MB_DUTYEMCODE,MB_ASEMCODE,MB_LOT,MB_FOBFV,MB_T1,MB_T2,MB_FOFV,MB_OQC,MB_QA,MB_CGMTEST,MB_CGMFV,MB_CGMOQC,MB_ASSING)");
             sql.Append("select makebad_seq.nextval,ma_code,ms_code,ms_sncode,'" + iUserCode + "',sysdate,'" + StepCode + "','" + iSourceCode + "',:bc_code,:bg_code,'',");
-            sql.Append("'0',:bc_remark,:bg_name,:bc_name,'Client','" + dutystepcode + "','" + dutyemcode + "','"+ asemcode + "','" + MB_LOT + "','" + MB_FOBFV + "','" + MB_T1 + "','" + MB_T2 + "','" + MB_FOFV + "','" + MB_OQC + "','" + MB_QA + "','" + MB_CGMTEST + "','" + MB_CGMFV + "','" + MB_CGMOQC + "','" + MB_ASSING + "' from make left join makeSerial on ms_makecode=ma_code  ");
+            sql.Append("'0',:bc_remark,:bg_name,:bc_name,'Client','" + dutystepcode + "','" + dutyemcode + "','" + asemcode + "','" + MB_LOT + "','" + MB_FOBFV + "','" + MB_T1 + "','" + MB_T2 + "','" + MB_FOFV + "','" + MB_OQC + "','" + MB_QA + "','" + MB_CGMTEST + "','" + MB_CGMFV + "','" + MB_CGMOQC + "','" + MB_ASSING + "' from make left join makeSerial on ms_makecode=ma_code  ");
             sql.Append(" where ms_sncode='" + iSnCode + "' and ms_makecode='" + iMakeCode + "'");
             if (iBadGroupCode.Length > 0)
             {
@@ -1193,7 +1193,7 @@ namespace UAS_MES_NEW.PublicMethod
                 case "RULE":
                     if (iIfRepeat != "-1")
                     {
-                        dt = (DataTable)dh.ExecuteSql("select cm_barcode from craftmaterial where cm_barcode='" + iSN + "' and cm_status=0 and cm_makecode = '"+ iMakeCode + "'", "select");
+                        dt = (DataTable)dh.ExecuteSql("select cm_barcode from craftmaterial where cm_barcode='" + iSN + "' and cm_status=0 and cm_makecode = '" + iMakeCode + "'", "select");
                         if (dt.Rows.Count > 0)
                         {
                             ErrMessage = "条码" + iSN + "已经上料";

+ 9 - 0
UAS_MES_ZT/UAS_MES_ZT.csproj

@@ -579,6 +579,12 @@
     <Compile Include="FunctionCode\Employee\Employee_PowerSarch.Designer.cs">
       <DependentUpon>Employee_PowerSarch.cs</DependentUpon>
     </Compile>
+    <Compile Include="FunctionCode\Make\Make_AgingCopy.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="FunctionCode\Make\Make_AgingCopy.Designer.cs">
+      <DependentUpon>Make_AgingCopy.cs</DependentUpon>
+    </Compile>
     <Compile Include="FunctionCode\Make\Make_AgingOver.cs">
       <SubType>Form</SubType>
     </Compile>
@@ -1522,6 +1528,9 @@
     <EmbeddedResource Include="FunctionCode\Employee\Employee_PowerSarch.resx">
       <DependentUpon>Employee_PowerSarch.cs</DependentUpon>
     </EmbeddedResource>
+    <EmbeddedResource Include="FunctionCode\Make\Make_AgingCopy.resx">
+      <DependentUpon>Make_AgingCopy.cs</DependentUpon>
+    </EmbeddedResource>
     <EmbeddedResource Include="FunctionCode\Make\Make_AgingOver.resx">
       <DependentUpon>Make_AgingOver.cs</DependentUpon>
     </EmbeddedResource>