|
|
@@ -22,7 +22,6 @@ public class rpt : IHttpHandler, IReadOnlySessionState
|
|
|
#region 产品编码
|
|
|
List<CDAParameter> goodsnull = new List<CDAParameter>();
|
|
|
string[] goodsCodes = new string[] { };
|
|
|
- string goodsStr = "";
|
|
|
if (context.Request["GOODSCODE"] != "" || context.Request["GOODSCODE"] != null)
|
|
|
{
|
|
|
goodsCodes = context.Request["GOODSCODE"].ToString().Split(',');
|
|
|
@@ -50,19 +49,6 @@ public class rpt : IHttpHandler, IReadOnlySessionState
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- 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
|
|
|
|
|
|
string buding = null;
|
|
|
@@ -236,7 +222,8 @@ public class rpt : IHttpHandler, IReadOnlySessionState
|
|
|
,CASE
|
|
|
WHEN SUM(CASE
|
|
|
WHEN fp.isrefire = '6' OR
|
|
|
- p.productiondataid IS NOT NULL THEN
|
|
|
+ p.productiondataid IS NOT NULL OR
|
|
|
+ p.productiondataid<>53 THEN
|
|
|
0
|
|
|
ELSE
|
|
|
1
|
|
|
@@ -259,7 +246,7 @@ public class rpt : IHttpHandler, IReadOnlySessionState
|
|
|
END END_R
|
|
|
,CASE
|
|
|
WHEN SUM(CASE
|
|
|
- WHEN p.productiondataid IS NULL THEN
|
|
|
+ WHEN p.productiondataid IS NULL or p.procedureid=53 THEN
|
|
|
0
|
|
|
ELSE
|
|
|
1
|
|
|
@@ -267,12 +254,22 @@ public class rpt : IHttpHandler, IReadOnlySessionState
|
|
|
1
|
|
|
ELSE
|
|
|
0
|
|
|
- END END_H
|
|
|
- ,1 END_ALL
|
|
|
+ END END_H,
|
|
|
+ CASE
|
|
|
+ WHEN SUM(CASE
|
|
|
+ WHEN p.procedureid=53 THEN
|
|
|
+ 0
|
|
|
+ ELSE
|
|
|
+ 1
|
|
|
+ END) > 0 THEN
|
|
|
+ 1
|
|
|
+ ELSE
|
|
|
+ 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)
|
|
|
+ AND p.procedureid IN (20, 22, 23, 37, 53)
|
|
|
WHERE fp.createtime >= @DATEBEGIN@
|
|
|
AND fp.createtime <= @DATEEND@
|
|
|
GROUP BY fp.groutingdailydetailid) TF
|
|
|
@@ -297,7 +294,7 @@ public class rpt : IHttpHandler, IReadOnlySessionState
|
|
|
,(L.BUILDINGNO),())
|
|
|
ORDER BY L.BUILDINGNO
|
|
|
,M.GOODSCODE
|
|
|
- ,GID) T ".Replace("{BUILDINGNO}", buding).Replace("{goodsCodes}", goodsStr);
|
|
|
+ ,GID) T ".Replace("{BUILDINGNO}", buding).Replace("{goodsCodes}", goodssql);
|
|
|
}
|
|
|
else {
|
|
|
sqlStr = @"
|
|
|
@@ -447,7 +444,8 @@ public class rpt : IHttpHandler, IReadOnlySessionState
|
|
|
,CASE
|
|
|
WHEN SUM(CASE
|
|
|
WHEN fp.isrefire = '6' OR
|
|
|
- p.productiondataid IS NOT NULL THEN
|
|
|
+ p.productiondataid IS NOT NULL OR
|
|
|
+ p.productiondataid<>53 THEN
|
|
|
0
|
|
|
ELSE
|
|
|
1
|
|
|
@@ -470,7 +468,7 @@ public class rpt : IHttpHandler, IReadOnlySessionState
|
|
|
END END_R
|
|
|
,CASE
|
|
|
WHEN SUM(CASE
|
|
|
- WHEN p.productiondataid IS NULL THEN
|
|
|
+ WHEN p.productiondataid IS NULL or p.procedureid=53 THEN
|
|
|
0
|
|
|
ELSE
|
|
|
1
|
|
|
@@ -479,11 +477,21 @@ public class rpt : IHttpHandler, IReadOnlySessionState
|
|
|
ELSE
|
|
|
0
|
|
|
END END_H
|
|
|
- ,1 END_ALL
|
|
|
+ , CASE
|
|
|
+ WHEN SUM(CASE
|
|
|
+ WHEN p.procedureid=53 THEN
|
|
|
+ 0
|
|
|
+ ELSE
|
|
|
+ 1
|
|
|
+ END) > 0 THEN
|
|
|
+ 1
|
|
|
+ ELSE
|
|
|
+ 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)
|
|
|
+ AND p.procedureid IN (20, 22, 23, 37, 53)
|
|
|
WHERE fp.createtime >= @DATEBEGIN@
|
|
|
AND fp.createtime <= @DATEEND@
|
|
|
GROUP BY fp.groutingdailydetailid) TF
|
|
|
@@ -506,14 +514,13 @@ public class rpt : IHttpHandler, IReadOnlySessionState
|
|
|
AND (M.GOODSNAME = @GOODSNAME@ OR @GOODSNAME@ IS NULL)
|
|
|
GROUP BY GROUPING SETS(( M.GOODSID, M.GOODSCODE, M.GOODSNAME, M.GOODSMODEL,G.GLAZETYPEID, D.DICTIONARYVALUE, O.LOGONAME),())
|
|
|
ORDER BY M.GOODSCODE
|
|
|
- ,GID) T ".Replace("{BUILDINGNO}", buding).Replace("{goodsCodes}", goodsStr);
|
|
|
+ ,GID) T ".Replace("{BUILDINGNO}", buding).Replace("{goodsCodes}", goodssql);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
//获取查询条件
|
|
|
List<CDAParameter> sqlPara = new List<CDAParameter>();
|
|
|
- //sqlPara.Add(new CDAParameter("ACCOUNTID", context.Session["accountId"].ToString()));
|
|
|
sqlPara.Add(new CDAParameter("DATEBEGIN", Convert.ToDateTime(context.Request["datebeginMaster"]), DataType.DateTime));
|
|
|
sqlPara.Add(new CDAParameter("DATEEND", Convert.ToDateTime(context.Request["dateendMaster"]), DataType.DateTime));
|
|
|
sqlPara.Add(new CDAParameter("GLAZETYPEID", context.Request["glazetypeidMaster"]));
|
|
|
@@ -694,12 +701,11 @@ public class rpt : IHttpHandler, IReadOnlySessionState
|
|
|
|
|
|
|
|
|
string test = context.Request["datebeginMaster"].ToString().Remove(4, 1);
|
|
|
- string test2 = context.Request["dateendMaster"].ToString().Remove(4, 1);
|
|
|
+ string test2 = context.Request["dateendMaster"].ToString().Remove(4, 1);
|
|
|
|
|
|
- List<CDAParameter> sqlPara = new List<CDAParameter>();
|
|
|
- //sqlPara.Add(new CDAParameter("ACCOUNTID", context.Session["accountId"].ToString()));
|
|
|
- sqlPara.Add(new CDAParameter("BEGINMONTH", Convert.ToInt32(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", Convert.ToInt32(context.Request["dateendMaster"].Substring(0, context.Request["dateendMaster"].IndexOf("-")) + context.Request["dateendMaster"].Substring(context.Request["dateendMaster"].IndexOf("-") + 1).PadLeft(2, '0'))));
|
|
|
+ List<CDAParameter> sqlPara = new List<CDAParameter>();
|
|
|
+ sqlPara.Add(new CDAParameter("BEGINMONTH", Convert.ToInt32(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", Convert.ToInt32(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("GLAZETYPEID", context.Request["glazetypeidMaster"]));
|
|
|
sqlPara.Add(new CDAParameter("LOGOID", context.Request["logoidMaster"]));
|
|
|
sqlPara.Add(new CDAParameter("GOODSMODEL", context.Request["goodsmodelMaster"]));
|