|
|
@@ -17,7 +17,7 @@ public class rpt : IHttpHandler, IReadOnlySessionState
|
|
|
public void ProcessRequest(HttpContext context)
|
|
|
{
|
|
|
context.Response.ContentType = "text/plain";
|
|
|
- using(IDataAccess conn = DataAccess.Create())
|
|
|
+ using (IDataAccess conn = DataAccess.Create())
|
|
|
{
|
|
|
string groutinglineMaster = context.Request["groutinglineMaster"].ToString();
|
|
|
|
|
|
@@ -30,18 +30,23 @@ public class rpt : IHttpHandler, IReadOnlySessionState
|
|
|
string goodsId = context.Request["goodsMaster[]"] is object ? context.Request["goodsMaster[]"].ToString() : "0";
|
|
|
if (goodsId == "0" && (context.Request["goodsMaster"] is object)) goodsId = context.Request["goodsMaster"].ToString();
|
|
|
if (goodsId == "") goodsId = "0";
|
|
|
- if (!goodsId.Equals("0")) {
|
|
|
- List<string> list= new List<string>(goodsId.Split(','));
|
|
|
+ if (!goodsId.Equals("0"))
|
|
|
+ {
|
|
|
+ List<string> list = new List<string>(goodsId.Split(','));
|
|
|
List<string> newlist = new List<string>();
|
|
|
- foreach (string item in list) {
|
|
|
- if (IsNumber(item)) {
|
|
|
+ foreach (string item in list)
|
|
|
+ {
|
|
|
+ if (IsNumber(item))
|
|
|
+ {
|
|
|
newlist.Add(item);
|
|
|
}
|
|
|
}
|
|
|
- if (newlist != null && newlist.Count < 1) {
|
|
|
+ if (newlist != null && newlist.Count < 1)
|
|
|
+ {
|
|
|
goodsId = "0";
|
|
|
}
|
|
|
- else{
|
|
|
+ else
|
|
|
+ {
|
|
|
goodsId = string.Join(",", newlist);
|
|
|
}
|
|
|
}
|
|
|
@@ -64,14 +69,14 @@ public class rpt : IHttpHandler, IReadOnlySessionState
|
|
|
if (fireType == "重烧") fireType = "6";
|
|
|
|
|
|
string testType = context.Request["testMaster"];
|
|
|
- if (testType == "2") testType = "";
|
|
|
+ if (testType == "2") testType = "";
|
|
|
|
|
|
string KILNCODE = context.Request["KILNCODE"] is object ? context.Request["KILNCODE"].ToString() : "-1";
|
|
|
string DEFECTCODE = context.Request["DEFECTCODE"] is object ? context.Request["DEFECTCODE"].ToString() : "-1";
|
|
|
string DEFECTPOSITIONNAME = context.Request["DEFECTPOSITIONNAME"] is object ? context.Request["DEFECTPOSITIONNAME"].ToString() : "-1";
|
|
|
|
|
|
//主表
|
|
|
- if(context.Request["m"].ToString()=="0")
|
|
|
+ if (context.Request["m"].ToString() == "0")
|
|
|
{
|
|
|
//读取报表数据
|
|
|
string sqlStr = @"
|
|
|
@@ -98,11 +103,13 @@ public class rpt : IHttpHandler, IReadOnlySessionState
|
|
|
'本烧' AS 烧成类型,
|
|
|
PD.KILNCODE,
|
|
|
D.DEFECTCODE,
|
|
|
- D.DEFECTNAME,
|
|
|
+ --D.DEFECTNAME,
|
|
|
+ MD.DEFECTNAME,--缺陷名称显示 xcm 2023-4-11
|
|
|
DOL.OFFICENAME,
|
|
|
COUNT( DISTINCT D.BARCODE ) AS NUM
|
|
|
FROM
|
|
|
TP_PM_DEFECT D
|
|
|
+ LEFT JOIN tp_mst_defect MD ON D.defectid = MD.defectid --缺陷名称显示 xcm 2023-4-11
|
|
|
LEFT JOIN TP_MST_GOODS G ON D.GOODSID = G.GOODSID
|
|
|
LEFT JOIN TP_MST_GOODSTYPE GT ON G.GOODSTYPEID = GT.GOODSTYPEID
|
|
|
INNER JOIN TP_PM_PRODUCTIONDATA PD ON D.PRODUCTIONDATAID = PD.PRODUCTIONDATAID
|
|
|
@@ -137,18 +144,20 @@ public class rpt : IHttpHandler, IReadOnlySessionState
|
|
|
GROUP BY
|
|
|
PD.KILNCODE,
|
|
|
D.DEFECTCODE,
|
|
|
- D.DEFECTNAME,
|
|
|
+ MD.DEFECTNAME, --缺陷名称显示 xcm 2023-4-11
|
|
|
DOL.OFFICENAME
|
|
|
UNION
|
|
|
SELECT
|
|
|
'重烧' AS 烧成类型,
|
|
|
PD.KILNCODE,
|
|
|
D.DEFECTCODE,
|
|
|
- D.DEFECTNAME,
|
|
|
+ --D.DEFECTNAME,
|
|
|
+ MD.DEFECTNAME, --缺陷名称显示 xcm 2023-4-11
|
|
|
DOL.OFFICENAME,
|
|
|
COUNT( DISTINCT D.BARCODE ) AS NUM
|
|
|
FROM
|
|
|
TP_PM_DEFECT D
|
|
|
+ LEFT JOIN tp_mst_defect MD ON D.defectid = MD.defectid --缺陷名称显示 xcm 2023-4-11
|
|
|
LEFT JOIN TP_MST_GOODS G ON D.GOODSID = G.GOODSID
|
|
|
LEFT JOIN TP_MST_GOODSTYPE GT ON G.GOODSTYPEID = GT.GOODSTYPEID
|
|
|
INNER JOIN TP_PM_PRODUCTIONDATA PD ON D.PRODUCTIONDATAID = PD.PRODUCTIONDATAID
|
|
|
@@ -183,7 +192,7 @@ public class rpt : IHttpHandler, IReadOnlySessionState
|
|
|
GROUP BY
|
|
|
PD.KILNCODE,
|
|
|
D.DEFECTCODE,
|
|
|
- D.DEFECTNAME,
|
|
|
+ MD.DEFECTNAME, --缺陷名称显示 xcm 2023-4-11
|
|
|
DOL.OFFICENAME
|
|
|
)
|
|
|
)
|
|
|
@@ -235,15 +244,19 @@ public class rpt : IHttpHandler, IReadOnlySessionState
|
|
|
M.烧成类型,
|
|
|
M.KILNCODE,
|
|
|
M.DEFECTCODE,
|
|
|
- M.DEFECTNAME,
|
|
|
+ --M.DEFECTNAME,
|
|
|
+ MD.DEFECTNAME, --缺陷名称显示 xcm 2023-4-11
|
|
|
M.OFFICENAME,
|
|
|
M.RN,
|
|
|
D.DEFECTPOSITIONCODE,
|
|
|
- D.DEFECTPOSITIONNAME,
|
|
|
+ mdp.DEFECTPOSITIONNAME, --缺陷位置显示 xcm 2023-4-11
|
|
|
+ --D.DEFECTPOSITIONNAME,
|
|
|
COUNT( DISTINCT D.BARCODE ) AS NUM
|
|
|
FROM
|
|
|
MES M
|
|
|
LEFT JOIN TP_PM_DEFECT D ON M.DEFECTCODE = D.DEFECTCODE
|
|
|
+ LEFT JOIN tp_mst_defect MD ON D.defectid = MD.defectid --缺陷名称显示 xcm 2023-4-11
|
|
|
+ LEFT JOIN tp_mst_defectposition mdp on d.defectpositionid = mdp.defectpositionid --缺陷位置显示 xcm 2023-4-11
|
|
|
LEFT JOIN TP_MST_GOODS G ON D.GOODSID = G.GOODSID
|
|
|
LEFT JOIN TP_MST_GOODSTYPE GT ON G.GOODSTYPEID = GT.GOODSTYPEID
|
|
|
LEFT JOIN TP_PM_PRODUCTIONDATA PD ON D.PRODUCTIONDATAID = PD.PRODUCTIONDATAID
|
|
|
@@ -261,11 +274,11 @@ public class rpt : IHttpHandler, IReadOnlySessionState
|
|
|
M.烧成类型,
|
|
|
M.KILNCODE,
|
|
|
M.DEFECTCODE,
|
|
|
- M.DEFECTNAME,
|
|
|
+ md.DEFECTNAME,--缺陷名称显示 xcm 2023-4-11
|
|
|
M.OFFICENAME,
|
|
|
M.RN,
|
|
|
D.DEFECTPOSITIONCODE,
|
|
|
- D.DEFECTPOSITIONNAME
|
|
|
+ mdp.DEFECTPOSITIONNAME --缺陷位置显示 xcm 2023-4-11
|
|
|
)
|
|
|
)
|
|
|
WHERE
|
|
|
@@ -280,10 +293,10 @@ public class rpt : IHttpHandler, IReadOnlySessionState
|
|
|
".Replace("{F}", fireType)
|
|
|
.Replace("{K}", kilnId)
|
|
|
.Replace("{T}", testType)
|
|
|
- .Replace("{GOODSTYPECODE}",goodstypeCode)
|
|
|
+ .Replace("{GOODSTYPECODE}", goodstypeCode)
|
|
|
.Replace("{DEFECTDEDUCTION}", defectDeduction)
|
|
|
.Replace("{DEFECTFINE}", defectFine)
|
|
|
- .Replace("{GOODSID}",goodsId)
|
|
|
+ .Replace("{GOODSID}", goodsId)
|
|
|
//.Replace("{GROUTINGLINEID}", groutinglineId)
|
|
|
;
|
|
|
|
|
|
@@ -292,12 +305,21 @@ public class rpt : IHttpHandler, IReadOnlySessionState
|
|
|
sqlPara.Add(new CDAParameter("DATEBEGIN", dateBegin, DataType.DateTime));
|
|
|
sqlPara.Add(new CDAParameter("DATEEND", dateEnd, DataType.DateTime));
|
|
|
sqlPara.Add(new CDAParameter("GROUTINGLINECODE", groutinglineMaster));
|
|
|
- JsonResult data = Easyui.ExecuteJsonResult(conn, sqlStr, sqlPara);
|
|
|
- context.Response.Write(data.ToJson());
|
|
|
+ try
|
|
|
+ {
|
|
|
+ JsonResult data = Easyui.ExecuteJsonResult(conn, sqlStr, sqlPara);
|
|
|
+ context.Response.Write(data.ToJson());
|
|
|
+ }
|
|
|
+ catch (Exception ex)
|
|
|
+ {
|
|
|
+
|
|
|
+ throw;
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
//子表1
|
|
|
- if(context.Request["m"].ToString()=="1")
|
|
|
+ if (context.Request["m"].ToString() == "1")
|
|
|
{
|
|
|
//读取报表数据
|
|
|
string sqlStr = @"
|
|
|
@@ -310,8 +332,10 @@ public class rpt : IHttpHandler, IReadOnlySessionState
|
|
|
PD.GROUTINGLINECODE AS 成型线编码,
|
|
|
NVL(PD.KILNCODE,'--') AS 窑炉编码,
|
|
|
'_' || D.DEFECTCODE AS 缺陷编码,
|
|
|
- D.DEFECTNAME AS 缺陷名称,
|
|
|
- D.DEFECTPOSITIONNAME AS 缺陷位置,
|
|
|
+ --D.DEFECTNAME AS 缺陷名称,
|
|
|
+ MD.DEFECTNAME AS 缺陷名称, --缺陷名称显示 xcm 2023-4-11
|
|
|
+ --D.DEFECTPOSITIONNAME AS 缺陷位置,
|
|
|
+ MDP.DEFECTPOSITIONNAME AS 缺陷位置, --缺陷位置显示 xcm 2023-4-11
|
|
|
D.DEFECTPROCEDURENAME AS 责任工序,
|
|
|
DOL.OFFICENAME 所属科室,
|
|
|
D.DEFECTUSERCODE 责任工号,
|
|
|
@@ -320,6 +344,8 @@ public class rpt : IHttpHandler, IReadOnlySessionState
|
|
|
D.CREATETIME AS 登记时间
|
|
|
FROM
|
|
|
TP_PM_DEFECT D
|
|
|
+ LEFT JOIN tp_mst_defect MD ON D.defectid = MD.defectid --缺陷名称显示 xcm 2023-4-11
|
|
|
+ LEFT JOIN tp_mst_defectposition mdp on d.defectpositionid = mdp.defectpositionid --缺陷位置显示 xcm 2023-4-11
|
|
|
LEFT JOIN TP_MST_GOODS G ON D.GOODSID = G.GOODSID
|
|
|
LEFT JOIN TP_MST_GOODSTYPE GT ON G.GOODSTYPEID = GT.GOODSTYPEID
|
|
|
INNER JOIN TP_PM_PRODUCTIONDATA PD ON D.PRODUCTIONDATAID = PD.PRODUCTIONDATAID
|
|
|
@@ -361,8 +387,10 @@ public class rpt : IHttpHandler, IReadOnlySessionState
|
|
|
PD.GROUTINGLINECODE AS 成型线编码,
|
|
|
NVL(PD.KILNCODE,'--') AS 窑炉编码,
|
|
|
'_' || D.DEFECTCODE AS 缺陷编码,
|
|
|
- D.DEFECTNAME AS 缺陷名称,
|
|
|
- D.DEFECTPOSITIONNAME AS 缺陷位置,
|
|
|
+ --D.DEFECTNAME AS 缺陷名称,
|
|
|
+ MD.DEFECTNAME AS 缺陷名称, --缺陷名称显示 xcm 2023-4-11
|
|
|
+ --D.DEFECTPOSITIONNAME AS 缺陷位置,
|
|
|
+ MDP.DEFECTPOSITIONNAME AS 缺陷位置, --缺陷位置显示 xcm 2023-4-11
|
|
|
D.DEFECTPROCEDURENAME AS 责任工序,
|
|
|
DOL.OFFICENAME 所属科室,
|
|
|
D.DEFECTUSERCODE 责任工号,
|
|
|
@@ -371,6 +399,8 @@ public class rpt : IHttpHandler, IReadOnlySessionState
|
|
|
D.CREATETIME AS 登记时间
|
|
|
FROM
|
|
|
TP_PM_DEFECT D
|
|
|
+ LEFT JOIN tp_mst_defect MD ON D.defectid = MD.defectid --缺陷名称显示 xcm 2023-4-11
|
|
|
+ LEFT JOIN tp_mst_defectposition mdp on d.defectpositionid = mdp.defectpositionid --缺陷位置显示 xcm 2023-4-11
|
|
|
LEFT JOIN TP_MST_GOODS G ON D.GOODSID = G.GOODSID
|
|
|
LEFT JOIN TP_MST_GOODSTYPE GT ON G.GOODSTYPEID = GT.GOODSTYPEID
|
|
|
INNER JOIN TP_PM_PRODUCTIONDATA PD ON D.PRODUCTIONDATAID = PD.PRODUCTIONDATAID
|
|
|
@@ -404,9 +434,9 @@ public class rpt : IHttpHandler, IReadOnlySessionState
|
|
|
AND (DF.DEFECTFINECODE IN ({DEFECTFINE}) OR '{DEFECTFINE}' = '999')
|
|
|
".Replace("{F}", fireType)
|
|
|
.Replace("{K}", kilnId)
|
|
|
- .Replace("{GOODSID}",goodsId)
|
|
|
- .Replace("{GOODSTYPECODE}",goodstypeCode)
|
|
|
- .Replace("{DEFECTDEDUCTION}", defectDeduction)
|
|
|
+ .Replace("{GOODSID}", goodsId)
|
|
|
+ .Replace("{GOODSTYPECODE}", goodstypeCode)
|
|
|
+ .Replace("{DEFECTDEDUCTION}", defectDeduction)
|
|
|
.Replace("{DEFECTFINE}", defectFine);
|
|
|
|
|
|
List<CDAParameter> sqlPara = new List<CDAParameter>();
|
|
|
@@ -416,12 +446,21 @@ public class rpt : IHttpHandler, IReadOnlySessionState
|
|
|
sqlPara.Add(new CDAParameter("DEFECTCODE", DEFECTCODE));
|
|
|
sqlPara.Add(new CDAParameter("DEFECTPOSITIONNAME", DEFECTPOSITIONNAME));
|
|
|
sqlPara.Add(new CDAParameter("KILNCODE", KILNCODE));
|
|
|
- JsonResult data = Easyui.ExecuteJsonResult(conn, sqlStr, sqlPara);
|
|
|
- context.Response.Write(data.ToJson());
|
|
|
+ try
|
|
|
+ {
|
|
|
+ JsonResult data = Easyui.ExecuteJsonResult(conn, sqlStr, sqlPara);
|
|
|
+ context.Response.Write(data.ToJson());
|
|
|
+ }
|
|
|
+ catch (Exception ex)
|
|
|
+ {
|
|
|
+
|
|
|
+ throw;
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
//子表2
|
|
|
- if(context.Request["m"].ToString()=="2")
|
|
|
+ if (context.Request["m"].ToString() == "2")
|
|
|
{
|
|
|
//读取报表数据
|
|
|
string sqlStr = @"
|
|
|
@@ -448,11 +487,13 @@ public class rpt : IHttpHandler, IReadOnlySessionState
|
|
|
}
|
|
|
public static bool IsNumber(string s)
|
|
|
{
|
|
|
- try {
|
|
|
+ try
|
|
|
+ {
|
|
|
int.Parse(s);
|
|
|
return true;
|
|
|
}
|
|
|
- catch (Exception) {
|
|
|
+ catch (Exception)
|
|
|
+ {
|
|
|
return false;
|
|
|
}
|
|
|
}
|