Browse Source

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

caosy 5 years ago
parent
commit
ca80ccfbf1

+ 29 - 37
UAS-出货标签管理(贸易版)/ExportExcel.Designer.cs

@@ -56,15 +56,15 @@
             this.M_Param2 = new System.Windows.Forms.CheckBox();
             this.M_Param3 = new System.Windows.Forms.CheckBox();
             this.H_Param3 = new System.Windows.Forms.CheckBox();
-            this.RowNum = new UAS_LabelMachine.CustomControl.NumOnlyTextBox();
             this.M_Param4 = new System.Windows.Forms.CheckBox();
             this.H_Param4 = new System.Windows.Forms.CheckBox();
+            this.RowNum = new UAS_LabelMachine.CustomControl.NumOnlyTextBox();
             this.SuspendLayout();
             // 
             // Export
             // 
             this.Export.Location = new System.Drawing.Point(584, 580);
-            this.Export.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.Export.Margin = new System.Windows.Forms.Padding(4);
             this.Export.Name = "Export";
             this.Export.Size = new System.Drawing.Size(188, 48);
             this.Export.TabIndex = 0;
@@ -79,7 +79,7 @@
             this.CH_BLUEFILM.CheckState = System.Windows.Forms.CheckState.Checked;
             this.CH_BLUEFILM.Font = new System.Drawing.Font("宋体", 10F);
             this.CH_BLUEFILM.Location = new System.Drawing.Point(260, 116);
-            this.CH_BLUEFILM.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.CH_BLUEFILM.Margin = new System.Windows.Forms.Padding(4);
             this.CH_BLUEFILM.Name = "CH_BLUEFILM";
             this.CH_BLUEFILM.Size = new System.Drawing.Size(125, 31);
             this.CH_BLUEFILM.TabIndex = 1;
@@ -89,11 +89,9 @@
             // CH_SPLITBATCH
             // 
             this.CH_SPLITBATCH.AutoSize = true;
-            this.CH_SPLITBATCH.Checked = true;
-            this.CH_SPLITBATCH.CheckState = System.Windows.Forms.CheckState.Checked;
             this.CH_SPLITBATCH.Font = new System.Drawing.Font("宋体", 10F);
             this.CH_SPLITBATCH.Location = new System.Drawing.Point(700, 116);
-            this.CH_SPLITBATCH.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.CH_SPLITBATCH.Margin = new System.Windows.Forms.Padding(4);
             this.CH_SPLITBATCH.Name = "CH_SPLITBATCH";
             this.CH_SPLITBATCH.Size = new System.Drawing.Size(152, 31);
             this.CH_SPLITBATCH.TabIndex = 3;
@@ -103,11 +101,9 @@
             // CH_PBCODE
             // 
             this.CH_PBCODE.AutoSize = true;
-            this.CH_PBCODE.Checked = true;
-            this.CH_PBCODE.CheckState = System.Windows.Forms.CheckState.Checked;
             this.CH_PBCODE.Font = new System.Drawing.Font("宋体", 10F);
             this.CH_PBCODE.Location = new System.Drawing.Point(260, 188);
-            this.CH_PBCODE.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.CH_PBCODE.Margin = new System.Windows.Forms.Padding(4);
             this.CH_PBCODE.Name = "CH_PBCODE";
             this.CH_PBCODE.Size = new System.Drawing.Size(98, 31);
             this.CH_PBCODE.TabIndex = 8;
@@ -117,11 +113,9 @@
             // CH_REMARK
             // 
             this.CH_REMARK.AutoSize = true;
-            this.CH_REMARK.Checked = true;
-            this.CH_REMARK.CheckState = System.Windows.Forms.CheckState.Checked;
             this.CH_REMARK.Font = new System.Drawing.Font("宋体", 10F);
             this.CH_REMARK.Location = new System.Drawing.Point(488, 188);
-            this.CH_REMARK.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.CH_REMARK.Margin = new System.Windows.Forms.Padding(4);
             this.CH_REMARK.Name = "CH_REMARK";
             this.CH_REMARK.Size = new System.Drawing.Size(152, 31);
             this.CH_REMARK.TabIndex = 9;
@@ -135,7 +129,7 @@
             this.ch_code.CheckState = System.Windows.Forms.CheckState.Checked;
             this.ch_code.Font = new System.Drawing.Font("宋体", 10F);
             this.ch_code.Location = new System.Drawing.Point(488, 116);
-            this.ch_code.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.ch_code.Margin = new System.Windows.Forms.Padding(4);
             this.ch_code.Name = "ch_code";
             this.ch_code.Size = new System.Drawing.Size(125, 31);
             this.ch_code.TabIndex = 10;
@@ -145,11 +139,9 @@
             // CH_WATERID
             // 
             this.CH_WATERID.AutoSize = true;
-            this.CH_WATERID.Checked = true;
-            this.CH_WATERID.CheckState = System.Windows.Forms.CheckState.Checked;
             this.CH_WATERID.Font = new System.Drawing.Font("宋体", 10F);
             this.CH_WATERID.Location = new System.Drawing.Point(904, 116);
-            this.CH_WATERID.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.CH_WATERID.Margin = new System.Windows.Forms.Padding(4);
             this.CH_WATERID.Name = "CH_WATERID";
             this.CH_WATERID.Size = new System.Drawing.Size(156, 31);
             this.CH_WATERID.TabIndex = 11;
@@ -205,7 +197,7 @@
             this.H_Param2.AutoSize = true;
             this.H_Param2.Font = new System.Drawing.Font("宋体", 10F);
             this.H_Param2.Location = new System.Drawing.Point(488, 346);
-            this.H_Param2.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.H_Param2.Margin = new System.Windows.Forms.Padding(4);
             this.H_Param2.Name = "H_Param2";
             this.H_Param2.Size = new System.Drawing.Size(156, 31);
             this.H_Param2.TabIndex = 17;
@@ -218,7 +210,7 @@
             this.H_Param1.AutoSize = true;
             this.H_Param1.Font = new System.Drawing.Font("宋体", 10F);
             this.H_Param1.Location = new System.Drawing.Point(260, 346);
-            this.H_Param1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.H_Param1.Margin = new System.Windows.Forms.Padding(4);
             this.H_Param1.Name = "H_Param1";
             this.H_Param1.Size = new System.Drawing.Size(156, 31);
             this.H_Param1.TabIndex = 18;
@@ -231,7 +223,7 @@
             this.M_Param1.AutoSize = true;
             this.M_Param1.Font = new System.Drawing.Font("宋体", 10F);
             this.M_Param1.Location = new System.Drawing.Point(260, 266);
-            this.M_Param1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.M_Param1.Margin = new System.Windows.Forms.Padding(4);
             this.M_Param1.Name = "M_Param1";
             this.M_Param1.Size = new System.Drawing.Size(156, 31);
             this.M_Param1.TabIndex = 19;
@@ -266,7 +258,7 @@
             this.BatchCode.AutoSize = true;
             this.BatchCode.Font = new System.Drawing.Font("宋体", 10F);
             this.BatchCode.Location = new System.Drawing.Point(260, 432);
-            this.BatchCode.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.BatchCode.Margin = new System.Windows.Forms.Padding(4);
             this.BatchCode.Name = "BatchCode";
             this.BatchCode.Size = new System.Drawing.Size(124, 31);
             this.BatchCode.TabIndex = 22;
@@ -278,7 +270,7 @@
             this.BoxCode.AutoSize = true;
             this.BoxCode.Font = new System.Drawing.Font("宋体", 10F);
             this.BoxCode.Location = new System.Drawing.Point(444, 432);
-            this.BoxCode.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.BoxCode.Margin = new System.Windows.Forms.Padding(4);
             this.BoxCode.Name = "BoxCode";
             this.BoxCode.Size = new System.Drawing.Size(97, 31);
             this.BoxCode.TabIndex = 23;
@@ -291,7 +283,7 @@
             this.FixRow.Checked = true;
             this.FixRow.Font = new System.Drawing.Font("宋体", 10F);
             this.FixRow.Location = new System.Drawing.Point(612, 432);
-            this.FixRow.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.FixRow.Margin = new System.Windows.Forms.Padding(4);
             this.FixRow.Name = "FixRow";
             this.FixRow.Size = new System.Drawing.Size(151, 31);
             this.FixRow.TabIndex = 24;
@@ -315,7 +307,7 @@
             this.FirstPage_WID.AutoSize = true;
             this.FirstPage_WID.Font = new System.Drawing.Font("宋体", 10F);
             this.FirstPage_WID.Location = new System.Drawing.Point(260, 508);
-            this.FirstPage_WID.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.FirstPage_WID.Margin = new System.Windows.Forms.Padding(4);
             this.FirstPage_WID.Name = "FirstPage_WID";
             this.FirstPage_WID.Size = new System.Drawing.Size(210, 31);
             this.FirstPage_WID.TabIndex = 29;
@@ -327,7 +319,7 @@
             this.FirstPage_YIELD.AutoSize = true;
             this.FirstPage_YIELD.Font = new System.Drawing.Font("宋体", 10F);
             this.FirstPage_YIELD.Location = new System.Drawing.Point(488, 508);
-            this.FirstPage_YIELD.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.FirstPage_YIELD.Margin = new System.Windows.Forms.Padding(4);
             this.FirstPage_YIELD.Name = "FirstPage_YIELD";
             this.FirstPage_YIELD.Size = new System.Drawing.Size(98, 31);
             this.FirstPage_YIELD.TabIndex = 31;
@@ -339,7 +331,7 @@
             this.FirstPage_REMARK.AutoSize = true;
             this.FirstPage_REMARK.Font = new System.Drawing.Font("宋体", 10F);
             this.FirstPage_REMARK.Location = new System.Drawing.Point(608, 508);
-            this.FirstPage_REMARK.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.FirstPage_REMARK.Margin = new System.Windows.Forms.Padding(4);
             this.FirstPage_REMARK.Name = "FirstPage_REMARK";
             this.FirstPage_REMARK.Size = new System.Drawing.Size(98, 31);
             this.FirstPage_REMARK.TabIndex = 32;
@@ -349,7 +341,7 @@
             // ExportSetting
             // 
             this.ExportSetting.Location = new System.Drawing.Point(402, 580);
-            this.ExportSetting.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.ExportSetting.Margin = new System.Windows.Forms.Padding(4);
             this.ExportSetting.Name = "ExportSetting";
             this.ExportSetting.Size = new System.Drawing.Size(160, 48);
             this.ExportSetting.TabIndex = 33;
@@ -396,16 +388,6 @@
             this.H_Param3.UseVisualStyleBackColor = true;
             this.H_Param3.Visible = false;
             // 
-            // RowNum
-            // 
-            this.RowNum.Location = new System.Drawing.Point(960, 428);
-            this.RowNum.Margin = new System.Windows.Forms.Padding(4);
-            this.RowNum.Name = "RowNum";
-            this.RowNum.Negative = false;
-            this.RowNum.Size = new System.Drawing.Size(100, 35);
-            this.RowNum.TabIndex = 30;
-            this.RowNum.Text = "10";
-            // 
             // M_Param4
             // 
             this.M_Param4.AutoSize = true;
@@ -432,6 +414,16 @@
             this.H_Param4.UseVisualStyleBackColor = true;
             this.H_Param4.Visible = false;
             // 
+            // RowNum
+            // 
+            this.RowNum.Location = new System.Drawing.Point(960, 428);
+            this.RowNum.Margin = new System.Windows.Forms.Padding(4);
+            this.RowNum.Name = "RowNum";
+            this.RowNum.Negative = false;
+            this.RowNum.Size = new System.Drawing.Size(100, 35);
+            this.RowNum.TabIndex = 30;
+            this.RowNum.Text = "10";
+            // 
             // ExportExcel
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 24F);
@@ -467,7 +459,7 @@
             this.Controls.Add(this.CH_SPLITBATCH);
             this.Controls.Add(this.CH_BLUEFILM);
             this.Controls.Add(this.Export);
-            this.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.Margin = new System.Windows.Forms.Padding(4);
             this.Name = "ExportExcel";
             this.Text = "导出数据";
             this.Load += new System.EventHandler(this.ExportExcel_Load);

+ 18 - 1
UAS-出货标签管理(贸易版)/ExportExcel.cs

@@ -5,8 +5,10 @@ using System.Data;
 using System.Drawing;
 using System.Linq;
 using System.Text;
+using System.Threading;
 using System.Windows.Forms;
 using UAS_LabelMachine.Entity;
+using UAS_LabelMachine.PublicForm;
 using UAS_LabelMachine.PublicMethod;
 
 namespace UAS_LabelMachine
@@ -18,6 +20,8 @@ namespace UAS_LabelMachine
         DataHelper dh = SystemInf.dh;
         string inoutno;
 
+        SetLoadingWindow stw;
+
         public ExportExcel(string pi_inoutno)
         {
             InitializeComponent();
@@ -29,8 +33,20 @@ namespace UAS_LabelMachine
         {
             ExportFileDialog.Description = "选择导出的路径";
             DialogResult result = ExportFileDialog.ShowDialog();
-            string custcode = dh.getFieldDataByCondition("prodinout", "pi_cardcode", "pi_inoutno='" + inoutno + "'").ToString();
             if (result == DialogResult.OK)
+            {
+                Thread thread = new Thread(ExportMethod);
+                stw = new SetLoadingWindow(thread, "正在导出数据");
+                BaseUtil.SetFormCenter(stw);
+                stw.ShowDialog();
+            }
+        }
+
+        private void ExportMethod()
+        {
+
+            string custcode = dh.getFieldDataByCondition("prodinout", "pi_cardcode", "pi_inoutno='" + inoutno + "'").ToString();
+
             {
                 StringBuilder sql = new StringBuilder();
                 List<CheckBox> conditionbox = new List<CheckBox>();
@@ -169,6 +185,7 @@ namespace UAS_LabelMachine
                 if (i <= 4)
                 {
                     Controls["H_Param" + (i + 1)].Visible = true;
+                    ((CheckBox)Controls["H_Param" + (i + 1)]).Checked = true;
                     Controls["H_Param" + (i + 1)].Text = dt.Rows[i]["cep_name"].ToString();
                 }
             }

+ 0 - 1
UAS-出货标签管理(贸易版)/PublicMethod/DataHelper.cs

@@ -824,7 +824,6 @@ namespace UAS_LabelMachine
         {
             object result = null;
             command = new OracleCommand(SQL, connection);
-            //Console.WriteLine(SQL);
             //用来拼接参数的
             if (names.Length > 0)
             {

+ 31 - 20
UAS-出货标签管理(贸易版)/PublicMethod/ExcelHandler.cs

@@ -186,7 +186,7 @@ namespace UAS_LabelMachine
                 return null;
             }
         }
-        int RowHeight = 11;
+        int RowHeight = 12;
         /// <summary>
         /// 将DataTable形式的数据转成Excel格式的,然后用字节流的形式写入文件
         /// </summary>
@@ -278,22 +278,23 @@ namespace UAS_LabelMachine
             HSSFWorkbook book = new HSSFWorkbook();
             //Excel中的Sheet
             ISheet sheet = book.CreateSheet("分页");
-            sheet.SetMargin(MarginType.TopMargin, 0.5);
-            sheet.SetMargin(MarginType.BottomMargin, 0.5);
-            sheet.SetMargin(MarginType.LeftMargin, 0.5);
-            sheet.SetMargin(MarginType.RightMargin, 0.5);
+            sheet.SetMargin(MarginType.TopMargin, 0.4);
+            sheet.SetMargin(MarginType.BottomMargin, 0.4);
+            sheet.SetMargin(MarginType.LeftMargin, 0.4);
+            sheet.SetMargin(MarginType.RightMargin, 0.4);
             //芯片号需要作为更新盒号的条件
+            HSSFFont ffont = (HSSFFont)book.CreateFont();
+            ffont.FontName = "宋体";
             bool ShowChcode = true;
             //更新箱号
-            List<string> ch_code = new List<string>();
+            List<string> pib_id = new List<string>();
             //系统打印箱号
             List<string> pib_outboxcode1 = new List<string>();
-
             int BoxCode = 1;
             ICellStyle style = book.CreateCellStyle();
             style.VerticalAlignment = VerticalAlignment.Center;
             style.Alignment = NPOI.SS.UserModel.HorizontalAlignment.Left;
-
+            style.SetFont(ffont);
             ICellStyle styleborder = book.CreateCellStyle();
             styleborder.BorderBottom = NPOI.SS.UserModel.BorderStyle.Thin;
             styleborder.BorderTop = NPOI.SS.UserModel.BorderStyle.Thin;
@@ -301,6 +302,7 @@ namespace UAS_LabelMachine
             styleborder.BorderRight = NPOI.SS.UserModel.BorderStyle.Thin;
             styleborder.VerticalAlignment = VerticalAlignment.Center;
             styleborder.Alignment = NPOI.SS.UserModel.HorizontalAlignment.Left;
+            styleborder.SetFont(ffont);
             string pi_inoutno = "";
             //设置列的宽度,根据首行的列的内容的长度来设置
             for (int i = DataTable.Columns.Count - 1; i > 0; i--)
@@ -369,9 +371,12 @@ namespace UAS_LabelMachine
             //固定第一行
             //row.RowStyle.IsLocked=true;
             //给第一行的标签赋值样式和值
+            // ffont.FontHeight = 13;
             row.CreateCell(0);
-            row.Cells[0].SetCellValue("                     深爱半导体股份有限公司芯片出货清单");
-            row.GetCell(0).CellStyle = style;
+            row.Cells[0].SetCellValue("                                       深爱半导体股份有限公司芯片出货清单");
+
+            row.GetCell(0).CellStyle.SetFont((ffont));
+            //ffont.FontHeight = 10;
             //开始绘制的Index
             int PaintIndex = 1;
             int sumCount = 0;
@@ -448,6 +453,7 @@ namespace UAS_LabelMachine
                             sumCount = 0;
                             row1 = sheet.CreateRow(PaintIndex);
                             sheet.SetRowBreak(PaintIndex - 1);
+                            sheet.Footer.Center = "第&P页,共&N页";
                             PaintIndex = PaintIndex + 1;
                         }
                         //每次到了页数开始分页
@@ -463,7 +469,7 @@ namespace UAS_LabelMachine
                                         row1.CreateCell(j);
                                         row1.Cells[j].SetCellValue(DataTable.Rows[i]["pi_title"].ToString());
                                     }
-                                    else if (j > 5 && j == columnNum - 5)
+                                    else if (j == 4)
                                     {
                                         row1.CreateCell(j);
                                         row1.Cells[j].SetCellValue(DataTable.Rows[i]["pi_inoutno"].ToString());
@@ -489,7 +495,7 @@ namespace UAS_LabelMachine
                                         row1.CreateCell(j);
                                         row1.Cells[j].SetCellValue(DataTable.Rows[i]["pr_orispeccode"].ToString() + DataTable.Rows[i]["me_desc"].ToString() + DataTable.Rows[i]["pr_size"].ToString());
                                     }
-                                    else if (columnNum > 5 && j == columnNum - 5)
+                                    else if (j == 4)
                                     {
                                         row1.CreateCell(j);
                                         row1.Cells[j].SetCellValue(DataTable.Rows[i]["pi_date"].ToString());
@@ -529,7 +535,7 @@ namespace UAS_LabelMachine
                                         NumIndex = j;
                                     }
                                     //如果chw_itemname1的值为空,则值为100和0,其中一列不显示,不显示
-                                    if (DataTable.Columns[j].ColumnName.ToLower().Contains("chw_itemname") || DataTable.Columns[j].ColumnName.ToLower().Contains("pr_orispeccode") || DataTable.Columns[j].ColumnName.ToLower().Contains("pd_ordercode") || DataTable.Columns[j].ColumnName.ToLower().Contains("pr_size") || DataTable.Columns[j].ColumnName.ToLower().Contains("me_desc") || (!ShowChcode && DataTable.Columns[j].ColumnName.ToLower().Contains("ch_code")))
+                                    if (DataTable.Columns[j].ColumnName.ToLower().Contains("pib_id") || DataTable.Columns[j].ColumnName.ToLower().Contains("chw_itemname") || DataTable.Columns[j].ColumnName.ToLower().Contains("pr_orispeccode") || DataTable.Columns[j].ColumnName.ToLower().Contains("pd_ordercode") || DataTable.Columns[j].ColumnName.ToLower().Contains("pr_size") || DataTable.Columns[j].ColumnName.ToLower().Contains("me_desc") || (!ShowChcode && DataTable.Columns[j].ColumnName.ToLower().Contains("ch_code")))
                                     {
                                         sheet.SetColumnHidden(j - 4, true);
                                     }
@@ -621,9 +627,10 @@ namespace UAS_LabelMachine
                                 row1.Cells[j].CellStyle = style;
                             }
                             sheet.SetRowBreak(PaintIndex);
+                            sheet.Footer.Center = "第&P页,共&N页";
                             PaintIndex = PaintIndex + 1;
                         }
-                        ch_code.Add(DataTable.Rows[i]["ch_code"].ToString());
+                        pib_id.Add(DataTable.Rows[i]["pib_id"].ToString());
                         pib_outboxcode1.Add(BoxCode.ToString());
                     }
                     for (int i = 0; i < sheet.LastRowNum; i++)
@@ -662,6 +669,7 @@ namespace UAS_LabelMachine
                             sumCount = 0;
                             row1 = sheet.CreateRow(PaintIndex);
                             sheet.SetRowBreak(PaintIndex - 1);
+                            sheet.Footer.Center = "第&P页,共&N页";
                             PaintIndex = PaintIndex + 1;
                         }
                         //每次到了页数开始分页
@@ -727,7 +735,7 @@ namespace UAS_LabelMachine
                                     }
                                     else
                                         row1.Cells[j - 4].SetCellValue(DataTable.Columns[j].Caption);
-                                    if (DataTable.Columns[j].ColumnName.ToLower().Contains("chw_itemname") || DataTable.Columns[j].ColumnName.ToLower().Contains("pr_orispeccode") || DataTable.Columns[j].ColumnName.ToLower().Contains("pd_ordercode") || DataTable.Columns[j].ColumnName.ToLower().Contains("pr_size") || DataTable.Columns[j].ColumnName.ToLower().Contains("me_desc") || (!ShowChcode && DataTable.Columns[j].ColumnName.ToLower().Contains("ch_code")))
+                                    if (DataTable.Columns[j].ColumnName.ToLower().Contains("pib_id") || DataTable.Columns[j].ColumnName.ToLower().Contains("chw_itemname") || DataTable.Columns[j].ColumnName.ToLower().Contains("pr_orispeccode") || DataTable.Columns[j].ColumnName.ToLower().Contains("pd_ordercode") || DataTable.Columns[j].ColumnName.ToLower().Contains("pr_size") || DataTable.Columns[j].ColumnName.ToLower().Contains("me_desc") || (!ShowChcode && DataTable.Columns[j].ColumnName.ToLower().Contains("ch_code")))
                                     {
                                         sheet.SetColumnHidden(j - 4, true);
                                     }
@@ -806,9 +814,10 @@ namespace UAS_LabelMachine
                                 row1.Cells[j].CellStyle = style;
                             }
                             sheet.SetRowBreak(PaintIndex);
+                            sheet.Footer.Center = "第&P页,共&N页";
                             PaintIndex = PaintIndex + 1;
                         }
-                        ch_code.Add(DataTable.Rows[i]["ch_code"].ToString());
+                        pib_id.Add(DataTable.Rows[i]["pib_id"].ToString());
                         pib_outboxcode1.Add(BoxCode.ToString());
                     }
                     for (int i = 0; i < sheet.LastRowNum; i++)
@@ -847,6 +856,7 @@ namespace UAS_LabelMachine
                             sumCount = 0;
                             row1 = sheet.CreateRow(PaintIndex);
                             sheet.SetRowBreak(PaintIndex - 1);
+                            sheet.Footer.Center = "第&P页,共&N页";
                             PaintIndex = PaintIndex + 1;
                         }
                         //每次到了页数开始分页
@@ -923,7 +933,7 @@ namespace UAS_LabelMachine
                                     }
                                     else
                                         row1.Cells[j - 4].SetCellValue(DataTable.Columns[j].Caption);
-                                    if (DataTable.Columns[j].ColumnName.ToLower().Contains("chw_itemname") || DataTable.Columns[j].ColumnName.ToLower().Contains("pr_orispeccode") || DataTable.Columns[j].ColumnName.ToLower().Contains("pd_ordercode") || DataTable.Columns[j].ColumnName.ToLower().Contains("pr_size") || DataTable.Columns[j].ColumnName.ToLower().Contains("me_desc") || (!ShowChcode && DataTable.Columns[j].ColumnName.ToLower().Contains("ch_code")))
+                                    if (DataTable.Columns[j].ColumnName.ToLower().Contains("pib_id") || DataTable.Columns[j].ColumnName.ToLower().Contains("chw_itemname") || DataTable.Columns[j].ColumnName.ToLower().Contains("pr_orispeccode") || DataTable.Columns[j].ColumnName.ToLower().Contains("pd_ordercode") || DataTable.Columns[j].ColumnName.ToLower().Contains("pr_size") || DataTable.Columns[j].ColumnName.ToLower().Contains("me_desc") || (!ShowChcode && DataTable.Columns[j].ColumnName.ToLower().Contains("ch_code")))
                                     {
                                         sheet.SetColumnHidden(j - 4, true);
                                     }
@@ -1002,9 +1012,10 @@ namespace UAS_LabelMachine
                                 row1.Cells[j].CellStyle = style;
                             }
                             sheet.SetRowBreak(PaintIndex);
+                            sheet.Footer.Center = "第&P页,共&N页";
                             PaintIndex = PaintIndex + 1;
                         }
-                        ch_code.Add(DataTable.Rows[i]["ch_code"].ToString());
+                        pib_id.Add(DataTable.Rows[i]["pib_id"].ToString());
                         pib_outboxcode1.Add(BoxCode.ToString());
                     }
                     for (int i = 0; i < sheet.LastRowNum; i++)
@@ -1019,7 +1030,7 @@ namespace UAS_LabelMachine
                 default:
                     break;
             }
-            dh.BatchInsert("update prodiobarcode set pib_outboxcode1=:pib_outboxcode1 where pib_inoutno='" + Inoutno + "' and pib_custbarcode=:pib_custbarcode", new string[] { "pib_outboxcode1", "pib_custbarcode" }, pib_outboxcode1.ToArray(), ch_code.ToArray());
+            dh.BatchInsert("update prodiobarcode set pib_outboxcode1=:pib_outboxcode1 where pib_inoutno='" + Inoutno + "' and pib_id=:pib_id", new string[] { "pib_outboxcode1", "pib_id" }, pib_outboxcode1.ToArray(), pib_id.ToArray());
             //删除下载链接再重新插入
             HttpHandler.GenDownLoadLinK(Inoutno);
             //填充首页
@@ -1029,7 +1040,7 @@ namespace UAS_LabelMachine
             ISheet sheet2 = book.CreateSheet("首页");
             row = sheet2.CreateRow(0);
             row.CreateCell(0);
-            row.Cells[0].SetCellValue("                     深爱半导体股份有限公司芯片出货清单");
+            row.Cells[0].SetCellValue("                            深爱半导体股份有限公司芯片出货清单");
             row.GetCell(0).CellStyle = style;
             rowNum = FirstDT.Rows.Count;
             //不需要显示的列移除

+ 12 - 5
UAS-出货标签管理(贸易版)/PublicMethod/HttpHandler.cs

@@ -88,14 +88,21 @@ namespace UAS_LabelMachine.PublicMethod
         {
             SystemInf.dh.ExecuteSql("delete from ProdDownLink where pl_inoutno='" + Inoutno + "'", "delete");
             SystemInf.dh.ExecuteSql("insert into ProdDownLink(pl_inoutno,pl_outboxcode) select distinct '" + Inoutno + "',pib_outboxcode1 from prodiobarcode where pib_inoutno='" + Inoutno + "'", "insert");
-            //string url = "http://localhost:8080/uas_war_exploded/common/form/reqDemo.action?Pi_inoutno=" + Inoutno;//html调用的地址              
-            string url = DataHelper.ERPAddesss + "common/form/reqDemo.action?Pi_inoutno=" + Inoutno;//html调用的地址              
+            SystemInf.dh.GetConfig("DownLoadLink", "Prodinout!Down");
+            string url = SystemInf.dh.GetConfig("DownLoadLink", "Prodinout!Down") + "/common/form/reqDemo.action?Pi_inoutno=" + Inoutno;//html调用的地址              
             HttpWebRequest webrequest = (HttpWebRequest)WebRequest.Create(url);
-            if (webrequest == null)
+            try
+            {
+                if (webrequest == null)
+                {
+                    return false;
+                }
+                WebResponse myResponse = webrequest.GetResponse();
+            }
+            catch (Exception e)
             {
-                return false;
+                LogManager.DoLog(e.Message + e.StackTrace);
             }
-            WebResponse myResponse = webrequest.GetResponse();
             return true;
         }
     }

+ 3 - 1
UAS-出货标签管理(贸易版)/SQL/SQL.txt

@@ -330,4 +330,6 @@ begin
   on pi_id=pd_piid left join chip_in_out on io_piid=pi_id and pd_id=io_pdid left join chip on ch_code=io_chipcode left join CHIP_WAFERTEST_VIEW on ch_code=chw_chipcode 
   left join CHIP_EDCDATA_VIEW on che_chipcode=ch_code left join product on pr_code=pd_prodcode left join prodiobarcode on 
   pib_piid=pi_id and pib_custbarcode=ch_code where pi_inoutno='''||v_inoutno||''' order by ch_code';
-end;
+end;
+
+insert into configs(id,caller,code,data) values(configs_seq.nextval,'Prodinout!Down','DownLoadLink','http://sisemi03.zicp.io/ERP');

+ 5 - 6
UAS-出货标签管理(贸易版)/UAS_出货标签管理.cs

@@ -1019,7 +1019,7 @@ namespace UAS_LabelMachine
             sql.Clear();
             sql.Append("select to_char(nvl(cl_date,sysdate),'YYYY-MM-DD HH24:Mi:SS') cl_date,cl_labelname,cl_isdefault,la_id||'#'||cl_labelurl||'#'||to_char(cl_date,'YYYY-MM-DD HH24:Mi:SS') ");
             sql.Append(" la_id,cl_custcode from customerlabel left join customer on cu_code=cl_custcode left join label on la_code=CL_LABELCODE where (cl_custcode='" + cu_code.Text + "' ");
-            sql.Append(" or cl_custcode is null) and cl_labeltype='单盘' order by cl_custcode");
+            sql.Append(" or cl_custcode is null) and cl_labeltype='单盘' order by cl_labelname");
             dt = (DataTable)dh.ExecuteSql(sql.ToString(), "select");
             SingleLabelCombox.DisplayMember = "cl_labelname";
             SingleLabelCombox.ValueMember = "la_id";
@@ -1057,7 +1057,7 @@ namespace UAS_LabelMachine
             sql.Clear();
             sql.Append("select to_char(nvl(cl_date,sysdate),'YYYY-MM-DD HH24:Mi:SS') cl_date,cl_labelname,cl_isdefault,la_id||'#'||cl_labelurl||'#'||to_char(cl_date,'YYYY-MM-DD HH24:Mi:SS') ");
             sql.Append(" la_id,cl_custcode from customerlabel left join customer on cu_code=cl_custcode left join label on la_code=CL_LABELCODE where (cl_custcode='" + cu_code.Text + "' ");
-            sql.Append(" or cl_custcode is null) and cl_labeltype='中盒' order by cl_custcode");
+            sql.Append(" or cl_custcode is null) and cl_labeltype='中盒' order by cl_labelname");
             dt = (DataTable)dh.ExecuteSql(sql.ToString(), "select");
             MidLabelCombox.DisplayMember = "cl_labelname";
             MidLabelCombox.ValueMember = "la_id";
@@ -1097,7 +1097,7 @@ namespace UAS_LabelMachine
             sql.Clear();
             sql.Append("select to_char(nvl(cl_date,sysdate),'YYYY-MM-DD HH24:Mi:SS') cl_date,cl_labelname,cl_isdefault,la_id||'#'||cl_labelurl||'#'||to_char(cl_date,'YYYY-MM-DD HH24:Mi:SS') ");
             sql.Append(" la_id,cl_custcode from customerlabel left join customer on cu_code=cl_custcode left join label on la_code=CL_LABELCODE where (cl_custcode='" + cu_code.Text + "' ");
-            sql.Append(" or cl_custcode is null) and cl_labeltype='外箱' order by cl_custcode");
+            sql.Append(" or cl_custcode is null) and cl_labeltype='外箱' order by cl_labelname");
             dt = (DataTable)dh.ExecuteSql(sql.ToString(), "select");
             OutBoxCombox.DisplayMember = "cl_labelname";
             OutBoxCombox.ValueMember = "la_id";
@@ -1356,7 +1356,6 @@ namespace UAS_LabelMachine
 
         private void MidBoxLabelPrint()
         {
-            HttpHandler.GenDownLoadLinK(pi_inoutno.Text);
             if (MidLabelNum.Text == "")
             {
                 int begin = 0;
@@ -1592,7 +1591,7 @@ namespace UAS_LabelMachine
                             {
                                 updateCondition += " and pib_lotno='" + dt.Rows[i]["pib_lotno"].ToString() + "'";
                             }
-                            dh.ExecuteSql("update prodiobarcode set pib_custoutboxcode='" + custoutboxcode + "' where pib_id in(select pib_id from prodiobarcode left join prodinout on pib_inoutno=pi_inoutno left join prodiodetail on pd_piid=pi_id and pib_prodcode=pd_prodcode where pib_inoutno='" + pi_inoutno.Text + "' and pib_outboxcode2='" + pib_outboxcode2 + "' "+ updateCondition + " )", "update");
+                            dh.ExecuteSql("update prodiobarcode set pib_custoutboxcode='" + custoutboxcode + "' where pib_id in(select pib_id from prodiobarcode left join prodinout on pib_inoutno=pi_inoutno left join prodiodetail on pd_piid=pi_id and pib_prodcode=pd_prodcode where pib_inoutno='" + pi_inoutno.Text + "' and pib_outboxcode2='" + pib_outboxcode2 + "' " + updateCondition + " )", "update");
                             dh.UpdateByCondition("RuleMaxNum", "rmn_maxnumber='" + custserialnum + "'", "rmn_nrcode='" + NrCode + "' and rmn_prefix='" + Prefix + "'");
                         }
                     }
@@ -2784,7 +2783,7 @@ namespace UAS_LabelMachine
         {
             MidFormat = engine.Documents.Open(ftpOperater.DownLoadTo + MidLabelCombox.Text);
             Resolution re = new Resolution(ImageResolution.Printer);
-            MidFormat.ExportImageToFile(@"C:\打印标签\"+ MidLabelCombox.Text + ".jpg",ImageType.JPEG, Seagull.BarTender.Print.ColorDepth.Mono, re, OverwriteOptions.DoNotOverwrite);
+            MidFormat.ExportImageToFile(@"C:\打印标签\" + MidLabelCombox.Text + ".jpg", ImageType.JPEG, Seagull.BarTender.Print.ColorDepth.Mono, re, OverwriteOptions.DoNotOverwrite);
             PreViewWindow pre = new PreViewWindow(MidLabelCombox.Text);
             pre.StartPosition = FormStartPosition.CenterScreen;
             pre.ShowDialog();