|
|
@@ -133,23 +133,30 @@ public class rpt : IHttpHandler, IReadOnlySessionState
|
|
|
|
|
|
string datebeginMasterS = context.Request["datebeginMasterS"];
|
|
|
string datebeginMasterD = context.Request["datebeginMasterD"];
|
|
|
+ string datebeginMasterG = context.Request["datebeginMasterG"];
|
|
|
+ string dateendMasterG = context.Request["dateendMasterG"];
|
|
|
string goodstypecode = context.Request["goodstypecode"];
|
|
|
List<CDAParameter> sqlPara = new List<CDAParameter>();
|
|
|
|
|
|
- string sqlStr = @"SELECT t.fhtime AS 交接时间
|
|
|
+ string sqlStr = @"SELECT to_char(gdd.groutingdate,'yyyy-mm-dd') as 注浆日期
|
|
|
+ ,t.fhtime AS 交接时间
|
|
|
,gt.goodstypename AS 产品类型
|
|
|
- ,g.goodscode AS 产品型号
|
|
|
+ ,g.goodscode AS 产品编码
|
|
|
,g.goodsname AS 产品名称
|
|
|
- ,t.barcode AS 产品条码
|
|
|
- ,k.workshop || '车间' as 车间
|
|
|
- FROM tp_pm_finishedproduct t
|
|
|
+ ,gdd.barcode AS 产品条码
|
|
|
+ ,gl.workshop || '车间' as 车间
|
|
|
+ FROM tp_pm_groutingdailydetail gdd
|
|
|
+ left join tp_pm_finishedproduct t on t.groutingdailydetailid = gdd.groutingdailydetailid
|
|
|
+ inner join tp_pc_groutingline gl ON gl.groutinglineid = gdd.groutinglineid
|
|
|
INNER JOIN tp_mst_goods g
|
|
|
- ON g.goodsid = t.goodsid
|
|
|
- INNER JOIN tp_mst_kiln k
|
|
|
+ ON g.goodsid = gdd.goodsid
|
|
|
+ left JOIN tp_mst_kiln k
|
|
|
ON k.kilnid = t.kilnid
|
|
|
INNER JOIN tp_mst_goodstype gt
|
|
|
ON gt.goodstypeid = g.goodstypeid
|
|
|
- where 1=1
|
|
|
+ where gdd.valueflag = '1'
|
|
|
+ AND gdd.groutingflag = '1'
|
|
|
+ AND gdd.barcode IS NOT NULL
|
|
|
AND (INSTR(GT.GOODSTYPECODE,'{GOODSTYPECODE}') = 1 OR '{GOODSTYPECODE}' IS NULL) ".Replace("{GOODSTYPECODE}", goodstypecode);
|
|
|
if (!string.IsNullOrEmpty(datebeginMasterS))
|
|
|
{
|
|
|
@@ -159,13 +166,23 @@ public class rpt : IHttpHandler, IReadOnlySessionState
|
|
|
if (!string.IsNullOrEmpty(datebeginMasterD))
|
|
|
{
|
|
|
sqlStr += " and t.fhtime <@datebeginMasterD@ ";
|
|
|
- sqlPara.Add(new CDAParameter("datebeginMasterD", Convert.ToDateTime(datebeginMasterD).AddDays(1), DataType.Date));
|
|
|
+ sqlPara.Add(new CDAParameter("datebeginMasterD", Convert.ToDateTime(datebeginMasterD).AddSeconds(1), DataType.Date));
|
|
|
+ }
|
|
|
+ if (!string.IsNullOrEmpty(datebeginMasterG))
|
|
|
+ {
|
|
|
+ sqlStr += " and gdd.groutingdate >=@datebeginMasterG@ ";
|
|
|
+ sqlPara.Add(new CDAParameter("datebeginMasterG", datebeginMasterG, DataType.Date));
|
|
|
+ }
|
|
|
+ if (!string.IsNullOrEmpty(dateendMasterG))
|
|
|
+ {
|
|
|
+ sqlStr += " and gdd.groutingdate <@dateendMasterG@ ";
|
|
|
+ sqlPara.Add(new CDAParameter("dateendMasterG", Convert.ToDateTime(dateendMasterG).AddDays(1), DataType.Date));
|
|
|
}
|
|
|
if (!string.IsNullOrEmpty(workshop))
|
|
|
{
|
|
|
- sqlStr += " AND k.workshop in (" + workshop + ")";
|
|
|
+ sqlStr += " AND gl.workshop in (" + workshop + ")";
|
|
|
}
|
|
|
- sqlStr += " order by fhtime desc, barcode ";
|
|
|
+ sqlStr += " order by gdd.groutingdate desc, t.fhtime desc, gdd.barcode ";
|
|
|
try
|
|
|
{
|
|
|
JsonResult data = Easyui.ExecuteJsonResult(conn, sqlStr, sqlPara);
|