Browse Source

解决合并冲突

jiangjc 1 year ago
parent
commit
1fa2c093b5
35 changed files with 1990 additions and 138 deletions
  1. 3 65
      OASystem/OASystem.Api/Controllers/AuthController.cs
  2. 63 0
      OASystem/OASystem.Api/Controllers/CRMController.cs
  3. 0 1
      OASystem/OASystem.Api/Controllers/GroupsController.cs
  4. 128 4
      OASystem/OASystem.Api/Controllers/SmallFunController.cs
  5. 139 1
      OASystem/OASystem.Api/Controllers/SystemController.cs
  6. 25 2
      OASystem/OASystem.Api/Controllers/TencentOCRController.cs
  7. 74 0
      OASystem/OASystem.Api/OAMethodLib/ChatGPT/ChatGPTTools.cs
  8. 1 1
      OASystem/OASystem.Api/OAMethodLib/ExcelOutput/Excel_BusConfItemList.cs
  9. 77 0
      OASystem/OASystem.Api/OAMethodLib/File/AsposeHelper.cs
  10. 146 0
      OASystem/OASystem.Api/OAMethodLib/File/NPOIHelper.cs
  11. 73 0
      OASystem/OASystem.Api/OAMethodLib/GoogleMapAPI/GoogleMapTools.cs
  12. 34 35
      OASystem/OASystem.Api/OAMethodLib/GroupStepForDelegation.cs
  13. 0 1
      OASystem/OASystem.Api/OAMethodLib/TencentCloudAPI/TencentOCRTools.cs
  14. 169 0
      OASystem/OASystem.Api/OAMethodLib/YouDaoAPI/YouDaoApiTools.cs
  15. 2 1
      OASystem/OASystem.Api/OASystem.API.csproj
  16. 6 3
      OASystem/OASystem.Api/Program.cs
  17. 15 2
      OASystem/OASystem.Domain/AutoMappers/_baseMappingProfile.cs
  18. 59 0
      OASystem/OASystem.Domain/Dtos/CRM/ClientCompanyDto.cs
  19. 19 0
      OASystem/OASystem.Domain/Dtos/SmallFun/ChatGptDto.cs
  20. 31 0
      OASystem/OASystem.Domain/Dtos/SmallFun/GoogleMapApiDto.cs
  21. 30 0
      OASystem/OASystem.Domain/Dtos/SmallFun/YouDaoDto.cs
  22. 53 0
      OASystem/OASystem.Domain/Dtos/System/SetDataDto.cs
  23. 47 1
      OASystem/OASystem.Domain/Dtos/System/setDataTypeDto.cs
  24. 6 2
      OASystem/OASystem.Domain/ViewModels/CRM/VisaCustomerCompanyView.cs
  25. 233 0
      OASystem/OASystem.Domain/ViewModels/SmallFun/GoogleMapResultView.cs
  26. 34 0
      OASystem/OASystem.Domain/ViewModels/SmallFun/GoogleMapView.cs
  27. 158 0
      OASystem/OASystem.Domain/ViewModels/SmallFun/YouDaoLanguageView.cs
  28. 8 1
      OASystem/OASystem.Domain/ViewModels/System/SetDataView.cs
  29. 8 0
      OASystem/OASystem.Domain/ViewModels/TencentOCR/IDCardOCRView.cs
  30. 70 7
      OASystem/OASystem.Infrastructure/Repositories/CRM/VisaDeleClientCompanyRepository.cs
  31. 181 3
      OASystem/OASystem.Infrastructure/Repositories/System/SetDataRepository.cs
  32. 68 6
      OASystem/OASystem.Infrastructure/Repositories/System/SetDataTypeRepository.cs
  33. 28 1
      OASystem/OASystem.Infrastructure/Repositories/System/SystemMenuPermissionRepository.cs
  34. 1 0
      OASystem/OASystem.Infrastructure/Tools/CommonFun.cs
  35. 1 1
      OASystem/_Doc/OA2023数据字典.docx

+ 3 - 65
OASystem/OASystem.Api/Controllers/AuthController.cs

@@ -51,17 +51,17 @@ namespace OASystem.API.Controllers
             }
 
             #endregion
-            IActionResult authData = null;
+            Result authData = null;
             if (userData.Data != null)
             {
                 var uid = (userData.Data as UserLoginInfoView).UserId;
-                authData = await MenuLoad(new MenuLoadDto() { PortType = dto.PortType, UserId = uid });
+                authData = _SystemMenuPermissionRepository.QueryMenuLoad(uid, dto.PortType);
             }
 
             var view = new LoginView
             {
                 UserInfo = userData == null ? null : userData.Data,
-                AuthData = authData != null ? (authData as OkObjectResult).Value : null,
+                AuthData = authData == null ? null : authData.Data,
             };
 
             DateTime createZebraTime = DateTime.Now;
@@ -184,67 +184,5 @@ namespace OASystem.API.Controllers
 
             return Ok(JsonView(view));
         }
-
-
-
-        /// <summary>
-        /// 菜单加载
-        /// </summary>
-        /// <returns></returns>
-        [HttpPost]
-        [HttpPost("MenuLoad")]
-        [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
-        public async Task<IActionResult> MenuLoad(MenuLoadDto dto)
-        {
-            var QueryResult = _SystemMenuPermissionRepository.QueryMenuLoad(dto.UserId,dto.PortType);
-            ArrayList arr = new ArrayList();
-            JsonView ViewData = new JsonView();
-            ViewData.Code = 400;
-            ViewData.Msg = "错误!";
-            ViewData.Data = null;
-
-            if (QueryResult.Code == 0)
-            {
-                if (dto.PortType == 1)
-                {
-                    var menuGroup = (QueryResult.Data as List<MenuLoadView>).GroupBy(x => x.modulid);
-                    foreach (var item in menuGroup)
-                    {
-                        var modul = item.FirstOrDefault();
-                        if (modul != null)
-                        {
-                            arr.Add(new
-                            {
-                                modulName = modul.modulName,
-                                modulid = modul.modulid,
-                                pageList = item
-                            });
-                        }
-                    }
-
-                    ViewData.Code = 200;
-                    ViewData.Msg = QueryResult.Msg;
-                    ViewData.Data = arr;
-
-                }
-                else if (dto.PortType == 2)
-                {
-                    var pages = (QueryResult.Data as List<MenuLoadView>).Select(x => x.pageid).ToArray();
-                    arr = ArrayList.Adapter(pages);
-
-                    ViewData.Code = 200;
-                    ViewData.Msg = QueryResult.Msg;
-                    ViewData.Data = arr;
-                }
-            }
-            else
-            {
-                ViewData.Msg = "错误!(" + QueryResult.Msg + ")";
-            }
-
-            return Ok(ViewData);
-        }
-
-
     }
 }

+ 63 - 0
OASystem/OASystem.Api/Controllers/CRMController.cs

@@ -1,5 +1,7 @@
 using Microsoft.AspNetCore.Http;
 using Microsoft.AspNetCore.Mvc;
+using OASystem.Domain.Dtos.CRM;
+using OASystem.Domain.Entities.Customer;
 using OASystem.Infrastructure.Repositories.CRM;
 
 namespace OASystem.API.Controllers
@@ -44,6 +46,67 @@ namespace OASystem.API.Controllers
             return Ok(JsonView(clientCompanyData.Data, clientCompanyData.Data.Count));
         }
 
+        /// <summary>
+        /// 签证客户公司列表操作(Status:1.新增,2.修改)
+        /// </summary>
+        /// <param name="dto"></param>
+        /// <returns></returns>
+        [HttpPost]
+        [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
+        public async Task<IActionResult> OperationClientCompany(OperationClientCompanyDto dto)
+        {
+            try
+            {
+                if (dto.CompanyName == "")
+                {
+                    return Ok(JsonView(false, "请检查客户单位名称是否填写!"));
+                }
+                if (dto.Address == "")
+                {
+                    return Ok(JsonView(false, "请检查客户单位地址是否填写!"));
+                }
+                if (dto.PostCodes == "")
+                {
+                    return Ok(JsonView(false, "请检查客户单位邮编是否填写!"));
+                }
+                Result clientCompanyData = await _clientCompanyRepository.OperationClientCompany(dto);
+              
+                if (clientCompanyData.Code != 0)
+                {
+                    return Ok(JsonView(false, clientCompanyData.Msg));
+                }
+                return Ok(JsonView(true, clientCompanyData.Msg));
+            }
+            catch (Exception)
+            {
+                return Ok(JsonView(false, "程序错误!"));
+                throw;
+            }
+            
+        }
+        /// <summary>
+        /// 签证客户公司列表操作(删除)
+        /// </summary>
+        /// <returns></returns>
+        [HttpPost]
+        [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
+        public async Task<IActionResult> DelClientCompany(ClientCompanyDto dto)
+        {
+            try
+            {
+                var res = await _clientCompanyRepository.SoftDeleteByIdAsync<Crm_CustomerCompany>(dto.Id.ToString(), dto.DeleteUserId);
+                if (!res)
+                {
+                    return Ok(JsonView(false, "删除失败"));
+                }
+                return Ok(JsonView(true, "删除成功!"));
+            }
+            catch (Exception ex)
+            {
+                return Ok(JsonView(false, "程序错误!"));
+                throw;
+            }
+        }
         /// <summary>
         /// 获取签证客户列表
         /// </summary>

+ 0 - 1
OASystem/OASystem.Api/Controllers/GroupsController.cs

@@ -1,7 +1,6 @@
 using Microsoft.AspNetCore.Mvc;
 using Newtonsoft.Json.Serialization;
 using OASystem.API.OAMethodLib;
-using OASystem.API.OAMethodLibs;
 using OASystem.Domain.Dtos.Groups;
 using OASystem.Domain.Entities.Groups;
 using OASystem.Domain.ViewModels.Groups;

+ 128 - 4
OASystem/OASystem.Api/Controllers/SmallFunController.cs

@@ -2,17 +2,23 @@
 using Microsoft.AspNetCore.Mvc;
 using Microsoft.Extensions.Options;
 using MySqlX.XDevAPI;
+using OASystem.API.OAMethodLib.ChatGPT;
+using OASystem.API.OAMethodLib.GoogleMapAPI;
 using OASystem.API.OAMethodLib.JuHeAPI;
+using OASystem.API.OAMethodLib.YouDaoAPI;
 using OASystem.Domain.Dtos.Groups;
 using OASystem.Domain.Dtos.SmallFun;
 using OASystem.Domain.ViewModels.JuHeExchangeRate;
+using OASystem.Domain.ViewModels.SmallFun;
 using SqlSugar;
 using System.Buffers;
 using System.Collections.Generic;
 using System.Collections.Immutable;
 using System.Collections.Specialized;
+using System.Diagnostics;
 using System.Text.Json;
 using System.Text.Json.Nodes;
+using System.Transactions;
 using System.Xml.Linq;
 
 namespace OASystem.API.Controllers
@@ -37,15 +43,14 @@ namespace OASystem.API.Controllers
             this._config = config;
         }
 
-
-        #region 聚合汇率相关
+        #region 聚合API 汇率相关
         /// <summary>
         /// 获取汇率币种
         /// </summary>
         /// <returns></returns>
         [HttpPost]
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
-        public async Task<IActionResult> GeRateCurrency()
+        public async Task<IActionResult> GetCurrencys()
         {
             var rateCurrencyData = AppSettingsHelper.Get<RateCurrencyModel>("RateCurrency");
 
@@ -59,7 +64,7 @@ namespace OASystem.API.Controllers
         /// <returns></returns>
         [HttpPost]
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
-        public async Task<IActionResult> GeExchangeRate(ExchangeRateDto rateDto)
+        public async Task<IActionResult> GetCurrencyExchange(ExchangeRateDto rateDto)
         {
             #region 参数处理
             if (string.IsNullOrEmpty(rateDto.CurrencyCodePer) || string.IsNullOrEmpty(rateDto.CurrencyCodeSuf))
@@ -82,7 +87,126 @@ namespace OASystem.API.Controllers
         }
         #endregion
 
+        #region 有道API 文本翻译
+
+        /// <summary>
+        /// 有道翻译 所有语种
+        /// </summary>
+        /// <returns></returns>
+        [HttpPost]
+        [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
+        public async Task<IActionResult> GetLuaguages()
+        {
+            var luaguages = new GetYouDaoLanguages().Luanguages;
+            return Ok(JsonView(luaguages));
+        }
+
+        /// <summary>
+        /// 有道翻译
+        /// </summary>
+        /// <param name="dto">待翻译的文本 目前只支持 中转英</param>
+        /// <returns></returns>
+        [HttpPost]
+        [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
+        public async Task<IActionResult> GetTranslate(YouDaoDto dto)
+        {
+            if (string.IsNullOrEmpty(dto.Txt))
+            {
+                return Ok(JsonView("待翻译的文本不能为空!"));
+            }
+            string from = "zh-CHS", to = "en";
+            if (!string.IsNullOrEmpty(dto.From) && !string.IsNullOrEmpty(dto.To))
+            {
+                var luaguuages = new GetYouDaoLanguages().Luanguages;
+                
+                var fromLuaguage = luaguuages.Where(a => a.Code == dto.From).FirstOrDefault();
+                var toLuaguage = luaguuages.Where(a => a.Code == dto.To).FirstOrDefault();
+                if (fromLuaguage == null)
+                {
+                    return Ok(JsonView("源语言code不支持!"));
+                }
+                if (toLuaguage == null)
+                {
+                    return Ok(JsonView("目标语言code不支持!"));
+                }
+
+                from = dto.From;
+                to = dto.To;
+            }
+
+
+            var translateData = await YouDaoApiTools.GetReTrans(dto.Txt, from, to);
+
+            if (translateData == null || translateData.Code != 0) 
+            {
+                return Ok(JsonView(false, translateData.Msg));
+            }
+
+            return Ok(JsonView( new { translation = translateData.Data }));
+        }
 
+        #endregion
+
+        #region googleMapApi 
 
+        /// <summary>
+        /// googleMapApi 获取距离And时间
+        /// </summary>
+        /// <param name="dto">
+        /// 请求参数默认值
+        /// origin:"FERİT RECAİ ERTUĞRUL CAD. NO: 18 ORAN / ANKARA,Turkey"; 
+        /// destination : "Dudullu Mh. Imes Sanayi Sitesi 504. Sk. No:4/B1 Umraniye/Istanbul";
+        /// </param>
+        /// <returns></returns>
+        [HttpPost]
+        [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
+        public async Task<IActionResult> GetGooglMapForeignAndTime(GoogleMapDirectionsDto dto)
+        {
+            var data = await GoogleMapTools.GetForeignAndTime(dto.origin,dto.destination);
+
+            if (data == null || data.Code != 0)
+            {
+                return Ok(JsonView(false, data.Msg));
+            }
+
+            return Ok(JsonView(data.Data));
+        }
+
+        #endregion
+
+        #region ChatGPT
+
+        /// <summary>
+        /// ChatGPT 自动补全
+        /// </summary>
+        /// <param name="dto"> </param>
+        /// <returns></returns>
+        [HttpPost]
+        [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
+        public async Task<IActionResult> ChatGptCompletions(CompletionsDto dto)
+        {
+            if (string.IsNullOrEmpty(dto.Prompt)) 
+            {
+                return Ok(JsonView(false,"待自动补全的文本为空!"));
+            }
+
+            Stopwatch sw = new Stopwatch();
+            sw.Start();
+            Thread.Sleep(999);
+            Console.WriteLine($"程序耗时:{sw.ElapsedMilliseconds}ms.");
+
+            var data = await ChatGPTTools.Completions(dto.Prompt);
+
+            sw.Stop();
+            if (data == null || data.Code != 0)
+            {
+                return Ok(JsonView(false, data.Msg+"【耗时:"+ sw.ElapsedMilliseconds/1000+ "ms】"));
+            }
+
+            return Ok(JsonView(200,  "【耗时:"+ sw.ElapsedMilliseconds/1000 + "s】", data.Data));
+        }
+
+
+        #endregion
     }
 }

+ 139 - 1
OASystem/OASystem.Api/Controllers/SystemController.cs

@@ -171,7 +171,7 @@ namespace OASystem.API.Controllers
         /// <returns></returns>
         [HttpPost]
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
-        public async Task<IActionResult> QuerySetDataType(setDataTypeDto dto)
+        public async Task<IActionResult> QuerySetDataType(SetDataTypeDto dto)
         {
             try
             {
@@ -191,6 +191,144 @@ namespace OASystem.API.Controllers
                 throw;
             }
         }
+
+        /// <summary>
+        /// 数据类型表操作(Status:1.新增,2.修改)
+        /// </summary>
+        /// <param name="dto"></param>
+        /// <returns></returns>
+        [HttpPost]
+        [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
+        public async Task<IActionResult> OperationSetDataType(OperationSetDataTypeDto dto)
+        {
+            try
+            {
+                if (dto.Name == "")
+                {
+                    return Ok(JsonView(false, "请检查类型名称是否填写!"));
+                }
+                Result result = await _setDataTypeRep.OperationSetDataType(dto);
+                if (result.Code != 0)
+                {
+                    return Ok(JsonView(false, result.Msg));
+                }
+                return Ok(JsonView(true, result.Msg));
+            }
+            catch (Exception ex)
+            {
+                return Ok(JsonView(false, "程序错误!"));
+                throw;
+            }
+        }
+
+        /// <summary>
+        /// 数据类型表操作删除
+        /// </summary>
+        /// <param name="dto"></param>
+        /// <returns></returns>
+        [HttpPost]
+        [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
+        public async Task<IActionResult> DelSetDataType(DelSetDataTypeDto dto)
+        {
+            try
+            {
+                var res = await _setDataTypeRep.SoftDeleteByIdAsync<Sys_SetDataType>(dto.Id.ToString(), dto.DeleteUserId);
+                if (!res)
+                {
+                    return Ok(JsonView(false, "删除失败"));
+                }
+                return Ok(JsonView(true, "删除成功!"));
+            }
+            catch (Exception ex)
+            {
+                return Ok(JsonView(false, "程序错误!"));
+                throw;
+            }
+        }
+        #endregion
+
+        #region 数据类型板块
+        /// <summary>
+        /// 数据类型板块表查询
+        /// </summary>
+        /// <param name="dto"></param>
+        /// <returns></returns>
+        [HttpPost]
+        [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
+        public async Task<IActionResult> QuerySetDataInfo(SetDataIDto dto)
+        {
+            try
+            {
+                Result setData = await _setDataRepository.QuerySetData(dto);
+                if (setData.Code == 0)
+                {
+                    return Ok(JsonView(true, "查询成功", setData.Data));
+                }
+                else
+                {
+                    return Ok(JsonView(false, setData.Msg));
+                }
+            }
+            catch (Exception)
+            {
+                return Ok(JsonView(false, "程序错误!"));
+                throw;
+            }
+        }
+
+        /// <summary>
+        /// 数据类型板块表操作(Status:1.新增,2.修改)
+        /// </summary>
+        /// <param name="dto"></param>
+        /// <returns></returns>
+        [HttpPost]
+        [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
+        public async Task<IActionResult> OperationSetData(OperationSetDataDto dto)
+        {
+            try
+            {
+                if (dto.Name == "")
+                {
+                    return Ok(JsonView(false, "请检查板块名称是否填写!"));
+                }
+                Result result = await _setDataRepository.OperationSetData(dto);
+                if (result.Code != 0)
+                {
+                    return Ok(JsonView(false, result.Msg));
+                }
+                return Ok(JsonView(true, result.Msg));
+            }
+            catch (Exception ex)
+            {
+                return Ok(JsonView(false, "程序错误!"));
+                throw;
+            }
+        }
+
+        /// <summary>
+        /// 数据类型表操作删除
+        /// </summary>
+        /// <param name="dto"></param>
+        /// <returns></returns>
+        [HttpPost]
+        [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
+        public async Task<IActionResult> DelSetData(DelSetDataDto dto)
+        {
+            try
+            {
+                var res = await _setDataRepository.SoftDeleteByIdAsync<Sys_SetData>(dto.Id.ToString(), dto.DeleteUserId);
+                if (!res)
+                {
+                    return Ok(JsonView(false, "删除失败"));
+                }
+                return Ok(JsonView(true, "删除成功!"));
+            }
+            catch (Exception ex)
+            {
+                return Ok(JsonView(false, "程序错误!"));
+                throw;
+            }
+        }
         #endregion
 
         #region 企业操作

+ 25 - 2
OASystem/OASystem.Api/Controllers/TencentOCRController.cs

@@ -1,8 +1,11 @@
-using OASystem.API.OAMethodLib.TencentCloudAPI;
+using OASystem.API.OAMethodLib.File;
+using OASystem.API.OAMethodLib.NPOI;
+using OASystem.API.OAMethodLib.TencentCloudAPI;
 using OASystem.Domain.Dtos.CRM;
 using OASystem.Domain.Dtos.Tencent;
 using OASystem.Domain.ViewModels.TencentOCR;
 using OASystem.Infrastructure.Repositories.CRM;
+using Org.BouncyCastle.Crypto;
 using StackExchange.Redis;
 using System.Net.NetworkInformation;
 using TencentCloud.Ocr.V20181119.Models;
@@ -107,7 +110,7 @@ namespace OASystem.API.Controllers
                     CerdAddress = idCardData.Data.Address,
                 });
 
-            IDCardOCRView iDCardOCRView = new IDCardOCRView()
+            IDCardOCRAndDownUrlView iDCardOCRView = new IDCardOCRAndDownUrlView()
             {
                 Status = cerdStatus,
                 Name = idCardData.Data.Name,
@@ -120,6 +123,26 @@ namespace OASystem.API.Controllers
                 ValidDate = idCardData.Data.ValidDate
             };
 
+            #region word生成 返回地址
+            string tempPath = string.Format("{0}", "C:\\Server\\File\\OA2023\\Office\\Word\\TencentOCR\\Template\\ocr_身份证(人像面).doc");
+
+            Dictionary<string, object> dic = new Dictionary<string, object>();
+            dic.Add("Name", iDCardOCRView.Name);
+            dic.Add("Sex", iDCardOCRView.Sex);
+            dic.Add("Nation", iDCardOCRView.Nation);
+            dic.Add("Birth", iDCardOCRView.Birth);
+            dic.Add("Address", iDCardOCRView.Address);
+            dic.Add("IdNum", iDCardOCRView.IdNum);
+            dic.Add("Authority", iDCardOCRView.Authority);
+            dic.Add("ValidDate", iDCardOCRView.ValidDate);
+
+            string downPath = string.Format("C:\\Server\\File\\OA2023\\Office\\Word\\TencentOCR\\Save\\{0}.doc",
+                dic["Name"].ToString() + "身份证(人像面)" + DateTime.Now.ToString("yyyyMMddHHmmss"));
+
+            string serverPathh = AsposeHelper.ExpertWordToModel(tempPath, downPath, dic, null);
+            iDCardOCRView.DownUrl = serverPathh.Replace("C:", "http:\\132.232.92.186");
+            #endregion
+
             return Ok(JsonView(iDCardOCRView));
         }
 

+ 74 - 0
OASystem/OASystem.Api/OAMethodLib/ChatGPT/ChatGPTTools.cs

@@ -0,0 +1,74 @@
+using Microsoft.AspNetCore.Http;
+using OASystem.Domain;
+using OpenAI.GPT3.Managers;
+using OpenAI.GPT3;
+using Org.BouncyCastle.Ocsp;
+using System.Net.Http;
+using System.Net.Http.Headers;
+using OpenAI.GPT3.ObjectModels.RequestModels;
+using OpenAI.GPT3.ObjectModels;
+using static OpenAI.GPT3.ObjectModels.SharedModels.IOpenAiModels;
+using System.IO;
+
+namespace OASystem.API.OAMethodLib.ChatGPT
+{
+    /// <summary>
+    /// ChatGPT 3.5
+    /// </summary>
+    public static class ChatGPTTools
+    {
+        private readonly static string _appKey = "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";
+        private readonly static HttpClient _httpClient = new HttpClient { BaseAddress = new Uri("https://api.openai.com") };
+
+
+        /// <summary>
+        /// ChatGPT - Completions 自动补全
+        /// </summary>
+        /// <param name="prompt">提示(问题)</param>
+        /// <returns></returns>
+        public static async Task<Result> Completions(string prompt)
+        {
+            var result = new Result();
+
+            string url = string.Format("{0}", "/v1/completions");
+            var reqData = new CompletionCreateRequest()
+            {
+                Prompt = prompt,     //提示(问题) 你向API提供的提示,即你提出的问题
+                Temperature = 0.3f,  //创新采样 取值范围0-1,当设置为0时,对于相同的问题,模型始终返回相同或者相近的结果,
+                                     //设置1则与上次的回答更加不同。默认1
+                TopP =1f,            //默认1。替代temperature使用,考虑了模型质量,0.1为生成结果的质量为10%,建议使用1。
+                N = 1,               //默认1。针对提示所生成结果的次数,会大量消耗令牌。
+                Stream = false,      //默认false。是否以流式返回部分进度,流完成后会发送终止消息data:[DONE]
+                Echo = false,        //默认false,在返回结果外,还显示用户给的问题
+                //Stop = "",           //最多四个序列,返回的文本不包括停止序列
+                MaxTokens = 1024,    //默认16,大多数模型支持最大为204
+            };
+
+            return await PostChatGPT(url, reqData);
+        }
+
+        /// <summary>
+        /// post 访问 
+        /// </summary>
+        /// <param name="url">接口路径</param>
+        /// <param name="formData">请求参数</param>
+        /// <returns></returns>
+        public static async Task<Result> PostChatGPT(string url, CompletionCreateRequest reqData)
+        {
+            Result result = new Result();
+
+            OpenAIService service = new OpenAIService(new OpenAiOptions() { ApiKey = _appKey });
+
+            var res = await service.Completions.CreateCompletion(reqData, Models.TextDavinciV3);
+
+            if (res.Successful)
+            {
+                result.Code = 0;
+                result.Data =  new { Text = res.Choices.FirstOrDefault().Text };
+            }
+            else result.Msg = "访问失败!";
+
+            return result;
+        }
+    }
+}

+ 1 - 1
OASystem/OASystem.Api/OAMethodLib/ExcelOutput/Excel_BusConfItemList.cs

@@ -31,7 +31,7 @@ namespace OASystem.API.OAMethodLib.ExcelOutput
 
             if (!string.IsNullOrEmpty(_entity.ExcelPath))
             {
-                if (File.Exists(_entity.ExcelPath))
+                if (System.IO.File.Exists(_entity.ExcelPath))
                 {
                     //存在 
                     string fileUrl = url + path + _entity.ExcelPath;

File diff suppressed because it is too large
+ 77 - 0
OASystem/OASystem.Api/OAMethodLib/File/AsposeHelper.cs


+ 146 - 0
OASystem/OASystem.Api/OAMethodLib/File/NPOIHelper.cs

@@ -0,0 +1,146 @@
+//using NPOI.XWPF.UserModel;
+
+namespace OASystem.API.OAMethodLib.NPOI
+{
+    /// <summary>
+    /// word / excel 
+    /// </summary>
+    public class NPOIHelper
+    {
+        //#region Word
+        ///// <summary>
+        ///// 输出模板docx文档(使用字典)
+        ///// </summary>
+        ///// <param name="tempFilePath">docx文件路径</param>
+        ///// <param name="outPath">输出文件路径</param>
+        ///// <param name="data">字典数据源</param>
+        //public static void Export(string tempFilePath, string outPath, Dictionary<string, string> data)
+        //{
+        //    try
+        //    {
+        //        using (FileStream stream = File.OpenRead(tempFilePath ))
+        //        {
+        //            XWPFDocument doc = new XWPFDocument(stream);
+        //            //遍历段落                  
+        //            foreach (var para in doc.Paragraphs)
+        //            {
+        //                ReplaceKey(para, data);
+        //            }
+
+        //            //遍历表格      
+        //            foreach (var table in doc.Tables)
+        //            {
+        //                foreach (var row in table.Rows)
+        //                {
+        //                    foreach (var cell in row.GetTableCells())
+        //                    {
+        //                        foreach (var para in cell.Paragraphs)
+        //                        {
+        //                            ReplaceKey(para, data);
+        //                        }
+        //                    }
+        //                }
+        //            }
+
+        //            //写文件
+        //            FileStream outFile = new FileStream(outPath, FileMode.Create);
+        //            doc.Write(outFile);
+        //            outFile.Close();
+        //        }
+        //    }
+        //    catch (Exception ex)
+        //    {
+
+        //        throw;
+        //    }
+            
+        //}
+        //private static void ReplaceKey(XWPFParagraph para, Dictionary<string, string> data)
+        //{
+        //    string text = "";
+        //    foreach (var run in para.Runs)
+        //    {
+        //        text = run.ToString();
+        //        foreach (var key in data.Keys)
+        //        {
+        //            //$$模板中数据占位符为$KEY$
+        //            if (text.Contains($"${key}$"))
+        //            {
+        //                text = text.Replace($"${key}$", data[key]);
+        //            }
+        //        }
+        //        run.SetText(text, 0);
+        //    }
+        //}
+
+        ///// <summary>
+        ///// 输出模板docx文档(使用反射)
+        ///// </summary>
+        ///// <param name="tempFilePath">docx文件路径</param>
+        ///// <param name="outPath">输出文件路径</param>
+        ///// <param name="data">对象数据源</param>
+        //public static void ExportObjet(string tempFilePath, string outPath, object data)
+        //{
+        //    using (FileStream stream = File.OpenRead(tempFilePath))
+        //    {
+        //        XWPFDocument doc = new XWPFDocument(stream);
+        //        //遍历段落                  
+        //        foreach (var para in doc.Paragraphs)
+        //        {
+        //            ReplaceKeyObjet(para, data);
+        //        }
+        //        //遍历表格      
+        //        foreach (var table in doc.Tables)
+        //        {
+        //            foreach (var row in table.Rows)
+        //            {
+        //                foreach (var cell in row.GetTableCells())
+        //                {
+        //                    foreach (var para in cell.Paragraphs)
+        //                    {
+        //                        ReplaceKeyObjet(para, data);
+        //                    }
+        //                }
+        //            }
+        //        }
+        //        //写文件
+        //        FileStream outFile = new FileStream(outPath, FileMode.Create);
+        //        doc.Write(outFile);
+        //        outFile.Close();
+        //    }
+        //}
+        //private static void ReplaceKeyObjet(XWPFParagraph para, object model)
+        //{
+        //    string text = "";
+        //    Type t = model.GetType();
+        //    PropertyInfo[] pi = t.GetProperties();
+        //    foreach (var run in para.Runs)
+        //    {
+        //        text = run.ToString();
+        //        foreach (PropertyInfo p in pi)
+        //        {
+        //            //$$模板中数据占位符为$KEY$
+        //            string key = $"${p.Name}$";
+        //            if (text.Contains(key))
+        //            {
+        //                try
+        //                {
+        //                    text = text.Replace(key, p.GetValue(model, null).ToString());
+        //                }
+        //                catch (Exception ex)
+        //                {
+        //                    //可能有空指针异常
+        //                    text = text.Replace(key, "");
+        //                }
+        //            }
+        //        }
+        //        run.SetText(text, 0);
+        //    }
+        //}
+        //#endregion
+
+
+
+
+    }
+}

+ 73 - 0
OASystem/OASystem.Api/OAMethodLib/GoogleMapAPI/GoogleMapTools.cs

@@ -0,0 +1,73 @@
+using OASystem.Domain.ViewModels.JuHeExchangeRate;
+using OASystem.Domain.ViewModels.SmallFun;
+using System.Text.Json;
+
+namespace OASystem.API.OAMethodLib.GoogleMapAPI
+{
+    /// <summary>
+    /// 谷歌地图API
+    /// </summary>
+    public static class GoogleMapTools
+    {
+        private static string _appKey = "AIzaSyBdLf8u8DinXQWVPLEkdrxOJpClXSqEnho"; //谷歌地图AppKey
+        private static readonly HttpClient _httpClient = new HttpClient { BaseAddress = new Uri("https://maps.googleapis.com") };
+
+        /// <summary>
+        /// googleMapApi 获取距离And时间
+        /// </summary>
+        /// <param name="origin"></param>
+        /// <param name="destination"></param>
+        /// <returns></returns>
+        public static async Task<Result> GetForeignAndTime(string origin, string destination) 
+        {
+            var result = new Result() { Code = -2, Msg = "未知错误" };
+            if (string.IsNullOrEmpty(origin) || string.IsNullOrEmpty(destination))
+            {
+                result.Msg= "起始地或目的地为空";
+                return result;
+            }
+
+            string url = string.Format(@"/maps/api/directions/json?origin={0}&destination={1}&key={2}", origin, destination,_appKey);
+
+            var req = await _httpClient.GetAsync(url);
+
+            if (req.IsSuccessStatusCode) {
+                var strResponse = await req.Content.ReadAsStringAsync();
+                var resultData = System.Text.Json.JsonSerializer.Deserialize<GoogleMapResultView>(strResponse,
+                        new JsonSerializerOptions() { PropertyNamingPolicy = JsonNamingPolicy.CamelCase });
+
+                if (resultData.Status == "OK") 
+                {
+                    if (resultData.Routes == null)
+                    {
+                        result.Msg = resultData.Status;
+                        return result;
+                    }
+
+                    var data =  JsonConvert.DeserializeObject<dynamic>( resultData.Routes.ToJson());
+
+                    var dataView = new DistanceAndTimeView {
+                        DistanceText = data[0]["legs"][0]["distance"]["text"].ToString(),
+                        DistanceValue = data[0]["legs"][0]["distance"]["value"],
+                        DurationText = data[0]["legs"][0]["duration"]["text"].ToString(),
+                        DurationValue = data[0]["legs"][0]["duration"]["value"],
+                    };
+
+
+                    result.Code = 0;
+                    result.Data = dataView;
+                }
+                else
+                {
+                    result.Msg = resultData.Status;
+                }
+
+            }
+            else
+            {
+                result.Msg = "GoogleMapApi接口网络异常链接超时";
+            }
+            return result;
+        }
+    }
+}

+ 34 - 35
OASystem/OASystem.Api/OAMethodLib/GroupStepForDelegation.cs

@@ -1,6 +1,5 @@
 using Google.Protobuf.WellKnownTypes;
 using Microsoft.AspNetCore.DataProtection.KeyManagement;
-using OASystem.API.OAMethodLib;
 using OASystem.Domain.Common;
 using OASystem.Domain.Dtos.Groups;
 using OASystem.Domain.Entities.Groups;
@@ -9,7 +8,7 @@ using OASystem.Infrastructure.Repositories.Groups;
 using System.Configuration;
 using static OpenAI.GPT3.ObjectModels.SharedModels.IOpenAiModels;
 
-namespace OASystem.API.OAMethodLibs
+namespace OASystem.API.OAMethodLib
 {
 
     /// <summary>
@@ -67,7 +66,7 @@ namespace OASystem.API.OAMethodLibs
                     #endregion
                     #region 经费预算
                     Grp_ScheduleDetailInfo grp_budget202 = _model.DeepClone();
-                    grp_budget202.JobContent = EnumHelper.GetEnumDescription(GrpSchedulePrimaryStepEnum.BudgetChild02);
+                    grp_budget202.JobContent = GrpSchedulePrimaryStepEnum.BudgetChild02.GetEnumDescription();
                     grp_budget202.ParentStep = (int)GrpSchedulePrimaryStepEnum.Budget;
                     grp_budget202.Step = (int)GrpSchedulePrimaryStepEnum.BudgetChild02;
                     grp_budget202.SLevel = 2;
@@ -76,7 +75,7 @@ namespace OASystem.API.OAMethodLibs
                     #region 市场部人员报价对接/反馈
                     //上传明细单
                     Grp_ScheduleDetailInfo grp_feedback302 = _model.DeepClone();
-                    grp_feedback302.JobContent = EnumHelper.GetEnumDescription(GrpSchedulePrimaryStepEnum.FeedbackChild02);
+                    grp_feedback302.JobContent = GrpSchedulePrimaryStepEnum.FeedbackChild02.GetEnumDescription();
                     grp_feedback302.ParentStep = (int)GrpSchedulePrimaryStepEnum.Feedback;
                     grp_feedback302.Step = (int)GrpSchedulePrimaryStepEnum.FeedbackChild02;
                     grp_feedback302.SLevel = 2;
@@ -84,7 +83,7 @@ namespace OASystem.API.OAMethodLibs
 
                     //录入最终总经费预算
                     Grp_ScheduleDetailInfo grp_feedback303 = _model.DeepClone();
-                    grp_feedback303.JobContent = EnumHelper.GetEnumDescription(GrpSchedulePrimaryStepEnum.FeedbackChild03);
+                    grp_feedback303.JobContent = GrpSchedulePrimaryStepEnum.FeedbackChild03.GetEnumDescription();
                     grp_feedback303.ParentStep = (int)GrpSchedulePrimaryStepEnum.Feedback;
                     grp_feedback303.Step = (int)GrpSchedulePrimaryStepEnum.FeedbackChild03;
                     grp_feedback303.SLevel = 2;
@@ -92,7 +91,7 @@ namespace OASystem.API.OAMethodLibs
 
                     //完成报价对接/反馈
                     Grp_ScheduleDetailInfo grp_feedback304 = _model.DeepClone();
-                    grp_feedback304.JobContent = EnumHelper.GetEnumDescription(GrpSchedulePrimaryStepEnum.FeedbackChild04);
+                    grp_feedback304.JobContent = GrpSchedulePrimaryStepEnum.FeedbackChild04.GetEnumDescription();
                     grp_feedback304.ParentStep = (int)GrpSchedulePrimaryStepEnum.Feedback;
                     grp_feedback304.Step = (int)GrpSchedulePrimaryStepEnum.FeedbackChild04;
                     grp_feedback304.SLevel = 2;
@@ -104,7 +103,7 @@ namespace OASystem.API.OAMethodLibs
                     #region 护照/签证
                     //收集资料
                     Grp_ScheduleDetailInfo grp_visa502 = _model.DeepClone();
-                    grp_visa502.JobContent = EnumHelper.GetEnumDescription(GrpSchedulePrimaryStepEnum.VisaChild02);
+                    grp_visa502.JobContent = GrpSchedulePrimaryStepEnum.VisaChild02.GetEnumDescription();
                     grp_visa502.ParentStep = (int)GrpSchedulePrimaryStepEnum.Visa;
                     grp_visa502.Step = (int)GrpSchedulePrimaryStepEnum.VisaChild02;
                     grp_visa502.SLevel = 2;
@@ -112,7 +111,7 @@ namespace OASystem.API.OAMethodLibs
 
                     //取护照资料
                     Grp_ScheduleDetailInfo grp_visa503 = _model.DeepClone();
-                    grp_visa503.JobContent = EnumHelper.GetEnumDescription(GrpSchedulePrimaryStepEnum.VisaChild03);
+                    grp_visa503.JobContent = GrpSchedulePrimaryStepEnum.VisaChild03.GetEnumDescription();
                     grp_visa503.ParentStep = (int)GrpSchedulePrimaryStepEnum.Visa;
                     grp_visa503.Step = (int)GrpSchedulePrimaryStepEnum.VisaChild03;
                     grp_visa503.SLevel = 2;
@@ -120,7 +119,7 @@ namespace OASystem.API.OAMethodLibs
 
                     //填资料
                     Grp_ScheduleDetailInfo grp_visa504 = _model.DeepClone();
-                    grp_visa504.JobContent = EnumHelper.GetEnumDescription(GrpSchedulePrimaryStepEnum.VisaChild04);
+                    grp_visa504.JobContent = GrpSchedulePrimaryStepEnum.VisaChild04.GetEnumDescription();
                     grp_visa504.ParentStep = (int)GrpSchedulePrimaryStepEnum.Visa;
                     grp_visa504.Step = (int)GrpSchedulePrimaryStepEnum.VisaChild04;
                     grp_visa504.SLevel = 2;
@@ -128,7 +127,7 @@ namespace OASystem.API.OAMethodLibs
 
                     //送签
                     Grp_ScheduleDetailInfo grp_visa505 = _model.DeepClone();
-                    grp_visa505.JobContent = EnumHelper.GetEnumDescription(GrpSchedulePrimaryStepEnum.VisaChild05);
+                    grp_visa505.JobContent = GrpSchedulePrimaryStepEnum.VisaChild05.GetEnumDescription();
                     grp_visa505.ParentStep = (int)GrpSchedulePrimaryStepEnum.Visa;
                     grp_visa505.Step = (int)GrpSchedulePrimaryStepEnum.VisaChild05;
                     grp_visa505.SLevel = 2;
@@ -136,7 +135,7 @@ namespace OASystem.API.OAMethodLibs
 
                     //出签+取护照
                     Grp_ScheduleDetailInfo grp_visa506 = _model.DeepClone();
-                    grp_visa506.JobContent = EnumHelper.GetEnumDescription(GrpSchedulePrimaryStepEnum.VisaChild06);
+                    grp_visa506.JobContent = GrpSchedulePrimaryStepEnum.VisaChild06.GetEnumDescription();
                     grp_visa506.ParentStep = (int)GrpSchedulePrimaryStepEnum.Visa;
                     grp_visa506.Step = (int)GrpSchedulePrimaryStepEnum.VisaChild06;
                     grp_visa506.SLevel = 2;
@@ -144,7 +143,7 @@ namespace OASystem.API.OAMethodLibs
 
                     //归还护照
                     Grp_ScheduleDetailInfo grp_visa507 = _model.DeepClone();
-                    grp_visa507.JobContent = EnumHelper.GetEnumDescription(GrpSchedulePrimaryStepEnum.VisaChild07);
+                    grp_visa507.JobContent = GrpSchedulePrimaryStepEnum.VisaChild07.GetEnumDescription();
                     grp_visa507.ParentStep = (int)GrpSchedulePrimaryStepEnum.Visa;
                     grp_visa507.Step = (int)GrpSchedulePrimaryStepEnum.VisaChild07;
                     grp_visa507.SLevel = 2;
@@ -152,7 +151,7 @@ namespace OASystem.API.OAMethodLibs
 
                     //签证费用录入 
                     Grp_ScheduleDetailInfo grp_visa508 = _model.DeepClone();
-                    grp_visa508.JobContent = EnumHelper.GetEnumDescription(GrpSchedulePrimaryStepEnum.VisaChild08);
+                    grp_visa508.JobContent = GrpSchedulePrimaryStepEnum.VisaChild08.GetEnumDescription();
                     grp_visa508.ParentStep = (int)GrpSchedulePrimaryStepEnum.Visa;
                     grp_visa508.Step = (int)GrpSchedulePrimaryStepEnum.VisaChild08;
                     grp_visa508.SLevel = 2;
@@ -161,35 +160,35 @@ namespace OASystem.API.OAMethodLibs
                     #region 业务操作
                     //机票
                     Grp_ScheduleDetailInfo grp_busJP601 = _model.DeepClone();
-                    grp_busJP601.JobContent = EnumHelper.GetEnumDescription(GrpSchedulePrimaryStepEnum.BusinessJP);
+                    grp_busJP601.JobContent = GrpSchedulePrimaryStepEnum.BusinessJP.GetEnumDescription();
                     grp_busJP601.ParentStep = (int)GrpSchedulePrimaryStepEnum.Business;
                     grp_busJP601.Step = (int)GrpSchedulePrimaryStepEnum.BusinessJP;
                     grp_busJP601.SLevel = 2;
                     entityList.Add(grp_busJP601);
                     //机票-询价并导入黑屏代码
                     Grp_ScheduleDetailInfo grp_busJP6012 = _model.DeepClone();
-                    grp_busJP6012.JobContent = EnumHelper.GetEnumDescription(GrpSchedulePrimaryStepEnum.BusinessJPChild02);
+                    grp_busJP6012.JobContent = GrpSchedulePrimaryStepEnum.BusinessJPChild02.GetEnumDescription();
                     grp_busJP6012.ParentStep = (int)GrpSchedulePrimaryStepEnum.BusinessJP;
                     grp_busJP6012.Step = (int)GrpSchedulePrimaryStepEnum.BusinessJPChild02;
                     grp_busJP6012.SLevel = 3;
                     entityList.Add(grp_busJP6012);
                     //机票-机票已占位
                     Grp_ScheduleDetailInfo grp_busJP6013 = _model.DeepClone();
-                    grp_busJP6013.JobContent = EnumHelper.GetEnumDescription(GrpSchedulePrimaryStepEnum.BusinessJPChild03);
+                    grp_busJP6013.JobContent = GrpSchedulePrimaryStepEnum.BusinessJPChild03.GetEnumDescription();
                     grp_busJP6013.ParentStep = (int)GrpSchedulePrimaryStepEnum.BusinessJP;
                     grp_busJP6013.Step = (int)GrpSchedulePrimaryStepEnum.BusinessJPChild03;
                     grp_busJP6013.SLevel = 3;
                     entityList.Add(grp_busJP6013);
                     //机票-已出票
                     Grp_ScheduleDetailInfo grp_busJP6014 = _model.DeepClone();
-                    grp_busJP6014.JobContent = EnumHelper.GetEnumDescription(GrpSchedulePrimaryStepEnum.BusinessJPChild04);
+                    grp_busJP6014.JobContent = GrpSchedulePrimaryStepEnum.BusinessJPChild04.GetEnumDescription();
                     grp_busJP6014.ParentStep = (int)GrpSchedulePrimaryStepEnum.BusinessJP;
                     grp_busJP6014.Step = (int)GrpSchedulePrimaryStepEnum.BusinessJPChild04;
                     grp_busJP6014.SLevel = 3;
                     entityList.Add(grp_busJP6014);
                     //机票-机票费用录入
                     Grp_ScheduleDetailInfo grp_busJP6015 = _model.DeepClone();
-                    grp_busJP6015.JobContent = EnumHelper.GetEnumDescription(GrpSchedulePrimaryStepEnum.BusinessJPChild05);
+                    grp_busJP6015.JobContent = GrpSchedulePrimaryStepEnum.BusinessJPChild05.GetEnumDescription();
                     grp_busJP6015.ParentStep = (int)GrpSchedulePrimaryStepEnum.BusinessJP;
                     grp_busJP6015.Step = (int)GrpSchedulePrimaryStepEnum.BusinessJPChild05;
                     grp_busJP6015.SLevel = 3;
@@ -197,14 +196,14 @@ namespace OASystem.API.OAMethodLibs
 
                     //酒店
                     Grp_ScheduleDetailInfo grp_busJD602 = _model.DeepClone();
-                    grp_busJD602.JobContent = EnumHelper.GetEnumDescription(GrpSchedulePrimaryStepEnum.BusinessJD);
+                    grp_busJD602.JobContent = GrpSchedulePrimaryStepEnum.BusinessJD.GetEnumDescription();
                     grp_busJD602.ParentStep = (int)GrpSchedulePrimaryStepEnum.Business;
                     grp_busJD602.Step = (int)GrpSchedulePrimaryStepEnum.BusinessJD;
                     grp_busJD602.SLevel = 2;
                     entityList.Add(grp_busJD602);
                     //酒店-酒店费用录入
                     Grp_ScheduleDetailInfo grp_busJD6022 = _model.DeepClone();
-                    grp_busJD6022.JobContent = EnumHelper.GetEnumDescription(GrpSchedulePrimaryStepEnum.BusinessJDChild02);
+                    grp_busJD6022.JobContent = GrpSchedulePrimaryStepEnum.BusinessJDChild02.GetEnumDescription();
                     grp_busJD6022.ParentStep = (int)GrpSchedulePrimaryStepEnum.BusinessJD;
                     grp_busJD6022.Step = (int)GrpSchedulePrimaryStepEnum.BusinessJDChild02;
                     grp_busJD6022.SLevel = 3;
@@ -212,21 +211,21 @@ namespace OASystem.API.OAMethodLibs
 
                     //OP
                     Grp_ScheduleDetailInfo grp_busOP603 = _model.DeepClone();
-                    grp_busOP603.JobContent = EnumHelper.GetEnumDescription(GrpSchedulePrimaryStepEnum.BusinessOP);
+                    grp_busOP603.JobContent = GrpSchedulePrimaryStepEnum.BusinessOP.GetEnumDescription();
                     grp_busOP603.ParentStep = (int)GrpSchedulePrimaryStepEnum.Business;
                     grp_busOP603.Step = (int)GrpSchedulePrimaryStepEnum.BusinessOP;
                     grp_busOP603.SLevel = 2;
                     entityList.Add(grp_busOP603);
                     //OP-OP询价
                     Grp_ScheduleDetailInfo grp_busOP6032 = _model.DeepClone();
-                    grp_busOP6032.JobContent = EnumHelper.GetEnumDescription(GrpSchedulePrimaryStepEnum.BusinessOPChild02);
+                    grp_busOP6032.JobContent = GrpSchedulePrimaryStepEnum.BusinessOPChild02.GetEnumDescription();
                     grp_busOP6032.ParentStep = (int)GrpSchedulePrimaryStepEnum.BusinessOP;
                     grp_busOP6032.Step = (int)GrpSchedulePrimaryStepEnum.BusinessOPChild02;
                     grp_busOP6032.SLevel = 3;
                     entityList.Add(grp_busOP6032);
                     //OP-OP费用录入
                     Grp_ScheduleDetailInfo grp_busOP6033 = _model.DeepClone();
-                    grp_busOP6033.JobContent = EnumHelper.GetEnumDescription(GrpSchedulePrimaryStepEnum.BusinessOPChild03);
+                    grp_busOP6033.JobContent = GrpSchedulePrimaryStepEnum.BusinessOPChild03.GetEnumDescription();
                     grp_busOP6033.ParentStep = (int)GrpSchedulePrimaryStepEnum.BusinessOP;
                     grp_busOP6033.Step = (int)GrpSchedulePrimaryStepEnum.BusinessOPChild03;
                     grp_busOP6033.SLevel = 3;
@@ -234,21 +233,21 @@ namespace OASystem.API.OAMethodLibs
 
                     //商邀
                     Grp_ScheduleDetailInfo grp_busSY604 = _model.DeepClone();
-                    grp_busSY604.JobContent = EnumHelper.GetEnumDescription(GrpSchedulePrimaryStepEnum.BusinessSY);
+                    grp_busSY604.JobContent = GrpSchedulePrimaryStepEnum.BusinessSY.GetEnumDescription();
                     grp_busSY604.ParentStep = (int)GrpSchedulePrimaryStepEnum.Business;
                     grp_busSY604.Step = (int)GrpSchedulePrimaryStepEnum.BusinessSY;
                     grp_busSY604.SLevel = 2;
                     entityList.Add(grp_busSY604);
                     //商邀-商邀报批
                     Grp_ScheduleDetailInfo grp_busSY6042 = _model.DeepClone();
-                    grp_busSY6042.JobContent = EnumHelper.GetEnumDescription(GrpSchedulePrimaryStepEnum.BusinessSYChild02);
+                    grp_busSY6042.JobContent = GrpSchedulePrimaryStepEnum.BusinessSYChild02.GetEnumDescription();
                     grp_busSY6042.ParentStep = (int)GrpSchedulePrimaryStepEnum.BusinessSY;
                     grp_busSY6042.Step = (int)GrpSchedulePrimaryStepEnum.BusinessSYChild02;
                     grp_busSY6042.SLevel = 3;
                     entityList.Add(grp_busSY6042);
                     //商邀-商邀费用录入
                     Grp_ScheduleDetailInfo grp_busSY6043 = _model.DeepClone();
-                    grp_busSY6043.JobContent = EnumHelper.GetEnumDescription(GrpSchedulePrimaryStepEnum.BusinessSYChild03);
+                    grp_busSY6043.JobContent = GrpSchedulePrimaryStepEnum.BusinessSYChild03.GetEnumDescription();
                     grp_busSY6043.ParentStep = (int)GrpSchedulePrimaryStepEnum.BusinessSY;
                     grp_busSY6043.Step = (int)GrpSchedulePrimaryStepEnum.BusinessSYChild03;
                     grp_busSY6043.SLevel = 3;
@@ -259,7 +258,7 @@ namespace OASystem.API.OAMethodLibs
                     #region 费用审批
                     //机票费用审批
                     Grp_ScheduleDetailInfo grp_cost702 = _model.DeepClone();
-                    grp_cost702.JobContent = EnumHelper.GetEnumDescription(GrpSchedulePrimaryStepEnum.CostAuditChild02);
+                    grp_cost702.JobContent = GrpSchedulePrimaryStepEnum.CostAuditChild02.GetEnumDescription();
                     grp_cost702.ParentStep = (int)GrpSchedulePrimaryStepEnum.CostAudit;
                     grp_cost702.Step = (int)GrpSchedulePrimaryStepEnum.CostAuditChild02;
                     grp_cost702.Duty = _groupConfig.Boss;
@@ -267,7 +266,7 @@ namespace OASystem.API.OAMethodLibs
                     entityList.Add(grp_cost702);
                     //酒店费用审批
                     Grp_ScheduleDetailInfo grp_cost703 = _model.DeepClone();
-                    grp_cost703.JobContent = EnumHelper.GetEnumDescription(GrpSchedulePrimaryStepEnum.CostAuditChild03);
+                    grp_cost703.JobContent = GrpSchedulePrimaryStepEnum.CostAuditChild03.GetEnumDescription();
                     grp_cost703.ParentStep = (int)GrpSchedulePrimaryStepEnum.CostAudit;
                     grp_cost703.Step = (int)GrpSchedulePrimaryStepEnum.CostAuditChild03;
                     grp_cost703.Duty = _groupConfig.Boss;
@@ -275,7 +274,7 @@ namespace OASystem.API.OAMethodLibs
                     entityList.Add(grp_cost703);
                     //OP费用审批
                     Grp_ScheduleDetailInfo grp_cost704 = _model.DeepClone();
-                    grp_cost704.JobContent = EnumHelper.GetEnumDescription(GrpSchedulePrimaryStepEnum.CostAuditChild04);
+                    grp_cost704.JobContent = GrpSchedulePrimaryStepEnum.CostAuditChild04.GetEnumDescription();
                     grp_cost704.ParentStep = (int)GrpSchedulePrimaryStepEnum.CostAudit;
                     grp_cost704.Step = (int)GrpSchedulePrimaryStepEnum.CostAuditChild04;
                     grp_cost704.Duty = _groupConfig.Boss;
@@ -283,7 +282,7 @@ namespace OASystem.API.OAMethodLibs
                     entityList.Add(grp_cost704);
                     //OP费用审批
                     Grp_ScheduleDetailInfo grp_cost705 = _model.DeepClone();
-                    grp_cost705.JobContent = EnumHelper.GetEnumDescription(GrpSchedulePrimaryStepEnum.CostAuditChild05);
+                    grp_cost705.JobContent = GrpSchedulePrimaryStepEnum.CostAuditChild05.GetEnumDescription();
                     grp_cost705.ParentStep = (int)GrpSchedulePrimaryStepEnum.CostAudit;
                     grp_cost705.Step = (int)GrpSchedulePrimaryStepEnum.CostAuditChild05;
                     grp_cost705.Duty = _groupConfig.Boss;
@@ -291,7 +290,7 @@ namespace OASystem.API.OAMethodLibs
                     entityList.Add(grp_cost705);
                     //增减款项审批
                     Grp_ScheduleDetailInfo grp_cost706 = _model.DeepClone();
-                    grp_cost706.JobContent = EnumHelper.GetEnumDescription(GrpSchedulePrimaryStepEnum.CostAuditChild06);
+                    grp_cost706.JobContent = GrpSchedulePrimaryStepEnum.CostAuditChild06.GetEnumDescription();
                     grp_cost706.ParentStep = (int)GrpSchedulePrimaryStepEnum.CostAudit;
                     grp_cost706.Step = (int)GrpSchedulePrimaryStepEnum.CostAuditChild06;
                     grp_cost706.Duty = _groupConfig.Boss;
@@ -301,21 +300,21 @@ namespace OASystem.API.OAMethodLibs
                     #region 付款给供应商
                     //OP费用付款
                     Grp_ScheduleDetailInfo grp_pay802 = _model.DeepClone();
-                    grp_pay802.JobContent = EnumHelper.GetEnumDescription(GrpSchedulePrimaryStepEnum.PayChild02);
+                    grp_pay802.JobContent = GrpSchedulePrimaryStepEnum.PayChild02.GetEnumDescription();
                     grp_pay802.ParentStep = (int)GrpSchedulePrimaryStepEnum.Pay;
                     grp_pay802.Step = (int)GrpSchedulePrimaryStepEnum.PayChild02;
                     grp_pay802.SLevel = 2;
                     entityList.Add(grp_pay802);
                     //商邀费用付款
                     Grp_ScheduleDetailInfo grp_pay803 = _model.DeepClone();
-                    grp_pay803.JobContent = EnumHelper.GetEnumDescription(GrpSchedulePrimaryStepEnum.PayChild03);
+                    grp_pay803.JobContent = GrpSchedulePrimaryStepEnum.PayChild03.GetEnumDescription();
                     grp_pay803.ParentStep = (int)GrpSchedulePrimaryStepEnum.Pay;
                     grp_pay803.Step = (int)GrpSchedulePrimaryStepEnum.PayChild03;
                     grp_pay803.SLevel = 2;
                     entityList.Add(grp_pay803);
                     //增减款项付款
                     Grp_ScheduleDetailInfo grp_pay804 = _model.DeepClone();
-                    grp_pay804.JobContent = EnumHelper.GetEnumDescription(GrpSchedulePrimaryStepEnum.PayChild04);
+                    grp_pay804.JobContent = GrpSchedulePrimaryStepEnum.PayChild04.GetEnumDescription();
                     grp_pay804.ParentStep = (int)GrpSchedulePrimaryStepEnum.Pay;
                     grp_pay804.Step = (int)GrpSchedulePrimaryStepEnum.PayChild04;
                     grp_pay804.SLevel = 2;
@@ -333,7 +332,7 @@ namespace OASystem.API.OAMethodLibs
                     #region 收款
                     //收款完成
                     Grp_ScheduleDetailInfo grp_col01 = _model.DeepClone();
-                    grp_col01.JobContent = EnumHelper.GetEnumDescription(GrpSchedulePrimaryStepEnum.CollectChild01);
+                    grp_col01.JobContent = GrpSchedulePrimaryStepEnum.CollectChild01.GetEnumDescription();
                     grp_col01.ParentStep = (int)GrpSchedulePrimaryStepEnum.Collect;
                     grp_col01.Step = (int)GrpSchedulePrimaryStepEnum.CollectChild01;
                     grp_col01.ExpectBeginDt = dftEndDt;

+ 0 - 1
OASystem/OASystem.Api/OAMethodLib/TencentCloudAPI/TencentOCRTools.cs

@@ -1,5 +1,4 @@
 using OASystem.Domain.Dtos.Tencent;
-using OASystem.TencentOCR;
 using TencentCloud.Common;
 using TencentCloud.Ocr.V20181119.Models;
 using TencentCloud.Ocr.V20181119;

+ 169 - 0
OASystem/OASystem.Api/OAMethodLib/YouDaoAPI/YouDaoApiTools.cs

@@ -0,0 +1,169 @@
+using OASystem.Domain.ViewModels.JuHeExchangeRate;
+using System.Text.Json;
+
+namespace OASystem.API.OAMethodLib.YouDaoAPI
+{
+    /// <summary>
+    /// 有道API Tools
+    /// </summary>
+    public static class YouDaoApiTools
+    {
+        private static readonly HttpClient _httpClient = new HttpClient { BaseAddress = new Uri("https://openapi.youdao.com") };
+        //private static readonly IHttpClientFactory _httpClientFactory;
+        private static readonly string _appKey = "0fe3bc01e109ed36";    //应用ID
+        private static readonly string _appSecret = "1f2x9TrqJfSBEJ8iH9GEFGgTyaYGjEry"; //应用密钥
+
+        /// <summary>
+        /// 有道翻译
+        /// 默认 中=>英
+        /// </summary>
+        /// <param name="txt">待翻译的文本</param>
+        /// <param name="from">源语言</param>
+        /// <param name="to">目标语言</param>
+        /// <returns></returns>
+        public static async Task<Result> GetReTrans(string txt, string from = "zh-CHS", string to = "en")
+        {
+            var result = new Result();
+            #region MyRegion
+            if (string.IsNullOrEmpty(txt))
+            {
+                result.Msg = "待翻译文本为空!";
+                return result;
+            }
+
+            #endregion
+
+            string url = string.Format("/api");
+
+            #region 请求参数处理
+
+            string q = txt;
+            //input的计算方式为:input=q前10个字符 + q长度 + q后10个字符(当q长度大于20)或 input=q字符串(当q长度小于等于20);
+            string input = q.Length <= 20 ? q : q.Substring(0, 10) + q.Length + q.Substring(q.Length - 10, 10);
+            string salt = DateTime.Now.Millisecond.ToString();
+            string curtime = GetUTCTime(true).ToString(); //UTC秒时间戳
+            //sign = sha256(应用ID + input + salt + curtime + 应用密钥);
+            string signStr = string.Format("{0}{1}{2}{3}{4}", _appKey, input, salt, curtime, _appSecret);
+            string sign = SHA256EncryptString(signStr);
+            #endregion
+
+            var reqData = new FormUrlEncodedContent(
+                            new List<KeyValuePair<string, string>>()
+                            {
+                                //new KeyValuePair<string, string>("q",System.Web.HttpUtility.UrlEncode(q, Encoding.UTF8)),//待翻译文本  必须是UTF-8编码
+                                new KeyValuePair<string, string>("q",q),             //待翻译文本  必须是UTF-8编码
+                                new KeyValuePair<string, string>("from",from),       //源语言
+                                new KeyValuePair<string, string>("to",to),           //目标语言
+                                new KeyValuePair<string, string>("appKey",_appKey),  //应用ID
+                                new KeyValuePair<string, string>("salt",salt),       //UUID
+                                new KeyValuePair<string, string>("sign",sign),       //签名 
+                                new KeyValuePair<string, string>("signType","v3"),   //签名类型
+                                new KeyValuePair<string, string>("curtime",curtime), //TUC 时间戳
+                            });
+
+            var reTransReq = await _httpClient.PostAsync(url, reqData);
+            if (reTransReq.IsSuccessStatusCode)
+            {
+                var strResponse = await reTransReq.Content.ReadAsStringAsync();
+                var strResponse1 = System.Web.HttpUtility.UrlDecode(strResponse, System.Text.Encoding.UTF8);
+
+                var trans = JsonConvert.DeserializeObject<dynamic>(strResponse1);
+                string errorCode = trans["errorCode"].ToString();
+                if (errorCode == "0")
+                {
+                    result.Code = 0;
+                    var translation = JsonConvert.DeserializeObject<List<string>>(trans["translation"].ToString());
+                    result.Msg = string.Format(@"成功!");
+                    result.Data = translation;
+                }
+                else
+                {
+                    result.Msg = string.Format(@"有道翻译API [Error:{0}]", errorCode);
+                }
+                
+
+                
+            }
+            else
+            {
+                result.Msg = "接口请求失败!";
+            }
+
+
+            return result;
+        }
+
+        #region SHA256加密
+        /// <summary>
+        /// SHA256加密
+        /// </summary>
+        /// <param name="data"></param>
+        /// <returns></returns>
+        public static string SHA256EncryptString(string data)
+        {
+            byte[] bytes = Encoding.UTF8.GetBytes(data);
+            byte[] hash = SHA256Managed.Create().ComputeHash(bytes);
+
+            StringBuilder builder = new StringBuilder();
+            for (int i = 0; i < hash.Length; i++)
+            {
+                builder.Append(hash[i].ToString("x2"));
+            }
+            return builder.ToString();
+        }
+
+        /// <summary>
+        /// SHA256加密
+        /// </summary>
+        /// <param name="StrIn">待加密字符串</param>
+        /// <returns>加密数组</returns>
+        public static Byte[] SHA256EncryptByte(string StrIn)
+        {
+            var sha256 = new SHA256Managed();
+            var Asc = new ASCIIEncoding();
+            var tmpByte = Asc.GetBytes(StrIn);
+            var EncryptBytes = sha256.ComputeHash(tmpByte);
+            sha256.Clear();
+            return EncryptBytes;
+        }
+        #endregion
+
+        #region UTC时间戳
+        /// <summary>
+        /// 获取utc时间
+        /// </summary>
+        /// <param name="type">true 秒 flase 毫秒</param>
+        /// <returns></returns>
+        public static long GetUTCTime(bool type)
+        {
+            TimeSpan ts = DateTime.UtcNow - new DateTime(1970, 1, 1, 0, 0, 0, 0);
+            return type ? Convert.ToInt64(ts.TotalSeconds) : Convert.ToInt64(ts.TotalMilliseconds);
+        }
+
+        /// <summary>
+        /// 将当前时间戳转换至Datetime
+        /// </summary>
+        /// <param name="timeStamp"></param>
+        /// <returns></returns>
+        public static DateTime ConvertUTCToDateTime(long timeStamp)
+        {
+            DateTime startTime = TimeZone.CurrentTimeZone.ToLocalTime(new DateTime(1970, 1, 1)); // 当地时区
+            DateTime dt = startTime.AddSeconds(timeStamp);
+            return dt;
+        }
+
+        /// <summary>
+        /// 把datetime转utc时间戳
+        /// </summary>
+        /// <param name="time"></param>
+        /// <returns></returns>
+        public static int ConvertDateTimeToUTC(DateTime time)
+        {
+            double intResult = 0;
+            DateTime startTime = TimeZone.CurrentTimeZone.ToLocalTime(new DateTime(1970, 1, 1));
+            intResult = (time - startTime).TotalSeconds;
+            return (int)intResult;
+        }
+        #endregion
+    }
+}

+ 2 - 1
OASystem/OASystem.Api/OASystem.API.csproj

@@ -20,12 +20,13 @@
   </ItemGroup>
 
   <ItemGroup>
+    <PackageReference Include="Aspose.Words" Version="21.8.0" />
     <PackageReference Include="Aspose.Cells" Version="23.4.0" />
     <PackageReference Include="Autofac" Version="6.4.0" />
     <PackageReference Include="Autofac.Extensions.DependencyInjection" Version="8.0.0" />
     <PackageReference Include="AutoMapper" Version="12.0.0" />
     <PackageReference Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="12.0.0" />
-    <PackageReference Include="Betalgo.OpenAI.GPT3" Version="6.6.7" />
+    <PackageReference Include="Betalgo.OpenAI.GPT3" Version="6.8.3" />
     <PackageReference Include="BouncyCastle.NetCore" Version="1.8.8" />
     <PackageReference Include="Flurl.Http" Version="3.2.4" />
     <PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="6.0.11" />

+ 6 - 3
OASystem/OASystem.Api/Program.cs

@@ -5,12 +5,10 @@ using OASystem.API;
 using OASystem.RedisRepository.RedisAsyncHelper;
 using OASystem.RedisRepository.Config;
 using OASystem.API.OAMethodLib;
-using System.Text.Json.Serialization;
-using OASystem.API.OAMethodLibs;
-using OASystem.Domain.Dtos.Groups;
 using Microsoft.AspNetCore.Http.Features;
 using Microsoft.AspNetCore.Server.Kestrel.Core;
 using OASystem.API.OAMethodLib.JuHeAPI;
+using OASystem.API.OAMethodLib.YouDaoAPI;
 
 var builder = WebApplication.CreateBuilder(args);
 var basePath = AppContext.BaseDirectory;
@@ -236,7 +234,12 @@ builder.Services.AddScoped<IMapper, Mapper>();
 builder.Services.AddControllersWithViews();
 builder.Services.AddSingleton<IJuHeApiService, JuHeApiService>();
 builder.Services.AddHttpClient("PublicJuHeApi", c => c.BaseAddress = new Uri("http://web.juhe.cn"));
+#endregion
 
+#region ÓеÀAPI ·þÎñ
+//builder.Services.AddControllersWithViews();
+//builder.Services.AddSingleton<IYouDaoApiService, YouDaoApiService>();
+//builder.Services.AddHttpClient("PublicYouDaoApi", c => c.BaseAddress = new Uri("https://openapi.youdao.com"));
 #endregion
 
 var app = builder.Build();

+ 15 - 2
OASystem/OASystem.Domain/AutoMappers/_baseMappingProfile.cs

@@ -1,8 +1,10 @@
-using OASystem.Domain.Dtos.Groups;
+using OASystem.Domain.Dtos.CRM;
+using OASystem.Domain.Dtos.Groups;
 using OASystem.Domain.Dtos.Resource;
 using OASystem.Domain.Dtos.System;
 using OASystem.Domain.Dtos.UserDto;
 using OASystem.Domain.Entities;
+using OASystem.Domain.Entities.Customer;
 using OASystem.Domain.Entities.Business;
 using OASystem.Domain.Entities.Groups;
 using OASystem.Domain.Entities.Resource;
@@ -29,7 +31,10 @@ namespace OASystem.Domain.AutoMappers
             CreateMap<Sys_Message, DepartmentIView>();
             CreateMap<Sys_MessageReadAuth, DepartmentIView>();
             #endregion
-
+            #region 数据类型板块
+            CreateMap<OperationSetDataTypeDto, Sys_SetDataType>();
+            CreateMap<OperationSetDataDto, Sys_SetData>();
+            #endregion
             #region 公司板块
             CreateMap<Sys_Company, CompanyView>();
             CreateMap<AddCompanyDto, Sys_Company>();
@@ -110,6 +115,14 @@ namespace OASystem.Domain.AutoMappers
             #endregion
             #endregion
 
+            #region Crm
+
+            #region 客户公司资料板块
+            CreateMap<OperationClientCompanyDto, Crm_CustomerCompany>();
+            #endregion
+
+            #endregion
+
             #region Business
             #endregion
         }

+ 59 - 0
OASystem/OASystem.Domain/Dtos/CRM/ClientCompanyDto.cs

@@ -0,0 +1,59 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace OASystem.Domain.Dtos.CRM
+{
+    public class OperationClientCompanyDto
+    {
+
+        /// <summary>
+        /// 操作状态
+        /// 1 添加 
+        /// 2 修改 
+        /// </summary>
+        public int Status { get; set; }
+        /// <summary>
+        /// 编号
+        /// </summary>
+
+        public int Id { get; set; }
+        /// <summary>
+        /// 客户公司名称
+        /// </summary>
+        public string CompanyName { get; set; }
+        /// <summary>
+        /// 公司地址
+        /// </summary>
+        public string Address { get; set; }
+        /// <summary>
+        /// 邮政编码
+        /// </summary>
+        public string PostCodes { get; set; }
+        /// <summary>
+        /// 最后操作人
+        /// </summary>
+        public int LastedOpUserId { get; set; }
+        /// <summary>
+        /// 最后操作时间
+        /// </summary>
+        public DateTime LastedOpDt { get; set; }= DateTime.Now;
+        
+        /// <summary>
+        /// 创建者Id
+        /// </summary>
+        public int CreateUserId { get; set; }
+        /// <summary>
+        /// 备注
+        /// </summary>
+        public string Remark { get; set; }
+     
+    }
+    public class ClientCompanyDto
+    {
+        public int Id { get; set; }
+        public int DeleteUserId { get; set; }
+    }
+}

+ 19 - 0
OASystem/OASystem.Domain/Dtos/SmallFun/ChatGptDto.cs

@@ -0,0 +1,19 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace OASystem.Domain.Dtos.SmallFun
+{
+    /// <summary>
+    /// ChatGPT 自动补全 请求dto
+    /// </summary>
+    public class CompletionsDto
+    {
+        /// <summary>
+        /// 提示(问题)
+        /// </summary>
+        public string? Prompt { get; set; }
+    }
+}

+ 31 - 0
OASystem/OASystem.Domain/Dtos/SmallFun/GoogleMapApiDto.cs

@@ -0,0 +1,31 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace OASystem.Domain.Dtos.SmallFun
+{
+    /// <summary>
+    /// googleMapApi
+    /// </summary>
+    internal class GoogleMapApiDto
+    {
+    }
+
+    /// <summary>
+    /// google 路线查询
+    /// </summary>
+    public class GoogleMapDirectionsDto
+    {
+        /// <summary>
+        /// 起始地
+        /// </summary>
+        public string? origin { get; set; } = "FERİT RECAİ ERTUĞRUL CAD. NO: 18 ORAN / ANKARA,Turkey"; //默认值 
+
+        /// <summary>
+        /// 目的地
+        /// </summary>
+        public string? destination { get; set; } = "Dudullu Mh. Imes Sanayi Sitesi 504. Sk. No:4/B1 Umraniye/Istanbul";
+    }
+}

+ 30 - 0
OASystem/OASystem.Domain/Dtos/SmallFun/YouDaoDto.cs

@@ -0,0 +1,30 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace OASystem.Domain.Dtos.SmallFun
+{
+    /// <summary>
+    /// 有道API翻译
+    /// 请求dto
+    /// </summary>
+    public class YouDaoDto:DtoBase
+    {
+        /// <summary>
+        /// 源语言 Code
+        /// </summary>
+        public string? From { get; set; }
+
+        /// <summary>
+        /// 目标语言 Code
+        /// </summary>
+        public string? To { get; set; }
+
+        /// <summary>
+        /// 待翻译的文本
+        /// </summary>
+        public string? Txt { get; set; }
+    }
+}

+ 53 - 0
OASystem/OASystem.Domain/Dtos/System/SetDataDto.cs

@@ -16,4 +16,57 @@ namespace OASystem.Domain.Dtos.System
         /// </summary>
         public int DataType { get; set; }
     }
+    /// <summary>
+    /// 类型表参数
+    /// </summary>
+    public class SetDataIDto:DtoBase
+    {
+        /// <summary>
+        /// 数据类型
+        /// </summary>
+        public int STid { get; set; }
+    }
+    public class OperationSetDataDto
+    {
+        /// <summary>
+        /// 操作状态
+        /// 1 添加 
+        /// 2 修改 
+        /// </summary>
+        public int Status { get; set; }
+        /// <summary>
+        /// 编号
+        /// </summary>
+        public int Id { get; set; }
+        /// <summary>
+        /// 子类型名称
+        /// </summary>
+        public string Name { get; set; }
+
+        /// <summary>
+        /// Sys_SetDataType.id 数据类型表Id
+        /// </summary>
+        public int STid { get; set; }
+      
+        /// <summary>
+        /// 创建者Id
+        /// </summary>
+        public int CreateUserId { get; set; }
+        /// <summary>
+        /// 备注
+        /// </summary>
+        public string Remark { get; set; }
+     
+    }
+    public class DelSetDataDto
+    {
+        /// <summary>
+        /// Id
+        /// </summary>
+        public int Id { get; set; }
+        /// <summary>
+        /// 删除者Id
+        /// </summary>
+        public int DeleteUserId { get; set; }
+    }
 }

+ 47 - 1
OASystem/OASystem.Domain/Dtos/System/setDataTypeDto.cs

@@ -6,7 +6,7 @@ using System.Threading.Tasks;
 
 namespace OASystem.Domain.Dtos.System
 {
-    public class setDataTypeDto:DtoBase
+    public class SetDataTypeDto:DtoBase
     {
         /// <summary>
         /// 类型名称
@@ -17,4 +17,50 @@ namespace OASystem.Domain.Dtos.System
         /// </summary>
         public string CnName { get; set; }
     }
+    public class OperationSetDataTypeDto
+    {
+        /// <summary>
+        /// 操作状态
+        /// 1 添加 
+        /// 2 修改 
+        /// </summary>
+        public int Status { get; set; }
+        /// <summary>
+        /// 编号
+        /// </summary>
+        public int Id { get; set; }
+        /// <summary>
+        /// 类型名称
+        /// </summary>
+        public string Name { get; set; }
+        /// <summary>
+        /// 是否启用
+        /// </summary>
+        public int IsEnable { get; set; } = 1;
+
+        
+        /// <summary>
+        /// 创建者Id
+        /// </summary>
+     
+        public int CreateUserId { get; set; }
+      
+        /// <summary>
+        /// 备注
+        /// </summary>
+        public string Remark { get; set; }
+       
+    }
+
+    public class DelSetDataTypeDto
+    {
+        /// <summary>
+        /// Id
+        /// </summary>
+        public int Id { get; set; }
+        /// <summary>
+        /// 删除者Id
+        /// </summary>
+        public int DeleteUserId { get; set; }
+    }
 }

+ 6 - 2
OASystem/OASystem.Domain/ViewModels/CRM/VisaCustomerCompanyView.cs

@@ -11,7 +11,7 @@ namespace OASystem.Domain.ViewModels.CRM
     /// <summary>
     /// 
     /// </summary>
-    public class VisaCustomerCompanyView : Crm_VisaCustomerCompany
+    public class CustomerCompanyView : Crm_VisaCustomerCompany
     { }
 
 
@@ -19,7 +19,7 @@ namespace OASystem.Domain.ViewModels.CRM
     /// 签证客户公司
     /// 返回视图
     /// </summary>
-    public class VisaCustomerCompanyListView
+    public class CustomerCompanyListView
     {
         /// <summary>
         /// ID
@@ -50,5 +50,9 @@ namespace OASystem.Domain.ViewModels.CRM
         /// 创建时间
         /// </summary>
         public DateTime CreateTime { get; set; }
+        /// <summary>
+        /// 备注
+        /// </summary>
+        public string Remark { get; set; }
     }
 }

+ 233 - 0
OASystem/OASystem.Domain/ViewModels/SmallFun/GoogleMapResultView.cs

@@ -0,0 +1,233 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace OASystem.Domain.ViewModels.SmallFun
+{
+    /// <summary>
+    /// googleMapApi 返回试图
+    /// </summary>
+    public class GoogleMapResultView
+    {
+        /// <summary>
+        /// 地理编码路径点
+        /// </summary>
+        public object? Geocoded_waypoints { get; set; }
+
+        /// <summary>
+        /// 返回数据源
+        /// </summary>
+        public object? Routes { get; set; }
+
+        /// <summary>
+        /// 状态
+        /// </summary>
+        public string? Status { get; set; }
+    }
+
+    /// <summary>
+    /// 途径
+    /// </summary>
+    public class Routes
+    {
+        /// <summary>
+        /// 界标
+        /// </summary>
+        public Bounds? Bounds { get; set; }
+
+        /// <summary>
+        /// 版权保护
+        /// </summary>
+        public string? CopyRights { get; set; }
+    }
+
+    #region bounds 界标
+
+    /// <summary>
+    /// 界标
+    /// </summary>
+    public class Bounds {
+
+        /// <summary>
+        /// 东北方
+        /// </summary>
+        public Northeast? Northeast { get; set; }
+
+        /// <summary>
+        /// 西南方
+        /// </summary>
+        public Southwest? Southwest { get; set; }
+
+    }
+
+    /// <summary>
+    /// 东北方
+    /// </summary>
+    public class Northeast
+    {
+        /// <summary>
+        /// 纬度
+        /// </summary>
+        public string? Lat { get; set; }
+
+        /// <summary>
+        /// 经度
+        /// </summary>
+        public string Lng { get; set; }
+    }
+
+    /// <summary>
+    /// 西南方
+    /// </summary>
+    public class Southwest
+    {
+        /// <summary>
+        /// 纬度
+        /// </summary>
+        public string? Lat { get; set; }
+
+        /// <summary>
+        /// 经度
+        /// </summary>
+        public string Lng { get; set; }
+    }
+    #endregion
+
+    #region leg
+   
+    /// <summary>
+    /// Leg
+    /// </summary>
+    public class Leg
+    {
+        /// <summary>
+        /// 距离
+        /// </summary>
+        public TextValue? Distance { get; set; }
+
+        /// <summary>
+        /// 时长
+        /// </summary>
+        public TextValue? Duration { get; set; }
+
+        /// <summary>
+        /// 结束地址
+        /// </summary>
+        public string? End_address { get; set; }
+
+        /// <summary>
+        /// 结束地址经纬度
+        /// </summary>
+        public LatLng? End_location { get; set; }
+
+        /// <summary>
+        /// 开始地址
+        /// </summary>
+        public string? Start_address { get; set; }
+
+        /// <summary>
+        /// 开始地址经纬度
+        /// </summary>
+        public LatLng? Start_location { get; set; }
+        
+        /// <summary>
+        /// Step
+        /// </summary>
+        public List<Step>? Steps { get; set; }
+
+
+    }
+
+
+    /// <summary>
+    /// Step
+    /// </summary>
+    public class Step
+    {
+        /// <summary>
+        /// 距离
+        /// </summary>
+        public TextValue? Distance { get; set; }
+
+        /// <summary>
+        /// 耗时
+        /// </summary>
+        public TextValue? Duration { get; set; }
+
+        /// <summary>
+        /// 结束经纬度
+        /// </summary>
+        public LatLng? End_location { get; set; }
+
+        /// <summary>
+        /// html指令
+        /// </summary>
+        public string? Html_instructions { get; set; }
+
+        /// <summary>
+        /// 多线
+        /// </summary>
+        public Polyline? Polyline { get; set; }
+
+        /// <summary>
+        /// 开始经纬度
+        /// </summary>
+        public LatLng? Start_location { get; set; }
+
+        /// <summary>
+        /// 出行方式
+        /// </summary>
+        public string? Travel_mode { get; set; }
+    }
+
+
+    /// <summary>
+    /// 多线
+    /// </summary>
+    public class Polyline 
+    {
+        /// <summary>
+        /// 目的
+        /// </summary>
+        public string? Points { get; set; }
+    }
+
+    /// <summary>
+    /// 文本值
+    /// </summary>
+    public class TextValue
+    {
+        /// <summary>
+        /// 文本
+        /// </summary>
+        public string? Text { get; set; }
+
+        /// <summary>
+        /// 值
+        /// </summary>
+        public int Value { get; set; }
+    }
+
+    /// <summary>
+    /// 经纬度值
+    /// </summary>
+    public class LatLng 
+    {
+        /// <summary>
+        /// 纬度
+        /// </summary>
+        public string? Lat { get; set; }
+
+        /// <summary>
+        /// 经度
+        /// </summary>
+        public string Lng { get; set; }
+    }
+    
+    
+    
+    
+    #endregion
+}

+ 34 - 0
OASystem/OASystem.Domain/ViewModels/SmallFun/GoogleMapView.cs

@@ -0,0 +1,34 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace OASystem.Domain.ViewModels.SmallFun
+{
+    /// <summary>
+    /// google地图 返回 时间and距离 View
+    /// </summary>
+    public class DistanceAndTimeView
+    {
+        /// <summary>
+        /// 时间文本
+        /// </summary>
+        public string? DurationText { get; set; }
+
+        /// <summary>
+        /// 时间值
+        /// </summary>
+        public int? DurationValue { get; set; }
+
+        /// <summary>
+        /// 距离文本
+        /// </summary>
+        public string? DistanceText { get; set; }
+
+        /// <summary>
+        /// 距离值
+        /// </summary>
+        public int? DistanceValue { get; set; }
+    }
+}

+ 158 - 0
OASystem/OASystem.Domain/ViewModels/SmallFun/YouDaoLanguageView.cs

@@ -0,0 +1,158 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace OASystem.Domain.ViewModels.SmallFun
+{
+    /// <summary>
+    /// 有道api支持支持语言
+    /// </summary>
+    public class YouDaoLanguageView
+    {
+        /// <summary>
+        /// 语言名称
+        /// </summary>
+        public string? Name { get; set; }
+
+        /// <summary>
+        /// 语言code
+        /// </summary>
+        public string? Code { get; set; }
+    }
+
+
+    /// <summary>
+    /// 有道API语言
+    /// </summary>
+    public class GetYouDaoLanguages
+    {
+        /// <summary>
+        /// 获取所有语言
+        /// </summary>
+        public List<YouDaoLanguageView> Luanguages
+        {
+            get
+            {
+                List<YouDaoLanguageView> _languages = new List<YouDaoLanguageView>() {
+                   //new YouDaoLanguageView { Name = "自动识别",Code = "auto" },
+                   new YouDaoLanguageView { Name = "中文",Code = "zh-CHS" },
+                   new YouDaoLanguageView { Name = "中文繁体",Code = "zh-CHT" },
+                   new YouDaoLanguageView { Name = "英文",Code = "en" },
+                   new YouDaoLanguageView { Name = "日文",Code = "ja" },
+                   new YouDaoLanguageView { Name = "韩文",Code = "ko" },
+                   new YouDaoLanguageView { Name = "法文",Code = "fr" },
+                   new YouDaoLanguageView { Name = "西班牙文",Code = "es" },
+                   new YouDaoLanguageView { Name = "葡萄牙文",Code = "pt" },
+                   new YouDaoLanguageView { Name = "意大利文",Code = "it" },
+                   new YouDaoLanguageView { Name = "俄文",Code = "ru" },
+                   new YouDaoLanguageView { Name = "越南文",Code = "vi" },
+                   new YouDaoLanguageView { Name = "德文",Code = "de" },
+                   new YouDaoLanguageView { Name = "阿拉伯文",Code = "ar" },
+                   new YouDaoLanguageView { Name = "印尼文",Code = "id" },
+                   new YouDaoLanguageView { Name = "南非荷兰语",Code = "af" },
+                   new YouDaoLanguageView { Name = "波斯尼亚语",Code = "bs" },
+                   new YouDaoLanguageView { Name = "保加利亚语",Code = "bg" },
+                   new YouDaoLanguageView { Name = "粤语",Code = "yue" },
+                   new YouDaoLanguageView { Name = "加泰隆语",Code = "ca" },
+                   new YouDaoLanguageView { Name = "克罗地亚语",Code = "hr" },
+                   new YouDaoLanguageView { Name = "捷克语",Code = "cs" },
+                   new YouDaoLanguageView { Name = "丹麦语",Code = "da" },
+                   new YouDaoLanguageView { Name = "荷兰语",Code = "nl" },
+                   new YouDaoLanguageView { Name = "爱沙尼亚语",Code = "et" },
+                   new YouDaoLanguageView { Name = "斐济语",Code = "fj" },
+                   new YouDaoLanguageView { Name = "芬兰语",Code = "fi" },
+                   new YouDaoLanguageView { Name = "希腊语",Code = "el" },
+                   new YouDaoLanguageView { Name = "海地克里奥尔语",Code = "ht" },
+                   new YouDaoLanguageView { Name = "希伯来语",Code = "he" },
+                   new YouDaoLanguageView { Name = "印地语",Code = "hi" },
+                   new YouDaoLanguageView { Name = "白苗语",Code = "mww" },
+                   new YouDaoLanguageView { Name = "匈牙利语",Code = "hu" },
+                   new YouDaoLanguageView { Name = "斯瓦希里语",Code = "sw" },
+                   new YouDaoLanguageView { Name = "克林贡语",Code = "tlh" },
+                   new YouDaoLanguageView { Name = "拉脱维亚语",Code = "lv" },
+                   new YouDaoLanguageView { Name = "立陶宛语",Code = "lt" },
+                   new YouDaoLanguageView { Name = "马来语",Code = "ms" },
+                   new YouDaoLanguageView { Name = "马耳他语",Code = "mt" },
+                   new YouDaoLanguageView { Name = "挪威语",Code = "no" },
+                   new YouDaoLanguageView { Name = "波斯语",Code = "fa" },
+                   new YouDaoLanguageView { Name = "波兰语",Code = "pl" },
+                   new YouDaoLanguageView { Name = "克雷塔罗奥托米语",Code = "otq" },
+                   new YouDaoLanguageView { Name = "罗马尼亚语",Code = "ro" },
+                   new YouDaoLanguageView { Name = "塞尔维亚语(西里尔文)",Code = "sr-Cyrl" },
+                   new YouDaoLanguageView { Name = "塞尔维亚语(拉丁文)",Code = "sr-Latn" },
+                   new YouDaoLanguageView { Name = "斯洛伐克语",Code = "sk" },
+                   new YouDaoLanguageView { Name = "斯洛文尼亚语",Code = "sl" },
+                   new YouDaoLanguageView { Name = "瑞典语",Code = "sv" },
+                   new YouDaoLanguageView { Name = "塔希提语",Code = "ty" },
+                   new YouDaoLanguageView { Name = "泰语",Code = "th" },
+                   new YouDaoLanguageView { Name = "汤加语",Code = "to" },
+                   new YouDaoLanguageView { Name = "土耳其语",Code = "tr" },
+                   new YouDaoLanguageView { Name = "乌克兰语",Code = "uk" },
+                   new YouDaoLanguageView { Name = "乌尔都语",Code = "ur" },
+                   new YouDaoLanguageView { Name = "威尔士语",Code = "cy" },
+                   new YouDaoLanguageView { Name = "尤卡坦玛雅语",Code = "yua" },
+                   new YouDaoLanguageView { Name = "阿尔巴尼亚语",Code = "sq" },
+                   new YouDaoLanguageView { Name = "阿姆哈拉语",Code = "am" },
+                   new YouDaoLanguageView { Name = "亚美尼亚语",Code = "hy" },
+                   new YouDaoLanguageView { Name = "阿塞拜疆语",Code = "az" },
+                   new YouDaoLanguageView { Name = "孟加拉语",Code = "bn" },
+                   new YouDaoLanguageView { Name = "巴斯克语",Code = "eu" },
+                   new YouDaoLanguageView { Name = "白俄罗斯语",Code = "be" },
+                   new YouDaoLanguageView { Name = "宿务语",Code = "ceb" },
+                   new YouDaoLanguageView { Name = "科西嘉语",Code = "co" },
+                   new YouDaoLanguageView { Name = "世界语",Code = "eo" },
+                   new YouDaoLanguageView { Name = "菲律宾语",Code = "tl" },
+                   new YouDaoLanguageView { Name = "弗里西语",Code = "fy" },
+                   new YouDaoLanguageView { Name = "加利西亚语",Code = "gl" },
+                   new YouDaoLanguageView { Name = "格鲁吉亚语",Code = "ka" },
+                   new YouDaoLanguageView { Name = "古吉拉特语",Code = "gu" },
+                   new YouDaoLanguageView { Name = "豪萨语",Code = "ha" },
+                   new YouDaoLanguageView { Name = "夏威夷语",Code = "haw" },
+                   new YouDaoLanguageView { Name = "冰岛语",Code = "is" },
+                   new YouDaoLanguageView { Name = "伊博语",Code = "ig" },
+                   new YouDaoLanguageView { Name = "爱尔兰语",Code = "ga" },
+                   new YouDaoLanguageView { Name = "爪哇语",Code = "jw" },
+                   new YouDaoLanguageView { Name = "卡纳达语",Code = "kn" },
+                   new YouDaoLanguageView { Name = "哈萨克语",Code = "kk" },
+                   new YouDaoLanguageView { Name = "高棉语",Code = "km" },
+                   new YouDaoLanguageView { Name = "库尔德语",Code = "ku" },
+                   new YouDaoLanguageView { Name = "柯尔克孜语",Code = "ky" },
+                   new YouDaoLanguageView { Name = "老挝语",Code = "lo" },
+                   new YouDaoLanguageView { Name = "拉丁语",Code = "la" },
+                   new YouDaoLanguageView { Name = "卢森堡语",Code = "lb" },
+                   new YouDaoLanguageView { Name = "马其顿语",Code = "mk" },
+                   new YouDaoLanguageView { Name = "马尔加什语",Code = "mg" },
+                   new YouDaoLanguageView { Name = "马拉雅拉姆语",Code = "ml" },
+                   new YouDaoLanguageView { Name = "毛利语",Code = "mi" },
+                   new YouDaoLanguageView { Name = "马拉地语",Code = "mr" },
+                   new YouDaoLanguageView { Name = "蒙古语",Code = "mn" },
+                   new YouDaoLanguageView { Name = "缅甸语",Code = "my" },
+                   new YouDaoLanguageView { Name = "尼泊尔语",Code = "ne" },
+                   new YouDaoLanguageView { Name = "齐切瓦语",Code = "ny" },
+                   new YouDaoLanguageView { Name = "普什图语",Code = "ps" },
+                   new YouDaoLanguageView { Name = "旁遮普语",Code = "pa" },
+                   new YouDaoLanguageView { Name = "萨摩亚语",Code = "sm" },
+                   new YouDaoLanguageView { Name = "苏格兰盖尔语",Code = "gd" },
+                   new YouDaoLanguageView { Name = "塞索托语",Code = "st" },
+                   new YouDaoLanguageView { Name = "修纳语",Code = "sn" },
+                   new YouDaoLanguageView { Name = "信德语",Code = "sd" },
+                   new YouDaoLanguageView { Name = "僧伽罗语",Code = "si" },
+                   new YouDaoLanguageView { Name = "索马里语",Code = "so" },
+                   new YouDaoLanguageView { Name = "巽他语",Code = "su" },
+                   new YouDaoLanguageView { Name = "塔吉克语",Code = "tg" },
+                   new YouDaoLanguageView { Name = "泰米尔语",Code = "ta" },
+                   new YouDaoLanguageView { Name = "泰卢固语",Code = "te" },
+                   new YouDaoLanguageView { Name = "乌兹别克语",Code = "uz" },
+                   new YouDaoLanguageView { Name = "南非科萨语",Code = "xh" },
+                   new YouDaoLanguageView { Name = "意第绪语",Code = "yi" },
+                   new YouDaoLanguageView { Name = "约鲁巴语",Code = "yo" },
+                   new YouDaoLanguageView { Name = "南非祖鲁语",Code = "zu" },
+                };
+
+                return _languages;
+            }
+        }
+    }
+}

+ 8 - 1
OASystem/OASystem.Domain/ViewModels/System/SetDataView.cs

@@ -1,4 +1,5 @@
-using System;
+using OASystem.Domain.Entities.System;
+using System;
 using System.Collections.Generic;
 using System.Linq;
 using System.Text;
@@ -96,4 +97,10 @@ namespace OASystem.Domain.ViewModels.System
         /// </summary>
         public List<int> FunArr { get; set; }
     }
+
+    public class SetDataIView:Sys_SetData
+    {
+        public string StName { get; set; }
+        public string CnName { get;set; }
+    }
 }

+ 8 - 0
OASystem/OASystem.Domain/ViewModels/TencentOCR/IDCardOCRView.cs

@@ -57,4 +57,12 @@ namespace OASystem.Domain.ViewModels.TencentOCR
         /// </summary>
         public string ValidDate { get; set; }
     }
+
+    public class IDCardOCRAndDownUrlView : IDCardOCRView
+    {
+        /// <summary>
+        /// 下载文档地址
+        /// </summary>
+        public string DownUrl { get; set; }
+    }
 }

+ 70 - 7
OASystem/OASystem.Infrastructure/Repositories/CRM/VisaDeleClientCompanyRepository.cs

@@ -1,7 +1,10 @@
-using OASystem.Domain;
+using AutoMapper;
+using OASystem.Domain;
 using OASystem.Domain.Dtos;
+using OASystem.Domain.Dtos.CRM;
 using OASystem.Domain.Dtos.UserDto;
 using OASystem.Domain.Entities.Customer;
+using OASystem.Domain.Entities.Resource;
 using OASystem.Domain.ViewModels.CRM;
 using System;
 using System.Collections.Generic;
@@ -15,10 +18,14 @@ namespace OASystem.Infrastructure.Repositories.CRM
     /// 签证客户公司
     /// 仓库
     /// </summary>
-    public class VisaDeleClientCompanyRepository : BaseRepository<Crm_VisaCustomerCompany, VisaCustomerCompanyView>
+    public class VisaDeleClientCompanyRepository : BaseRepository<Crm_CustomerCompany, CustomerCompanyView>
     {
-        public VisaDeleClientCompanyRepository(SqlSugarClient sqlSugar) :
-            base(sqlSugar){ }
+        private readonly IMapper _mapper;
+        public VisaDeleClientCompanyRepository(SqlSugarClient sqlSugar, IMapper mapper) :
+            base(sqlSugar)
+        {
+            _mapper= mapper;
+        }
 
         /// <summary>
         /// 签证客户公司 List
@@ -31,10 +38,10 @@ namespace OASystem.Infrastructure.Repositories.CRM
 
             if (dto.PortType == 1 || dto.PortType == 2)
             {
-                string sql = string.Format(@"Select ccc.Id,ccc.CompanyName,ccc.Address,ccc.PostCodes,su.CnName UserName,ccc.CreateTime 
-                                             From Crm_CustomerCompany ccc Inner Join Sys_Users su On ccc.CreateUserId = su.Id");
+                string sql = string.Format(@"Select ccc.Id,ccc.CompanyName,ccc.Address,ccc.PostCodes,su.CnName UserName,ccc.CreateTime,ccc.Remark
+                                             From Crm_CustomerCompany ccc Inner Join Sys_Users su On ccc.CreateUserId = su.Id where ccc.IsDel=0");
 
-                var _clientCompanyList = await _sqlSugar.SqlQueryable<VisaCustomerCompanyListView>(sql).ToListAsync();
+                var _clientCompanyList = await _sqlSugar.SqlQueryable<CustomerCompanyListView>(sql).ToListAsync();
                 if (_clientCompanyList.Count > 0)
                 {
                     result.Code = 0;
@@ -50,5 +57,61 @@ namespace OASystem.Infrastructure.Repositories.CRM
             return result;
         }
 
+        public async  Task<Result> OperationClientCompany(OperationClientCompanyDto dto)
+        {
+            Result result = new Result() { Code = -2, Msg = "未知错误" };
+            try
+            {
+                if (dto.Status == 1)//添加
+                {
+                    string selectSql = string.Format(@"select * from Crm_CustomerCompany WHERE CompanyName='{0}' and IsDel='{1}'"
+                                                       , dto.CompanyName, 0);
+                    var CustomerCompany = await _sqlSugar.SqlQueryable<Crm_CustomerCompany>(selectSql).FirstAsync();//查询是否存在
+                    if (CustomerCompany != null)
+                    {
+                        return result = new Result() { Code = -1, Msg = "该信息已存在,请勿重复添加!" };
+
+                    }
+                    else//不存在,可添加
+                    {
+                        Crm_CustomerCompany _CustomerCompany = _mapper.Map<Crm_CustomerCompany>(dto);
+                        int id = await AddAsyncReturnId(_CustomerCompany);
+                        if (id == 0)
+                        {
+                            return result = new Result() { Code = -1, Msg = "添加失败!" };
+
+                        }
+                        result = new Result() { Code = 0, Msg = "添加成功!", Data = new { Id = id } };
+                    }
+                }
+                else if (dto.Status == 2)//修改
+                {
+                    bool res = await UpdateAsync(a => a.Id == dto.Id, a => new Crm_CustomerCompany
+                    {
+                        CompanyName=dto.CompanyName,
+                        Address = dto.Address,
+                        PostCodes = dto.PostCodes,
+                        LastedOpUserId = dto.LastedOpUserId,
+                        LastedOpDt = dto.LastedOpDt,
+                        Remark = dto.Remark,
+                     
+                    });
+                    if (!res)
+                    {
+                        return result = new Result() { Code = -1, Msg = "修改失败!" };
+                    }
+                    result = new Result() { Code = 0, Msg = "修改成功!" };
+                }
+                else
+                {
+                    return result = new Result() { Code = -1, Msg = "请传入Status参数,1添加 2修改!" };
+                }
+            }
+            catch (Exception ex)
+            {
+                return result = new Result() { Code = -2, Msg = "程序错误!" };
+            }
+            return result;
+        }
     }
 }

+ 181 - 3
OASystem/OASystem.Infrastructure/Repositories/System/SetDataRepository.cs

@@ -1,6 +1,9 @@
 
+using AutoMapper;
 using OASystem.Domain;
+using OASystem.Domain.Dtos.System;
 using OASystem.Domain.Dtos.UserDto;
+using OASystem.Domain.Entities.Resource;
 using OASystem.Domain.Entities.System;
 using OASystem.Domain.ViewModels.System;
 
@@ -8,9 +11,10 @@ namespace OASystem.Infrastructure.Repositories.System
 {
     public class SetDataRepository : BaseRepository<Sys_SetData, SetDataView>
     {
-        public SetDataRepository(SqlSugarClient sqlSugar) : base(sqlSugar)
+        private readonly IMapper _mapper;
+        public SetDataRepository(SqlSugarClient sqlSugar, IMapper mapper) : base(sqlSugar)
         {
-
+            _mapper = mapper;
         }
 
         /// <summary>
@@ -94,7 +98,181 @@ namespace OASystem.Infrastructure.Repositories.System
 
             return result;
         }
-        
 
+        public async Task<Result> QuerySetData(SetDataIDto dto)
+        {
+            Result result = new Result() { Code = -2, Msg = "未知错误" };
+            try
+            {
+                string sqlWhere = string.Empty;
+                if (dto.STid!=0)
+                {
+                    sqlWhere += string.Format(@" And s2.STid ={0}=", dto.STid);
+                }
+                sqlWhere += string.Format(@" And s1.IsDel={0} And  s2.IsDel={0}", 0);
+                if (!string.IsNullOrEmpty(sqlWhere.Trim()))
+                {
+                    Regex r = new Regex("And");
+                    sqlWhere = r.Replace(sqlWhere, "Where", 1);
+                }
+                if (dto.PortType == 1)
+                {
+                    string sql = string.Format(@"select s2.*,s1.Name as 'StName',u.CnName from Sys_setDataType s1 left join Sys_SetData s2 on s1.Id=s2.STid left join Sys_Users u on s2.CreateUserId=u.Id {0}", sqlWhere);
+                    List<SetDataIView> SetData = await _sqlSugar.SqlQueryable<SetDataIView>(sql).ToListAsync();
+                    if (SetData.Count == 0)
+                    {
+                        return result = new Result() { Code = -1, Msg = "暂无数据" };
+                    }
+                    SetData = SetData.OrderByDescending(x => x.CreateTime).ToList();
+
+                    if (dto.PageSize == 0 && dto.PageIndex == 0)
+                    {
+                        return result = new Result()
+                        {
+                            Code = 0,
+                            Msg = "查询成功",
+                            Data = SetData,
+                        };
+                    }
+                    else
+                    {
+                        int count = SetData.Count;
+                        float totalPage = (float)count / dto.PageSize;//总页数
+                        if (totalPage == 0) totalPage = 1;
+                        else totalPage = (int)Math.Ceiling((double)totalPage);
+
+                        List<SetDataIView> _SetData = new List<SetDataIView>();
+                        for (int i = 0; i < dto.PageSize; i++)
+                        {
+                            var RowIndex = i + (dto.PageIndex - 1) * dto.PageSize;
+                            if (RowIndex < SetData.Count)
+                            {
+                                _SetData.Add(SetData[RowIndex]);
+                            }
+                            else
+                            {
+                                break;
+                            }
+                        }
+                        return result = new Result()
+                        {
+                            Code = 0,
+                            Msg = "查询成功",
+                            Data = new { pageCount = count, totalPage = (int)totalPage, pageIndex = dto.PageIndex, pageSize = dto.PageSize, pageSource = _SetData },
+                        };
+                    }
+
+                }
+                else if (dto.PortType == 2)
+                {
+                    string sql = string.Format(@"select s2.*,s1.Name as 'StName' from Sys_setDataType s1 left join Sys_SetData s2 on s1.Id=s2.STid {0}", sqlWhere);
+                    List<SetDataIView> SetData = await _sqlSugar.SqlQueryable<SetDataIView>(sql).ToListAsync();
+                    if (SetData.Count == 0)
+                    {
+                        return result = new Result() { Code = -1, Msg = "暂无数据" };
+                    }
+                    SetData = SetData.OrderByDescending(x => x.CreateTime).ToList();
+
+                    if (dto.PageSize == 0 && dto.PageIndex == 0)
+                    {
+                        return result = new Result()
+                        {
+                            Code = 0,
+                            Msg = "查询成功",
+                            Data = SetData,
+                        };
+                    }
+                    else
+                    {
+                        int count = SetData.Count;
+                        float totalPage = (float)count / dto.PageSize;//总页数
+                        if (totalPage == 0) totalPage = 1;
+                        else totalPage = (int)Math.Ceiling((double)totalPage);
+
+                        List<SetDataIView> _SetData = new List<SetDataIView>();
+                        for (int i = 0; i < dto.PageSize; i++)
+                        {
+                            var RowIndex = i + (dto.PageIndex - 1) * dto.PageSize;
+                            if (RowIndex < SetData.Count)
+                            {
+                                _SetData.Add(SetData[RowIndex]);
+                            }
+                            else
+                            {
+                                break;
+                            }
+                        }
+                        return result = new Result()
+                        {
+                            Code = 0,
+                            Msg = "查询成功",
+                            Data = new { pageCount = count, totalPage = (int)totalPage, pageIndex = dto.PageIndex, pageSize = dto.PageSize, pageSource = _SetData },
+                        };
+                    }
+                }
+                else
+                {
+                    return result = new Result() { Code = -2, Msg = "请传入PortType参数!1:Web,2:Android,3:IOS" };
+                }
+            }
+            catch (Exception)
+            {
+                return result;
+                throw;
+            }
+        }
+
+        public async Task<Result> OperationSetData(OperationSetDataDto dto)
+        {
+            Result result = new Result() { Code = -2, Msg = "未知错误" };
+            try
+            {
+                if (dto.Status == 1)//添加
+                {
+                    string selectSql = string.Format(@"select * from Sys_SetData where Name='{0}' and IsDel='{1}'"
+                                                       , dto.Name, 0);
+                    var SetData = await _sqlSugar.SqlQueryable<Sys_SetData>(selectSql).FirstAsync();//查询是否存在
+                    if (SetData != null)
+                    {
+                        return result = new Result() { Code = -1, Msg = "该信息已存在,请勿重复添加!" };
+
+                    }
+                    else//不存在,可添加
+                    {
+                        Sys_SetData _SetData = _mapper.Map<Sys_SetData>(dto);
+                        int id = await AddAsyncReturnId(_SetData);
+                        if (id == 0)
+                        {
+                            return result = new Result() { Code = -1, Msg = "添加失败!" };
+
+                        }
+                        result = new Result() { Code = 0, Msg = "添加成功!", Data = new { Id = id } };
+                    }
+                }
+                else if (dto.Status == 2)//修改
+                {
+                    bool res = await UpdateAsync(a => a.Id == dto.Id, a => new Sys_SetData
+                    {
+                        Name = dto.Name,
+                        STid = dto.STid,
+                        Remark = dto.Remark,
+                    });
+                    if (!res)
+                    {
+                        return result = new Result() { Code = -1, Msg = "修改失败!" };
+                    }
+                    result = new Result() { Code = 0, Msg = "修改成功!" };
+                }
+                else
+                {
+                    return result = new Result() { Code = -1, Msg = "请传入Status参数,1添加 2修改!" };
+                }
+            }
+            catch (Exception ex)
+            {
+                return result = new Result() { Code = -2, Msg = "程序错误!" };
+            }
+            return result;
+        }
     }
 }

+ 68 - 6
OASystem/OASystem.Infrastructure/Repositories/System/SetDataTypeRepository.cs

@@ -11,17 +11,79 @@ using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
 
-namespace OASystem.Infrastructure.Repositories.Resource
+namespace OASystem.Infrastructure.Repositories.System
 {
-    public class SetDataTypeRepository: BaseRepository<Sys_SetDataType, SetDataTypeView>
+    public class SetDataTypeRepository : BaseRepository<Sys_SetDataType, SetDataTypeView>
     {
         private readonly IMapper _mapper;
         public SetDataTypeRepository(SqlSugarClient sqlSugar, IMapper mapper) : base(sqlSugar)
         {
             _mapper = mapper;
         }
+        /// <summary>
+        /// 数据类型种类修改添加炒作
+        /// </summary>
+        /// <param name="dto"></param>
+        /// <returns></returns>
+        public async Task<Result> OperationSetDataType(OperationSetDataTypeDto dto)
+        {
+            Result result = new Result() { Code = -2, Msg = "未知错误" };
+            try
+            {
+                if (dto.Status == 1)//添加
+                {
+                    string selectSql = string.Format(@"select * from Sys_SetDataType where Name='{0}' and IsDel='{1}'"
+                                                       , dto.Name, 0);
+                    var SetDataType = await _sqlSugar.SqlQueryable<Sys_SetDataType>(selectSql).FirstAsync();//查询是否存在
+                    if (SetDataType != null)
+                    {
+                        return result = new Result() { Code = -1, Msg = "该信息已存在,请勿重复添加!" };
+
+                    }
+                    else//不存在,可添加
+                    {
+                        Sys_SetDataType _SetDataType = _mapper.Map<Sys_SetDataType>(dto);
+                        int id = await AddAsyncReturnId(_SetDataType);
+                        if (id == 0)
+                        {
+                            return result = new Result() { Code = -1, Msg = "添加失败!" };
 
-        public async Task<Result> QuerySetDataType(setDataTypeDto dto)
+                        }
+                        result = new Result() { Code = 0, Msg = "添加成功!", Data = new { Id = id } };
+                    }
+                }
+                else if (dto.Status == 2)//修改
+                {
+                    bool res = await UpdateAsync(a => a.Id == dto.Id, a => new Sys_SetDataType
+                    {
+                        Name = dto.Name,
+                        IsEnable = dto.IsEnable,
+                        Remark = dto.Remark,
+                    });
+                    if (!res)
+                    {
+                        return result = new Result() { Code = -1, Msg = "修改失败!" };
+                    }
+                    result = new Result() { Code = 0, Msg = "修改成功!" };
+                }
+                else
+                {
+                    return result = new Result() { Code = -1, Msg = "请传入Status参数,1添加 2修改!" };
+                }
+            }
+            catch (Exception ex)
+            {
+                return result = new Result() { Code = -2, Msg = "程序错误!" };
+            }
+            return result;
+        }
+
+        /// <summary>
+        /// 查询数据类型种类
+        /// </summary>
+        /// <param name="dto"></param>
+        /// <returns></returns>
+        public async Task<Result> QuerySetDataType(SetDataTypeDto dto)
         {
             Result result = new Result() { Code = -2, Msg = "未知错误" };
             try
@@ -43,7 +105,7 @@ namespace OASystem.Infrastructure.Repositories.Resource
                 }
                 if (dto.PortType == 1)
                 {
-                    string sql = string.Format(@"select s.*,u.CnName from Sys_setDataType s left join Sys_Users u on s.CreateUserId=u.Id  {0}", sqlWhere);
+                    string sql = string.Format(@"select s.*,u.CnName from Sys_SetDataType s left join Sys_Users u on s.CreateUserId=u.Id  {0}", sqlWhere);
                     List<SetDataTypeView> SetDataType = await _sqlSugar.SqlQueryable<SetDataTypeView>(sql).ToListAsync();
                     if (SetDataType.Count == 0)
                     {
@@ -91,7 +153,7 @@ namespace OASystem.Infrastructure.Repositories.Resource
                 }
                 else if (dto.PortType == 2)
                 {
-                    string sql = string.Format(@"select s.*,u.CnName from Sys_setDataType s left join Sys_Users u on s.CreateUserId=u.Id  {0}", sqlWhere);
+                    string sql = string.Format(@"select s.*,u.CnName from Sys_SetDataType s left join Sys_Users u on s.CreateUserId=u.Id  {0}", sqlWhere);
                     List<SetDataTypeView> SetDataType = await _sqlSugar.SqlQueryable<SetDataTypeView>(sql).ToListAsync();
                     if (SetDataType.Count == 0)
                     {
@@ -148,5 +210,5 @@ namespace OASystem.Infrastructure.Repositories.Resource
             }
         }
     }
-   
+
 }

+ 28 - 1
OASystem/OASystem.Infrastructure/Repositories/System/SystemMenuPermissionRepository.cs

@@ -1,6 +1,7 @@
 using OASystem.Domain;
 using OASystem.Domain.Entities.System;
 using OASystem.Domain.ViewModels.System;
+using System.Collections;
 
 namespace OASystem.Infrastructure.Repositories.System
 {
@@ -105,7 +106,33 @@ namespace OASystem.Infrastructure.Repositories.System
                 {
                     result.Code = 0;
                     result.Msg = "成功!";
-                    result.Data = DBData;
+                    var arr = new ArrayList();
+
+                    if (PortType == 1)
+                    {
+                        var menuGroup = DBData.GroupBy(x => x.modulid);
+                        foreach (var item in menuGroup)
+                        {
+                            var modul = item.FirstOrDefault();
+                            if (modul != null)
+                            {
+                                arr.Add(new
+                                {
+                                    modulName = modul.modulName,
+                                    modulid = modul.modulid,
+                                    pageList = item
+                                });
+                            }
+                        }
+
+                    }
+                    else if (PortType == 2)
+                    {
+                        var pages = DBData.Select(x => x.pageid).ToArray();
+                        arr = ArrayList.Adapter(pages);
+                    }
+
+                    result.Data = arr;
                 }
                
             }

+ 1 - 0
OASystem/OASystem.Infrastructure/Tools/CommonFun.cs

@@ -234,4 +234,5 @@ public static class CommonFun
     }
 
     #endregion
+
 }

+ 1 - 1
OASystem/_Doc/OA2023数据字典.docx

@@ -531,7 +531,7 @@ Null
 是否由职位模板导入
 是否由职位模板导入
 
-9) 岗位权限表:Sys_JobPostAuthority(新增)
+9) 岗位权限表:(新增)
                                    字段名
                                  类型长度
                                  字段属性