/// <summary> /// 任务完成:更新货位状态;更新库存(出库库操作不同);更新计划状态及当前完成数量;管理任务删除(保留15天数据);出入库记录更新; /// </summary> /// <param name="manageTask"></param> /// <returns></returns> public override bool ChangeStatus(View_ManageModel manageTask) { try { string restr = ""; if (manageTask == null) { return(false); } if (manageTask.Manage_Type_Name == EnumManageTaskType.空托盘上架.ToString()) //空托盘没有库存,无计划 { TaskHandleMethod.UpdateCellStatus(manageTask.Mange_End_Cell_ID, EnumCellStatus.空料框, EnumGSTaskStatus.完成, EnumGSOperate.入库); TaskHandleMethod.AddCellOperRecord(manageTask.Mange_End_Cell_ID, EnumGSOperateType.系统添加空料框, "空托盘上架任务完成,更新货位状态", ref restr); TaskHandleMethod.AddStockRecord(manageTask.Mange_ID); } else if (manageTask.Manage_Type_Name == EnumManageTaskType.架.ToString()) { TaskHandleMethod.UpdateCellStatus(manageTask.Mange_End_Cell_ID, EnumCellStatus.满位, EnumGSTaskStatus.完成, EnumGSOperate.入库); TaskHandleMethod.AddCellOperRecord(manageTask.Mange_End_Cell_ID, EnumGSOperateType.系统更新货位操作, "物料上架任务完成,更新货位状态", ref restr); TaskHandleMethod.UpdatePlanCompleteNum(manageTask.Mange_ID); TaskHandleMethod.UpdateStockUpdateTime(manageTask.Mange_Stock_Barcode, DateTime.Now); TaskHandleMethod.UpdateStockPos(manageTask.Mange_Stock_Barcode, manageTask.Mange_End_Cell_ID, ref restr); TaskHandleMethod.AddStockRecord(manageTask.Mange_ID); } else if (manageTask.Manage_Type_Name == EnumManageTaskType.空托盘下架.ToString()) { TaskHandleMethod.UpdateCellStatus(manageTask.Mange_Start_Cell_ID, EnumCellStatus.空闲, EnumGSTaskStatus.完成, EnumGSOperate.出库); TaskHandleMethod.AddCellOperRecord(manageTask.Mange_Start_Cell_ID, EnumGSOperateType.系统更新货位操作, "空托盘下架任务完成,更新货位状态", ref restr); } else if (manageTask.Manage_Type_Name == EnumManageTaskType.架.ToString()) //下架完成后,删除库存 { TaskHandleMethod.UpdateCellStatus(manageTask.Mange_Start_Cell_ID, EnumCellStatus.空闲, EnumGSTaskStatus.完成, EnumGSOperate.出库); TaskHandleMethod.AddCellOperRecord(manageTask.Mange_Start_Cell_ID, EnumGSOperateType.系统更新货位操作, "货物下架任务完成,更新货位状态", ref restr); TaskHandleMethod.UpdatePlanCompleteNum(manageTask.Mange_ID); TaskHandleMethod.AddStockRecord(manageTask.Mange_ID);//删除stock前 TaskHandleMethod.DeleteStock(manageTask.Mange_Stock_Barcode); } else if (manageTask.Manage_Type_Name == EnumManageTaskType.盘点下架.ToString()) { TaskHandleMethod.UpdateCellStatus(manageTask.Mange_Start_Cell_ID, EnumCellStatus.空闲, EnumGSTaskStatus.完成, EnumGSOperate.出库); TaskHandleMethod.AddCellOperRecord(manageTask.Mange_Start_Cell_ID, EnumGSOperateType.系统更新货位操作, "货物下架任务完成,更新货位状态", ref restr); //TaskHandleMethod.UpdatePlanCompleteNum(manageTask.Mange_ID); TaskHandleMethod.AddStockRecord(manageTask.Mange_ID); TaskHandleMethod.DeleteStock(manageTask.Mange_ID); } else if (manageTask.Manage_Type_Name == EnumManageTaskType.拣选下架.ToString()) { } else if (manageTask.Manage_Type_Name == EnumManageTaskType.移库.ToString()) { TaskHandleMethod.UpdateCellStatus(manageTask.Mange_Start_Cell_ID, EnumCellStatus.空闲, EnumGSTaskStatus.完成, EnumGSOperate.出库); TaskHandleMethod.UpdateCellStatus(manageTask.Mange_End_Cell_ID, EnumCellStatus.满位, EnumGSTaskStatus.完成, EnumGSOperate.入库); TaskHandleMethod.UpdateStockCell(manageTask.Mange_Stock_Barcode, manageTask.Mange_End_Cell_ID, ref restr); TaskHandleMethod.AddCellOperRecord(manageTask.Mange_Start_Cell_ID, EnumGSOperateType.系统更新货位操作, "货物移库任务完成,更新货位状态", ref restr); TaskHandleMethod.AddStockRecord(manageTask.Mange_ID); } else { return(false); } TaskHandleMethod.CheckPlanCompleteStatus(manageTask.Plan_ID, ref restr);//检查计划是否完成,如果完成自动更新计划通过计划数量和完成数量相等判断 TaskHandleMethod.UpdateManageCompleteTime(manageTask.Mange_ID, DateTime.Now); TaskHandleMethod.UpdateManageHandleStatus(manageTask.Mange_ID, EnumBreakDowmStatus.已处理); StatusManager.wmsFrame.WriteLog("服务管理", "", "提示", restr); return(true); } catch (Exception ex) { StatusManager.wmsFrame.WriteLog("服务管理", "", "错误", "任务完成处理失败!" + ex.Message); return(false); } }
/// <summary> /// 任务完成:更新货位状态;更新库存(出库库操作不同);更新计划状态及当前完成数量;管理任务删除(保留15天数据);出入库记录更新; /// </summary> /// <param name="manageTask"></param> /// <returns></returns> public override bool ChangeStatus(View_ManageModel manageTask) { try { string restr = ""; if (manageTask == null) { return(false); } View_CellModel viewCell = null; if (manageTask.Manage_Type_Name == EnumManageTaskType.空托盘上架.ToString()) //空托盘没有库存,无计划 { TaskHandleMethod.UpdateCellStatus(manageTask.Mange_End_Cell_ID, EnumCellStatus.空料框, EnumGSTaskStatus.完成, EnumGSOperate.入库); TaskHandleMethod.AddCellOperRecord(manageTask.Mange_End_Cell_ID, EnumGSOperateType.系统添加空料框, "空托盘上架任务完成,更新货位状态", ref restr); TaskHandleMethod.AddStockRecord(manageTask.Mange_ID); viewCell = bllView.GetModelByChildCellID(manageTask.Mange_End_Cell_ID); if (viewCell != null) { restr = "空托盘上架任务完成,更新货位[" + viewCell.WareHouse_Name + "," + viewCell.Cell_Name + "," + viewCell.Cell_Chlid_Position + "]状态,空料框、完成。"; } } else if (manageTask.Manage_Type_Name == EnumManageTaskType.架.ToString()) { TaskHandleMethod.UpdateCellStatus(manageTask.Mange_End_Cell_ID, EnumCellStatus.满位, EnumGSTaskStatus.完成, EnumGSOperate.入库); TaskHandleMethod.AddCellOperRecord(manageTask.Mange_End_Cell_ID, EnumGSOperateType.系统更新货位操作, "物料上架任务完成,更新货位状态", ref restr); TaskHandleMethod.UpdatePlanCompleteNum(manageTask.Mange_ID); TaskHandleMethod.UpdateStockUpdateTime(manageTask.Mange_Stock_Barcode, DateTime.Now); TaskHandleMethod.UpdateStockPos(manageTask.Mange_Stock_Barcode, manageTask.Mange_End_Cell_ID, ref restr); TaskHandleMethod.AddStockRecord(manageTask.Mange_ID); viewCell = bllView.GetModelByChildCellID(manageTask.Mange_End_Cell_ID); if (viewCell != null) { restr = "上架任务完成,更新货位[" + viewCell.WareHouse_Name + "," + viewCell.Cell_Name + "," + viewCell.Cell_Chlid_Position + "]状态,满筐、完成。"; } } else if (manageTask.Manage_Type_Name == EnumManageTaskType.空托盘下架.ToString()) { TaskHandleMethod.UpdateCellStatus(manageTask.Mange_Start_Cell_ID, EnumCellStatus.空闲, EnumGSTaskStatus.完成, EnumGSOperate.出库); TaskHandleMethod.AddCellOperRecord(manageTask.Mange_Start_Cell_ID, EnumGSOperateType.系统更新货位操作, "空托盘下架任务完成,更新货位状态", ref restr); viewCell = bllView.GetModelByChildCellID(manageTask.Mange_Start_Cell_ID); if (viewCell != null) { restr = "空托盘下架任务完成,更新货位[" + viewCell.WareHouse_Name + "," + viewCell.Cell_Name + "," + viewCell.Cell_Chlid_Position + "]状态,空闲、完成。"; } } else if (manageTask.Manage_Type_Name == EnumManageTaskType.架.ToString()) //下架完成后,删除库存 { TaskHandleMethod.UpdateCellStatus(manageTask.Mange_Start_Cell_ID, EnumCellStatus.空闲, EnumGSTaskStatus.完成, EnumGSOperate.出库); TaskHandleMethod.AddCellOperRecord(manageTask.Mange_Start_Cell_ID, EnumGSOperateType.系统更新货位操作, "货物下架任务完成,更新货位状态", ref restr); TaskHandleMethod.UpdatePlanCompleteNum(manageTask.Mange_ID); TaskHandleMethod.AddStockRecord(manageTask.Mange_ID);//删除stock前 TaskHandleMethod.DeleteStock(manageTask.Mange_Stock_Barcode); viewCell = bllView.GetModelByChildCellID(manageTask.Mange_Start_Cell_ID); if (viewCell != null) { restr = "下架任务完成,更新货位[" + viewCell.WareHouse_Name + "," + viewCell.Cell_Name + "," + viewCell.Cell_Chlid_Position + "]状态,空闲、完成。"; } } else if (manageTask.Manage_Type_Name == EnumManageTaskType.盘点下架.ToString()) { TaskHandleMethod.UpdateCellStatus(manageTask.Mange_Start_Cell_ID, EnumCellStatus.空闲, EnumGSTaskStatus.完成, EnumGSOperate.出库); TaskHandleMethod.AddCellOperRecord(manageTask.Mange_Start_Cell_ID, EnumGSOperateType.系统更新货位操作, "货物下架任务完成,更新货位状态", ref restr); //TaskHandleMethod.UpdatePlanCompleteNum(manageTask.Mange_ID); TaskHandleMethod.AddStockRecord(manageTask.Mange_ID); TaskHandleMethod.DeleteStock(manageTask.Mange_ID); viewCell = bllView.GetModelByChildCellID(manageTask.Mange_Start_Cell_ID); if (viewCell != null) { restr = "盘点下架任务完成,更新货位[" + viewCell.WareHouse_Name + "," + viewCell.Cell_Name + "," + viewCell.Cell_Chlid_Position + "]状态,空闲、完成。"; } } else if (manageTask.Manage_Type_Name == EnumManageTaskType.拣选下架.ToString()) { } else if (manageTask.Manage_Type_Name == EnumManageTaskType.移库.ToString()) { TaskHandleMethod.UpdateCellStatus(manageTask.Mange_Start_Cell_ID, EnumCellStatus.空闲, EnumGSTaskStatus.完成, EnumGSOperate.出库); TaskHandleMethod.UpdateCellStatus(manageTask.Mange_End_Cell_ID, EnumCellStatus.满位, EnumGSTaskStatus.完成, EnumGSOperate.入库); TaskHandleMethod.UpdateStockCell(manageTask.Mange_Stock_Barcode, manageTask.Mange_End_Cell_ID, ref restr); TaskHandleMethod.AddCellOperRecord(manageTask.Mange_Start_Cell_ID, EnumGSOperateType.系统更新货位操作, "货物移库任务完成,更新货位状态", ref restr); TaskHandleMethod.AddStockRecord(manageTask.Mange_ID); View_CellModel startCell = bllView.GetModelByChildCellID(manageTask.Mange_Start_Cell_ID); View_CellModel endCell = bllView.GetModelByChildCellID(manageTask.Mange_End_Cell_ID); if (startCell != null && endCell != null) { restr = "移库任务完成,更新货位[" + startCell.WareHouse_Name + "," + startCell.Cell_Name + "," + startCell.Cell_Chlid_Position + "]状态,空闲、完成;"; restr = "更新货位[" + endCell.WareHouse_Name + "," + endCell.Cell_Name + "," + endCell.Cell_Chlid_Position + "]状态,满位、完成。"; } } else { return(false); } StatusManager.wmsFrame.WriteLog("服务管理", "", "提示", restr); TaskHandleMethod.CheckPlanCompleteStatus(manageTask.Plan_ID, ref restr);//检查计划是否完成,如果完成自动更新计划通过计划数量和完成数量相等判断 TaskHandleMethod.UpdateManageCompleteTime(manageTask.Mange_ID, DateTime.Now); TaskHandleMethod.UpdateManageHandleStatus(manageTask.Mange_ID, EnumBreakDowmStatus.已处理); return(true); } catch (Exception ex) { StatusManager.wmsFrame.WriteLog("服务管理", "", "错误", "任务完成处理失败!" + ex.Message); return(false); } }