Browse Source

导出BUG调整

callm 5 years ago
parent
commit
8fb117614e
1 changed files with 14 additions and 15 deletions
  1. 14 15
      UAS_MES_ODLF/DataOperate/ExcelHandler.cs

+ 14 - 15
UAS_MES_ODLF/DataOperate/ExcelHandler.cs

@@ -268,8 +268,8 @@ namespace UAS_MES_NEW.DataOperate
         /// <returns></returns>
         public MemoryStream DataTableToExcel_BAIDU(DataTable DataTable, DateTime begindate, int DateNum)
         {
-            string[] Step = new[] { "1-MT1", "2-MT2", "3-MMI", "4-RSA(耦合)", "5-AUD(曲线)", "6-THD(自播自录)", "7-SCK(验号)","投入数" };
-            string[] StepCode = new[] { "B_MT1", "B_MT2", "B_MMI", "B_RSA", "B_AUD", "B_THD", "B_SN", "B_OUTLOOK","B_LCDBA1" };
+            string[] Step = new[] { "1-MT1", "2-MT2", "3-MMI", "4-RSA(耦合)", "5-AUD(曲线)", "6-THD(自播自录)", "7-SCK(验号)" };
+            string[] StepCode = new[] { "B_MT1", "B_MT2", "B_MMI", "B_RSA", "B_AUD", "B_THD", "B_SN", "B_OUTLOOK" };
             string[] Kind = new[] { "测试数", "不良数", "误测数", "FPY", "RPY" };
             string[] TotalKind = new[] { "总投入数", "总不良数", "FPY", "RPY" };
             string[] OutLook = new[] { "测试数", "不良数", "FPY" };
@@ -517,7 +517,7 @@ namespace UAS_MES_NEW.DataOperate
                 {
                     int rowindex = 6 + j * 5;
                     DataTable dt = PublicMethod.BaseUtil.filterDataTable(DataTable, "sp_date='" + begindate.AddDays(i).ToString("yyyy-MM-dd") + "' and 工序编号='" + StepCode[j] + "'");
-                    if (StepCode[j] != "B_OUTLOOK" && StepCode[j] != "B_LCDBA1")
+                    if (StepCode[j] != "B_OUTLOOK")
                     {
                         for (int k = rowindex; k < rowindex + 5; k++)
                         {
@@ -608,7 +608,7 @@ namespace UAS_MES_NEW.DataOperate
                             }
                         }
                     }
-                    else if (StepCode[j] == "B_OUTLOOK")
+                    else
                     {
                         for (int k = rowindex; k < rowindex + 3; k++)
                         {
@@ -668,15 +668,14 @@ namespace UAS_MES_NEW.DataOperate
                             }
                         }
                     }
-                    else {
-                        double 投入数;
-                        if (dt.Rows.Count > 0)
-                        {
-                            if (double.TryParse(dt.Rows[0]["投入数"].ToString(), out 投入数))
-                            {
-                                TotalIN = 投入数;
-                            }
-                        }
+                }
+                DataTable dt1 = PublicMethod.BaseUtil.filterDataTable(DataTable, "sp_date='" + begindate.AddDays(i).ToString("yyyy-MM-dd") + "' and 工序编号='B_LCDBA1'");
+                double 投入数;
+                if (dt1.Rows.Count > 0)
+                {
+                    if (double.TryParse(dt1.Rows[0]["测试数"].ToString(), out 投入数))
+                    {
+                        TotalIN = 投入数;
                     }
                 }
 
@@ -694,12 +693,12 @@ namespace UAS_MES_NEW.DataOperate
                 row = sheet.GetRow(4);
                 cell = row.CreateCell(i + 2);
                 cell.CellStyle = LIGHT_GREEN;
-                cell.SetCellValue(TotalFPY==-1?0: TotalFPY);
+                cell.SetCellValue(TotalFPY == -1 ? 0 : TotalFPY);
 
                 row = sheet.GetRow(5);
                 cell = row.CreateCell(i + 2);
                 cell.CellStyle = LIGHT_CORNFLOWER_BLUE;
-                cell.SetCellValue(TotalRPY==-1?0: TotalRPY);
+                cell.SetCellValue(TotalRPY == -1 ? 0 : TotalRPY);
             }
             for (int i = 0; i < sheet.PhysicalNumberOfRows; i++)
             {