From b5bc0d6eb2d2e55ea830a1b286252b9754cbf8e9 Mon Sep 17 00:00:00 2001
From: hutongqing <hutongqing@hnkhzn.com>
Date: 星期三, 21 八月 2024 11:21:04 +0800
Subject: [PATCH] 更新主从表添加、修改、删除时对从表的对应操作

---
 WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/System/Sys_DictionaryController.cs |   53 +++++++++++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 51 insertions(+), 2 deletions(-)

diff --git a/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/System/Sys_DictionaryController.cs b/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/System/Sys_DictionaryController.cs
index 2108a61..520f0ca 100644
--- a/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/System/Sys_DictionaryController.cs
+++ b/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/System/Sys_DictionaryController.cs
@@ -2,16 +2,28 @@
 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>
+    public class Sys_DictionaryController : ApiBaseController<ISys_DictionaryService, Sys_Dictionary>
     {
         private readonly IHttpContextAccessor _httpContextAccessor;
         public Sys_DictionaryController(ISys_DictionaryService service, IHttpContextAccessor httpContextAccessor) : base(service)
@@ -22,7 +34,44 @@
         [HttpPost, Route("GetVueDictionary"), AllowAnonymous]
         public IActionResult GetVueDictionary([FromBody] string[] dicNos)
         {
-            return Content(Service.GetVueDictionary(dicNos).Serialize());
+            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);
         }
     }
 }

--
Gitblit v1.9.3