|
|
@@ -180,6 +180,7 @@ public class glineplanstop : IHttpHandler, IReadOnlySessionState
|
|
|
DateTime stop_begindate = Convert.ToDateTime(form["STOP_BEGINDATE"]);
|
|
|
DateTime STOP_ENDDATE = Convert.ToDateTime(form["STOP_ENDDATE"]);
|
|
|
string STOP_REASON = form["STOP_REASON"];
|
|
|
+ string STOP_REASON_ID = form["STOP_REASON_ID"];
|
|
|
string REMARKS = form["REMARKS"];
|
|
|
|
|
|
//停工计划总单
|
|
|
@@ -187,6 +188,7 @@ public class glineplanstop : IHttpHandler, IReadOnlySessionState
|
|
|
SET stop_begindate = @stop_begindate@
|
|
|
,stop_enddate = @stop_enddate@
|
|
|
,stop_reason = @stop_reason@
|
|
|
+ ,STOP_REASON_ID = @STOP_REASON_ID@
|
|
|
,groutinglineid = @groutinglineid@
|
|
|
,remarks = @remarks@
|
|
|
,updatetime = SYSDATE
|
|
|
@@ -198,6 +200,7 @@ public class glineplanstop : IHttpHandler, IReadOnlySessionState
|
|
|
sqlPara.Add(new CDAParameter("stop_begindate", stop_begindate, DataType.DateTime));
|
|
|
sqlPara.Add(new CDAParameter("stop_enddate", STOP_ENDDATE, DataType.DateTime));
|
|
|
sqlPara.Add(new CDAParameter("stop_reason", STOP_REASON));
|
|
|
+ sqlPara.Add(new CDAParameter("STOP_REASON_ID", STOP_REASON_ID));
|
|
|
sqlPara.Add(new CDAParameter("remarks", REMARKS));
|
|
|
sqlPara.Add(new CDAParameter("updateuserid", HttpContext.Current.Session["userId"]));
|
|
|
try
|
|
|
@@ -318,6 +321,7 @@ public class glineplanstop : IHttpHandler, IReadOnlySessionState
|
|
|
,stop_begindate
|
|
|
,stop_enddate
|
|
|
,stop_reason
|
|
|
+ ,STOP_REASON_ID
|
|
|
,groutinglineid as Lineid
|
|
|
,remarks
|
|
|
FROM t_gline_plan_stop gs
|
|
|
@@ -358,6 +362,7 @@ public class glineplanstop : IHttpHandler, IReadOnlySessionState
|
|
|
DateTime stop_begindate = Convert.ToDateTime(form["STOP_BEGINDATE"]);
|
|
|
DateTime STOP_ENDDATE = Convert.ToDateTime(form["STOP_ENDDATE"]);
|
|
|
string STOP_REASON = form["STOP_REASON"];
|
|
|
+ string STOP_REASON_ID = form["STOP_REASON_ID"];
|
|
|
string REMARKS = form["REMARKS"];
|
|
|
|
|
|
//停工计划总单
|
|
|
@@ -367,6 +372,7 @@ public class glineplanstop : IHttpHandler, IReadOnlySessionState
|
|
|
,stop_enddate
|
|
|
,stop_reason
|
|
|
,groutinglineid
|
|
|
+ ,STOP_REASON_ID
|
|
|
,remarks
|
|
|
,accountid
|
|
|
,createuserid
|
|
|
@@ -377,6 +383,7 @@ public class glineplanstop : IHttpHandler, IReadOnlySessionState
|
|
|
,@stop_enddate@
|
|
|
,@stop_reason@
|
|
|
,@groutinglineid@
|
|
|
+ ,@STOP_REASON_ID@
|
|
|
,@remarks@
|
|
|
,@accountid@
|
|
|
,@createuserid@
|
|
|
@@ -385,6 +392,7 @@ public class glineplanstop : IHttpHandler, IReadOnlySessionState
|
|
|
sqlPara.Add(new CDAParameter("stopID", stopID));
|
|
|
sqlPara.Add(new CDAParameter("accountid", HttpContext.Current.Session["accountId"]));
|
|
|
sqlPara.Add(new CDAParameter("groutinglineid", GROUTINGLINEID));
|
|
|
+ sqlPara.Add(new CDAParameter("STOP_REASON_ID", STOP_REASON_ID));
|
|
|
sqlPara.Add(new CDAParameter("stop_begindate", stop_begindate, DataType.DateTime));
|
|
|
sqlPara.Add(new CDAParameter("stop_enddate", STOP_ENDDATE, DataType.DateTime));
|
|
|
sqlPara.Add(new CDAParameter("stop_reason", STOP_REASON));
|
|
|
@@ -574,29 +582,87 @@ public class glineplanstop : IHttpHandler, IReadOnlySessionState
|
|
|
{
|
|
|
Lineid = form["Lineid"];
|
|
|
}
|
|
|
+ string STOP_CODE = form["STOP_CODE"];//计划单号
|
|
|
+ string workshop = form["workshopMaster[]"];//车间
|
|
|
+ if (string.IsNullOrEmpty(workshop))
|
|
|
+ {
|
|
|
+ workshop = form["workshopMaster"];
|
|
|
+ }
|
|
|
+ string STOP_REASON_ID = form["STOP_REASON_ID[]"];//停工原因
|
|
|
+ if (string.IsNullOrEmpty(STOP_REASON_ID))
|
|
|
+ {
|
|
|
+ STOP_REASON_ID = form["STOP_REASON_ID"];
|
|
|
+ }
|
|
|
+ string CREATEUSER = form["CREATEUSER"];//创建者
|
|
|
+ string datebeginMasterS = form["datebeginMasterS"];//停工开始日期起始时间
|
|
|
+ string datebeginMasterD = form["datebeginMasterD"];//停工开始日期截止时间
|
|
|
+ string dateendMasterS = form["dateendMasterS"];//停工结束日期起始时间
|
|
|
+ string dateendMasterD = form["dateendMasterD"];//停工结束日期截止时间
|
|
|
string sqlStr = @"select
|
|
|
gs.stopid as sid
|
|
|
+ ,gs.STOP_CODE
|
|
|
,to_char(gs.stop_begindate,'YYYY-MM-DD') stop_begindate
|
|
|
,to_char(gs.stop_enddate,'YYYY-MM-DD') stop_enddate
|
|
|
,gs.stop_reason
|
|
|
,gs.Remarks
|
|
|
,gs.createtime
|
|
|
,gl.groutinglinename
|
|
|
+ ,case when gs.groutinglineid is not null then gl.workshop || '车间' else null end as workshop
|
|
|
,mu.username as CREATEUSER
|
|
|
+ ,md.dictionaryvalue
|
|
|
from t_gline_plan_stop gs
|
|
|
left join TP_PC_GroutingLine gl
|
|
|
on gs.groutinglineid = gl.groutinglineid
|
|
|
left join tp_mst_user mu
|
|
|
on gs.createuserid = mu.userid
|
|
|
+ left join tp_mst_datadictionary md
|
|
|
+ on gs.stop_reason_id = md.dictionaryid
|
|
|
where gs.ACCOUNTID =@ACCOUNTID@";
|
|
|
+ List<CDAParameter> sqlPara = new List<CDAParameter>();
|
|
|
+ sqlPara.Add(new CDAParameter("ACCOUNTID", HttpContext.Current.Session["accountId"]));
|
|
|
if (!string.IsNullOrEmpty(Lineid))
|
|
|
{
|
|
|
sqlStr += " and gs.groutinglineid in(" + Lineid + ") ";
|
|
|
|
|
|
}
|
|
|
+ if (!string.IsNullOrEmpty(STOP_CODE))
|
|
|
+ {
|
|
|
+ sqlStr += " and gs.STOP_CODE like '%" + STOP_CODE + "%'";
|
|
|
+ }
|
|
|
+ if (!string.IsNullOrEmpty(workshop))
|
|
|
+ {
|
|
|
+ sqlStr += " and gl.workshop in (" + workshop + ")";
|
|
|
+ }
|
|
|
+ if (!string.IsNullOrEmpty(STOP_REASON_ID))
|
|
|
+ {
|
|
|
+ sqlStr += " and gs.STOP_REASON_ID in (" + STOP_REASON_ID + ") ";
|
|
|
+ }
|
|
|
+ if (!string.IsNullOrEmpty(CREATEUSER))
|
|
|
+ {
|
|
|
+ sqlStr += " and mu.username like '%" + CREATEUSER + "%'";
|
|
|
+ }
|
|
|
+ if (!string.IsNullOrEmpty(datebeginMasterS))
|
|
|
+ {
|
|
|
+ sqlStr += " and gs.stop_begindate >= @datebeginMasterS@";
|
|
|
+ sqlPara.Add(new CDAParameter("datebeginMasterS", Convert.ToDateTime(datebeginMasterS)));
|
|
|
+ }
|
|
|
+ if (!string.IsNullOrEmpty(datebeginMasterD))
|
|
|
+ {
|
|
|
+ sqlStr += " and gs.stop_begindate < @datebeginMasterD@";
|
|
|
+ sqlPara.Add(new CDAParameter("datebeginMasterD", Convert.ToDateTime(datebeginMasterD).AddDays(1)));
|
|
|
+ }
|
|
|
+ if (!string.IsNullOrEmpty(dateendMasterS))
|
|
|
+ {
|
|
|
+ sqlStr += " and gs.stop_enddate >= @dateendMasterS@";
|
|
|
+ sqlPara.Add(new CDAParameter("dateendMasterS", Convert.ToDateTime(dateendMasterS)));
|
|
|
+ }
|
|
|
+ if (!string.IsNullOrEmpty(dateendMasterD))
|
|
|
+ {
|
|
|
+ sqlStr += " and gs.stop_enddate < @dateendMasterD@";
|
|
|
+ sqlPara.Add(new CDAParameter("dateendMasterD", Convert.ToDateTime(dateendMasterD).AddDays(1)));
|
|
|
+ }
|
|
|
sqlStr += " order by gs.createtime desc";
|
|
|
- List<CDAParameter> sqlPara = new List<CDAParameter>();
|
|
|
- sqlPara.Add(new CDAParameter("ACCOUNTID", HttpContext.Current.Session["accountId"]));
|
|
|
+
|
|
|
|
|
|
|
|
|
int total = 0;
|