From 70f22c9c06c7dfe2a2a83c0d2fcc79892dba7d8f Mon Sep 17 00:00:00 2001 From: hutongqing <hutongqing@hnkhzn.com> Date: 星期三, 18 十二月 2024 17:08:29 +0800 Subject: [PATCH] 1 --- 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_IStockRepository/IStockInfoRepository.cs | 2 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Config/Dt_CodeRuleConfig.cs | 34 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Config/Dt_AnalysisRuleConfig.cs | 29 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Outbound/Dt_OutboundLockInfo.cs | 48 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_SystemService/Sys_DictionaryService.cs | 50 代码管理/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/30faa678-93fd-4e91-b1d8-13e2bcae7dba.vsidx | 0 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_DTO/Task/WMSTaskDTO.cs | 56 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs | 40 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Basic/Dt_SupplierInfo.cs | 36 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Basic/Dt_Warehouse.cs | 24 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Common/TaskEnum/TaskInStatusEnum.cs | 38 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Inbound/Dt_ReceiveOrder.cs | 6 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Model/Models/BasicInfo/Dt_StationManger.cs | 11 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/AssignLocation/LocationInfoService_GM.cs | 174 ++ 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_DTO/ERP/ErpResponseContent.cs | 40 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/ApprovalFlow/Dt_NodeTransition.cs | 15 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Inbound/Dt_InboundOrderDetail.cs | 35 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/AssignLocation/LocationInfoService_BC.cs | 174 ++ 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Common/LocationEnum/LocationStatusEnum.cs | 14 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_ITaskInfoService/ITaskService.cs | 23 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Outbound/Dt_OutboundOrder.cs | 36 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_DTO/MES/MesResponseContent.cs | 29 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Record/Dt_LocationStatusChangeRecord.cs | 45 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_StockRepository/StockInfoRepository.cs | 7 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Filter/CustomProfile.cs | 3 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/LocationInfoService_Common.cs | 174 ++ 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/Helper/ConvertHelper.cs | 51 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/TaskInfo/TaskController.cs | 28 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/AssignLocation/LocationInfoService_PP.cs | 174 ++ 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/干膜仓/StackerCraneJob_GM.cs | 303 +++ 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/ApprovalFlow/Dt_ApprovalFlow.cs | 17 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/Attributes/BoolIndexAttribute.cs | 17 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/W_ConveyorLineDBName.cs | 72 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/板材仓/StackerCraneJob_BC.cs | 303 +++ 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Outbound/Dt_OutboundOrderDetail.cs | 36 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Inbound/Dt_InboundOrder_Hty.cs | 36 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Common/TaskEnum/TaskOutStatusEnum.cs | 2 代码管理/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/43c5884a-259b-409f-9f97-bec930af24db.vsidx | 0 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_IBasicService/ILocationInfoService.cs | 6 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Check/Dt_CheckOrder.cs | 17 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Stock/Dt_StockInfoDetail.cs | 45 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Base/LocationInfoService.cs | 6 代码管理/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/60b56cfe-9fa4-4dcb-a205-bd29744252b2.vsidx | 0 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/AssignLocation/LocationInfoService_CSJ.cs | 199 ++ 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Common/CommonEnum/PalletTypeEnum.cs | 5 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/油墨仓/StackerCraneJob_YM.cs | 303 +++ 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Record/Dt_StockQuantityChangeRecord.cs | 45 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Basic/Dt_CustomerInfo.cs | 12 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Basic/Dt_MaterielInfo.cs | 15 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Outbound.cs | 238 +++ 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/OutboundOrderDetailService.cs | 62 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Stock/Dt_StockInfo.cs | 35 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Inbound/Dt_PurchaseOrder.cs | 24 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Inbound/Dt_PurchaseOrderDetail.cs | 9 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Inbound/Dt_ReceiveOrderDetail.cs | 6 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/TaskInfo/WMSTaskDTO.cs | 2 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/LocationInfoService.cs | 9 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/TaskInfo/Dt_Task.cs | 9 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/ConveyorLineTaskCommand.cs | 188 ++ 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs | 32 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/PP仓/StackerCraneJob_PP.cs | 303 +++ 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Inbound/Dt_InboundOrder.cs | 41 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/R_ConveyorLineDBName.cs | 124 + 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/AssignLocation/LocationInfoService_ZH.cs | 174 ++ 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Basic/Dt_LocationInfo.cs | 51 代码管理/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/2877cb87-c685-49b7-a63b-30bdbb709bbd.vsidx | 0 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Core/Helper/HttpHelper.cs | 32 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Common/TaskEnum/TaskTypeEnum.cs | 88 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs | 135 + 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Common/TaskEnum/TaskEnumHelper.cs | 18 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/WIDESEA_BasicService.csproj | 2 代码管理/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/012f25e8-74cc-4271-80f7-3993d746a5bd.vsidx | 0 /dev/null | 0 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/TaskEnum/TaskStatusEnum.cs | 84 代码管理/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/5697cb23-9f2e-4eb6-ba02-077734b9a84e.vsidx | 0 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/ApprovalFlow/Dt_ApprovalNode.cs | 23 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Check/Dt_CheckOrderResult.cs | 3 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Outbound/Dt_OutboundOrderDetail_Hty.cs | 42 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/测试架仓/StackerCraneJob_CSJ.cs | 52 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Basic/LocationInfoController.cs | 4 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/ApprovalFlow/Dt_ApprovalTask.cs | 7 81 files changed, 4,181 insertions(+), 451 deletions(-) diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/30faa678-93fd-4e91-b1d8-13e2bcae7dba.vsidx" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/30faa678-93fd-4e91-b1d8-13e2bcae7dba.vsidx" new file mode 100644 index 0000000..beee39c --- /dev/null +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/30faa678-93fd-4e91-b1d8-13e2bcae7dba.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/3ea8b77f-1ded-4afe-bbbb-d42ee2627f62.vsidx" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/3ea8b77f-1ded-4afe-bbbb-d42ee2627f62.vsidx" deleted file mode 100644 index f3f5325..0000000 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/3ea8b77f-1ded-4afe-bbbb-d42ee2627f62.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/456f23a3-e9db-4baa-b211-0debbf6a9766.vsidx" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/456f23a3-e9db-4baa-b211-0debbf6a9766.vsidx" deleted file mode 100644 index 79d16d1..0000000 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/456f23a3-e9db-4baa-b211-0debbf6a9766.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/672f95bc-ead2-44f0-a24c-957a3a267788.vsidx" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/672f95bc-ead2-44f0-a24c-957a3a267788.vsidx" deleted file mode 100644 index fb37439..0000000 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/672f95bc-ead2-44f0-a24c-957a3a267788.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/77d1070c-616d-4033-b739-10b3890a2871.vsidx" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/77d1070c-616d-4033-b739-10b3890a2871.vsidx" deleted file mode 100644 index 3d58d18..0000000 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/77d1070c-616d-4033-b739-10b3890a2871.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/8f970bf6-017d-4af8-aaf8-8f1412be4898.vsidx" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/8f970bf6-017d-4af8-aaf8-8f1412be4898.vsidx" deleted file mode 100644 index 344aa06..0000000 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/8f970bf6-017d-4af8-aaf8-8f1412be4898.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/d42b07cd-42aa-4600-b30d-6127996a8402.vsidx" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/d42b07cd-42aa-4600-b30d-6127996a8402.vsidx" deleted file mode 100644 index c9ebcf8..0000000 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/d42b07cd-42aa-4600-b30d-6127996a8402.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/eea7343e-b2dc-465b-88dc-48639ebcee30.vsidx" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/eea7343e-b2dc-465b-88dc-48639ebcee30.vsidx" deleted file mode 100644 index ae0d138..0000000 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/eea7343e-b2dc-465b-88dc-48639ebcee30.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/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_Common/AreaInfo.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/AreaInfo.cs" deleted file mode 100644 index 2f52e30..0000000 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/AreaInfo.cs" +++ /dev/null @@ -1,15 +0,0 @@ -锘縰sing System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace WIDESEAWCS_Common -{ - public enum AreaInfo - { - CLOutAreaA, - CLOutAreaB, - CLOutAreaC - } -} diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/Attributes/BoolIndexAttribute.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/Attributes/BoolIndexAttribute.cs" new file mode 100644 index 0000000..c34fc8a --- /dev/null +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/Attributes/BoolIndexAttribute.cs" @@ -0,0 +1,17 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace WIDESEAWCS_Common.Attributes +{ + public class BoolIndexAttribute : Attribute + { + public int Index { get; set; } + public BoolIndexAttribute(int index) + { + Index = index; + } + } +} diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/Helper/ConvertHelper.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/Helper/ConvertHelper.cs" new file mode 100644 index 0000000..dc67877 --- /dev/null +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/Helper/ConvertHelper.cs" @@ -0,0 +1,51 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using System.Text; +using System.Threading.Tasks; +using WIDESEAWCS_Common.Attributes; + +namespace WIDESEAWCS_Common.Helper +{ + public class ConvertHelper + { + public static bool[] ByteToBoolArray(byte data) + { + bool[] result = new bool[8]; + for (int i = 0; i < 8; i++) + { + result[i] = (data & (1 << i)) != 0; + } + return result; + } + + public static T ByteToBoolObject<T>(byte data) + { + bool[] boolArray = ByteToBoolArray(data); + + Type type = typeof(T); + object? obj = Activator.CreateInstance(type); + if (obj == null) + { + throw new Exception($"绫诲瀷瀹炰緥鍖栭敊璇�"); + } + T result = (T)obj; + + PropertyInfo[] propertyInfos = type.GetProperties(); + foreach (PropertyInfo propertyInfo in propertyInfos) + { + BoolIndexAttribute? boolIndexAttribute = propertyInfo.GetCustomAttribute<BoolIndexAttribute>(); + if (boolIndexAttribute != null) + { + if (boolIndexAttribute.Index >= 0 && boolIndexAttribute.Index < 8) + { + propertyInfo.SetValue(result, boolArray[boolIndexAttribute.Index]); + } + } + } + + return result; + } + } +} diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/TaskEnum/TaskStatusEnum.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/TaskEnum/TaskStatusEnum.cs" index 1919700..17162b0 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/TaskEnum/TaskStatusEnum.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/TaskEnum/TaskStatusEnum.cs" @@ -7,37 +7,22 @@ namespace WIDESEAWCS_Common.TaskEnum { + /// <summary> + /// 鍏ュ簱浠诲姟鐘舵�� + /// </summary> public enum TaskInStatusEnum { /// <summary> /// 鏂板缓鍏ュ簱浠诲姟 /// </summary> - [Description("鏂板缓鍏ュ簱浠诲姟")] + [Description("鏂板缓")] InNew = 200, - ///// <summary> - ///// AGV鍏ュ簱鎵ц涓� - ///// </summary> - //[Description("AGV鍏ュ簱鎵ц涓�")] - //AGV_InExecuting = 210, - - ///// <summary> - ///// AGV鍏ュ簱瀹屾垚 - ///// </summary> - //[Description("AGV鎼繍瀹屾垚")] - //AGV_InFinish = 215, - /// <summary> - /// 杈撻�佺嚎鍏ュ簱鎵ц涓� + /// 鍫嗗灈鏈哄緟鎵ц /// </summary> - [Description("杈撻�佺嚎鍏ュ簱鎵ц涓�")] - Line_InExecuting = 220, - - /// <summary> - /// 杈撻�佺嚎鍏ュ簱瀹屾垚 - /// </summary> - [Description("杈撻�佺嚎杈撻�佸畬鎴�")] - Line_InFinish = 225, + [Description("鍫嗗灈鏈哄緟鎵ц")] + SC_InExecute = 225, /// <summary> /// 鍫嗗灈鏈哄叆搴撴墽琛屼腑 @@ -58,12 +43,6 @@ InFinish = 290, /// <summary> - /// 鍏ュ簱浠诲姟鎸傝捣 - /// </summary> - [Description("鍏ュ簱浠诲姟鎸傝捣")] - InPending = 297, - - /// <summary> /// 鍏ュ簱浠诲姟鍙栨秷 /// </summary> [Description("鍏ュ簱浠诲姟鍙栨秷")] @@ -76,61 +55,40 @@ InException = 299, } + /// <summary> + /// 鍑哄簱浠诲姟鐘舵�� + /// </summary> public enum TaskOutStatusEnum { /// <summary> - /// 鏂板缓鍑哄簱浠诲姟 + /// 鏂板缓浠诲姟 /// </summary> - [Description("鏂板缓鍑哄簱浠诲姟")] + [Description("鏂板缓")] OutNew = 100, + + /// <summary> + /// 鍫嗗灈鏈哄嚭搴撳緟鎵ц + /// </summary> + [Description("鍫嗗灈鏈哄嚭搴撳緟鎵ц")] + SC_OutExecute = 125, /// <summary> /// 鍫嗗灈鏈哄嚭搴撴墽琛屼腑 /// </summary> [Description("鍫嗗灈鏈哄嚭搴撴墽琛屼腑")] - SC_OutExecuting = 110, + SC_OutExecuting = 130, /// <summary> /// 鍫嗗灈鏈哄嚭搴撳畬鎴� /// </summary> [Description("鍫嗗灈鏈哄嚭搴撳畬鎴�")] - SC_OutFinish = 115, - - /// <summary> - /// 杈撻�佺嚎鍑哄簱鎵ц涓� - /// </summary> - [Description("杈撻�佺嚎鍑哄簱鎵ц涓�")] - Line_OutExecuting = 120, - - /// <summary> - /// 杈撻�佺嚎鍑哄簱瀹屾垚 - /// </summary> - [Description("杈撻�佺嚎杈撻�佸畬鎴�")] - Line_OutFinish = 125, - - ///// <summary> - ///// AGV鍑哄簱鎵ц涓� - ///// </summary> - //[Description("AGV鍑哄簱鎵ц涓�")] - //AGV_OutExecuting = 130, - - ///// <summary> - ///// AGV鍑哄簱瀹屾垚 - ///// </summary> - //[Description("AGV鎼繍瀹屾垚")] - //AGV_OutFinish = 135, + SC_OutFinish = 135, /// <summary> /// 鍑哄簱浠诲姟瀹屾垚 /// </summary> [Description("鍑哄簱浠诲姟瀹屾垚")] OutFinish = 190, - - /// <summary> - /// 鍑哄簱浠诲姟鎸傝捣 - /// </summary> - [Description("鍑哄簱浠诲姟鎸傝捣")] - OutPending = 197, /// <summary> /// 鍑哄簱浠诲姟鍙栨秷 @@ -142,6 +100,6 @@ /// 鍑哄簱浠诲姟寮傚父 /// </summary> [Description("鍑哄簱浠诲姟寮傚父")] - OutException = 199, + OutException = 199 } } diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/TaskInfo/WMSTaskDTO.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/TaskInfo/WMSTaskDTO.cs" index f29527c..5844ddd 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/TaskInfo/WMSTaskDTO.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/TaskInfo/WMSTaskDTO.cs" @@ -36,7 +36,7 @@ /// <summary> /// 浠诲姟鐘舵�� /// </summary> - public int TaskState { get; set; } + public int TaskStatus { get; set; } /// <summary> /// 璧风偣 diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Model/Models/BasicInfo/Dt_StationManger.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Model/Models/BasicInfo/Dt_StationManger.cs" index c432c1e..5f3d31d 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Model/Models/BasicInfo/Dt_StationManger.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Model/Models/BasicInfo/Dt_StationManger.cs" @@ -30,6 +30,15 @@ public string StationName { get; set; } /// <summary> + /// 绔欏彴绫诲瀷 <br/> + /// 1锛氬彧鍏� <br/> + /// 2锛氬彧鍑� <br/> + /// 3锛氬彲鍏ュ彲鍑� + /// </summary> + [SugarColumn(IsNullable = false, ColumnDescription = "绔欏彴绫诲瀷")] + public int StationType { get; set; } + + /// <summary> /// 瀵瑰簲鍫嗗灈鏈烘帓-鍒�-灞� /// </summary> [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "瀵瑰簲鍫嗗灈鏈烘帓-鍒�-灞�")] @@ -51,7 +60,7 @@ /// AGV绔欏彴缂栧彿 /// </summary> [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "AGV绔欏彴缂栧彿")] - public string AGVStationCode { get; set; } + public string? AGVStationCode { get; set; } /// <summary> /// 澶囨敞 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 00161ac..8fbf76e 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" @@ -71,7 +71,7 @@ /// </summary> /// <param name="taskDTOs">WMS浠诲姟瀵硅薄闆嗗悎</param> /// <returns>杩斿洖澶勭悊缁撴灉</returns> - public WebResponseContent ReceiveWMSTask([NotNull]List<WMSTaskDTO> taskDTOs) + public WebResponseContent ReceiveWMSTask([NotNull] List<WMSTaskDTO> taskDTOs) { WebResponseContent content = new WebResponseContent(); try @@ -87,25 +87,15 @@ task.Creater = "WMS"; if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup) { - List<Dt_Router> routers = _routerService.QueryNextRoutes(item.RoadWay, item.TargetAddress); - //鏆備笉鑰冭檻澶氳矾寰� - if (routers.Count > 0) - { - task.TaskState = (int)TaskOutStatusEnum.OutNew; - task.CurrentAddress = item.SourceAddress; - task.NextAddress = routers.FirstOrDefault().ChildPosi; - } + task.TaskState = (int)TaskOutStatusEnum.OutNew; + task.CurrentAddress = item.SourceAddress; + task.NextAddress = item.TargetAddress; + } else if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.InboundGroup) { - List<Dt_Router> routers = _routerService.QueryNextRoutes(item.SourceAddress, item.TargetAddress); - //鏆備笉鑰冭檻澶氳矾寰� - if (routers.Count > 0) - { - task.TaskState = (int)TaskInStatusEnum.InNew; - task.CurrentAddress = item.SourceAddress; - task.NextAddress = routers.FirstOrDefault().ChildPosi; - } + task.TaskState = (int)TaskInStatusEnum.InNew; task.CurrentAddress = item.SourceAddress; + task.NextAddress = item.TargetAddress; } tasks.Add(task); } @@ -141,7 +131,7 @@ RoadWay = "SC01", SourceAddress = sourceAddress, TargetAddress = "SC01", - TaskState = (int)TaskInStatusEnum.InNew, + TaskStatus = (int)TaskInStatusEnum.InNew, Id = 0, TaskType = (int)TaskInboundTypeEnum.Inbound }; @@ -196,11 +186,11 @@ /// <returns></returns> public Dt_Task? QuertStackerCraneTask(string deviceNo, TaskTypeGroup? taskTypeGroup = null) { - if(taskTypeGroup == null) + if (taskTypeGroup == null) return BaseDal.QueryFirst(x => x.Roadway == deviceNo && (TaskInboundTypes.Contains(x.TaskType) && x.TaskState == (int)TaskInStatusEnum.Line_InFinish || TaskOutboundTypes.Contains(x.TaskType) && x.TaskState == (int)TaskOutStatusEnum.OutNew), TaskOrderBy); - if(taskTypeGroup.Value == TaskTypeGroup.InboundGroup) + if (taskTypeGroup.Value == TaskTypeGroup.InboundGroup) return BaseDal.QueryFirst(x => x.Roadway == deviceNo && TaskInboundTypes.Contains(x.TaskType) && x.TaskState == (int)TaskInStatusEnum.Line_InFinish, TaskOrderBy); - if(taskTypeGroup.Value == TaskTypeGroup.OutbondGroup) + if (taskTypeGroup.Value == TaskTypeGroup.OutbondGroup) return BaseDal.QueryFirst(x => x.Roadway == deviceNo && TaskOutboundTypes.Contains(x.TaskType) && x.TaskState == (int)TaskOutStatusEnum.OutNew, TaskOrderBy); return null; } diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs" index 526f379..e66cafa 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs" @@ -36,7 +36,7 @@ namespace WIDESEAWCS_Tasks { [DisallowConcurrentExecution] - public class CommonConveyorLineJob : IJob + public class CommonConveyorLineJob : JobBase, IJob { private readonly ITaskService _taskService; private readonly ITaskExecuteDetailService _taskExecuteDetailService; @@ -59,34 +59,16 @@ CommonConveyorLine conveyorLine = (CommonConveyorLine)context.JobDetail.JobDataMap.Get("JobParams"); if (conveyorLine != null) { - List<string> childDeviceCodes = _routerService.QueryAllPositions(conveyorLine.DeviceCode); - List<Task> tasks = new List<Task>(); + List<string> childDeviceCodes = new List<string>(); + foreach (string childDeviceCode in childDeviceCodes) { - //Task task = Task.Run(() => - //{ - ConveyorLineTaskCommand command = conveyorLine.ReadCustomer<ConveyorLineTaskCommand>(childDeviceCode); - if (command != null) - { - DeviceProtocolDetailDTO? deviceProtocolDetail = conveyorLine.DeviceProtocolDetailDTOs.FirstOrDefault(x => x.ProtocalDetailValue == command.InteractiveSignal.ToString() && x.DeviceProParamName == nameof(ConveyorLineTaskCommand.InteractiveSignal)); - if (deviceProtocolDetail != null) - { - MethodInfo? method = GetType().GetMethod(deviceProtocolDetail.ProtocolDetailType); - if (method != null) - { - method.Invoke(this, new object[] { conveyorLine, command, childDeviceCode }); - } - else - { - //todo 鏈壘鍒版柟娉曟椂 - } - } - } - //}); - //tasks.Add(task); + R_ConveyorLineInfo command = conveyorLine.ReadCustomer<R_ConveyorLineInfo>(childDeviceCode); + if (command != null) + { + + } } - - Task.WaitAll(tasks.ToArray()); } } @@ -107,7 +89,7 @@ /// <param name="conveyorLine">杈撻�佺嚎瀹炰緥瀵硅薄</param> /// <param name="command">璇诲彇鐨勮姹備俊鎭�</param> /// <param name="childDeviceCode">瀛愯澶囩紪鍙�</param> - public void RequestInbound(CommonConveyorLine conveyorLine, ConveyorLineTaskCommand command,string childDeviceCode) + public void RequestInbound(CommonConveyorLine conveyorLine, ConveyorLineTaskCommand command, string childDeviceCode) { if (_taskService.RequestWMSTask(command.Barcode, childDeviceCode).Status) { @@ -155,7 +137,7 @@ Dt_Task task = _taskService.QueryExecutingConveyorLineTask(command.TaskNum, childDeviceCode); if (task != null) { - conveyorLine.SetValue(ConveyorLineDBName.WriteInteractiveSignal, 0, childDeviceCode); + //conveyorLine.SetValue(R_ConveyorLineDBName.WriteInteractiveSignal, 0, childDeviceCode); WebResponseContent content = _taskService.UpdateTaskStatusToNext(task); Console.Out.WriteLine(content.Serialize()); } @@ -212,7 +194,7 @@ Dt_Task task = _taskService.QueryExecutingConveyorLineTask(command.TaskNum, childDeviceCode); if (task != null) { - conveyorLine.SetValue(ConveyorLineDBName.WriteInteractiveSignal, 0, childDeviceCode); + //conveyorLine.SetValue(R_ConveyorLineDBName.WriteInteractiveSignal, 0, childDeviceCode); WebResponseContent content = _taskService.UpdateTaskStatusToNext(task); Console.Out.WriteLine(content.Serialize()); } diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/ConveyorLineDBName.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/ConveyorLineDBName.cs" deleted file mode 100644 index 9ab2c8e..0000000 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/ConveyorLineDBName.cs" +++ /dev/null @@ -1,40 +0,0 @@ -锘�#region << 鐗� 鏈� 娉� 閲� >> -/*---------------------------------------------------------------- - * 鍛藉悕绌洪棿锛歐IDESEAWCS_Tasks.ConveyorLineJob - * 鍒涘缓鑰咃細鑳$搴� - * 鍒涘缓鏃堕棿锛�2024/8/2 16:13:36 - * 鐗堟湰锛歏1.0.0 - * 鎻忚堪锛� - * - * ---------------------------------------------------------------- - * 淇敼浜猴細 - * 淇敼鏃堕棿锛� - * 鐗堟湰锛歏1.0.1 - * 淇敼璇存槑锛� - * - *----------------------------------------------------------------*/ -#endregion << 鐗� 鏈� 娉� 閲� >> - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace WIDESEAWCS_Tasks.ConveyorLineJob -{ - public enum ConveyorLineDBName - { - InteractiveSignal, - ConveyorLineBarcode, - ConveyorLineTargetAddress, - ConveyorLineTaskNum, - ConveyorLineTrayType, - - WriteInteractiveSignal, - WriteConveyorLineBarcode, - WriteConveyorLineTargetAddress, - WriteConveyorLineTaskNum, - WriteConveyorLineTrayType - } -} 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 ac1c79d..4e4952a 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" @@ -20,6 +20,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; +using WIDESEAWCS_Common.Attributes; using WIDESEAWCS_QuartzJob.DeviceBase; namespace WIDESEAWCS_Tasks.ConveyorLineJob @@ -35,4 +36,191 @@ public int TaskNum { get; set; } } + + + public class R_ConveyorLineInfo : DeviceCommand + { + /// <summary> + /// 绔欏彴缂栧彿 + /// </summary> + public short ConveyorNo { get; set; } + + /// <summary> + /// 鐘舵�� + /// </summary> + public byte Status { get; set; } + + /// <summary> + /// 浠诲姟鍙� + /// </summary> + public int TaskNum { get; set; } + + /// <summary> + /// 璧峰鍦板潃 + /// </summary> + public short StartPos { get; set; } + + /// <summary> + /// 鐩爣鍦板潃 + /// </summary> + public short EndPos { get; set; } + + /// <summary> + /// 閲嶉噺 + /// </summary> + public short GoodsWeight { get; set; } + + /// <summary> + /// 璐х墿绫诲瀷 + /// </summary> + public short GoodsType { get; set; } + + /// <summary> + /// 0闈欐1鍓嶈繘2鍚庨��3涓婂崌/椤烘椂閽堟棆杞�4涓嬮檷/閫嗘椂閽堟棆杞� + /// </summary> + public short RunStatus { get; set; } + + /// <summary> + /// 鏉$爜 + /// </summary> + [DataLength(20)] + public string Barcode { get; set; } + + /// <summary> + /// 棰勭暀 + /// </summary> + public short Sapre1 { get; set; } + + /// <summary> + /// 棰勭暀 + /// </summary> + public short Sapre2 { get; set; } + + /// <summary> + /// 浜や簰淇″彿 + /// </summary> + public byte Signal { get; set; } + } + + public class R_ConveyorLineStatus + { + /// <summary> + /// 鎻℃墜淇″彿 + /// </summary> + [BoolIndex(0)] + public bool HandShake { get; set; } + + /// <summary> + /// 1鑱旀満 0鑴辨満 + /// </summary> + [BoolIndex(1)] + public bool Online { get; set; } + + /// <summary> + /// 1绌洪棽 0绻佸繖 + /// </summary> + [BoolIndex(2)] + public bool Free { get; set; } + + /// <summary> + /// 1鏈夎揣 0鏃犺揣 + /// </summary> + [BoolIndex(3)] + public bool Goods { get; set; } + + /// <summary> + /// 1鏁呴殰 0姝e父 + /// </summary> + [BoolIndex(4)] + public bool Alarm { get; set; } + + /// <summary> + /// 1璇锋眰琛ョ洏 0鏃� + /// </summary> + [BoolIndex(5)] + public bool RequestPakcPallet { get; set; } + + /// <summary> + /// 1璇锋眰鎷嗙洏 0鏃� + /// </summary> + [BoolIndex(6)] + public bool RequestUnpackPellet { get; set; } + } + + public class R_ConveyorLineSignal + { + /// <summary> + /// 璇锋眰淇″彿 + /// </summary> + public bool STB { get; set; } + + /// <summary> + /// 鍝嶅簲淇″彿 + /// </summary> + public bool ACK { get; set; } + } + + public class W_ConveyorLineInfo + { + + /// <summary> + /// 绔欏彴缂栧彿 + /// </summary> + public short ConveyorNo { get; set; } + + /// <summary> + /// 鎻℃墜淇″彿 + /// </summary> + public bool HandShake { get; set; } + + /// <summary> + /// 澶嶄綅鎶ヨ + /// </summary> + public bool ClearAlarm { get; set; } + + /// <summary> + /// 閫�鍥� + /// </summary> + public bool Return { get; set; } + + /// <summary> + /// 浠诲姟鍙� + /// </summary> + public int TaskNum { get; set; } + + /// <summary> + /// 璧峰鍦板潃 + /// </summary> + public short StartPos { get; set; } + + /// <summary> + /// 鐩爣鍦板潃 + /// </summary> + public short EndPos { get; set; } + + /// <summary> + /// 璐х墿绫诲瀷 + /// </summary> + public short GoodsType { get; set; } + + /// <summary> + /// 棰勭暀 + /// </summary> + public short Sapre1 { get; set; } + + /// <summary> + /// 棰勭暀 + /// </summary> + public short Sapre2 { get; set; } + + /// <summary> + /// 璇锋眰淇″彿 + /// </summary> + public bool STB { get; set; } + + /// <summary> + /// 鍝嶅簲淇″彿 + /// </summary> + public bool ACK { get; set; } + } } 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" new file mode 100644 index 0000000..10c3c1a --- /dev/null +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/R_ConveyorLineDBName.cs" @@ -0,0 +1,124 @@ +锘�#region << 鐗� 鏈� 娉� 閲� >> +/*---------------------------------------------------------------- + * 鍛藉悕绌洪棿锛歐IDESEAWCS_Tasks.ConveyorLineJob + * 鍒涘缓鑰咃細鑳$搴� + * 鍒涘缓鏃堕棿锛�2024/8/2 16:13:36 + * 鐗堟湰锛歏1.0.0 + * 鎻忚堪锛� + * + * ---------------------------------------------------------------- + * 淇敼浜猴細 + * 淇敼鏃堕棿锛� + * 鐗堟湰锛歏1.0.1 + * 淇敼璇存槑锛� + * + *----------------------------------------------------------------*/ +#endregion << 鐗� 鏈� 娉� 閲� >> + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace WIDESEAWCS_Tasks.ConveyorLineJob +{ + public enum R_ConveyorLineDBName + { + /// <summary> + /// 绔欏彴缂栧彿 + /// </summary> + ConveyorNo, + + /// <summary> + /// 鎻℃墜淇″彿 + /// </summary> + HandShake, + + /// <summary> + /// 1鑱旀満 0鑴辨満 + /// </summary> + Online, + + /// <summary> + /// 1绌洪棽 0绻佸繖 + /// </summary> + Free, + + /// <summary> + /// 1鏈夎揣 0鏃犺揣 + /// </summary> + Goods, + + /// <summary> + /// 1鏁呴殰 0姝e父 + /// </summary> + Alarm, + + /// <summary> + /// 1璇锋眰琛ョ洏 0鏃� + /// </summary> + RequestPakcPallet, + + /// <summary> + /// 1璇锋眰鎷嗙洏 0鏃� + /// </summary> + RequestUnpackPellet, + + /// <summary> + /// 浠诲姟鍙� + /// </summary> + TaskNum, + + /// <summary> + /// 璧峰鍦板潃 + /// </summary> + StartPos, + + /// <summary> + /// 鐩爣鍦板潃 + /// </summary> + EndPos, + + /// <summary> + /// 閲嶉噺 + /// </summary> + GoodsWeight, + + /// <summary> + /// 璐х墿绫诲瀷 + /// </summary> + GoodsType, + + /// <summary> + /// 0闈欐1鍓嶈繘2鍚庨��3涓婂崌/椤烘椂閽堟棆杞�4涓嬮檷/閫嗘椂閽堟棆杞� + /// </summary> + RunStatus, + + /// <summary> + /// 鏉$爜 + /// </summary> + Barcode, + + /// <summary> + /// 棰勭暀 + /// </summary> + Sapre1, + + /// <summary> + /// 棰勭暀 + /// </summary> + Sapre2, + + /// <summary> + /// 璇锋眰淇″彿 + /// </summary> + STB, + + /// <summary> + /// 鍝嶅簲淇″彿 + /// </summary> + ACK + } + +} diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/W_ConveyorLineDBName.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/W_ConveyorLineDBName.cs" new file mode 100644 index 0000000..23a4edb --- /dev/null +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/W_ConveyorLineDBName.cs" @@ -0,0 +1,72 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace WIDESEAWCS_Tasks.ConveyorLineJob +{ + public enum W_ConveyorLineDBName + { + /// <summary> + /// 绔欏彴缂栧彿 + /// </summary> + ConveyorNo, + + /// <summary> + /// 鎻℃墜淇″彿 + /// </summary> + HandShake, + + /// <summary> + /// 澶嶄綅鎶ヨ + /// </summary> + ClearAlarm, + + /// <summary> + /// 閫�鍥� + /// </summary> + Return, + + /// <summary> + /// 浠诲姟鍙� + /// </summary> + TaskNum, + + /// <summary> + /// 璧峰鍦板潃 + /// </summary> + StartPos, + + /// <summary> + /// 鐩爣鍦板潃 + /// </summary> + EndPos, + + /// <summary> + /// 璐х墿绫诲瀷 + /// </summary> + GoodsType, + + /// <summary> + /// 棰勭暀1 + /// </summary> + Sapre1, + + /// <summary> + /// 棰勭暀2 + /// </summary> + Sapre2, + + /// <summary> + /// 璇锋眰淇″彿 + /// </summary> + STB, + + /// <summary> + /// 鍝嶅簲淇″彿 + /// </summary> + ACK + + } +} diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/PP\344\273\223/StackerCraneJob_PP.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/PP\344\273\223/StackerCraneJob_PP.cs" new file mode 100644 index 0000000..b8b06cd --- /dev/null +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/PP\344\273\223/StackerCraneJob_PP.cs" @@ -0,0 +1,303 @@ +锘縰sing Microsoft.AspNetCore.Components.Routing; +using Quartz; +using System; +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WIDESEAWCS_Common.TaskEnum; +using WIDESEAWCS_Core.Enums; +using WIDESEAWCS_IBasicInfoRepository; +using WIDESEAWCS_ITaskInfoRepository; +using WIDESEAWCS_ITaskInfoService; +using WIDESEAWCS_Model.Models; +using WIDESEAWCS_QuartzJob; +using WIDESEAWCS_QuartzJob.DeviceBase; +using WIDESEAWCS_QuartzJob.Models; +using WIDESEAWCS_QuartzJob.Service; +using WIDESEAWCS_QuartzJob.StackerCrane.Enum; +using WIDESEAWCS_Tasks.HoisterJob; +using WIDESEAWCS_Tasks.StackerCraneJob; +using WIDESEAWCS_Tasks.闃荤剨浠�; + +namespace WIDESEAWCS_Tasks +{ + [DisallowConcurrentExecution] + public class StackerCraneJob_PP : JobBase, IJob + { + private readonly ITaskService _taskService; + private readonly ITaskExecuteDetailService _taskExecuteDetailService; + private readonly ITaskRepository _taskRepository; + private readonly IRouterService _routerService; + private readonly IStationMangerRepository _stationMangerRepository; + + public StackerCraneJob_PP(ITaskService taskService, ITaskExecuteDetailService taskExecuteDetailService, ITaskRepository taskRepository, IRouterService routerService, IStationMangerRepository stationMangerRepository) + { + _taskService = taskService; + _taskExecuteDetailService = taskExecuteDetailService; + _taskRepository = taskRepository; + _routerService = routerService; + _stationMangerRepository = stationMangerRepository; + } + + public Task Execute(IJobExecutionContext context) + { + try + { + CommonStackerCrane commonStackerCrane = (CommonStackerCrane)context.JobDetail.JobDataMap.Get("JobParams"); + if (commonStackerCrane != null) + { + if (!commonStackerCrane.IsEventSubscribed) + { + commonStackerCrane.StackerCraneTaskCompletedEventHandler += CommonStackerCrane_StackerCraneTaskCompletedEventHandler;//璁㈤槄浠诲姟瀹屾垚浜嬩欢 + } + + if (commonStackerCrane.StackerCraneAutoStatusValue == StackerCraneAutoStatus.Automatic && commonStackerCrane.StackerCraneStatusValue == StackerCraneStatus.Normal) + { + commonStackerCrane.CheckStackerCraneTaskCompleted();//闃叉浠诲姟瀹屾垚浜嬩欢鐩戞祴瓒呮椂锛屽啀鎵嬪姩瑙﹀彂涓�娆� + + if (commonStackerCrane.StackerCraneWorkStatusValue == StackerCraneWorkStatus.Standby) + { + Dt_Task? task = GetTask(commonStackerCrane); + if (task != null) + { + StackerCraneTaskCommand? stackerCraneTaskCommand = ConvertToStackerCraneTaskCommand(task); + if (stackerCraneTaskCommand != null) + { + bool sendFlag = commonStackerCrane.SendCommand(stackerCraneTaskCommand); + if (sendFlag) + { + commonStackerCrane.LastTaskType = task.TaskType; + _taskService.UpdateTaskStatusToNext(task.TaskNum); + } + } + } + } + } + } + } + catch (Exception ex) + { + WriteError(nameof(CommonStackerCraneJob), ex.Message, ex); + } + return Task.CompletedTask; + } + + /// <summary> + /// 浠诲姟瀹屾垚浜嬩欢璁㈤槄鐨勬柟娉� + /// </summary> + /// <param name="sender"></param> + /// <param name="e"></param> + private void CommonStackerCrane_StackerCraneTaskCompletedEventHandler(object? sender, WIDESEAWCS_QuartzJob.StackerCrane.StackerCraneTaskCompletedEventArgs e) + { + CommonStackerCrane? commonStackerCrane = sender as CommonStackerCrane; + if (commonStackerCrane != null) + { + if (commonStackerCrane.GetValue<StackerCraneDBName, short>(StackerCraneDBName.WorkType) != 5) + { + Console.Out.WriteLine("TaskCompleted" + e.TaskNum); + _taskService.StackCraneTaskCompleted(e.TaskNum); + commonStackerCrane.SetValue(StackerCraneDBName.WorkType, 5); + } + } + } + + /// <summary> + /// 鑾峰彇浠诲姟 + /// </summary> + /// <param name="commonStackerCrane">鍫嗗灈鏈哄璞�</param> + /// <returns></returns> + private Dt_Task? GetTask(CommonStackerCrane commonStackerCrane) + { + Dt_Task task; + if (commonStackerCrane.LastTaskType == null) + { + task = _taskService.QueryStackerCraneTask(commonStackerCrane.DeviceCode); + } + else + { + if (commonStackerCrane.LastTaskType.GetValueOrDefault().GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup) + { + task = _taskService.QueryStackerCraneInTask(commonStackerCrane.DeviceCode); + if (task == null) + { + task = _taskService.QueryStackerCraneOutTask(commonStackerCrane.DeviceCode); + } + } + else + { + task = _taskService.QueryStackerCraneOutTask(commonStackerCrane.DeviceCode); + if (task == null) + { + task = _taskService.QueryStackerCraneInTask(commonStackerCrane.DeviceCode); + } + } + } + + if (task != null && task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup) + { + if (OutTaskStationIsOccupied(task) != null || true) + { + return task; + } + else + { + List<string> otherOutStaionCodes = _routerService.QueryNextRoutes(commonStackerCrane.DeviceCode, task.NextAddress).Select(x => x.ChildPosi).ToList(); + List<Dt_Task> tasks = _taskService.QueryStackerCraneOutTasks(commonStackerCrane.DeviceCode, otherOutStaionCodes); + foreach (var item in tasks) + { + if (OutTaskStationIsOccupied(task) != null) + { + return task; + } + } + task = _taskService.QueryStackerCraneInTask(commonStackerCrane.DeviceCode); + } + } + + return task; + } + + /// <summary> + /// 鍑哄簱浠诲姟鍒ゆ柇鍑哄簱绔欏彴鏄惁琚崰鐢� + /// </summary> + /// <param name="task">浠诲姟瀹炰綋</param> + /// <returns>濡傛灉鏈鍗犵敤锛岃繑鍥炰紶鍏ョ殑浠诲姟淇℃伅锛屽惁鍒欙紝杩斿洖null</returns> + private Dt_Task? OutTaskStationIsOccupied([NotNull] Dt_Task task) + { + Dt_StationManger? stationManger = _stationMangerRepository.QueryFirst(x => x.StationCode == task.TargetAddress && x.StackerCraneCode == task.Roadway); + if (stationManger != null) + { + IDevice? device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == stationManger.StationDeviceCode); + if (device != null) + { + OtherDevice client = (OtherDevice)device; + if (client.GetValue<GroundStationDBName, bool>(GroundStationDBName.R_IsCanPut, stationManger.StationCode))//鍑哄簱绔欏彴鏈鍗犵敤 + { + task.TargetAddress = stationManger.StackerCraneStationCode; + _taskRepository.UpdateData(task); + return task; + } + } + else + { + _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"鏈壘鍒板嚭搴撶珯鍙般�恵stationManger.StationDeviceCode}銆戝搴旂殑閫氳瀵硅薄锛屾棤娉曞垽鏂嚭搴撶珯鍙版槸鍚﹁鍗犵敤"); + } + } + else + { + _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"鏈壘鍒扮珯鍙般�恵task.NextAddress}銆戜俊鎭紝鏃犳硶鏍¢獙绔欏彴"); + } + return null; + } + + /// <summary> + /// 浠诲姟瀹炰綋杞崲鎴愬懡浠odel + /// </summary> + /// <param name="task">浠诲姟瀹炰綋</param> + /// <returns></returns> + /// <exception cref="Exception"></exception> + public StackerCraneTaskCommand? ConvertToStackerCraneTaskCommand([NotNull] Dt_Task task) + { + StackerCraneTaskCommand stackerCraneTaskCommand = new StackerCraneTaskCommand(); + + stackerCraneTaskCommand.Barcode = task.PalletCode; + stackerCraneTaskCommand.TaskNum = task.TaskNum; + stackerCraneTaskCommand.WorkType = 1; + stackerCraneTaskCommand.TrayType = 1; + if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.InboundGroup)//鍒ゆ柇鏄惁鏄叆搴撲换鍔� + { + //List<Dt_Router> routers = _routerService.QueryNextRoutes(task.CurrentAddress, task.Roadway); + //if (routers.Count > 0) + //{ + string[] startCodes = task.CurrentAddress.Split("-"); + + stackerCraneTaskCommand.StartRow = Convert.ToInt16(startCodes[0]); + stackerCraneTaskCommand.StartColumn = Convert.ToInt16(startCodes[1]); + stackerCraneTaskCommand.StartLayer = Convert.ToInt16(startCodes[2]); + + string[] targetCodes = task.NextAddress.Split("-"); + if (targetCodes.Length == 3) + { + stackerCraneTaskCommand.EndRow = Convert.ToInt16(targetCodes[0]); + stackerCraneTaskCommand.EndColumn = Convert.ToInt16(targetCodes[1]); + stackerCraneTaskCommand.EndLayer = Convert.ToInt16(targetCodes[2]); + } + else + { + //鏁版嵁閰嶇疆閿欒 + _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"鍏ュ簱浠诲姟缁堢偣閿欒锛岃捣鐐癸細銆恵task.NextAddress}銆�"); + return null; + } + //} + //else + //{ + // _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"鏈壘鍒扮珯鍙般�恵task.NextAddress}銆戜俊鎭紝鏃犳硶鑾峰彇瀵瑰簲鐨勫爢鍨涙満鍙栬揣绔欏彴淇℃伅"); + // return null; + //} + } + else if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup) + { + //List<Dt_Router> routers = _routerService.QueryNextRoutes(task.Roadway, task.TargetAddress); + //if (routers.Count > 0) + { + string[] targetCodes = task.NextAddress.Split("-"); + + stackerCraneTaskCommand.EndRow = Convert.ToInt16(targetCodes[0]); + stackerCraneTaskCommand.EndColumn = Convert.ToInt16(targetCodes[1]); + stackerCraneTaskCommand.EndLayer = Convert.ToInt16(targetCodes[2]); + + string[] sourceCodes = task.CurrentAddress.Split("-"); + if (sourceCodes.Length == 3) + { + stackerCraneTaskCommand.StartRow = Convert.ToInt16(sourceCodes[0]); + stackerCraneTaskCommand.StartColumn = Convert.ToInt16(sourceCodes[1]); + stackerCraneTaskCommand.StartLayer = Convert.ToInt16(sourceCodes[2]); + } + else + { + //鏁版嵁閰嶇疆閿欒 + _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"鍑哄簱浠诲姟璧风偣閿欒锛岃捣鐐癸細銆恵task.CurrentAddress}銆�"); + return null; + } + } + //else + //{ + // _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"鏈壘鍒扮珯鍙般�恵task.NextAddress}銆戜俊鎭紝鏃犳硶鑾峰彇瀵瑰簲鐨勫爢鍨涙満鏀捐揣绔欏彴淇℃伅"); + // return null; + //} + } + else if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.RelocationGroup) + { + string[] targetCodes = task.NextAddress.Split("-"); + if (targetCodes.Length == 3) + { + stackerCraneTaskCommand.EndRow = Convert.ToInt16(targetCodes[0]); + stackerCraneTaskCommand.EndColumn = Convert.ToInt16(targetCodes[1]); + stackerCraneTaskCommand.EndLayer = Convert.ToInt16(targetCodes[2]); + } + else + { + //鏁版嵁閰嶇疆閿欒 + _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"绉诲簱浠诲姟缁堢偣閿欒锛岃捣鐐癸細銆恵task.NextAddress}銆�"); + return null; + } + string[] sourceCodes = task.CurrentAddress.Split("-"); + if (sourceCodes.Length == 3) + { + stackerCraneTaskCommand.StartRow = Convert.ToInt16(sourceCodes[0]); + stackerCraneTaskCommand.StartColumn = Convert.ToInt16(sourceCodes[1]); + stackerCraneTaskCommand.StartLayer = Convert.ToInt16(sourceCodes[2]); + } + else + { + //鏁版嵁閰嶇疆閿欒 + _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"绉诲簱浠诲姟璧风偣閿欒锛岃捣鐐癸細銆恵task.CurrentAddress}銆�"); + return null; + } + } + return stackerCraneTaskCommand; + } + } +} 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" new file mode 100644 index 0000000..003e20b --- /dev/null +++ "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" @@ -0,0 +1,303 @@ +锘縰sing Microsoft.AspNetCore.Components.Routing; +using Quartz; +using System; +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WIDESEAWCS_Common.TaskEnum; +using WIDESEAWCS_Core.Enums; +using WIDESEAWCS_IBasicInfoRepository; +using WIDESEAWCS_ITaskInfoRepository; +using WIDESEAWCS_ITaskInfoService; +using WIDESEAWCS_Model.Models; +using WIDESEAWCS_QuartzJob; +using WIDESEAWCS_QuartzJob.DeviceBase; +using WIDESEAWCS_QuartzJob.Models; +using WIDESEAWCS_QuartzJob.Service; +using WIDESEAWCS_QuartzJob.StackerCrane.Enum; +using WIDESEAWCS_Tasks.HoisterJob; +using WIDESEAWCS_Tasks.StackerCraneJob; +using WIDESEAWCS_Tasks.闃荤剨浠�; + +namespace WIDESEAWCS_Tasks +{ + [DisallowConcurrentExecution] + public class StackerCraneJob_GM : JobBase, IJob + { + private readonly ITaskService _taskService; + private readonly ITaskExecuteDetailService _taskExecuteDetailService; + private readonly ITaskRepository _taskRepository; + private readonly IRouterService _routerService; + private readonly IStationMangerRepository _stationMangerRepository; + + public StackerCraneJob_GM(ITaskService taskService, ITaskExecuteDetailService taskExecuteDetailService, ITaskRepository taskRepository, IRouterService routerService, IStationMangerRepository stationMangerRepository) + { + _taskService = taskService; + _taskExecuteDetailService = taskExecuteDetailService; + _taskRepository = taskRepository; + _routerService = routerService; + _stationMangerRepository = stationMangerRepository; + } + + public Task Execute(IJobExecutionContext context) + { + try + { + CommonStackerCrane commonStackerCrane = (CommonStackerCrane)context.JobDetail.JobDataMap.Get("JobParams"); + if (commonStackerCrane != null) + { + if (!commonStackerCrane.IsEventSubscribed) + { + commonStackerCrane.StackerCraneTaskCompletedEventHandler += CommonStackerCrane_StackerCraneTaskCompletedEventHandler;//璁㈤槄浠诲姟瀹屾垚浜嬩欢 + } + + if (commonStackerCrane.StackerCraneAutoStatusValue == StackerCraneAutoStatus.Automatic && commonStackerCrane.StackerCraneStatusValue == StackerCraneStatus.Normal) + { + commonStackerCrane.CheckStackerCraneTaskCompleted();//闃叉浠诲姟瀹屾垚浜嬩欢鐩戞祴瓒呮椂锛屽啀鎵嬪姩瑙﹀彂涓�娆� + + if (commonStackerCrane.StackerCraneWorkStatusValue == StackerCraneWorkStatus.Standby) + { + Dt_Task? task = GetTask(commonStackerCrane); + if (task != null) + { + StackerCraneTaskCommand? stackerCraneTaskCommand = ConvertToStackerCraneTaskCommand(task); + if (stackerCraneTaskCommand != null) + { + bool sendFlag = commonStackerCrane.SendCommand(stackerCraneTaskCommand); + if (sendFlag) + { + commonStackerCrane.LastTaskType = task.TaskType; + _taskService.UpdateTaskStatusToNext(task.TaskNum); + } + } + } + } + } + } + } + catch (Exception ex) + { + WriteError(nameof(CommonStackerCraneJob), ex.Message, ex); + } + return Task.CompletedTask; + } + + /// <summary> + /// 浠诲姟瀹屾垚浜嬩欢璁㈤槄鐨勬柟娉� + /// </summary> + /// <param name="sender"></param> + /// <param name="e"></param> + private void CommonStackerCrane_StackerCraneTaskCompletedEventHandler(object? sender, WIDESEAWCS_QuartzJob.StackerCrane.StackerCraneTaskCompletedEventArgs e) + { + CommonStackerCrane? commonStackerCrane = sender as CommonStackerCrane; + if (commonStackerCrane != null) + { + if (commonStackerCrane.GetValue<StackerCraneDBName, short>(StackerCraneDBName.WorkType) != 5) + { + Console.Out.WriteLine("TaskCompleted" + e.TaskNum); + _taskService.StackCraneTaskCompleted(e.TaskNum); + commonStackerCrane.SetValue(StackerCraneDBName.WorkType, 5); + } + } + } + + /// <summary> + /// 鑾峰彇浠诲姟 + /// </summary> + /// <param name="commonStackerCrane">鍫嗗灈鏈哄璞�</param> + /// <returns></returns> + private Dt_Task? GetTask(CommonStackerCrane commonStackerCrane) + { + Dt_Task task; + if (commonStackerCrane.LastTaskType == null) + { + task = _taskService.QueryStackerCraneTask(commonStackerCrane.DeviceCode); + } + else + { + if (commonStackerCrane.LastTaskType.GetValueOrDefault().GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup) + { + task = _taskService.QueryStackerCraneInTask(commonStackerCrane.DeviceCode); + if (task == null) + { + task = _taskService.QueryStackerCraneOutTask(commonStackerCrane.DeviceCode); + } + } + else + { + task = _taskService.QueryStackerCraneOutTask(commonStackerCrane.DeviceCode); + if (task == null) + { + task = _taskService.QueryStackerCraneInTask(commonStackerCrane.DeviceCode); + } + } + } + + if (task != null && task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup) + { + if (OutTaskStationIsOccupied(task) != null || true) + { + return task; + } + else + { + List<string> otherOutStaionCodes = _routerService.QueryNextRoutes(commonStackerCrane.DeviceCode, task.NextAddress).Select(x => x.ChildPosi).ToList(); + List<Dt_Task> tasks = _taskService.QueryStackerCraneOutTasks(commonStackerCrane.DeviceCode, otherOutStaionCodes); + foreach (var item in tasks) + { + if (OutTaskStationIsOccupied(task) != null) + { + return task; + } + } + task = _taskService.QueryStackerCraneInTask(commonStackerCrane.DeviceCode); + } + } + + return task; + } + + /// <summary> + /// 鍑哄簱浠诲姟鍒ゆ柇鍑哄簱绔欏彴鏄惁琚崰鐢� + /// </summary> + /// <param name="task">浠诲姟瀹炰綋</param> + /// <returns>濡傛灉鏈鍗犵敤锛岃繑鍥炰紶鍏ョ殑浠诲姟淇℃伅锛屽惁鍒欙紝杩斿洖null</returns> + private Dt_Task? OutTaskStationIsOccupied([NotNull] Dt_Task task) + { + Dt_StationManger? stationManger = _stationMangerRepository.QueryFirst(x => x.StationCode == task.TargetAddress && x.StackerCraneCode == task.Roadway); + if (stationManger != null) + { + IDevice? device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == stationManger.StationDeviceCode); + if (device != null) + { + OtherDevice client = (OtherDevice)device; + if (client.GetValue<GroundStationDBName, bool>(GroundStationDBName.R_IsCanPut, stationManger.StationCode))//鍑哄簱绔欏彴鏈鍗犵敤 + { + task.TargetAddress = stationManger.StackerCraneStationCode; + _taskRepository.UpdateData(task); + return task; + } + } + else + { + _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"鏈壘鍒板嚭搴撶珯鍙般�恵stationManger.StationDeviceCode}銆戝搴旂殑閫氳瀵硅薄锛屾棤娉曞垽鏂嚭搴撶珯鍙版槸鍚﹁鍗犵敤"); + } + } + else + { + _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"鏈壘鍒扮珯鍙般�恵task.NextAddress}銆戜俊鎭紝鏃犳硶鏍¢獙绔欏彴"); + } + return null; + } + + /// <summary> + /// 浠诲姟瀹炰綋杞崲鎴愬懡浠odel + /// </summary> + /// <param name="task">浠诲姟瀹炰綋</param> + /// <returns></returns> + /// <exception cref="Exception"></exception> + public StackerCraneTaskCommand? ConvertToStackerCraneTaskCommand([NotNull] Dt_Task task) + { + StackerCraneTaskCommand stackerCraneTaskCommand = new StackerCraneTaskCommand(); + + stackerCraneTaskCommand.Barcode = task.PalletCode; + stackerCraneTaskCommand.TaskNum = task.TaskNum; + stackerCraneTaskCommand.WorkType = 1; + stackerCraneTaskCommand.TrayType = 1; + if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.InboundGroup)//鍒ゆ柇鏄惁鏄叆搴撲换鍔� + { + //List<Dt_Router> routers = _routerService.QueryNextRoutes(task.CurrentAddress, task.Roadway); + //if (routers.Count > 0) + //{ + string[] startCodes = task.CurrentAddress.Split("-"); + + stackerCraneTaskCommand.StartRow = Convert.ToInt16(startCodes[0]); + stackerCraneTaskCommand.StartColumn = Convert.ToInt16(startCodes[1]); + stackerCraneTaskCommand.StartLayer = Convert.ToInt16(startCodes[2]); + + string[] targetCodes = task.NextAddress.Split("-"); + if (targetCodes.Length == 3) + { + stackerCraneTaskCommand.EndRow = Convert.ToInt16(targetCodes[0]); + stackerCraneTaskCommand.EndColumn = Convert.ToInt16(targetCodes[1]); + stackerCraneTaskCommand.EndLayer = Convert.ToInt16(targetCodes[2]); + } + else + { + //鏁版嵁閰嶇疆閿欒 + _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"鍏ュ簱浠诲姟缁堢偣閿欒锛岃捣鐐癸細銆恵task.NextAddress}銆�"); + return null; + } + //} + //else + //{ + // _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"鏈壘鍒扮珯鍙般�恵task.NextAddress}銆戜俊鎭紝鏃犳硶鑾峰彇瀵瑰簲鐨勫爢鍨涙満鍙栬揣绔欏彴淇℃伅"); + // return null; + //} + } + else if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup) + { + //List<Dt_Router> routers = _routerService.QueryNextRoutes(task.Roadway, task.TargetAddress); + //if (routers.Count > 0) + { + string[] targetCodes = task.NextAddress.Split("-"); + + stackerCraneTaskCommand.EndRow = Convert.ToInt16(targetCodes[0]); + stackerCraneTaskCommand.EndColumn = Convert.ToInt16(targetCodes[1]); + stackerCraneTaskCommand.EndLayer = Convert.ToInt16(targetCodes[2]); + + string[] sourceCodes = task.CurrentAddress.Split("-"); + if (sourceCodes.Length == 3) + { + stackerCraneTaskCommand.StartRow = Convert.ToInt16(sourceCodes[0]); + stackerCraneTaskCommand.StartColumn = Convert.ToInt16(sourceCodes[1]); + stackerCraneTaskCommand.StartLayer = Convert.ToInt16(sourceCodes[2]); + } + else + { + //鏁版嵁閰嶇疆閿欒 + _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"鍑哄簱浠诲姟璧风偣閿欒锛岃捣鐐癸細銆恵task.CurrentAddress}銆�"); + return null; + } + } + //else + //{ + // _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"鏈壘鍒扮珯鍙般�恵task.NextAddress}銆戜俊鎭紝鏃犳硶鑾峰彇瀵瑰簲鐨勫爢鍨涙満鏀捐揣绔欏彴淇℃伅"); + // return null; + //} + } + else if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.RelocationGroup) + { + string[] targetCodes = task.NextAddress.Split("-"); + if (targetCodes.Length == 3) + { + stackerCraneTaskCommand.EndRow = Convert.ToInt16(targetCodes[0]); + stackerCraneTaskCommand.EndColumn = Convert.ToInt16(targetCodes[1]); + stackerCraneTaskCommand.EndLayer = Convert.ToInt16(targetCodes[2]); + } + else + { + //鏁版嵁閰嶇疆閿欒 + _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"绉诲簱浠诲姟缁堢偣閿欒锛岃捣鐐癸細銆恵task.NextAddress}銆�"); + return null; + } + string[] sourceCodes = task.CurrentAddress.Split("-"); + if (sourceCodes.Length == 3) + { + stackerCraneTaskCommand.StartRow = Convert.ToInt16(sourceCodes[0]); + stackerCraneTaskCommand.StartColumn = Convert.ToInt16(sourceCodes[1]); + stackerCraneTaskCommand.StartLayer = Convert.ToInt16(sourceCodes[2]); + } + else + { + //鏁版嵁閰嶇疆閿欒 + _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"绉诲簱浠诲姟璧风偣閿欒锛岃捣鐐癸細銆恵task.CurrentAddress}銆�"); + return null; + } + } + return stackerCraneTaskCommand; + } + } +} 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" new file mode 100644 index 0000000..2f537f9 --- /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/StackerCraneJob_BC.cs" @@ -0,0 +1,303 @@ +锘縰sing Microsoft.AspNetCore.Components.Routing; +using Quartz; +using System; +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WIDESEAWCS_Common.TaskEnum; +using WIDESEAWCS_Core.Enums; +using WIDESEAWCS_IBasicInfoRepository; +using WIDESEAWCS_ITaskInfoRepository; +using WIDESEAWCS_ITaskInfoService; +using WIDESEAWCS_Model.Models; +using WIDESEAWCS_QuartzJob; +using WIDESEAWCS_QuartzJob.DeviceBase; +using WIDESEAWCS_QuartzJob.Models; +using WIDESEAWCS_QuartzJob.Service; +using WIDESEAWCS_QuartzJob.StackerCrane.Enum; +using WIDESEAWCS_Tasks.HoisterJob; +using WIDESEAWCS_Tasks.StackerCraneJob; +using WIDESEAWCS_Tasks.闃荤剨浠�; + +namespace WIDESEAWCS_Tasks +{ + [DisallowConcurrentExecution] + public class StackerCraneJob_BC : JobBase, IJob + { + private readonly ITaskService _taskService; + private readonly ITaskExecuteDetailService _taskExecuteDetailService; + private readonly ITaskRepository _taskRepository; + private readonly IRouterService _routerService; + private readonly IStationMangerRepository _stationMangerRepository; + + public StackerCraneJob_BC(ITaskService taskService, ITaskExecuteDetailService taskExecuteDetailService, ITaskRepository taskRepository, IRouterService routerService, IStationMangerRepository stationMangerRepository) + { + _taskService = taskService; + _taskExecuteDetailService = taskExecuteDetailService; + _taskRepository = taskRepository; + _routerService = routerService; + _stationMangerRepository = stationMangerRepository; + } + + public Task Execute(IJobExecutionContext context) + { + try + { + CommonStackerCrane commonStackerCrane = (CommonStackerCrane)context.JobDetail.JobDataMap.Get("JobParams"); + if (commonStackerCrane != null) + { + if (!commonStackerCrane.IsEventSubscribed) + { + commonStackerCrane.StackerCraneTaskCompletedEventHandler += CommonStackerCrane_StackerCraneTaskCompletedEventHandler;//璁㈤槄浠诲姟瀹屾垚浜嬩欢 + } + + if (commonStackerCrane.StackerCraneAutoStatusValue == StackerCraneAutoStatus.Automatic && commonStackerCrane.StackerCraneStatusValue == StackerCraneStatus.Normal) + { + commonStackerCrane.CheckStackerCraneTaskCompleted();//闃叉浠诲姟瀹屾垚浜嬩欢鐩戞祴瓒呮椂锛屽啀鎵嬪姩瑙﹀彂涓�娆� + + if (commonStackerCrane.StackerCraneWorkStatusValue == StackerCraneWorkStatus.Standby) + { + Dt_Task? task = GetTask(commonStackerCrane); + if (task != null) + { + StackerCraneTaskCommand? stackerCraneTaskCommand = ConvertToStackerCraneTaskCommand(task); + if (stackerCraneTaskCommand != null) + { + bool sendFlag = commonStackerCrane.SendCommand(stackerCraneTaskCommand); + if (sendFlag) + { + commonStackerCrane.LastTaskType = task.TaskType; + _taskService.UpdateTaskStatusToNext(task.TaskNum); + } + } + } + } + } + } + } + catch (Exception ex) + { + WriteError(nameof(CommonStackerCraneJob), ex.Message, ex); + } + return Task.CompletedTask; + } + + /// <summary> + /// 浠诲姟瀹屾垚浜嬩欢璁㈤槄鐨勬柟娉� + /// </summary> + /// <param name="sender"></param> + /// <param name="e"></param> + private void CommonStackerCrane_StackerCraneTaskCompletedEventHandler(object? sender, WIDESEAWCS_QuartzJob.StackerCrane.StackerCraneTaskCompletedEventArgs e) + { + CommonStackerCrane? commonStackerCrane = sender as CommonStackerCrane; + if (commonStackerCrane != null) + { + if (commonStackerCrane.GetValue<StackerCraneDBName, short>(StackerCraneDBName.WorkType) != 5) + { + Console.Out.WriteLine("TaskCompleted" + e.TaskNum); + _taskService.StackCraneTaskCompleted(e.TaskNum); + commonStackerCrane.SetValue(StackerCraneDBName.WorkType, 5); + } + } + } + + /// <summary> + /// 鑾峰彇浠诲姟 + /// </summary> + /// <param name="commonStackerCrane">鍫嗗灈鏈哄璞�</param> + /// <returns></returns> + private Dt_Task? GetTask(CommonStackerCrane commonStackerCrane) + { + Dt_Task task; + if (commonStackerCrane.LastTaskType == null) + { + task = _taskService.QueryStackerCraneTask(commonStackerCrane.DeviceCode); + } + else + { + if (commonStackerCrane.LastTaskType.GetValueOrDefault().GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup) + { + task = _taskService.QueryStackerCraneInTask(commonStackerCrane.DeviceCode); + if (task == null) + { + task = _taskService.QueryStackerCraneOutTask(commonStackerCrane.DeviceCode); + } + } + else + { + task = _taskService.QueryStackerCraneOutTask(commonStackerCrane.DeviceCode); + if (task == null) + { + task = _taskService.QueryStackerCraneInTask(commonStackerCrane.DeviceCode); + } + } + } + + if (task != null && task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup) + { + if (OutTaskStationIsOccupied(task) != null || true) + { + return task; + } + else + { + List<string> otherOutStaionCodes = _routerService.QueryNextRoutes(commonStackerCrane.DeviceCode, task.NextAddress).Select(x => x.ChildPosi).ToList(); + List<Dt_Task> tasks = _taskService.QueryStackerCraneOutTasks(commonStackerCrane.DeviceCode, otherOutStaionCodes); + foreach (var item in tasks) + { + if (OutTaskStationIsOccupied(task) != null) + { + return task; + } + } + task = _taskService.QueryStackerCraneInTask(commonStackerCrane.DeviceCode); + } + } + + return task; + } + + /// <summary> + /// 鍑哄簱浠诲姟鍒ゆ柇鍑哄簱绔欏彴鏄惁琚崰鐢� + /// </summary> + /// <param name="task">浠诲姟瀹炰綋</param> + /// <returns>濡傛灉鏈鍗犵敤锛岃繑鍥炰紶鍏ョ殑浠诲姟淇℃伅锛屽惁鍒欙紝杩斿洖null</returns> + private Dt_Task? OutTaskStationIsOccupied([NotNull] Dt_Task task) + { + Dt_StationManger? stationManger = _stationMangerRepository.QueryFirst(x => x.StationCode == task.TargetAddress && x.StackerCraneCode == task.Roadway); + if (stationManger != null) + { + IDevice? device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == stationManger.StationDeviceCode); + if (device != null) + { + OtherDevice client = (OtherDevice)device; + if (client.GetValue<GroundStationDBName, bool>(GroundStationDBName.R_IsCanPut, stationManger.StationCode))//鍑哄簱绔欏彴鏈鍗犵敤 + { + task.TargetAddress = stationManger.StackerCraneStationCode; + _taskRepository.UpdateData(task); + return task; + } + } + else + { + _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"鏈壘鍒板嚭搴撶珯鍙般�恵stationManger.StationDeviceCode}銆戝搴旂殑閫氳瀵硅薄锛屾棤娉曞垽鏂嚭搴撶珯鍙版槸鍚﹁鍗犵敤"); + } + } + else + { + _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"鏈壘鍒扮珯鍙般�恵task.NextAddress}銆戜俊鎭紝鏃犳硶鏍¢獙绔欏彴"); + } + return null; + } + + /// <summary> + /// 浠诲姟瀹炰綋杞崲鎴愬懡浠odel + /// </summary> + /// <param name="task">浠诲姟瀹炰綋</param> + /// <returns></returns> + /// <exception cref="Exception"></exception> + public StackerCraneTaskCommand? ConvertToStackerCraneTaskCommand([NotNull] Dt_Task task) + { + StackerCraneTaskCommand stackerCraneTaskCommand = new StackerCraneTaskCommand(); + + stackerCraneTaskCommand.Barcode = task.PalletCode; + stackerCraneTaskCommand.TaskNum = task.TaskNum; + stackerCraneTaskCommand.WorkType = 1; + stackerCraneTaskCommand.TrayType = 1; + if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.InboundGroup)//鍒ゆ柇鏄惁鏄叆搴撲换鍔� + { + //List<Dt_Router> routers = _routerService.QueryNextRoutes(task.CurrentAddress, task.Roadway); + //if (routers.Count > 0) + //{ + string[] startCodes = task.CurrentAddress.Split("-"); + + stackerCraneTaskCommand.StartRow = Convert.ToInt16(startCodes[0]); + stackerCraneTaskCommand.StartColumn = Convert.ToInt16(startCodes[1]); + stackerCraneTaskCommand.StartLayer = Convert.ToInt16(startCodes[2]); + + string[] targetCodes = task.NextAddress.Split("-"); + if (targetCodes.Length == 3) + { + stackerCraneTaskCommand.EndRow = Convert.ToInt16(targetCodes[0]); + stackerCraneTaskCommand.EndColumn = Convert.ToInt16(targetCodes[1]); + stackerCraneTaskCommand.EndLayer = Convert.ToInt16(targetCodes[2]); + } + else + { + //鏁版嵁閰嶇疆閿欒 + _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"鍏ュ簱浠诲姟缁堢偣閿欒锛岃捣鐐癸細銆恵task.NextAddress}銆�"); + return null; + } + //} + //else + //{ + // _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"鏈壘鍒扮珯鍙般�恵task.NextAddress}銆戜俊鎭紝鏃犳硶鑾峰彇瀵瑰簲鐨勫爢鍨涙満鍙栬揣绔欏彴淇℃伅"); + // return null; + //} + } + else if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup) + { + //List<Dt_Router> routers = _routerService.QueryNextRoutes(task.Roadway, task.TargetAddress); + //if (routers.Count > 0) + { + string[] targetCodes = task.NextAddress.Split("-"); + + stackerCraneTaskCommand.EndRow = Convert.ToInt16(targetCodes[0]); + stackerCraneTaskCommand.EndColumn = Convert.ToInt16(targetCodes[1]); + stackerCraneTaskCommand.EndLayer = Convert.ToInt16(targetCodes[2]); + + string[] sourceCodes = task.CurrentAddress.Split("-"); + if (sourceCodes.Length == 3) + { + stackerCraneTaskCommand.StartRow = Convert.ToInt16(sourceCodes[0]); + stackerCraneTaskCommand.StartColumn = Convert.ToInt16(sourceCodes[1]); + stackerCraneTaskCommand.StartLayer = Convert.ToInt16(sourceCodes[2]); + } + else + { + //鏁版嵁閰嶇疆閿欒 + _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"鍑哄簱浠诲姟璧风偣閿欒锛岃捣鐐癸細銆恵task.CurrentAddress}銆�"); + return null; + } + } + //else + //{ + // _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"鏈壘鍒扮珯鍙般�恵task.NextAddress}銆戜俊鎭紝鏃犳硶鑾峰彇瀵瑰簲鐨勫爢鍨涙満鏀捐揣绔欏彴淇℃伅"); + // return null; + //} + } + else if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.RelocationGroup) + { + string[] targetCodes = task.NextAddress.Split("-"); + if (targetCodes.Length == 3) + { + stackerCraneTaskCommand.EndRow = Convert.ToInt16(targetCodes[0]); + stackerCraneTaskCommand.EndColumn = Convert.ToInt16(targetCodes[1]); + stackerCraneTaskCommand.EndLayer = Convert.ToInt16(targetCodes[2]); + } + else + { + //鏁版嵁閰嶇疆閿欒 + _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"绉诲簱浠诲姟缁堢偣閿欒锛岃捣鐐癸細銆恵task.NextAddress}銆�"); + return null; + } + string[] sourceCodes = task.CurrentAddress.Split("-"); + if (sourceCodes.Length == 3) + { + stackerCraneTaskCommand.StartRow = Convert.ToInt16(sourceCodes[0]); + stackerCraneTaskCommand.StartColumn = Convert.ToInt16(sourceCodes[1]); + stackerCraneTaskCommand.StartLayer = Convert.ToInt16(sourceCodes[2]); + } + else + { + //鏁版嵁閰嶇疆閿欒 + _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"绉诲簱浠诲姟璧风偣閿欒锛岃捣鐐癸細銆恵task.CurrentAddress}銆�"); + return null; + } + } + return stackerCraneTaskCommand; + } + } +} 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" new file mode 100644 index 0000000..0b1a496 --- /dev/null +++ "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" @@ -0,0 +1,303 @@ +锘縰sing Microsoft.AspNetCore.Components.Routing; +using Quartz; +using System; +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WIDESEAWCS_Common.TaskEnum; +using WIDESEAWCS_Core.Enums; +using WIDESEAWCS_IBasicInfoRepository; +using WIDESEAWCS_ITaskInfoRepository; +using WIDESEAWCS_ITaskInfoService; +using WIDESEAWCS_Model.Models; +using WIDESEAWCS_QuartzJob; +using WIDESEAWCS_QuartzJob.DeviceBase; +using WIDESEAWCS_QuartzJob.Models; +using WIDESEAWCS_QuartzJob.Service; +using WIDESEAWCS_QuartzJob.StackerCrane.Enum; +using WIDESEAWCS_Tasks.HoisterJob; +using WIDESEAWCS_Tasks.StackerCraneJob; +using WIDESEAWCS_Tasks.闃荤剨浠�; + +namespace WIDESEAWCS_Tasks +{ + [DisallowConcurrentExecution] + public class StackerCraneJob_YM : JobBase, IJob + { + private readonly ITaskService _taskService; + private readonly ITaskExecuteDetailService _taskExecuteDetailService; + private readonly ITaskRepository _taskRepository; + private readonly IRouterService _routerService; + private readonly IStationMangerRepository _stationMangerRepository; + + public StackerCraneJob_YM(ITaskService taskService, ITaskExecuteDetailService taskExecuteDetailService, ITaskRepository taskRepository, IRouterService routerService, IStationMangerRepository stationMangerRepository) + { + _taskService = taskService; + _taskExecuteDetailService = taskExecuteDetailService; + _taskRepository = taskRepository; + _routerService = routerService; + _stationMangerRepository = stationMangerRepository; + } + + public Task Execute(IJobExecutionContext context) + { + try + { + CommonStackerCrane commonStackerCrane = (CommonStackerCrane)context.JobDetail.JobDataMap.Get("JobParams"); + if (commonStackerCrane != null) + { + if (!commonStackerCrane.IsEventSubscribed) + { + commonStackerCrane.StackerCraneTaskCompletedEventHandler += CommonStackerCrane_StackerCraneTaskCompletedEventHandler;//璁㈤槄浠诲姟瀹屾垚浜嬩欢 + } + + if (commonStackerCrane.StackerCraneAutoStatusValue == StackerCraneAutoStatus.Automatic && commonStackerCrane.StackerCraneStatusValue == StackerCraneStatus.Normal) + { + commonStackerCrane.CheckStackerCraneTaskCompleted();//闃叉浠诲姟瀹屾垚浜嬩欢鐩戞祴瓒呮椂锛屽啀鎵嬪姩瑙﹀彂涓�娆� + + if (commonStackerCrane.StackerCraneWorkStatusValue == StackerCraneWorkStatus.Standby) + { + Dt_Task? task = GetTask(commonStackerCrane); + if (task != null) + { + StackerCraneTaskCommand? stackerCraneTaskCommand = ConvertToStackerCraneTaskCommand(task); + if (stackerCraneTaskCommand != null) + { + bool sendFlag = commonStackerCrane.SendCommand(stackerCraneTaskCommand); + if (sendFlag) + { + commonStackerCrane.LastTaskType = task.TaskType; + _taskService.UpdateTaskStatusToNext(task.TaskNum); + } + } + } + } + } + } + } + catch (Exception ex) + { + WriteError(nameof(CommonStackerCraneJob), ex.Message, ex); + } + return Task.CompletedTask; + } + + /// <summary> + /// 浠诲姟瀹屾垚浜嬩欢璁㈤槄鐨勬柟娉� + /// </summary> + /// <param name="sender"></param> + /// <param name="e"></param> + private void CommonStackerCrane_StackerCraneTaskCompletedEventHandler(object? sender, WIDESEAWCS_QuartzJob.StackerCrane.StackerCraneTaskCompletedEventArgs e) + { + CommonStackerCrane? commonStackerCrane = sender as CommonStackerCrane; + if (commonStackerCrane != null) + { + if (commonStackerCrane.GetValue<StackerCraneDBName, short>(StackerCraneDBName.WorkType) != 5) + { + Console.Out.WriteLine("TaskCompleted" + e.TaskNum); + _taskService.StackCraneTaskCompleted(e.TaskNum); + commonStackerCrane.SetValue(StackerCraneDBName.WorkType, 5); + } + } + } + + /// <summary> + /// 鑾峰彇浠诲姟 + /// </summary> + /// <param name="commonStackerCrane">鍫嗗灈鏈哄璞�</param> + /// <returns></returns> + private Dt_Task? GetTask(CommonStackerCrane commonStackerCrane) + { + Dt_Task task; + if (commonStackerCrane.LastTaskType == null) + { + task = _taskService.QueryStackerCraneTask(commonStackerCrane.DeviceCode); + } + else + { + if (commonStackerCrane.LastTaskType.GetValueOrDefault().GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup) + { + task = _taskService.QueryStackerCraneInTask(commonStackerCrane.DeviceCode); + if (task == null) + { + task = _taskService.QueryStackerCraneOutTask(commonStackerCrane.DeviceCode); + } + } + else + { + task = _taskService.QueryStackerCraneOutTask(commonStackerCrane.DeviceCode); + if (task == null) + { + task = _taskService.QueryStackerCraneInTask(commonStackerCrane.DeviceCode); + } + } + } + + if (task != null && task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup) + { + if (OutTaskStationIsOccupied(task) != null || true) + { + return task; + } + else + { + List<string> otherOutStaionCodes = _routerService.QueryNextRoutes(commonStackerCrane.DeviceCode, task.NextAddress).Select(x => x.ChildPosi).ToList(); + List<Dt_Task> tasks = _taskService.QueryStackerCraneOutTasks(commonStackerCrane.DeviceCode, otherOutStaionCodes); + foreach (var item in tasks) + { + if (OutTaskStationIsOccupied(task) != null) + { + return task; + } + } + task = _taskService.QueryStackerCraneInTask(commonStackerCrane.DeviceCode); + } + } + + return task; + } + + /// <summary> + /// 鍑哄簱浠诲姟鍒ゆ柇鍑哄簱绔欏彴鏄惁琚崰鐢� + /// </summary> + /// <param name="task">浠诲姟瀹炰綋</param> + /// <returns>濡傛灉鏈鍗犵敤锛岃繑鍥炰紶鍏ョ殑浠诲姟淇℃伅锛屽惁鍒欙紝杩斿洖null</returns> + private Dt_Task? OutTaskStationIsOccupied([NotNull] Dt_Task task) + { + Dt_StationManger? stationManger = _stationMangerRepository.QueryFirst(x => x.StationCode == task.TargetAddress && x.StackerCraneCode == task.Roadway); + if (stationManger != null) + { + IDevice? device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == stationManger.StationDeviceCode); + if (device != null) + { + OtherDevice client = (OtherDevice)device; + if (client.GetValue<GroundStationDBName, bool>(GroundStationDBName.R_IsCanPut, stationManger.StationCode))//鍑哄簱绔欏彴鏈鍗犵敤 + { + task.TargetAddress = stationManger.StackerCraneStationCode; + _taskRepository.UpdateData(task); + return task; + } + } + else + { + _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"鏈壘鍒板嚭搴撶珯鍙般�恵stationManger.StationDeviceCode}銆戝搴旂殑閫氳瀵硅薄锛屾棤娉曞垽鏂嚭搴撶珯鍙版槸鍚﹁鍗犵敤"); + } + } + else + { + _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"鏈壘鍒扮珯鍙般�恵task.NextAddress}銆戜俊鎭紝鏃犳硶鏍¢獙绔欏彴"); + } + return null; + } + + /// <summary> + /// 浠诲姟瀹炰綋杞崲鎴愬懡浠odel + /// </summary> + /// <param name="task">浠诲姟瀹炰綋</param> + /// <returns></returns> + /// <exception cref="Exception"></exception> + public StackerCraneTaskCommand? ConvertToStackerCraneTaskCommand([NotNull] Dt_Task task) + { + StackerCraneTaskCommand stackerCraneTaskCommand = new StackerCraneTaskCommand(); + + stackerCraneTaskCommand.Barcode = task.PalletCode; + stackerCraneTaskCommand.TaskNum = task.TaskNum; + stackerCraneTaskCommand.WorkType = 1; + stackerCraneTaskCommand.TrayType = 1; + if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.InboundGroup)//鍒ゆ柇鏄惁鏄叆搴撲换鍔� + { + //List<Dt_Router> routers = _routerService.QueryNextRoutes(task.CurrentAddress, task.Roadway); + //if (routers.Count > 0) + //{ + string[] startCodes = task.CurrentAddress.Split("-"); + + stackerCraneTaskCommand.StartRow = Convert.ToInt16(startCodes[0]); + stackerCraneTaskCommand.StartColumn = Convert.ToInt16(startCodes[1]); + stackerCraneTaskCommand.StartLayer = Convert.ToInt16(startCodes[2]); + + string[] targetCodes = task.NextAddress.Split("-"); + if (targetCodes.Length == 3) + { + stackerCraneTaskCommand.EndRow = Convert.ToInt16(targetCodes[0]); + stackerCraneTaskCommand.EndColumn = Convert.ToInt16(targetCodes[1]); + stackerCraneTaskCommand.EndLayer = Convert.ToInt16(targetCodes[2]); + } + else + { + //鏁版嵁閰嶇疆閿欒 + _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"鍏ュ簱浠诲姟缁堢偣閿欒锛岃捣鐐癸細銆恵task.NextAddress}銆�"); + return null; + } + //} + //else + //{ + // _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"鏈壘鍒扮珯鍙般�恵task.NextAddress}銆戜俊鎭紝鏃犳硶鑾峰彇瀵瑰簲鐨勫爢鍨涙満鍙栬揣绔欏彴淇℃伅"); + // return null; + //} + } + else if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup) + { + //List<Dt_Router> routers = _routerService.QueryNextRoutes(task.Roadway, task.TargetAddress); + //if (routers.Count > 0) + { + string[] targetCodes = task.NextAddress.Split("-"); + + stackerCraneTaskCommand.EndRow = Convert.ToInt16(targetCodes[0]); + stackerCraneTaskCommand.EndColumn = Convert.ToInt16(targetCodes[1]); + stackerCraneTaskCommand.EndLayer = Convert.ToInt16(targetCodes[2]); + + string[] sourceCodes = task.CurrentAddress.Split("-"); + if (sourceCodes.Length == 3) + { + stackerCraneTaskCommand.StartRow = Convert.ToInt16(sourceCodes[0]); + stackerCraneTaskCommand.StartColumn = Convert.ToInt16(sourceCodes[1]); + stackerCraneTaskCommand.StartLayer = Convert.ToInt16(sourceCodes[2]); + } + else + { + //鏁版嵁閰嶇疆閿欒 + _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"鍑哄簱浠诲姟璧风偣閿欒锛岃捣鐐癸細銆恵task.CurrentAddress}銆�"); + return null; + } + } + //else + //{ + // _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"鏈壘鍒扮珯鍙般�恵task.NextAddress}銆戜俊鎭紝鏃犳硶鑾峰彇瀵瑰簲鐨勫爢鍨涙満鏀捐揣绔欏彴淇℃伅"); + // return null; + //} + } + else if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.RelocationGroup) + { + string[] targetCodes = task.NextAddress.Split("-"); + if (targetCodes.Length == 3) + { + stackerCraneTaskCommand.EndRow = Convert.ToInt16(targetCodes[0]); + stackerCraneTaskCommand.EndColumn = Convert.ToInt16(targetCodes[1]); + stackerCraneTaskCommand.EndLayer = Convert.ToInt16(targetCodes[2]); + } + else + { + //鏁版嵁閰嶇疆閿欒 + _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"绉诲簱浠诲姟缁堢偣閿欒锛岃捣鐐癸細銆恵task.NextAddress}銆�"); + return null; + } + string[] sourceCodes = task.CurrentAddress.Split("-"); + if (sourceCodes.Length == 3) + { + stackerCraneTaskCommand.StartRow = Convert.ToInt16(sourceCodes[0]); + stackerCraneTaskCommand.StartColumn = Convert.ToInt16(sourceCodes[1]); + stackerCraneTaskCommand.StartLayer = Convert.ToInt16(sourceCodes[2]); + } + else + { + //鏁版嵁閰嶇疆閿欒 + _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"绉诲簱浠诲姟璧风偣閿欒锛岃捣鐐癸細銆恵task.CurrentAddress}銆�"); + return null; + } + } + return stackerCraneTaskCommand; + } + } +} 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 0b4fd5a..9951ece 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" @@ -208,9 +208,6 @@ stackerCraneTaskCommand.TrayType = 1; if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.InboundGroup)//鍒ゆ柇鏄惁鏄叆搴撲换鍔� { - //List<Dt_Router> routers = _routerService.QueryNextRoutes(task.CurrentAddress, task.Roadway); - //if (routers.Count > 0) - //{ string[] startCodes = task.CurrentAddress.Split("-"); stackerCraneTaskCommand.StartRow = Convert.ToInt16(startCodes[0]); @@ -230,43 +227,28 @@ _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"鍏ュ簱浠诲姟缁堢偣閿欒锛岃捣鐐癸細銆恵task.NextAddress}銆�"); return null; } - //} - //else - //{ - // _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"鏈壘鍒扮珯鍙般�恵task.NextAddress}銆戜俊鎭紝鏃犳硶鑾峰彇瀵瑰簲鐨勫爢鍨涙満鍙栬揣绔欏彴淇℃伅"); - // return null; - //} } else if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup) { - //List<Dt_Router> routers = _routerService.QueryNextRoutes(task.Roadway, task.TargetAddress); - //if (routers.Count > 0) + string[] targetCodes = task.NextAddress.Split("-"); + + stackerCraneTaskCommand.EndRow = Convert.ToInt16(targetCodes[0]); + stackerCraneTaskCommand.EndColumn = Convert.ToInt16(targetCodes[1]); + stackerCraneTaskCommand.EndLayer = Convert.ToInt16(targetCodes[2]); + + string[] sourceCodes = task.CurrentAddress.Split("-"); + if (sourceCodes.Length == 3) { - string[] targetCodes = task.NextAddress.Split("-"); - - stackerCraneTaskCommand.EndRow = Convert.ToInt16(targetCodes[0]); - stackerCraneTaskCommand.EndColumn = Convert.ToInt16(targetCodes[1]); - stackerCraneTaskCommand.EndLayer = Convert.ToInt16(targetCodes[2]); - - string[] sourceCodes = task.CurrentAddress.Split("-"); - if (sourceCodes.Length == 3) - { - stackerCraneTaskCommand.StartRow = Convert.ToInt16(sourceCodes[0]); - stackerCraneTaskCommand.StartColumn = Convert.ToInt16(sourceCodes[1]); - stackerCraneTaskCommand.StartLayer = Convert.ToInt16(sourceCodes[2]); - } - else - { - //鏁版嵁閰嶇疆閿欒 - _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"鍑哄簱浠诲姟璧风偣閿欒锛岃捣鐐癸細銆恵task.CurrentAddress}銆�"); - return null; - } + stackerCraneTaskCommand.StartRow = Convert.ToInt16(sourceCodes[0]); + stackerCraneTaskCommand.StartColumn = Convert.ToInt16(sourceCodes[1]); + stackerCraneTaskCommand.StartLayer = Convert.ToInt16(sourceCodes[2]); } - //else - //{ - // _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"鏈壘鍒扮珯鍙般�恵task.NextAddress}銆戜俊鎭紝鏃犳硶鑾峰彇瀵瑰簲鐨勫爢鍨涙満鏀捐揣绔欏彴淇℃伅"); - // return null; - //} + else + { + //鏁版嵁閰嶇疆閿欒 + _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"鍑哄簱浠诲姟璧风偣閿欒锛岃捣鐐癸細銆恵task.CurrentAddress}銆�"); + return null; + } } else if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.RelocationGroup) { diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/012f25e8-74cc-4271-80f7-3993d746a5bd.vsidx" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/012f25e8-74cc-4271-80f7-3993d746a5bd.vsidx" new file mode 100644 index 0000000..8b27e08 --- /dev/null +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/012f25e8-74cc-4271-80f7-3993d746a5bd.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/0f2de342-959b-4075-9776-5b88fd484124.vsidx" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/0f2de342-959b-4075-9776-5b88fd484124.vsidx" deleted file mode 100644 index 56db219..0000000 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/0f2de342-959b-4075-9776-5b88fd484124.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/2877cb87-c685-49b7-a63b-30bdbb709bbd.vsidx" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/2877cb87-c685-49b7-a63b-30bdbb709bbd.vsidx" new file mode 100644 index 0000000..ea81175 --- /dev/null +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/2877cb87-c685-49b7-a63b-30bdbb709bbd.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/43c5884a-259b-409f-9f97-bec930af24db.vsidx" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/43c5884a-259b-409f-9f97-bec930af24db.vsidx" new file mode 100644 index 0000000..22edc39 --- /dev/null +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/43c5884a-259b-409f-9f97-bec930af24db.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/4b9d13b5-464a-47d4-8dae-9937d5273cc6.vsidx" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/4b9d13b5-464a-47d4-8dae-9937d5273cc6.vsidx" deleted file mode 100644 index b4217cb..0000000 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/4b9d13b5-464a-47d4-8dae-9937d5273cc6.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/5023b4f8-50f2-4301-b3ca-8d83fa478bdc.vsidx" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/5023b4f8-50f2-4301-b3ca-8d83fa478bdc.vsidx" deleted file mode 100644 index 6878405..0000000 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/5023b4f8-50f2-4301-b3ca-8d83fa478bdc.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/5697cb23-9f2e-4eb6-ba02-077734b9a84e.vsidx" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/5697cb23-9f2e-4eb6-ba02-077734b9a84e.vsidx" new file mode 100644 index 0000000..a62cf2d --- /dev/null +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/5697cb23-9f2e-4eb6-ba02-077734b9a84e.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/60b56cfe-9fa4-4dcb-a205-bd29744252b2.vsidx" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/60b56cfe-9fa4-4dcb-a205-bd29744252b2.vsidx" new file mode 100644 index 0000000..643e4f7 --- /dev/null +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/60b56cfe-9fa4-4dcb-a205-bd29744252b2.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/9b53cffc-065b-40ee-a779-a99d0cdd29b8.vsidx" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/9b53cffc-065b-40ee-a779-a99d0cdd29b8.vsidx" deleted file mode 100644 index 08bc741..0000000 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/9b53cffc-065b-40ee-a779-a99d0cdd29b8.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/bb9c5c98-5de4-43c8-8a36-34ad166b9c7a.vsidx" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/bb9c5c98-5de4-43c8-8a36-34ad166b9c7a.vsidx" deleted file mode 100644 index f1f7a5f..0000000 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/bb9c5c98-5de4-43c8-8a36-34ad166b9c7a.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/d6701bb1-0090-4502-a2ca-a4e0726e92d8.vsidx" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/d6701bb1-0090-4502-a2ca-a4e0726e92d8.vsidx" deleted file mode 100644 index 6256f40..0000000 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/d6701bb1-0090-4502-a2ca-a4e0726e92d8.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/ffdc57a2-11a0-4784-96ef-3f73a9839656.vsidx" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/ffdc57a2-11a0-4784-96ef-3f73a9839656.vsidx" deleted file mode 100644 index 7bbc7ae..0000000 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/ffdc57a2-11a0-4784-96ef-3f73a9839656.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/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/Base/LocationInfoService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Base/LocationInfoService.cs" index b48d9f6..b7724a4 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Base/LocationInfoService.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Base/LocationInfoService.cs" @@ -23,12 +23,14 @@ public partial class LocationInfoService : ServiceBase<Dt_LocationInfo, ILocationInfoRepository>, ILocationInfoService { private readonly IUnitOfWorkManage _unitOfWorkManage; + private readonly IBasicRepository _basicRepository; public ILocationInfoRepository Repository => BaseDal; - public LocationInfoService(ILocationInfoRepository BaseDal, IUnitOfWorkManage unitOfWorkManage) : base(BaseDal) + public LocationInfoService(ILocationInfoRepository BaseDal, IUnitOfWorkManage unitOfWorkManage, IBasicRepository basicRepository) : base(BaseDal) { _unitOfWorkManage = unitOfWorkManage; + _basicRepository = basicRepository; } /// <summary> @@ -129,7 +131,7 @@ Layer = k + 1, LocationStatus = LocationStatusEnum.Free.ObjToInt(), LocationType = LocationTypeEnum.Undefined.ObjToInt(), - RoadwayNo = $"R{initializationLocationDTO.Roadway.ToString()}", + RoadwayNo = $"{initializationLocationDTO.Roadway.ToString()}", Row = i + 1, Depth = depth, }; 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" new file mode 100644 index 0000000..9a147d6 --- /dev/null +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/AssignLocation/LocationInfoService_BC.cs" @@ -0,0 +1,174 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WIDESEA_Common.CommonEnum; +using WIDESEA_Common.LocationEnum; +using WIDESEA_Core.BaseServices; +using WIDESEA_Core.Helper; +using WIDESEA_IBasicRepository; +using WIDESEA_IBasicService; +using WIDESEA_Model.Models; + +namespace WIDESEA_BasicService +{ + public partial class LocationInfoService + { + + double weightValue_BC = 0.25; + + private readonly static object _locker_BC = new object(); + static List<LocationCache> locationCaches_BC = new List<LocationCache>(); + + /// <summary> + /// 鏉挎潗浠撹揣浣嶅垎閰� + /// </summary> + /// <param name="roadwayNo">宸烽亾鍙�</param> + /// <param name="palletType"> + /// 鎵樼洏绫诲瀷 + /// </param> + /// <returns></returns> + public Dt_LocationInfo? AssignLocation_BC(string roadwayNo, PalletTypeEnum palletType, string beRelocationCode = "") + { + lock (_locker_BC) + { + List<LocationCache> removeItems = locationCaches_BC.Where(x => (DateTime.Now - x.DateTime).TotalMinutes > 5).ToList(); + int count = removeItems.Count; + for (int i = 0; i < count; i++) + { + locationCaches_BC.Remove(removeItems[i]); + } + + List<string> lockLocationCodes = locationCaches_BC.Select(x => x.LocationCode).ToList(); + + List<Dt_LocationInfo> locationInfos = Repository.QueryData(x => x.RoadwayNo == roadwayNo); + if (locationInfos == null || locationInfos.Count == 0) + { + throw new Exception($"鏈壘鍒拌宸烽亾鐨勮揣浣嶄俊鎭�,宸烽亾鍙�:{roadwayNo}"); + } + + if (!string.IsNullOrEmpty(beRelocationCode)) + { + Dt_LocationInfo? beRelocation = locationInfos.FirstOrDefault(x => x.LocationCode == beRelocationCode); + if (beRelocation == null) + { + throw new Exception($"鏈壘鍒拌揣浣嶄俊鎭�"); + } + int maxDepth = locationInfos.Max(x => x.Depth); + int mathCurrentRow = beRelocation.Row - Convert.ToInt32(Math.Ceiling(beRelocation.Row / maxDepth / 2.0)) * maxDepth * 2; + if (mathCurrentRow <= maxDepth) + { + locationInfos = locationInfos.Where(x => x.Row - Convert.ToInt32(Math.Ceiling(x.Row / maxDepth / 2.0)) * maxDepth * 2 <= maxDepth).ToList(); + } + else + { + locationInfos = locationInfos.Where(x => x.Row - Convert.ToInt32(Math.Ceiling(x.Row / maxDepth / 2.0)) * maxDepth * 2 > maxDepth).ToList(); + } + } + + //宸插畾涔夎揣浣嶇被鍨嬬殑璐т綅 + List<Dt_LocationInfo> definedTypeLocations = locationInfos.Where(x => x.LocationType == palletType.ObjToInt()).ToList(); + + //鏈畾涔夌被鍨嬬殑绌鸿揣浣� + List<Dt_LocationInfo> undefinedTypeEmptyLocations = locationInfos.Where(x => (x.EnableStatus == EnableStatusEnum.Normal.ObjToInt() || x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt()) && x.LocationStatus == LocationStatusEnum.Free.ObjToInt() && x.LocationType == LocationTypeEnum.Undefined.ObjToInt() && !lockLocationCodes.Contains(x.LocationCode)).OrderByDescending(x => x.Depth).ThenBy(x => x.Layer).ThenBy(x => x.Row).ThenBy(x => x.Column).ToList(); + + 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.Row).ThenBy(x => x.Column).ToList(); + + if ((locationInfos.Count * weightValue_BC >= definedTypeLocations.Count && undefinedTypeEmptyLocations.Any()) || !definedTypeEmptyLocations.Any())//濡傛灉宸插畾涔夌被鍨嬭揣浣嶆湭瓒呰繃姣斾緥锛屼笖鏈夋湭瀹氫箟绫诲瀷鐨勮揣浣� + { + if (palletType == PalletTypeEnum.LargePallet || palletType == PalletTypeEnum.LargestPallet) + { + undefinedTypeEmptyLocations = undefinedTypeEmptyLocations.Where(x => x.Depth % 2 == 1).ToList(); + } + for (int i = 0; i < undefinedTypeEmptyLocations.Count; i++) + { + Dt_LocationInfo undefinedTypeEmptyLocation = undefinedTypeEmptyLocations[i]; + Dt_LocationInfo? locationInfo = GetUsableLocation_BC(locationInfos, undefinedTypeEmptyLocation, palletType); + if (locationInfo != null) + { + UpdateLocationStatus(locationInfo, palletType, LocationStatusEnum.Lock, 3); + 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); + if (locationInfo != null) + { + UpdateLocationStatus(locationInfo, palletType, LocationStatusEnum.Lock, 3); + locationCaches_BC.Add(new LocationCache { LocationCode = locationInfo.LocationCode, DateTime = DateTime.Now }); + return locationInfo; + } + } + } + return null; + } + } + + /// <summary> + /// 鑾峰彇鍙敤璐т綅(娴嬭瘯鏋朵粨) + /// </summary> + /// <param name="locationInfos"></param> + /// <param name="emptyLocation"></param> + /// <param name="palletType"></param> + /// <returns></returns> + private Dt_LocationInfo? GetUsableLocation_BC(List<Dt_LocationInfo> locationInfos, Dt_LocationInfo emptyLocation, PalletTypeEnum palletType) + { + switch (palletType) + { + case PalletTypeEnum.LargestPallet: + case PalletTypeEnum.LargePallet: + if (emptyLocation.Depth % 2 == 0) + { + return null; + } + break; + } + Dt_LocationInfo? locationInfo = DepthLocationIsEmpty_BC(locationInfos, emptyLocation, palletType); + if (locationInfo != null) + { + return locationInfo; + } + return null; + } + + /// <summary> + /// 鍒ゆ柇涓嶅悓娣卞害鐨勫悓缁勮揣浣嶇姸鎬佹槸鍚︿负绌洪棽绌轰綅(娴嬭瘯鏋朵粨) + /// </summary> + /// <param name="locationInfos"></param> + /// <param name="emptyLocation"></param> + /// <returns></returns> + private Dt_LocationInfo? DepthLocationIsEmpty_BC(List<Dt_LocationInfo> locationInfos, Dt_LocationInfo emptyLocation, PalletTypeEnum palletType) + { + List<Dt_LocationInfo> locations = GetGroupLocations(locationInfos, emptyLocation); + + bool moreDepthFlag = false; + bool littleDepthFlag = false; + + switch (palletType) + { + case PalletTypeEnum.LargestPallet: + case PalletTypeEnum.LargePallet: + 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锛屽垯琛ㄧず娣辫揣浣嶆湁鏈浣跨敤鐨勬儏鍐� + + 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; + } + + if (moreDepthFlag && littleDepthFlag) + { + return emptyLocation; + } + + return null; + } + } +} 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" new file mode 100644 index 0000000..31aed3f --- /dev/null +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/AssignLocation/LocationInfoService_CSJ.cs" @@ -0,0 +1,199 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WIDESEA_Common.CommonEnum; +using WIDESEA_Common.LocationEnum; +using WIDESEA_Core.BaseServices; +using WIDESEA_Core.Helper; +using WIDESEA_IBasicRepository; +using WIDESEA_IBasicService; +using WIDESEA_Model.Models; + +namespace WIDESEA_BasicService +{ + public partial class LocationInfoService + { + + double weightValue_CSJ = 0.25; + + private readonly static object _locker_CSJ = new object(); + static List<LocationCache> locationCaches_CSJ = new List<LocationCache>(); + + /// <summary> + /// 娴嬭瘯鏋朵粨璐т綅鍒嗛厤 <br/> + /// 鎵樼洏绫诲瀷锛� <br/> + /// 1锛氭渶闀� <br/> + /// 2锛氶暱 <br/> + /// 3锛氫腑绛� <br/> + /// 4锛氱煭 <br/> + /// 3鍜�4閮芥槸3娣憋紝涓斿彲浠ユ贩鏀俱�� <br/> + /// 1鍜�2閮芥槸2娣憋紝涓斿彲浠ユ贩鏀俱�� <br/> + /// 绉诲簱鏃跺彧鑳芥槸鍚屼晶璐т綅銆� + /// </summary> + /// <param name="roadwayNo">宸烽亾鍙�</param> + /// <param name="palletType"> + /// 鎵樼洏绫诲瀷 <br/> + /// 1锛氭渶闀� <br/> + /// 2锛氶暱 <br/> + /// 3锛氫腑绛� <br/> + /// 4锛氱煭 + /// </param> + /// <returns></returns> + public Dt_LocationInfo? AssignLocation_CSJ(string roadwayNo, PalletTypeEnum palletType, string beRelocationCode = "") + { + lock (_locker_CSJ) + { + List<LocationCache> removeItems = locationCaches_CSJ.Where(x => (DateTime.Now - x.DateTime).TotalMinutes > 5).ToList(); + int count = removeItems.Count; + for (int i = 0; i < count; i++) + { + locationCaches_CSJ.Remove(removeItems[i]); + } + + List<string> lockLocationCodes = locationCaches_CSJ.Select(x => x.LocationCode).ToList(); + + List<Dt_LocationInfo> locationInfos = Repository.QueryData(x => x.RoadwayNo == roadwayNo); + if (locationInfos == null || locationInfos.Count == 0) + { + throw new Exception($"鏈壘鍒拌宸烽亾鐨勮揣浣嶄俊鎭�,宸烽亾鍙�:{roadwayNo}"); + } + + if (!string.IsNullOrEmpty(beRelocationCode)) + { + Dt_LocationInfo? beRelocation = locationInfos.FirstOrDefault(x => x.LocationCode == beRelocationCode); + if (beRelocation == null) + { + throw new Exception($"鏈壘鍒拌揣浣嶄俊鎭�"); + } + int maxDepth = locationInfos.Max(x => x.Depth); + int mathCurrentRow = beRelocation.Row - Convert.ToInt32(Math.Ceiling(beRelocation.Row / maxDepth / 2.0)) * maxDepth * 2; + if (mathCurrentRow <= maxDepth) + { + locationInfos = locationInfos.Where(x => x.Row - Convert.ToInt32(Math.Ceiling(x.Row / maxDepth / 2.0)) * maxDepth * 2 <= maxDepth).ToList(); + } + else + { + locationInfos = locationInfos.Where(x => x.Row - Convert.ToInt32(Math.Ceiling(x.Row / maxDepth / 2.0)) * maxDepth * 2 > maxDepth).ToList(); + } + } + + //宸插畾涔夎揣浣嶇被鍨嬬殑璐т綅 + List<Dt_LocationInfo> definedTypeLocations = locationInfos.Where(x => x.LocationType == palletType.ObjToInt()).ToList(); + + //鏈畾涔夌被鍨嬬殑绌鸿揣浣� + List<Dt_LocationInfo> undefinedTypeEmptyLocations = locationInfos.Where(x => (x.EnableStatus == EnableStatusEnum.Normal.ObjToInt() || x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt()) && x.LocationStatus == LocationStatusEnum.Free.ObjToInt() && x.LocationType == LocationTypeEnum.Undefined.ObjToInt() && !lockLocationCodes.Contains(x.LocationCode)).OrderByDescending(x => x.Depth).ThenBy(x => x.Layer).ThenBy(x => x.Row).ThenBy(x => x.Column).ToList(); + + 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.Row).ThenBy(x => x.Column).ToList(); + + if ((locationInfos.Count * weightValue_CSJ >= definedTypeLocations.Count && undefinedTypeEmptyLocations.Any()) || !definedTypeEmptyLocations.Any())//濡傛灉宸插畾涔夌被鍨嬭揣浣嶆湭瓒呰繃姣斾緥锛屼笖鏈夋湭瀹氫箟绫诲瀷鐨勮揣浣� + { + if (palletType == PalletTypeEnum.LargePallet || palletType == PalletTypeEnum.LargestPallet) + { + undefinedTypeEmptyLocations = undefinedTypeEmptyLocations.Where(x => x.Depth % 2 == 1).ToList(); + } + for (int i = 0; i < undefinedTypeEmptyLocations.Count; i++) + { + Dt_LocationInfo undefinedTypeEmptyLocation = undefinedTypeEmptyLocations[i]; + Dt_LocationInfo? locationInfo = GetUsableLocation_CSJ(locationInfos, undefinedTypeEmptyLocation, palletType); + if (locationInfo != null) + { + UpdateLocationStatus(locationInfo, palletType, LocationStatusEnum.Lock, 3); + locationCaches_CSJ.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_CSJ(locationInfos, definedTypeEmptyLocation, palletType); + if (locationInfo != null) + { + UpdateLocationStatus(locationInfo, palletType, LocationStatusEnum.Lock, 3); + locationCaches_CSJ.Add(new LocationCache { LocationCode = locationInfo.LocationCode, DateTime = DateTime.Now }); + return locationInfo; + } + } + } + return null; + } + } + + /// <summary> + /// 鑾峰彇鍙敤璐т綅(娴嬭瘯鏋朵粨) + /// </summary> + /// <param name="locationInfos"></param> + /// <param name="emptyLocation"></param> + /// <param name="palletType"></param> + /// <returns></returns> + private Dt_LocationInfo? GetUsableLocation_CSJ(List<Dt_LocationInfo> locationInfos, Dt_LocationInfo emptyLocation, PalletTypeEnum palletType) + { + switch (palletType) + { + case PalletTypeEnum.LargestPallet: + case PalletTypeEnum.LargePallet: + if (emptyLocation.Depth % 2 == 0) + { + return null; + } + break; + } + Dt_LocationInfo? locationInfo = DepthLocationIsEmpty_CSJ(locationInfos, emptyLocation, palletType); + if (locationInfo != null) + { + return locationInfo; + } + return null; + } + + /// <summary> + /// 鍒ゆ柇涓嶅悓娣卞害鐨勫悓缁勮揣浣嶇姸鎬佹槸鍚︿负绌洪棽绌轰綅(娴嬭瘯鏋朵粨) + /// </summary> + /// <param name="locationInfos"></param> + /// <param name="emptyLocation"></param> + /// <returns></returns> + private Dt_LocationInfo? DepthLocationIsEmpty_CSJ(List<Dt_LocationInfo> locationInfos, Dt_LocationInfo emptyLocation, PalletTypeEnum palletType) + { + List<Dt_LocationInfo> locations = GetGroupLocations(locationInfos, emptyLocation); + + bool moreDepthFlag = false; + bool littleDepthFlag = false; + + switch (palletType) + { + case PalletTypeEnum.LargestPallet: + case PalletTypeEnum.LargePallet: + { + 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锛屽垯琛ㄧず娣辫揣浣嶆湁鏈浣跨敤鐨勬儏鍐� + + 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 PalletTypeEnum.MediumPallet: + case PalletTypeEnum.SmallPallet: + { + List<Dt_LocationInfo> moreDepth = locations.Where(x => x.Depth > emptyLocation.Depth).ToList(); + moreDepthFlag = moreDepth.FirstOrDefault(x => x.LocationStatus != LocationStatusEnum.InStock.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; + } + + if (moreDepthFlag && littleDepthFlag) + { + return emptyLocation; + } + + return null; + } + } +} 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" new file mode 100644 index 0000000..6e1254e --- /dev/null +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/AssignLocation/LocationInfoService_GM.cs" @@ -0,0 +1,174 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WIDESEA_Common.CommonEnum; +using WIDESEA_Common.LocationEnum; +using WIDESEA_Core.BaseServices; +using WIDESEA_Core.Helper; +using WIDESEA_IBasicRepository; +using WIDESEA_IBasicService; +using WIDESEA_Model.Models; + +namespace WIDESEA_BasicService +{ + public partial class LocationInfoService + { + + double weightValue_GM = 0.25; + + private readonly static object _locker_GM = new object(); + static List<LocationCache> locationCaches_GM = new List<LocationCache>(); + + /// <summary> + /// 骞茶啘浠撹揣浣嶅垎閰� + /// </summary> + /// <param name="roadwayNo">宸烽亾鍙�</param> + /// <param name="palletType"> + /// 鎵樼洏绫诲瀷 + /// </param> + /// <returns></returns> + public Dt_LocationInfo? AssignLocation_GM(string roadwayNo, PalletTypeEnum palletType, string beRelocationCode = "") + { + lock (_locker_GM) + { + List<LocationCache> removeItems = locationCaches_GM.Where(x => (DateTime.Now - x.DateTime).TotalMinutes > 5).ToList(); + int count = removeItems.Count; + for (int i = 0; i < count; i++) + { + locationCaches_GM.Remove(removeItems[i]); + } + + List<string> lockLocationCodes = locationCaches_GM.Select(x => x.LocationCode).ToList(); + + List<Dt_LocationInfo> locationInfos = Repository.QueryData(x => x.RoadwayNo == roadwayNo); + if (locationInfos == null || locationInfos.Count == 0) + { + throw new Exception($"鏈壘鍒拌宸烽亾鐨勮揣浣嶄俊鎭�,宸烽亾鍙�:{roadwayNo}"); + } + + if (!string.IsNullOrEmpty(beRelocationCode)) + { + Dt_LocationInfo? beRelocation = locationInfos.FirstOrDefault(x => x.LocationCode == beRelocationCode); + if (beRelocation == null) + { + throw new Exception($"鏈壘鍒拌揣浣嶄俊鎭�"); + } + int maxDepth = locationInfos.Max(x => x.Depth); + int mathCurrentRow = beRelocation.Row - Convert.ToInt32(Math.Ceiling(beRelocation.Row / maxDepth / 2.0)) * maxDepth * 2; + if (mathCurrentRow <= maxDepth) + { + locationInfos = locationInfos.Where(x => x.Row - Convert.ToInt32(Math.Ceiling(x.Row / maxDepth / 2.0)) * maxDepth * 2 <= maxDepth).ToList(); + } + else + { + locationInfos = locationInfos.Where(x => x.Row - Convert.ToInt32(Math.Ceiling(x.Row / maxDepth / 2.0)) * maxDepth * 2 > maxDepth).ToList(); + } + } + + //宸插畾涔夎揣浣嶇被鍨嬬殑璐т綅 + List<Dt_LocationInfo> definedTypeLocations = locationInfos.Where(x => x.LocationType == palletType.ObjToInt()).ToList(); + + //鏈畾涔夌被鍨嬬殑绌鸿揣浣� + List<Dt_LocationInfo> undefinedTypeEmptyLocations = locationInfos.Where(x => (x.EnableStatus == EnableStatusEnum.Normal.ObjToInt() || x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt()) && x.LocationStatus == LocationStatusEnum.Free.ObjToInt() && x.LocationType == LocationTypeEnum.Undefined.ObjToInt() && !lockLocationCodes.Contains(x.LocationCode)).OrderByDescending(x => x.Depth).ThenBy(x => x.Layer).ThenBy(x => x.Row).ThenBy(x => x.Column).ToList(); + + 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.Row).ThenBy(x => x.Column).ToList(); + + if ((locationInfos.Count * weightValue_GM >= definedTypeLocations.Count && undefinedTypeEmptyLocations.Any()) || !definedTypeEmptyLocations.Any())//濡傛灉宸插畾涔夌被鍨嬭揣浣嶆湭瓒呰繃姣斾緥锛屼笖鏈夋湭瀹氫箟绫诲瀷鐨勮揣浣� + { + if (palletType == PalletTypeEnum.LargePallet || palletType == PalletTypeEnum.LargestPallet) + { + undefinedTypeEmptyLocations = undefinedTypeEmptyLocations.Where(x => x.Depth % 2 == 1).ToList(); + } + for (int i = 0; i < undefinedTypeEmptyLocations.Count; i++) + { + Dt_LocationInfo undefinedTypeEmptyLocation = undefinedTypeEmptyLocations[i]; + Dt_LocationInfo? locationInfo = GetUsableLocation_GM(locationInfos, undefinedTypeEmptyLocation, palletType); + if (locationInfo != null) + { + UpdateLocationStatus(locationInfo, palletType, LocationStatusEnum.Lock, 3); + locationCaches_GM.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_GM(locationInfos, definedTypeEmptyLocation, palletType); + if (locationInfo != null) + { + UpdateLocationStatus(locationInfo, palletType, LocationStatusEnum.Lock, 3); + locationCaches_GM.Add(new LocationCache { LocationCode = locationInfo.LocationCode, DateTime = DateTime.Now }); + return locationInfo; + } + } + } + return null; + } + } + + /// <summary> + /// 鑾峰彇鍙敤璐т綅(娴嬭瘯鏋朵粨) + /// </summary> + /// <param name="locationInfos"></param> + /// <param name="emptyLocation"></param> + /// <param name="palletType"></param> + /// <returns></returns> + private Dt_LocationInfo? GetUsableLocation_GM(List<Dt_LocationInfo> locationInfos, Dt_LocationInfo emptyLocation, PalletTypeEnum palletType) + { + switch (palletType) + { + case PalletTypeEnum.LargestPallet: + case PalletTypeEnum.LargePallet: + if (emptyLocation.Depth % 2 == 0) + { + return null; + } + break; + } + Dt_LocationInfo? locationInfo = DepthLocationIsEmpty_GM(locationInfos, emptyLocation, palletType); + if (locationInfo != null) + { + return locationInfo; + } + return null; + } + + /// <summary> + /// 鍒ゆ柇涓嶅悓娣卞害鐨勫悓缁勮揣浣嶇姸鎬佹槸鍚︿负绌洪棽绌轰綅(娴嬭瘯鏋朵粨) + /// </summary> + /// <param name="locationInfos"></param> + /// <param name="emptyLocation"></param> + /// <returns></returns> + private Dt_LocationInfo? DepthLocationIsEmpty_GM(List<Dt_LocationInfo> locationInfos, Dt_LocationInfo emptyLocation, PalletTypeEnum palletType) + { + List<Dt_LocationInfo> locations = GetGroupLocations(locationInfos, emptyLocation); + + bool moreDepthFlag = false; + bool littleDepthFlag = false; + + switch (palletType) + { + case PalletTypeEnum.LargestPallet: + case PalletTypeEnum.LargePallet: + 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锛屽垯琛ㄧず娣辫揣浣嶆湁鏈浣跨敤鐨勬儏鍐� + + 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; + } + + if (moreDepthFlag && littleDepthFlag) + { + return emptyLocation; + } + + return null; + } + } +} 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" new file mode 100644 index 0000000..99d093f --- /dev/null +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/AssignLocation/LocationInfoService_PP.cs" @@ -0,0 +1,174 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WIDESEA_Common.CommonEnum; +using WIDESEA_Common.LocationEnum; +using WIDESEA_Core.BaseServices; +using WIDESEA_Core.Helper; +using WIDESEA_IBasicRepository; +using WIDESEA_IBasicService; +using WIDESEA_Model.Models; + +namespace WIDESEA_BasicService +{ + public partial class LocationInfoService + { + + double weightValue_PP = 0.25; + + private readonly static object _locker_PP = new object(); + static List<LocationCache> locationCaches_PP = new List<LocationCache>(); + + /// <summary> + /// PP浠撹揣浣嶅垎閰� + /// </summary> + /// <param name="roadwayNo">宸烽亾鍙�</param> + /// <param name="palletType"> + /// 鎵樼洏绫诲瀷 + /// </param> + /// <returns></returns> + public Dt_LocationInfo? AssignLocation_PP(string roadwayNo, PalletTypeEnum palletType, string beRelocationCode = "") + { + lock (_locker_PP) + { + List<LocationCache> removeItems = locationCaches_PP.Where(x => (DateTime.Now - x.DateTime).TotalMinutes > 5).ToList(); + int count = removeItems.Count; + for (int i = 0; i < count; i++) + { + locationCaches_PP.Remove(removeItems[i]); + } + + List<string> lockLocationCodes = locationCaches_PP.Select(x => x.LocationCode).ToList(); + + List<Dt_LocationInfo> locationInfos = Repository.QueryData(x => x.RoadwayNo == roadwayNo); + if (locationInfos == null || locationInfos.Count == 0) + { + throw new Exception($"鏈壘鍒拌宸烽亾鐨勮揣浣嶄俊鎭�,宸烽亾鍙�:{roadwayNo}"); + } + + if (!string.IsNullOrEmpty(beRelocationCode)) + { + Dt_LocationInfo? beRelocation = locationInfos.FirstOrDefault(x => x.LocationCode == beRelocationCode); + if (beRelocation == null) + { + throw new Exception($"鏈壘鍒拌揣浣嶄俊鎭�"); + } + int maxDepth = locationInfos.Max(x => x.Depth); + int mathCurrentRow = beRelocation.Row - Convert.ToInt32(Math.Ceiling(beRelocation.Row / maxDepth / 2.0)) * maxDepth * 2; + if (mathCurrentRow <= maxDepth) + { + locationInfos = locationInfos.Where(x => x.Row - Convert.ToInt32(Math.Ceiling(x.Row / maxDepth / 2.0)) * maxDepth * 2 <= maxDepth).ToList(); + } + else + { + locationInfos = locationInfos.Where(x => x.Row - Convert.ToInt32(Math.Ceiling(x.Row / maxDepth / 2.0)) * maxDepth * 2 > maxDepth).ToList(); + } + } + + //宸插畾涔夎揣浣嶇被鍨嬬殑璐т綅 + List<Dt_LocationInfo> definedTypeLocations = locationInfos.Where(x => x.LocationType == palletType.ObjToInt()).ToList(); + + //鏈畾涔夌被鍨嬬殑绌鸿揣浣� + List<Dt_LocationInfo> undefinedTypeEmptyLocations = locationInfos.Where(x => (x.EnableStatus == EnableStatusEnum.Normal.ObjToInt() || x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt()) && x.LocationStatus == LocationStatusEnum.Free.ObjToInt() && x.LocationType == LocationTypeEnum.Undefined.ObjToInt() && !lockLocationCodes.Contains(x.LocationCode)).OrderByDescending(x => x.Depth).ThenBy(x => x.Layer).ThenBy(x => x.Row).ThenBy(x => x.Column).ToList(); + + 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.Row).ThenBy(x => x.Column).ToList(); + + if ((locationInfos.Count * weightValue_PP >= definedTypeLocations.Count && undefinedTypeEmptyLocations.Any()) || !definedTypeEmptyLocations.Any())//濡傛灉宸插畾涔夌被鍨嬭揣浣嶆湭瓒呰繃姣斾緥锛屼笖鏈夋湭瀹氫箟绫诲瀷鐨勮揣浣� + { + if (palletType == PalletTypeEnum.LargePallet || palletType == PalletTypeEnum.LargestPallet) + { + undefinedTypeEmptyLocations = undefinedTypeEmptyLocations.Where(x => x.Depth % 2 == 1).ToList(); + } + for (int i = 0; i < undefinedTypeEmptyLocations.Count; i++) + { + Dt_LocationInfo undefinedTypeEmptyLocation = undefinedTypeEmptyLocations[i]; + Dt_LocationInfo? locationInfo = GetUsableLocation_PP(locationInfos, undefinedTypeEmptyLocation, palletType); + if (locationInfo != null) + { + UpdateLocationStatus(locationInfo, palletType, LocationStatusEnum.Lock, 3); + locationCaches_PP.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_PP(locationInfos, definedTypeEmptyLocation, palletType); + if (locationInfo != null) + { + UpdateLocationStatus(locationInfo, palletType, LocationStatusEnum.Lock, 3); + locationCaches_PP.Add(new LocationCache { LocationCode = locationInfo.LocationCode, DateTime = DateTime.Now }); + return locationInfo; + } + } + } + return null; + } + } + + /// <summary> + /// 鑾峰彇鍙敤璐т綅(娴嬭瘯鏋朵粨) + /// </summary> + /// <param name="locationInfos"></param> + /// <param name="emptyLocation"></param> + /// <param name="palletType"></param> + /// <returns></returns> + private Dt_LocationInfo? GetUsableLocation_PP(List<Dt_LocationInfo> locationInfos, Dt_LocationInfo emptyLocation, PalletTypeEnum palletType) + { + switch (palletType) + { + case PalletTypeEnum.LargestPallet: + case PalletTypeEnum.LargePallet: + if (emptyLocation.Depth % 2 == 0) + { + return null; + } + break; + } + Dt_LocationInfo? locationInfo = DepthLocationIsEmpty_PP(locationInfos, emptyLocation, palletType); + if (locationInfo != null) + { + return locationInfo; + } + return null; + } + + /// <summary> + /// 鍒ゆ柇涓嶅悓娣卞害鐨勫悓缁勮揣浣嶇姸鎬佹槸鍚︿负绌洪棽绌轰綅(娴嬭瘯鏋朵粨) + /// </summary> + /// <param name="locationInfos"></param> + /// <param name="emptyLocation"></param> + /// <returns></returns> + private Dt_LocationInfo? DepthLocationIsEmpty_PP(List<Dt_LocationInfo> locationInfos, Dt_LocationInfo emptyLocation, PalletTypeEnum palletType) + { + List<Dt_LocationInfo> locations = GetGroupLocations(locationInfos, emptyLocation); + + bool moreDepthFlag = false; + bool littleDepthFlag = false; + + switch (palletType) + { + case PalletTypeEnum.LargestPallet: + case PalletTypeEnum.LargePallet: + 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锛屽垯琛ㄧず娣辫揣浣嶆湁鏈浣跨敤鐨勬儏鍐� + + 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; + } + + if (moreDepthFlag && littleDepthFlag) + { + return emptyLocation; + } + + return null; + } + } +} 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" new file mode 100644 index 0000000..9715b79 --- /dev/null +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/AssignLocation/LocationInfoService_ZH.cs" @@ -0,0 +1,174 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WIDESEA_Common.CommonEnum; +using WIDESEA_Common.LocationEnum; +using WIDESEA_Core.BaseServices; +using WIDESEA_Core.Helper; +using WIDESEA_IBasicRepository; +using WIDESEA_IBasicService; +using WIDESEA_Model.Models; + +namespace WIDESEA_BasicService +{ + public partial class LocationInfoService + { + + double weightValue_ZH = 0.25; + + private readonly static object _locker_ZH = new object(); + static List<LocationCache> locationCaches_ZH = new List<LocationCache>(); + + /// <summary> + /// 闃荤剨浠撹揣浣嶅垎閰� + /// </summary> + /// <param name="roadwayNo">宸烽亾鍙�</param> + /// <param name="palletType"> + /// 鎵樼洏绫诲瀷 + /// </param> + /// <returns></returns> + public Dt_LocationInfo? AssignLocation_ZH(string roadwayNo, PalletTypeEnum palletType, string beRelocationCode = "") + { + lock (_locker_ZH) + { + List<LocationCache> removeItems = locationCaches_ZH.Where(x => (DateTime.Now - x.DateTime).TotalMinutes > 5).ToList(); + int count = removeItems.Count; + for (int i = 0; i < count; i++) + { + locationCaches_ZH.Remove(removeItems[i]); + } + + List<string> lockLocationCodes = locationCaches_ZH.Select(x => x.LocationCode).ToList(); + + List<Dt_LocationInfo> locationInfos = Repository.QueryData(x => x.RoadwayNo == roadwayNo); + if (locationInfos == null || locationInfos.Count == 0) + { + throw new Exception($"鏈壘鍒拌宸烽亾鐨勮揣浣嶄俊鎭�,宸烽亾鍙�:{roadwayNo}"); + } + + if (!string.IsNullOrEmpty(beRelocationCode)) + { + Dt_LocationInfo? beRelocation = locationInfos.FirstOrDefault(x => x.LocationCode == beRelocationCode); + if (beRelocation == null) + { + throw new Exception($"鏈壘鍒拌揣浣嶄俊鎭�"); + } + int maxDepth = locationInfos.Max(x => x.Depth); + int mathCurrentRow = beRelocation.Row - Convert.ToInt32(Math.Ceiling(beRelocation.Row / maxDepth / 2.0)) * maxDepth * 2; + if (mathCurrentRow <= maxDepth) + { + locationInfos = locationInfos.Where(x => x.Row - Convert.ToInt32(Math.Ceiling(x.Row / maxDepth / 2.0)) * maxDepth * 2 <= maxDepth).ToList(); + } + else + { + locationInfos = locationInfos.Where(x => x.Row - Convert.ToInt32(Math.Ceiling(x.Row / maxDepth / 2.0)) * maxDepth * 2 > maxDepth).ToList(); + } + } + + //宸插畾涔夎揣浣嶇被鍨嬬殑璐т綅 + List<Dt_LocationInfo> definedTypeLocations = locationInfos.Where(x => x.LocationType == palletType.ObjToInt()).ToList(); + + //鏈畾涔夌被鍨嬬殑绌鸿揣浣� + List<Dt_LocationInfo> undefinedTypeEmptyLocations = locationInfos.Where(x => (x.EnableStatus == EnableStatusEnum.Normal.ObjToInt() || x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt()) && x.LocationStatus == LocationStatusEnum.Free.ObjToInt() && x.LocationType == LocationTypeEnum.Undefined.ObjToInt() && !lockLocationCodes.Contains(x.LocationCode)).OrderByDescending(x => x.Depth).ThenBy(x => x.Layer).ThenBy(x => x.Row).ThenBy(x => x.Column).ToList(); + + 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.Row).ThenBy(x => x.Column).ToList(); + + if ((locationInfos.Count * weightValue_ZH >= definedTypeLocations.Count && undefinedTypeEmptyLocations.Any()) || !definedTypeEmptyLocations.Any())//濡傛灉宸插畾涔夌被鍨嬭揣浣嶆湭瓒呰繃姣斾緥锛屼笖鏈夋湭瀹氫箟绫诲瀷鐨勮揣浣� + { + if (palletType == PalletTypeEnum.LargePallet || palletType == PalletTypeEnum.LargestPallet) + { + undefinedTypeEmptyLocations = undefinedTypeEmptyLocations.Where(x => x.Depth % 2 == 1).ToList(); + } + for (int i = 0; i < undefinedTypeEmptyLocations.Count; i++) + { + Dt_LocationInfo undefinedTypeEmptyLocation = undefinedTypeEmptyLocations[i]; + Dt_LocationInfo? locationInfo = GetUsableLocation_ZH(locationInfos, undefinedTypeEmptyLocation, palletType); + if (locationInfo != null) + { + UpdateLocationStatus(locationInfo, palletType, LocationStatusEnum.Lock, 3); + locationCaches_ZH.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_ZH(locationInfos, definedTypeEmptyLocation, palletType); + if (locationInfo != null) + { + UpdateLocationStatus(locationInfo, palletType, LocationStatusEnum.Lock, 3); + locationCaches_ZH.Add(new LocationCache { LocationCode = locationInfo.LocationCode, DateTime = DateTime.Now }); + return locationInfo; + } + } + } + return null; + } + } + + /// <summary> + /// 鑾峰彇鍙敤璐т綅(娴嬭瘯鏋朵粨) + /// </summary> + /// <param name="locationInfos"></param> + /// <param name="emptyLocation"></param> + /// <param name="palletType"></param> + /// <returns></returns> + private Dt_LocationInfo? GetUsableLocation_ZH(List<Dt_LocationInfo> locationInfos, Dt_LocationInfo emptyLocation, PalletTypeEnum palletType) + { + switch (palletType) + { + case PalletTypeEnum.LargestPallet: + case PalletTypeEnum.LargePallet: + if (emptyLocation.Depth % 2 == 0) + { + return null; + } + break; + } + Dt_LocationInfo? locationInfo = DepthLocationIsEmpty_ZH(locationInfos, emptyLocation, palletType); + if (locationInfo != null) + { + return locationInfo; + } + return null; + } + + /// <summary> + /// 鍒ゆ柇涓嶅悓娣卞害鐨勫悓缁勮揣浣嶇姸鎬佹槸鍚︿负绌洪棽绌轰綅(娴嬭瘯鏋朵粨) + /// </summary> + /// <param name="locationInfos"></param> + /// <param name="emptyLocation"></param> + /// <returns></returns> + private Dt_LocationInfo? DepthLocationIsEmpty_ZH(List<Dt_LocationInfo> locationInfos, Dt_LocationInfo emptyLocation, PalletTypeEnum palletType) + { + List<Dt_LocationInfo> locations = GetGroupLocations(locationInfos, emptyLocation); + + bool moreDepthFlag = false; + bool littleDepthFlag = false; + + switch (palletType) + { + case PalletTypeEnum.LargestPallet: + case PalletTypeEnum.LargePallet: + 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锛屽垯琛ㄧず娣辫揣浣嶆湁鏈浣跨敤鐨勬儏鍐� + + 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; + } + + if (moreDepthFlag && littleDepthFlag) + { + return emptyLocation; + } + + return null; + } + } +} diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/LocationInfoService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/LocationInfoService.cs" index da611cd..bdba1c5 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/LocationInfoService.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/LocationInfoService.cs" @@ -21,8 +21,15 @@ namespace WIDESEA_BasicService { - public partial class LocationInfoService : ServiceBase<Dt_LocationInfo, ILocationInfoRepository>, ILocationInfoService + public class LocationInfoService_Old { + private readonly ILocationInfoRepository Repository; + + public LocationInfoService_Old(ILocationInfoRepository repository) + { + Repository = repository; + } + double weightValue = 0.5; private readonly static object _locker = new object(); 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" new file mode 100644 index 0000000..bd6834c --- /dev/null +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/LocationInfoService_Common.cs" @@ -0,0 +1,174 @@ +锘縰sing AutoMapper; +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WIDESEA_Core; +using WIDESEA_Core.BaseRepository; +using WIDESEA_Core.BaseServices; +using WIDESEA_Core.Enums; +using WIDESEA_Core.Helper; +using WIDESEA_Core.Utilities; +using WIDESEA_DTO.Basic; +using WIDESEA_IBasicRepository; +using WIDESEA_IRecordService; +using WIDESEA_IBasicService; +using WIDESEA_Model.Models; +using WIDESEA_Common.CommonEnum; +using WIDESEA_Common.LocationEnum; + +namespace WIDESEA_BasicService +{ + public partial class LocationInfoService + { + public Dt_LocationInfo? AssignLocation(string roadwayNo, PalletTypeEnum palletType, int warehouseId) + { + Dt_Warehouse warehouse = _basicRepository.WarehouseRepository.QueryFirst(x => x.WarehouseId == warehouseId); + if (warehouse == null) + { + throw new Exception($"鏈壘鍒颁粨搴撲俊鎭�"); + } + + return warehouse.WarehouseName switch + { + "鏉挎潗浠�" => AssignLocation_BC(roadwayNo, palletType), + "PP浠�" => AssignLocation_PP(roadwayNo, palletType), + "骞茶啘浠�" => AssignLocation_GM(roadwayNo, palletType), + "娴嬭瘯鏋朵粨" => AssignLocation_CSJ(roadwayNo, palletType), + "闃荤剨浠�" => AssignLocation_ZH(roadwayNo, palletType), + "娌瑰ⅷ浠�" => AssignLocation(roadwayNo), + "鎴愬搧浠�" => AssignLocation(roadwayNo), + "杈呮枡浠�" => AssignLocation(roadwayNo), + _ => throw new Exception($"鏈壘鍒颁粨搴撹揣浣嶅垎閰嶆柟娉�") + }; + } + + private readonly static object _locker = new object(); + private static List<LocationCache> locationCaches = new List<LocationCache>(); + /// <summary> + /// + /// </summary> + /// <param name="roadwayNo"></param> + /// <returns></returns> + public Dt_LocationInfo? AssignLocation(string roadwayNo) + { + lock (_locker) + { + List<LocationCache> removeItems = locationCaches.Where(x => (DateTime.Now - x.DateTime).TotalMinutes > 5).ToList();//鏌ヨ娣诲姞闈欐�佸彉閲忚秴杩�5鍒嗛挓鐨勮揣浣� + int count = removeItems.Count; + for (int i = 0; i < count; i++) + { + locationCaches.Remove(removeItems[i]);//绉婚櫎鏌ヨ娣诲姞闈欐�佸彉閲忚秴杩�5鍒嗛挓鐨勮揣浣� + } + + List<string> lockLocations = locationCaches.Select(x => x.LocationCode).ToList(); + + List<Dt_LocationInfo> locationInfos = BaseDal.QueryData(x => x.RoadwayNo == roadwayNo);//鏌ヨ宸烽亾鎵�鏈夎揣浣嶄俊鎭� + + Dictionary<string, OrderByType> orderBy = new Dictionary<string, OrderByType>() + { + { nameof(Dt_LocationInfo.Layer),OrderByType.Asc }, + { nameof(Dt_LocationInfo.Column),OrderByType.Asc }, + { nameof(Dt_LocationInfo.Depth),OrderByType.Desc }, + { nameof(Dt_LocationInfo.Row),OrderByType.Asc } + }; + + return BaseDal.QueryFirst(x => x.RoadwayNo == roadwayNo && x.LocationStatus == LocationStatusEnum.Free.ObjToInt() && !lockLocations.Contains(x.LocationCode), orderBy);//鏌ヨ绌鸿揣浣嶄俊鎭苟鎺掗櫎5鍒嗛挓鍐呭垎閰嶇殑璐т綅,鏍规嵁灞傘�佸垪銆佹繁搴︺�佽鎺掑簭 + } + } + + /// <summary> + /// 淇敼璐т綅鐘舵�佸強绫诲瀷 + /// </summary> + /// <param name="locationCode">璐т綅缂栧彿</param> + /// <param name="palletType">鎵樼洏绫诲瀷</param> + /// <param name="locationStatus">璐т綅鐘舵��</param> + public void UpdateLocationStatus(string locationCode, PalletTypeEnum palletType, LocationStatusEnum locationStatus, int warehousId) + { + Dt_LocationInfo location = Repository.QueryFirst(x => x.LocationCode == locationCode); + if (location == null) + { + throw new Exception($"鏈壘鍒拌揣浣嶄俊鎭�,{locationCode}"); + } + UpdateLocationStatus(location, palletType, locationStatus, warehousId); + } + + /// <summary> + /// 淇敼璐т綅鐘舵�佸強绫诲瀷 + /// </summary> + /// <param name="location">璐т綅瀵硅薄</param> + /// <param name="palletType">鎵樼洏绫诲瀷</param> + /// <param name="locationStatus">璐т綅鐘舵��</param> + public void UpdateLocationStatus(Dt_LocationInfo location, PalletTypeEnum palletType, LocationStatusEnum locationStatus, int warehousId) + { + List<Dt_LocationInfo> locationInfos = Repository.QueryData(x => x.RoadwayNo == location.RoadwayNo); + + List<Dt_LocationInfo> locations = GetGroupLocations(locationInfos, location); + if (locationInfos.Max(x => x.Depth) < 3) + { + for (int i = 0; i < locations.Count; i++) + { + locations[i].LocationStatus = locationStatus.ObjToInt(); + locations[i].LocationType = palletType.ObjToInt(); + } + + Dt_LocationInfo? 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++) + { + nearLocations[i].LocationType = palletType.ObjToInt(); + if (palletType == PalletTypeEnum.LargePallet) + { + nearLocations[i].LocationStatus = locationStatus.ObjToInt(); + } + } + locations.AddRange(nearLocations); + } + } + else + { + for (int i = 0; i < locations.Count; i++) + { + locations[i].LocationStatus = locationStatus.ObjToInt(); + locations[i].LocationType = palletType.ObjToInt(); + } + } + Repository.UpdateData(locations); + } + + /// <summary> + /// 鑾峰彇涓嶅悓娣卞害鐨勫悓缁勮揣浣嶄俊鎭� + /// </summary> + /// <param name="locationInfos"></param> + /// <param name="location"></param> + /// <returns></returns> + private List<Dt_LocationInfo> GetGroupLocations(List<Dt_LocationInfo> locationInfos, Dt_LocationInfo location) + { + List<Dt_LocationInfo> groupLocations = new List<Dt_LocationInfo>() { location }; + int maxDepth = locationInfos.Max(x => x.Depth); + 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); + if (locationInfo != null) + { + groupLocations.Add(locationInfo); + } + } + + 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); + if (locationInfo != null) + { + groupLocations.Add(locationInfo); + } + } + return groupLocations; + } + } + +} diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/WIDESEA_BasicService.csproj" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/WIDESEA_BasicService.csproj" index e0052fb..555f689 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/WIDESEA_BasicService.csproj" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/WIDESEA_BasicService.csproj" @@ -1,4 +1,4 @@ -<Project Sdk="Microsoft.NET.Sdk"> +锘�<Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <TargetFramework>net6.0</TargetFramework> diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Common/CommonEnum/PalletTypeEnum.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Common/CommonEnum/PalletTypeEnum.cs" index c4ea3dd..aee9c69 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Common/CommonEnum/PalletTypeEnum.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Common/CommonEnum/PalletTypeEnum.cs" @@ -22,5 +22,10 @@ /// 澶ф墭鐩� /// </summary> LargePallet = 3, + + /// <summary> + /// 鏈�澶ф墭鐩� + /// </summary> + LargestPallet = 4 } } diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Common/LocationEnum/LocationStatusEnum.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Common/LocationEnum/LocationStatusEnum.cs" index e010eea..123091b 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Common/LocationEnum/LocationStatusEnum.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Common/LocationEnum/LocationStatusEnum.cs" @@ -27,18 +27,12 @@ /// 鏈夎揣 /// </summary> [Description("鏈夎揣")] - InStock = 2, + InStock = 100, /// <summary> - /// 绌烘墭閿佸畾 + /// 澶ф墭鐩橀攣瀹� /// </summary> - [Description("绌烘墭閿佸畾")] - PalletLock = 98, - - /// <summary> - /// 绌烘墭鐩� - /// </summary> - [Description("绌烘墭鐩�")] - Pallet = 99 + [Description("澶ф墭鐩橀攣瀹�")] + PalletLock = 99 } } diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Common/TaskEnum/TaskEnumHelper.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Common/TaskEnum/TaskEnumHelper.cs" new file mode 100644 index 0000000..5ddce7c --- /dev/null +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Common/TaskEnum/TaskEnumHelper.cs" @@ -0,0 +1,18 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace WIDESEA_Common.TaskEnum +{ + public static class TaskEnumHelper + { + public static List<int> GetEnumIndexList(this Type type) + { + if (type is null) throw new ArgumentNullException("type"); + if (!type.IsEnum) return new List<int>(); + return Enum.GetValues(type).Cast<int>().ToList(); + } + } +} diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Common/TaskEnum/InTaskStatusEnum.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Common/TaskEnum/TaskInStatusEnum.cs" similarity index 61% rename from "\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Common/TaskEnum/InTaskStatusEnum.cs" rename to "\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Common/TaskEnum/TaskInStatusEnum.cs" index 94a8dbc..df3f31c 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Common/TaskEnum/InTaskStatusEnum.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Common/TaskEnum/TaskInStatusEnum.cs" @@ -10,13 +10,19 @@ /// <summary> /// 鍏ュ簱浠诲姟鐘舵�� /// </summary> - public enum InTaskStatusEnum + public enum TaskInStatusEnum { /// <summary> /// 鏂板缓鍏ュ簱浠诲姟 /// </summary> [Description("鏂板缓")] InNew = 200, + + /// <summary> + /// 鍫嗗灈鏈哄緟鎵ц + /// </summary> + [Description("鍫嗗灈鏈哄緟鎵ц")] + SC_InExecute = 225, /// <summary> /// 鍫嗗灈鏈哄叆搴撴墽琛屼腑 @@ -47,35 +53,5 @@ /// </summary> [Description("鍏ュ簱浠诲姟寮傚父")] InException = 299, - - /// <summary> - /// 鏂板缓绉诲簱浠诲姟 - /// </summary> - [Description("鏂板缓绉诲簱浠诲姟")] - RelocationNew = 300, - - /// <summary> - /// 绉诲簱浠诲姟瀹屾垚 - /// </summary> - [Description("绉诲簱浠诲姟瀹屾垚")] - RelocationFinish = 310, - - /// <summary> - /// 绉诲簱浠诲姟鎵ц涓� - /// </summary> - [Description("绉诲簱浠诲姟鎵ц涓�")] - RelocationExecuting = 320, - - /// <summary> - /// 绉诲簱浠诲姟鍙栨秷 - /// </summary> - [Description("绉诲簱浠诲姟鍙栨秷")] - RelocationCancel = 330, - - /// <summary> - /// 绉诲簱浠诲姟寮傚父 - /// </summary> - [Description("绉诲簱浠诲姟寮傚父")] - RelocationException = 340, } } diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Common/TaskEnum/OutTaskStatusEnum.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Common/TaskEnum/TaskOutStatusEnum.cs" similarity index 96% rename from "\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Common/TaskEnum/OutTaskStatusEnum.cs" rename to "\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Common/TaskEnum/TaskOutStatusEnum.cs" index c202e7a..e7f5807 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Common/TaskEnum/OutTaskStatusEnum.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Common/TaskEnum/TaskOutStatusEnum.cs" @@ -10,7 +10,7 @@ /// <summary> /// 鍑哄簱浠诲姟鐘舵�� /// </summary> - public enum OutTaskStatusEnum + public enum TaskOutStatusEnum { /// <summary> /// 鏂板缓浠诲姟 diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Common/TaskEnum/TaskTypeEnum.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Common/TaskEnum/TaskTypeEnum.cs" index 4143d5b..9682426 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Common/TaskEnum/TaskTypeEnum.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Common/TaskEnum/TaskTypeEnum.cs" @@ -7,102 +7,70 @@ namespace WIDESEA_Common.TaskEnum { - /// <summary> - /// 浠诲姟绫诲瀷 - /// </summary> - public enum TaskTypeEnum + public enum TaskInboundTypeEnum { - /// <summary> - /// 鍑哄簱 =100 - /// </summary> - [Description("鍑哄簱")] - Outbound = 100, - - /// <summary> - /// 鐩樼偣鍑哄簱 - /// </summary> - [Description("鐩樼偣鍑哄簱")] - OutInventory = 101, - - /// <summary> - /// 鍒嗘嫞鍑哄簱 - /// </summary> - [Description("鍒嗘嫞鍑哄簱")] - OutPick = 102, - - /// <summary> - /// 璐ㄦ鍑哄簱 - /// </summary> - [Description("璐ㄦ鍑哄簱")] - OutQuality = 103, - - /// <summary> - /// 鍑虹┖ - /// </summary> - [Description("鍑虹┖")] - PalletOutbound = 104, - - /// <summary> - /// 琛ョ┖ - /// </summary> - [Description("琛ョ┖")] - PalletFillOutbound = 105, - /// <summary> /// 鍏ュ簱 /// </summary> [Description("鍏ュ簱")] Inbound = 200, - /// <summary> /// 鐩樼偣鍏ュ簱 /// </summary> [Description("鐩樼偣鍏ュ簱")] InInventory = 201, - /// <summary> /// 鍒嗘嫞鍏ュ簱 /// </summary> [Description("鍒嗘嫞鍏ュ簱")] InPick = 202, - /// <summary> /// 璐ㄦ鍏ュ簱 /// </summary> [Description("璐ㄦ鍏ュ簱")] - InQuality = 203, + InQuality = 203 + } + public enum TaskOutboundTypeEnum + { /// <summary> - /// 鍏ョ┖ + /// 鍑哄簱 /// </summary> - [Description("鍏ョ┖")] - PalletInbound = 204, - + [Description("鍑哄簱")] + Outbound = 100, /// <summary> - /// 鍥炵┖ + /// 鐩樼偣鍑哄簱 /// </summary> - [Description("鍥炵┖")] - PalletReturnInbound = 205, - + [Description("鐩樼偣鍑哄簱")] + OutInventory = 101, /// <summary> - /// 绉诲簱 + /// 鍒嗘嫞鍑哄簱 /// </summary> - [Description("绉诲簱")] - Relocation = 300, + [Description("鍒嗘嫞鍑哄簱")] + OutPick = 102, + /// <summary> + /// 璐ㄦ鍑哄簱 + /// </summary> + [Description("璐ㄦ鍑哄簱")] + OutQuality = 103, + } + public enum TaskRelocationTypeEnum + { /// <summary> /// 搴撳唴绉诲簱 /// </summary> [Description("搴撳唴绉诲簱")] - RelocationIn = 301, - + Relocation = 300, /// <summary> /// 搴撳绉诲簱 /// </summary> [Description("搴撳绉诲簱")] - RelocationOut = 302, + RelocationIn = 301 + } - [Description("AGV鎼繍")] - AGVCarry = 500, + public enum TaskOtherTypeEnum + { + } } diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Core/Helper/HttpHelper.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Core/Helper/HttpHelper.cs" index f49dc71..ccfdf9b 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Core/Helper/HttpHelper.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Core/Helper/HttpHelper.cs" @@ -20,9 +20,11 @@ string result = string.Empty; using HttpClient httpClient = new HttpClient(); httpClient.Timeout = new TimeSpan(0, 0, 60); - - foreach (var header in headers) - httpClient.DefaultRequestHeaders.Add(header.Key, header.Value); + if (headers != null) + { + foreach (var header in headers) + httpClient.DefaultRequestHeaders.Add(header.Key, header.Value); + } result = await httpClient.GetAsync(serviceAddress).Result.Content.ReadAsStringAsync(); return result; @@ -44,9 +46,11 @@ httpContent.Headers.ContentType = new MediaTypeHeaderValue("application/json"); using HttpClient httpClient = new HttpClient(); httpClient.Timeout = new TimeSpan(0, 0, 60); - - foreach (var header in headers) - httpClient.DefaultRequestHeaders.Add(header.Key, header.Value); + if (headers != null) + { + foreach (var header in headers) + httpClient.DefaultRequestHeaders.Add(header.Key, header.Value); + } result = await httpClient.PostAsync(serviceAddress, httpContent).Result.Content.ReadAsStringAsync(); } @@ -66,9 +70,11 @@ string result = string.Empty; using HttpClient httpClient = new HttpClient(); httpClient.Timeout = new TimeSpan(0, 0, 60); - - foreach (var header in headers) - httpClient.DefaultRequestHeaders.Add(header.Key, header.Value); + if (headers != null) + { + foreach (var header in headers) + httpClient.DefaultRequestHeaders.Add(header.Key, header.Value); + } result = httpClient.GetStringAsync(serviceAddress).Result; return result; @@ -91,8 +97,12 @@ using HttpClient httpClient = new HttpClient(); httpClient.Timeout = new TimeSpan(0, 0, 60); - foreach (var header in headers) - httpClient.DefaultRequestHeaders.Add(header.Key, header.Value); + if (headers != null) + { + foreach (var header in headers) + httpClient.DefaultRequestHeaders.Add(header.Key, header.Value); + } + result = httpClient.PostAsync(serviceAddress, httpContent).Result.Content.ReadAsStringAsync().Result; } diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_DTO/ERP/ErpResponseContent.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_DTO/ERP/ErpResponseContent.cs" index 4b7860b..339459c 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_DTO/ERP/ErpResponseContent.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_DTO/ERP/ErpResponseContent.cs" @@ -8,24 +8,13 @@ namespace WIDESEA_DTO { + /// <summary> + /// + /// </summary> [ModelValidate] public class ErpResponseContent { - public class content - { - /// <summary> - /// - /// </summary> - public string Code { get; set; } - /// <summary> - /// - /// </summary> - public string Name { get; set; } - /// <summary> - /// - /// </summary> - public string ShortName { get; set; } - } + //public class Root //{ @@ -48,7 +37,7 @@ /// <summary> /// /// </summary> - public content Content { get; set; } + public Content Content { get; set; } //} public static ErpResponseContent Instance { @@ -70,4 +59,23 @@ return this; } } + + /// <summary> + /// + /// </summary> + public class Content + { + /// <summary> + /// + /// </summary> + public string Code { get; set; } + /// <summary> + /// + /// </summary> + public string Name { get; set; } + /// <summary> + /// + /// </summary> + public string ShortName { get; set; } + } } diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_DTO/MES/MesResponseContent.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_DTO/MES/MesResponseContent.cs" index ece82c2..b64c5e2 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_DTO/MES/MesResponseContent.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_DTO/MES/MesResponseContent.cs" @@ -7,6 +7,9 @@ namespace WIDESEA_DTO { + /// <summary> + /// + /// </summary> [ModelValidate] public class MesResponseContent { @@ -26,30 +29,6 @@ /// /// </summary> public DateTime DataTime { get; set; } - /// <summary> - /// - /// </summary> - public content Content { get; set; } - - public class content - { - /// <summary> - /// - /// </summary> - public string Code { get; set; } - /// <summary> - /// - /// </summary> - public string Name { get; set; } - /// <summary> - /// - /// </summary> - public string ShortName { get; set; } - /// <summary> - /// - /// </summary> - public string Contacts { get; set; } - } public static MesResponseContent Instance { @@ -71,5 +50,7 @@ StrMsg = message == null ? "鎵ц澶辫触" : message; return this; } + public Content Content { get; set; } } + } diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_DTO/Task/WMSTaskDTO.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_DTO/Task/WMSTaskDTO.cs" new file mode 100644 index 0000000..84b63eb --- /dev/null +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_DTO/Task/WMSTaskDTO.cs" @@ -0,0 +1,56 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace WIDESEA_DTO.Task +{ + public class WMSTaskDTO + { + /// <summary> + /// WMS浠诲姟涓婚敭 + /// </summary> + public int Id { get; set; } + + /// <summary> + /// 浠诲姟鍙� + /// </summary> + public int TaskNum { get; set; } + + /// <summary> + /// 鎵樼洏鍙� + /// </summary> + public string PalletCode { get; set; } + + /// <summary> + /// 宸烽亾鍙� + /// </summary> + public string RoadWay { get; set; } + + /// <summary> + /// 浠诲姟绫诲瀷 + /// </summary> + public int TaskType { get; set; } + + /// <summary> + /// 浠诲姟鐘舵�� + /// </summary> + public int TaskStatus { get; set; } + + /// <summary> + /// 璧风偣 + /// </summary> + public string SourceAddress { get; set; } + + /// <summary> + /// 缁堢偣 + /// </summary> + public string TargetAddress { get; set; } + + /// <summary> + /// 浼樺厛绾� + /// </summary> + public int Grade { get; set; } + } +} diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_IBasicService/ILocationInfoService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_IBasicService/ILocationInfoService.cs" index 5257bf4..925ecf3 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_IBasicService/ILocationInfoService.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_IBasicService/ILocationInfoService.cs" @@ -58,7 +58,7 @@ /// <param name="roadwayNo">宸烽亾鍙�</param> /// <param name="palletType">鎵樼洏绫诲瀷</param> /// <returns></returns> - Dt_LocationInfo? AssignLocation(string roadwayNo, PalletTypeEnum palletType); + Dt_LocationInfo? AssignLocation(string roadwayNo, PalletTypeEnum palletType, int warehouseId); /// <summary> /// 淇敼璐т綅鐘舵�佸強绫诲瀷 @@ -66,7 +66,7 @@ /// <param name="locationCode">璐т綅缂栧彿</param> /// <param name="palletType">鎵樼洏绫诲瀷</param> /// <param name="locationStatus">璐т綅鐘舵��</param> - void UpdateLocationStatus(string locationCode, PalletTypeEnum palletType, LocationStatusEnum locationStatus); + void UpdateLocationStatus(string locationCode, PalletTypeEnum palletType, LocationStatusEnum locationStatus, int warehousId); /// <summary> /// 淇敼璐т綅鐘舵�佸強绫诲瀷 @@ -74,6 +74,6 @@ /// <param name="location">璐т綅瀵硅薄</param> /// <param name="palletType">鎵樼洏绫诲瀷</param> /// <param name="locationStatus">璐т綅鐘舵��</param> - void UpdateLocationStatus(Dt_LocationInfo location, PalletTypeEnum palletType, LocationStatusEnum locationStatus); + void UpdateLocationStatus(Dt_LocationInfo location, PalletTypeEnum palletType, LocationStatusEnum locationStatus, int warehousId); } } diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_IStockRepository/IStockInfoRepository.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_IStockRepository/IStockInfoRepository.cs" index 6b542d0..b193db7 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_IStockRepository/IStockInfoRepository.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_IStockRepository/IStockInfoRepository.cs" @@ -26,7 +26,5 @@ List<Dt_StockInfo> GetStockInfosExclude(string materielCode, List<string> palletCodes); bool UpdateDataWithDetail(Dt_StockInfo stockInfo); - - Dt_StockInfo GetPalletStockInfo(string roadwayNo); } } 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 f860808..404bde1 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" @@ -22,6 +22,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; +using WIDESEA_Common.CommonEnum; using WIDESEA_Core; using WIDESEA_Core.BaseServices; using WIDESEA_Core.Enums; @@ -38,8 +39,30 @@ { ITaskRepository Repository { get; } + WebResponseContent PushTasksToWCS(); + + /// <summary> + /// 鐢宠鍏ュ簱浠诲姟(PDA浣跨敤锛屼粎鎵樼洏缁戝畾鍏ュ簱绔欏彴锛屼笉鍒嗛厤璐т綅) + /// </summary> + /// <param name="palletCode">鎵樼洏鍙�</param> + /// <param name="stationCode">绔欏彴鍙�</param> + /// <returns></returns> WebResponseContent RequestInboundTask(string palletCode, string stationCode); + /// <summary> + /// 鍏ュ簱浠诲姟鐢宠鍒嗛厤璐т綅 + /// </summary> + /// <param name="taskNum">浠诲姟鍙�</param> + /// <param name="roadwayNo">宸烽亾鍙�</param> + /// <param name="palletType">鎵樼洏绫诲瀷</param> + /// <returns></returns> + WebResponseContent AssignInboundTaskLocation(int taskNum, string roadwayNo); + + /// <summary> + /// + /// </summary> + /// <param name="taskNum"></param> + /// <returns></returns> WebResponseContent InboundTaskCompleted(int taskNum); /// <summary> /// 娴嬭瘯鏋跺嚭浠� diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/ApprovalFlow/Dt_ApprovalFlow.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/ApprovalFlow/Dt_ApprovalFlow.cs" index b69f057..f63ed62 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/ApprovalFlow/Dt_ApprovalFlow.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/ApprovalFlow/Dt_ApprovalFlow.cs" @@ -8,18 +8,33 @@ namespace WIDESEA_Model.Models { + /// <summary> + /// 瀹℃壒娴佺▼琛� + /// </summary> [SugarTable(nameof(Dt_ApprovalFlow), "瀹℃壒娴佺▼琛�")] public class Dt_ApprovalFlow : BaseEntity { - [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "瀹℃壒娴佺▼缂栧彿锛屼富閿�")] + /// <summary> + /// 涓婚敭 + /// </summary> + [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "涓婚敭")] public int Id { get; set; } + /// <summary> + /// 瀹℃壒娴佺▼缂栧彿 + /// </summary> [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "瀹℃壒娴佺▼缂栧彿")] public string FlowCode { get; set; } + /// <summary> + /// 瀹℃壒娴佺▼鍚嶇О + /// </summary> [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "瀹℃壒娴佺▼鍚嶇О")] public string FlowName { get; set; } + /// <summary> + /// 瀹℃壒娴佺▼鎻忚堪 + /// </summary> [SugarColumn(IsNullable = true, Length = 200, ColumnDescription = "瀹℃壒娴佺▼鎻忚堪")] public string FlowDes { get; set; } } diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/ApprovalFlow/Dt_ApprovalNode.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/ApprovalFlow/Dt_ApprovalNode.cs" index 03ae7f3..6381da3 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/ApprovalFlow/Dt_ApprovalNode.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/ApprovalFlow/Dt_ApprovalNode.cs" @@ -8,24 +8,45 @@ namespace WIDESEA_Model.Models { + /// <summary> + /// 瀹℃壒鑺傜偣琛� + /// </summary> [SugarTable(nameof(Dt_ApprovalNode), "瀹℃壒鑺傜偣琛�")] public class Dt_ApprovalNode : BaseEntity { - [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "瀹℃壒鑺傜偣缂栧彿锛屼富閿�")] + /// <summary> + /// 涓婚敭 + /// </summary> + [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "涓婚敭")] public int Id { get; set; } + /// <summary> + /// 瀹℃壒娴佺▼缂栧彿 + /// </summary> [SugarColumn(IsNullable = false, ColumnDescription = "瀹℃壒娴佺▼缂栧彿锛屽閿�")] public int FlowId { get; set; } + /// <summary> + /// 瀹℃壒鑺傜偣鍚嶇О + /// </summary> [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "瀹℃壒鑺傜偣鍚嶇О")] public string NodeName { get; set; } + /// <summary> + /// 鑺傜偣绫诲瀷锛堝鍗曚汉瀹℃壒銆佸浜哄鎵广�佷細绛剧瓑锛� + /// </summary> [SugarColumn(IsNullable = false, ColumnDescription = "鑺傜偣绫诲瀷锛堝鍗曚汉瀹℃壒銆佸浜哄鎵广�佷細绛剧瓑锛�")] public int NodeType { get; set; } + /// <summary> + /// 瀹℃壒浜鸿鑹诧紙濡傞儴闂ㄧ粡鐞嗐�佹�荤粡鐞嗙瓑锛� + /// </summary> [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "瀹℃壒浜鸿鑹诧紙濡傞儴闂ㄧ粡鐞嗐�佹�荤粡鐞嗙瓑锛�")] public int ApproverRole { get; set; } + /// <summary> + /// 鑺傜偣椤哄簭 + /// </summary> [SugarColumn(IsNullable = false, ColumnDescription = "鑺傜偣椤哄簭")] public int NodeSequence { get; set; } } diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/ApprovalFlow/Dt_ApprovalTask.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/ApprovalFlow/Dt_ApprovalTask.cs" index 45ae9e2..c1126f5 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/ApprovalFlow/Dt_ApprovalTask.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/ApprovalFlow/Dt_ApprovalTask.cs" @@ -8,6 +8,9 @@ namespace WIDESEA_Model.Models { + /// <summary> + /// 瀹℃壒浠诲姟琛� + /// </summary> [SugarTable(nameof(Dt_ApprovalTask), "瀹℃壒浠诲姟琛�")] public class Dt_ApprovalTask : BaseEntity { @@ -60,9 +63,9 @@ public string AuditUser { get; set; } /// <summary> - /// + /// 鏉ユ簮涓婚敭 /// </summary> - [SugarColumn(IsNullable = false, ColumnDescription = "")] + [SugarColumn(IsNullable = false, ColumnDescription = "鏉ユ簮涓婚敭")] public int SourceKey { get; set; } } } diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/ApprovalFlow/Dt_NodeTransition.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/ApprovalFlow/Dt_NodeTransition.cs" index 5cfe388..7944396 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/ApprovalFlow/Dt_NodeTransition.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/ApprovalFlow/Dt_NodeTransition.cs" @@ -8,18 +8,33 @@ namespace WIDESEA_Model.Models { + /// <summary> + /// 鑺傜偣璺宠浆琛� + /// </summary> [SugarTable(nameof(Dt_NodeTransition), "鑺傜偣璺宠浆琛�")] public class Dt_NodeTransition : BaseEntity { + /// <summary> + /// 璺宠浆缂栧彿 + /// </summary> [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "璺宠浆缂栧彿锛屼富閿�")] public int Id { get; set; } + /// <summary> + /// 璧峰鑺傜偣缂栧彿 + /// </summary> [SugarColumn(IsNullable = false, ColumnDescription = "璧峰鑺傜偣缂栧彿锛屽閿�")] public int FromNodeId { get; set; } + /// <summary> + /// 鐩爣鑺傜偣缂栧彿 + /// </summary> [SugarColumn(IsNullable = false, ColumnDescription = "鐩爣鑺傜偣缂栧彿锛屽閿�")] public int ToNodeId { get; set; } + /// <summary> + /// 璺宠浆鏉′欢锛堝鈥滃悓鎰忓垯璺宠浆鍒颁笅涓�鑺傜偣鈥濓紝鈥滄嫆缁濆垯缁撴潫娴佺▼鈥濈瓑锛� + /// </summary> [SugarColumn(IsNullable = false, Length = 200, ColumnDescription = "璺宠浆鏉′欢锛堝鈥滃悓鎰忓垯璺宠浆鍒颁笅涓�鑺傜偣鈥濓紝鈥滄嫆缁濆垯缁撴潫娴佺▼鈥濈瓑锛�")] public string Condition { get; set; } } diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Basic/Dt_CustomerInfo.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Basic/Dt_CustomerInfo.cs" index 389d860..cbbddb4 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Basic/Dt_CustomerInfo.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Basic/Dt_CustomerInfo.cs" @@ -8,26 +8,36 @@ namespace WIDESEA_Model.Models { - [SugarTable(nameof(Dt_CustomerInfo),"瀹㈡埛淇℃伅")] + /// <summary> + /// 瀹㈡埛淇℃伅 + /// </summary> + [SugarTable(nameof(Dt_CustomerInfo), "瀹㈡埛淇℃伅")] public class Dt_CustomerInfo : BaseEntity { + /// <summary> + /// 涓婚敭 + /// </summary> [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "涓婚敭")] public int Id { get; set; } + /// <summary> /// 瀹㈡埛缂栫爜 /// </summary> [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "瀹㈡埛缂栫爜")] public string Code { get; set; } + /// <summary> /// 瀹㈡埛鍚嶇О /// </summary> [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "瀹㈡埛鍚嶇О")] public string Name { get; set; } + /// <summary> /// 瀹㈡埛鍏ㄧО /// </summary> [SugarColumn(IsNullable = true, Length = 100, ColumnDescription = "瀹㈡埛鍏ㄧО")] public string NickName { get; set; } + /// <summary> /// 瀹㈡埛鐘舵�� 0:绂佺敤 1:鍙敤 /// </summary> diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Basic/Dt_LocationInfo.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Basic/Dt_LocationInfo.cs" index ec5e4e9..b431c5d 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Basic/Dt_LocationInfo.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Basic/Dt_LocationInfo.cs" @@ -8,49 +8,88 @@ namespace WIDESEA_Model.Models { + /// <summary> + /// 璐т綅淇℃伅 + /// </summary> [SugarTable(nameof(Dt_LocationInfo), "璐т綅淇℃伅")] public class Dt_LocationInfo : BaseEntity, BaseWarehouseEntity { + /// <summary> + /// 涓婚敭 + /// </summary> [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "涓婚敭")] public int Id { get; set; } + /// <summary> + /// 浠撳簱缂栧彿 + /// </summary> + [SugarColumn(IsNullable = false, ColumnDescription = "浠撳簱缂栧彿")] + public int WarehouseId { get; set; } + + /// <summary> + /// 璐т綅缂栧彿 + /// </summary> [SugarColumn(IsNullable = true, Length = 20, ColumnDescription = "璐т綅缂栧彿")] public string LocationCode { get; set; } + /// <summary> + /// 璐т綅鍚嶇О + /// </summary> [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "璐т綅鍚嶇О")] public string LocationName { get; set; } + /// <summary> + /// 宸烽亾缂栧彿 + /// </summary> [SugarColumn(IsNullable = true, Length = 20, ColumnDescription = "宸烽亾缂栧彿")] public string RoadwayNo { get; set; } + /// <summary> + /// 璐т綅琛� + /// </summary> [SugarColumn(IsNullable = true, ColumnDescription = "璐т綅琛�")] public int Row { get; set; } + /// <summary> + /// 璐т綅鍒� + /// </summary> [SugarColumn(IsNullable = true, ColumnDescription = "璐т綅鍒�")] public int Column { get; set; } + /// <summary> + /// 璐т綅灞� + /// </summary> [SugarColumn(IsNullable = true, ColumnDescription = "璐т綅灞�")] public int Layer { get; set; } + /// <summary> + /// 璐т綅娣卞害 + /// </summary> [SugarColumn(IsNullable = true, ColumnDescription = "璐т綅娣卞害")] public int Depth { get; set; } - //[SugarColumn(IsNullable = false, ColumnDescription = "宸︿晶/鍙充晶")] - //public int LocationSide { get; set; } - + /// <summary> + /// 璐т綅绫诲瀷 + /// </summary> [SugarColumn(IsNullable = true, ColumnDescription = "璐т綅绫诲瀷")] public int LocationType { get; set; } + /// <summary> + /// 璐т綅鐘舵�� + /// </summary> [SugarColumn(IsNullable = true, DefaultValue = "0", ColumnDescription = "璐т綅鐘舵��")] public int LocationStatus { get; set; } + /// <summary> + /// 绂佺敤鐘舵�� + /// </summary> [SugarColumn(IsNullable = true, DefaultValue = "0", ColumnDescription = "绂佺敤鐘舵��")] public int EnableStatus { get; set; } + /// <summary> + /// 澶囨敞 + /// </summary> [SugarColumn(IsNullable = true, Length = 200, ColumnDescription = "澶囨敞")] public string Remark { get; set; } - - - public int WarehouseId { get ; set ; } } } diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Basic/Dt_MaterielInfo.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Basic/Dt_MaterielInfo.cs" index 3a890ea..682c4fe 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Basic/Dt_MaterielInfo.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Basic/Dt_MaterielInfo.cs" @@ -10,6 +10,9 @@ namespace WIDESEA_Model.Models { + /// <summary> + /// 鐗╂枡淇℃伅 + /// </summary> [SugarTable(nameof(Dt_MaterielInfo), "鐗╂枡淇℃伅")] [SugarIndex("unique_materielinfo_materielcode", nameof(MaterielCode), OrderByType.Asc, true)] public class Dt_MaterielInfo : BaseEntity//, BaseWarehouseEntity @@ -19,6 +22,12 @@ /// </summary> [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "涓婚敭")] public int Id { get; set; } + + /// <summary> + /// 浠撳簱缂栧彿 + /// </summary> + [SugarColumn(IsNullable = false, ColumnDescription = "浠撳簱缂栧彿")] + public int WarehouseId { get; set; } /// <summary> /// 鐗╂枡缂栧彿 @@ -115,11 +124,5 @@ /// </summary> [SugarColumn(IsNullable = true, Length = 200, ColumnDescription = "澶囨敞")] public string Remark { get; set; } - - /// <summary> - /// 浠撳簱缂栧彿 - /// </summary> - [SugarColumn(IsNullable = false, ColumnDescription = "浠撳簱缂栧彿")] - public int WarehouseId { get; set; } } } diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Basic/Dt_SupplierInfo.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Basic/Dt_SupplierInfo.cs" index dbbba7d..557e906 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Basic/Dt_SupplierInfo.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Basic/Dt_SupplierInfo.cs" @@ -8,39 +8,75 @@ namespace WIDESEA_Model.Models { + /// <summary> + /// 渚涘簲鍟嗕俊鎭� + /// </summary> [SugarTable(nameof(Dt_SupplierInfo), "渚涘簲鍟嗕俊鎭�")] public class Dt_SupplierInfo : BaseEntity { + /// <summary> + /// 涓婚敭 + /// </summary> [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "涓婚敭")] public int Id { get; set; } + /// <summary> + /// 渚涘簲鍟嗙紪鐮� + /// </summary> [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "渚涘簲鍟嗙紪鐮�")] public string SupplierCode { get; set; } + /// <summary> + /// 渚涘簲鍟嗗悕绉� + /// </summary> [SugarColumn(IsNullable = true, Length = 200, ColumnDescription = "渚涘簲鍟嗗悕绉�")] public string SupplierName { get; set; } + /// <summary> + /// 渚涘簲鍟嗙畝绉� + /// </summary> [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "渚涘簲鍟嗙畝绉�")] public string SupplierShortName { get; set; } + /// <summary> + /// 鑱旂郴浜� + /// </summary> [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "鑱旂郴浜�")] public string Contacts { get; set; } + /// <summary> + /// 鑱旂郴鐢佃瘽 + /// </summary> [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "鑱旂郴鐢佃瘽")] public string ContactNumber { get; set; } + /// <summary> + /// 鑱旂郴鍦板潃 + /// </summary> [SugarColumn(IsNullable = true, Length = 200, ColumnDescription = "鑱旂郴鍦板潃")] public string ContactAddress { get; set; } + /// <summary> + /// 鐢靛瓙閭 + /// </summary> [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "鐢靛瓙閭")] public string Email { get; set; } + /// <summary> + /// 鎻忚堪 + /// </summary> [SugarColumn(IsNullable = true, Length = 200, ColumnDescription = "鎻忚堪")] public string Description { get; set; } + /// <summary> + /// 搴撳瓨缁勭粐 + /// </summary> [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "搴撳瓨缁勭粐")] public string InvOrgId { get; set; } + /// <summary> + /// 鐘舵�� + /// </summary> [SugarColumn(IsNullable = false, ColumnDescription = "鐘舵��")] public int Status { get; set; } } diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Basic/Dt_Warehouse.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Basic/Dt_Warehouse.cs" index 7965eb1..fa11459 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Basic/Dt_Warehouse.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Basic/Dt_Warehouse.cs" @@ -8,27 +8,51 @@ namespace WIDESEA_Model.Models { + /// <summary> + /// 浠撳簱淇℃伅 + /// </summary> [SugarTable(nameof(Dt_Warehouse), "浠撳簱淇℃伅")] public class Dt_Warehouse : BaseEntity { + /// <summary> + /// 涓婚敭 + /// </summary> [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "涓婚敭")] public int WarehouseId { get; set; } + /// <summary> + /// 浠撳簱缂栧彿 + /// </summary> [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "浠撳簱缂栧彿")] public string WarehouseCode { get; set; } + /// <summary> + /// 浠撳簱鍚嶇О + /// </summary> [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "浠撳簱鍚嶇О")] public string WarehouseName { get; set; } + /// <summary> + /// 浠撳簱绫诲瀷 + /// </summary> [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "浠撳簱绫诲瀷")] public string WarehouseType { get; set; } + /// <summary> + /// 浠撳簱鐘舵�� + /// </summary> [SugarColumn(IsNullable = false, DefaultValue = "0", ColumnDescription = "浠撳簱鐘舵��")] public int WarehouseStatus { get; set; } + /// <summary> + /// 浠撳簱鎻忚堪 + /// </summary> [SugarColumn(IsNullable = true, ColumnDescription = "浠撳簱鎻忚堪")] public string WarehouseDes { get; set; } + /// <summary> + /// 澶囨敞 + /// </summary> [SugarColumn(IsNullable = true, Length = 200, ColumnDescription = "澶囨敞")] public string Remark { get; set; } } diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Check/Dt_CheckOrder.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Check/Dt_CheckOrder.cs" index 7987de7..210137d 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Check/Dt_CheckOrder.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Check/Dt_CheckOrder.cs" @@ -10,7 +10,10 @@ namespace WIDESEA_Model.Models { - [SugarTable] + /// <summary> + /// 璐ㄦ鍗� + /// </summary> + [SugarTable(nameof(Dt_CheckOrder), "璐ㄦ鍗�")] public class Dt_CheckOrder : BaseEntity { /// <summary> @@ -32,9 +35,15 @@ [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "鏀惰揣鍗曞彿")] public string ReceiveOrderNo { get; set; } + /// <summary> + /// 璐ㄦ鍗曠姸鎬� + /// </summary> [SugarColumn(IsNullable = false, ColumnDescription = "璐ㄦ鍗曠姸鎬�")] public int CheckOrderStatus { get; set; } + /// <summary> + /// 瀹℃壒鐘舵�� + /// </summary> [SugarColumn(IsNullable = false, ColumnDescription = "瀹℃壒鐘舵��")] public int AuditStatus { get; set; } @@ -92,9 +101,15 @@ [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "鐗归噰璇存槑")] public string DefectedNote { get; set; } + /// <summary> + /// 妫�楠屼汉 + /// </summary> [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "妫�楠屼汉")] public string CheckUserName { get; set; } + /// <summary> + /// 璐ㄦ缁撴灉 + /// </summary> [Navigate(NavigateType.OneToMany, nameof(Dt_CheckOrderResult.CheckOrderId), nameof(CheckOrderId))] public List<Dt_CheckOrderResult> Details { get; set; } } diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Check/Dt_CheckOrderResult.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Check/Dt_CheckOrderResult.cs" index 7eecde4..12bbcc7 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Check/Dt_CheckOrderResult.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Check/Dt_CheckOrderResult.cs" @@ -8,6 +8,9 @@ namespace WIDESEA_Model.Models { + /// <summary> + /// 妫�楠岀粨鏋� + /// </summary> [SugarTable(nameof(Dt_CheckOrderResult), "妫�楠岀粨鏋�")] public class Dt_CheckOrderResult : BaseEntity { diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Config/Dt_AnalysisRuleConfig.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Config/Dt_AnalysisRuleConfig.cs" index 72cb380..7813561 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Config/Dt_AnalysisRuleConfig.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Config/Dt_AnalysisRuleConfig.cs" @@ -8,30 +8,57 @@ namespace WIDESEA_Model.Models { - [SugarTable(nameof(Dt_AnalysisRuleConfig))] + /// <summary> + /// 缂栫爜瑙f瀽瑙勫垯閰嶇疆 + /// </summary> + [SugarTable(nameof(Dt_AnalysisRuleConfig),"缂栫爜瑙f瀽瑙勫垯閰嶇疆")] public class Dt_AnalysisRuleConfig : BaseEntity { + /// <summary> + /// 涓婚敭 + /// </summary> [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "涓婚敭")] public int Id { get; set; } + /// <summary> + /// 瑙勫垯缂栧彿 + /// </summary> [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "瑙勫垯缂栧彿")] public string AnalysisCode { get; set; } + /// <summary> + /// 瑙勫垯鍚嶇О + /// </summary> [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "瑙勫垯鍚嶇О")] public string AnalysisName { get; set; } + /// <summary> + /// 鍓嶇紑瀛楃涓� + /// </summary> [SugarColumn(IsNullable = true, Length = 20, ColumnDescription = "鍓嶇紑瀛楃涓�")] public string StartStr { get; set; } + /// <summary> + /// 缁撴潫瀛楃涓� + /// </summary> [SugarColumn(IsNullable = true, Length = 20, ColumnDescription = "缁撴潫瀛楃涓�")] public string EndStr { get; set; } + /// <summary> + /// 鍒嗗壊瀛楃涓� + /// </summary> [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "鍒嗗壊瀛楃涓�")] public string SplitStr { get; set; } + /// <summary> + /// 缂栫爜瑙勫垯 + /// </summary> [SugarColumn(IsNullable = false, Length = 100, ColumnDescription = "缂栫爜瑙勫垯")] public string Format { get; set; } + /// <summary> + /// 澶囨敞 + /// </summary> [SugarColumn(IsNullable = true, Length = 200, ColumnDescription = "澶囨敞")] public string Remark { get; set; } } diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Config/Dt_CodeRuleConfig.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Config/Dt_CodeRuleConfig.cs" index 282f21a..e25fc30 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Config/Dt_CodeRuleConfig.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Config/Dt_CodeRuleConfig.cs" @@ -8,33 +8,63 @@ namespace WIDESEA_Model.Models { - [SugarTable(nameof(Dt_CodeRuleConfig))] + /// <summary> + /// 缂栫爜鐢熸垚瑙勫垯閰嶇疆 + /// </summary> + [SugarTable(nameof(Dt_CodeRuleConfig), "缂栫爜鐢熸垚瑙勫垯閰嶇疆")] public class Dt_CodeRuleConfig : BaseEntity { + /// <summary> + /// 涓婚敭 + /// </summary> [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "涓婚敭")] public int Id { get; set; } + /// <summary> + /// 瑙勫垯缂栧彿 + /// </summary> [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "瑙勫垯缂栧彿")] public string RuleCode { get; set; } + /// <summary> + /// 瑙勫垯鍚嶇О + /// </summary> [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "瑙勫垯鍚嶇О")] public string RuleName { get; set; } - [SugarColumn(IsNullable = false,ColumnDescription ="娴佹按鍙疯捣濮嬪��")] + /// <summary> + /// 娴佹按鍙疯捣濮嬪�� + /// </summary> + [SugarColumn(IsNullable = false, ColumnDescription = "娴佹按鍙疯捣濮嬪��")] public int StartVal { get; set; } + /// <summary> + /// 鍓嶇紑瀛楃涓� + /// </summary> [SugarColumn(IsNullable = true, Length = 2, ColumnDescription = "鍓嶇紑瀛楃涓�")] public string StartStr { get; set; } + /// <summary> + /// 缂栫爜瑙勫垯 + /// </summary> [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "缂栫爜瑙勫垯")] public string Format { get; set; } + /// <summary> + /// 娴佹按鍙烽暱搴� + /// </summary> [SugarColumn(IsNullable = false, ColumnDescription = "娴佹按鍙烽暱搴�")] public int Length { get; set; } + /// <summary> + /// 娴佹按鍙峰綋鍓嶅�� + /// </summary> [SugarColumn(IsNullable = false, ColumnDescription = "娴佹按鍙峰綋鍓嶅��")] public int CurrentVal { get; set; } + /// <summary> + /// 澶囨敞 + /// </summary> [SugarColumn(IsNullable = true, Length = 500, ColumnDescription = "澶囨敞")] public string Remark { get; set; } } diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Inbound/Dt_InboundOrder.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Inbound/Dt_InboundOrder.cs" index eb69f09..63042a0 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Inbound/Dt_InboundOrder.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Inbound/Dt_InboundOrder.cs" @@ -10,37 +10,70 @@ namespace WIDESEA_Model.Models { + /// <summary> + /// 鍏ュ簱鍗� + /// </summary> [SugarTable(nameof(Dt_InboundOrder), "鍏ュ簱鍗�")] public class Dt_InboundOrder : BaseEntity { + /// <summary> + /// 涓婚敭 + /// </summary> [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "涓婚敭")] public int Id { get; set; } + /// <summary> + /// 浠撳簱涓婚敭 + /// </summary> + [SugarColumn(IsNullable = false, ColumnDescription = "浠撳簱涓婚敭")] + public int WarehouseId { get; set; } + + /// <summary> + /// 鍗曟嵁缂栧彿 + /// </summary> [CodeRule(RuleCodeEnum.InboundOrderRule)] [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "鍗曟嵁缂栧彿")] public string InboundOrderNo { get; set; } + /// <summary> + /// 涓婃父鍗曟嵁缂栧彿 + /// </summary> [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "涓婃父鍗曟嵁缂栧彿")] public string UpperOrderNo { get; set; } - [SugarColumn(IsNullable = false, ColumnDescription = "")] - public int WarehouseId { get; set; } - - [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "")] + /// <summary> + /// 渚涘簲鍟嗙紪鍙� + /// </summary> + [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "渚涘簲鍟嗙紪鍙�")] public string SupplierId { get; set; } + /// <summary> + /// 鍗曟嵁绫诲瀷 + /// </summary> [SugarColumn(IsNullable = false, ColumnDescription = "鍗曟嵁绫诲瀷")] public int OrderType { get; set; } + /// <summary> + /// 鍗曟嵁鐘舵�� + /// </summary> [SugarColumn(IsNullable = false, ColumnDescription = "鍗曟嵁鐘舵��")] public int OrderStatus { get; set; } + /// <summary> + /// 鍒涘缓鏂瑰紡 + /// </summary> [SugarColumn(IsNullable = false, ColumnDescription = "鍒涘缓鏂瑰紡")] public int CreateType { get; set; } + /// <summary> + /// 澶囨敞 + /// </summary> [SugarColumn(IsNullable = true, Length = 200, ColumnDescription = "澶囨敞")] public string Remark { get; set; } + /// <summary> + /// 鍏ュ簱鍗曟槑缁� + /// </summary> [Navigate(NavigateType.OneToMany, nameof(Dt_InboundOrderDetail.OrderId), nameof(Id))] public List<Dt_InboundOrderDetail> Details { get; set; } } diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Inbound/Dt_InboundOrderDetail.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Inbound/Dt_InboundOrderDetail.cs" index 0aac169..e6c6247 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Inbound/Dt_InboundOrderDetail.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Inbound/Dt_InboundOrderDetail.cs" @@ -8,42 +8,75 @@ namespace WIDESEA_Model.Models { + /// <summary> + /// 鍏ュ簱鍗曟槑缁� + /// </summary> [SugarTable(nameof(Dt_InboundOrderDetail), "鍏ュ簱鍗曟槑缁�")] public class Dt_InboundOrderDetail : BaseEntity { + /// <summary> + /// 涓婚敭 + /// </summary> [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "涓婚敭")] public int Id { get; set; } + /// <summary> + /// 鍏ュ簱鍗曚富閿� + /// </summary> [SugarColumn(IsNullable = false, ColumnDescription = "鍏ュ簱鍗曚富閿�")] public int OrderId { get; set; } + /// <summary> + /// 鐗╂枡缂栧彿 + /// </summary> [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "鐗╂枡缂栧彿")] public string MaterielCode { get; set; } + /// <summary> + /// 鎵规鍙� + /// </summary> [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "鎵规鍙�")] public string BatchNo { get; set; } + /// <summary> + /// 鍗曟嵁鏁伴噺 + /// </summary> [SugarColumn(IsNullable = false, ColumnDescription = "鍗曟嵁鏁伴噺")] public float OrderQuantity { get; set; } + /// <summary> + /// 缁勭洏鏁伴噺 + /// </summary> [SugarColumn(IsNullable = false, ColumnDescription = "缁勭洏鏁伴噺", DefaultValue = "0")] public float ReceiptQuantity { get; set; } + /// <summary> + /// 涓婃灦鏁伴噺 + /// </summary> [SugarColumn(IsNullable = false, ColumnDescription = "涓婃灦鏁伴噺", DefaultValue = "0")] public float OverInQuantity { get; set; } + /// <summary> + /// 璁㈠崟鏄庣粏鐘舵�� + /// </summary> [SugarColumn(IsNullable = false, ColumnDescription = "璁㈠崟鏄庣粏鐘舵��")] public int OrderDetailStatus { get; set; } + /// <summary> + /// 鍗曚綅 + /// </summary> [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "鍗曚綅")] public string Unit { get; set; } /// <summary> /// 鏀惰揣鍗曟槑缁嗚鍙� /// </summary> - [SugarColumn(IsNullable = false, ColumnDescription = "琛屽彿")] + [SugarColumn(IsNullable = false, ColumnDescription = "鏀惰揣鍗曟槑缁嗚鍙�")] public int RowNo { get; set; } + /// <summary> + /// 澶囨敞 + /// </summary> [SugarColumn(IsNullable = true, ColumnDescription = "澶囨敞")] public string Remark { get; set; } } diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Inbound/Dt_InboundOrder_Hty.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Inbound/Dt_InboundOrder_Hty.cs" index 501f8c7..e5df887 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Inbound/Dt_InboundOrder_Hty.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Inbound/Dt_InboundOrder_Hty.cs" @@ -11,34 +11,64 @@ namespace WIDESEA_Model.Models { - [SugarTable(nameof(Dt_InboundOrder_Hty), "鍏ュ簱鍗�")] - public class Dt_InboundOrder_Hty + /// <summary> + /// + /// </summary> + [SugarTable(nameof(Dt_InboundOrder_Hty), "鍏ュ簱鍗曞巻鍙�")] + public class Dt_InboundOrder_Hty { + /// <summary> + /// + /// </summary> [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "涓婚敭")] public int Id { get; set; } + /// <summary> + /// + /// </summary> [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "鍗曟嵁缂栧彿")] public string OrderNo { get; set; } + /// <summary> + /// + /// </summary> [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "涓婃父鍗曟嵁缂栧彿")] public string UpperOrderNo { get; set; } + /// <summary> + /// + /// </summary> [SugarColumn(IsNullable = false, ColumnDescription = "鍗曟嵁绫诲瀷")] public int OrderType { get; set; } + /// <summary> + /// 鍗曟嵁鐘舵�� + /// </summary> [SugarColumn(IsNullable = false, ColumnDescription = "鍗曟嵁鐘舵��")] public int OrderStatus { get; set; } + /// <summary> + /// 鍒涘缓鏂瑰紡 + /// </summary> [SugarColumn(IsNullable = false, ColumnDescription = "鍒涘缓鏂瑰紡")] public int CreateType { get; set; } + /// <summary> + /// 澶囨敞 + /// </summary> [SugarColumn(IsNullable = true, Length = 200, ColumnDescription = "澶囨敞")] public string Remark { get; set; } + /// <summary> + /// 婧愪富閿� + /// </summary> [SugarColumn(IsNullable = false, DefaultValue = "0", ColumnDescription = "婧愪富閿�")] public int SourceId { get; set; } - [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "澶囨敞")] + /// <summary> + /// 鎿嶄綔绫诲瀷 + /// </summary> + [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "鎿嶄綔绫诲瀷")] public string OperateType { get; set; } /// <summary> diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Inbound/Dt_PurchaseOrder.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Inbound/Dt_PurchaseOrder.cs" index 516598b..f5691b5 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Inbound/Dt_PurchaseOrder.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Inbound/Dt_PurchaseOrder.cs" @@ -9,57 +9,63 @@ namespace WIDESEA_Model.Models { - [SugarTable(nameof(Dt_PurchaseOrder), "閲囪喘璁㈠崟"), ModelValidate] + /// <summary> + /// + /// </summary> + [SugarTable(nameof(Dt_PurchaseOrder), "閲囪喘鍗�"), ModelValidate] public class Dt_PurchaseOrder : BaseEntity { /// <summary> /// 涓婚敭 /// </summary> - [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "")] + [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "涓婚敭")] public int Id { get; set; } /// <summary> /// 閲囪喘鍗曞彿 /// </summary> [PropertyValidate("閲囪喘鍗曞彿", NotNullAndEmpty = true)] - [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "")] + [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "閲囪喘鍗曞彿")] public string PurchaseOrderNo { get; set; } /// <summary> /// 鍗曟嵁绫诲瀷(S:鏍囧噯鍏ュ簱銆乂:瀵勫敭琛ョ粰鍏ュ簱) /// </summary> [PropertyValidate("鍗曟嵁绫诲瀷", NotNullAndEmpty = true, Check = new[] { "S", "V" })] - [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "")] + [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "鍗曟嵁绫诲瀷")] public string PurchaseOrderType { get; set; } /// <summary> /// 渚涘簲鍟嗙紪鍙� /// </summary> [PropertyValidate("渚涘簲鍟嗙紪鍙�", NotNullAndEmpty = true)] - [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "")] + [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "渚涘簲鍟嗙紪鍙�")] public string SupplierCode { get; set; } /// <summary> /// 閲囪喘鏁伴噺 /// </summary> [PropertyValidate("閲囪喘鏁伴噺", MinValue = 0, IsContainMinValue = false)] - [SugarColumn(IsNullable = false, ColumnDescription = "")] + [SugarColumn(IsNullable = false, ColumnDescription = "閲囪喘鏁伴噺")] public float OrderQuantity { get; set; } - [SugarColumn(IsNullable = false, ColumnDescription = "")] + /// <summary> + /// 閲囪喘鍗曠姸鎬� + /// </summary> + [SugarColumn(IsNullable = false, ColumnDescription = "閲囪喘鍗曠姸鎬�")] public int PurchaseOrderStatus { get; set; } /// <summary> /// 涓嬪崟鏃ユ湡 /// </summary> [PropertyValidate("涓嬪崟鏃ユ湡", NotNullAndEmpty = true)] - [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "")] + [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "涓嬪崟鏃ユ湡")] public string OrderDate { get; set; } /// <summary> /// 澶囨敞 /// </summary> - [SugarColumn(IsNullable = true, Length = 200, ColumnDescription = "")] + [SugarColumn(IsNullable = true, Length = 200, ColumnDescription = "澶囨敞")] public string Remark { get; set; } /// <summary> diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Inbound/Dt_PurchaseOrderDetail.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Inbound/Dt_PurchaseOrderDetail.cs" index 2cf844d..c3ab638 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Inbound/Dt_PurchaseOrderDetail.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Inbound/Dt_PurchaseOrderDetail.cs" @@ -9,6 +9,9 @@ namespace WIDESEA_Model.Models { + /// <summary> + /// 閲囪喘鍗曟槑缁� + /// </summary> [SugarTable(nameof(Dt_PurchaseOrderDetail), "閲囪喘鍗曟槑缁�"), ModelValidate] public class Dt_PurchaseOrderDetail : BaseEntity { @@ -45,19 +48,19 @@ /// <summary> /// 浠撳簱缂栧彿 /// </summary> - [SugarColumn(IsNullable = false, Length = 50, ColumnName = "WarehouseId", ColumnDescription = "")] + [SugarColumn(IsNullable = false, Length = 50, ColumnName = "WarehouseId", ColumnDescription = "浠撳簱缂栧彿")] public int WarehouseId { get; set; } /// <summary> /// 鏁伴噺 /// </summary> - [SugarColumn(IsNullable = false, ColumnDescription = "")] + [SugarColumn(IsNullable = false, ColumnDescription = "鏁伴噺")] public float PurchaseDetailQuantity { get; set; } /// <summary> /// 鍗曚綅 /// </summary> - [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "")] + [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "鍗曚綅")] public string Unit { get; set; } } } diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Inbound/Dt_ReceiveOrder.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Inbound/Dt_ReceiveOrder.cs" index 0480c18..c48f4f8 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Inbound/Dt_ReceiveOrder.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Inbound/Dt_ReceiveOrder.cs" @@ -10,6 +10,9 @@ namespace WIDESEA_Model.Models { + /// <summary> + /// 鏀惰揣鍗� + /// </summary> [SugarTable(nameof(Dt_ReceiveOrder), "鏀惰揣鍗�")] public class Dt_ReceiveOrder : BaseEntity { @@ -80,6 +83,9 @@ [SugarColumn(IsNullable = true, Length = 500, ColumnDescription = "澶囨敞")] public string Remark { get; set; } + /// <summary> + /// 鏀惰揣鍗曟槑缁� + /// </summary> [Navigate(NavigateType.OneToMany, nameof(Dt_ReceiveOrderDetail.ReceiveOrderId), nameof(ReceiveOrderId))] public List<Dt_ReceiveOrderDetail> Details { get; set; } } diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Inbound/Dt_ReceiveOrderDetail.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Inbound/Dt_ReceiveOrderDetail.cs" index 815a973..36534f9 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Inbound/Dt_ReceiveOrderDetail.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Inbound/Dt_ReceiveOrderDetail.cs" @@ -8,6 +8,9 @@ namespace WIDESEA_Model.Models { + /// <summary> + /// 鏀惰揣鍗曟槑缁� + /// </summary> [SugarTable(nameof(Dt_ReceiveOrderDetail), "鏀惰揣鍗曟槑缁�")] public class Dt_ReceiveOrderDetail : BaseEntity { @@ -29,6 +32,9 @@ [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "閲囪喘鍗曞彿")] public string PurchaseOrderNo { get; set; } + /// <summary> + /// 閲囪喘鍗曟槑缁嗚鍙� + /// </summary> [SugarColumn(IsNullable = false, ColumnDescription = "閲囪喘鍗曟槑缁嗚鍙�")] public int PurchaseOrderDetailRowNo { get; set; } diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Outbound/Dt_OutboundLockInfo.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Outbound/Dt_OutboundLockInfo.cs" index 9009559..19246be 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Outbound/Dt_OutboundLockInfo.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Outbound/Dt_OutboundLockInfo.cs" @@ -9,51 +9,99 @@ namespace WIDESEA_Model.Models { + /// <summary> + /// 鍑哄簱璇︽儏 + /// </summary> [SugarTable(nameof(Dt_OutStockLockInfo), "鍑哄簱璇︽儏")] public class Dt_OutStockLockInfo : BaseEntity { + /// <summary> + /// 涓婚敭 + /// </summary> [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "涓婚敭")] public int Id { get; set; } + /// <summary> + /// 鍗曟嵁缂栧彿 + /// </summary> [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "鍗曟嵁缂栧彿")] public string OrderNo { get; set; } + /// <summary> + /// 鍗曟嵁鏄庣粏涓婚敭 + /// </summary> [SugarColumn(IsNullable = false, ColumnDescription = "鍗曟嵁鏄庣粏涓婚敭")] public int OrderDetailId { get; set; } + /// <summary> + /// 鍗曟嵁绫诲瀷 + /// </summary> [SugarColumn(IsNullable = false, ColumnDescription = "鍗曟嵁绫诲瀷")] public int OrderType { get; set; } + /// <summary> + /// 鎵规鍙� + /// </summary> [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "鎵规鍙�")] public string BatchNo { get; set; } + /// <summary> + /// 鐗╂枡缂栧彿 + /// </summary> [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "鐗╂枡缂栧彿")] public string MaterielCode { get; set; } + /// <summary> + /// 鐗╂枡鍚嶇О + /// </summary> [SugarColumn(IsNullable = true, Length = 200, ColumnDescription = "鐗╂枡鍚嶇О")] public string MaterielName { get; set; } + /// <summary> + /// 搴撳瓨涓婚敭 + /// </summary> [SugarColumn(IsNullable = false, ColumnDescription = "搴撳瓨涓婚敭")] public int StockId { get; set; } + /// <summary> + /// 鍗曟嵁鏁伴噺 + /// </summary> [SugarColumn(IsNullable = false, ColumnDescription = "鍗曟嵁鏁伴噺")] public float OrderQuantity { get; set; } + /// <summary> + /// 鍘熷搴撳瓨閲� + /// </summary> [SugarColumn(IsNullable = false, ColumnDescription = "鍘熷搴撳瓨閲�")] public float OriginalQuantity { get; set; } + /// <summary> + /// 鍒嗛厤鍑哄簱閲� + /// </summary> [SugarColumn(IsNullable = false, ColumnDescription = "鍒嗛厤鍑哄簱閲�")] public float AssignQuantity { get; set; } + /// <summary> + /// 璐т綅缂栧彿 + /// </summary> [SugarColumn(IsNullable = true, Length = 20, ColumnDescription = "璐т綅缂栧彿")] public string LocationCode { get; set; } + /// <summary> + /// 鎵樼洏缂栧彿 + /// </summary> [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "鎵樼洏缂栧彿")] public string PalletCode { get; set; } + /// <summary> + /// 浠诲姟鍙� + /// </summary> [SugarColumn(IsNullable = true, ColumnDescription = "浠诲姟鍙�")] public int? TaskNum { get; set; } + /// <summary> + /// 鐘舵�� + /// </summary> [SugarColumn(IsNullable = false, ColumnDescription = "鐘舵��")] public int Status { get; set; } } diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Outbound/Dt_OutboundOrder.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Outbound/Dt_OutboundOrder.cs" index 831d292..729c762 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Outbound/Dt_OutboundOrder.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Outbound/Dt_OutboundOrder.cs" @@ -10,34 +10,64 @@ namespace WIDESEA_Model.Models { + /// <summary> + /// 鍑哄簱鍗� + /// </summary> [SugarTable(nameof(Dt_OutboundOrder), "鍑哄簱鍗�")] public class Dt_OutboundOrder : BaseEntity { + /// <summary> + /// 涓婚敭 + /// </summary> [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "涓婚敭")] public int Id { get; set; } + /// <summary> + /// 浠撳簱涓婚敭 + /// </summary> + [SugarColumn(IsNullable = false, ColumnDescription = "浠撳簱涓婚敭")] + public int WarehouseId { get; set; } + + /// <summary> + /// 鍗曟嵁缂栧彿 + /// </summary> [CodeRule(RuleCodeEnum.OutboundOrderRule)] [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "鍗曟嵁缂栧彿", IsOnlyIgnoreUpdate = true)] public string OrderNo { get; set; } + /// <summary> + /// 涓婃父鍗曟嵁缂栧彿 + /// </summary> [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "涓婃父鍗曟嵁缂栧彿", IsOnlyIgnoreUpdate = true)] public string UpperOrderNo { get; set; } + /// <summary> + /// 鍗曟嵁绫诲瀷 + /// </summary> [SugarColumn(IsNullable = false, ColumnDescription = "鍗曟嵁绫诲瀷", IsOnlyIgnoreUpdate = true)] public int OrderType { get; set; } + /// <summary> + /// 鍗曟嵁鐘舵�� + /// </summary> [SugarColumn(IsNullable = false, ColumnDescription = "鍗曟嵁鐘舵��")] public int OrderStatus { get; set; } + /// <summary> + /// 鍒涘缓鏂瑰紡 + /// </summary> [SugarColumn(IsNullable = false, ColumnDescription = "鍒涘缓鏂瑰紡", IsOnlyIgnoreUpdate = true)] public int CreateType { get; set; } - [SugarColumn(IsNullable = false, ColumnDescription = "浠撳簱涓婚敭")] - public int WarehouseId { get; set; } - + /// <summary> + /// 澶囨敞 + /// </summary> [SugarColumn(IsNullable = true, Length = 200, ColumnDescription = "澶囨敞")] public string Remark { get; set; } + /// <summary> + /// 鍑哄簱鍗曟槑缁� + /// </summary> [Navigate(NavigateType.OneToMany, nameof(Dt_OutboundOrderDetail.OrderId), nameof(Id))] public List<Dt_OutboundOrderDetail> Details { get; set; } } diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Outbound/Dt_OutboundOrderDetail.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Outbound/Dt_OutboundOrderDetail.cs" index e1433c0..8eb716d 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Outbound/Dt_OutboundOrderDetail.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Outbound/Dt_OutboundOrderDetail.cs" @@ -8,39 +8,75 @@ namespace WIDESEA_Model.Models { + /// <summary> + /// 鍑哄簱鍗曟槑缁� + /// </summary> [SugarTable(nameof(Dt_OutboundOrderDetail), "鍑哄簱鍗曟槑缁�")] public class Dt_OutboundOrderDetail : BaseEntity { + /// <summary> + /// 涓婚敭 + /// </summary> [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "涓婚敭")] public int Id { get; set; } + /// <summary> + /// 鍑哄簱鍗曚富閿� + /// </summary> [SugarColumn(IsNullable = false, ColumnDescription = "鍑哄簱鍗曚富閿�")] public int OrderId { get; set; } + /// <summary> + /// 鐗╂枡缂栧彿 + /// </summary> [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "鐗╂枡缂栧彿")] public string MaterielCode { get; set; } + /// <summary> + /// 鐗╂枡鍚嶇О + /// </summary> [SugarColumn(IsNullable = true, Length = 200, ColumnDescription = "鐗╂枡鍚嶇О")] public string MaterielName { get; set; } + /// <summary> + /// 鎵规鍙� + /// </summary> [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "鎵规鍙�")] public string BatchNo { get; set; } + /// <summary> + /// 琛屽彿 + /// </summary> [SugarColumn(IsNullable = false, ColumnDescription = "琛屽彿")] public int RowNo { get; set; } + /// <summary> + /// 鍗曟嵁鏁伴噺 + /// </summary> [SugarColumn(IsNullable = false, ColumnDescription = "鍗曟嵁鏁伴噺")] public float OrderQuantity { get; set; } + /// <summary> + /// 閿佸畾鏁伴噺 + /// </summary> [SugarColumn(IsNullable = false, ColumnDescription = "閿佸畾鏁伴噺", DefaultValue = "0")] public float LockQuantity { get; set; } + /// <summary> + /// 宸插嚭鏁伴噺 + /// </summary> [SugarColumn(IsNullable = false, ColumnDescription = "宸插嚭鏁伴噺", DefaultValue = "0")] public float OverOutQuantity { get; set; } + /// <summary> + /// 璁㈠崟鏄庣粏鐘舵�� + /// </summary> [SugarColumn(IsNullable = false, ColumnDescription = "璁㈠崟鏄庣粏鐘舵��")] public int OrderDetailStatus { get; set; } + /// <summary> + /// 澶囨敞 + /// </summary> [SugarColumn(IsNullable = true, ColumnDescription = "澶囨敞")] public string Remark { get; set; } } diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Outbound/Dt_OutboundOrderDetail_Hty.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Outbound/Dt_OutboundOrderDetail_Hty.cs" index 3ab06c6..996da79 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Outbound/Dt_OutboundOrderDetail_Hty.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Outbound/Dt_OutboundOrderDetail_Hty.cs" @@ -9,41 +9,81 @@ namespace WIDESEA_Model.Models { + /// <summary> + /// + /// </summary> [SugarTable(nameof(Dt_OutboundOrderDetail_Hty), "鍑哄簱鍗曟槑缁�")] - public class Dt_OutboundOrderDetail_Hty + public class Dt_OutboundOrderDetail_Hty { + /// <summary> + /// + /// </summary> [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "涓婚敭")] public int Id { get; set; } + /// <summary> + /// + /// </summary> [SugarColumn(IsNullable = false, ColumnDescription = "鍑哄簱鍗曚富閿�")] public int OrderId { get; set; } + /// <summary> + /// + /// </summary> [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "鐗╂枡缂栧彿")] public string MaterielCode { get; set; } + /// <summary> + /// + /// </summary> [SugarColumn(IsNullable = true, Length = 200, ColumnDescription = "鐗╂枡鍚嶇О")] public string MaterielName { get; set; } + /// <summary> + /// + /// </summary> [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "鎵规鍙�")] public string BatchNo { get; set; } + /// <summary> + /// + /// </summary> [SugarColumn(IsNullable = false, DecimalDigits = 2, ColumnDescription = "鍗曟嵁鏁伴噺")] public decimal OrderQuantity { get; set; } + /// <summary> + /// + /// </summary> [SugarColumn(IsNullable = false, DecimalDigits = 2, ColumnDescription = "閿佸畾鏁伴噺", DefaultValue = "0")] public decimal LockQuantity { get; set; } + /// <summary> + /// + /// </summary> [SugarColumn(IsNullable = false, DecimalDigits = 2, ColumnDescription = "宸插嚭鏁伴噺", DefaultValue = "0")] public decimal OverOutQuantity { get; set; } + /// <summary> + /// + /// </summary> [SugarColumn(IsNullable = false, ColumnDescription = "璁㈠崟鏄庣粏鐘舵��")] public int OrderDetailStatus { get; set; } + /// <summary> + /// + /// </summary> [SugarColumn(IsNullable = true, ColumnDescription = "澶囨敞")] public string Remark { get; set; } + + /// <summary> + /// + /// </summary> [SugarColumn(IsNullable = false, DefaultValue = "0", ColumnDescription = "婧愪富閿�")] public int SourceId { get; set; } + /// <summary> + /// + /// </summary> [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "澶囨敞")] public string OperateType { get; set; } /// <summary> diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Record/Dt_LocationStatusChangeRecord.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Record/Dt_LocationStatusChangeRecord.cs" index 6e040ac..7986d6c 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Record/Dt_LocationStatusChangeRecord.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Record/Dt_LocationStatusChangeRecord.cs" @@ -8,36 +8,69 @@ namespace WIDESEA_Model.Models { - [SugarTable(nameof(Dt_LocationStatusChangeRecord),"璐т綅鐘舵�佸彉鍔ㄨ褰�")] + /// <summary> + /// 璐т綅鐘舵�佸彉鍔ㄨ褰� + /// </summary> + [SugarTable(nameof(Dt_LocationStatusChangeRecord), "璐т綅鐘舵�佸彉鍔ㄨ褰�")] public class Dt_LocationStatusChangeRecord : BaseEntity { + /// <summary> + /// 涓婚敭 + /// </summary> [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "涓婚敭")] public int Id { get; set; } + /// <summary> + /// 璐т綅涓婚敭 + /// </summary> [SugarColumn(IsNullable = false, ColumnDescription = "璐т綅涓婚敭")] - public int LocationId { get; set; } + public int LocationId { get; set; } + /// <summary> + /// 璐т綅缂栧彿 + /// </summary> [SugarColumn(IsNullable = true, Length = 20, ColumnDescription = "璐т綅缂栧彿")] - public string LocationCode { get; set; } + public string LocationCode { get; set; } + /// <summary> + /// 鍙樺姩鍓嶈揣浣嶇姸鎬� + /// </summary> [SugarColumn(IsNullable = false, ColumnDescription = "鍙樺姩鍓嶈揣浣嶇姸鎬�")] - public int BeforeStatus { get; set; } + public int BeforeStatus { get; set; } + /// <summary> + /// 鍙樺姩鍚庤揣浣嶇姸鎬� + /// </summary> [SugarColumn(IsNullable = false, ColumnDescription = "鍙樺姩鍚庤揣浣嶇姸鎬�")] public int AfterStatus { get; set; } + /// <summary> + /// 鍙樺姩绫诲瀷锛堝嚭搴撱�佸叆搴撱�佹墜鍔ㄨ皟鏁�...锛� + /// </summary> [SugarColumn(IsNullable = false, ColumnDescription = "鍙樺姩绫诲瀷锛堝嚭搴撱�佸叆搴撱�佹墜鍔ㄨ皟鏁�...锛�")] - public int ChangeType { get; set; } + public int ChangeType { get; set; } + /// <summary> + /// 鍗曟嵁涓婚敭 + /// </summary> [SugarColumn(IsNullable = true, ColumnDescription = "鍗曟嵁涓婚敭")] public int? OrderId { get; set; } + /// <summary> + /// 鍗曟嵁缂栧彿 + /// </summary> [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "鍗曟嵁缂栧彿")] - public string OrderNo { get; set; } + public string OrderNo { get; set; } + /// <summary> + /// 浠诲姟鍙� + /// </summary> [SugarColumn(IsNullable = true, ColumnDescription = "浠诲姟鍙�")] public int? TaskNum { get; set; } + /// <summary> + /// 澶囨敞 + /// </summary> [SugarColumn(IsNullable = true, ColumnDescription = "澶囨敞")] public string Remark { get; set; } } diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Record/Dt_StockQuantityChangeRecord.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Record/Dt_StockQuantityChangeRecord.cs" index 616bcf5..e6b74e1 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Record/Dt_StockQuantityChangeRecord.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Record/Dt_StockQuantityChangeRecord.cs" @@ -8,48 +8,93 @@ namespace WIDESEA_Model.Models { + /// <summary> + /// 搴撳瓨鍙樺姩淇℃伅璁板綍 + /// </summary> [SugarTable(nameof(Dt_StockQuantityChangeRecord), "搴撳瓨鍙樺姩淇℃伅璁板綍")] public class Dt_StockQuantityChangeRecord : BaseEntity { + /// <summary> + /// 涓婚敭 + /// </summary> [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "涓婚敭")] public int Id { get; set; } + /// <summary> + /// 搴撳瓨鏄庣粏涓婚敭 + /// </summary> [SugarColumn(IsNullable = false, ColumnDescription = "搴撳瓨鏄庣粏涓婚敭")] public int StockDetailId { get; set; } + /// <summary> + /// 鎵樼洏缂栧彿 + /// </summary> [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "鎵樼洏缂栧彿")] public string PalleCode { get; set; } + /// <summary> + /// 鐗╂枡缂栧彿 + /// </summary> [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "鐗╂枡缂栧彿")] public string MaterielCode { get; set; } + /// <summary> + /// 鐗╂枡鍚嶇О + /// </summary> [SugarColumn(IsNullable = false, Length = 200, ColumnDescription = "鐗╂枡鍚嶇О")] public string MaterielName { get; set; } + /// <summary> + /// 鎵规鍙� + /// </summary> [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "鎵规鍙�")] public string BatchNo { get; set; } + /// <summary> + /// 搴忓垪鍙� + /// </summary> [SugarColumn(IsNullable = false, Length = 100, ColumnDescription = "搴忓垪鍙�")] public string SerilNumber { get; set; } + /// <summary> + /// 鍗曟嵁缂栧彿 + /// </summary> [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "鍗曟嵁缂栧彿")] public string OrderNo { get; set; } + /// <summary> + /// 浠诲姟鍙� + /// </summary> [SugarColumn(IsNullable = true, ColumnDescription = "浠诲姟鍙�")] public int? TaskNum { get; set; } + /// <summary> + /// 鍙樺姩绫诲瀷锛堝嚭搴撱�佸叆搴撱�佹墜鍔ㄨ皟鏁�...锛� + /// </summary> [SugarColumn(IsNullable = false, ColumnDescription = "鍙樺姩绫诲瀷锛堝嚭搴撱�佸叆搴撱�佹墜鍔ㄨ皟鏁�...锛�")] public int ChangeType { get; set; } + /// <summary> + /// 鍙樺姩鏁伴噺锛堟鏁拌〃绀哄鍔狅紝璐熸暟琛ㄧず鍑忓皯锛� + /// </summary> [SugarColumn(IsNullable = false, ColumnDescription = "鍙樺姩鏁伴噺锛堟鏁拌〃绀哄鍔狅紝璐熸暟琛ㄧず鍑忓皯锛�")] public float ChangeQuantity { get; set; } + /// <summary> + /// 鍙樺姩鍓嶅簱瀛橀噺 + /// </summary> [SugarColumn(IsNullable = false, ColumnDescription = "鍙樺姩鍓嶅簱瀛橀噺", DefaultValue = "0")] public float BeforeQuantity { get; set; } + /// <summary> + /// 鍙樺姩鍚庡簱瀛橀噺 + /// </summary> [SugarColumn(IsNullable = false, ColumnDescription = "鍙樺姩鍚庡簱瀛橀噺", DefaultValue = "0")] public float AfterQuantity { get; set; } + /// <summary> + /// 澶囨敞 + /// </summary> [SugarColumn(IsNullable = true, ColumnDescription = "澶囨敞")] public string Remark { get; set; } } diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Stock/Dt_StockInfo.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Stock/Dt_StockInfo.cs" index 07b7820..ffb04d0 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Stock/Dt_StockInfo.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Stock/Dt_StockInfo.cs" @@ -8,30 +8,57 @@ namespace WIDESEA_Model.Models { + /// <summary> + /// 搴撳瓨淇℃伅 + /// </summary> [SugarTable(nameof(Dt_StockInfo), "搴撳瓨淇℃伅")] public class Dt_StockInfo : BaseEntity { + /// <summary> + /// 涓婚敭 + /// </summary> [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "涓婚敭")] public int Id { get; set; } + /// <summary> + /// 鎵樼洏缂栧彿 + /// </summary> [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "鎵樼洏缂栧彿")] public string PalletCode { get; set; } + /// <summary> + /// 鎵樼洏绫诲瀷 + /// </summary> + [SugarColumn(IsNullable = false, ColumnDescription = "鎵樼洏绫诲瀷")] + public int PalletType { get; set; } + + /// <summary> + /// 璐т綅缂栧彿 + /// </summary> [SugarColumn(IsNullable = true, Length = 20, ColumnDescription = "璐т綅缂栧彿")] public string LocationCode { get; set; } - [SugarColumn(IsNullable = false, ColumnDescription = "")] + /// <summary> + /// 浠撳簱涓婚敭 + /// </summary> + [SugarColumn(IsNullable = false, ColumnDescription = "浠撳簱涓婚敭")] public int WarehouseId { get; set; } + /// <summary> + /// 搴撳瓨鐘舵�� + /// </summary> [SugarColumn(IsNullable = false, ColumnDescription = "搴撳瓨鐘舵��")] public int StockStatus { get; set; } + /// <summary> + /// 澶囨敞 + /// </summary> [SugarColumn(IsNullable = true, ColumnDescription = "澶囨敞")] public string Remark { get; set; } - [SugarColumn(IsNullable = false, ColumnDescription = "")] - public int PalletType { get; set; } - + /// <summary> + /// 搴撳瓨鏄庣粏 + /// </summary> [Navigate(NavigateType.OneToMany, nameof(Dt_StockInfoDetail.StockId), nameof(Id))] public List<Dt_StockInfoDetail> Details { get; set; } } diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Stock/Dt_StockInfoDetail.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Stock/Dt_StockInfoDetail.cs" index e5cc910..8ba0114 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Stock/Dt_StockInfoDetail.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Stock/Dt_StockInfoDetail.cs" @@ -8,48 +8,93 @@ namespace WIDESEA_Model.Models { + /// <summary> + /// + /// </summary> [SugarTable(nameof(Dt_StockInfoDetail), "搴撳瓨淇℃伅鏄庣粏")] public class Dt_StockInfoDetail : BaseEntity { + /// <summary> + /// + /// </summary> [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "涓婚敭")] public int Id { get; set; } + /// <summary> + /// 搴撳瓨淇℃伅涓婚敭 + /// </summary> [SugarColumn(IsNullable = false, ColumnDescription = "搴撳瓨淇℃伅涓婚敭")] public int StockId { get; set; } + /// <summary> + /// 鐗╂枡缂栧彿 + /// </summary> [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "鐗╂枡缂栧彿")] public string MaterielCode { get; set; } + /// <summary> + /// 鐗╂枡鍚嶇О + /// </summary> [SugarColumn(IsNullable = false, Length = 200, ColumnDescription = "鐗╂枡鍚嶇О")] public string MaterielName { get; set; } + /// <summary> + /// 鍗曟嵁缂栧彿 + /// </summary> [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "鍗曟嵁缂栧彿")] public string OrderNo { get; set; } + /// <summary> + /// 鎵规鍙� + /// </summary> [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "鎵规鍙�")] public string BatchNo { get; set; } + /// <summary> + /// 鐢熶骇鏃ユ湡 + /// </summary> [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "鐢熶骇鏃ユ湡")] public string ProductionDate { get; set; } + /// <summary> + /// 鏈夋晥鏈� + /// </summary> [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "鏈夋晥鏈�")] public string EffectiveDate { get; set; } + /// <summary> + /// 搴忓垪鍙� + /// </summary> [SugarColumn(IsNullable = false, Length = 100, ColumnDescription = "搴忓垪鍙�")] public string SerialNumber { get; set; } + /// <summary> + /// 搴撳瓨鏁伴噺 + /// </summary> [SugarColumn(IsNullable = false, ColumnDescription = "搴撳瓨鏁伴噺")] public float StockQuantity { get; set; } + /// <summary> + /// 鍑哄簱鏁伴噺 + /// </summary> [SugarColumn(IsNullable = false, ColumnDescription = "鍑哄簱鏁伴噺", DefaultValue = "0")] public float OutboundQuantity { get; set; } + /// <summary> + /// 搴撳瓨鏄庣粏鐘舵�� + /// </summary> [SugarColumn(IsNullable = false, ColumnDescription = "搴撳瓨鏄庣粏鐘舵��")] public int Status { get; set; } + /// <summary> + /// 鍏ュ簱鍗曟槑缁嗚鍙� + /// </summary> [SugarColumn(IsNullable = false, ColumnDescription = "鍏ュ簱鍗曟槑缁嗚鍙�")] public int InboundOrderRowNo { get; set; } + /// <summary> + /// 澶囨敞 + /// </summary> [SugarColumn(IsNullable = true, ColumnDescription = "澶囨敞")] public string Remark { get; set; } } diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/TaskInfo/Dt_Task.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/TaskInfo/Dt_Task.cs" index 8ea64db..ab7a584 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/TaskInfo/Dt_Task.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/TaskInfo/Dt_Task.cs" @@ -11,6 +11,9 @@ namespace WIDESEA_Model.Models { + /// <summary> + /// 浠诲姟淇℃伅 + /// </summary> [SugarTable(nameof(Dt_Task), "浠诲姟淇℃伅"), SugarIndex("unique_task_taskNum", nameof(TaskNum), OrderByType.Asc, true)] public class Dt_Task : BaseEntity { @@ -39,6 +42,12 @@ public string PalletCode { get; set; } /// <summary> + /// 鎵樼洏绫诲瀷 + /// </summary> + [SugarColumn(IsNullable = false, ColumnDescription = "鎵樼洏绫诲瀷")] + public int PalletType { get; set; } + + /// <summary> /// 宸烽亾鍙� /// </summary> [ImporterHeader(Name = "宸烽亾鍙�")] diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/OutboundOrderDetailService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/OutboundOrderDetailService.cs" index 330d4d8..26e345a 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/OutboundOrderDetailService.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/OutboundOrderDetailService.cs" @@ -48,11 +48,22 @@ _recordService = recordService; } + /// <summary> + /// 閿佸畾搴撳瓨锛岀敱绯荤粺鍒嗛厤(浠呴�昏緫杩愮畻锛屼笉鐢熸垚浠诲姟锛屼笉淇敼鏁版嵁搴撴暟鎹�) + /// </summary> + /// <param name="orderDetailId"></param> + /// <returns></returns> public WebResponseContent LockOutboundStock(int orderDetailId) { Dt_OutboundOrderDetail outboundOrderDetail = BaseDal.QueryFirst(x => x.Id == orderDetailId); - (bool, string) result = CheckDeital(outboundOrderDetail); - if (!result.Item1) return WebResponseContent.Instance.Error(result.Item2); + if (outboundOrderDetail == null) + { + return WebResponseContent.Instance.Error("鏈壘鍒板嚭搴撳崟鏄庣粏淇℃伅"); + } + if (outboundOrderDetail.OrderDetailStatus != OrderDetailStatusEnum.New.ObjToInt()) + { + return WebResponseContent.Instance.Error("璇ユ槑缁嗕笉鍙搷浣�"); + } Dt_OutboundOrder outboundOrder = _outboundRepository.OutboundOrderRepository.QueryFirst(x => x.Id == outboundOrderDetail.OrderId); float needQuantity = outboundOrderDetail.OrderQuantity - outboundOrderDetail.LockQuantity; @@ -137,19 +148,13 @@ } } - private (bool, string) CheckDeital(Dt_OutboundOrderDetail outboundOrderDetail) - { - if (outboundOrderDetail == null) - { - return (false, "鏈壘鍒板嚭搴撳崟鏄庣粏淇℃伅"); - } - if (outboundOrderDetail.OrderDetailStatus != OrderDetailStatusEnum.New.ObjToInt()) - { - return (false, "璇ユ槑缁嗕笉鍙搷浣�"); - } - return (true, "鎴愬姛"); - } - + /// <summary> + /// + /// </summary> + /// <param name="outboundOrderDetail"></param> + /// <param name="stockSelectViews"></param> + /// <returns></returns> + /// <exception cref="Exception"></exception> public (List<Dt_StockInfo>, Dt_OutboundOrderDetail, List<Dt_OutStockLockInfo>, List<Dt_LocationInfo>) AssignStockOutbound(Dt_OutboundOrderDetail outboundOrderDetail, List<StockSelectViewDTO> stockSelectViews) { (bool, string) checkResult = CheckSelectStockDeital(outboundOrderDetail, stockSelectViews); @@ -200,6 +205,12 @@ return (outStocks, outboundOrderDetail, outStockLockInfos, locationInfos); } + /// <summary> + /// 閿佸畾搴撳瓨锛岀敱浜哄伐鎸囧畾锛屾垨鍔犱笂绯荤粺鍒嗛厤(鍖呭惈閫昏緫杩愮畻锛屼笖淇敼鏁版嵁搴撴暟鎹�) + /// </summary> + /// <param name="orderDetailId"></param> + /// <param name="stockSelectViews"></param> + /// <returns></returns> public WebResponseContent LockOutboundStock(int orderDetailId, List<StockSelectViewDTO> stockSelectViews) { try @@ -229,6 +240,12 @@ } } + /// <summary> + /// 閿佸畾搴撳瓨锛岀敱绯荤粺鍒嗛厤(鍖呭惈閫昏緫杩愮畻锛屼笖淇敼鏁版嵁搴撴暟鎹�) + /// </summary> + /// <param name="orderDetailId"></param> + /// <param name="stockSelectViews"></param> + /// <returns></returns> public WebResponseContent LockOutboundStock(int[] keys) { try @@ -273,6 +290,16 @@ } } + /// <summary> + /// 鍑哄簱搴撳瓨鍒嗛厤鍚庯紝鏇存柊鏁版嵁搴撴暟鎹� + /// </summary> + /// <param name="stockInfos"></param> + /// <param name="outboundOrderDetails"></param> + /// <param name="outStockLockInfos"></param> + /// <param name="locationInfos"></param> + /// <param name="locationStatus"></param> + /// <param name="tasks"></param> + /// <returns></returns> public WebResponseContent LockOutboundStockDataUpdate(List<Dt_StockInfo> stockInfos, List<Dt_OutboundOrderDetail> outboundOrderDetails, List<Dt_OutStockLockInfo> outStockLockInfos, List<Dt_LocationInfo> locationInfos, LocationStatusEnum locationStatus = LocationStatusEnum.Lock, List<Dt_Task>? tasks = null) { try @@ -324,6 +351,11 @@ return (true, "鎴愬姛"); } + /// <summary> + /// 鎾ら攢閿佸畾搴撳瓨 + /// </summary> + /// <param name="orderDetailId"></param> + /// <returns></returns> public WebResponseContent RevokeLockOutboundStock(int orderDetailId) { Dt_OutboundOrderDetail outboundOrderDetail = BaseDal.QueryFirst(x => x.Id == orderDetailId); 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 2dbdad0..de0c465 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" @@ -94,12 +94,5 @@ { return Db.UpdateNav(stockInfo).Include(x => x.Details).ExecuteCommand(); } - - public Dt_StockInfo GetPalletStockInfo(string roadwayNo) - { - //ISugarQueryable<string> locationCodes = Db.Queryable<Dt_LocationInfo>().Where(x => x.RoadwayNo == roadwayNo && x.LocationStatus == LocationStatusEnum.Pallet.ObjToInt() && (x.EnalbeStatus == LocationEnalbeStatusEnum.OnlyOut.ObjToInt() || LocationEnalbeStatusEnum.Normal.ObjToInt() == x.EnalbeStatus)).Select(x => x.LocationCode); - - return Db.Queryable<Dt_StockInfo>().Where(x => x.StockStatus == StockStatusEmun.宸插叆搴�.ObjToInt() && SqlFunc.Subqueryable<Dt_LocationInfo>().Where(v => v.LocationCode == x.LocationCode && v.RoadwayNo == roadwayNo && v.LocationStatus == LocationStatusEnum.Pallet.ObjToInt() && (v.EnableStatus == EnableStatusEnum.OnlyOut.ObjToInt() || EnableStatusEnum.Normal.ObjToInt() == v.EnableStatus)).Any()).OrderBy(x => x.ModifyDate).First(); - } } } diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_SystemService/Sys_DictionaryService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_SystemService/Sys_DictionaryService.cs" index f6f1027..be7f5d1 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_SystemService/Sys_DictionaryService.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_SystemService/Sys_DictionaryService.cs" @@ -442,25 +442,25 @@ { List<object> data = new List<object>(); - { - Type type = typeof(TaskTypeEnum); - List<int> enums = Enum.GetValues(typeof(TaskTypeEnum)).Cast<int>().ToList(); - int index = 0; - foreach (var item in enums) - { - FieldInfo? fieldInfo = typeof(TaskTypeEnum).GetField(((TaskTypeEnum)item).ToString()); - DescriptionAttribute? description = fieldInfo.GetCustomAttribute<DescriptionAttribute>(); - if (description != null) - { - data.Add(new { key = item.ToString(), value = description.Description }); - } - else - { - data.Add(new { key = item.ToString(), value = item.ToString() }); - } - index++; - } - } + //{ + // Type type = typeof(TaskTypeEnum); + // List<int> enums = Enum.GetValues(typeof(TaskTypeEnum)).Cast<int>().ToList(); + // int index = 0; + // foreach (var item in enums) + // { + // FieldInfo? fieldInfo = typeof(TaskTypeEnum).GetField(((TaskTypeEnum)item).ToString()); + // DescriptionAttribute? description = fieldInfo.GetCustomAttribute<DescriptionAttribute>(); + // if (description != null) + // { + // data.Add(new { key = item.ToString(), value = description.Description }); + // } + // else + // { + // data.Add(new { key = item.ToString(), value = item.ToString() }); + // } + // index++; + // } + //} result = new VueDictionaryDTO { DicNo = key, Config = "", Data = data }; } @@ -470,12 +470,12 @@ List<object> data = new List<object>(); { - Type type = typeof(InTaskStatusEnum); - List<int> enums = Enum.GetValues(typeof(InTaskStatusEnum)).Cast<int>().ToList(); + Type type = typeof(TaskInStatusEnum); + List<int> enums = Enum.GetValues(typeof(TaskInStatusEnum)).Cast<int>().ToList(); int index = 0; foreach (var item in enums) { - FieldInfo? fieldInfo = typeof(InTaskStatusEnum).GetField(((InTaskStatusEnum)item).ToString()); + FieldInfo? fieldInfo = typeof(TaskInStatusEnum).GetField(((TaskInStatusEnum)item).ToString()); DescriptionAttribute? description = fieldInfo.GetCustomAttribute<DescriptionAttribute>(); if (description != null) { @@ -490,12 +490,12 @@ } { - Type type = typeof(OutTaskStatusEnum); - List<int> enums = Enum.GetValues(typeof(OutTaskStatusEnum)).Cast<int>().ToList(); + Type type = typeof(TaskOutStatusEnum); + List<int> enums = Enum.GetValues(typeof(TaskOutStatusEnum)).Cast<int>().ToList(); int index = 0; foreach (var item in enums) { - FieldInfo? fieldInfo = typeof(OutTaskStatusEnum).GetField(((OutTaskStatusEnum)item).ToString()); + FieldInfo? fieldInfo = typeof(TaskOutStatusEnum).GetField(((TaskOutStatusEnum)item).ToString()); DescriptionAttribute? description = fieldInfo.GetCustomAttribute<DescriptionAttribute>(); if (description != null) { 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 ba3138c..73909ec 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" @@ -16,21 +16,8 @@ #endregion << 鐗� 鏈� 娉� 閲� >> using AutoMapper; -using HslCommunication.WebSocket; -using MailKit.Search; using Newtonsoft.Json; -using OfficeOpenXml.FormulaParsing.Excel.Functions.Text; using SqlSugar; -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq; -using System.Linq.Expressions; -using System.Net.Http.Headers; -using System.Reflection; -using System.Reflection.Metadata; -using System.Text; using System.Threading.Tasks; using WIDESEA_Common.CommonEnum; using WIDESEA_Common.LocationEnum; @@ -43,6 +30,7 @@ using WIDESEA_Core.Helper; using WIDESEA_DTO.Inbound; using WIDESEA_DTO.Stock; +using WIDESEA_DTO.Task; using WIDESEA_IBasicRepository; using WIDESEA_IBasicService; using WIDESEA_IInboundService; @@ -65,18 +53,60 @@ private readonly IStockRepository _stockRepository; private readonly IBasicService _basicService; private readonly IRecordService _recordService; + private readonly IOutboundService _outboundService; + private readonly IStockService _stockService; public ITaskRepository Repository => BaseDal; - public TaskService(ITaskRepository BaseDal, IMapper mapper, IUnitOfWorkManage unitOfWorkManage, IStockRepository stockRepository, IBasicService basicService, IRecordService recordService) : base(BaseDal) + private Dictionary<string, OrderByType> _taskOrderBy = new() + { + {nameof(Dt_Task.Grade),OrderByType.Desc }, + {nameof(Dt_Task.CreateDate),OrderByType.Asc}, + }; + + public List<int> TaskInboundTypes => typeof(TaskInboundTypeEnum).GetEnumIndexList(); + + public List<int> TaskOutboundTypes => typeof(TaskOutboundTypeEnum).GetEnumIndexList(); + + public TaskService(ITaskRepository BaseDal, IMapper mapper, IUnitOfWorkManage unitOfWorkManage, IStockRepository stockRepository, IBasicService basicService, IRecordService recordService, IOutboundService outboundService, IStockService stockService) : base(BaseDal) { _mapper = mapper; _unitOfWorkManage = unitOfWorkManage; _stockRepository = stockRepository; _basicService = basicService; _recordService = recordService; + _outboundService = outboundService; + _stockService = stockService; } + /// <summary> + /// 浠诲姟淇℃伅鎺ㄩ�佽嚦WCS + /// </summary> + /// <returns></returns> + public WebResponseContent PushTasksToWCS() + { + try + { + List<Dt_Task> tasks = BaseDal.QueryData(x => (TaskInboundTypes.Contains(x.TaskType) && x.TaskStatus == (int)TaskInStatusEnum.InNew || TaskOutboundTypes.Contains(x.TaskType) && x.TaskStatus == (int)TaskOutStatusEnum.OutNew)); + + List<WMSTaskDTO> taskDTOs = _mapper.Map<List<WMSTaskDTO>>(tasks); + + string response = HttpHelper.Post("http://127.0.0.1:9291/api/Task/ReceiveTask", taskDTOs.Serialize()); + + return JsonConvert.DeserializeObject<WebResponseContent>(response) ?? WebResponseContent.Instance.Error("杩斿洖閿欒"); + } + catch (Exception ex) + { + return WebResponseContent.Instance.Error(ex.Message); + } + } + + /// <summary> + /// 鐢宠鍏ュ簱浠诲姟(PDA浣跨敤锛屼粎鎵樼洏缁戝畾鍏ュ簱绔欏彴锛屼笉鍒嗛厤璐т綅) + /// </summary> + /// <param name="palletCode">鎵樼洏鍙�</param> + /// <param name="stationCode">绔欏彴鍙�</param> + /// <returns></returns> public WebResponseContent RequestInboundTask(string palletCode, string stationCode) { try @@ -85,6 +115,11 @@ if (task != null) { return WebResponseContent.Instance.Error($"璇ユ墭鐩樺凡鐢熸垚浠诲姟"); + } + + if (Repository.QueryFirst(x => x.SourceAddress == stationCode && x.TaskStatus == TaskInStatusEnum.InNew.ObjToInt()) != null) + { + return WebResponseContent.Instance.Error($"璇ョ珯鐐瑰凡鏈夋湭鎵ц鐨勪换鍔�"); } Dt_StockInfo stockInfo = _stockRepository.StockInfoRepository.QueryFirst(x => x.PalletCode == palletCode); @@ -101,38 +136,24 @@ return WebResponseContent.Instance.Error($"璇ユ墭鐩樺凡缁戝畾璐т綅"); } - //todo 閫氳繃绔欏彴鍙锋壘宸烽亾鍙� - string roadwayNo = "RSC01"; - - PalletTypeEnum palletType = PalletTypeEnum.SmallPallet; - - Dt_LocationInfo? locationInfo = _basicService.LocationInfoService.AssignLocation(roadwayNo, palletType); - if (locationInfo == null) - { - return WebResponseContent.Instance.Error($"璐т綅鍒嗛厤澶辫触,鏈壘鍒板彲鍒嗛厤璐т綅"); - } Dt_Task newTask = new Dt_Task() { CurrentAddress = stationCode, Grade = 0, NextAddress = "", PalletCode = palletCode, - Roadway = roadwayNo, + Roadway = "", SourceAddress = stationCode, - TargetAddress = locationInfo.LocationCode, - TaskType = TaskTypeEnum.Inbound.ObjToInt(), - TaskStatus = InTaskStatusEnum.InNew.ObjToInt(), + TargetAddress = "", + TaskType = TaskInboundTypeEnum.Inbound.ObjToInt(), + TaskStatus = TaskInStatusEnum.SC_InExecute.ObjToInt(), }; - - LocationStatusEnum lastStatus = (LocationStatusEnum)locationInfo.LocationStatus; stockInfo.StockStatus = StockStatusEmun.鍏ュ簱纭.ObjToInt(); _unitOfWorkManage.BeginTran(); int taskId = BaseDal.AddData(newTask); newTask.TaskId = taskId; - _recordService.LocationStatusChangeRecordSetvice.AddLocationStatusChangeRecord(locationInfo, lastStatus, LocationChangeType.InboundAssignLocation); - _basicService.LocationInfoService.UpdateLocationStatus(locationInfo, palletType, LocationStatusEnum.Lock); _stockRepository.StockInfoRepository.UpdateData(stockInfo); _unitOfWorkManage.CommitTran(); @@ -145,6 +166,54 @@ } } + /// <summary> + /// 鍏ュ簱浠诲姟鐢宠鍒嗛厤璐т綅 + /// </summary> + /// <param name="taskNum">浠诲姟鍙�</param> + /// <param name="roadwayNo">宸烽亾鍙�</param> + /// <param name="palletType">鎵樼洏绫诲瀷</param> + /// <returns></returns> + public WebResponseContent AssignInboundTaskLocation(int taskNum, string roadwayNo) + { + try + { + Dt_Task task = BaseDal.QueryFirst(x => x.TaskNum == taskNum); + if (task == null) + { + return WebResponseContent.Instance.Error($"鏈壘鍒拌鍏ュ簱浠诲姟"); + } + + Dt_LocationInfo? locationInfo = _basicService.LocationInfoService.AssignLocation(roadwayNo, (PalletTypeEnum)task.PalletType, task.WarehouseId); + if (locationInfo == null) + { + return WebResponseContent.Instance.Error($"璐т綅鍒嗛厤澶辫触,鏈壘鍒板彲鍒嗛厤璐т綅"); + } + + task.Roadway = roadwayNo; + task.TargetAddress = locationInfo.LocationCode; + task.TaskStatus = TaskInStatusEnum.SC_InExecute.ObjToInt(); + + LocationStatusEnum lastStatus = (LocationStatusEnum)locationInfo.LocationStatus; + + _unitOfWorkManage.BeginTran(); + _recordService.LocationStatusChangeRecordSetvice.AddLocationStatusChangeRecord(locationInfo, lastStatus, LocationChangeType.InboundAssignLocation); + _basicService.LocationInfoService.UpdateLocationStatus(locationInfo, (PalletTypeEnum)task.PalletType, LocationStatusEnum.Lock, task.WarehouseId); + BaseDal.UpdateData(task); + _unitOfWorkManage.CommitTran(); + return WebResponseContent.Instance.OK(); + } + catch (Exception ex) + { + _unitOfWorkManage.RollbackTran(); + return WebResponseContent.Instance.Error(ex.Message); + } + } + + /// <summary> + /// 鍏ュ簱浠诲姟瀹屾垚 + /// </summary> + /// <param name="taskNum">浠诲姟鍙�</param> + /// <returns></returns> public WebResponseContent InboundTaskCompleted(int taskNum) { try @@ -155,7 +224,7 @@ return WebResponseContent.Instance.Error($"鏈壘鍒拌浠诲姟淇℃伅"); } - if (task.TaskType != TaskTypeEnum.Inbound.ObjToInt()) + if (task.TaskType != TaskInboundTypeEnum.Inbound.ObjToInt()) { return WebResponseContent.Instance.Error($"浠诲姟绫诲瀷閿欒"); } diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Outbound.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Outbound.cs" new file mode 100644 index 0000000..723443b --- /dev/null +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Outbound.cs" @@ -0,0 +1,238 @@ +锘� +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WIDESEA_Core.Enums; +using WIDESEA_Core; +using WIDESEA_DTO.Stock; +using WIDESEA_Model.Models; +using WIDESEA_Core.Helper; +using WIDESEA_Common.OtherEnum; +using WIDESEA_Common.TaskEnum; +using WIDESEA_Common.OrderEnum; +using WIDESEA_Common.StockEnum; + +namespace WIDESEA_TaskInfoService +{ + public partial class TaskService + { + + /// <summary> + /// 搴撳瓨鏁版嵁杞嚭搴撲换鍔� + /// </summary> + /// <param name="stockInfos"></param> + /// <returns></returns> + public List<Dt_Task> GetTasks(List<Dt_StockInfo> stockInfos) + { + List<Dt_Task> tasks = new List<Dt_Task>(); + for (int i = 0; i < stockInfos.Count; i++) + { + Dt_StockInfo stockInfo = stockInfos[i]; + + if (stockInfo != null) + { + Dt_LocationInfo locationInfo = _basicService.LocationInfoService.Repository.QueryFirst(x => x.LocationCode == stockInfo.LocationCode); + Dt_Task task = new() + { + CurrentAddress = stockInfo.LocationCode, + Grade = 0, + PalletCode = stockInfo.PalletCode, + NextAddress = "", + Roadway = locationInfo.RoadwayNo, + SourceAddress = stockInfo.LocationCode, + TargetAddress = "", + TaskStatus = TaskOutStatusEnum.OutNew.ObjToInt(), + TaskType = TaskOutboundTypeEnum.Outbound.ObjToInt(), + TaskNum = BaseDal.GetTaskNum(nameof(SequenceEnum.SeqTaskNum)) + }; + tasks.Add(task); + } + } + return tasks; + } + + /// <summary> + /// 鍑哄簱浠诲姟鏁版嵁澶勭悊 + /// </summary> + /// <param name="orderDetailId"></param> + /// <param name="stockSelectViews"></param> + /// <returns></returns> + /// <exception cref="Exception"></exception> + public (List<Dt_Task>, List<Dt_StockInfo>?, List<Dt_OutboundOrderDetail>?, List<Dt_OutStockLockInfo>?, List<Dt_LocationInfo>?) OutboundTaskDataHandle(int orderDetailId, List<StockSelectViewDTO> stockSelectViews) + { + List<Dt_Task> tasks = new List<Dt_Task>(); + Dt_OutboundOrderDetail outboundOrderDetail = _outboundService.OutboundOrderDetailService.Repository.QueryFirst(x => x.Id == orderDetailId); + + if (outboundOrderDetail == null) + { + throw new Exception("鏈壘鍒板嚭搴撳崟鏄庣粏淇℃伅"); + } + + if (stockSelectViews.Sum(x => x.UseableQuantity) > outboundOrderDetail.OrderQuantity - outboundOrderDetail.LockQuantity) + { + throw new Exception("閫夋嫨鏁伴噺瓒呭嚭鍗曟嵁鏁伴噺"); + } + List<Dt_StockInfo>? stockInfos = null; + Dt_OutboundOrderDetail? orderDetail = null; + List<Dt_OutStockLockInfo>? outStockLockInfos = null; + List<Dt_LocationInfo>? locationInfos = null; + if (outboundOrderDetail.OrderDetailStatus == OrderDetailStatusEnum.New.ObjToInt()) + { + (List<Dt_StockInfo>, Dt_OutboundOrderDetail, List<Dt_OutStockLockInfo>, List<Dt_LocationInfo>) result = _outboundService.OutboundOrderDetailService.AssignStockOutbound(outboundOrderDetail, stockSelectViews); + if (result.Item1 != null && result.Item1.Count > 0) + { + tasks = GetTasks(result.Item1); + result.Item2.OrderDetailStatus = OrderDetailStatusEnum.Outbound.ObjToInt(); + result.Item3.ForEach(x => + { + x.Status = OutLockStockStatusEnum.鍑哄簱涓�.ObjToInt(); + }); + + stockInfos = result.Item1; + orderDetail = result.Item2; + outStockLockInfos = result.Item3; + locationInfos = result.Item4; + } + else + { + throw new Exception("鏃犲簱瀛�"); + } + } + else + { + List<Dt_OutStockLockInfo> stockLockInfos = _outboundService.OutboundStockLockInfoService.GetByOrderDetailId(outboundOrderDetail.OrderId, OutLockStockStatusEnum.宸插垎閰�); + if (stockLockInfos != null && stockLockInfos.Count > 0) + { + List<Dt_StockInfo> stocks = _stockService.StockInfoService.Repository.GetStockInfosByPalletCodes(stockLockInfos.Select(x => x.PalletCode).Distinct().ToList()); + tasks = GetTasks(stocks); + } + } + + return (tasks, stockInfos, orderDetail == null ? null : new List<Dt_OutboundOrderDetail> { orderDetail }, outStockLockInfos, locationInfos); + } + + /// <summary> + /// 鐢熸垚鍑哄簱浠诲姟 + /// </summary> + /// <param name="orderDetailId"></param> + /// <param name="stockSelectViews"></param> + /// <returns></returns> + public WebResponseContent GenerateOutboundTask(int orderDetailId, List<StockSelectViewDTO> stockSelectViews) + { + try + { + (List<Dt_Task>, List<Dt_StockInfo>?, List<Dt_OutboundOrderDetail>?, List<Dt_OutStockLockInfo>?, List<Dt_LocationInfo>?) result = OutboundTaskDataHandle(orderDetailId, stockSelectViews); + + WebResponseContent content = GenerateOutboundTaskDataUpdate(result.Item1, result.Item2, result.Item3, result.Item4, result.Item5); + + return content; + } + catch (Exception ex) + { + return WebResponseContent.Instance.Error(ex.Message); + } + } + + /// <summary> + /// 鐢熸垚鍑哄簱浠诲姟鍚庢暟鎹洿鏂板埌鏁版嵁搴� + /// </summary> + /// <param name="tasks"></param> + /// <param name="stockInfos"></param> + /// <param name="outboundOrderDetails"></param> + /// <param name="outStockLockInfos"></param> + /// <param name="locationInfos"></param> + /// <returns></returns> + public WebResponseContent GenerateOutboundTaskDataUpdate(List<Dt_Task> tasks, List<Dt_StockInfo>? stockInfos = null, List<Dt_OutboundOrderDetail>? outboundOrderDetails = null, List<Dt_OutStockLockInfo>? outStockLockInfos = null, List<Dt_LocationInfo>? locationInfos = null) + { + try + { + _unitOfWorkManage.BeginTran(); + + BaseDal.AddData(tasks); + if (stockInfos != null && outboundOrderDetails != null && outStockLockInfos != null && locationInfos != null) + { + WebResponseContent content = _outboundService.OutboundOrderDetailService.LockOutboundStockDataUpdate(stockInfos, outboundOrderDetails, outStockLockInfos, locationInfos, tasks: tasks); + + if (content.Status) + { + _unitOfWorkManage.CommitTran(); + } + else + { + _unitOfWorkManage.RollbackTran(); + } + return content; + } + else if (outboundOrderDetails != null && outboundOrderDetails.Count > 0) + { + outboundOrderDetails.ForEach(x => + { + x.OrderDetailStatus = OrderDetailStatusEnum.Outbound.ObjToInt(); + }); + + _outboundService.OutboundOrderDetailService.Repository.UpdateData(outboundOrderDetails); + } + _unitOfWorkManage.CommitTran(); + return WebResponseContent.Instance.OK(); + } + catch (Exception ex) + { + _unitOfWorkManage.RollbackTran(); + return WebResponseContent.Instance.Error(ex.Message); + } + + } + + /// <summary> + /// 鐢熸垚鍑哄簱浠诲姟 + /// </summary> + /// <param name="keys"></param> + /// <returns></returns> + public WebResponseContent GenerateOutboundTask(int[] keys) + { + try + { + List<Dt_Task> tasks = new List<Dt_Task>(); + List<StockSelectViewDTO> stockSelectViews = new List<StockSelectViewDTO>(); + List<Dt_StockInfo> stockInfos = new List<Dt_StockInfo>(); + List<Dt_OutboundOrderDetail> outboundOrderDetails = new List<Dt_OutboundOrderDetail>(); + List<Dt_OutStockLockInfo> outStockLockInfos = new List<Dt_OutStockLockInfo>(); + List<Dt_LocationInfo> locationInfos = new List<Dt_LocationInfo>(); + foreach (int key in keys) + { + (List<Dt_Task>, List<Dt_StockInfo>?, List<Dt_OutboundOrderDetail>?, List<Dt_OutStockLockInfo>?, List<Dt_LocationInfo>?) result = OutboundTaskDataHandle(key, stockSelectViews); + if (result.Item2 != null && result.Item2.Count > 0) + { + stockInfos.AddRange(result.Item2); + } + if (result.Item3 != null && result.Item3.Count > 0) + { + outboundOrderDetails.AddRange(result.Item3); + } + if (result.Item4 != null && result.Item4.Count > 0) + { + outStockLockInfos.AddRange(result.Item4); + } + if (result.Item5 != null && result.Item5.Count > 0) + { + locationInfos.AddRange(result.Item5); + } + if (result.Item1 != null && result.Item1.Count > 0) + { + tasks.AddRange(result.Item1); + } + } + + WebResponseContent content = GenerateOutboundTaskDataUpdate(tasks, stockInfos, outboundOrderDetails, outStockLockInfos, locationInfos); + return content; + } + catch (Exception ex) + { + _unitOfWorkManage.RollbackTran(); + return WebResponseContent.Instance.Error(ex.Message); + } + } + } +} \ No newline at end of file diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Basic/LocationInfoController.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Basic/LocationInfoController.cs" index cb150fa..f98e93f 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Basic/LocationInfoController.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Basic/LocationInfoController.cs" @@ -42,9 +42,9 @@ /// <param name="palletType"></param> /// <returns></returns> [HttpPost, HttpGet, Route("AssignLocation"), AllowAnonymous] - public Dt_LocationInfo? AssignLocation(string roadwayNo, PalletTypeEnum palletType) + public Dt_LocationInfo? AssignLocation(string roadwayNo, PalletTypeEnum palletType, int warehouseId) { - return Service.AssignLocation(roadwayNo, palletType); + return Service.AssignLocation(roadwayNo, palletType, warehouseId); } /// <summary> 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 7eb00c9..6e357a9 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" @@ -1,6 +1,7 @@ 锘縰sing Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; +using WIDESEA_Common.CommonEnum; using WIDESEA_Core; using WIDESEA_Core.BaseController; using WIDESEA_DTO.Stock; @@ -18,15 +19,38 @@ } /// <summary> + /// 灏哤MS浠诲姟鎺ㄩ�佽嚦WCS + /// </summary> + /// <returns></returns> + [HttpPost, HttpGet, Route("PushTasksToWCS"), AllowAnonymous] + public WebResponseContent PushTasksToWCS() + { + return Service.PushTasksToWCS(); + } + + /// <summary> /// 鐢宠鍏ュ簱浠诲姟 /// </summary> /// <param name="palletCode"></param> /// <param name="stationCode"></param> /// <returns></returns> - [HttpPost, HttpGet, Route("RequestInboundTask")] + [HttpPost, HttpGet, Route("RequestInboundTask"), AllowAnonymous] public WebResponseContent RequestInboundTask(string palletCode, string stationCode) { return Service.RequestInboundTask(palletCode, stationCode); + } + + /// <summary> + /// 鍏ュ簱浠诲姟鐢宠鍒嗛厤璐т綅 + /// </summary> + /// <param name="taskNum">浠诲姟鍙�</param> + /// <param name="roadwayNo">宸烽亾鍙�</param> + /// <param name="palletType">鎵樼洏绫诲瀷</param> + /// <returns></returns> + [HttpPost, HttpGet, Route("AssignInboundTaskLocation"), AllowAnonymous] + public WebResponseContent AssignInboundTaskLocation(int taskNum, string roadwayNo) + { + return Service.AssignInboundTaskLocation(taskNum, roadwayNo); } /// <summary> @@ -34,7 +58,7 @@ /// </summary> /// <param name="taskNum"></param> /// <returns></returns> - [HttpPost, HttpGet, Route("InboundTaskCompleted")] + [HttpPost, HttpGet, Route("InboundTaskCompleted"), AllowAnonymous] public WebResponseContent InboundTaskCompleted(int taskNum) { return Service.InboundTaskCompleted(taskNum); diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Filter/CustomProfile.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Filter/CustomProfile.cs" index c4442ac..8636c46 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Filter/CustomProfile.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Filter/CustomProfile.cs" @@ -11,6 +11,7 @@ using WIDESEA_DTO.Inbound; using WIDESEA_DTO.Outbound; using WIDESEA_DTO.System; +using WIDESEA_DTO.Task; using WIDESEA_Model.Models; namespace WIDESEA_WMSServer.Filter @@ -30,6 +31,8 @@ CreateMap<OutboundOrderDetailAddDTO, Dt_OutboundOrderDetail>().ForMember(x => x.OrderDetailStatus, b => b.MapFrom(b => 0)); CreateMap<OutboundOrderAddDTO, Dt_OutboundOrder>(); CreateMap<Dt_ReceiveOrderDetail, Dt_CheckOrder>().ForMember(a => a.ReceivedQuantity, b => b.MapFrom(x => x.ReceivedQuantity)).ForMember(a => a.MaterielCode, b => b.MapFrom(x => x.MaterielCode)).ForMember(a => a.CheckOrderStatus, b => b.MapFrom(x => CheckOrderStatusEnum.NotCheck.ObjToInt())); + + CreateMap<Dt_Task, WMSTaskDTO>(); } } } -- Gitblit v1.9.3