Ver código fonte

产品编码多1000的错误

konghe 1 ano atrás
pai
commit
091c77eb64

+ 45 - 69
wwwroot/mes/rpt/rpt008/rpt.ashx

@@ -172,14 +172,13 @@ public class rpt : IHttpHandler, IReadOnlySessionState
                                           0
                                           0
                                        END OK_B
                                        END OK_B
                                       ,CASE
                                       ,CASE
-                                         WHEN P.PROCEDUREID = 35 AND
-                                              RPD.Productiondataid IS NULL THEN
+                                         WHEN P.PROCEDUREID = 35 THEN
                                           1
                                           1
                                          ELSE
                                          ELSE
                                           0
                                           0
                                        END OK_R
                                        END OK_R
                                       ,CASE
                                       ,CASE
-                                         WHEN RPD.Productiondataid IS NOT NULL THEN
+                                         WHEN P.PROCEDUREID = 13 AND RPD.Productiondataid IS NOT NULL THEN
                                           1
                                           1
                                          ELSE
                                          ELSE
                                           0
                                           0
@@ -211,7 +210,7 @@ public class rpt : IHttpHandler, IReadOnlySessionState
                                    AND RPD.Procedureid IN (20, 22, 23, 37)
                                    AND RPD.Procedureid IN (20, 22, 23, 37)
                                 UNION ALL
                                 UNION ALL
                                 SELECT 3 FLAG
                                 SELECT 3 FLAG
-                                      ,fp.groutingdailydetailid
+                                      ,TP_PM_ProductionData.groutingdailydetailid
                                       ,0 OUT_K_B
                                       ,0 OUT_K_B
                                       ,0 OUT_K_R
                                       ,0 OUT_K_R
                                       ,0 OUT_K_ALL
                                       ,0 OUT_K_ALL
@@ -221,12 +220,10 @@ public class rpt : IHttpHandler, IReadOnlySessionState
                                       ,0 OK_ALL
                                       ,0 OK_ALL
                                       ,CASE
                                       ,CASE
                                          WHEN SUM(CASE
                                          WHEN SUM(CASE
-                                                    WHEN fp.isrefire = '6' OR
-                                                         p.productiondataid IS NOT NULL OR
-                                                         p.productiondataid<>53 THEN
-                                                     0
-                                                    ELSE
+                                                    WHEN TP.PROCEDUREID = 13 and RPD.groutingdailydetailid is  null THEN
                                                      1
                                                      1
+                                                    ELSE
+                                                     0
                                                   END) > 0 THEN
                                                   END) > 0 THEN
                                           1
                                           1
                                          ELSE
                                          ELSE
@@ -234,11 +231,10 @@ public class rpt : IHttpHandler, IReadOnlySessionState
                                        END END_B
                                        END END_B
                                       ,CASE
                                       ,CASE
                                          WHEN SUM(CASE
                                          WHEN SUM(CASE
-                                                    WHEN fp.isrefire = '0' OR
-                                                         p.productiondataid IS NOT NULL THEN
-                                                     0
-                                                    ELSE
+                                                    WHEN TP.PROCEDUREID = 35  THEN
                                                      1
                                                      1
+                                                    ELSE
+                                                     0
                                                   END) > 0 THEN
                                                   END) > 0 THEN
                                           1
                                           1
                                          ELSE
                                          ELSE
@@ -246,33 +242,25 @@ public class rpt : IHttpHandler, IReadOnlySessionState
                                        END END_R
                                        END END_R
                                       ,CASE
                                       ,CASE
                                          WHEN SUM(CASE
                                          WHEN SUM(CASE
-                                                    WHEN p.productiondataid IS NULL or p.procedureid=53 THEN
-                                                     0
-                                                    ELSE
+                                                     WHEN TP.PROCEDUREID = 13 and RPD.groutingdailydetailid is not null THEN
                                                      1
                                                      1
-                                                  END) > 0 THEN
-                                          1
-                                         ELSE
-                                          0
-                                       END END_H,
-                                        CASE
-                                         WHEN SUM(CASE
-                                                    WHEN p.procedureid=53 THEN
-                                                     0
                                                     ELSE
                                                     ELSE
-                                                     1
+                                                     0
                                                   END) > 0 THEN
                                                   END) > 0 THEN
                                           1
                                           1
                                          ELSE
                                          ELSE
                                           0
                                           0
-                                       END END_ALL
-                                  FROM tp_pm_finishedproduct fp
-                                  LEFT JOIN tp_pm_productiondata p
-                                    ON p.groutingdailydetailid = fp.groutingdailydetailid
-                                   AND p.procedureid IN (20, 22, 23, 37, 53)
-                                 WHERE fp.createtime >= @DATEBEGIN@
-                                   AND fp.createtime <= @DATEEND@
-                                 GROUP BY fp.groutingdailydetailid) TF
+                                       END END_H,
+                                       1 END_ALL
+                                   from TP_PM_ProductionData INNER JOIN  TP_PM_ProductionData TP on TP.barcode=TP_PM_ProductionData.BARCODE and TP.CHECKBATCHNO = 1  and TP.VALUEFLAG=1
+                                           AND TP.GOODSLEVELTYPEID IN (4, 5)
+                                           AND TP.PROCEDUREID IN (13, 35)
+                                           AND TP.CREATETIME >= @DATEBEGIN@
+                                           AND TP.CREATETIME <=  @DATEEND@ LEFT JOIN TP_PM_PRODUCTIONDATA RPD
+                                    ON RPD.BARCODE = TP_PM_ProductionData.BARCODE
+                                   AND RPD.Procedureid IN (20, 22, 23, 37) 
+			where TP_PM_ProductionData.ValueFlag = '1'
+       and TP_PM_ProductionData.ProcedureID = 15 and TP_PM_ProductionData.CREATETIME>@DATEBEGIN@  and TP_PM_ProductionData.CREATETIME<= @DATEEND@ GROUP BY TP_PM_ProductionData.groutingdailydetailid) TF
                           LEFT JOIN TP_PM_GROUTINGDAILYDETAIL G
                           LEFT JOIN TP_PM_GROUTINGDAILYDETAIL G
                             ON TF.GROUTINGDAILYDETAILID = G.GROUTINGDAILYDETAILID
                             ON TF.GROUTINGDAILYDETAILID = G.GROUTINGDAILYDETAILID
                           LEFT JOIN TP_PC_GROUTINGLINE L
                           LEFT JOIN TP_PC_GROUTINGLINE L
@@ -394,14 +382,13 @@ public class rpt : IHttpHandler, IReadOnlySessionState
                                           0
                                           0
                                        END OK_B
                                        END OK_B
                                       ,CASE
                                       ,CASE
-                                         WHEN P.PROCEDUREID = 35 AND
-                                              RPD.Productiondataid IS NULL THEN
+                                         WHEN P.PROCEDUREID = 35  THEN
                                           1
                                           1
                                          ELSE
                                          ELSE
                                           0
                                           0
                                        END OK_R
                                        END OK_R
                                       ,CASE
                                       ,CASE
-                                         WHEN RPD.Productiondataid IS NOT NULL THEN
+                                         WHEN P.PROCEDUREID = 13 AND RPD.Productiondataid IS NOT NULL THEN
                                           1
                                           1
                                          ELSE
                                          ELSE
                                           0
                                           0
@@ -432,8 +419,8 @@ public class rpt : IHttpHandler, IReadOnlySessionState
                                     ON RPD.PRODUCTIONDATAID = P.MAXPRODUCTIONDATAID
                                     ON RPD.PRODUCTIONDATAID = P.MAXPRODUCTIONDATAID
                                    AND RPD.Procedureid IN (20, 22, 23, 37)
                                    AND RPD.Procedureid IN (20, 22, 23, 37)
                                 UNION ALL
                                 UNION ALL
-                                SELECT 3 FLAG
-                                      ,fp.groutingdailydetailid
+                                 SELECT 3 FLAG
+                                      ,TP_PM_ProductionData.groutingdailydetailid
                                       ,0 OUT_K_B
                                       ,0 OUT_K_B
                                       ,0 OUT_K_R
                                       ,0 OUT_K_R
                                       ,0 OUT_K_ALL
                                       ,0 OUT_K_ALL
@@ -443,12 +430,10 @@ public class rpt : IHttpHandler, IReadOnlySessionState
                                       ,0 OK_ALL
                                       ,0 OK_ALL
                                       ,CASE
                                       ,CASE
                                          WHEN SUM(CASE
                                          WHEN SUM(CASE
-                                                    WHEN fp.isrefire = '6' OR
-                                                         p.productiondataid IS NOT NULL  OR
-                                                         p.productiondataid<>53  THEN
-                                                     0
-                                                    ELSE
+                                                    WHEN TP.PROCEDUREID = 13 and RPD.groutingdailydetailid is  null THEN
                                                      1
                                                      1
+                                                    ELSE
+                                                     0
                                                   END) > 0 THEN
                                                   END) > 0 THEN
                                           1
                                           1
                                          ELSE
                                          ELSE
@@ -456,11 +441,10 @@ public class rpt : IHttpHandler, IReadOnlySessionState
                                        END END_B
                                        END END_B
                                       ,CASE
                                       ,CASE
                                          WHEN SUM(CASE
                                          WHEN SUM(CASE
-                                                    WHEN fp.isrefire = '0' OR
-                                                         p.productiondataid IS NOT NULL THEN
-                                                     0
-                                                    ELSE
+                                                    WHEN TP.PROCEDUREID = 35  THEN
                                                      1
                                                      1
+                                                    ELSE
+                                                     0
                                                   END) > 0 THEN
                                                   END) > 0 THEN
                                           1
                                           1
                                          ELSE
                                          ELSE
@@ -468,33 +452,25 @@ public class rpt : IHttpHandler, IReadOnlySessionState
                                        END END_R
                                        END END_R
                                       ,CASE
                                       ,CASE
                                          WHEN SUM(CASE
                                          WHEN SUM(CASE
-                                                    WHEN p.productiondataid IS NULL  or p.procedureid=53  THEN
-                                                     0
-                                                    ELSE
+                                                     WHEN TP.PROCEDUREID = 13 and RPD.groutingdailydetailid is not null THEN
                                                      1
                                                      1
-                                                  END) > 0 THEN
-                                          1
-                                         ELSE
-                                          0
-                                       END END_H
-                                      , CASE
-                                         WHEN SUM(CASE
-                                                    WHEN p.procedureid=53 THEN
-                                                     0
                                                     ELSE
                                                     ELSE
-                                                     1
+                                                     0
                                                   END) > 0 THEN
                                                   END) > 0 THEN
                                           1
                                           1
                                          ELSE
                                          ELSE
                                           0
                                           0
-                                       END END_ALL
-                                  FROM tp_pm_finishedproduct fp
-                                  LEFT JOIN tp_pm_productiondata p
-                                    ON p.groutingdailydetailid = fp.groutingdailydetailid
-                                   AND p.procedureid IN (20, 22, 23, 37, 53)
-                                 WHERE fp.createtime >= @DATEBEGIN@
-                                   AND fp.createtime <= @DATEEND@
-                                 GROUP BY fp.groutingdailydetailid) TF
+                                       END END_H,
+                                       1 END_ALL
+                                   from TP_PM_ProductionData INNER JOIN  TP_PM_ProductionData TP on TP.barcode=TP_PM_ProductionData.BARCODE and TP.CHECKBATCHNO = 1  and TP.VALUEFLAG=1
+                                           AND TP.GOODSLEVELTYPEID IN (4, 5)
+                                           AND TP.PROCEDUREID IN (13, 35)
+                                           AND TP.CREATETIME >= @DATEBEGIN@
+                                           AND TP.CREATETIME <=  @DATEEND@ LEFT JOIN TP_PM_PRODUCTIONDATA RPD
+                                    ON RPD.BARCODE = TP_PM_ProductionData.BARCODE
+                                   AND RPD.Procedureid IN (20, 22, 23, 37) 
+			where TP_PM_ProductionData.ValueFlag = '1'
+       and TP_PM_ProductionData.ProcedureID = 15 and TP_PM_ProductionData.CREATETIME>@DATEBEGIN@  and TP_PM_ProductionData.CREATETIME<= @DATEEND@ GROUP BY TP_PM_ProductionData.groutingdailydetailid) TF
                           LEFT JOIN TP_PM_GROUTINGDAILYDETAIL G
                           LEFT JOIN TP_PM_GROUTINGDAILYDETAIL G
                             ON TF.GROUTINGDAILYDETAILID = G.GROUTINGDAILYDETAILID
                             ON TF.GROUTINGDAILYDETAILID = G.GROUTINGDAILYDETAILID
                           LEFT JOIN TP_PC_GROUTINGLINE L
                           LEFT JOIN TP_PC_GROUTINGLINE L

+ 18 - 32
wwwroot/mes/rpt/rpt012/rpt.ashx

@@ -19,10 +19,9 @@ public class rpt : IHttpHandler, IReadOnlySessionState
         context.Response.ContentType = "text/plain";
         context.Response.ContentType = "text/plain";
         using(IDataAccess conn = DataAccess.Create())
         using(IDataAccess conn = DataAccess.Create())
         {
         {
-			  #region 产品编码
+            #region 产品编码
             List<CDAParameter> goodsnull = new List<CDAParameter>();
             List<CDAParameter> goodsnull = new List<CDAParameter>();
             string[] goodsCodes = new string[] { };
             string[] goodsCodes = new string[] { };
-            string goodsStr = "";
             if (context.Request["GOODSCODE"] != "" || context.Request["GOODSCODE"] != null)
             if (context.Request["GOODSCODE"] != "" || context.Request["GOODSCODE"] != null)
             {
             {
                 goodsCodes = context.Request["GOODSCODE"].ToString().Split(',');
                 goodsCodes = context.Request["GOODSCODE"].ToString().Split(',');
@@ -34,39 +33,26 @@ public class rpt : IHttpHandler, IReadOnlySessionState
 										WHERE 1=1";
 										WHERE 1=1";
 
 
 
 
-             if (goodsCodes.Length > 1 || goodsCodes[0]!="")
-                {
+            if (goodsCodes.Length > 1 || goodsCodes[0]!="")
+            {
 
 
-                    if (context.Request["isNotcheck"].ToString() == "1")
+                if (context.Request["isNotcheck"].ToString() == "1")
+                {
+                    goodssql += @" AND GOODSCODE NOT LIKE ('%" + goodsCodes[0] + "%') ";
+                    for (int i = 1; i < goodsCodes.Length; i++)
                     {
                     {
-                        goodssql += @" AND GOODSCODE NOT LIKE ('%" + goodsCodes[0] + "%') ";
-                        for (int i = 1; i < goodsCodes.Length; i++)
-                        {
-                            goodssql += @" AND GOODSCODE NOT LIKE ('%" + goodsCodes[i] + "%') ";
-                        }
+                        goodssql += @" AND GOODSCODE NOT LIKE ('%" + goodsCodes[i] + "%') ";
                     }
                     }
-                    else
+                }
+                else
+                {
+                    goodssql += @" AND GOODSCODE  LIKE ('%" + goodsCodes[0] + "%') ";
+                    for (int i = 1; i < goodsCodes.Length; i++)
                     {
                     {
-                        goodssql += @" AND GOODSCODE  LIKE ('%" + goodsCodes[0] + "%') ";
-                        for (int i = 1; i < goodsCodes.Length; i++)
-                        {
-                            goodssql += @" OR GOODSCODE  LIKE ('%" + goodsCodes[i] + "%') ";
-                        }
+                        goodssql += @" OR GOODSCODE  LIKE ('%" + goodsCodes[i] + "%') ";
                     }
                     }
-
                 }
                 }
-            
-            DataTable goodsTable = conn.ExecuteDatatable(goodssql,goodsnull.ToArray());
-
 
 
-
-            if (goodsTable.Rows.Count > 0)
-            {
-                for (int i = 0; i < goodsTable.Rows.Count; i++)
-                {
-                    if (i > 0) goodsStr += ",";
-                    goodsStr += "'" + goodsTable.Rows[i]["GOODSCODE"].ToString() + "'";
-                }
             }
             }
             #endregion 
             #endregion 
 
 
@@ -238,8 +224,8 @@ public class rpt : IHttpHandler, IReadOnlySessionState
 						) PC ON PD.MONITORCODE = PC.MONITORCODE 
 						) PC ON PD.MONITORCODE = PC.MONITORCODE 
 						AND ( PC.GID = 3 OR PC.GID=7 OR ( PD.工号 = PC.工号 AND PD.产品型号 = PC.产品型号 ) )
 						AND ( PC.GID = 3 OR PC.GID=7 OR ( PD.工号 = PC.工号 AND PD.产品型号 = PC.产品型号 ) )
                 ".Replace("{COLSTR}",colStr).Replace("{MODELTYPE}",modelType)
                 ".Replace("{COLSTR}",colStr).Replace("{MODELTYPE}",modelType)
-				 .Replace("{goodsCodes}", goodsStr)
-				;
+                 .Replace("{goodsCodes}", goodssql)
+                ;
 
 
                 //获取查询条件
                 //获取查询条件
                 List<CDAParameter> sqlPara = new List<CDAParameter>();
                 List<CDAParameter> sqlPara = new List<CDAParameter>();
@@ -280,14 +266,14 @@ public class rpt : IHttpHandler, IReadOnlySessionState
             //子表
             //子表
             if(context.Request["m"].ToString()=="detail")
             if(context.Request["m"].ToString()=="detail")
             {
             {
-              
+
             }
             }
 
 
             //2021-7-15 dongyan  新增结转功能 选择结转checkbox 查询结转数据
             //2021-7-15 dongyan  新增结转功能 选择结转checkbox 查询结转数据
             //将成检产量统计表数据插入到 JZ_RPT012 并通过条件查询结转数据
             //将成检产量统计表数据插入到 JZ_RPT012 并通过条件查询结转数据
             if (context.Request["m"].ToString() == "jiezhauang")
             if (context.Request["m"].ToString() == "jiezhauang")
             {
             {
-               
+
 
 
                 string sqlStr = @"
                 string sqlStr = @"
 								SELECT
 								SELECT

+ 30 - 43
wwwroot/mes/rpt/rpt026/rpt.ashx

@@ -20,10 +20,9 @@ public class rpt : IHttpHandler, IReadOnlySessionState
         using(IDataAccess conn = DataAccess.Create())
         using(IDataAccess conn = DataAccess.Create())
         {
         {
 
 
-        #region 产品编码
+            #region 产品编码
             List<CDAParameter> goodsnull = new List<CDAParameter>();
             List<CDAParameter> goodsnull = new List<CDAParameter>();
             string[] goodsCodes = new string[] { };
             string[] goodsCodes = new string[] { };
-            string goodsStr = "";
             if (context.Request["GOODSCODE"] != "" || context.Request["GOODSCODE"] != null)
             if (context.Request["GOODSCODE"] != "" || context.Request["GOODSCODE"] != null)
             {
             {
                 goodsCodes = context.Request["GOODSCODE"].ToString().Split(',');
                 goodsCodes = context.Request["GOODSCODE"].ToString().Split(',');
@@ -35,40 +34,28 @@ public class rpt : IHttpHandler, IReadOnlySessionState
                                         WHERE 1=1";
                                         WHERE 1=1";
 
 
 
 
-             if (goodsCodes.Length > 1 || goodsCodes[0]!="")
-                {
+            if (goodsCodes.Length > 1 || goodsCodes[0]!="")
+            {
 
 
-                    if (context.Request["isNotcheck"].ToString() == "1")
+                if (context.Request["isNotcheck"].ToString() == "1")
+                {
+                    goodssql += @" AND GOODSCODE NOT LIKE ('%" + goodsCodes[0] + "%') ";
+                    for (int i = 1; i < goodsCodes.Length; i++)
                     {
                     {
-                        goodssql += @" AND GOODSCODE NOT LIKE ('%" + goodsCodes[0] + "%') ";
-                        for (int i = 1; i < goodsCodes.Length; i++)
-                        {
-                            goodssql += @" AND GOODSCODE NOT LIKE ('%" + goodsCodes[i] + "%') ";
-                        }
+                        goodssql += @" AND GOODSCODE NOT LIKE ('%" + goodsCodes[i] + "%') ";
                     }
                     }
-                    else
+                }
+                else
+                {
+                    goodssql += @" AND GOODSCODE  LIKE ('%" + goodsCodes[0] + "%') ";
+                    for (int i = 1; i < goodsCodes.Length; i++)
                     {
                     {
-                        goodssql += @" AND GOODSCODE  LIKE ('%" + goodsCodes[0] + "%') ";
-                        for (int i = 1; i < goodsCodes.Length; i++)
-                        {
-                            goodssql += @" OR GOODSCODE  LIKE ('%" + goodsCodes[i] + "%') ";
-                        }
+                        goodssql += @" OR GOODSCODE  LIKE ('%" + goodsCodes[i] + "%') ";
                     }
                     }
-
                 }
                 }
-            
-            DataTable goodsTable = conn.ExecuteDatatable(goodssql,goodsnull.ToArray());
 
 
-
-
-            if (goodsTable.Rows.Count > 0)
-            {
-                for (int i = 0; i < goodsTable.Rows.Count; i++)
-                {
-                    if (i > 0) goodsStr += ",";
-                    goodsStr += "'" + goodsTable.Rows[i]["GOODSCODE"].ToString() + "'";
-                }
             }
             }
+
             #endregion 
             #endregion 
             //主表
             //主表
             if (context.Request["m"].ToString() == "master")
             if (context.Request["m"].ToString() == "master")
@@ -851,7 +838,7 @@ INNER join TP_PM_PRODUCTIONDATA TT ON tt.groutingdailydetailID = t.groutingdaily
          GROUP BY G.goodscode) TT
          GROUP BY G.goodscode) TT
  GROUP BY GROUPING SETS((TT.GOODS_CODE),())
  GROUP BY GROUPING SETS((TT.GOODS_CODE),())
 ) last 
 ) last 
-left join tp_mst_goods g on g.goodscode = last.产品编码  ORDER BY 产品编码".Replace("{goodsCodes}", goodsStr);
+left join tp_mst_goods g on g.goodscode = last.产品编码  ORDER BY 产品编码".Replace("{goodsCodes}", goodssql);
                     #endregion
                     #endregion
                 }
                 }
                 else if (flag == "二期")
                 else if (flag == "二期")
@@ -1634,7 +1621,7 @@ INNER join TP_PM_PRODUCTIONDATA TT ON tt.groutingdailydetailID = t.groutingdaily
  GROUP BY GROUPING SETS((TT.GOODS_CODE),())
  GROUP BY GROUPING SETS((TT.GOODS_CODE),())
 ) last 
 ) last 
 left join tp_mst_goods g on g.goodscode = last.产品编码  ORDER BY 产品编码
 left join tp_mst_goods g on g.goodscode = last.产品编码  ORDER BY 产品编码
-".Replace("{goodsCodes}", goodsStr);
+".Replace("{goodsCodes}", goodssql);
                     #endregion
                     #endregion
                 }
                 }
                 else
                 else
@@ -1855,7 +1842,7 @@ SELECT DECODE(GROUPING_ID(TT.GOODS_CODE), 1, '总计', TT.GOODS_CODE) AS 产品
 
 
 ) last 
 ) last 
 left join tp_mst_goods g on g.goodscode = last.产品编码  ORDER BY 产品编码
 left join tp_mst_goods g on g.goodscode = last.产品编码  ORDER BY 产品编码
-".Replace("{goodsCodes}", goodsStr);
+".Replace("{goodsCodes}", goodssql);
                     #endregion
                     #endregion
                 }
                 }
                 //获取查询条件
                 //获取查询条件
@@ -1882,7 +1869,7 @@ left join tp_mst_goods g on g.goodscode = last.产品编码  ORDER BY 产品编
                     }
                     }
                     if (rowZero)
                     if (rowZero)
                     {
                     {
-						//移除空行
+                        //移除空行
                         dt.Rows.RemoveAt(row);
                         dt.Rows.RemoveAt(row);
                     }
                     }
                     else
                     else
@@ -1926,10 +1913,10 @@ left join tp_mst_goods g on g.goodscode = last.产品编码  ORDER BY 产品编
             //2021-8-3 陈强 添加全条件查询
             //2021-8-3 陈强 添加全条件查询
             if (context.Request["m"].ToString()=="jiezhuan")
             if (context.Request["m"].ToString()=="jiezhuan")
             {
             {
-                 String sqlStr1 = String.Empty;
+                String sqlStr1 = String.Empty;
                 if ( context.Request["workshopcodeMaster"].ToString() == "一期")
                 if ( context.Request["workshopcodeMaster"].ToString() == "一期")
                 {
                 {
-                     sqlStr1 = @"SELECT
+                    sqlStr1 = @"SELECT
 	                            DECODE( GOODS_CODE, NULL, '合计', GOODS_CODE ) AS 产品型号,
 	                            DECODE( GOODS_CODE, NULL, '合计', GOODS_CODE ) AS 产品型号,
 	                            sum( CNUM1 ) AS 精坯期初 _一期,
 	                            sum( CNUM1 ) AS 精坯期初 _一期,
 	                            SUM( CNUM2 ) AS 精坯期初 _二期,
 	                            SUM( CNUM2 ) AS 精坯期初 _二期,
@@ -1972,11 +1959,11 @@ left join tp_mst_goods g on g.goodscode = last.产品编码  ORDER BY 产品编
                                 AND (@GOODSMODEL@ IS NULL OR GOODS_CODE = @GOODSMODEL@ )
                                 AND (@GOODSMODEL@ IS NULL OR GOODS_CODE = @GOODSMODEL@ )
                             GROUP BY
                             GROUP BY
 	                            grouping sets ( ( GOODS_CODE ), ( ) )";
 	                            grouping sets ( ( GOODS_CODE ), ( ) )";
-                   
+
                 }
                 }
                 else if (context.Request["workshopcodeMaster"].ToString() == "二期")
                 else if (context.Request["workshopcodeMaster"].ToString() == "二期")
                 {
                 {
-                        sqlStr1 = @"SELECT
+                    sqlStr1 = @"SELECT
 	                                DECODE( GOODS_CODE, NULL, '合计', GOODS_CODE ) AS 产品型号,
 	                                DECODE( GOODS_CODE, NULL, '合计', GOODS_CODE ) AS 产品型号,
 	                                sum( CNUM1 ) AS 精坯期初 _二期,
 	                                sum( CNUM1 ) AS 精坯期初 _二期,
 	                                SUM( CNUM2 ) AS 精坯期初 _一期,
 	                                SUM( CNUM2 ) AS 精坯期初 _一期,
@@ -2019,11 +2006,11 @@ left join tp_mst_goods g on g.goodscode = last.产品编码  ORDER BY 产品编
 	                                AND ( @GOODSMODEL@ IS NULL OR GOODS_CODE = @GOODSMODEL@) 
 	                                AND ( @GOODSMODEL@ IS NULL OR GOODS_CODE = @GOODSMODEL@) 
                                 GROUP BY
                                 GROUP BY
 	                                grouping sets ( ( GOODS_CODE ), ( ) )";
 	                                grouping sets ( ( GOODS_CODE ), ( ) )";
-                   
+
                 }
                 }
                 else
                 else
                 {
                 {
-                            sqlStr1 = @"SELECT
+                    sqlStr1 = @"SELECT
 	                                DECODE( GOODS_CODE, NULL, '合计', GOODS_CODE ) AS 产品型号,
 	                                DECODE( GOODS_CODE, NULL, '合计', GOODS_CODE ) AS 产品型号,
 	                                sum( CNUM1 ) AS 精坯期初,
 	                                sum( CNUM1 ) AS 精坯期初,
 	                                SUM( CNUM2 ) AS 釉坯期初,
 	                                SUM( CNUM2 ) AS 釉坯期初,
@@ -2048,13 +2035,13 @@ left join tp_mst_goods g on g.goodscode = last.产品编码  ORDER BY 产品编
 	                                grouping sets ( ( GOODS_CODE ), ( ) ) ";
 	                                grouping sets ( ( GOODS_CODE ), ( ) ) ";
                 }
                 }
 
 
-             //获取查询条件
+                //获取查询条件
                 List<CDAParameter> sqlPara = new List<CDAParameter>();
                 List<CDAParameter> sqlPara = new List<CDAParameter>();
                 //sqlPara.Add(new CDAParameter("DATEBEGIN", Convert.ToDateTime(context.Request["datebeginMaster"]), DataType.DateTime));
                 //sqlPara.Add(new CDAParameter("DATEBEGIN", Convert.ToDateTime(context.Request["datebeginMaster"]), DataType.DateTime));
                 //sqlPara.Add(new CDAParameter("DATEEND", Convert.ToDateTime(context.Request["dateendMaster"]).AddSeconds(1), DataType.DateTime));
                 //sqlPara.Add(new CDAParameter("DATEEND", Convert.ToDateTime(context.Request["dateendMaster"]).AddSeconds(1), DataType.DateTime));
                 sqlPara.Add(new CDAParameter("GOODSMODEL", context.Request["goodsmodelMaster"]));
                 sqlPara.Add(new CDAParameter("GOODSMODEL", context.Request["goodsmodelMaster"]));
                 sqlPara.Add(new CDAParameter("BEGINMONTH", context.Request["datebeginMaster"].Substring(0, context.Request["datebeginMaster"].IndexOf("-")) + context.Request["datebeginMaster"].Substring(context.Request["datebeginMaster"].IndexOf("-") + 1).PadLeft(2, '0')));
                 sqlPara.Add(new CDAParameter("BEGINMONTH", context.Request["datebeginMaster"].Substring(0, context.Request["datebeginMaster"].IndexOf("-")) + context.Request["datebeginMaster"].Substring(context.Request["datebeginMaster"].IndexOf("-") + 1).PadLeft(2, '0')));
-				sqlPara.Add(new CDAParameter("ENDMONTH", context.Request["dateendMaster"].Substring(0, context.Request["dateendMaster"].IndexOf("-")) + context.Request["dateendMaster"].Substring(context.Request["dateendMaster"].IndexOf("-") + 1).PadLeft(2, '0')));
+                sqlPara.Add(new CDAParameter("ENDMONTH", context.Request["dateendMaster"].Substring(0, context.Request["dateendMaster"].IndexOf("-")) + context.Request["dateendMaster"].Substring(context.Request["dateendMaster"].IndexOf("-") + 1).PadLeft(2, '0')));
 
 
                 DataTable dt = conn.ExecuteDatatable(sqlStr1, sqlPara.ToArray());
                 DataTable dt = conn.ExecuteDatatable(sqlStr1, sqlPara.ToArray());
 
 
@@ -2074,7 +2061,7 @@ left join tp_mst_goods g on g.goodscode = last.产品编码  ORDER BY 产品编
                     }
                     }
                     if (rowZero)
                     if (rowZero)
                     {
                     {
-						//移除空行
+                        //移除空行
                         dt.Rows.RemoveAt(row);
                         dt.Rows.RemoveAt(row);
                     }
                     }
                     else
                     else
@@ -2085,12 +2072,12 @@ left join tp_mst_goods g on g.goodscode = last.产品编码  ORDER BY 产品编
 
 
                 string jsonStr = new JsonResult(dt) { total = dt.Rows.Count }.ToJson();
                 string jsonStr = new JsonResult(dt) { total = dt.Rows.Count }.ToJson();
                 context.Response.Write(jsonStr);
                 context.Response.Write(jsonStr);
+            }
+
         }
         }
 
 
     }
     }
 
 
-}
-
     public bool IsReusable
     public bool IsReusable
     {
     {
         get
         get