Эх сурвалжийг харах

联淦自定义标签打印,亿道上料扫码超出80位去除限制

callm 1 жил өмнө
parent
commit
b525bc17a3

+ 1 - 0
UAS_MES_LGDZ/FunctionCode/Make/Make_ColorBoxLabelPrint.Designer.cs

@@ -362,6 +362,7 @@
             this.locksalecode.AutoSize = true;
             this.locksalecode.Checked = true;
             this.locksalecode.CheckState = System.Windows.Forms.CheckState.Checked;
+            this.locksalecode.Enabled = false;
             this.locksalecode.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.locksalecode.ForeColor = System.Drawing.Color.Red;
             this.locksalecode.Location = new System.Drawing.Point(180, 33);

+ 55 - 47
UAS_MES_LGDZ/FunctionCode/Make/Make_CustomLabelPrint.Designer.cs

@@ -28,11 +28,12 @@
         /// </summary>
         private void InitializeComponent()
         {
+            this.components = new System.ComponentModel.Container();
             System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Make_CustomLabelPrint));
             this.pr_code_label = new System.Windows.Forms.Label();
             this.label2 = new System.Windows.Forms.Label();
             this.label3 = new System.Windows.Forms.Label();
-            this.PrintLabel = new UAS_MES_NEW.CustomControl.ComBoxWithFocus.ComboxWithTip();
+            this.PrintLabel = new UAS_MES_NEW.CustomControl.ComBoxWithFocus.ComboxWithTip(this.components);
             this.label4 = new System.Windows.Forms.Label();
             this.label5 = new System.Windows.Forms.Label();
             this.sncode_label = new System.Windows.Forms.Label();
@@ -51,9 +52,10 @@
             // 
             this.pr_code_label.AutoSize = true;
             this.pr_code_label.Font = new System.Drawing.Font("微软雅黑", 12F);
-            this.pr_code_label.Location = new System.Drawing.Point(49, 27);
+            this.pr_code_label.Location = new System.Drawing.Point(74, 43);
+            this.pr_code_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.pr_code_label.Name = "pr_code_label";
-            this.pr_code_label.Size = new System.Drawing.Size(92, 27);
+            this.pr_code_label.Size = new System.Drawing.Size(146, 41);
             this.pr_code_label.TabIndex = 0;
             this.pr_code_label.Text = "产品代码";
             // 
@@ -61,9 +63,10 @@
             // 
             this.label2.AutoSize = true;
             this.label2.Font = new System.Drawing.Font("微软雅黑", 12F);
-            this.label2.Location = new System.Drawing.Point(52, 92);
+            this.label2.Location = new System.Drawing.Point(78, 147);
+            this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.label2.Name = "label2";
-            this.label2.Size = new System.Drawing.Size(92, 27);
+            this.label2.Size = new System.Drawing.Size(146, 41);
             this.label2.TabIndex = 1;
             this.label2.Text = "产品名称";
             // 
@@ -71,9 +74,10 @@
             // 
             this.label3.AutoSize = true;
             this.label3.Font = new System.Drawing.Font("微软雅黑", 12F);
-            this.label3.Location = new System.Drawing.Point(680, 25);
+            this.label3.Location = new System.Drawing.Point(1020, 40);
+            this.label3.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.label3.Name = "label3";
-            this.label3.Size = new System.Drawing.Size(52, 27);
+            this.label3.Size = new System.Drawing.Size(82, 41);
             this.label3.TabIndex = 2;
             this.label3.Text = "规格";
             // 
@@ -81,10 +85,10 @@
             // 
             this.PrintLabel.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
             this.PrintLabel.FormattingEnabled = true;
-            this.PrintLabel.Location = new System.Drawing.Point(462, 92);
-            this.PrintLabel.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.PrintLabel.Location = new System.Drawing.Point(693, 147);
+            this.PrintLabel.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
             this.PrintLabel.Name = "PrintLabel";
-            this.PrintLabel.Size = new System.Drawing.Size(169, 23);
+            this.PrintLabel.Size = new System.Drawing.Size(252, 32);
             this.PrintLabel.TabIndex = 185;
             this.PrintLabel.SelectedValueChanged += new System.EventHandler(this.PrintLabel_SelectedValueChanged);
             this.PrintLabel.TextChanged += new System.EventHandler(this.PrintLabel_TextChanged);
@@ -93,10 +97,10 @@
             // 
             this.label4.AutoSize = true;
             this.label4.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label4.Location = new System.Drawing.Point(356, 27);
-            this.label4.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label4.Location = new System.Drawing.Point(534, 43);
+            this.label4.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.label4.Name = "label4";
-            this.label4.Size = new System.Drawing.Size(72, 27);
+            this.label4.Size = new System.Drawing.Size(114, 41);
             this.label4.TabIndex = 184;
             this.label4.Text = "打印机";
             // 
@@ -104,10 +108,10 @@
             // 
             this.label5.AutoSize = true;
             this.label5.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label5.Location = new System.Drawing.Point(356, 92);
-            this.label5.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label5.Location = new System.Drawing.Point(534, 147);
+            this.label5.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.label5.Name = "label5";
-            this.label5.Size = new System.Drawing.Size(52, 27);
+            this.label5.Size = new System.Drawing.Size(82, 41);
             this.label5.TabIndex = 183;
             this.label5.Text = "标签";
             // 
@@ -117,10 +121,10 @@
             | System.Windows.Forms.AnchorStyles.Left)));
             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(38, 458);
-            this.sncode_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.sncode_label.Location = new System.Drawing.Point(57, 733);
+            this.sncode_label.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.sncode_label.Name = "sncode_label";
-            this.sncode_label.Size = new System.Drawing.Size(72, 27);
+            this.sncode_label.Size = new System.Drawing.Size(114, 41);
             this.sncode_label.TabIndex = 188;
             this.sncode_label.Text = "输入框";
             // 
@@ -128,9 +132,10 @@
             // 
             this.label6.AutoSize = true;
             this.label6.Font = new System.Drawing.Font("微软雅黑", 12F);
-            this.label6.Location = new System.Drawing.Point(551, 458);
+            this.label6.Location = new System.Drawing.Point(826, 733);
+            this.label6.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.label6.Name = "label6";
-            this.label6.Size = new System.Drawing.Size(52, 27);
+            this.label6.Size = new System.Drawing.Size(82, 41);
             this.label6.TabIndex = 189;
             this.label6.Text = "份数";
             // 
@@ -138,19 +143,21 @@
             // 
             this.pr_detail.AutoSize = true;
             this.pr_detail.Font = new System.Drawing.Font("微软雅黑", 12F);
-            this.pr_detail.Location = new System.Drawing.Point(160, 92);
+            this.pr_detail.Location = new System.Drawing.Point(240, 147);
+            this.pr_detail.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.pr_detail.Name = "pr_detail";
-            this.pr_detail.Size = new System.Drawing.Size(0, 27);
+            this.pr_detail.Size = new System.Drawing.Size(0, 41);
             this.pr_detail.TabIndex = 193;
             // 
             // pr_spec
             // 
             this.pr_spec.AutoSize = true;
             this.pr_spec.Font = new System.Drawing.Font("微软雅黑", 12F);
-            this.pr_spec.Location = new System.Drawing.Point(740, 25);
-            this.pr_spec.MaximumSize = new System.Drawing.Size(300, 100);
+            this.pr_spec.Location = new System.Drawing.Point(1110, 40);
+            this.pr_spec.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.pr_spec.MaximumSize = new System.Drawing.Size(450, 160);
             this.pr_spec.Name = "pr_spec";
-            this.pr_spec.Size = new System.Drawing.Size(0, 27);
+            this.pr_spec.Size = new System.Drawing.Size(0, 41);
             this.pr_spec.TabIndex = 194;
             // 
             // PrintNum
@@ -159,12 +166,12 @@
             this.PrintNum.BackColor = System.Drawing.Color.White;
             this.PrintNum.Enabled = false;
             this.PrintNum.ID = null;
-            this.PrintNum.Location = new System.Drawing.Point(629, 458);
-            this.PrintNum.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.PrintNum.Location = new System.Drawing.Point(944, 733);
+            this.PrintNum.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
             this.PrintNum.Name = "PrintNum";
             this.PrintNum.Negative = false;
             this.PrintNum.Power = null;
-            this.PrintNum.Size = new System.Drawing.Size(175, 25);
+            this.PrintNum.Size = new System.Drawing.Size(260, 35);
             this.PrintNum.Str = null;
             this.PrintNum.Str1 = null;
             this.PrintNum.Str2 = null;
@@ -178,16 +185,17 @@
             this.printButton.DownImage = ((System.Drawing.Image)(resources.GetObject("printButton.DownImage")));
             this.printButton.Image = null;
             this.printButton.IsShowBorder = true;
-            this.printButton.Location = new System.Drawing.Point(827, 458);
-            this.printButton.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.printButton.Location = new System.Drawing.Point(1240, 733);
+            this.printButton.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
             this.printButton.MoveImage = ((System.Drawing.Image)(resources.GetObject("printButton.MoveImage")));
             this.printButton.Name = "printButton";
             this.printButton.NormalImage = ((System.Drawing.Image)(resources.GetObject("printButton.NormalImage")));
             this.printButton.Power = null;
-            this.printButton.Size = new System.Drawing.Size(67, 23);
+            this.printButton.Size = new System.Drawing.Size(100, 37);
             this.printButton.TabIndex = 192;
             this.printButton.Text = "打印";
             this.printButton.UseVisualStyleBackColor = false;
+            this.printButton.Visible = false;
             this.printButton.Click += new System.EventHandler(this.printButton_Click);
             // 
             // pr_code
@@ -196,11 +204,11 @@
             this.pr_code.BackColor = System.Drawing.Color.White;
             this.pr_code.Font = new System.Drawing.Font("宋体", 9F);
             this.pr_code.ID = null;
-            this.pr_code.Location = new System.Drawing.Point(160, 27);
-            this.pr_code.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.pr_code.Location = new System.Drawing.Point(240, 43);
+            this.pr_code.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
             this.pr_code.Name = "pr_code";
             this.pr_code.Power = null;
-            this.pr_code.Size = new System.Drawing.Size(165, 25);
+            this.pr_code.Size = new System.Drawing.Size(246, 35);
             this.pr_code.Str = null;
             this.pr_code.Str1 = null;
             this.pr_code.Str2 = null;
@@ -215,11 +223,11 @@
             | System.Windows.Forms.AnchorStyles.Left)));
             this.inputText.BackColor = System.Drawing.Color.White;
             this.inputText.ID = null;
-            this.inputText.Location = new System.Drawing.Point(148, 458);
-            this.inputText.Margin = new System.Windows.Forms.Padding(4);
+            this.inputText.Location = new System.Drawing.Point(222, 733);
+            this.inputText.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6);
             this.inputText.Name = "inputText";
             this.inputText.Power = null;
-            this.inputText.Size = new System.Drawing.Size(260, 25);
+            this.inputText.Size = new System.Drawing.Size(388, 35);
             this.inputText.Str = null;
             this.inputText.Str1 = null;
             this.inputText.Str2 = null;
@@ -230,26 +238,26 @@
             // OperateResult
             // 
             this.OperateResult.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.OperateResult.Location = new System.Drawing.Point(44, 135);
-            this.OperateResult.Margin = new System.Windows.Forms.Padding(4);
+            this.OperateResult.Location = new System.Drawing.Point(66, 216);
+            this.OperateResult.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6);
             this.OperateResult.Name = "OperateResult";
-            this.OperateResult.Size = new System.Drawing.Size(940, 296);
+            this.OperateResult.Size = new System.Drawing.Size(1408, 471);
             this.OperateResult.TabIndex = 186;
             this.OperateResult.Text = "";
             // 
             // Printer
             // 
-            this.Printer.Location = new System.Drawing.Point(462, 27);
-            this.Printer.Margin = new System.Windows.Forms.Padding(5);
+            this.Printer.Location = new System.Drawing.Point(693, 43);
+            this.Printer.Margin = new System.Windows.Forms.Padding(8, 8, 8, 8);
             this.Printer.Name = "Printer";
-            this.Printer.Size = new System.Drawing.Size(169, 31);
+            this.Printer.Size = new System.Drawing.Size(254, 50);
             this.Printer.TabIndex = 182;
             // 
             // Make_CustomLabelPrint
             // 
-            this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
+            this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 24F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(1028, 515);
+            this.ClientSize = new System.Drawing.Size(1542, 824);
             this.Controls.Add(this.PrintNum);
             this.Controls.Add(this.pr_spec);
             this.Controls.Add(this.pr_detail);
@@ -267,7 +275,7 @@
             this.Controls.Add(this.label2);
             this.Controls.Add(this.pr_code_label);
             this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
-            this.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
             this.Name = "Make_CustomLabelPrint";
             this.Tag = "Make!CustomLabelPrint";
             this.Text = "Make_CustomLabelPrint";

+ 35 - 4
UAS_MES_LGDZ/FunctionCode/Make/Make_CustomLabelPrint.cs

@@ -8,6 +8,7 @@ using System.Data;
 using System.Drawing;
 using System.IO;
 using System.Linq;
+using System.Net;
 using System.Text;
 using System.Text.RegularExpressions;
 using System.Threading;
@@ -100,10 +101,13 @@ namespace UAS_MES_NEW.Make
                     OperateResult.AppendText("<<产品:" + pr_code.Text + ",没有维护自定义模板\n", Color.Red, pr_code);
                     return;
                 }
+                string la_id = listA.Rows[0]["la_id"].ToString();
+                string la_code = listA.Rows[0]["la_code"].ToString();
                 if (listA.Rows[0]["la_isdefault"].ToString() != "-1")
                 {
                     //说明没有默认的模板,那就取pl_id最大的
-                    listA = (DataTable)dh.ExecuteSql("select la_code,la_id,substr(la_url,instr(la_url,'\\',-1)+1)la_name,la_url,la_isdefault from label where la_prodcode='" + pr_code.Text + "' and la_templatetype='自定义' and la_statuscode='AUDITED' order by la_isdefault", "select");
+                    listA = (DataTable)dh.ExecuteSql("select fp_name la_url,'" + la_id + "' la_id,'"+ la_code + "'la_code from FILEPATH where fp_id in (select *  from table(select parsestring(LA_SOFTTYPE,';') from label where la_id='" + la_id + "' ) where COLUMN_VALUE is not null)", "select");
+                    //listA = (DataTable)dh.ExecuteSql("select la_code,la_id,substr(la_url,instr(la_url,'\\',-1)+1)la_name,la_url,la_isdefault from label where la_prodcode='" + pr_code.Text + "' and la_templatetype='自定义' and la_statuscode='AUDITED' order by la_isdefault", "select");
                 }
                 //标签显示
                 PrintLabel.DataSource = listA;
@@ -142,14 +146,35 @@ namespace UAS_MES_NEW.Make
                     //下标为1的时候实例化存值的数组
                     if (currentIndex == 1)
                     {
+                        string fp_name = "";
                         inputValues = new string[paramsInfo.Rows.Count];
                         sb = new StringBuilder();
                         string filelastwritetime = dh.getFieldDataByCondition("label", "la_lastwritetime", "la_id = '" + listA.Rows[PrintLabel.SelectedIndex]["la_id"].ToString() + "'").ToString();
+                        string LA_SOFTTYPE = dh.getFieldDataByCondition("label", "LA_SOFTTYPE", "la_id = '" + listA.Rows[PrintLabel.SelectedIndex]["la_id"].ToString() + "'").ToString();
                         FileInfo PrintFile = new FileInfo(listA.Rows[PrintLabel.SelectedIndex]["la_url"].ToString());
-                        if (PrintFile == null)
+                        if (!PrintFile.Exists)
                         {
-                            MessageBox.Show("打印文件不存在");
-                            return;
+                            if (LA_SOFTTYPE != "")
+                            {
+                                string[] fpid = LA_SOFTTYPE.Split(';');
+                                for (int i = 0; i < fpid.Length; i++)
+                                {
+                                    if (fpid[i] != "")
+                                    {
+                                        DataTable label = (DataTable)dh.ExecuteSql("select FP_PATH, FP_DATE, FP_NAME from FILEPATH where fp_id='" + fpid[i] + "'", "select");
+                                        if (label.Rows.Count > 0)
+                                        {
+                                            string fp_path = label.Rows[0]["FP_PATH"].ToString().Replace("/app/uas/webapps/", "");
+                                            fp_name = label.Rows[0]["fp_name"].ToString();
+                                            WebClient wc = new WebClient();
+                                            wc.DownloadFile("http://172.16.30.253:8099/" + fp_path, @"C:\打印标签\" + fp_name);
+                                        }
+                                    }
+                                }
+                                engine.Stop();
+                                engine = new Engine(true);
+                                BaseUtil.WriteLbl();
+                            }
                         }
                         string filechangetime = PrintFile.LastWriteTime.ToString();
                         if (filechangetime != filelastwritetime)
@@ -159,6 +184,12 @@ namespace UAS_MES_NEW.Make
                             string update = "la_lastwritetime = to_date((regexp_substr('" + filechangetime + "','\\d+.+\\d+')),'yyyy-mm-dd hh24:mi:ss')";
                             dh.UpdateByCondition("label", update, "la_id = '" + listA.Rows[PrintLabel.SelectedIndex]["la_id"].ToString() + "'");
                         }
+                        format = engine.Documents.Open(@"C:\打印标签\" + listA.Rows[PrintLabel.SelectedIndex]["la_url"].ToString());
+                        if (format == null)
+                        {
+                            MessageBox.Show("标签文件打开失败");
+                            return;
+                        }
                         format = engine.Documents.Open(listA.Rows[PrintLabel.SelectedIndex]["la_url"].ToString());
                     }
                     //将值赋到format对应的变量

+ 1 - 1
UAS_MES_LGDZ/FunctionCode/Query/Query_SN.cs

@@ -120,7 +120,7 @@ namespace UAS_MES_NEW.Query
                 }
                 else
                 {
-                    dt = (DataTable)dh.ExecuteSql("select msl_sncode from makesnlist where msl_makecode='" + ma_code.Text + "' and msl_sncode='" + RePrintSn.Text + "' order by msl_sncode", "select");
+                    dt = (DataTable)dh.ExecuteSql("select msl_sncode from makesnlist left join makeimeilist on mil_sncode=msl_sncode and mil_makecode=msl_makecode where msl_makecode='" + ma_code.Text + "' and (msl_sncode='" + RePrintSn.Text + "' or mil_imei1='"+RePrintSn.Text+"' or mil_imei2='"+RePrintSn.Text + "')order by msl_sncode", "select");
                     if (dt.Rows.Count > 0)
                     {
                         string mil_sncode = dt.Rows[0]["msl_sncode"].ToString();

+ 6 - 6
UAS_MES_YD/FunctionCode/Make/Make_ColorBoxLoadPrint.cs

@@ -201,7 +201,7 @@ namespace UAS_MES_NEW.Make
                                         return;
                                     }
                                 }
-                                TSN.Add(code.Text.Substring(0, code.Text.Length > 80 ? 80 : code.Text.Length));
+                                TSN.Add(code.Text);
                                 if (sp_barcoderule == "BARCODE")
                                 {
                                     sp_soncode = ErrorMessage;
@@ -336,7 +336,7 @@ namespace UAS_MES_NEW.Make
                                     {
                                         CollectDataSonCode.Add(sp_soncode);
                                         SPID.Add(sp_id);
-                                        CollectData.Add(code.Text.Substring(0, code.Text.Length > 80 ? 80 : code.Text.Length));
+                                        CollectData.Add(code.Text);
                                         sn_code.Text = code.Text;
                                         OperateResult.AppendText(">>序列号" + code.Text + ",物料" + sp_soncode + "上料成功\n", Color.Green);
                                         RemainIndex = RemainIndex + 1;
@@ -446,16 +446,16 @@ namespace UAS_MES_NEW.Make
             CollectDataSonCode.Add(sp_soncode);
             //采集成功提示
 
-            CollectData.Add(code.Text.Substring(0, code.Text.Length > 80 ? 80 : code.Text.Length));
+            CollectData.Add(code.Text);
             if (!CheckBarcode.ContainsKey(sp_fsoncode))
             {
-                CheckBarcode.Add(sp_fsoncode, code.Text.Substring(0, code.Text.Length > 80 ? 80 : code.Text.Length));
+                CheckBarcode.Add(sp_fsoncode, code.Text);
             }
             SPID.Add(sp_id);
             OperateResult.AppendText(">>物料" + sp_soncode + "采集成功,条码" + code.Text + "\n", Color.Green);
             LabelDataGridView.Rows[RemainIndex].Cells["BarCode"].Value = code.Text;
-            if (code.Text.Length > 80)
-                OperateResult.AppendText(">>采集条码" + code.Text + "程度超过长度限制80,内容截取前80位进行采集\n", Color.Red);
+            //if (code.Text.Length > 80)
+            //    OperateResult.AppendText(">>采集条码" + code.Text + "程度超过长度限制80,内容截取前80位进行采集\n", Color.Red);
             code.Clear();
             RemainIndex = RemainIndex + 1;
             //如果+1后不小于B序列的长度,则已采集完成,不需要进行提示了

+ 4 - 4
UAS_MES_YD/FunctionCode/Make/Make_ColorBoxLoadPrintBZ.cs

@@ -200,7 +200,7 @@ namespace UAS_MES_NEW.Make
                                         return;
                                     }
                                 }
-                                TSN.Add(code.Text.Substring(0, code.Text.Length > 80 ? 80 : code.Text.Length));
+                                TSN.Add(code.Text);
                                 if (sp_barcoderule == "BARCODE")
                                 {
                                     sp_soncode = ErrorMessage;
@@ -335,7 +335,7 @@ namespace UAS_MES_NEW.Make
                                     {
                                         CollectDataSonCode.Add(sp_soncode);
                                         SPID.Add(sp_id);
-                                        CollectData.Add(code.Text.Substring(0, code.Text.Length > 80 ? 80 : code.Text.Length));
+                                        CollectData.Add(code.Text);
                                         sn_code.Text = code.Text;
                                         OperateResult.AppendText(">>序列号" + code.Text + ",物料" + sp_soncode + "上料成功\n", Color.Green);
                                         RemainIndex = RemainIndex + 1;
@@ -445,10 +445,10 @@ namespace UAS_MES_NEW.Make
             CollectDataSonCode.Add(sp_soncode);
             //采集成功提示
 
-            CollectData.Add(code.Text.Substring(0, code.Text.Length > 80 ? 80 : code.Text.Length));
+            CollectData.Add(code.Text);
             if (!CheckBarcode.ContainsKey(sp_fsoncode))
             {
-                CheckBarcode.Add(sp_fsoncode, code.Text.Substring(0, code.Text.Length > 80 ? 80 : code.Text.Length));
+                CheckBarcode.Add(sp_fsoncode, code.Text);
             }
             SPID.Add(sp_id);
             OperateResult.AppendText(">>物料" + sp_soncode + "采集成功,条码" + code.Text + "\n", Color.Green);

+ 4 - 4
UAS_MES_YD/FunctionCode/Make/Make_FeedingCollection.cs

@@ -185,7 +185,7 @@ namespace UAS_MES_NEW.Make
                                         return;
                                     }
                                 }
-                                TSN.Add(code.Text.Substring(0, code.Text.Length > 80 ? 80 : code.Text.Length));
+                                TSN.Add(code.Text);
                                 if (sp_barcoderule == "BARCODE")
                                 {
                                     sp_soncode = ErrorMessage;
@@ -324,7 +324,7 @@ namespace UAS_MES_NEW.Make
                                     {
                                         CollectDataSonCode.Add(sp_soncode);
                                         SPID.Add(sp_id);
-                                        CollectData.Add(code.Text.Substring(0, code.Text.Length > 80 ? 80 : code.Text.Length));
+                                        CollectData.Add(code.Text);
                                         sn_code.Text = code.Text;
                                         OperateResult.AppendText(">>序列号" + code.Text + ",物料" + sp_soncode + "上料成功\n", Color.Green);
                                         RemainIndex = RemainIndex + 1;
@@ -507,10 +507,10 @@ namespace UAS_MES_NEW.Make
             CollectDataSonCode.Add(sp_soncode);
             //采集成功提示
 
-            CollectData.Add(code.Text.Substring(0, code.Text.Length > 80 ? 80 : code.Text.Length));
+            CollectData.Add(code.Text);
             if (!CheckBarcode.ContainsKey(sp_fsoncode))
             {
-                CheckBarcode.Add(sp_fsoncode, code.Text.Substring(0, code.Text.Length > 80 ? 80 : code.Text.Length));
+                CheckBarcode.Add(sp_fsoncode, code.Text);
             }
             SPID.Add(sp_id);
             OperateResult.AppendText(">>物料" + sp_soncode + "采集成功,条码" + code.Text + "\n", Color.Green);

+ 5 - 5
UAS_MES_YD/FunctionCode/Make/Make_FeedingCollectionCombine.cs

@@ -327,7 +327,7 @@ namespace UAS_MES_NEW.Make
                                     {
                                         CollectDataSonCode.Add(sp_soncode);
                                         SPID.Add(sp_id);
-                                        CollectData.Add(code.Text.Substring(0, code.Text.Length > 80 ? 80 : code.Text.Length));
+                                        CollectData.Add(code.Text);
                                         sn_code.Text = code.Text;
                                         OperateResult.AppendText(">>序列号" + code.Text + ",物料" + sp_soncode + "上料成功\n", Color.Green);
                                         RemainIndex = RemainIndex + 1;
@@ -431,16 +431,16 @@ namespace UAS_MES_NEW.Make
         {
             CollectDataSonCode.Add(sp_soncode);
             //采集成功提示
-            CollectData.Add(code.Text.Substring(0, code.Text.Length > 80 ? 80 : code.Text.Length));
+            CollectData.Add(code.Text);
             if (!CheckBarcode.ContainsKey(sp_fsoncode))
             {
-                CheckBarcode.Add(sp_fsoncode, code.Text.Substring(0, code.Text.Length > 80 ? 80 : code.Text.Length));
+                CheckBarcode.Add(sp_fsoncode, code.Text);
             }
             SPID.Add(sp_id);
             OperateResult.AppendText(">>物料" + sp_soncode + "采集成功,条码" + code.Text + "\n", Color.Green);
             LabelDataGridView.Rows[RemainIndex].Cells["BarCode"].Value = code.Text;
-            if (code.Text.Length > 80)
-                OperateResult.AppendText(">>采集条码" + code.Text + "程度超过长度限制80,内容截取前80位进行采集\n", Color.Red);
+            //if (code.Text.Length > 80)
+            //    OperateResult.AppendText(">>采集条码" + code.Text + "程度超过长度限制80,内容截取前80位进行采集\n", Color.Red);
             code.Clear();
             RemainIndex = RemainIndex + 1;
             //如果+1后不小于B序列的长度,则已采集完成,不需要进行提示了

+ 6 - 6
UAS_MES_YD/FunctionCode/Make/Make_FeedingCollectionCombineFix.cs

@@ -264,7 +264,7 @@ namespace UAS_MES_NEW.Make
                                                 }
                                                 CollectDataSonCode.Add(sp_soncode);
                                                 SPID.Add(sp_id);
-                                                CollectData.Add(code.Text.Substring(0, code.Text.Length > 80 ? 80 : code.Text.Length));
+                                                CollectData.Add(code.Text);
                                                 LabelDataGridView.Rows[RemainIndex].Cells["BarCode"].Value = code.Text;
                                                 OperateResult.AppendText(">>条码" + code.Text + "上料成功\n", Color.Green, code);
                                                 SetCheck set = new SetCheck("OK", Color.Green);
@@ -470,7 +470,7 @@ namespace UAS_MES_NEW.Make
                                     {
                                         CollectDataSonCode.Add(sp_soncode);
                                         SPID.Add(sp_id);
-                                        CollectData.Add(code.Text.Substring(0, code.Text.Length > 80 ? 80 : code.Text.Length));
+                                        CollectData.Add(code.Text);
                                         sn_code.Text = code.Text;
                                         OperateResult.AppendText(">>序列号" + code.Text + ",物料" + sp_soncode + "上料成功\n", Color.Green);
                                         RemainIndex = RemainIndex + 1;
@@ -578,16 +578,16 @@ namespace UAS_MES_NEW.Make
         {
             CollectDataSonCode.Add(sp_soncode);
             //采集成功提示
-            CollectData.Add(code.Text.Substring(0, code.Text.Length > 80 ? 80 : code.Text.Length));
+            CollectData.Add(code.Text);
             if (!CheckBarcode.ContainsKey(sp_fsoncode))
             {
-                CheckBarcode.Add(sp_fsoncode, code.Text.Substring(0, code.Text.Length > 80 ? 80 : code.Text.Length));
+                CheckBarcode.Add(sp_fsoncode, code.Text);
             }
             SPID.Add(sp_id);
             OperateResult.AppendText(">>物料" + sp_soncode + "采集成功,条码" + code.Text + "\n", Color.Green);
             LabelDataGridView.Rows[RemainIndex].Cells["BarCode"].Value = code.Text;
-            if (code.Text.Length > 80)
-                OperateResult.AppendText(">>采集条码" + code.Text + "程度超过长度限制80,内容截取前80位进行采集\n", Color.Red);
+            //if (code.Text.Length > 80)
+            //    OperateResult.AppendText(">>采集条码" + code.Text + "程度超过长度限制80,内容截取前80位进行采集\n", Color.Red);
             code.Clear();
             RemainIndex = RemainIndex + 1;
             //如果+1后不小于B序列的长度,则已采集完成,不需要进行提示了

+ 1 - 1
UAS_MES_YD/FunctionCode/Query/Query_SN.cs

@@ -67,7 +67,7 @@ namespace UAS_MES_NEW.Query
                 MessageBox.Show("工单号不存在");
                 return;
             }
-            DataTable dt = (DataTable)dh.ExecuteSql("select msl_sncode from makesnlist where  msl_makecode='" + ma_code.Text + "'", "select");
+            DataTable dt = (DataTable)dh.ExecuteSql("select msl_sncode from makesnlist where  msl_makecode='" + ma_code.Text + "' order by msl_sncode", "select");
             if (dt.Rows.Count == 0)
             {
                 MessageBox.Show("工单号未生成SN");