1
wangxinhui
2025-06-10 37f4f03c2ca91c82e59dd3f630d767cf137783a5
1
已删除1个文件
已修改11个文件
已添加1个文件
已重命名4个文件
168 ■■■■ 文件已修改
代码管理/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/4b93f505-b509-4621-b97f-51e95ab6ac4d.vsidx 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/84af00d5-ba67-4076-8ddf-2b24626091ba.vsidx 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/TaskInfo/WMSTaskDTO.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/AGV/ZH_AGVController.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/阻焊仓/AGV_ZHExtend.cs 99 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/02143a0b-3339-4244-b940-0fc56a40a2ae.vsidx 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/21808c2d-8810-4e97-8818-89c7d4b1de31.vsidx 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/7703b942-8352-48b9-837e-5dae49444a1f.vsidx 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/aa0693d7-bb1e-44db-ae44-ecadce313164.vsidx 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Common/TaskEnum/TaskTypeEnum.cs 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_DTO/Task/WMSTaskDTO.cs 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_ITaskInfoService/ITaskService.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Completed.cs 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Inbound.cs 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/TaskInfo/TaskController.cs 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/4b93f505-b509-4621-b97f-51e95ab6ac4d.vsidx
Binary files differ
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/84af00d5-ba67-4076-8ddf-2b24626091ba.vsidx
Binary files differ
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/TaskInfo/WMSTaskDTO.cs
@@ -68,5 +68,9 @@
        public string AGVArea { get; set; }
        public int PalletType { get; set; }
        /// <summary>
        /// AGV任务号
        /// </summary>
        public string AGVTaskNum { get; set; }
    }
}
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/AGV/ZH_AGVController.cs
@@ -89,7 +89,7 @@
                if (agvUpdateModel == null) throw new Exception("未获取到请求参数");
                agvResponseContent.ReqCode = agvUpdateModel.ReqCode;
                var task = _taskRepository.QueryFirst(x => agvUpdateModel.TaskCode == x.AgvTaskNum);
                if (task == null) throw new Exception($"未找到任务,任务号【{agvUpdateModel.TaskCode}】");
                if (task == null && agvUpdateModel.Method!= "begin") throw new Exception($"未找到任务,任务号【{agvUpdateModel.TaskCode}】");
                switch (agvUpdateModel.Method)
                {
                    case "begin":
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs
@@ -346,7 +346,10 @@
                        }
                        else
                        {
                            task.AgvTaskNum = item.AGVArea + DateTime.Now.ToString("yyyyMMdd") + item.TaskNum;
                            if (task.Roadway!="SC01_ZH")
                            {
                                task.AgvTaskNum = item.AGVArea + DateTime.Now.ToString("yyyyMMdd") + item.TaskNum;
                            }
                            List<Dt_Router> routers = _routerRepository.QueryData(x => x.InOutType == item.TaskType && item.AGVArea == x.StartPosi);
                            if (routers.FirstOrDefault() == null)
                            {
@@ -358,10 +361,9 @@
                            {
                                return WebResponseContent.Instance.Error($"未找到站台配置信息");
                            }
                            task.NextAddress = stationManger?.AGVStationCode ?? "";
                            task.DeviceCode = stationManger?.Remark ?? "";
                            task.TaskState = TaskStatusEnum.AGV_Execute.ObjToInt();
                            task.TaskState = TaskStatusEnum.AGV_Executing.ObjToInt();
                        }
                    }
@@ -455,9 +457,14 @@
                    WMSTaskDTO? taskDTO = JsonConvert.DeserializeObject<WMSTaskDTO>(responseContent.Data.ToString());
                    if (taskDTO != null)
                    {
                        taskDTO.AGVTaskNum = agvTaskCode;
                        content = ReceiveWMSTask(new List<WMSTaskDTO> { taskDTO });
                    }
                }
                else
                {
                    content.Error(responseContent.Message);
                }
            }
            catch (Exception ex)
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/×躸²Ö/AGV_ZHExtend.cs
@@ -9,6 +9,7 @@
using WIDESEAWCS_Core;
using WIDESEAWCS_Core.Helper;
using WIDESEAWCS_Model.Models;
using WIDESEAWCS_QuartzJob;
using WIDESEAWCS_Tasks.StackerCraneJob;
namespace WIDESEAWCS_Tasks
@@ -19,7 +20,7 @@
        {
            try
            {
                var newTasks = _taskService.Db.Queryable<Dt_Task>().Where(x => (x.TaskState == TaskStatusEnum.New.ObjToInt() || x.TaskState == TaskStatusEnum.AGV_Execute.ObjToInt()) && nameof(AGV_PPJob).Contains(x.DeviceCode) && !string.IsNullOrEmpty(x.DeviceCode)).ToList().OrderBy(x => x.Grade).ThenBy(x => x.CreateDate).ToList();
                var newTasks = _taskService.Db.Queryable<Dt_Task>().Where(x => (x.TaskState == TaskStatusEnum.AGV_Execute.ObjToInt()) && nameof(AGV_PPJob).Contains(x.DeviceCode) && !string.IsNullOrEmpty(x.DeviceCode)).ToList().OrderBy(x => x.Grade).ThenBy(x => x.CreateDate).ToList();
                foreach (var task in newTasks)
                {
                    try
@@ -61,5 +62,101 @@
                WriteError(nameof(AGV_FLJob), ex.Message, ex);
            }
        }
        /// <summary>
        /// ä¸‹å‘AGV继续执行任务
        /// </summary>
        public void SendAGVWaitToTask()
        {
            try
            {
                var WaitToTasks = _taskService.Db.Queryable<Dt_Task>().Where(x => x.TaskState == TaskStatusEnum.AGV_WaitToExecute.ObjToInt() && nameof(AGV_CSJJob).Contains(x.DeviceCode)).ToList().OrderBy(x => x.Grade).ThenBy(x => x.CreateDate).ToList();
                foreach (var WaitToTask in WaitToTasks)
                {
                    if (WaitToTask.TaskType.GetTaskTypeGroup() == TaskTypeGroup.InboundGroup)
                    {
                        if (WaitToTasks.FirstOrDefault(x => x.TaskState == TaskStatusEnum.AGV_Puting.ObjToInt() || x.TaskState == TaskStatusEnum.Finish.ObjToInt()) != null)
                        {
                            continue;
                        }
                        Dt_StationManger stationManger = _stationMangerRepository.QueryFirst(x => x.AGVStationCode == WaitToTask.NextAddress);
                        if (stationManger == null)
                        {
                            continue;
                        }
                        IDevice? device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == stationManger.StationDeviceCode);
                        if (device == null)
                        {
                            continue;
                        }
                        OtherDevice otherDevice = (OtherDevice)device;
                        bool canPut = otherDevice.GetValue<GroundStationDBName, bool>(GroundStationDBName.R_IsCanPut, stationManger.StationCode);
                        bool requestPut = otherDevice.GetValue<GroundStationDBName, bool>(GroundStationDBName.W_PutRequest, stationManger.StationCode);
                        if (!requestPut)
                        {
                            otherDevice.SetValue(GroundStationDBName.W_PutRequest, true, stationManger.StationCode);
                            continue;
                        }
                        else if (!canPut)
                        {
                            continue;
                        }
                    }
                    else
                    {
                        Dt_StationManger stationManger = _stationMangerRepository.QueryFirst(x => x.AGVStationCode == WaitToTask.CurrentAddress);
                        if (stationManger == null)
                        {
                            continue;
                        }
                        IDevice? device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == stationManger.StationDeviceCode);
                        if (device == null)
                        {
                            continue;
                        }
                        OtherDevice otherDevice = (OtherDevice)device;
                        bool canTake = otherDevice.GetValue<GroundStationDBName, bool>(GroundStationDBName.R_IsCanTake, stationManger.StationCode);
                        bool requestTake = otherDevice.GetValue<GroundStationDBName, bool>(GroundStationDBName.W_TakeRequest, stationManger.StationCode);
                        if (!requestTake)
                        {
                            otherDevice.SetValue(GroundStationDBName.W_TakeRequest, true, stationManger.StationCode);
                            continue;
                        }
                        else if (!canTake)
                        {
                            continue;
                        }
                    }
                    AgvSecureReplyDTO replyDTO = new AgvSecureReplyDTO()
                    {
                        ReqCode = Guid.NewGuid().ToString().Replace("-", ""), //WaitToTask.TaskNum.ToString(),
                        taskCode = WaitToTask.AgvTaskNum,
                    };
                    WebResponseContent content = _taskService.AgvSecureReply(replyDTO);
                    if (content.Status && WaitToTask.TaskType.GetTaskTypeGroup() == TaskTypeGroup.InboundGroup)
                    {
                        WaitToTask.TaskState = TaskStatusEnum.AGV_Puting.ObjToInt();
                        _taskService.UpdateTask(WaitToTask, TaskStatusEnum.AGV_Puting);
                        break;
                    }
                    else if (content.Status && WaitToTask.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup)
                    {
                        WaitToTask.TaskState = TaskStatusEnum.AGV_Executing.ObjToInt();
                        _taskService.UpdateTask(WaitToTask, TaskStatusEnum.AGV_Executing);
                    }
                    else
                    {
                        WaitToTask.TaskState = TaskStatusEnum.Exception.ObjToInt();
                        WaitToTask.ExceptionMessage = content.Message;
                        _taskService.UpdateTask(WaitToTask, TaskStatusEnum.Exception);
                    }
                }
                _taskService.UpdateData(WaitToTasks);
            }
            catch (Exception ex)
            {
                Console.Out.WriteLine(nameof(AGV_CSJJob) + ":" + ex.Message);
            }
        }
    }
}
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/02143a0b-3339-4244-b940-0fc56a40a2ae.vsidx
Binary files differ
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/21808c2d-8810-4e97-8818-89c7d4b1de31.vsidx
Binary files differ
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/7703b942-8352-48b9-837e-5dae49444a1f.vsidx
Binary files differ
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/aa0693d7-bb1e-44db-ae44-ecadce313164.vsidx
Binary files differ
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_Common/TaskEnum/TaskTypeEnum.cs
@@ -148,10 +148,15 @@
        [Description("成品空框回库")]
        EmptyProductBack = 630,
        /// <summary>
        /// é˜»ç„Šå…¥åº“
        /// é˜»ç„Šå…¥åº“小件
        /// </summary>
        [Description("阻焊入库")]
        InZHProduct = 640,
        [Description("阻焊入库小件")]
        InZHProductSmall = 640,
        /// <summary>
        /// é˜»ç„Šå…¥åº“大件
        /// </summary>
        [Description("阻焊入库大件")]
        InZHProductLarge = 645,
        /// <summary>
        /// å··é“内移库
        /// </summary>
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_DTO/Task/WMSTaskDTO.cs
@@ -80,6 +80,9 @@
        /// 
        /// </summary>
        public int PalletType { get; set; }
        /// <summary>
        /// AGV任务号
        /// </summary>
        public string AGVTaskNum { get; set; }
    }
}
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_ITaskInfoService/ITaskService.cs
@@ -47,7 +47,7 @@
        /// <param name="tasks"></param>
        /// <param name="agvDescription"></param>
        /// <returns></returns>
        WebResponseContent PushTasksToWCS(List<Dt_Task> tasks, string agvDescription = "");
        WebResponseContent PushTasksToWCS(List<Dt_Task> tasks, string agvDescription = "", string agvtaskNum = "");
        /// <summary>
        /// 
@@ -55,7 +55,7 @@
        /// <param name="taskNum"></param>
        /// <param name="agvDescription"></param>
        /// <returns></returns>
        WebResponseContent PushTasksToWCSSingle(int taskNum, string agvDescription = "");
        WebResponseContent PushTasksToWCSSingle(int taskNum, string agvDescription = "", string agvtaskNum = "");
        /// <summary>
        /// ç”³è¯·å…¥åº“任务(PDA使用,仅托盘绑定入库站台,不分配货位)
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs
@@ -112,7 +112,7 @@
        /// ä»»åŠ¡ä¿¡æ¯æŽ¨é€è‡³WCS
        /// </summary>
        /// <returns></returns>
        public WebResponseContent PushTasksToWCS(List<Dt_Task> tasks, string agvDescription = "")
        public WebResponseContent PushTasksToWCS(List<Dt_Task> tasks, string agvDescription = "",string agvtaskNum="")
        {
            try
            {
@@ -120,6 +120,7 @@
                taskDTOs.ForEach(x =>
                {
                    x.AGVArea = agvDescription;
                    x.AGVTaskNum = agvtaskNum;
                });
                string url = AppSettings.Get("WCS");
                if (string.IsNullOrEmpty(url))
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Completed.cs
@@ -55,7 +55,7 @@
        /// ä»»åŠ¡ä¿¡æ¯æŽ¨é€è‡³WCS
        /// </summary>
        /// <returns></returns>
        public WebResponseContent PushTasksToWCSSingle(int taskNum, string agvDescription = "")
        public WebResponseContent PushTasksToWCSSingle(int taskNum, string agvDescription = "", string agvtaskNum = "")
        {
            try
            {
@@ -69,6 +69,7 @@
                taskDTOs.ForEach(x =>
                {
                    x.AGVArea = agvDescription;
                    x.AGVTaskNum = agvtaskNum;
                });
                string url = AppSettings.Get("WCS");
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Inbound.cs
@@ -1,4 +1,5 @@
using Newtonsoft.Json;
using OfficeOpenXml.FormulaParsing.Excel.Functions.Math;
using OfficeOpenXml.FormulaParsing.Excel.Functions.RefAndLookup;
using System;
using System.Collections;
@@ -749,14 +750,18 @@
                Dt_Warehouse warehouse = _basicRepository.WarehouseRepository.QueryFirst(x => x.WarehouseCode == WarehouseEnum.HA154.ToString());
                //获取库存记录
                List<Dt_StockInfo> stockInfos = _stockRepository.StockInfoRepository.Db.Queryable<Dt_StockInfo>().Where(x =>
                  x.WarehouseId == warehouse.WarehouseId).Includes(x => x.Details).ToList();
                  x.WarehouseId == warehouse.WarehouseId && x.PalletCode== palletCode).Includes(x => x.Details).ToList();
                if (stockInfos.Count > 0)
                {
                    return content.Error($"载具托盘已存在");
                }
                Dt_StockInfo? stockInfoOld = stockInfos.FirstOrDefault(x => x.Details.Any(x => x.BatchNo == materialLot));
                if (stockInfoOld != null)
                {
                    return content.Error($"库存信息已存在");
                }
                Dt_PalletTypeInfo palletTypeInfo = _palletTypeInfoRepository.QueryFirst(x=>x.CodeStartStr== palletType);
                if (palletTypeInfo != null)
                if (palletTypeInfo == null)
                {
                    return content.Error($"托盘类型信息不存在");
                }
@@ -764,7 +769,7 @@
                WebResponseContent requestLotInfo = GetZHMesMaterialLot(materialLot);
                if (!requestLotInfo.Status)
                {
                    return content.Error($"{requestLotInfo.Message}");
                    return content.Error($"请求阻焊批次信息失败,{requestLotInfo.Message}");
                }
                MesLotInfoModel mesLotInfo = JsonConvert.DeserializeObject<MesLotInfoModel>(requestLotInfo.Data.ToString());
                Dt_StockInfoDetail stockInfoDetail = new Dt_StockInfoDetail()
@@ -800,14 +805,14 @@
                    Grade = 0,
                    PalletCode = palletCode,
                    NextAddress = "",
                    Roadway = "",
                    Roadway = "SC01_ZH",
                    SourceAddress = "AGV_ZH",
                    TargetAddress = "",
                    TaskStatus = (int)TaskStatusEnum.New,
                    TaskType = (int)TaskTypeEnum.InZHProduct,
                    TaskType = (int)TaskTypeEnum.InZHProductSmall,
                    TaskNum = BaseDal.GetTaskNum(nameof(SequenceEnum.SeqTaskNum)),
                    PalletType = palletTypeInfo.PalletType,
                    WarehouseId = warehouse.WarehouseId,
                    WarehouseId = warehouse.WarehouseId
                };
                _unitOfWorkManage.BeginTran();
                Db.InsertNav(stockInfo).Include(x => x.Details).ExecuteCommand();
@@ -816,7 +821,7 @@
                _unitOfWorkManage.CommitTran();
                //将任务推送到WCS
                PushTasksToWCS(new List<Dt_Task>() { taskIn }, "AGV_ZH"); ;
                content.OK();
                content.OK(data: taskIn);
            }
            catch (Exception ex)
            {
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/TaskInfo/TaskController.cs
@@ -130,6 +130,7 @@
        {
            return Service.AssignInboundTaskLocationByHeight(taskNum, roadwayNo, heightType);
        }
        [HttpPost, HttpGet, Route("RequestZHInboundTask"), AllowAnonymous]
        public WebResponseContent RequestZHInboundTask(string agvTaskCode, string palletCode, string palletType, string materialLot)
        {
            return Service.RequestZHInboundTask(agvTaskCode,palletCode,palletType,materialLot);
@@ -270,9 +271,9 @@
        /// <param name="agvDescription"></param>
        /// <returns></returns>
        [HttpPost, HttpGet, Route("PushTasksToWCSSingle"), AllowAnonymous]
        public WebResponseContent PushTasksToWCSSingle(int taskNum, string agvDescription = "")
        public WebResponseContent PushTasksToWCSSingle(int taskNum, string agvDescription = "", string agvtaskNum = "")
        {
            return Service.PushTasksToWCSSingle(taskNum, agvDescription);
            return Service.PushTasksToWCSSingle(taskNum, agvDescription, agvtaskNum);
        }
        /// <summary>
        /// é€‰æ‹©åº“存生成出库任务