1
hutongqing
2024-09-13 3ca95f10e441ff66d4d62f8dfe202bfb26c3c8e8
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
using Autofac.Core;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.DependencyModel;
using Newtonsoft.Json;
using System.Reflection;
using WIDESEAWCS_Core.BaseController;
using WIDESEAWCS_Core.Helper;
using WIDESEAWCS_ISystemServices;
using WIDESEAWCS_Model.Models;
using System.IO;
using WIDESEAWCS_QuartzJob.DeviceBase;
using WIDESEAWCS_DTO.System;
using System.ComponentModel;
using System.Collections.Generic;
using WIDESEAWCS_Communicator;
using Quartz;
using WIDESEAWCS_QuartzJob;
using OfficeOpenXml.FormulaParsing.Excel.Functions.DateTime;
 
namespace WIDESEAWCS_WCSServer.Controllers.System
{
    [Route("api/Sys_Dictionary")]
    [ApiController]
    public class Sys_DictionaryController : ApiBaseController<ISys_DictionaryService, Sys_Dictionary>
    {
        private readonly IHttpContextAccessor _httpContextAccessor;
        public Sys_DictionaryController(ISys_DictionaryService service, IHttpContextAccessor httpContextAccessor) : base(service)
        {
            _httpContextAccessor = httpContextAccessor;
        }
 
        [HttpPost, Route("GetVueDictionary"), AllowAnonymous]
        public IActionResult GetVueDictionary([FromBody] string[] dicNos)
        {
            List<VueDictionaryDTO> vueDictionaryDTOs = Service.GetVueDictionary(dicNos);
            #region
            try
            {
                List<string> dicList = dicNos.ToList();
 
                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)
                    {
                        dicList.Remove(item);
                        cusDics.Add(item);
                    }
 
                    foreach (var item in cusDics)
                    {
                        string dic = QuartzJobCommonMethod.GetVueDictionary(item.Trim());
                        if (!string.IsNullOrEmpty(dic))
                        {
                            VueDictionaryDTO vueDictionaryDTO = JsonConvert.DeserializeObject<VueDictionaryDTO>(dic);
                            vueDictionaryDTOs.Add(vueDictionaryDTO);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
 
            }
            #endregion
            return Json(vueDictionaryDTOs);
        }
    }
}