Bladeren bron

修改Key冻结功能

callm 3 weken geleden
bovenliggende
commit
b8410a3782

+ 32 - 0
UAS_MES_YDCY/FunctionCode/Special/Special_FreezeKey.Designer.cs

@@ -39,6 +39,8 @@
             this.SaveRepairInf = new UAS_MES_NEW.CustomControl.ButtonUtil.NormalButton();
             this.SN = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.cd_stepno = new System.Windows.Forms.Label();
+            this.cu_code = new System.Windows.Forms.ComboBox();
+            this.label1 = new System.Windows.Forms.Label();
             this.SuspendLayout();
             // 
             // SN_label
@@ -192,11 +194,39 @@
             this.cd_stepno.Size = new System.Drawing.Size(0, 41);
             this.cd_stepno.TabIndex = 156;
             // 
+            // cu_code
+            // 
+            this.cu_code.FormattingEnabled = true;
+            this.cu_code.Items.AddRange(new object[] {
+            "华硕",
+            "机械革命",
+            "MEDION",
+            "ACER"});
+            this.cu_code.Location = new System.Drawing.Point(279, 351);
+            this.cu_code.Name = "cu_code";
+            this.cu_code.Size = new System.Drawing.Size(318, 32);
+            this.cu_code.TabIndex = 157;
+            // 
+            // 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(115, 343);
+            this.label1.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.label1.Name = "label1";
+            this.label1.Size = new System.Drawing.Size(82, 41);
+            this.label1.TabIndex = 158;
+            this.label1.Text = "客户";
+            // 
             // Special_FreezeKey
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 24F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.ClientSize = new System.Drawing.Size(1384, 713);
+            this.Controls.Add(this.label1);
+            this.Controls.Add(this.cu_code);
             this.Controls.Add(this.cd_stepno);
             this.Controls.Add(this.cd_stepcode);
             this.Controls.Add(this.st_rstepcode_label);
@@ -229,5 +259,7 @@
         private System.Windows.Forms.Label ma_craftcode_label;
         private CustomControl.TextBoxWithIcon.SearchTextBox cr_code;
         private System.Windows.Forms.Label cd_stepno;
+        private System.Windows.Forms.ComboBox cu_code;
+        private System.Windows.Forms.Label label1;
     }
 }

+ 36 - 2
UAS_MES_YDCY/FunctionCode/Special/Special_FreezeKey.cs

@@ -49,7 +49,25 @@ namespace UAS_MES_NEW.Special
         {
             if (ms_id == "") { OperateResult.AppendText(">>请先获取SN\n"); return; }
             if (cd_stepcode.Text == "") { OperateResult.AppendText(">>请选择回流工序\n"); return; }
-            DataTable dt = (DataTable)dh.ExecuteSql("select mil_sncode,mil_id,nvl(ms_ifqccheck,0)ms_ifqccheck,ms_makecode,ms_firstsn,ms_sncode,ms_prodcode,ms_checkno,ms_craftcode,ms_outboxcode,mil_netcode from makeserial left join makeimeilist on mil_sncode=ms_sncode where ms_id='" + ms_id + "' and instr(ms_paststep,'" + cd_stepcode.Text + "')>0 ", "select");
+            DataTable dt = null;
+            switch (cu_code.Text)
+            {
+                case "华硕":
+                    dt = (DataTable)dh.ExecuteSql("select mil_id,nvl(ms_ifqccheck,0)ms_ifqccheck,ms_makecode,ms_firstsn,ms_sncode,ms_prodcode,ms_checkno,ms_craftcode,ms_outboxcode,mil_netcode from makeserial left join makeimeilist on mil_sncode=ms_sncode where ms_id='" + ms_id + "' and instr(ms_paststep,'" + cd_stepcode.Text + "')>0 ", "select");
+                    break;
+                case "机械革命":
+                    dt = (DataTable)dh.ExecuteSql("select mk_id mil_id,nvl(ms_ifqccheck,0)ms_ifqccheck,ms_makecode,ms_firstsn,ms_sncode,ms_prodcode,ms_checkno,ms_craftcode,ms_outboxcode,MK_DPK mil_netcode from makeserial left join MECHREVO_KEY on mk_sncode=ms_sncode where ms_id='" + ms_id + "' and instr(ms_paststep,'" + cd_stepcode.Text + "')>0 ", "select");
+                    break;
+                case "MEDION":
+                    dt = (DataTable)dh.ExecuteSql("select mk_id mil_id,nvl(ms_ifqccheck,0)ms_ifqccheck,ms_makecode,ms_firstsn,ms_sncode,ms_prodcode,ms_checkno,ms_craftcode,ms_outboxcode,MK_DPK mil_netcode from makeserial left join medion_key on mk_sncode=ms_sncode where ms_id='" + ms_id + "' and instr(ms_paststep,'" + cd_stepcode.Text + "')>0 ", "select");
+                    break;
+                case "ACER":
+                    dt = (DataTable)dh.ExecuteSql("select mk_id mil_id,nvl(ms_ifqccheck,0)ms_ifqccheck,ms_makecode,ms_firstsn,ms_sncode,ms_prodcode,ms_checkno,ms_craftcode,ms_outboxcode,MK_DPK mil_netcode from makeserial left join acer_key on mk_sncode=ms_sncode where ms_id='" + ms_id + "' and instr(ms_paststep,'" + cd_stepcode.Text + "')>0 ", "select");
+                    break;
+                default:
+                    break;
+            }
+
             string ms_checkno = dt.Rows[0]["ms_checkno"].ToString();
 
             if (dt.Rows.Count == 0) { OperateResult.AppendText(">>" + SN.Text + "不存在或未执行过" + cd_stepcode.Text + "工序\n"); return; }
@@ -76,7 +94,23 @@ namespace UAS_MES_NEW.Special
                 OperateResult.AppendText(">>序列号" + SN.Text + "不存在Key\n", Color.Red, SN);
                 return;
             }
-            dh.ExecuteSql("update makeimeilist set mil_sncode='',mil_status=-2,MIL_REMARK='主动冻结' where mil_id='" + mil_id + "'", "update");
+            switch (cu_code.Text)
+            {
+                case "华硕":
+                    dh.ExecuteSql("update makeimeilist set mil_sncode='',mil_status=-2,MIL_REMARK='主动冻结' where mil_id='" + mil_id + "'", "update");
+                    break;
+                case "机械革命":
+                    dh.ExecuteSql("update mechrevo_key set mk_sncode='',MK_STATUS=-2,mk_remark='主动冻结' where mk_id='" + mil_id + "'", "update");
+                    break;
+                case "MEDION":
+                    dh.ExecuteSql("update medion_key set mk_sncode='',MK_STATUS=-2,mk_remark='主动冻结' where mk_id='" + mil_id + "'", "update");
+                    break;
+                case "ACER":
+                    dh.ExecuteSql("update acer_key set mk_sncode='',MK_STATUS=-2,mk_remark='主动冻结' where mk_id='" + mil_id + "'", "update");
+                    break;
+                default:
+                    break;
+            }
             LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, ms_makecode, User.UserLineCode, User.UserSourceCode, "Key冻结成功", "Key冻结成功", SN.Text, "");
             OperateResult.AppendText(">>序列号" + SN.Text + "Key[" + mil_netcode + "]冻结成功\n", Color.Green, SN);
             if (cr_code.Text != "" && cr_code.Text != ms_craftcode) { OperateResult.AppendText(">>序列号途程和所选途程不一致\n"); return; }