| | |
| | | using Elastic.Clients.Elasticsearch; |
| | | using DocumentFormat.OpenXml.EMMA; |
| | | using Elastic.Clients.Elasticsearch; |
| | | using Furion.Logging; |
| | | using Furion.RemoteRequest.Extensions; |
| | | using Newtonsoft.Json; |
| | | using System.Text; |
| | | using WCS.Application.Entity; |
| | | using static SKIT.FlurlHttpClient.Wechat.Api.Models.ComponentTCBBatchCreateContainerServiceVersionResponse.Types; |
| | | |
| | | namespace WCS.Application; |
| | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 调用WMS接口自动码垛绑定信息返回巷道口 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public string BindRequestRoadWay(string orderNo, string palletNo,decimal qty ,string type,string skuNo, string lotNo, string lotText, string supplierLot, List<WcsBoxInfo> detail, |
| | | string startLocat, string taskModel, string ceng, ref string endLocat, ref string taskNo) |
| | | { |
| | | string returnStr = ""; |
| | | |
| | | var task = _db.Queryable<WcsTask>().First(m => m.IsDelete == false && (m.Status == TaskStatusEnum.Wait || m.Status == TaskStatusEnum.Doing) && m.TaskType == TaskTypeEnum.In && m.PalletNo == palletNo); |
| | | if (task == null) |
| | | { |
| | | var model = new BoxPalletBindVm() |
| | | { |
| | | OrderCode= orderNo, |
| | | AsnNo= orderNo, |
| | | AsnDetailNo=0, |
| | | PalletNo=palletNo, |
| | | Qty= qty, |
| | | Type=type, |
| | | SkuNo=skuNo, |
| | | LotNo= lotNo, |
| | | LotText= lotText, |
| | | SupplierLot= supplierLot, |
| | | Detail=detail |
| | | }; |
| | | string url = Urls.WMSAddress + ":" + Urls.WMSPort; |
| | | var result = (url + "/api/DownAPi/BindRequestRoadWay").SetBody(model, "application/json", Encoding.UTF8).PostAsAsync<ResponseTasks>().Result; |
| | | Log.Information("调用WMS接口反馈任务接口" + result.ToJson()); |
| | | if (result.Success == 0) |
| | | { |
| | | var taskAdd = new WcsTask() |
| | | { |
| | | TaskType = TaskTypeEnum.In, |
| | | Status = TaskStatusEnum.Wait, |
| | | Origin = "WMS", |
| | | StartLocate = startLocat, |
| | | PalletNo = palletNo, |
| | | TaskNo = result.TaskList.TaskNo, |
| | | EndLocate = result.TaskList.EndLocate, |
| | | EndRoadway = result.TaskList.EndRoadway |
| | | }; |
| | | |
| | | _db.Insertable(taskAdd).ExecuteCommand(); |
| | | endLocat = result.TaskList.EndRoadway; |
| | | returnStr = result.TaskList.EndLocate; |
| | | } |
| | | else |
| | | { |
| | | returnStr = "-1:" + result.Message; |
| | | return returnStr; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | returnStr = task.EndLocate; |
| | | endLocat = task.EndRoadway; |
| | | taskNo = task.TaskNo; |
| | | } |
| | | |
| | | endLocat = PLCCommon.RoadwayToStationNum(endLocat, ceng); |
| | | |
| | | return returnStr; |
| | | } |
| | | /// <summary> |
| | | /// 调用WMS接口申请储位接口 |
| | | /// </summary> |
| | | /// <param name="palletNo"></param> |