1
hutongqing
2024-10-29 dd2868457ea031e8f9bc538d05a98921968e9ba5
1
已删除1个文件
已添加7个文件
已修改8个文件
650 ■■■■■ 文件已修改
WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/2e039f01-75fb-4752-a777-4084d6de71ac.vsidx 补丁 | 查看 | 原始文档 | blame | 历史
WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/c37ec95c-ca36-40d5-988e-41ceb36fe9a6.vsidx 补丁 | 查看 | 原始文档 | blame | 历史
WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/fdf4ad03-f87a-4809-832b-50e9cd301540.vsidx 补丁 | 查看 | 原始文档 | blame | 历史
WIDESEAWCS_Server/WIDESEAWCS_Common/TaskEnum/TaskEnumHelper.cs 63 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WIDESEAWCS_Server/WIDESEAWCS_Common/TaskEnum/TaskStatusEnum.cs 147 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WIDESEAWCS_Server/WIDESEAWCS_Common/TaskEnum/TaskStatusGroup.cs 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WIDESEAWCS_Server/WIDESEAWCS_Common/TaskEnum/TaskTypeEnum.cs 76 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WIDESEAWCS_Server/WIDESEAWCS_Common/TaskEnum/TaskTypeGroup.cs 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WIDESEAWCS_Server/WIDESEAWCS_ITaskInfoService/ITaskService.cs 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WIDESEAWCS_Server/WIDESEAWCS_Model/WIDESEAWCS_Model.csproj 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/System/Sys_DictionaryController.cs 324 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WIDESEAWCS_Server/WIDESEAWCS_Server/Program.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
WIDESEAWCS_Server/WIDESEAWCS_SystemServices/Sys_DictionaryService.cs 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskExecuteDetailService.cs 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/2e039f01-75fb-4752-a777-4084d6de71ac.vsidx
Binary files differ
WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/c37ec95c-ca36-40d5-988e-41ceb36fe9a6.vsidx
Binary files differ
WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/fdf4ad03-f87a-4809-832b-50e9cd301540.vsidx
Binary files differ
WIDESEAWCS_Server/WIDESEAWCS_Common/TaskEnum/TaskEnumHelper.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,63 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEAWCS_Common.TaskEnum;
namespace WIDESEAWCS_Common.TaskEnum
{
    public static class TaskEnumHelper
    {
        public static List<int> GetEnumIndexList(this Type type)
        {
            if (type is null) throw new ArgumentNullException("type");
            if (!type.IsEnum) return new List<int>();
            return Enum.GetValues(type).Cast<int>().ToList();
        }
        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();
            }
        }
    }
}
WIDESEAWCS_Server/WIDESEAWCS_Common/TaskEnum/TaskStatusEnum.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,147 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace WIDESEAWCS_Common.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,
    }
}
WIDESEAWCS_Server/WIDESEAWCS_Common/TaskEnum/TaskStatusGroup.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace WIDESEAWCS_Common.TaskEnum
{
    public enum TaskStatusGroup
    {
        NotCompleted,
        Completed,
        Exception
    }
}
WIDESEAWCS_Server/WIDESEAWCS_Common/TaskEnum/TaskTypeEnum.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,76 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace WIDESEAWCS_Common.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
    {
    }
}
WIDESEAWCS_Server/WIDESEAWCS_Common/TaskEnum/TaskTypeGroup.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace WIDESEAWCS_Common.TaskEnum
{
    public enum TaskTypeGroup
    {
        InboundGroup,
        OutbondGroup,
        RelocationGroup,
        OtherGroup
    }
}
WIDESEAWCS_Server/WIDESEAWCS_ITaskInfoService/ITaskService.cs
@@ -22,6 +22,7 @@
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEAWCS_Common.TaskEnum;
using WIDESEAWCS_Core;
using WIDESEAWCS_Core.BaseServices;
using WIDESEAWCS_Core.Enums;
WIDESEAWCS_Server/WIDESEAWCS_Model/WIDESEAWCS_Model.csproj
@@ -8,7 +8,7 @@
    <ItemGroup>
        <PackageReference Include="System.Text.RegularExpressions" Version="4.3.1" />
        <PackageReference Include="WIDESEAWCS_Core" Version="1.0.4" />
        <PackageReference Include="WIDESEAWCS_Core" Version="1.0.5" />
    </ItemGroup>
    <ItemGroup>
WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/System/Sys_DictionaryController.cs
@@ -18,6 +18,10 @@
using Quartz;
using WIDESEAWCS_QuartzJob;
using OfficeOpenXml.FormulaParsing.Excel.Functions.DateTime;
using WIDESEAWCS_Common.TaskEnum;
using WIDESEAWCS_Core.Caches;
using WIDESEAWCS_QuartzJob.DeviceEnum;
using WIDESEAWCS_Core.Enums;
namespace WIDESEAWCS_WCSServer.Controllers.System
{
@@ -26,52 +30,348 @@
    public class Sys_DictionaryController : ApiBaseController<ISys_DictionaryService, Sys_Dictionary>
    {
        private readonly IHttpContextAccessor _httpContextAccessor;
        public Sys_DictionaryController(ISys_DictionaryService service, IHttpContextAccessor httpContextAccessor) : base(service)
        private readonly ICacheService _cacheService;
        public Sys_DictionaryController(ISys_DictionaryService service, IHttpContextAccessor httpContextAccessor, ICacheService cacheService) : base(service)
        {
            _httpContextAccessor = httpContextAccessor;
            _cacheService = cacheService;
        }
        [HttpPost, Route("GetVueDictionary"), AllowAnonymous]
        public IActionResult GetVueDictionary([FromBody] string[] dicNos)
        {
            List<VueDictionaryDTO> vueDictionaryDTOs = Service.GetVueDictionary(dicNos);
            #region
            try
            {
                List<string> dicList = dicNos.ToList();
                List<string> selectDicNos = vueDictionaryDTOs.Select(x => x.DicNo).ToList();
                List<string> cacheDicNos = new List<string>();
                foreach (string n in dicNos.Where(x => !selectDicNos.Contains(x)))
                {
                    string? str = _cacheService.Get(n);
                    if (!string.IsNullOrEmpty(str))
                    {
                        VueDictionaryDTO? vueDictionary = JsonConvert.DeserializeObject<VueDictionaryDTO>(str);
                        if (vueDictionary != null)
                        {
                            vueDictionaryDTOs.Add(vueDictionary);
                            cacheDicNos.Add(n);
                        }
                    }
                }
                List<string> dicList = dicNos.ToList();
                List<string> otherDicNos = dicNos.Where(x => !cacheDicNos.Contains(x) && !selectDicNos.Contains(x)).ToList();
                if (otherDicNos.Count() > 0)
                {
                string str = AppSettings.Configuration["dics"];
                if (!string.IsNullOrEmpty(str))
                {
                    string st = vueDictionaryDTOs[0].Data.Serialize();
                    List<string> cusDics = new List<string>();
                    List<string> dics = str.Split(",").ToList();
                    foreach (var item in dics)
                        foreach (var item in otherDicNos)
                    {
                        dicList.Remove(item);
                            if (dics.Contains(item))
                            {
                        cusDics.Add(item);
                            }
                    }
                    foreach (var item in cusDics)
                    {
                        string dic = QuartzJobCommonMethod.GetVueDictionary(item.Trim());
                        if (!string.IsNullOrEmpty(dic))
                            VueDictionaryDTO? vueDictionaryDTO = GetVueDictionary(item.Trim());
                            if (vueDictionaryDTO != null)
                        {
                            VueDictionaryDTO vueDictionaryDTO = JsonConvert.DeserializeObject<VueDictionaryDTO>(dic);
                            vueDictionaryDTOs.Add(vueDictionaryDTO);
                                if (!_cacheService.Exists(item))
                                {
                                    _cacheService.Add(item, vueDictionaryDTO.Serialize());
                        }
                    }
                }
            }
            catch (Exception ex)
                }
            }
            catch
            {
            }
            #endregion
            return Json(vueDictionaryDTOs);
        }
        private VueDictionaryDTO? GetVueDictionary(string key)
        {
            VueDictionaryDTO? result = null;
            try
            {
                switch (key)
                {
                    case "deviceType":
                        {
                            Type type = typeof(IDevice);
                            var basePath = AppContext.BaseDirectory;
                            List<Type> types = type.Assembly.GetTypes().Where(x => type.IsAssignableFrom(x) && !x.IsAbstract && !x.IsInterface).ToList();
                            List<object> data = new List<object>();
                            foreach (var deviceType in types)
                            {
                                DescriptionAttribute? description = deviceType.GetCustomAttribute<DescriptionAttribute>();
                                if (description != null)
                                {
                                    data.Add(new { key = deviceType.Name, value = description.Description });
                                }
                                else
                                {
                                    data.Add(new { key = deviceType.Name, value = deviceType.Name });
                                }
                            }
                            result = new VueDictionaryDTO { DicNo = key, Config = "", Data = data };
                        }
                        break;
                    case "jobAssembly":
                        {
                            result = new VueDictionaryDTO { DicNo = key, Config = "", Data = new List<object>() { new { key = "WIDESEAWCS_Tasks", value = "WIDESEAWCS_Tasks" } } };
                        }
                        break;
                    case "jobClassName":
                        {
                            Type type = typeof(IJob);
                            var basePath = AppContext.BaseDirectory;
                            string path = Path.Combine(basePath, $"WIDESEAWCS_Tasks");
                            Assembly assembly = Assembly.LoadFrom(path);
                            List<Type> types = assembly.GetTypes().Where(x => type.IsAssignableFrom(x) && !x.IsAbstract && !x.IsInterface).ToList();
                            result = new VueDictionaryDTO { DicNo = key, Config = "", Data = types.Select(x => new { key = x.Name, value = x.Name }) };
                        }
                        break;
                    case "deviceStatus":
                        {
                            List<object> data = new List<object>();
                            Type type = typeof(DeviceStatusEnum);
                            List<int> enums = Enum.GetValues(type).Cast<int>().ToList();
                            int index = 0;
                            foreach (var item in enums)
                            {
                                FieldInfo? fieldInfo = type.GetField(((DeviceStatusEnum)item).ToString());
                                DescriptionAttribute? description = fieldInfo.GetCustomAttribute<DescriptionAttribute>();
                                if (description != null)
                                {
                                    data.Add(new { key = item.ToString(), value = description.Description });
                                }
                                else
                                {
                                    data.Add(new { key = item.ToString(), value = item.ToString() });
                                }
                                index++;
                            }
                            result = new VueDictionaryDTO { DicNo = key, Config = "", Data = data };
                        }
                        break;
                    case "taskType":
                        {
                            List<object> data = new List<object>();
                            #region TaskInboundTypeEnum
                            {
                                Type type = typeof(TaskInboundTypeEnum);
                                List<int> enums = Enum.GetValues(typeof(TaskInboundTypeEnum)).Cast<int>().ToList();
                                int index = 0;
                                foreach (var item in enums)
                                {
                                    FieldInfo? fieldInfo = typeof(TaskInboundTypeEnum).GetField(((TaskInboundTypeEnum)item).ToString());
                                    DescriptionAttribute? description = fieldInfo.GetCustomAttribute<DescriptionAttribute>();
                                    if (description != null)
                                    {
                                        data.Add(new { key = item.ToString(), value = description.Description });
                                    }
                                    else
                                    {
                                        data.Add(new { key = item.ToString(), value = item.ToString() });
                                    }
                                    index++;
                                }
                            }
                            #endregion
                            #region TaskOutboundTypeEnum
                            {
                                Type type = typeof(TaskOutboundTypeEnum);
                                List<int> enums = Enum.GetValues(typeof(TaskOutboundTypeEnum)).Cast<int>().ToList();
                                int index = 0;
                                foreach (var item in enums)
                                {
                                    FieldInfo? fieldInfo = typeof(TaskOutboundTypeEnum).GetField(((TaskOutboundTypeEnum)item).ToString());
                                    DescriptionAttribute? description = fieldInfo.GetCustomAttribute<DescriptionAttribute>();
                                    if (description != null)
                                    {
                                        data.Add(new { key = item.ToString(), value = description.Description });
                                    }
                                    else
                                    {
                                        data.Add(new { key = item.ToString(), value = item.ToString() });
                                    }
                                    index++;
                                }
                            }
                            #endregion
                            #region TaskRelocationTypeEnum
                            {
                                Type type = typeof(TaskRelocationTypeEnum);
                                List<int> enums = Enum.GetValues(typeof(TaskRelocationTypeEnum)).Cast<int>().ToList();
                                int index = 0;
                                foreach (var item in enums)
                                {
                                    FieldInfo? fieldInfo = typeof(TaskRelocationTypeEnum).GetField(((TaskRelocationTypeEnum)item).ToString());
                                    DescriptionAttribute? description = fieldInfo.GetCustomAttribute<DescriptionAttribute>();
                                    if (description != null)
                                    {
                                        data.Add(new { key = item.ToString(), value = description.Description });
                                    }
                                    else
                                    {
                                        data.Add(new { key = item.ToString(), value = item.ToString() });
                                    }
                                    index++;
                                }
                            }
                            #endregion
                            #region TaskOtherTypeEnum
                            {
                                Type type = typeof(TaskOtherTypeEnum);
                                List<int> enums = Enum.GetValues(typeof(TaskOtherTypeEnum)).Cast<int>().ToList();
                                int index = 0;
                                foreach (var item in enums)
                                {
                                    FieldInfo? fieldInfo = typeof(TaskOtherTypeEnum).GetField(((TaskOtherTypeEnum)item).ToString());
                                    DescriptionAttribute? description = fieldInfo.GetCustomAttribute<DescriptionAttribute>();
                                    if (description != null)
                                    {
                                        data.Add(new { key = item.ToString(), value = description.Description });
                                    }
                                    else
                                    {
                                        data.Add(new { key = item.ToString(), value = item.ToString() });
                                    }
                                    index++;
                                }
                            }
                            #endregion
                            result = new VueDictionaryDTO { DicNo = key, Config = "", Data = data };
                        }
                        break;
                    case "taskState":
                        {
                            List<object> data = new List<object>();
                            #region TaskInStatusEnum
                            {
                                Type type = typeof(TaskInStatusEnum);
                                List<int> enums = Enum.GetValues(typeof(TaskInStatusEnum)).Cast<int>().ToList();
                                int index = 0;
                                foreach (var item in enums)
                                {
                                    FieldInfo? fieldInfo = typeof(TaskInStatusEnum).GetField(((TaskInStatusEnum)item).ToString());
                                    DescriptionAttribute? description = fieldInfo.GetCustomAttribute<DescriptionAttribute>();
                                    if (description != null)
                                    {
                                        data.Add(new { key = item.ToString(), value = description.Description });
                                    }
                                    else
                                    {
                                        data.Add(new { key = item.ToString(), value = item.ToString() });
                                    }
                                    index++;
                                }
                            }
                            #endregion
                            #region TaskOutStatusEnum
                            {
                                Type type = typeof(TaskOutStatusEnum);
                                List<int> enums = Enum.GetValues(typeof(TaskOutStatusEnum)).Cast<int>().ToList();
                                int index = 0;
                                foreach (var item in enums)
                                {
                                    FieldInfo? fieldInfo = typeof(TaskOutStatusEnum).GetField(((TaskOutStatusEnum)item).ToString());
                                    DescriptionAttribute? description = fieldInfo.GetCustomAttribute<DescriptionAttribute>();
                                    if (description != null)
                                    {
                                        data.Add(new { key = item.ToString(), value = description.Description });
                                    }
                                    else
                                    {
                                        data.Add(new { key = item.ToString(), value = item.ToString() });
                                    }
                                    index++;
                                }
                            }
                            #endregion
                            result = new VueDictionaryDTO { DicNo = key, Config = "", Data = data };
                        }
                        break;
                    case "devicePlcType":
                        {
                            Type type = typeof(BaseCommunicator);
                            var basePath = AppContext.BaseDirectory;
                            string path = Path.Combine(basePath, $"WIDESEAWCS_Communicator.dll");
                            Assembly assembly = Assembly.LoadFrom(path);
                            List<Type> types = assembly.GetTypes().Where(x => type.IsAssignableFrom(x) && !x.IsAbstract && !x.IsInterface).ToList();
                            List<object> data = new List<object>();
                            foreach (var deviceType in types)
                            {
                                DescriptionAttribute? description = deviceType.GetCustomAttribute<DescriptionAttribute>();
                                if (description != null)
                                {
                                    data.Add(new { key = deviceType.Name, value = description.Description });
                                }
                                else
                                {
                                    data.Add(new { key = deviceType.Name, value = deviceType.Name });
                                }
                            }
                            result = new VueDictionaryDTO { DicNo = key, Config = "", Data = data };
                        }
                        break;
                    case "inOutType":
                        {
                            List<object> data = new List<object>();
                            Type type = typeof(RouterInOutType);
                            List<int> enums = Enum.GetValues(typeof(RouterInOutType)).Cast<int>().ToList();
                            int index = 0;
                            foreach (var item in enums)
                            {
                                FieldInfo? fieldInfo = typeof(RouterInOutType).GetField(((RouterInOutType)item).ToString());
                                DescriptionAttribute? description = fieldInfo.GetCustomAttribute<DescriptionAttribute>();
                                if (description != null)
                                {
                                    data.Add(new { key = item.ToString(), value = description.Description });
                                }
                                else
                                {
                                    data.Add(new { key = item.ToString(), value = item.ToString() });
                                }
                                index++;
                            }
                            result = new VueDictionaryDTO { DicNo = key, Config = "", Data = data };
                        }
                        break;
                }
                return result;
            }
            catch (Exception ex)
            {
                return null;
            }
        }
    }
}
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();
WIDESEAWCS_Server/WIDESEAWCS_SystemServices/Sys_DictionaryService.cs
@@ -7,7 +7,6 @@
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using WIDESEAWCS_Common.TaskEnum;
using WIDESEAWCS_Core.BaseRepository;
using WIDESEAWCS_Core.BaseServices;
using WIDESEAWCS_Core.Caches;
WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskExecuteDetailService.cs
@@ -22,6 +22,7 @@
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using WIDESEAWCS_Common.TaskEnum;
using WIDESEAWCS_Core;
using WIDESEAWCS_Core.BaseServices;
using WIDESEAWCS_Core.Enums;
WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs
@@ -26,6 +26,7 @@
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using WIDESEAWCS_Common.TaskEnum;
using WIDESEAWCS_Core;
using WIDESEAWCS_Core.BaseServices;
using WIDESEAWCS_Core.Enums;
WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs
@@ -6,6 +6,7 @@
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEAWCS_Common.TaskEnum;
using WIDESEAWCS_Core.Enums;
using WIDESEAWCS_ITaskInfoRepository;
using WIDESEAWCS_ITaskInfoService;