瀏覽代碼

序列号转换

shim 8 年之前
父節點
當前提交
a1a1ff160c
共有 2 個文件被更改,包括 439 次插入99 次删除
  1. 202 85
      UAS-MES/FunctionCode/Make/Make_SeqTransform.Designer.cs
  2. 237 14
      UAS-MES/FunctionCode/Make/Make_SeqTransform.cs

+ 202 - 85
UAS-MES/FunctionCode/Make/Make_SeqTransform.Designer.cs

@@ -37,55 +37,61 @@
             this.sncode_label = new System.Windows.Forms.Label();
             this.ChangeResult = new System.Windows.Forms.CheckBox();
             this.changenum_lanel = new System.Windows.Forms.Label();
-            this.ma_qty = new System.Windows.Forms.Label();
-            this.ma_qty_lable = new System.Windows.Forms.Label();
             this.OperateResult = new UAS_MES.CustomControl.RichText.RichTextAutoBottom();
             this.sncode = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.ReCall = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
             this.Confirm = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
             this.changenum = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
-            this.ms_makecode = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
+            this.ma_code = new UAS_MES.CustomControl.TextBoxWithIcon.MaCodeSearchTextBox();
+            this.ms_makecode_lock = new UAS_MES.CustomControl.CustomCheckBox.LockCheckBox();
+            this.beforeTransSNLength_checkBox = new System.Windows.Forms.CheckBox();
+            this.afterTransSNLength_checkBox = new System.Windows.Forms.CheckBox();
+            this.beforeTransSNPre_checkBox = new System.Windows.Forms.CheckBox();
+            this.afterTransSNPre_checkBox = new System.Windows.Forms.CheckBox();
+            this.beforeTransSNLength = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
+            this.afterTransSNLength = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
+            this.beforeTransSNPre = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
+            this.afterTransSNPre = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.SuspendLayout();
             // 
             // pr_detail
             // 
             this.pr_detail.AutoSize = true;
             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(141, 69);
+            this.pr_detail.Location = new System.Drawing.Point(877, 22);
             this.pr_detail.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.pr_detail.Name = "pr_detail";
-            this.pr_detail.Size = new System.Drawing.Size(0, 27);
+            this.pr_detail.Size = new System.Drawing.Size(0, 31);
             this.pr_detail.TabIndex = 65;
             // 
             // 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(20, 21);
+            this.ms_makecode_label.Location = new System.Drawing.Point(22, 25);
             this.ms_makecode_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.ms_makecode_label.Name = "ms_makecode_label";
-            this.ms_makecode_label.Size = new System.Drawing.Size(92, 27);
+            this.ms_makecode_label.Size = new System.Drawing.Size(0, 31);
             this.ms_makecode_label.TabIndex = 61;
-            this.ms_makecode_label.Text = "归属工单";
             // 
             // ma_prodcode
             // 
             this.ma_prodcode.AutoSize = true;
             this.ma_prodcode.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ma_prodcode.Location = new System.Drawing.Point(492, 22);
+            this.ma_prodcode.Location = new System.Drawing.Point(533, 22);
             this.ma_prodcode.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.ma_prodcode.Name = "ma_prodcode";
-            this.ma_prodcode.Size = new System.Drawing.Size(0, 27);
+            this.ma_prodcode.Size = new System.Drawing.Size(0, 31);
             this.ma_prodcode.TabIndex = 64;
             // 
             // 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(20, 69);
+            this.pr_detail_label.Location = new System.Drawing.Point(738, 22);
             this.pr_detail_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.pr_detail_label.Name = "pr_detail_label";
-            this.pr_detail_label.Size = new System.Drawing.Size(92, 27);
+            this.pr_detail_label.Size = new System.Drawing.Size(110, 31);
             this.pr_detail_label.TabIndex = 62;
             this.pr_detail_label.Text = "产品名称";
             // 
@@ -93,10 +99,10 @@
             // 
             this.ma_prodcode_label.AutoSize = true;
             this.ma_prodcode_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ma_prodcode_label.Location = new System.Drawing.Point(375, 21);
+            this.ma_prodcode_label.Location = new System.Drawing.Point(396, 22);
             this.ma_prodcode_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.ma_prodcode_label.Name = "ma_prodcode_label";
-            this.ma_prodcode_label.Size = new System.Drawing.Size(92, 27);
+            this.ma_prodcode_label.Size = new System.Drawing.Size(110, 31);
             this.ma_prodcode_label.TabIndex = 63;
             this.ma_prodcode_label.Text = "产品编号";
             // 
@@ -104,10 +110,10 @@
             // 
             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(20, 552);
+            this.sncode_label.Location = new System.Drawing.Point(22, 662);
             this.sncode_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.sncode_label.Name = "sncode_label";
-            this.sncode_label.Size = new System.Drawing.Size(72, 27);
+            this.sncode_label.Size = new System.Drawing.Size(86, 31);
             this.sncode_label.TabIndex = 68;
             this.sncode_label.Text = "录入框";
             // 
@@ -115,10 +121,10 @@
             // 
             this.ChangeResult.AutoSize = true;
             this.ChangeResult.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ChangeResult.Location = new System.Drawing.Point(395, 552);
-            this.ChangeResult.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.ChangeResult.Location = new System.Drawing.Point(444, 662);
+            this.ChangeResult.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
             this.ChangeResult.Name = "ChangeResult";
-            this.ChangeResult.Size = new System.Drawing.Size(154, 31);
+            this.ChangeResult.Size = new System.Drawing.Size(184, 35);
             this.ChangeResult.TabIndex = 70;
             this.ChangeResult.Text = "修改转换结果";
             this.ChangeResult.UseVisualStyleBackColor = true;
@@ -127,41 +133,20 @@
             // 
             this.changenum_lanel.AutoSize = true;
             this.changenum_lanel.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.changenum_lanel.Location = new System.Drawing.Point(585, 552);
+            this.changenum_lanel.Location = new System.Drawing.Point(658, 662);
             this.changenum_lanel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.changenum_lanel.Name = "changenum_lanel";
-            this.changenum_lanel.Size = new System.Drawing.Size(92, 27);
+            this.changenum_lanel.Size = new System.Drawing.Size(110, 31);
             this.changenum_lanel.TabIndex = 71;
             this.changenum_lanel.Text = "转换数量";
             // 
-            // ma_qty
-            // 
-            this.ma_qty.AutoSize = true;
-            this.ma_qty.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ma_qty.Location = new System.Drawing.Point(819, 22);
-            this.ma_qty.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.ma_qty.Name = "ma_qty";
-            this.ma_qty.Size = new System.Drawing.Size(0, 27);
-            this.ma_qty.TabIndex = 76;
-            // 
-            // ma_qty_lable
-            // 
-            this.ma_qty_lable.AutoSize = true;
-            this.ma_qty_lable.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ma_qty_lable.Location = new System.Drawing.Point(712, 22);
-            this.ma_qty_lable.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.ma_qty_lable.Name = "ma_qty_lable";
-            this.ma_qty_lable.Size = new System.Drawing.Size(72, 27);
-            this.ma_qty_lable.TabIndex = 75;
-            this.ma_qty_lable.Text = "工单数";
-            // 
             // 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(27, 109);
-            this.OperateResult.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.OperateResult.Location = new System.Drawing.Point(30, 212);
+            this.OperateResult.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
             this.OperateResult.Name = "OperateResult";
-            this.OperateResult.Size = new System.Drawing.Size(1081, 426);
+            this.OperateResult.Size = new System.Drawing.Size(1216, 429);
             this.OperateResult.TabIndex = 78;
             this.OperateResult.Text = "";
             // 
@@ -170,11 +155,11 @@
             this.sncode.AllPower = "ifall";
             this.sncode.BackColor = System.Drawing.Color.White;
             this.sncode.ID = null;
-            this.sncode.Location = new System.Drawing.Point(127, 552);
-            this.sncode.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.sncode.Location = new System.Drawing.Point(143, 662);
+            this.sncode.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
             this.sncode.Name = "sncode";
             this.sncode.Power = "ifwrite";
-            this.sncode.Size = new System.Drawing.Size(212, 25);
+            this.sncode.Size = new System.Drawing.Size(238, 28);
             this.sncode.Str = null;
             this.sncode.Str1 = null;
             this.sncode.Str2 = null;
@@ -189,13 +174,13 @@
             this.ReCall.DownImage = ((System.Drawing.Image)(resources.GetObject("ReCall.DownImage")));
             this.ReCall.Image = ((System.Drawing.Image)(resources.GetObject("ReCall.Image")));
             this.ReCall.IsShowBorder = true;
-            this.ReCall.Location = new System.Drawing.Point(584, 598);
-            this.ReCall.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.ReCall.Location = new System.Drawing.Point(657, 718);
+            this.ReCall.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
             this.ReCall.MoveImage = ((System.Drawing.Image)(resources.GetObject("ReCall.MoveImage")));
             this.ReCall.Name = "ReCall";
             this.ReCall.NormalImage = ((System.Drawing.Image)(resources.GetObject("ReCall.NormalImage")));
             this.ReCall.Power = null;
-            this.ReCall.Size = new System.Drawing.Size(93, 30);
+            this.ReCall.Size = new System.Drawing.Size(105, 36);
             this.ReCall.TabIndex = 74;
             this.ReCall.Text = "撤销输入";
             this.ReCall.UseVisualStyleBackColor = true;
@@ -208,13 +193,13 @@
             this.Confirm.DownImage = ((System.Drawing.Image)(resources.GetObject("Confirm.DownImage")));
             this.Confirm.Image = ((System.Drawing.Image)(resources.GetObject("Confirm.Image")));
             this.Confirm.IsShowBorder = true;
-            this.Confirm.Location = new System.Drawing.Point(453, 598);
-            this.Confirm.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.Confirm.Location = new System.Drawing.Point(510, 718);
+            this.Confirm.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
             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(93, 30);
+            this.Confirm.Size = new System.Drawing.Size(105, 36);
             this.Confirm.TabIndex = 73;
             this.Confirm.Tag = "IfWrite";
             this.Confirm.Text = "确认";
@@ -226,56 +211,182 @@
             this.changenum.AllPower = null;
             this.changenum.BackColor = System.Drawing.Color.White;
             this.changenum.ID = null;
-            this.changenum.Location = new System.Drawing.Point(717, 552);
-            this.changenum.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.changenum.Location = new System.Drawing.Point(807, 662);
+            this.changenum.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
             this.changenum.Name = "changenum";
             this.changenum.Power = null;
             this.changenum.ReadOnly = true;
-            this.changenum.Size = new System.Drawing.Size(212, 25);
+            this.changenum.Size = new System.Drawing.Size(238, 28);
             this.changenum.Str = null;
             this.changenum.Str1 = null;
             this.changenum.Str2 = null;
             this.changenum.TabIndex = 72;
             // 
-            // ms_makecode
-            // 
-            this.ms_makecode.AllPower = null;
-            this.ms_makecode.BackColor = System.Drawing.Color.White;
-            this.ms_makecode.ID = null;
-            this.ms_makecode.Location = new System.Drawing.Point(139, 21);
-            this.ms_makecode.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
-            this.ms_makecode.Name = "ms_makecode";
-            this.ms_makecode.Power = null;
-            this.ms_makecode.Size = new System.Drawing.Size(212, 25);
-            this.ms_makecode.Str = null;
-            this.ms_makecode.Str1 = null;
-            this.ms_makecode.Str2 = null;
-            this.ms_makecode.TabIndex = 66;
-            // 
-            // 序列转换
-            // 
-            this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
+            // ma_code
+            // 
+            this.ma_code.AllPower = null;
+            this.ma_code.Caller = null;
+            this.ma_code.Condition = null;
+            this.ma_code.DBTitle = null;
+            this.ma_code.Font = new System.Drawing.Font("微软雅黑", 12F);
+            this.ma_code.FormName = null;
+            this.ma_code.Location = new System.Drawing.Point(108, 22);
+            this.ma_code.Name = "ma_code";
+            this.ma_code.Power = null;
+            this.ma_code.SelectField = null;
+            this.ma_code.SetValueField = null;
+            this.ma_code.Size = new System.Drawing.Size(221, 32);
+            this.ma_code.TabIndex = 79;
+            this.ma_code.TableName = null;
+            this.ma_code.Tag = "ma_code";
+            this.ma_code.TextBoxEnable = false;
+            // 
+            // ms_makecode_lock
+            // 
+            this.ms_makecode_lock.AutoSize = true;
+            this.ms_makecode_lock.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.ms_makecode_lock.Location = new System.Drawing.Point(30, 26);
+            this.ms_makecode_lock.Name = "ms_makecode_lock";
+            this.ms_makecode_lock.Size = new System.Drawing.Size(72, 28);
+            this.ms_makecode_lock.TabIndex = 80;
+            this.ms_makecode_lock.Text = "锁定";
+            this.ms_makecode_lock.UseVisualStyleBackColor = true;
+            // 
+            // beforeTransSNLength_checkBox
+            // 
+            this.beforeTransSNLength_checkBox.AutoSize = true;
+            this.beforeTransSNLength_checkBox.Font = new System.Drawing.Font("微软雅黑", 10F);
+            this.beforeTransSNLength_checkBox.Location = new System.Drawing.Point(30, 95);
+            this.beforeTransSNLength_checkBox.Name = "beforeTransSNLength_checkBox";
+            this.beforeTransSNLength_checkBox.Size = new System.Drawing.Size(198, 31);
+            this.beforeTransSNLength_checkBox.TabIndex = 81;
+            this.beforeTransSNLength_checkBox.Text = "转换前序列号长度";
+            this.beforeTransSNLength_checkBox.UseVisualStyleBackColor = true;
+            // 
+            // afterTransSNLength_checkBox
+            // 
+            this.afterTransSNLength_checkBox.AutoSize = true;
+            this.afterTransSNLength_checkBox.Font = new System.Drawing.Font("微软雅黑", 10F);
+            this.afterTransSNLength_checkBox.Location = new System.Drawing.Point(30, 144);
+            this.afterTransSNLength_checkBox.Name = "afterTransSNLength_checkBox";
+            this.afterTransSNLength_checkBox.Size = new System.Drawing.Size(198, 31);
+            this.afterTransSNLength_checkBox.TabIndex = 82;
+            this.afterTransSNLength_checkBox.Text = "转换后序列号长度";
+            this.afterTransSNLength_checkBox.UseVisualStyleBackColor = true;
+            // 
+            // beforeTransSNPre_checkBox
+            // 
+            this.beforeTransSNPre_checkBox.AutoSize = true;
+            this.beforeTransSNPre_checkBox.Font = new System.Drawing.Font("微软雅黑", 10F);
+            this.beforeTransSNPre_checkBox.Location = new System.Drawing.Point(631, 93);
+            this.beforeTransSNPre_checkBox.Name = "beforeTransSNPre_checkBox";
+            this.beforeTransSNPre_checkBox.Size = new System.Drawing.Size(198, 31);
+            this.beforeTransSNPre_checkBox.TabIndex = 83;
+            this.beforeTransSNPre_checkBox.Text = "转换前序列号前缀";
+            this.beforeTransSNPre_checkBox.UseVisualStyleBackColor = true;
+            // 
+            // afterTransSNPre_checkBox
+            // 
+            this.afterTransSNPre_checkBox.AutoSize = true;
+            this.afterTransSNPre_checkBox.Font = new System.Drawing.Font("微软雅黑", 10F);
+            this.afterTransSNPre_checkBox.Location = new System.Drawing.Point(631, 143);
+            this.afterTransSNPre_checkBox.Name = "afterTransSNPre_checkBox";
+            this.afterTransSNPre_checkBox.Size = new System.Drawing.Size(198, 31);
+            this.afterTransSNPre_checkBox.TabIndex = 84;
+            this.afterTransSNPre_checkBox.Text = "转换后序列号前缀";
+            this.afterTransSNPre_checkBox.UseVisualStyleBackColor = true;
+            // 
+            // beforeTransSNLength
+            // 
+            this.beforeTransSNLength.AllPower = null;
+            this.beforeTransSNLength.BackColor = System.Drawing.Color.White;
+            this.beforeTransSNLength.Font = new System.Drawing.Font("微软雅黑", 10F);
+            this.beforeTransSNLength.ID = null;
+            this.beforeTransSNLength.Location = new System.Drawing.Point(247, 93);
+            this.beforeTransSNLength.Name = "beforeTransSNLength";
+            this.beforeTransSNLength.Power = null;
+            this.beforeTransSNLength.Size = new System.Drawing.Size(250, 34);
+            this.beforeTransSNLength.Str = null;
+            this.beforeTransSNLength.Str1 = null;
+            this.beforeTransSNLength.Str2 = null;
+            this.beforeTransSNLength.TabIndex = 85;
+            // 
+            // afterTransSNLength
+            // 
+            this.afterTransSNLength.AllPower = null;
+            this.afterTransSNLength.BackColor = System.Drawing.Color.White;
+            this.afterTransSNLength.Font = new System.Drawing.Font("微软雅黑", 10F);
+            this.afterTransSNLength.ID = null;
+            this.afterTransSNLength.Location = new System.Drawing.Point(247, 144);
+            this.afterTransSNLength.Name = "afterTransSNLength";
+            this.afterTransSNLength.Power = null;
+            this.afterTransSNLength.Size = new System.Drawing.Size(250, 34);
+            this.afterTransSNLength.Str = null;
+            this.afterTransSNLength.Str1 = null;
+            this.afterTransSNLength.Str2 = null;
+            this.afterTransSNLength.TabIndex = 86;
+            // 
+            // beforeTransSNPre
+            // 
+            this.beforeTransSNPre.AllPower = null;
+            this.beforeTransSNPre.BackColor = System.Drawing.Color.White;
+            this.beforeTransSNPre.Font = new System.Drawing.Font("微软雅黑", 10F);
+            this.beforeTransSNPre.ID = null;
+            this.beforeTransSNPre.Location = new System.Drawing.Point(871, 93);
+            this.beforeTransSNPre.Name = "beforeTransSNPre";
+            this.beforeTransSNPre.Power = null;
+            this.beforeTransSNPre.Size = new System.Drawing.Size(250, 34);
+            this.beforeTransSNPre.Str = null;
+            this.beforeTransSNPre.Str1 = null;
+            this.beforeTransSNPre.Str2 = null;
+            this.beforeTransSNPre.TabIndex = 87;
+            // 
+            // afterTransSNPre
+            // 
+            this.afterTransSNPre.AllPower = null;
+            this.afterTransSNPre.BackColor = System.Drawing.Color.White;
+            this.afterTransSNPre.Font = new System.Drawing.Font("微软雅黑", 10F);
+            this.afterTransSNPre.ID = null;
+            this.afterTransSNPre.Location = new System.Drawing.Point(871, 143);
+            this.afterTransSNPre.Name = "afterTransSNPre";
+            this.afterTransSNPre.Power = null;
+            this.afterTransSNPre.Size = new System.Drawing.Size(250, 34);
+            this.afterTransSNPre.Str = null;
+            this.afterTransSNPre.Str1 = null;
+            this.afterTransSNPre.Str2 = null;
+            this.afterTransSNPre.TabIndex = 88;
+            // 
+            // Make_SeqTransform
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 18F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(1132, 640);
+            this.ClientSize = new System.Drawing.Size(1274, 768);
+            this.Controls.Add(this.afterTransSNPre);
+            this.Controls.Add(this.beforeTransSNPre);
+            this.Controls.Add(this.afterTransSNLength);
+            this.Controls.Add(this.beforeTransSNLength);
+            this.Controls.Add(this.afterTransSNPre_checkBox);
+            this.Controls.Add(this.beforeTransSNPre_checkBox);
+            this.Controls.Add(this.afterTransSNLength_checkBox);
+            this.Controls.Add(this.beforeTransSNLength_checkBox);
+            this.Controls.Add(this.ms_makecode_lock);
+            this.Controls.Add(this.ma_code);
             this.Controls.Add(this.OperateResult);
             this.Controls.Add(this.sncode);
-            this.Controls.Add(this.ma_qty);
-            this.Controls.Add(this.ma_qty_lable);
             this.Controls.Add(this.ReCall);
             this.Controls.Add(this.Confirm);
             this.Controls.Add(this.changenum);
             this.Controls.Add(this.changenum_lanel);
             this.Controls.Add(this.ChangeResult);
             this.Controls.Add(this.sncode_label);
-            this.Controls.Add(this.ms_makecode);
             this.Controls.Add(this.pr_detail);
             this.Controls.Add(this.ms_makecode_label);
             this.Controls.Add(this.ma_prodcode);
             this.Controls.Add(this.pr_detail_label);
             this.Controls.Add(this.ma_prodcode_label);
             this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
-            this.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
-            this.Name = "序列转换";
+            this.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
+            this.Name = "Make_SeqTransform";
             this.Tag = "Make!SeqTransform";
             this.Text = " ";
             this.Load += new System.EventHandler(this.序列转换_Load);
@@ -286,8 +397,6 @@
         }
 
         #endregion
-
-        private CustomControl.TextBoxWithIcon.EnterTextBox ms_makecode;
         private System.Windows.Forms.Label pr_detail;
         private System.Windows.Forms.Label ms_makecode_label;
         private System.Windows.Forms.Label ma_prodcode;
@@ -299,9 +408,17 @@
         private System.Windows.Forms.Label changenum_lanel;
         private CustomControl.ButtonUtil.NormalButton Confirm;
         private CustomControl.ButtonUtil.NormalButton ReCall;
-        private System.Windows.Forms.Label ma_qty;
-        private System.Windows.Forms.Label ma_qty_lable;
         private CustomControl.TextBoxWithIcon.EnterTextBox sncode;
         private CustomControl.RichText.RichTextAutoBottom OperateResult;
+        private CustomControl.TextBoxWithIcon.MaCodeSearchTextBox ma_code;
+        private CustomControl.CustomCheckBox.LockCheckBox ms_makecode_lock;
+        private System.Windows.Forms.CheckBox beforeTransSNLength_checkBox;
+        private System.Windows.Forms.CheckBox afterTransSNLength_checkBox;
+        private System.Windows.Forms.CheckBox beforeTransSNPre_checkBox;
+        private System.Windows.Forms.CheckBox afterTransSNPre_checkBox;
+        private CustomControl.TextBoxWithIcon.EnterTextBox beforeTransSNLength;
+        private CustomControl.TextBoxWithIcon.EnterTextBox afterTransSNLength;
+        private CustomControl.TextBoxWithIcon.EnterTextBox beforeTransSNPre;
+        private CustomControl.TextBoxWithIcon.EnterTextBox afterTransSNPre;
     }
 }

+ 237 - 14
UAS-MES/FunctionCode/Make/Make_SeqTransform.cs

@@ -1,6 +1,8 @@
 using System;
+using System.Data;
 using System.Drawing;
 using System.Windows.Forms;
+using UAS_MES.CustomControl.TextBoxWithIcon;
 using UAS_MES.DataOperate;
 using UAS_MES.Entity;
 using UAS_MES.PublicMethod;
@@ -13,7 +15,9 @@ namespace UAS_MES.Make
 
         DataHelper dh;
 
-        string bsncode = "";
+        DataTable dt;
+
+        string bsncode = "";//转换前序列号
 
         public Make_SeqTransform()
         {
@@ -25,6 +29,17 @@ namespace UAS_MES.Make
             asc.controllInitializeSize(this);
             dh = new DataHelper();
             sncode.Focus();
+
+            //设置锁定工单
+            ms_makecode_lock.GetMakeCodeCtl(ma_code);
+            ma_code.SetLockCheckBox(ms_makecode_lock);
+
+            //工单放大镜的配置
+            ma_code.TableName = "make left join product on ma_prodcode=pr_code";
+            ma_code.SelectField = "ma_code # 工单号,ma_prodcode # 产品编号,pr_detail # 产品名称";
+            ma_code.FormName = Name;
+            ma_code.SetValueField = new string[] { "ma_code", "ma_prodcode", "pr_detail" };
+            ma_code.Condition = "ma_statuscode='STARTED'";
         }
 
         private void sncode_KeyDown(object sender, KeyEventArgs e)
@@ -37,25 +52,43 @@ namespace UAS_MES.Make
                     //如果用户没有输入工单号自行去后台查询
                     string macode;
                     //如果用户填写了工单号 
-                    if (ms_makecode.Text != "")
+                    if (ma_code.Text != "")
                     {
-                        macode = ms_makecode.Text;
+                        macode = ma_code.Text;
+                        //用户填写了工单号,那么序列号必须要是该工单的,否则提示错误
+                        if (dh.CheckExist("makeserial", "ms_makecode='" + ma_code.Text + "' and (ms_sncode='" + sncode.Text + "' or ms_beforesn='" + sncode.Text + "')"))
+                        {
+                            OperateResult.AppendText(">>序列号" + sncode.Text + "不属于工单" + ma_code.Text + ",请重新输入或者切换工单\n", Color.Red);
+                            return;
+                        }
                     }
                     else
                     {
-                        macode = dh.getFieldDataByCondition("makeserial", "ms_makecode", "ms_sncode='" + sncode.Text + "' or ms_psn='" + sncode.Text + "'").ToString();
+                        macode = dh.getFieldDataByCondition("makeserial", "ms_makecode", "ms_sncode='" + sncode.Text + "' or ms_beforesn='" + sncode.Text + "'").ToString();
                     }
                     string ErrorMessage = "";
                     bool ifFirst;
+                    //bsncode为空,就说明是输入转换之前的序列号
                     if (bsncode == "")
                     {
+                        //判断用户是否锁定输入转换前序列号长度,
+                        if (!checkLengthOrPre(beforeTransSNLength_checkBox, beforeTransSNLength, "长度"))
+                        {
+                            return;
+                        }
+                        //判断用户是否锁定输入转换前序列号前缀,
+                        if (!checkLengthOrPre(beforeTransSNPre_checkBox, beforeTransSNPre, "前缀"))
+                        {
+                            return;
+                        }
+                        //核对工序
                         if (LogicHandler.CheckCurrentStepAndIfFirst(sncode.Text, macode, User.UserSourceCode, Tag.ToString(), out ifFirst, out ErrorMessage))
                         {
                             switch (ChangeResult.CheckState)
                             {
-                                //勾选状态是验证已转换的序列
+                                //勾选是修改已转换的序列,矫正修改错了的序列号
                                 case CheckState.Checked:
-                                    if (dh.CheckExist("MakeSerial", "ms_psn='" + sncode.Text + "'"))
+                                    if (dh.CheckExist("MakeSerial", "ms_beforesn='" + sncode.Text + "'"))
                                     {
                                         bsncode = sncode.Text;
                                         sncode.Text = "";
@@ -64,18 +97,26 @@ namespace UAS_MES.Make
                                     else
                                     {
                                         OperateResult.AppendText(">>不存在该已转序列号" + sncode.Text + "\n");
+                                        sncode.Text = "";
+                                        OperateResult.AppendText("<<请重新输入序列号\n", Color.Green);
                                     }
                                     break;
                                 case CheckState.Unchecked:
-                                    if (dh.getFieldDataByCondition("makeserial", "ms_psn", "ms_sncode='" + sncode.Text + "'").ToString() == "")
+                                    string beforesn = dh.getFieldDataByCondition("makeserial", "ms_beforesn", "ms_sncode='" + sncode.Text + "'").ToString().Trim();
+                                    //为空,就说明,没有进行过序列号的转换
+                                    if (beforesn == "" || beforesn == null)
                                     {
+                                        //记录转换前的序列号
                                         bsncode = sncode.Text;
                                         sncode.Text = "";
                                         OperateResult.AppendText("<<请输入转换后的序列号\n", Color.Green);
                                     }
                                     else
+                                    //不为空,进行过转换。不勾选修改结果,就不能再修改
                                     {
                                         OperateResult.AppendText(">>序列号" + sncode.Text + "已进行了转换\n", Color.Red);
+                                        sncode.Text = "";
+                                        OperateResult.AppendText("<<请重新输入序列号\n", Color.Green);
                                     }
                                     break;
                                 default:
@@ -87,31 +128,65 @@ namespace UAS_MES.Make
                             OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red);
                         }
                     }
+                    //bsncode不为空,说明输入的是转换后的序列号
                     else
                     {
-                        //如果两次输入的序列号相同进行提示
+                        //判断用户是否锁定输入转换后序列号长度,
+                        if (!checkLengthOrPre(afterTransSNLength_checkBox, afterTransSNLength, "长度"))
+                        {
+                            return;
+                        }
+                        //判断用户是否锁定输入转换后序列号前缀,
+                        if (!checkLengthOrPre(afterTransSNPre_checkBox, afterTransSNPre, "前缀"))
+                        {
+                            return;
+                        }
+                        //如果两次输入的序列号相同进行提示,不相同则进行下一步
                         if (bsncode != sncode.Text)
                         {
-                            //勾选了取消转换
+                            //勾选了修改转换结果
                             if (ChangeResult.Checked)
                             {
-                                if (!dh.CheckExist("makeserial", "ms_psn='" + sncode.Text + "'"))
+
+                                if (!dh.CheckExist("makeserial", "ms_sncode='" + sncode.Text + "'"))
                                 {
-                                    dh.UpdateByCondition("makeserial", "ms_psn='" + sncode.Text + "'", "ms_psn='" + bsncode + "'");
+                                    dh.UpdateByCondition("makeserial", "ms_sncode='" + sncode.Text + "'", "ms_beforesn='" + bsncode + "'");
                                     OperateResult.AppendText(">>转换成功");
+                                    //查询ms_firstsn
+                                    string firstsn = dh.getFieldDataByCondition("makeserial", "ms_firstsn", "ms_sncode='" + sncode.Text + "'").ToString();
+                                    //记录本次修改,存入makesnrelation表中
+                                    dh.ExecuteSql("insert into  makesnrelation (BEFORESN,SN,FIRSTSN,MAKECODE,msr_indate, msr_inman)values('" + bsncode + "','" + sncode + "','" + firstsn + "','" + ma_code.Text + "', sysdate ,'" + User.UserCode + "')", "insert");
+                                    //写入日志
+                                    LogManager.DoLog("修改序列号:" + bsncode + "为" + sncode.Text + "成功!" + "操作人:" + User.UserCode);
+                                    OperateResult.AppendText(">>请输入转换前的序列号\n", Color.Green);
+                                    //置空
+                                    bsncode = "";
+                                    //更新数量
+                                    changenum.Text = int.Parse(changenum.Text) + 1 + "";
                                 }
                                 else
                                 {
                                     OperateResult.AppendText(">>该序列号已存在,请输入其他序列号\n", Color.Red);
                                 }
                             }
-                            //未勾选取消转换
+                            //未勾选修改转换结果
                             else
                             {
-                                if (!dh.CheckExist("makeserial", "ms_psn='" + sncode.Text + "'"))
+                                if (!dh.CheckExist("makeserial", "ms_sncode='" + sncode.Text + "'"))
                                 {
-                                    dh.UpdateByCondition("makeserial", "ms_psn='" + sncode.Text + "'", "ms_sncode='" + bsncode + "'");
+                                    dh.UpdateByCondition("makeserial", "ms_sncode='" + sncode.Text + "' and ms_beforesn='" + bsncode + "'", "ms_sncode='" + bsncode + "'");
                                     OperateResult.AppendText(">>转换成功", Color.Green);
+                                    //查询ms_firstsn
+                                    string firstsn = dh.getFieldDataByCondition("makeserial", "ms_firstsn", "ms_sncode='" + sncode.Text + "'").ToString();
+                                    //记录本次修改,存入makesnrelation表中
+                                    dh.ExecuteSql("insert into  makesnrelation (BEFORESN,SN,FIRSTSN,MAKECODE,msr_indate, msr_inman)values('" + bsncode + "','" + sncode + "','" + firstsn + "','" + ma_code.Text + "', sysdate ,'" + User.UserCode + "')", "insert");
+                                    //写入日志
+                                    LogManager.DoLog("修改序列号:" + bsncode + "为" + sncode.Text + "成功!" + "操作人:" + User.UserCode);
+                                    OperateResult.AppendText(">>请输入转换前的序列号\n", Color.Green);
+                                    //置空
+                                    bsncode = "";
+                                    //更新数量
+                                    changenum.Text = int.Parse(changenum.Text) + 1 + "";
                                 }
                                 else
                                 {
@@ -148,5 +223,153 @@ namespace UAS_MES.Make
             bsncode = "";
             OperateResult.AppendText(">>请输需要转换的序列号\n", Color.Green);
         }
+        /// <summary>
+        /// 工单号keydown
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void ms_makecode_KeyDown(object sender, KeyEventArgs e)
+        {
+            if (e.KeyCode == Keys.Enter)
+            {
+                //查询表工单序列号防呆规则表
+                dt = (DataTable)dh.ExecuteSql("select msr_type, msr_prefix ,msr_length from makesnrule where msr_makecode=" + ma_code.Text, "select");
+                if (dt.Rows.Count > 0)
+                {
+                    foreach (DataRow dr in dt.Rows)
+                    {
+                        //如果有值,则这个字段自动勾选,并且不可编辑
+                        if (dr["msr_type"].ToString().ToLower() == "before")
+                        {
+                            //msr_type=before 的值赋值到转换前
+
+                            //临时变量记录
+                            string length = dr["msr_length"].ToString();
+                            string prefix = dr["msr_prefix"].ToString();
+                            //不为空
+                            if (prefix != "" && prefix != null)
+                            {
+                                //则赋值
+                                beforeTransSNPre.Text = prefix;
+                                //设置不可编辑
+                                beforeTransSNPre.ReadOnly = true;
+                                //勾选
+                                beforeTransSNPre_checkBox.Checked = true;
+                            }
+                            if (length != "" && length != null)
+                            {
+                                //赋值
+                                beforeTransSNLength.Text = length;
+                                //设置不可编辑
+                                beforeTransSNLength.ReadOnly = true;
+                                //勾选
+                                beforeTransSNLength_checkBox.Checked = true;
+                            }
+                        }
+                        else if (dr["msr_type"].ToString().ToLower() == "after")
+                        {
+                            //msr_type=after 的值赋值到转换后
+
+                            //临时变量记录
+                            string length = dr["msr_length"].ToString();
+                            string prefix = dr["msr_prefix"].ToString();
+                            //不为空
+                            if (prefix != "" && prefix != null)
+                            {
+                                //则赋值
+                                afterTransSNPre.Text = prefix;
+                                //设置不可编辑
+                                afterTransSNPre.ReadOnly = true;
+                                //勾选
+                                afterTransSNPre_checkBox.Checked = true;
+                            }
+                            if (length != "" && length != null)
+                            {
+                                //赋值
+                                afterTransSNLength.Text = length;
+                                //设置不可编辑
+                                afterTransSNLength.ReadOnly = true;
+                                //勾选
+                                afterTransSNLength_checkBox.Checked = true;
+                            }
+                        }
+                    }
+                }
+                else
+                {
+                    /*	如果转换前没有值,则取 select productsnrule where psr_prodcode=? 产品编号,
+                     *	有值则赋值到 转换前,并且自动勾选不可编辑。*/
+                    dt = (DataTable)dh.ExecuteSql("select psr_prefix ,psr_length from productsnrule where psr_prodcode = " + ma_prodcode.Text, "select");
+                    if (dt.Rows.Count > 0)
+                    {
+                        //将产品序列号防呆规则查出的数据填充
+                        beforeTransSNPre.Text = dt.Rows[0]["psr_prefix"].ToString();
+                        beforeTransSNPre.ReadOnly = true;
+                        beforeTransSNPre_checkBox.Checked = true;
+                        beforeTransSNLength.Text = dt.Rows[0]["psr_length"].ToString();
+                        beforeTransSNLength.ReadOnly = true;
+                        beforeTransSNLength_checkBox.Checked = true;
+                    }
+                }
+            }
+        }
+        /// <summary>
+        /// 如果清空了工单号,或者更换了工单号则将 : 转换前序列号长度,转换前序列号前缀
+        ///转换后序列号长度,转换后序列号前缀 四个字段值清空。
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void ms_makecode_UserControlTextChanged(object sender, EventArgs e)
+        {
+            //清空
+            beforeTransSNPre.Text = "";
+            beforeTransSNLength.Text = "";
+            afterTransSNPre.Text = "";
+            afterTransSNLength.Text = "";
+
+            //取消勾选
+            beforeTransSNPre_checkBox.Checked = false;
+            beforeTransSNLength_checkBox.Checked = false;
+            afterTransSNPre_checkBox.Checked = false;
+            afterTransSNLength_checkBox.Checked = false;
+        }
+        /// <summary>
+        /// 检验长度或者前缀是否合法
+        /// </summary>
+        /// <param name="checkbox"></param>
+        /// <param name="c"></param>
+        /// <param name="info"></param>
+        private bool checkLengthOrPre(CheckBox checkbox, EnterTextBox textbox, string type)
+        {
+            if (checkbox.Checked == true)
+            {
+                if (type == "长度")
+                {
+                    //则判断输入转换前的序列号长度是否合法,不合法则提示
+                    if (sncode.Text.Trim().Length != int.Parse(textbox.Text))
+                    {
+                        //序列号校验错误,长度错误
+                        OperateResult.AppendText(">>序列号校验错误,长度错误", Color.Red);
+                        sncode.Text = "";
+                        OperateResult.AppendText("<<请重新输入序列号\n", Color.Green);
+                        return false;
+                    }
+                }
+                else if (type == "前缀")
+                {
+                    //则判断输入转换前的序列号前缀是否合法,不合法则提示
+                    if (!sncode.Text.StartsWith(textbox.Text.Trim()))
+                    {
+                        //序列号校验错误,前缀错误
+                        OperateResult.AppendText(">>序列号校验错误,前缀错误", Color.Red);
+                        sncode.Text = "";
+                        OperateResult.AppendText("<<请重新输入序列号\n", Color.Green);
+                        return false;
+                    }
+                }
+                return true;
+            }
+            return true;
+        }
     }
 }