From 06407e013aeb7cf346352542dfbd4cc207622d92 Mon Sep 17 00:00:00 2001 From: huangxiaoqiang <1247017146@qq.com> Date: 星期一, 18 十一月 2024 10:30:55 +0800 Subject: [PATCH] 1 --- 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/System/Sys_DictionaryController.cs | 1 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_ITaskInfoRepository/WIDESEAWCS_ITaskInfoRepository.csproj | 2 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_ITaskInfoService/WIDESEAWCS_ITaskInfoService.csproj | 2 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_ITaskInfoService/ITaskService.cs | 1 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Core/Filter/ApiAuthorizeFilter.cs | 18 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_BasicInfoRepository/WIDESEAWCS_BasicInfoRepository.csproj | 2 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/PDAController.cs | 54 ++-- 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/WIDESEAWCS_TaskInfoService.csproj | 2 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/Http/HttpHelpers.cs | 8 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_SystemRepository/WIDESEAWCS_SystemRepository.csproj | 2 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Program.cs | 2 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/TaskEnum/TaskTypeEnum.cs | 76 ++++++ 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_IBasicInfoRepository/WIDESEAWCS_IBasicInfoRepository.csproj | 2 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs | 64 ++--- 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Model/WIDESEAWCS_Model.csproj | 4 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/LogJob/LogJob.cs | 132 +++++++++++ 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/TaskEnum/TaskTypeGroup.cs | 16 + 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/WIDESEAWCS_Common.csproj | 2 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs | 29 - 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Modified_Date.json | 2 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/WIDESEAWCS_Tasks.csproj | 4 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/TaskEnum/TaskEnumHelper.cs | 62 +++++ 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/appsettings.json | 2 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs | 6 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/GetStackerObject.cs | 7 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_IBasicInfoService/WIDESEAWCS_IBasicInfoService.csproj | 2 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/TaskEnum/TaskStatusEnum.cs | 147 ++++++++++++ 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_SystemServices/WIDESEAWCS_SystemServices.csproj | 2 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoRepository/WIDESEAWCS_TaskInfoRepository.csproj | 2 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/WIDESEAWCS_DTO.csproj | 2 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/WIDESEAWCS_Server.csproj | 2 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_BasicInfoService/WIDESEAWCS_BasicInfoService.csproj | 4 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_ISystemRepository/WIDESEAWCS_ISystemRepository.csproj | 2 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/appsettings.json | 2 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_ISystemServices/WIDESEAWCS_ISystemServices.csproj | 2 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskExecuteDetailService.cs | 1 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/TaskEnum/TaskStatusGroup.cs | 15 + 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Stock/StockInfoController.cs | 6 38 files changed, 552 insertions(+), 139 deletions(-) diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_BasicInfoRepository/WIDESEAWCS_BasicInfoRepository.csproj" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_BasicInfoRepository/WIDESEAWCS_BasicInfoRepository.csproj" index e5988d8..00d158a 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_BasicInfoRepository/WIDESEAWCS_BasicInfoRepository.csproj" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_BasicInfoRepository/WIDESEAWCS_BasicInfoRepository.csproj" @@ -7,7 +7,7 @@ </PropertyGroup> <ItemGroup> - <PackageReference Include="WIDESEAWCS_Communicator" Version="2.0.0" /> + <PackageReference Include="WIDESEAWCS_Communicator" Version="2.2.1" /> </ItemGroup> <ItemGroup> diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_BasicInfoService/WIDESEAWCS_BasicInfoService.csproj" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_BasicInfoService/WIDESEAWCS_BasicInfoService.csproj" index 2f93555..25ff47e 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_BasicInfoService/WIDESEAWCS_BasicInfoService.csproj" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_BasicInfoService/WIDESEAWCS_BasicInfoService.csproj" @@ -7,8 +7,8 @@ </PropertyGroup> <ItemGroup> - <PackageReference Include="WIDESEAWCS_Communicator" Version="2.0.0" /> - <PackageReference Include="WIDESEAWCS_QuartzJob" Version="2.0.4" /> + <PackageReference Include="WIDESEAWCS_Communicator" Version="2.2.1" /> + <PackageReference Include="WIDESEAWCS_QuartzJob" Version="2.1.0" /> </ItemGroup> <ItemGroup> diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/Http/HttpHelpers.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/Http/HttpHelpers.cs" index 5380000..caabe50 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/Http/HttpHelpers.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/Http/HttpHelpers.cs" @@ -62,7 +62,7 @@ } catch (Exception ex) { - WriteLog.Write_Log("System/API璇锋眰", rquestName, "璇锋眰寮傚父", new { 璇锋眰鎶ユ枃 = parm, 鎺ユ敹鎶ユ枃 = responseContent, 閿欒 = ex.Message }); + WriteLog.Write_Log("API", rquestName, "璇锋眰寮傚父", new { 璇锋眰鎶ユ枃 = parm, 鎺ユ敹鎶ユ枃 = responseContent, 閿欒 = ex.Message }); throw ex; } } @@ -119,7 +119,7 @@ } catch (Exception ex) { - WriteLog.Write_Log("System/API璇锋眰", rquestName, "璇锋眰寮傚父", new { 璇锋眰鎶ユ枃 = parm, 鎺ユ敹鎶ユ枃 = responseContent, 閿欒 = ex.Message }); + WriteLog.Write_Log("API", rquestName, "璇锋眰寮傚父", new { 璇锋眰鎶ユ枃 = parm, 鎺ユ敹鎶ユ枃 = responseContent, 閿欒 = ex.Message }); throw ex; } } @@ -184,12 +184,12 @@ throw new Exception("寮傚父锛屽搷搴旂爜锛�" + statsCode.ToString()); } - WriteLog.Write_Log("System/API璇锋眰", rquestName, "璇锋眰鎴愬姛", new { 璇锋眰鎶ユ枃 = parm, 鎺ユ敹鎶ユ枃 = responseContent }); + WriteLog.Write_Log("API", rquestName, "璇锋眰鎴愬姛", new { 璇锋眰鎶ユ枃 = parm, 鎺ユ敹鎶ユ枃 = responseContent }); return JsonConvert.DeserializeObject<T>(responseContent); } catch (Exception ex) { - WriteLog.Write_Log("System/API璇锋眰", rquestName, "璇锋眰寮傚父", new { 璇锋眰鎶ユ枃 = parm, 鎺ユ敹鎶ユ枃 = responseContent, 閿欒 = ex.Message }); + WriteLog.Write_Log("API", rquestName, "璇锋眰寮傚父", new { 璇锋眰鎶ユ枃 = parm, 鎺ユ敹鎶ユ枃 = responseContent, 閿欒 = ex.Message }); throw ex; } } diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/WIDESEAWCS_Common.csproj" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/WIDESEAWCS_Common.csproj" index 04bde5b..6f0bfe9 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/WIDESEAWCS_Common.csproj" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/WIDESEAWCS_Common.csproj" @@ -7,7 +7,7 @@ </PropertyGroup> <ItemGroup> - <PackageReference Include="WIDESEAWCS_Communicator" Version="2.0.0" /> + <PackageReference Include="WIDESEAWCS_Communicator" Version="2.2.1" /> </ItemGroup> </Project> diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/TaskEnum/TaskEnumHelper.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/TaskEnum/TaskEnumHelper.cs" new file mode 100644 index 0000000..26b471d --- /dev/null +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/TaskEnum/TaskEnumHelper.cs" @@ -0,0 +1,62 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace WIDESEAWCS_DTO.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(); + } + + public static TaskTypeGroup GetTaskTypeGroup(this int taskType) + { + if (!int.TryParse(Enum.Parse<TaskOutboundTypeEnum>(taskType.ToString()).ToString(), out int result)) + { + return TaskTypeGroup.OutbondGroup; + } + else if (!int.TryParse(Enum.Parse<TaskInStatusEnum>(taskType.ToString()).ToString(), out result)) + { + return TaskTypeGroup.InboundGroup; + } + else if (!int.TryParse(Enum.Parse<TaskRelocationTypeEnum>(taskType.ToString()).ToString(), out result)) + { + return TaskTypeGroup.RelocationGroup; + } + else if (!int.TryParse(Enum.Parse<TaskOtherTypeEnum>(taskType.ToString()).ToString(), out result)) + { + return TaskTypeGroup.OtherGroup; + } + else + { + throw new NotImplementedException(); + } + } + + public static int GetNextNotCompletedStatus<T>(this int currentStatus) where T : Enum + { + Type type = typeof(T); + if (type is null) throw new ArgumentNullException(); + if (!type.IsEnum) return 0; + if (type == typeof(TaskInStatusEnum)) + { + List<int> taskInboundTypes = type.GetEnumIndexList(); + return taskInboundTypes.Where(x => x > currentStatus && x < (int)TaskInStatusEnum.InFinish).OrderBy(x => x).FirstOrDefault(); + } + else if (type == typeof(TaskOutStatusEnum)) + { + return type.GetEnumIndexList().Where(x => x > currentStatus && x < (int)TaskOutStatusEnum.OutFinish).OrderBy(x => x).FirstOrDefault(); + } + else + { + throw new NotImplementedException(); + } + } + } +} diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/TaskEnum/TaskStatusEnum.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/TaskEnum/TaskStatusEnum.cs" new file mode 100644 index 0000000..a091118 --- /dev/null +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/TaskEnum/TaskStatusEnum.cs" @@ -0,0 +1,147 @@ +锘縰sing System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace WIDESEAWCS_DTO.TaskEnum +{ + public enum TaskInStatusEnum + { + /// <summary> + /// 鏂板缓鍏ュ簱浠诲姟 + /// </summary> + [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, + + /// <summary> + /// 鍫嗗灈鏈哄叆搴撴墽琛屼腑 + /// </summary> + [Description("鍫嗗灈鏈哄叆搴撴墽琛屼腑")] + SC_InExecuting = 230, + + /// <summary> + /// 鍫嗗灈鏈哄叆搴撳畬鎴� + /// </summary> + [Description("鍫嗗灈鏈哄叆搴撳畬鎴�")] + SC_InFinish = 235, + + /// <summary> + /// 鍏ュ簱浠诲姟瀹屾垚 + /// </summary> + [Description("鍏ュ簱浠诲姟瀹屾垚")] + InFinish = 290, + + /// <summary> + /// 鍏ュ簱浠诲姟鎸傝捣 + /// </summary> + [Description("鍏ュ簱浠诲姟鎸傝捣")] + InPending = 297, + + /// <summary> + /// 鍏ュ簱浠诲姟鍙栨秷 + /// </summary> + [Description("鍏ュ簱浠诲姟鍙栨秷")] + InCancel = 298, + + /// <summary> + /// 鍏ュ簱浠诲姟寮傚父 + /// </summary> + [Description("鍏ュ簱浠诲姟寮傚父")] + InException = 299, + } + + public enum TaskOutStatusEnum + { + /// <summary> + /// 鏂板缓鍑哄簱浠诲姟 + /// </summary> + [Description("鏂板缓鍑哄簱浠诲姟")] + OutNew = 100, + + /// <summary> + /// 鍫嗗灈鏈哄嚭搴撴墽琛屼腑 + /// </summary> + [Description("鍫嗗灈鏈哄嚭搴撴墽琛屼腑")] + SC_OutExecuting = 110, + + /// <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, + + /// <summary> + /// 鍑哄簱浠诲姟瀹屾垚 + /// </summary> + [Description("鍑哄簱浠诲姟瀹屾垚")] + OutFinish = 190, + + /// <summary> + /// 鍑哄簱浠诲姟鎸傝捣 + /// </summary> + [Description("鍑哄簱浠诲姟鎸傝捣")] + OutPending = 197, + + /// <summary> + /// 鍑哄簱浠诲姟鍙栨秷 + /// </summary> + [Description("鍑哄簱浠诲姟鍙栨秷")] + OutCancel = 198, + + /// <summary> + /// 鍑哄簱浠诲姟寮傚父 + /// </summary> + [Description("鍑哄簱浠诲姟寮傚父")] + OutException = 199, + } +} diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/TaskEnum/TaskStatusGroup.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/TaskEnum/TaskStatusGroup.cs" new file mode 100644 index 0000000..5cf0377 --- /dev/null +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/TaskEnum/TaskStatusGroup.cs" @@ -0,0 +1,15 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace WIDESEAWCS_DTO.TaskEnum +{ + public enum TaskStatusGroup + { + NotCompleted, + Completed, + Exception + } +} diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/TaskEnum/TaskTypeEnum.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/TaskEnum/TaskTypeEnum.cs" new file mode 100644 index 0000000..5503416 --- /dev/null +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/TaskEnum/TaskTypeEnum.cs" @@ -0,0 +1,76 @@ +锘縰sing System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace WIDESEAWCS_DTO.TaskEnum +{ + public enum TaskInboundTypeEnum + { + /// <summary> + /// 鍏ュ簱 + /// </summary> + [Description("鍏ュ簱")] + Inbound = 200, + /// <summary> + /// 鐩樼偣鍏ュ簱 + /// </summary> + [Description("鐩樼偣鍏ュ簱")] + InInventory = 201, + /// <summary> + /// 鍒嗘嫞鍏ュ簱 + /// </summary> + [Description("鍒嗘嫞鍏ュ簱")] + InPick = 202, + /// <summary> + /// 璐ㄦ鍏ュ簱 + /// </summary> + [Description("璐ㄦ鍏ュ簱")] + InQuality = 203 + } + + public enum TaskOutboundTypeEnum + { + /// <summary> + /// 鍑哄簱 + /// </summary> + [Description("鍑哄簱")] + Outbound = 100, + /// <summary> + /// 鐩樼偣鍑哄簱 + /// </summary> + [Description("鐩樼偣鍑哄簱")] + OutInventory = 101, + /// <summary> + /// 鍒嗘嫞鍑哄簱 + /// </summary> + [Description("鍒嗘嫞鍑哄簱")] + OutPick = 102, + /// <summary> + /// 璐ㄦ鍑哄簱 + /// </summary> + [Description("璐ㄦ鍑哄簱")] + OutQuality = 103, + } + + public enum TaskRelocationTypeEnum + { + /// <summary> + /// 搴撳唴绉诲簱 + /// </summary> + [Description("搴撳唴绉诲簱")] + Relocation = 300, + /// <summary> + /// 搴撳绉诲簱 + /// </summary> + [Description("搴撳绉诲簱")] + RelocationIn = 301 + } + + public enum TaskOtherTypeEnum + { + + } +} diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/TaskEnum/TaskTypeGroup.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/TaskEnum/TaskTypeGroup.cs" new file mode 100644 index 0000000..0128c14 --- /dev/null +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/TaskEnum/TaskTypeGroup.cs" @@ -0,0 +1,16 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace WIDESEAWCS_DTO.TaskEnum +{ + public enum TaskTypeGroup + { + InboundGroup, + OutbondGroup, + RelocationGroup, + OtherGroup + } +} diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/WIDESEAWCS_DTO.csproj" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/WIDESEAWCS_DTO.csproj" index 116c439..bcc4ff3 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/WIDESEAWCS_DTO.csproj" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/WIDESEAWCS_DTO.csproj" @@ -15,7 +15,7 @@ </ItemGroup> <ItemGroup> - <PackageReference Include="WIDESEAWCS_Communicator" Version="2.0.0" /> + <PackageReference Include="WIDESEAWCS_Communicator" Version="2.2.1" /> </ItemGroup> </Project> diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_IBasicInfoRepository/WIDESEAWCS_IBasicInfoRepository.csproj" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_IBasicInfoRepository/WIDESEAWCS_IBasicInfoRepository.csproj" index 1a0d49b..1d9a416 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_IBasicInfoRepository/WIDESEAWCS_IBasicInfoRepository.csproj" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_IBasicInfoRepository/WIDESEAWCS_IBasicInfoRepository.csproj" @@ -7,7 +7,7 @@ </PropertyGroup> <ItemGroup> - <PackageReference Include="WIDESEAWCS_Communicator" Version="2.0.0" /> + <PackageReference Include="WIDESEAWCS_Communicator" Version="2.2.1" /> </ItemGroup> <ItemGroup> diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_IBasicInfoService/WIDESEAWCS_IBasicInfoService.csproj" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_IBasicInfoService/WIDESEAWCS_IBasicInfoService.csproj" index 80dc362..72c2a68 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_IBasicInfoService/WIDESEAWCS_IBasicInfoService.csproj" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_IBasicInfoService/WIDESEAWCS_IBasicInfoService.csproj" @@ -7,7 +7,7 @@ </PropertyGroup> <ItemGroup> - <PackageReference Include="WIDESEAWCS_Communicator" Version="2.0.0" /> + <PackageReference Include="WIDESEAWCS_Communicator" Version="2.2.1" /> </ItemGroup> <ItemGroup> diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_ISystemRepository/WIDESEAWCS_ISystemRepository.csproj" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_ISystemRepository/WIDESEAWCS_ISystemRepository.csproj" index 57fb625..3707d54 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_ISystemRepository/WIDESEAWCS_ISystemRepository.csproj" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_ISystemRepository/WIDESEAWCS_ISystemRepository.csproj" @@ -7,7 +7,7 @@ </PropertyGroup> <ItemGroup> - <PackageReference Include="WIDESEAWCS_Communicator" Version="2.0.0" /> + <PackageReference Include="WIDESEAWCS_Communicator" Version="2.2.1" /> </ItemGroup> <ItemGroup> diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_ISystemServices/WIDESEAWCS_ISystemServices.csproj" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_ISystemServices/WIDESEAWCS_ISystemServices.csproj" index 9892542..5522748 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_ISystemServices/WIDESEAWCS_ISystemServices.csproj" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_ISystemServices/WIDESEAWCS_ISystemServices.csproj" @@ -7,7 +7,7 @@ </PropertyGroup> <ItemGroup> - <PackageReference Include="WIDESEAWCS_Communicator" Version="2.0.0" /> + <PackageReference Include="WIDESEAWCS_Communicator" Version="2.2.1" /> </ItemGroup> <ItemGroup> diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_ITaskInfoRepository/WIDESEAWCS_ITaskInfoRepository.csproj" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_ITaskInfoRepository/WIDESEAWCS_ITaskInfoRepository.csproj" index 5ca101e..0997d4a 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_ITaskInfoRepository/WIDESEAWCS_ITaskInfoRepository.csproj" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_ITaskInfoRepository/WIDESEAWCS_ITaskInfoRepository.csproj" @@ -7,7 +7,7 @@ </PropertyGroup> <ItemGroup> - <PackageReference Include="WIDESEAWCS_Communicator" Version="2.0.0" /> + <PackageReference Include="WIDESEAWCS_Communicator" Version="2.2.1" /> </ItemGroup> <ItemGroup> diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_ITaskInfoService/ITaskService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_ITaskInfoService/ITaskService.cs" index 39629ed..fb154d5 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_ITaskInfoService/ITaskService.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_ITaskInfoService/ITaskService.cs" @@ -27,6 +27,7 @@ using WIDESEAWCS_Core.Enums; using WIDESEAWCS_DTO.TaskInfo; using WIDESEAWCS_Model.Models; +using WIDESEAWCS_DTO.TaskEnum; namespace WIDESEAWCS_ITaskInfoService { diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_ITaskInfoService/WIDESEAWCS_ITaskInfoService.csproj" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_ITaskInfoService/WIDESEAWCS_ITaskInfoService.csproj" index 12dced9..8cf4290 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_ITaskInfoService/WIDESEAWCS_ITaskInfoService.csproj" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_ITaskInfoService/WIDESEAWCS_ITaskInfoService.csproj" @@ -7,7 +7,7 @@ </PropertyGroup> <ItemGroup> - <PackageReference Include="WIDESEAWCS_Communicator" Version="2.0.0" /> + <PackageReference Include="WIDESEAWCS_Communicator" Version="2.2.1" /> </ItemGroup> <ItemGroup> diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Model/WIDESEAWCS_Model.csproj" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Model/WIDESEAWCS_Model.csproj" index 22c1e70..e379ed4 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Model/WIDESEAWCS_Model.csproj" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Model/WIDESEAWCS_Model.csproj" @@ -8,8 +8,8 @@ <ItemGroup> <PackageReference Include="System.Text.RegularExpressions" Version="4.3.1" /> - <PackageReference Include="WIDESEAWCS_Communicator" Version="2.0.0" /> - <PackageReference Include="WIDESEAWCS_Core" Version="1.0.4" /> + <PackageReference Include="WIDESEAWCS_Communicator" Version="2.2.1" /> + <PackageReference Include="WIDESEAWCS_Core" Version="1.0.6" /> </ItemGroup> <ItemGroup> diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/System/Sys_DictionaryController.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/System/Sys_DictionaryController.cs" index 16f7330..5a82aac 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/System/Sys_DictionaryController.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/System/Sys_DictionaryController.cs" @@ -22,6 +22,7 @@ using WIDESEAWCS_Core.Caches; using WIDESEAWCS_QuartzJob.DeviceEnum; using WIDESEA_Core.Enums; +using WIDESEAWCS_DTO.TaskEnum; namespace WIDESEAWCS_WCSServer.Controllers.System { diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Modified_Date.json" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Modified_Date.json" index a60fd8d..70f3447 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Modified_Date.json" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Modified_Date.json" @@ -1 +1 @@ -{"MM":"1","LogTime":"2024-11-11"} \ No newline at end of file +{"MM":"1","LogTime":"2024-11-12"} \ No newline at end of file diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Program.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Program.cs" index dcb3b8b..b48b4d0 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Program.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Program.cs" @@ -119,7 +119,7 @@ //todo //app.UseRecordAccessLogsMiddle(); -app.UseCors(AppSettings.app(new string[] { "Cors", "PolicyName" })); +app.UseCors(AppSettings.Get(new string[] { "Cors", "PolicyName" })); DefaultFilesOptions defaultFilesOptions = new DefaultFilesOptions(); defaultFilesOptions.DefaultFileNames.Clear(); diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/WIDESEAWCS_Server.csproj" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/WIDESEAWCS_Server.csproj" index 9f80790..e47767f 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/WIDESEAWCS_Server.csproj" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/WIDESEAWCS_Server.csproj" @@ -74,7 +74,7 @@ <ItemGroup> <PackageReference Include="Swashbuckle.AspNetCore" Version="6.5.0" /> - <PackageReference Include="WIDESEAWCS_Communicator" Version="2.0.0" /> + <PackageReference Include="WIDESEAWCS_Communicator" Version="2.2.1" /> </ItemGroup> <ItemGroup> diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/appsettings.json" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/appsettings.json" index d7b001a..de17e48 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/appsettings.json" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/appsettings.json" @@ -19,7 +19,7 @@ "EnableAllIPs": true, //褰撲负true鏃讹紝寮�鏀炬墍鏈塈P鍧囧彲璁块棶銆� // 鏀寔澶氫釜鍩熷悕绔彛锛屾敞鎰忕鍙e彿鍚庝笉瑕佸甫/鏂滄潌锛氭瘮濡俵ocalhost:8000/锛屾槸閿欑殑 // 娉ㄦ剰锛宧ttp://127.0.0.1:1818 鍜� http://localhost:1818 鏄笉涓�鏍风殑 - "IPs": "http://127.0.0.1:8080,http://localhost:8080" + "IPs": "http://127.0.0.1:8080,http://localhost:8080,http://127.0.0.1:8081,http://localhost:8081" }, "WMS": "http://localhost:9290/api/Task/", diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_SystemRepository/WIDESEAWCS_SystemRepository.csproj" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_SystemRepository/WIDESEAWCS_SystemRepository.csproj" index c6b3a5d..08ccccd 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_SystemRepository/WIDESEAWCS_SystemRepository.csproj" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_SystemRepository/WIDESEAWCS_SystemRepository.csproj" @@ -7,7 +7,7 @@ </PropertyGroup> <ItemGroup> - <PackageReference Include="WIDESEAWCS_Communicator" Version="2.0.0" /> + <PackageReference Include="WIDESEAWCS_Communicator" Version="2.2.1" /> </ItemGroup> <ItemGroup> diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_SystemServices/WIDESEAWCS_SystemServices.csproj" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_SystemServices/WIDESEAWCS_SystemServices.csproj" index 7139cc7..ee8e5c7 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_SystemServices/WIDESEAWCS_SystemServices.csproj" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_SystemServices/WIDESEAWCS_SystemServices.csproj" @@ -7,7 +7,7 @@ </PropertyGroup> <ItemGroup> - <PackageReference Include="WIDESEAWCS_Communicator" Version="2.0.0" /> + <PackageReference Include="WIDESEAWCS_Communicator" Version="2.2.1" /> </ItemGroup> <ItemGroup> diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoRepository/WIDESEAWCS_TaskInfoRepository.csproj" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoRepository/WIDESEAWCS_TaskInfoRepository.csproj" index 4ac4ef5..45808b9 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoRepository/WIDESEAWCS_TaskInfoRepository.csproj" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoRepository/WIDESEAWCS_TaskInfoRepository.csproj" @@ -7,7 +7,7 @@ </PropertyGroup> <ItemGroup> - <PackageReference Include="WIDESEAWCS_Communicator" Version="2.0.0" /> + <PackageReference Include="WIDESEAWCS_Communicator" Version="2.2.1" /> </ItemGroup> <ItemGroup> diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskExecuteDetailService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskExecuteDetailService.cs" index e34f30e..06eed97 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskExecuteDetailService.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskExecuteDetailService.cs" @@ -26,6 +26,7 @@ using WIDESEAWCS_Core; using WIDESEAWCS_Core.BaseServices; using WIDESEAWCS_Core.Enums; +using WIDESEAWCS_DTO.TaskEnum; using WIDESEAWCS_ITaskInfoRepository; using WIDESEAWCS_ITaskInfoService; using WIDESEAWCS_Model.Models; 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 f878fbe..dd5870e 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" @@ -17,24 +17,12 @@ using AutoMapper; 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.Reflection; -using System.Reflection.Emit; -using System.Security.Policy; -using System.Text; -using System.Threading.Tasks; using WIDESEA_Comm.Http; using WIDESEA_Common.Log; using WIDESEAWCS_Core; using WIDESEAWCS_Core.BaseServices; -using WIDESEAWCS_Core.DB.Models; -using WIDESEAWCS_Core.Enums; using WIDESEAWCS_DTO.TaskInfo; using WIDESEAWCS_ITaskInfoRepository; using WIDESEAWCS_ITaskInfoService; @@ -44,6 +32,8 @@ using WIDESEAWCS_Core.Helper; using WIDESEA_Core.Enums; using WIDESEAWCS_Core.BaseRepository; +using WIDESEAWCS_DTO.TaskEnum; + namespace WIDESEAWCS_TaskInfoService { @@ -491,17 +481,16 @@ Dt_Task task = BaseDal.QueryFirst(x => x.TaskNum == taskNum); if (task == null) return WebResponseContent.Instance.Error($"鏈壘鍒拌浠诲姟淇℃伅,浠诲姟鍙�:銆恵taskNum}銆�"); + task.ModifyDate = DateTime.Now; + task.Modifier = "WMS"; if (task.TaskType == (int)TaskTypeEnum.Outbound || task.TaskType == (int)TaskTypeEnum.PalletOutbound) { _unitOfWorkManage.BeginTran(); task.TaskStatus = (int)OutTaskStatusEnum.OutFinish; - task.ModifyDate = DateTime.Now; - task.Modifier = "System"; - BaseDal.DeleteData(task); - _task_HtyService.AddTaskHty(task); _taskExecuteDetailService.AddTaskExecuteDetail(task.TaskId, $"鍫嗗灈鏈哄嚭搴撳畬鎴�"); if(App.User.UserId > 0) { + task.Modifier = "System"; var response = HttpHelpers.Post<WebResponseContent>(url + "TaskCompleted?taskNum=" + task.TaskNum, "", "浠诲姟瀹屾垚"); if (response.Status) { @@ -514,6 +503,8 @@ return content = WebResponseContent.Instance.Error(response.Message); } } + BaseDal.DeleteData(task); + _task_HtyService.AddTaskHty(task); _unitOfWorkManage.CommitTran(); return content.OK(); } @@ -521,13 +512,10 @@ { _unitOfWorkManage.BeginTran(); task.TaskStatus = (int)InTaskStatusEnum.InFinish; - task.ModifyDate = DateTime.Now; - task.Modifier = "System"; - BaseDal.DeleteData(task); - _task_HtyService.AddTaskHty(task); _taskExecuteDetailService.AddTaskExecuteDetail(task.TaskId, $"鍫嗗灈鏈哄叆搴撳畬鎴�"); if (App.User.UserId > 0) { + task.Modifier = "System"; var response = HttpHelpers.Post<WebResponseContent>(url + "TaskCompleted?taskNum=" + task.TaskNum, "", "浠诲姟瀹屾垚"); if (response.Status) { @@ -540,6 +528,8 @@ return content = WebResponseContent.Instance.Error(response.Message); } } + BaseDal.DeleteData(task); + _task_HtyService.AddTaskHty(task); _unitOfWorkManage.CommitTran(); return content.OK(); } @@ -547,13 +537,10 @@ { _unitOfWorkManage.BeginTran(); task.TaskStatus = (int)InTaskStatusEnum.RelocationFinish; - task.ModifyDate = DateTime.Now; - task.Modifier = "System"; - BaseDal.DeleteData(task); - _task_HtyService.AddTaskHty(task); _taskExecuteDetailService.AddTaskExecuteDetail(task.TaskId, $"鍫嗗灈鏈虹Щ搴撳畬鎴�"); if (App.User.UserId > 0) { + task.Modifier = "System"; var response = HttpHelpers.Post<WebResponseContent>(url + "TaskCompleted?taskNum=" + task.TaskNum, "", "浠诲姟瀹屾垚"); if (response.Status) { @@ -566,6 +553,8 @@ return content = WebResponseContent.Instance.Error(response.Message); } } + BaseDal.DeleteData(task); + _task_HtyService.AddTaskHty(task); _unitOfWorkManage.CommitTran(); return content.OK(); } @@ -581,7 +570,7 @@ } finally { - WriteLog.GetLog("瀹屾垚浠诲姟").Write($"鎿嶄綔浜猴細{(App.User.UserId > 0 ? App.User.UserName : "")}{Environment.NewLine}{JsonConvert.SerializeObject(content)}", "瀹屾垚浠诲姟"); + WriteLog.GetLog("瀹屾垚浠诲姟").Write($"鎿嶄綔浜猴細{(App.User.UserId > 0 ? App.User.UserName : "")}{Environment.NewLine}浠诲姟鍙凤細{taskNum}{Environment.NewLine}{JsonConvert.SerializeObject(content)}", "瀹屾垚浠诲姟"); } return content; } @@ -594,17 +583,18 @@ Dt_Task task = BaseDal.QueryFirst(x => x.TaskNum == taskNum); if (task == null) return WebResponseContent.Instance.Error($"鏈壘鍒拌浠诲姟淇℃伅,浠诲姟鍙�:銆恵taskNum}銆�"); + task.ModifyDate = DateTime.Now; + task.Modifier = "WMS"; if (task.TaskType == (int)TaskTypeEnum.Outbound || task.TaskType == (int)TaskTypeEnum.PalletOutbound) { _unitOfWorkManage.BeginTran(); task.TaskStatus = (int)OutTaskStatusEnum.OutCancel; - task.ModifyDate = DateTime.Now; - task.Modifier = "System"; - BaseDal.DeleteData(task); - _task_HtyService.AddTaskHty(task); _taskExecuteDetailService.AddTaskExecuteDetail(task.TaskId, $"鍫嗗灈鏈哄嚭搴撳彇娑�"); if (App.User.UserId > 0) { + BaseDal.DeleteData(task); + _task_HtyService.AddTaskHty(task); + task.Modifier = "System"; var response = HttpHelpers.Post<WebResponseContent>(url + "TaskCancel?taskNum=" + task.TaskNum, "", "鍙栨秷浠诲姟"); if (response.Status) { @@ -625,13 +615,10 @@ { _unitOfWorkManage.BeginTran(); task.TaskStatus = (int)InTaskStatusEnum.InCancel; - task.ModifyDate = DateTime.Now; - task.Modifier = "System"; - BaseDal.DeleteData(task); - _task_HtyService.AddTaskHty(task); _taskExecuteDetailService.AddTaskExecuteDetail(task.TaskId, $"鍫嗗灈鏈哄叆搴撳彇娑�"); if (App.User.UserId > 0) { + task.Modifier = "System"; var response = HttpHelpers.Post<WebResponseContent>(url + "TaskCancel?taskNum=" + task.TaskNum, "", "鍙栨秷浠诲姟"); if (response.Status) { @@ -645,6 +632,8 @@ return content = WebResponseContent.Instance.Error(response.Message); } } + BaseDal.DeleteData(task); + _task_HtyService.AddTaskHty(task); _unitOfWorkManage.CommitTran(); return content.OK(); } @@ -652,13 +641,10 @@ { _unitOfWorkManage.BeginTran(); task.TaskStatus = (int)InTaskStatusEnum.RelocationCancel; - task.ModifyDate = DateTime.Now; - task.Modifier = "System"; - BaseDal.DeleteData(task); - _task_HtyService.AddTaskHty(task); _taskExecuteDetailService.AddTaskExecuteDetail(task.TaskId, $"鍫嗗灈鏈虹Щ搴撳彇娑�"); if (App.User.UserId > 0) { + task.Modifier = "System"; var response = HttpHelpers.Post<WebResponseContent>(url + "TaskCancel?taskNum=" + task.TaskNum, "", "鍙栨秷浠诲姟"); if (response.Status) { @@ -672,6 +658,8 @@ return content = WebResponseContent.Instance.Error(response.Message); } } + BaseDal.DeleteData(task); + _task_HtyService.AddTaskHty(task); _unitOfWorkManage.CommitTran(); return content.OK(); } @@ -687,7 +675,7 @@ } finally { - WriteLog.GetLog("鍙栨秷浠诲姟").Write($"鎿嶄綔浜猴細{(App.User.UserId > 0 ? App.User.UserName : "")}{Environment.NewLine}{JsonConvert.SerializeObject(content)}", "鍙栨秷浠诲姟"); + WriteLog.GetLog("鍙栨秷浠诲姟").Write($"鎿嶄綔浜猴細{(App.User.UserId > 0 ? App.User.UserName : "")}{Environment.NewLine}浠诲姟鍙凤細{taskNum}{Environment.NewLine}{JsonConvert.SerializeObject(content)}", "鍙栨秷浠诲姟"); } } /// <summary> diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/WIDESEAWCS_TaskInfoService.csproj" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/WIDESEAWCS_TaskInfoService.csproj" index b2ccb27..f5e8eda 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/WIDESEAWCS_TaskInfoService.csproj" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/WIDESEAWCS_TaskInfoService.csproj" @@ -7,7 +7,7 @@ </PropertyGroup> <ItemGroup> - <PackageReference Include="WIDESEAWCS_Communicator" Version="2.0.0" /> + <PackageReference Include="WIDESEAWCS_Communicator" Version="2.2.1" /> </ItemGroup> <ItemGroup> diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/LogJob/LogJob.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/LogJob/LogJob.cs" new file mode 100644 index 0000000..532f26f --- /dev/null +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/LogJob/LogJob.cs" @@ -0,0 +1,132 @@ +锘縰sing HslCommunication; +using HslCommunication.Core; +using Microsoft.VisualBasic.FileIO; +using Newtonsoft.Json; +using Quartz; +using SixLabors.ImageSharp.PixelFormats; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Reflection; +using System.Reflection.Metadata.Ecma335; +using System.Text; +using System.Threading.Tasks; +using WIDESEAWCS_Communicator; +using WIDESEAWCS_Core.Helper; +using WIDESEAWCS_QuartzJob; +using WIDESEAWCS_QuartzJob.DeviceBase; +using WIDESEAWCS_QuartzJob.StackerCrane.Enum; + +namespace WIDESEAWCS_Tasks +{ + [DisallowConcurrentExecution] + public class LogJob : IJob + { + public Task Execute(IJobExecutionContext context) + { + try + { + #region + //CommonStackerCrane commonStackerCrane = (CommonStackerCrane)context.JobDetail.JobDataMap.Get("JobParams"); + + //Console.Out.WriteLine(commonStackerCrane.DeviceName + "鐘舵��:" + commonStackerCrane.StackerCraneStatusDes); + + //Console.Out.WriteLine(commonStackerCrane.DeviceName + "鎵嬭嚜鍔ㄧ姸鎬�:" + commonStackerCrane.StackerCraneAutoStatusDes); + + //Console.Out.WriteLine(commonStackerCrane.DeviceName + "浣滀笟鐘舵��:" + commonStackerCrane.StackerCraneWorkStatusDes); + + //Console.Out.WriteLine(commonStackerCrane.DeviceName + "褰撳墠浠诲姟鍙�:" + commonStackerCrane.GetValue<StackerCraneDBName, int>(StackerCraneDBName.CurrentTaskNum)); + + //commonStackerCrane.SetValue(StackerCraneDBName.CurrentTaskNum, DateTime.Now.Second); + + //OperateResult<TimeSpan> operateResult = commonStackerCrane.Communicator.Wait("DB1.18", 1000, 60000, 1); + //Console.Out.WriteLine(operateResult.Serialize()); + + //byte[] bytes = commonStackerCrane.Communicator.Read("DB1.1", 2); + //Console.Out.WriteLine(bytes.ToBoolArray().ToList().Serialize()); + + //bool[] bools = new bool[] { true, false, true }; + //byte[] bytes1 = bools.ToByteArray(); + //Console.Out.WriteLine(bytes1.ToList().Serialize()); + + + + //Console.Out.WriteLine(DateTime.Now); + + //Console.Out.WriteLine(); + #endregion + Task.Run(() => + { + while (true) + { + try + { + string date = DateTime.Now.ToString("yyyy-MM-dd"); + string json = File.ReadAllText(AppContext.BaseDirectory + "Modified_Date.json", Encoding.UTF8); + var LogsTime = JsonConvert.DeserializeObject<TimeList>(json); + if (date != LogsTime.LogTime) + { + LogsTime.LogTime = date; + string modifiedJson = JsonConvert.SerializeObject(LogsTime); + File.WriteAllText("Modified_Date.json", modifiedJson); + string folderPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "log"); + DateTime tenDaysAgo = DateTime.Now.AddDays(-14); // 鑾峰彇褰撳墠鏃堕棿鐨勪竷澶╀箣鍓嶇殑鏃ユ湡 + + DeleteLogs(folderPath, tenDaysAgo); + } + + Thread.Sleep(1000 * 60 * 60 * 24); + } + catch + { + Thread.Sleep(1000 * 60 * 60); + } + } + }); + + } + catch (Exception ex) + { + Console.Out.WriteLine(nameof(LogJob) + ":" + ex.Message); + } + + return Task.CompletedTask; + } + public static void DeleteLogs(string path, DateTime dateTime) + { + DirectoryInfo directory = new DirectoryInfo(path); + foreach (FileSystemInfo file in directory.GetFileSystemInfos()) + { + if (file is FileInfo && ((FileInfo)file).LastWriteTime < dateTime || + file is DirectoryInfo && ((DirectoryInfo)file).CreationTime < dateTime) + { + try + { + if (file is FileInfo) + { + ((FileInfo)file).Delete(); + } + else if (file is DirectoryInfo) + { + DeleteLogs(file.FullName, dateTime); + ((DirectoryInfo)file).Delete(true); + } + } + catch (Exception ex) + { + Console.WriteLine("鏃犳硶鍒犻櫎鏂囦欢鎴栨枃浠跺す: " + file.FullName + "\n閿欒淇℃伅: " + ex.Message); + } + } + } + } + public class TimeList + { + public string MM { get; set; } + + public string LogTime { get; set; } + } + } + + +} diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs" index e050312..3fd7762 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs" @@ -1,27 +1,15 @@ -锘縰sing HslCommunication; -using Microsoft.AspNetCore.Components.Routing; -using Newtonsoft.Json; -using Quartz; +锘縰sing Quartz; using SqlSugar.Extensions; -using System; -using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; -using System.Linq; -using System.Net; -using System.Reflection.Metadata; -using System.Text; -using System.Threading.Tasks; -using WIDESEA_Common.Log; using WIDESEA_Core.Enums; -using WIDESEAWCS_Core.Enums; using WIDESEAWCS_ITaskInfoRepository; using WIDESEAWCS_ITaskInfoService; using WIDESEAWCS_Model.Models; using WIDESEAWCS_QuartzJob; using WIDESEAWCS_QuartzJob.DeviceBase; -using WIDESEAWCS_QuartzJob.DTO; using WIDESEAWCS_QuartzJob.Models; using WIDESEAWCS_QuartzJob.Service; +using WIDESEAWCS_QuartzJob.StackerCrane; using WIDESEAWCS_Tasks.StackerCraneJob; namespace WIDESEAWCS_Tasks @@ -34,11 +22,11 @@ private readonly ITaskRepository _taskRepository; private readonly IRouterService _routerService; - public CommonStackerCraneJob(ITaskService taskService, ITaskExecuteDetailService taskExecuteDetailService, ITaskRepository taskRepository, IRouterService routerService) + public CommonStackerCraneJob(ITaskService taskService, ITaskRepository taskRepository, ITaskExecuteDetailService taskExecuteDetailService, IRouterService routerService) { _taskService = taskService; - _taskExecuteDetailService = taskExecuteDetailService; _taskRepository = taskRepository; + _taskExecuteDetailService = taskExecuteDetailService; _routerService = routerService; } @@ -47,16 +35,16 @@ try { SpeStackerCrane speStackerCrane = (SpeStackerCrane)context.JobDetail.JobDataMap.Get("JobParams"); - GetStackerObject getStackerObject = new GetStackerObject(speStackerCrane); if (speStackerCrane != null) { + GetStackerObject getStackerObject = new GetStackerObject(speStackerCrane); if (!getStackerObject.IsEventSubscribed) { getStackerObject.StackerCraneTaskCompletedEventHandler += CommonStackerCrane_StackerCraneTaskCompletedEventHandler;//璁㈤槄浠诲姟瀹屾垚浜嬩欢 } if (getStackerObject.StackerCraneAutoStatusValue == StackerCraneAutoStatus.Automatic && getStackerObject.StackerCraneStatusValue == StackerCraneStatus.Ready) { - getStackerObject.CheckStackerCraneTaskCompleted();//妫�娴嬪畬鎴愪簨浠� + getStackerObject.CheckStackerCraneTaskCompleted();//妫�娴嬪爢鍨涙満浠诲姟瀹屾垚浜嬩欢 if(getStackerObject.StackerCraneWorkStatusValue == StackerCraneWorkStatus.Standby) { @@ -80,7 +68,7 @@ } catch (Exception ex) { - WriteLog.GetLog($"鍫嗗灈鏈哄紓甯�").Write($"{nameof(CommonStackerCraneJob)}:{ex.Message}", "鍫嗗灈鏈哄紓甯�"); + //WriteLog.GetLog($"鍫嗗灈鏈哄紓甯�").Write($"{nameof(CommonStackerCraneJob)}:{ex.Message}", "鍫嗗灈鏈哄紓甯�"); } return Task.CompletedTask; } @@ -90,14 +78,13 @@ /// </summary> /// <param name="sender"></param> /// <param name="e"></param> - private void CommonStackerCrane_StackerCraneTaskCompletedEventHandler(object? sender, WIDESEAWCS_QuartzJob.StackerCrane.StackerCraneTaskCompletedEventArgs e) + private void CommonStackerCrane_StackerCraneTaskCompletedEventHandler(object? sender, StackerCraneTaskCompletedEventArgs e) { SpeStackerCrane? speStackerCrane = sender as SpeStackerCrane; if (speStackerCrane != null) { if (speStackerCrane.GetValue<StackerCraneDBName, short>(StackerCraneDBName.WorkType) != 5) { - Console.Out.WriteLine("TaskCompleted" + e.TaskNum); _taskService.StackCraneTaskCompleted(e.TaskNum); speStackerCrane.SetValue(StackerCraneDBName.WorkType, 5); } diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/GetStackerObject.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/GetStackerObject.cs" index d806122..bf711bf 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/GetStackerObject.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/GetStackerObject.cs" @@ -1,17 +1,10 @@ 锘縰sing HslCommunication; -using System; -using System.Collections.Generic; using System.ComponentModel; -using System.Linq; using System.Reflection; -using System.Text; -using System.Threading.Tasks; using WIDESEAWCS_Communicator; using WIDESEAWCS_QuartzJob; -using WIDESEAWCS_QuartzJob.DeviceBase; using WIDESEAWCS_QuartzJob.DTO; using WIDESEAWCS_QuartzJob.StackerCrane; -using WIDESEAWCS_QuartzJob.StackerCrane.Enum; namespace WIDESEAWCS_Tasks.StackerCraneJob { diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/WIDESEAWCS_Tasks.csproj" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/WIDESEAWCS_Tasks.csproj" index 1084b9b..dc9b032 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/WIDESEAWCS_Tasks.csproj" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/WIDESEAWCS_Tasks.csproj" @@ -7,8 +7,8 @@ </PropertyGroup> <ItemGroup> - <PackageReference Include="WIDESEAWCS_Communicator" Version="2.0.0" /> - <PackageReference Include="WIDESEAWCS_QuartzJob" Version="2.0.4" /> + <PackageReference Include="WIDESEAWCS_Communicator" Version="2.2.1" /> + <PackageReference Include="WIDESEAWCS_QuartzJob" Version="2.1.0" /> </ItemGroup> <ItemGroup> diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Core/Filter/ApiAuthorizeFilter.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Core/Filter/ApiAuthorizeFilter.cs" index 9aeb45d..2ccaf79 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Core/Filter/ApiAuthorizeFilter.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Core/Filter/ApiAuthorizeFilter.cs" @@ -38,7 +38,7 @@ /// <param name="context"></param> public void OnAuthorization(AuthorizationFilterContext context) { - if (!App.HostEnvironment.IsProduction() || context.HttpContext.Request.Path.Value == loginPath || context.HttpContext.Request.Path.Value == vierificationCodePath) + //if (!App.HostEnvironment.IsProduction() || context.HttpContext.Request.Path.Value == loginPath || context.HttpContext.Request.Path.Value == vierificationCodePath) { if (context.ActionDescriptor.EndpointMetadata.Any(item => item is IAllowAnonymous)) { @@ -58,14 +58,14 @@ return; } } - else - { - if (!context.HttpContext.User.Identity?.IsAuthenticated ?? false || !context.HttpContext.Request.Headers.ContainsKey(AppSecret.TokenHeaderName)) - { - context.Unauthorized("鏈巿鏉�"); - return; - } - } + //else + //{ + // if (!context.HttpContext.User.Identity?.IsAuthenticated ?? false || !context.HttpContext.Request.Headers.ContainsKey(AppSecret.TokenHeaderName)) + // { + // context.Unauthorized("鏈巿鏉�"); + // return; + // } + //} #region 鍗曠偣鐧诲綍 if (string.IsNullOrEmpty(App.User.Token)) 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 301d9b2..dfd5943 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" @@ -128,7 +128,7 @@ } finally { - WriteLog.GetLog("浠诲姟瀹屾垚").Write($"鎿嶄綔浜猴細{(App.User.UserId>0? App.User.UserName: "System")}{ Environment.NewLine}{ JsonConvert.SerializeObject(content)}", "浠诲姟瀹屾垚"); + WriteLog.GetLog("浠诲姟瀹屾垚").Write($"鎿嶄綔浜猴細{(App.User.UserId>0? App.User.UserName: "System")}{ Environment.NewLine}浠诲姟鍙凤細{taskNum}{Environment.NewLine}{ JsonConvert.SerializeObject(content)}", "浠诲姟瀹屾垚"); } } public WebResponseContent TaskCancel(int taskNum) @@ -175,7 +175,7 @@ } finally { - WriteLog.GetLog("浠诲姟鍙栨秷").Write($"鎿嶄綔浜猴細{(App.User.UserId > 0 ? App.User.UserName : "System")}{Environment.NewLine}{JsonConvert.SerializeObject(content)}", "浠诲姟鍙栨秷"); + WriteLog.GetLog("浠诲姟鍙栨秷").Write($"鎿嶄綔浜猴細{(App.User.UserId > 0 ? App.User.UserName : "System")}{Environment.NewLine}浠诲姟鍙凤細{taskNum}{Environment.NewLine}{JsonConvert.SerializeObject(content)}", "浠诲姟鍙栨秷"); } } @@ -277,7 +277,7 @@ LocationCode = task.TargetAddress, StockStatus = StockStatusEmun.宸插叆搴�.ObjToInt(), Creater = App.User.UserId > 0 ? App.User.UserName : "System", - CreateDate = App.User.UserId > 0 ? DateTime.Now : DateTime.Now, + CreateDate = DateTime.Now, }; Dt_LocationInfo locationInfo = _basicService.LocationInfoService.Repository.QueryFirst(x => x.LocationCode == task.TargetAddress); diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/PDAController.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/PDAController.cs" index 8462717..6e4397e 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/PDAController.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/PDAController.cs" @@ -10,6 +10,7 @@ using WIDESEA_ITaskInfoService; using System.IO; using WIDESEA_Model.Models; +using System; namespace WIDESEA_WMSServer.Controllers { @@ -52,12 +53,28 @@ return _inboundService.InbounOrderService.QueryOrderInfo(pageNo, orderNo); } - //[HttpPost, HttpGet, Route("UploadApp"), AllowAnonymous] - //public WebResponseContent UploadApp(IEnumerable<IFormFile> fileInput) - //{ + [HttpPost, HttpGet, Route("UploadApp"), AllowAnonymous] + public async Task<WebResponseContent> UploadApk(IEnumerable<IFormFile> fileInput) + { + // 妫�鏌ユ槸鍚︽湁鏂囦欢涓婁紶 + if (fileInput == null || !fileInput.Any()) + { + return WebResponseContent.Instance.Error("鏂囦欢鏈笂浼�"); + } - // //return PDAOperate.UploadApp(Request.Form.Files.ToList()); - //} + var formFile = fileInput.First(); + var uploadFolder = Path.Combine(Directory.GetCurrentDirectory(), "wwwroot", "Upload"); + Directory.CreateDirectory(uploadFolder); + + var fileName = $"WMS-PDA.apk"; + var filePath = Path.Combine(uploadFolder, fileName); + + using (var stream = new FileStream(filePath, FileMode.Create)) + { + await formFile.CopyToAsync(stream); + } + return WebResponseContent.Instance.OK("鏂囦欢涓婁紶鎴愬姛"); ; + } [HttpPost, HttpGet, Route("GetPDAVersion"), AllowAnonymous] public WebResponseContent GetPDAVersion(string version) @@ -87,31 +104,8 @@ stream.CopyTo(memory); } memory.Position = 0; - return File(memory, GetContentType(filePath), Path.GetFileName(filePath)); - } - private string GetContentType(string path) - { - var types = GetMimeTypes(); - var ext = Path.GetExtension(path).ToLowerInvariant(); - return types[ext]; - } - private Dictionary<string, string> GetMimeTypes() - { - return new Dictionary<string, string> - { - { ".txt", "text/plain" }, - { ".pdf", "application/pdf" }, - { ".doc", "application/vnd.ms-word" }, - { ".docx", "application/vnd.openxmlformats-officedocument.wordprocessingml.document" }, - { ".xls", "application/vnd.ms-excel" }, - { ".xlsx", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" }, - { ".png", "image/png" }, - { ".jpg", "image/jpeg" }, - { ".jpeg", "image/jpeg" }, - { ".gif", "image/gif" }, - { ".csv", "text/csv" }, - { ".apk", "application/vnd.android.package-archive" } - }; + var ext = Path.GetExtension(filePath).ToLowerInvariant(); + return File(memory, new Dictionary<string, string>{{ ".apk", "application/vnd.android.package-archive" }}[ext], Path.GetFileName(filePath)); } } } diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Stock/StockInfoController.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Stock/StockInfoController.cs" index 086702d..15d4466 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Stock/StockInfoController.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Stock/StockInfoController.cs" @@ -18,19 +18,19 @@ { } - [HttpPost, Route("GetAllStockViews"), AllowAnonymous] + [HttpPost, Route("GetAllStockViews"),AllowAnonymous] public List<StockViewDTO> GetAllStockViews() { return Service.Repository.GetAllStockViews(); } [HttpPost, Route("GetStockSelectViews"), AllowAnonymous] - public List<StockSelectViewDTO> GetStockSelectViews(string materielCode) + public List<StockSelectViewDTO> GetStockSelectViews([FromBody]string materielCode) { return Service.GetStockSelectViews(materielCode); } [HttpPost, Route("GetPalletStockInfo"), AllowAnonymous] - public Dt_StockInfo GetPalletStockInfo(string roadwayNo) + public Dt_StockInfo GetPalletStockInfo([FromBody] string roadwayNo) { return Service.Repository.GetPalletStockInfo(roadwayNo); } diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/appsettings.json" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/appsettings.json" index 25513e8..6057083 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/appsettings.json" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/appsettings.json" @@ -27,5 +27,5 @@ "ApiName": "WIDESEA", "ExpMinutes": 120, "QuartzJobAutoStart": true, - "PDAVersion": "20" + "PDAVersion": "2" } -- Gitblit v1.9.3