From 37f4f03c2ca91c82e59dd3f630d767cf137783a5 Mon Sep 17 00:00:00 2001 From: wangxinhui <wangxinhui@hnkhzn.com> Date: 星期二, 10 六月 2025 19:32:37 +0800 Subject: [PATCH] 1 --- 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/AGV/ZH_AGVController.cs | 2 代码管理/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/aa0693d7-bb1e-44db-ae44-ecadce313164.vsidx | 0 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_DTO/Task/WMSTaskDTO.cs | 5 + 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Common/TaskEnum/TaskTypeEnum.cs | 11 ++- 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs | 3 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/阻焊仓/AGV_ZHExtend.cs | 99 ++++++++++++++++++++++++++++++++ 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/TaskInfo/TaskController.cs | 5 + 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Inbound.cs | 19 ++++-- /dev/null | 0 代码管理/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/02143a0b-3339-4244-b940-0fc56a40a2ae.vsidx | 0 代码管理/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/21808c2d-8810-4e97-8818-89c7d4b1de31.vsidx | 0 代码管理/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/7703b942-8352-48b9-837e-5dae49444a1f.vsidx | 0 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/TaskInfo/WMSTaskDTO.cs | 4 + 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_ITaskInfoService/ITaskService.cs | 4 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs | 13 +++- 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Completed.cs | 3 代码管理/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/4b93f505-b509-4621-b97f-51e95ab6ac4d.vsidx | 0 17 files changed, 146 insertions(+), 22 deletions(-) diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/4b93f505-b509-4621-b97f-51e95ab6ac4d.vsidx" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/4b93f505-b509-4621-b97f-51e95ab6ac4d.vsidx" new file mode 100644 index 0000000..f739885 --- /dev/null +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/4b93f505-b509-4621-b97f-51e95ab6ac4d.vsidx" Binary files differ diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/84af00d5-ba67-4076-8ddf-2b24626091ba.vsidx" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/84af00d5-ba67-4076-8ddf-2b24626091ba.vsidx" deleted file mode 100644 index c44bf32..0000000 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/84af00d5-ba67-4076-8ddf-2b24626091ba.vsidx" +++ /dev/null Binary files differ diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/TaskInfo/WMSTaskDTO.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/TaskInfo/WMSTaskDTO.cs" index b6cb732..b0969d4 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/TaskInfo/WMSTaskDTO.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/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; } } } diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/AGV/ZH_AGVController.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/AGV/ZH_AGVController.cs" index 67617af..a6c4982 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/AGV/ZH_AGVController.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/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": diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs" index 9af1fe7..085cbdb 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/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) diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\351\230\273\347\204\212\344\273\223/AGV_ZHExtend.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\351\230\273\347\204\212\344\273\223/AGV_ZHExtend.cs" index 83d05a6..066b355 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\351\230\273\347\204\212\344\273\223/AGV_ZHExtend.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\351\230\273\347\204\212\344\273\223/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); + } + } } } diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/67049f81-98c9-4b14-ac45-8781b4667d93.vsidx" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/02143a0b-3339-4244-b940-0fc56a40a2ae.vsidx" similarity index 100% rename from "\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/67049f81-98c9-4b14-ac45-8781b4667d93.vsidx" rename to "\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/02143a0b-3339-4244-b940-0fc56a40a2ae.vsidx" Binary files differ diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/fe5a1663-e219-46ba-811e-e4993b5c3069.vsidx" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/21808c2d-8810-4e97-8818-89c7d4b1de31.vsidx" similarity index 62% rename from "\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/fe5a1663-e219-46ba-811e-e4993b5c3069.vsidx" rename to "\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/21808c2d-8810-4e97-8818-89c7d4b1de31.vsidx" index a0cfaf6..5432b9d 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/fe5a1663-e219-46ba-811e-e4993b5c3069.vsidx" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/21808c2d-8810-4e97-8818-89c7d4b1de31.vsidx" Binary files differ diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/3e16d87e-9dfc-4339-acea-a3e8fc3006cc.vsidx" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/7703b942-8352-48b9-837e-5dae49444a1f.vsidx" similarity index 100% rename from "\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/3e16d87e-9dfc-4339-acea-a3e8fc3006cc.vsidx" rename to "\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/7703b942-8352-48b9-837e-5dae49444a1f.vsidx" Binary files differ diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/89e89d9b-deaa-4861-a50e-511b40507585.vsidx" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/aa0693d7-bb1e-44db-ae44-ecadce313164.vsidx" similarity index 63% rename from "\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/89e89d9b-deaa-4861-a50e-511b40507585.vsidx" rename to "\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/aa0693d7-bb1e-44db-ae44-ecadce313164.vsidx" index e40ceb0..05d0eb4 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/89e89d9b-deaa-4861-a50e-511b40507585.vsidx" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/aa0693d7-bb1e-44db-ae44-ecadce313164.vsidx" Binary files differ diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Common/TaskEnum/TaskTypeEnum.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Common/TaskEnum/TaskTypeEnum.cs" index 1191fdb..2c24ff6 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Common/TaskEnum/TaskTypeEnum.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/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> diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_DTO/Task/WMSTaskDTO.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_DTO/Task/WMSTaskDTO.cs" index be404a5..2ac80f9 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_DTO/Task/WMSTaskDTO.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/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; } } } diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_ITaskInfoService/ITaskService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_ITaskInfoService/ITaskService.cs" index c14fa72..4211122 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_ITaskInfoService/ITaskService.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/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浣跨敤锛屼粎鎵樼洏缁戝畾鍏ュ簱绔欏彴锛屼笉鍒嗛厤璐т綅) diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs" index 908cc94..23bc63c 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/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)) diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Completed.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Completed.cs" index 7c452cc..a57f13c 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Completed.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/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"); diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Inbound.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Inbound.cs" index ac7efdb..ba680b1 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Inbound.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Inbound.cs" @@ -1,4 +1,5 @@ 锘縰sing 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) { diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/TaskInfo/TaskController.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/TaskInfo/TaskController.cs" index fe6c647..f828daa 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/TaskInfo/TaskController.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/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> /// 閫夋嫨搴撳瓨鐢熸垚鍑哄簱浠诲姟 -- Gitblit v1.9.3