private void IniHouseAreaList() { this.cb_HouseArea.Items.Clear(); WH_WareHouseModel house = bllWareHouse.GetModelByName(houseName); if (house == null) { return; } List <WH_AreaModel> areaList = bllArea.GetModels(house.WareHouse_ID); // for(int i=0;i<Enum.GetNames(typeof(EnumLogicArea)).Length;i++) for (int i = 0; i < areaList.Count(); i++) { if (areaList[i].Area_Name == "暂存区") { continue; } string areaName = areaList[i].Area_Name;//Enum.GetNames(typeof(EnumLogicArea))[i]; this.cb_HouseArea.Items.Add(areaName); } if (this.cb_HouseArea.Items.Count > 0) { this.cb_HouseArea.SelectedIndex = 0; } }
public void GetWareArea(string wareName) { ViewDataManager.WAREAREAVIEWDATA.AreaColorListData.Clear(); WH_WareHouseModel house = bllHouse.GetModelByName(wareName); if (house == null) { return; } List <WH_AreaModel> areaList = bllArea.GetModels(house.WareHouse_ID); if (areaList == null) { return; } foreach (WH_AreaModel area in areaList) { if (area.Area_Type == "暂存区") { continue; } AreaColorModel model = new AreaColorModel(); model.区域名称 = area.Area_Name; model.区域颜色 = area.Area_BackColor; ViewDataManager.WAREAREAVIEWDATA.AreaColorListData.Add(model); } }
public void QueryStationList(string houseName) { ViewDataManager.WHSTATIONVIEWDATA.WHStationListData.Clear(); WH_WareHouseModel house = bllWareHouse.GetModelByName(houseName); if (house == null) { this.View.ShowMessage("信息提示", "无此库房!"); return; } List <WH_Station_LogicModel> logicModelList = bllStationLogic.GetModelListByHouseID(house.WareHouse_ID); if (logicModelList == null || logicModelList.Count == 0) { return; } for (int i = 0; i < logicModelList.Count; i++) { WHStationDataModel model = new WHStationDataModel(); model.工位编码 = logicModelList[i].Cell_Child_ID; model.工位逻辑名称 = logicModelList[i].WH_Station_Logic_Name; model.工位逻辑类型 = logicModelList[i].WH_Station_Logic_Type; model.工位逻辑编码 = logicModelList[i].WH_Station_Logic; model.库房编码 = logicModelList[i].WareHouse_ID; ViewDataManager.WHSTATIONVIEWDATA.WHStationListData.Add(model); } }
public void GetUnShelveStation(string houseName) { //if (palletCode.Trim() == "") //{ // this.View.ShowMessage("信息提示", "请选择指定货位下架!"); // return; //} //View_StockListModel stockListModel = bllViewStockList.GetModelByPalletCode(palletCode,EnumCellType.货位.ToString()); //if(stockListModel == null) //{ // this.View.ShowMessage("信息提示", "此货位无库存!"); // return; //} WH_WareHouseModel house = bllWareHouse.GetModelByName(houseName); if (house == null) { this.View.ShowMessage("信息提示", "不存在此库房"); return; } List <WH_Station_LogicModel> staionList = bllStationLogic.GetStationListByType(house.WareHouse_ID, EnumCellType.架工位.ToString()); List <string> stationList = new List <string>(); foreach (WH_Station_LogicModel station in staionList) { stationList.Add(station.WH_Station_Logic_Name); } this.View.IniTargetList(stationList); }
public void IniUnShelveStationList(string houseName) { WH_WareHouseModel house = bllWareHouse.GetModelByName(houseName); if (house == null) { return; } string houseID = ""; //if (houseName == "A1库房" || houseName == "A2库房" || houseName == "A3库房" || houseName == "A4库房" || houseName == "A5库房") //{ // houseID = "1-5库房"; //} //else //{ houseID = house.WareHouse_ID; //} List <WH_Station_LogicModel> staionList = bllStationLogic.GetModelListByHouseIDAndCellType(houseID, EnumCellType.架工位.ToString()); List <string> stationList = new List <string>(); foreach (WH_Station_LogicModel station in staionList) { stationList.Add(station.WH_Station_Logic_Name); } this.View.IniTargetList(stationList); }
private void IniPutawayList(string houseName) { WH_WareHouseModel wareHouse = bllWareHouse.GetModelByName(houseName); if (wareHouse == null) { this.View.ShowMessage("信息提示", "库房不存在!"); return; } string houseID = ""; //if(houseName=="A1库房"||houseName=="A2库房"||houseName=="A3库房"||houseName=="A4库房"||houseName=="A5库房") //{ // houseID = "1-5库房"; //} //else //{ houseID = wareHouse.WareHouse_ID; //} List <WH_Station_LogicModel> cellList = bllStationLogic.GetModelListByHouseIDAndCellType(houseID, EnumCellType.架工位.ToString()); if (cellList == null) { return; } List <string> staList = new List <string>(); foreach (WH_Station_LogicModel sta in cellList) { staList.Add(sta.WH_Station_Logic_Name); } this.View.IniPutawayList(staList); }
public bool AddAreaModel(WareArea area) { WH_AreaModel model = new WH_AreaModel(); WH_WareHouseModel house = bllWareHouse.GetModelByName(area.WareHouseName); if (house == null) { return(false); } WH_AreaModel existArea = bllArea.GetModelByName(house.WareHouse_ID, area.AreaName); if (existArea != null) { this.View.ShowMessage("信息提示", "此区域名称已经存在!"); return(false); } model.WareHouse_ID = house.WareHouse_ID; model.Area_BackColor = area.AreaBackColor; model.Area_Code = area.AreaCode; model.Area_Name = area.AreaName; model.Area_Type = area.AreaType; model.Area_Flag = area.AreaEnableStatus; model.Area_ID = Guid.NewGuid().ToString(); return(bllArea.Add(model)); }
public void InitPosList(string houseName, int rowth) { WH_WareHouseModel house = bllHouse.GetModelByName(houseName); if (house == null) { return; } List <string> posTypeList = bllCell.GetCellPositionType(house.WareHouse_ID, rowth); this.View.InitPosTypeList(posTypeList); }
public void InitHouseRowList(string houseName) { WH_WareHouseModel wareHouse = bllHouse.GetModelByName(houseName); if (wareHouse == null) { return; } List <string> rowList = bllCell.GetRowListByDeviceCode(wareHouse.WareHouse_ID); this.View.IniRowList(rowList); }
public void InitHouseLayerList(string houseName, string row, string col) { WH_WareHouseModel wareHouse = bllHouse.GetModelByName(houseName); if (wareHouse == null) { return; } List <string> items = bllCell.GetLayerListByHouseRowCol(wareHouse.WareHouse_ID, row, col); this.View.IniLayerList(items); }
//public void IniRows(string houseName) //{ // //IniPutawayList(houseName); // WH_WareHouseModel wareHouse = bllWareHouse.GetModelByName(houseName); // if (wareHouse == null) // { // this.View.ShowMessage("信息提示", "库房不存在!"); // return; // } // List<string> rowList = bllViewCell.GetRCL(wareHouse.WareHouse_ID, 0, 0, 0, 0); // this.View.IniRows(rowList); // //List<View_CellModel> cellList = bllViewCell.GetPutawayCellList(houseName); // //this.View.IniCellList(cellList); //} public void IniCols(string houseName, int rowth) { WH_WareHouseModel wareHouse = bllWareHouse.GetModelByName(houseName); if (wareHouse == null) { this.View.ShowMessage("信息提示", "库房不存在!"); return; } List <string> colList = bllViewCell.GetRCL(wareHouse.WareHouse_ID, rowth, 0, 0, 1); this.View.IniCols(colList); }
public void IniPos(string houseName, int rowth, int colth, int layerth) { WH_WareHouseModel wareHouse = bllWareHouse.GetModelByName(houseName); if (wareHouse == null) { this.View.ShowMessage("信息提示", "库房不存在!"); return; } List <string> poses = bllViewCell.GetRCL(wareHouse.WareHouse_ID, rowth, colth, layerth, 3); this.View.IniPoses(poses); }
public bool InHouseResponse(List <View_PlanListModel> planList, ref string jsonStr, ref string reStr) { try { if (planList == null || planList.Count == 0) { return(false); } InHouseOrderResponse inHouseResponse = new InHouseOrderResponse();//入库完成给erp反馈,否则没有货位信息 inHouseResponse.wms_order_code = planList[0].Plan_Code; inHouseResponse.order_code = Guid.NewGuid().ToString(); if (planList[0].Plan_Create_Time != null) { inHouseResponse.order_date = planList[0].Plan_Create_Time.ToString(); } inHouseResponse.order_maker = planList[0].Plan_From_User; inHouseResponse.order_voucherType = planList[0].Plan_List_Resever1; inHouseResponse.warehouse_code = planList[0].Plan_Remark; WH_WareHouseModel house = bllWareHouse.GetModelByCode(planList[0].Plan_Remark); if (house != null) { inHouseResponse.warehouse_name = house.WareHouse_Name; } List <InventoryInfo> inventoryInfoList = new List <InventoryInfo>(); foreach (View_PlanListModel plan in planList) { InventoryInfo inventoryInfo = new InventoryInfo(); inventoryInfo.serial = plan.Plan_List_Remark;//批次 View_StockListModel stock = bllViewStockList.GetModeByPlanListID(plan.Plan_List_ID); if (stock != null) { inventoryInfo.inventory_code = stock.Cell_Code; inventoryInfo.inventory_name = stock.Cell_Name + "-" + stock.Cell_Chlid_Position; } inventoryInfo.quantity = plan.Plan_List_Finished_Quantity; inventoryInfo.serial = plan.Plan_List_Remark; inventoryInfoList.Add(inventoryInfo); } inHouseResponse.InventoryList = inventoryInfoList; reStr = "获取成功!"; jsonStr = Newtonsoft.Json.JsonConvert.SerializeObject(inHouseResponse); return(true); } catch (Exception ex) { reStr = ex.StackTrace; return(false); } }
public bool ModifyHouseModel(WHHouse house) { WH_WareHouseModel houseModel = bllWareHouse.GetModel(house.WareHouse_ID); if (houseModel == null) { return(false); } houseModel.WareHouse_Code = house.WareHouse_Code; houseModel.WareHouse_Flag = house.WareHouse_Flag; houseModel.WareHouse_Name = house.WareHouse_Name; houseModel.WareHouse_Remark = house.WareHouse_Remark; houseModel.WareHouse_Type = house.WareHouse_Type; return(bllWareHouse.Update(houseModel)); }
public void IniRows(string houseName) { IniPutawayList(houseName); WH_WareHouseModel wareHouse = bllWareHouse.GetModelByName(houseName); if (wareHouse == null) { this.View.ShowMessage("信息提示", "库房不存在!"); return; } List <string> rowList = bllViewCell.GetRCL(wareHouse.WareHouse_ID, 0, 0, 0, 0); this.View.IniRows(rowList); //List<View_CellModel> cellList = bllViewCell.GetPutawayCellList(houseName); //this.View.IniCellList(cellList); }
public bool OutHouseResponse(List <View_PlanListModel> planList, ref string jsonStr, ref string reStr) { try { if (planList == null || planList.Count == 0) { return(false); } OutHouseOrderResponse inhouseResponse = new OutHouseOrderResponse(); inhouseResponse.order_code = planList[0].Plan_Code; inhouseResponse.order_date = planList[0].Plan_Create_Time.ToString(); inhouseResponse.order_maker = planList[0].Plan_Operater; inhouseResponse.order_voucherType = planList[0].Plan_List_Resever1; inhouseResponse.warehouse_code = planList[0].Plan_Remark; WH_WareHouseModel wareHouse = bllWareHouse.GetModelByCode(planList[0].Plan_Remark); if (wareHouse != null) { inhouseResponse.warehouse_name = wareHouse.WareHouse_Name; } List <InventoryInfo> inventoryList = new List <InventoryInfo>(); List <View_Manage_CellModel> manageList = bllViewManageCell.GetListByPlanID(planList[0].Plan_ID); foreach (View_Manage_CellModel manage in manageList) { InventoryInfo inventInfo = new InventoryInfo(); inventInfo.inventory_code = manage.Cell_Code; inventInfo.inventory_name = manage.Cell_Name + "-" + manage.Cell_Chlid_Position; Manage_ListModel manageListModel = bllManageList.GetModelByManageID(manage.Mange_ID); if (manageListModel != null) { inventInfo.quantity = manageListModel.Manage_List_Quantity; } inventoryList.Add(inventInfo); } inhouseResponse.MaterilaList = inventoryList; reStr = "获取成功!"; jsonStr = Newtonsoft.Json.JsonConvert.SerializeObject(inhouseResponse); return(true); } catch (Exception ex) { reStr = ex.StackTrace; return(false); } }
public bool AddHuouseModel(WHHouse house) { WH_WareHouseModel houseModel = bllWareHouse.GetModel(house.WareHouse_ID); if (houseModel != null) { this.View.ShowMessage("信息提示", "此库房编号已存在!"); return(false); } houseModel = new WH_WareHouseModel(); houseModel.WareHouse_ID = house.WareHouse_ID; houseModel.WareHouse_Code = house.WareHouse_Code; houseModel.WareHouse_Flag = house.WareHouse_Flag; houseModel.WareHouse_Name = house.WareHouse_Name; houseModel.WareHouse_Remark = house.WareHouse_Remark; houseModel.WareHouse_Type = house.WareHouse_Type; return(bllWareHouse.Add(houseModel)); }
/// <summary> /// 设置整列逻辑区域 /// </summary> /// <param name="houseName"></param> /// <param name="colth"></param> /// <returns></returns> public bool SetMulLayerMulColArea(string houseName, string logicAreaName, int rowth, int stCol, int edCol, int stLayer, int edLayer) { //string reStr = ""; //for (int i = stCol; i <= edCol; i++) //{ WH_WareHouseModel house = bllHouse.GetModelByName(houseName); if (house == null) { this.View.ShowMessage("信息提示", "不存在库房:" + houseName); return(false); } WH_AreaModel area = bllArea.GetModelByName(house.WareHouse_ID, logicAreaName); if (area == null) { this.View.ShowMessage("信息提示", "区域名称错误!"); return(false); } bool status = bllCell.SetMulLayerMulColGsArea(this.currHouseName, area.Area_ID, rowth, stCol, edCol, stLayer, edLayer); if (status == false) { this.View.ShowMessage("信息提示", "区域设置错误!"); return(false); } ////for (int layer = stLayer; layer <= edLayer;layer ++ ) ////{ //// for(int col = stCol;col<=edCol;col++) //// { //this.iStorageManage.AddGSOperRecord(houseName, new CellCoordModel(rowth, stCol, stLayer) // , EnumGSOperateType.库存区域设置, "手动多层多列库存区域设置:起始列[" + stCol + "]终止列[" + edCol + "] 起始层[" + stLayer + "]" // + "终止层[" + edLayer + "] 为->" + logicArea.StoreHouseAreaName, ref reStr); //// } ////} ////} this.View.RefreshData(); return(true); }
//public void ResgistShowAreaProperty(Action<string> showAreaProperty) //{ // this.showAreaProperty = showAreaProperty; //} public void QueryAreaList(string wareInfo) { ViewDataManager.WAREAREAVIEWDATA.AreaListData.Clear(); WH_WareHouseModel house = bllWareHouse.GetModelByName(wareInfo); if (house == null) { return; } List <WH_AreaModel> areaList = bllArea.GetModels(house.WareHouse_ID); if (areaList == null) { return; } foreach (WH_AreaModel area in areaList) { if (area.Area_Type == "暂存区") { continue; //暂存区不显示 } AreaDataModel model = new AreaDataModel(); model.区域名称 = area.Area_Name; //model.区域启用状态 = area.Area_Flag; model.区域类型 = area.Area_Type; model.区域编号 = area.Area_ID; model.区域编码 = area.Area_Code; model.区域颜色 = area.Area_BackColor; //if(area.Area_Flag =="1") //{ // model.区域启用状态 = "是"; //} //else //{ // model.区域启用状态 = "否"; //} model.库房名称 = area.WareHouse_ID; ViewDataManager.WAREAREAVIEWDATA.AreaListData.Add(model); } }
public void GetCellDetailByPalletCode(string houseName, string palletCode) { WH_WareHouseModel house = bllHouse.GetModelByName(houseName); if (house == null) { this.View.ShowMessage("信息提示", "不存在此库房!"); return; } View_StockListModel stockModel = bllViewStockList.GetModelByHousePallet(house.WareHouse_ID, palletCode, EnumCellType.货位.ToString()); if (stockModel == null) { this.View.ShowMessage("信息提示", "无此托盘库存信息!"); return; } GetGSDetail(stockModel.Cell_Child_ID); this.View.SetRowTxt(stockModel.Cell_Row.ToString()); this.View.SetPosTxt(stockModel.Cell_Chlid_Position); this.View.GsSearch((int)stockModel.Cell_Column, (int)stockModel.Cell_Layer); }
private void UploadInHouseInfoToErp(List <View_PlanListModel> planList)//出库入库都一样 { if (planList == null || planList.Count == 0) { return; } InHouseOrderResponse inhouseResponse = new InHouseOrderResponse(); inhouseResponse.order_code = planList[0].Plan_Code; inhouseResponse.order_date = planList[0].Plan_Create_Time.ToString(); inhouseResponse.order_maker = planList[0].Plan_From_User; inhouseResponse.order_voucherType = planList[0].Plan_Type_Name; inhouseResponse.warehouse_code = planList[0].Plan_Remark; WH_WareHouseModel wareHouse = bllWareHouse.GetModelByCode(planList[0].Plan_Remark); if (wareHouse != null) { inhouseResponse.warehouse_name = wareHouse.WareHouse_Name; } List <InventoryInfo> inventoryList = new List <InventoryInfo>(); List <View_Manage_CellModel> manageList = bllViewManageCell.GetListByPlanID(planList[0].Plan_ID); foreach (View_Manage_CellModel manage in manageList) { InventoryInfo inventInfo = new InventoryInfo(); inventInfo.inventory_code = manage.Cell_Code; inventInfo.inventory_name = manage.Cell_Name; Manage_ListModel manageListModel = bllManageList.GetModelByManageID(manage.Mange_ID); if (manageListModel != null) { inventInfo.quantity = manageListModel.Manage_List_Quantity; } inventoryList.Add(inventInfo); } inhouseResponse.InventoryList = inventoryList; }
public void IniTargetPos(string houseName) { WH_WareHouseModel house = bllWareHouse.GetModelByName(houseName); if (house == null) { this.View.ShowMessage("信息提示", "不存在此库房"); return; } List <WH_Station_LogicModel> statinList = bllStationLogic.GetStationListByType(house.WareHouse_ID, EnumCellType.配盘工位.ToString()); List <string> palletSta = new List <string>(); if (statinList == null) { this.View.ShowMessage("信息提示", "此库房不存在配盘工位,请检查配置!"); return; } foreach (WH_Station_LogicModel station in statinList) { palletSta.Add(station.WH_Station_Logic_Name); } this.View.IniTargetPos(palletSta); }
public bool DeleteWareHouse(string whID) { WH_WareHouseModel whModel = bllWareHouse.GetModel(whID); if (whModel == null) { this.View.ShowMessage("信息提示", "不存在此库房"); return(false); } List <WH_AreaModel> areaList = bllArea.GetModels(whID); bool isDel = true; if (areaList != null && areaList.Count() != 0) { for (int i = 0; i < areaList.Count; i++) { if (bllArea.Delete(areaList[i].Area_ID) == false) { isDel = false; break;; } } } if (isDel == false) { this.View.ShowMessage("信息提示", "删除库房区域失败(数据库操作)!"); return(false); } if (bllWareHouse.Delete(whID) == false) { this.View.ShowMessage("信息提示", "删除库房失败(数据库操作)!"); return(false); } return(true); }
public static bool CreateUnshelveManageTask(string planCode, string palletCode, string houseName, string unshelveStationName, ref string manageID, ref string restr) { ManageModel manage = new ManageModel(); manage.Mange_CreateTime = DateTime.Now; WH_WareHouseModel wareHouse = bllWareHouse.GetModelByName(houseName); if (wareHouse == null) { restr = "库房名称错误!"; return(false); } WH_Station_LogicModel targetCell = bllStationLogic.GetStationByName(wareHouse.WareHouse_ID, unshelveStationName); if (targetCell == null) { restr = "下架站台不存在!"; return(false); } View_CellModel startCell = null; View_StockListModel stockModel = bllViewStockList.GetModelByPalletCode(palletCode, EnumCellType.货位.ToString()); if (stockModel == null) { restr = "没有找到所选物料库存!"; return(false); } startCell = bllViewCell.GetModelByWHAndCellName(stockModel.WareHouse_Name, stockModel.Cell_Name, stockModel.Cell_Chlid_Position); if (startCell == null) { restr = "没有找到所选物料货位!"; return(false); } if (startCell.Shelf_Type == EnumShelfType.双深.ToString() && startCell.Cell_Chlid_Position == EnumCellPos.后.ToString())//双深工位如果选中前面的工位要判断后面是否有料 { View_CellModel forwordCell = bllViewCell.GetCell(stockModel.WareHouse_ID, stockModel.Cell_Name, EnumCellPos.前.ToString()); if (forwordCell != null && forwordCell.Cell_Child_Status == "空闲" && forwordCell.Cell_Child_Run_Status == "完成")//前面的已经出去了 { } else { restr = "双深工位出库需要先将外面的库存出库,再出库里面的!"; return(false); } } manage.Mange_ID = Guid.NewGuid().ToString(); manage.Mange_Start_Cell_ID = startCell.Cell_Chlid_ID; manage.Mange_End_Cell_ID = targetCell.Cell_Child_ID; manage.Mange_Status = EnumManageTaskStatus.待执行.ToString(); manage.Manage_BreakDown_Status = "待分解"; manage.Mange_Stock_Barcode = palletCode; //manage.Mange_Type_ID = EnumManageTaskType.下架.ToString(); manage.Mange_Type_ID = "8";//下架 PlanMainModel planModel = null; if (planCode == "-1") { manage.Plan_ID = "-1"; } else { planModel = bllPlan.GetModelByPlanCode(planCode); if (planModel == null) { restr = "不存在此计划!"; return(false); } manage.Plan_ID = planModel.Plan_ID; } manageID = manage.Mange_ID; bllManage.Add(manage); bool status = CreateUnshelveManageListTask(planCode, manage.Mange_ID, palletCode, ref restr); if (status == true) { restr += "生成托盘[" + palletCode + "]下架任务成功:起点:" + startCell.WareHouse_Name + startCell.Cell_Name + startCell.Cell_Chlid_Position; EnumCellStatus cellStatus = (EnumCellStatus)Enum.Parse(typeof(EnumCellStatus), startCell.Cell_Child_Status); UpdateCellStatus(startCell.Cell_Chlid_ID, cellStatus, EnumGSTaskStatus.锁定, EnumGSOperate.出库); return(true); } else { restr += "生成托盘[" + palletCode + "]下架任务失败:起点:" + startCell.WareHouse_Name + startCell.Cell_Name + startCell.Cell_Chlid_Position; return(false); } }
/// <summary> /// /// </summary> /// <param name="palletCode"></param> /// <param name="houseName"></param> /// <param name="putawayStationName"></param> /// <param name="isAssign"></param> /// <param name="targetStation"></param> /// <param name="taskType">任务类型</param> /// <param name="manageID"></param> /// <param name="restr"></param> /// <returns></returns> public static bool CreatePutawayManageTask(string palletCode, string houseName, string putawayStationName, bool isAssign, string targetStation, EnumManageTaskType taskType, ref string manageID, ref string restr) { ManageModel manage = new ManageModel(); manage.Mange_CreateTime = DateTime.Now; WH_WareHouseModel house = bllWareHouse.GetModelByName(houseName); if (house == null) { restr = "库房对象为空!"; return(false); } WH_Station_LogicModel stationCell = bllStationLogic.GetStationByName(house.WareHouse_ID, putawayStationName); if (stationCell == null) { restr = "上架站台不存在!"; return(false); } WH_WareHouseModel wareHouse = bllWareHouse.GetModelByName(houseName); if (wareHouse == null) { restr = "库房名称错误!"; return(false); } View_StockListModel stock = bllViewStockList.GetModelByPalletCode(palletCode, EnumCellType.货位.ToString()); if (stock != null) { restr = "库存中已经有此托盘条码!"; return(false); } View_CellModel targetCell = null; if (isAssign == true)//分配货位要做校验 { string[] targetPos = targetStation.Split('-'); if (targetPos == null || targetPos.Length != 2) { restr = "指定货位格式错误!"; return(false); } string cellName = targetPos[0]; string cellPos = targetPos[1]; targetCell = bllViewCell.GetCell(wareHouse.WareHouse_ID, cellName, cellPos); if (targetCell == null || targetCell.Cell_Child_Status != EnumCellStatus.空闲.ToString() || targetCell.Cell_Child_Run_Status != EnumGSTaskStatus.完成.ToString()) { restr = "当前货位不可用!"; return(false); } } else { targetCell = bllViewCell.ApplyCell(wareHouse.WareHouse_ID); } if (targetCell == null) { restr = "库房已满,没有货位可以申请了!"; return(false); } if (targetCell.Shelf_Type == EnumShelfType.双深.ToString() && targetCell.Cell_Chlid_Position == EnumCellPos.前.ToString())//双深工位如果选中前面的工位要判断后面是否有料 { View_CellModel backCell = bllViewCell.GetCell(wareHouse.WareHouse_ID, targetCell.Cell_Name, EnumCellPos.后.ToString()); if (backCell != null && backCell.Cell_Child_Run_Status == EnumGSTaskStatus.完成.ToString() && backCell.Cell_Child_Status == EnumCellStatus.空闲.ToString()) { restr = "此货位为双深工位 ,需要先送入后面的货位再入前面的货位!"; return(false); } if (backCell != null && backCell.Cell_Child_Run_Status == EnumGSTaskStatus.锁定.ToString()) { restr = "此货位为双深工位 ,需要先送入后面的货位再入前面的货位,后面的工位处于锁定状态!"; return(false); } } if (targetCell.Cell_Child_Run_Status != EnumGSTaskStatus.完成.ToString() && targetCell.Cell_Child_Status != EnumCellStatus.空闲.ToString()) { restr = "指定货位已经被占用!"; return(false); } manage.Mange_ID = Guid.NewGuid().ToString(); manage.Mange_Start_Cell_ID = stationCell.Cell_Child_ID; manage.Mange_End_Cell_ID = targetCell.Cell_Chlid_ID; manage.Mange_Status = EnumManageTaskStatus.待执行.ToString(); manage.Manage_BreakDown_Status = "待分解"; manage.Mange_Stock_Barcode = palletCode; if (taskType == EnumManageTaskType.空托盘上架) { manage.Mange_Type_ID = "7";// EnumManageTaskType.空托盘上架.ToString(); } else if (taskType == EnumManageTaskType.架) { manage.Mange_Type_ID = "6";//上架 } else { restr = "任务类型错误!"; return(false); } View_StockListModel vslm = bllViewStockList.GetModelByPalletCode(palletCode, EnumCellType.配盘工位.ToString());// if (vslm == null) { restr = "没有配盘,请查看!"; return(false); } EnumOrderType orderType = EnumOrderType.计划; if (vslm.Plan_List_ID == "-1")//无计划的 { manage.Plan_ID = "-1"; orderType = EnumOrderType.非计划; } else { orderType = EnumOrderType.计划; View_Plan_StockListModel plan = bllViewPalnStockList.GetModelByPalletCode(palletCode); if (plan == null) { restr = "当前库存没有对应计划!"; return(false); } manage.Plan_ID = plan.Plan_ID; } manageID = manage.Mange_ID; bllManage.Add(manage); bool status = CreatePutawayManageListTask(manage.Mange_ID, orderType, palletCode, ref restr); if (status == true) { restr += "生成托盘[" + palletCode + "]上架任务成功:终点:" + houseName + targetCell.Cell_Name + targetCell.Cell_Chlid_Position; UpdateCellStatus(targetCell.Cell_Chlid_ID, EnumCellStatus.空闲, EnumGSTaskStatus.锁定, EnumGSOperate.入库); return(true); } else { restr += "生成托盘[" + palletCode + "]上架任务失败:终点:" + houseName + targetCell.Cell_Name + targetCell.Cell_Chlid_Position; return(false); } }
/// <summary> /// /// </summary> /// <param name="cate">0:查询排数量;1:查询列数量;2:查询层数量</param> /// <returns></returns> public List <int> GetHouseRCL(string houseName, int cate) { WH_WareHouseModel house = bllHouse.GetModelByName(houseName); return(bllCell.GetGsRCLData(house.WareHouse_ID, cate)); }
public string WareHouseInfo(string wareHouseInfoJson, string operateType) { ResponseData response = new ResponseData(); WH_WareHouseModel wareHouseDb = new WH_WareHouseModel(); //WareHouse wareHouse = new WareHouse(); //wareHouseInfoJson = GetWareHouseTestJson();//测试 try { WareHouse wareHouse = Newtonsoft.Json.JsonConvert.DeserializeObject <WareHouse>(wareHouseInfoJson); if (wareHouse == null) { response.Describe = "库房档案数据格式错误!"; response.Status = false; MainFrameHandler.GetMainFrame().WriteLog("WMS_To_ERP服务", "", "提示", response.Describe + "信息内容:" + wareHouseInfoJson); return(response.ToJson()); } if (wareHouse.warehouse_code == "") { response.Describe = "库房编码不能为空!"; response.Status = false; MainFrameHandler.GetMainFrame().WriteLog("WMS_To_ERP服务", "", "提示", response.Describe + "信息内容:" + wareHouseInfoJson); return(response.ToJson()); } if (wareHouse.warehouse_name == "") { response.Describe = "库房名称不能为空!"; response.Status = false; MainFrameHandler.GetMainFrame().WriteLog("WMS_To_ERP服务", "", "提示", response.Describe + "信息内容:" + wareHouseInfoJson); return(response.ToJson()); } if (operateType != "1" && operateType != "2" && operateType != "3") { response.Describe = "接口操作标识错误!operateType,1为增加,2为更新,3为删除!"; response.Status = false; MainFrameHandler.GetMainFrame().WriteLog("WMS_To_ERP服务", "", "提示", response.Describe + "信息内容:" + wareHouseInfoJson); return(response.ToJson()); } switch (operateType) { case "1": //增加 { wareHouseDb = bllWareHouse.GetModelByCode(wareHouse.warehouse_code); if (wareHouseDb != null) { response.Describe = "库房档案添加失败,已经存在此库房编码:" + wareHouse.warehouse_code; response.Status = false; MainFrameHandler.GetMainFrame().WriteLog("WMS_To_ERP服务", "", "提示", response.Describe + "信息内容:" + wareHouseInfoJson); return(response.ToJson()); } wareHouseDb = new WH_WareHouseModel(); wareHouseDb.WareHouse_ID = Guid.NewGuid().ToString(); wareHouseDb.WareHouse_Code = wareHouse.warehouse_code; wareHouseDb.WareHouse_Name = wareHouse.warehouse_name; bllWareHouse.Add(wareHouseDb); break; } case "2": //更新 { wareHouseDb = bllWareHouse.GetModelByCode(wareHouse.warehouse_code); if (wareHouseDb == null) { response.Describe = "库房档案数据更细失败,此库房编码不存在:" + wareHouse.warehouse_code; response.Status = false; MainFrameHandler.GetMainFrame().WriteLog("WMS_To_ERP服务", "", "提示", response.Describe + "信息内容:" + wareHouseInfoJson); return(response.ToJson()); } wareHouseDb.WareHouse_Code = wareHouse.warehouse_code; wareHouseDb.WareHouse_Name = wareHouse.warehouse_name; bllWareHouse.Update(wareHouseDb); break; } case "3": //删除 { bllWareHouse.DeleteByCode(wareHouse.warehouse_code); break; } default: { response.Status = false; response.Describe = "操作类型错误,operateType,1为增加,2为更新,3为删除!"; return(response.ToJson()); } } response.Describe = "库存档案数据导入成功!"; response.Status = true; MainFrameHandler.GetMainFrame().WriteLog("WMS_To_ERP服务", "", "提示", response.Describe + "信息内容:" + wareHouseInfoJson); return(response.ToJson()); } catch (Exception ex) { response.Describe = "物料单位数据导入失败!错误原因:" + ex.StackTrace.ToString(); response.Status = false; MainFrameHandler.GetMainFrame().WriteLog("WMS_To_ERP服务", "", "错误", response.Describe + "信息内容:" + wareHouseInfoJson); return(response.ToJson()); } }
public void UnShelveTask(string planCode, string planlistCode, string num, string palletCode, string houseName, string unshelveStationName) { //查看当前是否已经有此托盘条码的上架管理任务 View_Manage_ListModel manage = bllViewManageList.GetModelByPalletCodeAndTaskType(palletCode, EnumManageTaskType.架.ToString(), EnumManageTaskStatus.待执行.ToString()); if (manage != null) { //this.WmsFrame.WriteLog("下架逻辑", "", "提示", "当前托盘下架任务已经下发!"); this.View.ShowMessage("信息提示", "当前托盘下架任务已经下发!"); return; } if (CommonMoudle.TaskHandleMethod.IsOrderNumBiggerThanPlan(planlistCode, num) == true) { if (this.View.AskMessage("询问?", "当前计划物料下达数量已经大于计划数量,您确定还要下达吗?") != 0) { return; } } string restr = ""; string manageID = ""; //if(CheckMaterialNum(ref restr) == false)//先不加个数校验 //{ // this.View.ShowMessage("信息提示", restr); // return ; //} ReturnObject allowCreateTask = new ReturnObject(); allowCreateTask.Status = true; if (this.allowUnShelve != null) { WH_WareHouseModel house = bllWareHouse.GetModelByName(houseName); if (house == null) { this.View.ShowMessage("信息提示", "库房获取失败!"); return; } UnShelveParams unshelveParams = new UnShelveParams(); unshelveParams.WareHouseCode = house.WareHouse_Code; unshelveParams.PalletCode = palletCode; allowCreateTask = this.allowUnShelve(unshelveParams); } if (allowCreateTask.Status == false) { this.View.ShowMessage("信息提示", allowCreateTask.Describe); return; } if (CommonMoudle.TaskHandleMethod.CreateUnshelveManageTask(planCode, palletCode, houseName, unshelveStationName, ref manageID, ref restr) == false) { this.WmsFrame.WriteLog("下架逻辑", "", "提示", restr); return; } if (CommonMoudle.TaskHandleMethod.UpdatePlanOrderedNum(manageID) == false) { this.WmsFrame.WriteLog("下架逻辑", "", "提示", "更新计划下达数据数量失败:计划编码:" + planCode + ",托盘号:" + palletCode); return; } //下架管理任务生成完毕后需要更新货位状态,计划状态根据管理任务状态更新 if (UpateCellStatus(palletCode, EnumGSOperate.出库, EnumGSTaskStatus.锁定) == false) { return; } this.WmsFrame.WriteLog("下架逻辑", "", "提示", restr); QueryPlan(this.currPlanCode); }
public void PutawayTask(string palletCode, string houseName, string putawayStationName, bool isAssign, string rowth, string colth, string layerth, string pos) { string restr = ""; if (palletCode == "") { this.View.ShowMessage("信息提示", "请选择托盘条码!"); return; } //if(isEmptyPallet == false)//不是空托盘,没有库存判断 //{ StockModel stock = bllStock.GetModelByTrayCode(palletCode); if (stock == null) { this.View.ShowMessage("信息提示", "请配盘入库!"); return; } //} ManageModel manageTemp = bllManage.GetModelByPalletCode(palletCode); if (manageTemp != null) { this.View.ShowMessage("信息提示", "当前托盘已经生成上架任务!"); return; } string manageID = ""; EnumManageTaskType manaTask = EnumManageTaskType.架; string targetCell = rowth + "排" + colth + "列" + layerth + "层-" + pos; //if (isEmptyPallet == true) //{ // manaTask = EnumManageTaskType.空托盘上架; //} //else ////{ //manaTask = EnumManageTaskType.上架; //} ReturnObject allowCreateTask = new ReturnObject(); allowCreateTask.Status = true; if (this.AllowPutaway != null) { WH_WareHouseModel house = bllWareHouse.GetModelByName(houseName); if (house == null) { this.View.ShowMessage("信息提示", "库房获取失败!"); return; } PutawayParams putwayParams = new PutawayParams(); putwayParams.WareHouseName = houseName; putwayParams.WareHouseCode = house.WareHouse_Code; putwayParams.PalletCode = palletCode; allowCreateTask = this.AllowPutaway(putwayParams); } if (allowCreateTask.Status == false) { this.View.ShowMessage("信息提示", allowCreateTask.Describe); return; } if (TaskHandleMethod.CreatePutawayManageTask(palletCode, houseName, putawayStationName, isAssign, targetCell, manaTask, ref manageID, ref restr) == false) { this.WmsFrame.WriteLog("上架逻辑", "", "提示", "创建管理任务失败:" + restr); return; } //if (TaskHandleMethod.CreatePutawayManageListTask(manageID, palletCode, ref restr) == false) //{ // this.WmsFrame.WriteLog("上架逻辑", "", "提示", "创建管理任务列表失败:" + restr); // return; //} this.WmsFrame.WriteLog("上架逻辑", "", "提示", "上架任务下达成功!" + restr); }