13a442afefdddf1ec9ecd1e22c81735bf5c6a465..f21906b6464a0e6b42aade6f70127f7b8d6611f3
2025-06-11 chengsc
修改任务模板问题
f21906 对比 | 目录
2025-06-11 chengsc
添加叠托机业务
413194 对比 | 目录
6个文件已修改
169 ■■■■■ 已修改文件
Admin.NET/WCS.Application/Model/AGVModel.cs 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Admin.NET/WCS.Application/Model/TaskRequest.cs 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Admin.NET/WCS.Application/OpenApi/OpenApi.cs 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Admin.NET/WCS.Application/PLC/PLCService.cs 41 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Admin.NET/WCS.Application/Util/AGVStorageUtil.cs 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Admin.NET/WCS.Application/Util/HttpService.cs 56 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Admin.NET/WCS.Application/Model/AGVModel.cs
@@ -77,7 +77,7 @@
        /// DELIVERY送货
        /// ROTATE旋转
        /// </summary>
        public string code { get; set; }
        public object code { get; set; }
    }
    public class extra
    {
@@ -185,6 +185,15 @@
        /// 方法名 end : 任务结束
        /// </summary>
        public string Method { get; set; }
        /// <summary>
        /// 托盘号
        /// </summary>
        public string carrierCode { get; set; }
        /// <summary>
        /// 托盘数量
        /// </summary>
        public int pileCount { get; set; }
    }
    public class AGVCallBackResponse
    {
Admin.NET/WCS.Application/Model/TaskRequest.cs
@@ -2,6 +2,27 @@
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; }                          // 任务号
@@ -107,6 +128,11 @@
    /// </summary>
    public string LotNo { get; set; }
    /// <summary>
    /// 数量
    /// </summary>
    public int? Qty { get; set; }
}
/// <summary>
Admin.NET/WCS.Application/OpenApi/OpenApi.cs
@@ -3,6 +3,7 @@
using Furion.Logging;
using WCS.Application.Entity;
using WCS.Application.Util;
using static SKIT.FlurlHttpClient.Wechat.Api.Models.ComponentTCBBatchCreateContainerServiceVersionRequest.Types;
namespace WCS.Application;
@@ -428,7 +429,11 @@
            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
        {
@@ -532,6 +537,26 @@
                            }
                        }
                        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;
Admin.NET/WCS.Application/PLC/PLCService.cs
@@ -9,6 +9,7 @@
using Furion.Logging;
using IoTClient;
using NewLife.Reflection;
using Org.BouncyCastle.Ocsp;
using SixLabors.ImageSharp.ColorSpaces;
using WCS.Application.Entity;
using WCS.Application.Util;
@@ -1424,11 +1425,28 @@
        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
        {
@@ -1439,14 +1457,19 @@
                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")
        {
Admin.NET/WCS.Application/Util/AGVStorageUtil.cs
@@ -99,11 +99,16 @@
            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":
@@ -124,7 +129,10 @@
                    {
                        taskModle = "YCLSX2";
                    }
                    else if (locate2.AreaNo == "B10")
                    {
                        taskModle = "PF-FMR-STACK-NOTIFY-TASK";
                    }
                }
                break;
            default:
Admin.NET/WCS.Application/Util/HttpService.cs
@@ -37,6 +37,62 @@
        };
    }
    /// <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接口申请巷道接口