public async Task <RouteData> DoInventoryBoxsOut(long storeId, long[] inventoryBoxIds, PLCPosition pos) { IWMSOperationApiAccessor wmsAccessor = WMSApiManager.GetOperationApiAccessor(storeId.ToString(), _client, this.UserDto); RouteData result = await wmsAccessor.DoInventoryBoxOut(inventoryBoxIds, pos); return(result); }
/// <summary> /// 获取操作API /// </summary> /// <param name="key"></param> /// <param name="sqlSugar"></param> /// <param name="user"></param> /// <returns></returns> public static IWMSOperationApiAccessor GetOperationApiAccessor(string key, ISqlSugarClient sqlSugar, SysUserDto user) { if (_operationApiInstanceMap.ContainsKey(key)) { return(_operationApiInstanceMap[key]); } if (!_warehouseMap.ContainsKey(key)) { return(null); } Wms_warehouse warehouse = _warehouseMap[key]; IWMSOperationApiAccessor accessor = null; if (string.IsNullOrWhiteSpace(warehouse.IFAddress)) { accessor = new SelfWMSOperationApiAccessor(warehouse, sqlSugar, user); } else { //TODO 操作API外部接口,第三方库暂不使用 accessor = null; // new WMSApiAccessor(warehouse); _operationApiInstanceMap.Add(key, accessor); } return(accessor); }
public async Task <RouteData> DoStockCount(long storeId, [FromForm] OutsideStockCountStep step) { IWMSOperationApiAccessor operationAccessor = WMSApiManager.GetOperationApiAccessor(storeId.ToString(), _client, this.UserDto); RouteData result = await operationAccessor.DoStockCount(step); return(result); }
public async Task <RouteData <InventoryDetailDto[]> > InventoryOutDetailList(long storeId, long inventoryBoxTaskId) { IWMSOperationApiAccessor wmsAccessor = WMSApiManager.GetOperationApiAccessor(storeId.ToString(), _client, this.UserDto); RouteData <InventoryDetailDto[]> result = await wmsAccessor.InventoryOutDetailList(inventoryBoxTaskId); return(result); }
public async Task <RouteData> DoInventoryBoxBack(long storeId, StockOperation mode, long inventoryBoxTaskId, InventoryDetailDto[] details, PLCPosition pos) { IWMSOperationApiAccessor wmsAccessor = WMSApiManager.GetOperationApiAccessor(storeId.ToString(), _client, this.UserDto); RouteData result = await wmsAccessor.DoInventoryBoxBack(mode, inventoryBoxTaskId, details, pos); return(result); }
public async Task <RouteData> DoScanComplate(long storeId, long stockInId, long inventoryBoxId, Wms_StockMaterialDetailDto[] materials, string remark) { //try //{ // _client.BeginTran(); // RouteData result = await _stockinServices.DoScanComplate(stockInId, inventoryBoxId, materials, remark, this.UserDto); // if (!result.IsSccuess) // { // _client.RollbackTran(); // return result; // } // _client.CommitTran(); // return result; //} //catch (Exception) //{ // _client.RollbackTran(); // return YL.Core.Dto.RouteData.From(PubMessages.E2005_STOCKIN_BOXOUT_FAIL); //} IWMSOperationApiAccessor wmsAccessor = WMSApiManager.GetOperationApiAccessor(storeId.ToString(), _client, this.UserDto); if (wmsAccessor == null) { return(YL.Core.Dto.RouteData.From(PubMessages.E0007_WAREHOUSE_NOTFOUND)); } return(await wmsAccessor.DoStockInScanComplate(stockInId, inventoryBoxId, materials, remark)); }
public async Task <RouteData> DoAutoSelectBox(long storeId, long?reservoirAreaId, int requestSize, PLCPosition pos) { IWMSOperationApiAccessor wmsAccessor = WMSApiManager.GetOperationApiAccessor(storeId.ToString(), _client, this.UserDto); RouteData result = await wmsAccessor.DoAutoSelectBoxOut(reservoirAreaId, requestSize, pos); return(result); }
public async Task <RouteData> Resume(long storeId, long id) { IWMSOperationApiAccessor wmsAccessor = WMSApiManager.GetOperationApiAccessor(storeId.ToString(), _client, this.UserDto); if (wmsAccessor == null) { return(YL.Core.Dto.RouteData.From(PubMessages.E0007_WAREHOUSE_NOTFOUND)); } return(await wmsAccessor.ResumeStockOut(id)); }
public async Task <RouteData> DoScanComplate(long storeId, long stockOutId, long inventoryBoxId, Wms_StockMaterialDetailDto[] materials, string remark) { IWMSOperationApiAccessor wmsAccessor = WMSApiManager.GetOperationApiAccessor(storeId.ToString(), _client, this.UserDto); if (wmsAccessor == null) { return(YL.Core.Dto.RouteData.From(PubMessages.E0007_WAREHOUSE_NOTFOUND)); } return(await wmsAccessor.DoStockOutScanComplate(stockOutId, inventoryBoxId, materials, remark)); }
public async Task <RouteData <bool> > HasNofity(long storeId) { IWMSOperationApiAccessor wmsAccessor = WMSApiManager.GetOperationApiAccessor(storeId.ToString(), _client, this.UserDto); if (wmsAccessor == null) { return(RouteData <bool> .From(false)); } RouteData <bool> result = await wmsAccessor.HasStockOutNofity(); return(result); }
public async Task <RouteData> SetStockOutNofitied(long storeId) { IWMSOperationApiAccessor wmsAccessor = WMSApiManager.GetOperationApiAccessor(storeId.ToString(), _client, this.UserDto); if (wmsAccessor == null) { return(new RouteData()); } RouteData result = await wmsAccessor.SetStockOutNofitied(); return(result); }
public async Task <string> WorkList(long storeId, long pid) { Wms_stockout stockout = await _client.Queryable <Wms_stockout>().FirstAsync(x => x.StockOutId == pid); if (stockout == null) { return(""); } IWMSOperationApiAccessor wmsAccessor = WMSApiManager.GetOperationApiAccessor(storeId.ToString(), _client, this.UserDto); Wms_StockOutWorkDetailDto[] result = await wmsAccessor.GetStockOutCurrentPlan(pid); return(Bootstrap.GridData(result, result.Length).JilToJson()); }
public async Task <RouteData> RepeatWCSTaskStatus(long storeId, long wcsTaskId) { IWMSOperationApiAccessor accessor = WMSApiManager.GetOperationApiAccessor(storeId.ToString(), _client, this.UserDto); if (accessor == null) { return(YL.Core.Dto.RouteData.From(PubMessages.E0007_WAREHOUSE_NOTFOUND)); } RouteData result = await accessor.RepeatWCSTaskStatus(wcsTaskId); if (!result.IsSccuess) { } return(result); }
public async Task <IActionResult> InventoryBoxList(long storeId, string materialNo) { ViewBag.StoreId = storeId; ViewBag.MaterialNo = materialNo; IWMSOperationApiAccessor accessor = WMSApiManager.GetOperationApiAccessor(storeId.ToString(), _client, this.UserDto); IWMSBaseApiAccessor wmsAccessor = WMSApiManager.GetBaseApiAccessor(storeId.ToString(), _client); RouteData <Wms_reservoirarea[]> reservoirAreaResult = (await wmsAccessor.GetReservoirAreaList(1, 100, null, null, null, null)); ViewData["reservoirAreaList"] = reservoirAreaResult.Data; RouteData <Wms_InventoryBoxMaterialInfo[]> result = await accessor.GetInventoryBoxList(materialNo); Wms_InventoryBoxMaterialInfo last = result.Data.FirstOrDefault(x => x.InventoryBoxStatus == (int)InventoryBoxStatus.InPosition); ViewBag.Data = JsonConvert.SerializeObject(new Wms_InventoryBoxMaterialInfo[] { last }); return(View()); }
public async Task <Wms_StockOutDto[]> NofityList(long storeId) { IWMSOperationApiAccessor wmsAccessor = WMSApiManager.GetOperationApiAccessor(storeId.ToString(), _client, this.UserDto); if (wmsAccessor == null) { return(null); } RouteData <Wms_StockOutDto[]> result = await wmsAccessor.QueryStockOutNofityList(); if (!result.IsSccuess) { return(new Wms_StockOutDto[0]); } return(result.Data); }
public async Task <IActionResult> StepList(long storeId, string stockCountNo) { IWMSOperationApiAccessor operationAccessor = WMSApiManager.GetOperationApiAccessor(storeId.ToString(), _client, this.UserDto); RouteData <OutsideStockCountDto> result = await operationAccessor.BeginStockCount(stockCountNo); if (!result.IsSccuess) { return(Content(result.Message)); } ViewData["currentStoreId"] = storeId; ViewData["stockCountNo"] = stockCountNo; ViewData["stockCountDate"] = result.Data.StockCountDate; return(View(result.Data)); }
public async Task <IActionResult> StockOutBoxBack(long storeId, long inventoryBoxTaskId) { IWMSOperationApiAccessor wmsAccessor = WMSApiManager.GetOperationApiAccessor(storeId.ToString(), _client, this.UserDto); RouteData <Wms_inventoryboxTask> result = await wmsAccessor.GetInventoryBoxkTask(inventoryBoxTaskId); IWMSBaseApiAccessor wmsBaseAccessor = WMSApiManager.GetBaseApiAccessor(storeId.ToString(), _client, this.UserDto); RouteData <Wms_inventorybox> boxResult = await wmsBaseAccessor.GetInventoryBox(result.Data.InventoryBoxId); if (!boxResult.IsSccuess) { return(Json(boxResult.Message)); } ViewData["currentStoreId"] = storeId; ViewData["InventoryBoxTaskId"] = inventoryBoxTaskId; return(View(boxResult.Data)); }
public async Task <string> List([FromForm] PubParams.WcsTaskBootstrapParams bootstrap) { IWMSOperationApiAccessor accessor = WMSApiManager.GetOperationApiAccessor(bootstrap.storeId.ToString(), _client, this.UserDto); if (accessor == null) { return(""); } RouteData <Wms_wcstask[]> result = await accessor.GetWCSTaskList(bootstrap.FailOnly, bootstrap.pageIndex, bootstrap.limit, bootstrap.search, new string[] { bootstrap.sort + " " + bootstrap.order }, bootstrap.datemin, bootstrap.datemax); if (!result.IsSccuess) { return(""); } return(result.ToGridJson()); }
public async Task <RouteData> DoComplate(long storeId, long stockInId) { IWMSOperationApiAccessor wmsAccessor = WMSApiManager.GetOperationApiAccessor(storeId.ToString(), _client, this.UserDto); if (wmsAccessor == null) { return(YL.Core.Dto.RouteData.From(PubMessages.E0007_WAREHOUSE_NOTFOUND)); } return(await wmsAccessor.DoStockInComplate(stockInId)); //try //{ // _client.BeginTran(); // Wms_stockin stockin = _stockinServices.QueryableToEntity(x => x.StockInId == stockInId); // if (stockin == null) { return YL.Core.Dto.RouteData.From(PubMessages.E2013_STOCKIN_NOTFOUND); } // if (stockin.StockInStatus == StockInStatus.task_finish.ToByte()) { return YL.Core.Dto.RouteData.From(PubMessages.E2014_STOCKIN_ALLOW_FINISHED); } // stockin.StockInStatus = StockInStatus.task_finish.ToByte(); // if (!_stockinServices.Update(stockin)) // { // return YL.Core.Dto.RouteData.From(PubMessages.E2017_STOCKIN_FAIL, "入库单详细状态更新失败"); // } // List<Wms_stockindetail> details = _stockindetailServices.QueryableToList(x => x.StockInId == stockin.StockInId); // foreach(Wms_stockindetail detail in details) // { // if (detail.Status == StockInStatus.task_finish.ToByte()) continue; // detail.Status = StockInStatus.task_finish.ToByte(); // detail.ModifiedBy = this.UserDto.UserId; // detail.ModifiedDate = DateTime.Now; // if (!_stockindetailServices.Update(detail)) // { // return YL.Core.Dto.RouteData.From(PubMessages.E2017_STOCKIN_FAIL, "入库单详细状态更新失败"); // } // } // _client.CommitTran(); // return YL.Core.Dto.RouteData.From(PubMessages.I2002_STOCKIN_SCCUESS); //} //catch(Exception ex) //{ // _client.RollbackTran(); // return YL.Core.Dto.RouteData.From(PubMessages.E2017_STOCKIN_FAIL,ex.Message); //} }