| | |
| | | </PropertyGroup> |
| | | |
| | | <ItemGroup> |
| | | <PackageReference Include="WIDESEAWCS_Communicator" Version="2.0.0" /> |
| | | <PackageReference Include="WIDESEAWCS_Communicator" Version="2.2.1" /> |
| | | </ItemGroup> |
| | | |
| | | <ItemGroup> |
| | |
| | | </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> |
| | |
| | | } |
| | | 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; |
| | | } |
| | | } |
| | |
| | | } |
| | | 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; |
| | | } |
| | | } |
| | |
| | | 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; |
| | | } |
| | | } |
| | |
| | | </PropertyGroup> |
| | | |
| | | <ItemGroup> |
| | | <PackageReference Include="WIDESEAWCS_Communicator" Version="2.0.0" /> |
| | | <PackageReference Include="WIDESEAWCS_Communicator" Version="2.2.1" /> |
| | | </ItemGroup> |
| | | |
| | | </Project> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using 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(); |
| | | } |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using 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, |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using 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 |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using 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 |
| | | { |
| | | |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using 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 |
| | | } |
| | | } |
| | |
| | | </ItemGroup> |
| | | |
| | | <ItemGroup> |
| | | <PackageReference Include="WIDESEAWCS_Communicator" Version="2.0.0" /> |
| | | <PackageReference Include="WIDESEAWCS_Communicator" Version="2.2.1" /> |
| | | </ItemGroup> |
| | | |
| | | </Project> |
| | |
| | | </PropertyGroup> |
| | | |
| | | <ItemGroup> |
| | | <PackageReference Include="WIDESEAWCS_Communicator" Version="2.0.0" /> |
| | | <PackageReference Include="WIDESEAWCS_Communicator" Version="2.2.1" /> |
| | | </ItemGroup> |
| | | |
| | | <ItemGroup> |
| | |
| | | </PropertyGroup> |
| | | |
| | | <ItemGroup> |
| | | <PackageReference Include="WIDESEAWCS_Communicator" Version="2.0.0" /> |
| | | <PackageReference Include="WIDESEAWCS_Communicator" Version="2.2.1" /> |
| | | </ItemGroup> |
| | | |
| | | <ItemGroup> |
| | |
| | | </PropertyGroup> |
| | | |
| | | <ItemGroup> |
| | | <PackageReference Include="WIDESEAWCS_Communicator" Version="2.0.0" /> |
| | | <PackageReference Include="WIDESEAWCS_Communicator" Version="2.2.1" /> |
| | | </ItemGroup> |
| | | |
| | | <ItemGroup> |
| | |
| | | </PropertyGroup> |
| | | |
| | | <ItemGroup> |
| | | <PackageReference Include="WIDESEAWCS_Communicator" Version="2.0.0" /> |
| | | <PackageReference Include="WIDESEAWCS_Communicator" Version="2.2.1" /> |
| | | </ItemGroup> |
| | | |
| | | <ItemGroup> |
| | |
| | | </PropertyGroup> |
| | | |
| | | <ItemGroup> |
| | | <PackageReference Include="WIDESEAWCS_Communicator" Version="2.0.0" /> |
| | | <PackageReference Include="WIDESEAWCS_Communicator" Version="2.2.1" /> |
| | | </ItemGroup> |
| | | |
| | | <ItemGroup> |
| | |
| | | using WIDESEAWCS_Core.Enums; |
| | | using WIDESEAWCS_DTO.TaskInfo; |
| | | using WIDESEAWCS_Model.Models; |
| | | using WIDESEAWCS_DTO.TaskEnum; |
| | | |
| | | namespace WIDESEAWCS_ITaskInfoService |
| | | { |
| | |
| | | </PropertyGroup> |
| | | |
| | | <ItemGroup> |
| | | <PackageReference Include="WIDESEAWCS_Communicator" Version="2.0.0" /> |
| | | <PackageReference Include="WIDESEAWCS_Communicator" Version="2.2.1" /> |
| | | </ItemGroup> |
| | | |
| | | <ItemGroup> |
| | |
| | | |
| | | <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> |
| | |
| | | using WIDESEAWCS_Core.Caches; |
| | | using WIDESEAWCS_QuartzJob.DeviceEnum; |
| | | using WIDESEA_Core.Enums; |
| | | using WIDESEAWCS_DTO.TaskEnum; |
| | | |
| | | namespace WIDESEAWCS_WCSServer.Controllers.System |
| | | { |
| | |
| | | {"MM":"1","LogTime":"2024-11-11"} |
| | | {"MM":"1","LogTime":"2024-11-12"} |
| | |
| | | //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(); |
| | |
| | | |
| | | <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> |
| | |
| | | "EnableAllIPs": true, //å½ä¸ºtrueæ¶ï¼å¼æ¾ææIPåå¯è®¿é®ã |
| | | // æ¯æå¤ä¸ªåå端å£ï¼æ³¨æç«¯å£å·åä¸è¦å¸¦/ææï¼æ¯å¦localhost:8000/ï¼æ¯éç |
| | | // 注æï¼http://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/", |
| | |
| | | </PropertyGroup> |
| | | |
| | | <ItemGroup> |
| | | <PackageReference Include="WIDESEAWCS_Communicator" Version="2.0.0" /> |
| | | <PackageReference Include="WIDESEAWCS_Communicator" Version="2.2.1" /> |
| | | </ItemGroup> |
| | | |
| | | <ItemGroup> |
| | |
| | | </PropertyGroup> |
| | | |
| | | <ItemGroup> |
| | | <PackageReference Include="WIDESEAWCS_Communicator" Version="2.0.0" /> |
| | | <PackageReference Include="WIDESEAWCS_Communicator" Version="2.2.1" /> |
| | | </ItemGroup> |
| | | |
| | | <ItemGroup> |
| | |
| | | </PropertyGroup> |
| | | |
| | | <ItemGroup> |
| | | <PackageReference Include="WIDESEAWCS_Communicator" Version="2.0.0" /> |
| | | <PackageReference Include="WIDESEAWCS_Communicator" Version="2.2.1" /> |
| | | </ItemGroup> |
| | | |
| | | <ItemGroup> |
| | |
| | | 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; |
| | |
| | | |
| | | 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; |
| | |
| | | using WIDESEAWCS_Core.Helper; |
| | | using WIDESEA_Core.Enums; |
| | | using WIDESEAWCS_Core.BaseRepository; |
| | | using WIDESEAWCS_DTO.TaskEnum; |
| | | |
| | | |
| | | namespace WIDESEAWCS_TaskInfoService |
| | | { |
| | |
| | | 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) |
| | | { |
| | |
| | | return content = WebResponseContent.Instance.Error(response.Message); |
| | | } |
| | | } |
| | | BaseDal.DeleteData(task); |
| | | _task_HtyService.AddTaskHty(task); |
| | | _unitOfWorkManage.CommitTran(); |
| | | return content.OK(); |
| | | } |
| | |
| | | { |
| | | _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) |
| | | { |
| | |
| | | return content = WebResponseContent.Instance.Error(response.Message); |
| | | } |
| | | } |
| | | BaseDal.DeleteData(task); |
| | | _task_HtyService.AddTaskHty(task); |
| | | _unitOfWorkManage.CommitTran(); |
| | | return content.OK(); |
| | | } |
| | |
| | | { |
| | | _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) |
| | | { |
| | |
| | | return content = WebResponseContent.Instance.Error(response.Message); |
| | | } |
| | | } |
| | | BaseDal.DeleteData(task); |
| | | _task_HtyService.AddTaskHty(task); |
| | | _unitOfWorkManage.CommitTran(); |
| | | return content.OK(); |
| | | } |
| | |
| | | } |
| | | 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; |
| | | } |
| | |
| | | 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) |
| | | { |
| | |
| | | { |
| | | _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) |
| | | { |
| | |
| | | return content = WebResponseContent.Instance.Error(response.Message); |
| | | } |
| | | } |
| | | BaseDal.DeleteData(task); |
| | | _task_HtyService.AddTaskHty(task); |
| | | _unitOfWorkManage.CommitTran(); |
| | | return content.OK(); |
| | | } |
| | |
| | | { |
| | | _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) |
| | | { |
| | |
| | | return content = WebResponseContent.Instance.Error(response.Message); |
| | | } |
| | | } |
| | | BaseDal.DeleteData(task); |
| | | _task_HtyService.AddTaskHty(task); |
| | | _unitOfWorkManage.CommitTran(); |
| | | return content.OK(); |
| | | } |
| | |
| | | } |
| | | 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> |
| | |
| | | </PropertyGroup> |
| | | |
| | | <ItemGroup> |
| | | <PackageReference Include="WIDESEAWCS_Communicator" Version="2.0.0" /> |
| | | <PackageReference Include="WIDESEAWCS_Communicator" Version="2.2.1" /> |
| | | </ItemGroup> |
| | | |
| | | <ItemGroup> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using 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; } |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | using HslCommunication; |
| | | using Microsoft.AspNetCore.Components.Routing; |
| | | using Newtonsoft.Json; |
| | | using Quartz; |
| | | using 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 |
| | |
| | | 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; |
| | | } |
| | | |
| | |
| | | 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) |
| | | { |
| | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | WriteLog.GetLog($"å åæºå¼å¸¸").Write($"{nameof(CommonStackerCraneJob)}:{ex.Message}", "å åæºå¼å¸¸"); |
| | | //WriteLog.GetLog($"å åæºå¼å¸¸").Write($"{nameof(CommonStackerCraneJob)}:{ex.Message}", "å åæºå¼å¸¸"); |
| | | } |
| | | return Task.CompletedTask; |
| | | } |
| | |
| | | /// </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); |
| | | } |
| | |
| | | using 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 |
| | | { |
| | |
| | | </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> |
| | |
| | | /// <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)) |
| | | { |
| | |
| | | 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)) |
| | |
| | | } |
| | | 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) |
| | |
| | | } |
| | | 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)}", "ä»»å¡åæ¶"); |
| | | } |
| | | } |
| | | |
| | |
| | | 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); |
| | | |
| | |
| | | using WIDESEA_ITaskInfoService; |
| | | using System.IO; |
| | | using WIDESEA_Model.Models; |
| | | using System; |
| | | |
| | | namespace WIDESEA_WMSServer.Controllers |
| | | { |
| | |
| | | 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) |
| | |
| | | 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)); |
| | | } |
| | | } |
| | | } |
| | |
| | | { |
| | | } |
| | | |
| | | [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); |
| | | } |
| | |
| | | "ApiName": "WIDESEA", |
| | | "ExpMinutes": 120, |
| | | "QuartzJobAutoStart": true, |
| | | "PDAVersion": "20" |
| | | "PDAVersion": "2" |
| | | } |