| | |
| | | /// DELIVERY送货 |
| | | /// ROTATE旋转 |
| | | /// </summary> |
| | | public string code { get; set; } |
| | | public object code { get; set; } |
| | | } |
| | | public class extra |
| | | { |
| | |
| | | /// 方法名 end : 任务结束 |
| | | /// </summary> |
| | | public string Method { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 托盘号 |
| | | /// </summary> |
| | | public string carrierCode { get; set; } |
| | | /// <summary> |
| | | /// 托盘数量 |
| | | /// </summary> |
| | | public int pileCount { get; set; } |
| | | } |
| | | public class AGVCallBackResponse |
| | | { |
| | |
| | | using WCS.Application.Entity; |
| | | |
| | | namespace WCS.Application; |
| | | |
| | | /// <summary> |
| | | /// 空托跺入库申请 |
| | | /// </summary> |
| | | public class NullPallInRequest |
| | | { |
| | | |
| | | public string PalletNo { get; set; } |
| | | /// <summary> |
| | | /// 托盘数量 |
| | | /// </summary> |
| | | public int PallNum { get; set; } |
| | | /// <summary> |
| | | /// 储位 |
| | | /// </summary> |
| | | public string Locate { get; set; } |
| | | |
| | | public string HouseNo { get; set; } |
| | | |
| | | } |
| | | |
| | | public class TaskRequest |
| | | { |
| | | public string TaskNo { get; set; } // 任务号 |
| | |
| | | /// </summary> |
| | | public string LotNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 数量 |
| | | /// </summary> |
| | | public int? Qty { get; set; } |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | using Furion.Logging; |
| | | using WCS.Application.Entity; |
| | | using WCS.Application.Util; |
| | | using static SKIT.FlurlHttpClient.Wechat.Api.Models.ComponentTCBBatchCreateContainerServiceVersionRequest.Types; |
| | | |
| | | namespace WCS.Application; |
| | | |
| | |
| | | Code = "0" |
| | | }; |
| | | if (input.robotTaskCode.Substring(0, 3) != "WCS" && input.robotTaskCode.Substring(0, 2) != "TK") |
| | | { |
| | | result.Message = "反馈的任务不是WCS的任务"; |
| | | result.Code = "1"; |
| | | return result; |
| | | } |
| | | PLCUtil modUtil = null; |
| | | try |
| | | { |
| | |
| | | } |
| | | } |
| | | break; |
| | | case "notifyFullSite": |
| | | { |
| | | var palletNo = input.Extra.Values.carrierCode; |
| | | var count = input.Extra.Values.pileCount; |
| | | if (string.IsNullOrWhiteSpace(palletNo) || count <= 0) |
| | | { |
| | | throw new Exception("参数:托盘号/数量验证失败"); |
| | | } |
| | | //向WMS申请空托入库 |
| | | HttpService httpService = new HttpService(); |
| | | var inputs = new NullPallInRequest(); |
| | | |
| | | inputs.PalletNo = modTask.PalletNo; |
| | | inputs.PallNum = count; |
| | | inputs.Locate = "B100101";//叠托盘机位置 |
| | | inputs.HouseNo = "W02"; |
| | | var modResponseTask = httpService.RequestLiKuPallet(inputs); |
| | | |
| | | } |
| | | break; |
| | | case "cancel"://任务取消 |
| | | { |
| | | PLCService.AGVStatus = false; |
| | |
| | | using Furion.Logging; |
| | | using IoTClient; |
| | | using NewLife.Reflection; |
| | | using Org.BouncyCastle.Ocsp; |
| | | using SixLabors.ImageSharp.ColorSpaces; |
| | | using WCS.Application.Entity; |
| | | using WCS.Application.Util; |
| | |
| | | taskModel.taskType = taskTypeModel; |
| | | if (jiebo == "") |
| | | { |
| | | taskModel.targetRoute = new List<targetRoute>() |
| | | |
| | | taskModel.targetRoute = new List<targetRoute>(); |
| | | |
| | | if (taskModel.taskType == "DPJRK") |
| | | { |
| | | new targetRoute(){seq = 0,type = type1,code = modTask.StartLocate}, |
| | | new targetRoute(){seq = 1,type = type2,code = modTask.EndLocate} |
| | | }; |
| | | taskModel.targetRoute.Add(new targetRoute() { |
| | | seq = 0, |
| | | type = "MIX_CONDITION", |
| | | code = new List<object>() { |
| | | new { type = "SITE", code = modTask.StartLocate }, |
| | | new { type = "PILE_COUNT", code = modTask.Qty } |
| | | } |
| | | |
| | | }); |
| | | taskModel.targetRoute.Add(new targetRoute() { seq = 1, type = type2, code = modTask.EndLocate }); |
| | | } |
| | | else |
| | | { |
| | | taskModel.targetRoute.Add(new targetRoute() { seq = 0, type = type1, code = modTask.StartLocate }); |
| | | taskModel.targetRoute.Add(new targetRoute() { seq = 1, type = type2, code = modTask.EndLocate }); |
| | | } |
| | | |
| | | } |
| | | else |
| | | { |
| | |
| | | new targetRoute(){seq = 2,type = type2,code = modTask.EndLocate} |
| | | }; |
| | | } |
| | | |
| | | taskModel.extra = new extra() |
| | | |
| | | taskModel.extra = new extra(); |
| | | |
| | | if (taskModel.taskType != "DPJRK") |
| | | { |
| | | carrierInfo = new List<carrierInfo>() |
| | | taskModel.extra.carrierInfo = new List<carrierInfo>() |
| | | { |
| | | new carrierInfo(){ carrierType = "TP",carrierCode = modTask.PalletNo} |
| | | } |
| | | }; |
| | | }; |
| | | } |
| | | |
| | | |
| | | |
| | | var response = new HttpService().GenAgvSendTask(taskModel).Result; |
| | | if (response.code == "SUCCESS") |
| | | { |
| | |
| | | case "STORAGE" when type2 == "SITE": |
| | | { |
| | | taskModle = "FJ"; |
| | | if (locate1.AreaNo == "B10") |
| | | { |
| | | taskModle = "DPJRK"; |
| | | } |
| | | } |
| | | break; |
| | | case "SITE" when type2 == "STORAGE": |
| | | { |
| | | taskModle = "YCRK"; |
| | | |
| | | } |
| | | break; |
| | | case "SITE" when type2 == "SITE": |
| | |
| | | { |
| | | taskModle = "YCLSX2"; |
| | | } |
| | | |
| | | else if (locate2.AreaNo == "B10") |
| | | { |
| | | taskModle = "PF-FMR-STACK-NOTIFY-TASK"; |
| | | } |
| | | } |
| | | break; |
| | | default: |
| | |
| | | }; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 调用WMS接口申请叠托机空托入库接口 |
| | | /// </summary> |
| | | /// <param name="model"></param> |
| | | /// <returns></returns> |
| | | public string RequestLiKuPallet(NullPallInRequest model) |
| | | { |
| | | 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 == model.PalletNo); |
| | | |
| | | if (task == null) |
| | | { |
| | | string url = Urls.WMSAddress + ":" + Urls.WMSPort; |
| | | var result = (url + "/api/DownAPi/RequestPalletIn").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, |
| | | Type = PLCTypeEnum.ConveyorLine, |
| | | Origin = "WMS", |
| | | |
| | | Qty = result.TaskList.Qty, |
| | | PalletNo = model.PalletNo, |
| | | TaskNo = result.TaskList.TaskNo, |
| | | Levels = 999, |
| | | |
| | | StartLocate = model.Locate, |
| | | StartRoadway = result.TaskList.StartRoadway, |
| | | EndLocate = result.TaskList.EndLocate, |
| | | EndRoadway = result.TaskList.EndRoadway, |
| | | TaskId = FourWayCarUtil.GetTaskId() |
| | | }; |
| | | |
| | | _db.Insertable(taskAdd).ExecuteCommand(); |
| | | |
| | | returnStr = result.TaskList.EndLocate; |
| | | |
| | | } |
| | | else |
| | | { |
| | | returnStr = "-1:" + result.Message; |
| | | return returnStr; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | returnStr = task.EndLocate; |
| | | } |
| | | |
| | | return returnStr; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 调用WMS接口申请巷道接口 |