浏览代码

序列号转换备注录入修改以及半成品上料采集校验修改

Hcsy 7 年之前
父节点
当前提交
e81999da2f

+ 4 - 3
UAS-MES/FunctionCode/Make/Make_ColorBoxLoadPrint.cs

@@ -137,7 +137,7 @@ namespace UAS_MES.Make
                                 code.Text = "";
                             }
                             sql.Clear();
-                            sql.Append("select max(sp_id)sp_id,max(sp_detno)sp_detno,min(sp_ifrepeat)sp_ifrepeat,max(sp_checkbarcode)sp_checkbarcode,sp_fsoncode,max(sp_barcoderule)");
+                            sql.Append("select max(sp_id)sp_id,max(sp_detno)sp_detno,min(sp_ifrepeat)sp_ifrepeat,max(sp_checkbarcode)sp_checkbarcode,min(sp_checksalecode)sp_checksalecode,sp_fsoncode,max(sp_barcoderule)");
                             sql.Append("sp_barcoderule,wm_concat(sp_soncode) sp_soncode,max(sp_ifuseregex)sp_ifuseregex,max(sp_ifforsn)");
                             sql.Append("sp_ifforsn,max(sp_length)sp_length,max(sp_type)sp_type,replace(wm_concat(sp_prefix),',','|')sp_prefix,max(sp_regex)");
                             sql.Append("sp_regex,max(pr_detail)pr_detail from stepproduct left join product on pr_code=sp_fsoncode where ");
@@ -212,11 +212,12 @@ namespace UAS_MES.Make
                         string sp_regex = ListA.Rows[RemainIndex]["sp_regex"].ToString();
                         string length = ListA.Rows[RemainIndex]["sp_length"].ToString();
                         string sp_id = ListA.Rows[RemainIndex]["sp_id"].ToString();
-                        string sp_ifrepeat = dt.Rows[RemainIndex]["sp_ifrepeat"].ToString();
+                        string sp_ifrepeat = ListA.Rows[RemainIndex]["sp_ifrepeat"].ToString();
                         string sp_ifforsn = ListA.Rows[RemainIndex]["sp_ifforsn"].ToString();
                         string sp_barcoderule = ListA.Rows[RemainIndex]["sp_barcoderule"].ToString();
                         string sp_checkbarcode = ListA.Rows[RemainIndex]["sp_checkbarcode"].ToString();
-                        if (LogicHandler.CheckSNBeforeLoad(ma_code.Text, code.Text, sp_fsoncode, sp_soncode, sp_barcoderule, sp_prefix, length, sp_ifrepeat, out ErrorMessage))
+                        string sp_checksalecode = ListA.Rows[RemainIndex]["sp_checksalecode"].ToString();
+                        if (LogicHandler.CheckSNBeforeLoad(ma_code.Text, code.Text, sp_fsoncode, sp_soncode, sp_barcoderule, sp_prefix, length, sp_ifrepeat, sp_checksalecode, out ErrorMessage))
                         {
                             //判断采集的条码和本次采集的也不能重复
                             if (CollectData.Contains(code.Text) && sp_ifrepeat != "-1")

+ 3 - 2
UAS-MES/FunctionCode/Make/Make_Decompose.cs

@@ -260,7 +260,7 @@ namespace UAS_MES.Make
                             dtbar = new DataTable();
                             sql.Clear();
                             sql.Append("select max(sp_id)sp_id,max(sp_detno)sp_detno,min(sp_ifrepeat)sp_ifrepeat,sp_fsoncode,max(sp_barcoderule)");
-                            sql.Append("sp_barcoderule,sp_tracekind,wm_concat(sp_soncode) sp_soncode,max(sp_ifuseregex)sp_ifuseregex,max(sp_ifforsn)");
+                            sql.Append("sp_barcoderule, min(sp_checksalecode)sp_checksalecode,sp_tracekind,wm_concat(sp_soncode) sp_soncode,max(sp_ifuseregex)sp_ifuseregex,max(sp_ifforsn)");
                             sql.Append("sp_ifforsn,max(sp_length)sp_length,max(sp_type)sp_type,replace(wm_concat(sp_prefix),',','|')sp_prefix,max(sp_regex)");
                             sql.Append("sp_regex,max(pr_detail)pr_detail from stepproduct left join product on pr_code=sp_fsoncode where ");
                             sql.Append("sp_bomversion='" + ma_bomversion + "' and  sp_craftcode='" + LabelDataGridView.Rows[i].Cells["cm_craftcode"].Value + "'and sp_mothercode ='" + LabelDataGridView.Rows[i].Cells["cm_maprodcode"].Value + "'");
@@ -278,10 +278,11 @@ namespace UAS_MES.Make
                                 string length = dtbar.Rows[0]["sp_length"].ToString();
                                 string sp_ifrepeat = dtbar.Rows[0]["sp_ifrepeat"].ToString();
                                 string sp_barcoderule = dtbar.Rows[0]["sp_barcoderule"].ToString();
+                                string sp_checksalecode = dtbar.Rows[0]["sp_checksalecode"].ToString();
                                 if (sp_tracekind == "1")
                                 {
                                     //上料校验规则判断
-                                    if (!LogicHandler.CheckSNBeforeLoad(LabelDataGridView.Rows[i].Cells["cm_makecode"].Value.ToString(), LabelDataGridView.Rows[i].Cells["New_BarCode"].Value.ToString(), sp_fsoncode, sp_soncode, sp_barcoderule, sp_prefix, length, sp_ifrepeat, out ErrorMessage))
+                                    if (!LogicHandler.CheckSNBeforeLoad(LabelDataGridView.Rows[i].Cells["cm_makecode"].Value.ToString(), LabelDataGridView.Rows[i].Cells["New_BarCode"].Value.ToString(), sp_fsoncode, sp_soncode, sp_barcoderule, sp_prefix, length, sp_ifrepeat, sp_checksalecode,out ErrorMessage))
                                     {
                                         OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red);
                                         LoadData(sncode_1, sender, new KeyEventArgs(Keys.Enter));

+ 3 - 2
UAS-MES/FunctionCode/Make/Make_FeedingCollection.cs

@@ -150,7 +150,8 @@ namespace UAS_MES.Make
                             string sp_ifforsn = dt1.Rows[RemainIndex]["sp_ifforsn"].ToString();
                             string sp_barcoderule = dt1.Rows[RemainIndex]["sp_barcoderule"].ToString();
                             string sp_checkbarcode = dt1.Rows[RemainIndex]["sp_checkbarcode"].ToString();
-                            if (LogicHandler.CheckSNBeforeLoad(ma_code.Text, code.Text, sp_fsoncode, sp_soncode, sp_barcoderule, sp_prefix, length, sp_ifrepeat, out ErrorMessage))
+                            string sp_checksalecode = dt1.Rows[RemainIndex]["sp_checksalecode"].ToString();
+                            if (LogicHandler.CheckSNBeforeLoad(ma_code.Text, code.Text, sp_fsoncode, sp_soncode, sp_barcoderule, sp_prefix, length, sp_ifrepeat, sp_checksalecode, out ErrorMessage))
                             {
                                 //判断采集的条码和本次采集的也不能重复
                                 if (CollectData.Contains(code.Text) && sp_ifrepeat != "-1")
@@ -357,7 +358,7 @@ namespace UAS_MES.Make
             //单独用一个DataTable存储一个
             dt1 = new DataTable();
             sql.Clear();
-            sql.Append("select max(sp_id)sp_id,max(sp_detno)sp_detno,min(sp_ifrepeat)sp_ifrepeat,max(sp_checkbarcode)sp_checkbarcode,");
+            sql.Append("select max(sp_id)sp_id,max(sp_detno)sp_detno,min(sp_ifrepeat)sp_ifrepeat,max(sp_checkbarcode)sp_checkbarcode,min(sp_checksalecode)sp_checksalecode,");
             sql.Append("sp_fsoncode,max(sp_barcoderule)sp_barcoderule,wm_concat(sp_soncode) sp_soncode,max(sp_ifuseregex)sp_ifuseregex,max(sp_ifforsn)");
             sql.Append("sp_ifforsn,max(sp_length)sp_length,max(sp_type)sp_type,replace(wm_concat(sp_prefix),',','|')sp_prefix,max(sp_regex)");
             sql.Append("sp_regex,max(pr_detail)pr_detail from stepproduct left join product on pr_code=sp_fsoncode where ");

+ 176 - 103
UAS-MES/FunctionCode/Make/Make_SeqProgramTransform.Designer.cs

@@ -46,6 +46,11 @@
             this.sn_code_label = new System.Windows.Forms.Label();
             this.ma_softversion = new System.Windows.Forms.Label();
             this.label2 = new System.Windows.Forms.Label();
+            this.CollectRemark = new System.Windows.Forms.CheckBox();
+            this.label1 = new System.Windows.Forms.Label();
+            this.IFONLY = new System.Windows.Forms.CheckBox();
+            this.SameReamrk = new System.Windows.Forms.CheckBox();
+            this.Seq_Remark_PreFix = new UAS_MES.CustomControl.TextBoxWithIcon.SnCollectionBox();
             this.StepCount = new UAS_MES.CustomControl.TextBoxWithIcon.SourceStepCount();
             this.ChangeResult = new UAS_MES.CustomControl.CustomCheckBox.CustomCheckBox();
             this.show_sncode = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
@@ -57,8 +62,7 @@
             this.TSNPre = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.SNLength = new UAS_MES.CustomControl.TextBoxWithIcon.NumOnlyTextBox();
             this.TSNLength = new UAS_MES.CustomControl.TextBoxWithIcon.NumOnlyTextBox();
-            this.CollectRemark = new System.Windows.Forms.CheckBox();
-            this.Remark = new UAS_MES.CustomControl.RichText.RichTextAutoBottom();
+            this.Remark = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
             ((System.ComponentModel.ISupportInitialize)(this.ClearSn_code)).BeginInit();
             this.SuspendLayout();
             // 
@@ -66,9 +70,10 @@
             // 
             this.ms_macode_label.AutoSize = true;
             this.ms_macode_label.Font = new System.Drawing.Font("微软雅黑", 12F);
-            this.ms_macode_label.Location = new System.Drawing.Point(25, 21);
+            this.ms_macode_label.Location = new System.Drawing.Point(19, 17);
+            this.ms_macode_label.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
             this.ms_macode_label.Name = "ms_macode_label";
-            this.ms_macode_label.Size = new System.Drawing.Size(92, 27);
+            this.ms_macode_label.Size = new System.Drawing.Size(74, 21);
             this.ms_macode_label.TabIndex = 0;
             this.ms_macode_label.Text = "工单编号";
             // 
@@ -76,9 +81,10 @@
             // 
             this.ma_prodcode_label.AutoSize = true;
             this.ma_prodcode_label.Font = new System.Drawing.Font("微软雅黑", 12F);
-            this.ma_prodcode_label.Location = new System.Drawing.Point(385, 21);
+            this.ma_prodcode_label.Location = new System.Drawing.Point(289, 17);
+            this.ma_prodcode_label.Margin = new System.Windows.Forms.Padding(2, 0, 2, 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(74, 21);
             this.ma_prodcode_label.TabIndex = 1;
             this.ma_prodcode_label.Text = "产品编号";
             // 
@@ -86,9 +92,10 @@
             // 
             this.pr_detail_label.AutoSize = true;
             this.pr_detail_label.Font = new System.Drawing.Font("微软雅黑", 12F);
-            this.pr_detail_label.Location = new System.Drawing.Point(703, 21);
+            this.pr_detail_label.Location = new System.Drawing.Point(527, 17);
+            this.pr_detail_label.Margin = new System.Windows.Forms.Padding(2, 0, 2, 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(74, 21);
             this.pr_detail_label.TabIndex = 2;
             this.pr_detail_label.Text = "产品名称";
             // 
@@ -96,9 +103,10 @@
             // 
             this.remain_qty_label.AutoSize = true;
             this.remain_qty_label.Font = new System.Drawing.Font("微软雅黑", 12F);
-            this.remain_qty_label.Location = new System.Drawing.Point(25, 56);
+            this.remain_qty_label.Location = new System.Drawing.Point(19, 45);
+            this.remain_qty_label.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
             this.remain_qty_label.Name = "remain_qty_label";
-            this.remain_qty_label.Size = new System.Drawing.Size(72, 27);
+            this.remain_qty_label.Size = new System.Drawing.Size(58, 21);
             this.remain_qty_label.TabIndex = 3;
             this.remain_qty_label.Text = "剩余数";
             // 
@@ -106,9 +114,10 @@
             // 
             this.PrintNum_label.AutoSize = true;
             this.PrintNum_label.Font = new System.Drawing.Font("微软雅黑", 12F);
-            this.PrintNum_label.Location = new System.Drawing.Point(879, 520);
+            this.PrintNum_label.Location = new System.Drawing.Point(655, 398);
+            this.PrintNum_label.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
             this.PrintNum_label.Name = "PrintNum_label";
-            this.PrintNum_label.Size = new System.Drawing.Size(52, 27);
+            this.PrintNum_label.Size = new System.Drawing.Size(42, 21);
             this.PrintNum_label.TabIndex = 4;
             this.PrintNum_label.Text = "计数";
             this.PrintNum_label.Visible = false;
@@ -117,9 +126,10 @@
             // 
             this.ms_macode.AutoSize = true;
             this.ms_macode.Font = new System.Drawing.Font("微软雅黑", 12F);
-            this.ms_macode.Location = new System.Drawing.Point(125, 21);
+            this.ms_macode.Location = new System.Drawing.Point(94, 17);
+            this.ms_macode.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
             this.ms_macode.Name = "ms_macode";
-            this.ms_macode.Size = new System.Drawing.Size(0, 27);
+            this.ms_macode.Size = new System.Drawing.Size(0, 21);
             this.ms_macode.TabIndex = 5;
             this.ms_macode.TextChanged += new System.EventHandler(this.ms_macode_TextChanged);
             // 
@@ -127,18 +137,20 @@
             // 
             this.remain_qty.AutoSize = true;
             this.remain_qty.Font = new System.Drawing.Font("微软雅黑", 12F);
-            this.remain_qty.Location = new System.Drawing.Point(125, 56);
+            this.remain_qty.Location = new System.Drawing.Point(94, 45);
+            this.remain_qty.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
             this.remain_qty.Name = "remain_qty";
-            this.remain_qty.Size = new System.Drawing.Size(0, 27);
+            this.remain_qty.Size = new System.Drawing.Size(0, 21);
             this.remain_qty.TabIndex = 6;
             // 
             // count
             // 
             this.count.AutoSize = true;
             this.count.Font = new System.Drawing.Font("微软雅黑", 12F);
-            this.count.Location = new System.Drawing.Point(949, 518);
+            this.count.Location = new System.Drawing.Point(712, 398);
+            this.count.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
             this.count.Name = "count";
-            this.count.Size = new System.Drawing.Size(24, 27);
+            this.count.Size = new System.Drawing.Size(19, 21);
             this.count.TabIndex = 8;
             this.count.Text = "0";
             this.count.Visible = false;
@@ -147,10 +159,10 @@
             // 
             this.TSNLength_checkBox.AutoSize = true;
             this.TSNLength_checkBox.Font = new System.Drawing.Font("微软雅黑", 10F);
-            this.TSNLength_checkBox.Location = new System.Drawing.Point(33, 101);
-            this.TSNLength_checkBox.Margin = new System.Windows.Forms.Padding(3, 1, 3, 1);
+            this.TSNLength_checkBox.Location = new System.Drawing.Point(25, 81);
+            this.TSNLength_checkBox.Margin = new System.Windows.Forms.Padding(2, 1, 2, 1);
             this.TSNLength_checkBox.Name = "TSNLength_checkBox";
-            this.TSNLength_checkBox.Size = new System.Drawing.Size(100, 27);
+            this.TSNLength_checkBox.Size = new System.Drawing.Size(83, 24);
             this.TSNLength_checkBox.TabIndex = 10;
             this.TSNLength_checkBox.Text = "TSN长度";
             this.TSNLength_checkBox.UseVisualStyleBackColor = true;
@@ -159,10 +171,10 @@
             // 
             this.SNLength_checkBox.AutoSize = true;
             this.SNLength_checkBox.Font = new System.Drawing.Font("微软雅黑", 10F);
-            this.SNLength_checkBox.Location = new System.Drawing.Point(33, 139);
-            this.SNLength_checkBox.Margin = new System.Windows.Forms.Padding(3, 1, 3, 1);
+            this.SNLength_checkBox.Location = new System.Drawing.Point(25, 111);
+            this.SNLength_checkBox.Margin = new System.Windows.Forms.Padding(2, 1, 2, 1);
             this.SNLength_checkBox.Name = "SNLength_checkBox";
-            this.SNLength_checkBox.Size = new System.Drawing.Size(90, 27);
+            this.SNLength_checkBox.Size = new System.Drawing.Size(75, 24);
             this.SNLength_checkBox.TabIndex = 11;
             this.SNLength_checkBox.Text = "SN长度";
             this.SNLength_checkBox.UseVisualStyleBackColor = true;
@@ -171,10 +183,10 @@
             // 
             this.TSNPre_checkBox.AutoSize = true;
             this.TSNPre_checkBox.Font = new System.Drawing.Font("微软雅黑", 10F);
-            this.TSNPre_checkBox.Location = new System.Drawing.Point(571, 100);
-            this.TSNPre_checkBox.Margin = new System.Windows.Forms.Padding(3, 1, 3, 1);
+            this.TSNPre_checkBox.Location = new System.Drawing.Point(428, 80);
+            this.TSNPre_checkBox.Margin = new System.Windows.Forms.Padding(2, 1, 2, 1);
             this.TSNPre_checkBox.Name = "TSNPre_checkBox";
-            this.TSNPre_checkBox.Size = new System.Drawing.Size(100, 27);
+            this.TSNPre_checkBox.Size = new System.Drawing.Size(83, 24);
             this.TSNPre_checkBox.TabIndex = 12;
             this.TSNPre_checkBox.Text = "TSN前缀";
             this.TSNPre_checkBox.UseVisualStyleBackColor = true;
@@ -183,10 +195,10 @@
             // 
             this.SNPre_checkBox.AutoSize = true;
             this.SNPre_checkBox.Font = new System.Drawing.Font("微软雅黑", 10F);
-            this.SNPre_checkBox.Location = new System.Drawing.Point(571, 140);
-            this.SNPre_checkBox.Margin = new System.Windows.Forms.Padding(3, 1, 3, 1);
+            this.SNPre_checkBox.Location = new System.Drawing.Point(428, 112);
+            this.SNPre_checkBox.Margin = new System.Windows.Forms.Padding(2, 1, 2, 1);
             this.SNPre_checkBox.Name = "SNPre_checkBox";
-            this.SNPre_checkBox.Size = new System.Drawing.Size(90, 27);
+            this.SNPre_checkBox.Size = new System.Drawing.Size(75, 24);
             this.SNPre_checkBox.TabIndex = 13;
             this.SNPre_checkBox.Text = "SN前缀";
             this.SNPre_checkBox.UseVisualStyleBackColor = true;
@@ -195,9 +207,10 @@
             // 
             this.tip.AutoSize = true;
             this.tip.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold);
-            this.tip.Location = new System.Drawing.Point(25, 172);
+            this.tip.Location = new System.Drawing.Point(19, 138);
+            this.tip.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
             this.tip.Name = "tip";
-            this.tip.Size = new System.Drawing.Size(132, 27);
+            this.tip.Size = new System.Drawing.Size(106, 22);
             this.tip.TabIndex = 18;
             this.tip.Text = "采集提示信息";
             // 
@@ -205,9 +218,10 @@
             // 
             this.in_label.AutoSize = true;
             this.in_label.Font = new System.Drawing.Font("微软雅黑", 12F);
-            this.in_label.Location = new System.Drawing.Point(25, 521);
+            this.in_label.Location = new System.Drawing.Point(19, 417);
+            this.in_label.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
             this.in_label.Name = "in_label";
-            this.in_label.Size = new System.Drawing.Size(72, 27);
+            this.in_label.Size = new System.Drawing.Size(58, 21);
             this.in_label.TabIndex = 21;
             this.in_label.Text = "录入框";
             // 
@@ -215,10 +229,9 @@
             // 
             this.ClearSn_code.Cursor = System.Windows.Forms.Cursors.Hand;
             this.ClearSn_code.Image = global::UAS_MES.Properties.Resources.bindingNavigatorDeleteItem_Image;
-            this.ClearSn_code.Location = new System.Drawing.Point(356, 476);
-            this.ClearSn_code.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.ClearSn_code.Location = new System.Drawing.Point(267, 381);
             this.ClearSn_code.Name = "ClearSn_code";
-            this.ClearSn_code.Size = new System.Drawing.Size(21, 20);
+            this.ClearSn_code.Size = new System.Drawing.Size(16, 16);
             this.ClearSn_code.TabIndex = 144;
             this.ClearSn_code.TabStop = false;
             this.ClearSn_code.Click += new System.EventHandler(this.cancel_Click);
@@ -227,10 +240,9 @@
             // 
             this.sn_code_label.AutoSize = true;
             this.sn_code_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.sn_code_label.Location = new System.Drawing.Point(25, 476);
-            this.sn_code_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.sn_code_label.Location = new System.Drawing.Point(19, 381);
             this.sn_code_label.Name = "sn_code_label";
-            this.sn_code_label.Size = new System.Drawing.Size(72, 27);
+            this.sn_code_label.Size = new System.Drawing.Size(58, 21);
             this.sn_code_label.TabIndex = 142;
             this.sn_code_label.Text = "序列号";
             // 
@@ -238,29 +250,90 @@
             // 
             this.ma_softversion.AutoSize = true;
             this.ma_softversion.Font = new System.Drawing.Font("微软雅黑", 12F);
-            this.ma_softversion.Location = new System.Drawing.Point(807, 56);
+            this.ma_softversion.Location = new System.Drawing.Point(605, 45);
+            this.ma_softversion.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
             this.ma_softversion.Name = "ma_softversion";
-            this.ma_softversion.Size = new System.Drawing.Size(0, 27);
+            this.ma_softversion.Size = new System.Drawing.Size(0, 21);
             this.ma_softversion.TabIndex = 150;
             // 
             // 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(703, 56);
-            this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label2.Location = new System.Drawing.Point(527, 45);
             this.label2.Name = "label2";
-            this.label2.Size = new System.Drawing.Size(92, 27);
+            this.label2.Size = new System.Drawing.Size(74, 21);
             this.label2.TabIndex = 149;
             this.label2.Text = "软件版本";
             // 
+            // CollectRemark
+            // 
+            this.CollectRemark.AutoSize = true;
+            this.CollectRemark.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.CollectRemark.Location = new System.Drawing.Point(551, 429);
+            this.CollectRemark.Name = "CollectRemark";
+            this.CollectRemark.Size = new System.Drawing.Size(72, 16);
+            this.CollectRemark.TabIndex = 199;
+            this.CollectRemark.Text = "采集备注";
+            this.CollectRemark.UseVisualStyleBackColor = true;
+            this.CollectRemark.CheckedChanged += new System.EventHandler(this.CollectRemark_CheckedChanged);
+            // 
+            // label1
+            // 
+            this.label1.AutoSize = true;
+            this.label1.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label1.Location = new System.Drawing.Point(356, 399);
+            this.label1.Name = "label1";
+            this.label1.Size = new System.Drawing.Size(37, 20);
+            this.label1.TabIndex = 213;
+            this.label1.Text = "前缀";
+            // 
+            // IFONLY
+            // 
+            this.IFONLY.AutoSize = true;
+            this.IFONLY.Location = new System.Drawing.Point(360, 429);
+            this.IFONLY.Name = "IFONLY";
+            this.IFONLY.Size = new System.Drawing.Size(84, 16);
+            this.IFONLY.TabIndex = 211;
+            this.IFONLY.Text = "不允许重复";
+            this.IFONLY.UseVisualStyleBackColor = true;
+            this.IFONLY.CheckedChanged += new System.EventHandler(this.IFONLY_CheckedChanged);
+            // 
+            // SameReamrk
+            // 
+            this.SameReamrk.AutoSize = true;
+            this.SameReamrk.Location = new System.Drawing.Point(449, 429);
+            this.SameReamrk.Name = "SameReamrk";
+            this.SameReamrk.Size = new System.Drawing.Size(96, 16);
+            this.SameReamrk.TabIndex = 214;
+            this.SameReamrk.Text = "固定录入备注";
+            this.SameReamrk.UseVisualStyleBackColor = true;
+            this.SameReamrk.CheckedChanged += new System.EventHandler(this.SameReamrk_CheckedChanged);
+            // 
+            // Seq_Remark_PreFix
+            // 
+            this.Seq_Remark_PreFix.AllPower = null;
+            this.Seq_Remark_PreFix.BackColor = System.Drawing.Color.White;
+            this.Seq_Remark_PreFix.Font = new System.Drawing.Font("微软雅黑", 9F);
+            this.Seq_Remark_PreFix.ID = null;
+            this.Seq_Remark_PreFix.Location = new System.Drawing.Point(402, 396);
+            this.Seq_Remark_PreFix.Margin = new System.Windows.Forms.Padding(6, 7, 6, 7);
+            this.Seq_Remark_PreFix.Name = "Seq_Remark_PreFix";
+            this.Seq_Remark_PreFix.Power = null;
+            this.Seq_Remark_PreFix.Size = new System.Drawing.Size(38, 23);
+            this.Seq_Remark_PreFix.Str = null;
+            this.Seq_Remark_PreFix.Str1 = null;
+            this.Seq_Remark_PreFix.Str2 = null;
+            this.Seq_Remark_PreFix.TabIndex = 212;
+            this.Seq_Remark_PreFix.KeyDown += new System.Windows.Forms.KeyEventHandler(this.Seq_Remark_PreFix_KeyDown);
+            // 
             // StepCount
             // 
             this.StepCount.LineCode = null;
-            this.StepCount.Location = new System.Drawing.Point(387, 56);
-            this.StepCount.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.StepCount.Location = new System.Drawing.Point(290, 45);
+            this.StepCount.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
             this.StepCount.Name = "StepCount";
-            this.StepCount.Size = new System.Drawing.Size(117, 28);
+            this.StepCount.Size = new System.Drawing.Size(88, 22);
             this.StepCount.Source = null;
             this.StepCount.StepCode = null;
             this.StepCount.TabIndex = 195;
@@ -269,11 +342,11 @@
             // 
             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(356, 516);
-            this.ChangeResult.Margin = new System.Windows.Forms.Padding(3, 1, 3, 1);
+            this.ChangeResult.Location = new System.Drawing.Point(267, 413);
+            this.ChangeResult.Margin = new System.Windows.Forms.Padding(2, 1, 2, 1);
             this.ChangeResult.Name = "ChangeResult";
             this.ChangeResult.Power = "ifspecial";
-            this.ChangeResult.Size = new System.Drawing.Size(114, 31);
+            this.ChangeResult.Size = new System.Drawing.Size(93, 25);
             this.ChangeResult.TabIndex = 145;
             this.ChangeResult.Text = "重新转换";
             this.ChangeResult.UseVisualStyleBackColor = true;
@@ -286,11 +359,10 @@
             this.show_sncode.Enabled = false;
             this.show_sncode.Font = new System.Drawing.Font("微软雅黑", 10F);
             this.show_sncode.ID = null;
-            this.show_sncode.Location = new System.Drawing.Point(111, 476);
-            this.show_sncode.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.show_sncode.Location = new System.Drawing.Point(83, 381);
             this.show_sncode.Name = "show_sncode";
             this.show_sncode.Power = null;
-            this.show_sncode.Size = new System.Drawing.Size(212, 29);
+            this.show_sncode.Size = new System.Drawing.Size(160, 25);
             this.show_sncode.Str = null;
             this.show_sncode.Str1 = null;
             this.show_sncode.Str2 = null;
@@ -301,11 +373,11 @@
             this.ma_prodcode.AutoSize = true;
             this.ma_prodcode.CutLength = null;
             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(489, 21);
+            this.ma_prodcode.Location = new System.Drawing.Point(367, 17);
             this.ma_prodcode.Margin = new System.Windows.Forms.Padding(1, 0, 1, 0);
-            this.ma_prodcode.MaximumSize = new System.Drawing.Size(177, 0);
+            this.ma_prodcode.MaximumSize = new System.Drawing.Size(133, 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, 21);
             this.ma_prodcode.TabIndex = 24;
             // 
             // pr_detail
@@ -313,11 +385,11 @@
             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(805, 21);
+            this.pr_detail.Location = new System.Drawing.Point(604, 17);
             this.pr_detail.Margin = new System.Windows.Forms.Padding(1, 0, 1, 0);
-            this.pr_detail.MaximumSize = new System.Drawing.Size(145, 0);
+            this.pr_detail.MaximumSize = new System.Drawing.Size(109, 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, 21);
             this.pr_detail.TabIndex = 23;
             // 
             // code
@@ -326,11 +398,11 @@
             this.code.BackColor = System.Drawing.Color.White;
             this.code.Font = new System.Drawing.Font("微软雅黑", 10F);
             this.code.ID = null;
-            this.code.Location = new System.Drawing.Point(111, 519);
-            this.code.Margin = new System.Windows.Forms.Padding(3, 1, 3, 1);
+            this.code.Location = new System.Drawing.Point(83, 415);
+            this.code.Margin = new System.Windows.Forms.Padding(2, 1, 2, 1);
             this.code.Name = "code";
             this.code.Power = null;
-            this.code.Size = new System.Drawing.Size(212, 29);
+            this.code.Size = new System.Drawing.Size(160, 25);
             this.code.Str = null;
             this.code.Str1 = null;
             this.code.Str2 = null;
@@ -340,10 +412,10 @@
             // OperateResult
             // 
             this.OperateResult.Font = new System.Drawing.Font("微软雅黑", 15F);
-            this.OperateResult.Location = new System.Drawing.Point(31, 208);
-            this.OperateResult.Margin = new System.Windows.Forms.Padding(3, 1, 3, 1);
+            this.OperateResult.Location = new System.Drawing.Point(23, 166);
+            this.OperateResult.Margin = new System.Windows.Forms.Padding(2, 1, 2, 1);
             this.OperateResult.Name = "OperateResult";
-            this.OperateResult.Size = new System.Drawing.Size(1025, 248);
+            this.OperateResult.Size = new System.Drawing.Size(770, 199);
             this.OperateResult.TabIndex = 19;
             this.OperateResult.Text = "";
             // 
@@ -353,11 +425,11 @@
             this.SNPre.BackColor = System.Drawing.Color.White;
             this.SNPre.Font = new System.Drawing.Font("微软雅黑", 10F);
             this.SNPre.ID = null;
-            this.SNPre.Location = new System.Drawing.Point(689, 139);
-            this.SNPre.Margin = new System.Windows.Forms.Padding(3, 1, 3, 1);
+            this.SNPre.Location = new System.Drawing.Point(517, 111);
+            this.SNPre.Margin = new System.Windows.Forms.Padding(2, 1, 2, 1);
             this.SNPre.Name = "SNPre";
             this.SNPre.Power = null;
-            this.SNPre.Size = new System.Drawing.Size(189, 29);
+            this.SNPre.Size = new System.Drawing.Size(143, 25);
             this.SNPre.Str = null;
             this.SNPre.Str1 = null;
             this.SNPre.Str2 = null;
@@ -369,11 +441,11 @@
             this.TSNPre.BackColor = System.Drawing.Color.White;
             this.TSNPre.Font = new System.Drawing.Font("微软雅黑", 10F);
             this.TSNPre.ID = null;
-            this.TSNPre.Location = new System.Drawing.Point(689, 99);
-            this.TSNPre.Margin = new System.Windows.Forms.Padding(3, 1, 3, 1);
+            this.TSNPre.Location = new System.Drawing.Point(517, 79);
+            this.TSNPre.Margin = new System.Windows.Forms.Padding(2, 1, 2, 1);
             this.TSNPre.Name = "TSNPre";
             this.TSNPre.Power = null;
-            this.TSNPre.Size = new System.Drawing.Size(189, 29);
+            this.TSNPre.Size = new System.Drawing.Size(143, 25);
             this.TSNPre.Str = null;
             this.TSNPre.Str1 = null;
             this.TSNPre.Str2 = null;
@@ -385,12 +457,12 @@
             this.SNLength.BackColor = System.Drawing.Color.White;
             this.SNLength.Font = new System.Drawing.Font("微软雅黑", 10F);
             this.SNLength.ID = null;
-            this.SNLength.Location = new System.Drawing.Point(164, 138);
-            this.SNLength.Margin = new System.Windows.Forms.Padding(3, 1, 3, 1);
+            this.SNLength.Location = new System.Drawing.Point(123, 110);
+            this.SNLength.Margin = new System.Windows.Forms.Padding(2, 1, 2, 1);
             this.SNLength.Name = "SNLength";
             this.SNLength.Negative = false;
             this.SNLength.Power = null;
-            this.SNLength.Size = new System.Drawing.Size(189, 29);
+            this.SNLength.Size = new System.Drawing.Size(143, 25);
             this.SNLength.Str = null;
             this.SNLength.Str1 = null;
             this.SNLength.Str2 = null;
@@ -402,48 +474,45 @@
             this.TSNLength.BackColor = System.Drawing.Color.White;
             this.TSNLength.Font = new System.Drawing.Font("微软雅黑", 10F);
             this.TSNLength.ID = null;
-            this.TSNLength.Location = new System.Drawing.Point(164, 99);
-            this.TSNLength.Margin = new System.Windows.Forms.Padding(3, 1, 3, 1);
+            this.TSNLength.Location = new System.Drawing.Point(123, 79);
+            this.TSNLength.Margin = new System.Windows.Forms.Padding(2, 1, 2, 1);
             this.TSNLength.Name = "TSNLength";
             this.TSNLength.Negative = false;
             this.TSNLength.Power = null;
-            this.TSNLength.Size = new System.Drawing.Size(189, 29);
+            this.TSNLength.Size = new System.Drawing.Size(143, 25);
             this.TSNLength.Str = null;
             this.TSNLength.Str1 = null;
             this.TSNLength.Str2 = null;
             this.TSNLength.TabIndex = 14;
             // 
-            // CollectRemark
-            // 
-            this.CollectRemark.AutoSize = true;
-            this.CollectRemark.Checked = true;
-            this.CollectRemark.CheckState = System.Windows.Forms.CheckState.Checked;
-            this.CollectRemark.Font = new System.Drawing.Font("微软雅黑", 10F);
-            this.CollectRemark.Location = new System.Drawing.Point(483, 471);
-            this.CollectRemark.Margin = new System.Windows.Forms.Padding(4);
-            this.CollectRemark.Name = "CollectRemark";
-            this.CollectRemark.Size = new System.Drawing.Size(100, 27);
-            this.CollectRemark.TabIndex = 199;
-            this.CollectRemark.Text = "采集备注";
-            this.CollectRemark.UseVisualStyleBackColor = true;
-            // 
             // Remark
             // 
-            this.Remark.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.Remark.Location = new System.Drawing.Point(594, 469);
-            this.Remark.Margin = new System.Windows.Forms.Padding(4, 2, 4, 2);
+            this.Remark.AllPower = null;
+            this.Remark.BackColor = System.Drawing.Color.White;
+            this.Remark.ID = null;
+            this.Remark.Location = new System.Drawing.Point(453, 373);
+            this.Remark.Margin = new System.Windows.Forms.Padding(2);
+            this.Remark.Multiline = true;
             this.Remark.Name = "Remark";
-            this.Remark.Size = new System.Drawing.Size(253, 89);
-            this.Remark.TabIndex = 198;
-            this.Remark.Text = "";
+            this.Remark.Power = null;
+            this.Remark.Size = new System.Drawing.Size(148, 46);
+            this.Remark.Str = null;
+            this.Remark.Str1 = null;
+            this.Remark.Str2 = null;
+            this.Remark.TabIndex = 215;
+            this.Remark.KeyDown += new System.Windows.Forms.KeyEventHandler(this.Remark_KeyDown);
             // 
             // Make_SeqProgramTransform
             // 
-            this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
+            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(1084, 568);
-            this.Controls.Add(this.CollectRemark);
+            this.ClientSize = new System.Drawing.Size(813, 454);
             this.Controls.Add(this.Remark);
+            this.Controls.Add(this.SameReamrk);
+            this.Controls.Add(this.label1);
+            this.Controls.Add(this.Seq_Remark_PreFix);
+            this.Controls.Add(this.IFONLY);
+            this.Controls.Add(this.CollectRemark);
             this.Controls.Add(this.StepCount);
             this.Controls.Add(this.ma_softversion);
             this.Controls.Add(this.label2);
@@ -474,7 +543,7 @@
             this.Controls.Add(this.ma_prodcode_label);
             this.Controls.Add(this.ms_macode_label);
             this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
-            this.Margin = new System.Windows.Forms.Padding(3, 1, 3, 1);
+            this.Margin = new System.Windows.Forms.Padding(2, 1, 2, 1);
             this.Name = "Make_SeqProgramTransform";
             this.Tag = "Make!SeqProgramTransform";
             this.Load += new System.EventHandler(this.Make_SeqProgramTransform_Load);
@@ -517,6 +586,10 @@
         private System.Windows.Forms.Label label2;
         private CustomControl.TextBoxWithIcon.SourceStepCount StepCount;
         private System.Windows.Forms.CheckBox CollectRemark;
-        private CustomControl.RichText.RichTextAutoBottom Remark;
+        private System.Windows.Forms.Label label1;
+        private CustomControl.TextBoxWithIcon.SnCollectionBox Seq_Remark_PreFix;
+        private System.Windows.Forms.CheckBox IFONLY;
+        private System.Windows.Forms.CheckBox SameReamrk;
+        private CustomControl.TextBoxWithIcon.EnterTextBox Remark;
     }
 }

+ 185 - 32
UAS-MES/FunctionCode/Make/Make_SeqProgramTransform.cs

@@ -78,6 +78,7 @@ namespace UAS_MES.Make
             StepCount.LineCode = User.UserLineCode;
             StepCount.Dh = dh;
             StepCount.Start();
+            Seq_Remark_PreFix.Text = BaseUtil.GetCacheData("Seq_Remark_PreFix").ToString();
         }
 
         private void code_KeyDown(object sender, KeyEventArgs e)
@@ -371,6 +372,46 @@ namespace UAS_MES.Make
         /// <param name="step"></param>
         private bool checkRules(int step)
         {
+            //说明已经是最后一个校验规则
+            if (step == ListA.Rows.Count + 1)
+            {
+                if (CollectRemark.Checked || SameReamrk.Checked)
+                {
+                    if (Remark.Text == "")
+                    {
+                        OperateResult.AppendText(">>备注栏信息为空,录入备注信息\n", Color.Black);
+                        Remark.SelectAll();
+                        Remark.Focus();
+                        return false;
+                    }
+                    if (IFONLY.Checked)
+                    {
+                        if (!CheckPre())
+                        {
+                            return false;
+                        }
+                        string UsedSncode = dh.getFieldDataByCondition("SNRELATIONINFORECORD", "SIR_SNCODE", "sir_remark = '" + Remark.Text + "'").ToString();
+                        if (UsedSncode != "")
+                        {
+                            OperateResult.AppendText(">>备注信息" + Remark.Text + "已被" + UsedSncode + "采集,不可重复采集\n", Color.Red);
+                            Remark.SelectAll();
+                            Remark.Focus();
+                            return false;
+                        }
+                        LogicHandler.CollectRemarkInf(show_sncode.Text, "", "", ms_macode.Text, ma_prodcode.Text, Remark.Text);
+                    }
+                    else if (SameReamrk.Checked)
+                    {
+                        if (!CheckPre())
+                        {
+                            return false;
+                        }
+                        LogicHandler.CollectRemarkInf(show_sncode.Text, "", "", ms_macode.Text, ma_prodcode.Text, Remark.Text);
+                    }
+                }
+                return SetStepResult();
+            }
+
             type = ListA.Rows[step - 2]["psr_type"].ToString();
             //将type中的mac和bt中的"-"和":"号去掉
             if (type == "MAC" || type == "BT")
@@ -481,16 +522,16 @@ namespace UAS_MES.Make
                         foreach (DictionaryEntry de in hs)
                         {
                             //拿到重复的项
-                            if (de.Value.ToString()==macOrBt)
+                            if (de.Value.ToString() == macOrBt)
                             {
-                                OperateResult.AppendText("<<" + ListA.Rows[step - 2]["psr_type"].ToString() + ":" + code.Text + "错误," + de.Key+ "已录\n", Color.Red);
+                                OperateResult.AppendText("<<" + ListA.Rows[step - 2]["psr_type"].ToString() + ":" + code.Text + "错误," + de.Key + "已录\n", Color.Red);
                                 OperateResult.AppendText(">>请输入" + ListA.Rows[step - 2]["psr_type"].ToString() + "\n", Color.Black, code);
                                 return false;
                             }
                         }
                     }
                     //验证是否已被使用
-                    string temSn = dh.getFieldDataByCondition("makeserial", "ms_sncode", "(MS_mac='" + macOrBt + "'or ms_bt='"+macOrBt+"') and  ms_status in (0,1,2,3) and ms_id <> '" + oMsid + "' and nvl(ms_nextmacode,' ')=' '").ToString();
+                    string temSn = dh.getFieldDataByCondition("makeserial", "ms_sncode", "(MS_mac='" + macOrBt + "'or ms_bt='" + macOrBt + "') and  ms_status in (0,1,2,3) and ms_id <> '" + oMsid + "' and nvl(ms_nextmacode,' ')=' '").ToString();
                     if (temSn != "")
                     {
                         OperateResult.AppendText("<<" + ListA.Rows[step - 2]["psr_type"].ToString() + ":" + code.Text + "错误,已被序列号" + temSn + "使用\n", Color.Red);
@@ -500,7 +541,7 @@ namespace UAS_MES.Make
                     else
                     {
                         //校验在sninfo表中是否存在
-                        temSn = dh.getFieldDataByCondition("sninfo", "si_sn", "(si_mac='" + macOrBt + "' or si_bt='"+macOrBt+"') and si_id <>'" + siid + "'").ToString();
+                        temSn = dh.getFieldDataByCondition("sninfo", "si_sn", "(si_mac='" + macOrBt + "' or si_bt='" + macOrBt + "') and si_id <>'" + siid + "'").ToString();
                         if (temSn != "")
                         {
                             OperateResult.AppendText("<<" + ListA.Rows[step - 2]["psr_type"].ToString() + ":" + code.Text + "错误,已被序列号" + temSn + "使用\n", Color.Red);
@@ -557,47 +598,105 @@ namespace UAS_MES.Make
             //说明已经是最后一个校验规则
             if (step == ListA.Rows.Count + 1)
             {
-                //通过存储过程二次校验
-                if (LogicHandler.snChangeAndBurn(TSN, SN, User.UserSourceCode, User.UserCode, ms_macode.Text, ChangeResult.Checked ? 1 : 0, (hs.ContainsKey("IMEI1") ? hs["IMEI1"].ToString() : ""), (hs.ContainsKey("IMEI2") ? hs["IMEI2"].ToString() : ""), (hs.ContainsKey("IMEI3") ? hs["IMEI3"].ToString() : ""), "", (hs.ContainsKey("NETCODE") ? hs["NETCODE"].ToString() : ""), "", "", "", "", (hs.ContainsKey("MAC") ? hs["MAC"].ToString() : ""), (hs.ContainsKey("BT") ? hs["BT"].ToString() : ""), "", "", "", out errorMessage))
+                if (CollectRemark.Checked || SameReamrk.Checked)
                 {
-                    OperateResult.AppendText("<<序列号" + TSN + "成功转换为" + SN + "\n<<关联采集成功\n", Color.Green);
-                    //写入日志
-                    LogManager.DoLog("修改序列号:" + TSN + "为" + SN + "成功!" + "操作人:" + User.UserCode);
-                    //记录日志
-                    LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, ms_macode.Text, User.UserLineCode, User.UserSourceCode, "序列烧录转换", TSN + "转换为" + SN, SN, "");
-                    //获取剩余数,刷新页面
-                    sql.Clear();
-                    sql.Append("select mcd_inqty from makecraftdetail where mcd_macode='" + ms_macode.Text + "' and mcd_stepcode='" + User.CurrentStepCode + "'");
-                    dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
-                    if (dt.Rows.Count > 0)
+                    if (Remark.Text == "")
                     {
-                        remain_qty.Text = ma_qty - int.Parse(dt.Rows[0]["mcd_inqty"].ToString()) + "";
+                        OperateResult.AppendText(">>备注栏信息为空,录入备注信息\n", Color.Black);
+                        Remark.SelectAll();
+                        Remark.Focus();
+                        return false;
+                    }
+                    if (IFONLY.Checked)
+                    {
+                        if (!CheckPre())
+                        {
+                            return false;
+                        }
+                        string UsedSncode = dh.getFieldDataByCondition("SNRELATIONINFORECORD", "SIR_SNCODE", "sir_remark = '" + Remark.Text + "'").ToString();
+                        if (UsedSncode != "")
+                        {
+                            OperateResult.AppendText(">>备注信息" + Remark.Text + "已被" + UsedSncode + "采集,不可重复采集\n", Color.Red);
+                            Remark.SelectAll();
+                            Remark.Focus();
+                            return false;
+                        }
+                        LogicHandler.CollectRemarkInf(show_sncode.Text, "", "", ms_macode.Text, ma_prodcode.Text, Remark.Text);
                     }
-                    if (CollectRemark.Checked && Remark.Text != "")
+                    else if (SameReamrk.Checked)
                     {
-                        LogicHandler.CollectRemarkInf(SN, "", "", ms_macode.Text, ma_prodcode.Text, Remark.Text);
+                        if (!CheckPre())
+                        {
+                            return false;
+                        }
+                        LogicHandler.CollectRemarkInf(show_sncode.Text, "", "", ms_macode.Text, ma_prodcode.Text, Remark.Text);
                     }
-                    //更新页面计数+1
-                    count.Text = int.Parse(count.Text) + 1 + "";
-                    //完成之后,清除信息
-                    clearInfo();
-                    OperateResult.AppendText(">>请输入TSN号\n", Color.Black);
                 }
-                else
+                return SetStepResult();
+            }
+            else
+            {
+                OperateResult.AppendText(">>请输入" + ListA.Rows[step - 1]["psr_type"] + "\n", Color.Green, code);
+                return true;
+            }
+        }
+
+        //校验备注前缀
+        private Boolean CheckPre()
+        {
+            try
+            {
+                if (Remark.Text.Substring(0, Seq_Remark_PreFix.Text.Length) != Seq_Remark_PreFix.Text)
                 {
-                    OperateResult.AppendText(">>" + errorMessage + "\n", Color.Red, code);
-                    OperateResult.AppendText(">>请重新输入TSN\n", Color.Black, code);
-                    //    //清空信息
-                    clearInfo();
+                    OperateResult.AppendText(">>备注前缀不匹配,请重新输入备注信息\n", Color.Red);
+                    Remark.SelectAll();
+                    Remark.Focus();
+                    return false;
                 }
-                code.Text = "";
+            }
+            catch (Exception)
+            {
+                OperateResult.AppendText(">>备注前缀不匹配,请重新输入备注信息\n", Color.Red);
+                Remark.SelectAll();
+                Remark.Focus();
                 return false;
             }
+            return true;
+        }
+
+        //通过存储过程二次校验
+        private Boolean SetStepResult()
+        {
+            if (LogicHandler.snChangeAndBurn(TSN, SN, User.UserSourceCode, User.UserCode, ms_macode.Text, ChangeResult.Checked ? 1 : 0, (hs.ContainsKey("IMEI1") ? hs["IMEI1"].ToString() : ""), (hs.ContainsKey("IMEI2") ? hs["IMEI2"].ToString() : ""), (hs.ContainsKey("IMEI3") ? hs["IMEI3"].ToString() : ""), "", (hs.ContainsKey("NETCODE") ? hs["NETCODE"].ToString() : ""), "", "", "", "", (hs.ContainsKey("MAC") ? hs["MAC"].ToString() : ""), (hs.ContainsKey("BT") ? hs["BT"].ToString() : ""), "", "", "", out errorMessage))
+            {
+                OperateResult.AppendText("<<序列号" + TSN + "成功转换为" + SN + "\n<<关联采集成功\n", Color.Green);
+                //写入日志
+                LogManager.DoLog("修改序列号:" + TSN + "为" + SN + "成功!" + "操作人:" + User.UserCode);
+                //记录日志
+                LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, ms_macode.Text, User.UserLineCode, User.UserSourceCode, "序列烧录转换", TSN + "转换为" + SN, SN, "");
+                //获取剩余数,刷新页面
+                sql.Clear();
+                sql.Append("select mcd_inqty from makecraftdetail where mcd_macode='" + ms_macode.Text + "' and mcd_stepcode='" + User.CurrentStepCode + "'");
+                dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
+                if (dt.Rows.Count > 0)
+                {
+                    remain_qty.Text = ma_qty - int.Parse(dt.Rows[0]["mcd_inqty"].ToString()) + "";
+                }
+                //更新页面计数+1
+                count.Text = int.Parse(count.Text) + 1 + "";
+                //完成之后,清除信息
+                clearInfo();
+                OperateResult.AppendText(">>请输入TSN号\n", Color.Black);
+            }
             else
             {
-                OperateResult.AppendText(">>请输入" + ListA.Rows[step - 1]["psr_type"] + "\n", Color.Green, code);
-                return true;
+                OperateResult.AppendText(">>" + errorMessage + "\n", Color.Red, code);
+                OperateResult.AppendText(">>请重新输入TSN\n", Color.Black, code);
+                //    //清空信息
+                clearInfo();
             }
+            code.Text = "";
+            return false;
         }
         /// <summary>
         /// 工单号变化时,带出校验规则
@@ -717,5 +816,59 @@ namespace UAS_MES.Make
         {
             asc.controlAutoSize(this);
         }
+
+        private void Seq_Remark_PreFix_KeyDown(object sender, KeyEventArgs e)
+        {
+            if (e.KeyCode == Keys.Enter)
+            {
+                BaseUtil.SetCacheData("Seq_Remark_PreFix", Seq_Remark_PreFix.Text);
+                if (CollectRemark.Checked || SameReamrk.Checked)
+                {
+                    Remark.SelectAll();
+                    Remark.Focus();
+                }
+            }
+        }
+
+        private void Remark_KeyDown(object sender, KeyEventArgs e)
+        {
+            if (e.KeyCode == Keys.Enter)
+            {
+                if (step == ListA.Rows.Count + 1 && (CollectRemark.Checked || SameReamrk.Checked) && Remark.Text != "")
+                {
+                    code.Text = Remark.Text;
+                    code.Focus();
+                    code_KeyDown(this, new KeyEventArgs(Keys.Enter));
+                }
+                 else
+                 code.Focus();
+            }
+        }
+
+        private void IFONLY_CheckedChanged(object sender, EventArgs e)
+        {
+            if (IFONLY.Checked)
+            {
+                SameReamrk.Checked = false;
+                CollectRemark.Checked = true;
+            }
+        }
+
+        private void SameReamrk_CheckedChanged(object sender, EventArgs e)
+        {
+            if (SameReamrk.Checked)
+            {
+                IFONLY.Checked = false;
+                CollectRemark.Checked = false;
+            }
+        }
+
+        private void CollectRemark_CheckedChanged(object sender, EventArgs e)
+        {
+            if (CollectRemark.Checked)
+            {
+                SameReamrk.Checked = false;
+            }
+        }
     }
 }

+ 174 - 111
UAS-MES/FunctionCode/Make/Make_SeqTransform.Designer.cs

@@ -46,6 +46,12 @@
             this.sn_code_label = new System.Windows.Forms.Label();
             this.label2 = new System.Windows.Forms.Label();
             this.ma_softversion = new System.Windows.Forms.Label();
+            this.SameReamrk = new System.Windows.Forms.CheckBox();
+            this.label3 = new System.Windows.Forms.Label();
+            this.IFONLY = new System.Windows.Forms.CheckBox();
+            this.CollectRemark = new System.Windows.Forms.CheckBox();
+            this.Remark = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
+            this.Seq_Remark_PreFix = new UAS_MES.CustomControl.TextBoxWithIcon.SnCollectionBox();
             this.StepCount = new UAS_MES.CustomControl.TextBoxWithIcon.SourceStepCount();
             this.ChangeResult = new UAS_MES.CustomControl.CustomCheckBox.CustomCheckBox();
             this.show_sncode = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
@@ -57,8 +63,6 @@
             this.beforeTransSNPre = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.OperateResult = new UAS_MES.CustomControl.RichText.RichTextAutoBottom();
             this.sncode = new UAS_MES.CustomControl.TextBoxWithIcon.SnCollectionBox();
-            this.CollectRemark = new System.Windows.Forms.CheckBox();
-            this.Remark = new UAS_MES.CustomControl.RichText.RichTextAutoBottom();
             ((System.ComponentModel.ISupportInitialize)(this.ClearSn_code)).BeginInit();
             this.SuspendLayout();
             // 
@@ -66,20 +70,18 @@
             // 
             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.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.ms_makecode_label.Location = new System.Drawing.Point(15, 17);
             this.ms_makecode_label.Name = "ms_makecode_label";
-            this.ms_makecode_label.Size = new System.Drawing.Size(0, 27);
+            this.ms_makecode_label.Size = new System.Drawing.Size(0, 21);
             this.ms_makecode_label.TabIndex = 61;
             // 
             // 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(733, 19);
-            this.pr_detail_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.pr_detail_label.Location = new System.Drawing.Point(550, 15);
             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(74, 21);
             this.pr_detail_label.TabIndex = 62;
             this.pr_detail_label.Text = "产品名称";
             // 
@@ -87,10 +89,9 @@
             // 
             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(409, 19);
-            this.ma_prodcode_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.ma_prodcode_label.Location = new System.Drawing.Point(307, 15);
             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(74, 21);
             this.ma_prodcode_label.TabIndex = 63;
             this.ma_prodcode_label.Text = "产品编号";
             // 
@@ -98,10 +99,9 @@
             // 
             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(23, 539);
-            this.sncode_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.sncode_label.Location = new System.Drawing.Point(17, 431);
             this.sncode_label.Name = "sncode_label";
-            this.sncode_label.Size = new System.Drawing.Size(72, 27);
+            this.sncode_label.Size = new System.Drawing.Size(58, 21);
             this.sncode_label.TabIndex = 68;
             this.sncode_label.Text = "录入框";
             // 
@@ -109,10 +109,10 @@
             // 
             this.beforeTransSNLength_checkBox.AutoSize = true;
             this.beforeTransSNLength_checkBox.Font = new System.Drawing.Font("微软雅黑", 10F);
-            this.beforeTransSNLength_checkBox.Location = new System.Drawing.Point(25, 101);
-            this.beforeTransSNLength_checkBox.Margin = new System.Windows.Forms.Padding(3, 1, 3, 1);
+            this.beforeTransSNLength_checkBox.Location = new System.Drawing.Point(19, 81);
+            this.beforeTransSNLength_checkBox.Margin = new System.Windows.Forms.Padding(2, 1, 2, 1);
             this.beforeTransSNLength_checkBox.Name = "beforeTransSNLength_checkBox";
-            this.beforeTransSNLength_checkBox.Size = new System.Drawing.Size(100, 27);
+            this.beforeTransSNLength_checkBox.Size = new System.Drawing.Size(83, 24);
             this.beforeTransSNLength_checkBox.TabIndex = 81;
             this.beforeTransSNLength_checkBox.Text = "TSN长度";
             this.beforeTransSNLength_checkBox.UseVisualStyleBackColor = true;
@@ -121,10 +121,10 @@
             // 
             this.afterTransSNLength_checkBox.AutoSize = true;
             this.afterTransSNLength_checkBox.Font = new System.Drawing.Font("微软雅黑", 10F);
-            this.afterTransSNLength_checkBox.Location = new System.Drawing.Point(25, 141);
-            this.afterTransSNLength_checkBox.Margin = new System.Windows.Forms.Padding(3, 1, 3, 1);
+            this.afterTransSNLength_checkBox.Location = new System.Drawing.Point(19, 113);
+            this.afterTransSNLength_checkBox.Margin = new System.Windows.Forms.Padding(2, 1, 2, 1);
             this.afterTransSNLength_checkBox.Name = "afterTransSNLength_checkBox";
-            this.afterTransSNLength_checkBox.Size = new System.Drawing.Size(90, 27);
+            this.afterTransSNLength_checkBox.Size = new System.Drawing.Size(75, 24);
             this.afterTransSNLength_checkBox.TabIndex = 82;
             this.afterTransSNLength_checkBox.Text = "SN长度";
             this.afterTransSNLength_checkBox.UseVisualStyleBackColor = true;
@@ -133,10 +133,10 @@
             // 
             this.beforeTransSNPre_checkBox.AutoSize = true;
             this.beforeTransSNPre_checkBox.Font = new System.Drawing.Font("微软雅黑", 10F);
-            this.beforeTransSNPre_checkBox.Location = new System.Drawing.Point(561, 101);
-            this.beforeTransSNPre_checkBox.Margin = new System.Windows.Forms.Padding(3, 1, 3, 1);
+            this.beforeTransSNPre_checkBox.Location = new System.Drawing.Point(421, 81);
+            this.beforeTransSNPre_checkBox.Margin = new System.Windows.Forms.Padding(2, 1, 2, 1);
             this.beforeTransSNPre_checkBox.Name = "beforeTransSNPre_checkBox";
-            this.beforeTransSNPre_checkBox.Size = new System.Drawing.Size(100, 27);
+            this.beforeTransSNPre_checkBox.Size = new System.Drawing.Size(83, 24);
             this.beforeTransSNPre_checkBox.TabIndex = 83;
             this.beforeTransSNPre_checkBox.Text = "TSN前缀";
             this.beforeTransSNPre_checkBox.UseVisualStyleBackColor = true;
@@ -145,10 +145,10 @@
             // 
             this.afterTransSNPre_checkBox.AutoSize = true;
             this.afterTransSNPre_checkBox.Font = new System.Drawing.Font("微软雅黑", 10F);
-            this.afterTransSNPre_checkBox.Location = new System.Drawing.Point(561, 142);
-            this.afterTransSNPre_checkBox.Margin = new System.Windows.Forms.Padding(3, 1, 3, 1);
+            this.afterTransSNPre_checkBox.Location = new System.Drawing.Point(421, 114);
+            this.afterTransSNPre_checkBox.Margin = new System.Windows.Forms.Padding(2, 1, 2, 1);
             this.afterTransSNPre_checkBox.Name = "afterTransSNPre_checkBox";
-            this.afterTransSNPre_checkBox.Size = new System.Drawing.Size(90, 27);
+            this.afterTransSNPre_checkBox.Size = new System.Drawing.Size(75, 24);
             this.afterTransSNPre_checkBox.TabIndex = 84;
             this.afterTransSNPre_checkBox.Text = "SN前缀";
             this.afterTransSNPre_checkBox.UseVisualStyleBackColor = true;
@@ -157,9 +157,10 @@
             // 
             this.label1.AutoSize = true;
             this.label1.Font = new System.Drawing.Font("微软雅黑", 12F);
-            this.label1.Location = new System.Drawing.Point(20, 19);
+            this.label1.Location = new System.Drawing.Point(15, 15);
+            this.label1.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
             this.label1.Name = "label1";
-            this.label1.Size = new System.Drawing.Size(92, 27);
+            this.label1.Size = new System.Drawing.Size(74, 21);
             this.label1.TabIndex = 93;
             this.label1.Text = "工单编号";
             // 
@@ -167,9 +168,10 @@
             // 
             this.ma_code.AutoSize = true;
             this.ma_code.Font = new System.Drawing.Font("微软雅黑", 12F);
-            this.ma_code.Location = new System.Drawing.Point(121, 19);
+            this.ma_code.Location = new System.Drawing.Point(91, 15);
+            this.ma_code.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
             this.ma_code.Name = "ma_code";
-            this.ma_code.Size = new System.Drawing.Size(0, 27);
+            this.ma_code.Size = new System.Drawing.Size(0, 21);
             this.ma_code.TabIndex = 95;
             this.ma_code.TextChanged += new System.EventHandler(this.ms_makecode_UserControlTextChanged);
             // 
@@ -177,9 +179,10 @@
             // 
             this.changenum.AutoSize = true;
             this.changenum.Font = new System.Drawing.Font("微软雅黑", 12F);
-            this.changenum.Location = new System.Drawing.Point(972, 534);
+            this.changenum.Location = new System.Drawing.Point(744, 425);
+            this.changenum.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
             this.changenum.Name = "changenum";
-            this.changenum.Size = new System.Drawing.Size(24, 27);
+            this.changenum.Size = new System.Drawing.Size(19, 21);
             this.changenum.TabIndex = 100;
             this.changenum.Text = "0";
             this.changenum.Visible = false;
@@ -188,18 +191,20 @@
             // 
             this.remain_qty.AutoSize = true;
             this.remain_qty.Font = new System.Drawing.Font("微软雅黑", 12F);
-            this.remain_qty.Location = new System.Drawing.Point(124, 64);
+            this.remain_qty.Location = new System.Drawing.Point(93, 51);
+            this.remain_qty.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
             this.remain_qty.Name = "remain_qty";
-            this.remain_qty.Size = new System.Drawing.Size(0, 27);
+            this.remain_qty.Size = new System.Drawing.Size(0, 21);
             this.remain_qty.TabIndex = 99;
             // 
             // PrintNum_label
             // 
             this.PrintNum_label.AutoSize = true;
             this.PrintNum_label.Font = new System.Drawing.Font("微软雅黑", 12F);
-            this.PrintNum_label.Location = new System.Drawing.Point(873, 534);
+            this.PrintNum_label.Location = new System.Drawing.Point(683, 425);
+            this.PrintNum_label.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
             this.PrintNum_label.Name = "PrintNum_label";
-            this.PrintNum_label.Size = new System.Drawing.Size(52, 27);
+            this.PrintNum_label.Size = new System.Drawing.Size(42, 21);
             this.PrintNum_label.TabIndex = 98;
             this.PrintNum_label.Text = "计数";
             this.PrintNum_label.Visible = false;
@@ -208,9 +213,10 @@
             // 
             this.remain_qty_label.AutoSize = true;
             this.remain_qty_label.Font = new System.Drawing.Font("微软雅黑", 12F);
-            this.remain_qty_label.Location = new System.Drawing.Point(24, 64);
+            this.remain_qty_label.Location = new System.Drawing.Point(18, 51);
+            this.remain_qty_label.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
             this.remain_qty_label.Name = "remain_qty_label";
-            this.remain_qty_label.Size = new System.Drawing.Size(72, 27);
+            this.remain_qty_label.Size = new System.Drawing.Size(58, 21);
             this.remain_qty_label.TabIndex = 97;
             this.remain_qty_label.Text = "剩余数";
             // 
@@ -218,10 +224,9 @@
             // 
             this.ClearSn_code.Cursor = System.Windows.Forms.Cursors.Hand;
             this.ClearSn_code.Image = global::UAS_MES.Properties.Resources.bindingNavigatorDeleteItem_Image;
-            this.ClearSn_code.Location = new System.Drawing.Point(373, 499);
-            this.ClearSn_code.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.ClearSn_code.Location = new System.Drawing.Point(280, 399);
             this.ClearSn_code.Name = "ClearSn_code";
-            this.ClearSn_code.Size = new System.Drawing.Size(21, 20);
+            this.ClearSn_code.Size = new System.Drawing.Size(16, 16);
             this.ClearSn_code.TabIndex = 141;
             this.ClearSn_code.TabStop = false;
             this.ClearSn_code.Click += new System.EventHandler(this.ReCall_Click);
@@ -230,10 +235,9 @@
             // 
             this.sn_code_label.AutoSize = true;
             this.sn_code_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.sn_code_label.Location = new System.Drawing.Point(23, 495);
-            this.sn_code_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.sn_code_label.Location = new System.Drawing.Point(17, 396);
             this.sn_code_label.Name = "sn_code_label";
-            this.sn_code_label.Size = new System.Drawing.Size(72, 27);
+            this.sn_code_label.Size = new System.Drawing.Size(58, 21);
             this.sn_code_label.TabIndex = 139;
             this.sn_code_label.Text = "序列号";
             // 
@@ -241,10 +245,9 @@
             // 
             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(733, 64);
-            this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label2.Location = new System.Drawing.Point(550, 51);
             this.label2.Name = "label2";
-            this.label2.Size = new System.Drawing.Size(92, 27);
+            this.label2.Size = new System.Drawing.Size(74, 21);
             this.label2.TabIndex = 147;
             this.label2.Text = "软件版本";
             // 
@@ -252,18 +255,97 @@
             // 
             this.ma_softversion.AutoSize = true;
             this.ma_softversion.Font = new System.Drawing.Font("微软雅黑", 12F);
-            this.ma_softversion.Location = new System.Drawing.Point(831, 64);
+            this.ma_softversion.Location = new System.Drawing.Point(623, 51);
+            this.ma_softversion.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
             this.ma_softversion.Name = "ma_softversion";
-            this.ma_softversion.Size = new System.Drawing.Size(0, 27);
+            this.ma_softversion.Size = new System.Drawing.Size(0, 21);
             this.ma_softversion.TabIndex = 148;
             // 
+            // SameReamrk
+            // 
+            this.SameReamrk.AutoSize = true;
+            this.SameReamrk.Location = new System.Drawing.Point(461, 439);
+            this.SameReamrk.Name = "SameReamrk";
+            this.SameReamrk.Size = new System.Drawing.Size(96, 16);
+            this.SameReamrk.TabIndex = 220;
+            this.SameReamrk.Text = "固定录入备注";
+            this.SameReamrk.UseVisualStyleBackColor = true;
+            this.SameReamrk.CheckedChanged += new System.EventHandler(this.SameReamrk_CheckedChanged);
+            // 
+            // label3
+            // 
+            this.label3.AutoSize = true;
+            this.label3.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label3.Location = new System.Drawing.Point(368, 409);
+            this.label3.Name = "label3";
+            this.label3.Size = new System.Drawing.Size(37, 20);
+            this.label3.TabIndex = 219;
+            this.label3.Text = "前缀";
+            // 
+            // IFONLY
+            // 
+            this.IFONLY.AutoSize = true;
+            this.IFONLY.Location = new System.Drawing.Point(372, 439);
+            this.IFONLY.Name = "IFONLY";
+            this.IFONLY.Size = new System.Drawing.Size(84, 16);
+            this.IFONLY.TabIndex = 217;
+            this.IFONLY.Text = "不允许重复";
+            this.IFONLY.UseVisualStyleBackColor = true;
+            this.IFONLY.CheckedChanged += new System.EventHandler(this.IFONLY_CheckedChanged);
+            // 
+            // CollectRemark
+            // 
+            this.CollectRemark.AutoSize = true;
+            this.CollectRemark.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.CollectRemark.Location = new System.Drawing.Point(563, 439);
+            this.CollectRemark.Name = "CollectRemark";
+            this.CollectRemark.Size = new System.Drawing.Size(72, 16);
+            this.CollectRemark.TabIndex = 216;
+            this.CollectRemark.Text = "采集备注";
+            this.CollectRemark.UseVisualStyleBackColor = true;
+            this.CollectRemark.CheckedChanged += new System.EventHandler(this.CollectRemark_CheckedChanged);
+            // 
+            // Remark
+            // 
+            this.Remark.AllPower = null;
+            this.Remark.BackColor = System.Drawing.Color.White;
+            this.Remark.ID = null;
+            this.Remark.Location = new System.Drawing.Point(465, 383);
+            this.Remark.Margin = new System.Windows.Forms.Padding(2);
+            this.Remark.Multiline = true;
+            this.Remark.Name = "Remark";
+            this.Remark.Power = null;
+            this.Remark.Size = new System.Drawing.Size(148, 46);
+            this.Remark.Str = null;
+            this.Remark.Str1 = null;
+            this.Remark.Str2 = null;
+            this.Remark.TabIndex = 221;
+            this.Remark.KeyDown += new System.Windows.Forms.KeyEventHandler(this.Remark_KeyDown);
+            // 
+            // Seq_Remark_PreFix
+            // 
+            this.Seq_Remark_PreFix.AllPower = null;
+            this.Seq_Remark_PreFix.BackColor = System.Drawing.Color.White;
+            this.Seq_Remark_PreFix.Font = new System.Drawing.Font("微软雅黑", 9F);
+            this.Seq_Remark_PreFix.ID = null;
+            this.Seq_Remark_PreFix.Location = new System.Drawing.Point(414, 406);
+            this.Seq_Remark_PreFix.Margin = new System.Windows.Forms.Padding(6, 7, 6, 7);
+            this.Seq_Remark_PreFix.Name = "Seq_Remark_PreFix";
+            this.Seq_Remark_PreFix.Power = null;
+            this.Seq_Remark_PreFix.Size = new System.Drawing.Size(38, 23);
+            this.Seq_Remark_PreFix.Str = null;
+            this.Seq_Remark_PreFix.Str1 = null;
+            this.Seq_Remark_PreFix.Str2 = null;
+            this.Seq_Remark_PreFix.TabIndex = 218;
+            this.Seq_Remark_PreFix.KeyDown += new System.Windows.Forms.KeyEventHandler(this.Seq_Remark_PreFix_KeyDown);
+            // 
             // StepCount
             // 
             this.StepCount.LineCode = null;
-            this.StepCount.Location = new System.Drawing.Point(409, 64);
-            this.StepCount.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.StepCount.Location = new System.Drawing.Point(307, 51);
+            this.StepCount.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
             this.StepCount.Name = "StepCount";
-            this.StepCount.Size = new System.Drawing.Size(117, 28);
+            this.StepCount.Size = new System.Drawing.Size(88, 22);
             this.StepCount.Source = null;
             this.StepCount.StepCode = null;
             this.StepCount.TabIndex = 196;
@@ -272,11 +354,11 @@
             // 
             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(373, 534);
-            this.ChangeResult.Margin = new System.Windows.Forms.Padding(3, 1, 3, 1);
+            this.ChangeResult.Location = new System.Drawing.Point(280, 427);
+            this.ChangeResult.Margin = new System.Windows.Forms.Padding(2, 1, 2, 1);
             this.ChangeResult.Name = "ChangeResult";
             this.ChangeResult.Power = "ifspecial";
-            this.ChangeResult.Size = new System.Drawing.Size(114, 31);
+            this.ChangeResult.Size = new System.Drawing.Size(93, 25);
             this.ChangeResult.TabIndex = 146;
             this.ChangeResult.Text = "重新转换";
             this.ChangeResult.UseVisualStyleBackColor = true;
@@ -289,11 +371,10 @@
             this.show_sncode.Enabled = false;
             this.show_sncode.Font = new System.Drawing.Font("微软雅黑", 10F);
             this.show_sncode.ID = null;
-            this.show_sncode.Location = new System.Drawing.Point(129, 495);
-            this.show_sncode.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.show_sncode.Location = new System.Drawing.Point(97, 396);
             this.show_sncode.Name = "show_sncode";
             this.show_sncode.Power = null;
-            this.show_sncode.Size = new System.Drawing.Size(212, 29);
+            this.show_sncode.Size = new System.Drawing.Size(160, 25);
             this.show_sncode.Str = null;
             this.show_sncode.Str1 = null;
             this.show_sncode.Str2 = null;
@@ -304,10 +385,11 @@
             this.pr_detail.AutoSize = true;
             this.pr_detail.CutLength = null;
             this.pr_detail.Font = new System.Drawing.Font("微软雅黑", 12F);
-            this.pr_detail.Location = new System.Drawing.Point(831, 19);
-            this.pr_detail.MaximumSize = new System.Drawing.Size(177, 0);
+            this.pr_detail.Location = new System.Drawing.Point(623, 15);
+            this.pr_detail.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
+            this.pr_detail.MaximumSize = new System.Drawing.Size(133, 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, 21);
             this.pr_detail.TabIndex = 96;
             // 
             // ma_prodcode
@@ -315,30 +397,30 @@
             this.ma_prodcode.AutoSize = true;
             this.ma_prodcode.CutLength = null;
             this.ma_prodcode.Font = new System.Drawing.Font("微软雅黑", 12F);
-            this.ma_prodcode.Location = new System.Drawing.Point(512, 21);
+            this.ma_prodcode.Location = new System.Drawing.Point(384, 17);
             this.ma_prodcode.Margin = new System.Windows.Forms.Padding(1, 0, 1, 0);
-            this.ma_prodcode.MaximumSize = new System.Drawing.Size(177, 0);
+            this.ma_prodcode.MaximumSize = new System.Drawing.Size(133, 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, 21);
             this.ma_prodcode.TabIndex = 94;
             // 
             // afterTransSNLength
             // 
             this.afterTransSNLength.Font = new System.Drawing.Font("微软雅黑", 10F);
-            this.afterTransSNLength.Location = new System.Drawing.Point(148, 144);
-            this.afterTransSNLength.Margin = new System.Windows.Forms.Padding(3, 1, 3, 1);
+            this.afterTransSNLength.Location = new System.Drawing.Point(111, 115);
+            this.afterTransSNLength.Margin = new System.Windows.Forms.Padding(2, 1, 2, 1);
             this.afterTransSNLength.Name = "afterTransSNLength";
-            this.afterTransSNLength.Size = new System.Drawing.Size(223, 29);
+            this.afterTransSNLength.Size = new System.Drawing.Size(168, 25);
             this.afterTransSNLength.TabIndex = 90;
             this.afterTransSNLength.Text = "0";
             // 
             // beforeTransSNLength
             // 
             this.beforeTransSNLength.Font = new System.Drawing.Font("微软雅黑", 10F);
-            this.beforeTransSNLength.Location = new System.Drawing.Point(148, 101);
-            this.beforeTransSNLength.Margin = new System.Windows.Forms.Padding(3, 1, 3, 1);
+            this.beforeTransSNLength.Location = new System.Drawing.Point(111, 81);
+            this.beforeTransSNLength.Margin = new System.Windows.Forms.Padding(2, 1, 2, 1);
             this.beforeTransSNLength.Name = "beforeTransSNLength";
-            this.beforeTransSNLength.Size = new System.Drawing.Size(223, 29);
+            this.beforeTransSNLength.Size = new System.Drawing.Size(168, 25);
             this.beforeTransSNLength.TabIndex = 89;
             this.beforeTransSNLength.Text = "0";
             // 
@@ -348,11 +430,11 @@
             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(684, 141);
-            this.afterTransSNPre.Margin = new System.Windows.Forms.Padding(3, 1, 3, 1);
+            this.afterTransSNPre.Location = new System.Drawing.Point(513, 113);
+            this.afterTransSNPre.Margin = new System.Windows.Forms.Padding(2, 1, 2, 1);
             this.afterTransSNPre.Name = "afterTransSNPre";
             this.afterTransSNPre.Power = null;
-            this.afterTransSNPre.Size = new System.Drawing.Size(223, 29);
+            this.afterTransSNPre.Size = new System.Drawing.Size(168, 25);
             this.afterTransSNPre.Str = null;
             this.afterTransSNPre.Str1 = null;
             this.afterTransSNPre.Str2 = null;
@@ -364,11 +446,11 @@
             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(684, 99);
-            this.beforeTransSNPre.Margin = new System.Windows.Forms.Padding(3, 1, 3, 1);
+            this.beforeTransSNPre.Location = new System.Drawing.Point(513, 79);
+            this.beforeTransSNPre.Margin = new System.Windows.Forms.Padding(2, 1, 2, 1);
             this.beforeTransSNPre.Name = "beforeTransSNPre";
             this.beforeTransSNPre.Power = null;
-            this.beforeTransSNPre.Size = new System.Drawing.Size(223, 29);
+            this.beforeTransSNPre.Size = new System.Drawing.Size(168, 25);
             this.beforeTransSNPre.Str = null;
             this.beforeTransSNPre.Str1 = null;
             this.beforeTransSNPre.Str2 = null;
@@ -377,10 +459,9 @@
             // OperateResult
             // 
             this.OperateResult.Font = new System.Drawing.Font("微软雅黑", 15F);
-            this.OperateResult.Location = new System.Drawing.Point(25, 184);
-            this.OperateResult.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.OperateResult.Location = new System.Drawing.Point(19, 147);
             this.OperateResult.Name = "OperateResult";
-            this.OperateResult.Size = new System.Drawing.Size(1081, 288);
+            this.OperateResult.Size = new System.Drawing.Size(812, 231);
             this.OperateResult.TabIndex = 78;
             this.OperateResult.Text = "";
             // 
@@ -390,11 +471,10 @@
             this.sncode.BackColor = System.Drawing.Color.White;
             this.sncode.Font = new System.Drawing.Font("微软雅黑", 10F);
             this.sncode.ID = null;
-            this.sncode.Location = new System.Drawing.Point(129, 536);
-            this.sncode.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.sncode.Location = new System.Drawing.Point(97, 429);
             this.sncode.Name = "sncode";
             this.sncode.Power = "ifread";
-            this.sncode.Size = new System.Drawing.Size(212, 29);
+            this.sncode.Size = new System.Drawing.Size(160, 25);
             this.sncode.Str = null;
             this.sncode.Str1 = null;
             this.sncode.Str2 = null;
@@ -402,37 +482,17 @@
             this.sncode.Tag = "IfRead";
             this.sncode.KeyDown += new System.Windows.Forms.KeyEventHandler(this.sncode_KeyDown);
             // 
-            // CollectRemark
-            // 
-            this.CollectRemark.AutoSize = true;
-            this.CollectRemark.Checked = true;
-            this.CollectRemark.CheckState = System.Windows.Forms.CheckState.Checked;
-            this.CollectRemark.Font = new System.Drawing.Font("微软雅黑", 10F);
-            this.CollectRemark.Location = new System.Drawing.Point(489, 486);
-            this.CollectRemark.Margin = new System.Windows.Forms.Padding(4);
-            this.CollectRemark.Name = "CollectRemark";
-            this.CollectRemark.Size = new System.Drawing.Size(100, 27);
-            this.CollectRemark.TabIndex = 201;
-            this.CollectRemark.Text = "采集备注";
-            this.CollectRemark.UseVisualStyleBackColor = true;
-            // 
-            // Remark
-            // 
-            this.Remark.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.Remark.Location = new System.Drawing.Point(600, 484);
-            this.Remark.Margin = new System.Windows.Forms.Padding(4, 2, 4, 2);
-            this.Remark.Name = "Remark";
-            this.Remark.Size = new System.Drawing.Size(253, 89);
-            this.Remark.TabIndex = 200;
-            this.Remark.Text = "";
-            // 
             // Make_SeqTransform
             // 
-            this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
+            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(1132, 584);
-            this.Controls.Add(this.CollectRemark);
+            this.ClientSize = new System.Drawing.Size(849, 467);
             this.Controls.Add(this.Remark);
+            this.Controls.Add(this.SameReamrk);
+            this.Controls.Add(this.label3);
+            this.Controls.Add(this.Seq_Remark_PreFix);
+            this.Controls.Add(this.IFONLY);
+            this.Controls.Add(this.CollectRemark);
             this.Controls.Add(this.StepCount);
             this.Controls.Add(this.ma_softversion);
             this.Controls.Add(this.label2);
@@ -463,7 +523,6 @@
             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 = "Make_SeqTransform";
             this.Tag = "Make!SeqTransform";
             this.Text = " ";
@@ -505,7 +564,11 @@
         private System.Windows.Forms.Label label2;
         private System.Windows.Forms.Label ma_softversion;
         private CustomControl.TextBoxWithIcon.SourceStepCount StepCount;
+        private CustomControl.TextBoxWithIcon.EnterTextBox Remark;
+        private System.Windows.Forms.CheckBox SameReamrk;
+        private System.Windows.Forms.Label label3;
+        private CustomControl.TextBoxWithIcon.SnCollectionBox Seq_Remark_PreFix;
+        private System.Windows.Forms.CheckBox IFONLY;
         private System.Windows.Forms.CheckBox CollectRemark;
-        private CustomControl.RichText.RichTextAutoBottom Remark;
     }
 }

+ 117 - 4
UAS-MES/FunctionCode/Make/Make_SeqTransform.cs

@@ -219,6 +219,41 @@ namespace UAS_MES.Make
                             //防呆验证完成
                             if ((!ChangeResult.Checked && (!dh.CheckExist("makeserial", "ms_sncode='" + sncode.Text + "' and ms_id <>'" + oMsId + "' and nvl(ms_nextmacode,' ') =' '") && !onlyPass || onlyPass && bsncode == sncode.Text)) || (ChangeResult.Checked && !dh.CheckExist("makeserial", "ms_sncode='" + sncode.Text + "' and ms_id <>'" + oMsId + "' and nvl(ms_nextmacode,' ') =' '")))
                             {
+                                if (CollectRemark.Checked || SameReamrk.Checked)
+                                {
+                                    if (Remark.Text == "")
+                                    {
+                                        OperateResult.AppendText(">>备注栏信息为空,录入备注信息\n", Color.Black);
+                                        Remark.SelectAll();
+                                        Remark.Focus();
+                                        return;
+                                    }
+                                    if (IFONLY.Checked)
+                                    {
+                                        if (!CheckPre())
+                                        {
+                                            return;
+                                        }
+                                        string UsedSncode = dh.getFieldDataByCondition("SNRELATIONINFORECORD", "SIR_SNCODE", "sir_remark = '" + Remark.Text + "'").ToString();
+                                        if (UsedSncode != "")
+                                        {
+                                            OperateResult.AppendText(">>备注信息" + Remark.Text + "已被" + UsedSncode + "采集,不可重复采集\n", Color.Red);
+                                            Remark.SelectAll();
+                                            Remark.Focus();
+                                            return;
+                                        }
+                                        LogicHandler.CollectRemarkInf(show_sncode.Text, "", "", oMakeCode, ma_prodcode.Text, Remark.Text);
+                                    }
+                                    else if (SameReamrk.Checked)
+                                    {
+                                        if (!CheckPre())
+                                        {
+                                            return;
+                                        }
+                                        LogicHandler.CollectRemarkInf(show_sncode.Text, "", "", oMakeCode, ma_prodcode.Text, Remark.Text);
+                                    }
+                                }
+
                                 if (!ChangeResult.Checked && !onlyPass || bsncode != sncode.Text)
                                 {
                                     string firstsn = "";
@@ -248,10 +283,10 @@ namespace UAS_MES.Make
                                 OperateResult.AppendText("<<序列号" + bsncode + "成功转换为" + sncode.Text + "\n", Color.Green);
                                 //记录日志
                                 LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, ma_code.Text, User.UserLineCode, User.UserSourceCode, "序列转换", bsncode + "转换为" + sncode.Text, sncode.Text, "");
-                                if (CollectRemark.Checked && Remark.Text != "")
-                                {
-                                    LogicHandler.CollectRemarkInf(sncode.Text, "", "", oMakeCode, ma_prodcode.Text, Remark.Text);
-                                }
+                                //if (CollectRemark.Checked && Remark.Text != "")
+                                //{
+                                //    LogicHandler.CollectRemarkInf(sncode.Text, "", "", oMakeCode, ma_prodcode.Text, Remark.Text);
+                                //}
                                 LogManager.DoLog("修改序列号:" + bsncode + "为" + sncode.Text + "成功!" + "操作人:" + User.UserCode);
                                 //写入日志
                                 if (!LogicHandler.SetStepResult(ma_code.Text, User.UserSourceCode, sncode.Text, "序列转换", "序列转换成功", User.UserCode, out errorMessage))
@@ -466,11 +501,89 @@ namespace UAS_MES.Make
             StepCount.LineCode = User.UserLineCode;
             StepCount.Dh = dh;
             StepCount.Start();
+            Seq_Remark_PreFix.Text = BaseUtil.GetCacheData("Seq_Remark_PreFix").ToString();
         }
 
         private void Make_SeqTransform_SizeChanged(object sender, EventArgs e)
         {
             asc.controlAutoSize(this);
         }
+
+        private void Remark_KeyDown(object sender, KeyEventArgs e)
+        {
+            if (e.KeyCode == Keys.Enter)
+            {
+                if ( (CollectRemark.Checked || SameReamrk.Checked) && Remark.Text != "")
+                {
+                    sncode.Focus();
+                    sncode_KeyDown(this, new KeyEventArgs(Keys.Enter));
+                }
+                else
+                    sncode.Focus();
+            }
+        }
+
+        private void IFONLY_CheckedChanged(object sender, EventArgs e)
+        {
+            if (IFONLY.Checked)
+            {
+                SameReamrk.Checked = false;
+                CollectRemark.Checked = true;
+            }
+        }
+
+        private void SameReamrk_CheckedChanged(object sender, EventArgs e)
+        {
+            if (SameReamrk.Checked)
+            {
+                IFONLY.Checked = false;
+                CollectRemark.Checked = false;
+            }
+        }
+
+        private void Seq_Remark_PreFix_KeyDown(object sender, KeyEventArgs e)
+        {
+            if (e.KeyCode == Keys.Enter)
+            {
+                BaseUtil.SetCacheData("Seq_Remark_PreFix", Seq_Remark_PreFix.Text);
+                if (CollectRemark.Checked || SameReamrk.Checked)
+                {
+                    Remark.SelectAll();
+                    Remark.Focus();
+                }
+            }
+        }
+
+
+        //校验备注前缀
+        private Boolean CheckPre()
+        {
+            try
+            {
+                if (Remark.Text.Substring(0, Seq_Remark_PreFix.Text.Length) != Seq_Remark_PreFix.Text)
+                {
+                    OperateResult.AppendText(">>备注前缀不匹配,请重新输入备注信息\n", Color.Red);
+                    Remark.SelectAll();
+                    Remark.Focus();
+                    return false;
+                }
+            }
+            catch (Exception)
+            {
+                OperateResult.AppendText(">>备注前缀不匹配,请重新输入备注信息\n", Color.Red);
+                Remark.SelectAll();
+                Remark.Focus();
+                return false;
+            }
+            return true;
+        }
+
+        private void CollectRemark_CheckedChanged(object sender, EventArgs e)
+        {
+            if (CollectRemark.Checked)
+            {
+                SameReamrk.Checked = false;
+            }
+        }
     }
 }

+ 4 - 3
UAS_MES_NEW/FunctionCode/Make/Make_ColorBoxLoadPrint.cs

@@ -137,7 +137,7 @@ namespace UAS_MES_NEW.Make
                                 code.Text = "";
                             }
                             sql.Clear();
-                            sql.Append("select max(sp_id)sp_id,max(sp_detno)sp_detno,min(sp_ifrepeat)sp_ifrepeat,max(sp_checkbarcode)sp_checkbarcode,sp_fsoncode,max(sp_barcoderule)");
+                            sql.Append("select max(sp_id)sp_id,max(sp_detno)sp_detno,min(sp_ifrepeat)sp_ifrepeat,max(sp_checkbarcode)sp_checkbarcode,min(sp_checksalecode)sp_checksalecode,sp_fsoncode,max(sp_barcoderule)");
                             sql.Append("sp_barcoderule,wm_concat(sp_soncode) sp_soncode,max(sp_ifuseregex)sp_ifuseregex,max(sp_ifforsn)");
                             sql.Append("sp_ifforsn,max(sp_length)sp_length,max(sp_type)sp_type,replace(wm_concat(sp_prefix),',','|')sp_prefix,max(sp_regex)");
                             sql.Append("sp_regex,max(pr_detail)pr_detail from stepproduct left join product on pr_code=sp_fsoncode where ");
@@ -212,11 +212,12 @@ namespace UAS_MES_NEW.Make
                         string sp_regex = ListA.Rows[RemainIndex]["sp_regex"].ToString();
                         string length = ListA.Rows[RemainIndex]["sp_length"].ToString();
                         string sp_id = ListA.Rows[RemainIndex]["sp_id"].ToString();
-                        string sp_ifrepeat = dt.Rows[RemainIndex]["sp_ifrepeat"].ToString();
+                        string sp_ifrepeat = ListA.Rows[RemainIndex]["sp_ifrepeat"].ToString();
                         string sp_ifforsn = ListA.Rows[RemainIndex]["sp_ifforsn"].ToString();
                         string sp_barcoderule = ListA.Rows[RemainIndex]["sp_barcoderule"].ToString();
                         string sp_checkbarcode = ListA.Rows[RemainIndex]["sp_checkbarcode"].ToString();
-                        if (LogicHandler.CheckSNBeforeLoad(ma_code.Text, code.Text, sp_fsoncode, sp_soncode, sp_barcoderule, sp_prefix, length, sp_ifrepeat, out ErrorMessage))
+                        string sp_checksalecode = ListA.Rows[RemainIndex]["sp_checksalecode"].ToString();
+                        if (LogicHandler.CheckSNBeforeLoad(ma_code.Text, code.Text, sp_fsoncode, sp_soncode, sp_barcoderule, sp_prefix, length, sp_ifrepeat, sp_checksalecode, out ErrorMessage))
                         {
                             //判断采集的条码和本次采集的也不能重复
                             if (CollectData.Contains(code.Text) && sp_ifrepeat != "-1")

+ 20 - 19
UAS_MES_NEW/FunctionCode/Make/Make_Decompose.cs

@@ -118,14 +118,14 @@ namespace UAS_MES_NEW.Make
                 BaseUtil.FillDgvWithDataTable(LabelDataGridView, dt);
                 for (int i = 0; i < LabelDataGridView.Rows.Count; i++)
                 {
-                    DataTable datatable =  (DataTable)dh.ExecuteSql("select cm_barcode,cm_sncode from CRAFTMATERIAL where cm_id = '" + LabelDataGridView.Rows[i].Cells["cm_id"].Value + "'","select");
+                    DataTable datatable = (DataTable)dh.ExecuteSql("select cm_barcode,cm_sncode from CRAFTMATERIAL where cm_id = '" + LabelDataGridView.Rows[i].Cells["cm_id"].Value + "'", "select");
                     LabelDataGridView.Rows[i].Cells["cm_barcode"].Value = datatable.Rows[0]["cm_barcode"].ToString();
                     LabelDataGridView.Rows[i].Cells["cm_sncode"].Value = datatable.Rows[0]["cm_sncode"].ToString();
                     string[] cm_sncodedetail = LabelDataGridView.Rows[i].Cells["cm_soncode"].Value.ToString().Split(',');
                     string pr_name = "";
                     foreach (string item in cm_sncodedetail)
                     {
-                        pr_name += "'"+item + "',";
+                        pr_name += "'" + item + "',";
                     }
                     pr_name = pr_name.TrimEnd(',');
                     LabelDataGridView.Rows[i].Cells["pr_detail_"].Value = dh.getFieldDataByCondition("product", "wm_concat(pr_detail)", "pr_code in (" + pr_name + ")");
@@ -211,12 +211,12 @@ namespace UAS_MES_NEW.Make
             {
                 if (LabelDataGridView.Rows[i].Cells["Choose"].Value != null)
                 {
-                    if ((Boolean)LabelDataGridView.Rows[i].Cells["Choose"].Value == true && change.Checked && (LabelDataGridView.Rows[i].Cells["mb_badcode"].Value == null || LabelDataGridView.Rows[i].Cells["New_BarCode"].Value == null)&& LabelDataGridView.Rows[i].Cells["cm_status"].Value.ToString() != "-1")
+                    if ((Boolean)LabelDataGridView.Rows[i].Cells["Choose"].Value == true && change.Checked && (LabelDataGridView.Rows[i].Cells["mb_badcode"].Value == null || LabelDataGridView.Rows[i].Cells["New_BarCode"].Value == null) && LabelDataGridView.Rows[i].Cells["cm_status"].Value.ToString() != "-1")
                     {
                         OperateResult.AppendText("第" + (i + 1) + "行没有采集不良代码或新批号\n", Color.Red);
                         return;
                     }
-                    if ((Boolean)LabelDataGridView.Rows[i].Cells["Choose"].Value == true && change.Checked &&  LabelDataGridView.Rows[i].Cells["New_BarCode"].Value == null && LabelDataGridView.Rows[i].Cells["cm_status"].Value.ToString() == "-1")
+                    if ((Boolean)LabelDataGridView.Rows[i].Cells["Choose"].Value == true && change.Checked && LabelDataGridView.Rows[i].Cells["New_BarCode"].Value == null && LabelDataGridView.Rows[i].Cells["cm_status"].Value.ToString() == "-1")
                     {
                         OperateResult.AppendText("第" + (i + 1) + "行没有采集新批号\n", Color.Red);
                         return;
@@ -260,13 +260,13 @@ namespace UAS_MES_NEW.Make
                             dtbar = new DataTable();
                             sql.Clear();
                             sql.Append("select max(sp_id)sp_id,max(sp_detno)sp_detno,min(sp_ifrepeat)sp_ifrepeat,sp_fsoncode,max(sp_barcoderule)");
-                            sql.Append("sp_barcoderule,sp_tracekind,wm_concat(sp_soncode) sp_soncode,max(sp_ifuseregex)sp_ifuseregex,max(sp_ifforsn)");
+                            sql.Append("sp_barcoderule, min(sp_checksalecode)sp_checksalecode,sp_tracekind,wm_concat(sp_soncode) sp_soncode,max(sp_ifuseregex)sp_ifuseregex,max(sp_ifforsn)");
                             sql.Append("sp_ifforsn,max(sp_length)sp_length,max(sp_type)sp_type,replace(wm_concat(sp_prefix),',','|')sp_prefix,max(sp_regex)");
                             sql.Append("sp_regex,max(pr_detail)pr_detail from stepproduct left join product on pr_code=sp_fsoncode where ");
                             sql.Append("sp_bomversion='" + ma_bomversion + "' and  sp_craftcode='" + LabelDataGridView.Rows[i].Cells["cm_craftcode"].Value + "'and sp_mothercode ='" + LabelDataGridView.Rows[i].Cells["cm_maprodcode"].Value + "'");
                             sql.Append(" group by sp_fsoncode,sp_tracekind  order by SP_DETNO asc");
                             dtbar = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
-                            DataRow[] dtrows =  dtbar.Select("sp_soncode like '"+ LabelDataGridView.Rows[i].Cells["cm_soncode"].Value + "'");
+                            DataRow[] dtrows = dtbar.Select("sp_soncode like '" + LabelDataGridView.Rows[i].Cells["cm_soncode"].Value + "'");
                             dtbar = BaseUtil.ToDataTable(dtrows);
                             if (dtbar.Rows.Count > 0)
                             {
@@ -278,21 +278,22 @@ namespace UAS_MES_NEW.Make
                                 string length = dtbar.Rows[0]["sp_length"].ToString();
                                 string sp_ifrepeat = dtbar.Rows[0]["sp_ifrepeat"].ToString();
                                 string sp_barcoderule = dtbar.Rows[0]["sp_barcoderule"].ToString();
+                                string sp_checksalecode = dtbar.Rows[0]["sp_checksalecode"].ToString();
                                 if (sp_tracekind == "1")
                                 {
                                     //上料校验规则判断
-                                    if (!LogicHandler.CheckSNBeforeLoad(LabelDataGridView.Rows[i].Cells["cm_makecode"].Value.ToString(), LabelDataGridView.Rows[i].Cells["New_BarCode"].Value.ToString(), sp_fsoncode, sp_soncode, sp_barcoderule, sp_prefix, length, sp_ifrepeat, out ErrorMessage))
+                                    if (!LogicHandler.CheckSNBeforeLoad(LabelDataGridView.Rows[i].Cells["cm_makecode"].Value.ToString(), LabelDataGridView.Rows[i].Cells["New_BarCode"].Value.ToString(), sp_fsoncode, sp_soncode, sp_barcoderule, sp_prefix, length, sp_ifrepeat, sp_checksalecode, out ErrorMessage))
                                     {
                                         OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red);
                                         LoadData(sncode_1, sender, new KeyEventArgs(Keys.Enter));
                                         continue;
                                     }
-                                    dh.UpdateByCondition("makeserial", "ms_nextmacode='" + LabelDataGridView.Rows[i].Cells["cm_makecode"].Value.ToString() + "'", "ms_id=(select max(ms_id) from makeserial where ms_sncode='" + LabelDataGridView.Rows[i].Cells["New_BarCode"].Value.ToString() + "')");                                  
+                                    dh.UpdateByCondition("makeserial", "ms_nextmacode='" + LabelDataGridView.Rows[i].Cells["cm_makecode"].Value.ToString() + "'", "ms_id=(select max(ms_id) from makeserial where ms_sncode='" + LabelDataGridView.Rows[i].Cells["New_BarCode"].Value.ToString() + "')");
                                 }
-                                else if(sp_tracekind == "2")
+                                else if (sp_tracekind == "2")
                                 {
                                     if (!dh.CheckExist("makesourcestock", " (MSS_FPRODCODE = '" + LabelDataGridView.Rows[i].Cells["cm_soncode"].Value.ToString() + "' or MSS_PRODCODE = '" + LabelDataGridView.Rows[i].Cells["cm_soncode"].Value.ToString() + "') and mss_barcode = '" + LabelDataGridView.Rows[i].Cells["New_BarCode"].Value.ToString() + "'"))
-                                    {   
+                                    {
                                         OperateResult.AppendText(">>物料" + LabelDataGridView.Rows[i].Cells["cm_soncode"].Value.ToString() + "岗位备料无条码" + LabelDataGridView.Rows[i].Cells["New_BarCode"].Value.ToString() + "\n", Color.Red);
                                         continue;
                                     }
@@ -316,7 +317,7 @@ namespace UAS_MES_NEW.Make
                                 }
                             }
                             else
-                            {                        
+                            {
                                 //当前备料信息不再工序BOM中,为BOM之外的批管控物料备料
                                 if (!dh.CheckExist("makesourcestock", " (MSS_FPRODCODE = '" + LabelDataGridView.Rows[i].Cells["cm_soncode"].Value.ToString() + "' or MSS_PRODCODE = '" + LabelDataGridView.Rows[i].Cells["cm_soncode"].Value.ToString() + "') and mss_barcode = '" + LabelDataGridView.Rows[i].Cells["New_BarCode"].Value.ToString() + "'"))
                                 {
@@ -374,13 +375,13 @@ namespace UAS_MES_NEW.Make
                                 }
                             }
 
-                                //此物料上线状态更新为-1,代表被拆解
-                                sql.Clear();
-                                sql.Append("update craftmaterial set cm_status=-1,cm_lastdeco=-1,cm_dropman='" + User.UserCode + "',");
-                                sql.Append("cm_dropdate =sysdate,cm_dropstep='" + User.CurrentStepCode + "',");
-                                sql.Append("cm_dropsccode='" + User.UserSourceCode + "' where cm_id='" + LabelDataGridView.Rows[i].Cells["cm_id"].Value + "'");
-                                dh.ExecuteSql(sql.GetString(), "update");
-                            
+                            //此物料上线状态更新为-1,代表被拆解
+                            sql.Clear();
+                            sql.Append("update craftmaterial set cm_status=-1,cm_lastdeco=-1,cm_dropman='" + User.UserCode + "',");
+                            sql.Append("cm_dropdate =sysdate,cm_dropstep='" + User.CurrentStepCode + "',");
+                            sql.Append("cm_dropsccode='" + User.UserSourceCode + "' where cm_id='" + LabelDataGridView.Rows[i].Cells["cm_id"].Value + "'");
+                            dh.ExecuteSql(sql.GetString(), "update");
+
 
                             ////将新批号绑定到序列号中
                             //dt = (DataTable)dh.ExecuteSql("select sp_id from stepproduct where sp_mothercode='" + LabelDataGridView.Rows[i].Cells["cm_maprodcode"].Value + "'", "select");
@@ -469,6 +470,6 @@ namespace UAS_MES_NEW.Make
 
         private void LabelDataGridView_Sorted(object sender, EventArgs e)
         {
-        } 
+        }
     }
 }

+ 3 - 2
UAS_MES_NEW/FunctionCode/Make/Make_FeedingCollection.cs

@@ -150,7 +150,8 @@ namespace UAS_MES_NEW.Make
                             string sp_ifforsn = dt1.Rows[RemainIndex]["sp_ifforsn"].ToString();
                             string sp_barcoderule = dt1.Rows[RemainIndex]["sp_barcoderule"].ToString();
                             string sp_checkbarcode = dt1.Rows[RemainIndex]["sp_checkbarcode"].ToString();
-                            if (LogicHandler.CheckSNBeforeLoad(ma_code.Text, code.Text, sp_fsoncode, sp_soncode, sp_barcoderule, sp_prefix, length, sp_ifrepeat, out ErrorMessage))
+                            string sp_checksalecode = dt1.Rows[RemainIndex]["sp_checksalecode"].ToString();
+                            if (LogicHandler.CheckSNBeforeLoad(ma_code.Text, code.Text, sp_fsoncode, sp_soncode, sp_barcoderule, sp_prefix, length, sp_ifrepeat, sp_checksalecode, out ErrorMessage))
                             {
                                 //判断采集的条码和本次采集的也不能重复
                                 if (CollectData.Contains(code.Text) && sp_ifrepeat != "-1")
@@ -357,7 +358,7 @@ namespace UAS_MES_NEW.Make
             //单独用一个DataTable存储一个
             dt1 = new DataTable();
             sql.Clear();
-            sql.Append("select max(sp_id)sp_id,max(sp_detno)sp_detno,min(sp_ifrepeat)sp_ifrepeat,max(sp_checkbarcode)sp_checkbarcode,");
+            sql.Append("select max(sp_id)sp_id,max(sp_detno)sp_detno,min(sp_ifrepeat)sp_ifrepeat,max(sp_checkbarcode)sp_checkbarcode,min(sp_checksalecode)sp_checksalecode,");
             sql.Append("sp_fsoncode,max(sp_barcoderule)sp_barcoderule,wm_concat(sp_soncode) sp_soncode,max(sp_ifuseregex)sp_ifuseregex,max(sp_ifforsn)");
             sql.Append("sp_ifforsn,max(sp_length)sp_length,max(sp_type)sp_type,replace(wm_concat(sp_prefix),',','|')sp_prefix,max(sp_regex)");
             sql.Append("sp_regex,max(pr_detail)pr_detail from stepproduct left join product on pr_code=sp_fsoncode where ");

+ 91 - 27
UAS_MES_NEW/FunctionCode/Make/Make_SeqProgramTransform.Designer.cs

@@ -46,15 +46,19 @@
             this.sn_code_label = new System.Windows.Forms.Label();
             this.ma_softversion = new System.Windows.Forms.Label();
             this.label2 = new System.Windows.Forms.Label();
+            this.SameReamrk = new System.Windows.Forms.CheckBox();
+            this.label1 = new System.Windows.Forms.Label();
+            this.IFONLY = new System.Windows.Forms.CheckBox();
             this.CollectRemark = new System.Windows.Forms.CheckBox();
-            this.Remark = new UAS_MES_NEW.CustomControl.RichText.RichTextAutoBottom();
+            this.Remark = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.EnterTextBox();
+            this.Seq_Remark_PreFix = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.SnCollectionBox();
+            this.OperateResult = new UAS_MES_NEW.CustomControl.RichText.RichTextAutoBottom();
             this.StepCount = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.SourceStepCount();
             this.ChangeResult = new UAS_MES_NEW.CustomControl.CustomCheckBox.CustomCheckBox();
             this.show_sncode = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.ma_prodcode = new UAS_MES_NEW.CustomControl.ValueLabel.ValueLabel();
             this.pr_detail = new UAS_MES_NEW.CustomControl.ValueLabel.ValueLabel();
             this.code = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.SnCollectionBox();
-            this.OperateResult = new UAS_MES_NEW.CustomControl.RichText.RichTextAutoBottom();
             this.SNPre = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.TSNPre = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.SNLength = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.NumOnlyTextBox();
@@ -262,28 +266,90 @@
             this.label2.TabIndex = 149;
             this.label2.Text = "软件版本";
             // 
+            // SameReamrk
+            // 
+            this.SameReamrk.AutoSize = true;
+            this.SameReamrk.Location = new System.Drawing.Point(446, 426);
+            this.SameReamrk.Name = "SameReamrk";
+            this.SameReamrk.Size = new System.Drawing.Size(96, 16);
+            this.SameReamrk.TabIndex = 218;
+            this.SameReamrk.Text = "固定录入备注";
+            this.SameReamrk.UseVisualStyleBackColor = true;
+            this.SameReamrk.CheckedChanged += new System.EventHandler(this.SameReamrk_CheckedChanged);
+            // 
+            // label1
+            // 
+            this.label1.AutoSize = true;
+            this.label1.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label1.Location = new System.Drawing.Point(353, 394);
+            this.label1.Name = "label1";
+            this.label1.Size = new System.Drawing.Size(37, 20);
+            this.label1.TabIndex = 217;
+            this.label1.Text = "前缀";
+            // 
+            // IFONLY
+            // 
+            this.IFONLY.AutoSize = true;
+            this.IFONLY.Location = new System.Drawing.Point(357, 426);
+            this.IFONLY.Name = "IFONLY";
+            this.IFONLY.Size = new System.Drawing.Size(84, 16);
+            this.IFONLY.TabIndex = 216;
+            this.IFONLY.Text = "不允许重复";
+            this.IFONLY.UseVisualStyleBackColor = true;
+            this.IFONLY.CheckedChanged += new System.EventHandler(this.IFONLY_CheckedChanged);
+            // 
             // CollectRemark
             // 
             this.CollectRemark.AutoSize = true;
-            this.CollectRemark.Checked = true;
-            this.CollectRemark.CheckState = System.Windows.Forms.CheckState.Checked;
-            this.CollectRemark.Font = new System.Drawing.Font("微软雅黑", 10F);
-            this.CollectRemark.Location = new System.Drawing.Point(362, 377);
+            this.CollectRemark.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.CollectRemark.Location = new System.Drawing.Point(548, 426);
             this.CollectRemark.Name = "CollectRemark";
-            this.CollectRemark.Size = new System.Drawing.Size(84, 24);
-            this.CollectRemark.TabIndex = 199;
+            this.CollectRemark.Size = new System.Drawing.Size(72, 16);
+            this.CollectRemark.TabIndex = 215;
             this.CollectRemark.Text = "采集备注";
             this.CollectRemark.UseVisualStyleBackColor = true;
+            this.CollectRemark.CheckedChanged += new System.EventHandler(this.CollectRemark_CheckedChanged);
             // 
             // Remark
             // 
-            this.Remark.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.Remark.Location = new System.Drawing.Point(446, 375);
-            this.Remark.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.Remark.AllPower = null;
+            this.Remark.BackColor = System.Drawing.Color.White;
+            this.Remark.ID = null;
+            this.Remark.Location = new System.Drawing.Point(446, 369);
+            this.Remark.Multiline = true;
             this.Remark.Name = "Remark";
-            this.Remark.Size = new System.Drawing.Size(191, 72);
-            this.Remark.TabIndex = 198;
-            this.Remark.Text = "";
+            this.Remark.Power = null;
+            this.Remark.Size = new System.Drawing.Size(159, 50);
+            this.Remark.Str = null;
+            this.Remark.Str1 = null;
+            this.Remark.Str2 = null;
+            this.Remark.TabIndex = 220;
+            this.Remark.KeyDown += new System.Windows.Forms.KeyEventHandler(this.Remark_KeyDown);
+            // 
+            // Seq_Remark_PreFix
+            // 
+            this.Seq_Remark_PreFix.AllPower = null;
+            this.Seq_Remark_PreFix.BackColor = System.Drawing.Color.White;
+            this.Seq_Remark_PreFix.ID = null;
+            this.Seq_Remark_PreFix.Location = new System.Drawing.Point(396, 393);
+            this.Seq_Remark_PreFix.Name = "Seq_Remark_PreFix";
+            this.Seq_Remark_PreFix.Power = null;
+            this.Seq_Remark_PreFix.Size = new System.Drawing.Size(44, 21);
+            this.Seq_Remark_PreFix.Str = null;
+            this.Seq_Remark_PreFix.Str1 = null;
+            this.Seq_Remark_PreFix.Str2 = null;
+            this.Seq_Remark_PreFix.TabIndex = 219;
+            this.Seq_Remark_PreFix.KeyDown += new System.Windows.Forms.KeyEventHandler(this.Seq_Remark_PreFix_KeyDown);
+            // 
+            // OperateResult
+            // 
+            this.OperateResult.Font = new System.Drawing.Font("微软雅黑", 15F);
+            this.OperateResult.Location = new System.Drawing.Point(23, 166);
+            this.OperateResult.Margin = new System.Windows.Forms.Padding(2, 1, 2, 1);
+            this.OperateResult.Name = "OperateResult";
+            this.OperateResult.Size = new System.Drawing.Size(770, 199);
+            this.OperateResult.TabIndex = 19;
+            this.OperateResult.Text = "";
             // 
             // StepCount
             // 
@@ -368,16 +434,6 @@
             this.code.TabIndex = 22;
             this.code.KeyDown += new System.Windows.Forms.KeyEventHandler(this.code_KeyDown);
             // 
-            // OperateResult
-            // 
-            this.OperateResult.Font = new System.Drawing.Font("微软雅黑", 15F);
-            this.OperateResult.Location = new System.Drawing.Point(23, 166);
-            this.OperateResult.Margin = new System.Windows.Forms.Padding(2, 1, 2, 1);
-            this.OperateResult.Name = "OperateResult";
-            this.OperateResult.Size = new System.Drawing.Size(770, 199);
-            this.OperateResult.TabIndex = 19;
-            this.OperateResult.Text = "";
-            // 
             // SNPre
             // 
             this.SNPre.AllPower = null;
@@ -449,8 +505,13 @@
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.ClientSize = new System.Drawing.Size(813, 454);
-            this.Controls.Add(this.CollectRemark);
             this.Controls.Add(this.Remark);
+            this.Controls.Add(this.Seq_Remark_PreFix);
+            this.Controls.Add(this.OperateResult);
+            this.Controls.Add(this.SameReamrk);
+            this.Controls.Add(this.label1);
+            this.Controls.Add(this.IFONLY);
+            this.Controls.Add(this.CollectRemark);
             this.Controls.Add(this.StepCount);
             this.Controls.Add(this.ma_softversion);
             this.Controls.Add(this.label2);
@@ -462,7 +523,6 @@
             this.Controls.Add(this.pr_detail);
             this.Controls.Add(this.code);
             this.Controls.Add(this.in_label);
-            this.Controls.Add(this.OperateResult);
             this.Controls.Add(this.tip);
             this.Controls.Add(this.SNPre);
             this.Controls.Add(this.TSNPre);
@@ -523,7 +583,11 @@
         private System.Windows.Forms.Label ma_softversion;
         private System.Windows.Forms.Label label2;
         private CustomControl.TextBoxWithIcon.SourceStepCount StepCount;
+        private System.Windows.Forms.CheckBox SameReamrk;
+        private System.Windows.Forms.Label label1;
+        private System.Windows.Forms.CheckBox IFONLY;
         private System.Windows.Forms.CheckBox CollectRemark;
-        private CustomControl.RichText.RichTextAutoBottom Remark;
+        private CustomControl.TextBoxWithIcon.SnCollectionBox Seq_Remark_PreFix;
+        private CustomControl.TextBoxWithIcon.EnterTextBox Remark;
     }
 }

+ 187 - 35
UAS_MES_NEW/FunctionCode/Make/Make_SeqProgramTransform.cs

@@ -54,7 +54,7 @@ namespace UAS_MES_NEW.Make
 
         string macOrBt = "";//存储去掉":"或者"-"的mac和bt
 
-        bool onlyPass = false;
+        bool onlyPass = false;//自己转自己
 
         string imeif = "";
 
@@ -78,6 +78,7 @@ namespace UAS_MES_NEW.Make
             StepCount.LineCode = User.UserLineCode;
             StepCount.Dh = dh;
             StepCount.Start();
+            Seq_Remark_PreFix.Text = BaseUtil.GetCacheData("Seq_Remark_PreFix").ToString();
         }
 
         private void code_KeyDown(object sender, KeyEventArgs e)
@@ -371,6 +372,46 @@ namespace UAS_MES_NEW.Make
         /// <param name="step"></param>
         private bool checkRules(int step)
         {
+            //说明已经是最后一个校验规则
+            if (step == ListA.Rows.Count + 1)
+            {
+                if (CollectRemark.Checked || SameReamrk.Checked)
+                {
+                    if (Remark.Text == "")
+                    {
+                        OperateResult.AppendText(">>备注栏信息为空,录入备注信息\n", Color.Black);
+                        Remark.SelectAll();
+                        Remark.Focus();
+                        return false;
+                    }
+                    if (IFONLY.Checked)
+                    {
+                        if (!CheckPre())
+                        {
+                            return false;
+                        }
+                        string UsedSncode = dh.getFieldDataByCondition("SNRELATIONINFORECORD", "SIR_SNCODE", "sir_remark = '" + Remark.Text + "'").ToString();
+                        if (UsedSncode != "")
+                        {
+                            OperateResult.AppendText(">>备注信息" + Remark.Text + "已被" + UsedSncode + "采集,不可重复采集\n", Color.Red);
+                            Remark.SelectAll();
+                            Remark.Focus();
+                            return false;
+                        }
+                        LogicHandler.CollectRemarkInf(show_sncode.Text, "", "", ms_macode.Text, ma_prodcode.Text, Remark.Text);
+                    }
+                    else if (SameReamrk.Checked)
+                    {
+                        if (!CheckPre())
+                        {
+                            return false;
+                        }
+                        LogicHandler.CollectRemarkInf(show_sncode.Text, "", "", ms_macode.Text, ma_prodcode.Text, Remark.Text);
+                    }
+                }
+                return SetStepResult();
+            }
+
             type = ListA.Rows[step - 2]["psr_type"].ToString();
             //将type中的mac和bt中的"-"和":"号去掉
             if (type == "MAC" || type == "BT")
@@ -439,7 +480,7 @@ namespace UAS_MES_NEW.Make
                 case "IMEI1":
                 case "IMEI2":
                 case "IMEI3":
-                    string tempSn = dh.getFieldDataByCondition("makeserial", "ms_sncode", "(ms_imei1='" + imeif + "' or ms_imei2 = '" + imeif + "' or ms_imei3 = '" + imeif + "') and  ms_status in (0,1,2,3)  and ms_id <> '" + oMsid + "'  and nvl(ms_nextmacode,' ')=' '").ToString();
+                    string tempSn = dh.getFieldDataByCondition("makeserial", "ms_sncode", "(ms_imei1='" + imeif + "' or ms_imei2 = '" + imeif + "' or ms_imei3 = '" + imeif + "') and  ms_status in (0,1,2,3)  and ms_id <> '" + oMsid + "' and nvl(ms_nextmacode,' ')=' '").ToString();
                     if (tempSn != "")
                     {
                         OperateResult.AppendText("<<" + type + ":" + imeif + "错误,已被序列号" + tempSn + "使用\n", Color.Red);
@@ -481,16 +522,16 @@ namespace UAS_MES_NEW.Make
                         foreach (DictionaryEntry de in hs)
                         {
                             //拿到重复的项
-                            if (de.Value.ToString()==macOrBt)
+                            if (de.Value.ToString() == macOrBt)
                             {
-                                OperateResult.AppendText("<<" + ListA.Rows[step - 2]["psr_type"].ToString() + ":" + code.Text + "错误," + de.Key+ "已录\n", Color.Red);
+                                OperateResult.AppendText("<<" + ListA.Rows[step - 2]["psr_type"].ToString() + ":" + code.Text + "错误," + de.Key + "已录\n", Color.Red);
                                 OperateResult.AppendText(">>请输入" + ListA.Rows[step - 2]["psr_type"].ToString() + "\n", Color.Black, code);
                                 return false;
                             }
                         }
                     }
                     //验证是否已被使用
-                    string temSn = dh.getFieldDataByCondition("makeserial", "ms_sncode", "MS_" + type + "='" + macOrBt + "' and  ms_status in (0,1,2,3) and ms_id <> '" + oMsid + "'  and nvl(ms_nextmacode,' ')=' '").ToString();
+                    string temSn = dh.getFieldDataByCondition("makeserial", "ms_sncode", "(MS_mac='" + macOrBt + "'or ms_bt='" + macOrBt + "') and  ms_status in (0,1,2,3) and ms_id <> '" + oMsid + "' and nvl(ms_nextmacode,' ')=' '").ToString();
                     if (temSn != "")
                     {
                         OperateResult.AppendText("<<" + ListA.Rows[step - 2]["psr_type"].ToString() + ":" + code.Text + "错误,已被序列号" + temSn + "使用\n", Color.Red);
@@ -500,7 +541,7 @@ namespace UAS_MES_NEW.Make
                     else
                     {
                         //校验在sninfo表中是否存在
-                        temSn = dh.getFieldDataByCondition("sninfo", "si_sn", "si_" + type + "='" + macOrBt + "' and si_id <>'" + siid + "'").ToString();
+                        temSn = dh.getFieldDataByCondition("sninfo", "si_sn", "(si_mac='" + macOrBt + "' or si_bt='" + macOrBt + "') and si_id <>'" + siid + "'").ToString();
                         if (temSn != "")
                         {
                             OperateResult.AppendText("<<" + ListA.Rows[step - 2]["psr_type"].ToString() + ":" + code.Text + "错误,已被序列号" + temSn + "使用\n", Color.Red);
@@ -525,7 +566,7 @@ namespace UAS_MES_NEW.Make
                         }
                     }
                     //校验网标是否存在
-                    string teSn = dh.getFieldDataByCondition("makeserial", "ms_sncode", "MS_" + type + "='" + imeif + "' and  ms_status in (0,1,2,3) and ms_id <> '" + oMsid + "'  and nvl(ms_nextmacode,' ')=' '").ToString();
+                    string teSn = dh.getFieldDataByCondition("makeserial", "ms_sncode", "MS_" + type + "='" + imeif + "' and  ms_status in (0,1,2,3) and ms_id <> '" + oMsid + "' and nvl(ms_nextmacode,' ')=' '").ToString();
                     if (teSn != "")
                     {
                         OperateResult.AppendText("<<" + ListA.Rows[step - 2]["psr_type"].ToString() + ":" + imeif + "错误,已被序列号" + teSn + "使用\n", Color.Red);
@@ -557,47 +598,105 @@ namespace UAS_MES_NEW.Make
             //说明已经是最后一个校验规则
             if (step == ListA.Rows.Count + 1)
             {
-                //通过存储过程二次校验
-                if (LogicHandler.snChangeAndBurn(TSN, SN, User.UserSourceCode, User.UserCode, ms_macode.Text, ChangeResult.Checked ? 1 : 0, (hs.ContainsKey("IMEI1") ? hs["IMEI1"].ToString() : ""), (hs.ContainsKey("IMEI2") ? hs["IMEI2"].ToString() : ""), (hs.ContainsKey("IMEI3") ? hs["IMEI3"].ToString() : ""), "", (hs.ContainsKey("NETCODE") ? hs["NETCODE"].ToString() : ""), "", "", "", "", (hs.ContainsKey("MAC") ? hs["MAC"].ToString() : ""), (hs.ContainsKey("BT") ? hs["BT"].ToString() : ""), "", "", "", out errorMessage))
+                if (CollectRemark.Checked || SameReamrk.Checked)
                 {
-                    OperateResult.AppendText("<<序列号" + TSN + "成功转换为" + SN + "\n<<关联采集成功\n", Color.Green);
-                    //写入日志
-                    LogManager.DoLog("修改序列号:" + TSN + "为" + SN + "成功!" + "操作人:" + User.UserCode);
-                    //记录日志
-                    LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, ms_macode.Text, User.UserLineCode, User.UserSourceCode, "序列烧录转换", TSN + "转换为" + SN, SN, "");
-                    //获取剩余数,刷新页面
-                    sql.Clear();
-                    sql.Append("select mcd_inqty from makecraftdetail where mcd_macode='" + ms_macode.Text + "' and mcd_stepcode='" + User.CurrentStepCode + "'");
-                    dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
-                    if (dt.Rows.Count > 0)
+                    if (Remark.Text == "")
                     {
-                        remain_qty.Text = ma_qty - int.Parse(dt.Rows[0]["mcd_inqty"].ToString()) + "";
+                        OperateResult.AppendText(">>备注栏信息为空,录入备注信息\n", Color.Black);
+                        Remark.SelectAll();
+                        Remark.Focus();
+                        return false;
+                    }
+                    if (IFONLY.Checked)
+                    {
+                        if (!CheckPre())
+                        {
+                            return false;
+                        }
+                        string UsedSncode = dh.getFieldDataByCondition("SNRELATIONINFORECORD", "SIR_SNCODE", "sir_remark = '" + Remark.Text + "'").ToString();
+                        if (UsedSncode != "")
+                        {
+                            OperateResult.AppendText(">>备注信息" + Remark.Text + "已被" + UsedSncode + "采集,不可重复采集\n", Color.Red);
+                            Remark.SelectAll();
+                            Remark.Focus();
+                            return false;
+                        }
+                        LogicHandler.CollectRemarkInf(show_sncode.Text, "", "", ms_macode.Text, ma_prodcode.Text, Remark.Text);
                     }
-                    if (CollectRemark.Checked && Remark.Text != "")
+                    else if (SameReamrk.Checked)
                     {
-                        LogicHandler.CollectRemarkInf(SN, "", "", ms_macode.Text, ma_prodcode.Text, Remark.Text);
+                        if (!CheckPre())
+                        {
+                            return false;
+                        }
+                        LogicHandler.CollectRemarkInf(show_sncode.Text, "", "", ms_macode.Text, ma_prodcode.Text, Remark.Text);
                     }
-                    //更新页面计数+1
-                    count.Text = int.Parse(count.Text) + 1 + "";
-                    //完成之后,清除信息
-                    clearInfo();
-                    OperateResult.AppendText(">>请输入TSN号\n", Color.Black);
                 }
-                else
+                return SetStepResult();
+            }
+            else
+            {
+                OperateResult.AppendText(">>请输入" + ListA.Rows[step - 1]["psr_type"] + "\n", Color.Green, code);
+                return true;
+            }
+        }
+
+        //校验备注前缀
+        private Boolean CheckPre()
+        {
+            try
+            {
+                if (Remark.Text.Substring(0, Seq_Remark_PreFix.Text.Length) != Seq_Remark_PreFix.Text)
                 {
-                    OperateResult.AppendText(">>" + errorMessage + "\n", Color.Red, code);
-                    OperateResult.AppendText(">>请重新输入TSN\n", Color.Black, code);
-                    //    //清空信息
-                    clearInfo();
+                    OperateResult.AppendText(">>备注前缀不匹配,请重新输入备注信息\n", Color.Red);
+                    Remark.SelectAll();
+                    Remark.Focus();
+                    return false;
                 }
-                code.Text = "";
+            }
+            catch (Exception)
+            {
+                OperateResult.AppendText(">>备注前缀不匹配,请重新输入备注信息\n", Color.Red);
+                Remark.SelectAll();
+                Remark.Focus();
                 return false;
             }
+            return true;
+        }
+
+        //通过存储过程二次校验
+        private Boolean SetStepResult()
+        {
+            if (LogicHandler.snChangeAndBurn(TSN, SN, User.UserSourceCode, User.UserCode, ms_macode.Text, ChangeResult.Checked ? 1 : 0, (hs.ContainsKey("IMEI1") ? hs["IMEI1"].ToString() : ""), (hs.ContainsKey("IMEI2") ? hs["IMEI2"].ToString() : ""), (hs.ContainsKey("IMEI3") ? hs["IMEI3"].ToString() : ""), "", (hs.ContainsKey("NETCODE") ? hs["NETCODE"].ToString() : ""), "", "", "", "", (hs.ContainsKey("MAC") ? hs["MAC"].ToString() : ""), (hs.ContainsKey("BT") ? hs["BT"].ToString() : ""), "", "", "", out errorMessage))
+            {
+                OperateResult.AppendText("<<序列号" + TSN + "成功转换为" + SN + "\n<<关联采集成功\n", Color.Green);
+                //写入日志
+                LogManager.DoLog("修改序列号:" + TSN + "为" + SN + "成功!" + "操作人:" + User.UserCode);
+                //记录日志
+                LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, ms_macode.Text, User.UserLineCode, User.UserSourceCode, "序列烧录转换", TSN + "转换为" + SN, SN, "");
+                //获取剩余数,刷新页面
+                sql.Clear();
+                sql.Append("select mcd_inqty from makecraftdetail where mcd_macode='" + ms_macode.Text + "' and mcd_stepcode='" + User.CurrentStepCode + "'");
+                dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
+                if (dt.Rows.Count > 0)
+                {
+                    remain_qty.Text = ma_qty - int.Parse(dt.Rows[0]["mcd_inqty"].ToString()) + "";
+                }
+                //更新页面计数+1
+                count.Text = int.Parse(count.Text) + 1 + "";
+                //完成之后,清除信息
+                clearInfo();
+                OperateResult.AppendText(">>请输入TSN号\n", Color.Black);
+            }
             else
             {
-                OperateResult.AppendText(">>请输入" + ListA.Rows[step - 1]["psr_type"] + "\n", Color.Green, code);
-                return true;
+                OperateResult.AppendText(">>" + errorMessage + "\n", Color.Red, code);
+                OperateResult.AppendText(">>请重新输入TSN\n", Color.Black, code);
+                //    //清空信息
+                clearInfo();
             }
+            code.Text = "";
+            return false;
         }
         /// <summary>
         /// 工单号变化时,带出校验规则
@@ -717,5 +816,58 @@ namespace UAS_MES_NEW.Make
         {
             asc.controlAutoSize(this);
         }
+
+        private void Seq_Remark_PreFix_KeyDown(object sender, KeyEventArgs e)
+        {
+            if (e.KeyCode == Keys.Enter)
+            {
+                BaseUtil.SetCacheData("Seq_Remark_PreFix", Seq_Remark_PreFix.Text);
+                if (CollectRemark.Checked || SameReamrk.Checked)
+                {
+                    Remark.SelectAll();
+                    Remark.Focus();
+                }
+            }
+        }
+
+        private void Remark_KeyDown(object sender, KeyEventArgs e)
+        {
+            if (e.KeyCode == Keys.Enter)
+            {
+                if (step == ListA.Rows.Count + 1 && (CollectRemark.Checked || SameReamrk.Checked) && Remark.Text != "")
+                {
+                    code.Text = Remark.Text;
+                    code.Focus();
+                    code_KeyDown(this, new KeyEventArgs(Keys.Enter));
+                }
+                else
+                    code.Focus();
+            }
+        }
+
+        private void IFONLY_CheckedChanged(object sender, EventArgs e)
+        {
+            if (IFONLY.Checked)
+            {
+                SameReamrk.Checked = false;
+                CollectRemark.Checked = true;
+            }
+        }
+
+        private void SameReamrk_CheckedChanged(object sender, EventArgs e)
+        {
+            if (SameReamrk.Checked)
+            {
+                IFONLY.Checked = false;
+                CollectRemark.Checked = false;
+            }
+        }
+
+        private void CollectRemark_CheckedChanged(object sender, EventArgs e)
+        {
+            if (CollectRemark.Checked) {
+                SameReamrk.Checked = false;
+            }
+        }
     }
 }

+ 85 - 21
UAS_MES_NEW/FunctionCode/Make/Make_SeqTransform.Designer.cs

@@ -57,8 +57,12 @@
             this.beforeTransSNPre = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.OperateResult = new UAS_MES_NEW.CustomControl.RichText.RichTextAutoBottom();
             this.sncode = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.SnCollectionBox();
+            this.Remark = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.EnterTextBox();
+            this.Seq_Remark_PreFix = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.SnCollectionBox();
+            this.SameReamrk = new System.Windows.Forms.CheckBox();
+            this.label3 = new System.Windows.Forms.Label();
+            this.IFONLY = new System.Windows.Forms.CheckBox();
             this.CollectRemark = new System.Windows.Forms.CheckBox();
-            this.Remark = new UAS_MES_NEW.CustomControl.RichText.RichTextAutoBottom();
             ((System.ComponentModel.ISupportInitialize)(this.ClearSn_code)).BeginInit();
             this.SuspendLayout();
             // 
@@ -175,7 +179,7 @@
             // 
             this.changenum.AutoSize = true;
             this.changenum.Font = new System.Drawing.Font("微软雅黑", 12F);
-            this.changenum.Location = new System.Drawing.Point(729, 427);
+            this.changenum.Location = new System.Drawing.Point(751, 427);
             this.changenum.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
             this.changenum.Name = "changenum";
             this.changenum.Size = new System.Drawing.Size(19, 21);
@@ -197,7 +201,7 @@
             // 
             this.PrintNum_label.AutoSize = true;
             this.PrintNum_label.Font = new System.Drawing.Font("微软雅黑", 12F);
-            this.PrintNum_label.Location = new System.Drawing.Point(655, 427);
+            this.PrintNum_label.Location = new System.Drawing.Point(677, 427);
             this.PrintNum_label.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
             this.PrintNum_label.Name = "PrintNum_label";
             this.PrintNum_label.Size = new System.Drawing.Size(42, 21);
@@ -401,36 +405,92 @@
             this.sncode.Tag = "IfRead";
             this.sncode.KeyDown += new System.Windows.Forms.KeyEventHandler(this.sncode_KeyDown);
             // 
+            // Remark
+            // 
+            this.Remark.AllPower = null;
+            this.Remark.BackColor = System.Drawing.Color.White;
+            this.Remark.ID = null;
+            this.Remark.Location = new System.Drawing.Point(464, 384);
+            this.Remark.Multiline = true;
+            this.Remark.Name = "Remark";
+            this.Remark.Power = null;
+            this.Remark.Size = new System.Drawing.Size(159, 50);
+            this.Remark.Str = null;
+            this.Remark.Str1 = null;
+            this.Remark.Str2 = null;
+            this.Remark.TabIndex = 226;
+            this.Remark.KeyDown += new System.Windows.Forms.KeyEventHandler(this.Remark_KeyDown);
+            // 
+            // Seq_Remark_PreFix
+            // 
+            this.Seq_Remark_PreFix.AllPower = null;
+            this.Seq_Remark_PreFix.BackColor = System.Drawing.Color.White;
+            this.Seq_Remark_PreFix.ID = null;
+            this.Seq_Remark_PreFix.Location = new System.Drawing.Point(414, 408);
+            this.Seq_Remark_PreFix.Name = "Seq_Remark_PreFix";
+            this.Seq_Remark_PreFix.Power = null;
+            this.Seq_Remark_PreFix.Size = new System.Drawing.Size(44, 21);
+            this.Seq_Remark_PreFix.Str = null;
+            this.Seq_Remark_PreFix.Str1 = null;
+            this.Seq_Remark_PreFix.Str2 = null;
+            this.Seq_Remark_PreFix.TabIndex = 225;
+            this.Seq_Remark_PreFix.KeyDown += new System.Windows.Forms.KeyEventHandler(this.Seq_Remark_PreFix_KeyDown);
+            // 
+            // SameReamrk
+            // 
+            this.SameReamrk.AutoSize = true;
+            this.SameReamrk.Location = new System.Drawing.Point(464, 440);
+            this.SameReamrk.Name = "SameReamrk";
+            this.SameReamrk.Size = new System.Drawing.Size(96, 16);
+            this.SameReamrk.TabIndex = 224;
+            this.SameReamrk.Text = "固定录入备注";
+            this.SameReamrk.UseVisualStyleBackColor = true;
+            this.SameReamrk.CheckedChanged += new System.EventHandler(this.SameReamrk_CheckedChanged);
+            // 
+            // label3
+            // 
+            this.label3.AutoSize = true;
+            this.label3.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label3.Location = new System.Drawing.Point(371, 409);
+            this.label3.Name = "label3";
+            this.label3.Size = new System.Drawing.Size(37, 20);
+            this.label3.TabIndex = 223;
+            this.label3.Text = "前缀";
+            // 
+            // IFONLY
+            // 
+            this.IFONLY.AutoSize = true;
+            this.IFONLY.Location = new System.Drawing.Point(374, 440);
+            this.IFONLY.Name = "IFONLY";
+            this.IFONLY.Size = new System.Drawing.Size(84, 16);
+            this.IFONLY.TabIndex = 222;
+            this.IFONLY.Text = "不允许重复";
+            this.IFONLY.UseVisualStyleBackColor = true;
+            this.IFONLY.CheckedChanged += new System.EventHandler(this.IFONLY_CheckedChanged);
+            // 
             // CollectRemark
             // 
             this.CollectRemark.AutoSize = true;
-            this.CollectRemark.Checked = true;
-            this.CollectRemark.CheckState = System.Windows.Forms.CheckState.Checked;
-            this.CollectRemark.Font = new System.Drawing.Font("微软雅黑", 10F);
-            this.CollectRemark.Location = new System.Drawing.Point(367, 389);
+            this.CollectRemark.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.CollectRemark.Location = new System.Drawing.Point(566, 440);
             this.CollectRemark.Name = "CollectRemark";
-            this.CollectRemark.Size = new System.Drawing.Size(84, 24);
-            this.CollectRemark.TabIndex = 201;
+            this.CollectRemark.Size = new System.Drawing.Size(72, 16);
+            this.CollectRemark.TabIndex = 221;
             this.CollectRemark.Text = "采集备注";
             this.CollectRemark.UseVisualStyleBackColor = true;
-            // 
-            // Remark
-            // 
-            this.Remark.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.Remark.Location = new System.Drawing.Point(450, 387);
-            this.Remark.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
-            this.Remark.Name = "Remark";
-            this.Remark.Size = new System.Drawing.Size(191, 72);
-            this.Remark.TabIndex = 200;
-            this.Remark.Text = "";
+            this.CollectRemark.CheckedChanged += new System.EventHandler(this.CollectRemark_CheckedChanged);
             // 
             // Make_SeqTransform
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.ClientSize = new System.Drawing.Size(849, 467);
-            this.Controls.Add(this.CollectRemark);
             this.Controls.Add(this.Remark);
+            this.Controls.Add(this.Seq_Remark_PreFix);
+            this.Controls.Add(this.SameReamrk);
+            this.Controls.Add(this.label3);
+            this.Controls.Add(this.IFONLY);
+            this.Controls.Add(this.CollectRemark);
             this.Controls.Add(this.StepCount);
             this.Controls.Add(this.ma_softversion);
             this.Controls.Add(this.label2);
@@ -502,7 +562,11 @@
         private System.Windows.Forms.Label label2;
         private System.Windows.Forms.Label ma_softversion;
         private CustomControl.TextBoxWithIcon.SourceStepCount StepCount;
+        private CustomControl.TextBoxWithIcon.EnterTextBox Remark;
+        private CustomControl.TextBoxWithIcon.SnCollectionBox Seq_Remark_PreFix;
+        private System.Windows.Forms.CheckBox SameReamrk;
+        private System.Windows.Forms.Label label3;
+        private System.Windows.Forms.CheckBox IFONLY;
         private System.Windows.Forms.CheckBox CollectRemark;
-        private CustomControl.RichText.RichTextAutoBottom Remark;
     }
 }

+ 117 - 4
UAS_MES_NEW/FunctionCode/Make/Make_SeqTransform.cs

@@ -219,6 +219,41 @@ namespace UAS_MES_NEW.Make
                             //防呆验证完成
                             if ((!ChangeResult.Checked && (!dh.CheckExist("makeserial", "ms_sncode='" + sncode.Text + "' and ms_id <>'" + oMsId + "' and nvl(ms_nextmacode,' ') =' '") && !onlyPass || onlyPass && bsncode == sncode.Text)) || (ChangeResult.Checked && !dh.CheckExist("makeserial", "ms_sncode='" + sncode.Text + "' and ms_id <>'" + oMsId + "' and nvl(ms_nextmacode,' ') =' '")))
                             {
+                                if (CollectRemark.Checked || SameReamrk.Checked)
+                                {
+                                    if (Remark.Text == "")
+                                    {
+                                        OperateResult.AppendText(">>备注栏信息为空,录入备注信息\n", Color.Black);
+                                        Remark.SelectAll();
+                                        Remark.Focus();
+                                        return;
+                                    }
+                                    if (IFONLY.Checked)
+                                    {
+                                        if (!CheckPre())
+                                        {
+                                            return;
+                                        }
+                                        string UsedSncode = dh.getFieldDataByCondition("SNRELATIONINFORECORD", "SIR_SNCODE", "sir_remark = '" + Remark.Text + "'").ToString();
+                                        if (UsedSncode != "")
+                                        {
+                                            OperateResult.AppendText(">>备注信息" + Remark.Text + "已被" + UsedSncode + "采集,不可重复采集\n", Color.Red);
+                                            Remark.SelectAll();
+                                            Remark.Focus();
+                                            return;
+                                        }
+                                        LogicHandler.CollectRemarkInf(show_sncode.Text, "", "", oMakeCode, ma_prodcode.Text, Remark.Text);
+                                    }
+                                    else if (SameReamrk.Checked)
+                                    {
+                                        if (!CheckPre())
+                                        {
+                                            return;
+                                        }
+                                        LogicHandler.CollectRemarkInf(show_sncode.Text, "", "", oMakeCode, ma_prodcode.Text, Remark.Text);
+                                    }
+                                }
+
                                 if (!ChangeResult.Checked && !onlyPass || bsncode != sncode.Text)
                                 {
                                     string firstsn = "";
@@ -248,10 +283,10 @@ namespace UAS_MES_NEW.Make
                                 OperateResult.AppendText("<<序列号" + bsncode + "成功转换为" + sncode.Text + "\n", Color.Green);
                                 //记录日志
                                 LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, ma_code.Text, User.UserLineCode, User.UserSourceCode, "序列转换", bsncode + "转换为" + sncode.Text, sncode.Text, "");
-                                if (CollectRemark.Checked && Remark.Text != "")
-                                {
-                                    LogicHandler.CollectRemarkInf(sncode.Text, "", "", oMakeCode, ma_prodcode.Text, Remark.Text);
-                                }
+                                //if (CollectRemark.Checked && Remark.Text != "")
+                                //{
+                                //    LogicHandler.CollectRemarkInf(sncode.Text, "", "", oMakeCode, ma_prodcode.Text, Remark.Text);
+                                //}
                                 LogManager.DoLog("修改序列号:" + bsncode + "为" + sncode.Text + "成功!" + "操作人:" + User.UserCode);
                                 //写入日志
                                 if (!LogicHandler.SetStepResult(ma_code.Text, User.UserSourceCode, sncode.Text, "序列转换", "序列转换成功", User.UserCode, out errorMessage))
@@ -466,11 +501,89 @@ namespace UAS_MES_NEW.Make
             StepCount.LineCode = User.UserLineCode;
             StepCount.Dh = dh;
             StepCount.Start();
+            Seq_Remark_PreFix.Text = BaseUtil.GetCacheData("Seq_Remark_PreFix").ToString();
         }
 
         private void Make_SeqTransform_SizeChanged(object sender, EventArgs e)
         {
             asc.controlAutoSize(this);
         }
+
+        private void Remark_KeyDown(object sender, KeyEventArgs e)
+        {
+            if (e.KeyCode == Keys.Enter)
+            {
+                if ((CollectRemark.Checked || SameReamrk.Checked) && Remark.Text != "")
+                {
+                    sncode.Focus();
+                    sncode_KeyDown(this, new KeyEventArgs(Keys.Enter));
+                }
+                else
+                    sncode.Focus();
+            }
+        }
+
+        private void IFONLY_CheckedChanged(object sender, EventArgs e)
+        {
+            if (IFONLY.Checked)
+            {
+                SameReamrk.Checked = false;
+                CollectRemark.Checked = true;
+            }
+        }
+
+        private void SameReamrk_CheckedChanged(object sender, EventArgs e)
+        {
+            if (SameReamrk.Checked)
+            {
+                IFONLY.Checked = false;
+                CollectRemark.Checked = false;
+            }
+        }
+
+        private void Seq_Remark_PreFix_KeyDown(object sender, KeyEventArgs e)
+        {
+            if (e.KeyCode == Keys.Enter)
+            {
+                BaseUtil.SetCacheData("Seq_Remark_PreFix", Seq_Remark_PreFix.Text);
+                if (CollectRemark.Checked || SameReamrk.Checked)
+                {
+                    Remark.SelectAll();
+                    Remark.Focus();
+                }
+            }
+        }
+
+
+        //校验备注前缀
+        private Boolean CheckPre()
+        {
+            try
+            {
+                if (Remark.Text.Substring(0, Seq_Remark_PreFix.Text.Length) != Seq_Remark_PreFix.Text)
+                {
+                    OperateResult.AppendText(">>备注前缀不匹配,请重新输入备注信息\n", Color.Red);
+                    Remark.SelectAll();
+                    Remark.Focus();
+                    return false;
+                }
+            }
+            catch (Exception)
+            {
+                OperateResult.AppendText(">>备注前缀不匹配,请重新输入备注信息\n", Color.Red);
+                Remark.SelectAll();
+                Remark.Focus();
+                return false;
+            }
+            return true;
+        }
+
+        private void CollectRemark_CheckedChanged(object sender, EventArgs e)
+        {
+            if (CollectRemark.Checked)
+            {
+                SameReamrk.Checked = false;
+            }
+        }
     }
 }