|
@ -331,7 +331,7 @@ namespace QMAPP.FJC.DAL.TianJin |
|
|
/// <param name="count">数量</param>
|
|
|
/// <param name="count">数量</param>
|
|
|
/// <param name="filter">过滤选项:0全部;1隐藏挂起;2只看挂起</param>
|
|
|
/// <param name="filter">过滤选项:0全部;1隐藏挂起;2只看挂起</param>
|
|
|
/// <returns></returns>
|
|
|
/// <returns></returns>
|
|
|
public List<WorkOrder> GetOrderUnPrinted(string routecode, string Direction, string SHIFTCODE, string BeginTime, string EndTime, int filter = 0, int count = 20) |
|
|
public List<WorkOrder> GetOrderUnPrintedF(string routecode, string Direction, string SHIFTCODE, string BeginTime, string EndTime, int filter = 0, int count = 20) |
|
|
{ |
|
|
{ |
|
|
try |
|
|
try |
|
|
{ |
|
|
{ |
|
@ -371,9 +371,13 @@ namespace QMAPP.FJC.DAL.TianJin |
|
|
sql.AppendFormat(" WHERE P.[ROUTE_CODE]=@routecode "); |
|
|
sql.AppendFormat(" WHERE P.[ROUTE_CODE]=@routecode "); |
|
|
sql.AppendFormat(" AND W.[PRINTED]='0' "); |
|
|
sql.AppendFormat(" AND W.[PRINTED]='0' "); |
|
|
|
|
|
|
|
|
|
|
|
//if (!string.IsNullOrEmpty(Direction))
|
|
|
|
|
|
//{
|
|
|
|
|
|
// sql.AppendFormat($" AND M.[MATERIAL_NAME] LIKE '%{Direction}%' ");
|
|
|
|
|
|
//}
|
|
|
if (!string.IsNullOrEmpty(Direction)) |
|
|
if (!string.IsNullOrEmpty(Direction)) |
|
|
{ |
|
|
{ |
|
|
sql.AppendFormat($" AND M.[MATERIAL_NAME] LIKE '%{Direction}%' "); |
|
|
sql.AppendFormat($" AND M.[MATERIAL_NAME] LIKE '%{Direction}前%' "); |
|
|
} |
|
|
} |
|
|
if (!string.IsNullOrEmpty(SHIFTCODE)) |
|
|
if (!string.IsNullOrEmpty(SHIFTCODE)) |
|
|
{ |
|
|
{ |
|
@ -401,7 +405,102 @@ namespace QMAPP.FJC.DAL.TianJin |
|
|
break; |
|
|
break; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
sql.AppendFormat(" ORDER BY W.[UPDATEDATE],W.[PRI],W.[PLAN_DATE],W.[ORDERPLAN_NO],P.PLAN_SEQ,W.[SEQ],W.[MATERIAL_CODE] "); |
|
|
sql.AppendFormat(" ORDER BY W.[PRI],W.[PLAN_DATE],W.[ORDERPLAN_NO],P.PLAN_SEQ,W.[SEQ],W.[MATERIAL_CODE] "); |
|
|
|
|
|
List<DataParameter> parameters = new List<DataParameter>(); |
|
|
|
|
|
parameters.Add(new DataParameter("routecode", routecode)); |
|
|
|
|
|
using (var session = AppDataFactory.CreateMainSession()) |
|
|
|
|
|
{ |
|
|
|
|
|
return session.GetList<WorkOrder>(sql.ToString(), parameters.ToArray()).ToList(); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
catch (Exception ex) |
|
|
|
|
|
{ |
|
|
|
|
|
throw ex; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 获取指定工序的生产计划清单
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="workcellcode">工序编码</param>
|
|
|
|
|
|
/// <param name="count">数量</param>
|
|
|
|
|
|
/// <param name="filter">过滤选项:0全部;1隐藏挂起;2只看挂起</param>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
public List<WorkOrder> GetOrderUnPrintedR(string routecode, string Direction, string SHIFTCODE, string BeginTime, string EndTime, int filter = 0, int count = 20) |
|
|
|
|
|
{ |
|
|
|
|
|
try |
|
|
|
|
|
{ |
|
|
|
|
|
StringBuilder sql = new StringBuilder(); |
|
|
|
|
|
sql.AppendFormat("SELECT TOP {0} W.[PID]\r\n", count); |
|
|
|
|
|
sql.AppendFormat(" ,W.[ORDERPLANID] "); |
|
|
|
|
|
sql.AppendFormat(" ,W.[ORDERPLAN_NO] "); |
|
|
|
|
|
sql.AppendFormat(" ,W.[ORDER_TYPE] "); |
|
|
|
|
|
sql.AppendFormat(" ,W.[SEQ] "); |
|
|
|
|
|
sql.AppendFormat(" ,W.[MATERIAL_CODE] "); |
|
|
|
|
|
sql.AppendFormat(" ,M.[MATERIAL_NAME] "); |
|
|
|
|
|
sql.AppendFormat(" ,W.[PBOM_CODE] "); |
|
|
|
|
|
sql.AppendFormat(" ,W.[QTY] "); |
|
|
|
|
|
sql.AppendFormat(" ,W.[COMPLETE_QTY] "); |
|
|
|
|
|
sql.AppendFormat(" ,W.[PLAN_DATE] "); |
|
|
|
|
|
sql.AppendFormat(" ,W.[SHIFT_CODE] "); |
|
|
|
|
|
sql.AppendFormat(" ,W.[WORKCENTER_CODE] "); |
|
|
|
|
|
sql.AppendFormat(" ,W.[WORKCENTER_NAME] "); |
|
|
|
|
|
sql.AppendFormat(" ,W.[WORKCELL_CODE] "); |
|
|
|
|
|
sql.AppendFormat(" ,W.[WORKCELL_NAME] "); |
|
|
|
|
|
sql.AppendFormat(" ,W.[WORKLOC_CODE] "); |
|
|
|
|
|
sql.AppendFormat(" ,W.[REMARK] "); |
|
|
|
|
|
sql.AppendFormat(" ,W.[EQPT_NAME] "); |
|
|
|
|
|
sql.AppendFormat(" ,W.[EQPT_CODE] "); |
|
|
|
|
|
sql.AppendFormat(" ,W.[STATE] "); |
|
|
|
|
|
sql.AppendFormat(" ,W.[MOULD_CODE] "); |
|
|
|
|
|
sql.AppendFormat(" ,W.[PRI] "); |
|
|
|
|
|
sql.AppendFormat(" ,W.[UPDATEDATE] "); |
|
|
|
|
|
sql.AppendFormat(" ,W.[PRINTED] "); |
|
|
|
|
|
sql.AppendFormat(" ,P.[IGNORE_FISBREAK] "); |
|
|
|
|
|
sql.AppendFormat(" ,P.[FIS_ASMSETCODE] "); |
|
|
|
|
|
sql.AppendFormat(" FROM [T_PP_WORKORDER] AS W WITH(NOLOCK) "); |
|
|
|
|
|
sql.AppendFormat(" LEFT JOIN [T_PP_ORDERPLAN] AS P WITH(NOLOCK) "); |
|
|
|
|
|
sql.AppendFormat(" ON P.[PID]=W.[ORDERPLANID] "); |
|
|
|
|
|
sql.AppendFormat(" LEFT JOIN [T_MD_MATERIAL] AS M WITH(NOLOCK) "); |
|
|
|
|
|
sql.AppendFormat(" ON W.[MATERIAL_CODE]=M.[MATERIAL_CODE] "); |
|
|
|
|
|
sql.AppendFormat(" WHERE P.[ROUTE_CODE]=@routecode "); |
|
|
|
|
|
sql.AppendFormat(" AND W.[PRINTED]='0' "); |
|
|
|
|
|
|
|
|
|
|
|
//if (!string.IsNullOrEmpty(Direction))
|
|
|
|
|
|
//{
|
|
|
|
|
|
// sql.AppendFormat($" AND M.[MATERIAL_NAME] LIKE '%{Direction}%' ");
|
|
|
|
|
|
//}
|
|
|
|
|
|
if (!string.IsNullOrEmpty(Direction)) |
|
|
|
|
|
{ |
|
|
|
|
|
sql.AppendFormat($" AND M.[MATERIAL_NAME] LIKE '%{Direction}后%' "); |
|
|
|
|
|
} |
|
|
|
|
|
if (!string.IsNullOrEmpty(SHIFTCODE)) |
|
|
|
|
|
{ |
|
|
|
|
|
sql.AppendFormat($" AND W.[SHIFT_CODE] = '{SHIFTCODE}' "); |
|
|
|
|
|
} |
|
|
|
|
|
if (BeginTime != DateTime.MinValue.ToString()) |
|
|
|
|
|
{ |
|
|
|
|
|
sql.AppendFormat($" AND W.[PLAN_DATE] >= '{Convert.ToDateTime(BeginTime).ToString("yyyy-MM-dd")} 00:00:00' "); |
|
|
|
|
|
} |
|
|
|
|
|
if (EndTime != DateTime.MinValue.ToString()) |
|
|
|
|
|
{ |
|
|
|
|
|
sql.AppendFormat($" AND W.[PLAN_DATE] <= '{Convert.ToDateTime(EndTime).ToString("yyyy-MM-dd")} 23:59:59' "); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
switch (filter) |
|
|
|
|
|
{ |
|
|
|
|
|
case 1: |
|
|
|
|
|
{ |
|
|
|
|
|
sql.AppendFormat(" AND W.[STATE]<>4 "); |
|
|
|
|
|
break; |
|
|
|
|
|
} |
|
|
|
|
|
case 2: |
|
|
|
|
|
{ |
|
|
|
|
|
sql.AppendFormat(" AND W.[STATE]=4 "); |
|
|
|
|
|
break; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
sql.AppendFormat(" ORDER BY W.[PRI],W.[PLAN_DATE],W.[ORDERPLAN_NO],P.PLAN_SEQ,W.[SEQ],W.[MATERIAL_CODE] "); |
|
|
List<DataParameter> parameters = new List<DataParameter>(); |
|
|
List<DataParameter> parameters = new List<DataParameter>(); |
|
|
parameters.Add(new DataParameter("routecode", routecode)); |
|
|
parameters.Add(new DataParameter("routecode", routecode)); |
|
|
using (var session = AppDataFactory.CreateMainSession()) |
|
|
using (var session = AppDataFactory.CreateMainSession()) |
|
@ -415,6 +514,7 @@ namespace QMAPP.FJC.DAL.TianJin |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
/// <summary>
|
|
|
/// 获取指定工序的生产计划清单---018D前门
|
|
|
/// 获取指定工序的生产计划清单---018D前门
|
|
|
/// </summary>
|
|
|
/// </summary>
|
|
|