Просмотр исходного кода

Merge branch 'master' of ssh://10.10.100.21/source/mes-client

章政 8 лет назад
Родитель
Сommit
00ded55233

+ 42 - 48
UAS-MES/FunctionCode/Make/Make_CollectBTMAC.cs

@@ -139,38 +139,35 @@ namespace UAS_MES.Make
                         string result = "";
                         sql.Clear();
                         string checkbt = sncode.Text.Replace(":", "").Replace("-", "");
-                        sql.Append("select mal_bt from MakeAddressList where mal_makecode = '" + ms_makecode.Text + "'");
-                        dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
-                        if (dt.Rows.Count > 0)
+                        if (dh.CheckExist("MakeAddressList", "mal_makecode = '" + ms_makecode.Text + "'"))
                         {
-                            Boolean isbt = false;
-                            for (int i = 0; i < dt.Rows.Count; i++)
-                            {
-                                if (dt.Rows[i][0].ToString() == checkbt)
-                                {
-                                    isbt = true;
-                                }
-                            }
-                            if (!isbt)
+                            sql.Append("select mal_bt from MakeAddressList where mal_bt = '" + checkbt + "' and mal_makecode = '" + ms_makecode.Text + "'");
+                            dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
+                            if (!(dt.Rows.Count > 0))
                             {
-                                OperateResult.AppendText(">>BT号"+ checkbt + "不符合工单导入要求\n", Color.Red, sncode);
+                                OperateResult.AppendText(">>BT号" + checkbt + "不符合工单导入要求\n", Color.Red,sncode);
                                 return;
                             }
                         }
                         else
                         {
-                            //根据工单号获取销售单号
-                            sale_code = dh.getFieldDataByCondition("make", "ma_salecode", "ma_code = '" + ms_makecode.Text + "'").ToString();
-                            sql.Clear();
-                            sql.Append("select sr_startcode,sr_endcode from SaleMacBTRange where sr_sacode = '" + sale_code + "' and sr_type = 'BT'");
-                            dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
-                            if (dt.Rows.Count > 0)
+                            ////根据工单号获取销售单号
+                            //sale_code = dh.getFieldDataByCondition("make", "ma_salecode", "ma_code = '" + ms_makecode.Text + "'").ToString();
+                            //sql.Clear();
+                            //sql.Append("select sr_startcode,sr_endcode from SaleMacBTRange where sr_sacode = '" + sale_code + "' and sr_type = 'BT'");
+                            //dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
+                            //if (dt.Rows.Count > 0)
+                            //{
+                            //    if (!(dt.Rows[0]["sr_startcode"].ToString().Replace(":", "").Replace("-", "").CompareTo(checkbt) <= 0 && dt.Rows[0]["sr_endcode"].ToString().Replace(":", "").Replace("-", "").CompareTo(checkbt) >= 0))
+                            //    {
+                            //        OperateResult.AppendText(">>BT号" + checkbt + "不符合销售单合同范围\n", Color.Red, sncode);
+                            //        return;
+                            //    }
+                            //}
+                            if (!LogicHandler.checkMacOrBtRange(oMsID, checkbt, "BT"))
                             {
-                                if (!(dt.Rows[0]["sr_startcode"].ToString().Replace(":", "").Replace("-", "").CompareTo(checkbt) <= 0 && dt.Rows[0]["sr_endcode"].ToString().Replace(":", "").Replace("-", "").CompareTo(checkbt) >= 0))
-                                {
-                                    OperateResult.AppendText(">>BT号"+ checkbt + "不符合销售单合同范围\n", Color.Red, sncode);
-                                    return;
-                                }
+                                OperateResult.AppendText(">>BT号" + checkbt + "不符合销售单合同范围\n", Color.Red, sncode);
+                                return;
                             }
                         }
                         //根据序列号获取此时BT号
@@ -217,38 +214,35 @@ namespace UAS_MES.Make
                     string result = "";
                     sql.Clear();
                     string checkmac = sncode.Text.Replace(":", "").Replace("-", "");
-                    sql.Append("select mal_mac from MakeAddressList where mal_makecode = '" + ms_makecode.Text + "'");
-                    dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
-                    if (dt.Rows.Count > 0)
+                    if (dh.CheckExist("MakeAddressList", "mal_makecode = '" + ms_makecode.Text + "'"))
                     {
-                        Boolean ismac = false;
-                        for (int i = 0; i < dt.Rows.Count; i++)
-                        {
-                            if (dt.Rows[i][0].ToString() == checkmac)
-                            {
-                                ismac = true;
-                            }
-                        }
-                        if (!ismac)
+                        sql.Append("select mal_mac from MakeAddressList where mal_mac = '" + checkmac + "' and mal_makecode = '" + ms_makecode.Text + "'");
+                        dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
+                        if (!(dt.Rows.Count > 0))
                         {
-                            OperateResult.AppendText(">>MAC号"+ checkmac + "不符合工单导入要求\n", Color.Red, sncode);
+                            OperateResult.AppendText(">>MAC号" + checkmac + "不符合工单导入要求\n", Color.Red, sncode);
                             return;
                         }
                     }
                     else
                     {
-                        //根据工单号获取销售单号
-                        sale_code = dh.getFieldDataByCondition("make", "ma_salecode", "ma_code = '" + ms_makecode.Text + "'").ToString();
-                        sql.Clear();
-                        sql.Append("select sr_startcode,sr_endcode from SaleMacBTRange where sr_sacode = '" + sale_code + "' and sr_type = 'MAC'");
-                        dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
-                        if (dt.Rows.Count > 0)
+                        ////根据工单号获取销售单号
+                        //sale_code = dh.getFieldDataByCondition("make", "ma_salecode", "ma_code = '" + ms_makecode.Text + "'").ToString();
+                        //sql.Clear();
+                        //sql.Append("select sr_startcode,sr_endcode from SaleMacBTRange where sr_sacode = '" + sale_code + "' and sr_type = 'MAC'");
+                        //dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
+                        //if (dt.Rows.Count > 0)
+                        //{
+                        //    if (!(dt.Rows[0]["sr_startcode"].ToString().Replace(":", "").Replace("-", "").CompareTo(checkmac) <= 0 && dt.Rows[0]["sr_endcode"].ToString().Replace(":", "").Replace("-", "").CompareTo(checkmac) >= 0))
+                        //    {
+                        //        OperateResult.AppendText(">>MAC号" + checkmac + "不符合销售单合同范围\n", Color.Red, sncode);
+                        //        return;
+                        //    }
+                        //}
+                        if (!LogicHandler.checkMacOrBtRange(oMsID, checkmac, "MAC"))
                         {
-                            if (!(dt.Rows[0]["sr_startcode"].ToString().Replace(":", "").Replace("-", "").CompareTo(checkmac) <= 0 && dt.Rows[0]["sr_endcode"].ToString().Replace(":", "").Replace("-", "").CompareTo(checkmac) >= 0))
-                            {
-                                OperateResult.AppendText(">>MAC号" + checkmac + "不符合销售单合同范围\n", Color.Red, sncode);
-                                return;
-                            }
+                            OperateResult.AppendText(">>MAC号" + checkmac + "不符合销售单合同范围\n", Color.Red, sncode);
+                            return;
                         }
                     }
                     ////根据序列号获取此时网标号

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

@@ -118,8 +118,9 @@ namespace UAS_MES.Make
                 BaseUtil.FillDgvWithDataTable(LabelDataGridView, dt);
                 for (int i = 0; i < LabelDataGridView.Rows.Count; i++)
                 {
-                    LabelDataGridView.Rows[i].Cells["cm_barcode"].Value = dh.getFieldDataByCondition("CRAFTMATERIAL", "CM_BARCODE", "cm_id = '" + LabelDataGridView.Rows[i].Cells["cm_id"].Value + "'");
-                    LabelDataGridView.Rows[i].Cells["cm_sncode"].Value = dh.getFieldDataByCondition("CRAFTMATERIAL", "cm_sncode", "cm_id = '" + LabelDataGridView.Rows[i].Cells["cm_id"].Value + "'");
+                    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();
                     // LabelDataGridView.Rows[i].Cells["pr_detail_"].Value = dh.getFieldDataByCondition("product", "pr_detail", "pr_code = '" + LabelDataGridView.Rows[i].Cells["cm_soncode"].Value + "'");
                     LabelDataGridView.Rows[i].Cells["cm_status_1"].Value = (LabelDataGridView.Rows[i].Cells["cm_status"].Value.ToString() == "-1") ? "已拆解" : "上线";
                 }

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

@@ -72,7 +72,7 @@ namespace UAS_MES.Make
                     OperateResult.AppendText("<<" + sncode.Text + "\n", Color.Black);
                     //查询是否存在该ms_id
                     sql.Clear();
-                    sql.Append("select max(MS_id) ms_id from makeserial where ms_sncode='" + sncode.Text + "' or ms_firstsn in (select firstsn from makesnrelation where beforesn='" + sncode.Text + "')");
+                    sql.Append("select max(ms_id) ms_id from makeserial where ms_sncode ='"+sncode.Text+"' or exists (select 1 from  makesnrelation where beforesn='"+sncode.Text+"'  and ms_makecode=makecode)");
                     dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
                     if (dt.Rows.Count == 0 || dt.Rows[0]["ms_id"].ToString() == "")
                     {

+ 2 - 1
UAS-MES/FunctionCode/Make/Make_LabelCheck.cs

@@ -77,7 +77,7 @@ namespace UAS_MES.Make
                     OperateResult.AppendText("<<"+sncode.Text+"\n", Color.Black);
                     //查询是否存在该ms_id
                     sql.Clear();
-                    sql.Append("select ms_id,ms_prodcode,ms_makecode,ms_craftcode,ms_beforesn from makeserial where ms_id in (select max(MS_id) ms_id from makeserial where ms_sncode='" + sncode.Text+"' or ms_firstsn in (select firstsn from makesnrelation where beforesn='"+sncode.Text+"'))");
+                    sql.Append("select ms_id,ms_prodcode,ms_makecode,ms_craftcode,ms_beforesn from makeserial where ms_id in (select max(ms_id) from makeserial where ms_sncode ='"+sncode.Text+"' or exists (select 1 from  makesnrelation where beforesn='"+sncode.Text+"'  and ms_makecode=makecode))");
                     dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
                     
                     if (dt.Rows.Count == 0 || dt.Rows[0]["ms_id"].ToString() == "")
@@ -116,6 +116,7 @@ namespace UAS_MES.Make
                 else
                 {
                     OperateResult.AppendText("<<" + sncode.Text + "\n", Color.Black);
+
                     if (needCheckedInfo == sncode.Text||((needCheckedInfo == sncode.Text.Replace(":", "").Replace("-", ""))&&(checkItemInfo.Rows[checkIndex]["checkitem"].ToString() == "MAC"|| checkItemInfo.Rows[checkIndex]["checkitem"].ToString() == "BT")))
                     {
                         checkIndex += 1;//序号+1,进入下一步

+ 52 - 52
UAS-MES/FunctionCode/Make/Make_SeqProgramTransform.Designer.cs

@@ -44,6 +44,8 @@
             this.in_label = new System.Windows.Forms.Label();
             this.ClearSn_code = new System.Windows.Forms.PictureBox();
             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.ChangeResult = new UAS_MES.CustomControl.CustomCheckBox.CustomCheckBox();
             this.show_sncode = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.ma_prodcode = new UAS_MES.CustomControl.ValueLabel.ValueLabel();
@@ -54,8 +56,6 @@
             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.ma_softversion = new System.Windows.Forms.Label();
-            this.label2 = new System.Windows.Forms.Label();
             ((System.ComponentModel.ISupportInitialize)(this.ClearSn_code)).BeginInit();
             this.SuspendLayout();
             // 
@@ -63,7 +63,7 @@
             // 
             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(40, 14);
+            this.ms_macode_label.Location = new System.Drawing.Point(29, 26);
             this.ms_macode_label.Name = "ms_macode_label";
             this.ms_macode_label.Size = new System.Drawing.Size(110, 31);
             this.ms_macode_label.TabIndex = 0;
@@ -73,7 +73,7 @@
             // 
             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(444, 14);
+            this.ma_prodcode_label.Location = new System.Drawing.Point(433, 26);
             this.ma_prodcode_label.Name = "ma_prodcode_label";
             this.ma_prodcode_label.Size = new System.Drawing.Size(110, 31);
             this.ma_prodcode_label.TabIndex = 1;
@@ -83,7 +83,7 @@
             // 
             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(802, 14);
+            this.pr_detail_label.Location = new System.Drawing.Point(791, 26);
             this.pr_detail_label.Name = "pr_detail_label";
             this.pr_detail_label.Size = new System.Drawing.Size(110, 31);
             this.pr_detail_label.TabIndex = 2;
@@ -93,7 +93,7 @@
             // 
             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(40, 56);
+            this.remain_qty_label.Location = new System.Drawing.Point(29, 68);
             this.remain_qty_label.Name = "remain_qty_label";
             this.remain_qty_label.Size = new System.Drawing.Size(86, 31);
             this.remain_qty_label.TabIndex = 3;
@@ -103,7 +103,7 @@
             // 
             this.PrintNum_label.AutoSize = true;
             this.PrintNum_label.Font = new System.Drawing.Font("微软雅黑", 12F);
-            this.PrintNum_label.Location = new System.Drawing.Point(444, 56);
+            this.PrintNum_label.Location = new System.Drawing.Point(433, 68);
             this.PrintNum_label.Name = "PrintNum_label";
             this.PrintNum_label.Size = new System.Drawing.Size(62, 31);
             this.PrintNum_label.TabIndex = 4;
@@ -113,7 +113,7 @@
             // 
             this.ms_macode.AutoSize = true;
             this.ms_macode.Font = new System.Drawing.Font("微软雅黑", 12F);
-            this.ms_macode.Location = new System.Drawing.Point(152, 14);
+            this.ms_macode.Location = new System.Drawing.Point(141, 26);
             this.ms_macode.Name = "ms_macode";
             this.ms_macode.Size = new System.Drawing.Size(0, 31);
             this.ms_macode.TabIndex = 5;
@@ -123,7 +123,7 @@
             // 
             this.remain_qty.AutoSize = true;
             this.remain_qty.Font = new System.Drawing.Font("微软雅黑", 12F);
-            this.remain_qty.Location = new System.Drawing.Point(152, 55);
+            this.remain_qty.Location = new System.Drawing.Point(141, 67);
             this.remain_qty.Name = "remain_qty";
             this.remain_qty.Size = new System.Drawing.Size(0, 31);
             this.remain_qty.TabIndex = 6;
@@ -132,7 +132,7 @@
             // 
             this.count.AutoSize = true;
             this.count.Font = new System.Drawing.Font("微软雅黑", 12F);
-            this.count.Location = new System.Drawing.Point(556, 56);
+            this.count.Location = new System.Drawing.Point(545, 68);
             this.count.Name = "count";
             this.count.Size = new System.Drawing.Size(28, 31);
             this.count.TabIndex = 8;
@@ -142,7 +142,7 @@
             // 
             this.TSNLength_checkBox.AutoSize = true;
             this.TSNLength_checkBox.Font = new System.Drawing.Font("微软雅黑", 10F);
-            this.TSNLength_checkBox.Location = new System.Drawing.Point(46, 100);
+            this.TSNLength_checkBox.Location = new System.Drawing.Point(37, 121);
             this.TSNLength_checkBox.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.TSNLength_checkBox.Name = "TSNLength_checkBox";
             this.TSNLength_checkBox.Size = new System.Drawing.Size(117, 31);
@@ -154,7 +154,7 @@
             // 
             this.SNLength_checkBox.AutoSize = true;
             this.SNLength_checkBox.Font = new System.Drawing.Font("微软雅黑", 10F);
-            this.SNLength_checkBox.Location = new System.Drawing.Point(46, 146);
+            this.SNLength_checkBox.Location = new System.Drawing.Point(37, 167);
             this.SNLength_checkBox.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.SNLength_checkBox.Name = "SNLength_checkBox";
             this.SNLength_checkBox.Size = new System.Drawing.Size(106, 31);
@@ -166,7 +166,7 @@
             // 
             this.TSNPre_checkBox.AutoSize = true;
             this.TSNPre_checkBox.Font = new System.Drawing.Font("微软雅黑", 10F);
-            this.TSNPre_checkBox.Location = new System.Drawing.Point(450, 100);
+            this.TSNPre_checkBox.Location = new System.Drawing.Point(642, 120);
             this.TSNPre_checkBox.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.TSNPre_checkBox.Name = "TSNPre_checkBox";
             this.TSNPre_checkBox.Size = new System.Drawing.Size(117, 31);
@@ -178,7 +178,7 @@
             // 
             this.SNPre_checkBox.AutoSize = true;
             this.SNPre_checkBox.Font = new System.Drawing.Font("微软雅黑", 10F);
-            this.SNPre_checkBox.Location = new System.Drawing.Point(450, 148);
+            this.SNPre_checkBox.Location = new System.Drawing.Point(642, 168);
             this.SNPre_checkBox.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.SNPre_checkBox.Name = "SNPre_checkBox";
             this.SNPre_checkBox.Size = new System.Drawing.Size(106, 31);
@@ -190,7 +190,7 @@
             // 
             this.tip.AutoSize = true;
             this.tip.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold);
-            this.tip.Location = new System.Drawing.Point(43, 182);
+            this.tip.Location = new System.Drawing.Point(29, 207);
             this.tip.Name = "tip";
             this.tip.Size = new System.Drawing.Size(158, 31);
             this.tip.TabIndex = 18;
@@ -200,7 +200,7 @@
             // 
             this.in_label.AutoSize = true;
             this.in_label.Font = new System.Drawing.Font("微软雅黑", 12F);
-            this.in_label.Location = new System.Drawing.Point(43, 523);
+            this.in_label.Location = new System.Drawing.Point(29, 625);
             this.in_label.Name = "in_label";
             this.in_label.Size = new System.Drawing.Size(86, 31);
             this.in_label.TabIndex = 21;
@@ -210,7 +210,7 @@
             // 
             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(414, 481);
+            this.ClearSn_code.Location = new System.Drawing.Point(400, 572);
             this.ClearSn_code.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
             this.ClearSn_code.Name = "ClearSn_code";
             this.ClearSn_code.Size = new System.Drawing.Size(24, 24);
@@ -222,18 +222,38 @@
             // 
             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(43, 481);
+            this.sn_code_label.Location = new System.Drawing.Point(29, 572);
             this.sn_code_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.sn_code_label.Name = "sn_code_label";
             this.sn_code_label.Size = new System.Drawing.Size(86, 31);
             this.sn_code_label.TabIndex = 142;
             this.sn_code_label.Text = "序列号";
             // 
+            // ma_softversion
+            // 
+            this.ma_softversion.AutoSize = true;
+            this.ma_softversion.Font = new System.Drawing.Font("微软雅黑", 12F);
+            this.ma_softversion.Location = new System.Drawing.Point(911, 56);
+            this.ma_softversion.Name = "ma_softversion";
+            this.ma_softversion.Size = new System.Drawing.Size(0, 31);
+            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(790, 68);
+            this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label2.Name = "label2";
+            this.label2.Size = new System.Drawing.Size(110, 31);
+            this.label2.TabIndex = 149;
+            this.label2.Text = "软件版本";
+            // 
             // ChangeResult
             // 
             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(414, 524);
+            this.ChangeResult.Location = new System.Drawing.Point(400, 620);
             this.ChangeResult.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.ChangeResult.Name = "ChangeResult";
             this.ChangeResult.Power = "ifspecial";
@@ -250,7 +270,7 @@
             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(138, 481);
+            this.show_sncode.Location = new System.Drawing.Point(124, 572);
             this.show_sncode.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
             this.show_sncode.Name = "show_sncode";
             this.show_sncode.Power = null;
@@ -265,7 +285,7 @@
             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(554, 14);
+            this.ma_prodcode.Location = new System.Drawing.Point(543, 26);
             this.ma_prodcode.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
             this.ma_prodcode.MaximumSize = new System.Drawing.Size(164, 0);
             this.ma_prodcode.Name = "ma_prodcode";
@@ -290,7 +310,7 @@
             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(138, 526);
+            this.code.Location = new System.Drawing.Point(124, 622);
             this.code.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.code.Name = "code";
             this.code.Power = null;
@@ -304,10 +324,10 @@
             // OperateResult
             // 
             this.OperateResult.Font = new System.Drawing.Font("微软雅黑", 15F);
-            this.OperateResult.Location = new System.Drawing.Point(46, 221);
+            this.OperateResult.Location = new System.Drawing.Point(35, 249);
             this.OperateResult.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.OperateResult.Name = "OperateResult";
-            this.OperateResult.Size = new System.Drawing.Size(1153, 240);
+            this.OperateResult.Size = new System.Drawing.Size(1153, 296);
             this.OperateResult.TabIndex = 19;
             this.OperateResult.Text = "";
             // 
@@ -317,11 +337,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(584, 146);
+            this.SNPre.Location = new System.Drawing.Point(776, 166);
             this.SNPre.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.SNPre.Name = "SNPre";
             this.SNPre.Power = null;
-            this.SNPre.Size = new System.Drawing.Size(210, 34);
+            this.SNPre.Size = new System.Drawing.Size(213, 34);
             this.SNPre.Str = null;
             this.SNPre.Str1 = null;
             this.SNPre.Str2 = null;
@@ -333,11 +353,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(584, 98);
+            this.TSNPre.Location = new System.Drawing.Point(776, 118);
             this.TSNPre.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.TSNPre.Name = "TSNPre";
             this.TSNPre.Power = null;
-            this.TSNPre.Size = new System.Drawing.Size(210, 34);
+            this.TSNPre.Size = new System.Drawing.Size(213, 34);
             this.TSNPre.Str = null;
             this.TSNPre.Str1 = null;
             this.TSNPre.Str2 = null;
@@ -349,7 +369,7 @@
             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(194, 144);
+            this.SNLength.Location = new System.Drawing.Point(185, 165);
             this.SNLength.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.SNLength.Name = "SNLength";
             this.SNLength.Negative = false;
@@ -366,7 +386,7 @@
             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(194, 98);
+            this.TSNLength.Location = new System.Drawing.Point(185, 119);
             this.TSNLength.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.TSNLength.Name = "TSNLength";
             this.TSNLength.Negative = false;
@@ -377,31 +397,11 @@
             this.TSNLength.Str2 = null;
             this.TSNLength.TabIndex = 14;
             // 
-            // ma_softversion
-            // 
-            this.ma_softversion.AutoSize = true;
-            this.ma_softversion.Font = new System.Drawing.Font("微软雅黑", 12F);
-            this.ma_softversion.Location = new System.Drawing.Point(911, 56);
-            this.ma_softversion.Name = "ma_softversion";
-            this.ma_softversion.Size = new System.Drawing.Size(0, 31);
-            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(801, 56);
-            this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.label2.Name = "label2";
-            this.label2.Size = new System.Drawing.Size(110, 31);
-            this.label2.TabIndex = 149;
-            this.label2.Text = "软件版本";
-            // 
             // Make_SeqProgramTransform
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 18F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(1268, 590);
+            this.ClientSize = new System.Drawing.Size(1274, 681);
             this.Controls.Add(this.ma_softversion);
             this.Controls.Add(this.label2);
             this.Controls.Add(this.ChangeResult);
@@ -435,7 +435,7 @@
             this.Name = "Make_SeqProgramTransform";
             this.Tag = "Make!SeqProgramTransform";
             this.Load += new System.EventHandler(this.Make_SeqProgramTransform_Load);
-            this.SizeChanged += new System.EventHandler(this.序列烧录转换_SizeChanged);
+            this.SizeChanged += new System.EventHandler(this.Make_SeqProgramTransform_SizeChanged);
             ((System.ComponentModel.ISupportInitialize)(this.ClearSn_code)).EndInit();
             this.ResumeLayout(false);
             this.PerformLayout();

+ 24 - 30
UAS-MES/FunctionCode/Make/Make_SeqProgramTransform.cs

@@ -81,12 +81,7 @@ namespace UAS_MES.Make
             OperateResult.AppendText(">>请输入TSN号\n", Color.Black);
             dh = new DataHelper();
         }
-
-        private void 序列烧录转换_SizeChanged(object sender, EventArgs e)
-        {
-            asc.controlAutoSize(this);
-        }
-
+        
         private void code_KeyDown(object sender, KeyEventArgs e)
         {
             if (e.KeyCode == Keys.Enter)
@@ -248,16 +243,6 @@ namespace UAS_MES.Make
                         else if (step == 1)
                         {
                             OperateResult.AppendText(">>" + code.Text + "\n", Color.Black);
-                            //判断工单是否导入了序列号清单
-                            if (dh.CheckExist("makesnlist", "msl_makecode='" + ms_macode.Text + "' and msl_type='after'"))
-                            {
-                                if (!dh.CheckExist("makesnlist", "msl_sncode='" + code.Text + "' and  msl_makecode='" + ms_macode.Text + "' and msl_type='after'"))
-                                {
-                                    //有序列号清单,输入的序列号却不在范围内
-                                    OperateResult.AppendText(">>SN号" + code.Text + "错误,不在工单设定的转换后序列号清单中\n", Color.Red, code);
-                                    return;
-                                }
-                            }
                             //判断用户是否锁定输入SN长度,
                             if (!checkLengthOrPre(SNLength_checkBox, SNLength, "长度", "SN"))
                             {
@@ -268,6 +253,16 @@ namespace UAS_MES.Make
                             {
                                 return;
                             }
+                            //判断工单是否导入了序列号清单
+                            if (dh.CheckExist("makesnlist", "msl_makecode='" + ms_macode.Text + "' and msl_type='after'"))
+                            {
+                                if (!dh.CheckExist("makesnlist", "msl_sncode='" + code.Text + "' and  msl_makecode='" + ms_macode.Text + "' and msl_type='after'"))
+                                {
+                                    //有序列号清单,输入的序列号却不在范围内
+                                    OperateResult.AppendText(">>SN号" + code.Text + "错误,不在工单设定的转换后序列号清单中\n", Color.Red, code);
+                                    return;
+                                }
+                            }
                             //判断转换后序列号的范围是否合法
                             if (!checkStartAndEnd())
                             {
@@ -410,7 +405,7 @@ namespace UAS_MES.Make
         /// <param name="step"></param>
         private bool checkRules(int step)
         {
-            type = ListA.Rows[step - 2]["psr_type"].ToString() == "WIFI" ? "MAC" : ListA.Rows[step - 2]["psr_type"].ToString();
+            type = ListA.Rows[step - 2]["psr_type"].ToString();
             //将type中的mac和bt中的"-"和":"号去掉
             if (type == "MAC" || type == "BT")
             {
@@ -498,17 +493,11 @@ namespace UAS_MES.Make
                 case "BT":
                 case "MAC":
                     //验证是否符合合同防呆
-                    sql.Clear();
-                    sql.Append("select sr_startcode,sr_endcode from SaleMacBTRange where sr_sacode = '" + dh.getFieldDataByCondition("makeserial", "ms_salecode","ms_id='"+oMsid+"'") + "' and sr_type = '" + type + "'");
-                    macRange = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
-                    if (macRange.Rows.Count > 0)
+                    if (!LogicHandler.checkMacOrBtRange(oMsid,macOrBt,type))
                     {
-                        if (!(macRange.Rows[0]["sr_startcode"].ToString().Replace(":", "").Replace("-", "").CompareTo(macOrBt) <= 0 && macRange.Rows[0]["sr_endcode"].ToString().Replace(":", "").Replace("-", "").CompareTo(macOrBt) >= 0))
-                        {
-                            OperateResult.AppendText(">>" + ListA.Rows[step - 2]["psr_type"].ToString() + ":" + code.Text + "错误,不在合同防呆范围内\n", Color.Red);
-                            OperateResult.AppendText(">>请输入" + ListA.Rows[step - 2]["psr_type"].ToString() + "\n", Color.Black, code);
-                            return false;
-                        }
+                        OperateResult.AppendText(">>" + ListA.Rows[step - 2]["psr_type"].ToString() + ":" + code.Text + "错误,不在合同防呆范围内\n", Color.Red);
+                        OperateResult.AppendText(">>请输入" + ListA.Rows[step - 2]["psr_type"].ToString() + "\n", Color.Black, code);
+                        return false;
                     }
                     //验证是否已被使用
                     if (!ChangeResult.Checked && checkExist("MS_" + type + "='" + macOrBt + "' and  ms_status in (0,1,2,3)")
@@ -579,8 +568,8 @@ namespace UAS_MES.Make
                     //遍历判断已采集的信息是否已存在
                     foreach (DictionaryEntry de in hs)
                     {
-                        if (!ChangeResult.Checked && dh.CheckExist("makeserial", "MS_" + (de.Key.ToString() == "WIFI" ? "MAC" : de.Key) + "='" + de.Value + "' and  ms_status in (0,1,2,3)")
-                            || (ChangeResult.Checked && dh.CheckExist("makeserial", "MS_" + (de.Key.ToString() == "WIFI" ? "MAC" : de.Key) + "='" + de.Value + "' and  ms_status in (0,1,2,3) and ms_id <> '" + oMsid + "'")))
+                        if (!ChangeResult.Checked && dh.CheckExist("makeserial", "MS_" + (de.Key.ToString()) + "='" + de.Value + "' and  ms_status in (0,1,2,3)")
+                            || (ChangeResult.Checked && dh.CheckExist("makeserial", "MS_" + (de.Key.ToString()) + "='" + de.Value + "' and  ms_status in (0,1,2,3) and ms_id <> '" + oMsid + "'")))
                         {
                             flag = false;
                             OperateResult.AppendText(">>" + de.Key + "已被使用,请重新输入TSN,重新转换\n", Color.Red);
@@ -591,7 +580,7 @@ namespace UAS_MES.Make
                         else
                         {
                             //校验sninfo中是否存在
-                            if (dh.CheckExist("sninfo", "si_" + (de.Key.ToString() == "WIFI" ? "MAC" : de.Key) + "='" + de.Value + "' and si_id <>'" + siid + "'"))
+                            if (dh.CheckExist("sninfo", "si_" + (de.Key.ToString()) + "='" + de.Value + "' and si_id <>'" + siid + "'"))
                             {
                                 flag = false;
                                 OperateResult.AppendText(">>" + de.Key + "已被使用,请重新输入TSN,重新转换\n", Color.Red);
@@ -922,5 +911,10 @@ namespace UAS_MES.Make
                 dh.ExecuteSql(sql.GetString(), "update");
             }
         }
+
+        private void Make_SeqProgramTransform_SizeChanged(object sender, EventArgs e)
+        {
+            asc.controlAutoSize(this);
+        }
     }
 }

+ 42 - 42
UAS-MES/FunctionCode/Make/Make_SeqTransform.Designer.cs

@@ -44,6 +44,8 @@
             this.remain_qty_label = new System.Windows.Forms.Label();
             this.ClearSn_code = new System.Windows.Forms.PictureBox();
             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.ChangeResult = new UAS_MES.CustomControl.CustomCheckBox.CustomCheckBox();
             this.show_sncode = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.pr_detail = new UAS_MES.CustomControl.ValueLabel.ValueLabel();
@@ -54,8 +56,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.label2 = new System.Windows.Forms.Label();
-            this.ma_softversion = new System.Windows.Forms.Label();
             ((System.ComponentModel.ISupportInitialize)(this.ClearSn_code)).BeginInit();
             this.SuspendLayout();
             // 
@@ -95,7 +95,7 @@
             // 
             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(25, 644);
+            this.sncode_label.Location = new System.Drawing.Point(25, 647);
             this.sncode_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.sncode_label.Name = "sncode_label";
             this.sncode_label.Size = new System.Drawing.Size(86, 31);
@@ -109,9 +109,9 @@
             this.beforeTransSNLength_checkBox.Location = new System.Drawing.Point(28, 121);
             this.beforeTransSNLength_checkBox.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.beforeTransSNLength_checkBox.Name = "beforeTransSNLength_checkBox";
-            this.beforeTransSNLength_checkBox.Size = new System.Drawing.Size(198, 31);
+            this.beforeTransSNLength_checkBox.Size = new System.Drawing.Size(117, 31);
             this.beforeTransSNLength_checkBox.TabIndex = 81;
-            this.beforeTransSNLength_checkBox.Text = "转换前序列号长度";
+            this.beforeTransSNLength_checkBox.Text = "TSN长度";
             this.beforeTransSNLength_checkBox.UseVisualStyleBackColor = true;
             // 
             // afterTransSNLength_checkBox
@@ -121,33 +121,33 @@
             this.afterTransSNLength_checkBox.Location = new System.Drawing.Point(28, 170);
             this.afterTransSNLength_checkBox.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.afterTransSNLength_checkBox.Name = "afterTransSNLength_checkBox";
-            this.afterTransSNLength_checkBox.Size = new System.Drawing.Size(198, 31);
+            this.afterTransSNLength_checkBox.Size = new System.Drawing.Size(106, 31);
             this.afterTransSNLength_checkBox.TabIndex = 82;
-            this.afterTransSNLength_checkBox.Text = "转换后序列号长度";
+            this.afterTransSNLength_checkBox.Text = "SN长度";
             this.afterTransSNLength_checkBox.UseVisualStyleBackColor = true;
             // 
             // beforeTransSNPre_checkBox
             // 
             this.beforeTransSNPre_checkBox.AutoSize = true;
             this.beforeTransSNPre_checkBox.Font = new System.Drawing.Font("微软雅黑", 10F);
-            this.beforeTransSNPre_checkBox.Location = new System.Drawing.Point(630, 119);
+            this.beforeTransSNPre_checkBox.Location = new System.Drawing.Point(632, 121);
             this.beforeTransSNPre_checkBox.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.beforeTransSNPre_checkBox.Name = "beforeTransSNPre_checkBox";
-            this.beforeTransSNPre_checkBox.Size = new System.Drawing.Size(198, 31);
+            this.beforeTransSNPre_checkBox.Size = new System.Drawing.Size(117, 31);
             this.beforeTransSNPre_checkBox.TabIndex = 83;
-            this.beforeTransSNPre_checkBox.Text = "转换前序列号前缀";
+            this.beforeTransSNPre_checkBox.Text = "TSN前缀";
             this.beforeTransSNPre_checkBox.UseVisualStyleBackColor = true;
             // 
             // afterTransSNPre_checkBox
             // 
             this.afterTransSNPre_checkBox.AutoSize = true;
             this.afterTransSNPre_checkBox.Font = new System.Drawing.Font("微软雅黑", 10F);
-            this.afterTransSNPre_checkBox.Location = new System.Drawing.Point(630, 169);
+            this.afterTransSNPre_checkBox.Location = new System.Drawing.Point(632, 171);
             this.afterTransSNPre_checkBox.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.afterTransSNPre_checkBox.Name = "afterTransSNPre_checkBox";
-            this.afterTransSNPre_checkBox.Size = new System.Drawing.Size(198, 31);
+            this.afterTransSNPre_checkBox.Size = new System.Drawing.Size(106, 31);
             this.afterTransSNPre_checkBox.TabIndex = 84;
-            this.afterTransSNPre_checkBox.Text = "转换后序列号前缀";
+            this.afterTransSNPre_checkBox.Text = "SN前缀";
             this.afterTransSNPre_checkBox.UseVisualStyleBackColor = true;
             // 
             // label1
@@ -232,6 +232,26 @@
             this.sn_code_label.TabIndex = 139;
             this.sn_code_label.Text = "序列号";
             // 
+            // 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(825, 76);
+            this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label2.Name = "label2";
+            this.label2.Size = new System.Drawing.Size(110, 31);
+            this.label2.TabIndex = 147;
+            this.label2.Text = "软件版本";
+            // 
+            // ma_softversion
+            // 
+            this.ma_softversion.AutoSize = true;
+            this.ma_softversion.Font = new System.Drawing.Font("微软雅黑", 12F);
+            this.ma_softversion.Location = new System.Drawing.Point(935, 76);
+            this.ma_softversion.Name = "ma_softversion";
+            this.ma_softversion.Size = new System.Drawing.Size(0, 31);
+            this.ma_softversion.TabIndex = 148;
+            // 
             // ChangeResult
             // 
             this.ChangeResult.AutoSize = true;
@@ -289,7 +309,7 @@
             // afterTransSNLength
             // 
             this.afterTransSNLength.Font = new System.Drawing.Font("微软雅黑", 10F);
-            this.afterTransSNLength.Location = new System.Drawing.Point(267, 167);
+            this.afterTransSNLength.Location = new System.Drawing.Point(166, 172);
             this.afterTransSNLength.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.afterTransSNLength.Name = "afterTransSNLength";
             this.afterTransSNLength.Size = new System.Drawing.Size(250, 34);
@@ -299,7 +319,7 @@
             // beforeTransSNLength
             // 
             this.beforeTransSNLength.Font = new System.Drawing.Font("微软雅黑", 10F);
-            this.beforeTransSNLength.Location = new System.Drawing.Point(267, 116);
+            this.beforeTransSNLength.Location = new System.Drawing.Point(166, 121);
             this.beforeTransSNLength.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.beforeTransSNLength.Name = "beforeTransSNLength";
             this.beforeTransSNLength.Size = new System.Drawing.Size(250, 34);
@@ -312,7 +332,7 @@
             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(870, 169);
+            this.afterTransSNPre.Location = new System.Drawing.Point(769, 169);
             this.afterTransSNPre.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.afterTransSNPre.Name = "afterTransSNPre";
             this.afterTransSNPre.Power = null;
@@ -328,7 +348,7 @@
             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(870, 119);
+            this.beforeTransSNPre.Location = new System.Drawing.Point(769, 119);
             this.beforeTransSNPre.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.beforeTransSNPre.Name = "beforeTransSNPre";
             this.beforeTransSNPre.Power = null;
@@ -342,7 +362,7 @@
             // 
             this.OperateResult.Font = new System.Drawing.Font("微软雅黑", 15F);
             this.OperateResult.Location = new System.Drawing.Point(28, 220);
-            this.OperateResult.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.OperateResult.Margin = new System.Windows.Forms.Padding(4);
             this.OperateResult.Name = "OperateResult";
             this.OperateResult.Size = new System.Drawing.Size(1216, 344);
             this.OperateResult.TabIndex = 78;
@@ -355,7 +375,7 @@
             this.sncode.Font = new System.Drawing.Font("微软雅黑", 10F);
             this.sncode.ID = null;
             this.sncode.Location = new System.Drawing.Point(145, 644);
-            this.sncode.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.sncode.Margin = new System.Windows.Forms.Padding(4);
             this.sncode.Name = "sncode";
             this.sncode.Power = "ifread";
             this.sncode.Size = new System.Drawing.Size(238, 34);
@@ -366,26 +386,6 @@
             this.sncode.Tag = "IfRead";
             this.sncode.KeyDown += new System.Windows.Forms.KeyEventHandler(this.sncode_KeyDown);
             // 
-            // 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(825, 76);
-            this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.label2.Name = "label2";
-            this.label2.Size = new System.Drawing.Size(110, 31);
-            this.label2.TabIndex = 147;
-            this.label2.Text = "软件版本";
-            // 
-            // ma_softversion
-            // 
-            this.ma_softversion.AutoSize = true;
-            this.ma_softversion.Font = new System.Drawing.Font("微软雅黑", 12F);
-            this.ma_softversion.Location = new System.Drawing.Point(935, 76);
-            this.ma_softversion.Name = "ma_softversion";
-            this.ma_softversion.Size = new System.Drawing.Size(0, 31);
-            this.ma_softversion.TabIndex = 148;
-            // 
             // Make_SeqTransform
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 18F);
@@ -420,12 +420,12 @@
             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.Margin = new System.Windows.Forms.Padding(4);
             this.Name = "Make_SeqTransform";
             this.Tag = "Make!SeqTransform";
             this.Text = " ";
-            this.Load += new System.EventHandler(this.序列转换_Load);
-            this.SizeChanged += new System.EventHandler(this.序列转换_SizeChanged);
+            this.Load += new System.EventHandler(this.Make_SeqTransform_Load);
+            this.SizeChanged += new System.EventHandler(this.Make_SeqTransform_SizeChanged);
             ((System.ComponentModel.ISupportInitialize)(this.ClearSn_code)).EndInit();
             this.ResumeLayout(false);
             this.PerformLayout();

+ 21 - 33
UAS-MES/FunctionCode/Make/Make_SeqTransform.cs

@@ -42,27 +42,7 @@ namespace UAS_MES.Make
         {
             InitializeComponent();
         }
-
-        private void 序列转换_Load(object sender, EventArgs e)
-        {
-            asc.controllInitializeSize(this);
-            dh = new DataHelper();
-            sncode.Focus();
-            OperateResult.AppendText(">>请输入TSN号\n", Color.Black);
-
-            ////设置锁定工单
-            //ms_makecode_lock.GetMakeCodeCtl(ma_code);
-            //ma_code.SetLockCheckBox(ms_makecode_lock);
-
-            ////工单放大镜的配置
-            //ma_code.TableName = "make left join product on ma_prodcode=pr_code";
-            //ma_code.SelectField = "ma_code # 工单号,ma_prodcode # 产品编号,pr_detail # 产品名称";
-            //ma_code.FormName = Name;
-            //ma_code.SetValueField = new string[] { "ma_code", "ma_prodcode", "pr_detail" };
-            //ma_code.Condition = "ma_statuscode='STARTED'";
-            //ma_code.DbChange += Ma_code_DbChange;
-        }
-
+        
         //private void Ma_code_DbChange(object sender, EventArgs e)
         //{
         //    Dbfind = ma_code.ReturnData;
@@ -224,6 +204,12 @@ namespace UAS_MES.Make
                         //bsncode不为空,说明输入的是转换后的序列号
                         else
                         {
+                            //判断用户是否锁定输入转换后序列号长度,
+                            if (!checkLengthOrPre(afterTransSNLength_checkBox, afterTransSNLength, "长度"))
+                                return;
+                            //判断用户是否锁定输入转换后序列号前缀,
+                            if (!checkLengthOrPre(afterTransSNPre_checkBox, afterTransSNPre, "前缀"))
+                                return;
                             //判断工单是否导入了序列号清单
                             if (dh.CheckExist("makesnlist", "msl_makecode='" + ma_code.Text + "' and msl_type='after'"))
                             {
@@ -234,12 +220,6 @@ namespace UAS_MES.Make
                                     return;
                                 }
                             }
-                            //判断用户是否锁定输入转换后序列号长度,
-                            if (!checkLengthOrPre(afterTransSNLength_checkBox, afterTransSNLength, "长度"))
-                                return;
-                            //判断用户是否锁定输入转换后序列号前缀,
-                            if (!checkLengthOrPre(afterTransSNPre_checkBox, afterTransSNPre, "前缀"))
-                                return;
                             //判断输入的转换后序列号是否符合起始终止
                             if (!checkStartAndEnd())
                             {
@@ -353,12 +333,7 @@ namespace UAS_MES.Make
                 sncode.Text = "";
             }
         }
-
-        private void 序列转换_SizeChanged(object sender, EventArgs e)
-        {
-            asc.controlAutoSize(this);
-        }
-
+        
         private void Confirm_Click(object sender, EventArgs e)
         {
             KeyEventArgs ky = new KeyEventArgs(Keys.Enter);
@@ -608,5 +583,18 @@ namespace UAS_MES.Make
                 OperateResult.AppendText("<<请输入TSN号\n", Color.Black);
             }
         }
+
+        private void Make_SeqTransform_Load(object sender, EventArgs e)
+        {
+            asc.controllInitializeSize(this);
+            dh = new DataHelper();
+            sncode.Focus();
+            OperateResult.AppendText(">>请输入TSN号\n", Color.Black);
+        }
+
+        private void Make_SeqTransform_SizeChanged(object sender, EventArgs e)
+        {
+            asc.controlAutoSize(this);
+        }
     }
 }

+ 7 - 23
UAS-MES/FunctionCode/Make/Make_UpdateCollectCode.cs

@@ -160,34 +160,18 @@ namespace UAS_MES.Make
                             }
                             else
                             {
-                                //判断是否有合同号MAC范围
-                                //if (dh.CheckExist("SaleMacBTRange", "sr_sacode='" + dt.Rows[0]["ms_salecode"].ToString() + "' and sr_type='" + ((CheckBox)list[step - 1]).Text.Split('/')[0] + "'"))
-                                //{
-                                //    //有范围的情况下看是否在范围内
-                                //    if (!dh.CheckExist("SaleMacBTRange", "sr_sacode='" + dt.Rows[0]["ms_salecode"].ToString() + "' and  sr_type='" + ((CheckBox)list[step - 1]).Text.Split('/')[0] + "' AND  '" + inputValue.Text.Replace(":", "").Replace("-", "") + "' between sr_startcode and sr_endcode"))
-                                //    {
-                                //        OperateResult.AppendText("<<" + ((CheckBox)list[step - 1]).Text.Split('/')[0] + ":" + inputValue.Text + "错误,不在合同防呆范围内\n", Color.Red, inputValue);
-                                //        OperateResult.AppendText(">>请采集" + ((CheckBox)list[step - 1]).Text.Split('/')[0] + "\n", Color.Black);
-                                //        return;
-                                //    }
-                                //}
-                                sql.Clear();
-                                sql.Append("select sr_startcode,sr_endcode from SaleMacBTRange where sr_sacode = '" + dt.Rows[0]["ms_salecode"].ToString() + "' and sr_type = '"+ ((CheckBox)list[step - 1]).Text.Split('/')[0] + "'");
-                                macRange = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
-                                if (macRange.Rows.Count > 0)
-                                {
-                                    if (!(macRange.Rows[0]["sr_startcode"].ToString().Replace(":", "").Replace("-", "").CompareTo(inputValue.Text.Replace(":", "").Replace("-", "")) <= 0 && macRange.Rows[0]["sr_endcode"].ToString().Replace(":", "").Replace("-", "").CompareTo(inputValue.Text.Replace(":", "").Replace("-", "")) >= 0))
-                                    {
-                                        OperateResult.AppendText("<<" + ((CheckBox)list[step - 1]).Text.Split('/')[0] + ":" + inputValue.Text + "错误,不在合同防呆范围内\n", Color.Red, inputValue);
-                                        OperateResult.AppendText(">>请采集" + ((CheckBox)list[step - 1]).Text.Split('/')[0] + "\n", Color.Black);
-                                        return;
-                                    }
-                                }
                                 //验证长度前缀
                                 if (!checkPrefixAndLength())
                                 {
                                     return;
                                 }
+                                //验证MAC和BT合同合同防呆
+                                if (!LogicHandler.checkMacOrBtRange(ms_id, inputValue.Text.Replace(":", "").Replace("-", ""), ((CheckBox)list[step - 1]).Text.Split('/')[0]))
+                                {
+                                    OperateResult.AppendText("<<" + ((CheckBox)list[step - 1]).Text.Split('/')[0] + ":" + inputValue.Text + "错误,不在合同防呆范围内\n", Color.Red, inputValue);
+                                    OperateResult.AppendText(">>请采集" + ((CheckBox)list[step - 1]).Text.Split('/')[0] + "\n", Color.Black);
+                                    return;
+                                }
                                 //验证长度前缀通过,验证数据库
                                 if (dh.CheckExist("makeserial", "ms_status in (0,1,2,3) and  ms_" + ((CheckBox)list[step - 1]).Text.Split('/')[0] + " ='" + inputValue.Text.Replace(":", "").Replace("-", "") + "'"))
                                 {

+ 26 - 1
UAS-MES/PublicMethod/LogicHandler.cs

@@ -1385,6 +1385,31 @@ namespace UAS_MES.PublicMethod
             error = "";
             return true;
         }
-
+        /// <summary>
+        /// 验证是否符合合同防呆
+        /// </summary>
+        /// <param name="msid"></param>
+        /// <param name="macOrBt"></param>
+        /// <param name="type"></param>
+        /// <returns></returns>
+        public static Boolean checkMacOrBtRange(string msid,string macOrBt,string type)
+        {
+            //--判断是否有合同,是否在合同定义的范围内
+            string saleCode= dh.getFieldDataByCondition("makeserial", "ms_salecode", "ms_id='" + msid + "'").ToString();
+            if (saleCode=="")
+            {
+                return true;
+            }
+            //判断是否有合同范围
+            if (dh.CheckExist("SaleMacBTRange","Sr_Sacode = '"+saleCode+"' and sr_type = '"+type+"'"))
+            {
+                //有合同范围再判断是否在范围内
+                if (!dh.CheckExist("SaleMacBTRange", "Sr_Sacode = '"+saleCode+"' and sr_type = '"+type+"' and '"+macOrBt+"' between SR_STARTCODE and SR_ENDCODE"))
+                {
+                    return false;
+                }
+            }
+            return true;
+        }
     }
 }

+ 7 - 0
UAS_XmlAnalysor/Form1.cs

@@ -16,6 +16,8 @@ namespace UAS_XmlAnalysor
 
         DataTable dt;
 
+        Tip form2;
+
         Thread InitDB;
         /// <summary>
         /// 缓存的文件
@@ -25,15 +27,18 @@ namespace UAS_XmlAnalysor
         /// 缓存的文件夹
         /// </summary>
         string CachePathFolder = Environment.GetEnvironmentVariable("windir").Substring(0, 1) + @":/UAS_MES/XmlAnalysor/";
+        
 
         public Form1()
         {
             InitializeComponent();
             StartPosition = FormStartPosition.CenterScreen;
+            form2 = new Tip();
         }
 
         private void Form1_Load(object sender, EventArgs e)
         {
+            form2.Show();
             CheckForIllegalCrossThreadCalls = false;
             FormBorderStyle = FormBorderStyle.FixedSingle;
             InitDB = new Thread(ConnectDB);
@@ -239,12 +244,14 @@ namespace UAS_XmlAnalysor
                         {
                             file.MoveTo(BackUpFolderPath.Text + @"\" + e.Name);
                             OperateResult.AppendText("成功解析文件" + e.Name + "\n");
+                            form2.startthread(e.Name);
                             break;
                         }
                         else if (!File.Exists(BackUpFolderPath.Text + @"\" + e.Name.Split('.')[0] + "(" + i + ")" + "." + e.Name.Split('.')[1]))
                         {
                             file.MoveTo(BackUpFolderPath.Text + @"\" + e.Name.Split('.')[0] + "(" + i + ")" + "." + e.Name.Split('.')[1]);
                             OperateResult.AppendText("成功解析文件" + e.Name + "\n");
+                            form2.startthread(e.Name);
                             break;
                         }
                     }

+ 69 - 0
UAS_XmlAnalysor/Form2.Designer.cs

@@ -0,0 +1,69 @@
+namespace UAS_XmlAnalysor
+{
+    partial class Tip
+    {
+        /// <summary>
+        /// Required designer variable.
+        /// </summary>
+        private System.ComponentModel.IContainer components = null;
+
+        /// <summary>
+        /// Clean up any resources being used.
+        /// </summary>
+        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+        protected override void Dispose(bool disposing)
+        {
+            if (disposing && (components != null))
+            {
+                components.Dispose();
+            }
+            base.Dispose(disposing);
+        }
+
+        #region Windows Form Designer generated code
+
+        /// <summary>
+        /// Required method for Designer support - do not modify
+        /// the contents of this method with the code editor.
+        /// </summary>
+        private void InitializeComponent()
+        {
+            this.label1 = new System.Windows.Forms.Label();
+            this.SuspendLayout();
+            // 
+            // label1
+            // 
+            this.label1.AutoSize = true;
+            this.label1.BackColor = System.Drawing.SystemColors.Menu;
+            this.label1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label1.ForeColor = System.Drawing.Color.Black;
+            this.label1.Location = new System.Drawing.Point(75, 18);
+            this.label1.Name = "label1";
+            this.label1.Size = new System.Drawing.Size(0, 21);
+            this.label1.TabIndex = 0;
+            // 
+            // Tip
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.BackColor = System.Drawing.SystemColors.Menu;
+            this.ClientSize = new System.Drawing.Size(312, 59);
+            this.Controls.Add(this.label1);
+            this.ForeColor = System.Drawing.Color.White;
+            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
+            this.Name = "Tip";
+            this.Text = "Form2";
+            this.TopMost = true;
+            this.Load += new System.EventHandler(this.Form2_Load);
+            this.MouseEnter += new System.EventHandler(this.Form2_MouseEnter);
+            this.MouseLeave += new System.EventHandler(this.Form2_MouseLeave);
+            this.ResumeLayout(false);
+            this.PerformLayout();
+
+        }
+
+        #endregion
+
+        private System.Windows.Forms.Label label1;
+    }
+}

+ 114 - 0
UAS_XmlAnalysor/Form2.cs

@@ -0,0 +1,114 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Threading;
+using System.Windows.Forms;
+
+namespace UAS_XmlAnalysor
+{
+    public partial class Tip : Form
+    {
+        int state;
+
+        private DoWorkEventArgs e;
+
+        public Tip()
+        {
+            InitializeComponent();
+        }
+        private void Form2_Load(object sender, EventArgs e)
+        {
+            this.ShowInTaskbar = false;
+            this.Left = Screen.PrimaryScreen.WorkingArea.Width - this.Width;
+            this.Top = this.Height;
+            state = 0;
+            label1.Text = DateTime.Now.ToString();
+        }
+
+        public void startthread(string filename)
+        {
+            label1.Text = filename+"解析完成";
+            //thread.Start();
+            using (BackgroundWorker bw = new BackgroundWorker())
+            {
+                bw.RunWorkerCompleted += new RunWorkerCompletedEventHandler(bw_RunWorkerCompleted);
+                bw.DoWork += new DoWorkEventHandler(bw_DoWork);
+                bw.RunWorkerAsync("Tank");
+            }
+        }
+
+        private void bw_DoWork(object sender, DoWorkEventArgs e)
+        {
+
+        }
+        private void bw_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
+        {
+            aa();
+            Thread.Sleep(500);
+            bb();
+        }
+        public void aa()
+        {
+            if (state == 0)
+            {
+                state = 1;
+                int t = this.Left;
+                for (int i = t; i >= Screen.PrimaryScreen.WorkingArea.Width - this.Width; i--)
+                {
+                    this.Left = i;
+                    Application.DoEvents();
+                }
+                state = 0;
+            }
+        }
+
+        public void bb()
+        {
+            if (this.Left <= Screen.PrimaryScreen.WorkingArea.Width - 10 && state == 0)
+            {
+                state = 1;
+                int t = this.Left;
+                for (int i = t; i < Screen.PrimaryScreen.WorkingArea.Width - 10; i++)
+                {
+                    this.Left = i;
+                    Application.DoEvents();
+                }
+                state = 0;
+            }
+        }
+
+        private void Form2_MouseEnter(object sender, EventArgs e)
+        {
+            if (state == 0)
+            {
+                state = 1;
+                int t = this.Left;
+                for (int i = t; i >= Screen.PrimaryScreen.WorkingArea.Width - this.Width; i=i-2)
+                {
+                    this.Left = i;
+                    Application.DoEvents();
+                }
+                state = 0;
+            }
+        }
+
+        private void Form2_MouseLeave(object sender, EventArgs e)
+        {
+            if (this.Left <= Screen.PrimaryScreen.WorkingArea.Width - 10 && state == 0)
+            {
+                state = 1;
+                int t = this.Left;
+                for (int i = t; i < Screen.PrimaryScreen.WorkingArea.Width - 10; i=i+2)
+                {
+                    this.Left = i;
+                    Application.DoEvents();
+                }
+                state = 0;
+            }
+        }
+    }
+}

+ 120 - 0
UAS_XmlAnalysor/Form2.resx

@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+</root>