ソースを参照

修改维修测试界面

章政 8 年 前
コミット
7dba1e4261

+ 1 - 1
UAS-MES/FunctionCode/Make/Make_CartonBoxWeigh.cs

@@ -160,7 +160,7 @@ namespace UAS_MES.Make
         {
             string ErrorMessage;
             dh.ExecuteSql("update package set pa_weight=" + weight.Text + ", pa_printcount= nvl(pa_printcount,0)+1 where pa_outboxcode='" + outboxcode.Text + "'", "update");
-            if (!LogicHandler.UpdateMakeMessage(pd_barcode.Text, ma_code.Text, User.UserSourceCode, User.UserName, "称量合格", out ErrorMessage))
+            if (!LogicHandler.UpdateMakeMessage(pd_barcode.Text, ma_code.Text,"卡通箱称重", User.UserSourceCode, User.UserName, "称量合格", out ErrorMessage))
                 OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red);
         }
 

+ 1 - 1
UAS-MES/FunctionCode/Make/Make_FeedingCollection.cs

@@ -486,7 +486,7 @@ namespace UAS_MES.Make
                     //上料采集成功,设置序列号栏目为空
                     RemainIndex = 0;
                     OperateResult.AppendText(">>上料采集完成!\n", Color.Green);
-                    if (LogicHandler.UpdateMakeMessage(sn_code.Text, ma_code, User.UserSourceCode, User.UserName, "上料成功", out ErrorMessage))
+                    if (LogicHandler.UpdateMakeMessage(sn_code.Text, ma_code,"上料采集", User.UserSourceCode, User.UserName, "上料成功", out ErrorMessage))
                     {
                         sn_code.Text = "";
                         if (mcd_remainqty.Text == "0")

+ 21 - 27
UAS-MES/FunctionCode/Make/Make_Repair.Designer.cs

@@ -84,13 +84,13 @@
             this.ms_prodcode = new UAS_MES.CustomControl.ValueLabel.ValueLabel();
             this.pr_detail = new UAS_MES.CustomControl.ValueLabel.ValueLabel();
             this.Clean = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
-            this.ms_sncode = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.cd_stepcode = new UAS_MES.CustomControl.TextBoxWithIcon.SearchTextBox();
             this.cr_code = new UAS_MES.CustomControl.TextBoxWithIcon.SearchTextBox();
             this.NewBadCode = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
             this.SaveBadLocation = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
             this.Scrap = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
             this.RepairComplete = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
+            this.ms_sncode = new UAS_MES.CustomControl.ValueLabel.ValueLabel();
             this.panel2.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.LocationSource)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.ComponentSource)).BeginInit();
@@ -133,7 +133,7 @@
             this.ma_craftcode_label.Name = "ma_craftcode_label";
             this.ma_craftcode_label.Size = new System.Drawing.Size(92, 27);
             this.ma_craftcode_label.TabIndex = 66;
-            this.ma_craftcode_label.Text = "回流工艺";
+            this.ma_craftcode_label.Text = "回流途程";
             // 
             // st_rstepcode_label
             // 
@@ -515,7 +515,7 @@
             this.NewRepairInf.DownImage = ((System.Drawing.Image)(resources.GetObject("NewRepairInf.DownImage")));
             this.NewRepairInf.Image = ((System.Drawing.Image)(resources.GetObject("NewRepairInf.Image")));
             this.NewRepairInf.IsShowBorder = true;
-            this.NewRepairInf.Location = new System.Drawing.Point(395, 631);
+            this.NewRepairInf.Location = new System.Drawing.Point(395, 628);
             this.NewRepairInf.Margin = new System.Windows.Forms.Padding(4);
             this.NewRepairInf.MoveImage = ((System.Drawing.Image)(resources.GetObject("NewRepairInf.MoveImage")));
             this.NewRepairInf.Name = "NewRepairInf";
@@ -535,7 +535,7 @@
             this.SaveRepairInf.DownImage = ((System.Drawing.Image)(resources.GetObject("SaveRepairInf.DownImage")));
             this.SaveRepairInf.Image = ((System.Drawing.Image)(resources.GetObject("SaveRepairInf.Image")));
             this.SaveRepairInf.IsShowBorder = true;
-            this.SaveRepairInf.Location = new System.Drawing.Point(548, 631);
+            this.SaveRepairInf.Location = new System.Drawing.Point(548, 628);
             this.SaveRepairInf.Margin = new System.Windows.Forms.Padding(4);
             this.SaveRepairInf.MoveImage = ((System.Drawing.Image)(resources.GetObject("SaveRepairInf.MoveImage")));
             this.SaveRepairInf.Name = "SaveRepairInf";
@@ -555,7 +555,7 @@
             this.DeleteRepairInf.DownImage = ((System.Drawing.Image)(resources.GetObject("DeleteRepairInf.DownImage")));
             this.DeleteRepairInf.Image = ((System.Drawing.Image)(resources.GetObject("DeleteRepairInf.Image")));
             this.DeleteRepairInf.IsShowBorder = true;
-            this.DeleteRepairInf.Location = new System.Drawing.Point(700, 631);
+            this.DeleteRepairInf.Location = new System.Drawing.Point(700, 628);
             this.DeleteRepairInf.Margin = new System.Windows.Forms.Padding(4);
             this.DeleteRepairInf.MoveImage = ((System.Drawing.Image)(resources.GetObject("DeleteRepairInf.MoveImage")));
             this.DeleteRepairInf.Name = "DeleteRepairInf";
@@ -796,24 +796,6 @@
             this.Clean.Text = "清除";
             this.Clean.UseVisualStyleBackColor = true;
             // 
-            // ms_sncode
-            // 
-            this.ms_sncode.AllPower = null;
-            this.ms_sncode.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
-            | System.Windows.Forms.AnchorStyles.Left)));
-            this.ms_sncode.BackColor = System.Drawing.Color.White;
-            this.ms_sncode.ID = null;
-            this.ms_sncode.Location = new System.Drawing.Point(123, 51);
-            this.ms_sncode.Margin = new System.Windows.Forms.Padding(4);
-            this.ms_sncode.Name = "ms_sncode";
-            this.ms_sncode.Power = null;
-            this.ms_sncode.Size = new System.Drawing.Size(178, 25);
-            this.ms_sncode.Str = null;
-            this.ms_sncode.Str1 = null;
-            this.ms_sncode.Str2 = null;
-            this.ms_sncode.TabIndex = 80;
-            this.ms_sncode.Tag = "Read";
-            // 
             // cd_stepcode
             // 
             this.cd_stepcode.AllPower = null;
@@ -842,7 +824,7 @@
             | System.Windows.Forms.AnchorStyles.Left)));
             this.cr_code.Caller = null;
             this.cr_code.Condition = null;
-            this.cr_code.DBTitle = "回流工艺";
+            this.cr_code.DBTitle = "回流途程";
             this.cr_code.FormName = null;
             this.cr_code.Location = new System.Drawing.Point(123, 99);
             this.cr_code.Margin = new System.Windows.Forms.Padding(4);
@@ -864,7 +846,7 @@
             this.NewBadCode.DownImage = ((System.Drawing.Image)(resources.GetObject("NewBadCode.DownImage")));
             this.NewBadCode.Image = ((System.Drawing.Image)(resources.GetObject("NewBadCode.Image")));
             this.NewBadCode.IsShowBorder = true;
-            this.NewBadCode.Location = new System.Drawing.Point(248, 631);
+            this.NewBadCode.Location = new System.Drawing.Point(248, 628);
             this.NewBadCode.Margin = new System.Windows.Forms.Padding(4);
             this.NewBadCode.MoveImage = ((System.Drawing.Image)(resources.GetObject("NewBadCode.MoveImage")));
             this.NewBadCode.Name = "NewBadCode";
@@ -938,11 +920,24 @@
             this.RepairComplete.UseVisualStyleBackColor = true;
             this.RepairComplete.Click += new System.EventHandler(this.RepairComplete_Click);
             // 
+            // ms_sncode
+            // 
+            this.ms_sncode.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
+            | System.Windows.Forms.AnchorStyles.Left)));
+            this.ms_sncode.AutoSize = true;
+            this.ms_sncode.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.ms_sncode.Location = new System.Drawing.Point(126, 51);
+            this.ms_sncode.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.ms_sncode.Name = "ms_sncode";
+            this.ms_sncode.Size = new System.Drawing.Size(0, 27);
+            this.ms_sncode.TabIndex = 126;
+            // 
             // Make_Repair
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.ClientSize = new System.Drawing.Size(1327, 735);
+            this.Controls.Add(this.ms_sncode);
             this.Controls.Add(this.nr_code);
             this.Controls.Add(this.prodcode);
             this.Controls.Add(this.bg_code);
@@ -982,7 +977,6 @@
             this.Controls.Add(this.ms_prodcode_label);
             this.Controls.Add(this.pr_detail_label);
             this.Controls.Add(this.Clean);
-            this.Controls.Add(this.ms_sncode);
             this.Controls.Add(this.cd_stepcode);
             this.Controls.Add(this.cr_code);
             this.Controls.Add(this.ma_craftcode_label);
@@ -1034,7 +1028,6 @@
         private System.Windows.Forms.Label bg_name_label;
         private System.Windows.Forms.Label ms_sncode_label;
         private System.Windows.Forms.Label ms_makecode_label;
-        private CustomControl.TextBoxWithIcon.EnterTextBox ms_sncode;
         private CustomControl.ButtonUtil.NormalButton Clean;
         private CustomControl.ValueLabel.ValueLabel pr_detail;
         private CustomControl.ValueLabel.ValueLabel ms_prodcode;
@@ -1078,5 +1071,6 @@
         private System.Windows.Forms.DataGridViewTextBoxColumn mbp_id;
         private System.Windows.Forms.DataGridViewTextBoxColumn mbl_loc1;
         private System.Windows.Forms.DataGridViewTextBoxColumn mbl_id;
+        private CustomControl.ValueLabel.ValueLabel ms_sncode;
     }
 }

+ 11 - 18
UAS-MES/FunctionCode/Make/Make_Repair.cs

@@ -80,7 +80,6 @@ namespace UAS_MES.Make
             cd_stepcode.SetValueField = new string[] { "cd_stepcode" };
             cd_stepcode.SelectField = "cd_stepname # 工序名称 ,cd_stepcode # 工序编号,cd_stepno # 执行顺序";
 
-
             prodcode.FormName = Name;
             prodcode.TableName = dbtable1.Replace(":macode", macode).Replace(":sncode", GetSNCode.Text);
             prodcode.SetValueField = new string[] { "prodcode" };
@@ -103,27 +102,21 @@ namespace UAS_MES.Make
                 //验证工序是否正确
                 if (LogicHandler.CheckStepAttribute(Tag.ToString(), User.UserSourceCode, out ErrorMessage))
                 {
-
                     BadInf_1.Clear();
                     if (LogicHandler.GetMakeInfo(GetSNCode.Text, out macode, out ErrorMessage))
                     {
-                        if (LogicHandler.CheckStepSNAndMacode(macode, User.UserSourceCode, GetSNCode.Text, User.UserCode, out macode, out msid, out ErrorMessage))
+                        //验证makeserial或者ms_firstsn表序列号是否存在
+                        sql.Clear();
+                        sql.Append("select max(ms_id) ms_id,ms_makecode,ms_prodcode,ms_sncode,pr_detail ");
+                        sql.Append("ms_stepcode,ms_craftcode from makeserial left join product on pr_code=ms_prodcode where ms_makecode ='" + macode + "' and(ms_sncode");
+                        sql.Append("='" + GetSNCode.Text + "' or ms_firstsn in (select firstsn from makesnrelation ");
+                        sql.Append("where sn='" + GetSNCode.Text + "')) group by ms_makecode,ms_prodcode,ms_sncode,pr_detail,ms_stepcode,ms_craftcode");
+                        dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
+                        if (dt.Rows.Count > 0)
                         {
-                            //验证makeserial或者ms_firstsn表序列号是否存在
-                            sql.Clear();
-                            sql.Append("select max(ms_id) ms_id,ms_makecode,ms_prodcode,ms_sncode,pr_detail ");
-                            sql.Append("ms_stepcode,ms_craftcode from makeserial left join product on pr_code=ms_prodcode where ms_makecode ='" + macode + "' and(ms_sncode");
-                            sql.Append("='" + GetSNCode.Text + "' or ms_firstsn in (select firstsn from makesnrelation ");
-                            sql.Append("where sn='" + GetSNCode.Text + "')) group by ms_makecode,ms_prodcode,ms_sncode,pr_detail,ms_stepcode,ms_craftcode");
-                            dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
-                            if (dt.Rows.Count > 0)
-                            {
-                                msid = dt.Rows[0]["ms_id"].ToString();
-                                BaseUtil.SetFormValue(this.Controls, dt);
-                                LoadBadInfTree(sender, e);
-                            }
-                            else
-                                OperatResult.AppendText(">>序列号" + GetSNCode.Text + "不存在\n", Color.Red);
+                            msid = dt.Rows[0]["ms_id"].ToString();
+                            BaseUtil.SetFormValue(this.Controls, dt);
+                            LoadBadInfTree(sender, e);
                         }
                         else
                             OperatResult.AppendText(">>" + ErrorMessage + "\n", Color.Red);

+ 6 - 4
UAS-MES/FunctionCode/Make/Make_TestCollection.Designer.cs

@@ -192,6 +192,7 @@
             this.columnHeader4,
             this.columnHeader1,
             this.columnHeader2});
+            this.WaitRejectList.Font = new System.Drawing.Font("微软雅黑", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.WaitRejectList.Location = new System.Drawing.Point(29, 329);
             this.WaitRejectList.Margin = new System.Windows.Forms.Padding(4);
             this.WaitRejectList.Name = "WaitRejectList";
@@ -209,13 +210,13 @@
             // 
             this.columnHeader4.Text = "不良代码组";
             this.columnHeader4.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
-            this.columnHeader4.Width = 100;
+            this.columnHeader4.Width = 130;
             // 
             // columnHeader1
             // 
             this.columnHeader1.Text = "不良代码";
             this.columnHeader1.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
-            this.columnHeader1.Width = 80;
+            this.columnHeader1.Width = 96;
             // 
             // columnHeader2
             // 
@@ -264,6 +265,7 @@
             this.columnHeader3,
             this.columnHeader7,
             this.columnHeader8});
+            this.ChoosedRejectList.Font = new System.Drawing.Font("微软雅黑", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.ChoosedRejectList.Location = new System.Drawing.Point(544, 329);
             this.ChoosedRejectList.Margin = new System.Windows.Forms.Padding(4);
             this.ChoosedRejectList.Name = "ChoosedRejectList";
@@ -281,13 +283,13 @@
             // 
             this.columnHeader3.Text = "不良代码组";
             this.columnHeader3.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
-            this.columnHeader3.Width = 95;
+            this.columnHeader3.Width = 130;
             // 
             // columnHeader7
             // 
             this.columnHeader7.Text = "不良代码";
             this.columnHeader7.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
-            this.columnHeader7.Width = 80;
+            this.columnHeader7.Width = 94;
             // 
             // columnHeader8
             // 

+ 44 - 12
UAS-MES/FunctionCode/Make/Make_TestCollection.cs

@@ -199,11 +199,11 @@ namespace UAS_MES.Make
             if (dt.Rows.Count == 0)
             {
                 sql.Clear();
-                sql.Append("select bg_code||':'||bg_name bg_code from badgroup");
+                sql.Append("select bg_code||':'||bg_name bg_name,bg_code from badgroup");
                 dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
-                bc_groupcode.DataSource = dt;
-                bc_groupcode.DisplayMember = "bg_code";
+                bc_groupcode.DisplayMember = "bg_name";
                 bc_groupcode.ValueMember = "bg_code";
+                bc_groupcode.DataSource = dt;
                 //设置Combox的下拉值
             }
             else
@@ -220,7 +220,8 @@ namespace UAS_MES.Make
         private void LoadBadCodeListView()
         {
             sql.Clear();
-            sql.Append("select bg_code||':'||bg_name bg_code,bc_name,bc_note from badcode left join badgroup on bc_groupcode=bg_code where bc_groupcode='" + bc_groupcode.Text + "' and bg_code is not null");
+            object bg_code = bc_groupcode.SelectedValue;
+            sql.Append("select bg_code||':'||bg_name bg_code,bc_code,bc_note from badcode left join badgroup on bc_groupcode=bg_code where bc_groupcode='" + (bg_code != null ? bg_code.ToString() : "") + "' and bg_code is not null");
             dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
             //往listview中添加数据
             WaitRejectList.Items.Clear();
@@ -235,6 +236,23 @@ namespace UAS_MES.Make
                 WaitRejectList.Items.Add(lvi);
             }
             WaitRejectList.EndUpdate();
+            sql.Clear();
+            sql.Append("select bg_code||':'||bg_name bg_code,bc_code,mb_badremark from makebad  ") ;
+            sql.Append("left join badgroup on mb_bgcode=bg_code left join badcode on mb_badcode=bc_code ");
+            sql.Append(" where mb_sncode='" + ms_sncode.Text + "' and mb_makecode='" + ma_code.Text + "'");
+            dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
+            ChoosedRejectList.Items.Clear();
+            ChoosedRejectList.BeginUpdate();
+            for (int i = 0; i < dt.Rows.Count; i++)
+            {
+                ListViewItem lvi = new ListViewItem();
+                //第一列是勾选列,设置列头文本为空
+                lvi.Text = "";
+                for (int j = 0; j < dt.Columns.Count; j++)
+                    lvi.SubItems.Add(dt.Rows[i][j].ToString());
+                ChoosedRejectList.Items.Add(lvi);
+            }
+            ChoosedRejectList.EndUpdate();
         }
 
         /// <summary>
@@ -259,11 +277,11 @@ namespace UAS_MES.Make
                 string RejectRecordNum = dh.getFieldDataByCondition("makeBad", "count(1) cn", "mb_sncode='" + ms_sncode.Text + "' and mb_status not in (1,-1)").ToString();
                 //存在不良记录
                 if (int.Parse(RejectRecordNum) > 0)
-                    OperateResult.AppendText(">>" + ms_sncode.Text + "存在不良记录,不允许通过!\n", Color.Red);
+                    OperateResult.AppendText(">>" + ms_sncode.Text + "已经判为不良品,不允许修改!\n", Color.Red);
                 else
                 {
                     //良品信息采集
-                    if (LogicHandler.UpdateMakeMessage(ms_sncode.Text, ma_code.Text, User.UserSourceCode, User.UserCode, "检测合格", out ErrorMessage))
+                    if (LogicHandler.UpdateMakeMessage(ms_sncode.Text, ma_code.Text, "良品采集", User.UserSourceCode, User.UserCode, "检测合格", out ErrorMessage))
                         OperateResult.AppendText(">>" + ms_sncode.Text + "已采集为良品\n", Color.Green);
                     else
                         OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red);
@@ -288,9 +306,10 @@ namespace UAS_MES.Make
             string ErrorMessage = "";
             if (AutoBadCode.Checked)
             {
-                bccode = new string[] { "DefaultValue" };
-                bcremark = new string[] { "DefaultValue" };
-                bgcode = new string[] { "DefaultValue" };
+                string defaultvalue = Properties.Settings.Default.DefaultCollectionValue;
+                bccode = new string[] { defaultvalue };
+                bcremark = new string[] { defaultvalue };
+                bgcode = new string[] { defaultvalue };
             }
             else
             {
@@ -305,7 +324,7 @@ namespace UAS_MES.Make
                     //如果长度不相等表示用户自行填写了
                     if (bccode.Length != RejectCount)
                     {
-                        bgcode[0] = bc_groupcode.Text;
+                        bgcode[0] = bc_groupcode.SelectedValue.ToString();
                         bccode[0] = bc_code.Text;
                         bcremark[0] = bc_remark.Text;
                     }
@@ -314,7 +333,8 @@ namespace UAS_MES.Make
                     {
                         if (!(bccode[0] == ChoosedRejectList.Items[bc_code.Text == "" ? i : i - 1].SubItems[1].Text))
                         {
-                            bgcode[i] = ChoosedRejectList.Items[bc_code.Text == "" ? i : i - 1].SubItems[1].Text;
+                            //截取分号前面的内容
+                            bgcode[i] = ChoosedRejectList.Items[bc_code.Text == "" ? i : i - 1].SubItems[1].Text.Split(':')[0];
                             //获取所有的不良代码
                             bccode[i] = ChoosedRejectList.Items[bc_code.Text == "" ? i : i - 1].SubItems[2].Text;
                             //获取所有的不良备注
@@ -323,7 +343,20 @@ namespace UAS_MES.Make
                     }
                 }
             }
+            //如果之前是良品的
+            dt = dh.getFieldsDataByCondition("makeserial", new string[] { "ms_status", "ms_checkno" }, "ms_sncode='" + ms_sncode.Text + "' and ms_stepcode='" + User.CurrentStepCode + "'");
+            if (dt.Rows.Count > 0)
+            {
+                string status = dt.Rows[0]["ms_status"].ToString();
+                if (status == "1" || status == "2")
+                    dh.UpdateByCondition("makecraftdetail", "mcd_okqty=mcd_okqty-1", "mcd_macode='" + ma_code.Text + "' and mcd_stepcode='" + User.CurrentStepCode + "'");
+                string checkno = dt.Rows[0]["ms_checkno"].ToString();
+                //存在抽检批次更新为空
+                if (checkno != "")
+                    dh.UpdateByCondition("makeserial", "ms_checkno=''", "ms_sncode='" + ms_sncode.Text + "' and ms_makecode='" + ma_code.Text + "'");
+            }
             //不良信息采集
+            dh.ExecuteSql("delete from makebad where mb_sncode='"+ms_sncode.Text+"' and mb_makecode='"+ma_code.Text+"'","delete");
             if (LogicHandler.SetTestNGDetail(ms_sncode.Text, ma_code.Text, User.UserName, User.UserSourceCode, "检查未通过", bgcode, bccode, bcremark, out ErrorMessage))
             {
                 OperateResult.AppendText(">>" + ms_sncode.Text + "已采集为不良\n", Color.Green);
@@ -337,7 +370,6 @@ namespace UAS_MES.Make
             }
             else
                 OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red);
-
         }
 
         private void bc_code_KeyDown(object sender, KeyEventArgs e)