|
@ -663,6 +663,75 @@ namespace QMAPP.FJC.BLL.FIS |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 发布信息--直接发布到帽檐
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name=""></param>
|
|
|
|
|
|
/// <returns>发布个数</returns>
|
|
|
|
|
|
public DataResult<int> PublishEndWorkloc(string strs) |
|
|
|
|
|
{ |
|
|
|
|
|
string[] list = strs.Split(":".ToCharArray()); |
|
|
|
|
|
DataResult<int> result = new DataResult<int>(); |
|
|
|
|
|
try |
|
|
|
|
|
{ |
|
|
|
|
|
OrderPlanDAL orderPlandal = new OrderPlanDAL(); |
|
|
|
|
|
|
|
|
|
|
|
List<OrderPlan> validorderPlanList = new List<OrderPlan>(); |
|
|
|
|
|
List<OrderPlan> putOutPlanList = new List<OrderPlan>(); |
|
|
|
|
|
|
|
|
|
|
|
foreach (string str in list) |
|
|
|
|
|
{ |
|
|
|
|
|
OrderPlan op = orderPlandal.Get(new OrderPlan { PID = str }); |
|
|
|
|
|
|
|
|
|
|
|
if (op.PLAN_STATE != EnumGeter.PLANSTATE.INIT.GetHashCode().ToString()) |
|
|
|
|
|
{ |
|
|
|
|
|
validorderPlanList.Add(op); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
putOutPlanList.Add(op); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (validorderPlanList.Count > 0) |
|
|
|
|
|
{ |
|
|
|
|
|
result.IsSuccess = false; |
|
|
|
|
|
result.Msg = "只有初始状态下的订单能够进行发布!"; |
|
|
|
|
|
|
|
|
|
|
|
return result; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
DataTable totalDt = GetWorkOrderTable(); |
|
|
|
|
|
foreach (var op in putOutPlanList) |
|
|
|
|
|
{ |
|
|
|
|
|
op.PLAN_STATE = EnumGeter.PLANSTATE.COMMIT.GetHashCode().ToString(); |
|
|
|
|
|
op.UPDATEUSER = this.LoginUser.UserID; |
|
|
|
|
|
totalDt = this.PutOutOrderPlanEndWorkP1(op, totalDt); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
using (IDataSession session = AppDataFactory.CreateMainSession()) |
|
|
|
|
|
{ |
|
|
|
|
|
IDbConnection dbConn = DbManager.MainConnectionInfo.Connection; |
|
|
|
|
|
IDbTransaction ids = dbConn.BeginTransaction(); |
|
|
|
|
|
|
|
|
|
|
|
orderPlandal.BaseSession = session; |
|
|
|
|
|
foreach (var op in putOutPlanList) |
|
|
|
|
|
{ |
|
|
|
|
|
orderPlandal.Update(op); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
session.DbHelper.BulkCopyData(totalDt, "T_PP_WORKORDER", dbConn, ids); |
|
|
|
|
|
ids.Commit(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
result.IsSuccess = true; |
|
|
|
|
|
return result; |
|
|
|
|
|
} |
|
|
|
|
|
catch (Exception ex) |
|
|
|
|
|
{ |
|
|
|
|
|
throw ex; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
/// <summary>
|
|
|
/// 发布信息--直接发布到最后一个工位
|
|
|
/// 发布信息--直接发布到最后一个工位
|
|
|
/// </summary>
|
|
|
/// </summary>
|
|
@ -695,7 +764,7 @@ namespace QMAPP.FJC.BLL.FIS |
|
|
workOrder["COMPLETE_QTY"] = 0; |
|
|
workOrder["COMPLETE_QTY"] = 0; |
|
|
workOrder["PLAN_DATE"] = info.PLAN_DATE; |
|
|
workOrder["PLAN_DATE"] = info.PLAN_DATE; |
|
|
workOrder["SHIFT_CODE"] = info.SHIFT_CODE; |
|
|
workOrder["SHIFT_CODE"] = info.SHIFT_CODE; |
|
|
workOrder["WORKCENTER_CODE"] = info.WORKCENTER_CODE; |
|
|
workOrder["WORKCENTER_CODE"] = "BC316_ASSLINE"; |
|
|
workOrder["WORKCELL_CODE"] = seq.WORKCELL_CODE; |
|
|
workOrder["WORKCELL_CODE"] = seq.WORKCELL_CODE; |
|
|
workOrder["WORKLOC_CODE"] = ""; |
|
|
workOrder["WORKLOC_CODE"] = ""; |
|
|
workOrder["REMARK"] = ""; |
|
|
workOrder["REMARK"] = ""; |
|
@ -712,6 +781,52 @@ namespace QMAPP.FJC.BLL.FIS |
|
|
return workOrderDt; |
|
|
return workOrderDt; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 发布信息--直接发布到帽檐工位
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="">信息</param>
|
|
|
|
|
|
/// <returns>发布个数</returns>
|
|
|
|
|
|
public DataTable PutOutOrderPlanEndWorkP1(OrderPlan info, DataTable workOrderDt) |
|
|
|
|
|
{ |
|
|
|
|
|
|
|
|
|
|
|
WorkCellDAL workCelldal = new WorkCellDAL(); |
|
|
|
|
|
string pbomcode = info.PBOM_CODE; |
|
|
|
|
|
//List<QMAPP.MD.Entity.ProcessRouteWorkCellSeq> list = workCelldal.GetEndWorkCell(pbomcode);
|
|
|
|
|
|
|
|
|
|
|
|
//var dicPRI = new DictManageBLL(Dict.DictKind.ORDERPRI);
|
|
|
|
|
|
|
|
|
|
|
|
//注入派工单信息
|
|
|
|
|
|
for (int i = 0; i < info.QTY; i++) |
|
|
|
|
|
{ |
|
|
|
|
|
DataRow workOrder = workOrderDt.NewRow(); |
|
|
|
|
|
|
|
|
|
|
|
workOrder["PID"] = Guid.NewGuid().ToString(); |
|
|
|
|
|
workOrder["ORDERPLANID"] = info.PID; |
|
|
|
|
|
workOrder["ORDERPLAN_NO"] = (info.PLAN_NO.ToString() + (i + 1).ToString().PadLeft(4, '0')); |
|
|
|
|
|
workOrder["ORDER_TYPE"] = info.PLANSOURCE; |
|
|
|
|
|
workOrder["SEQ"] = (i + 1).ToString().PadLeft(6, '0'); |
|
|
|
|
|
workOrder["MATERIAL_CODE"] = info.MATERIAL_CODE; |
|
|
|
|
|
workOrder["PBOM_CODE"] = info.PBOM_CODE; |
|
|
|
|
|
workOrder["QTY"] = 1; |
|
|
|
|
|
workOrder["COMPLETE_QTY"] = 0; |
|
|
|
|
|
workOrder["PLAN_DATE"] = info.PLAN_DATE; |
|
|
|
|
|
workOrder["SHIFT_CODE"] = info.SHIFT_CODE; |
|
|
|
|
|
workOrder["WORKCENTER_CODE"] = "BC316_ASSLINE"; |
|
|
|
|
|
workOrder["WORKCELL_CODE"] = "BRIM_WELDING_BC316"; |
|
|
|
|
|
workOrder["WORKLOC_CODE"] = ""; |
|
|
|
|
|
workOrder["REMARK"] = ""; |
|
|
|
|
|
workOrder["EQPT_NAME"] = ""; |
|
|
|
|
|
workOrder["EQPT_CODE"] = ""; |
|
|
|
|
|
workOrder["STATE"] = EnumGeter.WORKPLANSTATE.INIT.GetHashCode().ToString(); |
|
|
|
|
|
workOrder["PRI"] = "2"; |
|
|
|
|
|
|
|
|
|
|
|
workOrderDt.Rows.Add(workOrder); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return workOrderDt; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
public List<WorkOrder> PutOutOrderPlan(OrderPlan info,int number,int lastIndex) |
|
|
public List<WorkOrder> PutOutOrderPlan(OrderPlan info,int number,int lastIndex) |
|
|
{ |
|
|
{ |
|
|
List<WorkOrder> wolist = new List<WorkOrder>(); |
|
|
List<WorkOrder> wolist = new List<WorkOrder>(); |
|
|