Ver Fonte

质量报表的合计调整

姜永辉 há 5 dias atrás
pai
commit
40488275e7

+ 11 - 11
DK.Client/ReportModule/R04/M01/F_RPT_040105.Designer.cs

@@ -70,8 +70,8 @@
             this.subGoodstypecode = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.ProductionLineName = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.dtsource = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.Kilncode = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.goodstypecode = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.Kilncode = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.OutKilnCount = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.GCount = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.OutGCount = new System.Windows.Forms.DataGridViewTextBoxColumn();
@@ -388,8 +388,8 @@
             this.subGoodstypecode,
             this.ProductionLineName,
             this.dtsource,
-            this.Kilncode,
             this.goodstypecode,
+            this.Kilncode,
             this.OutKilnCount,
             this.GCount,
             this.OutGCount,
@@ -472,14 +472,6 @@
             this.dtsource.ReadOnly = true;
             this.dtsource.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
             // 
-            // Kilncode
-            // 
-            this.Kilncode.DataPropertyName = "Kilncode";
-            this.Kilncode.HeaderText = "窑炉编码";
-            this.Kilncode.Name = "Kilncode";
-            this.Kilncode.ReadOnly = true;
-            this.Kilncode.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
-            // 
             // goodstypecode
             // 
             this.goodstypecode.DataPropertyName = "goodstypename2";
@@ -488,6 +480,14 @@
             this.goodstypecode.ReadOnly = true;
             this.goodstypecode.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
             // 
+            // Kilncode
+            // 
+            this.Kilncode.DataPropertyName = "Kilncode";
+            this.Kilncode.HeaderText = "窑炉编码";
+            this.Kilncode.Name = "Kilncode";
+            this.Kilncode.ReadOnly = true;
+            this.Kilncode.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
+            // 
             // OutKilnCount
             // 
             this.OutKilnCount.DataPropertyName = "OutKilnCount";
@@ -695,8 +695,8 @@
         private System.Windows.Forms.DataGridViewTextBoxColumn subGoodstypecode;
         private System.Windows.Forms.DataGridViewTextBoxColumn ProductionLineName;
         private System.Windows.Forms.DataGridViewTextBoxColumn dtsource;
-        private System.Windows.Forms.DataGridViewTextBoxColumn Kilncode;
         private System.Windows.Forms.DataGridViewTextBoxColumn goodstypecode;
+        private System.Windows.Forms.DataGridViewTextBoxColumn Kilncode;
         private System.Windows.Forms.DataGridViewTextBoxColumn OutKilnCount;
         private System.Windows.Forms.DataGridViewTextBoxColumn GCount;
         private System.Windows.Forms.DataGridViewTextBoxColumn OutGCount;

+ 10 - 34
DK.Service/ReportModuleLogic/ReportModuleLogic.cs

@@ -4600,20 +4600,16 @@ namespace Dongke.IBOSS.PRD.Service.ReportModuleLogic
             } 
 
             string sqlString = "select qdgroup.gid\n" +
-            "      ,decode(qdgroup.gid, 3, '总计', qdgroup.productionlinename) productionlinename\n" +
-            "       ,qdgroup.dtsource " + 
-            "      ,decode(qdgroup.gid\n" +
-            "             ,1\n" +
-            "             ,'合计[' || qdgroup.kilncode || ']'\n" +
-            "             ,0\n" +
-            "             ,qdgroup.kilncode\n" +
-            "             ,'--') kilncode\n" +
+            "      ,decode(qdgroup.gid, 3, '', qdgroup.productionlinename) productionlinename\n" +
+            "        ,decode(qdgroup.gid, 1, '' || qdgroup.dtsource || '合计', 0, qdgroup.dtsource, '') dtsource  " +
+            
             "      ,decode(qdgroup.gid\n" +
             "             ,2\n" +
-            "             ,'合计[' || qdgroup.goodstypename2 || ']'\n" +
+            "             ,'' || qdgroup.goodstypename2 || '合计'\n" +
             "             ,0\n" +
             "             ,qdgroup.goodstypename2\n" +
-            "             ,'--') goodstypename2\n" +
+            "             ,3,'总计','') goodstypename2\n" +
+            "      ,qdgroup.kilncode" +
             "      ,qdgroup.goodstypecode2\n" + 
             "      ,qdgroup.OutKilnCount\n" +
             "      ,qdgroup.GoodCount\n" +
@@ -4644,33 +4640,13 @@ namespace Dongke.IBOSS.PRD.Service.ReportModuleLogic
             "             ,to_number(null)\n" +
             "             ,round(qdgroup.ReFireCount / qdgroup.OutKilnCount, 4)) ReFirePercent\n" +
             "  from (select grouping_id(pcpl.productionlinename\n" +
-            "                          ,mstkiln.kilncode\n" +
+            "                          ,ppcc.dtsource\n" +
             "                          ,mstgoodstype2.goodstypecode) gid\n" +
             "              ,pcpl.productionlinename\n" +
             "              ,mstkiln.kilncode\n" +
             "              ,mstgoodstype2.goodstypename goodstypename2\n" +
             "              ,mstgoodstype2.goodstypecode goodstypecode2\n" + 
-            "              ,ppcc.dtsource " 
-            //"              ,nvl(sum(decode(ppcc.goodsleveltypeid, 0, 1, 0)), 0) OutKilnCount\n" +
-            //"              ,nvl(sum(decode(ppcc.goodsleveltypeid, 5, 1,16,1, 0)), 0) BadCount\n" +
-            //"              ,nvl(sum(decode(ppcc.goodsleveltypeid, 6, 1, 0)), 0) ReFireCount\n" +
-            //"              ,nvl(sum(decode(ppcc.goodsleveltypeid, 7, 1, 0)), 0) SubstandardCount\n" +
-            //"              ,nvl(sum(decode(ppcc.goodsleveltypeid, 0, 1, 5, -1, 6, -1, 7, -1,16,-1, 0)), 0) GoodCount\n" +
-            //"          from (select DISTINCT 0                   goodsleveltypeid  \n" +
-            //"                      ,pd.barcode\n" +
-            //"                      ,pd.productionlineid\n" +
-            //"                      ,pd.goodsid\n" +
-            //"                      ,pd.kilnid\n" +
-            //"                      ,pd.kilncarbatchno\n" +
-            //"                      ,1                   cc\n" +
-            //"                  from tp_pm_productiondata pd\n" +
-            //"                 inner join tp_pm_groutingdailydetail gdd on gdd.groutingdailydetailid = pd.groutingdailydetailid\n" +
-            //"                 where pd.valueflag = '1'\n" +
-            //"                   and (:in_rptSprocedureId is null or pd.procedureid = :in_rptSprocedureId)\n" +
-            //"                   and (:in_OutProcedureIDS is null or instr(','||:in_OutProcedureIDS||',', ','||pd.procedureid||',') > 0)\n" +
-            //"                   and pd.accountid = :in_AccountID\n"
-            
-            ;
+            "              ,ppcc.dtsource "  ;
 
             StringBuilder selSql = new StringBuilder(sqlString);
 
@@ -4879,9 +4855,9 @@ namespace Dongke.IBOSS.PRD.Service.ReportModuleLogic
                 selSql.Append("    AND mstgoodstype.GOODSTYPECode LIKE '%' \n");
             }
             sqlString =
-            "         group by grouping sets((pcpl.productionlinename, mstkiln.kilncode, mstgoodstype2.goodstypename,mstgoodstype2.goodstypecode, ppcc.dtsource),(pcpl.productionlinename, mstgoodstype2.goodstypename,mstgoodstype2.goodstypecode),(pcpl.productionlinename, mstkiln.kilncode),(pcpl.productionlinename))\n" +
+            "         group by grouping sets((pcpl.productionlinename, mstkiln.kilncode, mstgoodstype2.goodstypename,mstgoodstype2.goodstypecode, ppcc.dtsource),(pcpl.productionlinename, mstgoodstype2.goodstypename,mstgoodstype2.goodstypecode),(pcpl.productionlinename, ppcc.dtsource),(pcpl.productionlinename))\n" +
             "         order by pcpl.productionlinename\n" +
-            "                 ,mstkiln.kilncode\n" +
+            "                 ,ppcc.dtsource \n" +
             "                 ,mstgoodstype2.goodstypecode\n" +
             "                 ) qdgroup\n";