From 96e6dc957aee5d20218ac8127a28db6a7e6ba6de Mon Sep 17 00:00:00 2001 From: dengjunjie <dengjunjie@hnkhzn.com> Date: 星期五, 10 一月 2025 10:00:52 +0800 Subject: [PATCH] 1 --- 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/板材仓/ConveyorLineJob_BC_Old.cs | 295 ++++++++++++ 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/测试架仓/GroundStationJob_CSJ.cs | 36 - 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_ITaskInfoService/ITaskService.cs | 20 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/AssignLocation/LocationInfoService_CSJ.cs | 55 + 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Program.cs | 2 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/MesTaskService.cs | 4 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/油墨仓/StackerCraneJob_YM.cs | 24 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Inbound.cs | 2 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/AssignLocation/LocationInfoService_GM.cs | 19 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Inbound/InboundOrderController.cs | 18 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/AssignLocation/LocationInfoService_BC.cs | 61 +- 代码管理/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/f8288fd8-10a9-42d7-ac09-8c962aedebb7.vsidx | 0 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/油墨仓/CommonHoisterJob.cs | 16 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/ConveyorLineTaskCommand.cs | 9 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_ITaskInfoService/ITaskService.cs | 2 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs | 42 + 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/AssignInboundTaskLocation_BC.cs | 58 ++ 代码管理/WMS/WIDESEA_WMSClient/src/views/basic/materielInfo.vue | 5 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_StockRepository/StockInfoRepository.cs | 2 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/R_ConveyorLineDBName.cs | 4 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/WIDESEAWCS_Tasks.csproj | 2 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/LocationInfoService_Common.cs | 69 +- 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_InboundService/InboundOrderService.cs | 3 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/AssignLocation/LocationInfoService_ZH.cs | 19 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_InboundService/ReceiveOrderService.cs | 2 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/干膜仓/ConveyorLineJob_GM.cs | 41 - 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs | 2 代码管理/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/fe4c888c-4628-47ca-995c-f8221d13ee48.vsidx | 0 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/ERP/ErpController.cs | 11 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/TaskInfo/TaskController.cs | 12 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/AssignLocation/LocationInfoService_PP.cs | 19 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_InboundService/ReceiveOrderDetailService.cs | 4 /dev/null | 0 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/干膜仓/StackerCraneJob_GM.cs | 7 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/板材仓/ConveyorLineJob_BC.cs | 184 ++----- 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/板材仓/StackerCraneJob_BC.cs | 42 - 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/TaskEnum/TaskTypeEnum.cs | 5 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_BasicInfoService/WIDESEAWCS_BasicInfoService.csproj | 2 代码管理/WMS/WIDESEA_WMSClient/src/views/inbound/purchaseOrder.vue | 9 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/appsettings.json | 1 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/测试架仓/StackerCraneJob_CSJ.cs | 36 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_DTO/MES/TestToolModel.cs | 8 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService_Operate.cs | 87 +++ 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/板材仓/RGVJob_BC.cs | 184 +++++++ 44 files changed, 1,051 insertions(+), 372 deletions(-) diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/74867a10-626f-4e30-a018-f262a1dd62c2.vsidx" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/74867a10-626f-4e30-a018-f262a1dd62c2.vsidx" deleted file mode 100644 index 1d8a286..0000000 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/74867a10-626f-4e30-a018-f262a1dd62c2.vsidx" +++ /dev/null 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/9a2aa82f-b430-4ff0-9e51-65e4c7ea2eae.vsidx" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/9a2aa82f-b430-4ff0-9e51-65e4c7ea2eae.vsidx" deleted file mode 100644 index 2183a8f..0000000 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/9a2aa82f-b430-4ff0-9e51-65e4c7ea2eae.vsidx" +++ /dev/null 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/f8288fd8-10a9-42d7-ac09-8c962aedebb7.vsidx" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/f8288fd8-10a9-42d7-ac09-8c962aedebb7.vsidx" new file mode 100644 index 0000000..e84e8f7 --- /dev/null +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/f8288fd8-10a9-42d7-ac09-8c962aedebb7.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/read.lock" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/read.lock" deleted file mode 100644 index e69de29..0000000 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/read.lock" +++ /dev/null diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_BasicInfoService/WIDESEAWCS_BasicInfoService.csproj" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_BasicInfoService/WIDESEAWCS_BasicInfoService.csproj" index 16a5285..71f573d 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_BasicInfoService/WIDESEAWCS_BasicInfoService.csproj" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_BasicInfoService/WIDESEAWCS_BasicInfoService.csproj" @@ -7,7 +7,7 @@ </PropertyGroup> <ItemGroup> - <PackageReference Include="WIDESEAWCS_QuartzJob" Version="3.0.3" /> + <PackageReference Include="WIDESEAWCS_QuartzJob" Version="3.0.4" /> </ItemGroup> <ItemGroup> diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/TaskEnum/TaskTypeEnum.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/TaskEnum/TaskTypeEnum.cs" index 1d73209..0d8a1db 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/TaskEnum/TaskTypeEnum.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/TaskEnum/TaskTypeEnum.cs" @@ -35,6 +35,11 @@ [Description("绌虹鍑哄簱")] OutEmpty = 140, /// <summary> + /// MES鍑哄簱 + /// </summary> + [Description("MES鍑哄簱")] + MesOutbound = 200, + /// <summary> /// 閲囪喘鍏ュ簱 /// </summary> [Description("閲囪喘鍏ュ簱")] diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_ITaskInfoService/ITaskService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_ITaskInfoService/ITaskService.cs" index 4fc6f04..d364d1a 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_ITaskInfoService/ITaskService.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_ITaskInfoService/ITaskService.cs" @@ -160,5 +160,25 @@ AgvResponseContent AgvUpdateTask(AgvUpdateDTO agvUpdateModel); WebResponseContent SendSecureReplyToAgv(int taskNum); + + /// <summary> + /// 鏇存柊浠诲姟淇℃伅鍙婃坊鍔犱换鍔℃槑缁嗚褰� + /// </summary> + /// <param name="task"></param> + /// <param name="deviceCode"></param> + /// <param name="sourceAddress"></param> + /// <param name="targetAddress"></param> + /// <param name="currentAddress"></param> + /// <param name="nextAddress"></param> + /// <param name="taskStatus"></param> + void UpdateTask(Dt_Task task, TaskStatusEnum taskStatus, string deviceCode = "", string sourceAddress = "", string targetAddress = "", string currentAddress = "", string nextAddress = ""); + + /// <summary> + /// 璇锋眰鍒嗛厤宸烽亾 + /// </summary> + /// <param name="taskNum"></param> + /// <param name="roadwayNos"></param> + /// <returns></returns> + WebResponseContent RequestWMSAssignRoadway(int taskNum, List<string> roadwayNos); } } diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/appsettings.json" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/appsettings.json" index 5b8ee56..3e0e1e8 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/appsettings.json" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/appsettings.json" @@ -23,6 +23,7 @@ // 娉ㄦ剰锛宧ttp://127.0.0.1:1818 鍜� http://localhost:1818 鏄笉涓�鏍风殑 "IPs": "http://127.0.0.1:8080,http://localhost:8080" }, + "WMSApiAddress": "http://127.0.0.1:9293", "ApiName": "WIDESEA", "ExpMinutes": 120, "QuartzJobAutoStart": true 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 07d66bd..d23cf79 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" @@ -170,7 +170,7 @@ Dt_StationManger stationManger; if (taskTypeGroup == TaskTypeGroup.InboundGroup) { - stationManger = _stationMangerRepository.QueryFirst(x => x.StationCode == item.SourceAddress); + stationManger = _stationMangerRepository.QueryFirst(x => x.StationCode == item.SourceAddress || x.StationDeviceCode == item.SourceAddress); } else { @@ -181,7 +181,7 @@ return WebResponseContent.Instance.Error($"鏈壘鍒扮珯鍙伴厤缃俊鎭�"); } - List<Dt_Router> routers = _routerRepository.QueryData(x => x.InOutType == item.TaskType && (item.SourceAddress == x.StartPosi || item.RoadWay == x.StartPosi)); + List<Dt_Router> routers = _routerRepository.QueryData(x => x.InOutType == item.TaskType && (item.SourceAddress == x.StartPosi || item.RoadWay == x.StartPosi || item.RoadWay == x.ChildPosiDeviceCode || item.RoadWay == x.ChildPosi)); router = routers.FirstOrDefault(); if (router == null) { @@ -194,6 +194,11 @@ { task.NextAddress = router.NextPosi; task.DeviceCode = stationManger.StationDeviceCode; + } + else if(item.TaskType == TaskTypeEnum.MesOutbound.ObjToInt()) + { + task.NextAddress = router.NextPosi; + task.DeviceCode = stationManger.StackerCraneCode; } else { @@ -284,8 +289,12 @@ { return WebResponseContent.Instance.Error($"鏈壘鍒扮珯鍙颁俊鎭�"); } - - string responseStr = HttpHelper.Get($"http://127.0.0.1:9283/api/Task/DeviceRequestInboundTask?stationCode={sourceAddress}&roadwayNo={stationManger.StackerCraneCode}&palletCode={palletCode}"); + string address = AppSettings.Get("WMSApiAddress"); + if(string.IsNullOrEmpty(address)) + { + return WebResponseContent.Instance.Error($"鏈壘鍒癢MSApi鍦板潃"); + } + string responseStr = HttpHelper.Get($"{address}/api/Task/DeviceRequestInboundTask?stationCode={sourceAddress}&roadwayNo={stationManger.StackerCraneCode}&palletCode={palletCode}"); WebResponseContent? responseContent = JsonConvert.DeserializeObject<WebResponseContent>(responseStr); if (responseContent != null && responseContent.Status && responseContent.Data != null) { @@ -304,6 +313,31 @@ return content; } + public WebResponseContent RequestWMSAssignRoadway(int taskNum, List<string> roadwayNos) + { + WebResponseContent content = new WebResponseContent(); + try + { + string address = AppSettings.Get("WMSApiAddress"); + if (string.IsNullOrEmpty(address)) + { + return WebResponseContent.Instance.Error($"鏈壘鍒癢MSApi鍦板潃"); + } + string responseStr = HttpHelper.Post($"{address}/api/Task/AssignRoadway?taskNum={taskNum}",roadwayNos.Serialize()); + WebResponseContent? responseContent = JsonConvert.DeserializeObject<WebResponseContent>(responseStr); + if (responseContent != null && responseContent.Status && responseContent.Data != null) + { + return responseContent; + } + + } + catch (Exception ex) + { + content = WebResponseContent.Instance.Error(ex.Message); + } + return content; + } + /// <summary> /// 鍚慦MS鐢宠鍒嗛厤璐т綅 /// </summary> diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService_Operate.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService_Operate.cs" new file mode 100644 index 0000000..20b791c --- /dev/null +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService_Operate.cs" @@ -0,0 +1,87 @@ +锘縰sing System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Reflection; +using System.Text; +using WIDESEAWCS_Common.TaskEnum; +using WIDESEAWCS_Core; +using WIDESEAWCS_Core.Enums; +using WIDESEAWCS_Core.Helper; +using WIDESEAWCS_Model.Models; + +namespace WIDESEAWCS_TaskInfoService +{ + public partial class TaskService + { + public void UpdateTask(Dt_Task task, TaskStatusEnum taskStatus, string deviceCode = "", string sourceAddress = "", string targetAddress = "", string currentAddress = "", string nextAddress = "") + { + StringBuilder stringBuilder = new StringBuilder(App.User?.UserId == 0 ? $"绯荤粺鑷姩娴佺▼" : "浜哄伐鎵嬪姩娴佺▼"); + if (task.DeviceCode != deviceCode && !string.IsNullOrEmpty(deviceCode)) + { + stringBuilder.Append($",璁惧缂栧彿鐢眥task.DeviceCode}鍙樻洿涓簕deviceCode}"); + task.DeviceCode = deviceCode; + } + if (task.SourceAddress != sourceAddress && !string.IsNullOrEmpty(sourceAddress)) + { + stringBuilder.Append($",璧峰鍦板潃鐢眥task.SourceAddress}鍙樻洿涓簕sourceAddress}"); + task.SourceAddress = sourceAddress; + } + if (task.TargetAddress != targetAddress && !string.IsNullOrEmpty(targetAddress)) + { + stringBuilder.Append($",鐩爣鍦板潃鐢眥task.TargetAddress}鍙樻洿涓簕targetAddress}"); + task.TargetAddress = targetAddress; + } + if (task.CurrentAddress != currentAddress && !string.IsNullOrEmpty(currentAddress)) + { + stringBuilder.Append($",褰撳墠浣嶇疆鐢眥task.CurrentAddress}鍙樻洿涓簕currentAddress}"); + task.CurrentAddress = currentAddress; + } + if (task.NextAddress != nextAddress && !string.IsNullOrEmpty(nextAddress)) + { + stringBuilder.Append($",涓嬩竴浣嶇疆鐢眥task.NextAddress}鍙樻洿涓簕nextAddress}"); + task.NextAddress = nextAddress; + } + if (task.TaskState != taskStatus.ObjToInt()) + { + string newStatus = $"{taskStatus}"; + try + { + List<int> enums = Enum.GetValues(typeof(TaskStatusEnum)).Cast<int>().ToList(); + FieldInfo? fieldInfo = typeof(TaskStatusEnum).GetField((taskStatus).ToString()); + if (fieldInfo != null) + { + DescriptionAttribute? description = fieldInfo.GetCustomAttribute<DescriptionAttribute>(); + if (description != null) + { + newStatus = $"{description.Description}({taskStatus})"; + } + } + } + catch { } + string oldStatus = $"{task.TaskState}"; + try + { + FieldInfo? fieldInfo2 = typeof(RouterInOutType).GetField(((TaskStatusEnum)task.TaskState).ToString()); + if (fieldInfo2 != null) + { + DescriptionAttribute? description2 = fieldInfo2.GetCustomAttribute<DescriptionAttribute>(); + if (description2 != null) + { + oldStatus = $"{description2.Description}({task.TaskState})"; + } + } + } + catch { } + stringBuilder.Append($",浠诲姟鐘舵�佺敱{oldStatus}鍙樻洿涓簕newStatus}"); + + task.TaskState = taskStatus.ObjToInt(); + } + + BaseDal.UpdateData(task); + + _taskExecuteDetailService.AddTaskExecuteDetail(task.TaskNum, stringBuilder.ToString()); + + } + } +} diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/ConveyorLineTaskCommand.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/ConveyorLineTaskCommand.cs" index 58371ab..887955e 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/ConveyorLineTaskCommand.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/ConveyorLineTaskCommand.cs" @@ -85,11 +85,16 @@ /// </summary> public short RunStatus { get; set; } + private string _barcode; /// <summary> /// 鏉$爜 /// </summary> [DataLength(20)] - public string Barcode { get; set; } + public string Barcode + { + get { return _barcode; } + set { _barcode = value.Replace("\0", "").Replace("\\0", ""); } + } /// <summary> /// 棰勭暀 @@ -183,7 +188,7 @@ public byte Operate { get; set; } - public byte Undefined { get; set; } + public byte Undefined { get; set; } /// <summary> /// 浠诲姟鍙� diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/R_ConveyorLineDBName.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/R_ConveyorLineDBName.cs" index 307a869..b22c8ee 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/R_ConveyorLineDBName.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/R_ConveyorLineDBName.cs" @@ -121,4 +121,8 @@ ACK } + public enum R_ConveyorLineWorkType + { + ConveyorLineWorkType + } } diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/WIDESEAWCS_Tasks.csproj" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/WIDESEAWCS_Tasks.csproj" index 3239aea..67721bb 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/WIDESEAWCS_Tasks.csproj" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/WIDESEAWCS_Tasks.csproj" @@ -13,7 +13,7 @@ </ItemGroup> <ItemGroup> - <PackageReference Include="WIDESEAWCS_QuartzJob" Version="3.0.3" /> + <PackageReference Include="WIDESEAWCS_QuartzJob" Version="3.0.4" /> </ItemGroup> <ItemGroup> diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\345\271\262\350\206\234\344\273\223/ConveyorLineJob_GM.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\345\271\262\350\206\234\344\273\223/ConveyorLineJob_GM.cs" index cc4a372..1cf5e15 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\345\271\262\350\206\234\344\273\223/ConveyorLineJob_GM.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\345\271\262\350\206\234\344\273\223/ConveyorLineJob_GM.cs" @@ -99,19 +99,12 @@ } else if (item.StationType == StationTypeEnum.StationType_InboundAndOutbound.ObjToInt()) { - if(!conveyorLineSignalRead.STB && !conveyorLineSignalRead.ACK && conveyorLineStatus.Online && !conveyorLineStatus.Goods && !conveyorLineStatus.Alarm && !conveyorLineSignalWrite.STB && !conveyorLineSignalWrite.ACK) + if (!conveyorLineSignalRead.STB && !conveyorLineSignalRead.ACK && conveyorLineStatus.Online && !conveyorLineStatus.Goods && !conveyorLineStatus.Alarm && !conveyorLineSignalWrite.STB && !conveyorLineSignalWrite.ACK) { Dt_Task task = _taskRepository.QueryFirst(x => _taskService.TaskOutboundTypes.Contains(x.TaskType) && x.TaskState == TaskStatusEnum.New.ObjToInt() && string.IsNullOrEmpty(x.TargetAddress) && string.IsNullOrEmpty(x.NextAddress)); - if(task != null) + if (task != null) { - string oldAddress = task.NextAddress; - int oldStatus = task.TaskState; - task.NextAddress = item.StationCode; - task.DeviceCode = item.StackerCraneCode; - task.TaskState = TaskStatusEnum.SC_Execute.ObjToInt(); - task.TargetAddress = item.StationCode; - _taskRepository.UpdateData(task); - _taskExecuteDetailService.AddTaskExecuteDetail(task.TaskNum, $"绯荤粺鑷姩娴佺▼,鐩爣鍦板潃鐢眥oldAddress}鍙樻洿涓簕task.NextAddress},浠诲姟鐘舵�佺敱{oldStatus}鍙樻洿涓簕task.TaskState}"); + _taskService.UpdateTask(task, TaskStatusEnum.SC_Execute, nextAddress: item.StationCode, deviceCode: item.StackerCraneCode, targetAddress: item.StationCode); } } @@ -132,16 +125,7 @@ WriteInfo(item.StationName, $"璇锋眰鍒嗛厤璐т綅杩斿洖淇℃伅閿欒,璁惧缂栧彿:{item.StationCode},浠诲姟鍙�:{task.TaskNum}"); continue; } - string oldAddress = task.NextAddress; - int oldStatus = task.TaskState; - task.CurrentAddress = stationManger.StackerCraneStationCode; - task.TargetAddress = locationCode; - task.NextAddress = locationCode; - task.DeviceCode = stationManger.StackerCraneCode; - task.TaskState = TaskStatusEnum.SC_Execute.ObjToInt(); - _taskRepository.UpdateData(task); - - _taskExecuteDetailService.AddTaskExecuteDetail(task.TaskNum, $"绯荤粺鑷姩娴佺▼,鐩爣鍦板潃鐢眥oldAddress}鍙樻洿涓簕task.NextAddress},浠诲姟鐘舵�佺敱{oldStatus}鍙樻洿涓簕task.TaskState}"); + _taskService.UpdateTask(task, TaskStatusEnum.SC_Execute, currentAddress: stationManger.StackerCraneStationCode, targetAddress: locationCode, nextAddress: locationCode, deviceCode: stationManger.StackerCraneCode); device.SetValue(W_ConveyorLineDB.Spare1, ConveyorWorkTypeEnum.Inbound.ObjToInt(), item.StationCode); device.SetValue(W_ConveyorLineDB.ACK, true, item.StationCode); @@ -172,14 +156,7 @@ continue; } - string oldAddress = task.NextAddress; - int oldStatus = task.TaskState; - task.NextAddress = router.NextPosi; - task.TargetAddress = router.NextPosi; - task.TaskState = TaskStatusEnum.Line_Executing.ObjToInt(); - _taskRepository.UpdateData(task); - - _taskExecuteDetailService.AddTaskExecuteDetail(task.TaskNum, $"绯荤粺鑷姩娴佺▼,鐩爣鍦板潃鐢眥oldAddress}鍙樻洿涓簕task.NextAddress},浠诲姟鐘舵�佺敱{oldStatus}鍙樻洿涓簕task.TaskState}"); + _taskService.UpdateTask(task, TaskStatusEnum.Line_Executing, nextAddress: router.NextPosi, targetAddress: router.NextPosi); device.SetValue(W_ConveyorLineDB.TaskNum, task.TaskNum, item.StationCode); device.SetValue(W_ConveyorLineDB.EndPos, task.NextAddress, item.StationCode); @@ -206,13 +183,7 @@ if (task != null) { //todo 杈撻�佺嚎宸ヤ綔妯″紡闇�瑕佸垽鏂� - - string oldAddress = task.NextAddress; - int oldStatus = task.TaskState; - task.TaskState = TaskStatusEnum.Line_Execute.ObjToInt(); - _taskRepository.UpdateData(task); - - _taskExecuteDetailService.AddTaskExecuteDetail(task.TaskNum, $"绯荤粺鑷姩娴佺▼,鐩爣鍦板潃鐢眥oldAddress}鍙樻洿涓簕task.NextAddress},浠诲姟鐘舵�佺敱{oldStatus}鍙樻洿涓簕task.TaskState}"); + _taskService.UpdateTask(task, TaskStatusEnum.Line_Execute); device.SetValue(W_ConveyorLineDB.TaskNum, task.TaskNum, item.StationCode); device.SetValue(W_ConveyorLineDB.EndPos, task.NextAddress, item.StationCode); diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\345\271\262\350\206\234\344\273\223/StackerCraneJob_GM.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\345\271\262\350\206\234\344\273\223/StackerCraneJob_GM.cs" index f2d5676..cf2235c 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\345\271\262\350\206\234\344\273\223/StackerCraneJob_GM.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\345\271\262\350\206\234\344\273\223/StackerCraneJob_GM.cs" @@ -90,12 +90,9 @@ if (sendFlag) { commonStackerCrane.LastTaskType = task.TaskType; - int oldState = task.TaskState; - task.TaskState = TaskStatusEnum.SC_Executing.ObjToInt(); task.Dispatchertime = DateTime.Now; task.ExceptionMessage = ""; - _taskRepository.UpdateData(task); - _taskExecuteDetailService.AddTaskExecuteDetail(task.TaskId, $"绯荤粺鑷姩娴佺▼锛屼换鍔$姸鎬佷粠銆恵oldState}銆戣浆鍒般�恵task.TaskState}銆�"); + _taskService.UpdateTask(task, TaskStatusEnum.SC_Executing); commonStackerCrane.Communicator.Write("DB105.54", (short)1); } @@ -147,7 +144,7 @@ } int oldStatus = task.TaskState; - task.DeviceCode = "CL01_GM"; + task.DeviceCode = stationManger.StationDeviceCode; task.TaskState = TaskStatusEnum.Line_Execute.ObjToInt(); task.CurrentAddress = stationManger.StationCode; _taskRepository.UpdateData(task); diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\346\235\277\346\235\220\344\273\223/ConveyorLineJob_BC.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\346\235\277\346\235\220\344\273\223/ConveyorLineJob_BC.cs" index d6499ed..2e763fc 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\346\235\277\346\235\220\344\273\223/ConveyorLineJob_BC.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\346\235\277\346\235\220\344\273\223/ConveyorLineJob_BC.cs" @@ -69,11 +69,12 @@ ConveyorLineSignal conveyorLineSignalRead = conveyorLineInfoRead.Signal.ByteToBoolObject<ConveyorLineSignal>(); ConveyorLineSignal conveyorLineSignalWrite = conveyorLineInfoWrite.Signal.ByteToBoolObject<ConveyorLineSignal>(); - if (item.StationType == StationTypeEnum.StationType_OnlyInbound.ObjToInt()) + + if (item.StationType == StationTypeEnum.StationType_InboundAndOutbound.ObjToInt()) { if (conveyorLineSignalRead.STB && conveyorLineStatus.Online && conveyorLineStatus.Goods && !conveyorLineStatus.Alarm && !conveyorLineSignalWrite.ACK) { - if (!string.IsNullOrEmpty(conveyorLineInfoRead.Barcode)) + if (conveyorLineInfoRead.TaskNum == 0 && !string.IsNullOrEmpty(conveyorLineInfoRead.Barcode))//閲囪喘鍏ュ簱 { WebResponseContent content = _taskService.RequestWMSTask(conveyorLineInfoRead.Barcode, item.StationCode); if (content.Status) @@ -81,155 +82,76 @@ device.SetValue(W_ConveyorLineDB.ACK, true, item.StationCode); } } - } - else if (!conveyorLineSignalRead.STB && conveyorLineStatus.Online && conveyorLineStatus.Goods && !conveyorLineStatus.Alarm && conveyorLineSignalWrite.ACK) - { - Dt_Task task = _taskRepository.QueryFirst(x => x.CurrentAddress == item.StationCode && x.PalletCode == conveyorLineInfoRead.Barcode && x.DeviceCode == item.StationDeviceCode); - if (task != null) + else//鐢熶骇閫�搴� { - task.CurrentAddress = item.StackerCraneStationCode; - task.TaskState = TaskStatusEnum.SC_Execute.ObjToInt(); - task.DeviceCode = item.StackerCraneCode; - _taskRepository.UpdateData(task); - } - - device.SetValue(W_ConveyorLineDB.ACK, false, item.StationCode); - } - - } - else if (item.StationType == StationTypeEnum.StationType_InboundAndOutbound.ObjToInt()) - { - if (!conveyorLineSignalRead.STB && !conveyorLineSignalRead.ACK && conveyorLineStatus.Online && !conveyorLineStatus.Goods && !conveyorLineStatus.Alarm && !conveyorLineSignalWrite.STB && !conveyorLineSignalWrite.ACK) - { - Dt_Task task = _taskRepository.QueryFirst(x => _taskService.TaskOutboundTypes.Contains(x.TaskType) && x.TaskState == TaskStatusEnum.New.ObjToInt() && string.IsNullOrEmpty(x.TargetAddress) && string.IsNullOrEmpty(x.NextAddress)); - if (task != null) - { - string oldAddress = task.NextAddress; - int oldStatus = task.TaskState; - task.NextAddress = item.StationCode; - task.DeviceCode = item.StackerCraneCode; - task.TaskState = TaskStatusEnum.SC_Execute.ObjToInt(); - task.TargetAddress = item.StationCode; - _taskRepository.UpdateData(task); - _taskExecuteDetailService.AddTaskExecuteDetail(task.TaskNum, $"绯荤粺鑷姩娴佺▼,鐩爣鍦板潃鐢眥oldAddress}鍙樻洿涓簕task.NextAddress},浠诲姟鐘舵�佺敱{oldStatus}鍙樻洿涓簕task.TaskState}"); - } - } - - if (conveyorLineSignalRead.STB && conveyorLineStatus.Online && conveyorLineStatus.Goods && !conveyorLineStatus.Alarm && !conveyorLineSignalWrite.ACK)//鍏ュ簱 - { - Dt_Task task = _taskRepository.QueryFirst(x => x.TaskNum == conveyorLineInfoRead.TaskNum && x.NextAddress == item.StationCode); - if (task != null && task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.InboundGroup) - { - Dt_StationManger? stationManger = stationMangers.FirstOrDefault(x => x.StationCode == item.StationCode); - if (stationManger == null) - { - WriteInfo(item.StationName, $"鏈壘鍒板搴旂珯鍙颁俊鎭�,璁惧缂栧彿:{item.StationCode},浠诲姟鍙�:{task.TaskNum}"); - continue; - } - string? locationCode = _taskService.RequestAssignLocation(task.TaskNum, stationManger.StackerCraneCode); - if (string.IsNullOrEmpty(locationCode)) - { - WriteInfo(item.StationName, $"璇锋眰鍒嗛厤璐т綅杩斿洖淇℃伅閿欒,璁惧缂栧彿:{item.StationCode},浠诲姟鍙�:{task.TaskNum}"); - continue; - } - string oldAddress = task.NextAddress; - int oldStatus = task.TaskState; - task.CurrentAddress = stationManger.StackerCraneStationCode; - task.TargetAddress = locationCode; - task.NextAddress = locationCode; - task.DeviceCode = stationManger.StackerCraneCode; - task.TaskState = TaskStatusEnum.SC_Execute.ObjToInt(); - _taskRepository.UpdateData(task); - - _taskExecuteDetailService.AddTaskExecuteDetail(task.TaskNum, $"绯荤粺鑷姩娴佺▼,鐩爣鍦板潃鐢眥oldAddress}鍙樻洿涓簕task.NextAddress},浠诲姟鐘舵�佺敱{oldStatus}鍙樻洿涓簕task.TaskState}"); - - device.SetValue(W_ConveyorLineDB.Spare1, ConveyorWorkTypeEnum.Inbound.ObjToInt(), item.StationCode); - device.SetValue(W_ConveyorLineDB.ACK, true, item.StationCode); - } - } - else if (!conveyorLineSignalRead.STB && conveyorLineStatus.Online && conveyorLineStatus.Goods && !conveyorLineStatus.Alarm && conveyorLineSignalWrite.ACK) - { - device.SetValue(W_ConveyorLineDB.ACK, false, item.StationCode); - } - else - { - if (!conveyorLineSignalWrite.STB && !conveyorLineSignalRead.ACK && conveyorLineStatus.Goods) - { - Dt_Task task = _taskRepository.QueryFirst(x => x.CurrentAddress == item.StationCode && x.TaskState == TaskStatusEnum.Line_Execute.ObjToInt() && x.DeviceCode == item.StationDeviceCode); - if (task != null && task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup) + Dt_Task task = _taskRepository.QueryFirst(x => x.TaskNum == conveyorLineInfoRead.TaskNum && x.NextAddress == item.StationCode && _taskService.TaskInboundTypes.Contains(x.TaskType)); // 甯︿换鍔″彿鏌ヨ浠诲姟 + if (task != null) { Dt_StationManger? stationManger = stationMangers.FirstOrDefault(x => x.StationCode == item.StationCode); if (stationManger == null) { - WriteInfo(item.StationName, $"鏈壘鍒板搴旂珯鍙颁俊鎭�,璁惧缂栧彿:{item.StationCode},浠诲姟鍙�:{task.TaskNum}"); + WriteError(item.StationName, $"鏈壘鍒板搴旂珯鍙颁俊鎭�,璁惧缂栧彿:{item.StationCode},浠诲姟鍙�:{task.TaskNum}"); continue; } - - Dt_Router router = _routerRepository.QueryFirst(x => x.InOutType == task.TaskType && (task.CurrentAddress == x.StartPosi)); - if (router == null) + string? locationCode = _taskService.RequestAssignLocation(task.TaskNum, stationManger.StackerCraneCode); + if (string.IsNullOrEmpty(locationCode)) { - WriteInfo(item.StationName, $"鏈壘鍒拌矾鐢遍厤缃俊鎭�,璁惧缂栧彿:{item.StationCode},浠诲姟鍙�:{task.TaskNum}"); + WriteError(item.StationName, $"璇锋眰鍒嗛厤璐т綅杩斿洖淇℃伅閿欒,璁惧缂栧彿:{item.StationCode},浠诲姟鍙�:{task.TaskNum}"); continue; } - string oldAddress = task.NextAddress; - int oldStatus = task.TaskState; - task.NextAddress = router.NextPosi; - task.TargetAddress = router.NextPosi; - task.TaskState = TaskStatusEnum.Line_Executing.ObjToInt(); - _taskRepository.UpdateData(task); + _taskService.UpdateTask(task, TaskStatusEnum.SC_Execute, deviceCode: stationManger.StackerCraneCode, targetAddress: locationCode, currentAddress: stationManger.StackerCraneStationCode, nextAddress: locationCode); - _taskExecuteDetailService.AddTaskExecuteDetail(task.TaskNum, $"绯荤粺鑷姩娴佺▼,鐩爣鍦板潃鐢眥oldAddress}鍙樻洿涓簕task.NextAddress},浠诲姟鐘舵�佺敱{oldStatus}鍙樻洿涓簕task.TaskState}"); - - device.SetValue(W_ConveyorLineDB.TaskNum, task.TaskNum, item.StationCode); - device.SetValue(W_ConveyorLineDB.EndPos, task.NextAddress, item.StationCode); - device.SetValue(W_ConveyorLineDB.StartPos, task.CurrentAddress, item.StationCode); - device.SetValue(W_ConveyorLineDB.Spare1, ConveyorWorkTypeEnum.Outbound.ObjToInt(), item.StationCode); - device.SetValue(W_ConveyorLineDB.STB, true, item.StationCode); - } - } - else if (conveyorLineSignalWrite.STB && conveyorLineSignalRead.ACK && conveyorLineStatus.Goods) - { - _taskService.TaskCompleted(conveyorLineInfoRead.TaskNum); - device.SetValue(W_ConveyorLineDB.STB, false, item.StationCode); - } - } - } - else if (item.StationType == StationTypeEnum.StationType_InStartAndOutEnd.ObjToInt()) - { - if (!conveyorLineSignalWrite.STB && !conveyorLineSignalWrite.ACK && !conveyorLineSignalRead.STB && !conveyorLineSignalRead.ACK && conveyorLineStatus.Goods && !conveyorLineStatus.Alarm) - { - Dt_Task outTask = _taskRepository.QueryFirst(x => _taskService.TaskOutboundTypes.Contains(x.TaskType) && x.TaskState != TaskStatusEnum.New.ObjToInt() && x.TaskState != TaskStatusEnum.SC_Execute.ObjToInt() && x.TargetAddress == item.StationCode); - if (outTask == null) - { - Dt_Task task = _taskRepository.QueryFirst(x => x.TaskState == TaskStatusEnum.New.ObjToInt() && string.IsNullOrEmpty(x.TargetAddress) && x.SourceAddress == item.StationCode && _taskService.TaskInboundTypes.Contains(x.TaskType)); - if (task != null) - { - //todo 杈撻�佺嚎宸ヤ綔妯″紡闇�瑕佸垽鏂� - - string oldAddress = task.NextAddress; - int oldStatus = task.TaskState; - task.TaskState = TaskStatusEnum.Line_Execute.ObjToInt(); - _taskRepository.UpdateData(task); - - _taskExecuteDetailService.AddTaskExecuteDetail(task.TaskNum, $"绯荤粺鑷姩娴佺▼,鐩爣鍦板潃鐢眥oldAddress}鍙樻洿涓簕task.NextAddress},浠诲姟鐘舵�佺敱{oldStatus}鍙樻洿涓簕task.TaskState}"); - - device.SetValue(W_ConveyorLineDB.TaskNum, task.TaskNum, item.StationCode); - device.SetValue(W_ConveyorLineDB.EndPos, task.NextAddress, item.StationCode); device.SetValue(W_ConveyorLineDB.Spare1, ConveyorWorkTypeEnum.Inbound.ObjToInt(), item.StationCode); - device.SetValue(W_ConveyorLineDB.STB, true, item.StationCode); + device.SetValue(W_ConveyorLineDB.ACK, true, item.StationCode); } } } - else if (conveyorLineSignalWrite.STB && conveyorLineSignalRead.ACK && !conveyorLineStatus.Alarm) - { - device.SetValue(W_ConveyorLineDB.STB, false, item.StationCode); - } - else if (!conveyorLineSignalRead.STB && conveyorLineSignalWrite.ACK && !conveyorLineStatus.Alarm) + else if (!conveyorLineSignalRead.STB && conveyorLineStatus.Online && conveyorLineStatus.Goods && !conveyorLineStatus.Alarm && conveyorLineSignalWrite.ACK) { device.SetValue(W_ConveyorLineDB.ACK, false, item.StationCode); } + else if (!conveyorLineSignalRead.STB && !conveyorLineSignalRead.ACK && conveyorLineStatus.Online && conveyorLineStatus.Goods && !conveyorLineStatus.Alarm && !conveyorLineSignalWrite.STB && !conveyorLineSignalWrite.ACK && conveyorLineInfoRead.TaskNum == 0)//鍑哄簱 + { + Dt_Task task = _taskRepository.QueryFirst(x => x.CurrentAddress == item.StationCode && _taskService.TaskOutboundTypes.Contains(x.TaskType) && x.DeviceCode == item.StationDeviceCode && x.TaskState == TaskStatusEnum.Line_Execute.ObjToInt()); + if (task != null) + { + _taskService.UpdateTask(task, TaskStatusEnum.SC_Execute); + + device.SetValue(W_ConveyorLineDB.TaskNum, task.TaskNum, item.StationCode); + device.SetValue(W_ConveyorLineDB.StartPos, task.CurrentAddress, item.StationCode); + device.SetValue(W_ConveyorLineDB.EndPos, task.NextAddress, item.StationCode); + device.SetValue(W_ConveyorLineDB.Spare1, ConveyorWorkTypeEnum.Outbound.ObjToInt(), item.StationCode); + device.SetValue(W_ConveyorLineDB.STB, true, item.StationCode); + } + } + else if (!conveyorLineSignalRead.STB && conveyorLineSignalRead.ACK && conveyorLineStatus.Online && conveyorLineStatus.Goods && !conveyorLineStatus.Alarm && conveyorLineSignalWrite.STB && !conveyorLineSignalWrite.ACK) + { + device.SetValue(W_ConveyorLineDB.STB, false, item.StationCode); + } } + //else if (item.StationType == StationTypeEnum.StationType_InStartAndOutEnd.ObjToInt()) + //{ + // if (!conveyorLineSignalWrite.ACK && conveyorLineSignalRead.STB && conveyorLineStatus.Goods && !conveyorLineStatus.Alarm) + // { + // if (conveyorLineInfoRead.TaskNum == 0 && !string.IsNullOrEmpty(conveyorLineInfoRead.Barcode))//閫�鏂欏叆搴� + // { + + // } + // else//鍑哄簱瀹屾垚 + // { + + // } + // } + // else if (conveyorLineSignalWrite.STB && conveyorLineSignalRead.ACK && !conveyorLineStatus.Alarm) + // { + // device.SetValue(W_ConveyorLineDB.STB, false, item.StationCode); + // } + // else if (!conveyorLineSignalRead.STB && conveyorLineSignalWrite.ACK && !conveyorLineStatus.Alarm) + // { + // device.SetValue(W_ConveyorLineDB.ACK, false, item.StationCode); + // } + //} } else { diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\346\235\277\346\235\220\344\273\223/ConveyorLineJob_BC_Old.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\346\235\277\346\235\220\344\273\223/ConveyorLineJob_BC_Old.cs" new file mode 100644 index 0000000..591546b --- /dev/null +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\346\235\277\346\235\220\344\273\223/ConveyorLineJob_BC_Old.cs" @@ -0,0 +1,295 @@ +锘縰sing Quartz; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WIDESEAWCS_Common; +using WIDESEAWCS_Common.Helper; +using WIDESEAWCS_Common.TaskEnum; +using WIDESEAWCS_Core; +using WIDESEAWCS_Core.Helper; +using WIDESEAWCS_IBasicInfoRepository; +using WIDESEAWCS_ITaskInfoRepository; +using WIDESEAWCS_ITaskInfoService; +using WIDESEAWCS_Model.Models; +using WIDESEAWCS_QuartzJob; +using WIDESEAWCS_QuartzJob.DTO; +using WIDESEAWCS_QuartzJob.Models; +using WIDESEAWCS_QuartzJob.Repository; +using WIDESEAWCS_Tasks.ConveyorLineJob; + +namespace WIDESEAWCS_Tasks +{ + [DisallowConcurrentExecution] + public class ConveyorLineJob_BC_Old : JobBase, IJob + { + + private readonly ITaskService _taskService; + private readonly ITaskExecuteDetailService _taskExecuteDetailService; + private readonly ITaskRepository _taskRepository; + private readonly IStationMangerRepository _stationMangerRepository; + private readonly IRouterRepository _routerRepository; + + public ConveyorLineJob_BC_Old(ITaskService taskService, ITaskExecuteDetailService taskExecuteDetailService, ITaskRepository taskRepository, IStationMangerRepository stationMangerRepository, IRouterRepository routerRepository) + { + _taskService = taskService; + _taskExecuteDetailService = taskExecuteDetailService; + _taskRepository = taskRepository; + _stationMangerRepository = stationMangerRepository; + _routerRepository = routerRepository; + } + + public Task Execute(IJobExecutionContext context) + { + bool flag = context.JobDetail.JobDataMap.TryGetValue("JobParams", out object? value); + if (flag && value != null) + { + OtherDevice device = (OtherDevice)value; + List<string> deviceStations = device.DeviceProDTOs.Select(x => x.DeviceChildCode).ToList(); + List<Dt_StationManger> stationMangers = _stationMangerRepository.QueryData(x => x.StationDeviceCode == device.DeviceCode); + foreach (var item in stationMangers.Where(x => deviceStations.Contains(x.StationCode))) + { + DeviceProDTO? deviceProRead = device.DeviceProDTOs.Where(x => x.DeviceChildCode == item.StationCode && x.DeviceProParamType == nameof(R_ConveyorLineDB)).OrderBy(x => x.DeviceProOffset).FirstOrDefault(); + + DeviceProDTO? deviceProWrite = device.DeviceProDTOs.Where(x => x.DeviceChildCode == item.StationCode && x.DeviceProParamType == nameof(W_ConveyorLineDB)).OrderBy(x => x.DeviceProOffset).FirstOrDefault(); + + if (deviceProRead != null && deviceProWrite != null) + { + R_ConveyorLineInfo conveyorLineInfoRead = device.Communicator.ReadCustomer<R_ConveyorLineInfo>(deviceProRead.DeviceProAddress); + + W_ConveyorLineInfo conveyorLineInfoWrite = device.Communicator.ReadCustomer<W_ConveyorLineInfo>(deviceProWrite.DeviceProAddress); + if (conveyorLineInfoRead == null || conveyorLineInfoWrite == null) + { + continue; + } + + R_ConveyorLineStatus conveyorLineStatus = conveyorLineInfoRead.Status.ByteToBoolObject<R_ConveyorLineStatus>(); + + ConveyorLineSignal conveyorLineSignalRead = conveyorLineInfoRead.Signal.ByteToBoolObject<ConveyorLineSignal>(); + + ConveyorLineSignal conveyorLineSignalWrite = conveyorLineInfoWrite.Signal.ByteToBoolObject<ConveyorLineSignal>(); + if (item.StationType == StationTypeEnum.StationType_OnlyInbound.ObjToInt()) + { + if (conveyorLineSignalRead.STB && conveyorLineStatus.Online && conveyorLineStatus.Goods && !conveyorLineStatus.Alarm && !conveyorLineSignalWrite.ACK && conveyorLineInfoRead.TaskNum == 0) + { + if (!string.IsNullOrEmpty(conveyorLineInfoRead.Barcode)) + { + WebResponseContent content = _taskService.RequestWMSTask(conveyorLineInfoRead.Barcode, item.StationCode); + if (content.Status) + { + device.SetValue(W_ConveyorLineDB.ACK, true, item.StationCode); + } + } + } + else if (conveyorLineSignalRead.STB && conveyorLineStatus.Online && conveyorLineStatus.Goods && !conveyorLineStatus.Alarm && !conveyorLineSignalWrite.ACK && conveyorLineInfoRead.TaskNum > 0) + { + Dt_Task task = _taskRepository.QueryFirst(x => x.TaskNum == conveyorLineInfoRead.TaskNum && x.NextAddress == item.StationCode && _taskService.TaskInboundTypes.Contains(x.TaskType)); + if(task != null) + { + Dt_StationManger? stationManger = stationMangers.FirstOrDefault(x => x.StationCode == item.StationCode); + if (stationManger == null) + { + WriteInfo(item.StationName, $"鏈壘鍒板搴旂珯鍙颁俊鎭�,璁惧缂栧彿:{item.StationCode},浠诲姟鍙�:{task.TaskNum}"); + continue; + } + string? locationCode = _taskService.RequestAssignLocation(task.TaskNum, stationManger.StackerCraneCode); + if (string.IsNullOrEmpty(locationCode)) + { + WriteInfo(item.StationName, $"璇锋眰鍒嗛厤璐т綅杩斿洖淇℃伅閿欒,璁惧缂栧彿:{item.StationCode},浠诲姟鍙�:{task.TaskNum}"); + continue; + } + string oldAddress = task.NextAddress; + int oldStatus = task.TaskState; + task.CurrentAddress = stationManger.StackerCraneStationCode; + task.TargetAddress = locationCode; + task.NextAddress = locationCode; + task.DeviceCode = stationManger.StackerCraneCode; + task.TaskState = TaskStatusEnum.SC_Execute.ObjToInt(); + _taskRepository.UpdateData(task); + + _taskExecuteDetailService.AddTaskExecuteDetail(task.TaskNum, $"绯荤粺鑷姩娴佺▼,鐩爣鍦板潃鐢眥oldAddress}鍙樻洿涓簕task.NextAddress},浠诲姟鐘舵�佺敱{oldStatus}鍙樻洿涓簕task.TaskState}"); + + device.SetValue(W_ConveyorLineDB.Spare1, ConveyorWorkTypeEnum.Inbound.ObjToInt(), item.StationCode); + device.SetValue(W_ConveyorLineDB.ACK, true, item.StationCode); + } + } + else if (!conveyorLineSignalRead.STB && conveyorLineStatus.Online && conveyorLineStatus.Goods && !conveyorLineStatus.Alarm && conveyorLineSignalWrite.ACK) + { + Dt_Task task = _taskRepository.QueryFirst(x => x.CurrentAddress == item.StationCode && x.PalletCode == conveyorLineInfoRead.Barcode && x.DeviceCode == item.StationDeviceCode); + if (task != null) + { + task.CurrentAddress = item.StackerCraneStationCode; + task.TaskState = TaskStatusEnum.SC_Execute.ObjToInt(); + task.DeviceCode = item.StackerCraneCode; + _taskRepository.UpdateData(task); + } + + device.SetValue(W_ConveyorLineDB.ACK, false, item.StationCode); + } + + } + else if (item.StationType == StationTypeEnum.StationType_OnlyOutbound.ObjToInt()) + { + if (!conveyorLineSignalRead.STB && !conveyorLineSignalRead.ACK && conveyorLineStatus.Online && conveyorLineStatus.Goods && !conveyorLineStatus.Alarm && !conveyorLineSignalWrite.STB && !conveyorLineSignalWrite.ACK) + { + Dt_Task task = _taskRepository.QueryFirst(x => _taskService.TaskOutboundTypes.Contains(x.TaskType) && x.TaskState == TaskStatusEnum.Line_Execute.ObjToInt() && string.IsNullOrEmpty(x.TargetAddress) && x.DeviceCode == item.StationDeviceCode && !string.IsNullOrEmpty(x.NextAddress)); + if (task != null) + { + int oldStatus = task.TaskState; + task.TaskState = TaskStatusEnum.Line_Executing.ObjToInt(); + _taskRepository.UpdateData(task); + _taskExecuteDetailService.AddTaskExecuteDetail(task.TaskNum, $"绯荤粺鑷姩娴佺▼,浠诲姟鐘舵�佺敱{oldStatus}鍙樻洿涓簕task.TaskState}"); + device.SetValue(W_ConveyorLineDB.TaskNum, task.TaskNum, item.StationCode); + device.SetValue(W_ConveyorLineDB.EndPos, task.NextAddress, item.StationCode); + device.SetValue(W_ConveyorLineDB.StartPos, task.CurrentAddress, item.StationCode); + device.SetValue(W_ConveyorLineDB.Spare1, ConveyorWorkTypeEnum.Outbound.ObjToInt(), item.StationCode); + device.SetValue(W_ConveyorLineDB.STB, true, item.StationCode); + } + } + } + else if (item.StationType == StationTypeEnum.StationType_InboundAndOutbound.ObjToInt()) + { + if (!conveyorLineSignalRead.STB && !conveyorLineSignalRead.ACK && conveyorLineStatus.Online && !conveyorLineStatus.Goods && !conveyorLineStatus.Alarm && !conveyorLineSignalWrite.STB && !conveyorLineSignalWrite.ACK) + { + Dt_Task task = _taskRepository.QueryFirst(x => _taskService.TaskOutboundTypes.Contains(x.TaskType) && x.TaskState == TaskStatusEnum.New.ObjToInt() && string.IsNullOrEmpty(x.TargetAddress) && string.IsNullOrEmpty(x.NextAddress)); + if (task != null) + { + string oldAddress = task.NextAddress; + int oldStatus = task.TaskState; + task.NextAddress = item.StationCode; + task.DeviceCode = item.StackerCraneCode; + task.TaskState = TaskStatusEnum.SC_Execute.ObjToInt(); + task.TargetAddress = item.StationCode; + _taskRepository.UpdateData(task); + _taskExecuteDetailService.AddTaskExecuteDetail(task.TaskNum, $"绯荤粺鑷姩娴佺▼,鐩爣鍦板潃鐢眥oldAddress}鍙樻洿涓簕task.NextAddress},浠诲姟鐘舵�佺敱{oldStatus}鍙樻洿涓簕task.TaskState}"); + } + } + + if (conveyorLineSignalRead.STB && conveyorLineStatus.Online && conveyorLineStatus.Goods && !conveyorLineStatus.Alarm && !conveyorLineSignalWrite.ACK)//鍏ュ簱 + { + Dt_Task task = _taskRepository.QueryFirst(x => x.TaskNum == conveyorLineInfoRead.TaskNum && x.NextAddress == item.StationCode); + if (task != null && task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.InboundGroup) + { + Dt_StationManger? stationManger = stationMangers.FirstOrDefault(x => x.StationCode == item.StationCode); + if (stationManger == null) + { + WriteInfo(item.StationName, $"鏈壘鍒板搴旂珯鍙颁俊鎭�,璁惧缂栧彿:{item.StationCode},浠诲姟鍙�:{task.TaskNum}"); + continue; + } + string? locationCode = _taskService.RequestAssignLocation(task.TaskNum, stationManger.StackerCraneCode); + if (string.IsNullOrEmpty(locationCode)) + { + WriteInfo(item.StationName, $"璇锋眰鍒嗛厤璐т綅杩斿洖淇℃伅閿欒,璁惧缂栧彿:{item.StationCode},浠诲姟鍙�:{task.TaskNum}"); + continue; + } + string oldAddress = task.NextAddress; + int oldStatus = task.TaskState; + task.CurrentAddress = stationManger.StackerCraneStationCode; + task.TargetAddress = locationCode; + task.NextAddress = locationCode; + task.DeviceCode = stationManger.StackerCraneCode; + task.TaskState = TaskStatusEnum.SC_Execute.ObjToInt(); + _taskRepository.UpdateData(task); + + _taskExecuteDetailService.AddTaskExecuteDetail(task.TaskNum, $"绯荤粺鑷姩娴佺▼,鐩爣鍦板潃鐢眥oldAddress}鍙樻洿涓簕task.NextAddress},浠诲姟鐘舵�佺敱{oldStatus}鍙樻洿涓簕task.TaskState}"); + + device.SetValue(W_ConveyorLineDB.Spare1, ConveyorWorkTypeEnum.Inbound.ObjToInt(), item.StationCode); + device.SetValue(W_ConveyorLineDB.ACK, true, item.StationCode); + } + } + else if (!conveyorLineSignalRead.STB && conveyorLineStatus.Online && conveyorLineStatus.Goods && !conveyorLineStatus.Alarm && conveyorLineSignalWrite.ACK) + { + device.SetValue(W_ConveyorLineDB.ACK, false, item.StationCode); + } + else + { + if (!conveyorLineSignalWrite.STB && !conveyorLineSignalRead.ACK && conveyorLineStatus.Goods) + { + Dt_Task task = _taskRepository.QueryFirst(x => x.CurrentAddress == item.StationCode && x.TaskState == TaskStatusEnum.Line_Execute.ObjToInt() && x.DeviceCode == item.StationDeviceCode); + if (task != null && task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup) + { + Dt_StationManger? stationManger = stationMangers.FirstOrDefault(x => x.StationCode == item.StationCode); + if (stationManger == null) + { + WriteInfo(item.StationName, $"鏈壘鍒板搴旂珯鍙颁俊鎭�,璁惧缂栧彿:{item.StationCode},浠诲姟鍙�:{task.TaskNum}"); + continue; + } + + Dt_Router router = _routerRepository.QueryFirst(x => x.InOutType == task.TaskType && (task.CurrentAddress == x.StartPosi)); + if (router == null) + { + WriteInfo(item.StationName, $"鏈壘鍒拌矾鐢遍厤缃俊鎭�,璁惧缂栧彿:{item.StationCode},浠诲姟鍙�:{task.TaskNum}"); + continue; + } + + string oldAddress = task.NextAddress; + int oldStatus = task.TaskState; + task.NextAddress = router.NextPosi; + task.TargetAddress = router.NextPosi; + task.TaskState = TaskStatusEnum.Line_Executing.ObjToInt(); + _taskRepository.UpdateData(task); + + _taskExecuteDetailService.AddTaskExecuteDetail(task.TaskNum, $"绯荤粺鑷姩娴佺▼,鐩爣鍦板潃鐢眥oldAddress}鍙樻洿涓簕task.NextAddress},浠诲姟鐘舵�佺敱{oldStatus}鍙樻洿涓簕task.TaskState}"); + + device.SetValue(W_ConveyorLineDB.TaskNum, task.TaskNum, item.StationCode); + device.SetValue(W_ConveyorLineDB.EndPos, task.NextAddress, item.StationCode); + device.SetValue(W_ConveyorLineDB.StartPos, task.CurrentAddress, item.StationCode); + device.SetValue(W_ConveyorLineDB.Spare1, ConveyorWorkTypeEnum.Outbound.ObjToInt(), item.StationCode); + device.SetValue(W_ConveyorLineDB.STB, true, item.StationCode); + } + } + else if (conveyorLineSignalWrite.STB && conveyorLineSignalRead.ACK && conveyorLineStatus.Goods) + { + _taskService.TaskCompleted(conveyorLineInfoRead.TaskNum); + device.SetValue(W_ConveyorLineDB.STB, false, item.StationCode); + } + } + } + else if (item.StationType == StationTypeEnum.StationType_InStartAndOutEnd.ObjToInt()) + { + if (!conveyorLineSignalWrite.STB && !conveyorLineSignalWrite.ACK && !conveyorLineSignalRead.STB && !conveyorLineSignalRead.ACK && conveyorLineStatus.Goods && !conveyorLineStatus.Alarm) + { + Dt_Task outTask = _taskRepository.QueryFirst(x => _taskService.TaskOutboundTypes.Contains(x.TaskType) && x.TaskState != TaskStatusEnum.New.ObjToInt() && x.TaskState != TaskStatusEnum.SC_Execute.ObjToInt() && x.TargetAddress == item.StationCode); + if (outTask == null) + { + Dt_Task task = _taskRepository.QueryFirst(x => x.TaskState == TaskStatusEnum.New.ObjToInt() && string.IsNullOrEmpty(x.TargetAddress) && x.SourceAddress == item.StationCode && _taskService.TaskInboundTypes.Contains(x.TaskType)); + if (task != null) + { + //todo 杈撻�佺嚎宸ヤ綔妯″紡闇�瑕佸垽鏂� + + string oldAddress = task.NextAddress; + int oldStatus = task.TaskState; + task.TaskState = TaskStatusEnum.Line_Execute.ObjToInt(); + _taskRepository.UpdateData(task); + + _taskExecuteDetailService.AddTaskExecuteDetail(task.TaskNum, $"绯荤粺鑷姩娴佺▼,鐩爣鍦板潃鐢眥oldAddress}鍙樻洿涓簕task.NextAddress},浠诲姟鐘舵�佺敱{oldStatus}鍙樻洿涓簕task.TaskState}"); + + device.SetValue(W_ConveyorLineDB.TaskNum, task.TaskNum, item.StationCode); + device.SetValue(W_ConveyorLineDB.EndPos, task.NextAddress, item.StationCode); + device.SetValue(W_ConveyorLineDB.Spare1, ConveyorWorkTypeEnum.Inbound.ObjToInt(), item.StationCode); + device.SetValue(W_ConveyorLineDB.STB, true, item.StationCode); + } + } + } + else if (conveyorLineSignalWrite.STB && conveyorLineSignalRead.ACK && !conveyorLineStatus.Alarm) + { + device.SetValue(W_ConveyorLineDB.STB, false, item.StationCode); + } + else if (!conveyorLineSignalRead.STB && conveyorLineSignalWrite.ACK && !conveyorLineStatus.Alarm) + { + device.SetValue(W_ConveyorLineDB.ACK, false, item.StationCode); + } + } + } + else + { + WriteInfo(device.DeviceName, $"鏈壘鍒拌澶囧瓙缂栧彿{item.StationCode}鐨勫崗璁俊鎭�"); + } + } + } + + return Task.CompletedTask; + } + } +} diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\346\235\277\346\235\220\344\273\223/RGVJob_BC.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\346\235\277\346\235\220\344\273\223/RGVJob_BC.cs" new file mode 100644 index 0000000..71585c2 --- /dev/null +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\346\235\277\346\235\220\344\273\223/RGVJob_BC.cs" @@ -0,0 +1,184 @@ +锘縰sing Microsoft.AspNetCore.Components.Routing; +using Microsoft.IdentityModel.Tokens; +using Quartz; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WIDESEAWCS_Common; +using WIDESEAWCS_Common.Helper; +using WIDESEAWCS_Common.TaskEnum; +using WIDESEAWCS_Core; +using WIDESEAWCS_Core.Helper; +using WIDESEAWCS_IBasicInfoRepository; +using WIDESEAWCS_ITaskInfoRepository; +using WIDESEAWCS_ITaskInfoService; +using WIDESEAWCS_Model.Models; +using WIDESEAWCS_QuartzJob; +using WIDESEAWCS_QuartzJob.DTO; +using WIDESEAWCS_QuartzJob.Models; +using WIDESEAWCS_QuartzJob.Repository; +using WIDESEAWCS_QuartzJob.Service; +using WIDESEAWCS_Tasks.ConveyorLineJob; + +namespace WIDESEAWCS_Tasks +{ + [DisallowConcurrentExecution] + public class RGVJob_BC : JobBase, IJob + { + + private readonly ITaskService _taskService; + private readonly ITaskExecuteDetailService _taskExecuteDetailService; + private readonly ITaskRepository _taskRepository; + private readonly IStationMangerRepository _stationMangerRepository; + private readonly IRouterRepository _routerRepository; + private readonly IRouterService _routerService; + + public RGVJob_BC(ITaskService taskService, ITaskExecuteDetailService taskExecuteDetailService, ITaskRepository taskRepository, IStationMangerRepository stationMangerRepository, IRouterRepository routerRepository, IRouterService routerService) + { + _taskService = taskService; + _taskExecuteDetailService = taskExecuteDetailService; + _taskRepository = taskRepository; + _stationMangerRepository = stationMangerRepository; + _routerRepository = routerRepository; + _routerService = routerService; + } + + public Task Execute(IJobExecutionContext context) + { + bool flag = context.JobDetail.JobDataMap.TryGetValue("JobParams", out object? value); + if (flag && value != null) + { + OtherDevice device = (OtherDevice)value; + List<string> deviceStations = device.DeviceProDTOs.Select(x => x.DeviceChildCode).ToList(); + List<Dt_StationManger> stationMangers = _stationMangerRepository.QueryData(x => x.StationDeviceCode == device.DeviceCode); + foreach (var item in stationMangers.Where(x => deviceStations.Contains(x.StationCode))) + { + DeviceProDTO? deviceProRead = device.DeviceProDTOs.Where(x => x.DeviceChildCode == item.StationCode && x.DeviceProParamType == nameof(R_ConveyorLineDB)).OrderBy(x => x.DeviceProOffset).FirstOrDefault(); + + DeviceProDTO? deviceProWrite = device.DeviceProDTOs.Where(x => x.DeviceChildCode == item.StationCode && x.DeviceProParamType == nameof(W_ConveyorLineDB)).OrderBy(x => x.DeviceProOffset).FirstOrDefault(); + + if (deviceProRead != null && deviceProWrite != null) + { + R_ConveyorLineInfo conveyorLineInfoRead = device.Communicator.ReadCustomer<R_ConveyorLineInfo>(deviceProRead.DeviceProAddress); + + W_ConveyorLineInfo conveyorLineInfoWrite = device.Communicator.ReadCustomer<W_ConveyorLineInfo>(deviceProWrite.DeviceProAddress); + if (conveyorLineInfoRead == null || conveyorLineInfoWrite == null) + { + continue; + } + + R_ConveyorLineStatus conveyorLineStatus = conveyorLineInfoRead.Status.ByteToBoolObject<R_ConveyorLineStatus>(); + + ConveyorLineSignal conveyorLineSignalRead = conveyorLineInfoRead.Signal.ByteToBoolObject<ConveyorLineSignal>(); + + ConveyorLineSignal conveyorLineSignalWrite = conveyorLineInfoWrite.Signal.ByteToBoolObject<ConveyorLineSignal>(); + + if (item.StationType == StationTypeEnum.StationType_InStartAndOutEnd.ObjToInt()) + { + if (conveyorLineSignalRead.STB /*&& conveyorLineStatus.Online && conveyorLineStatus.Goods*/ && !conveyorLineStatus.Alarm && !conveyorLineSignalWrite.ACK && !string.IsNullOrEmpty(conveyorLineInfoRead.Barcode) && conveyorLineInfoRead.TaskNum == 0)//鍏ュ簱 + { + Dt_Task task = _taskRepository.QueryFirst(x => x.SourceAddress == item.StationDeviceCode && x.TaskState == TaskStatusEnum.New.ObjToInt() && _taskService.TaskInboundTypes.Contains(x.TaskType) && x.PalletCode == conveyorLineInfoRead.Barcode && string.IsNullOrEmpty(x.DeviceCode) && string.IsNullOrEmpty(x.NextAddress) && string.IsNullOrEmpty(x.TargetAddress)); + if (task != null && task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.InboundGroup) + { + Dt_StationManger? stationManger = stationMangers.FirstOrDefault(x => x.StationCode == item.StationCode); + if (stationManger == null) + { + WriteInfo(item.StationName, $"鏈壘鍒板搴旂珯鍙颁俊鎭�,璁惧缂栧彿:{item.StationCode},浠诲姟鍙�:{task.TaskNum}"); + continue; + } + List<Dt_Router> routers = _routerRepository.QueryData(x => x.InOutType == task.TaskType && (task.Roadway == x.ChildPosiDeviceCode || task.Roadway == x.ChildPosi)); + Dt_Router? router = routers.FirstOrDefault(); + if (router == null) + { + WriteError(device.DeviceName, $"鏈壘鍒颁换鍔$被鍨媨task.TaskType}瀵瑰簲鐨勮矾鐢变俊鎭�"); + } + else + { + if (routers.Count == 1) + { + task.Dispatchertime = DateTime.Now; + _taskService.UpdateTask(task, TaskStatusEnum.Line_Executing, deviceCode: router.ChildPosi, targetAddress: router.NextPosi, nextAddress: router.StartPosi, currentAddress: item.StationCode); + + device.SetValue(W_ConveyorLineDB.StartPos, item.StationCode, item.StationCode); + device.SetValue(W_ConveyorLineDB.EndPos, router.StartPosi, item.StationCode); + device.SetValue(W_ConveyorLineDB.TaskNum, task.TaskNum, item.StationCode); + device.SetValue(W_ConveyorLineDB.Spare1, ConveyorWorkTypeEnum.Inbound.ObjToInt(), item.StationCode); + device.SetValue(W_ConveyorLineDB.ACK, true, item.StationCode); + } + else + { + List<string> canInboundStations = new List<string>(); + List<string> stations = routers.Select(x => x.NextPosi).ToList(); + foreach (string station in stations) + { + Dt_StationManger stationManger1 = _stationMangerRepository.QueryFirst(x => x.StationCode == station); + if (stationManger1 != null) + { + IDevice? device1 = Storage.Devices.FirstOrDefault(x => x.DeviceCode == stationManger1.StationDeviceCode); + if (device1 != null) + { + OtherDevice otherDevice = (OtherDevice)device1; + //short workType = otherDevice.GetValue<R_ConveyorLineWorkType, short>(R_ConveyorLineWorkType.ConveyorLineWorkType, item.StationCode); + //if (workType == ConveyorWorkTypeEnum.Undefined.ObjToInt() || workType == ConveyorWorkTypeEnum.Inbound.ObjToInt()) + { + canInboundStations.Add(stationManger1.Remark); + } + } + } + } + + WebResponseContent responseContent = _taskService.RequestWMSAssignRoadway(task.TaskNum, canInboundStations); + if (responseContent.Status) + { + List<Dt_Router> dt_Routers = _routerService.QueryNextRoutes(item.StationCode, responseContent.Data.ToString() ?? "", task.TaskType); + + Dt_Router? routerTemp = _routerService.QueryNextRoutes(item.StationCode, responseContent.Data.ToString() ?? "", task.TaskType).FirstOrDefault(); + if (routerTemp != null) + { + task.Dispatchertime = DateTime.Now; + task.Roadway = responseContent.Data.ToString() ?? task.Roadway; + _taskService.UpdateTask(task, TaskStatusEnum.Line_Executing, deviceCode: routerTemp.ChildPosiDeviceCode, targetAddress: routerTemp.NextPosi, nextAddress: routerTemp.NextPosi, currentAddress: item.StationCode); + + device.SetValue(W_ConveyorLineDB.StartPos, item.StationCode, item.StationCode); + device.SetValue(W_ConveyorLineDB.EndPos, routerTemp.NextPosi, item.StationCode); + device.SetValue(W_ConveyorLineDB.TaskNum, task.TaskNum, item.StationCode); + device.SetValue(W_ConveyorLineDB.Spare1, ConveyorWorkTypeEnum.Inbound.ObjToInt(), item.StationCode); + device.SetValue(W_ConveyorLineDB.ACK, true, item.StationCode); + } + else + { + WriteError(device.DeviceName, $"鏈壘鍒颁换鍔$被鍨媨task.TaskType},璧风偣{item.StationCode},缁堢偣{responseContent.Data.ToString()}鐨勮矾鐢变俊鎭�"); + } + } + else + { + WriteError(device.DeviceName, responseContent.Message); + } + } + } + } + } + else if (conveyorLineSignalRead.STB && conveyorLineStatus.Online && conveyorLineStatus.Goods && !conveyorLineStatus.Alarm && !conveyorLineSignalWrite.ACK && conveyorLineInfoRead.TaskNum > 0)//鍑哄簱 + { + //_taskService.TaskCompleted(conveyorLineInfoRead.TaskNum); + device.SetValue(W_ConveyorLineDB.ACK, true, item.StationCode); + } + else if (!conveyorLineSignalRead.STB && conveyorLineSignalWrite.ACK && !conveyorLineStatus.Alarm) + { + device.SetValue(W_ConveyorLineDB.ACK, false, item.StationCode); + } + } + } + else + { + WriteError(device.DeviceName, $"鏈壘鍒拌澶囧瓙缂栧彿{item.StationCode}鐨勫崗璁俊鎭�"); + } + } + } + + return Task.CompletedTask; + } + } +} diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\346\235\277\346\235\220\344\273\223/StackerCraneJob_BC.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\346\235\277\346\235\220\344\273\223/StackerCraneJob_BC.cs" index 14ec422..b79bd18 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\346\235\277\346\235\220\344\273\223/StackerCraneJob_BC.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\346\235\277\346\235\220\344\273\223/StackerCraneJob_BC.cs" @@ -25,6 +25,7 @@ using WIDESEAWCS_Core; using WIDESEAWCS_Core.Caches; using Newtonsoft.Json; +using WIDESEAWCS_TaskInfoService; namespace WIDESEAWCS_Tasks { @@ -87,12 +88,9 @@ if (sendFlag) { commonStackerCrane.LastTaskType = task.TaskType; - int oldState = task.TaskState; - task.TaskState = TaskStatusEnum.SC_Executing.ObjToInt(); task.Dispatchertime = DateTime.Now; task.ExceptionMessage = ""; - _taskRepository.UpdateData(task); - _taskExecuteDetailService.AddTaskExecuteDetail(task.TaskId, $"绯荤粺鑷姩娴佺▼锛屼换鍔$姸鎬佷粠銆恵oldState}銆戣浆鍒般�恵task.TaskState}銆�"); + _taskService.UpdateTask(task, TaskStatusEnum.SC_Executing); } } } @@ -136,17 +134,11 @@ Dt_StationManger stationManger = _stationMangerRepository.QueryFirst(x => x.StackerCraneStationCode == task.NextAddress); if (stationManger == null) { - _taskExecuteDetailService.AddTaskExecuteDetail(taskNum, $"AGV绔欑偣鏈厤缃�,{task.NextAddress}"); - _taskService.UpdateTaskExceptionMessage(taskNum, $"AGV绔欑偣鏈厤缃�,{task.NextAddress}"); - return WebResponseContent.Instance.Error($"AGV绔欑偣鏈厤缃�,{task.NextAddress}"); + _taskExecuteDetailService.AddTaskExecuteDetail(taskNum, $"杈撻�佺嚎鍑哄簱绔欑偣鏈厤缃�,{task.NextAddress}"); + _taskService.UpdateTaskExceptionMessage(taskNum, $"杈撻�佺嚎鍑哄簱绔欑偣鏈厤缃�,{task.NextAddress}"); + return WebResponseContent.Instance.Error($"杈撻�佺嚎鍑哄簱绔欑偣鏈厤缃�,{task.NextAddress}"); } - int oldStatus = task.TaskState; - task.DeviceCode = "AGV_CSJ"; - task.TaskState = TaskStatusEnum.AGV_Execute.ObjToInt(); - task.CurrentAddress = stationManger.AGVStationCode; - task.NextAddress = task.TargetAddress; - _taskRepository.UpdateData(task); - _taskExecuteDetailService.AddTaskExecuteDetail(taskNum, $"绯荤粺鑷姩娴佺▼,锛屼换鍔$姸鎬佷粠銆恵oldStatus}銆戣浆鍒般�恵task.TaskState}銆�"); + _taskService.UpdateTask(task, TaskStatusEnum.Line_Execute, deviceCode: stationManger.StationDeviceCode, currentAddress: stationManger.StationCode, nextAddress: task.TargetAddress); } else if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.InboundGroup || task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.RelocationGroup) { @@ -154,14 +146,14 @@ } else { - WriteInfo(deviceCode, $"鏈壘鍒拌浠诲姟绫诲瀷鍥炶皟WMS浠诲姟瀹屾垚鎺ュ彛,{task.TaskType}"); + WriteError(deviceCode, $"鏈壘鍒拌浠诲姟绫诲瀷鍥炶皟WMS浠诲姟瀹屾垚鎺ュ彛,{task.TaskType}"); _taskExecuteDetailService.AddTaskExecuteDetail(taskNum, $"鏈壘鍒拌浠诲姟绫诲瀷鍥炶皟WMS浠诲姟瀹屾垚鎺ュ彛,{task.TaskType}"); _taskService.UpdateTaskExceptionMessage(taskNum, $"鏈壘鍒拌浠诲姟绫诲瀷鍥炶皟WMS浠诲姟瀹屾垚鎺ュ彛,{task.TaskType}"); } } else { - WriteInfo(deviceCode, $"鏈壘鍒颁换鍔′俊鎭�,浠诲姟鍙�:{taskNum}"); + WriteError(deviceCode, $"鏈壘鍒颁换鍔′俊鎭�,浠诲姟鍙�:{taskNum}"); return WebResponseContent.Instance.Error($"鏈壘鍒颁换鍔′俊鎭�,浠诲姟鍙�:{taskNum}"); } @@ -234,7 +226,7 @@ if (string.IsNullOrEmpty(url)) { _taskExecuteDetailService.AddTaskExecuteDetail(task.TaskNum, $"鏈壘鍒癢MS绉诲簱鍒ゆ柇鎺ュ彛"); - WriteInfo(commonStackerCrane.DeviceCode, $"鏈壘鍒癢MS绉诲簱鍒ゆ柇鎺ュ彛"); + WriteError(commonStackerCrane.DeviceCode, $"鏈壘鍒癢MS绉诲簱鍒ゆ柇鎺ュ彛"); _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"鏈壘鍒癢MS绉诲簱鍒ゆ柇鎺ュ彛"); return null; } @@ -268,13 +260,13 @@ } else { - WriteInfo(task.DeviceCode, $"鏈壘鍒板嚭搴撶珯鍙般�恵stationManger.StationDeviceCode}銆戝搴旂殑閫氳瀵硅薄锛屾棤娉曞垽鏂嚭搴撶珯鍙版槸鍚﹁鍗犵敤"); + WriteError(task.DeviceCode, $"鏈壘鍒板嚭搴撶珯鍙般�恵stationManger.StationDeviceCode}銆戝搴旂殑閫氳瀵硅薄锛屾棤娉曞垽鏂嚭搴撶珯鍙版槸鍚﹁鍗犵敤"); _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"鏈壘鍒板嚭搴撶珯鍙般�恵stationManger.StationDeviceCode}銆戝搴旂殑閫氳瀵硅薄锛屾棤娉曞垽鏂嚭搴撶珯鍙版槸鍚﹁鍗犵敤"); } } else { - WriteInfo(task.DeviceCode, $"鏈壘鍒扮珯鍙般�恵task.NextAddress}銆戜俊鎭紝鏃犳硶鏍¢獙绔欏彴"); + WriteError(task.DeviceCode, $"鏈壘鍒扮珯鍙般�恵task.NextAddress}銆戜俊鎭紝鏃犳硶鏍¢獙绔欏彴"); _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"鏈壘鍒扮珯鍙般�恵task.NextAddress}銆戜俊鎭紝鏃犳硶鏍¢獙绔欏彴"); } return null; @@ -306,7 +298,7 @@ else { _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"鍏ュ簱浠诲姟璧风偣閿欒锛岃捣鐐癸細銆恵task.CurrentAddress}銆�"); - WriteInfo(task.DeviceCode, $"鍏ュ簱浠诲姟璧风偣閿欒锛岃捣鐐癸細銆恵task.CurrentAddress}銆�"); + WriteError(task.DeviceCode, $"鍏ュ簱浠诲姟璧风偣閿欒锛岃捣鐐癸細銆恵task.CurrentAddress}銆�"); return null; } @@ -321,7 +313,7 @@ { //鏁版嵁閰嶇疆閿欒 _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"鍏ュ簱浠诲姟缁堢偣閿欒锛岀粓鐐癸細銆恵task.NextAddress}銆�"); - WriteInfo(task.DeviceCode, $"鍏ュ簱浠诲姟缁堢偣閿欒锛岀粓鐐癸細銆恵task.NextAddress}銆�"); + WriteError(task.DeviceCode, $"鍏ュ簱浠诲姟缁堢偣閿欒锛岀粓鐐癸細銆恵task.NextAddress}銆�"); return null; } } @@ -339,7 +331,7 @@ { //鏁版嵁閰嶇疆閿欒 _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"鍑哄簱浠诲姟缁堢偣閿欒锛岀粓鐐癸細銆恵task.NextAddress}銆�"); - WriteInfo(task.DeviceCode, $"鍑哄簱浠诲姟缁堢偣閿欒锛岀粓鐐癸細銆恵task.NextAddress}銆�"); + WriteError(task.DeviceCode, $"鍑哄簱浠诲姟缁堢偣閿欒锛岀粓鐐癸細銆恵task.NextAddress}銆�"); return null; } @@ -354,7 +346,7 @@ { //鏁版嵁閰嶇疆閿欒 _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"鍑哄簱浠诲姟璧风偣閿欒锛岃捣鐐癸細銆恵task.CurrentAddress}銆�"); - WriteInfo(task.DeviceCode, $"鍑哄簱浠诲姟璧风偣閿欒锛岃捣鐐癸細銆恵task.CurrentAddress}銆�"); + WriteError(task.DeviceCode, $"鍑哄簱浠诲姟璧风偣閿欒锛岃捣鐐癸細銆恵task.CurrentAddress}銆�"); return null; } } @@ -371,7 +363,7 @@ { //鏁版嵁閰嶇疆閿欒 _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"绉诲簱浠诲姟缁堢偣閿欒锛岀粓鐐癸細銆恵task.NextAddress}銆�"); - WriteInfo(task.DeviceCode, $"绉诲簱浠诲姟缁堢偣閿欒锛岀粓鐐癸細銆恵task.NextAddress}銆�"); + WriteError(task.DeviceCode, $"绉诲簱浠诲姟缁堢偣閿欒锛岀粓鐐癸細銆恵task.NextAddress}銆�"); return null; } string[] sourceCodes = task.CurrentAddress.Split("-"); @@ -385,7 +377,7 @@ { //鏁版嵁閰嶇疆閿欒 _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"绉诲簱浠诲姟璧风偣閿欒锛岃捣鐐癸細銆恵task.CurrentAddress}銆�"); - WriteInfo(task.DeviceCode, $"绉诲簱浠诲姟璧风偣閿欒锛岃捣鐐癸細銆恵task.CurrentAddress}銆�"); + WriteError(task.DeviceCode, $"绉诲簱浠诲姟璧风偣閿欒锛岃捣鐐癸細銆恵task.CurrentAddress}銆�"); return null; } } diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\346\262\271\345\242\250\344\273\223/CommonHoisterJob.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\346\262\271\345\242\250\344\273\223/CommonHoisterJob.cs" index c12061d..d94d4dd 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\346\262\271\345\242\250\344\273\223/CommonHoisterJob.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\346\262\271\345\242\250\344\273\223/CommonHoisterJob.cs" @@ -48,7 +48,7 @@ List<Dt_StationManger> stationMangers = _stationMangerRepository.QueryData(x => x.StationDeviceCode == hoister.DeviceCode); if (stationMangers == null || stationMangers.Count == 0) { - WriteInfo(hoister.DeviceName, "鏈壘鍒板搴旂珯鍙颁俊鎭�"); + WriteError(hoister.DeviceName, "鏈壘鍒板搴旂珯鍙颁俊鎭�"); return Task.CompletedTask; } @@ -68,7 +68,7 @@ if (task != null) { bool isWrite = hoister.SetValue(HoisterDBName.RequestIn, true, deviceChildCode); - WriteInfo(hoister.DeviceName, $"璇锋眰鍏ュ簱,璁惧缂栧彿:{deviceChildCode},浠诲姟鍙�:{task.TaskNum}"); + WriteError(hoister.DeviceName, $"璇锋眰鍏ュ簱,璁惧缂栧彿:{deviceChildCode},浠诲姟鍙�:{task.TaskNum}"); } } else if (!leisure && tray && requestIn && inbounding && !requestOut && !outbounding) @@ -79,13 +79,13 @@ Dt_StationManger? stationManger = stationMangers.FirstOrDefault(x => x.StationCode == deviceChildCode); if (stationManger == null) { - WriteInfo(hoister.DeviceName, $"鏈壘鍒板搴旂珯鍙颁俊鎭�,璁惧缂栧彿:{deviceChildCode},浠诲姟鍙�:{task.TaskNum}"); + WriteError(hoister.DeviceName, $"鏈壘鍒板搴旂珯鍙颁俊鎭�,璁惧缂栧彿:{deviceChildCode},浠诲姟鍙�:{task.TaskNum}"); break; } string? locationCode = _taskService.RequestAssignLocation(task.TaskNum, stationManger.StackerCraneCode); if (string.IsNullOrEmpty(locationCode)) { - WriteInfo(hoister.DeviceName, $"璇锋眰鍒嗛厤璐т綅杩斿洖淇℃伅閿欒,璁惧缂栧彿:{deviceChildCode},浠诲姟鍙�:{task.TaskNum}"); + WriteError(hoister.DeviceName, $"璇锋眰鍒嗛厤璐т綅杩斿洖淇℃伅閿欒,璁惧缂栧彿:{deviceChildCode},浠诲姟鍙�:{task.TaskNum}"); break; } task.CurrentAddress = stationManger.StackerCraneStationCode; @@ -99,7 +99,7 @@ } else { - WriteInfo(hoister.DeviceName, $"鏈壘鍒板搴斾换鍔′俊鎭�,{deviceChildCode}"); + WriteError(hoister.DeviceName, $"鏈壘鍒板搴斾换鍔′俊鎭�,{deviceChildCode}"); } } else if (leisure && !tray && !requestIn && !inbounding && !requestOut && !outbounding) @@ -108,7 +108,7 @@ if (task != null) { bool isWrite = hoister.SetValue(HoisterDBName.RequestOut, true, deviceChildCode); - WriteInfo(hoister.DeviceName, $"璇锋眰鍑哄簱,璁惧缂栧彿:{deviceChildCode},浠诲姟鍙�:{task.TaskNum}"); + WriteError(hoister.DeviceName, $"璇锋眰鍑哄簱,璁惧缂栧彿:{deviceChildCode},浠诲姟鍙�:{task.TaskNum}"); } } else if (!leisure && !tray && !requestIn && !inbounding && requestOut && outbounding) @@ -119,7 +119,7 @@ Dt_StationManger? stationManger = stationMangers.FirstOrDefault(x => x.StationCode == deviceChildCode); if (stationManger == null) { - WriteInfo(hoister.DeviceName, $"鏈壘鍒板搴旂珯鍙颁俊鎭�,璁惧缂栧彿:{deviceChildCode},浠诲姟鍙�:{task.TaskNum}"); + WriteError(hoister.DeviceName, $"鏈壘鍒板搴旂珯鍙颁俊鎭�,璁惧缂栧彿:{deviceChildCode},浠诲姟鍙�:{task.TaskNum}"); break; } @@ -133,7 +133,7 @@ } else { - WriteInfo(hoister.DeviceName, $"鏈壘鍒板搴旂珯鍙颁俊鎭�,{deviceChildCode}"); + WriteError(hoister.DeviceName, $"鏈壘鍒板搴旂珯鍙颁俊鎭�,{deviceChildCode}"); } } } diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\346\262\271\345\242\250\344\273\223/StackerCraneJob_YM.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\346\262\271\345\242\250\344\273\223/StackerCraneJob_YM.cs" index f27d1fc..888e499 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\346\262\271\345\242\250\344\273\223/StackerCraneJob_YM.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\346\262\271\345\242\250\344\273\223/StackerCraneJob_YM.cs" @@ -77,12 +77,9 @@ if (sendFlag) { commonStackerCrane.LastTaskType = task.TaskType; - int oldState = task.TaskState; - task.TaskState = TaskStatusEnum.SC_Executing.ObjToInt(); - task.ExceptionMessage = ""; task.Dispatchertime = DateTime.Now; - _taskRepository.UpdateData(task); - _taskExecuteDetailService.AddTaskExecuteDetail(task.TaskId, $"绯荤粺鑷姩娴佺▼锛屼换鍔$姸鎬佷粠銆恵oldState}銆戣浆鍒般�恵task.TaskState}銆�"); + task.ExceptionMessage = ""; + _taskService.UpdateTask(task, TaskStatusEnum.SC_Executing); } } } @@ -113,7 +110,7 @@ { if (commonStackerCrane.GetValue<StackerCraneDBName, short>(StackerCraneDBName.WorkType) != 5) { - WriteInfo(commonStackerCrane.DeviceName, $"璇诲彇鍒颁换鍔″畬鎴愪俊鍙�,{e.TaskNum}"); + WriteDebug(commonStackerCrane.DeviceName, $"璇诲彇鍒颁换鍔″畬鎴愪俊鍙�,{e.TaskNum}"); Dt_Task task = _taskRepository.QueryFirst(x => x.TaskNum == e.TaskNum); if (task != null) { @@ -121,7 +118,7 @@ } else { - WriteInfo(commonStackerCrane.DeviceName, $"璇诲彇鍒颁换鍔″畬鎴愪俊鍙�,鏈壘鍒板搴旂殑浠诲姟淇℃伅,{e.TaskNum}"); + WriteError(commonStackerCrane.DeviceName, $"璇诲彇鍒颁换鍔″畬鎴愪俊鍙�,鏈壘鍒板搴旂殑浠诲姟淇℃伅,{e.TaskNum}"); } commonStackerCrane.SetValue(StackerCraneDBName.WorkType, 5); } @@ -130,7 +127,6 @@ catch (Exception ex) { WriteError(commonStackerCrane?.DeviceCode ?? nameof(StackerCraneJob_YM), ex.Message, ex); - } } @@ -249,7 +245,7 @@ else { _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"鍏ュ簱浠诲姟璧风偣閿欒锛岃捣鐐癸細銆恵task.CurrentAddress}銆�"); - WriteInfo(task.DeviceCode, $"鍏ュ簱浠诲姟璧风偣閿欒锛岃捣鐐癸細銆恵task.CurrentAddress}銆�"); + WriteError(task.DeviceCode, $"鍏ュ簱浠诲姟璧风偣閿欒锛岃捣鐐癸細銆恵task.CurrentAddress}銆�"); return null; } @@ -264,7 +260,7 @@ { //鏁版嵁閰嶇疆閿欒 _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"鍏ュ簱浠诲姟缁堢偣閿欒锛岀粓鐐癸細銆恵task.NextAddress}銆�"); - WriteInfo(task.DeviceCode, $"鍏ュ簱浠诲姟缁堢偣閿欒锛岀粓鐐癸細銆恵task.NextAddress}銆�"); + WriteError(task.DeviceCode, $"鍏ュ簱浠诲姟缁堢偣閿欒锛岀粓鐐癸細銆恵task.NextAddress}銆�"); return null; } } @@ -282,7 +278,7 @@ { //鏁版嵁閰嶇疆閿欒 _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"鍑哄簱浠诲姟缁堢偣閿欒锛岀粓鐐癸細銆恵task.NextAddress}銆�"); - WriteInfo(task.DeviceCode, $"鍑哄簱浠诲姟缁堢偣閿欒锛岀粓鐐癸細銆恵task.NextAddress}銆�"); + WriteError(task.DeviceCode, $"鍑哄簱浠诲姟缁堢偣閿欒锛岀粓鐐癸細銆恵task.NextAddress}銆�"); return null; } @@ -297,7 +293,7 @@ { //鏁版嵁閰嶇疆閿欒 _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"鍑哄簱浠诲姟璧风偣閿欒锛岃捣鐐癸細銆恵task.CurrentAddress}銆�"); - WriteInfo(task.DeviceCode, $"鍑哄簱浠诲姟璧风偣閿欒锛岃捣鐐癸細銆恵task.CurrentAddress}銆�"); + WriteError(task.DeviceCode, $"鍑哄簱浠诲姟璧风偣閿欒锛岃捣鐐癸細銆恵task.CurrentAddress}銆�"); return null; } } @@ -314,7 +310,7 @@ { //鏁版嵁閰嶇疆閿欒 _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"绉诲簱浠诲姟缁堢偣閿欒锛岀粓鐐癸細銆恵task.NextAddress}銆�"); - WriteInfo(task.DeviceCode, $"绉诲簱浠诲姟缁堢偣閿欒锛岀粓鐐癸細銆恵task.NextAddress}銆�"); + WriteError(task.DeviceCode, $"绉诲簱浠诲姟缁堢偣閿欒锛岀粓鐐癸細銆恵task.NextAddress}銆�"); return null; } string[] sourceCodes = task.CurrentAddress.Split("-"); @@ -328,7 +324,7 @@ { //鏁版嵁閰嶇疆閿欒 _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"绉诲簱浠诲姟璧风偣閿欒锛岃捣鐐癸細銆恵task.CurrentAddress}銆�"); - WriteInfo(task.DeviceCode, $"绉诲簱浠诲姟璧风偣閿欒锛岃捣鐐癸細銆恵task.CurrentAddress}銆�"); + WriteError(task.DeviceCode, $"绉诲簱浠诲姟璧风偣閿欒锛岃捣鐐癸細銆恵task.CurrentAddress}銆�"); return null; } } diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\346\265\213\350\257\225\346\236\266\344\273\223/GroundStationJob_CSJ.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\346\265\213\350\257\225\346\236\266\344\273\223/GroundStationJob_CSJ.cs" index adaece9..d2ae90d 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\346\265\213\350\257\225\346\236\266\344\273\223/GroundStationJob_CSJ.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\346\265\213\350\257\225\346\236\266\344\273\223/GroundStationJob_CSJ.cs" @@ -43,7 +43,7 @@ { if (device == null) { - WriteInfo(nameof(GroundStationJob_CSJ), "璋冨害閿欒,璁惧瀵硅薄浼犲�间负null"); + WriteError(nameof(GroundStationJob_CSJ), "璋冨害閿欒,璁惧瀵硅薄浼犲�间负null"); return Task.CompletedTask; } List<string> deviceStations = device.DeviceProDTOs.Select(x => x.DeviceChildCode).ToList(); @@ -64,12 +64,7 @@ Dt_Task task = _taskRepository.QueryFirst(x => x.DeviceCode == item.StackerCraneCode && x.TaskState == TaskStatusEnum.SC_Execute.ObjToInt() && string.IsNullOrEmpty(x.NextAddress)); if (task != null && isCanPut && !isCanTake && !putRequest && !putFinish && !takeRequest && !takeFinish) { - string oldAddress = task.NextAddress; - int oldStatus = task.TaskState; - task.TaskState = TaskStatusEnum.SC_Execute.ObjToInt(); - task.NextAddress = item.StationCode; - _taskRepository.UpdateData(task); - _taskExecuteDetailService.AddTaskExecuteDetail(task.TaskNum, $"绯荤粺鑷姩娴佺▼,鐩爣鍦板潃鐢眥oldAddress}鍙樻洿涓簕task.NextAddress},浠诲姟鐘舵�佺敱{oldStatus}鍙樻洿涓簕task.TaskState}"); + _taskService.UpdateTask(task, TaskStatusEnum.SC_Execute, nextAddress: item.StationCode); } } if (item.StationType == StationTypeEnum.StationType_OnlyInbound.ObjToInt()) @@ -82,22 +77,16 @@ Dt_StationManger? stationManger = stationMangers.FirstOrDefault(x => x.StationCode == item.StationCode); if (stationManger == null) { - WriteInfo(item.StationName, $"鏈壘鍒板搴旂珯鍙颁俊鎭�,璁惧缂栧彿:{item.StationCode},浠诲姟鍙�:{task.TaskNum}"); + WriteError(item.StationName, $"鏈壘鍒板搴旂珯鍙颁俊鎭�,璁惧缂栧彿:{item.StationCode},浠诲姟鍙�:{task.TaskNum}"); continue; } string? locationCode = _taskService.RequestAssignLocation(task.TaskNum, stationManger.StackerCraneCode); if (string.IsNullOrEmpty(locationCode)) { - WriteInfo(item.StationName, $"璇锋眰鍒嗛厤璐т綅杩斿洖淇℃伅閿欒,璁惧缂栧彿:{item.StationCode},浠诲姟鍙�:{task.TaskNum}"); + WriteError(item.StationName, $"璇锋眰鍒嗛厤璐т綅杩斿洖淇℃伅閿欒,璁惧缂栧彿:{item.StationCode},浠诲姟鍙�:{task.TaskNum}"); continue; } - task.TaskState = TaskStatusEnum.SC_Execute.ObjToInt(); - task.CurrentAddress = stationManger.StackerCraneStationCode; - task.TargetAddress = locationCode; - task.NextAddress = locationCode; - task.DeviceCode = stationManger.StackerCraneCode; - _taskRepository.UpdateData(task); - _taskExecuteDetailService.AddTaskExecuteDetail(task.TaskNum, $"绯荤粺鑷姩娴佺▼,鐩爣鍦板潃鐢眥oldAddress}鍙樻洿涓簕task.NextAddress},浠诲姟鐘舵�佺敱{oldStatus}鍙樻洿涓簕task.TaskState}"); + _taskService.UpdateTask(task, TaskStatusEnum.SC_Execute, currentAddress: stationManger.StackerCraneStationCode, targetAddress: locationCode, nextAddress: locationCode, deviceCode: stationManger.StackerCraneCode); } } } @@ -117,25 +106,16 @@ Dt_StationManger? stationManger = stationMangers.FirstOrDefault(x => x.StationCode == item.StationCode); if (stationManger == null) { - WriteInfo(item.StationName, $"鏈壘鍒板搴旂珯鍙颁俊鎭�,璁惧缂栧彿:{item.StationCode},浠诲姟鍙�:{task.TaskNum}"); + WriteError(item.StationName, $"鏈壘鍒板搴旂珯鍙颁俊鎭�,璁惧缂栧彿:{item.StationCode},浠诲姟鍙�:{task.TaskNum}"); continue; } string? locationCode = _taskService.RequestAssignLocation(task.TaskNum, stationManger.StackerCraneCode); if (string.IsNullOrEmpty(locationCode)) { - WriteInfo(item.StationName, $"璇锋眰鍒嗛厤璐т綅杩斿洖淇℃伅閿欒,璁惧缂栧彿:{item.StationCode},浠诲姟鍙�:{task.TaskNum}"); + WriteError(item.StationName, $"璇锋眰鍒嗛厤璐т綅杩斿洖淇℃伅閿欒,璁惧缂栧彿:{item.StationCode},浠诲姟鍙�:{task.TaskNum}"); continue; } - string oldAddress = task.NextAddress; - int oldStatus = task.TaskState; - task.CurrentAddress = stationManger.StackerCraneStationCode; - task.TargetAddress = locationCode; - task.NextAddress = locationCode; - task.DeviceCode = stationManger.StackerCraneCode; - task.TaskState = TaskStatusEnum.SC_Execute.ObjToInt(); - _taskRepository.UpdateData(task); - - _taskExecuteDetailService.AddTaskExecuteDetail(task.TaskNum, $"绯荤粺鑷姩娴佺▼,鐩爣鍦板潃鐢眥oldAddress}鍙樻洿涓簕task.NextAddress},浠诲姟鐘舵�佺敱{oldStatus}鍙樻洿涓簕task.TaskState}"); + _taskService.UpdateTask(task, TaskStatusEnum.SC_Execute, currentAddress: stationManger.StackerCraneStationCode, targetAddress: locationCode, nextAddress: locationCode, deviceCode: stationManger.StackerCraneCode); } } catch (Exception ex) diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\346\265\213\350\257\225\346\236\266\344\273\223/StackerCraneJob_CSJ.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\346\265\213\350\257\225\346\236\266\344\273\223/StackerCraneJob_CSJ.cs" index c9593f4..cbe865d 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\346\265\213\350\257\225\346\236\266\344\273\223/StackerCraneJob_CSJ.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\346\265\213\350\257\225\346\236\266\344\273\223/StackerCraneJob_CSJ.cs" @@ -87,12 +87,9 @@ if (sendFlag) { commonStackerCrane.LastTaskType = task.TaskType; - int oldState = task.TaskState; - task.TaskState = TaskStatusEnum.SC_Executing.ObjToInt(); task.Dispatchertime = DateTime.Now; task.ExceptionMessage = ""; - _taskRepository.UpdateData(task); - _taskExecuteDetailService.AddTaskExecuteDetail(task.TaskId, $"绯荤粺鑷姩娴佺▼锛屼换鍔$姸鎬佷粠銆恵oldState}銆戣浆鍒般�恵task.TaskState}銆�"); + _taskService.UpdateTask(task, TaskStatusEnum.SC_Executing); } } } @@ -140,13 +137,8 @@ _taskService.UpdateTaskExceptionMessage(taskNum, $"AGV绔欑偣鏈厤缃�,{task.NextAddress}"); return WebResponseContent.Instance.Error($"AGV绔欑偣鏈厤缃�,{task.NextAddress}"); } - int oldStatus = task.TaskState; - task.DeviceCode = "AGV_CSJ"; - task.TaskState = TaskStatusEnum.AGV_Execute.ObjToInt(); - task.CurrentAddress = stationManger.AGVStationCode; - task.NextAddress = task.TargetAddress; - _taskRepository.UpdateData(task); - _taskExecuteDetailService.AddTaskExecuteDetail(taskNum, $"绯荤粺鑷姩娴佺▼,锛屼换鍔$姸鎬佷粠銆恵oldStatus}銆戣浆鍒般�恵task.TaskState}銆�"); + + _taskService.UpdateTask(task, TaskStatusEnum.AGV_Execute, deviceCode: "AGV_CSJ", currentAddress: stationManger.AGVStationCode ?? throw new Exception($"agv绔欑偣閿欒"), nextAddress: task.TargetAddress); } else if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.InboundGroup || task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.RelocationGroup) { @@ -154,14 +146,14 @@ } else { - WriteInfo(deviceCode, $"鏈壘鍒拌浠诲姟绫诲瀷鍥炶皟WMS浠诲姟瀹屾垚鎺ュ彛,{task.TaskType}"); + WriteError(deviceCode, $"鏈壘鍒拌浠诲姟绫诲瀷鍥炶皟WMS浠诲姟瀹屾垚鎺ュ彛,{task.TaskType}"); _taskExecuteDetailService.AddTaskExecuteDetail(taskNum, $"鏈壘鍒拌浠诲姟绫诲瀷鍥炶皟WMS浠诲姟瀹屾垚鎺ュ彛,{task.TaskType}"); _taskService.UpdateTaskExceptionMessage(taskNum, $"鏈壘鍒拌浠诲姟绫诲瀷鍥炶皟WMS浠诲姟瀹屾垚鎺ュ彛,{task.TaskType}"); } } else { - WriteInfo(deviceCode, $"鏈壘鍒颁换鍔′俊鎭�,浠诲姟鍙�:{taskNum}"); + WriteError(deviceCode, $"鏈壘鍒颁换鍔′俊鎭�,浠诲姟鍙�:{taskNum}"); return WebResponseContent.Instance.Error($"鏈壘鍒颁换鍔′俊鎭�,浠诲姟鍙�:{taskNum}"); } @@ -234,7 +226,7 @@ if (string.IsNullOrEmpty(url)) { _taskExecuteDetailService.AddTaskExecuteDetail(task.TaskNum, $"鏈壘鍒癢MS绉诲簱鍒ゆ柇鎺ュ彛"); - WriteInfo(commonStackerCrane.DeviceCode, $"鏈壘鍒癢MS绉诲簱鍒ゆ柇鎺ュ彛"); + WriteError(commonStackerCrane.DeviceCode, $"鏈壘鍒癢MS绉诲簱鍒ゆ柇鎺ュ彛"); _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"鏈壘鍒癢MS绉诲簱鍒ゆ柇鎺ュ彛"); return null; } @@ -268,13 +260,13 @@ } else { - WriteInfo(task.DeviceCode, $"鏈壘鍒板嚭搴撶珯鍙般�恵stationManger.StationDeviceCode}銆戝搴旂殑閫氳瀵硅薄锛屾棤娉曞垽鏂嚭搴撶珯鍙版槸鍚﹁鍗犵敤"); + WriteError(task.DeviceCode, $"鏈壘鍒板嚭搴撶珯鍙般�恵stationManger.StationDeviceCode}銆戝搴旂殑閫氳瀵硅薄锛屾棤娉曞垽鏂嚭搴撶珯鍙版槸鍚﹁鍗犵敤"); _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"鏈壘鍒板嚭搴撶珯鍙般�恵stationManger.StationDeviceCode}銆戝搴旂殑閫氳瀵硅薄锛屾棤娉曞垽鏂嚭搴撶珯鍙版槸鍚﹁鍗犵敤"); } } else { - WriteInfo(task.DeviceCode, $"鏈壘鍒扮珯鍙般�恵task.NextAddress}銆戜俊鎭紝鏃犳硶鏍¢獙绔欏彴"); + WriteError(task.DeviceCode, $"鏈壘鍒扮珯鍙般�恵task.NextAddress}銆戜俊鎭紝鏃犳硶鏍¢獙绔欏彴"); _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"鏈壘鍒扮珯鍙般�恵task.NextAddress}銆戜俊鎭紝鏃犳硶鏍¢獙绔欏彴"); } return null; @@ -306,7 +298,7 @@ else { _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"鍏ュ簱浠诲姟璧风偣閿欒锛岃捣鐐癸細銆恵task.CurrentAddress}銆�"); - WriteInfo(task.DeviceCode, $"鍏ュ簱浠诲姟璧风偣閿欒锛岃捣鐐癸細銆恵task.CurrentAddress}銆�"); + WriteError(task.DeviceCode, $"鍏ュ簱浠诲姟璧风偣閿欒锛岃捣鐐癸細銆恵task.CurrentAddress}銆�"); return null; } @@ -321,7 +313,7 @@ { //鏁版嵁閰嶇疆閿欒 _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"鍏ュ簱浠诲姟缁堢偣閿欒锛岀粓鐐癸細銆恵task.NextAddress}銆�"); - WriteInfo(task.DeviceCode, $"鍏ュ簱浠诲姟缁堢偣閿欒锛岀粓鐐癸細銆恵task.NextAddress}銆�"); + WriteError(task.DeviceCode, $"鍏ュ簱浠诲姟缁堢偣閿欒锛岀粓鐐癸細銆恵task.NextAddress}銆�"); return null; } } @@ -339,7 +331,7 @@ { //鏁版嵁閰嶇疆閿欒 _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"鍑哄簱浠诲姟缁堢偣閿欒锛岀粓鐐癸細銆恵task.NextAddress}銆�"); - WriteInfo(task.DeviceCode, $"鍑哄簱浠诲姟缁堢偣閿欒锛岀粓鐐癸細銆恵task.NextAddress}銆�"); + WriteError(task.DeviceCode, $"鍑哄簱浠诲姟缁堢偣閿欒锛岀粓鐐癸細銆恵task.NextAddress}銆�"); return null; } @@ -354,7 +346,7 @@ { //鏁版嵁閰嶇疆閿欒 _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"鍑哄簱浠诲姟璧风偣閿欒锛岃捣鐐癸細銆恵task.CurrentAddress}銆�"); - WriteInfo(task.DeviceCode, $"鍑哄簱浠诲姟璧风偣閿欒锛岃捣鐐癸細銆恵task.CurrentAddress}銆�"); + WriteError(task.DeviceCode, $"鍑哄簱浠诲姟璧风偣閿欒锛岃捣鐐癸細銆恵task.CurrentAddress}銆�"); return null; } } @@ -371,7 +363,7 @@ { //鏁版嵁閰嶇疆閿欒 _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"绉诲簱浠诲姟缁堢偣閿欒锛岀粓鐐癸細銆恵task.NextAddress}銆�"); - WriteInfo(task.DeviceCode, $"绉诲簱浠诲姟缁堢偣閿欒锛岀粓鐐癸細銆恵task.NextAddress}銆�"); + WriteError(task.DeviceCode, $"绉诲簱浠诲姟缁堢偣閿欒锛岀粓鐐癸細銆恵task.NextAddress}銆�"); return null; } string[] sourceCodes = task.CurrentAddress.Split("-"); @@ -385,7 +377,7 @@ { //鏁版嵁閰嶇疆閿欒 _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"绉诲簱浠诲姟璧风偣閿欒锛岃捣鐐癸細銆恵task.CurrentAddress}銆�"); - WriteInfo(task.DeviceCode, $"绉诲簱浠诲姟璧风偣閿欒锛岃捣鐐癸細銆恵task.CurrentAddress}銆�"); + WriteError(task.DeviceCode, $"绉诲簱浠诲姟璧风偣閿欒锛岃捣鐐癸細銆恵task.CurrentAddress}銆�"); return null; } } diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSClient/src/views/basic/materielInfo.vue" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSClient/src/views/basic/materielInfo.vue" index b2f15b4..aaacaa0 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSClient/src/views/basic/materielInfo.vue" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSClient/src/views/basic/materielInfo.vue" @@ -93,10 +93,11 @@ }, { field: "warehouseId", - title: "鍖哄煙涓婚敭", + title: "浠撳簱", type: "string", - width: 90, + width: 100, align: "left", + bind: { key: "warehouses", data: [] }, }, { field: "materielCode", diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSClient/src/views/inbound/purchaseOrder.vue" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSClient/src/views/inbound/purchaseOrder.vue" index b4a0e42..6fce489 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSClient/src/views/inbound/purchaseOrder.vue" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSClient/src/views/inbound/purchaseOrder.vue" @@ -108,8 +108,9 @@ type: "string", width: 150, align: "left", - bind: { key: "purchaseType", data: [] }, + bind: { key: "", data: [{key:'S',value:"鏍囧噯鍏ュ簱"},{key:'V',value:"瀵勫敭琛ョ粰鍏ュ簱"}] }, }, + { field: "supplierCode", title: "渚涘簲鍟嗙紪鍙�", @@ -246,10 +247,11 @@ }, { field: "warehouseId", - title: "浠撳簱缂栧彿", + title: "浠撳簱", type: "string", - width: 200, + width: 100, align: "left", + bind: { key: "warehouses", data: [] }, }, { field: "purchaseDetailStatus", @@ -257,6 +259,7 @@ type: "string", width: 180, align: "left", + bind: { key: "purchaseOrderStatus", data: [] }, }, { field: "creater", diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/20a5f0b4-0f4e-4c7b-ba91-4c7a50a996ab.vsidx" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/20a5f0b4-0f4e-4c7b-ba91-4c7a50a996ab.vsidx" deleted file mode 100644 index 48a58f5..0000000 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/20a5f0b4-0f4e-4c7b-ba91-4c7a50a996ab.vsidx" +++ /dev/null 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/68aadf08-0043-4085-8419-285f1df3a4b6.vsidx" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/68aadf08-0043-4085-8419-285f1df3a4b6.vsidx" deleted file mode 100644 index db8c6d9..0000000 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/68aadf08-0043-4085-8419-285f1df3a4b6.vsidx" +++ /dev/null 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/881d0eea-b27b-4997-b88b-dadb2843b1e3.vsidx" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/881d0eea-b27b-4997-b88b-dadb2843b1e3.vsidx" deleted file mode 100644 index d65def0..0000000 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/881d0eea-b27b-4997-b88b-dadb2843b1e3.vsidx" +++ /dev/null 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/fe4c888c-4628-47ca-995c-f8221d13ee48.vsidx" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/fe4c888c-4628-47ca-995c-f8221d13ee48.vsidx" new file mode 100644 index 0000000..38bc46e --- /dev/null +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/fe4c888c-4628-47ca-995c-f8221d13ee48.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/read.lock" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/read.lock" deleted file mode 100644 index e69de29..0000000 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/read.lock" +++ /dev/null diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/AssignLocation/LocationInfoService_BC.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/AssignLocation/LocationInfoService_BC.cs" index 5649ce6..b2aff79 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/AssignLocation/LocationInfoService_BC.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/AssignLocation/LocationInfoService_BC.cs" @@ -16,7 +16,7 @@ public partial class LocationInfoService { - double weightValue_BC = 0.25; + double weightValue_BC = 0.5; private readonly static object _locker_BC = new object(); static List<LocationCache> locationCaches_BC = new List<LocationCache>(); @@ -75,11 +75,24 @@ List<Dt_LocationInfo> definedTypeEmptyLocations = locationInfos.Where(x => (x.EnableStatus == EnableStatusEnum.Normal.ObjToInt() || x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt()) && x.LocationStatus == LocationStatusEnum.Free.ObjToInt() && x.LocationType == palletType.ObjToInt() && !lockLocationCodes.Contains(x.LocationCode)).OrderByDescending(x => x.Depth).ThenBy(x => x.Layer).ThenBy(x => x.Column).ThenBy(x => x.Row).ToList(); - if ((locationInfos.Count * weightValue_BC >= definedTypeLocations.Count && undefinedTypeEmptyLocations.Any()) || !definedTypeEmptyLocations.Any())//濡傛灉宸插畾涔夌被鍨嬭揣浣嶆湭瓒呰繃姣斾緥锛屼笖鏈夋湭瀹氫箟绫诲瀷鐨勮揣浣� + if (definedTypeEmptyLocations.Any()) + { + for (int i = 0; i < definedTypeEmptyLocations.Count; i++) + { + Dt_LocationInfo definedTypeEmptyLocation = definedTypeEmptyLocations[i]; + Dt_LocationInfo? locationInfo = GetUsableLocation_BC(locationInfos, definedTypeEmptyLocation, palletType, palletTypeInfo); + if (locationInfo != null) + { + locationCaches_BC.Add(new LocationCache { LocationCode = locationInfo.LocationCode, DateTime = DateTime.Now }); + return locationInfo; + } + } + } + else if ((/*locationInfos.Count * weightValue_BC >= definedTypeLocations.Count &&*/ undefinedTypeEmptyLocations.Any()))//濡傛灉宸插畾涔夌被鍨嬭揣浣嶆湭瓒呰繃姣斾緥锛屼笖鏈夋湭瀹氫箟绫诲瀷鐨勮揣浣� { if (palletTypeInfo.LocaitonCount == 2) { - if (palletTypeInfo.IsOdd) + if (roadwayNo != "SC01_BC") undefinedTypeEmptyLocations = undefinedTypeEmptyLocations.Where(x => x.Column % 2 == 1).ToList(); else undefinedTypeEmptyLocations = undefinedTypeEmptyLocations.Where(x => x.Column % 2 == 0).ToList(); @@ -90,19 +103,7 @@ Dt_LocationInfo? locationInfo = GetUsableLocation_BC(locationInfos, undefinedTypeEmptyLocation, palletType, palletTypeInfo); if (locationInfo != null) { - locationCaches_BC.Add(new LocationCache { LocationCode = locationInfo.LocationCode, DateTime = DateTime.Now }); - return locationInfo; - } - } - } - else - { - for (int i = 0; i < definedTypeEmptyLocations.Count; i++) - { - Dt_LocationInfo definedTypeEmptyLocation = definedTypeEmptyLocations[i]; - Dt_LocationInfo? locationInfo = GetUsableLocation_BC(locationInfos, definedTypeEmptyLocation, palletType, palletTypeInfo); - if (locationInfo != null) - { + UpdateLocationStatus(locationInfo, palletType, LocationStatusEnum.Lock, locationInfo.WarehouseId); locationCaches_BC.Add(new LocationCache { LocationCode = locationInfo.LocationCode, DateTime = DateTime.Now }); return locationInfo; } @@ -124,10 +125,11 @@ if (palletTypeInfo.LocaitonCount == 2) { - if (palletTypeInfo.IsOdd && emptyLocation.Column % 2 != 1 || !palletTypeInfo.IsOdd && emptyLocation.Column % 2 != 0) - return null; - - Dt_LocationInfo? nearLocation = locationInfos.FirstOrDefault(x => x.Row == emptyLocation.Row && x.Layer == emptyLocation.Layer && x.Depth == emptyLocation.Depth && x.Column == emptyLocation.Column + 1); + Dt_LocationInfo? nearLocation = null; + if (emptyLocation.RoadwayNo != "SC01_BC" && emptyLocation.Column % 2 == 1) + nearLocation = locationInfos.FirstOrDefault(x => x.Row == emptyLocation.Row && x.Layer == emptyLocation.Layer && x.Depth == emptyLocation.Depth && x.Column == emptyLocation.Column + 1); + else if (emptyLocation.RoadwayNo == "SC01_BC" && emptyLocation.Column % 2 == 0) + nearLocation = locationInfos.FirstOrDefault(x => x.Row == emptyLocation.Row && x.Layer == emptyLocation.Layer && x.Depth == emptyLocation.Depth && x.Column == emptyLocation.Column - 1); if (nearLocation != null && DepthLocationIsEmpty_BC(locationInfos, nearLocation) != null) { Dt_LocationInfo? locationInfo = DepthLocationIsEmpty_BC(locationInfos, emptyLocation); @@ -137,7 +139,6 @@ } } } - else { Dt_LocationInfo? locationInfo = DepthLocationIsEmpty_BC(locationInfos, emptyLocation); @@ -162,12 +163,22 @@ bool moreDepthFlag = false; bool littleDepthFlag = false; - List<Dt_LocationInfo> moreDepth = locations.Where(x => x.Depth > emptyLocation.Depth).ToList(); - moreDepthFlag = moreDepth.FirstOrDefault(x => x.LocationStatus != LocationStatusEnum.InStock.ObjToInt() && (x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt() || x.EnableStatus == EnableStatusEnum.Normal.ObjToInt())) == null;//鏌ヨ澶т簬褰撳墠璐т綅娣卞害鐨勯泦鍚堥噷鏄惁鏈夌姸鎬佷笉涓烘湁璐х殑璐т綅锛屽鏋滄槸true锛屽垯琛ㄧず娣辫揣浣嶆湁鏈浣跨敤鐨勬儏鍐� + if (emptyLocation.LocationType == 0) + { + List<Dt_LocationInfo> moreDepth = locations.Where(x => x.Depth > emptyLocation.Depth).ToList(); + moreDepthFlag = moreDepth.FirstOrDefault(x => x.LocationStatus != LocationStatusEnum.InStock.ObjToInt() && (x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt() || x.EnableStatus == EnableStatusEnum.Normal.ObjToInt()) && x.LocationType != 0) == null;//鏌ヨ澶т簬褰撳墠璐т綅娣卞害鐨勯泦鍚堥噷鏄惁鏈夌姸鎬佷笉涓烘湁璐х殑璐т綅锛屽鏋滄槸true锛屽垯琛ㄧず娣辫揣浣嶆湁鏈浣跨敤鐨勬儏鍐� - List<Dt_LocationInfo> littleDepth = locations.Where(x => x.Depth <= emptyLocation.Depth).ToList(); - littleDepthFlag = littleDepth.FirstOrDefault(x => x.LocationStatus != LocationStatusEnum.Free.ObjToInt() && (x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt() || x.EnableStatus == EnableStatusEnum.Normal.ObjToInt())) == null; //鏌ヨ灏忎簬褰撳墠璐т綅娣卞害鐨勯泦鍚堥噷鏄惁鏈夌姸鎬佷笉涓虹┖锛屼笖绂佺敤鐘舵�佷笉涓虹鐢ㄤ互鍙婂彧鍏ョ殑璐т綅锛屽鏋滄槸true锛屽垯琛ㄧず娴呰揣浣嶈浣跨敤鎴栬�呰绂佺敤鐨勬儏鍐� + List<Dt_LocationInfo> littleDepth = locations.Where(x => x.Depth <= emptyLocation.Depth).ToList(); + littleDepthFlag = littleDepth.FirstOrDefault(x => x.LocationStatus != LocationStatusEnum.Free.ObjToInt() && (x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt() || x.EnableStatus == EnableStatusEnum.Normal.ObjToInt()) && x.LocationType != 0) == null; //鏌ヨ灏忎簬褰撳墠璐т綅娣卞害鐨勯泦鍚堥噷鏄惁鏈夌姸鎬佷笉涓虹┖锛屼笖绂佺敤鐘舵�佷笉涓虹鐢ㄤ互鍙婂彧鍏ョ殑璐т綅锛屽鏋滄槸true锛屽垯琛ㄧず娴呰揣浣嶈浣跨敤鎴栬�呰绂佺敤鐨勬儏鍐� + } + else + { + List<Dt_LocationInfo> moreDepth = locations.Where(x => x.Depth > emptyLocation.Depth).ToList(); + moreDepthFlag = moreDepth.FirstOrDefault(x => x.LocationStatus != LocationStatusEnum.InStock.ObjToInt() && (x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt() || x.EnableStatus == EnableStatusEnum.Normal.ObjToInt()) && x.LocationType != emptyLocation.LocationType) == null;//鏌ヨ澶т簬褰撳墠璐т綅娣卞害鐨勯泦鍚堥噷鏄惁鏈夌姸鎬佷笉涓烘湁璐х殑璐т綅锛屽鏋滄槸true锛屽垯琛ㄧず娣辫揣浣嶆湁鏈浣跨敤鐨勬儏鍐� + List<Dt_LocationInfo> littleDepth = locations.Where(x => x.Depth <= emptyLocation.Depth).ToList(); + littleDepthFlag = littleDepth.FirstOrDefault(x => x.LocationStatus != LocationStatusEnum.Free.ObjToInt() && (x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt() || x.EnableStatus == EnableStatusEnum.Normal.ObjToInt()) && x.LocationType != emptyLocation.LocationType) == null; //鏌ヨ灏忎簬褰撳墠璐т綅娣卞害鐨勯泦鍚堥噷鏄惁鏈夌姸鎬佷笉涓虹┖锛屼笖绂佺敤鐘舵�佷笉涓虹鐢ㄤ互鍙婂彧鍏ョ殑璐т綅锛屽鏋滄槸true锛屽垯琛ㄧず娴呰揣浣嶈浣跨敤鎴栬�呰绂佺敤鐨勬儏鍐� + } if (moreDepthFlag && littleDepthFlag) { return emptyLocation; diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/AssignLocation/LocationInfoService_CSJ.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/AssignLocation/LocationInfoService_CSJ.cs" index f9bb800..0772349 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/AssignLocation/LocationInfoService_CSJ.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/AssignLocation/LocationInfoService_CSJ.cs" @@ -190,21 +190,60 @@ case 3: case 4: { - List<Dt_LocationInfo> moreDepth = locations.Where(x => x.Depth > emptyLocation.Depth).ToList(); - moreDepthFlag = moreDepth.FirstOrDefault(x => x.LocationStatus != LocationStatusEnum.InStock.ObjToInt() && x.LocationStatus != LocationStatusEnum.PalletLock.ObjToInt() && (x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt() || x.EnableStatus == EnableStatusEnum.Normal.ObjToInt())) == null;//鏌ヨ澶т簬褰撳墠璐т綅娣卞害鐨勯泦鍚堥噷鏄惁鏈夌姸鎬佷笉涓烘湁璐х殑璐т綅锛屽鏋滄槸true锛屽垯琛ㄧず娣辫揣浣嶆湁鏈浣跨敤鐨勬儏鍐� - List<Dt_LocationInfo> littleDepth = locations.Where(x => x.Depth <= emptyLocation.Depth).ToList(); - littleDepthFlag = littleDepth.FirstOrDefault(x => x.LocationStatus != LocationStatusEnum.Free.ObjToInt() && (x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt() || x.EnableStatus == EnableStatusEnum.Normal.ObjToInt())) == null; //鏌ヨ灏忎簬褰撳墠璐т綅娣卞害鐨勯泦鍚堥噷鏄惁鏈夌姸鎬佷笉涓虹┖锛屼笖绂佺敤鐘舵�佷笉涓虹鐢ㄤ互鍙婂彧鍏ョ殑璐т綅锛屽鏋滄槸true锛屽垯琛ㄧず娴呰揣浣嶈浣跨敤鎴栬�呰绂佺敤鐨勬儏鍐� + if (emptyLocation.LocationType == 0) + { + List<Dt_LocationInfo> moreDepth = locations.Where(x => x.Depth > emptyLocation.Depth).ToList(); + moreDepthFlag = moreDepth.FirstOrDefault(x => x.LocationStatus != LocationStatusEnum.InStock.ObjToInt() && (x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt() || x.EnableStatus == EnableStatusEnum.Normal.ObjToInt()) && x.LocationType != 0) == null;//鏌ヨ澶т簬褰撳墠璐т綅娣卞害鐨勯泦鍚堥噷鏄惁鏈夌姸鎬佷笉涓烘湁璐х殑璐т綅锛屽鏋滄槸true锛屽垯琛ㄧず娣辫揣浣嶆湁鏈浣跨敤鐨勬儏鍐� + + List<Dt_LocationInfo> littleDepth = locations.Where(x => x.Depth <= emptyLocation.Depth).ToList(); + littleDepthFlag = littleDepth.FirstOrDefault(x => x.LocationStatus != LocationStatusEnum.Free.ObjToInt() && (x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt() || x.EnableStatus == EnableStatusEnum.Normal.ObjToInt()) && x.LocationType != 0) == null; //鏌ヨ灏忎簬褰撳墠璐т綅娣卞害鐨勯泦鍚堥噷鏄惁鏈夌姸鎬佷笉涓虹┖锛屼笖绂佺敤鐘舵�佷笉涓虹鐢ㄤ互鍙婂彧鍏ョ殑璐т綅锛屽鏋滄槸true锛屽垯琛ㄧず娴呰揣浣嶈浣跨敤鎴栬�呰绂佺敤鐨勬儏鍐� + } + else + { + List<Dt_LocationInfo> moreDepth = locations.Where(x => x.Depth > emptyLocation.Depth).ToList(); + moreDepthFlag = moreDepth.FirstOrDefault(x => x.LocationStatus != LocationStatusEnum.InStock.ObjToInt() && (x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt() || x.EnableStatus == EnableStatusEnum.Normal.ObjToInt()) && x.LocationType != emptyLocation.LocationType) == null;//鏌ヨ澶т簬褰撳墠璐т綅娣卞害鐨勯泦鍚堥噷鏄惁鏈夌姸鎬佷笉涓烘湁璐х殑璐т綅锛屽鏋滄槸true锛屽垯琛ㄧず娣辫揣浣嶆湁鏈浣跨敤鐨勬儏鍐� + + List<Dt_LocationInfo> littleDepth = locations.Where(x => x.Depth <= emptyLocation.Depth).ToList(); + littleDepthFlag = littleDepth.FirstOrDefault(x => x.LocationStatus != LocationStatusEnum.Free.ObjToInt() && (x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt() || x.EnableStatus == EnableStatusEnum.Normal.ObjToInt()) && x.LocationType != emptyLocation.LocationType) == null; //鏌ヨ灏忎簬褰撳墠璐т綅娣卞害鐨勯泦鍚堥噷鏄惁鏈夌姸鎬佷笉涓虹┖锛屼笖绂佺敤鐘舵�佷笉涓虹鐢ㄤ互鍙婂彧鍏ョ殑璐т綅锛屽鏋滄槸true锛屽垯琛ㄧず娴呰揣浣嶈浣跨敤鎴栬�呰绂佺敤鐨勬儏鍐� + } + //if (moreDepthFlag && littleDepthFlag) + //{ + // return emptyLocation; + //} + + //List<Dt_LocationInfo> moreDepth = locations.Where(x => x.Depth > emptyLocation.Depth).ToList(); + //moreDepthFlag = moreDepth.FirstOrDefault(x => x.LocationStatus != LocationStatusEnum.InStock.ObjToInt() && x.LocationStatus != LocationStatusEnum.PalletLock.ObjToInt() && (x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt() || x.EnableStatus == EnableStatusEnum.Normal.ObjToInt())) == null;//鏌ヨ澶т簬褰撳墠璐т綅娣卞害鐨勯泦鍚堥噷鏄惁鏈夌姸鎬佷笉涓烘湁璐х殑璐т綅锛屽鏋滄槸true锛屽垯琛ㄧず娣辫揣浣嶆湁鏈浣跨敤鐨勬儏鍐� + + //List<Dt_LocationInfo> littleDepth = locations.Where(x => x.Depth <= emptyLocation.Depth).ToList(); + //littleDepthFlag = littleDepth.FirstOrDefault(x => x.LocationStatus != LocationStatusEnum.Free.ObjToInt() && (x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt() || x.EnableStatus == EnableStatusEnum.Normal.ObjToInt())) == null; //鏌ヨ灏忎簬褰撳墠璐т綅娣卞害鐨勯泦鍚堥噷鏄惁鏈夌姸鎬佷笉涓虹┖锛屼笖绂佺敤鐘舵�佷笉涓虹鐢ㄤ互鍙婂彧鍏ョ殑璐т綅锛屽鏋滄槸true锛屽垯琛ㄧず娴呰揣浣嶈浣跨敤鎴栬�呰绂佺敤鐨勬儏鍐� } break; case 1: case 2: { - List<Dt_LocationInfo> moreDepth = locations.Where(x => x.Depth > emptyLocation.Depth).ToList(); - moreDepthFlag = moreDepth.FirstOrDefault(x => x.LocationStatus != LocationStatusEnum.InStock.ObjToInt() && (x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt() || x.EnableStatus == EnableStatusEnum.Normal.ObjToInt())) == null;//鏌ヨ澶т簬褰撳墠璐т綅娣卞害鐨勯泦鍚堥噷鏄惁鏈夌姸鎬佷笉涓烘湁璐х殑璐т綅锛屽鏋滄槸true锛屽垯琛ㄧず娣辫揣浣嶆湁鏈浣跨敤鐨勬儏鍐� + if (emptyLocation.LocationType == 0) + { + List<Dt_LocationInfo> moreDepth = locations.Where(x => x.Depth > emptyLocation.Depth).ToList(); + moreDepthFlag = moreDepth.FirstOrDefault(x => x.LocationStatus != LocationStatusEnum.InStock.ObjToInt() && (x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt() || x.EnableStatus == EnableStatusEnum.Normal.ObjToInt()) && x.LocationType != 0) == null;//鏌ヨ澶т簬褰撳墠璐т綅娣卞害鐨勯泦鍚堥噷鏄惁鏈夌姸鎬佷笉涓烘湁璐х殑璐т綅锛屽鏋滄槸true锛屽垯琛ㄧず娣辫揣浣嶆湁鏈浣跨敤鐨勬儏鍐� - List<Dt_LocationInfo> littleDepth = locations.Where(x => x.Depth <= emptyLocation.Depth).ToList(); - littleDepthFlag = littleDepth.FirstOrDefault(x => x.LocationStatus != LocationStatusEnum.Free.ObjToInt() && (x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt() || x.EnableStatus == EnableStatusEnum.Normal.ObjToInt())) == null; //鏌ヨ灏忎簬褰撳墠璐т綅娣卞害鐨勯泦鍚堥噷鏄惁鏈夌姸鎬佷笉涓虹┖锛屼笖绂佺敤鐘舵�佷笉涓虹鐢ㄤ互鍙婂彧鍏ョ殑璐т綅锛屽鏋滄槸true锛屽垯琛ㄧず娴呰揣浣嶈浣跨敤鎴栬�呰绂佺敤鐨勬儏鍐� + List<Dt_LocationInfo> littleDepth = locations.Where(x => x.Depth <= emptyLocation.Depth).ToList(); + littleDepthFlag = littleDepth.FirstOrDefault(x => x.LocationStatus != LocationStatusEnum.Free.ObjToInt() && (x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt() || x.EnableStatus == EnableStatusEnum.Normal.ObjToInt()) && x.LocationType != 0) == null; //鏌ヨ灏忎簬褰撳墠璐т綅娣卞害鐨勯泦鍚堥噷鏄惁鏈夌姸鎬佷笉涓虹┖锛屼笖绂佺敤鐘舵�佷笉涓虹鐢ㄤ互鍙婂彧鍏ョ殑璐т綅锛屽鏋滄槸true锛屽垯琛ㄧず娴呰揣浣嶈浣跨敤鎴栬�呰绂佺敤鐨勬儏鍐� + } + else + { + List<Dt_LocationInfo> moreDepth = locations.Where(x => x.Depth > emptyLocation.Depth).ToList(); + moreDepthFlag = moreDepth.FirstOrDefault(x => x.LocationStatus != LocationStatusEnum.InStock.ObjToInt() && (x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt() || x.EnableStatus == EnableStatusEnum.Normal.ObjToInt()) && x.LocationType != emptyLocation.LocationType) == null;//鏌ヨ澶т簬褰撳墠璐т綅娣卞害鐨勯泦鍚堥噷鏄惁鏈夌姸鎬佷笉涓烘湁璐х殑璐т綅锛屽鏋滄槸true锛屽垯琛ㄧず娣辫揣浣嶆湁鏈浣跨敤鐨勬儏鍐� + + List<Dt_LocationInfo> littleDepth = locations.Where(x => x.Depth <= emptyLocation.Depth).ToList(); + littleDepthFlag = littleDepth.FirstOrDefault(x => x.LocationStatus != LocationStatusEnum.Free.ObjToInt() && (x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt() || x.EnableStatus == EnableStatusEnum.Normal.ObjToInt()) && x.LocationType != emptyLocation.LocationType) == null; //鏌ヨ灏忎簬褰撳墠璐т綅娣卞害鐨勯泦鍚堥噷鏄惁鏈夌姸鎬佷笉涓虹┖锛屼笖绂佺敤鐘舵�佷笉涓虹鐢ㄤ互鍙婂彧鍏ョ殑璐т綅锛屽鏋滄槸true锛屽垯琛ㄧず娴呰揣浣嶈浣跨敤鎴栬�呰绂佺敤鐨勬儏鍐� + } + + //List<Dt_LocationInfo> moreDepth = locations.Where(x => x.Depth > emptyLocation.Depth).ToList(); + //moreDepthFlag = moreDepth.FirstOrDefault(x => x.LocationStatus != LocationStatusEnum.InStock.ObjToInt() && (x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt() || x.EnableStatus == EnableStatusEnum.Normal.ObjToInt())) == null;//鏌ヨ澶т簬褰撳墠璐т綅娣卞害鐨勯泦鍚堥噷鏄惁鏈夌姸鎬佷笉涓烘湁璐х殑璐т綅锛屽鏋滄槸true锛屽垯琛ㄧず娣辫揣浣嶆湁鏈浣跨敤鐨勬儏鍐� + + //List<Dt_LocationInfo> littleDepth = locations.Where(x => x.Depth <= emptyLocation.Depth).ToList(); + //littleDepthFlag = littleDepth.FirstOrDefault(x => x.LocationStatus != LocationStatusEnum.Free.ObjToInt() && (x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt() || x.EnableStatus == EnableStatusEnum.Normal.ObjToInt())) == null; //鏌ヨ灏忎簬褰撳墠璐т綅娣卞害鐨勯泦鍚堥噷鏄惁鏈夌姸鎬佷笉涓虹┖锛屼笖绂佺敤鐘舵�佷笉涓虹鐢ㄤ互鍙婂彧鍏ョ殑璐т綅锛屽鏋滄槸true锛屽垯琛ㄧず娴呰揣浣嶈浣跨敤鎴栬�呰绂佺敤鐨勬儏鍐� } break; diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/AssignLocation/LocationInfoService_GM.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/AssignLocation/LocationInfoService_GM.cs" index 4aa5502..43c07f3 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/AssignLocation/LocationInfoService_GM.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/AssignLocation/LocationInfoService_GM.cs" @@ -161,11 +161,22 @@ bool moreDepthFlag = false; bool littleDepthFlag = false; - List<Dt_LocationInfo> moreDepth = locations.Where(x => x.Depth > emptyLocation.Depth).ToList(); - moreDepthFlag = moreDepth.FirstOrDefault(x => x.LocationStatus != LocationStatusEnum.InStock.ObjToInt() && (x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt() || x.EnableStatus == EnableStatusEnum.Normal.ObjToInt())) == null;//鏌ヨ澶т簬褰撳墠璐т綅娣卞害鐨勯泦鍚堥噷鏄惁鏈夌姸鎬佷笉涓烘湁璐х殑璐т綅锛屽鏋滄槸true锛屽垯琛ㄧず娣辫揣浣嶆湁鏈浣跨敤鐨勬儏鍐� + if (emptyLocation.LocationType == 0) + { + List<Dt_LocationInfo> moreDepth = locations.Where(x => x.Depth > emptyLocation.Depth).ToList(); + moreDepthFlag = moreDepth.FirstOrDefault(x => x.LocationStatus != LocationStatusEnum.InStock.ObjToInt() && (x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt() || x.EnableStatus == EnableStatusEnum.Normal.ObjToInt()) && x.LocationType != 0) == null;//鏌ヨ澶т簬褰撳墠璐т綅娣卞害鐨勯泦鍚堥噷鏄惁鏈夌姸鎬佷笉涓烘湁璐х殑璐т綅锛屽鏋滄槸true锛屽垯琛ㄧず娣辫揣浣嶆湁鏈浣跨敤鐨勬儏鍐� - List<Dt_LocationInfo> littleDepth = locations.Where(x => x.Depth <= emptyLocation.Depth).ToList(); - littleDepthFlag = littleDepth.FirstOrDefault(x => x.LocationStatus != LocationStatusEnum.Free.ObjToInt() && (x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt() || x.EnableStatus == EnableStatusEnum.Normal.ObjToInt())) == null; //鏌ヨ灏忎簬褰撳墠璐т綅娣卞害鐨勯泦鍚堥噷鏄惁鏈夌姸鎬佷笉涓虹┖锛屼笖绂佺敤鐘舵�佷笉涓虹鐢ㄤ互鍙婂彧鍏ョ殑璐т綅锛屽鏋滄槸true锛屽垯琛ㄧず娴呰揣浣嶈浣跨敤鎴栬�呰绂佺敤鐨勬儏鍐� + List<Dt_LocationInfo> littleDepth = locations.Where(x => x.Depth <= emptyLocation.Depth).ToList(); + littleDepthFlag = littleDepth.FirstOrDefault(x => x.LocationStatus != LocationStatusEnum.Free.ObjToInt() && (x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt() || x.EnableStatus == EnableStatusEnum.Normal.ObjToInt()) && x.LocationType != 0) == null; //鏌ヨ灏忎簬褰撳墠璐т綅娣卞害鐨勯泦鍚堥噷鏄惁鏈夌姸鎬佷笉涓虹┖锛屼笖绂佺敤鐘舵�佷笉涓虹鐢ㄤ互鍙婂彧鍏ョ殑璐т綅锛屽鏋滄槸true锛屽垯琛ㄧず娴呰揣浣嶈浣跨敤鎴栬�呰绂佺敤鐨勬儏鍐� + } + else + { + List<Dt_LocationInfo> moreDepth = locations.Where(x => x.Depth > emptyLocation.Depth).ToList(); + moreDepthFlag = moreDepth.FirstOrDefault(x => x.LocationStatus != LocationStatusEnum.InStock.ObjToInt() && (x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt() || x.EnableStatus == EnableStatusEnum.Normal.ObjToInt()) && x.LocationType != emptyLocation.LocationType) == null;//鏌ヨ澶т簬褰撳墠璐т綅娣卞害鐨勯泦鍚堥噷鏄惁鏈夌姸鎬佷笉涓烘湁璐х殑璐т綅锛屽鏋滄槸true锛屽垯琛ㄧず娣辫揣浣嶆湁鏈浣跨敤鐨勬儏鍐� + + List<Dt_LocationInfo> littleDepth = locations.Where(x => x.Depth <= emptyLocation.Depth).ToList(); + littleDepthFlag = littleDepth.FirstOrDefault(x => x.LocationStatus != LocationStatusEnum.Free.ObjToInt() && (x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt() || x.EnableStatus == EnableStatusEnum.Normal.ObjToInt()) && x.LocationType != emptyLocation.LocationType) == null; //鏌ヨ灏忎簬褰撳墠璐т綅娣卞害鐨勯泦鍚堥噷鏄惁鏈夌姸鎬佷笉涓虹┖锛屼笖绂佺敤鐘舵�佷笉涓虹鐢ㄤ互鍙婂彧鍏ョ殑璐т綅锛屽鏋滄槸true锛屽垯琛ㄧず娴呰揣浣嶈浣跨敤鎴栬�呰绂佺敤鐨勬儏鍐� + } if (moreDepthFlag && littleDepthFlag) { diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/AssignLocation/LocationInfoService_PP.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/AssignLocation/LocationInfoService_PP.cs" index f0a7242..a97ed86 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/AssignLocation/LocationInfoService_PP.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/AssignLocation/LocationInfoService_PP.cs" @@ -134,11 +134,22 @@ bool moreDepthFlag = false; bool littleDepthFlag = false; - List<Dt_LocationInfo> moreDepth = locations.Where(x => x.Depth > emptyLocation.Depth).ToList(); - moreDepthFlag = moreDepth.FirstOrDefault(x => x.LocationStatus != LocationStatusEnum.InStock.ObjToInt() && x.LocationStatus != LocationStatusEnum.PalletLock.ObjToInt()) == null;//鏌ヨ澶т簬褰撳墠璐т綅娣卞害鐨勯泦鍚堥噷鏄惁鏈夌姸鎬佷笉涓烘湁璐х殑璐т綅锛屽鏋滄槸true锛屽垯琛ㄧず娣辫揣浣嶆湁鏈浣跨敤鐨勬儏鍐� + if (emptyLocation.LocationType == 0) + { + List<Dt_LocationInfo> moreDepth = locations.Where(x => x.Depth > emptyLocation.Depth).ToList(); + moreDepthFlag = moreDepth.FirstOrDefault(x => x.LocationStatus != LocationStatusEnum.InStock.ObjToInt() && (x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt() || x.EnableStatus == EnableStatusEnum.Normal.ObjToInt()) && x.LocationType != 0) == null;//鏌ヨ澶т簬褰撳墠璐т綅娣卞害鐨勯泦鍚堥噷鏄惁鏈夌姸鎬佷笉涓烘湁璐х殑璐т綅锛屽鏋滄槸true锛屽垯琛ㄧず娣辫揣浣嶆湁鏈浣跨敤鐨勬儏鍐� - List<Dt_LocationInfo> littleDepth = locations.Where(x => x.Depth <= emptyLocation.Depth).ToList(); - littleDepthFlag = littleDepth.FirstOrDefault(x => x.LocationStatus != LocationStatusEnum.Free.ObjToInt() && x.EnableStatus != EnableStatusEnum.OnlyIn.ObjToInt() && x.EnableStatus != EnableStatusEnum.Normal.ObjToInt()) == null; //鏌ヨ灏忎簬褰撳墠璐т綅娣卞害鐨勯泦鍚堥噷鏄惁鏈夌姸鎬佷笉涓虹┖锛屼笖绂佺敤鐘舵�佷笉涓虹鐢ㄤ互鍙婂彧鍏ョ殑璐т綅锛屽鏋滄槸true锛屽垯琛ㄧず娴呰揣浣嶈浣跨敤鎴栬�呰绂佺敤鐨勬儏鍐� + List<Dt_LocationInfo> littleDepth = locations.Where(x => x.Depth <= emptyLocation.Depth).ToList(); + littleDepthFlag = littleDepth.FirstOrDefault(x => x.LocationStatus != LocationStatusEnum.Free.ObjToInt() && (x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt() || x.EnableStatus == EnableStatusEnum.Normal.ObjToInt()) && x.LocationType != 0) == null; //鏌ヨ灏忎簬褰撳墠璐т綅娣卞害鐨勯泦鍚堥噷鏄惁鏈夌姸鎬佷笉涓虹┖锛屼笖绂佺敤鐘舵�佷笉涓虹鐢ㄤ互鍙婂彧鍏ョ殑璐т綅锛屽鏋滄槸true锛屽垯琛ㄧず娴呰揣浣嶈浣跨敤鎴栬�呰绂佺敤鐨勬儏鍐� + } + else + { + List<Dt_LocationInfo> moreDepth = locations.Where(x => x.Depth > emptyLocation.Depth).ToList(); + moreDepthFlag = moreDepth.FirstOrDefault(x => x.LocationStatus != LocationStatusEnum.InStock.ObjToInt() && (x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt() || x.EnableStatus == EnableStatusEnum.Normal.ObjToInt()) && x.LocationType != emptyLocation.LocationType) == null;//鏌ヨ澶т簬褰撳墠璐т綅娣卞害鐨勯泦鍚堥噷鏄惁鏈夌姸鎬佷笉涓烘湁璐х殑璐т綅锛屽鏋滄槸true锛屽垯琛ㄧず娣辫揣浣嶆湁鏈浣跨敤鐨勬儏鍐� + + List<Dt_LocationInfo> littleDepth = locations.Where(x => x.Depth <= emptyLocation.Depth).ToList(); + littleDepthFlag = littleDepth.FirstOrDefault(x => x.LocationStatus != LocationStatusEnum.Free.ObjToInt() && (x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt() || x.EnableStatus == EnableStatusEnum.Normal.ObjToInt()) && x.LocationType != emptyLocation.LocationType) == null; //鏌ヨ灏忎簬褰撳墠璐т綅娣卞害鐨勯泦鍚堥噷鏄惁鏈夌姸鎬佷笉涓虹┖锛屼笖绂佺敤鐘舵�佷笉涓虹鐢ㄤ互鍙婂彧鍏ョ殑璐т綅锛屽鏋滄槸true锛屽垯琛ㄧず娴呰揣浣嶈浣跨敤鎴栬�呰绂佺敤鐨勬儏鍐� + } if (moreDepthFlag && littleDepthFlag) { return emptyLocation; diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/AssignLocation/LocationInfoService_ZH.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/AssignLocation/LocationInfoService_ZH.cs" index 22d2318..dabc270 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/AssignLocation/LocationInfoService_ZH.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/AssignLocation/LocationInfoService_ZH.cs" @@ -149,11 +149,22 @@ bool moreDepthFlag = false; bool littleDepthFlag = false; - List<Dt_LocationInfo> moreDepth = locations.Where(x => x.Depth > emptyLocation.Depth).ToList(); - moreDepthFlag = moreDepth.FirstOrDefault(x => x.LocationStatus != LocationStatusEnum.InStock.ObjToInt() && x.LocationStatus != LocationStatusEnum.PalletLock.ObjToInt()) == null;//鏌ヨ澶т簬褰撳墠璐т綅娣卞害鐨勯泦鍚堥噷鏄惁鏈夌姸鎬佷笉涓烘湁璐х殑璐т綅锛屽鏋滄槸true锛屽垯琛ㄧず娣辫揣浣嶆湁鏈浣跨敤鐨勬儏鍐� + if (emptyLocation.LocationType == 0) + { + List<Dt_LocationInfo> moreDepth = locations.Where(x => x.Depth > emptyLocation.Depth).ToList(); + moreDepthFlag = moreDepth.FirstOrDefault(x => x.LocationStatus != LocationStatusEnum.InStock.ObjToInt() && (x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt() || x.EnableStatus == EnableStatusEnum.Normal.ObjToInt()) && x.LocationType != 0) == null;//鏌ヨ澶т簬褰撳墠璐т綅娣卞害鐨勯泦鍚堥噷鏄惁鏈夌姸鎬佷笉涓烘湁璐х殑璐т綅锛屽鏋滄槸true锛屽垯琛ㄧず娣辫揣浣嶆湁鏈浣跨敤鐨勬儏鍐� - List<Dt_LocationInfo> littleDepth = locations.Where(x => x.Depth <= emptyLocation.Depth).ToList(); - littleDepthFlag = littleDepth.FirstOrDefault(x => x.LocationStatus != LocationStatusEnum.Free.ObjToInt() && x.EnableStatus != EnableStatusEnum.OnlyIn.ObjToInt() && x.EnableStatus != EnableStatusEnum.Normal.ObjToInt()) == null; //鏌ヨ灏忎簬褰撳墠璐т綅娣卞害鐨勯泦鍚堥噷鏄惁鏈夌姸鎬佷笉涓虹┖锛屼笖绂佺敤鐘舵�佷笉涓虹鐢ㄤ互鍙婂彧鍏ョ殑璐т綅锛屽鏋滄槸true锛屽垯琛ㄧず娴呰揣浣嶈浣跨敤鎴栬�呰绂佺敤鐨勬儏鍐� + List<Dt_LocationInfo> littleDepth = locations.Where(x => x.Depth <= emptyLocation.Depth).ToList(); + littleDepthFlag = littleDepth.FirstOrDefault(x => x.LocationStatus != LocationStatusEnum.Free.ObjToInt() && (x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt() || x.EnableStatus == EnableStatusEnum.Normal.ObjToInt()) && x.LocationType != 0) == null; //鏌ヨ灏忎簬褰撳墠璐т綅娣卞害鐨勯泦鍚堥噷鏄惁鏈夌姸鎬佷笉涓虹┖锛屼笖绂佺敤鐘舵�佷笉涓虹鐢ㄤ互鍙婂彧鍏ョ殑璐т綅锛屽鏋滄槸true锛屽垯琛ㄧず娴呰揣浣嶈浣跨敤鎴栬�呰绂佺敤鐨勬儏鍐� + } + else + { + List<Dt_LocationInfo> moreDepth = locations.Where(x => x.Depth > emptyLocation.Depth).ToList(); + moreDepthFlag = moreDepth.FirstOrDefault(x => x.LocationStatus != LocationStatusEnum.InStock.ObjToInt() && (x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt() || x.EnableStatus == EnableStatusEnum.Normal.ObjToInt()) && x.LocationType != emptyLocation.LocationType) == null;//鏌ヨ澶т簬褰撳墠璐т綅娣卞害鐨勯泦鍚堥噷鏄惁鏈夌姸鎬佷笉涓烘湁璐х殑璐т綅锛屽鏋滄槸true锛屽垯琛ㄧず娣辫揣浣嶆湁鏈浣跨敤鐨勬儏鍐� + + List<Dt_LocationInfo> littleDepth = locations.Where(x => x.Depth <= emptyLocation.Depth).ToList(); + littleDepthFlag = littleDepth.FirstOrDefault(x => x.LocationStatus != LocationStatusEnum.Free.ObjToInt() && (x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt() || x.EnableStatus == EnableStatusEnum.Normal.ObjToInt()) && x.LocationType != emptyLocation.LocationType) == null; //鏌ヨ灏忎簬褰撳墠璐т綅娣卞害鐨勯泦鍚堥噷鏄惁鏈夌姸鎬佷笉涓虹┖锛屼笖绂佺敤鐘舵�佷笉涓虹鐢ㄤ互鍙婂彧鍏ョ殑璐т綅锛屽鏋滄槸true锛屽垯琛ㄧず娴呰揣浣嶈浣跨敤鎴栬�呰绂佺敤鐨勬儏鍐� + } if (moreDepthFlag && littleDepthFlag) { diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/LocationInfoService_Common.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/LocationInfoService_Common.cs" index ef8c85c..614a589 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/LocationInfoService_Common.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/LocationInfoService_Common.cs" @@ -165,6 +165,10 @@ } Dt_LocationInfo? nearLocation = locationInfos.FirstOrDefault(x => x.Row == location.Row && x.Layer == location.Layer && x.Depth == location.Depth && x.Column == location.Column + 1); + if(location.RoadwayNo == "SC01_BC") + { + nearLocation = locationInfos.FirstOrDefault(x => x.Row == location.Row && x.Layer == location.Layer && x.Depth == location.Depth && x.Column == location.Column - 1); + } if (nearLocation != null) { List<Dt_LocationInfo> nearLocations = GetGroupLocations(locationInfos, nearLocation); @@ -337,39 +341,48 @@ nearLocation = locationInfos.FirstOrDefault(x => x.Row == location.Row && x.Layer == location.Layer && x.Depth == location.Depth && x.Column == location.Column - 1); } + if (location.RoadwayNo == "SC01_BC") + { + nearLocation = locationInfos.FirstOrDefault(x => x.Row == location.Row && x.Layer == location.Layer && x.Depth == location.Depth && x.Column == location.Column - 1); + } + if (nearLocation != null) { List<Dt_LocationInfo> nearLocations = GetGroupLocations(locationInfos, nearLocation); for (int i = 0; i < nearLocations.Count; i++) { - if (nearLocations[i].LocationType != palletType) + List<int> palletTypes = palletTypeInfos.Select(x => x.PalletType).ToList(); + palletTypes.Add(0); + if (palletTypes.Contains(nearLocations[i].LocationType)) { - nearLocations[i].LocationType = palletType; - } + if (nearLocations[i].LocationType != palletType) + { + nearLocations[i].LocationType = palletType; + } - if (locationStatus == LocationStatusEnum.Lock) - { - if (nearLocations[i].LocationStatus == LocationStatusEnum.InStock.ObjToInt()) + if (locationStatus == LocationStatusEnum.Lock) { - nearLocations[i].LocationStatus = LocationStatusEnum.InStockLock.ObjToInt(); + if (nearLocations[i].LocationStatus == LocationStatusEnum.InStock.ObjToInt()) + { + nearLocations[i].LocationStatus = LocationStatusEnum.InStockLock.ObjToInt(); + } + else if (nearLocations[i].LocationStatus == LocationStatusEnum.Free.ObjToInt()) + { + nearLocations[i].LocationStatus = LocationStatusEnum.FreeLock.ObjToInt(); + } } - else if (nearLocations[i].LocationStatus == LocationStatusEnum.Free.ObjToInt()) + else if (locationStatus == LocationStatusEnum.Free || locationStatus == LocationStatusEnum.InStock) { - nearLocations[i].LocationStatus = LocationStatusEnum.FreeLock.ObjToInt(); + if (nearLocations[i].LocationStatus == LocationStatusEnum.InStockLock.ObjToInt()) + { + nearLocations[i].LocationStatus = LocationStatusEnum.InStock.ObjToInt(); + } + else if (nearLocations[i].LocationStatus == LocationStatusEnum.FreeLock.ObjToInt()) + { + nearLocations[i].LocationStatus = LocationStatusEnum.Free.ObjToInt(); + } } } - else if (locationStatus == LocationStatusEnum.Free || locationStatus == LocationStatusEnum.InStock) - { - if (nearLocations[i].LocationStatus == LocationStatusEnum.InStockLock.ObjToInt()) - { - nearLocations[i].LocationStatus = LocationStatusEnum.InStock.ObjToInt(); - } - else if (nearLocations[i].LocationStatus == LocationStatusEnum.FreeLock.ObjToInt()) - { - nearLocations[i].LocationStatus = LocationStatusEnum.Free.ObjToInt(); - } - } - } locations.AddRange(nearLocations); } @@ -430,9 +443,11 @@ { List<Dt_LocationInfo> groupLocations = new List<Dt_LocationInfo>() { location }; int maxDepth = locationInfos.Max(x => x.Depth); + int row = location.Row; for (int j = location.Depth + 1; j <= maxDepth; j++) { - Dt_LocationInfo? locationInfo = locationInfos.FirstOrDefault(x => x.Depth == j && x.Column == location.Column && x.Layer == location.Layer); + row += 1; + Dt_LocationInfo? locationInfo = locationInfos.FirstOrDefault(x => x.Depth == j && x.Column == location.Column && x.Layer == location.Layer && x.Row == row); if (locationInfo != null) { groupLocations.Add(locationInfo); @@ -441,7 +456,8 @@ for (int j = location.Depth - 1; j >= 1; j--) { - Dt_LocationInfo? locationInfo = locationInfos.FirstOrDefault(x => x.Depth == j && x.Column == location.Column && x.Layer == location.Layer); + row -= 1; + Dt_LocationInfo? locationInfo = locationInfos.FirstOrDefault(x => x.Depth == j && x.Column == location.Column && x.Layer == location.Layer && x.Row == row); if (locationInfo != null) { groupLocations.Add(locationInfo); @@ -461,9 +477,11 @@ List<Dt_LocationInfo> groupLocations = new List<Dt_LocationInfo>() { location }; int maxDepth = locationInfos.Max(x => x.Depth); + int row = location.Row; for (int j = location.Depth + 1; j <= maxDepth; j++) { - Dt_LocationInfo? locationInfo = locationInfos.FirstOrDefault(x => x.Depth == j && x.Column == location.Column && x.Layer == location.Layer); + row += 1; + Dt_LocationInfo? locationInfo = locationInfos.FirstOrDefault(x => x.Depth == j && x.Column == location.Column && x.Layer == location.Layer && x.Row == row); if (locationInfo != null) { groupLocations.Add(locationInfo); @@ -472,7 +490,8 @@ for (int j = location.Depth - 1; j >= 1; j--) { - Dt_LocationInfo? locationInfo = locationInfos.FirstOrDefault(x => x.Depth == j && x.Column == location.Column && x.Layer == location.Layer); + row -= 1; + Dt_LocationInfo? locationInfo = locationInfos.FirstOrDefault(x => x.Depth == j && x.Column == location.Column && x.Layer == location.Layer && x.Row == row); if (locationInfo != null) { groupLocations.Add(locationInfo); diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_DTO/MES/TestToolModel.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_DTO/MES/TestToolModel.cs" index f529847..e237c3d 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_DTO/MES/TestToolModel.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_DTO/MES/TestToolModel.cs" @@ -66,10 +66,10 @@ /// 娴嬭瘯鏋舵壒娆″彿 /// </summary> public string ToolCode { get; set; } - /// <summary> - /// 娴嬭瘯鏋剁墿鏂欏悕绉� - /// </summary> - public string MaterialName { get; set; } + ///// <summary> + ///// 娴嬭瘯鏋剁墿鏂欏悕绉� + ///// </summary> + //public string MaterialName { get; set; } /// <summary> /// 鍒濆瀵垮懡 /// </summary> 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 cf44c12..07cc697 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" @@ -195,5 +195,7 @@ /// <param name="model"></param> /// <returns></returns> MesResponseContent SubstrateBack(SubstrateBackModel model); + + WebResponseContent AssignRoadway(int taskNum, List<string> roadwayNos); } } diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_InboundService/InboundOrderService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_InboundService/InboundOrderService.cs" index 3c7c036..47bcfe6 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_InboundService/InboundOrderService.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_InboundService/InboundOrderService.cs" @@ -726,7 +726,6 @@ } return content; } - /// <summary> /// 鍏ュ簱瀹屾垚涓婃姤ERP /// </summary> @@ -744,7 +743,6 @@ { return WebResponseContent.Instance.Error($"鍏ュ簱鍗曟嵁宸插畬鎴�"); } - Dt_Warehouse warehouse = _warehouseService.Repository.QueryFirst(x => x.WarehouseId == stockInfo.WarehouseId); if (warehouse == null) { @@ -770,6 +768,7 @@ } catch (Exception ex) { + _unitOfWorkManage.RollbackTran(); content.Error(ex.Message); } return content; diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_InboundService/ReceiveOrderDetailService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_InboundService/ReceiveOrderDetailService.cs" index 9f97d1b..86a971f 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_InboundService/ReceiveOrderDetailService.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_InboundService/ReceiveOrderDetailService.cs" @@ -120,7 +120,7 @@ { purchaseOrderDetail.PurchaseDetailStatus = PurchaseOrderDetailStatusEnum.Receiving.ObjToInt(); } - float sumQty = purchaseOrder.Details.Sum(x => x.PurchaseDetailReceiveQty); //+ model.Quantity; + float sumQty = purchaseOrder.Details.Sum(x => x.PurchaseDetailReceiveQty)+ model.Quantity; if (purchaseOrder.OrderQuantity == sumQty) { purchaseOrder.PurchaseOrderStatus = PurchaseOrderStatusEnum.Received.ObjToInt(); @@ -182,7 +182,7 @@ { purchaseOrderDetail.PurchaseDetailStatus = PurchaseOrderDetailStatusEnum.Received.ObjToInt(); } - float sumQty = purchaseOrder.Details.Sum(x => x.PurchaseDetailReceiveQty);// + model.Quantity; + float sumQty = purchaseOrder.Details.Sum(x => x.PurchaseDetailReceiveQty) + model.Quantity; _unitOfWorkManage.BeginTran(); BaseDal.AddData(receiveOrderDetail); if (purchaseOrder.OrderQuantity == sumQty) diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_InboundService/ReceiveOrderService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_InboundService/ReceiveOrderService.cs" index 88a2d16..7c60c3d 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_InboundService/ReceiveOrderService.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_InboundService/ReceiveOrderService.cs" @@ -154,7 +154,7 @@ //鍒涘缓鍏ュ簱鍗� CreateInboundOrder(orderId); //鏀惰揣鎺ㄩ�佽嚦ERP 娴嬭瘯娉ㄩ噴 - //_invokeERPService.InvokeMatReceiveApi(receiveModel); + _invokeERPService.InvokeMatReceiveApi(receiveModel); return WebResponseContent.Instance.OK(); } catch (Exception ex) diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_StockRepository/StockInfoRepository.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_StockRepository/StockInfoRepository.cs" index 67d7666..a2c4e4a 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_StockRepository/StockInfoRepository.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_StockRepository/StockInfoRepository.cs" @@ -69,7 +69,7 @@ { if (!string.IsNullOrEmpty(lotNo)) { - return Db.Queryable<Dt_StockInfo>().Where(x => locationCodes.Contains(x.LocationCode)).Includes(x => x.Details).Where(x => x.Details.Any(v => v.MaterielCode == materielCode && v.BatchNo == lotNo)).ToList(); + return Db.Queryable<Dt_StockInfo>().Where(x => locationCodes.Contains(x.LocationCode)).Includes(x => x.Details).Where(x => x.Details.OrderBy(x=>x.EffectiveDate).Any(v => v.MaterielCode == materielCode && v.BatchNo == lotNo)).ToList(); } else { diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/AssignInboundTaskLocation_BC.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/AssignInboundTaskLocation_BC.cs" new file mode 100644 index 0000000..5580db0 --- /dev/null +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/AssignInboundTaskLocation_BC.cs" @@ -0,0 +1,58 @@ +锘縰sing SqlSugar; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WIDESEA_Common.LocationEnum; +using WIDESEA_Common.TaskEnum; +using WIDESEA_Core; +using WIDESEA_Core.Helper; +using WIDESEA_Model.Models; + +namespace WIDESEA_TaskInfoService +{ + public partial class TaskService + { + /// <summary> + /// 鍏ュ簱浠诲姟鐢宠鍒嗛厤璐т綅 + /// </summary> + /// <param name="taskNum">浠诲姟鍙�</param> + /// <param name="roadwayNo">宸烽亾鍙�</param> + /// <returns></returns> + public WebResponseContent AssignRoadway(int taskNum, List<string> roadwayNos) + { + try + { + Dt_Task task = BaseDal.QueryFirst(x => x.TaskNum == taskNum); + if (task == null) + { + return WebResponseContent.Instance.Error($"鏈壘鍒拌鍏ュ簱浠诲姟"); + } + + if (_basicRepository.LocationInfoRepository.QueryFirst(x => x.LocationCode == task.TargetAddress) != null) + { + return WebResponseContent.Instance.OK(data: task.TargetAddress); + } + + List<LocationCount> locationCounts = Db.Queryable<Dt_LocationInfo>().Where(x => (x.LocationType == task.PalletType || x.LocationType == 0) && x.LocationStatus == LocationStatusEnum.Free.ObjToInt() && (x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt() || x.EnableStatus == EnableStatusEnum.Normal.ObjToInt()) && roadwayNos.Contains(x.RoadwayNo)).GroupBy(x => x.RoadwayNo).Select(x => new LocationCount { RoadwayNo = x.RoadwayNo, Count = SqlFunc.AggregateCount(x) }).ToList(); + + string roadwayNo = locationCounts.OrderBy(x => x.Count).FirstOrDefault()?.RoadwayNo ?? ""; + + return !string.IsNullOrEmpty(roadwayNo) ? WebResponseContent.Instance.OK(data: roadwayNo): WebResponseContent.Instance.Error("鏈壘鍒板彲鍒嗛厤宸烽亾"); + } + catch (Exception ex) + { + _unitOfWorkManage.RollbackTran(); + return WebResponseContent.Instance.Error(ex.Message); + } + } + + public class LocationCount + { + public string RoadwayNo { get; set; } + + public int Count { get; set; } + } + } +} diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/MesTaskService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/MesTaskService.cs" index 92d02fb..a608990 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/MesTaskService.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/MesTaskService.cs" @@ -465,8 +465,8 @@ CurrentAddress = "", NextAddress = "", PalletType = stockInfo.PalletType, - Roadway = "", - SourceAddress = "", + Roadway = "RGV01_BC", + SourceAddress = "RGV01_BC", TargetAddress = "", TaskStatus = TaskStatusEnum.New.ObjToInt(), TaskType = TaskTypeEnum.MesMatReturn.ObjToInt(), 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 755d188..150a167 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" @@ -261,7 +261,7 @@ { foreach (var model in stockInfo.Details) { - TestSynStock(new TestToolSynInfo() { ToolCode = model.BatchNo, MaterialName = model.MaterielName, Life = int.TryParse(model.Remark, out int val) ? val : 1000 }); + TestSynStock(new TestToolSynInfo() { ToolCode = model.BatchNo, /*MaterialName = model.MaterielName,*/ Life = int.TryParse(model.Remark, out int val) ? val : 1000 }); } } 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 f0659a8..2219ed3 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" @@ -53,7 +53,7 @@ { return WebResponseContent.Instance.Error($"鏈壘鍒扮粍鐩樹俊鎭�"); } - if (stockInfo.StockStatus != StockStatusEmun.缁勭洏鏆傚瓨.ObjToInt() && stockInfo.StockStatus != StockStatusEmun.鎵嬪姩缁勭洏鏆傚瓨.ObjToInt()) + if (stockInfo.StockStatus != StockStatusEmun.缁勭洏鏆傚瓨.ObjToInt() && stockInfo.StockStatus != StockStatusEmun.鎵嬪姩缁勭洏鏆傚瓨.ObjToInt() && stockInfo.StockStatus!=StockStatusEmun.鍑哄簱瀹屾垚.ObjToInt()) { return WebResponseContent.Instance.Error($"璇ユ墭鐩樼姸鎬佷笉姝g‘,涓嶅彲鐢宠鍏ュ簱"); } diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/ERP/ErpController.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/ERP/ErpController.cs" index ac5eaf8..98dacb1 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/ERP/ErpController.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/ERP/ErpController.cs" @@ -12,6 +12,7 @@ using WIDESEA_DTO.Basic; using WIDESEA_DTO.ERP; using WIDESEA_External.ERPService; +using WIDESEA_External.Model; using WIDESEA_IBasicRepository; using WIDESEA_IBasicService; using WIDESEA_IInboundRepository; @@ -33,12 +34,15 @@ private readonly IBasicService _basicService; private readonly IOutboundService _outboundService; private readonly IInboundService _inboundService; + private readonly IInvokeERPService _invokeERPService; - public ErpController(IBasicService basicService, IOutboundService outboundService, IInboundService inboundService) + public ErpController(IBasicService basicService, IOutboundService outboundService, IInboundService inboundService, + IInvokeERPService invokeERPService) { _basicService = basicService; _outboundService = outboundService; _inboundService = inboundService; + _invokeERPService = invokeERPService; } /// <summary> @@ -118,5 +122,10 @@ if (content.Status) return Instance.OK(); else return Instance.Error(content.Message); } + [HttpPost, Route("InvokeOutStandardsApi"), AllowAnonymous] + public string InvokeOutStandardsApi(ERPIssueModel issueModel) + { + return _invokeERPService.InvokeOutStandardsApi(issueModel); + } } } diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Inbound/InboundOrderController.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Inbound/InboundOrderController.cs" index 6b6894e..8a3bbf1 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Inbound/InboundOrderController.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Inbound/InboundOrderController.cs" @@ -77,17 +77,25 @@ return Service.MaterielGroup(saveModel); } - /// <summary> - /// 鍏ュ簱瀹屾垚鍚庡洖浼燛RP - /// </summary> - /// <param name="id"></param> - /// <returns></returns> + ///// <summary> + ///// 鍏ュ簱瀹屾垚鍚庡洖浼燛RP + ///// </summary> + ///// <param name="id"></param> + ///// <returns></returns> //[HttpPost, HttpGet, Route("FeedbackInboundOrder")] //public WebResponseContent FeedbackInboundOrder(int id) //{ // return Service.FeedbackInboundOrder(id); //} + /// <summary> + /// 鏃犲叆搴撳崟缁勭洏 + /// </summary> + /// <param name="palletCode"></param> + /// <param name="initiallife"></param> + /// <param name="warehouseId"></param> + /// <param name="serNums"></param> + /// <returns></returns> [HttpPost, HttpGet, Route("ManualMaterielGroup")] public WebResponseContent MaterielGroup(string palletCode, int initiallife, int warehouseId, [FromBody] List<string> serNums) { 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 fec41b3..b6d9fa6 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" @@ -173,5 +173,17 @@ { return Service.Outbound(id); } + + /// <summary> + /// 鍒嗛厤宸烽亾 + /// </summary> + /// <param name="taskNum"></param> + /// <param name="roadwayNos"></param> + /// <returns></returns> + [HttpPost, Route("AssignRoadway"), AllowAnonymous] + public WebResponseContent AssignRoadway(int taskNum, [FromBody]List<string> roadwayNos) + { + return Service.AssignRoadway(taskNum, roadwayNos); + } } } diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Program.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Program.cs" index c8b83e9..d6f884a 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Program.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Program.cs" @@ -43,7 +43,7 @@ builder.Services.AddWebSocketSetup(); builder.Services.AddSqlsugarSetup();//SqlSugar 启动服务 builder.Services.AddDbSetup();//Db 启动服务 -//builder.Services.AddInitializationHostServiceSetup();//应用初始化服务注入 +builder.Services.AddInitializationHostServiceSetup();//应用初始化服务注入 builder.Services.AddHostedService<PermissionDataHostService>();//应用初始化服务注入 builder.Services.AddAutoMapperSetup(); -- Gitblit v1.9.3