Просмотр исходного кода

物资入库表增加字段(批次号、入库人、入库时间)

LEIYI месяцев назад: 10
Родитель
Сommit
75c9f0a552
54 измененных файлов с 966 добавлено и 1139 удалено
  1. 2 10
      OASystem/EntitySync/Program.cs
  2. 7 12
      OASystem/OASystem.Api/Controllers/BaiduOCRController.cs
  3. 4 5
      OASystem/OASystem.Api/Controllers/BaseController.cs
  4. 25 35
      OASystem/OASystem.Api/Controllers/BusinessController.cs
  5. 14 18
      OASystem/OASystem.Api/Controllers/CRMController.cs
  6. 2 6
      OASystem/OASystem.Api/Controllers/CallbackController.cs
  7. 7 9
      OASystem/OASystem.Api/Controllers/ClientHubController.cs
  8. 130 138
      OASystem/OASystem.Api/Controllers/FinancialController.cs
  9. 63 59
      OASystem/OASystem.Api/Controllers/GroupsController.cs
  10. 2 5
      OASystem/OASystem.Api/Controllers/MarketCustomerResourcesController.cs
  11. 152 167
      OASystem/OASystem.Api/Controllers/PersonnelModuleController.cs
  12. 65 63
      OASystem/OASystem.Api/Controllers/ResourceController.cs
  13. 11 27
      OASystem/OASystem.Api/Controllers/SmallFunController.cs
  14. 47 38
      OASystem/OASystem.Api/Controllers/StatisticsController.cs
  15. 9 10
      OASystem/OASystem.Api/Controllers/SystemController.cs
  16. 32 36
      OASystem/OASystem.Api/Controllers/TencentOCRController.cs
  17. 27 46
      OASystem/OASystem.Api/GlobalUsings.cs
  18. 1 3
      OASystem/OASystem.Api/Middlewares/ExceptionHandlingMiddleware.cs
  19. 1 1
      OASystem/OASystem.Api/OAMethodLib/ALiYun/AliMessagePost.cs
  20. 3 3
      OASystem/OASystem.Api/OAMethodLib/Auth/JWTBearer.cs
  21. 3 4
      OASystem/OASystem.Api/OAMethodLib/AutofacRegister.cs
  22. 2 5
      OASystem/OASystem.Api/OAMethodLib/BaiduApi/BaiduApiHelper.cs
  23. 4 11
      OASystem/OASystem.Api/OAMethodLib/ChatGPT/ChatGPTTools.cs
  24. 0 1
      OASystem/OASystem.Api/OAMethodLib/ExcelOutput/Excel_BusConfItemList.cs
  25. 2 8
      OASystem/OASystem.Api/OAMethodLib/File/AsposeHelper.cs
  26. 57 59
      OASystem/OASystem.Api/OAMethodLib/GeneralMethod.cs
  27. 10 9
      OASystem/OASystem.Api/OAMethodLib/GoogleMapAPI/GoogleMapTools.cs
  28. 9 12
      OASystem/OASystem.Api/OAMethodLib/GroupCommission.cs
  29. 2 8
      OASystem/OASystem.Api/OAMethodLib/GroupStepForDelegation.cs
  30. 1 3
      OASystem/OASystem.Api/OAMethodLib/IOOperatorHelper.cs
  31. 1 3
      OASystem/OASystem.Api/OAMethodLib/JsonConvertOverride.cs
  32. 6 14
      OASystem/OASystem.Api/OAMethodLib/JuHeAPI/JuHeApiService.cs
  33. 62 76
      OASystem/OASystem.Api/OAMethodLib/PayrollComputation.cs
  34. 4 5
      OASystem/OASystem.Api/OAMethodLib/QiYeWeChatAPI/AppNotice/Config.cs
  35. 5 8
      OASystem/OASystem.Api/OAMethodLib/QiYeWeChatAPI/AppNotice/Library.cs
  36. 1 10
      OASystem/OASystem.Api/OAMethodLib/QiYeWeChatAPI/QiYeWeChatApiService.cs
  37. 0 2
      OASystem/OASystem.Api/OAMethodLib/Quartz/Business/DeleReminderMessage.cs
  38. 2 2
      OASystem/OASystem.Api/OAMethodLib/Quartz/Business/TaskAssignment.cs
  39. 2 2
      OASystem/OASystem.Api/OAMethodLib/Quartz/Business/TaskNotification.cs
  40. 2 2
      OASystem/OASystem.Api/OAMethodLib/Quartz/Business/TeamCurrency.cs
  41. 0 1
      OASystem/OASystem.Api/OAMethodLib/Quartz/Jobs/GroupTeamCurrencyJob.cs
  42. 2 3
      OASystem/OASystem.Api/OAMethodLib/Quartz/Jobs/TaskJob.cs
  43. 2 7
      OASystem/OASystem.Api/OAMethodLib/Quartz/Jobs/TaskNewsFeedJob.cs
  44. 3 4
      OASystem/OASystem.Api/OAMethodLib/Quartz/QuartzFactory.cs
  45. 7 14
      OASystem/OASystem.Api/OAMethodLib/SignalR/Hubs/ChatHub.cs
  46. 14 16
      OASystem/OASystem.Api/OAMethodLib/TencentCloudAPI/TencentOCRTools.cs
  47. 1 4
      OASystem/OASystem.Api/OAMethodLib/YouDaoAPI/YouDaoApiTools.cs
  48. 14 31
      OASystem/OASystem.Api/Program.cs
  49. 1 2
      OASystem/OASystem.Api/SwaggerApi.cs
  50. 17 4
      OASystem/OASystem.Domain/Dtos/PersonnelModule/GoodsDTO.cs
  51. 18 0
      OASystem/OASystem.Domain/Entities/PersonnelModule/Pm_GoodsStorage.cs
  52. 0 2
      OASystem/OASystem.Domain/ViewModels/Financial/Fin_ForeignReceivablesView.cs
  53. 41 61
      OASystem/OASystem.Infrastructure/Repositories/Groups/AirTicketResRepository.cs
  54. 67 55
      OASystem/OASystem.Infrastructure/Repositories/PersonnelModule/GoodsRepository.cs

+ 2 - 10
OASystem/EntitySync/Program.cs

@@ -1,18 +1,10 @@
-using OASystem.Domain.Entities;
-using OASystem.Domain.Entities.Business;
-using OASystem.Domain.Entities.Customer;
-using OASystem.Domain.Entities.District;
-using OASystem.Domain.Entities.Financial;
-using OASystem.Domain.Entities.Groups;
-using OASystem.Domain.Entities.PersonnelModule;
-using OASystem.Domain.Entities.Resource;
-using OASystem.Domain.Entities.System;
+using OASystem.Domain.Entities.PersonnelModule;
 using SqlSugar;
 
 var db = new SqlSugarClient(new ConnectionConfig()
 {
     ConnectionString = "server=132.232.92.186;uid=sa;pwd=Yjx@158291;database=OA2023DB;",
-    DbType = SqlSugar.DbType.SqlServer,
+    DbType = DbType.SqlServer,
     IsAutoCloseConnection = true,
     InitKeyType = InitKeyType.Attribute
 });

+ 7 - 12
OASystem/OASystem.Api/Controllers/BaiduOCRController.cs

@@ -1,12 +1,7 @@
-using Autofac.Core;
-using Microsoft.AspNetCore.Http;
-using Microsoft.AspNetCore.Mvc;
-using OASystem.API.OAMethodLib;
+using OASystem.API.OAMethodLib;
 using OASystem.API.OAMethodLib.BaiduApi;
 using OASystem.API.OAMethodLib.TencentCloudAPI;
 using OASystem.Domain.Dtos.Baidu;
-using OASystem.Domain.Dtos.CRM;
-using OASystem.Domain.Entities.Customer;
 using OASystem.Domain.ViewModels.OCR;
 using Quartz.Util;
 
@@ -68,8 +63,8 @@ namespace OASystem.API.Controllers
                     List<string> listSexStr = new List<string>() { "性别", "gender", "sex" };
                     List<string> listDOBStr = new List<string>() { "D.O.B", "出生年月", "生日", "出生日期" };
                     List<string> listIdCard = new List<string>() { "身份证号码", "身份证", "身份证号" };
-                    List<string> listOrganizationStr = new List<string>() { "工作单位", "organization", "单位"};
-                    List<string> listJobStr = new List<string>() { "职务", "title", "职位", "所在单位及职务" , "单位及职务" };
+                    List<string> listOrganizationStr = new List<string>() { "工作单位", "organization", "单位" };
+                    List<string> listJobStr = new List<string>() { "职务", "title", "职位", "所在单位及职务", "单位及职务" };
                     List<string> listMobileStr = new List<string>() { "联系电话", "mobile" };
                     List<string> listAgeStr = new List<string>() { "年龄", "age" };
                     List<string> listBeiZhu = new List<string>() { "备注", "本团职务" };
@@ -130,7 +125,7 @@ namespace OASystem.API.Controllers
                             }
                             catch (Exception)
                             {
-                               throw new Exception("有未能识别的列名请检查 : " + JsonConvert.SerializeObject(headerList.Select(x => x.words)));
+                                throw new Exception("有未能识别的列名请检查 : " + JsonConvert.SerializeObject(headerList.Select(x => x.words)));
                             }
 
                             if (words.IsNullOrWhiteSpace())
@@ -146,7 +141,7 @@ namespace OASystem.API.Controllers
                                     string name = words.Substring(1);
                                     client.LastName = lastName;
                                     client.FirstName = name;
-                                    string lastNamePinYin = lastName.GetTotalPingYin().Count > 0 ? lastName.GetTotalPingYin()[0].ToUpper():"";
+                                    string lastNamePinYin = lastName.GetTotalPingYin().Count > 0 ? lastName.GetTotalPingYin()[0].ToUpper() : "";
                                     string firstNamePinYin = "";
 
                                     for (int n = 0; n < name.Length; n++)
@@ -207,7 +202,7 @@ namespace OASystem.API.Controllers
                             }
                         }
 
-                        if(!(client.FirstName + client.LastName + client.Pinyin + client.CompanyFullName + client.Job + client.Phone + client.Birthday).IsNullOrWhiteSpace())
+                        if (!(client.FirstName + client.LastName + client.Pinyin + client.CompanyFullName + client.Job + client.Phone + client.Birthday).IsNullOrWhiteSpace())
                         {
                             if (string.IsNullOrWhiteSpace(client.CompanyFullName))
                             {
@@ -223,7 +218,7 @@ namespace OASystem.API.Controllers
 
                                 client.Pinyin = pinyin.TrimEnd();
                             }
-                            
+
                             ClientArr.Add(client);
                         }
                     }

+ 4 - 5
OASystem/OASystem.Api/Controllers/BaseController.cs

@@ -1,5 +1,4 @@
-using OASystem.Domain.ViewModels;
-using System.Security.Claims;
+using System.Security.Claims;
 
 namespace OASystem.API.Controllers;
 
@@ -53,7 +52,7 @@ public class ControllerBase : Microsoft.AspNetCore.Mvc.ControllerBase
     {
         if (s)
         {
-            return new JsonView { Code = StatusCodes.Status200OK, Msg = msg,Data= obj };
+            return new JsonView { Code = StatusCodes.Status200OK, Msg = msg, Data = obj };
         }
         else
         {
@@ -61,11 +60,11 @@ public class ControllerBase : Microsoft.AspNetCore.Mvc.ControllerBase
         }
     }
 
-    protected virtual JsonView JsonView(bool s, string msg, object obj,int count)
+    protected virtual JsonView JsonView(bool s, string msg, object obj, int count)
     {
         if (s)
         {
-            return new JsonView { Code = StatusCodes.Status200OK, Msg = msg, Data = obj, Count=count };
+            return new JsonView { Code = StatusCodes.Status200OK, Msg = msg, Data = obj, Count = count };
         }
         else
         {

+ 25 - 35
OASystem/OASystem.Api/Controllers/BusinessController.cs

@@ -1,11 +1,6 @@
-using Microsoft.AspNetCore.Mvc;
-using NetTaste;
-using NPOI.SS.Formula.Functions;
-using OASystem.API.OAMethodLib;
+using OASystem.API.OAMethodLib;
 using OASystem.API.OAMethodLib.ALiYun;
 using OASystem.API.OAMethodLib.ExcelOutput;
-using OASystem.Domain.Common;
-using OASystem.Domain.Dtos.Baidu;
 using OASystem.Domain.Dtos.Business;
 using OASystem.Domain.Dtos.CRM;
 using OASystem.Domain.Dtos.FileDto;
@@ -13,19 +8,13 @@ using OASystem.Domain.Dtos.Financial;
 using OASystem.Domain.Dtos.Groups;
 using OASystem.Domain.Entities.Business;
 using OASystem.Domain.Entities.Customer;
-using OASystem.Domain.Entities.Financial;
 using OASystem.Domain.Entities.Groups;
-using OASystem.Domain.Entities.Resource;
 using OASystem.Domain.ViewModels.Business;
 using OASystem.Domain.ViewModels.CRM;
-using OASystem.Domain.ViewModels.Financial;
 using OASystem.Domain.ViewModels.Groups;
 using OASystem.Infrastructure.Repositories.Business;
 using OASystem.Infrastructure.Repositories.CRM;
 using OASystem.Infrastructure.Repositories.Groups;
-using OASystem.Infrastructure.Repositories.System;
-using Org.BouncyCastle.Asn1.Mozilla;
-using StackExchange.Redis;
 
 namespace OASystem.API.Controllers
 {
@@ -42,7 +31,7 @@ namespace OASystem.API.Controllers
         private readonly TeamRateRepository _teamRateRep;
         private readonly TableOperationRecordRepository _TableOperationRecordRep;
 
-        public BusinessController( IMapper mapper, CommonBusRepository busRep, SetDataRepository setDataRep, DelegationInfoRepository groupRep, TeamRateRepository teamRateRep,
+        public BusinessController(IMapper mapper, CommonBusRepository busRep, SetDataRepository setDataRep, DelegationInfoRepository groupRep, TeamRateRepository teamRateRep,
             TableOperationRecordRepository tableOperationRecordRep)
         {
             _mapper = mapper;
@@ -79,7 +68,7 @@ namespace OASystem.API.Controllers
 
                 return Ok(JsonView(false, ex.Message));
             }
-            
+
         }
 
         /// <summary>
@@ -117,7 +106,7 @@ namespace OASystem.API.Controllers
             {
                 var errors = new StringBuilder();
                 foreach (var error in validatorRes.Errors) errors.AppendLine(error.ErrorMessage);
-                return Ok(JsonView(false,errors.ToString()));
+                return Ok(JsonView(false, errors.ToString()));
             }
 
             //获取数据
@@ -146,7 +135,7 @@ namespace OASystem.API.Controllers
 
             SetDataInfoView xc_view = new SetDataInfoView();//77	行程 //移除行程
             xc_view = _view1.Where(it => it.Id == 77).FirstOrDefault();
-            if (xc_view != null) {  _view1.Remove(xc_view); };
+            if (xc_view != null) { _view1.Remove(xc_view); };
 
             List<SetDataInfoView> _view = new List<SetDataInfoView>();
             //_view.Insert(0, new SetDataInfoView { Id = -1, Name = "所有模块" });
@@ -165,8 +154,9 @@ namespace OASystem.API.Controllers
 
             SetDataInfoView jdzc_view = new SetDataInfoView();//751	酒店早餐
             jdzc_view = _view1.Where(it => it.Id == 751).FirstOrDefault();
-            if (jdzc_view != null) { 
-                _view1.Remove(jdzc_view); 
+            if (jdzc_view != null)
+            {
+                _view1.Remove(jdzc_view);
                 //_view.Insert(3, jdzc_view); _view1.Remove(jdzc_view);
             };
 
@@ -211,7 +201,7 @@ namespace OASystem.API.Controllers
         {
             if (dto.CTable < 1) Ok(JsonView(false, @"请输入正确的员工给Id!"));
 
-            if (dto.CTable < 1) 
+            if (dto.CTable < 1)
                 return Ok(JsonView(false, @"请输入正确的CTable Id !76 酒店预订  77 行程  79 车/导游地接<br/>80 签证    81 邀请/公务活动  82 团组客户保险<br\>85 机票预订   98 其他款项 751 酒店早餐"));
 
             if (dto.PortType == 1 || dto.PortType == 2 || dto.PortType == 3)
@@ -252,7 +242,7 @@ namespace OASystem.API.Controllers
         /// 币种 List
         /// </summary>
         /// <returns></returns>
-        [HttpGet,HttpPost]
+        [HttpGet, HttpPost]
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
         public async Task<IActionResult> PostCurrencyList()
         {
@@ -303,9 +293,9 @@ namespace OASystem.API.Controllers
                 }
 
 
-                if (dto.PortType == 1 || dto.PortType == 2 || dto.PortType == 3 )
+                if (dto.PortType == 1 || dto.PortType == 2 || dto.PortType == 3)
                 {
-                    var _vew = await GeneralMethod.PostGroupTeamRateByDiIdAndCTableId(dto.PortType,dto.DiId,dto.CTable);
+                    var _vew = await GeneralMethod.PostGroupTeamRateByDiIdAndCTableId(dto.PortType, dto.DiId, dto.CTable);
 
                     return Ok(JsonView(true, "操作成功!", _vew));
 
@@ -332,11 +322,11 @@ namespace OASystem.API.Controllers
         /// <returns></returns>
         [HttpGet, HttpPost]
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
-        public async Task<IActionResult> PostCurrencyByDiid(int DiId,int CId,int CurrencyId)
+        public async Task<IActionResult> PostCurrencyByDiid(int DiId, int CId, int CurrencyId)
         {
             try
             {
-                Result setData = await _setDataRep.PostCurrencyByDiid( DiId, CId, CurrencyId); //币种类型
+                Result setData = await _setDataRep.PostCurrencyByDiid(DiId, CId, CurrencyId); //币种类型
                 if (setData.Code == 0)
                 {
                     return Ok(JsonView(true, "查询成功", setData.Data));
@@ -380,7 +370,7 @@ namespace OASystem.API.Controllers
                     return Ok(JsonView(false, "页面Id不能为0!"));
                 }
 
-                List<CTableCorrelationPageDatas> data =  AppSettingsHelper.Get<CTableCorrelationPageDatas>("CTableCorrelationPageDatas");
+                List<CTableCorrelationPageDatas> data = AppSettingsHelper.Get<CTableCorrelationPageDatas>("CTableCorrelationPageDatas");
                 CTableCorrelationPageDatas correlationPageDatas = new CTableCorrelationPageDatas();
 
                 foreach (var item in data)
@@ -401,7 +391,7 @@ namespace OASystem.API.Controllers
                     return Ok(JsonView(false, "您查询的页面Id,未配置AppSettings,请前往配置!"));
                 }
 
-                return Ok(JsonView(true, "操作成功",new { CTable = correlationPageDatas.CTableId }));
+                return Ok(JsonView(true, "操作成功", new { CTable = correlationPageDatas.CTableId }));
             }
             catch (Exception ex)
             {
@@ -612,11 +602,11 @@ Where c.ConfListId = {0}", ConfId);
         /// <returns></returns>
         [HttpPost]
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
-        public async Task<IActionResult> PostTableOperationRecordAdd(TableOperationRecordAddDto _dto )
+        public async Task<IActionResult> PostTableOperationRecordAdd(TableOperationRecordAddDto _dto)
         {
             try
             {
-                Crm_TableOperationRecord _TableOperationRecord = new Crm_TableOperationRecord() 
+                Crm_TableOperationRecord _TableOperationRecord = new Crm_TableOperationRecord()
                 {
                     TableName = _dto.TableName,
                     PortType = _dto.PortType,
@@ -628,14 +618,14 @@ Where c.ConfListId = {0}", ConfId);
                     IsDel = 0
                 };
 
-                bool _view = await _TableOperationRecordRep._Add(_TableOperationRecord); 
+                bool _view = await _TableOperationRecordRep._Add(_TableOperationRecord);
                 if (_view)
                 {
-                    return Ok(JsonView(true,"操作成功!"));
+                    return Ok(JsonView(true, "操作成功!"));
                 }
                 else
                 {
-                    return Ok(JsonView(false,"操作失败!"));
+                    return Ok(JsonView(false, "操作失败!"));
                 }
             }
             catch (Exception)
@@ -681,7 +671,7 @@ Where c.ConfListId = {0}", ConfId);
                 return Ok(JsonView(false, "程序错误!Msg:" + ex.Message));
             }
         }
-       
+
 
         #endregion
 
@@ -708,7 +698,7 @@ Where c.ConfListId = {0}", ConfId);
                 {
                     val = val.Select(x => x.ToUpper()).ToList();
                 }
-                values.Add(val.Count > 0 ? val[0]: "暂无该拼音!");
+                values.Add(val.Count > 0 ? val[0] : "暂无该拼音!");
             }
 
             jw = JsonView(true, "转换成功!", values);
@@ -720,8 +710,8 @@ Where c.ConfListId = {0}", ConfId);
         [HttpGet]
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
         public IActionResult CodeTest()
-        { 
-            
+        {
+
             return Ok(JsonView(true, "测试成功!"));
         }
     }

+ 14 - 18
OASystem/OASystem.Api/Controllers/CRMController.cs

@@ -1,10 +1,6 @@
-using Microsoft.AspNetCore.Http;
-using Microsoft.AspNetCore.Mvc;
-
-using OASystem.Domain.Dtos.CRM;
+using OASystem.Domain.Dtos.CRM;
 using OASystem.Domain.Entities.Customer;
 using OASystem.Infrastructure.Repositories.CRM;
-using static OpenAI.GPT3.ObjectModels.SharedModels.IOpenAiModels;
 
 namespace OASystem.API.Controllers
 {
@@ -27,7 +23,7 @@ namespace OASystem.API.Controllers
         /// <param name="clientCompanyRepository"></param>
         /// <param name="clientRepository"></param>
         public CRMController(VisaDeleClientCompanyRepository clientCompanyRepository, VisaDeleClientRepository clientRepository,
-            CustomerCertRepository customerCertRep, CustomerFamilyRepository customerFamilyRep,CustomerSchoolRepository customerSchoolRep, CustomerCompanyRepository customerCompanyRep)
+            CustomerCertRepository customerCertRep, CustomerFamilyRepository customerFamilyRep, CustomerSchoolRepository customerSchoolRep, CustomerCompanyRepository customerCompanyRep)
         {
             this._clientCompanyRepository = clientCompanyRepository;
             this._clientRepository = clientRepository;
@@ -45,8 +41,8 @@ namespace OASystem.API.Controllers
         [HttpPost]
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
         public async Task<IActionResult> GetClientCompanyList(DtoBase dto)
-        { 
-            var clientCompanyData = await  _clientCompanyRepository.GetCrm_ClientCompanyList(dto);
+        {
+            var clientCompanyData = await _clientCompanyRepository.GetCrm_ClientCompanyList(dto);
 
             if (clientCompanyData.Code != 0)
             {
@@ -80,7 +76,7 @@ namespace OASystem.API.Controllers
                     return Ok(JsonView(false, "请检查客户单位邮编是否填写!"));
                 }
                 Result clientCompanyData = await _clientCompanyRepository.OperationClientCompany(dto);
-              
+
                 if (clientCompanyData.Code != 0)
                 {
                     return Ok(JsonView(false, clientCompanyData.Msg));
@@ -92,7 +88,7 @@ namespace OASystem.API.Controllers
                 return Ok(JsonView(false, "程序错误!"));
                 throw;
             }
-            
+
         }
         /// <summary>
         /// 签证客户公司列表操作(删除)
@@ -154,16 +150,16 @@ namespace OASystem.API.Controllers
                 List<Crm_VisaCustomerCompany> _VisaCustomerCompany = _clientRepository.Query<Crm_VisaCustomerCompany>(x => x.DcId == crm_Dele.Id && x.IsDel == 0).ToList();//客户工作经历表
                 List<Crm_VisaCustomerSchool> _VisaCustomerSchool = _clientRepository.Query<Crm_VisaCustomerSchool>(x => x.DcId == crm_Dele.Id && x.IsDel == 0).ToList();//客户学历表
                 List<Crm_VisaCustomerFamily> _VisaCustomerFamily = _clientRepository.Query<Crm_VisaCustomerFamily>(x => x.DcId == crm_Dele.Id && x.IsDel == 0).ToList();//客户学历表
-                List<Crm_CustomerCert> _CustomerCerts= _clientRepository.Query<Crm_CustomerCert>(x => x.DcId == crm_Dele.Id && x.IsDel == 0).ToList();//客户证件表
-                Crm_CustomerCompany _CustomerCompany =await _clientCompanyRepository.GetAsync<Crm_CustomerCompany>(x => x.Id == crm_Dele.CrmCompanyId);//客户公司信息
+                List<Crm_CustomerCert> _CustomerCerts = _clientRepository.Query<Crm_CustomerCert>(x => x.DcId == crm_Dele.Id && x.IsDel == 0).ToList();//客户证件表
+                Crm_CustomerCompany _CustomerCompany = await _clientCompanyRepository.GetAsync<Crm_CustomerCompany>(x => x.Id == crm_Dele.CrmCompanyId);//客户公司信息
                 var data = new
                 {
                     DeleClient = crm_Dele,
                     WorkExperience = _VisaCustomerCompany,
                     CustomerSchool = _VisaCustomerSchool,
                     CustomerFamily = _VisaCustomerFamily,
-                    CustomerCompany= _CustomerCompany,
-                    CustomerCerts= _CustomerCerts
+                    CustomerCompany = _CustomerCompany,
+                    CustomerCerts = _CustomerCerts
                 };
                 return Ok(JsonView(true, "查询成功!", data));
             }
@@ -185,7 +181,7 @@ namespace OASystem.API.Controllers
         {
             try
             {
-                Domain.Result result =await _clientRepository.OpCustomer(dto);
+                Domain.Result result = await _clientRepository.OpCustomer(dto);
                 if (result.Code != 0)
                 {
                     return Ok(JsonView(false, result.Msg));
@@ -206,7 +202,7 @@ namespace OASystem.API.Controllers
         /// <returns></returns>
         [HttpPost]
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
-        public async Task<IActionResult>DelCustomer(DeleClientDelDto dto)
+        public async Task<IActionResult> DelCustomer(DeleClientDelDto dto)
         {
             Result result = await _clientRepository.DelCustomer(dto);
             if (result.Code != 0)
@@ -262,14 +258,14 @@ namespace OASystem.API.Controllers
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
         public async Task<IActionResult> DelCustomerSchool(DelBaseDto dto)
         {
-            
+
             var result = await _customerSchoolRep.SoftDeleteByIdAsync<Crm_VisaCustomerSchool>(dto.Id.ToString(), dto.DeleteUserId);
             if (!result)
             {
                 return Ok(JsonView(false, "删除失败"));
             }
             return Ok(JsonView(true, "删除成功!"));
-            
+
         }
         /// <summary>
         /// 客户工作经历表数据删除

+ 2 - 6
OASystem/OASystem.Api/Controllers/CallbackController.cs

@@ -1,8 +1,4 @@
-using Microsoft.AspNetCore.Mvc;
-using OASystem.Domain.Dtos.CallBack.QiYeWeChat;
-using OASystem.Domain.Dtos.SmallFun;
-using OASystem.Infrastructure.Repositories.Business;
-using ILogger = Microsoft.Extensions.Logging.ILogger;
+using OASystem.Domain.Dtos.CallBack.QiYeWeChat;
 
 namespace OASystem.API.Controllers
 {
@@ -43,7 +39,7 @@ namespace OASystem.API.Controllers
             input.timestamp = timestamp;
             input.nonce = nonce;
             input.echostr = echostr;
-            _logger.LogInformation("【企业微信】【通讯录助手】【回调】【参数】"+ input.ToJson());
+            _logger.LogInformation("【企业微信】【通讯录助手】【回调】【参数】" + input.ToJson());
             if (HttpContext.Request.Method == System.Net.Http.HttpMethod.Get.Method)
             {
                 var model = await VerifyURLCallBack(input);

+ 7 - 9
OASystem/OASystem.Api/Controllers/ClientHubController.cs

@@ -1,6 +1,4 @@
-using Microsoft.AspNetCore.Http;
-using Microsoft.AspNetCore.Mvc;
-using Microsoft.AspNetCore.SignalR;
+using Microsoft.AspNetCore.SignalR;
 using OASystem.API.OAMethodLib;
 using OASystem.API.OAMethodLib.Hub.HubClients;
 using OASystem.API.OAMethodLib.Hub.Hubs;
@@ -17,7 +15,7 @@ namespace OASystem.API.Controllers
         private readonly ILogger<ClientHubController> _logger;
         private readonly IHubContext<ChatHub, IChatClient> _hubContext;
 
-        public ClientHubController(ILogger<ClientHubController> logger, IHubContext<ChatHub, IChatClient> hubContext )
+        public ClientHubController(ILogger<ClientHubController> logger, IHubContext<ChatHub, IChatClient> hubContext)
         {
             _logger = logger;
             _hubContext = hubContext;
@@ -42,7 +40,7 @@ namespace OASystem.API.Controllers
         /// <param name="hubContext"></param>
         /// <returns></returns>
         [HttpPost("SendAllUserMessage", Name = "SendAllUserMessage")]
-        public async Task<IActionResult> SendAllUserMessage( string msg)
+        public async Task<IActionResult> SendAllUserMessage(string msg)
         {
             await _hubContext.Clients.All.ReceiveMessage(msg);
             return Ok("Send Successful!");
@@ -56,7 +54,7 @@ namespace OASystem.API.Controllers
         /// <param name="hubContext"></param>
         /// <returns></returns>
         [HttpPost("SendCustomUserMessage", Name = "SendCustomUserMessage")]
-        public async Task<IActionResult> SendCustomUserMessage(List<int> userIds,string title,string content )
+        public async Task<IActionResult> SendCustomUserMessage(List<int> userIds, string title, string content)
         {
             string connId = string.Empty;
 
@@ -72,7 +70,7 @@ namespace OASystem.API.Controllers
 
             //await _hubContext.Clients.Client(connId).ReceiveMessage(date);
 
-            GeneralMethod.MessageIssueAndNotification(MessageTypeEnum.Announcement,title, content, userIds);
+            GeneralMethod.MessageIssueAndNotification(MessageTypeEnum.Announcement, title, content, userIds);
 
             return Ok("Send Successful!");
         }
@@ -88,7 +86,7 @@ namespace OASystem.API.Controllers
         [HttpPost("MessageIssuserAndNotification", Name = "MessageIssuserAndNotification")]
         public async Task<IActionResult> MessageIssuserAndNotification(MessageTypeEnum msgTypeEnum, string title, string content, List<int> userIds)
         {
-            var status = await GeneralMethod.MessageIssueAndNotification(msgTypeEnum,title, content, userIds);
+            var status = await GeneralMethod.MessageIssueAndNotification(msgTypeEnum, title, content, userIds);
             if (status)
             {
                 return Ok("Operation Successful!");
@@ -97,7 +95,7 @@ namespace OASystem.API.Controllers
             {
                 return Ok("Operation Fail!");
             }
-            
+
         }
 
     }

+ 130 - 138
OASystem/OASystem.Api/Controllers/FinancialController.cs

@@ -1,19 +1,9 @@
 using Aspose.Cells;
 using Aspose.Words;
-using Aspose.Words.Drawing;
 using EyeSoft.Extensions;
 using EyeSoft.IO;
-using EyeSoft.Runtime.InteropServices;
 using FluentValidation;
-using MathNet.Numerics.Distributions;
-using Microsoft.EntityFrameworkCore.Query.Internal;
-using Microsoft.OpenApi.Expressions;
-using NPOI.HPSF;
-using NPOI.HSSF.UserModel;
-using NPOI.SS.Formula.Functions;
-using NPOI.SS.Formula.PTG;
 using NPOI.SS.UserModel;
-using NPOI.Util;
 using NPOI.XSSF.UserModel;
 using OASystem.API.OAMethodLib;
 using OASystem.API.OAMethodLib.File;
@@ -28,17 +18,13 @@ using OASystem.Domain.ViewModels.Groups;
 using OASystem.Infrastructure.Repositories.Financial;
 using OASystem.Infrastructure.Repositories.Groups;
 using OfficeOpenXml;
-using Org.BouncyCastle.Math;
 using SqlSugar.Extensions;
 using System.Collections;
-using System.ComponentModel.Design;
 using System.Data;
 using System.Data.OleDb;
 using System.Diagnostics;
 using System.Globalization;
 using System.IO.Compression;
-using System.IO.Pipelines;
-using System.Linq.Expressions;
 
 namespace OASystem.API.Controllers
 {
@@ -244,7 +230,7 @@ namespace OASystem.API.Controllers
         public async Task<IActionResult> PostDelDailyPayment(DelDailyFeePaymentDto dto)
         {
             _sqlSugar.BeginTran();
-            
+
             var result = await _daiRep.Del(dto);
 
             //删除日付关联表
@@ -382,7 +368,7 @@ namespace OASystem.API.Controllers
                                                  id = dfp.Id,
                                                  amountName = dfp.Instructions,
                                                  amount = dfp.SumPrice,
-                                                 fAuditStatus = dfp.FAudit == 1 ? "审核通过" : 
+                                                 fAuditStatus = dfp.FAudit == 1 ? "审核通过" :
                                                                 dfp.FAudit == 2 ? "审核未通过" : "未审核",
                                                  fAuditDate = dfp.FAuditDate,
                                                  applicant = u.CnName,
@@ -391,7 +377,7 @@ namespace OASystem.API.Controllers
                                              //.ToListAsync();
                                              .CountAsync();
             //int count = dailyInfos.Count;
-            return Ok(JsonView(true,"查询成功", dailyInfos));
+            return Ok(JsonView(true, "查询成功", dailyInfos));
         }
 
         #endregion
@@ -793,9 +779,9 @@ namespace OASystem.API.Controllers
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
         public async Task<IActionResult> PostReceivablesSave(ForeignReceivablesSaveDto dto)
         {
-           
+
             return Ok(await _ForForeignReceivablesRep.PostReceivablesSave(dto));
-           
+
         }
 
         /// <summary>
@@ -1018,7 +1004,7 @@ namespace OASystem.API.Controllers
                                                       Name = dc.LastName + dc.FirstName,
                                                       Sex = dc.Sex,
                                                       Birthday = dc.BirthDay,
-                                                      Company = cc.CompanyFullName.Replace("\n",""),
+                                                      Company = cc.CompanyFullName.Replace("\n", ""),
                                                       Job = dc.Job,
                                                       AirType = tcl.ShippingSpaceTypeId
                                                   })
@@ -1081,11 +1067,13 @@ namespace OASystem.API.Controllers
                             {
                                 airName = $"头等舱";
                                 airPrice = _EnterExitCosts.AirTD;
-                            }else if (client.AirType == 458)
+                            }
+                            else if (client.AirType == 458)
                             {
                                 airName = $"公务舱";
                                 airPrice = _EnterExitCosts.AirGW;
-                            }else if (client.AirType == 460)
+                            }
+                            else if (client.AirType == 460)
                             {
                                 airName = $"经济舱";
                                 airPrice = _EnterExitCosts.AirJJ;
@@ -1381,10 +1369,10 @@ namespace OASystem.API.Controllers
         {
             if (groupId < 1) return Ok(JsonView(false, "请传入有效的GroupId参数!"));
 
-            var _EnterExitCosts =await _sqlSugar.Queryable<Grp_EnterExitCost>()
+            var _EnterExitCosts = await _sqlSugar.Queryable<Grp_EnterExitCost>()
                                                 .Where(it => it.IsDel == 0 && it.DiId == groupId)
                                                 .FirstAsync();
-            var _DayAndCosts =await _sqlSugar.Queryable<Grp_DayAndCost>()
+            var _DayAndCosts = await _sqlSugar.Queryable<Grp_DayAndCost>()
                                              .Where(it => it.IsDel == 0 && it.DiId == groupId)
                                              .ToListAsync();
             if (_EnterExitCosts == null) return Ok(JsonView(false, "该团组未填写出入境费用;"));
@@ -1417,7 +1405,7 @@ namespace OASystem.API.Controllers
                                                  .ToListAsync();
             if (groupClientList.Count < 1) return Ok(JsonView(false, "该团组未填写接团客户名单;"));
 
-            decimal domesticFeeTotal =0.00M,        //境内费用
+            decimal domesticFeeTotal = 0.00M,        //境内费用
                     economyClassFeeTotal = 0.00M,   //经济舱费用
                     businessClassFeeTotal = 0.00M,  //公务舱费用
                     firstClassFeeTotal = 0.00M,     //头等舱费用
@@ -1878,7 +1866,7 @@ namespace OASystem.API.Controllers
                                            .Where((u, d) => u.IsDel == 0 && d.DepName.Contains("市场部") && u.Id == dto.CurrUserId)
                                            .ToListAsync();
 
-           
+
             if (userInfos.Count > 0) userSqlWhere = string.Format(@$" And JietuanOperator={dto.CurrUserId} ");
 
 
@@ -2237,7 +2225,7 @@ namespace OASystem.API.Controllers
         /// <param name="beginDt"></param>
         /// <param name="endDt"></param>
         /// <returns></returns>
-        private tree_Group_DailyFeePaymentResult PayRequest_GroupPaymentByDateRange(int status, List<int> _groupIds,List<int> _hotelSubIds, string beginDt, string endDt)
+        private tree_Group_DailyFeePaymentResult PayRequest_GroupPaymentByDateRange(int status, List<int> _groupIds, List<int> _hotelSubIds, string beginDt, string endDt)
         {
             tree_Group_DailyFeePaymentResult _DailyFeePaymentResult = new tree_Group_DailyFeePaymentResult();
             List<tree_Group_DailyFeePaymentPageListView> dataList = new List<tree_Group_DailyFeePaymentPageListView>();
@@ -2461,7 +2449,7 @@ namespace OASystem.API.Controllers
                             else if (hotelContent.PriceType == 4) subPriceName = "城市税";
 
                             if (string.IsNullOrEmpty(subPriceName)) subPriceName = priName;
-                            else subPriceName = $"{priName.Replace("]","")}-{subPriceName}]";
+                            else subPriceName = $"{priName.Replace("]", "")}-{subPriceName}]";
 
                             string payeeStr1 = string.Format(@" {0},开户行:{1},银行卡号:{2} ",
                             string.IsNullOrEmpty(hotelContent.Payee) ? "-" : hotelContent.Payee,
@@ -2500,8 +2488,8 @@ namespace OASystem.API.Controllers
                             childInfo1.RemaksDescription = remaksDescription1;
 
                             if (status == 2)
-                            { 
-                                if (status1) 
+                            {
+                                if (status1)
                                 {
                                     childInfos.Add(childInfo1);
                                 }
@@ -2550,7 +2538,7 @@ namespace OASystem.API.Controllers
                         childList.Add(childInfo);
                         rouNumber++;
                     }
-                    
+
                 }
 
                 CompanyInfo companyInfo = new CompanyInfo();
@@ -2790,7 +2778,7 @@ namespace OASystem.API.Controllers
             if (dto.Rate <= 0) return Ok(JsonView(false, "请传入有效的Rate参数!"));
             #endregion
 
-            int hotelSubStatus = 0,status = 0;
+            int hotelSubStatus = 0, status = 0;
             int diid = 0, cTable = 0, currId = 0;
 
             if (dto.HotelSubId > 0)
@@ -2820,10 +2808,11 @@ namespace OASystem.API.Controllers
             {
                 var ccpInfo = _sqlSugar.Queryable<Grp_CreditCardPayment>().Where(it => it.Id == dto.Id).First();
                 decimal cnyMoney = 0.00M;
-                if (ccpInfo != null) {
+                if (ccpInfo != null)
+                {
                     cnyMoney = ccpInfo.PayMoney * dto.Rate;
                     diid = ccpInfo.DIId;
-                    cTable = ccpInfo.CTable; 
+                    cTable = ccpInfo.CTable;
                     currId = ccpInfo.PaymentCurrency;
                 }
 
@@ -2952,7 +2941,7 @@ namespace OASystem.API.Controllers
                         changeStatus = true;
                         //酒店子项是否全部付完款
                         List<int> hrIds = _sqlSugar.Queryable<Grp_HotelReservationsContent>().Where(it => it.IsDel == 0 && hotelSubIds.Contains(it.Id)).Select(it => it.HrId).Distinct().ToList();
-                        if (hrIds.Count > 0 )
+                        if (hrIds.Count > 0)
                         {
                             var hotelSubFeeData = _sqlSugar.Queryable<Grp_HotelReservationsContent>().Where(it => it.IsDel == 0 && hrIds.Contains(it.HrId)).ToList();
                             var hotelSubFeeGroupData = hotelSubFeeData.GroupBy(it => it.HrId).ToList();
@@ -3001,7 +2990,7 @@ namespace OASystem.API.Controllers
                 //修改提成关联表
                 var ids = _sqlSugar.Queryable<Fin_DailyFeePayment>()
                     .LeftJoin<Fin_RoyaltyForm>((dfp, rf) => dfp.Id == rf.DayOverhead && rf.IsDel == 0)
-                    .Where(dfp => dailyPaymentIds.Contains(dfp.Id) && dfp.IsDel == 0 )
+                    .Where(dfp => dailyPaymentIds.Contains(dfp.Id) && dfp.IsDel == 0)
                     .Select((dfp, rf) => rf.ConfirmIdArr).ToList();
                 var idsList = string.Join(',', ids).Split(',')
                             .Select(x =>
@@ -4022,9 +4011,9 @@ Group by PriceType ", dto.diId);
             var checkBoxDataArr = _sqlSugar.Queryable<Sys_SetData>().Where(x => x.IsDel == 0 && x.STid == 17).ToList();
             var CurrDataArr = _sqlSugar.Queryable<Sys_SetData>().Where(x => x.IsDel == 0 && x.STid == 66).ToList();
 
-            var joinTable =  _sqlSugar.Queryable<Fin_GroupExtraCost, Grp_CreditCardPayment, Sys_SetData, Grp_NationalTravelFee ,
-                Fin_LocalGuideRelevancyOverspend , Grp_CarTouristGuideGroundReservations, Sys_SetData,Grp_DelegationInfo>(
-                (f, c, s, g, r ,l, s1,i) => new JoinQueryInfos(
+            var joinTable = _sqlSugar.Queryable<Fin_GroupExtraCost, Grp_CreditCardPayment, Sys_SetData, Grp_NationalTravelFee,
+                Fin_LocalGuideRelevancyOverspend, Grp_CarTouristGuideGroundReservations, Sys_SetData, Grp_DelegationInfo>(
+                (f, c, s, g, r, l, s1, i) => new JoinQueryInfos(
                     JoinType.Left, f.Id == c.CId && c.CTable == 1015 && c.IsDel == 0,
                     JoinType.Left, c.PaymentCurrency == s.Id && s.IsDel == 0,
                     JoinType.Left, g.IsDel == 0 && g.Id == f.Area,
@@ -4034,7 +4023,7 @@ Group by PriceType ", dto.diId);
                     JoinType.Left, i.Id == l.DiId && i.IsDel == 0
                 ))
                 .Where((f, c, s, g) => f.IsDel == 0 && f.DiId == dto.diId)
-                .Select((f, c, s, g, r, l,s1,i) => new
+                .Select((f, c, s, g, r, l, s1, i) => new
                 {
                     c.PaymentCurrency,
                     c.DayRate,
@@ -4062,7 +4051,7 @@ Group by PriceType ", dto.diId);
                 .ToList()
                 .Select(x =>
                 {
-                    var costPirce = x.Price; 
+                    var costPirce = x.Price;
                     decimal costRMBPrice = x.RMBPrice;
                     decimal costDayRate = x.DayRate;
                     string remake = x.Remark;
@@ -4091,7 +4080,7 @@ Group by PriceType ", dto.diId);
                         if (dicSoure.Keys.Contains(x.PriceDetailType))
                         {
                             var CarCenter = _sqlSugar.Queryable<Grp_CarTouristGuideGroundReservationsContent>().Where(x1 => x1.CTGGRId == x.CarParentId && x1.IsDel == 0
-                            && x1.SId == mealsDic.First(x2 => x2.Value == dicSoure[x.PriceDetailType]).Key ).ToList().First(x1=> (DateTime.Compare(x1.DatePrice.ObjToDate(), x.PriceDt) == 0));
+                            && x1.SId == mealsDic.First(x2 => x2.Value == dicSoure[x.PriceDetailType]).Key).ToList().First(x1 => (DateTime.Compare(x1.DatePrice.ObjToDate(), x.PriceDt) == 0));
                             costPirce += (CarCenter.Price * CarCenter.Count * x.Rate);
                             oldPrice += (CarCenter.Price * CarCenter.Count);
 
@@ -4115,7 +4104,7 @@ Group by PriceType ", dto.diId);
                         {
                             costPirce = Convert.ToInt32(Math.Round(costPirce));
                         }
-                        
+
                         costRMBPrice = Convert.ToInt32(Math.Round(costPirce * costDayRate));
                     }
 
@@ -4141,9 +4130,9 @@ Group by PriceType ", dto.diId);
                 })
                 .ToList();
 
-            var PriceDetailTypeArr = new int[] { 1088 , 1074, 1075, 1076 };
+            var PriceDetailTypeArr = new int[] { 1088, 1074, 1075, 1076 };
             var whereArr = joinTable.Where(x => PriceDetailTypeArr.Contains(x.PriceDetailType)).ToList();
-            _ =  joinTable.RemoveAll(x => PriceDetailTypeArr.Contains(x.PriceDetailType));
+            _ = joinTable.RemoveAll(x => PriceDetailTypeArr.Contains(x.PriceDetailType));
             foreach (var item in whereArr)
             {
                 joinTable.Insert(0, item);
@@ -4195,7 +4184,7 @@ Group by PriceType ", dto.diId);
                 for (int i = 0; i < clounmCount; i++)
                 {
                     string property = dicClounm[i];
-                    string value =  item.GetType()!.GetProperty(property)!.GetValue(item)?.ToString() ?? "";
+                    string value = item.GetType()!.GetProperty(property)!.GetValue(item)?.ToString() ?? "";
                     sheet.GetRow(rowStartIndex).GetCell(i).SetCellValue(value);
                 }
 
@@ -4203,7 +4192,7 @@ Group by PriceType ", dto.diId);
             }
 
             sheet.GetRow(rowStartIndex).GetCell(2).SetCellValue($"小计:");
-            sheet.GetRow(rowStartIndex).GetCell(3).SetCellValue($"{joinTable.Sum(x=>x.RMBPrice)}元");
+            sheet.GetRow(rowStartIndex).GetCell(3).SetCellValue($"{joinTable.Sum(x => x.RMBPrice)}元");
             var path = $"GroupExtraCost/{grp_DelegationInfo.TeamName}_超支费用.xlsx";
             using (var stream = new MemoryStream())
             {
@@ -4230,7 +4219,7 @@ Group by PriceType ", dto.diId);
         [HttpPost]
         public IActionResult QueryCoefficientConfig()
         {
-            var arr =  _sqlSugar.Queryable<Sys_SetData>().Where(x => x.STid == 80 && x.IsDel == 0).ToList();
+            var arr = _sqlSugar.Queryable<Sys_SetData>().Where(x => x.STid == 80 && x.IsDel == 0).ToList();
 
             var carCoefficient = new int[] { 1050 }; //2.4
 
@@ -4464,7 +4453,7 @@ Group by PriceType ", dto.diId);
                  * 
                  */
 
-                            var ids = new List<int>();
+                var ids = new List<int>();
                 if (cardType == 74) //美元卡
                 {
                     var AirGroupReuslt = List_ccp.Where(x => x.CTable == 85).GroupBy(x => x.DIId).ToList();
@@ -5072,7 +5061,7 @@ Group by PriceType ", dto.diId);
         {
             var jw = JsonView(false);
             var userId = dto.UserId;
-            var user =  _sqlSugar.Queryable<Sys_Users>().First(x=>x.Id == userId);
+            var user = _sqlSugar.Queryable<Sys_Users>().First(x => x.Id == userId);
             //jw.Data = System.Array.Empty<string>();
 
             if (user == null)
@@ -5080,7 +5069,7 @@ Group by PriceType ", dto.diId);
                 jw.Msg = "暂无该用户!";
                 return Ok(jw);
             }
-            if (!DateTime.TryParse(dto.StartDate,out DateTime StartDateTime))
+            if (!DateTime.TryParse(dto.StartDate, out DateTime StartDateTime))
             {
                 jw.Msg = "开始时间格式有误!";
                 return Ok(jw);
@@ -5090,7 +5079,7 @@ Group by PriceType ", dto.diId);
                 jw.Msg = "结束时间格式有误!";
                 return Ok(jw);
             }
-            if (DateTime.Compare(StartDateTime,EndDateTime) > 0)
+            if (DateTime.Compare(StartDateTime, EndDateTime) > 0)
             {
                 jw.Msg = "开始时间大于结束时间!";
                 return Ok(jw);
@@ -5103,13 +5092,13 @@ Group by PriceType ", dto.diId);
             int[] Hotel = _sqlSugar.Queryable<Sys_Users>().Where(x => x.IsDel == 0 && x.JobPostId == 25).Select(x => x.Id).ToArray();
 
             //OP 职位表id 28 
-            int [] OP = _sqlSugar.Queryable<Sys_Users>().Where(x=>x.IsDel == 0 && x.JobPostId == 28).Select(x=>x.Id).ToArray();
+            int[] OP = _sqlSugar.Queryable<Sys_Users>().Where(x => x.IsDel == 0 && x.JobPostId == 28).Select(x => x.Id).ToArray();
 
             //商邀 职位表id 27
-            int [] Invitation = _sqlSugar.Queryable<Sys_Users>().Where(x => x.IsDel == 0 && x.JobPostId == 27).Select(x => x.Id).ToArray();
+            int[] Invitation = _sqlSugar.Queryable<Sys_Users>().Where(x => x.IsDel == 0 && x.JobPostId == 27).Select(x => x.Id).ToArray();
 
             //签证 职位表id 26
-            int[] Visa = _sqlSugar.Queryable<Sys_Users>().Where(x => x.IsDel == 0 && x.JobPostId == 26 ).Select(x => x.Id).ToArray();
+            int[] Visa = _sqlSugar.Queryable<Sys_Users>().Where(x => x.IsDel == 0 && x.JobPostId == 26).Select(x => x.Id).ToArray();
 
             //主管职位
             //string[] Manager = { "149", "283" };
@@ -5118,17 +5107,17 @@ Group by PriceType ", dto.diId);
 
             var teamLv = _sqlSugar.Queryable<Sys_SetData>().Where(x => x.STid == 56 && x.IsDel == 0).ToList();
 
-            var auditState = new int[] { 1 , 3 };
+            var auditState = new int[] { 1, 3 };
 
             if (AirTicket.Contains(userId))
             {
                 //提成方式:¥10/人×人数×段数(每个组团涉及的换机次数)
                 var listAir = _sqlSugar.Queryable<Grp_AirTicketReservations, Grp_DelegationInfo, Grp_CreditCardPayment>((x, a, b) => new
                 JoinQueryInfos(
-                    JoinType.Left, a.Id == x.DIId ,
-                    JoinType.Left, b.CTable == 85 && b.CId == x.Id )
-                ).Where((x, a, b) => x.IsDel == 0 && x.CreateUserId == userId  && (b.IsAuditGM == 1 || b.IsAuditGM == 3)
-                    && a.IsDel == 0 && a.VisitDate >= StartDateTime && a.VisitDate <= EndDateTime && b.IsDel == 0 && a.IsSure == 1 && auditState.Contains(b.IsAuditGM) )
+                    JoinType.Left, a.Id == x.DIId,
+                    JoinType.Left, b.CTable == 85 && b.CId == x.Id)
+                ).Where((x, a, b) => x.IsDel == 0 && x.CreateUserId == userId && (b.IsAuditGM == 1 || b.IsAuditGM == 3)
+                    && a.IsDel == 0 && a.VisitDate >= StartDateTime && a.VisitDate <= EndDateTime && b.IsDel == 0 && a.IsSure == 1 && auditState.Contains(b.IsAuditGM))
                     .Select((x, a, b) => new
                     {
                         x.FlightsDescription,
@@ -5166,7 +5155,7 @@ Group by PriceType ", dto.diId);
 
                         if (air.FlightsDescription.Contains("\r\n"))
                         {
-                            var rowCode = Regex.Split(air.FlightsDescription, "\\d+\\.", RegexOptions.IgnoreCase).Where(x=>!string.IsNullOrWhiteSpace(x)).ToArray();
+                            var rowCode = Regex.Split(air.FlightsDescription, "\\d+\\.", RegexOptions.IgnoreCase).Where(x => !string.IsNullOrWhiteSpace(x)).ToArray();
                             for (int i = 0; i < rowCode.Length; i++)
                             {
                                 if (i != 0)
@@ -5204,7 +5193,7 @@ Group by PriceType ", dto.diId);
                                     }
                                     catch (Exception ex)
                                     {
-                                        errMsg  = "机票行程代码格式有误!解析失败!" + $"({ex.Message})";
+                                        errMsg = "机票行程代码格式有误!解析失败!" + $"({ex.Message})";
                                         break;
                                     }
                                 }
@@ -5236,9 +5225,9 @@ Group by PriceType ", dto.diId);
                         string info = $"航班{air.FlightsCode} {(air.Price > 0 ? "" : "此笔为退费!")} 人数为{air.ClientNum} 有效段数为{airCount} 总段数为{airCount * air.ClientNum}";
                         if (!string.IsNullOrWhiteSpace(errMsg))
                         {
-                            info = $"航班{air.FlightsCode} " + errMsg ;
+                            info = $"航班{air.FlightsCode} " + errMsg;
                         }
-                        infos.Add(info); 
+                        infos.Add(info);
                         groupAirCount += airCount * air.ClientNum;
                     }
                     var groupinfo = listAir.First(x => x.Id == airArr.Key);
@@ -5248,21 +5237,21 @@ Group by PriceType ", dto.diId);
                         TeamName = groupinfo.TeamName,
                         TeamId = groupinfo.Id,
                         ChiArr = infos,
-                        TeamLvStr = teamLv.Find(x=>x.Id == groupinfo.TeamLevSId)?.Name,
+                        TeamLvStr = teamLv.Find(x => x.Id == groupinfo.TeamLevSId)?.Name,
                         VisitDate = groupinfo.VisitDate,
                         Temp = temp,
                         Price = (groupAirCount * 10),
-                    }) ;
+                    });
                 }
             }
             else if (Hotel.Contains(userId))
             {
                 //标准团组:¥10/间/晚 * 实际订房间数 * 实际订房晚数; setdata id 1001 客人房
                 var listHotel = _sqlSugar.Queryable<Grp_HotelReservations, Grp_DelegationInfo, Grp_CreditCardPayment>((x, a, b) => new JoinQueryInfos(
-                     JoinType.Left,x.DiId == a.Id,
-                     JoinType.Left,b.CTable == 76 && b.CId == x.Id  ))
-                    .Where((x, a, b) => x.IsDel == 0 && x.CreateUserId == userId && a.VisitDate >= StartDateTime 
-                    && a.VisitDate <= EndDateTime && a.IsDel == 0 && b.IsDel == 0 && x.CardPrice > 0 && a.IsSure == 1 && auditState.Contains(b.IsAuditGM) && x.CheckType == 1001).Select((x,a,b)=> new
+                     JoinType.Left, x.DiId == a.Id,
+                     JoinType.Left, b.CTable == 76 && b.CId == x.Id))
+                    .Where((x, a, b) => x.IsDel == 0 && x.CreateUserId == userId && a.VisitDate >= StartDateTime
+                    && a.VisitDate <= EndDateTime && a.IsDel == 0 && b.IsDel == 0 && x.CardPrice > 0 && a.IsSure == 1 && auditState.Contains(b.IsAuditGM) && x.CheckType == 1001).Select((x, a, b) => new
                     {
                         a.Id,
                         a.TeamName,
@@ -5272,7 +5261,7 @@ Group by PriceType ", dto.diId);
                         x.SingleRoomCount,
                         x.SuiteRoomCount,
                         x.DoubleRoomCount,
-                        x.OtherRoomCount, 
+                        x.OtherRoomCount,
                         x.CheckInDate,
                         x.CheckOutDate,
                         x.HotelName
@@ -5291,7 +5280,7 @@ Group by PriceType ", dto.diId);
                         var hotelCount = 0;
                         foreach (var property in propertys)
                         {
-                            var value =  item.GetType().GetProperty(property).GetValue(item).ObjToInt();
+                            var value = item.GetType().GetProperty(property).GetValue(item).ObjToInt();
                             if (value > 0)
                             {
                                 hotelCount += value;
@@ -5303,7 +5292,7 @@ Group by PriceType ", dto.diId);
                             if (DateTime.TryParse(item.CheckInDate, out DateTime checkin) && DateTime.TryParse(item.CheckOutDate, out DateTime checkout))
                             {
                                 var day = checkout - checkin;
-                                infos.Add($"{item.HotelName} 共有 {hotelCount} 间房 , 入住时间{item.CheckInDate} - {item.CheckOutDate} 共 { day.TotalDays }晚 提成数量:{hotelCount * day.TotalDays}  提成金额:{hotelCount * day.TotalDays * 10}");
+                                infos.Add($"{item.HotelName} 共有 {hotelCount} 间房 , 入住时间{item.CheckInDate} - {item.CheckOutDate} 共 {day.TotalDays}晚 提成数量:{hotelCount * day.TotalDays}  提成金额:{hotelCount * day.TotalDays * 10}");
                                 totalPrice += (decimal)(hotelCount * day.TotalDays * 10);
                             }
                             else
@@ -5318,10 +5307,10 @@ Group by PriceType ", dto.diId);
                     resultArr.Add(new ComputeRoyaltiesView
                     {
                         TeamName = groupinfo.TeamName,
-                        TeamId =  groupinfo.Id,
+                        TeamId = groupinfo.Id,
                         ChiArr = infos,
                         TeamLvStr = teamLv.Find(x => x.Id == groupinfo.TeamLevSId)?.Name,
-                        VisitDate =  groupinfo.VisitDate,
+                        VisitDate = groupinfo.VisitDate,
                         Temp = temp,
                         Price = totalPrice,
                     });
@@ -5339,10 +5328,10 @@ Group by PriceType ", dto.diId);
                 foreach (var groupinfo in OPList)
                 {
                     var price = LvArr.Find(x => x.Id == groupinfo.OpRoyaltyLv)?.Name.ObjToInt() ?? 0;
-                    string temp = $"本团等级为{teamLv.Find(x => x.Id == groupinfo.TeamLevSId)?.Name} 提成金额为{price} {(string.IsNullOrWhiteSpace(groupinfo.OpRoyaltyRemark) ? "" : "提成说明:" + groupinfo.OpRoyaltyRemark )}";
+                    string temp = $"本团等级为{teamLv.Find(x => x.Id == groupinfo.TeamLevSId)?.Name} 提成金额为{price} {(string.IsNullOrWhiteSpace(groupinfo.OpRoyaltyRemark) ? "" : "提成说明:" + groupinfo.OpRoyaltyRemark)}";
                     if (price == 0)
                     {
-                        temp = $"本团等级为{teamLv.Find(x => x.Id == groupinfo.TeamLevSId)?.Name} op提成选项未选择!" ;
+                        temp = $"本团等级为{teamLv.Find(x => x.Id == groupinfo.TeamLevSId)?.Name} op提成选项未选择!";
                     }
                     resultArr.Add(new ComputeRoyaltiesView
                     {
@@ -5363,9 +5352,9 @@ Group by PriceType ", dto.diId);
                 //4)不付费公务活动部分(自己联络)额外奖励:¥200 / 团(若公务活动方与邀请方为同一机构,奖励金额为¥100 / 团);
                 //5)只发邀请的团组不付费邀请额外奖励:¥100 / 团;
                 //邀请方已授权我司签发的邀请仍按照:¥100 / 团,无额外奖励。 
-                var officialList = _sqlSugar.Queryable<Res_OfficialActivities, Grp_DelegationInfo>((x,a)=> 
-                    new JoinQueryInfos(JoinType.Left,a.Id == x.DiId)
-                ).Where((x,a) => x.IsSubmitApproval == 0 && x.IsDel == 0 && a.IsDel == 0
+                var officialList = _sqlSugar.Queryable<Res_OfficialActivities, Grp_DelegationInfo>((x, a) =>
+                    new JoinQueryInfos(JoinType.Left, a.Id == x.DiId)
+                ).Where((x, a) => x.IsSubmitApproval == 0 && x.IsDel == 0 && a.IsDel == 0
                     && a.VisitDate >= StartDateTime && a.VisitDate <= EndDateTime && a.IsSure == 1
                 )
                 .Select((x, a) => new
@@ -5443,11 +5432,11 @@ Group by PriceType ", dto.diId);
                     resultArr.Add(new ComputeRoyaltiesView
                     {
                         TeamName = groupinfo.TeamName,
-                        TeamId =  groupinfo.Id,
+                        TeamId = groupinfo.Id,
                         ChiArr = infos,
                         TeamLvStr = teamLv.Find(x => x.Id == groupinfo.TeamLevSId)?.Name,
                         VisitDate = groupinfo.VisitDate,
-                        Temp =  temp,
+                        Temp = temp,
                         Price = money,
                     });
                 }
@@ -5471,17 +5460,17 @@ Group by PriceType ", dto.diId);
                     )
                 .Where(whereExpression.ToExpression())
                 .Select((x, a, b) => new
-                    {
-                        a.Id,
-                        a.TeamName,
-                        a.VisitDate,
-                        a.TeamLevSId,
-                        a.VisitPNumber,
-                        a.VisitCountry,
-                        x.VisaDescription,
-                        x.VisaFreeNumber,
-                        x.VisaNumber,
-                        x.VisaPrice
+                {
+                    a.Id,
+                    a.TeamName,
+                    a.VisitDate,
+                    a.TeamLevSId,
+                    a.VisitPNumber,
+                    a.VisitCountry,
+                    x.VisaDescription,
+                    x.VisaFreeNumber,
+                    x.VisaNumber,
+                    x.VisaPrice
                 })
                 .ToList();
 
@@ -5507,21 +5496,21 @@ Group by PriceType ", dto.diId);
                         string info = $"签证 {visa.VisaDescription}  {(visa.VisaPrice > 0 ? "" : "此笔为退费!")} 人数为{visa.VisaFreeNumber + visa.VisaNumber} 单价为{singlePrice} 金额为{singlePrice * (visa.VisaFreeNumber + visa.VisaNumber)}";
                         arr.Add(info);
                     }
-                   
-                    string temp  = "本团人数" + groupinfo.VisitPNumber + ",该人员" + user.CnName + "共办理英国、加拿大、美国签证" + (singlePrice == 50 ? count : 0).ToString() + "本护照(包含免签人员),申根国家及其他所有国家" + (singlePrice == 30 ? count : 0).ToString() + "本。" + user.CnName + "提成共" + money.ToString("#0.00") + "元";
+
+                    string temp = "本团人数" + groupinfo.VisitPNumber + ",该人员" + user.CnName + "共办理英国、加拿大、美国签证" + (singlePrice == 50 ? count : 0).ToString() + "本护照(包含免签人员),申根国家及其他所有国家" + (singlePrice == 30 ? count : 0).ToString() + "本。" + user.CnName + "提成共" + money.ToString("#0.00") + "元";
 
                     resultArr.Add(new ComputeRoyaltiesView
                     {
-                        TeamName =  groupinfo.TeamName,
+                        TeamName = groupinfo.TeamName,
                         TeamId = groupinfo.Id,
                         ChiArr = arr,
                         TeamLvStr = teamLv.Find(x => x.Id == groupinfo.TeamLevSId)?.Name,
-                        VisitDate =  groupinfo.VisitDate,
-                        Temp =  temp,
+                        VisitDate = groupinfo.VisitDate,
+                        Temp = temp,
                         Price = money,
                     });
                 }
-                    
+
             }
 
             if (resultArr.Count > 0)
@@ -5548,7 +5537,7 @@ Group by PriceType ", dto.diId);
             }
 
             return Ok(jw);
-        
+
         }
 
         /// <summary>
@@ -5568,7 +5557,7 @@ Group by PriceType ", dto.diId);
                 UserId = dto.UserId,
             });
 
-            var parseApiResult =  ((apiResult as OkObjectResult)?.Value) as OASystem.Domain.ViewModels.JsonView;
+            var parseApiResult = ((apiResult as OkObjectResult)?.Value) as OASystem.Domain.ViewModels.JsonView;
 
             if (parseApiResult != null && parseApiResult.Code == 200)
             {
@@ -5585,7 +5574,7 @@ Group by PriceType ", dto.diId);
                     dic.Add("operName", user.CnName);
                     dic.Add("timeNow", DateTime.Now.ToString("yyyy年MM月dd日"));
                     //dic.Add("DowntimeNow", DateTime.Now.ToString("yyyy年MM月dd日"));
-                    dic.Add("totalPrice",( "总金额:" +  parseApiResult.Data?.GetType().GetProperty("totalPrice")?.GetValue(parseApiResult.Data).ObjToDecimal().ToString() ?? "0") +" 元");
+                    dic.Add("totalPrice", ("总金额:" + parseApiResult.Data?.GetType().GetProperty("totalPrice")?.GetValue(parseApiResult.Data).ObjToDecimal().ToString() ?? "0") + " 元");
 
                     ArrayList ToTableArr = new ArrayList();
                     int No = 1;
@@ -5600,14 +5589,14 @@ Group by PriceType ", dto.diId);
                             item.VisitDate,
                             item.TeamLvStr,
                             item.Temp,
-                            infos =  string.Join("\r\n",item.ChiArr),
+                            infos = string.Join("\r\n", item.ChiArr),
                             price = item.Price + "元",
                         });
 
                         No++;
                     }
 
-                    DataTable TbData =CommonFun.ToDataTableArray(ToTableArr);
+                    DataTable TbData = CommonFun.ToDataTableArray(ToTableArr);
                     TbData.TableName = "TbData";
 
                     WorkbookDesigner designer = new WorkbookDesigner();
@@ -5622,11 +5611,11 @@ Group by PriceType ", dto.diId);
                     designer.SetDataSource(TbData);
                     designer.Process();
 
-                    designer.Workbook.Save(AppSettingsHelper.Get("ExcelBasePath") + "RoyaltyExcel/" + user.CnName + "_提成结算.xlsx" );
+                    designer.Workbook.Save(AppSettingsHelper.Get("ExcelBasePath") + "RoyaltyExcel/" + user.CnName + "_提成结算.xlsx");
 
                     jw = JsonView(true, "success!", new
                     {
-                        Url = AppSettingsHelper.Get("ExcelBaseUrl") + AppSettingsHelper.Get("ExcelFtpPath")+ "RoyaltyExcel/" + user.CnName + "_提成结算.xlsx",
+                        Url = AppSettingsHelper.Get("ExcelBaseUrl") + AppSettingsHelper.Get("ExcelFtpPath") + "RoyaltyExcel/" + user.CnName + "_提成结算.xlsx",
                     });
                 }
             }
@@ -5723,8 +5712,8 @@ Group by PriceType ", dto.diId);
                     var title = "提成确认";
                     var center = $"【{dto.StartData}】 - 【{dto.EndData}】提成财务已确认,请尽快查看!";
                     //【{dto.StartData}-{dto.EndData}-{dto.CompanyId}-{dto.DeparId}-{dto.UserId}】";
-                    var ids = new List<int> { 235 , 233 }; //dto.UserId
-                    await GeneralMethod.MessageIssueAndNotification(MessageTypeEnum.GroupBusinessOperations,title, center, ids);
+                    var ids = new List<int> { 235, 233 }; //dto.UserId
+                    await GeneralMethod.MessageIssueAndNotification(MessageTypeEnum.GroupBusinessOperations, title, center, ids);
 
                     jw = JsonView(true, $"人员:{user.CnName} {dto.StartData}-{dto.EndData} 通知成功!");
                 }
@@ -5736,7 +5725,7 @@ Group by PriceType ", dto.diId);
             }
             else
             {
-                jw = JsonView(false,"保存失败! 无提成信息");
+                jw = JsonView(false, "保存失败! 无提成信息");
             }
 
             return Ok(jw);
@@ -5780,7 +5769,7 @@ Group by PriceType ", dto.diId);
                     .And(it => it.VisitDate <= EndDateTime)
                     .And(it => it.IsDel == 0)
                     .And(it => it.UserId == dto.UserId)
-                    .AndIF(dto.Confirm != -1,it => it.IsConfirm == dto.Confirm)
+                    .AndIF(dto.Confirm != -1, it => it.IsConfirm == dto.Confirm)
                     .AndIF(dto.Send != -1, it => it.IsSeed == dto.Send)
                     .ToExpression();
 
@@ -5803,8 +5792,8 @@ Group by PriceType ", dto.diId);
                 jw = JsonView(true, "获取成功!", new
                 {
                     List = query,
-                    CostPrice = query.Sum(x=>x.Price),
-                    ConfirmPrice = query.Where(x=>x.IsConfirm == 1).Sum(x=>x.Price),
+                    CostPrice = query.Sum(x => x.Price),
+                    ConfirmPrice = query.Where(x => x.IsConfirm == 1).Sum(x => x.Price),
                     NoConfirmPrice = query.Where(x => x.IsConfirm == 0).Sum(x => x.Price),
                     SeedPrice = query.Where(x => x.IsSeed == 1).Sum(x => x.Price),
                     NoSeedPrice = query.Where(x => x.IsSeed == 0).Sum(x => x.Price),
@@ -5828,21 +5817,21 @@ Group by PriceType ", dto.diId);
         {
             var jw = JsonView(false);
 
-            var stateArr = new int[] {0 , 1}; 
+            var stateArr = new int[] { 0, 1 };
 
             if (!stateArr.Contains(dto.State))
             {
-                return Ok(JsonView(false,"状态标识有误!"));
+                return Ok(JsonView(false, "状态标识有误!"));
             }
 
             if (dto.Data != null && dto.Data.Count != 0)
             {
                 var expressionUpdateWhere = Expressionable.Create<Fin_RoyaltyConfirm>()
-                   .And(it => dto.Data.Contains (it.Id))
+                   .And(it => dto.Data.Contains(it.Id))
                    .And(it => it.IsDel == 0)
                    .ToExpression();
 
-                var count  =  _sqlSugar.Updateable<Fin_RoyaltyConfirm>().SetColumns(x => new Fin_RoyaltyConfirm
+                var count = _sqlSugar.Updateable<Fin_RoyaltyConfirm>().SetColumns(x => new Fin_RoyaltyConfirm
                 {
                     IsConfirm = dto.State,
                 })
@@ -5902,9 +5891,9 @@ Group by PriceType ", dto.diId);
                                     .ToExpression();
 
             var DbQueryConfirmInfo = _sqlSugar.Queryable<Fin_RoyaltyConfirm>()
-                .LeftJoin<Sys_Users>((r,s) => s.IsDel == 0 && s.Id == r.UserId)
-                .LeftJoin<Sys_JobPost>((r, s , p) => p.IsDel == 0 && p.Id == s.JobPostId)
-                .LeftJoin<Sys_Department>((r, s, p , d) => d.IsDel == 0 && d.Id == p.DepId)
+                .LeftJoin<Sys_Users>((r, s) => s.IsDel == 0 && s.Id == r.UserId)
+                .LeftJoin<Sys_JobPost>((r, s, p) => p.IsDel == 0 && p.Id == s.JobPostId)
+                .LeftJoin<Sys_Department>((r, s, p, d) => d.IsDel == 0 && d.Id == p.DepId)
                 .LeftJoin<Sys_Company>((r, s, p, d, c) => c.IsDel == 0 && c.Id == d.CompanyId)
                 .Where(queryExpression)
                 .Select((r, s, p, d, c) => new
@@ -5914,7 +5903,7 @@ Group by PriceType ", dto.diId);
                     r.Id,
                     r.TeamName,
                     r.Price,
-                    s.CnName,   
+                    s.CnName,
                     p.JobName,
                     d.DepName,
                     c.CompanyName
@@ -5936,12 +5925,12 @@ Group by PriceType ", dto.diId);
                     first.DepName,
                     first.JobName,
                     first.CnName,
-                    SumPrice = item.Sum(x=>x.Price),
-                    RoyaltyIdArr = item.Select(x=>x.Id)
+                    SumPrice = item.Sum(x => x.Price),
+                    RoyaltyIdArr = item.Select(x => x.Id)
                 });
             }
 
-            jw = JsonView(true,"获取成功!",returnData);
+            jw = JsonView(true, "获取成功!", returnData);
 
             return Ok(jw);
         }
@@ -5953,7 +5942,7 @@ Group by PriceType ", dto.diId);
         [HttpPost]
         public async Task<IActionResult> RoyaltyFormPrice(RoyaltyFromPriceDto dto)
         {
-            var jw = JsonView(false,"用户ID为空!");
+            var jw = JsonView(false, "用户ID为空!");
 
             var User = _sqlSugar.Queryable<Sys_Users>().First(x => x.Id
              == dto.CreateId && x.IsDel == 0);
@@ -5968,7 +5957,7 @@ Group by PriceType ", dto.diId);
                 var queryExpression = Expressionable.Create<Fin_RoyaltyConfirm>()
                                    .And(r => r.IsDel == 0)
                                    .And(r => r.IsConfirm == 1)
-                                   .And(r => dto.Items.Select(x=>x.UserId).Contains(r.UserId))
+                                   .And(r => dto.Items.Select(x => x.UserId).Contains(r.UserId))
                                    .ToExpression();
 
                 var DbQueryConfirmInfo = _sqlSugar.Queryable<Fin_RoyaltyConfirm>()
@@ -5996,10 +5985,10 @@ Group by PriceType ", dto.diId);
                 //已经提交到日付的用户提成信息
                 var existsDb = _sqlSugar.Queryable<Fin_RoyaltyForm>()
                     .Where(x => dto.Items
-                        .Select(x => x.UserId).Contains(x.UserId) && x.IsDel == 0 )
+                        .Select(x => x.UserId).Contains(x.UserId) && x.IsDel == 0)
                     .ToList();
 
-                var GroupByConfirmInfo = DbQueryConfirmInfo.GroupBy(x => x.UserId ).ToList();
+                var GroupByConfirmInfo = DbQueryConfirmInfo.GroupBy(x => x.UserId).ToList();
                 //关联信息
                 List<Fin_RoyaltyForm> relevanceSoure = new List<Fin_RoyaltyForm>();
 
@@ -6028,9 +6017,9 @@ Group by PriceType ", dto.diId);
                         var reqBody = dto.Items.Find(x => x.UserId == item.Key);
                         var exists = item.Where(x => reqBody!.ChiArr.Contains(x.Id));
                         var existsDbByUser = existsDb.Where(x => x.UserId == item.Key);
-                        var idsByUser = string.Join(',',existsDbByUser.Select(x=>x.ConfirmIdArr));
+                        var idsByUser = string.Join(',', existsDbByUser.Select(x => x.ConfirmIdArr));
                         var idsByUserList = idsByUser.Split(',')
-                            .Select(x=>
+                            .Select(x =>
                             {
                                 if (!string.IsNullOrWhiteSpace(x) && int.TryParse(x, out int intx))
                                 {
@@ -6045,7 +6034,8 @@ Group by PriceType ", dto.diId);
                         var yesPrice = existsYes.Sum(x => x.Price);
                         var savePrice = saveArr.Sum(x => x.Price);
 
-                        if (saveArr.Count() > 0) {
+                        if (saveArr.Count() > 0)
+                        {
 
                             ChiDayPrice.Add(new
                             AddDailyFeePaymentContentDto
@@ -6067,10 +6057,12 @@ Group by PriceType ", dto.diId);
                             });
                         }
 
-                        if (yesPrice > 0 ) {
+                        if (yesPrice > 0)
+                        {
                             message += $"{first.CnName} 提成 {savePrice}元已导入日付申请 , {yesPrice} 元已经存在 ! \r\n";
                         }
-                        else {
+                        else
+                        {
                             message += $"{first.CnName} 提成 {savePrice}元已导入日付申请 ! \r\n";
                         }
                     }
@@ -6116,7 +6108,7 @@ Group by PriceType ", dto.diId);
         /// <param name="endDt"></param>
         /// <returns></returns>
         [HttpGet]
-        public async Task<IActionResult> GroupUnAuditFeeList(string beginDt,string endDt,string teamName)
+        public async Task<IActionResult> GroupUnAuditFeeList(string beginDt, string endDt, string teamName)
         {
             var jw = JsonView(false);
 
@@ -6163,16 +6155,16 @@ Group by PriceType ", dto.diId);
 
             //76	酒店预订
             var hotelDatas = _sqlSugar.Queryable<Grp_HotelReservations>()
-                                      .InnerJoin<Grp_CreditCardPayment>((hr,ccp) => hr.Id == ccp.CId && 
+                                      .InnerJoin<Grp_CreditCardPayment>((hr, ccp) => hr.Id == ccp.CId &&
                                                                                     ccp.CTable == 76 &&
                                                                                     ccp.IsDel == 0
                                                                         )
                                       .Where((hr, ccp) => hr.IsDel == 0 && _groupIds.Contains(hr.DiId) && ccp.IsAuditGM == 0)
                                       .ToList();
             var hotelContentDatas = _sqlSugar.Queryable<Grp_HotelReservationsContent>()
-                                             .Where(it => it.IsDel == 0 && 
-                                                          it.IsPay == 0 && 
-                                                          it.Price != 0 && 
+                                             .Where(it => it.IsDel == 0 &&
+                                                          it.IsPay == 0 &&
+                                                          it.Price != 0 &&
                                                           _groupIds.Contains(it.DiId)
                                                     )
                                              .ToList();
@@ -6494,7 +6486,7 @@ Group by PriceType ", dto.diId);
             //移除没有数据的团
             foreach (var item in dataList)
             {
-                if (item.CNYTotalAmount > 0 && item.ChildList.Count >0)
+                if (item.CNYTotalAmount > 0 && item.ChildList.Count > 0)
                 {
                     dataList1.Add(item);
                 }

Разница между файлами не показана из-за своего большого размера
+ 63 - 59
OASystem/OASystem.Api/Controllers/GroupsController.cs


+ 2 - 5
OASystem/OASystem.Api/Controllers/MarketCustomerResourcesController.cs

@@ -1,9 +1,6 @@
-using Microsoft.AspNetCore.Mvc;
-using OASystem.API.OAMethodLib;
+using OASystem.API.OAMethodLib;
 using OASystem.Domain.Dtos.CRM;
-using OASystem.Domain.Entities.Customer;
 using OASystem.Infrastructure.Repositories.CRM;
-using static OASystem.Domain.Dtos.CRM.NewClientDataQueryDto;
 
 namespace OASystem.API.Controllers
 {
@@ -206,7 +203,7 @@ namespace OASystem.API.Controllers
                 return Ok(JsonView(false, "请传入有效的DeleteUserId参数!"));
             }
 
-            if (dto.PortType < 0 )
+            if (dto.PortType < 0)
             {
                 return Ok(JsonView(false, "请传入有效的PortType参数!"));
             }

+ 152 - 167
OASystem/OASystem.Api/Controllers/PersonnelModuleController.cs

@@ -1,32 +1,20 @@
-using Aliyun.Credentials.Utils;
-using Aspose.Cells;
+using Aspose.Cells;
 using FluentValidation;
-using Microsoft.AspNetCore.Http;
 using Microsoft.AspNetCore.SignalR;
-using Microsoft.IdentityModel.Tokens;
-using NPOI.POIFS.Crypt.Dsig;
 using OASystem.API.OAMethodLib;
 using OASystem.API.OAMethodLib.Hub.HubClients;
 using OASystem.API.OAMethodLib.Hub.Hubs;
 using OASystem.API.OAMethodLib.QiYeWeChatAPI;
-using OASystem.API.OAMethodLib.QiYeWeChatAPI.AppNotice;
 using OASystem.API.OAMethodLib.Quartz.Business;
-using OASystem.API.OAMethodLib.SignalR.Hubs;
 using OASystem.Domain.Dtos.Groups;
 using OASystem.Domain.Dtos.PersonnelModule;
-using OASystem.Domain.Entities.Groups;
 using OASystem.Domain.Entities.PersonnelModule;
 using OASystem.Domain.ViewModels.PersonnelModule;
 using OASystem.Domain.ViewModels.QiYeWeChat;
 using OASystem.Infrastructure.Repositories.PersonnelModule;
-using Org.BouncyCastle.Asn1.Ocsp;
-using StackExchange.Redis;
-using System.Collections.Generic;
-using System.ComponentModel;
 using System.Data;
 using System.Diagnostics;
 using System.Globalization;
-using System.IO;
 using static OASystem.API.OAMethodLib.JWTHelper;
 
 namespace OASystem.API.Controllers
@@ -45,8 +33,6 @@ namespace OASystem.API.Controllers
         private readonly UsersRepository _usersRep;
         private readonly TaskAllocationRepository _taskAllocationRep;
 
-        private string url;
-        private string path;
         private readonly IHubContext<ChatHub, IChatClient> _hubContext;
         private readonly GoodsRepository _goodsRep;
 
@@ -113,20 +99,19 @@ namespace OASystem.API.Controllers
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
         public async Task<IActionResult> GetWageSheetMonthWorkdays(string startDt, string endDt)
         {
-
             //参数处理
-            string dtFormat = "yyyy-MM-dd";
+            var dtFormat = "yyyy-MM-dd";
             DateTime startDt1, endDt1;
-            bool startDtIsValid = DateTime.TryParseExact(startDt, dtFormat, CultureInfo.InvariantCulture, DateTimeStyles.None, out startDt1);
-            bool endDtIsValid = DateTime.TryParseExact(endDt, dtFormat, CultureInfo.InvariantCulture, DateTimeStyles.None, out endDt1);
+            var startDtIsValid = DateTime.TryParseExact(startDt, dtFormat, CultureInfo.InvariantCulture, DateTimeStyles.None, out startDt1);
+            var endDtIsValid = DateTime.TryParseExact(endDt, dtFormat, CultureInfo.InvariantCulture, DateTimeStyles.None, out endDt1);
 
             if (!startDtIsValid) return Ok(JsonView(false, "开始日期格式错误!正确时间格式:yyyy-MM-dd  "));
             if (!endDtIsValid) return Ok(JsonView(false, "结束格式错误!正确时间格式:yyyy-MM-dd  "));
 
 
 
-            string sql = string.Format(@"Select  * From Sys_Calendar
-										 Where Isdel = 0 And Dt between  '{0}' And  '{1}'", startDt, endDt);
+            var sql = string.Format(@"Select  * From Sys_Calendar
+                                         Where Isdel = 0 And Dt between  '{0}' And  '{1}'", startDt, endDt);
             var data = await _wageSheetRep._sqlSugar.SqlQueryable<CalendarInfoView>(sql).ToListAsync();
 
             return Ok(JsonView(true, "查询成功!", data));
@@ -165,7 +150,7 @@ namespace OASystem.API.Controllers
                 sys_Calendars = sys_Calendars.OrderBy(it => it.Dt).ToList();
             }
 
-            pm_WageIssueWorkingDay1.Workdays = sys_Calendars.Where(it => it.IsWorkDay == true).ToList().Count();
+            pm_WageIssueWorkingDay1.Workdays = sys_Calendars.Where(it => it.IsWorkDay == true).ToList().Count;
             foreach (var item in sys_Calendars)
             {
                 item.Remark = pm_WageIssueWorkingDay1.Remark;
@@ -223,7 +208,7 @@ namespace OASystem.API.Controllers
                     YearMonth = dto.YearMonth,
                     StartDate = dto.StartDate,
                     EndDate = dto.EndDate,
-                    Workdays = calendarsDatas.Where(it => it.IsWorkDay == true).ToList().Count()
+                    Workdays = calendarsDatas.Where(it => it.IsWorkDay == true).ToList().Count
                 };
 
                 string sql = string.Format("Select * From Pm_WageIssueWorkingDay Where Isdel = 0 And YearMonth='{0}'", dto.YearMonth);
@@ -671,8 +656,8 @@ namespace OASystem.API.Controllers
             if (!yearMonthDtIsValid) return Ok(JsonView(false, "年月格式错误!正确时间格式:yyyy-MM  "));
             //公司部门
             string sql = string.Format(@"Select row_number() over(order by pm_ws.Id) as Row_Number,
-                                         	sc.Id as CompanyId,sc.CompanyName,sd.Id as DepId,sd.DepName, 
-                                         	sys_u1.CnName Name,sys_u2.CnName LastUpdateUserName,pm_ws.* 
+                                            sc.Id as CompanyId,sc.CompanyName,sd.Id as DepId,sd.DepName, 
+                                            sys_u1.CnName Name,sys_u2.CnName LastUpdateUserName,pm_ws.* 
                                          From Pm_WageSheet pm_ws
                                          Left Join Sys_Users sys_u1 On pm_ws.UserId = sys_u1.Id
                                          Left Join Sys_Users sys_u2 On pm_ws.LastUpdateUserId = sys_u2.Id
@@ -853,8 +838,8 @@ namespace OASystem.API.Controllers
 
                                     //公司部门
                                     string sql = string.Format(@"Select row_number() over(order by pm_ws.Id) as Row_Number,
-                                         	sc.Id as CompanyId,sc.CompanyName,sd.Id as DepId,sd.DepName, 
-                                         	sys_u1.CnName Name,sys_u2.CnName LastUpdateUserName,pm_ws.* 
+                                            sc.Id as CompanyId,sc.CompanyName,sd.Id as DepId,sd.DepName, 
+                                            sys_u1.CnName Name,sys_u2.CnName LastUpdateUserName,pm_ws.* 
                                          From Pm_WageSheet pm_ws
                                          Left Join Sys_Users sys_u1 On pm_ws.UserId = sys_u1.Id
                                          Left Join Sys_Users sys_u2 On pm_ws.LastUpdateUserId = sys_u2.Id
@@ -881,8 +866,8 @@ namespace OASystem.API.Controllers
                                             .Select(it =>
                                              {
                                                  //修改 绩效不等于0.00M的数据
-                                                 decimal oldTax = it.WithholdingTax;
-                                                 decimal newTax = Convert.ToDecimal(taxData.Rows[i][1].ToString());
+                                                 //decimal oldTax = it.WithholdingTax;
+                                                 var newTax = Convert.ToDecimal(taxData.Rows[i][1].ToString());
                                                  it.WithholdingTax = newTax;
                                                  it.TotalRealHair = it.Should - it.TotalDeductions - newTax;
                                                  return it;
@@ -983,25 +968,25 @@ namespace OASystem.API.Controllers
         /// <returns></returns>
         [HttpPost]
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
-        public async Task<IActionResult> PostTaskAllocationInit(TaskAllocationInitDto _dto)
+        public async Task<IActionResult> PostTaskAllocationInit(TaskAllocationInitDto dto)
         {
             try
             {
                 #region  参数验证
-                if (_dto.UserId < 1) return Ok(JsonView(false, "员工Id为空"));
-                if (_dto.PageId < 1) _dto.PageId = 172; //任务指派Id
+                if (dto.UserId < 1) return Ok(JsonView(false, "员工Id为空"));
+                if (dto.PageId < 1) dto.PageId = 172; //任务指派Id
 
                 PageFunAuthViewBase pageFunAuthView = new PageFunAuthViewBase();
 
                 #region 页面操作权限验证
-                pageFunAuthView = await GeneralMethod.PostUserPageFuncDatas(_dto.UserId, _dto.PageId);
+                pageFunAuthView = await GeneralMethod.PostUserPageFuncDatas(dto.UserId, dto.PageId);
 
                 if (pageFunAuthView.CheckAuth == 0) return Ok(JsonView(false, "您没有查看权限!"));
                 #endregion
 
                 #endregion
 
-                var _view = await _taskAllocationRep._Init(_dto.PortType, _dto.UserId);
+                var _view = await _taskAllocationRep._Init(dto.PortType, dto.UserId);
                 if (_view.Code == 0)
                 {
                     return Ok(JsonView(true, "查询成功!", _view.Data));
@@ -1023,18 +1008,18 @@ namespace OASystem.API.Controllers
         /// <returns></returns>
         [HttpPost]
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
-        public async Task<IActionResult> PostTaskAllocationPage(TaskAllocationPageDto _dto)
+        public async Task<IActionResult> PostTaskAllocationPage(TaskAllocationPageDto dto)
         {
             try
             {
                 #region  参数验证
-                if (_dto.UserId < 1) return Ok(JsonView(false, "员工Id为空"));
-                if (_dto.PageId < 1) _dto.PageId = 172; //任务指派Id
+                if (dto.UserId < 1) return Ok(JsonView(false, "员工Id为空"));
+                if (dto.PageId < 1) dto.PageId = 172; //任务指派Id
 
                 PageFunAuthViewBase pageFunAuthView = new PageFunAuthViewBase();
 
                 #region 页面操作权限验证
-                pageFunAuthView = await GeneralMethod.PostUserPageFuncDatas(_dto.UserId, _dto.PageId);
+                pageFunAuthView = await GeneralMethod.PostUserPageFuncDatas(dto.UserId, dto.PageId);
 
                 if (pageFunAuthView.CheckAuth == 0) return Ok(JsonView(false, "您没有查看权限!"));
                 #endregion
@@ -1046,29 +1031,29 @@ namespace OASystem.API.Controllers
 
 
                 //类型处理
-                if (_dto.Type == 0) whereSql = "";
-                else if (_dto.Type == 1) //1 由我指派
+                if (dto.Type == 0) whereSql = "";
+                else if (dto.Type == 1) //1 由我指派
                 {
-                    whereSql = string.Format(@" And ta.CreateUserId = {0} Or (Select COUNT(1) As PeopleNumber From Pm_TaskRelevanceUser Where IsDel = 0 And ta.Id = TAId And UserId = {0}) > 0", _dto.UserId);
+                    whereSql = string.Format(@" And ta.CreateUserId = {0} Or (Select COUNT(1) As PeopleNumber From Pm_TaskRelevanceUser Where IsDel = 0 And ta.Id = TAId And UserId = {0}) > 0", dto.UserId);
                 }
-                else if (_dto.Type == 2)// 2 指派给我
+                else if (dto.Type == 2)// 2 指派给我
                 {
-                    whereSql = string.Format(@" And (Select COUNT(1) As PeopleNumber From Pm_TaskRelevanceUser Where IsDel = 0 And ta.Id = TAId And UserId = {0}) > 0", _dto.UserId);
+                    whereSql = string.Format(@" And (Select COUNT(1) As PeopleNumber From Pm_TaskRelevanceUser Where IsDel = 0 And ta.Id = TAId And UserId = {0}) > 0", dto.UserId);
                 }
                 //状态 -1 全部 0 未开始 1 进行中 2 待审核 3 未完成 4 已完成
-                if (_dto.Status == -1) //全部
+                if (dto.Status == -1) //全部
                 {
                     whereSql += "";
                 }
                 else
                 {
-                    whereSql += string.Format(@" And ta.Status = {0} ", _dto.Status);
+                    whereSql += string.Format(@" And ta.Status = {0} ", dto.Status);
                 }
 
                 //任务名称
-                if (!string.IsNullOrEmpty(_dto.TaskName))
+                if (!string.IsNullOrEmpty(dto.TaskName))
                 {
-                    whereSql += string.Format(@" And ta.TaskName Like '%{0}%' ", _dto.TaskName);
+                    whereSql += string.Format(@" And ta.TaskName Like '%{0}%' ", dto.TaskName);
                 }
 
                 #endregion
@@ -1094,16 +1079,16 @@ namespace OASystem.API.Controllers
                                                  Where ta.IsDel = 0 {0} ) As temp ", whereSql);
 
                 RefAsync<int> total = 0;//REF和OUT不支持异步,想要真的异步这是最优解
-                var _view = await _taskAllocationRep._sqlSugar.SqlQueryable<TaskListView>(pageSql).ToPageListAsync(_dto.PageIndex, _dto.PageSize, total);//ToPageAsync
+                var _view = await _taskAllocationRep._sqlSugar.SqlQueryable<TaskListView>(pageSql).ToPageListAsync(dto.PageIndex, dto.PageSize, total);//ToPageAsync
 
                 List<int> taskIds = new List<int>();
                 taskIds = _view.Select(it => it.Id).ToList();
 
                 string taskerSql = string.Format(@"Select tau.TAId,tau.Id,tau.UserId,u.CnName As UserName,tau.BeginTime,tau.OverTime,tau.TaskStatus,
-												  tau.Cause,tau.Score,tau.Remark As ScoreRemark,tau.CreateUserId As TaskCreateUserId
-												  From Pm_TaskRelevanceUser tau 
-												  Left Join Sys_Users u On tau.UserId = u.Id
-												  Where tau.IsDel = 0");
+                                                  tau.Cause,tau.Score,tau.Remark As ScoreRemark,tau.CreateUserId As TaskCreateUserId
+                                                  From Pm_TaskRelevanceUser tau 
+                                                  Left Join Sys_Users u On tau.UserId = u.Id
+                                                  Where tau.IsDel = 0");
 
                 var taskerData = _taskAllocationRep._sqlSugar.SqlQueryable<TaskerDetailsView>(taskerSql).Where(it => taskIds.Contains(it.TAId)).ToList();
                 foreach (var item in _view)
@@ -1111,7 +1096,7 @@ namespace OASystem.API.Controllers
                     item.TaskerDetails = taskerData.Where(it => it.TAId == item.Id).ToList();
 
                     ////处理任务总状态 And 任务人状态
-                    //var taskerStatusData = taskerData.Where(it => it.TAId == item.Id && it.TaskCreateUserId != _dto.UserId && it.UserId == _dto.UserId).FirstOrDefault();
+                    //var taskerStatusData = taskerData.Where(it => it.TAId == item.Id && it.TaskCreateUserId != dto.UserId && it.UserId == dto.UserId).FirstOrDefault();
                     //if (taskerStatusData != null)
                     //{
                     //    item.Status = taskerStatusData.TaskStatus;
@@ -1135,25 +1120,25 @@ namespace OASystem.API.Controllers
         /// <returns></returns>
         [HttpPost]
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
-        public async Task<IActionResult> PostTaskAllocationDetails(TaskAllocationDetailsDto _dto)
+        public async Task<IActionResult> PostTaskAllocationDetails(TaskAllocationDetailsDto dto)
         {
             try
             {
                 #region  参数验证
-                if (_dto.UserId < 1) return Ok(JsonView(false, "员工Id为空"));
-                if (_dto.PageId < 1) _dto.PageId = 172; //任务指派Id
+                if (dto.UserId < 1) return Ok(JsonView(false, "员工Id为空"));
+                if (dto.PageId < 1) dto.PageId = 172; //任务指派Id
 
                 PageFunAuthViewBase pageFunAuthView = new PageFunAuthViewBase();
 
                 #region 页面操作权限验证
-                pageFunAuthView = await GeneralMethod.PostUserPageFuncDatas(_dto.UserId, _dto.PageId);
+                pageFunAuthView = await GeneralMethod.PostUserPageFuncDatas(dto.UserId, dto.PageId);
 
                 if (pageFunAuthView.CheckAuth == 0) return Ok(JsonView(false, "您没有查看权限!"));
                 #endregion
 
                 #endregion
 
-                var _view = await _taskAllocationRep._Details(_dto.PortType, _dto.Id);
+                var _view = await _taskAllocationRep._Details(dto.PortType, dto.Id);
                 if (_view.Code == 0)
                 {
                     return Ok(JsonView(true, "查询成功!", _view.Data));
@@ -1174,24 +1159,24 @@ namespace OASystem.API.Controllers
         /// <returns></returns>
         [HttpPost]
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
-        public async Task<IActionResult> PostTaskAllocationAddOrEdit(TaskAllocationAddOrEditDto _dto)
+        public async Task<IActionResult> PostTaskAllocationAddOrEdit(TaskAllocationAddOrEditDto dto)
         {
             try
             {
                 #region  参数验证
-                if (_dto.UserId < 1) return Ok(JsonView(false, "员工Id为空"));
-                if (_dto.PageId < 1) _dto.PageId = 172; //任务指派Id
+                if (dto.UserId < 1) return Ok(JsonView(false, "员工Id为空"));
+                if (dto.PageId < 1) dto.PageId = 172; //任务指派Id
 
                 PageFunAuthViewBase pageFunAuthView = new PageFunAuthViewBase();
 
                 #region 页面操作权限验证
-                pageFunAuthView = await GeneralMethod.PostUserPageFuncDatas(_dto.UserId, _dto.PageId);
+                pageFunAuthView = await GeneralMethod.PostUserPageFuncDatas(dto.UserId, dto.PageId);
 
-                if (_dto.Id == 0)
+                if (dto.Id == 0)
                 {
                     if (pageFunAuthView.AddAuth == 0) return Ok(JsonView(false, "您没有添加权限!"));
                 }
-                else if (_dto.Id > 0)
+                else if (dto.Id > 0)
                 {
 
                     if (pageFunAuthView.EditAuth == 0) return Ok(JsonView(false, "您没有编辑权限!"));
@@ -1202,16 +1187,16 @@ namespace OASystem.API.Controllers
 
                 #endregion
 
-                var _view = await _taskAllocationRep._AddOrEdit(_dto);
+                var _view = await _taskAllocationRep._AddOrEdit(dto);
                 if (_view.Code == 0)
                 {
 
-                    if (_dto.Id == 0) //添加提示任务单创建
+                    if (dto.Id == 0) //添加提示任务单创建
                     {
-                        string title = $"[{_dto.TaskName}] 任务新建成功!";
-                        string content = $"[{_dto.TaskName}] 任务新建成功,请前往任务页面查看详情!";
+                        string title = $"[{dto.TaskName}] 任务新建成功!";
+                        string content = $"[{dto.TaskName}] 任务新建成功,请前往任务页面查看详情!";
 
-                        await GeneralMethod.MessageIssueAndNotification(MessageTypeEnum.TaskProgressUpdate, title, content, _dto.UserIds);
+                        await GeneralMethod.MessageIssueAndNotification(MessageTypeEnum.TaskProgressUpdate, title, content, dto.UserIds);
                     }
 
                     return Ok(JsonView(true, "操作成功!"));
@@ -1232,11 +1217,11 @@ namespace OASystem.API.Controllers
         /// <returns></returns>
         [HttpPost]
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
-        public async Task<IActionResult> PostTaskAllocationTaskerDetails(TaskerDetailsDto _dto)
+        public async Task<IActionResult> PostTaskAllocationTaskerDetails(TaskerDetailsDto dto)
         {
             try
             {
-                var _view = await _taskAllocationRep._TaskerDetails(_dto.Id);
+                var _view = await _taskAllocationRep._TaskerDetails(dto.Id);
                 if (_view.Code == 0)
                 {
                     return Ok(JsonView(true, "操作成功!", _view.Data));
@@ -1257,24 +1242,24 @@ namespace OASystem.API.Controllers
         /// <returns></returns>
         [HttpPost]
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
-        public async Task<IActionResult> PostTaskAllocationSetStartStatus(TaskerStatusDto _dto)
+        public async Task<IActionResult> PostTaskAllocationSetStartStatus(TaskerStatusDto dto)
         {
             try
             {
-                var _view = await _taskAllocationRep._TaskerSetStartStatus(_dto.UserId, _dto.Id);
+                var _view = await _taskAllocationRep._TaskerSetStartStatus(dto.UserId, dto.Id);
                 if (_view.Code == 0)
                 {
                     //发送消息
-                    var taskData = _taskAllocationRep._sqlSugar.Queryable<Pm_TaskAllocation>().Where(it => it.Id == _dto.Id).First();
+                    var taskData = _taskAllocationRep._sqlSugar.Queryable<Pm_TaskAllocation>().Where(it => it.Id == dto.Id).First();
                     if (taskData != null)
                     {
-                        var taskUserIds = _taskAllocationRep._sqlSugar.Queryable<Pm_TaskRelevanceUser>().Where(it => it.TAId == _dto.Id).Select(it => it.UserId).ToList();
+                        var taskUserIds = _taskAllocationRep._sqlSugar.Queryable<Pm_TaskRelevanceUser>().Where(it => it.TAId == dto.Id).Select(it => it.UserId).ToList();
                         if (taskUserIds.Count > 0)
                         {
-                            taskUserIds.Remove(_dto.UserId);
+                            taskUserIds.Remove(dto.UserId);
                         }
 
-                        var UserName = _taskAllocationRep._sqlSugar.Queryable<Sys_Users>().Where(it => it.Id == _dto.UserId).Select(it => it.CnName).First();
+                        var UserName = _taskAllocationRep._sqlSugar.Queryable<Sys_Users>().Where(it => it.Id == dto.UserId).Select(it => it.CnName).First();
 
                         string title_createUser = $"[{taskData.TaskName}] 进度更新!";
                         string conten_createUser = $"[{UserName}] 已开始任务,请注意该工作人员任务进度!";
@@ -1288,7 +1273,7 @@ namespace OASystem.API.Controllers
 
 
                         string content1 = $"任务已开始,请在规定时间完成!若需查看,请前往任务页面查看详情!";
-                        await GeneralMethod.MessageIssueAndNotification(MessageTypeEnum.TaskProgressUpdate, title, content1, new List<int>() { _dto.UserId }); //设置任务人 发送消息
+                        await GeneralMethod.MessageIssueAndNotification(MessageTypeEnum.TaskProgressUpdate, title, content1, new List<int>() { dto.UserId }); //设置任务人 发送消息
 
                     }
 
@@ -1310,24 +1295,24 @@ namespace OASystem.API.Controllers
         /// <returns></returns>
         [HttpPost]
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
-        public async Task<IActionResult> PostTaskAllocationSetOverStatus(TaskerStatusDto _dto)
+        public async Task<IActionResult> PostTaskAllocationSetOverStatus(TaskerStatusDto dto)
         {
             try
             {
-                var _view = await _taskAllocationRep._TaskerSetOverStatus(_dto.UserId, _dto.Id);
+                var _view = await _taskAllocationRep._TaskerSetOverStatus(dto.UserId, dto.Id);
                 if (_view.Code == 0)
                 {
                     //发送消息
-                    var taskData = _taskAllocationRep._sqlSugar.Queryable<Pm_TaskAllocation>().Where(it => it.Id == _dto.Id).First();
+                    var taskData = _taskAllocationRep._sqlSugar.Queryable<Pm_TaskAllocation>().Where(it => it.Id == dto.Id).First();
                     if (taskData != null)
                     {
-                        var taskUserIds = _taskAllocationRep._sqlSugar.Queryable<Pm_TaskRelevanceUser>().Where(it => it.TAId == _dto.Id).Select(it => it.UserId).ToList();
+                        var taskUserIds = _taskAllocationRep._sqlSugar.Queryable<Pm_TaskRelevanceUser>().Where(it => it.TAId == dto.Id).Select(it => it.UserId).ToList();
                         if (taskUserIds.Count > 0)
                         {
-                            taskUserIds.Remove(_dto.UserId);
+                            taskUserIds.Remove(dto.UserId);
                         }
 
-                        var UserName = _taskAllocationRep._sqlSugar.Queryable<Sys_Users>().Where(it => it.Id == _dto.UserId).Select(it => it.CnName).First();
+                        var UserName = _taskAllocationRep._sqlSugar.Queryable<Sys_Users>().Where(it => it.Id == dto.UserId).Select(it => it.CnName).First();
 
                         string title_createUser = $"[{taskData.TaskName}] 进度更新!";
                         string conten_createUser = $"[{UserName}] 已完成任务,请前往任务页面进行审核操作!";
@@ -1341,7 +1326,7 @@ namespace OASystem.API.Controllers
 
 
                         string content1 = $"任务已完成,等待任务发布人审核!若需查看,请前往任务页面查看详情!";
-                        await GeneralMethod.MessageIssueAndNotification(MessageTypeEnum.TaskProgressUpdate, title, content1, new List<int>() { _dto.UserId }); //设置任务人 发送消息
+                        await GeneralMethod.MessageIssueAndNotification(MessageTypeEnum.TaskProgressUpdate, title, content1, new List<int>() { dto.UserId }); //设置任务人 发送消息
 
                     }
 
@@ -1363,15 +1348,15 @@ namespace OASystem.API.Controllers
         /// <returns></returns>
         [HttpPost]
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
-        public async Task<IActionResult> PostTaskAllocationSetHaveStatus(TaskAllocationStatusDto _dto)
+        public async Task<IActionResult> PostTaskAllocationSetHaveStatus(TaskAllocationStatusDto dto)
         {
             try
             {
-                var _view = await _taskAllocationRep._TaskSetHaveStatus(_dto.SubId);
+                var _view = await _taskAllocationRep._TaskSetHaveStatus(dto.SubId);
                 if (_view.Code == 0)
                 {
                     //发送消息
-                    var taskUserData = _taskAllocationRep._sqlSugar.Queryable<Pm_TaskRelevanceUser>().Where(it => it.Id == _dto.SubId).First();
+                    var taskUserData = _taskAllocationRep._sqlSugar.Queryable<Pm_TaskRelevanceUser>().Where(it => it.Id == dto.SubId).First();
                     if (taskUserData != null)
                     {
                         var taskData = _taskAllocationRep._sqlSugar.Queryable<Pm_TaskAllocation>().Where(it => it.Id == taskUserData.TAId).First();
@@ -1410,15 +1395,15 @@ namespace OASystem.API.Controllers
         /// <returns></returns>
         [HttpPost]
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
-        public async Task<IActionResult> PostTaskAllocationSetAuditStatus(TaskAllocationStatusDto _dto)
+        public async Task<IActionResult> PostTaskAllocationSetAuditStatus(TaskAllocationStatusDto dto)
         {
             try
             {
-                var _view = await _taskAllocationRep._TaskSetAuditStatus(_dto.SubId);
+                var _view = await _taskAllocationRep._TaskSetAuditStatus(dto.SubId);
                 if (_view.Code == 0)
                 {
                     //发送消息
-                    var taskUserData = _taskAllocationRep._sqlSugar.Queryable<Pm_TaskRelevanceUser>().Where(it => it.Id == _dto.SubId).First();
+                    var taskUserData = _taskAllocationRep._sqlSugar.Queryable<Pm_TaskRelevanceUser>().Where(it => it.Id == dto.SubId).First();
                     if (taskUserData != null)
                     {
                         var taskData = _taskAllocationRep._sqlSugar.Queryable<Pm_TaskAllocation>().Where(it => it.Id == taskUserData.TAId).First();
@@ -1451,15 +1436,15 @@ namespace OASystem.API.Controllers
         /// <returns></returns>
         [HttpPost]
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
-        public async Task<IActionResult> PostTaskAllocationSetUnFinishedStatus(TaskAllocationSetUnFinishedStatusDto _dto)
+        public async Task<IActionResult> PostTaskAllocationSetUnFinishedStatus(TaskAllocationSetUnFinishedStatusDto dto)
         {
             try
             {
-                var _view = await _taskAllocationRep._TaskSetUnFinishedStatus(_dto.SubId, _dto.Cause);
+                var _view = await _taskAllocationRep._TaskSetUnFinishedStatus(dto.SubId, dto.Cause);
                 if (_view.Code == 0)
                 {
                     //发送消息
-                    var taskUserData = _taskAllocationRep._sqlSugar.Queryable<Pm_TaskRelevanceUser>().Where(it => it.Id == _dto.SubId).First();
+                    var taskUserData = _taskAllocationRep._sqlSugar.Queryable<Pm_TaskRelevanceUser>().Where(it => it.Id == dto.SubId).First();
                     if (taskUserData != null)
                     {
                         var taskData = _taskAllocationRep._sqlSugar.Queryable<Pm_TaskAllocation>().Where(it => it.Id == taskUserData.TAId).First();
@@ -1491,18 +1476,18 @@ namespace OASystem.API.Controllers
         ///// <returns></returns>
         //[HttpPost]
         //[ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
-        //public async Task<IActionResult> PostTaskAllocationIsConfirmCompletion(TaskAllocationScoreDto _dto)
+        //public async Task<IActionResult> PostTaskAllocationIsConfirmCompletion(TaskAllocationScoreDto dto)
         //{
         //    try
         //    {
         //        #region  参数验证
-        //        if (_dto.UserId < 1) return Ok(JsonView(false, "员工Id为空"));
-        //        if (_dto.PageId < 1) _dto.PageId = 172; //任务指派Id
+        //        if (dto.UserId < 1) return Ok(JsonView(false, "员工Id为空"));
+        //        if (dto.PageId < 1) dto.PageId = 172; //任务指派Id
 
         //        PageFunAuthViewBase pageFunAuthView = new PageFunAuthViewBase();
 
         //        #region 页面操作权限验证
-        //        pageFunAuthView = await GeneralMethod.PostUserPageFuncDatas(_dto.UserId, _dto.PageId);
+        //        pageFunAuthView = await GeneralMethod.PostUserPageFuncDatas(dto.UserId, dto.PageId);
 
         //        if (pageFunAuthView.EditAuth == 0) return Ok(JsonView(false, "您没有编辑权限!"));
 
@@ -1510,7 +1495,7 @@ namespace OASystem.API.Controllers
 
         //        #endregion
 
-        //        var _view = await _taskAllocationRep._TaskConfirmCompletion(_dto.PortType, _dto.Id);
+        //        var _view = await _taskAllocationRep._TaskConfirmCompletion(dto.PortType, dto.Id);
         //        if (_view.Code == 0)
         //        {
         //            return Ok(JsonView(true, "操作成功!"));
@@ -1531,18 +1516,18 @@ namespace OASystem.API.Controllers
         ///// <returns></returns>
         //[HttpPost]
         //[ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
-        //public async Task<IActionResult> PostTaskAllocationConfirmCompletion(TaskAllocationConfirmCompletionDto _dto)
+        //public async Task<IActionResult> PostTaskAllocationConfirmCompletion(TaskAllocationConfirmCompletionDto dto)
         //{
         //    try
         //    {
         //        #region  参数验证
-        //        if (_dto.UserId < 1) return Ok(JsonView(false, "员工Id为空"));
-        //        if (_dto.PageId < 1) _dto.PageId = 172; //任务指派Id
+        //        if (dto.UserId < 1) return Ok(JsonView(false, "员工Id为空"));
+        //        if (dto.PageId < 1) dto.PageId = 172; //任务指派Id
 
         //        PageFunAuthViewBase pageFunAuthView = new PageFunAuthViewBase();
 
         //        #region 页面操作权限验证
-        //        pageFunAuthView = await GeneralMethod.PostUserPageFuncDatas(_dto.UserId, _dto.PageId);
+        //        pageFunAuthView = await GeneralMethod.PostUserPageFuncDatas(dto.UserId, dto.PageId);
 
         //        if (pageFunAuthView.EditAuth == 0) return Ok(JsonView(false, "您没有编辑权限!"));
 
@@ -1550,7 +1535,7 @@ namespace OASystem.API.Controllers
 
         //        #endregion
 
-        //        var _view = await _taskAllocationRep._TaskConfirmCompletion(_dto.PortType,_dto.Id);
+        //        var _view = await _taskAllocationRep._TaskConfirmCompletion(dto.PortType,dto.Id);
         //        if (_view.Code == 0)
         //        {
         //            return Ok(JsonView(true, "操作成功!"));
@@ -1571,18 +1556,18 @@ namespace OASystem.API.Controllers
         /// <returns></returns>
         [HttpPost]
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
-        public async Task<IActionResult> PostTaskAllocationScore(TaskAllocationScoreDto _dto)
+        public async Task<IActionResult> PostTaskAllocationScore(TaskAllocationScoreDto dto)
         {
             try
             {
                 #region  参数验证
-                if (_dto.UserId < 1) return Ok(JsonView(false, "员工Id为空"));
-                if (_dto.PageId < 1) _dto.PageId = 172; //任务指派Id
+                if (dto.UserId < 1) return Ok(JsonView(false, "员工Id为空"));
+                if (dto.PageId < 1) dto.PageId = 172; //任务指派Id
 
                 PageFunAuthViewBase pageFunAuthView = new PageFunAuthViewBase();
 
                 #region 页面操作权限验证
-                pageFunAuthView = await GeneralMethod.PostUserPageFuncDatas(_dto.UserId, _dto.PageId);
+                pageFunAuthView = await GeneralMethod.PostUserPageFuncDatas(dto.UserId, dto.PageId);
 
                 if (pageFunAuthView.EditAuth == 0) return Ok(JsonView(false, "您没有编辑权限!"));
 
@@ -1590,11 +1575,11 @@ namespace OASystem.API.Controllers
 
                 #endregion
 
-                var _view = await _taskAllocationRep._TaskScore(_dto);
+                var _view = await _taskAllocationRep._TaskScore(dto);
                 if (_view.Code == 0)
                 {
                     //发送消息
-                    var taskUserData = _taskAllocationRep._sqlSugar.Queryable<Pm_TaskRelevanceUser>().Where(it => it.Id == _dto.SubId).First();
+                    var taskUserData = _taskAllocationRep._sqlSugar.Queryable<Pm_TaskRelevanceUser>().Where(it => it.Id == dto.SubId).First();
                     if (taskUserData != null)
                     {
                         var taskData = _taskAllocationRep._sqlSugar.Queryable<Pm_TaskAllocation>().Where(it => it.Id == taskUserData.TAId).First();
@@ -1626,18 +1611,18 @@ namespace OASystem.API.Controllers
         /// <returns></returns>
         [HttpPost]
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
-        public async Task<IActionResult> PostTaskAllocationTermination(TaskAllocationConfirmCompletionDto _dto)
+        public async Task<IActionResult> PostTaskAllocationTermination(TaskAllocationConfirmCompletionDto dto)
         {
             try
             {
                 #region  参数验证
-                if (_dto.UserId < 1) return Ok(JsonView(false, "员工Id为空"));
-                if (_dto.PageId < 1) _dto.PageId = 172; //任务指派Id
+                if (dto.UserId < 1) return Ok(JsonView(false, "员工Id为空"));
+                if (dto.PageId < 1) dto.PageId = 172; //任务指派Id
 
                 PageFunAuthViewBase pageFunAuthView = new PageFunAuthViewBase();
 
                 #region 页面操作权限验证
-                pageFunAuthView = await GeneralMethod.PostUserPageFuncDatas(_dto.UserId, _dto.PageId);
+                pageFunAuthView = await GeneralMethod.PostUserPageFuncDatas(dto.UserId, dto.PageId);
 
                 if (pageFunAuthView.EditAuth == 0) return Ok(JsonView(false, "您没有编辑权限!"));
 
@@ -1645,14 +1630,14 @@ namespace OASystem.API.Controllers
 
                 #endregion
 
-                var _view = await _taskAllocationRep._TaskTermination(_dto.Id);
+                var _view = await _taskAllocationRep._TaskTermination(dto.Id);
                 if (_view.Code == 0)
                 {
                     //发送消息
-                    var taskData = _taskAllocationRep._sqlSugar.Queryable<Pm_TaskAllocation>().Where(it => it.Id == _dto.Id).First();
+                    var taskData = _taskAllocationRep._sqlSugar.Queryable<Pm_TaskAllocation>().Where(it => it.Id == dto.Id).First();
                     if (taskData != null)
                     {
-                        var taskUserIds = _taskAllocationRep._sqlSugar.Queryable<Pm_TaskRelevanceUser>().Where(it => it.Id == _dto.Id).Select(it => it.UserId).ToList();
+                        var taskUserIds = _taskAllocationRep._sqlSugar.Queryable<Pm_TaskRelevanceUser>().Where(it => it.Id == dto.Id).Select(it => it.UserId).ToList();
                         taskUserIds.Add(taskData.CreateUserId);
 
 
@@ -1680,18 +1665,18 @@ namespace OASystem.API.Controllers
         /// <returns></returns>
         [HttpPost]
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
-        public async Task<IActionResult> PostTaskAllocationDel(TaskAllocationConfirmCompletionDto _dto)
+        public async Task<IActionResult> PostTaskAllocationDel(TaskAllocationConfirmCompletionDto dto)
         {
             try
             {
                 #region  参数验证
-                if (_dto.UserId < 1) return Ok(JsonView(false, "员工Id为空"));
-                if (_dto.PageId < 1) _dto.PageId = 172; //任务指派Id
+                if (dto.UserId < 1) return Ok(JsonView(false, "员工Id为空"));
+                if (dto.PageId < 1) dto.PageId = 172; //任务指派Id
 
                 PageFunAuthViewBase pageFunAuthView = new PageFunAuthViewBase();
 
                 #region 页面操作权限验证
-                pageFunAuthView = await GeneralMethod.PostUserPageFuncDatas(_dto.UserId, _dto.PageId);
+                pageFunAuthView = await GeneralMethod.PostUserPageFuncDatas(dto.UserId, dto.PageId);
 
                 if (pageFunAuthView.DeleteAuth == 0) return Ok(JsonView(false, "您没有删除权限!"));
 
@@ -1699,7 +1684,7 @@ namespace OASystem.API.Controllers
 
                 #endregion
 
-                var _view = await _taskAllocationRep._TaskDel(_dto.Id);
+                var _view = await _taskAllocationRep._TaskDel(dto.Id);
                 if (_view.Code == 0)
                 {
                     return Ok(JsonView(true, "操作成功!"));
@@ -1719,16 +1704,16 @@ namespace OASystem.API.Controllers
         /// <summary>
         /// 测试
         /// </summary>
-        /// <param name="_dto"></param>
+        /// <param name="dto"></param>
         /// <returns></returns>
         [HttpPost]
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
-        public async Task<IActionResult> Test_QIYEWX(PostTourClientListDownloadFile _dto)
+        public async Task<IActionResult> Test_QIYEWX(PostTourClientListDownloadFile dto)
         {
             //List<string> templist = new List<string>() { 234.ToString() };
             //await AppNoticeLibrary.SendUserMsg_GroupStatus_AuditFee(14090, templist, QiyeWeChatEnum.TestChat);
 
-            //await AppNoticeLibrary.SendUserMsg_GroupShare_ToJob(_dto.DiId); ;
+            //await AppNoticeLibrary.SendUserMsg_GroupShare_ToJob(dto.DiId); ;
 
 
             //DeleReminderMessage.PostMessageByWebhook();
@@ -1754,17 +1739,17 @@ namespace OASystem.API.Controllers
             //AppNoticeLibrary.SendUserMsg_GroupStatus_Create(2358, userList);
 
             //费用审核
-            //AppNoticeLibrary.SendChatMsg_GroupStatus_ApplyFee(_dto.DiId, QiyeWeChatEnum.TestChat);
+            //AppNoticeLibrary.SendChatMsg_GroupStatus_ApplyFee(dto.DiId, QiyeWeChatEnum.TestChat);
 
             //费用审核结果通知(通过情况下发送财务群)
             //List<string> userList = new List<string>() { "234" };
-            //AppNoticeLibrary.SendUserMsg_GroupStatus_AuditFee(_dto.DiId, userList, QiyeWeChatEnum.CaiWuChat02);
+            //AppNoticeLibrary.SendUserMsg_GroupStatus_AuditFee(dto.DiId, userList, QiyeWeChatEnum.CaiWuChat02);
 
             //4、财务付款时:(1)对应版块人员【单独发,状态为已付款才发】
-            //AppNoticeLibrary.SendUserMsg_GroupStatus_PayResult(_dto.DiId, userList);
+            //AppNoticeLibrary.SendUserMsg_GroupStatus_PayResult(dto.DiId, userList);
 
             //团组提醒财务群
-            DateTime dtNow = DateTime.Now;
+            //DateTime dtNow = DateTime.Now;
             //List<Grp_DelegationInfo> listSource = _usersRep.Query<Grp_DelegationInfo>(s => s.IsDel == 0 && s.VisitStartDate >= dtNow).Take(3).ToList();
             //List<Grp_DelegationInfo> listAdd7day = _usersRep.Query<Grp_DelegationInfo>(s => s.IsDel == 0 && s.VisitStartDate >= dtNow).Take(3).ToList();
             //List<Grp_DelegationInfo> listAdd3day = new List<Grp_DelegationInfo>() { };
@@ -1773,10 +1758,10 @@ namespace OASystem.API.Controllers
 
 
             //日付申请提醒财务群
-            //AppNoticeLibrary.DailyPayReminders_Create_ToCaiwuChat(_dto.DiId, QiyeWeChatEnum.CaiWuChat02);
+            //AppNoticeLibrary.DailyPayReminders_Create_ToCaiwuChat(dto.DiId, QiyeWeChatEnum.CaiWuChat02);
             //日付申请结果推送用户、成功通知财务群
-            //AppNoticeLibrary.DailyPayReminder_Audit_ToUser(_dto.DiId, userList, QiyeWeChatEnum.TestChat);
-            //AppNoticeLibrary.DailyPayReminder_Pay_ToUser(_dto.DiId, userList);
+            //AppNoticeLibrary.DailyPayReminder_Audit_ToUser(dto.DiId, userList, QiyeWeChatEnum.TestChat);
+            //AppNoticeLibrary.DailyPayReminder_Pay_ToUser(dto.DiId, userList);
 
             string q = "";
 
@@ -1809,12 +1794,12 @@ namespace OASystem.API.Controllers
         /// <returns></returns>
         [HttpPost]
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
-        public async Task<IActionResult> GoodsList(GoodsListDTO _dto)
+        public async Task<IActionResult> GoodsList(GoodsListDTO dto)
         {
-            if (_dto.PortType > 1 || _dto.PortType > 3) return Ok(JsonView(false,MsgTips.Port));
-            if (_dto.PageIndex < 1 || _dto.PageSize < 1) return Ok(JsonView(false, MsgTips.PageIndex));
+            if (dto.PortType > 1 || dto.PortType > 3) return Ok(JsonView(false, MsgTips.Port));
+            if (dto.PageIndex < 1 || dto.PageSize < 1) return Ok(JsonView(false, MsgTips.PageIndex));
 
-            return Ok(await _goodsRep.GoodsList(_dto));
+            return Ok(await _goodsRep.GoodsList(dto));
         }
 
         /// <summary>
@@ -1839,13 +1824,13 @@ namespace OASystem.API.Controllers
         /// <returns></returns>
         [HttpPost]
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
-        public async Task<IActionResult> GoodsOP(GoodsOPDTO _dto)
+        public async Task<IActionResult> GoodsOP(GoodsOPDTO dto)
         {
             var _currUserInfo = JwtHelper.SerializeJwt(HttpContext.Request.Headers.Authorization);
             if (_currUserInfo == null) return Ok(JsonView(false, "请传入token!"));
 
             var validator = new GoodsOPDTOValidator();
-            var validatorRes = await validator.ValidateAsync(_dto);
+            var validatorRes = await validator.ValidateAsync(dto);
             if (!validatorRes.IsValid)
             {
                 var sb = new StringBuilder();
@@ -1853,7 +1838,7 @@ namespace OASystem.API.Controllers
                 return Ok(JsonView(false, sb.ToString()));
             }
 
-            return Ok(await _goodsRep.GoodsOP(_dto, _currUserInfo.UserId));
+            return Ok(await _goodsRep.GoodsOp(dto, _currUserInfo.UserId));
         }
 
         /// <summary>
@@ -1880,12 +1865,12 @@ namespace OASystem.API.Controllers
         /// <returns></returns>
         [HttpPost]
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
-        public async Task<IActionResult> GoodsStorageList(GoodsStorageListDTO _dto)
+        public async Task<IActionResult> GoodsStorageList(GoodsStorageListDTO dto)
         {
-            if (_dto.PortType > 1 || _dto.PortType > 3) return Ok(JsonView(false, MsgTips.Port));
-            if (_dto.PageIndex < 1 || _dto.PageSize < 1) return Ok(JsonView(false, MsgTips.PageIndex));
-            
-            return Ok(await _goodsRep.GoodsStorageList(_dto));
+            if (dto.PortType > 1 || dto.PortType > 3) return Ok(JsonView(false, MsgTips.Port));
+            if (dto.PageIndex < 1 || dto.PageSize < 1) return Ok(JsonView(false, MsgTips.PageIndex));
+
+            return Ok(await _goodsRep.GoodsStorageList(dto));
         }
 
         /// <summary>
@@ -1910,21 +1895,21 @@ namespace OASystem.API.Controllers
         /// <returns></returns>
         [HttpPost]
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
-        public async Task<IActionResult> GoodsStorageOP(GoodsStorageOPDTO _dto)
+        public async Task<IActionResult> GoodsStorageOp(GoodsStorageOpDto dto)
         {
-            var _currUserInfo = JwtHelper.SerializeJwt(HttpContext.Request.Headers.Authorization);
-            if (_currUserInfo == null) return Ok(JsonView(false, "请传入token!"));
+            var currUserInfo = JwtHelper.SerializeJwt(HttpContext.Request.Headers.Authorization);
+            if (currUserInfo == null) return Ok(JsonView(false, "请传入token!"));
 
-            var vadalitor = new GoodsStorageOPDTOValidator();
-            var vadalitorRes = await vadalitor.ValidateAsync(_dto);
-            if (!vadalitorRes.IsValid)
+            var validator = new GoodsStorageOpDtoValidator();
+            var validatorRes = await validator.ValidateAsync(dto);
+            if (!validatorRes.IsValid)
             {
                 var sb = new StringBuilder();
-                foreach (var error in vadalitorRes.Errors) sb.AppendLine(error.ErrorMessage);
+                foreach (var error in validatorRes.Errors) sb.AppendLine(error.ErrorMessage);
                 return Ok(JsonView(false, sb.ToString()));
             }
 
-            return Ok(await _goodsRep.GoodsStorageOP(_dto, _currUserInfo.UserId));
+            return Ok(await _goodsRep.GoodsStorageOp(dto, currUserInfo.UserId));
         }
 
         /// <summary>
@@ -1952,12 +1937,12 @@ namespace OASystem.API.Controllers
         /// <returns></returns>
         [HttpPost]
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
-        public async Task<IActionResult> GoodsReceiveList(GoodsReceiveListDTO _dto)
+        public async Task<IActionResult> GoodsReceiveList(GoodsReceiveListDTO dto)
         {
-            if (_dto.PortType > 1 || _dto.PortType > 3) return Ok(JsonView(false, MsgTips.Port));
-            if (_dto.PageIndex < 1 || _dto.PageSize < 1) return Ok(JsonView(false, MsgTips.PageIndex));
+            if (dto.PortType > 1 || dto.PortType > 3) return Ok(JsonView(false, MsgTips.Port));
+            if (dto.PageIndex < 1 || dto.PageSize < 1) return Ok(JsonView(false, MsgTips.PageIndex));
 
-            return Ok(await _goodsRep.GoodsReceiveList(_dto));
+            return Ok(await _goodsRep.GoodsReceiveList(dto));
         }
 
         /// <summary>
@@ -1967,7 +1952,7 @@ namespace OASystem.API.Controllers
         /// <returns></returns>
         [HttpGet("{id}")]
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
-        public async Task<IActionResult> GoodsReceiveInfo([FromQuery]int portType, int id)
+        public async Task<IActionResult> GoodsReceiveInfo([FromQuery] int portType, int id)
         {
             if (portType > 1 || portType > 3) return Ok(JsonView(false, MsgTips.Port));
             if (id < 1) return Ok(JsonView(false, MsgTips.Id));
@@ -1982,13 +1967,13 @@ namespace OASystem.API.Controllers
         /// <returns></returns>
         [HttpPost]
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
-        public async Task<IActionResult> GoodsReceiveOP(GoodsReceiveOPDTO _dto)
+        public async Task<IActionResult> GoodsReceiveOP(GoodsReceiveOPDTO dto)
         {
             var _currUserInfo = JwtHelper.SerializeJwt(HttpContext.Request.Headers.Authorization);
             if (_currUserInfo == null) return Ok(JsonView(false, "请传入token!"));
 
             var vadalitor = new GoodsReceiveOPDTOValidator();
-            var vadalitorRes = await vadalitor.ValidateAsync(_dto);
+            var vadalitorRes = await vadalitor.ValidateAsync(dto);
             if (!vadalitorRes.IsValid)
             {
                 var sb = new StringBuilder();
@@ -1996,42 +1981,42 @@ namespace OASystem.API.Controllers
                 return Ok(JsonView(false, sb.ToString()));
             }
 
-            return Ok(await _goodsRep.GoodsReceiveOP(_dto, _currUserInfo.UserId));
+            return Ok(await _goodsRep.GoodsReceiveOP(dto, _currUserInfo.UserId));
         }
 
         /// <summary>
         /// 物资进销存
         /// 领用 审核
         /// </summary>
-        /// <param name="_dto"></param>
+        /// <param name="dto"></param>
         /// <returns></returns>
         [HttpPost]
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
-        public async Task<IActionResult> GoodsReceiveAudit(GoodsReceiveAuditDTO _dto)
+        public async Task<IActionResult> GoodsReceiveAudit(GoodsReceiveAuditDTO dto)
         {
             var _currUserInfo = JwtHelper.SerializeJwt(HttpContext.Request.Headers.Authorization);
             if (_currUserInfo == null) return Ok(JsonView(false, "请传入token!"));
 
             var vadalitor = new GoodsReceiveAuditDTOValidator();
-            var vadalitorRes = await vadalitor.ValidateAsync(_dto);
+            var vadalitorRes = await vadalitor.ValidateAsync(dto);
             if (!vadalitorRes.IsValid)
             {
                 var sb = new StringBuilder();
                 foreach (var error in vadalitorRes.Errors) sb.AppendLine(error.ErrorMessage);
                 return Ok(JsonView(false, sb.ToString()));
             }
-            int[] idArray = _dto.Label
+            int[] idArray = dto.Label
                                 .Split(',')
-                                .Select(x => 
+                                .Select(x =>
                                 {
                                     int id;
                                     if (int.TryParse(x, out id)) return id;
                                     else return id;
                                 })
                                 .ToArray();
-            return Ok(await _goodsRep.GoodsReceiveAudit(idArray, _currUserInfo.UserId, _dto.AuditEnum));
+            return Ok(await _goodsRep.GoodsReceiveAudit(idArray, _currUserInfo.UserId, dto.AuditEnum));
         }
-        
+
         /// <summary>
         /// 物资进销存
         /// 领用 Del

+ 65 - 63
OASystem/OASystem.Api/Controllers/ResourceController.cs

@@ -1,23 +1,9 @@
 using Aspose.Words;
-using NPOI.HPSF;
-using NPOI.POIFS.Crypt.Dsig;
-using NPOI.SS.Formula.Functions;
 using OASystem.API.OAMethodLib;
 using OASystem.API.OAMethodLib.QiYeWeChatAPI.AppNotice;
-using OASystem.Domain.Dtos.Resource;
 using OASystem.Domain.Entities.Groups;
 using OASystem.Domain.ViewModels.Groups;
-using OASystem.Domain.ViewModels.QiYeWeChat;
 using OASystem.Infrastructure.Repositories.Groups;
-using Org.BouncyCastle.Asn1.Ocsp;
-using Org.BouncyCastle.Utilities;
-using Quartz.Util;
-using System.Collections.Generic;
-using System.Diagnostics;
-using System.IO;
-using System.Net.Http.Headers;
-using static OpenAI.GPT3.ObjectModels.SharedModels.IOpenAiModels;
-using static QRCoder.PayloadGenerator.SwissQrCode;
 
 namespace OASystem.API.Controllers
 {
@@ -47,11 +33,24 @@ namespace OASystem.API.Controllers
         private readonly TourClientListRepository _tourClientListRep;
         private readonly DelegationInfoRepository _delegationInfoRep;
 
-        public ResourceController(IMapper mapper, IConfiguration config, SqlSugarClient sqlSugar, CarDataRepository carDataRep, LocalGuideDataRepository localGuideDataRep,
-            ThreeCodeRepository threeCodeRep, HotelDataRepository hotelDataRep, ResItemInfoRepository resItemInfoRep, SetDataRepository setDataRepository,
-            CountryFeeRepository countryFeeRep, SetDataTypeRepository setDataTypeRep, AirTicketAgentRepository airTicketAgentRep,
-            InvitationOfficialActivityDataRepository invitationOfficialActivityDataRep, OfficialActivitiesRepository officialActivitiesRep, AskDataRepository askDataRep,
-            TicketBlackCodeRepository ticketBlackCodeRep, TourClientListRepository tourClientListRep, DelegationInfoRepository delegationInfoRep)
+        public ResourceController(IMapper mapper, 
+                                  IConfiguration config, 
+                                  SqlSugarClient sqlSugar,
+                                  CarDataRepository carDataRep, 
+                                  LocalGuideDataRepository localGuideDataRep,
+                                  ThreeCodeRepository threeCodeRep, 
+                                  HotelDataRepository hotelDataRep, 
+                                  ResItemInfoRepository resItemInfoRep, 
+                                  SetDataRepository setDataRepository,
+                                  CountryFeeRepository countryFeeRep, 
+                                  SetDataTypeRepository setDataTypeRep, 
+                                  AirTicketAgentRepository airTicketAgentRep,
+                                  InvitationOfficialActivityDataRepository invitationOfficialActivityDataRep, 
+                                  OfficialActivitiesRepository officialActivitiesRep, 
+                                  AskDataRepository askDataRep,
+                                  TicketBlackCodeRepository ticketBlackCodeRep, 
+                                  TourClientListRepository tourClientListRep, 
+                                  DelegationInfoRepository delegationInfoRep)
         {
             _mapper = mapper;
             _config = config;
@@ -364,7 +363,7 @@ namespace OASystem.API.Controllers
         {
             string sql = string.Format(@" Select * From Res_LocalGuideData With(Nolock) Where Id = {0} ", dto.Id);
             LocalGuideDetailDataView info = _resItemInfoRep._sqlSugar.SqlQueryable<LocalGuideDetailDataView>(sql).First();
-            if(info == null)
+            if (info == null)
             {
                 return Ok(JsonView(false, "未找到相关数据!"));
             }
@@ -587,7 +586,8 @@ namespace OASystem.API.Controllers
                     Four = single.Four?.Trim(),
                     single.AirPort,
                     single.AirPort_En,
-                    single.City, single.Country,
+                    single.City,
+                    single.Country,
                     single.Remark
                 });
             }
@@ -815,10 +815,10 @@ namespace OASystem.API.Controllers
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
         public async Task<IActionResult> QueryHotelDataInfo(QueryHotelDataInfoDto dto)
         {
-            var _view = await _hotelDataRep._Info(dto.PortType,dto.Id);
-            if (_view.Code == 0 )
+            var _view = await _hotelDataRep._Info(dto.PortType, dto.Id);
+            if (_view.Code == 0)
             {
-                return Ok(JsonView(true, _view.Msg,_view.Data));
+                return Ok(JsonView(true, _view.Msg, _view.Data));
             }
 
             return Ok(JsonView(false, _view.Msg));
@@ -869,8 +869,8 @@ namespace OASystem.API.Controllers
         {
             if (string.IsNullOrEmpty(dto.City)) return Ok(JsonView(false, "请检查酒店所在城市是否填写!"));
             if (string.IsNullOrEmpty(dto.Name)) return Ok(JsonView(false, "请检查酒店名称是否填写!"));
-            if (string.IsNullOrEmpty(dto.Address)) return Ok(JsonView(false, "请检查酒店地址是否填写正确!")); 
-            if (string.IsNullOrEmpty(dto.Tel)) return Ok(JsonView(false, "请检查酒店联系方式是否填写正确!")); 
+            if (string.IsNullOrEmpty(dto.Address)) return Ok(JsonView(false, "请检查酒店地址是否填写正确!"));
+            if (string.IsNullOrEmpty(dto.Tel)) return Ok(JsonView(false, "请检查酒店联系方式是否填写正确!"));
 
             Result result = await _hotelDataRep.OperationHotelData(dto);
             if (result.Code != 0) return Ok(JsonView(false, result.Msg));
@@ -1497,7 +1497,8 @@ Inner Join Sys_Department as d With(Nolock) On u.DepId=d.Id Where m.Id={0} ", _m
                 var _groupNameData = _DelegationInfos.Select(it => new { it.Id, it.TeamName }).ToList();
                 var _userNameData = _Users.Select(it => new { it.Id, it.CnName }).ToList();
 
-                var _data = new {
+                var _data = new
+                {
                     CountryData = _countryData,
                     InviterData = _inviterData,
                     DomainData = _domainData,
@@ -1559,7 +1560,7 @@ Inner Join Sys_Department as d With(Nolock) On u.DepId=d.Id Where m.Id={0} ", _m
 
                 RefAsync<int> totalCount = 0;
 
-               var _ivitiesViews = await _sqlSugar.SqlQueryable<InvitationOfficialActivityDataView>(sql).ToPageListAsync(dto.PageIndex, dto.PageSize, totalCount);
+                var _ivitiesViews = await _sqlSugar.SqlQueryable<InvitationOfficialActivityDataView>(sql).ToPageListAsync(dto.PageIndex, dto.PageSize, totalCount);
 
                 //List<Grp_DelegationInfo> _DelegationInfos = _sqlSugar.Queryable<Grp_DelegationInfo>().ToList();
 
@@ -1615,7 +1616,7 @@ Inner Join Sys_Department as d With(Nolock) On u.DepId=d.Id Where m.Id={0} ", _m
         /// <returns></returns>
         [HttpPost]
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
-        public async Task<IActionResult> OpInvitationOfficialActivity([FromForm]OpInvitationOfficialActivityDto dto)
+        public async Task<IActionResult> OpInvitationOfficialActivity([FromForm] OpInvitationOfficialActivityDto dto)
         {
             return Ok(await _InvitationOfficialActivityDataRep.IOA_OP(dto));
         }
@@ -1628,10 +1629,10 @@ Inner Join Sys_Department as d With(Nolock) On u.DepId=d.Id Where m.Id={0} ", _m
         /// <returns></returns>
         [HttpDelete("{id}")]
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
-        public async Task<IActionResult> InvitationOfficialActivityDelFile(int id,string fileName)
+        public async Task<IActionResult> InvitationOfficialActivityDelFile(int id, string fileName)
         {
-            if (id < 1 ) return Ok(JsonView(false, "请传入有效的Id"));
-            if(string.IsNullOrEmpty(fileName)) return Ok(JsonView(false, "文件名称不能为空!"));
+            if (id < 1) return Ok(JsonView(false, "请传入有效的Id"));
+            if (string.IsNullOrEmpty(fileName)) return Ok(JsonView(false, "文件名称不能为空!"));
 
             var info = await _sqlSugar.Queryable<Res_InvitationOfficialActivityData>().FirstAsync(x => x.Id == id);
             if (info == null) return Ok(JsonView(false, "该条数据不存在!"));
@@ -1643,7 +1644,7 @@ Inner Join Sys_Department as d With(Nolock) On u.DepId=d.Id Where m.Id={0} ", _m
             }
             catch (Exception) { }
 
-            if (files != null && files.Count > 0 && files.Contains(fileName)) 
+            if (files != null && files.Count > 0 && files.Contains(fileName))
             {
                 var filePath = $@"{AppSettingsHelper.Get("GrpFileBasePath")}/商邀相关文件/{fileName}";
                 if (System.IO.File.Exists(filePath))
@@ -1719,7 +1720,7 @@ Inner Join Sys_Department as d With(Nolock) On u.DepId=d.Id Where m.Id={0} ", _m
             var data = _sqlSugar.Queryable<Sys_SetData>().Where(a => a.IsDel == 0 && a.STid == 38).ToList();
 
             var _DeleFile = _sqlSugar.Queryable<Grp_DeleFile>().Where(a => a.Diid == dto.DiId && a.IsDel == 0 && a.Category == 970).ToList();
-            return Ok(JsonView(true, "查询成功!", new { Delegation = groupInfos, SetData = data,DeleFile = _DeleFile }));
+            return Ok(JsonView(true, "查询成功!", new { Delegation = groupInfos, SetData = data, DeleFile = _DeleFile }));
         }
 
         /// <summary>
@@ -1757,7 +1758,7 @@ Inner Join Sys_Department as d With(Nolock) On u.DepId=d.Id Where m.Id={0} ", _m
                 throw;
             }
         }
-        
+
         /// <summary>
         /// 公务出访操作(Status:1.新增,2.修改)
         /// </summary>
@@ -1786,7 +1787,7 @@ Inner Join Sys_Department as d With(Nolock) On u.DepId=d.Id Where m.Id={0} ", _m
             return Ok(JsonView(true, groupData.Msg, groupData.Data));
 
         }
-        
+
         /// <summary>
         /// 上传文件(邮件截图)
         /// </summary>
@@ -1794,7 +1795,7 @@ Inner Join Sys_Department as d With(Nolock) On u.DepId=d.Id Where m.Id={0} ", _m
         /// <returns></returns>
         [HttpPost]
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
-        public async Task<IActionResult> OfficialActivitiesUploadFiles([FromForm]OfficialActivitiesUploadFilesDto dto)
+        public async Task<IActionResult> OfficialActivitiesUploadFiles([FromForm] OfficialActivitiesUploadFilesDto dto)
         {
             string networkPath = AppSettingsHelper.Get("GrpFileBaseUrl");
             string localPath = AppSettingsHelper.Get("GrpFileBasePath");
@@ -1816,14 +1817,14 @@ Inner Join Sys_Department as d With(Nolock) On u.DepId=d.Id Where m.Id={0} ", _m
                 //文件名称
                 string[] fileNameArray = file.FileName.Split(".");
 
-                string projectFileName = $"{fileNameArray[0].ToString().Replace("-","_").Replace("/", "_")}{DateTime.UtcNow.ToString("yyyyMMddHHmmss")}.{fileNameArray[1].ToString()}";
+                string projectFileName = $"{fileNameArray[0].ToString().Replace("-", "_").Replace("/", "_")}{DateTime.UtcNow.ToString("yyyyMMddHHmmss")}.{fileNameArray[1].ToString()}";
                 //上传的文件的路径
                 string filePath = $@"{localPath}公务相关文件";
                 if (!Directory.Exists(filePath))
                 {
                     Directory.CreateDirectory(filePath);
                 }
-                
+
                 var path = Path.Combine(filePath, projectFileName);
                 //using var stream = new FileStream(path, FileMode.Create);
                 //await file.CopyToAsync(stream);
@@ -1868,7 +1869,7 @@ Inner Join Sys_Department as d With(Nolock) On u.DepId=d.Id Where m.Id={0} ", _m
             {
 
                 var oldFiles = string.IsNullOrEmpty(oaInfo.ScreenshotOfMailUrl)
-                               ? new List<string>() 
+                               ? new List<string>()
                                : JsonConvert.DeserializeObject<List<string>>(oaInfo.ScreenshotOfMailUrl);
 
                 if (oldFiles.Count > 0)
@@ -1878,7 +1879,7 @@ Inner Join Sys_Department as d With(Nolock) On u.DepId=d.Id Where m.Id={0} ", _m
 
                 fileUrls = fileUrls.Distinct().ToList();
 
-                if (fileUrls.Count()>0)
+                if (fileUrls.Count() > 0)
                 {
                     var upd = await _sqlSugar.Updateable<Res_OfficialActivities>()
                                           .SetColumns(x => x.ScreenshotOfMailUrl == JsonConvert.SerializeObject(fileUrls))
@@ -1890,9 +1891,10 @@ Inner Join Sys_Department as d With(Nolock) On u.DepId=d.Id Where m.Id={0} ", _m
             }
 
             List<string> returnFileUrls = new List<string>();
-            fileUrls.ForEach(x => {
+            fileUrls.ForEach(x =>
+            {
 
-                returnFileUrls.Add( $"{networkPath}{x}");
+                returnFileUrls.Add($"{networkPath}{x}");
             });
 
             if (status)
@@ -1907,7 +1909,7 @@ Inner Join Sys_Department as d With(Nolock) On u.DepId=d.Id Where m.Id={0} ", _m
                     msg = msg.Substring(0, msg.Length - 1);
                     msg += "等文件保存失败!";
                 }
-                return Ok(JsonView(true, msg, new { id = dto.id, fileUrls = returnFileUrls } ));
+                return Ok(JsonView(true, msg, new { id = dto.id, fileUrls = returnFileUrls }));
             }
             return Ok(JsonView(false, "操作失败!"));
         }
@@ -1928,10 +1930,10 @@ Inner Join Sys_Department as d With(Nolock) On u.DepId=d.Id Where m.Id={0} ", _m
             {
                 return Ok(JsonView(false, "参数有误,上传失败!"));
             }
-            
+
             string localFileDir = $"{localPath}{ptfPath}";
             List<string> fileUrls = new List<string>();
-           
+
             var oaInfo = await _sqlSugar.Queryable<Res_OfficialActivities>().Where(x => x.Id == dto.Id).FirstAsync();
 
             if (oaInfo != null)
@@ -1978,7 +1980,7 @@ Inner Join Sys_Department as d With(Nolock) On u.DepId=d.Id Where m.Id={0} ", _m
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
         public async Task<IActionResult> OfficialActivitiesInviteOperation(OfficialActivitiesInviteOperationDto dto)
         {
-            if (dto.Id < 1 ) return Ok(JsonView(false, "Id参数有误!"));
+            if (dto.Id < 1) return Ok(JsonView(false, "Id参数有误!"));
             if (dto.Type < 0 || dto.Type > 1) return Ok(JsonView(false, "Type参数有误!"));
 
             var upd = await _sqlSugar.Updateable<Res_OfficialActivities>()
@@ -2073,7 +2075,7 @@ Inner Join Sys_Department as d With(Nolock) On u.DepId=d.Id Where m.Id={0} ", _m
                 {
                     return Ok(JsonView(false, "取消文件失败!"));
                 }
-                
+
             }
             catch (Exception ex)
             {
@@ -2118,7 +2120,7 @@ Inner Join Sys_Department as d With(Nolock) On u.DepId=d.Id Where m.Id={0} ", _m
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
         public async Task<IActionResult> PostOfficialActivitiesReqReqSampleTips(PostOfficialActivitiesReqReqSampleTipsDto dto)
         {
-            var res = await _officialActivitiesRep.PostReqReqSampleTips(dto.country, dto.area,dto.client);
+            var res = await _officialActivitiesRep.PostReqReqSampleTips(dto.country, dto.area, dto.client);
             if (res.Code == 0)
             {
                 return Ok(JsonView(true, "操作成功!", res.Data));
@@ -2138,7 +2140,7 @@ Inner Join Sys_Department as d With(Nolock) On u.DepId=d.Id Where m.Id={0} ", _m
             #region 参数验证
 
             if (dto.FileType < 1 || dto.FileType > 2) return Ok(JsonView(false, "请传入有效的FileType参数. 1 省外办出访请示 2 市外办出访请示", ""));
-            if (dto.DiId < 1) return Ok(JsonView(false, "请传入有效的DiId参数.",""));
+            if (dto.DiId < 1) return Ok(JsonView(false, "请传入有效的DiId参数.", ""));
 
             #endregion
             //团组基础信息
@@ -2219,12 +2221,12 @@ Inner Join Sys_Department as d With(Nolock) On u.DepId=d.Id Where m.Id={0} ", _m
                     guestInfoStr = $@"{guestJob}、{guestName}";
                 }
                 guestInfoStr = guestInfoStr ?? "[接团客户名单未录入]";
-                string askTitle = $@"关于{guestInfoStr }等{visitPeopleNum}人赴{visitCountrys}进行{groupInfo.VisitPurpose}的请示";
+                string askTitle = $@"关于{guestInfoStr}等{visitPeopleNum}人赴{visitCountrys}进行{groupInfo.VisitPurpose}的请示";
                 dic.Add("AskTitle", askTitle);
 
                 //应×××(邀请方名称+邀请人职务和姓名)的邀请,我单位拟派×××(职务、姓名)等×人(人数)于×××年×××月×××日赴×××(国家或地区)进行×××(出访目的)。现请示如下。
                 string visitDateStr = @$"{groupInfo.VisitDate.Year}年{groupInfo.VisitDate.Month}月{groupInfo.VisitDate.Day}日";
-               
+
                 string askSubTitle = $@"应{obInfoStr}的邀请,我单位拟派{guestInfoStr}等{visitPeopleNum}人于{visitDateStr}赴{visitCountrys}进行{groupInfo.VisitPurpose}。现请示如下。";
                 dic.Add("AskSubTitle", askSubTitle);
 
@@ -2283,7 +2285,7 @@ Inner Join Sys_Department as d With(Nolock) On u.DepId=d.Id Where m.Id={0} ", _m
 
                 //出访路线
                 //成都—××(出境城市名称)—××(转机不出机场)—××(公务所在城市)……—××(入境城市名称)—成都。(例:成都—法兰克福<转机不出机场>—巴黎—巴塞罗那—阿姆斯特丹<转机不出机场>-成都)
-                
+
                 dic.Add("Line", lineStr);
 
                 //scheduling //行程安排
@@ -2306,7 +2308,7 @@ Inner Join Sys_Department as d With(Nolock) On u.DepId=d.Id Where m.Id={0} ", _m
                         schedulingStr += $"{item.Date}({item.WeekDay})\r\n{item.Trip}\r\n";
                     }
                 }
-                
+
 
                 #endregion
 
@@ -2382,7 +2384,7 @@ Inner Join Sys_Department as d With(Nolock) On u.DepId=d.Id Where m.Id={0} ", _m
 
                 //××(组团单位):接团客户信息团组
                 dic.Add("GroupClient", $"{groupInfo.ClientUnit}");
-                
+
                 dic.Add("GroupClient1", $"{groupInfo.ClientUnit}");
                 //关于××(职务、姓名)等×人赴××(国家或地区)进行×××(出访目的)的请示
                 string guestName = "";
@@ -2413,7 +2415,7 @@ Inner Join Sys_Department as d With(Nolock) On u.DepId=d.Id Where m.Id={0} ", _m
                  * 
                  */
 
-                string taskStr = string.Empty ;
+                string taskStr = string.Empty;
                 List<string> countrys = obDatas.Where(it => !string.IsNullOrEmpty(it.Country)).Select(it => it.Country).ToList();
                 int countryIndex = 1;
                 foreach (var item in countrys)
@@ -2509,12 +2511,12 @@ Inner Join Sys_Department as d With(Nolock) On u.DepId=d.Id Where m.Id={0} ", _m
                 }
 
                 var fileDir = AppSettingsHelper.Get("WordBasePath");
-                string fileName = $"{groupInfo.TeamName}市外办出访请示{DateTime.Now.ToString("yyyyMMddHHmmss")}.docx";
-                string filePath = fileDir + $@"OfficialActivities/{fileName}";
+                var fileName = $"{groupInfo.TeamName}市外办出访请示{DateTime.Now.ToString("yyyyMMddHHmmss")}.docx";
+                var filePath = fileDir + $@"OfficialActivities/{fileName}";
                 doc.Save(filePath);
 
-                string Url = $@"{AppSettingsHelper.Get("WordBaseUrl")}Office/Word/OfficialActivities/{fileName}";
-                return Ok(JsonView(true, "操作成功!", Url));
+                var url = $@"{AppSettingsHelper.Get("WordBaseUrl")}Office/Word/OfficialActivities/{fileName}";
+                return Ok(JsonView(true, "操作成功!", url));
             }
 
 
@@ -2579,7 +2581,7 @@ Inner Join Sys_Department as d With(Nolock) On u.DepId=d.Id Where m.Id={0} ", _m
             try
             {
                 Res_AskData _AskData = await _sqlSugar.Queryable<Res_AskData>().FirstAsync(a => a.IsDel == 0 && a.Id == dto.id);
-                if (_AskData==null)
+                if (_AskData == null)
                 {
                     return Ok(JsonView(true, "暂无数据!", _AskData));
                 }
@@ -2700,7 +2702,7 @@ Inner Join Sys_Department as d With(Nolock) On u.DepId=d.Id Where m.Id={0} ", _m
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
         public async Task<IActionResult> OpTicketBlackCode(OpTicketBlackCodeDto dto)
         {
-           
+
             Result groupData = await _ticketBlackCodeRep.OpTicketBlackCode(dto);
             if (groupData.Code != 0)
             {
@@ -2720,7 +2722,7 @@ Inner Join Sys_Department as d With(Nolock) On u.DepId=d.Id Where m.Id={0} ", _m
 
 
             return Ok(JsonView(true, groupData.Msg, groupData.Data));
-           
+
         }
 
         /// <summary>

+ 11 - 27
OASystem/OASystem.Api/Controllers/SmallFunController.cs

@@ -1,25 +1,9 @@
-using Microsoft.AspNetCore.Http;
-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.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
 {
@@ -119,7 +103,7 @@ namespace OASystem.API.Controllers
             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)
@@ -138,12 +122,12 @@ namespace OASystem.API.Controllers
 
             var translateData = await YouDaoApiTools.GetReTrans(dto.Txt, from, to);
 
-            if (translateData == null || translateData.Code != 0) 
+            if (translateData == null || translateData.Code != 0)
             {
                 return Ok(JsonView(false, translateData.Msg));
             }
 
-            return Ok(JsonView( new { translation = translateData.Data }));
+            return Ok(JsonView(new { translation = translateData.Data }));
         }
 
         #endregion
@@ -163,7 +147,7 @@ namespace OASystem.API.Controllers
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
         public async Task<IActionResult> GetGooglMapForeignAndTime(GoogleMapDirectionsDto dto)
         {
-            var data = await GoogleMapTools.GetForeignAndTime(dto.origin,dto.destination);
+            var data = await GoogleMapTools.GetForeignAndTime(dto.origin, dto.destination);
 
             if (data == null || data.Code != 0)
             {
@@ -186,9 +170,9 @@ namespace OASystem.API.Controllers
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
         public async Task<IActionResult> ChatGptCompletions(CompletionsDto dto)
         {
-            if (string.IsNullOrEmpty(dto.Prompt)) 
+            if (string.IsNullOrEmpty(dto.Prompt))
             {
-                return Ok(JsonView(false,"待自动补全的文本为空!"));
+                return Ok(JsonView(false, "待自动补全的文本为空!"));
             }
 
             //Stopwatch sw = new Stopwatch();
@@ -196,13 +180,13 @@ namespace OASystem.API.Controllers
             //Thread.Sleep(999);
             //Console.WriteLine($"程序耗时:{sw.ElapsedMilliseconds}ms.");
 
-           // var data = await ChatGPTTools.Completions(dto.Prompt);
+            // 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(false, data.Msg ));
+            // return Ok(JsonView(false, data.Msg+"【耗时:"+ sw.ElapsedMilliseconds/1000+ "ms】"));
+            //return Ok(JsonView(false, data.Msg ));
             //}
             string msg = @"前言
 人工智能领域的发展历程已经为我们带来了很多尖端技术,例如深度学习、自然语言处理等等。其中,GPT(Generative Pre-training Transformer)是一种基于Transformer架构的预训练语言模型,已经在语音识别、机器翻译、语言生成等领域得到广泛应用。本文将从GPT的基本原理、GPT的优缺点、GPT的应用等多个方面来展开探讨。
@@ -226,7 +210,7 @@ GPT的应用最为广泛的领域之一就是自然语言处理。例如,它
 GPT可以用于构建问答系统,其基本原理是通过学习训练数据中的问题和答案,将问题转换为特定领域的答案。当输入一个问题时,GPT可以预测出最有可能的答案,从而提高问答系统的质量。
 4、语音识别
 GPT也可以用于语音识别,其原理与文本生成类似。使用GPT进行语音识别的一个好处是可以进行语音到文本的转化,从而将语音转化为可观看的文本内容。";
-            return Ok(JsonView(200,  " ", msg));
+            return Ok(JsonView(200, " ", msg));
         }
 
 

+ 47 - 38
OASystem/OASystem.Api/Controllers/StatisticsController.cs

@@ -1,5 +1,4 @@
 using Aspose.Cells;
-using NPOI.OpenXmlFormats.Dml.Diagram;
 using OASystem.API.OAMethodLib;
 using OASystem.Domain.Dtos.Statistics;
 using OASystem.Domain.Entities.Customer;
@@ -7,10 +6,7 @@ using OASystem.Domain.Entities.Groups;
 using OASystem.Domain.ViewModels.Financial;
 using OASystem.Domain.ViewModels.Statistics;
 using OASystem.Infrastructure.Repositories.Groups;
-using OfficeOpenXml.Drawing;
 using System.Data;
-using System.Linq;
-using System.Security.Cryptography.Xml;
 using static OASystem.API.OAMethodLib.GeneralMethod;
 using TypeInfo = OASystem.Domain.ViewModels.Statistics.TypeInfo;
 
@@ -225,14 +221,14 @@ namespace OASystem.API.Controllers
                 List<Gsd_ProceedsReceivedView> _prViews = await _sqlSugar.SqlQueryable<Gsd_ProceedsReceivedView>(_prSql).ToListAsync();
                 prTotalAmount = _prViews.Sum(it => it.Price);
                 _giView.ProceedsReceivedViews = _prViews;
-                _giView.ProceedsReceivedStr = string.Format(@$"应收合计:{frTotalAmount.ToString("#0.00")} CNY  已收款合计:{prTotalAmount.ConvertToDecimal1().ToString("#0.00")} CNY");
+                _giView.ProceedsReceivedStr = string.Format(@$"应收合计:{frTotalAmount:#0.00} CNY  已收款合计:{prTotalAmount.ConvertToDecimal1():#0.00} CNY");
 
 
                 /*
                  * 超支费用 
                  */
                 decimal exTotalAmount = 0.00M;
-                string _ecSql = string.Format(@"Select gec.Id As GECId,gec.DiId As GECDiId,gec.PriceName,(gec.PriceSum * gec.Coefficient) As PayMoney,sd1.Name As PaymentCurrency,
+                string ecSql = string.Format(@"Select gec.Id As GECId,gec.DiId As GECDiId,gec.PriceName,(gec.PriceSum * gec.Coefficient) As PayMoney,sd1.Name As PaymentCurrency,
 													   (gec.PriceSum * gec.Coefficient * ccp.DayRate) As CNYPrice,ccp.DayRate,ccp.Payee,ccp.OrbitalPrivateTransfer,sd2.Name As PayWay,
 													   sd3.Name As CardType,ccp.IsPay,u.CnName As Applicant,gec.CreateTime
 												From OA2023DB.dbo.Fin_GroupExtraCost gec
@@ -243,7 +239,7 @@ namespace OASystem.API.Controllers
                                                 Left Join Sys_Users u On ccp.CreateUserId = u.Id
 												Where ccp.IsDel = 0 And ccp.CTable = 1015 {1} And ccp.DiId = {0} Order By CreateTime", _dto.DiId, _dto.isAudit ? "And ccp.IsAuditGM = 1 And ccp.IsPay = 1 " : " ");
 
-                List<Gsd_ExtraCostsView> _ExtraCostsViews = await _sqlSugar.SqlQueryable<Gsd_ExtraCostsView>(_ecSql).ToListAsync();
+                List<Gsd_ExtraCostsView> _ExtraCostsViews = await _sqlSugar.SqlQueryable<Gsd_ExtraCostsView>(ecSql).ToListAsync();
 
                 #region 超支费用 - 模拟数据
 
@@ -878,7 +874,7 @@ ORDER BY
                         }
                         decimal jjcPeopleNum = airJJCPris.GroupBy(item => item.CnName)
                                                       .Select(group => group.First())
-                                                      .ToList().Count(); ;
+                                                      .ToList().Count;
                         JJCAveragePrice = jjcTotalPrice / jjcPeopleNum;
                     }
 
@@ -893,7 +889,7 @@ ORDER BY
                         }
                         decimal gwcPeopleNum = airGWCPris.GroupBy(item => item.CnName)
                                                       .Select(group => group.First())
-                                                      .ToList().Count();
+                                                      .ToList().Count;
                         GWCAveragePrice = gwcTotalPrice / gwcPeopleNum;
                     }
                 }
@@ -2420,7 +2416,8 @@ FROM
 
             if (lastSales != 0 && thisSales != 0) yoy = (thisSales - lastSales) / lastSales;
 
-            return new SalesYOYView() {
+            return new SalesYOYView()
+            {
                 thisYearSales = thisSales.ToString("#0.00"),
                 lastYearSales = lastSales.ToString("#0.00"),
                 yoy = yoy.ToString("#0.00")
@@ -2651,7 +2648,8 @@ And VisitDate Between '{beginDt}' And  '{endDt}'
 Group By [Name]
 Order By Count Desc");
                 var clientGradeData = await _sqlSugar.SqlQueryable<MarketingSalesGroupStatisticsView>(sql2).ToListAsync();
-                return Ok(JsonView(true, "操作成功!", new {
+                return Ok(JsonView(true, "操作成功!", new
+                {
                     customerTypeData = customerTypeData,
                     clientGradeData = clientGradeData
                 }));
@@ -2704,7 +2702,8 @@ Order By Count Desc");
             if (userIds.Count > 0)
             {
                 userSql = string.Format(@$" AND JietuanOperator IN ({string.Join(",", userIds)})");
-            } else return Ok(JsonView(true, "操作成功!", new List<object> { }, 0));
+            }
+            else return Ok(JsonView(true, "操作成功!", new List<object> { }, 0));
 
             string sql = string.Format(@$"Select 
 	ROW_NUMBER() Over(Order By Count(*) Desc) As RowNumber,
@@ -2867,7 +2866,8 @@ Order By Count Desc");
 
             #endregion
 
-            var viewData = new {
+            var viewData = new
+            {
                 groupData = groupData,
                 groupTotal = total,
                 customerTypeData = customerTypeData,
@@ -3130,13 +3130,13 @@ Order By Count Desc");
                 DateTime _beginDt = Convert.ToDateTime($"{_dto.BeginDt} 00:00:00"),
                          _endDt = Convert.ToDateTime($"{_dto.EndDt} 23:59:59");
 
-                string sqlWhere = string.Format(@" And dfp.CreateTime Between '{0}' And '{1}'", _beginDt, _endDt);
+                var sqlWhere = string.Format(@" And dfp.CreateTime Between '{0}' And '{1}'", _beginDt, _endDt);
 
                 var dailypaymentTypeData = await RedisRepository.RedisFactory
                                                                 .CreateRedisRepository()
                                                                 .StringGetAsync<List<int>>("DailypaymentTypeData") ?? new List<int>();
 
-                string sql = string.Format(@"
+                var sql = string.Format(@"
 Select 
 	dfp.Id,
 	dfp.Instructions,
@@ -3159,7 +3159,7 @@ Left Join Sys_SetData sd1 On dfp.TransferTypeId = sd1.Id
 Left Join Sys_Company c On dfp.CompanyId = c.Id
 Left Join Sys_SetData sd2 On dfp.PriceTypeId = sd2.Id
 Where dfp.IsDel = 0 And dfp.IsPay = 1
-", sqlWhere);//--Order By dfp.CreateTime Desc
+");//--Order By dfp.CreateTime Desc
 
 
                 if (_dto.Type == 1) //data
@@ -3213,7 +3213,7 @@ Where dfp.IsDel = 0 And dfp.IsPay = 1
                         int index = 1;
                         foreach (var item in x.Contents)
                         {
-                            string str1 = $"{index}、费用名称:[{item.PriceName}]   单价:[{item.Price.ToString("#0.00")}]   数量:[{item.Quantity.ToString("#0.00")}]   小计:[{item.ItemTotal.ToString("#0.00")}]   备注:[{item.Remark}]";
+                            string str1 = $"{index}、费用名称:[{item.PriceName}]   单价:[{item.Price:#0.00}]   数量:[{item.Quantity:#0.00}]   小计:[{item.ItemTotal:#0.00}]   备注:[{item.Remark}]";
 
                             if (index == x.Contents.Count) str += str1;
                             else str += str1 + "\r\n";
@@ -3556,7 +3556,8 @@ WHERE
             var groupNames = await _sqlSugar.Queryable<Grp_DelegationInfo>().Where(x => groupIds.Contains(x.Id)).Select(x => new { Id = x.Id, GroupName = x.TeamName }).ToListAsync();
 
 
-            data.ForEach(x => {
+            data.ForEach(x =>
+            {
                 string cityName = "";
                 if (!string.IsNullOrEmpty(x.FlightsCity))
                 {
@@ -3575,11 +3576,11 @@ WHERE
                             {
                                 if (i == cityNum - 1)
                                 {
-                                    cityName += threeCodeData.Find(x => x.Three.Equals(code))?.City ?? "";
+                                    cityName += threeCodeData.Find(x1 => x1.Three.Equals(code))?.City ?? "";
                                 }
                                 else
                                 {
-                                    string str1 = threeCodeData.Find(x => x.Three.Equals(code))?.City ?? "";
+                                    var str1 = threeCodeData.Find(x1 => x1.Three.Equals(code))?.City ?? "";
                                     cityName += str1 + "、";
                                 }
                             }
@@ -3747,7 +3748,8 @@ ORDER BY
                                                 city = g.Key,
                                                 BookingRoomNum = g.Sum(x => x.RoomTotal),
                                                 hotelData = g.GroupBy(x => x.HotelName)
-                                                             .Select(g1 => new {
+                                                             .Select(g1 => new
+                                                             {
                                                                  hotelName = g1.Key,
                                                                  roomNights = g1.Sum(x => x.RoomNights),
                                                                  roomTotal = g1.Sum(x => x.RoomTotal),
@@ -3897,7 +3899,8 @@ WHERE
             var groupInfos1 = groupInfos.GroupBy(x => x.ClientName);
 
             var view = groupInfos1.Select(x =>
-                                            new {
+                                            new
+                                            {
                                                 clienName = x.Key,
                                                 clientUnit = x.FirstOrDefault()?.ClientUnit ?? "",
                                                 visitsNum = x.Count()
@@ -3932,7 +3935,8 @@ WHERE
                                             .LeftJoin<Sys_SetData>((di, sd) => di.TeamDid == sd.Id)
                                             .Where((di, sd) => di.IsDel == 0)
                                             .Where((di, sd) => di.VisitDate >= _beginDt && di.VisitDate <= _endDt)
-                                            .Select((di, sd) => new {
+                                            .Select((di, sd) => new
+                                            {
                                                 Id = di.Id,
                                                 GroupTypeId = di.TeamDid,
                                                 GroupTypeName = sd.Name,
@@ -3943,7 +3947,8 @@ WHERE
             var groupInfos1 = groupInfos.GroupBy(x => x.GroupTypeName);
 
             var view = groupInfos1.Select(x =>
-                                            new {
+                                            new
+                                            {
                                                 groupTypeName = x.Key,
                                                 groupNum = x.Count(),
                                                 linkGroupId = x.Select(x1 => x1.Id).ToList()
@@ -3997,7 +4002,8 @@ WHERE
                 linkGroupIds = groupInfos.Select(x => x.Id).ToList()
             };
             var groupNumData = groupInfos.GroupBy(x => x.Quarter)
-                                         .Select(x => new {
+                                         .Select(x => new
+                                         {
                                              Quarter = x.Key,
                                              QuarterName = x.FirstOrDefault()?.QuarterName ?? "-",
                                              Num = x.Count(),
@@ -4011,7 +4017,8 @@ WHERE
             });
 
             var groupNumMonthData = groupInfos.GroupBy(x => x.Month)
-                                         .Select(x => new {
+                                         .Select(x => new
+                                         {
                                              Month = x.Key,
                                              MonthName = x.FirstOrDefault()?.MonthName ?? "-",
                                              Num = x.Count(),
@@ -4070,7 +4077,8 @@ WHERE
                 linkGroupIds = groupInfos.Select(x => x.Id).ToList()
             };
             var groupPeopleNumData = groupInfos.GroupBy(x => x.Quarter)
-                                               .Select(x => new {
+                                               .Select(x => new
+                                               {
                                                    Quarter = x.Key,
                                                    QuarterName = x.FirstOrDefault()?.QuarterName ?? "-",
                                                    Num = x.Sum(x1 => x1.VisitPNumber),
@@ -4084,7 +4092,8 @@ WHERE
             });
 
             var groupPeopleNumMonthData = groupInfos.GroupBy(x => x.Month)
-                                                    .Select(x => new {
+                                                    .Select(x => new
+                                                    {
                                                         Month = x.Key,
                                                         MonthName = x.FirstOrDefault()?.MonthName ?? "-",
                                                         Num = x.Sum(x1 => x1.VisitPNumber),
@@ -4119,7 +4128,7 @@ WHERE
             int thisYear = _dto.Year, lastYear = _dto.Year - 1;
             string beginDt = $"{lastYear}-01-01 00:00:00",
                    endDt = $"{thisYear}-12-31 23:59:59";
-           
+
 
 
             string sql = string.Format(@"
@@ -4180,7 +4189,7 @@ ORDER BY
   temp.[Year],
   temp.[Quarter],
   temp.[Month]
-", beginDt,endDt);
+", beginDt, endDt);
 
             var opInfos = await _sqlSugar.SqlQueryable<StatisticsOP>(sql).ToListAsync();
 
@@ -4189,11 +4198,11 @@ ORDER BY
 
             for (int i = 0; i < opInfos.Count; i++)
             {
-                string country = string.Empty,city =string.Empty;
+                string country = string.Empty, city = string.Empty;
 
                 int dataId = 0;
                 bool isCountryId = int.TryParse(opInfos[i].Area, out dataId);
-                string[] citySelecter = new string[] {"其他城市","所有城市" };
+                string[] citySelecter = new string[] { "其他城市", "所有城市" };
                 if (isCountryId)
                 {
                     var countryInfo = countrys.Find(x => x.Id == dataId);
@@ -4263,13 +4272,13 @@ ORDER BY
                                                                                                         samePeriodFee: x2.Where(x2 => x2.Year == lastYear).Sum(x2 => x2.Price)
                                                                                               ))
                                                                                           .ToArray()
-                                                                    ))        
+                                                                    ))
                                                                 .ToArray()
                                              ))
                                       .OrderBy(x => x.FeeId)
                                       .ToList();
 
-                
+
                 var opParentYearIds = yearData.Select(x => x.FeeId).ToList();
                 var opParentYearDataSelector = opParentFeeData.Where(x => !opParentYearIds.Contains(x.Id)).ToList();
 
@@ -4297,15 +4306,15 @@ ORDER BY
                                        .Select(x => new StatisticsOPMonthYOY(
                                                monthId: x.Key,
                                                monthName: Enum.IsDefined(typeof(MonthEnum), (int)x.Key) ? ((MonthEnum)(int)x.Key).GetEnumDescription() : "",
-                                               feeDatas:x.GroupBy(x1 => x1.ParentFeeId)
+                                               feeDatas: x.GroupBy(x1 => x1.ParentFeeId)
                                                          .Select(x1 => new StatisticsOPYOY(
-                                                                       feeId:x1.Key,
+                                                                       feeId: x1.Key,
                                                                        feeName: x1.FirstOrDefault()?.ParentFeeName ?? "",
                                                                        currPeriodFee: x1.Where(x1 => x1.Year == thisYear).Sum(x1 => x1.Price),
                                                                        samePeriodFee: x1.Where(x1 => x1.Year == lastYear).Sum(x1 => x1.Price),
                                                                        currPeriodGroupTotal: x1.Where(x1 => x1.Year == thisYear).Select(x1 => x1.DiId).Distinct().Count(),
                                                                        samePeriodGroupTotal: x1.Where(x1 => x1.Year == lastYear).Select(x1 => x1.DiId).Distinct().Count(),
-                                                                       subFeeData:x1.GroupBy(x2 => x2.FeeSubType)
+                                                                       subFeeData: x1.GroupBy(x2 => x2.FeeSubType)
                                                                                     .Select(x2 => new StatisticsOPSubFeeYOY(
                                                                                                   feeId: x2.Key,
                                                                                                   feeName: x2.FirstOrDefault()?.FeeSubTypeName ?? "",
@@ -4331,7 +4340,7 @@ ORDER BY
                                        //.OrderBy(x => x.MonthId)
                                        .ToList();
                 //1、月份是否足够十二月
-                var monthIds = new int[] {1,2,3,4,5,6,7,8,9,10,11,12 };
+                var monthIds = new int[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 };
                 var monthDataIds = monthData.Select(x => x.MonthId).ToArray();
                 var newMonthIds = monthIds.Where(x => !monthDataIds.Contains(x)).ToList();
                 if (newMonthIds.Count > 0)

+ 9 - 10
OASystem/OASystem.Api/Controllers/SystemController.cs

@@ -1,4 +1,3 @@
-using NPOI.SS.Formula.Functions;
 using System.Collections;
 using static OASystem.API.OAMethodLib.GeneralMethod;
 
@@ -356,13 +355,13 @@ namespace OASystem.API.Controllers
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
         public IActionResult QuerySetDataInitByArr(QuerySetDataInitByArr Dto)
         {
-           var DbQuery = _setDataRepository.QueryDto<Sys_SetData, SetDataView>(s => Dto.DataTypeArr.Contains(s.STid)).ToList();
-           var GroupResult =  DbQuery.GroupBy(x => x.STid).Select(x => new
-           {
-               key = x.Key,
-               Arr = x.ToList()
-           });
-           return Ok(JsonView(true, "查询成功!", GroupResult ));
+            var DbQuery = _setDataRepository.QueryDto<Sys_SetData, SetDataView>(s => Dto.DataTypeArr.Contains(s.STid)).ToList();
+            var GroupResult = DbQuery.GroupBy(x => x.STid).Select(x => new
+            {
+                key = x.Key,
+                Arr = x.ToList()
+            });
+            return Ok(JsonView(true, "查询成功!", GroupResult));
         }
 
         /// <summary>
@@ -1154,7 +1153,7 @@ namespace OASystem.API.Controllers
         {
 
             if (dto.Id < 1) return Ok(JsonView(false, "请选择有效的userId!"));
-            if (dto.PortType<1 || dto.PortType>3) return Ok(JsonView(false, MsgTips.Port));
+            if (dto.PortType < 1 || dto.PortType > 3) return Ok(JsonView(false, MsgTips.Port));
 
             var _view = await _sqlSugar.Queryable<Sys_Users>()
                                        .Where(x => x.IsDel == 0 && x.Id == dto.Id)
@@ -1250,7 +1249,7 @@ namespace OASystem.API.Controllers
                                      .ExecuteCommandAsync();
             if (res > 0) return Ok(JsonView(true, "操作成功!"));
 
-            return Ok(JsonView(false,"操作失败!"));
+            return Ok(JsonView(false, "操作失败!"));
         }
 
 

+ 32 - 36
OASystem/OASystem.Api/Controllers/TencentOCRController.cs

@@ -1,22 +1,13 @@
-using Aspose.Cells;
-using Aspose.Words;
-using FluentValidation;
-using Microsoft.EntityFrameworkCore.Internal;
-using Microsoft.IdentityModel.Tokens;
-using NPOI.OpenXmlFormats.Wordprocessing;
-using NPOI.XWPF.UserModel;
+using NPOI.XWPF.UserModel;
 using OASystem.API.OAMethodLib.File;
 using OASystem.API.OAMethodLib.TencentCloudAPI;
 using OASystem.API.OAMethodLib.YouDaoAPI;
 using OASystem.Domain.Dtos.CRM;
 using OASystem.Domain.Dtos.Tencent;
 using OASystem.Domain.ViewModels.OCR;
-using OASystem.Domain.ViewModels.QiYeWeChat;
 using OASystem.Domain.ViewModels.TencentOCR;
 using OASystem.Infrastructure.Repositories.CRM;
-using System.Text;
 using TencentCloud.Ocr.V20181119.Models;
-using Document = NPOI.XWPF.UserModel.Document;
 
 namespace OASystem.API.Controllers
 {
@@ -47,8 +38,8 @@ namespace OASystem.API.Controllers
         public async Task<IActionResult> GetGeneralBasic(GeneralBasicOCRDto dto)
         {
             var validator = new GeneralBasicOCRDtoFoalidator();
-            var validatorRes =  await validator.ValidateAsync(dto);
-            if (!validatorRes.IsValid) 
+            var validatorRes = await validator.ValidateAsync(dto);
+            if (!validatorRes.IsValid)
             {
                 var errors = new StringBuilder();
                 foreach (var valid in validatorRes.Errors)
@@ -151,7 +142,7 @@ namespace OASystem.API.Controllers
             }
             else if (dto.Language == 2)
             {
-                iDCardOCRView.Name = !string.IsNullOrEmpty( idCardData.Data.Name) ? await YouDaoApiTools.GetOCR_ReTrans(idCardData.Data.Name) : "";
+                iDCardOCRView.Name = !string.IsNullOrEmpty(idCardData.Data.Name) ? await YouDaoApiTools.GetOCR_ReTrans(idCardData.Data.Name) : "";
                 iDCardOCRView.Sex = !string.IsNullOrEmpty(idCardData.Data.Sex) ? await YouDaoApiTools.GetOCR_ReTrans(idCardData.Data.Sex) : "";
                 iDCardOCRView.Nation = !string.IsNullOrEmpty(idCardData.Data.Nation) ? await YouDaoApiTools.GetOCR_ReTrans(idCardData.Data.Nation) : "";
                 iDCardOCRView.Birth = !string.IsNullOrEmpty(idCardData.Data.Birth) ? await YouDaoApiTools.GetOCR_ReTrans(idCardData.Data.Birth) : "";
@@ -268,12 +259,13 @@ namespace OASystem.API.Controllers
             }
 
             if (dto.language == 1) { }
-            else if (dto.language == 2) {
+            else if (dto.language == 2)
+            {
                 fileName = "户口簿识别[EN]";
                 content = await YouDaoApiTools.GetOCR_ReTrans(content);
             }
 
-            setWrap(content,p, runText);
+            setWrap(content, p, runText);
 
             runText.FontSize = 12;
             runText.SetFontFamily("宋体", FontCharRange.None); //设置宋体字体
@@ -360,7 +352,7 @@ namespace OASystem.API.Controllers
             {
                 return ex.Message;
             }
-            
+
         }
 
         /// <summary>
@@ -375,7 +367,7 @@ namespace OASystem.API.Controllers
             {
                 //设置换行
                 String[] text = value.ToString().Split("\n");
-               
+
                 for (int f = 0; f < text.Length; f++)
                 {
                     XWPFRun run1 = paragraph.CreateRun();
@@ -387,7 +379,7 @@ namespace OASystem.API.Controllers
                     else
                     {
                         run1.AddCarriageReturn();//硬回车
-                                                //注意:wps换行首行缩进是三个空格符,office要的话可以用 run.addTab();缩进或者四个空格符
+                                                 //注意:wps换行首行缩进是三个空格符,office要的话可以用 run.addTab();缩进或者四个空格符
                         run1.SetText(text[f].Trim());
                     }
                 }
@@ -446,7 +438,7 @@ namespace OASystem.API.Controllers
                 content += $"成立日期:{dataInfo.SetDate}\n";
 
             }
-            
+
             if (dto.language == 2)
             {
                 fileName = "营业执照识别[EN]";
@@ -582,7 +574,8 @@ namespace OASystem.API.Controllers
                     content += $"印章:{frontInfo.Seal ?? "Unknown"}\n";
                 }
 
-                if (dto.language == 2) {
+                if (dto.language == 2)
+                {
                     fileName = "行驶证识别-主页[EN]";
                     content = await YouDaoApiTools.GetOCR_ReTrans(content);
                 }
@@ -609,11 +602,12 @@ namespace OASystem.API.Controllers
                     content += $"准牵引总质量:{backInfo.TotalQuasiMass ?? "Unknown"}\n";
                 }
 
-                if (dto.language == 2) {
-                    fileName = "行驶证识别-副页[EN]"; 
+                if (dto.language == 2)
+                {
+                    fileName = "行驶证识别-副页[EN]";
                     content = await YouDaoApiTools.GetOCR_ReTrans(content);
                 }
-                
+
 
                 url = NPOICreateWord(fileName, content);
             }
@@ -635,7 +629,7 @@ namespace OASystem.API.Controllers
             var validator = new PropOwnerCertOCRDtoFoalidator();
             var validatorRes = await validator.ValidateAsync(dto);
 
-            if (!validatorRes.IsValid) 
+            if (!validatorRes.IsValid)
             {
                 var errors = new StringBuilder();
                 foreach (var valid in validatorRes.Errors) errors.AppendLine(valid.ErrorMessage);
@@ -657,7 +651,8 @@ namespace OASystem.API.Controllers
             PropOwnerCertOCRResponse pocInfo = pcData.Data as PropOwnerCertOCRResponse;
             string fileName = "房产证识别[CH]";
             string content = "";
-            if (pocInfo != null) {
+            if (pocInfo != null)
+            {
                 content += $"房地产权利人:{pocInfo.Owner}\n";
                 content += $"共有情况:{pocInfo.Possession}\n";
                 content += $"登记时间:{pocInfo.RegisterTime}\n";
@@ -687,11 +682,11 @@ namespace OASystem.API.Controllers
         {
             var validator = new GeneralBasicOCRDtoFoalidator();
             var validatorRes = await validator.ValidateAsync(dto);
-            if (!validatorRes.IsValid) 
+            if (!validatorRes.IsValid)
             {
                 var errors = new StringBuilder();
                 foreach (var valid in validatorRes.Errors) errors.AppendLine(valid.ErrorMessage);
-                return Ok(JsonView(false,errors.ToString()));
+                return Ok(JsonView(false, errors.ToString()));
             }
 
             var mlData = await TencentOCRTools.GetOCR((int)TencentOCREnum.GeneralBasic, dto);
@@ -738,11 +733,11 @@ namespace OASystem.API.Controllers
         {
             var validator = new GeneralBasicOCRDtoFoalidator();
             var validatorRes = await validator.ValidateAsync(dto);
-            if (!validatorRes.IsValid) 
+            if (!validatorRes.IsValid)
             {
                 var errors = new StringBuilder();
-                foreach (var valid in validatorRes.Errors) errors.AppendLine( valid.ErrorMessage);
-                return Ok(JsonView(false,errors.ToString()));
+                foreach (var valid in validatorRes.Errors) errors.AppendLine(valid.ErrorMessage);
+                return Ok(JsonView(false, errors.ToString()));
             }
 
             var gbData = await TencentOCRTools.GetOCR((int)TencentOCREnum.GeneralBasic, dto);
@@ -828,7 +823,8 @@ namespace OASystem.API.Controllers
                 content += $"最下方第二行 MRZ Code 序列:{pInfo.CodeCrc ?? "Unknown"}\n";
             }
 
-            if (dto.language == 2) {
+            if (dto.language == 2)
+            {
                 fileName = "护照识别(中国大陆地区护照)[EN]";
                 content = await YouDaoApiTools.GetOCR_ReTrans(content);
             }
@@ -913,11 +909,11 @@ namespace OASystem.API.Controllers
         {
             var validator = new BusinessCardOCRDtoFoavalidator();
             var validatorRes = await validator.ValidateAsync(dto);
-            if (!validatorRes.IsValid) 
+            if (!validatorRes.IsValid)
             {
                 var errors = new StringBuilder();
                 foreach (var valid in validatorRes.Errors) errors.AppendLine(valid.ErrorMessage);
-                return Ok(JsonView(false,errors.ToString()));
+                return Ok(JsonView(false, errors.ToString()));
             }
 
             var mlidpData = await TencentOCRTools.GetOCR((int)TencentOCREnum.BusinessCard, dto);
@@ -974,9 +970,9 @@ namespace OASystem.API.Controllers
             if (!validatorRes.IsValid)
             {
                 var errors = new StringBuilder();
-                foreach(var valid in validatorRes.Errors) { errors.AppendLine(valid.ErrorMessage); }
+                foreach (var valid in validatorRes.Errors) { errors.AppendLine(valid.ErrorMessage); }
 
-                return Ok(JsonView(false,errors.ToString()));
+                return Ok(JsonView(false, errors.ToString()));
             }
 
             var ssData = await TencentOCRTools.GetOCR((int)TencentOCREnum.SmartStructuralOCRV2, dto);
@@ -999,7 +995,7 @@ namespace OASystem.API.Controllers
                 content += $"TypeName:{view.name}\nContent:{view.value}\n";
             }
 
-            if (dto.language == 2) 
+            if (dto.language == 2)
             {
                 fileName = "智能结构化识别V2[EN]";
                 content = await YouDaoApiTools.GetOCR_ReTrans(content);

+ 27 - 46
OASystem/OASystem.Api/GlobalUsings.cs

@@ -1,59 +1,40 @@
-global using Microsoft.OpenApi.Models;
-global using System.Text.RegularExpressions;
-global using Microsoft.AspNetCore.Authorization;
-global using Microsoft.AspNetCore.Mvc;
-global using Serilog;
-global using OASystem.Domain.Enums;
-global using SqlSugar;
-global using Autofac;
+global using Autofac;
 global using Autofac.Extensions.DependencyInjection;
-global using System.Reflection;
-global using OASystem.Domain.ViewModels;
-global using OASystem.Domain.Dtos;
-global using OASystem.Domain.Entities;
-global using OASystem.Infrastructure.Repositories;
 global using AutoMapper;
-global using Swashbuckle.AspNetCore.SwaggerGen;
 global using Microsoft.AspNetCore.Authentication.JwtBearer;
+global using Microsoft.AspNetCore.Authorization;
+global using Microsoft.AspNetCore.Mvc;
 global using Microsoft.IdentityModel.Tokens;
-global using OASystem.API;
-global using OASystem.Domain.AutoMappers;
-global using OASystem.Infrastructure.Tools;
-global using System.Text;
-global using Swashbuckle.AspNetCore.Swagger;
+global using Microsoft.OpenApi.Models;
 global using Newtonsoft.Json;
 global using Newtonsoft.Json.Linq;
-global using QRCoder;
-global using System.Drawing;
-global using System.Drawing.Drawing2D;
-global using System.Net;
-global using System.Security.Cryptography;
-global using Org.BouncyCastle.Asn1.GM;
-global using Org.BouncyCastle.Asn1.X9;
-global using Org.BouncyCastle.Crypto.Parameters;
-global using Org.BouncyCastle.Crypto;
-global using Org.BouncyCastle.Security;
-global using Org.BouncyCastle.Crypto.Engines;
-global using Org.BouncyCastle.Crypto.Digests;
-global using Org.BouncyCastle.Utilities;
-global using Org.BouncyCastle.Utilities.Encoders;
-global using Org.BouncyCastle.Crypto.Generators;
-global using Org.BouncyCastle.X509;
-global using Org.BouncyCastle.Math;
-global using Org.BouncyCastle.Asn1;
-global using System.IO;
-global using System.Drawing.Imaging;
-global using System;
-global using System.Collections.Generic;
-global using System.Linq;
+global using OASystem.API;
 global using OASystem.Domain;
-global using OASystem.Domain.Dtos.System;
-global using OASystem.Domain.Entities.System;
-global using OASystem.Domain.ViewModels.System;
-global using OASystem.Infrastructure.Repositories.System;
+global using OASystem.Domain.AutoMappers;
+global using OASystem.Domain.Dtos;
 global using OASystem.Domain.Dtos.Resource;
+global using OASystem.Domain.Dtos.System;
 global using OASystem.Domain.Entities.Resource;
+global using OASystem.Domain.Entities.System;
+global using OASystem.Domain.Enums;
+global using OASystem.Domain.ViewModels;
 global using OASystem.Domain.ViewModels.Resource;
+global using OASystem.Domain.ViewModels.System;
 global using OASystem.Infrastructure.Repositories.Resource;
+global using OASystem.Infrastructure.Repositories.System;
+global using OASystem.Infrastructure.Tools;
+global using Serilog;
+global using SqlSugar;
+global using Swashbuckle.AspNetCore.SwaggerGen;
+global using System;
+global using System.Collections.Generic;
+global using System.Drawing;
+global using System.Drawing.Imaging;
+global using System.IO;
+global using System.Linq;
+global using System.Reflection;
+global using System.Security.Cryptography;
+global using System.Text;
+global using System.Text.RegularExpressions;
 
 

+ 1 - 3
OASystem/OASystem.Api/Middlewares/ExceptionHandlingMiddleware.cs

@@ -1,6 +1,4 @@
-using Microsoft.AspNetCore.Http;
-
-namespace OASystem.API.Middlewares
+namespace OASystem.API.Middlewares
 {
     /// <summary>
     /// 全局异常捕获中间件

+ 1 - 1
OASystem/OASystem.Api/OAMethodLib/ALiYun/AliMessagePost.cs

@@ -28,7 +28,7 @@ namespace OASystem.API.OAMethodLib.ALiYun
             return new AlibabaCloud.SDK.Dysmsapi20170525.Client(config);
         }
 
-        public static string PostMessage(string phoneNumber, string signName,string templateCode,string templateParam)
+        public static string PostMessage(string phoneNumber, string signName, string templateCode, string templateParam)
         {
             // 请确保代码运行环境设置了环境变量 ALIBABA_CLOUD_ACCESS_KEY_ID 和 ALIBABA_CLOUD_ACCESS_KEY_SECRET。
             // 工程代码泄露可能会导致 AccessKey 泄露,并威胁账号下所有资源的安全性。以下代码示例使用环境变量获取 AccessKey 的方式进行调用,仅供参考,建议使用更安全的 STS 方式,更多鉴权访问方式请参见:https://help.aliyun.com/document_detail/378671.html

+ 3 - 3
OASystem/OASystem.Api/OAMethodLib/Auth/JWTBearer.cs

@@ -13,9 +13,9 @@ namespace OASystem.API.OAMethodLib.Auth
         public static string GenerateToken(HttpContext httpContext)
         {
             // 请求时传入的用户参数为NameIdentifier claim的值
-            var claims = new[] { 
-                new Claim(ClaimTypes.NameIdentifier, httpContext.Request.Query["user"]) 
-            
+            var claims = new[] {
+                new Claim(ClaimTypes.NameIdentifier, httpContext.Request.Query["user"])
+
             };
             // 签名凭据
             var credentials = new SigningCredentials(SecurityKey, SecurityAlgorithms.HmacSha256);

+ 3 - 4
OASystem/OASystem.Api/OAMethodLib/AutofacRegister.cs

@@ -1,6 +1,5 @@
-using Microsoft.Extensions.Configuration.Json;
+using OASystem.Domain.Dtos.Business;
 using OASystem.Domain.Dtos.Groups;
-using OASystem.Domain.Dtos.Business;
 
 namespace OASystem.API.OAMethodLib
 {
@@ -27,8 +26,8 @@ namespace OASystem.API.OAMethodLib
 
             #region 团组结束通知短信
             DeleReminderConfig _deleReminderConfig = new DeleReminderConfig();
-            _deleReminderConfig.Test= AppSettingsHelper.Get(DeleReminderConfig.KEY, "Test");
-            _deleReminderConfig.PhoneNumber= AppSettingsHelper.Get(DeleReminderConfig.KEY, "PhoneNumber");
+            _deleReminderConfig.Test = AppSettingsHelper.Get(DeleReminderConfig.KEY, "Test");
+            _deleReminderConfig.PhoneNumber = AppSettingsHelper.Get(DeleReminderConfig.KEY, "PhoneNumber");
             builder.RegisterInstance<DeleReminderConfig>(_deleReminderConfig);
             #endregion
 

+ 2 - 5
OASystem/OASystem.Api/OAMethodLib/BaiduApi/BaiduApiHelper.cs

@@ -1,7 +1,4 @@
-using MySql.Data.MySqlClient.Memcached;
-using Org.BouncyCastle.Asn1.Crmf;
-using RestSharp;
-using System.IO;
+using RestSharp;
 
 namespace OASystem.API.OAMethodLib.BaiduApi
 {
@@ -31,7 +28,7 @@ namespace OASystem.API.OAMethodLib.BaiduApi
         {
             var client = new RestClient($"https://aip.baidubce.com/oauth/2.0/token");
             //client.Timeout = -1;
-            var request = new RestRequest("",Method.POST);
+            var request = new RestRequest("", Method.POST);
             request.AddParameter("grant_type", "client_credentials");
             request.AddParameter("client_id", API_KEY);
             request.AddParameter("client_secret", SECRET_KEY);

+ 4 - 11
OASystem/OASystem.Api/OAMethodLib/ChatGPT/ChatGPTTools.cs

@@ -1,14 +1,7 @@
-using Microsoft.AspNetCore.Http;
-using OASystem.Domain;
+using OpenAI.GPT3;
 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;
+using OpenAI.GPT3.ObjectModels.RequestModels;
 
 namespace OASystem.API.OAMethodLib.ChatGPT
 {
@@ -36,7 +29,7 @@ namespace OASystem.API.OAMethodLib.ChatGPT
                 Prompt = prompt,     //提示(问题) 你向API提供的提示,即你提出的问题
                 Temperature = 0.3f,  //创新采样 取值范围0-1,当设置为0时,对于相同的问题,模型始终返回相同或者相近的结果,
                                      //设置1则与上次的回答更加不同。默认1
-                TopP =1f,            //默认1。替代temperature使用,考虑了模型质量,0.1为生成结果的质量为10%,建议使用1。
+                TopP = 1f,            //默认1。替代temperature使用,考虑了模型质量,0.1为生成结果的质量为10%,建议使用1。
                 N = 1,               //默认1。针对提示所生成结果的次数,会大量消耗令牌。
                 Stream = false,      //默认false。是否以流式返回部分进度,流完成后会发送终止消息data:[DONE]
                 Echo = false,        //默认false,在返回结果外,还显示用户给的问题
@@ -64,7 +57,7 @@ namespace OASystem.API.OAMethodLib.ChatGPT
             if (res.Successful)
             {
                 result.Code = 0;
-                result.Data =  new { Text = res.Choices.FirstOrDefault().Text };
+                result.Data = new { Text = res.Choices.FirstOrDefault().Text };
             }
             else result.Msg = "访问失败!";
 

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

@@ -3,7 +3,6 @@ using OASystem.Domain.Entities.Business;
 using OASystem.Domain.Entities.Groups;
 using OASystem.Domain.ViewModels.Business;
 using OASystem.Infrastructure.Repositories.Business;
-using StackExchange.Redis;
 using System.Web;
 
 namespace OASystem.API.OAMethodLib.ExcelOutput

+ 2 - 8
OASystem/OASystem.Api/OAMethodLib/File/AsposeHelper.cs

@@ -1,12 +1,6 @@
 using Aspose.Cells;
 using Aspose.Words;
-using Aspose.Words.Tables;
-using System.Collections;
-using System.Collections.Generic;
 using System.Data;
-using System.IO;
-using System.Web;
-using Ubiety.Dns.Core;
 
 namespace OASystem.API.OAMethodLib.File
 {
@@ -49,7 +43,7 @@ namespace OASystem.API.OAMethodLib.File
 
                 //// 解码字节序列为文本
                 //tempPath = Encoding.UTF8.GetString(encodedBytes);
-                
+
                 //载入模板
                 Document doc = new Document(tempPath);
                 doc.MailMerge.Execute(fieldNames.ToArray(), fieldValues.ToArray());
@@ -180,7 +174,7 @@ namespace OASystem.API.OAMethodLib.File
         /// Aspose.Words  去水印
         /// version 21.8.0
         /// </summary>
-        public static void removewatermark_v2180 ()
+        public static void removewatermark_v2180()
         {
             new Aspose.Words.License().SetLicense(new MemoryStream(Convert.FromBase64String(asposeKey)));
         }

+ 57 - 59
OASystem/OASystem.Api/OAMethodLib/GeneralMethod.cs

@@ -5,8 +5,6 @@ using Aspose.Words.Layout;
 using Aspose.Words.Saving;
 using Microsoft.AspNetCore.SignalR;
 using Microsoft.International.Converters.PinYinConverter;
-using Microsoft.VisualBasic;
-using NPOI.HSSF.Util;
 using OASystem.API.OAMethodLib.File;
 using OASystem.API.OAMethodLib.Hub.HubClients;
 using OASystem.API.OAMethodLib.Hub.Hubs;
@@ -14,7 +12,6 @@ using OASystem.API.OAMethodLib.JuHeAPI;
 using OASystem.API.OAMethodLib.SignalR.Hubs;
 using OASystem.Domain.Dtos.Groups;
 using OASystem.Domain.Entities.Customer;
-using OASystem.Domain.Entities.District;
 using OASystem.Domain.Entities.Financial;
 using OASystem.Domain.Entities.Groups;
 using OASystem.Domain.ViewModels.Financial;
@@ -24,10 +21,7 @@ using OASystem.Infrastructure.Repositories.CRM;
 using OASystem.Infrastructure.Repositories.Groups;
 using System.Data;
 using System.IdentityModel.Tokens.Jwt;
-using System.IO.Compression;
 using System.Security.Claims;
-using System.Web;
-using static OpenAI.GPT3.ObjectModels.SharedModels.IOpenAiModels;
 
 namespace OASystem.API.OAMethodLib
 {
@@ -102,7 +96,8 @@ namespace OASystem.API.OAMethodLib
                 //页面操作权限数据(添加修改等...)
                 var pageFunctionData = _dirRep._sqlSugar.Queryable<Sys_SystemMenuAndFunction>().Where(it => pageData.Contains(it.SmId) && it.IsDel == 0).ToList();
 
-                var defaultPageData = pageFunctionData.Select(it => new Sys_UserAuthority() {
+                var defaultPageData = pageFunctionData.Select(it => new Sys_UserAuthority()
+                {
                     UId = userId,
                     SmId = it.SmId,
                     FId = it.FId,
@@ -171,10 +166,10 @@ namespace OASystem.API.OAMethodLib
             if (status)
             {
                 //给在线在用户发送消息
-                List<string> connIds = UserStore.OnlineUser.Where(it => userIds.Contains(it.UserId)).Select(it => it.ConnectionId).ToList();
+                var connIds = UserStore.OnlineUser.Where(it => userIds.Contains(it.UserId)).Select(it => it.ConnectionId).ToList();
 
-                string notificationTypeStr1 = GetMsgNotificationType(msgTypeEnum);
-                string notificationTypeStr = JsonConvert.SerializeObject(
+                var notificationTypeStr1 = GetMsgNotificationType(msgTypeEnum);
+                var notificationTypeStr = JsonConvert.SerializeObject(
                        new
                        {
                            UserIds = userIds,
@@ -281,8 +276,8 @@ namespace OASystem.API.OAMethodLib
                 expires: exp,
                 signingCredentials: creds);
 
-            var indentity = new ClaimsIdentity(claims, "formlogin");
-            var principal = new ClaimsPrincipal(indentity);
+            var identity = new ClaimsIdentity(claims, "login");
+            var principal = new ClaimsPrincipal(identity);
 
             // await _httpContext.SignInAsync (CookieAuthenticationDefaults.AuthenticationScheme, principal);
 
@@ -306,15 +301,15 @@ namespace OASystem.API.OAMethodLib
         {
             if (obj == null)
                 return 0;
-            int _number = 0;
-            bool reslut = Int32.TryParse(obj.ToString(), out _number);
-            return _number;
+            var number = 0;
+            var reslut = Int32.TryParse(obj.ToString(), out number);
+            return number;
 
         }
 
-        private static DateTime dateStart = new DateTime(1970, 1, 1, 8, 0, 0);
-        private static long longTime = 621355968000000000;
-        private static int samllTime = 10000000;
+        private static DateTime _dateStart = new DateTime(1970, 1, 1, 8, 0, 0);
+        private static long _longTime = 621355968000000000;
+        private static int _samllTime = 10000000;
 
         /// <summary>
         /// 时间戳 转 datetime
@@ -323,8 +318,8 @@ namespace OASystem.API.OAMethodLib
         /// <returns></returns>
         public static DateTime GetTimeSpmpToDate(this object timeStamp)
         {
-            if (timeStamp == null) return dateStart;
-            DateTime dateTime = new DateTime(longTime + Convert.ToInt64(timeStamp) * samllTime, DateTimeKind.Utc).ToLocalTime();
+            if (timeStamp == null) return _dateStart;
+            DateTime dateTime = new DateTime(_longTime + Convert.ToInt64(timeStamp) * _samllTime, DateTimeKind.Utc).ToLocalTime();
             return dateTime;
         }
 
@@ -599,7 +594,8 @@ namespace OASystem.API.OAMethodLib
                                               .LeftJoin<Sys_Department>((su, sd) => su.DepId == sd.Id && sd.IsDel == 0)
                                               .LeftJoin<Sys_JobPost>((su, sd, sjp) => su.JobPostId == sjp.Id && sjp.IsDel == 0)
                                               .Where(su => su.IsDel == 0)
-                                              .Select((su, sd, sjp) => new {
+                                              .Select((su, sd, sjp) => new
+                                              {
                                                   su.DepId,
                                                   sd.DepName,
                                                   su.JobPostId,
@@ -676,12 +672,12 @@ namespace OASystem.API.OAMethodLib
             //2024年8月26日16点27分 “邀请公务活动分配给王鸽(UserID:149)”
             _GroupsTaskAssignments.Add(
                  new Grp_GroupsTaskAssignment()
-                {
-                    DIId = diId,
-                    CTId = 81,
-                    UId = 149, 
-                    CreateUserId = userId
-                }
+                 {
+                     DIId = diId,
+                     CTId = 81,
+                     UId = 149,
+                     CreateUserId = userId
+                 }
             );
 
 
@@ -746,12 +742,12 @@ namespace OASystem.API.OAMethodLib
 
             //2024年8月26日16点27分 “其他款项分配给王鸽(UserID:149)”
             _GroupsTaskAssignments.Add(new Grp_GroupsTaskAssignment()
-                {
-                    DIId = diId,
-                    CTId = 98,
-                    UId = 149,
-                    CreateUserId = userId
-                }
+            {
+                DIId = diId,
+                CTId = 98,
+                UId = 149,
+                CreateUserId = userId
+            }
             );
 
             //1015 超支费用,285 收款退还  --> 财务部门(ALL)岗位
@@ -816,10 +812,10 @@ namespace OASystem.API.OAMethodLib
         /// <returns></returns>
         public static async Task<bool> IsMarketingStaff(int userId)
         {
-            var  userInfos = await _dirRep._sqlSugar
+            var userInfos = await _dirRep._sqlSugar
                                           .Queryable<Sys_Users>()
-                                          .InnerJoin<Sys_Department>((u,d) => u.DepId == d.Id)
-                                          .Where((u,d) => u.IsDel == 0 && u.Id == userId && d.DepName.Contains("市场部"))
+                                          .InnerJoin<Sys_Department>((u, d) => u.DepId == d.Id)
+                                          .Where((u, d) => u.IsDel == 0 && u.Id == userId && d.DepName.Contains("市场部"))
                                           .ToListAsync();
             if (userInfos.Count > 0) return true;
 
@@ -1056,14 +1052,14 @@ namespace OASystem.API.OAMethodLib
         /// <param name="text"></param>
         /// <param name="isUp"></param>
         /// <returns></returns>
-        public static string GetTotalPingYinFirst(this string text , bool isUp = true)
+        public static string GetTotalPingYinFirst(this string text, bool isUp = true)
         {
             var returnstr = string.Empty;
             var enResult = text.GetTotalPingYin();
-            if(enResult.Count == 0)
+            if (enResult.Count == 0)
             {
-                returnstr =  text;
-            } 
+                returnstr = text;
+            }
             else if (isUp)
             {
                 returnstr = enResult[0].ToUpper();
@@ -1072,7 +1068,7 @@ namespace OASystem.API.OAMethodLib
             {
                 returnstr = enResult[0].ToLower();
             }
-            return returnstr; 
+            return returnstr;
         }
 
         /// <summary>
@@ -1563,7 +1559,7 @@ namespace OASystem.API.OAMethodLib
                     {
                         DateTime arr_dt = Convert.ToDateTime(airData[0].ArrivedDate); //抵达时间
                         DateTime dep_dt = Convert.ToDateTime(airData[1].Day); //离开时间
-                        days = (dep_dt - arr_dt).Days;
+                        //days = (dep_dt - arr_dt).Days;
                         //countryStr += $@"{country}停留{days}日、";
                         countryStr += $@"{country}停留  日、";
                     }
@@ -1809,7 +1805,7 @@ namespace OASystem.API.OAMethodLib
 
             return dt;
         }
-        
+
         private readonly static string[] excludeArr = new string[] { "[中转]", "[转机]" };
 
         /// <summary>
@@ -2349,7 +2345,7 @@ namespace OASystem.API.OAMethodLib
         /// <param name="diid">团组Id</param>
         /// <param name="separator">分隔符</param>
         /// <returns></returns>
-        public static Dictionary<int,string> GetGroupCityLineItem(List<int> diids, string separator)
+        public static Dictionary<int, string> GetGroupCityLineItem(List<int> diids, string separator)
         {
             Dictionary<int, string> dicCitys = new Dictionary<int, string>();
             var cityCodes = _dirRep._sqlSugar.Queryable<Res_ThreeCode>().Where(it => it.IsDel == 0).ToList();
@@ -2423,10 +2419,10 @@ namespace OASystem.API.OAMethodLib
                 }
                 else city = "[未录入黑屏代码]";
 
-                dicCitys.Add(diid,city);
+                dicCitys.Add(diid, city);
             }
 
-            
+
 
             return dicCitys;
         }
@@ -2436,7 +2432,7 @@ namespace OASystem.API.OAMethodLib
         /// op行程单相关团组信息 含途径城市
         /// </summary>
         /// <returns></returns>
-        public static async Task< List<MateOpGroupPageListView>> MateOpGroupPageListRedis()
+        public static async Task<List<MateOpGroupPageListView>> MateOpGroupPageListRedis()
         {
             List<MateOpGroupPageListView> _views = new List<MateOpGroupPageListView>();
             string viewStr = await RedisRepository.RedisFactory.CreateRedisRepository().StringGetAsync<string>("MateOpGroupPageList");//string 取
@@ -2481,7 +2477,8 @@ namespace OASystem.API.OAMethodLib
 
                 #endregion
 
-                _views.ForEach(it => {
+                _views.ForEach(it =>
+                {
                     it.RouteCity = GetGroupCityLine(it.Id, @"/");
                     it.Department = UserDepDatas.Find(it1 => it.JietuanOperatorId == it1.UserId)?.DepName ?? "Unknown";
                 });
@@ -2518,7 +2515,7 @@ namespace OASystem.API.OAMethodLib
         /// </summary>
         /// <param name="diid"></param>
         /// <returns></returns>
-        public static Result GetBriefStroke (int diid)
+        public static Result GetBriefStroke(int diid)
         {
             DataTable resultTable = GetTableByBlackCode(diid);
 
@@ -2850,7 +2847,7 @@ namespace OASystem.API.OAMethodLib
                             trip += "16:00—17:30 公务活动;\r\n";
                         }
 
-                        
+
                     }
 
                     //if (time.Hour < 18)
@@ -2877,12 +2874,12 @@ namespace OASystem.API.OAMethodLib
                         };
                     }
                     //trip += $"{end_Object.City}\r\n";
-//                    trip += @"08:00        早餐于酒店;
-//09:00—10:30 公务活动;
-//12:00        午餐于当地餐厅;
-//14:00—16:00 公务活动;
-//18:00        晚餐于当地餐厅;
-//19:00        入住酒店休息;";
+                    //                    trip += @"08:00        早餐于酒店;
+                    //09:00—10:30 公务活动;
+                    //12:00        午餐于当地餐厅;
+                    //14:00—16:00 公务活动;
+                    //18:00        晚餐于当地餐厅;
+                    //19:00        入住酒店休息;";
                     trip += "09:00—10:30 公务活动;\r\n14:00—16:00 公务活动;\r\n";
 
                 }
@@ -2923,7 +2920,7 @@ namespace OASystem.API.OAMethodLib
         public static string GetWeek(this string dtStr)
         {
             string week = "";
-            bool isDt = DateTime.TryParse(dtStr,out DateTime dt);
+            bool isDt = DateTime.TryParse(dtStr, out DateTime dt);
             if (isDt)
             {
                 week = weekdays[(int)dt.DayOfWeek];
@@ -2964,7 +2961,7 @@ namespace OASystem.API.OAMethodLib
         /// <param name="userId"></param>
         /// <param name="CTable"></param>
         /// <returns></returns>
-        public static async Task<JsonView> EnterExitCostDownload(EnterExitCostDownloadDto dto,string fileFormat = "pdf")
+        public static async Task<JsonView> EnterExitCostDownload(EnterExitCostDownloadDto dto, string fileFormat = "pdf")
         {
             var _view = new JsonView() { Code = StatusCodes.Status204NoContent };
 
@@ -3261,7 +3258,8 @@ namespace OASystem.API.OAMethodLib
                         //doc.Save(AppSettingsHelper.Get("WordBasePath") + "EnterExitCost/File/" + strFileName);
                         var saveFormat = Aspose.Words.SaveFormat.Docx;
 
-                        if (fileFormat.Equals("pdf")) { 
+                        if (fileFormat.Equals("pdf"))
+                        {
                             //doc.LayoutOptions.IsShowComments = false;
                             doc.LayoutOptions.IsShowHiddenText = false;
                             doc.LayoutOptions.IsShowParagraphMarks = false;

+ 10 - 9
OASystem/OASystem.Api/OAMethodLib/GoogleMapAPI/GoogleMapTools.cs

@@ -1,5 +1,4 @@
-using OASystem.Domain.ViewModels.JuHeExchangeRate;
-using OASystem.Domain.ViewModels.SmallFun;
+using OASystem.Domain.ViewModels.SmallFun;
 using System.Text.Json;
 
 namespace OASystem.API.OAMethodLib.GoogleMapAPI
@@ -18,25 +17,26 @@ namespace OASystem.API.OAMethodLib.GoogleMapAPI
         /// <param name="origin"></param>
         /// <param name="destination"></param>
         /// <returns></returns>
-        public static async Task<Result> GetForeignAndTime(string origin, string destination) 
+        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= "起始地或目的地为空";
+                result.Msg = "起始地或目的地为空";
                 return result;
             }
 
-            string url = string.Format(@"/maps/api/directions/json?origin={0}&destination={1}&key={2}", origin, destination,_appKey);
+            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) {
+            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.Status == "OK")
                 {
                     if (resultData.Routes == null)
                     {
@@ -44,9 +44,10 @@ namespace OASystem.API.OAMethodLib.GoogleMapAPI
                         return result;
                     }
 
-                    var data =  JsonConvert.DeserializeObject<dynamic>( resultData.Routes.ToJson());
+                    var data = JsonConvert.DeserializeObject<dynamic>(resultData.Routes.ToJson());
 
-                    var dataView = new DistanceAndTimeView {
+                    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(),

+ 9 - 12
OASystem/OASystem.Api/OAMethodLib/GroupCommission.cs

@@ -1,7 +1,4 @@
-using Microsoft.AspNetCore.Components.Web;
-using MySqlX.XDevAPI.Relational;
-using OASystem.Domain.Dtos.Financial;
-using OASystem.Domain.Dtos.Groups;
+using OASystem.Domain.Dtos.Financial;
 using OASystem.Domain.Entities.Financial;
 using OASystem.Domain.Entities.Groups;
 using OASystem.Domain.ViewModels.Financial;
@@ -18,7 +15,7 @@ namespace OASystem.API.OAMethodLib
     public static class GroupCommission
     {
         //团组信息
-        private readonly static DelegationInfoRepository _dirRep = AutofacIocManager.Instance.GetService<DelegationInfoRepository>(); 
+        private readonly static DelegationInfoRepository _dirRep = AutofacIocManager.Instance.GetService<DelegationInfoRepository>();
         //团组实付金额
         private readonly static CreditCardPaymentRepository _ccpRep = AutofacIocManager.Instance.GetService<CreditCardPaymentRepository>();
         //团组应收款项
@@ -26,7 +23,7 @@ namespace OASystem.API.OAMethodLib
         //团组已收款项
         private readonly static ProceedsReceivedRepository _prRep = AutofacIocManager.Instance.GetService<ProceedsReceivedRepository>();
         //团组其他款项
-        private readonly static OtherPriceRepository _opRep = AutofacIocManager.Instance.GetService<OtherPriceRepository>(); 
+        private readonly static OtherPriceRepository _opRep = AutofacIocManager.Instance.GetService<OtherPriceRepository>();
 
         /// <summary>
         /// 获取团组提成 Page List
@@ -44,7 +41,7 @@ namespace OASystem.API.OAMethodLib
             }
             if (groupResult.Data == null) { }
 
-           // ListViewBase<DelegationPageListView> groupData = JsonConvert.DeserializeObject<ListViewBase<DelegationPageListView>>(groupResult.Data);
+            // ListViewBase<DelegationPageListView> groupData = JsonConvert.DeserializeObject<ListViewBase<DelegationPageListView>>(groupResult.Data);
             result.Data = groupResult.Data;
             List<int> diids = new List<int>();
             foreach (var item in result.Data.DataList)
@@ -107,7 +104,7 @@ namespace OASystem.API.OAMethodLib
             sumPr = sumPr - refund;
 
             //团组与非团组产生的成本费用数据
-            Result _ccpData =  await _ccpRep.GetGroupPaymentInfoByDiid(DiId, true);
+            Result _ccpData = await _ccpRep.GetGroupPaymentInfoByDiid(DiId, true);
             if (_ccpData.Code == 0 && _ccpData.Data != null)
             {
                 foreach (Grp_Fin_CreditCardPaymentView item in _ccpData.Data)
@@ -130,7 +127,7 @@ namespace OASystem.API.OAMethodLib
             //团组尾款=应收款项-已收款项
             decimal groupRatainage = sumPr - sumPr;
 
-            return new Fin_GroupProfitInfoView() { ReceivableFund = sumFr, ReceivedFund = sumPr,Refund = refund,Cost=cost,RetainedProfits=groupProfit,FinalPayment = groupRatainage };
+            return new Fin_GroupProfitInfoView() { ReceivableFund = sumFr, ReceivedFund = sumPr, Refund = refund, Cost = cost, RetainedProfits = groupProfit, FinalPayment = groupRatainage };
         }
 
         /// <summary>
@@ -140,8 +137,8 @@ namespace OASystem.API.OAMethodLib
         /// <returns></returns>
         public static async Task<List<Fin_GroupProfitInfoView>> GetCommissionByDiids(int[] DiIds)
         {
-           
-            if (DiIds.Length <= 0) return new  List<Fin_GroupProfitInfoView>();
+
+            if (DiIds.Length <= 0) return new List<Fin_GroupProfitInfoView>();
 
             List<Fin_GroupProfitInfoView> fin_GroupProfitInfoViews = new List<Fin_GroupProfitInfoView>();
 
@@ -258,7 +255,7 @@ namespace OASystem.API.OAMethodLib
             }
 
 
-            
+
             return fin_GroupProfitInfoViews;
         }
     }

+ 2 - 8
OASystem/OASystem.Api/OAMethodLib/GroupStepForDelegation.cs

@@ -1,13 +1,7 @@
-using Google.Protobuf.WellKnownTypes;
-using Microsoft.AspNetCore.DataProtection.KeyManagement;
-using OASystem.Domain.Common;
+using OASystem.Domain.Common;
 using OASystem.Domain.Dtos.Groups;
 using OASystem.Domain.Entities.Groups;
-using OASystem.Domain.Enums;
-using OASystem.Domain.ViewModels.Groups;
 using OASystem.Infrastructure.Repositories.Groups;
-using System.Configuration;
-using static OpenAI.GPT3.ObjectModels.SharedModels.IOpenAiModels;
 
 namespace OASystem.API.OAMethodLib
 {
@@ -469,7 +463,7 @@ Where d.Id={0} And u.Id not in({1})", DepartmentCode.IC, _groupConfig.FilterUser
         #endregion
 
 
-        
+
 
     }
 

+ 1 - 3
OASystem/OASystem.Api/OAMethodLib/IOOperatorHelper.cs

@@ -1,6 +1,4 @@
-using static StackExchange.Redis.Role;
-
-namespace OASystem.API.OAMethodLib
+namespace OASystem.API.OAMethodLib
 {
     public class IOOperatorHelper
     {

+ 1 - 3
OASystem/OASystem.Api/OAMethodLib/JsonConvertOverride.cs

@@ -1,6 +1,4 @@
-using Newtonsoft.Json;
-using System.Text.Json;
-using System.Text.Json.Serialization;
+using System.Text.Json;
 
 namespace OASystem.API.OAMethodLib
 {

+ 6 - 14
OASystem/OASystem.Api/OAMethodLib/JuHeAPI/JuHeApiService.cs

@@ -1,22 +1,14 @@
-using Dm;
-using Newtonsoft.Json;
-using OASystem.Domain;
-using OASystem.Domain.Dtos.SmallFun;
+using OASystem.Domain.Dtos.SmallFun;
 using OASystem.Domain.ViewModels.JuHeExchangeRate;
 using OASystem.Domain.ViewModels.SmallFun;
-using StackExchange.Redis;
-using System.DirectoryServices.Protocols;
-using System.Net.Http;
-using System.Net.Http.Json;
 using System.Text.Json;
-using Ubiety.Dns.Core;
 
 namespace OASystem.API.OAMethodLib.JuHeAPI
 {
     /// <summary>
     /// 聚合Api 服务
     /// </summary>
-    public class JuHeApiService: IJuHeApiService
+    public class JuHeApiService : IJuHeApiService
     {
         private readonly HttpClient _httpClient;
         private readonly HttpClient _httpClientTranslate;
@@ -30,7 +22,7 @@ namespace OASystem.API.OAMethodLib.JuHeAPI
         public JuHeApiService(IHttpClientFactory clientFactory)
         {
             _httpClient = clientFactory.CreateClient("PublicJuHeApi");
-            _httpClientTranslate = clientFactory.CreateClient("PublicJuHeTranslateApi"); 
+            _httpClientTranslate = clientFactory.CreateClient("PublicJuHeTranslateApi");
         }
 
         #region 汇率
@@ -346,7 +338,7 @@ namespace OASystem.API.OAMethodLib.JuHeAPI
         /// <param name="source">原文,数据类型为字符串,也可为数组(元素必须为字符串类型);每次请求的字符串长度之和尽量不要超过 </param>
         /// <param name="trans_type">翻译方向:en2zh(英文-中文),zh2en(中文-英文),ja2zh(日文-中文),zh2ja(中文-日文),ko2zh(韩文-中文),zh2ko(中文-韩文)</param>
         /// <returns></returns>
-        public async Task<string> GetTextTranslateAsync(string source,string trans_type = "zh2en")
+        public async Task<string> GetTextTranslateAsync(string source, string trans_type = "zh2en")
         {
 
             string res = "";
@@ -361,8 +353,8 @@ namespace OASystem.API.OAMethodLib.JuHeAPI
                                      new FormUrlEncodedContent(new List<KeyValuePair<string, string>>()
                                      {
                                              new KeyValuePair<string, string>("key",_appkey_textTranslate),//你申请的key 
-                                             new KeyValuePair<string, string>("source",source),   
-                                             new KeyValuePair<string, string>("trans_type",trans_type)    
+                                             new KeyValuePair<string, string>("source",source),
+                                             new KeyValuePair<string, string>("trans_type",trans_type)
 
                                      }));
             if (exchangeReq.IsSuccessStatusCode)

+ 62 - 76
OASystem/OASystem.Api/OAMethodLib/PayrollComputation.cs

@@ -1,22 +1,7 @@
-using Google.Protobuf.WellKnownTypes;
-using NPOI.HPSF;
-using NPOI.OpenXmlFormats.Dml.Diagram;
-using NPOI.OpenXmlFormats.Spreadsheet;
-using NPOI.SS.Formula.Functions;
-using NPOI.Util;
-using OASystem.API.OAMethodLib.QiYeWeChatAPI;
-using OASystem.Domain;
+using OASystem.API.OAMethodLib.QiYeWeChatAPI;
 using OASystem.Domain.Entities.PersonnelModule;
 using OASystem.Domain.ViewModels.PersonnelModule;
 using OASystem.Domain.ViewModels.QiYeWeChat;
-using OASystem.Infrastructure.Repositories.Groups;
-using System;
-using System.Collections.Generic;
-using System.Diagnostics.Eventing.Reader;
-using System.Drawing;
-using System.Linq.Expressions;
-using System.Text.Json.Nodes;
-using TencentCloud.Ocr.V20181119.Models;
 
 namespace OASystem.API.OAMethodLib
 {
@@ -26,7 +11,7 @@ namespace OASystem.API.OAMethodLib
     public static class PayrollComputation
     {
         private static Result _result = new Result();
-        private static readonly IQiYeWeChatApiService _qiYeWeChatApiService = AutofacIocManager.Instance.GetService<IQiYeWeChatApiService>(); 
+        private static readonly IQiYeWeChatApiService _qiYeWeChatApiService = AutofacIocManager.Instance.GetService<IQiYeWeChatApiService>();
         private static readonly UsersRepository _usersRep = AutofacIocManager.Instance.GetService<UsersRepository>();
         private static readonly IMapper _mapper = AutofacIocManager.Instance.GetService<IMapper>();
         private static readonly decimal _chengDuMinimumWage = 2100.00M * 0.80M; //员工在病假医疗期限内的病假工资按照成都市最低工资标准的 80%发放 
@@ -51,7 +36,7 @@ namespace OASystem.API.OAMethodLib
 
             //计算时间段内工作日
             int work_days = await GetWorkDays(thisYearMonth);
-            if (work_days <=0)
+            if (work_days <= 0)
             {
                 _result.Msg = $"{thisYearMonth} 工作日未设置,请前往《工作日管理页面》设置!";
                 return _result;
@@ -84,7 +69,7 @@ namespace OASystem.API.OAMethodLib
 
             //获取所有打卡记录 外出
             CheckInDataView checkInDataView = new CheckInDataView();
-            checkInDataView = await _qiYeWeChatApiService.GetCheckinDataAsync(qyWhchatIdList, 3,startDt, endDt);
+            checkInDataView = await _qiYeWeChatApiService.GetCheckinDataAsync(qyWhchatIdList, 3, startDt, endDt);
             if (checkInDataView.errcode != 0)
             {
                 _result.Msg = $"【企业微信】【打卡】【获取时间段内所有日打卡记录】【Msg】{checkInDataView.errmsg}";
@@ -93,12 +78,12 @@ namespace OASystem.API.OAMethodLib
 
             //查询工作日
             List<Sys_Calendar> sys_Calendars = new List<Sys_Calendar>();
-            string sys_sql = string.Format("Select * From Sys_Calendar Where Isdel = 0 And Dt between '{0}' And '{1}'", 
+            string sys_sql = string.Format("Select * From Sys_Calendar Where Isdel = 0 And Dt between '{0}' And '{1}'",
                 startDt.ToString("yyyy-MM-dd"), endDt.ToString("yyyy-MM-dd"));
             sys_Calendars = await _usersRep._sqlSugar.SqlQueryable<Sys_Calendar>(sys_sql).ToListAsync();
 
             //筛选出工作日日报
-            List<Root> workday_userRoots = checkInDayDataView.datas.Where(it => it.base_info.day_type == 0 && it.base_info.record_type == 1).ToList(); 
+            List<Root> workday_userRoots = checkInDayDataView.datas.Where(it => it.base_info.day_type == 0 && it.base_info.record_type == 1).ToList();
 
             //工作日日报
             workday_userRoots = workday_userRoots.OrderBy(it => it.base_info.date).ToList();
@@ -110,7 +95,7 @@ namespace OASystem.API.OAMethodLib
             CorpCheckInRuleView corpCheckInRole = await _qiYeWeChatApiService.GetCheckIn_CorpCheckInOptionAsync();
             if (corpCheckInRole.errcode != 0)
             {
-                _result.Msg = $"【企业微信】【打卡】【获取企业打卡规则】【Msg】{corpCheckInRole.errmsg}" ;
+                _result.Msg = $"【企业微信】【打卡】【获取企业打卡规则】【Msg】{corpCheckInRole.errmsg}";
                 return _result;
             }
 
@@ -121,7 +106,7 @@ namespace OASystem.API.OAMethodLib
             {
                 foreach (var item in group.spe_offdays)
                 {
-                    if (item.begtime_dt>= startDt && item.endtime_dt <= endDt)
+                    if (item.begtime_dt >= startDt && item.endtime_dt <= endDt)
                     {
                         if (item.endtime_dt > startDt)
                         {
@@ -221,7 +206,7 @@ namespace OASystem.API.OAMethodLib
                     #region 计算日工资 正常日薪 事假日薪 病假日薪
 
                     //月 - 应发工资
-                    decimal amountPayable = pm_wsInfo.Basic + pm_wsInfo.Floats + pm_wsInfo.PostAllowance + pm_wsInfo.InformationSecurityFee + 
+                    decimal amountPayable = pm_wsInfo.Basic + pm_wsInfo.Floats + pm_wsInfo.PostAllowance + pm_wsInfo.InformationSecurityFee +
                                             pm_wsInfo.OtherSubsidies;
 
                     // 日薪 = *计算方式:日平均工资 = 月工资/当月应出勤天数。
@@ -252,7 +237,7 @@ namespace OASystem.API.OAMethodLib
                     else
                     {
                         userRoots = workday_userRoots.Where(it => it.base_info.name == _name || it.base_info.name.Contains(_name)).ToList(); //工作日日报 1-固定上下班;
-                    } 
+                    }
 
                     //userRoots = userRoots.Distinct().ToList();
                     userRoots = userRoots.OrderBy(it => it.base_info.date).ToList();
@@ -278,8 +263,8 @@ namespace OASystem.API.OAMethodLib
                         List<Ex_Item> ex_reissuecard_Items = new List<Ex_Item>(); //打卡类型 数据
                         List<Sp_items> acc_sp_items = new List<Sp_items>(); //审批数据
 
-                        int user_probationary_bk_num = 0; 
-                                                          
+                        int user_probationary_bk_num = 0;
+
                         decimal user_probationary_bk_decimal = pm_wsInfo.Floats; //绩效工资为0 则为试用员工
 
                         //处理外出打卡记录
@@ -585,7 +570,7 @@ namespace OASystem.API.OAMethodLib
                             sp_gooutpunch_details = await _qiYeWeChatApiService.GetApprovalDetailsAsync(startDt, endDt, acctid, 2, 4); //时间段内所有 已同意的 外出打卡 审批数据
                             if (sp_gooutpunch_details.Count <= 0)
                             {
-                                _result.Msg +=  $"{_name}:{startDt} - {endDt}  外出打卡 审批数据获取未获取到!\r\n";
+                                _result.Msg += $"{_name}:{startDt} - {endDt}  外出打卡 审批数据获取未获取到!\r\n";
                             }
 
                             List<LeaveDetails> goOutPunchDetails = new List<LeaveDetails>();
@@ -603,7 +588,7 @@ namespace OASystem.API.OAMethodLib
                                         Attendance attendance = content_Attendance.value.attendance; //假勤组件
 
                                         string goOutText = string.Empty;
-                                        if (content_Textarea!=null)
+                                        if (content_Textarea != null)
                                         {
                                             goOutText = content_Textarea.value.text;
                                         }
@@ -640,7 +625,7 @@ namespace OASystem.API.OAMethodLib
                                 if (goOut_checkInDataInfos.Count > 1)
                                 {
                                     DateTime gooutStartDt = goOut_checkInDataInfos[0].checkin_time_dt;
-                                    DateTime gooutendDt = goOut_checkInDataInfos[goOut_checkInDataInfos.Count-1].checkin_time_dt;
+                                    DateTime gooutendDt = goOut_checkInDataInfos[goOut_checkInDataInfos.Count - 1].checkin_time_dt;
 
                                     Ex_Item beLate_belate_ex = new Ex_Item()
                                     {
@@ -649,7 +634,7 @@ namespace OASystem.API.OAMethodLib
                                         Duration = 0,
                                         StartTimeDt = Convert.ToDateTime(goOutPunchItem.StartDt),
                                         Unit = "分钟",
-                                        Reason ="数据来源【外出打卡】"
+                                        Reason = "数据来源【外出打卡】"
                                     };
 
                                     decimal day_deduction = 0.00M;
@@ -694,7 +679,7 @@ namespace OASystem.API.OAMethodLib
                                             day_deduction = ConvertToDecimal(dailyWage);
                                             absenteeism_deduction += day_deduction; //矿工一日
                                             meal_deduction += 10.00M;
-                                            beLate_belate_ex.Reason = "数据来源【外出打卡】" +thisDay + " 上午(09:00)-下午(18:00) 缺卡/未打视为旷工一天(7.5小时)";
+                                            beLate_belate_ex.Reason = "数据来源【外出打卡】" + thisDay + " 上午(09:00)-下午(18:00) 缺卡/未打视为旷工一天(7.5小时)";
                                         }
                                         beLate_belate_ex.Deduction = day_deduction;
                                         ex_reissuecard_Items.Add(beLate_belate_ex);
@@ -781,7 +766,7 @@ namespace OASystem.API.OAMethodLib
                             sp_leave_details = await _qiYeWeChatApiService.GetApprovalDetailsAsync(startDt, endDt, acctid, 2, 1); //时间段内所有 已同意的 请假 审批数据
                             if (sp_leave_details.Count <= 0)
                             {
-                                _result.Msg +=  $"{_name}: {startDt} - {endDt}  请假 审批数据获取未获取到!\r\n";
+                                _result.Msg += $"{_name}: {startDt} - {endDt}  请假 审批数据获取未获取到!\r\n";
                                 //continue;
                             }
                             List<Ex_Item> ex_ItemInfos = new List<Ex_Item>();
@@ -819,7 +804,7 @@ namespace OASystem.API.OAMethodLib
                                         if ((Convert.ToDateTime(date_Range.new_begin_dt) < startDt || Convert.ToDateTime(date_Range.new_begin_dt) > endDt) &&
                                             (Convert.ToDateTime(date_Range.new_end_dt) < startDt || Convert.ToDateTime(date_Range.new_end_dt) > endDt))
                                         {
-                                             continue;
+                                            continue;
                                         }
 
                                         string leave_starttime = date_Range.new_begin_dt.ToString("HH:mm");
@@ -838,7 +823,7 @@ namespace OASystem.API.OAMethodLib
                                         string endTime1 = string.Empty;
                                         Slice_info slice_info = new Slice_info();
                                         //2事假;3病假;
-                                        if (leaveTypeId == 2 || leaveTypeId ==3)
+                                        if (leaveTypeId == 2 || leaveTypeId == 3)
                                         {
                                             slice_info = vacation.attendance.slice_info;
                                         }
@@ -957,7 +942,7 @@ namespace OASystem.API.OAMethodLib
                                                         endTime1 = "18:00";
                                                     }
                                                 }
-                                            
+
                                             }
                                             else
                                             {
@@ -1058,8 +1043,8 @@ namespace OASystem.API.OAMethodLib
                                     #endregion
 
                                     //计算餐补 假勤类型扣款
-                                    CalculateTypeFee1(leaveDetails,leaveType, leave_item.DtType, leave_item.StartDt, leave_item.EndDt, amountPayable, work_days,
-                                        new_duration,out leave_meals, out thisTypeDeduction);
+                                    CalculateTypeFee1(leaveDetails, leaveType, leave_item.DtType, leave_item.StartDt, leave_item.EndDt, amountPayable, work_days,
+                                        new_duration, out leave_meals, out thisTypeDeduction);
                                     if (leave_meals != 0)
                                     {
                                         leave_item.IsDeduction = true;
@@ -1185,8 +1170,8 @@ namespace OASystem.API.OAMethodLib
                                         {
                                             continue;
                                         }
-                                        
-                                       decimal bukaPrice = 0.00M;
+
+                                        decimal bukaPrice = 0.00M;
 
                                         if (user_probationary_bk_decimal == 0) //计算试用员工补卡次数
                                         {
@@ -1194,7 +1179,7 @@ namespace OASystem.API.OAMethodLib
                                             else if (bukaNum <= 4 && bukaNum > 2) bukaPrice = 10.00M;
                                             else bukaPrice = 50.00M;
 
-                                        } 
+                                        }
                                         else   //计算正式员工补卡次数
                                         {
                                             if (bukaNum <= 2) bukaPrice = 10.00M;
@@ -1215,14 +1200,14 @@ namespace OASystem.API.OAMethodLib
                                             {
                                                 //按时间段移除 上午补卡时间段 09:00 - 12:00 下午补卡时间段 12:00 - 18:00
                                                 TimeSpan _strWorkingDayAM = DateTime.Parse("09:00").TimeOfDay;
-                                                TimeSpan _endWorkingDayAM = DateTime.Parse("12:00").TimeOfDay; 
-                                                TimeSpan _strWorkingDayPM = DateTime.Parse("13:30").TimeOfDay; 
+                                                TimeSpan _endWorkingDayAM = DateTime.Parse("12:00").TimeOfDay;
+                                                TimeSpan _strWorkingDayPM = DateTime.Parse("13:30").TimeOfDay;
                                                 TimeSpan _endWorkingDayPM = DateTime.Parse("18:00").TimeOfDay;
                                                 TimeSpan _dspNow = punch_correction1.time_dt.TimeOfDay;
 
                                                 //上午时间段 打卡记录数据
                                                 var filtratePrefix_checkInItemAMs = filtratePrefix_checkInItems.Where(it => it.sch_checkin_time_dt.TimeOfDay >= _strWorkingDayAM &&
-                                                                                                                           it.sch_checkin_time_dt.TimeOfDay <= _endWorkingDayAM ).ToList();
+                                                                                                                           it.sch_checkin_time_dt.TimeOfDay <= _endWorkingDayAM).ToList();
                                                 if (filtratePrefix_checkInItemAMs.Count > 0)
                                                 {
                                                     foreach (var filtratePrefix_checkInItem1 in filtratePrefix_checkInItemAMs)
@@ -1335,7 +1320,7 @@ namespace OASystem.API.OAMethodLib
                                         Date_range date_Range = attendance.date_range;
 
                                         //筛选 不在工作日内的假勤申请
-                                        if (date_Range.new_begin_dt < startDt   || date_Range.new_end_dt > endDt)
+                                        if (date_Range.new_begin_dt < startDt || date_Range.new_end_dt > endDt)
                                         {
                                             continue;
                                         }
@@ -1379,11 +1364,11 @@ namespace OASystem.API.OAMethodLib
                                         int days = (int)(Convert.ToDateTime(date_Range.new_end_dt.ToString("yyyy-MM-dd")) -
                                                          Convert.ToDateTime(date_Range.new_begin_dt.ToString("yyyy-MM-dd"))).TotalDays + 1;
 
-                                        
+
                                         for (int i = 0; i < days; i++)
                                         {
                                             DateTime thisDt = date_Range.new_begin_dt.AddDays(i);
-                                            
+
                                             //处理开始时间 是否在当天工作时间内
                                             if (i == 0) //开始时间
                                             {
@@ -1396,7 +1381,7 @@ namespace OASystem.API.OAMethodLib
                                                         continue;
                                                     }
                                                 }
-                                                
+
                                             }
 
                                             //处理结束时间 是否在当天工作时间内
@@ -1414,7 +1399,8 @@ namespace OASystem.API.OAMethodLib
 
                                             Sys_Calendar sys_Calendar = new Sys_Calendar();
                                             sys_Calendar = sys_Calendars.Where(it => it.Dt == thisDt.ToString("yyyy-MM-dd")).FirstOrDefault();
-                                            if (sys_Calendar != null) {
+                                            if (sys_Calendar != null)
+                                            {
                                                 if (sys_Calendar.IsWorkDay)
                                                 {
                                                     cckk += 10.00M;
@@ -1422,7 +1408,7 @@ namespace OASystem.API.OAMethodLib
                                             }
                                         }
 
- 
+
                                         meal_deduction += cckk;
 
 
@@ -1499,7 +1485,7 @@ namespace OASystem.API.OAMethodLib
                         {
                             salaryTotal = (workDays * dailyWage) + mealTotal + pm_wsInfo.OtherHandle;    //应发合计
                         }
-                            
+
                     }
 
 
@@ -1526,7 +1512,7 @@ namespace OASystem.API.OAMethodLib
                     pm_wsInfo.Ex_ItemsRemark = JsonConvert.SerializeObject(ex_Items);  //
                     pm_wsInfo.Mealsupplement = mealTotal;          //餐补
 
-                    pm_wsInfo.Should = ConvertToDecimal( salaryTotal);               //应发合计
+                    pm_wsInfo.Should = ConvertToDecimal(salaryTotal);               //应发合计
                     pm_wsInfo.TotalDeductions = ConvertToDecimal(eductionTotal);    //扣款合计
                     pm_wsInfo.TotalRealHair = ConvertToDecimal(actualReleaseTotal - pm_wsInfo.WithholdingTax); //实发合计
                     pm_wsInfo.AfterTax = ConvertToDecimal(actualReleaseTotal - pm_wsInfo.WithholdingTax); //税后工资
@@ -1560,7 +1546,7 @@ namespace OASystem.API.OAMethodLib
         /// </summary>
         /// <param name="timeStr"></param>
         /// <returns></returns>
-        public static bool IsWorkTime(string timeStr) 
+        public static bool IsWorkTime(string timeStr)
         {
             string thisDayWorkStartTime = "09:00:00";
             string thisDayWorkEndTime = "18:00:00";
@@ -1623,9 +1609,9 @@ namespace OASystem.API.OAMethodLib
 
             TemplateDetailView templateDetailView = new TemplateDetailView();
             templateDetailView = await _qiYeWeChatApiService.GetTemplateDetailAsync(template_id);
-            if (templateDetailView.errcode != 0) 
+            if (templateDetailView.errcode != 0)
             {
-                Serilog.Log.Error("【企业微信】【审批】【获取假勤类型的审批】【Msg】"+ templateDetailView.errmsg);
+                Serilog.Log.Error("【企业微信】【审批】【获取假勤类型的审批】【Msg】" + templateDetailView.errmsg);
                 return vacationLeaveTypes;
             }
             List<VacationItemInfo> VacationItemInfos = templateDetailView.vacation_list.item;
@@ -1728,7 +1714,7 @@ namespace OASystem.API.OAMethodLib
                 case 2: //2事假
                     // 事假日薪 *计算方式:日平均工资 = 当月应发工资 /当月应出勤天数。 
                     decimal personalkLeave_dailywage_halfhour = personalkLeave_dailywage_day / 7.50M; //事假单位 0.5小时
-                   
+
                     if (date_Range_type == "halfday")
                     {
                         #region 处理当天是否扣除餐补
@@ -1963,8 +1949,8 @@ namespace OASystem.API.OAMethodLib
         /// <param name="duration"></param>
         /// <param name="mealDeduction"></param>
         /// <param name="typeDeduction"></param>
-        public static void CalculateTypeFee2(List<LeaveDetails> leaveDetails,int leaveType, string date_Range_type, DateTime startTime, DateTime endTime,
-            decimal amountPayable,int work_days, decimal duration, out decimal mealDeduction, out decimal typeDeduction)
+        public static void CalculateTypeFee2(List<LeaveDetails> leaveDetails, int leaveType, string date_Range_type, DateTime startTime, DateTime endTime,
+            decimal amountPayable, int work_days, decimal duration, out decimal mealDeduction, out decimal typeDeduction)
         {
             typeDeduction = 0;
             mealDeduction = 0;
@@ -1998,7 +1984,7 @@ namespace OASystem.API.OAMethodLib
                             {
                                 mealDeduction = 10; //餐补扣款 
                             }
-                        } 
+                        }
                         else // 多天
                         {
                             var njManyDaysItem = leaveDetails.Where(it => it.StartDt.ToString("yyyy-MM-dd") == startTime.ToString("yyyy-MM-dd")).ToList();
@@ -2019,7 +2005,7 @@ namespace OASystem.API.OAMethodLib
                                     {
                                         mealDeduction = 10 * Math.Ceiling(duration);
                                     }
-                                }                            
+                                }
                             }
                             else
                             {
@@ -2031,7 +2017,7 @@ namespace OASystem.API.OAMethodLib
                     break;
                 case 2: //2事假
                     // 事假日薪 *计算方式:日平均工资 = 当月应发工资 /当月应出勤天数。 
-                    decimal personalkLeave_dailywage_halfhour =  personalkLeave_dailywage_day / 7.50M; //事假单位 0.5小时
+                    decimal personalkLeave_dailywage_halfhour = personalkLeave_dailywage_day / 7.50M; //事假单位 0.5小时
 
                     if (date_Range_type == "halfday")
                     {
@@ -2059,7 +2045,7 @@ namespace OASystem.API.OAMethodLib
                                     }
                                 }
 
-                                LeaveDetails sjDetailsMeal = leaveDetails.Where(it => it.EndDt == startTime ).FirstOrDefault();
+                                LeaveDetails sjDetailsMeal = leaveDetails.Where(it => it.EndDt == startTime).FirstOrDefault();
                                 if (sjDetailsMeal == null)
                                 {
                                     mealDeduction += 10.00M;
@@ -2067,7 +2053,7 @@ namespace OASystem.API.OAMethodLib
                             }
                             else
                             {
-                                typeDeduction = personalkLeave_dailywage_day* sj_wholeDay;
+                                typeDeduction = personalkLeave_dailywage_day * sj_wholeDay;
                             }
                             typeDeduction = ConvertToDecimal(typeDeduction);
                         }
@@ -2086,7 +2072,7 @@ namespace OASystem.API.OAMethodLib
                         else if (duration >= 7.5M) //多天计算
                         {
                             decimal leave_halfHour1 = Convert.ToDecimal(duration) / Convert.ToDecimal(0.5);
-                            
+
 
                             decimal leaveDays = duration / 7.5M;
                             if (leaveDays % 1 == 0)
@@ -2097,7 +2083,7 @@ namespace OASystem.API.OAMethodLib
                             else
                             {
                                 typeDeduction = personalkLeave_dailywage_day * Convert.ToInt32(leaveDays);
-                                decimal sy_shijiaunit = leave_halfHour1 - Convert.ToDecimal (15.00M * Convert.ToInt32(leaveDays));
+                                decimal sy_shijiaunit = leave_halfHour1 - Convert.ToDecimal(15.00M * Convert.ToInt32(leaveDays));
                                 if (sy_shijiaunit > 0)
                                 {
                                     typeDeduction += ConvertToDecimal(personalkLeave_dailywage_halfhour * sy_shijiaunit);
@@ -2147,7 +2133,7 @@ namespace OASystem.API.OAMethodLib
                                     decimal bjLongTime = bj_slice_Info.duration / 3600.00M;
                                     if (bjLongTime == 3.00M)
                                     {
-                                        bj_halfDayWage =   (pl_dailywage_day / 7.50M) * 3.00M;
+                                        bj_halfDayWage = (pl_dailywage_day / 7.50M) * 3.00M;
                                     }
                                     else if (bjLongTime == 4.50M)
                                     {
@@ -2162,7 +2148,7 @@ namespace OASystem.API.OAMethodLib
                     else if (date_Range_type == "hour")
                     {
                         decimal sickLeave_halfHour = duration / 0.5M;
-                        typeDeduction = ConvertToDecimal(sickLeave_dailywage_halfhour_deduction1 * sickLeave_halfHour); 
+                        typeDeduction = ConvertToDecimal(sickLeave_dailywage_halfhour_deduction1 * sickLeave_halfHour);
 
                         if (duration >= 3 && duration < 7.5M) //单天请假三小时 && 请假时间在上午 则没有餐补
                         {
@@ -2202,22 +2188,22 @@ namespace OASystem.API.OAMethodLib
                     }
                     break;
                 case 4: //4调休假
-                    CalculateTypeFeeSub(leaveDetails,date_Range_type, startTime, endTime, duration, out mealDeduction);
+                    CalculateTypeFeeSub(leaveDetails, date_Range_type, startTime, endTime, duration, out mealDeduction);
                     break;
                 case 5: //5婚假
-                    CalculateTypeFeeSub(leaveDetails,date_Range_type, startTime, endTime, duration, out mealDeduction);
+                    CalculateTypeFeeSub(leaveDetails, date_Range_type, startTime, endTime, duration, out mealDeduction);
                     break;
                 case 6: //6产假
-                    CalculateTypeFeeSub(leaveDetails,date_Range_type, startTime, endTime, duration, out mealDeduction);
+                    CalculateTypeFeeSub(leaveDetails, date_Range_type, startTime, endTime, duration, out mealDeduction);
                     break;
                 case 7: //7陪产假
-                    CalculateTypeFeeSub(leaveDetails,date_Range_type, startTime, endTime, duration, out mealDeduction);
+                    CalculateTypeFeeSub(leaveDetails, date_Range_type, startTime, endTime, duration, out mealDeduction);
                     break;
                 case 8: //8其他
-                    CalculateTypeFeeSub(leaveDetails,date_Range_type, startTime, endTime, duration, out mealDeduction);
+                    CalculateTypeFeeSub(leaveDetails, date_Range_type, startTime, endTime, duration, out mealDeduction);
                     break;
                 case 9: //9丧假
-                    CalculateTypeFeeSub(leaveDetails,date_Range_type, startTime, endTime, duration, out mealDeduction);
+                    CalculateTypeFeeSub(leaveDetails, date_Range_type, startTime, endTime, duration, out mealDeduction);
                     break;
 
             }
@@ -2234,7 +2220,7 @@ namespace OASystem.API.OAMethodLib
         /// <param name="endTime"></param>
         /// <param name="duration"></param>
         /// <param name="mealDeduction"></param>
-        public static void CalculateTypeFeeSub(List<LeaveDetails> leaveDetails,string date_Range_type, DateTime startTime1, DateTime endTime1, 
+        public static void CalculateTypeFeeSub(List<LeaveDetails> leaveDetails, string date_Range_type, DateTime startTime1, DateTime endTime1,
             decimal duration, out decimal mealDeduction)
         {
             mealDeduction = 0;
@@ -2261,7 +2247,7 @@ namespace OASystem.API.OAMethodLib
                         if (leaveDetails1[0].StartDt == startTime1)
                         {
                             mealDeduction = 10; //餐补扣款
-                        } 
+                        }
                     }
 
                 }
@@ -2382,7 +2368,7 @@ namespace OASystem.API.OAMethodLib
         /// <param name="startDt"></param>
         /// <param name="endDt"></param>
         /// <returns></returns>
-        public static async Task<int> GetWorkDays(string yearMonth) 
+        public static async Task<int> GetWorkDays(string yearMonth)
         {
             int workdays = 0;
             string sql = string.Format(@"Select * From  Pm_WageIssueWorkingDay 

+ 4 - 5
OASystem/OASystem.Api/OAMethodLib/QiYeWeChatAPI/AppNotice/Config.cs

@@ -1,5 +1,4 @@
-using MathNet.Numerics.Statistics;
-using OASystem.Domain.Entities.Groups;
+using OASystem.Domain.Entities.Groups;
 using OASystem.Domain.ViewModels.CRM;
 using System.ComponentModel;
 
@@ -178,7 +177,7 @@ namespace OASystem.API.OAMethodLib.QiYeWeChatAPI.AppNotice
         /// 团组出发前一周提醒财务检查合同、尾款
         /// </summary>
         /// <returns></returns>
-        public static string GroupRemindersToGuojiao( List<Grp_DelegationInfo> list_3day)
+        public static string GroupRemindersToGuojiao(List<Grp_DelegationInfo> list_3day)
         {
             string teamNames2 = "><font color='comment'>暂无</font>";
 
@@ -201,7 +200,7 @@ namespace OASystem.API.OAMethodLib.QiYeWeChatAPI.AppNotice
 
 <font color='info'>请各位注意检查业务费用是否录入完整</font>
 
-[详细信息请前往OA系统查看](http://oa.pan-american-intl.com:4399/)  ",  teamNames2);
+[详细信息请前往OA系统查看](http://oa.pan-american-intl.com:4399/)  ", teamNames2);
 
             return result;
         }
@@ -445,7 +444,7 @@ namespace OASystem.API.OAMethodLib.QiYeWeChatAPI.AppNotice
         /// </summary>
         /// <param name="info"></param>
         /// <returns></returns>
-        public static string CRMStatistics_Month_ToUser(List<CRMWeekStatisticsView> list, string beginDt, string endDt,int totalInsert, int totalDelete)
+        public static string CRMStatistics_Month_ToUser(List<CRMWeekStatisticsView> list, string beginDt, string endDt, int totalInsert, int totalDelete)
         {
             string users = "暂无";
             if (list.Count > 0)

+ 5 - 8
OASystem/OASystem.Api/OAMethodLib/QiYeWeChatAPI/AppNotice/Library.cs

@@ -1,12 +1,9 @@
-using EyeSoft.Runtime.InteropServices;
-using NPOI.SS.Formula.Functions;
-using OASystem.Domain.Entities.Financial;
+using OASystem.Domain.Entities.Financial;
 using OASystem.Domain.Entities.Groups;
 using OASystem.Domain.ViewModels.CRM;
 using OASystem.Domain.ViewModels.Groups;
 using OASystem.Domain.ViewModels.QiYeWeChat;
 using OASystem.Infrastructure.Repositories.Groups;
-using static OpenAI.GPT3.ObjectModels.SharedModels.IOpenAiModels;
 
 namespace OASystem.API.OAMethodLib.QiYeWeChatAPI.AppNotice
 {
@@ -122,7 +119,7 @@ namespace OASystem.API.OAMethodLib.QiYeWeChatAPI.AppNotice
         }
 
         #endregion
-       
+
         #region 团组费用审核
 
 
@@ -684,7 +681,7 @@ namespace OASystem.API.OAMethodLib.QiYeWeChatAPI.AppNotice
         /// <param name="begin"></param>
         /// <param name="end"></param>
         /// <returns></returns>
-        public static async Task<bool> SendUserMsg_CRMStatistics_Month_ToHR(List<CRMWeekStatisticsView> sourceList, List<string> userId, string begin, string end, int totalInsert,int totalDelete)
+        public static async Task<bool> SendUserMsg_CRMStatistics_Month_ToHR(List<CRMWeekStatisticsView> sourceList, List<string> userId, string begin, string end, int totalInsert, int totalDelete)
         {
             //发送信息
             List<string> qwUserIdList = GetQiyeChatUserIdList(userId);
@@ -939,7 +936,7 @@ namespace OASystem.API.OAMethodLib.QiYeWeChatAPI.AppNotice
         /// <param name="diId"></param>
         /// <param name="operationId"></param>
         /// <returns></returns>
-        public static async Task<bool> SendUserMsg_GroupShare_ToDP(int diId,int operationId)
+        public static async Task<bool> SendUserMsg_GroupShare_ToDP(int diId, int operationId)
         {
             Grp_DelegationInfo groupInfo = _grpDeleRep.Query<Grp_DelegationInfo>(s => s.Id == diId).First();
 
@@ -988,7 +985,7 @@ namespace OASystem.API.OAMethodLib.QiYeWeChatAPI.AppNotice
 
             var operationName = _grpDeleRep.Query<Sys_Users>(s => s.IsDel == 0 && s.Id == operationId).First()?.CnName ?? "Unknown";
             var defaultJobPostIds = new List<int>();
-            List<string> receivedUserIds = _grpDeleRep.Query<Sys_Users>(s => s.IsDel == 0 && s.DepId == 7 && s.JobPostId == 28 ).Select(x => x.Id.ToString()).ToList();
+            List<string> receivedUserIds = _grpDeleRep.Query<Sys_Users>(s => s.IsDel == 0 && s.DepId == 7 && s.JobPostId == 28).Select(x => x.Id.ToString()).ToList();
             var defaultUserIds = new List<string>() { "208", "233" };
             receivedUserIds.AddRange(defaultUserIds);
 

+ 1 - 10
OASystem/OASystem.Api/OAMethodLib/QiYeWeChatAPI/QiYeWeChatApiService.cs

@@ -1,16 +1,7 @@
-using Microsoft.AspNetCore.Identity;
-using NPOI.Util;
-using OASystem.Domain.Dtos.QiYeWeChat;
-using OASystem.Domain.ViewModels.JuHeExchangeRate;
+using OASystem.Domain.Dtos.QiYeWeChat;
 using OASystem.Domain.ViewModels.QiYeWeChat;
-using Org.BouncyCastle.Ocsp;
-using SqlSugar;
-using System;
-using System.Collections.Generic;
 using System.Diagnostics;
 using System.Text.Json;
-using Ubiety.Dns.Core;
-using Ubiety.Dns.Core.Common;
 
 namespace OASystem.API.OAMethodLib.QiYeWeChatAPI
 {

+ 0 - 2
OASystem/OASystem.Api/OAMethodLib/Quartz/Business/DeleReminderMessage.cs

@@ -5,11 +5,9 @@ using OASystem.Domain.Dtos.Business;
 using OASystem.Domain.Entities.Business;
 using OASystem.Domain.Entities.Customer;
 using OASystem.Domain.Entities.Groups;
-using OASystem.Domain.Entities.PersonnelModule;
 using OASystem.Domain.ViewModels.CRM;
 using OASystem.Domain.ViewModels.Groups;
 using OASystem.Infrastructure.Repositories.Groups;
-using OASystem.Infrastructure.Repositories.PersonnelModule;
 
 namespace OASystem.API.OAMethodLib.Quartz.Business
 {

+ 2 - 2
OASystem/OASystem.Api/OAMethodLib/Quartz/Business/TaskAssignment.cs

@@ -33,13 +33,13 @@ namespace OASystem.API.OAMethodLib.Quartz.Business
                 List<int> primaryIds = new List<int>();
                 primaryIds = data.Select(it => it.Id).ToList();
                 var subData = newDB.Queryable<Pm_TaskRelevanceUser>()
-                                    .Where(it => 
+                                    .Where(it =>
                                                     it.IsDel == 0 &&
                                                     primaryIds.Contains(it.TAId) &&
                                                     it.TaskStatus <= TaskerEnum.UnderWay
                                             )
                                     .ToList();
-               
+
                 if (subData.Count > 0)
                 {
                     foreach (var item in subData)

+ 2 - 2
OASystem/OASystem.Api/OAMethodLib/Quartz/Business/TaskNotification.cs

@@ -19,7 +19,7 @@ namespace OASystem.API.OAMethodLib.Quartz.Business
         /// <summary>
         /// 任务通知
         /// </summary>
-        public static async void PostTaskMessageNotification() 
+        public static async void PostTaskMessageNotification()
         {
             //_logger.LogInformation("调用任务消息推送 " + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "【在线人数】:" + JsonConvert.SerializeObject(UserStore.OnlineUser));
 
@@ -130,7 +130,7 @@ namespace OASystem.API.OAMethodLib.Quartz.Business
                 }
                 newDB.CommitTran();
                 //推送消息
-               await _hubContext.Clients.Clients(UserStore.OnlineUser.Where(it => userIds.Contains(it.UserId)).Select(it => it.ConnectionId).ToList()).ReceiveMessage("您有新的任务相关消息");
+                await _hubContext.Clients.Clients(UserStore.OnlineUser.Where(it => userIds.Contains(it.UserId)).Select(it => it.ConnectionId).ToList()).ReceiveMessage("您有新的任务相关消息");
 
                 _logger.LogInformation("任务消息推送成功 " + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "【在线人数】:" + JsonConvert.SerializeObject(UserStore.OnlineUser));
             }

+ 2 - 2
OASystem/OASystem.Api/OAMethodLib/Quartz/Business/TeamCurrency.cs

@@ -18,11 +18,11 @@ namespace OASystem.API.OAMethodLib.Quartz.Business
             var _currData = await _grpCurrencyRep.PostGroupTeamRateHot();
             if (_currData != null)
             {
-              var s = await RedisRepository.RedisFactory.CreateRedisRepository().KeyDeleteAsync(grpCurrencyName);
+                var s = await RedisRepository.RedisFactory.CreateRedisRepository().KeyDeleteAsync(grpCurrencyName);
                 if (s)
                 {
                     TimeSpan ts = DateTime.Now.AddHours(25).TimeOfDay;
-                    await RedisRepository.RedisFactory.CreateRedisRepository().StringSetAsync(grpCurrencyName,JsonConvert.SerializeObject(_currData), ts);
+                    await RedisRepository.RedisFactory.CreateRedisRepository().StringSetAsync(grpCurrencyName, JsonConvert.SerializeObject(_currData), ts);
                 }
             }
         }

+ 0 - 1
OASystem/OASystem.Api/OAMethodLib/Quartz/Jobs/GroupTeamCurrencyJob.cs

@@ -1,6 +1,5 @@
 using OASystem.API.OAMethodLib.Quartz.Business;
 using Quartz;
-using QuzrtzJob.Factory;
 
 namespace OASystem.API.OAMethodLib.Quartz.Jobs
 {

+ 2 - 3
OASystem/OASystem.Api/OAMethodLib/Quartz/Jobs/TaskJob.cs

@@ -1,6 +1,5 @@
 using OASystem.API.OAMethodLib.Quartz.Business;
 using Quartz;
-using QuzrtzJob.Factory;
 
 namespace OASystem.API.OAMethodLib.Quartz.Jobs
 {
@@ -8,7 +7,7 @@ namespace OASystem.API.OAMethodLib.Quartz.Jobs
     /// 任务指派
     /// 定时器
     /// </summary>
-    public class TaskJob:IJob
+    public class TaskJob : IJob
     {
         private readonly ILogger<TaskJob> _logger;
 
@@ -31,7 +30,7 @@ namespace OASystem.API.OAMethodLib.Quartz.Jobs
 
                 _logger.LogInformation($"调用任务状态变更Function ErrorMsg:{ex.Message} " + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
             }
-           
+
 
             return Task.CompletedTask;
         }

+ 2 - 7
OASystem/OASystem.Api/OAMethodLib/Quartz/Jobs/TaskNewsFeedJob.cs

@@ -1,9 +1,4 @@
-using Microsoft.AspNetCore.SignalR;
-using OASystem.API.OAMethodLib.Hub.HubClients;
-using OASystem.API.OAMethodLib.Hub.Hubs;
-using OASystem.API.OAMethodLib.Quartz.Business;
-using OASystem.API.OAMethodLib.SignalR.Hubs;
-using OASystem.Infrastructure.Repositories.PersonnelModule;
+using OASystem.API.OAMethodLib.Quartz.Business;
 using Quartz;
 
 namespace OASystem.API.OAMethodLib.Quartz.Jobs
@@ -40,7 +35,7 @@ namespace OASystem.API.OAMethodLib.Quartz.Jobs
 
                 _logger.LogInformation($"调用任务消息通知ErrorMsg:{ex.Message} " + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
             }
-           
+
 
             //return Task.CompletedTask;
             await Task.CompletedTask;

+ 3 - 4
OASystem/OASystem.Api/OAMethodLib/Quartz/QuartzFactory.cs

@@ -1,5 +1,4 @@
-using OASystem.API.OAMethodLib.Quartz;
-using OASystem.API.OAMethodLib.Quartz.Jobs;
+using OASystem.API.OAMethodLib.Quartz.Jobs;
 using Quartz;
 using Quartz.Spi;
 
@@ -31,7 +30,7 @@ namespace QuzrtzJob.Factory
                             //.WithSimpleSchedule(x => x.WithIntervalInSeconds(2).RepeatForever())//每两秒执行一次
                             .WithCronSchedule("0 15 9 * * ?")
                             .Build();
-            
+
             var taskTrigger = TriggerBuilder.Create()
                             //.WithSimpleSchedule(x => x.WithIntervalInSeconds(60).RepeatForever())//每六十秒执行一次
                             .WithCronSchedule("0 0 9,18 * * ?") //每天早上九点和下午六点触发
@@ -46,7 +45,7 @@ namespace QuzrtzJob.Factory
                             .Build();
 
             //5、创建任务
-            var jobDetail = JobBuilder.Create<ALiYunPostMessageJob>().WithIdentity("job1", "group") .Build();
+            var jobDetail = JobBuilder.Create<ALiYunPostMessageJob>().WithIdentity("job1", "group").Build();
             var taskJobDetail = JobBuilder.Create<TaskJob>().WithIdentity("job2", "group").Build();
             var taskMsgJobDetail = JobBuilder.Create<TaskNewsFeedJob>().WithIdentity("job3", "group").Build();
             var teamCurrencyJobDetail = JobBuilder.Create<GroupTeamCurrencyJob>().WithIdentity("job4", "group").Build();

+ 7 - 14
OASystem/OASystem.Api/OAMethodLib/SignalR/Hubs/ChatHub.cs

@@ -1,14 +1,7 @@
 using Microsoft.AspNetCore.SignalR;
-using NPOI.SS.Formula.Functions;
-using OASystem.API.OAMethodLib.Hub;
 using OASystem.API.OAMethodLib.Hub.HubClients;
 using OASystem.API.OAMethodLib.SignalR.Hubs;
 using OASystem.API.OAMethodLib.SignalR.HubService;
-using Quartz;
-using SqlSugar.DistributedSystem.Snowflake;
-using System.DirectoryServices.Protocols;
-using System.Text.RegularExpressions;
-using static OASystem.API.OAMethodLib.Hub.Hubs.ChatHub;
 using static OASystem.API.OAMethodLib.JWTHelper;
 
 namespace OASystem.API.OAMethodLib.Hub.Hubs
@@ -19,12 +12,12 @@ namespace OASystem.API.OAMethodLib.Hub.Hubs
     {
         private readonly ILogger<ChatHub> _logger;
         private readonly CommonService _common;
-        
+
         /// <summary>
         /// 已登录的用户信息
         /// </summary>
         //public static List<UserModel> OnlineUser { get; set; } = new List<UserModel>();
-         
+
         public ChatHub(ILogger<ChatHub> logger, CommonService common)
         {
             _logger = logger;
@@ -42,9 +35,9 @@ namespace OASystem.API.OAMethodLib.Hub.Hubs
 
             if (!UserStore.OnlineUser.Exists(u => u.ConnectionId == connid))
             {
-                result += "上线成功!" ;
-                
-                UserStore.OnlineUser.Add( new UserModel() { UserId = userId,ConnectionId = connid,GroupName = "FMGJ-OASystem" });
+                result += "上线成功!";
+
+                UserStore.OnlineUser.Add(new UserModel() { UserId = userId, ConnectionId = connid, GroupName = "FMGJ-OASystem" });
             }
             else
             {
@@ -76,7 +69,7 @@ namespace OASystem.API.OAMethodLib.Hub.Hubs
                         var connId = Context.ConnectionId;
 
                         //UserStore.OnlineUser.RemoveAll(u => u.UserId == tokenModelJwt.UserId);
-                        
+
                         UserStore.OnlineUser.Add(new UserModel() { UserId = tokenModelJwt.UserId, ConnectionId = connId, GroupName = "FMGJ-OASystem" });
 
                         _logger.LogInformation($"Client ConnectionId=> [[{connId}]] UserId=> [[{tokenModelJwt.UserId}]] Already Connection Server!");
@@ -115,7 +108,7 @@ namespace OASystem.API.OAMethodLib.Hub.Hubs
             return base.OnDisconnectedAsync(exception);
         }
 
-       
+
         /**
          * 测试 
          * */

+ 14 - 16
OASystem/OASystem.Api/OAMethodLib/TencentCloudAPI/TencentOCRTools.cs

@@ -1,10 +1,8 @@
 using OASystem.Domain.Dtos.Tencent;
+using OASystem.Domain.ViewModels.OCR;
 using TencentCloud.Common;
-using TencentCloud.Ocr.V20181119.Models;
 using TencentCloud.Ocr.V20181119;
-using OASystem.Domain.ViewModels.OCR;
-using Aspose.Words;
-using NPOI.SS.Formula.Functions;
+using TencentCloud.Ocr.V20181119.Models;
 
 namespace OASystem.API.OAMethodLib.TencentCloudAPI
 {
@@ -45,7 +43,7 @@ namespace OASystem.API.OAMethodLib.TencentCloudAPI
                         else if (iDCardDto.CardSide == 1) req.CardSide = "BACK";
 
                         req.ImageBase64 = iDCardDto.picBase64;
-                        
+
                         IDCardOCRResponse resp = client.IDCardOCRSync(req);
                         result.Data = resp;
                         break;
@@ -62,7 +60,7 @@ namespace OASystem.API.OAMethodLib.TencentCloudAPI
                         BizLicenseOCRDto blOCR = (BizLicenseOCRDto)data;
                         BizLicenseOCRRequest blReq = new BizLicenseOCRRequest();
                         blReq.ImageBase64 = blOCR.picBase64;
-                        
+
                         BizLicenseOCRResponse blRep = client.BizLicenseOCRSync(blReq);
                         result.Data = blRep;
                         break;
@@ -71,7 +69,7 @@ namespace OASystem.API.OAMethodLib.TencentCloudAPI
                         OrgCodeCertOCRDto occOCR = (OrgCodeCertOCRDto)data;
                         OrgCodeCertOCRRequest ocReq = new OrgCodeCertOCRRequest();
                         ocReq.ImageBase64 = occOCR.picBase64;
-                        
+
                         OrgCodeCertOCRResponse occReq = client.OrgCodeCertOCRSync(ocReq);
                         result.Data = occReq;
                         break;
@@ -85,7 +83,7 @@ namespace OASystem.API.OAMethodLib.TencentCloudAPI
                         else if (vlOCR.CardSide == 2) vlReq.CardSide = "DOUBLE";
 
                         vlReq.ImageBase64 = vlOCR.picBase64;
-                        
+
                         VehicleLicenseOCRResponse vlRep = client.VehicleLicenseOCRSync(vlReq);
                         result.Data = vlRep;
                         break;
@@ -93,7 +91,7 @@ namespace OASystem.API.OAMethodLib.TencentCloudAPI
                         PropOwnerCertOCRDto pocOCR = (PropOwnerCertOCRDto)data;
                         PropOwnerCertOCRRequest pocReq = new PropOwnerCertOCRRequest();
                         pocReq.ImageBase64 = pocOCR.picBase64;
-                        
+
                         PropOwnerCertOCRResponse pocRep = client.PropOwnerCertOCRSync(pocReq);
                         result.Data = pocRep;
                         break;
@@ -138,8 +136,8 @@ namespace OASystem.API.OAMethodLib.TencentCloudAPI
                         };
 
                         SmartStructuralOCRResponse ssRep = client.SmartStructuralOCRSync(ssReq);
-                         List<StructuralItem> structuralItems = ssRep.StructuralItems.ToList();
-                        if (structuralItems.Count() < 1 )
+                        List<StructuralItem> structuralItems = ssRep.StructuralItems.ToList();
+                        if (structuralItems.Count() < 1)
                         {
                             return new Result() { Code = -1, Msg = "智能结构化识别V2:未识别出可用信息" };
                         }
@@ -216,9 +214,9 @@ namespace OASystem.API.OAMethodLib.TencentCloudAPI
                                     phone += item.Value + ",";
                                 }
 
-                                if (phone.Length > 0 )
+                                if (phone.Length > 0)
                                 {
-                                    phone = phone.Substring(0,phone.Length - 1);
+                                    phone = phone.Substring(0, phone.Length - 1);
                                 }
                                 businessCardInfo.Phone = phone;
                             }
@@ -234,12 +232,12 @@ namespace OASystem.API.OAMethodLib.TencentCloudAPI
 
                                 if (tel.Length > 0)
                                 {
-                                    tel = tel.Substring(0,tel.Length - 1);
+                                    tel = tel.Substring(0, tel.Length - 1);
                                 }
                                 businessCardInfo.Tel = tel;
                             }
                         }
-                        
+
                         result.Data = businessCardInfo;
                         break;
                 }
@@ -328,7 +326,7 @@ namespace OASystem.API.OAMethodLib.TencentCloudAPI
             }
         }
 
-        
+
 
     }
 }

+ 1 - 4
OASystem/OASystem.Api/OAMethodLib/YouDaoAPI/YouDaoApiTools.cs

@@ -1,7 +1,4 @@
-using OASystem.Domain.ViewModels.JuHeExchangeRate;
-using System.Text.Json;
-
-namespace OASystem.API.OAMethodLib.YouDaoAPI
+namespace OASystem.API.OAMethodLib.YouDaoAPI
 {
     /// <summary>
     /// 有道API Tools

+ 14 - 31
OASystem/OASystem.Api/Program.cs

@@ -1,35 +1,18 @@
-
-using StackExchange.Redis;
-using Autofac.Core;
-using OASystem.API;
-using OASystem.RedisRepository.RedisAsyncHelper;
-using OASystem.RedisRepository.Config;
-using OASystem.API.OAMethodLib;
+using Microsoft.AspNetCore.Http.Connections;
 using Microsoft.AspNetCore.Http.Features;
 using Microsoft.AspNetCore.Server.Kestrel.Core;
+using Microsoft.Extensions.DependencyInjection.Extensions;
+using OASystem.API.Middlewares;
+using OASystem.API.OAMethodLib;
+using OASystem.API.OAMethodLib.Hub.Hubs;
 using OASystem.API.OAMethodLib.JuHeAPI;
-using OASystem.API.OAMethodLib.YouDaoAPI;
-using Quartz.Impl;
-using Quartz.Spi;
-using Quartz;
-using QuzrtzJob.Factory;
-using System.Runtime.CompilerServices;
 using OASystem.API.OAMethodLib.QiYeWeChatAPI;
 using OASystem.API.OAMethodLib.Quartz.Jobs;
-using Microsoft.AspNetCore.Cors.Infrastructure;
-using Microsoft.AspNetCore.SignalR;
-using SqlSugar.DistributedSystem.Snowflake;
-using Microsoft.AspNetCore.Http.Connections;
-using OASystem.API.OAMethodLib.Hub.Hubs;
-using Microsoft.Extensions.DependencyInjection.Extensions;
 using OASystem.API.OAMethodLib.SignalR.HubService;
-using OASystem.API.OAMethodLib.Auth;
-using OASystem.API.OAMethodLib.Hub.HubClients;
-using Microsoft.Extensions.Options;
-using Microsoft.AspNetCore.Identity;
-using static OpenAI.GPT3.ObjectModels.SharedModels.IOpenAiModels;
-using OASystem.API.Middlewares;
-using Microsoft.Extensions.DependencyInjection;
+using Quartz;
+using Quartz.Impl;
+using Quartz.Spi;
+using QuzrtzJob.Factory;
 
 var builder = WebApplication.CreateBuilder(args);
 var basePath = AppContext.BaseDirectory;
@@ -110,11 +93,11 @@ builder.Services.Configure<KestrelServerOptions>(options =>
 #endregion
 
 #region 接口分组
-var groups = new List<Tuple<string, string>>
-{
-    //new Tuple<string, string>("Group1","分组一"),
-    //new Tuple<string, string>("Group2","分组二")
-};
+//var groups = new List<Tuple<string, string>>
+//{
+//    //new Tuple<string, string>("Group1","分组一"),
+//    //new Tuple<string, string>("Group2","分组二")
+//};
 #endregion
 
 #region 注入数据库

+ 1 - 2
OASystem/OASystem.Api/SwaggerApi.cs

@@ -1,10 +1,9 @@
 
 using Microsoft.AspNetCore.Mvc.ApiExplorer;
-using System.ComponentModel;
 
 namespace OASystem.API
 {
-    
+
     public class SwaggerApi : IDocumentFilter
     {
         [AttributeUsage(AttributeTargets.Method | AttributeTargets.Class)]

+ 17 - 4
OASystem/OASystem.Domain/Dtos/PersonnelModule/GoodsDTO.cs

@@ -96,7 +96,7 @@ namespace OASystem.Domain.Dtos.PersonnelModule
     /// <summary>
     /// 物品入库 操作(Create Or Edit)
     /// </summary>
-    public class GoodsStorageOPDTO
+    public class GoodsStorageOpDto
     {
         /// <summary>
         /// ID编号
@@ -145,10 +145,21 @@ namespace OASystem.Domain.Dtos.PersonnelModule
         /// </summary>
         public string? SupplierSource { get; set; }
 
+        /// <summary>
+        /// 入库人
+        /// </summary>
+        public int StorageUserId { get; set; }
+        
+        /// <summary>
+        /// 入库时间
+        /// eg:2024-10-01 15:00:00
+        /// </summary>
+        public string? StorageTime { get; set; }
+
         /// <summary>
         /// 备注
         /// </summary>
-        public string Remark { get; set; }
+        public string? Remark { get; set; }
 
     }
 
@@ -156,18 +167,20 @@ namespace OASystem.Domain.Dtos.PersonnelModule
     /// 物品入库 操作(Create Or Edit) 
     /// Validator
     /// </summary>
-    public class GoodsStorageOPDTOValidator : AbstractValidator<GoodsStorageOPDTO>
+    public class GoodsStorageOpDtoValidator : AbstractValidator<GoodsStorageOpDto>
     {
         /// <summary>
         /// 初始化
         /// </summary>
-        public GoodsStorageOPDTOValidator()
+        public GoodsStorageOpDtoValidator()
         {
             //RuleFor(x => x.CurrUserId).Must(x => x > 0).WithMessage("请传入当前登陆用户ID!");
             RuleFor(x => x.GoodsId).Must(x => x > 0).WithMessage("请传入有效的物品Id!");
             RuleFor(x => x.Quantity).Must(x => x > 0).WithMessage("请传入有效的物品数量!");
             RuleFor(x => x.UnitPrice).Must(x => x > 0).WithMessage("请传入有效的物品单价!");
             RuleFor(x => x.TotalPrice).Must(x => x > 0).WithMessage("请传入有效的物品价格合计!");
+            RuleFor(x => x.StorageUserId).Must(x => x > 0).WithMessage("请传入有效用户Id!");
+            RuleFor(x => x.StorageTime).NotEmpty().WithMessage("请传入有效的入库时间!");
         }
     }
 

+ 18 - 0
OASystem/OASystem.Domain/Entities/PersonnelModule/Pm_GoodsStorage.cs

@@ -19,6 +19,12 @@ namespace OASystem.Domain.Entities.PersonnelModule
         [SugarColumn(ColumnDescription = "商品Id", IsNullable = true, ColumnDataType = "int")]
         public int GoodsId { get; set; }
 
+        /// <summary>
+        /// 批次号
+        /// </summary>
+        [SugarColumn(ColumnDescription = "此次供应商名称", IsNullable = true, ColumnDataType = "varchar(50)")]
+        public string? BatchNo { get; set; }
+
         /// <summary>
         /// 此次入库数量
         /// </summary>
@@ -61,5 +67,17 @@ namespace OASystem.Domain.Entities.PersonnelModule
         [SugarColumn(ColumnDescription = "此次供应商来源", IsNullable = true, ColumnDataType = "varchar(200)")]
         public string? SupplierSource { get; set; }
 
+        /// <summary>
+        /// 入库人
+        /// </summary>
+        [SugarColumn(ColumnDescription = "入库人", IsNullable = true, ColumnDataType = "int")]
+        public int StorageUserId { get; set; }
+
+        /// <summary>
+        /// 入库时间
+        /// </summary>
+        [SugarColumn(ColumnDescription = "入库时间", IsNullable = true, ColumnDataType = "varchar(30)")]
+        public string? StorageTime { get; set; }
+
     }
 }

+ 0 - 2
OASystem/OASystem.Domain/ViewModels/Financial/Fin_ForeignReceivablesView.cs

@@ -97,7 +97,6 @@ namespace OASystem.Domain.ViewModels.Financial
         {
             get
             {
-
                 string str = "";
                 if (AddingWay == 0) str = "账单模块";
                 else if (AddingWay == 1) str = "成本预算模块";
@@ -215,7 +214,6 @@ namespace OASystem.Domain.ViewModels.Financial
         {
             get
             {
-
                 string str = "";
                 if (AddingWay == 0) str = "账单模块";
                 else if (AddingWay == 1) str = "成本预算模块";

+ 41 - 61
OASystem/OASystem.Infrastructure/Repositories/Groups/AirTicketResRepository.cs

@@ -1,35 +1,15 @@
 using AutoMapper;
-using Newtonsoft.Json.Linq;
 using Newtonsoft.Json;
+using Newtonsoft.Json.Linq;
 using OASystem.Domain;
 using OASystem.Domain.Dtos.Groups;
-using OASystem.Domain.Dtos.UserDto;
-using OASystem.Domain.Entities.Business;
 using OASystem.Domain.Entities.Customer;
+using OASystem.Domain.Entities.Financial;
 using OASystem.Domain.Entities.Groups;
 using OASystem.Domain.Entities.Resource;
 using OASystem.Domain.ViewModels.Groups;
-using OASystem.Infrastructure.Tools;
-using Org.BouncyCastle.Asn1.Ocsp;
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Linq;
-using System.Security.Cryptography;
-using System.Security.Policy;
-using System.Text;
-using System.Threading.Tasks;
-using System.Web;
-using System.Xml.Linq;
 using System.Net;
-using NPOI.XWPF.UserModel;
-using NPOI.OpenXmlFormats.Wordprocessing;
-using System.Collections;
-using Aspose.Words.Tables;
-using Aspose.Words;
-using System.Reflection;
-using OASystem.Domain.Entities.Financial;
-using NPOI.SS.Formula.Functions;
+using System.Security.Cryptography;
 
 namespace OASystem.Infrastructure.Repositories.Groups
 {
@@ -354,22 +334,22 @@ namespace OASystem.Infrastructure.Repositories.Groups
                 if (DiId.Length>1)
                 {
                     DiId = DiId.Substring(0, DiId.Length - 1);
-                
-                string sql = string.Format(@"select * from Grp_DelegationInfo where Id in({0}) and IsDel={1} Order By Id Desc", DiId, 0);
-                List<Grp_DelegationInfo> grp_Delegations = _sqlSugar.SqlQueryable<Grp_DelegationInfo>(sql).ToList();
-                    
+
+                    string sql = string.Format(@"select * from Grp_DelegationInfo where Id in({0}) and IsDel={1} Order By Id Desc", DiId, 0);
+                    List<Grp_DelegationInfo> grp_Delegations = _sqlSugar.SqlQueryable<Grp_DelegationInfo>(sql).ToList();
+
                     if (grp_Delegations.Count == 0)
-                {
-                    return result = new Result() { Code = -1, Msg = "查询失败!" };
-                }
-                
-                foreach (var item in grp_Delegations)
-                {
-                    GroupNameView groupNameView = new GroupNameView();
-                    groupNameView.Id = item.Id;
-                    groupNameView.GroupName = item.TeamName;
-                    grp_NameView.Add(groupNameView);
-                }
+                    {
+                        return result = new Result() { Code = -1, Msg = "查询失败!" };
+                    }
+
+                    foreach (var item in grp_Delegations)
+                    {
+                        GroupNameView groupNameView = new GroupNameView();
+                        groupNameView.Id = item.Id;
+                        groupNameView.GroupName = item.TeamName;
+                        grp_NameView.Add(groupNameView);
+                    }
                 }
                 #endregion
 
@@ -436,25 +416,25 @@ namespace OASystem.Infrastructure.Repositories.Groups
                     //}
                     //else//不存在,可添加
                     //{
-                        //grp_AirTicket.ArrivedTime = "";
-                        //grp_AirTicket.LeaveDescription = "";
-                        //grp_AirTicket.FlightsDescription = "";
-                        //grp_AirTicket.DeleteUserId = 0;
-                        //grp_AirTicket.DeleteTime = "";
-                        //grp_AirTicket.ReturnDescription = "";
-                        grp_AirTicket.FlightsDate= DateTime.Parse(grp_AirTicket.FlightsDate).ToString("yyyy-MM-dd");
-                        id = await AddAsyncReturnId(grp_AirTicket);
-                        if (id == 0)
-                        {
-                            result = new Result() { Code = -1, Msg = "添加失败!" };
+                    //grp_AirTicket.ArrivedTime = "";
+                    //grp_AirTicket.LeaveDescription = "";
+                    //grp_AirTicket.FlightsDescription = "";
+                    //grp_AirTicket.DeleteUserId = 0;
+                    //grp_AirTicket.DeleteTime = "";
+                    //grp_AirTicket.ReturnDescription = "";
+                    grp_AirTicket.FlightsDate = DateTime.Parse(grp_AirTicket.FlightsDate).ToString("yyyy-MM-dd");
+                    id = await AddAsyncReturnId(grp_AirTicket);
+                    if (id == 0)
+                    {
+                        result = new Result() { Code = -1, Msg = "添加失败!" };
 
-                        }
-                        else
-                        {
-                            result = new Result() { Code = 0, Msg = "添加成功!" };
-                        }
+                    }
+                    else
+                    {
+                        result = new Result() { Code = 0, Msg = "添加成功!" };
+                    }
 
-                   // }
+                    // }
                     if (result.Code == 0)
                     {
                         Grp_CreditCardPayment grp_CreditCard = _mapper.Map<Grp_CreditCardPayment>(dto.CardPaymentOpData);
@@ -464,11 +444,11 @@ namespace OASystem.Infrastructure.Repositories.Groups
                         else grp_CreditCard.IsPay = 0;
 
                         //获取新汇率  int diId,int CId, int currencyId
-                        var rate = await fn(dto.AirTicketResOpData.DiId,85,dto.AirTicketResOpData.Currency);
+                        var rate = await fn(dto.AirTicketResOpData.DiId, 85, dto.AirTicketResOpData.Currency);
 
                         if (rate.Code == 0)
                         {
-                            var rateInfo =  (rate.Data as CurrencyInfo);
+                            var rateInfo = (rate.Data as CurrencyInfo);
                             if (rateInfo is not null)
                             {
 
@@ -520,7 +500,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
                         //{
                         //    if (_GroupCostParameter != null)
                         //    {
-                               
+
                         //        if (Convert.ToDecimal(_GroupCostParameter.JJCCB) * Convert.ToDecimal(grp_AirTicket.ClientNum) > grp_CreditCard.RMBPrice)
                         //        {
                         //            grp_CreditCard.ExceedBudget = 0;// 超出预算比例 换算
@@ -539,7 +519,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
                         //            grp_CreditCard.AuditGMDate = "";
                         //            grp_CreditCard.IsPay = 0;
                         //        }
-                               
+
                         //    }
                         //    else
                         //    {
@@ -665,7 +645,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
                         TicketCode = dto.AirTicketResOpData.TicketCode,
                         Remark = dto.AirTicketResOpData.Remark,
                     });
-                    if (!res){result = new Result() { Code = -1, Msg = "修改失败!" }; }
+                    if (!res) { result = new Result() { Code = -1, Msg = "修改失败!" }; }
                     else { result = new Result() { Code = 0, Msg = "修改成功!" }; }
 
                     if (result.Code == 0)
@@ -845,7 +825,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
                             RMBPrice = grp_CreditCard.RMBPrice,
                             OrbitalPrivateTransfer = grp_CreditCard.OrbitalPrivateTransfer,
                             ExceedBudget = grp_CreditCard.ExceedBudget,
-                            Remark= grp_CreditCard.Remark,
+                            Remark = grp_CreditCard.Remark,
                         }).ExecuteCommandAsync();
                         if (CTable == 0)
                         {

+ 67 - 55
OASystem/OASystem.Infrastructure/Repositories/PersonnelModule/GoodsRepository.cs

@@ -1,15 +1,8 @@
-using OASystem.Domain.Entities.PersonnelModule;
-using OASystem.Domain.ViewModels.PersonnelModule;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using AutoMapper;
+using AutoMapper;
 using OASystem.Domain.Dtos.PersonnelModule;
-using SqlSugar;
-using NPOI.SS.Formula.Functions;
 using OASystem.Domain.Entities.Groups;
+using OASystem.Domain.Entities.PersonnelModule;
+using OASystem.Domain.ViewModels.PersonnelModule;
 
 namespace OASystem.Infrastructure.Repositories.PersonnelModule
 {
@@ -62,8 +55,17 @@ namespace OASystem.Infrastructure.Repositories.PersonnelModule
                                            .ToListAsync();
 
 
+            var userData = await _sqlSugar.Queryable<Sys_Users>()
+                .Where(x => x.IsDel == 0)
+                .Select(x => new
+                {
+                    x.Id,
+                    UserName = x.CnName,
+                })
+                .ToListAsync();
+
             _jv.Code = StatusCodes.Status200OK;
-            _jv.Data = new { goodsTypeData = typeData, groupNameData = groupData };
+            _jv.Data = new { goodsTypeData = typeData, groupNameData = groupData, userNameData = userData };
             _jv.Msg = $"操作成功";
             return _jv;
         }
@@ -71,14 +73,14 @@ namespace OASystem.Infrastructure.Repositories.PersonnelModule
         /// <summary>
         /// 物品列表
         /// </summary>
-        /// <param name="_dto"></param>
+        /// <param name="dto"></param>
         /// <returns></returns>
-        public async Task<JsonView> GoodsList(GoodsListDTO _dto)
+        public async Task<JsonView> GoodsList(GoodsListDTO dto)
         {
             var ids = new List<int>();
-            if (!string.IsNullOrEmpty(_dto.TypeIds))
+            if (!string.IsNullOrEmpty(dto.TypeIds))
             {
-                var strArray = _dto.TypeIds.Split(',');
+                var strArray = dto.TypeIds.Split(',');
                 foreach (var str in strArray)
                 {
                     if (int.TryParse(str, out int id))
@@ -94,7 +96,7 @@ namespace OASystem.Infrastructure.Repositories.PersonnelModule
                                       .LeftJoin<Sys_Users>((gi, sd, u) => gi.LastUpdateUserId == u.Id)
                                       .Where((gi, sd, u) => gi.IsDel == 0)
                                       .WhereIF(ids.Count > 0, (gi, sd, u) => ids.Contains(gi.Type))
-                                      .WhereIF(!string.IsNullOrEmpty(_dto.GoodsName), (gi, sd, u) => gi.Name.Contains(_dto.GoodsName))
+                                      .WhereIF(!string.IsNullOrEmpty(dto.GoodsName), (gi, sd, u) => gi.Name.Contains(dto.GoodsName))
                                       .Select((gi, sd, u) => new
                                       {
                                           gi.Id,
@@ -107,7 +109,7 @@ namespace OASystem.Infrastructure.Repositories.PersonnelModule
                                           gi.Remark,
                                       })
                                       .OrderByDescending(gi => gi.LastUpdateTime)
-                                      .ToPageListAsync(_dto.PageIndex, _dto.PageSize, total);
+                                      .ToPageListAsync(dto.PageIndex, dto.PageSize, total);
 
             _jv.Code = StatusCodes.Status200OK;
             _jv.Data = data;
@@ -119,7 +121,8 @@ namespace OASystem.Infrastructure.Repositories.PersonnelModule
         /// <summary>
         /// 物品Info
         /// </summary>
-        /// <param name="_dto"></param>
+        /// <param name="portType"></param>
+        /// <param name="id"></param>
         /// <returns></returns>
         public async Task<JsonView> GoodsInfo(int portType, int id)
         {
@@ -156,27 +159,27 @@ namespace OASystem.Infrastructure.Repositories.PersonnelModule
         /// <summary>
         /// 物品 OP(Create Or Edit)
         /// </summary>
-        /// <param name="_dto"></param>
+        /// <param name="dto"></param>
         /// <param name="currUserId"></param>
         /// <returns></returns>
-        public async Task<JsonView> GoodsOP(GoodsOPDTO _dto,int currUserId)
+        public async Task<JsonView> GoodsOp(GoodsOPDTO dto, int currUserId)
         {
             var info = new Pm_GoodsInfo()
             {
-                Id = _dto.Id,
-                Name = _dto.Name,
-                Type = _dto.Type,
+                Id = dto.Id,
+                Name = dto.Name,
+                Type = dto.Type,
                 SQ_Total = 0,
                 OQ_Total = 0,
                 PriceTotal = 0,
                 StockQuantity = 0,
-                Remark = _dto.Remark,
+                Remark = dto.Remark,
                 LastUpdateUserId = currUserId,
                 LastUpdateTime = DateTime.Now,
                 CreateUserId = currUserId
             };
 
-            if (_dto.Id > 0) //Edit
+            if (dto.Id > 0) //Edit
             {
                 var upd = await _sqlSugar.Updateable(info)
                                          .UpdateColumns(x => new
@@ -195,7 +198,7 @@ namespace OASystem.Infrastructure.Repositories.PersonnelModule
                     return _jv;
                 }
             }
-            else if (_dto.Id < 1) //添加
+            else if (dto.Id < 1) //添加
             {
                 var selectInfo = await _sqlSugar.Queryable<Pm_GoodsInfo>().FirstAsync(x => x.Name.Equals(info.Name));
                 if (selectInfo != null)
@@ -269,17 +272,18 @@ namespace OASystem.Infrastructure.Repositories.PersonnelModule
         /// <summary>
         /// 物品入库列表
         /// </summary>
-        /// <param name="_dto"></param>
+        /// <param name="dto"></param>
         /// <returns></returns>
-        public async Task<JsonView> GoodsStorageList(GoodsStorageListDTO _dto)
+        public async Task<JsonView> GoodsStorageList(GoodsStorageListDTO dto)
         {
             RefAsync<int> total = 0;
             var data = await _sqlSugar.Queryable<Pm_GoodsStorage>()
                                       .LeftJoin<Pm_GoodsInfo>((gs, gi) => gs.GoodsId == gi.Id)
                                       .LeftJoin<Sys_Users>((gs, gi, u) => gs.CreateUserId == u.Id)
-                                      .Where((gs, gi, u) => gs.IsDel == 0)
-                                      .WhereIF(_dto.GoodsId > 0, (gs, gi, u) => gs.GoodsId == _dto.GoodsId)
-                                      .Select((gs, gi, u) => new
+                                      .LeftJoin<Sys_Users>((gs, gi, u,u1) => gs.StorageUserId == u1.Id)
+                                      .Where((gs, gi, u,u1) => gs.IsDel == 0)
+                                      .WhereIF(dto.GoodsId > 0, (gs, gi, u,u1) => gs.GoodsId == dto.GoodsId)
+                                      .Select((gs, gi, u, u1) => new
                                       {
                                           gs.Id,
                                           gs.GoodsId,
@@ -291,11 +295,13 @@ namespace OASystem.Infrastructure.Repositories.PersonnelModule
                                           gs.SupplierTel,
                                           gs.SupplierAddress,
                                           gs.SupplierSource,
+                                          StorageUserName=u1.CnName,
+                                          gs.StorageTime,
                                           CreateUserName = u.CnName,
                                           gs.CreateTime,
                                       })
                                       .OrderByDescending(gs => gs.CreateTime)
-                                      .ToPageListAsync(_dto.PageIndex, _dto.PageSize, total);
+                                      .ToPageListAsync(dto.PageIndex, dto.PageSize, total);
 
 
             _jv.Code = StatusCodes.Status200OK;
@@ -315,9 +321,10 @@ namespace OASystem.Infrastructure.Repositories.PersonnelModule
             var data = await _sqlSugar.Queryable<Pm_GoodsStorage>()
                                       .LeftJoin<Pm_GoodsInfo>((gs, gi) => gs.GoodsId == gi.Id)
                                       .LeftJoin<Sys_Users>((gs, gi, u) => gs.CreateUserId == u.Id)
+                                      .LeftJoin<Sys_Users>((gs, gi, u, u1) => gs.StorageUserId == u1.Id)
                                       .Where((gs, gi, u) => gs.IsDel == 0)
                                       .WhereIF(id > 0, (gs, gi, u) => gs.Id == id)
-                                      .Select((gs, gi, u) => new
+                                      .Select((gs, gi, u, u1) => new
                                       {
                                           gs.Id,
                                           gs.GoodsId,
@@ -329,6 +336,8 @@ namespace OASystem.Infrastructure.Repositories.PersonnelModule
                                           gs.SupplierTel,
                                           gs.SupplierAddress,
                                           gs.SupplierSource,
+                                          StorageUser = u1.CnName,
+                                          gs.StorageTime,
                                           CreateUserName = u.CnName,
                                           gs.CreateTime,
                                           gs.Remark
@@ -344,27 +353,28 @@ namespace OASystem.Infrastructure.Repositories.PersonnelModule
         /// <summary>
         /// 物品入库 操作(Create Or Edit)
         /// </summary>
-        /// <param name="_dto"></param>
+        /// <param name="dto"></param>
         /// <param name="currUserId"></param>
         /// <returns></returns>
-        public async Task<JsonView> GoodsStorageOP(GoodsStorageOPDTO _dto,int currUserId)
+        public async Task<JsonView> GoodsStorageOp(GoodsStorageOpDto dto, int currUserId)
         {
-            var info = _mapper.Map<Pm_GoodsStorage>(_dto);
+            var info = _mapper.Map<Pm_GoodsStorage>(dto);
             info.CreateUserId = currUserId;
+            info.BatchNo = Guid.NewGuid().ToString("N");
 
-            decimal editAgoQauntity = 0.00M,
+            decimal editAgoQuantity = 0.00M,
                     editAgoTotalPrice = 0.00M;
 
             _sqlSugar.BeginTran();
             if (info.Id > 0) //修改
             {
                 var selectInfo = await _sqlSugar.Queryable<Pm_GoodsStorage>()
-                                                .Where(x => x.Id == _dto.Id)
+                                                .Where(x => x.Id == dto.Id)
                                                 .FirstAsync();
-                editAgoQauntity = selectInfo.Quantity;
+                editAgoQuantity = selectInfo.Quantity;
                 editAgoTotalPrice = selectInfo.TotalPrice;
 
-                var stoageEdit = await _sqlSugar.Updateable(info)
+                var storageEdit = await _sqlSugar.Updateable(info)
                                                 .UpdateColumns(x => new
                                                 {
                                                     x.Quantity,
@@ -374,10 +384,12 @@ namespace OASystem.Infrastructure.Repositories.PersonnelModule
                                                     x.SupplierTel,
                                                     x.SupplierAddress,
                                                     x.SupplierSource,
+                                                    x.StorageUserId,
+                                                    x.StorageTime
                                                 })
-                                                .Where(x => x.Id == _dto.Id)
+                                                .Where(x => x.Id == dto.Id)
                                                 .ExecuteCommandAsync();
-                if (stoageEdit < 1)
+                if (storageEdit < 1)
                 {
                     _sqlSugar.RollbackTran();
                     _jv.Msg = $"修改失败!";
@@ -386,8 +398,8 @@ namespace OASystem.Infrastructure.Repositories.PersonnelModule
             }
             else if (info.Id < 1) //添加
             {
-                var stoageAdd = await _sqlSugar.Insertable(info).ExecuteCommandAsync();
-                if (stoageAdd < 1)
+                var storageAdd = await _sqlSugar.Insertable(info).ExecuteCommandAsync();
+                if (storageAdd < 1)
                 {
                     _sqlSugar.RollbackTran();
                     _jv.Msg = $"添加失败!";
@@ -396,8 +408,8 @@ namespace OASystem.Infrastructure.Repositories.PersonnelModule
             }
 
             var goodsInfo = await _sqlSugar.Queryable<Pm_GoodsInfo>().FirstAsync(x => x.Id == info.GoodsId);
-            goodsInfo.SQ_Total = goodsInfo.SQ_Total - editAgoQauntity + info.Quantity;
-            goodsInfo.StockQuantity = goodsInfo.StockQuantity - editAgoQauntity + info.Quantity;
+            goodsInfo.SQ_Total = goodsInfo.SQ_Total - editAgoQuantity + info.Quantity;
+            goodsInfo.StockQuantity = goodsInfo.StockQuantity - editAgoQuantity + info.Quantity;
             goodsInfo.PriceTotal = goodsInfo.PriceTotal - editAgoTotalPrice + info.TotalPrice;
             goodsInfo.LastUpdateUserId = currUserId;
             goodsInfo.LastUpdateTime = DateTime.Now;
@@ -495,9 +507,9 @@ namespace OASystem.Infrastructure.Repositories.PersonnelModule
         /// <summary>
         /// 物品领用列表
         /// </summary>
-        /// <param name="_dto"></param>
+        /// <param name="dto"></param>
         /// <returns></returns>
-        public async Task<JsonView> GoodsReceiveList(GoodsReceiveListDTO _dto)
+        public async Task<JsonView> GoodsReceiveList(GoodsReceiveListDTO dto)
         {
             RefAsync<int> total = 0;
             var data = await _sqlSugar.Queryable<Pm_GoodsReceive>()
@@ -505,8 +517,8 @@ namespace OASystem.Infrastructure.Repositories.PersonnelModule
                                       .LeftJoin<Sys_Users>((gr, gi, u1) => gr.AuditUserId == u1.Id)
                                       .LeftJoin<Sys_Users>((gr, gi, u1, u2) => gr.CreateUserId == u2.Id)
                                       .Where((gr, gi, u1, u2) => gr.IsDel == 0)
-                                      .WhereIF(_dto.GoodsId > 0, (gr, gi, u1, u2) => gr.GoodsId == _dto.GoodsId)
-                                      .WhereIF(_dto.GoodsId > 0, (gr, gi, u1, u2) => gr.CreateUserId == _dto.CurrUserId)
+                                      .WhereIF(dto.GoodsId > 0, (gr, gi, u1, u2) => gr.GoodsId == dto.GoodsId)
+                                      .WhereIF(dto.GoodsId > 0, (gr, gi, u1, u2) => gr.CreateUserId == dto.CurrUserId)
                                       .Select((gr, gi, u1, u2) => new GoodsReceiveListView
                                       {
                                           Id = gr.Id,
@@ -525,7 +537,7 @@ namespace OASystem.Infrastructure.Repositories.PersonnelModule
                                           CreateTime = gr.CreateTime
                                       })
                                       .OrderByDescending(gr => gr.CreateTime)
-                                      .ToPageListAsync(_dto.PageIndex, _dto.PageSize, total);
+                                      .ToPageListAsync(dto.PageIndex, dto.PageSize, total);
 
             _jv.Code = StatusCodes.Status200OK;
             _jv.Data = data;
@@ -576,12 +588,12 @@ namespace OASystem.Infrastructure.Repositories.PersonnelModule
         /// <summary>
         /// 物品领用 OP(Add Or Edit)
         /// </summary>
-        /// <param name="_dto"></param>
+        /// <param name="dto"></param>
         /// <param name="currUserId"></param>
         /// <returns></returns>
-        public async Task<JsonView> GoodsReceiveOP(GoodsReceiveOPDTO _dto,int currUserId)
+        public async Task<JsonView> GoodsReceiveOP(GoodsReceiveOPDTO dto, int currUserId)
         {
-            var info = _mapper.Map<Pm_GoodsReceive>(_dto);
+            var info = _mapper.Map<Pm_GoodsReceive>(dto);
             info.CreateUserId = currUserId;
             _sqlSugar.BeginTran();
 
@@ -593,7 +605,7 @@ namespace OASystem.Infrastructure.Repositories.PersonnelModule
             //待审核 该物品数量
             var waitAuditQuantity = await _sqlSugar.Queryable<Pm_GoodsReceive>()
                                                    .Where(x => x.IsDel == 0 &&
-                                                               x.GoodsId == _dto.GoodsId &&
+                                                               x.GoodsId == dto.GoodsId &&
                                                                x.AuditStatus == GoodsAuditEnum.Pending
                                                     )
                                                    .SumAsync(x => x.Quantity);