|
@@ -14,92 +14,78 @@ using DK.XuWei.WebMes;
|
|
|
|
|
|
|
|
public class rpt : IHttpHandler, IReadOnlySessionState
|
|
public class rpt : IHttpHandler, IReadOnlySessionState
|
|
|
{
|
|
{
|
|
|
- List<CDAParameter> goodsnull = new List<CDAParameter>();
|
|
|
|
|
- string[] goodsCodes = new string[] { };
|
|
|
|
|
- string goodsStr = "";
|
|
|
|
|
- DataTable goodsTable = new DataTable();
|
|
|
|
|
- string defectStr = "";
|
|
|
|
|
- DataTable col = new DataTable();
|
|
|
|
|
- string proc = "";
|
|
|
|
|
- string sqlStr = "";
|
|
|
|
|
- //楼号
|
|
|
|
|
- string buding = null;
|
|
|
|
|
- public void ProcessRequest(HttpContext context)
|
|
|
|
|
- {
|
|
|
|
|
- context.Response.ContentType = "text/plain";
|
|
|
|
|
- proc = context.Request["procedureidMaster"].ToString();
|
|
|
|
|
- //主表
|
|
|
|
|
- if (context.Request["m"].ToString() == "master")
|
|
|
|
|
- {
|
|
|
|
|
- #region 产品编码
|
|
|
|
|
- using (IDataAccess conn = DataAccess.Create())
|
|
|
|
|
- {
|
|
|
|
|
- if (context.Request["GOODSCODE"] != "" || context.Request["GOODSCODE"] != null)
|
|
|
|
|
- {
|
|
|
|
|
- goodsCodes = context.Request["GOODSCODE"].ToString().Split(',');
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- string goodssql = @"SELECT
|
|
|
|
|
|
|
+ List<CDAParameter> goodsnull = new List<CDAParameter>();
|
|
|
|
|
+ string[] goodsCodes = new string[] { };
|
|
|
|
|
+ string goodsStr = "";
|
|
|
|
|
+ DataTable goodsTable = new DataTable();
|
|
|
|
|
+ string defectStr = "";
|
|
|
|
|
+ DataTable col = new DataTable();
|
|
|
|
|
+ string proc = "";
|
|
|
|
|
+ string sqlStr = "";
|
|
|
|
|
+ //楼号
|
|
|
|
|
+ string buding = null;
|
|
|
|
|
+ public void ProcessRequest(HttpContext context)
|
|
|
|
|
+ {
|
|
|
|
|
+ context.Response.ContentType = "text/plain";
|
|
|
|
|
+ proc = context.Request["procedureidMaster"].ToString();
|
|
|
|
|
+ //主表
|
|
|
|
|
+ if (context.Request["m"].ToString() == "master")
|
|
|
|
|
+ {
|
|
|
|
|
+ #region 产品编码
|
|
|
|
|
+ if (context.Request["GOODSCODE"] != "" || context.Request["GOODSCODE"] != null)
|
|
|
|
|
+ {
|
|
|
|
|
+ goodsCodes = context.Request["GOODSCODE"].ToString().Split(',');
|
|
|
|
|
+ }
|
|
|
|
|
+ string goodssql = @"SELECT
|
|
|
GOODSCODE
|
|
GOODSCODE
|
|
|
- FROM TP_MST_GOODS
|
|
|
|
|
- WHERE VALUEFLAG=1";
|
|
|
|
|
- if (goodsCodes.Length > 1 || goodsCodes[0] != "")
|
|
|
|
|
- {
|
|
|
|
|
- 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[i] + "%') ";
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- else
|
|
|
|
|
- {
|
|
|
|
|
- goodssql += @" AND GOODSCODE LIKE ('%" + goodsCodes[0] + "%') ";
|
|
|
|
|
- for (int i = 1; i < goodsCodes.Length; i++)
|
|
|
|
|
- {
|
|
|
|
|
- goodssql += @" OR GOODSCODE LIKE ('%" + goodsCodes[i] + "%') ";
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- goodsTable = conn.ExecuteDatatable(goodssql, goodsnull.ToArray());
|
|
|
|
|
|
|
+ FROM TP_MST_GOODS where 1=1";
|
|
|
|
|
+ if (goodsCodes.Length > 1 || goodsCodes[0] != "")
|
|
|
|
|
+ {
|
|
|
|
|
+ if (context.Request["isNotcheck"].ToString() == "1")
|
|
|
|
|
+ {
|
|
|
|
|
+ goodssql += @" AND GOODSCODE NOT LIKE ('%" + goodsCodes[0].ToUpper() + "%') ";
|
|
|
|
|
+ for (int i = 1; i < goodsCodes.Length; i++)
|
|
|
|
|
+ {
|
|
|
|
|
+ goodssql += @" AND GOODSCODE NOT LIKE ('%" + goodsCodes[i].ToUpper() + "%') ";
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ goodssql += @" AND GOODSCODE LIKE ('%" + goodsCodes[0].ToUpper() + "%') ";
|
|
|
|
|
+ for (int i = 1; i < goodsCodes.Length; i++)
|
|
|
|
|
+ {
|
|
|
|
|
+ goodssql += @" OR GOODSCODE LIKE ('%" + goodsCodes[i].ToUpper() + "%') ";
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- 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
|
|
|
|
|
- #region 取缺陷拼接串
|
|
|
|
|
- string procedureId = "21,2,6,16,31,25,30,33,7,8,9";
|
|
|
|
|
- if (context.Request["buildingnoMaster"].ToString().IndexOf("2#") >= 0)
|
|
|
|
|
- {
|
|
|
|
|
- //二期 原料21 成型2 施釉6 循环线16 出装/登窑7 烧窑/入窑8 卸窑9
|
|
|
|
|
- procedureId = "21,2,6,16,7,8,9";
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ #endregion
|
|
|
|
|
+ #region 取缺陷拼接串
|
|
|
|
|
+ string procedureId = "21,2,6,16,31,25,30,33,7,8,9";
|
|
|
|
|
+ if (context.Request["buildingnoMaster"].ToString().IndexOf("2#") >= 0)
|
|
|
|
|
+ {
|
|
|
|
|
+ //二期 原料21 成型2 施釉6 循环线16 出装/登窑7 烧窑/入窑8 卸窑9
|
|
|
|
|
+ procedureId = "21,2,6,16,7,8,9";
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- if (context.Request["buildingnoMaster"].ToString().IndexOf("1#") >= 0)
|
|
|
|
|
- {
|
|
|
|
|
- //一期 原料31 成型25 施釉30 循环线33 出装/登窑7 烧窑/入窑8 卸窑9
|
|
|
|
|
- procedureId = "31,25,30,33,7,8,9";
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ if (context.Request["buildingnoMaster"].ToString().IndexOf("1#") >= 0)
|
|
|
|
|
+ {
|
|
|
|
|
+ //一期 原料31 成型25 施釉30 循环线33 出装/登窑7 烧窑/入窑8 卸窑9
|
|
|
|
|
+ procedureId = "31,25,30,33,7,8,9";
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
|
|
|
- if (context.Request["buildingnoMaster"].ToString() != "12")
|
|
|
|
|
- {
|
|
|
|
|
- buding = "IN('" + context.Request["buildingnoMaster"] + "')";
|
|
|
|
|
- }
|
|
|
|
|
- else
|
|
|
|
|
- {
|
|
|
|
|
- buding = "IN(" + "'1#','2#'" + ")";
|
|
|
|
|
- }
|
|
|
|
|
- using (IDataAccess conn = DataAccess.Create())
|
|
|
|
|
- {
|
|
|
|
|
- col = conn.ExecuteDatatable(@"
|
|
|
|
|
|
|
+ if (context.Request["buildingnoMaster"].ToString() != "12")
|
|
|
|
|
+ {
|
|
|
|
|
+ buding = "IN('" + context.Request["buildingnoMaster"] + "')";
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ buding = "IN(" + "'1#','2#'" + ")";
|
|
|
|
|
+ }
|
|
|
|
|
+ using (IDataAccess conn = DataAccess.Create())
|
|
|
|
|
+ {
|
|
|
|
|
+ col = conn.ExecuteDatatable(@"
|
|
|
SELECT
|
|
SELECT
|
|
|
DG.DEFECTGROUPTYPE AS TNO,
|
|
DG.DEFECTGROUPTYPE AS TNO,
|
|
|
DG.DEFECTGROUPID AS DNO,
|
|
DG.DEFECTGROUPID AS DNO,
|
|
@@ -124,23 +110,23 @@ public class rpt : IHttpHandler, IReadOnlySessionState
|
|
|
ORDER BY
|
|
ORDER BY
|
|
|
TNO,DNO
|
|
TNO,DNO
|
|
|
");
|
|
");
|
|
|
- }
|
|
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- for (int i = 0; i < col.Rows.Count; i++)
|
|
|
|
|
- {
|
|
|
|
|
- if (defectStr.IndexOf("'" + col.Rows[i]["DEFECT"].ToString() + "'") < 0)
|
|
|
|
|
- {
|
|
|
|
|
- if (i > 0) defectStr += ",";
|
|
|
|
|
- defectStr += "'" + col.Rows[i]["DEFECT"].ToString() + "' AS " + col.Rows[i]["DEFECT"].ToString();
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- #endregion
|
|
|
|
|
- using (IDataAccess conn = DataAccess.Create())
|
|
|
|
|
- {
|
|
|
|
|
- if (proc == "13")
|
|
|
|
|
- {
|
|
|
|
|
- //读取报表数据
|
|
|
|
|
- sqlStr = @"
|
|
|
|
|
|
|
+ for (int i = 0; i < col.Rows.Count; i++)
|
|
|
|
|
+ {
|
|
|
|
|
+ if (defectStr.IndexOf("'" + col.Rows[i]["DEFECT"].ToString() + "'") < 0)
|
|
|
|
|
+ {
|
|
|
|
|
+ if (i > 0) defectStr += ",";
|
|
|
|
|
+ defectStr += "'" + col.Rows[i]["DEFECT"].ToString() + "' AS " + col.Rows[i]["DEFECT"].ToString();
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ #endregion
|
|
|
|
|
+ using (IDataAccess conn = DataAccess.Create())
|
|
|
|
|
+ {
|
|
|
|
|
+ if (proc == "13")
|
|
|
|
|
+ {
|
|
|
|
|
+ //读取报表数据
|
|
|
|
|
+ sqlStr = @"
|
|
|
SELECT
|
|
SELECT
|
|
|
DECODE( TA.GID, 3, '合计', TA.GOODSTYPENAME ) AS 产品类别,
|
|
DECODE( TA.GID, 3, '合计', TA.GOODSTYPENAME ) AS 产品类别,
|
|
|
--TA.GOODSCODE AS 产品编码,
|
|
--TA.GOODSCODE AS 产品编码,
|
|
@@ -371,12 +357,12 @@ public class rpt : IHttpHandler, IReadOnlySessionState
|
|
|
OR ( TA.GID = 3 )
|
|
OR ( TA.GID = 3 )
|
|
|
)
|
|
)
|
|
|
ORDER BY TA.GOODSTYPENAME,TA.GOODSCODE
|
|
ORDER BY TA.GOODSTYPENAME,TA.GOODSCODE
|
|
|
- ".Replace("{DEFECT}", defectStr).Replace("{BUILDINGNO}", buding).Replace("{goodsCodes}", goodsStr);
|
|
|
|
|
- }
|
|
|
|
|
- else
|
|
|
|
|
- {
|
|
|
|
|
- //读取报表数据
|
|
|
|
|
- sqlStr = @"
|
|
|
|
|
|
|
+ ".Replace("{DEFECT}", defectStr).Replace("{BUILDINGNO}", buding).Replace("{goodsCodes}", goodssql);
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ //读取报表数据
|
|
|
|
|
+ sqlStr = @"
|
|
|
SELECT
|
|
SELECT
|
|
|
DECODE( TA.GID, 3, '合计', TA.GOODSTYPENAME ) AS 产品类别,
|
|
DECODE( TA.GID, 3, '合计', TA.GOODSTYPENAME ) AS 产品类别,
|
|
|
--TA.GOODSCODE AS 产品编码,
|
|
--TA.GOODSCODE AS 产品编码,
|
|
@@ -606,149 +592,149 @@ public class rpt : IHttpHandler, IReadOnlySessionState
|
|
|
OR ( TA.GID = 3 )
|
|
OR ( TA.GID = 3 )
|
|
|
)
|
|
)
|
|
|
ORDER BY TA.GOODSTYPENAME,TA.GOODSCODE
|
|
ORDER BY TA.GOODSTYPENAME,TA.GOODSCODE
|
|
|
- ".Replace("{DEFECT}", defectStr).Replace("{BUILDINGNO}", buding).Replace("{goodsCodes}", goodsStr);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ ".Replace("{DEFECT}", defectStr).Replace("{BUILDINGNO}", buding).Replace("{goodsCodes}", goodssql);
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- //获取查询条件
|
|
|
|
|
- List<CDAParameter> sqlPara = new List<CDAParameter>();
|
|
|
|
|
- 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("KILNID", context.Request["kilnidMaster"]));
|
|
|
|
|
- sqlPara.Add(new CDAParameter("PROCEDUREID", context.Request["procedureidMaster"]));
|
|
|
|
|
|
|
+ //获取查询条件
|
|
|
|
|
+ List<CDAParameter> sqlPara = new List<CDAParameter>();
|
|
|
|
|
+ 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("KILNID", context.Request["kilnidMaster"]));
|
|
|
|
|
+ sqlPara.Add(new CDAParameter("PROCEDUREID", context.Request["procedureidMaster"]));
|
|
|
|
|
|
|
|
- if (context.Request["goodscodeMaster[]"] is object)
|
|
|
|
|
- {
|
|
|
|
|
- if (context.Request["goodscodeMaster[]"].ToString() != "")
|
|
|
|
|
- {
|
|
|
|
|
- sqlPara.Add(new CDAParameter("GOODSCODE", context.Request["goodscodeMaster[]"]));
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ if (context.Request["goodscodeMaster[]"] is object)
|
|
|
|
|
+ {
|
|
|
|
|
+ if (context.Request["goodscodeMaster[]"].ToString() != "")
|
|
|
|
|
+ {
|
|
|
|
|
+ sqlPara.Add(new CDAParameter("GOODSCODE", context.Request["goodscodeMaster[]"]));
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- if (context.Request["goodscodeMaster"] is object)
|
|
|
|
|
- {
|
|
|
|
|
- if (context.Request["goodscodeMaster"].ToString() != "")
|
|
|
|
|
- {
|
|
|
|
|
- sqlPara.Add(new CDAParameter("GOODSCODE", context.Request["goodscodeMaster"]));
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- else
|
|
|
|
|
- {
|
|
|
|
|
- sqlPara.Add(new CDAParameter("GOODSCODE", null));
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ if (context.Request["goodscodeMaster"] is object)
|
|
|
|
|
+ {
|
|
|
|
|
+ if (context.Request["goodscodeMaster"].ToString() != "")
|
|
|
|
|
+ {
|
|
|
|
|
+ sqlPara.Add(new CDAParameter("GOODSCODE", context.Request["goodscodeMaster"]));
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ sqlPara.Add(new CDAParameter("GOODSCODE", null));
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- if (context.Request["goodsnameMaster"] is object)
|
|
|
|
|
- {
|
|
|
|
|
- if (context.Request["goodsnameMaster"].ToString() != "")
|
|
|
|
|
- {
|
|
|
|
|
- sqlPara.Add(new CDAParameter("GOODSNAME", context.Request["goodsnameMaster"]));
|
|
|
|
|
- }
|
|
|
|
|
- else
|
|
|
|
|
- {
|
|
|
|
|
- sqlPara.Add(new CDAParameter("GOODSNAME", null));
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- else
|
|
|
|
|
- {
|
|
|
|
|
- sqlPara.Add(new CDAParameter("GOODSNAME", null));
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ if (context.Request["goodsnameMaster"] is object)
|
|
|
|
|
+ {
|
|
|
|
|
+ if (context.Request["goodsnameMaster"].ToString() != "")
|
|
|
|
|
+ {
|
|
|
|
|
+ sqlPara.Add(new CDAParameter("GOODSNAME", context.Request["goodsnameMaster"]));
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ sqlPara.Add(new CDAParameter("GOODSNAME", null));
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ sqlPara.Add(new CDAParameter("GOODSNAME", null));
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- //xuwei add 2023-12-29 ====================================
|
|
|
|
|
- //=========================================================
|
|
|
|
|
- sqlStr = sqlStr.Replace("@DATEBEGIN@", "DATE'" + Convert.ToDateTime(context.Request["datebeginMaster"]).ToString("yyyy-MM-dd") + "'");
|
|
|
|
|
- sqlStr = sqlStr.Replace("@DATEEND@", "DATE'" + Convert.ToDateTime(context.Request["dateendMaster"]).AddSeconds(1).ToString("yyyy-MM-dd") + "'");
|
|
|
|
|
- sqlStr = sqlStr.Replace("@KILNID@", context.Request["kilnidMaster"].ToString() != "" ? context.Request["kilnidMaster"].ToString() : " NULL ");
|
|
|
|
|
- sqlStr = sqlStr.Replace("@PROCEDUREID@", context.Request["procedureidMaster"].ToString() != "" ? context.Request["procedureidMaster"].ToString() : " NULL ");
|
|
|
|
|
- sqlStr = sqlStr.Replace("@GOODSCODE@", " '' ");
|
|
|
|
|
- sqlStr = sqlStr.Replace("@GOODSNAME@", " '' ");
|
|
|
|
|
- string nameGuid = string.Empty;
|
|
|
|
|
- nameGuid = DateTime.Now.ToString("hh24:mi:ss").Replace("/", "").Replace(":", "").Replace(" ", "");
|
|
|
|
|
- sqlStr = @"CREATE OR REPLACE PROCEDURE PRO_" + nameGuid + @" (RS OUT SYS_REFCURSOR) IS
|
|
|
|
|
|
|
+ //xuwei add 2023-12-29 ====================================
|
|
|
|
|
+ //=========================================================
|
|
|
|
|
+ sqlStr = sqlStr.Replace("@DATEBEGIN@", "DATE'" + Convert.ToDateTime(context.Request["datebeginMaster"]).ToString("yyyy-MM-dd") + "'");
|
|
|
|
|
+ sqlStr = sqlStr.Replace("@DATEEND@", "DATE'" + Convert.ToDateTime(context.Request["dateendMaster"]).AddSeconds(1).ToString("yyyy-MM-dd") + "'");
|
|
|
|
|
+ sqlStr = sqlStr.Replace("@KILNID@", context.Request["kilnidMaster"].ToString() != "" ? context.Request["kilnidMaster"].ToString() : " NULL ");
|
|
|
|
|
+ sqlStr = sqlStr.Replace("@PROCEDUREID@", context.Request["procedureidMaster"].ToString() != "" ? context.Request["procedureidMaster"].ToString() : " NULL ");
|
|
|
|
|
+ sqlStr = sqlStr.Replace("@GOODSCODE@", " '' ");
|
|
|
|
|
+ sqlStr = sqlStr.Replace("@GOODSNAME@", " '' ");
|
|
|
|
|
+ string nameGuid = string.Empty;
|
|
|
|
|
+ nameGuid = DateTime.Now.ToString("hh24:mi:ss").Replace("/", "").Replace(":", "").Replace(" ", "");
|
|
|
|
|
+ sqlStr = @"CREATE OR REPLACE PROCEDURE PRO_" + nameGuid + @" (RS OUT SYS_REFCURSOR) IS
|
|
|
BEGIN
|
|
BEGIN
|
|
|
OPEN RS FOR
|
|
OPEN RS FOR
|
|
|
" + sqlStr +
|
|
" + sqlStr +
|
|
|
|
|
|
|
|
- @";
|
|
|
|
|
|
|
+ @";
|
|
|
END PRO_" + nameGuid + @";
|
|
END PRO_" + nameGuid + @";
|
|
|
";
|
|
";
|
|
|
- conn.ExecuteNonQuery(sqlStr);
|
|
|
|
|
- sqlPara.Clear();
|
|
|
|
|
- string procedureName = "PRO_" + nameGuid;
|
|
|
|
|
- sqlPara.Add(new CDAParameter("rs", DataType.Cursor, ParameterDirection.Output));
|
|
|
|
|
- DataTable dt = conn.ExecuteSPDatatable(procedureName, sqlPara.ToArray());
|
|
|
|
|
- string deleteProcedure = "drop PROCEDURE PRO_" + nameGuid;
|
|
|
|
|
- int resultProcedure = conn.ExecuteNonQuery(deleteProcedure);
|
|
|
|
|
|
|
+ conn.ExecuteNonQuery(sqlStr);
|
|
|
|
|
+ sqlPara.Clear();
|
|
|
|
|
+ string procedureName = "PRO_" + nameGuid;
|
|
|
|
|
+ sqlPara.Add(new CDAParameter("rs", DataType.Cursor, ParameterDirection.Output));
|
|
|
|
|
+ DataTable dt = conn.ExecuteSPDatatable(procedureName, sqlPara.ToArray());
|
|
|
|
|
+ string deleteProcedure = "drop PROCEDURE PRO_" + nameGuid;
|
|
|
|
|
+ int resultProcedure = conn.ExecuteNonQuery(deleteProcedure);
|
|
|
|
|
|
|
|
- //直接获取不分页数据
|
|
|
|
|
- //DataTable dt = conn.ExecuteDatatable(sqlStr, sqlPara.ToArray());
|
|
|
|
|
- //
|
|
|
|
|
- //xuwei end ==============================================
|
|
|
|
|
- //========================================================
|
|
|
|
|
|
|
+ //直接获取不分页数据
|
|
|
|
|
+ //DataTable dt = conn.ExecuteDatatable(sqlStr, sqlPara.ToArray());
|
|
|
|
|
+ //
|
|
|
|
|
+ //xuwei end ==============================================
|
|
|
|
|
+ //========================================================
|
|
|
|
|
|
|
|
- dt.Columns.Remove("D_GID");
|
|
|
|
|
- dt.Columns.Remove("D_goodstypecode");
|
|
|
|
|
- dt.Columns.Remove("D_goodscode");
|
|
|
|
|
- //处理列特殊字符
|
|
|
|
|
- for (int c = 0; c < dt.Columns.Count; c++)
|
|
|
|
|
- {
|
|
|
|
|
- dt.Columns[c].ColumnName = dt.Columns[c].ColumnName.Replace("'", "").Replace("+", "").Replace('/', ' ');
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ dt.Columns.Remove("D_GID");
|
|
|
|
|
+ dt.Columns.Remove("D_goodstypecode");
|
|
|
|
|
+ dt.Columns.Remove("D_goodscode");
|
|
|
|
|
+ //处理列特殊字符
|
|
|
|
|
+ for (int c = 0; c < dt.Columns.Count; c++)
|
|
|
|
|
+ {
|
|
|
|
|
+ dt.Columns[c].ColumnName = dt.Columns[c].ColumnName.Replace("'", "").Replace("+", "").Replace('/', ' ');
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- //增加 施釉循环线合计
|
|
|
|
|
- int ind1 = dt.Columns.IndexOf("施釉缺陷_合计");
|
|
|
|
|
- int ind2 = dt.Columns.IndexOf("循环线施釉缺陷_合计");
|
|
|
|
|
- int ind = Math.Max(ind1, ind2);
|
|
|
|
|
- if (ind > 0)
|
|
|
|
|
- {
|
|
|
|
|
- dt.Columns.Add(new DataColumn("施釉_合计", typeof(Int32)));
|
|
|
|
|
- dt.Columns["施釉_合计"].SetOrdinal(ind + 1);
|
|
|
|
|
- for (int i = 0; i < dt.Rows.Count; i++)
|
|
|
|
|
- {
|
|
|
|
|
- int c1 = 0;
|
|
|
|
|
- int c2 = 0;
|
|
|
|
|
- if (ind1 > 0 && dt.Rows[i]["施釉缺陷_合计"] != DBNull.Value)
|
|
|
|
|
- {
|
|
|
|
|
- c1 = Convert.ToInt32(dt.Rows[i]["施釉缺陷_合计"]);
|
|
|
|
|
- }
|
|
|
|
|
- if (ind2 > 0 && dt.Rows[i]["循环线施釉缺陷_合计"] != DBNull.Value)
|
|
|
|
|
- {
|
|
|
|
|
- c2 = Convert.ToInt32(dt.Rows[i]["循环线施釉缺陷_合计"]);
|
|
|
|
|
- }
|
|
|
|
|
- if (c1 + c2 > 0)
|
|
|
|
|
- {
|
|
|
|
|
- dt.Rows[i]["施釉_合计"] = c1 + c2;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- //获取分页参数
|
|
|
|
|
- int page = HttpContext.Current.Request["page"] is object ? Convert.ToInt32(HttpContext.Current.Request["page"]) : 1;
|
|
|
|
|
- int rows = HttpContext.Current.Request["rows"] is object ? Convert.ToInt32(HttpContext.Current.Request["rows"]) : 10;
|
|
|
|
|
- string sort = HttpContext.Current.Request["sort"] is object ? HttpContext.Current.Request["sort"] : "m.REPORTCODE";
|
|
|
|
|
- string order = HttpContext.Current.Request["order"] is object ? HttpContext.Current.Request["order"] : "";
|
|
|
|
|
- //获取分页数据
|
|
|
|
|
- int total = 0;
|
|
|
|
|
- //dt = conn.SelectPages(page, rows, out total, sqlStr, sqlPara.ToArray());
|
|
|
|
|
- string jsonStr = new JsonResult(dt) { total = total }.ToJson();
|
|
|
|
|
- //string jsonStr = new JsonResult(dt) { total = dt.Rows.Count }.ToJson();
|
|
|
|
|
- context.Response.Write(jsonStr);
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ //增加 施釉循环线合计
|
|
|
|
|
+ int ind1 = dt.Columns.IndexOf("施釉缺陷_合计");
|
|
|
|
|
+ int ind2 = dt.Columns.IndexOf("循环线施釉缺陷_合计");
|
|
|
|
|
+ int ind = Math.Max(ind1, ind2);
|
|
|
|
|
+ if (ind > 0)
|
|
|
|
|
+ {
|
|
|
|
|
+ dt.Columns.Add(new DataColumn("施釉_合计", typeof(Int32)));
|
|
|
|
|
+ dt.Columns["施釉_合计"].SetOrdinal(ind + 1);
|
|
|
|
|
+ for (int i = 0; i < dt.Rows.Count; i++)
|
|
|
|
|
+ {
|
|
|
|
|
+ int c1 = 0;
|
|
|
|
|
+ int c2 = 0;
|
|
|
|
|
+ if (ind1 > 0 && dt.Rows[i]["施釉缺陷_合计"] != DBNull.Value)
|
|
|
|
|
+ {
|
|
|
|
|
+ c1 = Convert.ToInt32(dt.Rows[i]["施釉缺陷_合计"]);
|
|
|
|
|
+ }
|
|
|
|
|
+ if (ind2 > 0 && dt.Rows[i]["循环线施釉缺陷_合计"] != DBNull.Value)
|
|
|
|
|
+ {
|
|
|
|
|
+ c2 = Convert.ToInt32(dt.Rows[i]["循环线施釉缺陷_合计"]);
|
|
|
|
|
+ }
|
|
|
|
|
+ if (c1 + c2 > 0)
|
|
|
|
|
+ {
|
|
|
|
|
+ dt.Rows[i]["施釉_合计"] = c1 + c2;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ //获取分页参数
|
|
|
|
|
+ int page = HttpContext.Current.Request["page"] is object ? Convert.ToInt32(HttpContext.Current.Request["page"]) : 1;
|
|
|
|
|
+ int rows = HttpContext.Current.Request["rows"] is object ? Convert.ToInt32(HttpContext.Current.Request["rows"]) : 10;
|
|
|
|
|
+ string sort = HttpContext.Current.Request["sort"] is object ? HttpContext.Current.Request["sort"] : "m.REPORTCODE";
|
|
|
|
|
+ string order = HttpContext.Current.Request["order"] is object ? HttpContext.Current.Request["order"] : "";
|
|
|
|
|
+ //获取分页数据
|
|
|
|
|
+ int total = 0;
|
|
|
|
|
+ //dt = conn.SelectPages(page, rows, out total, sqlStr, sqlPara.ToArray());
|
|
|
|
|
+ string jsonStr = new JsonResult(dt) { total = total }.ToJson();
|
|
|
|
|
+ //string jsonStr = new JsonResult(dt) { total = dt.Rows.Count }.ToJson();
|
|
|
|
|
+ context.Response.Write(jsonStr);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- if (context.Request["m"].ToString() == "jiezhauang")
|
|
|
|
|
- {
|
|
|
|
|
- using (IDataAccess conn = DataAccess.Create())
|
|
|
|
|
- {
|
|
|
|
|
- string buding = null;
|
|
|
|
|
- if (context.Request["buildingnoMaster"].ToString() != "12")
|
|
|
|
|
- {
|
|
|
|
|
- buding = "IN('" + context.Request["buildingnoMaster"] + "')";
|
|
|
|
|
- }
|
|
|
|
|
- else
|
|
|
|
|
- {
|
|
|
|
|
- buding = "IN(" + "'1#','2#'" + ")";
|
|
|
|
|
- }
|
|
|
|
|
- string sqlStr = @"
|
|
|
|
|
|
|
+ if (context.Request["m"].ToString() == "jiezhauang")
|
|
|
|
|
+ {
|
|
|
|
|
+ using (IDataAccess conn = DataAccess.Create())
|
|
|
|
|
+ {
|
|
|
|
|
+ string buding = null;
|
|
|
|
|
+ if (context.Request["buildingnoMaster"].ToString() != "12")
|
|
|
|
|
+ {
|
|
|
|
|
+ buding = "IN('" + context.Request["buildingnoMaster"] + "')";
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ buding = "IN(" + "'1#','2#'" + ")";
|
|
|
|
|
+ }
|
|
|
|
|
+ string sqlStr = @"
|
|
|
SELECT
|
|
SELECT
|
|
|
DECODE(产品类别, null, '合计',产品类别) 产品类别,
|
|
DECODE(产品类别, null, '合计',产品类别) 产品类别,
|
|
|
产品名称 ,
|
|
产品名称 ,
|
|
@@ -939,30 +925,30 @@ public class rpt : IHttpHandler, IReadOnlySessionState
|
|
|
) GROUP BY
|
|
) GROUP BY
|
|
|
GROUPING SETS ((产品类别,产品名称),()) ".Replace("{BUILDINGNO}", buding);
|
|
GROUPING SETS ((产品类别,产品名称),()) ".Replace("{BUILDINGNO}", buding);
|
|
|
|
|
|
|
|
- //获取查询条件
|
|
|
|
|
- List<CDAParameter> sqlPara = new List<CDAParameter>();
|
|
|
|
|
- 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("BUILDINGNO", context.Request["buildingnoMaster"]));
|
|
|
|
|
- sqlPara.Add(new CDAParameter("KILNID", context.Request["kilnidMaster"]));
|
|
|
|
|
- sqlPara.Add(new CDAParameter("PROCEDUREID", context.Request["procedureidMaster"]));
|
|
|
|
|
- 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')));
|
|
|
|
|
|
|
+ //获取查询条件
|
|
|
|
|
+ List<CDAParameter> sqlPara = new List<CDAParameter>();
|
|
|
|
|
+ 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("BUILDINGNO", context.Request["buildingnoMaster"]));
|
|
|
|
|
+ sqlPara.Add(new CDAParameter("KILNID", context.Request["kilnidMaster"]));
|
|
|
|
|
+ sqlPara.Add(new CDAParameter("PROCEDUREID", context.Request["procedureidMaster"]));
|
|
|
|
|
+ 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')));
|
|
|
|
|
|
|
|
- //获取分页数据
|
|
|
|
|
- int total = 0;
|
|
|
|
|
- DataTable dt = conn.ExecuteDatatable(sqlStr, sqlPara.ToArray());
|
|
|
|
|
- string jsonStr = new JsonResult(dt) { total = total }.ToJson();
|
|
|
|
|
- context.Response.Write(jsonStr);
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ //获取分页数据
|
|
|
|
|
+ int total = 0;
|
|
|
|
|
+ DataTable dt = conn.ExecuteDatatable(sqlStr, sqlPara.ToArray());
|
|
|
|
|
+ string jsonStr = new JsonResult(dt) { total = total }.ToJson();
|
|
|
|
|
+ context.Response.Write(jsonStr);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- public bool IsReusable
|
|
|
|
|
- {
|
|
|
|
|
- get
|
|
|
|
|
- {
|
|
|
|
|
- return false;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ public bool IsReusable
|
|
|
|
|
+ {
|
|
|
|
|
+ get
|
|
|
|
|
+ {
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|