|
|
@ -751,6 +751,57 @@ namespace QMAPP.FJC.DAL.ProductionPlan |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// 获取指定工位第一条的派工单
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="workloccode"></param>
|
|
|
|
/// <returns></returns>
|
|
|
|
public WorkOrder GetFirstOrderInLoc(string workcellcode, string mouldcode) |
|
|
|
{ |
|
|
|
try |
|
|
|
{ |
|
|
|
List<DataParameter> parameters = new List<DataParameter>(); |
|
|
|
StringBuilder sql = new StringBuilder(); |
|
|
|
sql.AppendLine("SELECT TOP 1 W.* "); |
|
|
|
sql.AppendLine(" ,P.[IGNORE_FISBREAK] "); |
|
|
|
sql.AppendFormat(" FROM [T_PP_WORKORDER] AS W "); |
|
|
|
sql.AppendFormat(" LEFT JOIN [T_PP_ORDERPLAN] AS P "); |
|
|
|
sql.AppendFormat(" ON P.[PID]=W.[ORDERPLANID] "); |
|
|
|
sql.AppendFormat(" LEFT JOIN [T_MD_MATERIAL] AS M "); |
|
|
|
sql.AppendFormat(" ON W.[MATERIAL_CODE]=M.[MATERIAL_CODE] "); |
|
|
|
sql.AppendFormat(" WHERE W.[WORKCELL_CODE]=@workcellcode "); |
|
|
|
//if (mouldcode == "HWL_FRONT") // 左前门
|
|
|
|
//{
|
|
|
|
// sql.AppendLine(" and left(W.PBOM_CODE,10) = 'VW331DP_LF'");
|
|
|
|
//}
|
|
|
|
//else if (mouldcode == "HWL_REAR") //左后门
|
|
|
|
//{
|
|
|
|
// sql.AppendLine(" and left(W.PBOM_CODE,10) = 'VW331DP_LR' ");
|
|
|
|
//}
|
|
|
|
//else if (mouldcode == "HWL_FRONT") //右前门
|
|
|
|
//{
|
|
|
|
// sql.AppendLine(" and left(W.PBOM_CODE,10) = 'VW331DP_RF' ");
|
|
|
|
//}
|
|
|
|
//else if (mouldcode == "HWR_REAR") //右后门
|
|
|
|
//{
|
|
|
|
// sql.AppendLine(" and left(W.PBOM_CODE,10) = 'VW331DP_RR' ");
|
|
|
|
//}
|
|
|
|
//sql.AppendLine(" AND W.[MOULD_CODE]=@mouldcode ");
|
|
|
|
sql.AppendLine(" AND W.[STATE]<>'4' "); |
|
|
|
sql.AppendFormat(" ORDER BY W.[PRI],W.[PLAN_DATE],P.PLAN_SEQ,W.[SEQ],W.[MATERIAL_CODE] "); |
|
|
|
parameters.Add(new DataParameter("workcellcode", workcellcode)); |
|
|
|
parameters.Add(new DataParameter("mouldcode", mouldcode)); |
|
|
|
using (var session = AppDataFactory.CreateMainSession()) |
|
|
|
{ |
|
|
|
return session.Get<WorkOrder>(sql.ToString(), parameters.ToArray()); |
|
|
|
} |
|
|
|
} |
|
|
|
catch (Exception ex) |
|
|
|
{ |
|
|
|
throw ex; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// 获取工序下匹配的派工单
|
|
|
|
/// </summary>
|
|
|
|