Переглянути джерело

优化代码结构和注释,提升可读性和性能

主要更改:
- 删除和注释掉未使用的代码和变量
- 添加和修改 XML 注释
- 将同步方法改为异步方法
- 修改变量处理逻辑
- 删除不必要的 `using` 语句
- 格式化代码以符合编码规范
- 更新包引用,移除不再使用的包
LEIYI 3 місяців тому
батько
коміт
9866d41b20
38 змінених файлів з 436 додано та 447 видалено
  1. 0 1
      OASystem/OASystem.Api/Controllers/AuthController.cs
  2. 1 3
      OASystem/OASystem.Api/Controllers/BusinessController.cs
  3. 6 0
      OASystem/OASystem.Api/Controllers/CRMController.cs
  4. 10 7
      OASystem/OASystem.Api/Controllers/ClientHubController.cs
  5. 8 11
      OASystem/OASystem.Api/Controllers/FinancialController.cs
  6. 32 37
      OASystem/OASystem.Api/Controllers/GroupsController.cs
  7. 15 9
      OASystem/OASystem.Api/Controllers/PersonnelModuleController.cs
  8. 75 77
      OASystem/OASystem.Api/Controllers/ResourceController.cs
  9. 37 55
      OASystem/OASystem.Api/Controllers/StatisticsController.cs
  10. 81 97
      OASystem/OASystem.Api/Controllers/SystemController.cs
  11. 9 3
      OASystem/OASystem.Api/Middlewares/RecordAPIOperationMiddleware.cs
  12. 1 1
      OASystem/OASystem.Api/OAMethodLib/ChatGPT/ChatGPTTools.cs
  13. 1 1
      OASystem/OASystem.Api/OAMethodLib/ExcelOutput/Excel_BusConfItemList.cs
  14. 2 1
      OASystem/OASystem.Api/OAMethodLib/File/AsposeHelper.cs
  15. 18 16
      OASystem/OASystem.Api/OAMethodLib/GeneralMethod.cs
  16. 1 0
      OASystem/OASystem.Api/OAMethodLib/GroupStepForDelegation.cs
  17. 4 4
      OASystem/OASystem.Api/OAMethodLib/IOOperatorHelper.cs
  18. 30 37
      OASystem/OASystem.Api/OAMethodLib/PayrollComputation.cs
  19. 9 4
      OASystem/OASystem.Api/OAMethodLib/QiYeWeChatAPI/AppNotice/Config.cs
  20. 14 7
      OASystem/OASystem.Api/OAMethodLib/QiYeWeChatAPI/AppNotice/Library.cs
  21. 7 1
      OASystem/OASystem.Api/OAMethodLib/QiYeWeChatAPI/IQiYeWeChatApiService.cs
  22. 1 1
      OASystem/OASystem.Api/OAMethodLib/Quartz/Business/TaskAssignment.cs
  23. 12 12
      OASystem/OASystem.Api/OAMethodLib/Quartz/Business/TaskNotification.cs
  24. 1 1
      OASystem/OASystem.Api/OAMethodLib/Quartz/QuartzFactory.cs
  25. 31 3
      OASystem/OASystem.Api/OAMethodLib/SignalR/HubClients/IChatClient.cs
  26. 1 2
      OASystem/OASystem.Api/OAMethodLib/SignalR/Hubs/ChatHub.cs
  27. 3 2
      OASystem/OASystem.Api/OAMethodLib/TencentCloudAPI/TencentOCRTools.cs
  28. 1 1
      OASystem/OASystem.Domain/Dtos/PersonnelModule/TaskAllocationDto.cs
  29. 2 1
      OASystem/OASystem.Domain/Enums/EnumHelper.cs
  30. 4 3
      OASystem/OASystem.Infrastructure/OASystem.Infrastructure.csproj
  31. 2 2
      OASystem/OASystem.Infrastructure/Repositories/Business/CommonBusRepository.cs
  32. 0 1
      OASystem/OASystem.Infrastructure/Repositories/CRM/NewClientDataRepository.cs
  33. 1 2
      OASystem/OASystem.Infrastructure/Repositories/Groups/VisaFeeInfoRepository.cs
  34. 1 1
      OASystem/OASystem.Infrastructure/Repositories/Login/LoginRepository.cs
  35. 0 1
      OASystem/OASystem.Infrastructure/Repositories/Resource/CarDataRepository.cs
  36. 0 1
      OASystem/OASystem.Infrastructure/Repositories/Resource/HotelDataRepository.cs
  37. 1 2
      OASystem/OASystem.Infrastructure/Repositories/Resource/ResItemInfoRepository.cs
  38. 14 39
      OASystem/OASystem.Infrastructure/Tools/CommonFun.cs

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

@@ -23,7 +23,6 @@ using OASystem.Domain.Entities.Groups;
 using OASystem.Domain.Entities.Customer;
 using static QRCoder.PayloadGenerator.SwissQrCode;
 using OASystem.Domain.AesEncryption;
-using XAct;
 using Microsoft.Extensions.Configuration;
 using OASystem.Domain.Attributes;
 

+ 1 - 3
OASystem/OASystem.Api/Controllers/BusinessController.cs

@@ -118,7 +118,6 @@ namespace OASystem.API.Controllers
         /// <summary>
         /// 获取团组指向分类
         /// </summary>
-        /// <param name="_dto">参数Json字符串</param>
         /// <returns></returns>
         [HttpPost]
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
@@ -404,7 +403,6 @@ namespace OASystem.API.Controllers
         /// <summary>
         /// 获取会务活动列表
         /// </summary>
-        /// <param name="paras"></param>
         /// <returns></returns>
         [HttpPost]
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
@@ -500,7 +498,7 @@ Where c.ConfListId = {0}", ConfId);
                 return Ok(JsonView(rstUpdate == 0));
             }
 
-            return Ok(JsonView(false));
+            //return Ok(JsonView(false));
         }
 
         /// <summary>

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

@@ -21,11 +21,17 @@ namespace OASystem.API.Controllers
         private readonly CustomerSchoolRepository _customerSchoolRep;
         private readonly CustomerCompanyRepository _customerCompanyRep;
         private readonly GeocodeService _geocodeService;
+
         /// <summary>
         /// 初始化
         /// </summary>
         /// <param name="clientCompanyRepository"></param>
         /// <param name="clientRepository"></param>
+        /// <param name="customerCertRep"></param>
+        /// <param name="customerFamilyRep"></param>
+        /// <param name="customerSchoolRep"></param>
+        /// <param name="customerCompanyRep"></param>
+        /// <param name="geocodeService"></param>
         public CRMController(
             VisaDeleClientCompanyRepository clientCompanyRepository, 
             VisaDeleClientRepository clientRepository,

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

@@ -15,6 +15,11 @@ namespace OASystem.API.Controllers
         private readonly ILogger<ClientHubController> _logger;
         private readonly IHubContext<ChatHub, IChatClient> _hubContext;
 
+        /// <summary>
+        /// 
+        /// </summary>
+        /// <param name="logger"></param>
+        /// <param name="hubContext"></param>
         public ClientHubController(ILogger<ClientHubController> logger, IHubContext<ChatHub, IChatClient> hubContext)
         {
             _logger = logger;
@@ -35,9 +40,7 @@ namespace OASystem.API.Controllers
         /// <summary>
         /// 发送消息给客户端
         /// </summary>
-        /// <param name="userid"></param>
-        /// <param name="date"></param>
-        /// <param name="hubContext"></param>
+        /// <param name="msg"></param>
         /// <returns></returns>
         [HttpPost("SendAllUserMessage", Name = "SendAllUserMessage")]
         public async Task<IActionResult> SendAllUserMessage(string msg)
@@ -49,9 +52,9 @@ namespace OASystem.API.Controllers
         /// <summary>
         /// 发送指定的消息给指定的客户端
         /// </summary>
-        /// <param name="userid"></param>
-        /// <param name="date"></param>
-        /// <param name="hubContext"></param>
+        /// <param name="userIds"></param>
+        /// <param name="title"></param>
+        /// <param name="content"></param>
         /// <returns></returns>
         [HttpPost("SendCustomUserMessage", Name = "SendCustomUserMessage")]
         public async Task<IActionResult> SendCustomUserMessage(List<int> userIds, string title, string content)
@@ -70,7 +73,7 @@ namespace OASystem.API.Controllers
 
             //await _hubContext.Clients.Client(connId).ReceiveMessage(date);
 
-            GeneralMethod.MessageIssueAndNotification(MessageTypeEnum.Announcement, title, content, userIds);
+            await GeneralMethod.MessageIssueAndNotification(MessageTypeEnum.Announcement, title, content, userIds);
 
             return Ok("Send Successful!");
         }

+ 8 - 11
OASystem/OASystem.Api/Controllers/FinancialController.cs

@@ -379,7 +379,6 @@ namespace OASystem.API.Controllers
         /// 日付申请 
         /// 总经理未审核 日付信息
         /// </summary>
-        /// <param name="dto"> dto </param>
         /// <returns></returns>
         [HttpGet]
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
@@ -878,7 +877,6 @@ namespace OASystem.API.Controllers
         /// File Download
         /// Init 
         /// </summary>
-        /// <param name="dto"></param>
         /// <returns></returns>
         [HttpPost]
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
@@ -1962,7 +1960,7 @@ namespace OASystem.API.Controllers
                     string str_client = string.Empty;
                     decimal sum_refund = 0M; //收款退还
                     decimal sum_extra = 0M; //超支费用
-                    decimal balance = 0M;
+                    //decimal balance = 0M;
                     string str_schedule = string.Empty;
 
                     //1.应收
@@ -2152,7 +2150,6 @@ namespace OASystem.API.Controllers
         /// 付款申请
         /// 基础数据
         /// </summary>
-        /// <param name="dto"></param>
         /// <returns></returns>
         [HttpPost]
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
@@ -2273,7 +2270,9 @@ namespace OASystem.API.Controllers
         /// 付款申请(团组费用申请相关) 
         /// 查询 根据日期范围
         /// </summary>
+        /// <param name="status"></param>
         /// <param name="_groupIds"></param>
+        /// <param name="_hotelSubIds"></param>
         /// <param name="beginDt"></param>
         /// <param name="endDt"></param>
         /// <returns></returns>
@@ -2619,6 +2618,7 @@ namespace OASystem.API.Controllers
         /// 付款申请(日付申请相关)
         /// 查询 根据日期范围
         /// </summary>
+        /// <param name="status"></param>
         /// <param name="_dailyIds"></param>
         /// <param name="beginDt"></param>
         /// <param name="endDt"></param>
@@ -4479,8 +4479,9 @@ Group by PriceType ", dto.diId);
         ///将指定的Excel的文件转换成DataTable(Excel的第一个sheet)
         /// </summary>
         /// <param name="fullFielPath">文件的绝对路径</param>
+        /// <param name="sheetName"></param>
         /// <returns></returns>
-        private DataTable WorksheetToTable(string fullFielPath, string sheetName = null)
+        private DataTable WorksheetToTable(string fullFielPath, string? sheetName = null)
         {
             //如果是“EPPlus”,需要指定LicenseContext。
             //EPPlus.Core 不需要指定。
@@ -4593,10 +4594,6 @@ Group by PriceType ", dto.diId);
         /// <summary>
         /// 信用卡对账--基础数据
         /// </summary>
-        /// <param name="file"></param>
-        /// <param name="cardType"></param>
-        /// <param name="beginDt"></param>
-        /// <param name="endDt"></param>
         /// <returns></returns>
         [HttpPost]
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
@@ -5023,7 +5020,7 @@ Group by PriceType ", dto.diId);
 
                     foreach (DataRow item in dt1.Rows)
                     {
-                        if (item["TradingDay"] == "" && item["RMBMoney"] == "")
+                        if (item["TradingDay"].ToString() == "" && item["RMBMoney"].ToString() == "")
                         {
                             continue;
                         }
@@ -5265,7 +5262,6 @@ Group by PriceType ", dto.diId);
         /// </summary>
         /// <param name="pathName">带路径的Excel文件名</param>
         /// <param name="sheetName">工作表名</param>
-        /// <param name="tbContainer">将数据存入的DataTable</param>
         /// <returns></returns>
         public static DataTable ExcelToDataTable(string pathName, string sheetName="")
         {
@@ -6383,6 +6379,7 @@ Group by PriceType ", dto.diId);
         /// </summary>
         /// <param name="beginDt"></param>
         /// <param name="endDt"></param>
+        /// <param name="teamName"></param>
         /// <returns></returns>
         [HttpGet]
         public async Task<IActionResult> GroupUnAuditFeeList(string beginDt, string endDt, string teamName)

+ 32 - 37
OASystem/OASystem.Api/Controllers/GroupsController.cs

@@ -254,7 +254,7 @@ namespace OASystem.API.Controllers
         /// <summary>
         /// 获取团组流程管控信息
         /// </summary>
-        /// <param name="paras">参数Json字符串</param>
+        /// <param name="_jsonDto"></param>
         /// <returns></returns>
         [HttpPost]
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
@@ -293,7 +293,7 @@ namespace OASystem.API.Controllers
         /// <summary>
         /// 修改团组流程管控详细表数据
         /// </summary>
-        /// <param name="paras"></param>
+        /// <param name="dto"></param>
         /// <returns></returns>
         [HttpPost]
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
@@ -1831,7 +1831,6 @@ FROM
         /// <summary>
         /// 团组任务分配初始化
         /// </summary>
-        /// <param name="dto"></param>
         /// <returns></returns>
         [HttpPost]
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
@@ -2003,7 +2002,7 @@ FROM
         /// <summary>
         /// 获取团组费用审核
         /// </summary>
-        /// <param name="paras">参数Json字符串</param>
+        /// <param name="_dto"></param>
         /// <returns></returns>
         [HttpPost]
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
@@ -4372,7 +4371,7 @@ FROM
         /// <summary>
         /// 文件上传多个文件  可以带参数
         /// </summary>
-        /// <param name="file"></param>
+        /// <param name="files"></param>
         /// <returns></returns>
         [HttpPost]
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
@@ -4457,7 +4456,7 @@ FROM
         /// 商邀费用列表
         /// 下载文件
         /// </summary>
-        /// <param name="dto"></param>
+        /// <param name="id"></param>
         /// <returns></returns>
         [HttpGet("{id}")]
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
@@ -4515,7 +4514,6 @@ FROM
         /// <summary>
         /// 商邀费用 Info Page 基础数据源
         /// </summary>
-        /// <param name="dto"></param>
         /// <returns></returns>
         [HttpPost]
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
@@ -5389,7 +5387,8 @@ FROM
 
                 };
 
-            var _currencyRate = await _juHeApi.PostItemRateAsync(_currencyInfos.Select(it => it.CurrencyCode).ToArray());
+            string[] currencyCodeArray = _currencyInfos.Select(it => it.CurrencyCode).ToArray();
+            var _currencyRate = await _juHeApi.PostItemRateAsync(currencyCodeArray);
             if (_currencyRate.Count > 0)
             {
                 foreach (var item in _currencyInfos)
@@ -6673,7 +6672,7 @@ FROM
 
                         string missionLeader = "";  //团负责人默认接团客户名单第一个人
                         string missionLeaderJob = "";//负责人job
-                        int groupNumber = 0; //团人数
+                        //int groupNumber = 0; //团人数
                         if (DeleClientList.Count > 0)
                         {
                             missionLeader = DeleClientList[0]?.Name ?? "";
@@ -6802,8 +6801,8 @@ FROM
 
                         //国际旅费
 
-                        string outsideJJ = "";
-                        string allPriceJJ = "";
+                        //string outsideJJ = "";
+                        //string allPriceJJ = "";
                         if (_EnterExitCosts.SumJJC == 1 && _EnterExitCosts.SumGWC == 0)
                         {
                             dic.Add("AirFeeTotal", _EnterExitCosts.AirJJ.ToString("#0.00"));
@@ -6935,7 +6934,8 @@ FROM
                         var Names = string.Join("、", DeleClientList.Select(x => x.Name)).TrimEnd('、');
                         dic.Add("Names", Names);
 
-                        int accommodationRows = 12, foodandotherRows = 12;
+                        int accommodationRows = 12;
+                        //int foodandotherRows = 12;
                         var Dac1currCn = dac1.GroupBy(x => x.Currency).Select(x => x.Key).ToList();
                         var Dac2currCn = dac2.GroupBy(x => x.Currency).Select(x => x.Key).ToList();
 
@@ -8698,9 +8698,9 @@ FROM
                         dic.Add("GroupName", "-");
                         dic.Add("ClientUnit", "-");
 
-                        string missionLeader = "";  //团负责人默认接团客户名单第一个人
-                        string missionLeaderJob = "";//负责人job
-                        int groupNumber = 0; //团人数
+                        //string missionLeader = "";  //团负责人默认接团客户名单第一个人
+                        //string missionLeaderJob = "";//负责人job
+                        //int groupNumber = 0; //团人数
                         
                         dic.Add("MissionLeader", "-"); //团负责人
                         dic.Add("MissionLeaderJob", "-"); //团负责人job
@@ -8739,8 +8739,8 @@ FROM
 
                         //国际旅费
 
-                        string outsideJJ = "";
-                        string allPriceJJ = "";
+                        //string outsideJJ = "";
+                        //string allPriceJJ = "";
                         if (_EnterExitCosts.SumJJC == 1 && _EnterExitCosts.SumGWC == 0)
                         {
                             dic.Add("AirFeeTotal", _EnterExitCosts.AirJJ.ToString("#0.00"));
@@ -8887,7 +8887,6 @@ FROM
         /// <summary>
         /// 团组模块 - 出入境费用-草稿 - 导入正式出入境费用基础数据
         /// </summary>
-        /// <param name="dto"></param>
         /// <returns></returns>
         [HttpPost]
         public async Task<IActionResult> EnterExitCostDraftImportDataInit()
@@ -10960,11 +10959,11 @@ WHERE
 
         #region op
 
-       
+
         /// <summary>
         /// 移动端更新费用消息通知
         /// </summary>
-        /// <param name="diid"></param>
+        /// <param name="draftId"></param>
         /// <param name="id"></param>
         /// <param name="currUserId"></param>
         private async Task EnterExitCostDraftMobileOpNotice(int draftId, int id, int currUserId)
@@ -11871,7 +11870,6 @@ WHERE
         /// 签证提成录入 
         /// 基础数据
         /// </summary>
-        /// <param name="_dto"></param>
         /// <returns></returns>
         [HttpGet]
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
@@ -13745,7 +13743,7 @@ WHERE
                         #region 企微通知对应岗位用户
                         try
                         {
-                            AppNoticeLibrary.SendUserMsg_GroupShare_ToJob(dto.Diid);
+                            await AppNoticeLibrary.SendUserMsg_GroupShare_ToJob(dto.Diid);
                         }
                         catch (Exception ex)
                         {
@@ -16021,7 +16019,7 @@ ORDER by  gctggrc.id DESC
                     DataId = hotelId,
                     CreateUserId = _dto.UserId
                 };
-                var opStatus = OperationEnum.NoOperation;
+                //var opStatus = OperationEnum.NoOperation;
                 if (_dto.Id<1) //添加操作
                 {
                     opInfo.OperationItem = OperationEnum.Add;
@@ -16108,7 +16106,8 @@ ORDER by  gctggrc.id DESC
         /// 酒店自动审核测试
         /// Add Or Edit 
         /// </summary>
-        /// <param name="_dto"></param>
+        /// <param name="diid"></param>
+        /// <param name="dataId"></param>
         /// <returns></returns>
         [HttpPost]
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
@@ -16490,7 +16489,7 @@ ORDER by  gctggrc.id DESC
             #region 数据处理
 
             List<int> guestIds = new List<int>();
-            int index = 0;
+            //int index = 0;
             foreach (var item in hrDtas)
             {
                 if (item.GuestName.Contains(","))
@@ -17344,9 +17343,9 @@ ORDER by  gctggrc.id DESC
 
 
                 hrDtas = hrDtas.OrderBy(it => it.CheckInDate).ToList();
-                string strFileName = "HotelStatement/";
+                //string strFileName = "HotelStatement/";
 
-                string guestNames = ""; //格式Mr.xxx Ms.xxx
+                //string guestNames = ""; //格式Mr.xxx Ms.xxx
                 List<HotelReservations_PCFD_View> pcfds = new List<HotelReservations_PCFD_View>();
                 var rateDatas = new List<dynamic>();
                 #region 数据处理
@@ -17815,7 +17814,7 @@ ORDER by  gctggrc.id DESC
             }
 
 
-            return Ok(JsonView(false));
+            //return Ok(JsonView(false));
         }
 
         /// <summary>
@@ -18363,7 +18362,6 @@ ORDER by  gctggrc.id DESC
         /// 接团客户名单
         /// 迁移数据(慎用!)
         /// </summary>
-        /// <param name="dto"></param>
         /// <returns></returns>
         [HttpPost]
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
@@ -18513,7 +18511,7 @@ ORDER by  gctggrc.id DESC
                 return Ok(JsonView(false, ex.Message));
             }
 
-            return Ok(JsonView(true));
+            //return Ok(JsonView(true));
 
         }
 
@@ -18528,7 +18526,7 @@ ORDER by  gctggrc.id DESC
         /// 接团客户名单
         /// 根据团组Id查询List
         /// </summary>
-        /// <param name="dto"></param>
+        /// <param name="_dto"></param>
         /// <returns></returns>
         [HttpPost]
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
@@ -19069,7 +19067,6 @@ ORDER by  gctggrc.id DESC
         /// 倒推表基础数据
         /// Init
         /// </summary>
-        /// <param name="dto"></param>
         /// <returns></returns>
         [HttpPost]
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
@@ -19264,7 +19261,6 @@ ORDER by  gctggrc.id DESC
         /// 酒店询价
         /// Init
         /// </summary>
-        /// <param name="dto"></param>
         /// <returns></returns>
         [HttpPost]
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
@@ -19583,7 +19579,7 @@ ORDER by  gctggrc.id DESC
             if (dto.PortType == 1 || dto.PortType == 2 || dto.PortType == 3) // web/Android
             {
                 var _view = await GeneralMethod.MateOpGroupPageListRedis();
-                string sqlWhere = "";
+                //string sqlWhere = "";
 
                 if (!string.IsNullOrEmpty(dto.Country))
                 {
@@ -21052,7 +21048,6 @@ And (UnitName != '' Or UnitName != null) {sqlWhere}");
         /// 团组接待意见调查 - 信息管理
         /// 基础数据(团组)
         /// </summary>
-        /// <param name="dto"></param>
         /// <returns></returns>
         [HttpGet]
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
@@ -21167,7 +21162,7 @@ And (UnitName != '' Or UnitName != null) {sqlWhere}");
         /// 团组接待意见调查 - 用户
         /// 列表
         /// </summary>
-        /// <param name="id"></param>
+        /// <param name="diId"></param>
         /// <returns></returns>
         [HttpGet("{diId}")]
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
@@ -21224,7 +21219,7 @@ ORDER BY
         /// 团组接待意见调查 - 用户
         /// 保存
         /// </summary>
-        /// <param name="id"></param>
+        /// <param name="dto"></param>
         /// <returns></returns>
         [HttpPost]
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]

+ 15 - 9
OASystem/OASystem.Api/Controllers/PersonnelModuleController.cs

@@ -29,7 +29,7 @@ namespace OASystem.API.Controllers
     {
         private Result _result;
         private readonly IMapper _mapper;
-        private readonly decimal _chengDuMinimumWage = 2100.00M;
+        //private readonly decimal _chengDuMinimumWage = 2100.00M;
         private readonly IQiYeWeChatApiService _qiYeWeChatApiService;
         private readonly WageSheetRepository _wageSheetRep;
         private readonly UsersRepository _usersRep;
@@ -180,8 +180,8 @@ namespace OASystem.API.Controllers
                 sys_Calendars_add = sys_Calendars.Where(it => it.Id == 0).OrderBy(it => it.Dt).ToList();
                 sys_Calendars_update = sys_Calendars.Where(it => it.Id != 0).OrderBy(it => it.Dt).ToList();
 
-                int add1 = 0;
-                int upd = 0;
+                //int add1 = 0;
+                //int upd = 0;
                 if (sys_Calendars_add.Count > 0)
                 {
                     var calendarsAdd = await _sqlSugar.Insertable(sys_Calendars_add).ExecuteReturnIdentityAsync();
@@ -524,9 +524,14 @@ namespace OASystem.API.Controllers
             }
             //处理上个月同月同人 多条数据
             List<Pm_WageSheet> preWageSheetItems1 = new List<Pm_WageSheet>();
-            preWageSheetItems1 = preWageSheetItems.GroupBy(it => new { it.YearMonth, it.UserId })
-                                                  .Select(it => it.FirstOrDefault(item => item.Basic != 0))
-                                                  .ToList();
+            //preWageSheetItems1 = preWageSheetItems.GroupBy(it => new { it.YearMonth, it.UserId })
+            //                                      .Select(it => it.FirstOrDefault(item => item.Basic != 0))
+            //                                      .ToList();
+            preWageSheetItems1 = preWageSheetItems
+                .GroupBy(it => new { it.YearMonth, it.UserId })
+                .Select(it => it.FirstOrDefault(item => item.Basic != 0))
+                .Where(it => it != null)
+                .ToList()!;
 
             //获取OA系统内所有用户
             List<UserNameView> userNames = _usersRep._sqlSugar.SqlQueryable<UserNameView>("Select Id,CnName From Sys_Users").ToList();
@@ -927,7 +932,7 @@ namespace OASystem.API.Controllers
                 return Ok(JsonView(false, "程序错误!"));
                 throw;
             }
-            return Ok(JsonView(true, "操作成功!"));
+            //return Ok(JsonView(true, "操作成功!"));
         }
 
         /// <summary>
@@ -946,7 +951,8 @@ namespace OASystem.API.Controllers
             }
 
             List<string> qyWhchatIdList = new List<string>();
-            qyWhchatIdList = userIdListView.dept_user.Select(it => it.userid).ToList();
+            //qyWhchatIdList = userIdListView.dept_user.Select(it => it.userid).ToList();
+            qyWhchatIdList = userIdListView.dept_user.Select(it => it.userid!).ToList();
 
             var data = await _qiYeWeChatApiService.GetCheckinDataAsync(qyWhchatIdList, code, Convert.ToDateTime(startDt), Convert.ToDateTime(endDt));
             return Ok(JsonView(true, "操作成功!", data.checkindata));
@@ -1680,7 +1686,7 @@ namespace OASystem.API.Controllers
             //AppNoticeLibrary.DailyPayReminder_Audit_ToUser(dto.DiId, userList, QiyeWeChatEnum.TestChat);
             //AppNoticeLibrary.DailyPayReminder_Pay_ToUser(dto.DiId, userList);
 
-            string q = "";
+            //string q = "";
 
             DeleReminderMessage.PostMessageByWebhook_CRMStatistics();
 

+ 75 - 77
OASystem/OASystem.Api/Controllers/ResourceController.cs

@@ -1,27 +1,16 @@
 using Aspose.Cells;
 using Aspose.Words;
 using EyeSoft.Extensions;
-using EyeSoft.Reflection;
-using NPOI.SS.Formula.Functions;
 using OASystem.API.OAMethodLib;
 using OASystem.API.OAMethodLib.QiYeWeChatAPI.AppNotice;
 using OASystem.Domain.AesEncryption;
-using OASystem.Domain.Dtos.CRM;
 using OASystem.Domain.Dtos.Groups;
-using OASystem.Domain.Dtos.PersonnelModule;
 using OASystem.Domain.Entities.Groups;
 using OASystem.Domain.ViewModels.Groups;
-using OASystem.Domain.ViewModels.JuHeExchangeRate;
-using OASystem.Domain.ViewModels.QiYeWeChat;
 using OASystem.Infrastructure.Repositories.Groups;
-using Org.BouncyCastle.Asn1.X509;
-using Org.BouncyCastle.Utilities.Encoders;
 using System.Data;
 using System.Diagnostics;
-using System.IO;
 using static OASystem.API.OAMethodLib.JWTHelper;
-using static OpenAI.GPT3.ObjectModels.SharedModels.IOpenAiModels;
-using static QRCoder.PayloadGenerator.SwissQrCode;
 
 namespace OASystem.API.Controllers
 {
@@ -56,23 +45,23 @@ namespace OASystem.API.Controllers
         private readonly BasicInsuranceCostRepository _insuranceCostRep;
 
         public ResourceController(
-            IMapper mapper, 
-            IConfiguration config, 
+            IMapper mapper,
+            IConfiguration config,
             SqlSugarClient sqlSugar,
-            CarDataRepository carDataRep, 
+            CarDataRepository carDataRep,
             LocalGuideDataRepository localGuideDataRep,
-            ThreeCodeRepository threeCodeRep, 
-            HotelDataRepository hotelDataRep, 
-            ResItemInfoRepository resItemInfoRep, 
+            ThreeCodeRepository threeCodeRep,
+            HotelDataRepository hotelDataRep,
+            ResItemInfoRepository resItemInfoRep,
             SetDataRepository setDataRepository,
-            CountryFeeRepository countryFeeRep, 
-            SetDataTypeRepository setDataTypeRep, 
+            CountryFeeRepository countryFeeRep,
+            SetDataTypeRepository setDataTypeRep,
             AirTicketAgentRepository airTicketAgentRep,
-            InvitationOfficialActivityDataRepository invitationOfficialActivityDataRep, 
-            OfficialActivitiesRepository officialActivitiesRep, 
+            InvitationOfficialActivityDataRepository invitationOfficialActivityDataRep,
+            OfficialActivitiesRepository officialActivitiesRep,
             AskDataRepository askDataRep,
-            TicketBlackCodeRepository ticketBlackCodeRep, 
-            TourClientListRepository tourClientListRep, 
+            TicketBlackCodeRepository ticketBlackCodeRep,
+            TourClientListRepository tourClientListRep,
             DelegationInfoRepository delegationInfoRep,
             TranslatorLibraryRepository translatorRep,
             MediaSuppliersRepository mediaSupplierRep,
@@ -393,7 +382,7 @@ namespace OASystem.API.Controllers
 
 
         }
-        
+
         /// <summary>
         /// 机场三字码数据城市下拉框数据
         /// </summary>
@@ -895,7 +884,7 @@ namespace OASystem.API.Controllers
         /// <summary>
         /// 物料供应商查询
         /// </summary>
-        /// <param name="paras">Json序列化</param>
+        /// <param name="_jsonDto">Json序列化</param>
         /// <returns></returns>
         [HttpPost]
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
@@ -925,7 +914,7 @@ namespace OASystem.API.Controllers
                 return Ok(JsonView(false, "参数反序列化失败"));
             }
 
-            return Ok(JsonView(false));
+            //return Ok(JsonView(false));
         }
 
         /// <summary>
@@ -1036,7 +1025,7 @@ namespace OASystem.API.Controllers
                 return Ok(JsonView(false, "参数反序列化失败"));
             }
 
-            return Ok(JsonView(false));
+            //return Ok(JsonView(false));
         }
 
         /// <summary>
@@ -1132,7 +1121,7 @@ namespace OASystem.API.Controllers
         /// <summary>
         /// 备忘录查询
         /// </summary>
-        /// <param name="paras">Json序列化</param>
+        /// <param name="_jsonDto">Json序列化</param>
         /// <returns></returns>
         [HttpPost]
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
@@ -1474,7 +1463,7 @@ Inner Join Sys_Department as d With(Nolock) On u.DepId=d.Id Where m.Id={0} ", _m
                 var InvitationOfficialActivityDataList = _sqlSugar.Queryable<Res_InvitationOfficialActivityData>()
                     .Where(x => x.IsDel == 0)
                     .WhereIF(dto.CreateUserId != 0 && !string.IsNullOrWhiteSpace(dto.CreateUserId.ToString()), x => x.CreateUserId == dto.CreateUserId)
-                    .WhereIF(DateTime.TryParse(dto.StartCreateTime , out DateTime startTime) && DateTime.TryParse(dto.EndCreateTime, out  endTime), x => x.CreateTime >= startTime && x.CreateTime <= endTime )
+                    .WhereIF(DateTime.TryParse(dto.StartCreateTime, out DateTime startTime) && DateTime.TryParse(dto.EndCreateTime, out endTime), x => x.CreateTime >= startTime && x.CreateTime <= endTime)
                     .Select(columns)
                     .ToList();
 
@@ -1546,7 +1535,7 @@ Inner Join Sys_Department as d With(Nolock) On u.DepId=d.Id Where m.Id={0} ", _m
                 var allGroupIds = new HashSet<int>();
                 foreach (var item in _ivitiesViews)
                 {
-                    EncryptionProcessor.DecryptProperties(item);    
+                    EncryptionProcessor.DecryptProperties(item);
 
                     if (!string.IsNullOrEmpty(item.Delegation))
                     {
@@ -1554,16 +1543,16 @@ Inner Join Sys_Department as d With(Nolock) On u.DepId=d.Id Where m.Id={0} ", _m
                         {
                             int id;
                             if (int.TryParse(x, out id)) return id;
-                            return 0; 
-                        }).Where(id => id != 0)); 
+                            return 0;
+                        }).Where(id => id != 0));
                     }
                 }
 
                 var _DelegationInfos = _sqlSugar.Queryable<Grp_DelegationInfo>()
                     .Where(x => allGroupIds.Contains(x.Id) && x.IsDel == 0)
                     .ToList()
-                    .GroupBy(x => x.Id) 
-                    .ToDictionary(group => group.Key, group => group.Select(g => g.TeamName)); 
+                    .GroupBy(x => x.Id)
+                    .ToDictionary(group => group.Key, group => group.Select(g => g.TeamName));
 
                 foreach (var item in _ivitiesViews)
                 {
@@ -1574,10 +1563,10 @@ Inner Join Sys_Department as d With(Nolock) On u.DepId=d.Id Where m.Id={0} ", _m
                         {
                             int id;
                             if (int.TryParse(x, out id)) return id;
-                            return 0; 
+                            return 0;
                         })
                         .Where(id => id != 0)
-                        .ToArray(); 
+                        .ToArray();
 
                         foreach (var id in groupIds)
                         {
@@ -1910,7 +1899,6 @@ Inner Join Sys_Department as d With(Nolock) On u.DepId=d.Id Where m.Id={0} ", _m
         /// <summary>
         /// 商邀资料 导入文件(Excel)模板下载 
         /// </summary>
-        /// <param name="dto"></param>
         /// <returns></returns>
         [HttpGet]
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
@@ -1930,7 +1918,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> InvitationOfficialActivityExcelUpload(IFormFile file,int currUserId)
+        public async Task<IActionResult> InvitationOfficialActivityExcelUpload(IFormFile file, int currUserId)
         {
             var fileName = file.FileName;
             var filePostfix = fileName.Split(".")[1].ToUpper();
@@ -1972,8 +1960,9 @@ Inner Join Sys_Department as d With(Nolock) On u.DepId=d.Id Where m.Id={0} ", _m
                     else groupIdsLabel = groupNames.Where(x => groupNames1.Equals(x.TeamName)).FirstOrDefault()?.Id.ToString() ?? string.Empty;
 
                 }
-                
-                infos.Add(new Res_InvitationOfficialActivityData() { 
+
+                infos.Add(new Res_InvitationOfficialActivityData()
+                {
                     Country = worksheet.Cells[row, 0].StringValue ?? "-",
                     City = worksheet.Cells[row, 1].StringValue ?? "-",
                     UnitName = worksheet.Cells[row, 2].StringValue ?? "-",
@@ -2026,9 +2015,9 @@ Inner Join Sys_Department as d With(Nolock) On u.DepId=d.Id Where m.Id={0} ", _m
             if (_groupData.Code == 0) groupInfos = _groupData.Data;
 
             var data = _sqlSugar.Queryable<Sys_SetData>().Where(a => a.IsDel == 0).ToList();
-            var data1 = data.Where(a => a.STid == 38).Select(x => new { x.Id,x.Name }).ToList();
+            var data1 = data.Where(a => a.STid == 38).Select(x => new { x.Id, x.Name }).ToList();
             var data2 = data.Where(a => a.STid == 101).Select(x => new { x.Id, x.Name }).ToList();
-            var data3 = data.Where(a => a.STid == 66).Select(x => new { x.Id, x.Name ,x.Remark}).ToList();
+            var data3 = data.Where(a => a.STid == 66).Select(x => new { x.Id, x.Name, x.Remark }).ToList();
 
             var _DeleFile = _sqlSugar.Queryable<Grp_DeleFile>().Where(a => a.Diid == dto.DiId && a.IsDel == 0 && a.Category == 970).ToList();
 
@@ -2037,7 +2026,7 @@ Inner Join Sys_Department as d With(Nolock) On u.DepId=d.Id Where m.Id={0} ", _m
             var translatorData1 = _mapper.Map<List<TranslatorView>>(translatorData);
             foreach (var item in translatorData1) EncryptionProcessor.DecryptProperties(item);
 
-            return Ok(JsonView(true, "查询成功!", new { Delegation = groupInfos, SetData = data1,DataSource = data2, currencyData = data3, DeleFile = _DeleFile , TranslatorData = translatorData1 }));
+            return Ok(JsonView(true, "查询成功!", new { Delegation = groupInfos, SetData = data1, DataSource = data2, currencyData = data3, DeleFile = _DeleFile, TranslatorData = translatorData1 }));
         }
 
         /// <summary>
@@ -2100,7 +2089,7 @@ Inner Join Sys_Department as d With(Nolock) On u.DepId=d.Id Where m.Id={0} ", _m
         /// <summary>
         /// 上传文件(邮件截图)
         /// </summary>
-        /// <param name="file"></param>
+        /// <param name="dto"></param>
         /// <returns></returns>
         [HttpPost]
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
@@ -2226,7 +2215,7 @@ Inner Join Sys_Department as d With(Nolock) On u.DepId=d.Id Where m.Id={0} ", _m
         /// <summary>
         /// 删除文件(邮件截图)
         /// </summary>
-        /// <param name="file"></param>
+        /// <param name="dto"></param>
         /// <returns></returns>
         [HttpPost]
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
@@ -2283,7 +2272,7 @@ Inner Join Sys_Department as d With(Nolock) On u.DepId=d.Id Where m.Id={0} ", _m
         /// <summary>
         /// 公务出访 确认、取消邀请
         /// </summary>
-        /// <param name="file"></param>
+        /// <param name="dto"></param>
         /// <returns></returns>
         [HttpPost]
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
@@ -2667,9 +2656,10 @@ Inner Join Sys_Department as d With(Nolock) On u.DepId=d.Id Where m.Id={0} ", _m
 
 
                     builder.MoveToCell(0, i + 1, 3, 0);
-                    string birthDay = "";
+                    
+                    //string birthDay = "";
                     string birthDayStr = string.Empty;
-                    if (guestInfo.BirthDay != null)
+                    if (guestInfo.BirthDay != DateTime.MinValue)
                     {
                         birthDayStr = guestInfo.BirthDay.ToString("yyyy.MM");
                     }
@@ -2815,7 +2805,7 @@ Inner Join Sys_Department as d With(Nolock) On u.DepId=d.Id Where m.Id={0} ", _m
                     builder.MoveToCell(0, i + 1, 3, 0);
                     DateTime birthDay = guestInfo.BirthDay;
                     string birthDayStr = string.Empty;
-                    if (birthDay != null)
+                    if (birthDay != DateTime.MinValue)
                     {
                         birthDayStr = birthDay.ToString("yyyy.MM");
                     }
@@ -2873,7 +2863,7 @@ Inner Join Sys_Department as d With(Nolock) On u.DepId=d.Id Where m.Id={0} ", _m
             var startTime_bool = DateTime.TryParse(dto.StartTime, out DateTime startTime_parse);
             var endTime_bool = DateTime.TryParse(dto.EndTime, out DateTime endTime_parse);
 
-            if(startTime_parse > endTime_parse)
+            if (startTime_parse > endTime_parse)
             {
                 jw.Msg = "开始实际不能大于结束时间!";
                 return Ok(jw);
@@ -2901,7 +2891,7 @@ Inner Join Sys_Department as d With(Nolock) On u.DepId=d.Id Where m.Id={0} ", _m
                                     b.CreateTime
                                 })
                                 .ToList()
-                                .Where(x=>!x.Client.IsNullOrWhiteSpace())
+                                .Where(x => !x.Client.IsNullOrWhiteSpace())
                                 .ToList();
 
                 if (Query_DB.Count > 0)
@@ -2909,7 +2899,7 @@ Inner Join Sys_Department as d With(Nolock) On u.DepId=d.Id Where m.Id={0} ", _m
                     //打开excel
                     var ftpPath = AppSettingsHelper.Get("ExcelFtpPath");
                     var fileBasePath = AppSettingsHelper.Get("ExcelBasePath");
-                    var fileName = "公务出访信息.docx";
+                    //var fileName = "公务出访信息.docx";
 
                     //创建数据源Table
                     DataTable dtSource = new DataTable();
@@ -2940,7 +2930,7 @@ Inner Join Sys_Department as d With(Nolock) On u.DepId=d.Id Where m.Id={0} ", _m
                     designer.SetDataSource("title", title);
                     designer.SetDataSource(dtSource);
                     designer.Process();
-                    
+
                     var exportSerevePath = fileBasePath + "ExportOfficialActivitiesInfo/" + title + ".xlsx";
                     var exportFtpPaht = ftpPath + "ExportOfficialActivitiesInfo/" + title + ".xlsx";
 
@@ -3043,7 +3033,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> AskDataProvinceFAOPFile(AskDataProvinceFileDto dto)
         {
-            if (dto.DataIdItem.Length < 1) return Ok(JsonView(false,$"请传入有效的数据Id集合!"));
+            if (dto.DataIdItem.Length < 1) return Ok(JsonView(false, $"请传入有效的数据Id集合!"));
             if (dto.DiId < 1) return Ok(JsonView(false, $"请传入有效的数据DiId参数!"));
 
             //大写数字序号
@@ -3107,7 +3097,7 @@ Inner Join Sys_Department as d With(Nolock) On u.DepId=d.Id Where m.Id={0} ", _m
             }
 
             //模板路径
-            var tempPath =  AppSettingsHelper.Get("WordBasePath") + "Template/省外办出访请示模板.doc";
+            var tempPath = AppSettingsHelper.Get("WordBasePath") + "Template/省外办出访请示模板.doc";
             //载入模板
             Aspose.Words.Document doc = new Aspose.Words.Document(tempPath);
 
@@ -3176,7 +3166,7 @@ WHERE
             //机票代码实例
             DataTable airTable = GeneralMethod.GetTableByBlackCode(dto.DiId);
             //三字码
-            var threeCodes = await _sqlSugar.Queryable<Res_ThreeCode>().Where(x => x.IsDel == 0 ).ToListAsync();
+            var threeCodes = await _sqlSugar.Queryable<Res_ThreeCode>().Where(x => x.IsDel == 0).ToListAsync();
 
             //团名
             if (doc.Range.Bookmarks["TeamName"] != null)
@@ -3485,7 +3475,7 @@ WHERE
             doc.Save(AppSettingsHelper.Get("WordBasePath") + strFileName);  //"C:\\Server\\File\\OA2023\\Office\\Word" + strFileName
             var url = AppSettingsHelper.Get("WordBaseUrl") + AppSettingsHelper.Get("WordFtpPath") + strFileName;  //"C:\\Server\\File\\OA2023\\Office\\Word" + strFileName
 
-            return Ok(JsonView(true,"操作成功!",new { url = url }));
+            return Ok(JsonView(true, "操作成功!", new { url = url }));
         }
 
 
@@ -4070,7 +4060,6 @@ WHERE
         /// 翻译人员库
         /// Init
         /// </summary>
-        /// <param name="id"></param>
         /// <returns></returns>
         [HttpGet()]
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
@@ -4078,7 +4067,8 @@ WHERE
         {
             var currencyData = await _sqlSugar.Queryable<Sys_SetData>()
                 .Where(x => x.IsDel == 0 && x.STid == 66)
-                .Select(x => new {
+                .Select(x => new
+                {
                     x.Id,
                     x.Name,
                 })
@@ -4096,13 +4086,15 @@ WHERE
                 .ToListAsync();
 
             var officialDutyData1 = officialDutyData.GroupBy(x => x.DiId)
-                .Select(g => new {
+                .Select(g => new
+                {
                     id = g.Key,
                     label = g.FirstOrDefault()?.TeamName ?? "-",
                     children = g.Select(g1 => new { id = g1.Id, label = g1.Client }).ToList()
                 })
                 .ToList();
-            var view = new { 
+            var view = new
+            {
                 currencyData = currencyData,
                 officialDutyData = officialDutyData1
             };
@@ -4120,7 +4112,7 @@ WHERE
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
         public async Task<IActionResult> TranslatorLibraryInfo(int id)
         {
-            if (id <1 ) return Ok(JsonView(false,"请传入有效的Id!"));
+            if (id < 1) return Ok(JsonView(false, "请传入有效的Id!"));
 
             var info = await _translatorRep.Query(x => x.Id == id).FirstAsync();
 
@@ -4189,7 +4181,7 @@ WHERE
         /// <returns></returns>
         [HttpPost]
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
-        public async Task<IActionResult> TranslatorLibraryOp([FromForm]TranslatorLibraryOpDto dto)
+        public async Task<IActionResult> TranslatorLibraryOp([FromForm] TranslatorLibraryOpDto dto)
         {
             if (dto.PortType < 1 || dto.PortType > 3) return Ok(JsonView(false, MsgTips.Port));
             if (dto.Status < 1 || dto.Status > 2) return Ok(JsonView(false, MsgTips.Status));
@@ -4259,7 +4251,8 @@ WHERE
                 }
 
                 var id = await _translatorRep.AddAsync(translatorInfo);
-                if (id > 0) {
+                if (id > 0)
+                {
 
                     #region 新增(公务信息关联翻译人员) 关联信息
 
@@ -4329,7 +4322,8 @@ WHERE
                         LastUpdateUserId = translatorInfo.LastUpdateUserId,
                     });
 
-                if (upd) {
+                if (upd)
+                {
                     #region 更新(公务信息关联翻译人员) 关联信息
 
                     var officialDutyLinkTranslators_select = await _sqlSugar.Queryable<Grp_OfficialDutyLinkTranslator>()
@@ -4372,7 +4366,7 @@ WHERE
                             await _sqlSugar.Insertable(officialDutyLinkTranslators).ExecuteCommandAsync();
                         }
                     }
-                   
+
                     #endregion
                     _sqlSugar.CommitTran();
                     return Ok(JsonView(true));
@@ -4400,16 +4394,18 @@ WHERE
 
             _sqlSugar.BeginTran();
             var upd = await _translatorRep.SoftDeleteByIdAsync<Res_TranslatorLibrary>(id.ToString(), currUserInfo.UserId);
-            if (!upd) {
+            if (!upd)
+            {
                 _sqlSugar.RollbackTran();
                 return Ok(JsonView(false));
             }
 
             #region 删除公务出访
             await _sqlSugar.Updateable<Grp_OfficialDutyLinkTranslator>()
-                           .SetColumns(x => new Grp_OfficialDutyLinkTranslator() { 
-                               DeleteUserId = currUserInfo.UserId, 
-                               DeleteTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), 
+                           .SetColumns(x => new Grp_OfficialDutyLinkTranslator()
+                           {
+                               DeleteUserId = currUserInfo.UserId,
+                               DeleteTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),
                                IsDel = 1,
                                Remark = $"翻译人员库-->删除"
                            })
@@ -4528,7 +4524,8 @@ WHERE
             var id = dto.Id;
             var info = await _sqlSugar.Queryable<Res_BasicInsuranceCost>()
                 .Where(x => x.Id == id && x.IsDel == 0)
-                .Select(x => new {
+                .Select(x => new
+                {
                     x.Id,
                     x.IsSchengen,
                     x.CountryName,
@@ -4558,11 +4555,12 @@ WHERE
             RefAsync<int> total = 0;
 
             var data = await _sqlSugar.Queryable<Res_BasicInsuranceCost>()
-                .LeftJoin<Sys_Users>((bic,u) => bic.CreateUserId == u.Id)
+                .LeftJoin<Sys_Users>((bic, u) => bic.CreateUserId == u.Id)
                 .Where((bic, u) => bic.IsDel == 0)
                 .WhereIF(!string.IsNullOrEmpty(dto.Search), (bic, u) => bic.CountryName.Contains(dto.Search))
                 .OrderByDescending((bic, u) => bic.Id)
-                .Select((bic, u) => new {
+                .Select((bic, u) => new
+                {
                     bic.Id,
                     bic.IsSchengen,
                     bic.CountryName,
@@ -4571,9 +4569,9 @@ WHERE
                     CreateUserName = u.CnName,
                     bic.CreateTime
                 })
-                .ToPageListAsync(dto.PageIndex,dto.PageSize,total);
+                .ToPageListAsync(dto.PageIndex, dto.PageSize, total);
 
-            return Ok(JsonView(data,total));
+            return Ok(JsonView(data, total));
         }
 
         /// <summary>
@@ -4591,7 +4589,7 @@ WHERE
             if (!_portIds.Contains(dto.PortType)) return Ok(JsonView(false, MsgTips.Port));
             if (userId < 1) return Ok(JsonView(false, MsgTips.UserId));
             var countryName = dto.CountryName.Trim();
-            if (string.IsNullOrEmpty(countryName)) return Ok(JsonView(false,$"国家名称不能为空!"));
+            if (string.IsNullOrEmpty(countryName)) return Ok(JsonView(false, $"国家名称不能为空!"));
 
             var info = _mapper.Map<Res_BasicInsuranceCost>(dto);
             info.CreateUserId = dto.CurrUserId;
@@ -4608,7 +4606,7 @@ WHERE
                 var upd = await _insuranceCostRep.UpdateAsync(x => x.Id == dto.Id, x => new Res_BasicInsuranceCost
                 {
                     IsSchengen = dto.IsSchengen,
-                    CountryName = dto.CountryName, 
+                    CountryName = dto.CountryName,
                     Cost = dto.Cost,
                     Remark = dto.Remark
                 });

+ 37 - 55
OASystem/OASystem.Api/Controllers/StatisticsController.cs

@@ -1,20 +1,5 @@
 using Aspose.Cells;
-using Aspose.Words.Tables;
-using crypto;
-using EyeSoft.Collections.Generic;
 using FluentValidation;
-using Google.Protobuf.WellKnownTypes;
-using Microsoft.AspNetCore.Mvc.ViewEngines;
-using Microsoft.EntityFrameworkCore.Metadata.Internal;
-using Microsoft.Extensions.Hosting;
-using MySqlX.XDevAPI.Relational;
-using NetUV.Core.Handles;
-using NodaTime;
-using NPOI.HPSF;
-using NPOI.POIFS.Properties;
-using NPOI.SS.Formula.Functions;
-using NPOI.SS.Formula.PTG;
-using NPOI.XSSF.Streaming.Values;
 using OASystem.API.OAMethodLib;
 using OASystem.API.OAMethodLib.JuHeAPI;
 using OASystem.Domain.AesEncryption;
@@ -23,15 +8,9 @@ using OASystem.Domain.Entities.Customer;
 using OASystem.Domain.Entities.Financial;
 using OASystem.Domain.Entities.Groups;
 using OASystem.Domain.ViewModels.Financial;
-using OASystem.Domain.ViewModels.JuHeExchangeRate;
-using OASystem.Domain.ViewModels.QiYeWeChat;
 using OASystem.Domain.ViewModels.Statistics;
 using OASystem.Infrastructure.Repositories.Groups;
-using StackExchange.Redis;
-using System;
 using System.Data;
-using System.Runtime.Intrinsics.Arm;
-using TencentCloud.Ocr.V20181119.Models;
 using static OASystem.API.OAMethodLib.GeneralMethod;
 using TypeInfo = OASystem.Domain.ViewModels.Statistics.TypeInfo;
 
@@ -44,7 +23,7 @@ namespace OASystem.API.Controllers
     [ApiController]
     public class StatisticsController : ControllerBase
     {
-        private readonly int _decimalPlaces;
+        //private readonly int _decimalPlaces;
         private readonly IConfiguration _config;
         private readonly IMapper _mapper;
         private readonly SqlSugarClient _sqlSugar;
@@ -739,7 +718,7 @@ ORDER BY
                         item.AuditGMDate = Convert.ToDateTime(item.AuditGMDate).ToString("yyyy-MM-dd HH:mm:ss");
                     }
 
-                    if (item.DatePrice != null)
+                    if (item.DatePrice != DateTime.MinValue)
                     {
                         item.PriceName = $"{item.PriceName}({Convert.ToDateTime(item.DatePrice).ToString("yyyy-MM-dd")})";
                     }
@@ -775,8 +754,10 @@ ORDER BY
                 string str = "";
                 List<dynamic> airClientPris = new List<dynamic>();
                 decimal AirCNYTotalPrice = 0.00M;
-                decimal JJCCNYTotalPrice = 0.00M, JJCPeopleNum = 0.00M, JJCAveragePrice = 0.00M;
-                decimal GWCCNYTotalPrice = 0.00M, GWCPeopleNum = 0.00M, GWCAveragePrice = 0.00M;
+                //decimal JJCCNYTotalPrice = 0.00M, JJCPeopleNum = 0.00M; 
+                decimal JJCAveragePrice = 0.00M;
+                //decimal GWCCNYTotalPrice = 0.00M, GWCPeopleNum = 0.00M; 
+                decimal GWCAveragePrice = 0.00M;
 
                 //if (groupAirFeeViews.Count > 0)
                 //{
@@ -803,7 +784,6 @@ ORDER BY
                             {
                                 itemClientName = item.ClientName;
 
-                                decimal unitCost = 0.00M;
                                 AirCNYTotalPrice += item.CNYPrice;
                                 continue;
                             }
@@ -1320,8 +1300,8 @@ ORDER BY
                         OverviewInfo = rc.Temp,
                         DetailedInfo = rc.ChiArr,
                         Amount = rc.Price,
-                        IsConfirm = rc.IsConfirm ,
-                        IsSeed = rc.IsSeed ,
+                        IsConfirm = rc.IsConfirm,
+                        IsSeed = rc.IsSeed,
                         RoyaltyUserName = u1.CnName,
                         CreateUserName = u2.CnName,
                         CreateTime = rc.CreateTime
@@ -1765,7 +1745,7 @@ ORDER BY
                         item.AuditGMDate = Convert.ToDateTime(item.AuditGMDate).ToString("yyyy-MM-dd HH:mm:ss");
                     }
 
-                    if (item.DatePrice != null)
+                    if (item.DatePrice != DateTime.MinValue)
                     {
                         item.PriceName = $"{item.PriceName}({Convert.ToDateTime(item.DatePrice).ToString("yyyy-MM-dd")})";
                     }
@@ -2110,7 +2090,7 @@ ORDER BY
             #endregion
 
             #region 应收金额(增加方式=实际报价时 费用必须审核才能进入团组报表)
-            decimal frTotalAmount = 0.00M;//应收总金额
+            //decimal frTotalAmount = 0.00M;//应收总金额
             string _frSql = string.Format(@"  Select fr.Id,fr.AddingWay,fr.Status,u.CnName As Auditor,fr.AuditTime,fr.Diid,fr.PriceName,fr.Price,fr.Count,fr.Unit,fr.Currency,
 										        sd.Name As CurrencyCode,sd.Remark As CurrencyName,fr.Rate,fr.ItemSumPrice,fr.CreateTime,fr.Remark
 										        From Fin_ForeignReceivables fr
@@ -2138,7 +2118,7 @@ ORDER BY
             #endregion
 
             #region 已收金额
-            decimal prTotalAmount = 0.00M;//已收总金额
+            //decimal prTotalAmount = 0.00M;//已收总金额
             string _prSql = string.Format(@"Select pr.Id,pr.Diid,pr.SectionTime As SectionTimeDt,pr.Price,pr.Currency,
 										        sd1.Name As CurrencyCode,sd1.Remark As CurrencyName,pr.Client,
 										        pr.ReceivablesType,sd2.Name As ReceivablesTypeName,pr.Remark,pr.CreateTime
@@ -2310,18 +2290,18 @@ ORDER BY
         public async Task<IActionResult> PostGroupStatementDetails1()
         {
             var groupInfos = _sqlSugar.Queryable<Grp_DelegationInfo>()
-                .Where(x => x.IsDel == 0 && x.VisitDate >= DateTime.Parse ("2024-01-01") && x.VisitDate <= DateTime.Parse("2024-12-31"))
+                .Where(x => x.IsDel == 0 && x.VisitDate >= DateTime.Parse("2024-01-01") && x.VisitDate <= DateTime.Parse("2024-12-31"))
                 .OrderByDescending(x => x.VisitDate)
                 .ToList();
 
             #region 费用类型 币种,转账,客户信息
 
-            List<Sys_SetData> _setDatas =  _sqlSugar.Queryable<Sys_SetData>().Where(it => it.IsDel == 0).ToList();
+            List<Sys_SetData> _setDatas = _sqlSugar.Queryable<Sys_SetData>().Where(it => it.IsDel == 0).ToList();
             var _clientDatas = _sqlSugar.Queryable<Crm_DeleClient>()
                 .Where(it => it.IsDel == 0)
                 .Select(x => new Crm_DeleClient { Id = x.Id, FirstName = x.FirstName, LastName = x.LastName, Sex = x.Sex })
                 .ToList();
-           // foreach (var item1 in _clientDatas) EncryptionProcessor.DecryptProperties(item1);
+            // foreach (var item1 in _clientDatas) EncryptionProcessor.DecryptProperties(item1);
 
             #endregion
 
@@ -2870,7 +2850,7 @@ ORDER BY
                         item.AuditGMDate = Convert.ToDateTime(item.AuditGMDate).ToString("yyyy-MM-dd HH:mm:ss");
                     }
 
-                    if (item.DatePrice != null)
+                    if (item.DatePrice != DateTime.MinValue)
                     {
                         item.PriceName = $"{item.PriceName}({Convert.ToDateTime(item.DatePrice).ToString("yyyy-MM-dd")})";
                     }
@@ -2906,8 +2886,10 @@ ORDER BY
                 string str = "";
                 List<dynamic> airClientPris = new List<dynamic>();
                 decimal AirCNYTotalPrice = 0.00M;
-                decimal JJCCNYTotalPrice = 0.00M, JJCPeopleNum = 0.00M, JJCAveragePrice = 0.00M;
-                decimal GWCCNYTotalPrice = 0.00M, GWCPeopleNum = 0.00M, GWCAveragePrice = 0.00M;
+                //decimal JJCCNYTotalPrice = 0.00M, JJCPeopleNum = 0.00M;
+                decimal JJCAveragePrice = 0.00M;
+                //decimal GWCCNYTotalPrice = 0.00M, GWCPeopleNum = 0.00M;
+                decimal GWCAveragePrice = 0.00M;
 
                 //if (groupAirFeeViews.Count > 0)
                 //{
@@ -2933,8 +2915,6 @@ ORDER BY
                             if (m_EnName.Success || m_ZHName.Success)
                             {
                                 itemClientName = item.ClientName;
-
-                                decimal unitCost = 0.00M;
                                 AirCNYTotalPrice += item.CNYPrice;
                                 continue;
                             }
@@ -3512,7 +3492,7 @@ ORDER BY
 
         }
         private class GroupStatisticsInfo
-            {
+        {
             public int Index { get; set; }
             public int Id { get; set; }
             public string GroupName { get; set; }
@@ -4103,7 +4083,7 @@ ORDER BY
             if (_dto.Type == 1)//接团
             {
                 List<GroupBookingNumberView> views = new List<GroupBookingNumberView>();
-                dynamic groupData = null;
+                //dynamic groupData = null;
                 foreach (var item in datas)
                 {
                     if (item.TypeItem.Count > 0)
@@ -4219,7 +4199,8 @@ ORDER BY
         /// <summary>
         /// 计算团组ALLType预订数量
         /// </summary>
-        /// <param name="diIds"></param>
+        /// <param name="type"></param>
+        /// <param name="info"></param>
         /// <returns></returns>
         private async Task<GroupTypeNumberInfo> GroupBookingsNumber(int type, Grp_DelegationInfo info)
         {
@@ -7510,7 +7491,7 @@ WHERE
 
             var sql = string.Format(@"SELECT * FROM Grp_DelegationInfo WHERE ISdel = 0  AND '{0}' BETWEEN VisitStartDate AND VisitEndDate", nowLable);
             var groupInfos = await _sqlSugar.SqlQueryable<Grp_DelegationInfo>(sql)
-                .Select(x => new { x.Id, x.VisitCountry, x.TeamName,x.ClientUnit, x.VisitStartDate, x.VisitEndDate }).
+                .Select(x => new { x.Id, x.VisitCountry, x.TeamName, x.ClientUnit, x.VisitStartDate, x.VisitEndDate }).
                 ToListAsync();
 
             if (!groupInfos.Any()) return Ok(JsonView(false, "今日暂无团组出行!"));
@@ -7532,7 +7513,8 @@ WHERE
             var hotelDatas = await _sqlSugar.Queryable<Grp_HotelReservations>()
                 .LeftJoin<Grp_NationalTravelFee>((hr, ntf) => hr.AreaId == ntf.Id)
                 .Where((hr, ntf) => hr.IsDel == 0 && groupIds.Contains(hr.DiId))
-                .Select((hr, ntf) => new { 
+                .Select((hr, ntf) => new
+                {
                     hr.DiId,
                     hr.AreaId,
                     hr.HotelName,
@@ -7681,17 +7663,17 @@ WHERE
                         arriveCity = arriveCountryInfo.City;
                         arriveAirport = arriveCountryInfo.AirPort;
 
-                        var arriveDateTimeBool = DateTime.TryParse(arrivedDate + " " + arrivedTime.Insert(2, ":"),out DateTime arriveDateTime);
+                        var arriveDateTimeBool = DateTime.TryParse(arrivedDate + " " + arrivedTime.Insert(2, ":"), out DateTime arriveDateTime);
 
                         if (!arriveDateTimeBool) continue;
 
                         var filghtHoursBool = int.TryParse(flightTime.Split("H")[0].ToString(), out int filghtHours);
-                        var filghtMinutesBool= int.TryParse(flightTime.Split("H")[1].Remove(2).ToString(), out int filghtMinutes);
+                        var filghtMinutesBool = int.TryParse(flightTime.Split("H")[1].Remove(2).ToString(), out int filghtMinutes);
                         if (!filghtHoursBool || !filghtHoursBool) continue;
 
                         var departDateTime = arriveDateTime.AddHours(-filghtHours).AddMinutes(-filghtMinutes);
 
-                        var localTime = GetCountryOrCityCurrentDateTime(arriveCountry,arriveCity);
+                        var localTime = GetCountryOrCityCurrentDateTime(arriveCountry, arriveCity);
 
                         var currTimeZoneStatus = localTime >= departDateTime && localTime <= arriveDateTime;
                         if (!currTimeZoneStatus) continue;
@@ -7727,7 +7709,7 @@ WHERE
                 Items = g.ToList().Select(gg => new { gg.GroupName, gg.Client, gg.StatusText }).ToList()
             });
 
-            if (!result1.Any()) return Ok(JsonView(false,"今天暂无出行的的团!"));
+            if (!result1.Any()) return Ok(JsonView(false, "今天暂无出行的的团!"));
             return Ok(JsonView(result1));
         }
 
@@ -8112,7 +8094,7 @@ ORDER BY
 
             var dailyItems = await _sqlSugar.SqlQueryable<DailyInfo>(dailySql).ToArrayAsync();
 
-            view.GroupItems = groupItems.OrderBy(x=> x.RowIndex).ToArray();
+            view.GroupItems = groupItems.OrderBy(x => x.RowIndex).ToArray();
             view.DailyItems = dailyItems;
             return view;
         }
@@ -8261,7 +8243,7 @@ ORDER BY
             string beginDt = $"{dto.BeginDt} 00:00:00",
                    endDt = $"{dto.EndDt} 23:59:59";
 
-            return Ok(JsonView(true,"操作成功!", await CorporateProfitItems(1, beginDt, endDt)));
+            return Ok(JsonView(true, "操作成功!", await CorporateProfitItems(1, beginDt, endDt)));
         }
 
         /// <summary>
@@ -8488,7 +8470,7 @@ ORDER BY
                         yearSsGross = yearSsIncomes - yearSsCost,
                         yearQtGross = yearQtIncomes - yearQtCost;
                 //年-团数量
-                int yearAllCount = yearGroupItems.Count(), 
+                int yearAllCount = yearGroupItems.Count(),
                     yearTzCount = yearGroupItems.Where(x => groupTypeIds.Contains(x.TeamDid)).Count(),
                     yearHwCount = yearGroupItems.Where(x => inforTypeIds.Contains(x.TeamDid)).Count(),
                     yearSsCount = yearGroupItems.Where(x => competitionTypeIds.Contains(x.TeamDid)).Count(),
@@ -8577,7 +8559,7 @@ ORDER BY
                 decimal monthStaffCostTotal = dailyItems.Where(x => x.PriceParentTypeId == 48).Sum(x => x.ItemTotal),
                         yearStaffCostTotal = yearDailyItems.Where(x => x.PriceParentTypeId == 48).Sum(x => x.ItemTotal);
 
-                dailyViewItems.Add(new CorporateProfitDailyView() { No = "一", PriceName = "人员费用", ThisMonthAmount = monthStaffCostTotal, ThisYearAmount = yearStaffCostTotal});
+                dailyViewItems.Add(new CorporateProfitDailyView() { No = "一", PriceName = "人员费用", ThisMonthAmount = monthStaffCostTotal, ThisYearAmount = yearStaffCostTotal });
                 conmmentTexts.Add(new CorporateProfitDailyCommentView()
                 {
                     MonthComment = DailyListToString(dailyItems.Where(x => x.PriceParentTypeId == 48).ToArray()),
@@ -8701,7 +8683,7 @@ ORDER BY
                     string priceName = !string.IsNullOrEmpty(item.Remark) ? item.Remark : item.Name;
                     decimal monthAmount = dailyItems.Where(x => x.PriceTypeId == item.Id).Sum(x => x.ItemTotal),
                             yearAmount = yearDailyItems.Where(x => x.PriceTypeId == item.Id).Sum(x => x.ItemTotal);
-                    dailyViewItems.Add(new CorporateProfitDailyView() { PriceName = priceName, ThisMonthAmount = monthAmount, ThisYearAmount = yearAmount }); 
+                    dailyViewItems.Add(new CorporateProfitDailyView() { PriceName = priceName, ThisMonthAmount = monthAmount, ThisYearAmount = yearAmount });
                     conmmentTexts.Add(new CorporateProfitDailyCommentView()
                     {
                         MonthComment = DailyListToString(dailyItems.Where(x => x.PriceTypeId == item.Id).ToArray()),
@@ -8743,7 +8725,7 @@ ORDER BY
                 var dt = CommonFun.ToDataTableArray(dailyViewItems);
                 dt.TableName = "DailyView";
                 designer.SetDataSource(dt);
-               
+
                 #endregion
 
                 #endregion
@@ -8759,7 +8741,7 @@ ORDER BY
                            yearComment = $"D{i + 3}";
                     int monthCommentIndex = dailySheet.Comments.Add(monthComment),
                         yearCommentIndex = dailySheet.Comments.Add(yearComment);
-                    
+
 
                     string commentText1 = conmmentTexts[i].MonthComment,
                            commentText2 = conmmentTexts[i].YearComment;

+ 81 - 97
OASystem/OASystem.Api/Controllers/SystemController.cs

@@ -1,22 +1,10 @@
-using Aspose.Cells;
-using EyeSoft.Messanging;
-using Microsoft.EntityFrameworkCore.Metadata;
-using Microsoft.Extensions.Configuration.UserSecrets;
-using OASystem.Domain;
+using OASystem.Domain.AesEncryption;
 using OASystem.Domain.Entities.Customer;
 using OASystem.Domain.Entities.Financial;
 using OASystem.Domain.Entities.Groups;
-using Org.BouncyCastle.Asn1.Cmp;
 using System.Collections;
 using static OASystem.API.OAMethodLib.GeneralMethod;
-using static OpenAI.GPT3.ObjectModels.SharedModels.IOpenAiModels;
-using static QRCoder.PayloadGenerator;
-using static Quartz.Logging.OperationName;
 using static OASystem.API.OAMethodLib.JWTHelper;
-using System.Runtime.Intrinsics.Arm;
-using OASystem.Domain.Dtos.Statistics;
-using OASystem.Domain.AesEncryption;
-using OASystem.Domain.Entities.System;
 
 namespace OASystem.API.Controllers
 {
@@ -264,7 +252,8 @@ namespace OASystem.API.Controllers
                     .Queryable<Sys_Users>()
                     .LeftJoin<Sys_Department>((u, d) => u.DepId == d.Id)
                     .Where((u, d) => u.Id == dto.UserId)
-                    .Select((u, d) => new {
+                    .Select((u, d) => new
+                    {
                         DepName = d.DepName,
                         CnName = u.CnName
                     })
@@ -273,7 +262,7 @@ namespace OASystem.API.Controllers
                 var noLoginAuth = _config.GetSection("NoLoginAuth").Get<List<string>>();
                 if (noLoginAuth.Any())
                 {
-                    if (noLoginAuth.Contains(userInfo.CnName)) return Ok(JsonView(204, "NO ACCESS!!",""));
+                    if (noLoginAuth.Contains(userInfo.CnName)) return Ok(JsonView(204, "NO ACCESS!!", ""));
                 }
 
                 //其他市场部人员 限制登录时间段
@@ -283,19 +272,16 @@ namespace OASystem.API.Controllers
                 if (currentDateTime < startTime && currentDateTime > endTime) return Ok(JsonView(204, "NO ACCESS!!", ""));
                 #endregion
 
-
-
-
                 int messageUnReadCount = 0;
                 int announcementUnReadCount = 0;
                 var data = await _messageRep.GetUnReadCount(dto.UserId);
-                if (data != null)
+                if (data > 0)
                 {
                     messageUnReadCount = data;
 
                 }
                 var data1 = await _messageRep.GetAnnouncementUnReadCount(dto.UserId);
-                if (data1 != null)
+                if (data1 > 0)
                 {
                     announcementUnReadCount = data1;
                 }
@@ -740,82 +726,72 @@ namespace OASystem.API.Controllers
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
         public async Task<IActionResult> QueryDepartmentList(DepartmentDto dto)
         {
-            try
+
+            if (dto.PortType == 1)
             {
-                if (dto.PortType == 1)
+                if (dto.CompanyId != 0)
                 {
-                    if (dto.CompanyId != 0)
+                    var result = _sysDepRep.QueryDto<Sys_Department, DepartmentIView>(s => s.CompanyId == dto.CompanyId).ToList();
+                    if (result.Count == 0)
                     {
-                        var result = _sysDepRep.QueryDto<Sys_Department, DepartmentIView>(s => s.CompanyId == dto.CompanyId).ToList();
-                        if (result.Count == 0)
-                        {
-
-                            return Ok(JsonView(false, "暂无数据!"));
-                        }
-                        for (int i = 0; i < result.Count; i++)
-                        {
-                            if (result[i].ParentDepId != 0)
-                            {
-                                result[i].ParentDepName = result.Find(x => x.Id == result[i].ParentDepId).ParentDepName;
-                            }
-                            var company = _sysDepRep.QueryDto<Sys_Company, CompanyView>(s => s.Id == result[i].CompanyId).ToList();
-                            if (company.Count != 0)
-                            {
-                                result[i].CompanyName = company[0].CompanyName;
-                            }
-                            return Ok(JsonView(true, "查询成功!", result));
-                        }
+                        return Ok(JsonView(false, "暂无数据!"));
                     }
-                    else
+                    int resultCount = result.Count;
+                    for (int i = 0; i < resultCount; i++)
                     {
-                        var result = _sysDepRep.QueryDto<Sys_Department, DepartmentIView>(s => s.IsDel <= 1).ToList();
-                        if (result.Count == 0)
+                        if (result[i].ParentDepId != 0)
                         {
-
-                            return Ok(JsonView(false, "暂无数据!"));
+                            result[i].ParentDepName = result.Find(x => x.Id == result[i].ParentDepId).ParentDepName;
                         }
-                        for (int i = 0; i < result.Count; i++)
+                        var company = _sysDepRep.QueryDto<Sys_Company, CompanyView>(s => s.Id == result[i].CompanyId).ToList();
+                        if (company.Count != 0)
                         {
-                            if (result[i].ParentDepId != 0)
-                            {
-                                result[i].ParentDepName = result.Find(x => x.Id == result[i].ParentDepId).ParentDepName;
-                            }
-                            var company = _sysDepRep.QueryDto<Sys_Company, CompanyView>(s => s.Id == result[i].CompanyId).ToList();
-                            if (company.Count != 0)
-                            {
-                                result[i].CompanyName = company[0].CompanyName;
-                            }
+                            result[i].CompanyName = company[0].CompanyName;
                         }
-                        return Ok(JsonView(true, "查询成功!", result));
                     }
-                    return Ok(JsonView(false, "暂无数据!"));
-
-
+                    return Ok(JsonView(true, "查询成功!", result));
                 }
-                else if (dto.PortType == 2)
+                else
                 {
-                    var result = _sysDepRep.QueryDto<Sys_Department, DepartmentIView>(s => s.CompanyId == dto.CompanyId).ToList();
+                    var result = _sysDepRep.QueryDto<Sys_Department, DepartmentIView>(s => s.IsDel <= 1).ToList();
                     if (result.Count == 0)
                     {
-                        return Ok(JsonView(400, "暂无数据!", new List<string>()));
+                        return Ok(JsonView(false, "暂无数据!"));
+                    }
+                    for (int i = 0; i < result.Count; i++)
+                    {
+                        if (result[i].ParentDepId != 0)
+                        {
+                            result[i].ParentDepName = result.Find(x => x.Id == result[i].ParentDepId).ParentDepName;
+                        }
+                        var company = _sysDepRep.QueryDto<Sys_Company, CompanyView>(s => s.Id == result[i].CompanyId).ToList();
+                        if (company.Count != 0)
+                        {
+                            result[i].CompanyName = company[0].CompanyName;
+                        }
                     }
                     return Ok(JsonView(true, "查询成功!", result));
                 }
-                else if (dto.PortType == 3)
-                {
-                    return Ok(JsonView(false, "暂无数据!"));
-                }
-                else
+            }
+            else if (dto.PortType == 2)
+            {
+                var result = _sysDepRep.QueryDto<Sys_Department, DepartmentIView>(s => s.CompanyId == dto.CompanyId).ToList();
+                if (result.Count == 0)
                 {
-                    return Ok(JsonView(false, "暂无数据!"));
+                    return Ok(JsonView(400, "暂无数据!", new List<string>()));
                 }
+                return Ok(JsonView(true, "查询成功!", result));
             }
-            catch (Exception ex)
+            else if (dto.PortType == 3)
             {
-                return Ok(JsonView(false, "程序错误!"));
-                throw;
+
+            }
+            else
+            {
+
             }
 
+            return Ok(JsonView(false, "暂无数据!"));
         }
         /// <summary>
         /// 部门添加
@@ -1181,7 +1157,8 @@ namespace OASystem.API.Controllers
             //解密
             EncryptionProcessor.DecryptProperties(_view);
 
-            var data = new {
+            var data = new
+            {
                 _view.Id,
                 _view.CnName,
                 _view.EnName,
@@ -1287,7 +1264,7 @@ namespace OASystem.API.Controllers
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
         public async Task<IActionResult> EditUser(EditUserDto dto)
         {
-            if(dto.CurrUserId < 1) return Ok(JsonView(false, "暂无修改权限!"));
+            if (dto.CurrUserId < 1) return Ok(JsonView(false, "暂无修改权限!"));
 
             //修改权限验证 指定人员 信息部门(4)和人事部刘一茹( 230)、赖红燕(309)
             var userIds = new List<int>() {
@@ -1331,25 +1308,25 @@ namespace OASystem.API.Controllers
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
         public async Task<IActionResult> EditMyUser(EditMyUserDto dto)
         {
-            if (string.IsNullOrWhiteSpace(dto.CnName) || 
-                string.IsNullOrWhiteSpace(dto.Address) || 
-                string.IsNullOrWhiteSpace(dto.IDCard) || 
+            if (string.IsNullOrWhiteSpace(dto.CnName) ||
+                string.IsNullOrWhiteSpace(dto.Address) ||
+                string.IsNullOrWhiteSpace(dto.IDCard) ||
                 dto.Sex != 0 && dto.Sex != 1 ||
-                string.IsNullOrWhiteSpace(dto.MaritalStatus) || 
-                string.IsNullOrWhiteSpace(dto.HomeAddress) || 
+                string.IsNullOrWhiteSpace(dto.MaritalStatus) ||
+                string.IsNullOrWhiteSpace(dto.HomeAddress) ||
                 dto.Birthday >= DateTime.Now.AddYears(-1))
             {
                 return Ok(JsonView(false, "请完善你的个人信息!"));
             }
-            else if (string.IsNullOrWhiteSpace(dto.GraduateInstitutions) || 
-                string.IsNullOrWhiteSpace(dto.Professional) || 
-                dto.Education == 0 || 
+            else if (string.IsNullOrWhiteSpace(dto.GraduateInstitutions) ||
+                string.IsNullOrWhiteSpace(dto.Professional) ||
+                dto.Education == 0 ||
                 string.IsNullOrWhiteSpace(dto.GraduateInstitutions))
             {
                 return Ok(JsonView(false, "请完善你的学历信息!"));
             }
-            else if (string.IsNullOrWhiteSpace(dto.Phone) || 
-                string.IsNullOrWhiteSpace(dto.UrgentPhone) || 
+            else if (string.IsNullOrWhiteSpace(dto.Phone) ||
+                string.IsNullOrWhiteSpace(dto.UrgentPhone) ||
                 string.IsNullOrWhiteSpace(dto.Email))
             {
                 return Ok(JsonView(false, "请检查联系方式、紧急联系人及邮箱输写是否正确!"));
@@ -2186,7 +2163,7 @@ And u.UId = {0} And u.FId = 1 ", dto.UserId);
                 if (department.Equals("总经办")) //总经办
                 {
                     //1、资料数据(市场部客户资源、op地接导游、op地接车数据、商邀数据、团组收款数据)数据提示Range(固定上个月) -- Add
-                    
+
                     #region 市场部客户资源
                     //1.1 市场部客户资源
                     var users = await _sqlSugar.Queryable<Sys_Users>()
@@ -2268,7 +2245,8 @@ And u.UId = {0} And u.FId = 1 ", dto.UserId);
 
                     foreach (var item in opTourGuideData) EncryptionProcessor.DecryptProperties(item);
                     var opTourGuideDataGroups = opTourGuideData.GroupBy(x => x.CreateUserId)
-                        .Select(g => new {
+                        .Select(g => new
+                        {
                             uId = g.Key,
                             name = g.ToList().FirstOrDefault()?.CreatleUserName ?? "-",
                             msgTips = $"上月新增OP地接导游资源共{g.Count()}条",
@@ -2290,7 +2268,7 @@ And u.UId = {0} And u.FId = 1 ", dto.UserId);
                         .Where((cd, u) => cd.IsDel == 0 && cd.CreateTime >= startDateTime && cd.CreateTime <= endDateTime)
                         .Select((cd, u) => new CarDataMsgTipsView()
                         {
-                            Area =  cd.UnitArea,
+                            Area = cd.UnitArea,
                             Client = cd.UnitName,
                             Contact = cd.Contact,
                             Job = "",
@@ -2302,7 +2280,8 @@ And u.UId = {0} And u.FId = 1 ", dto.UserId);
                         .ToListAsync();
                     foreach (var item in opCarData) EncryptionProcessor.DecryptProperties(item);
                     var opCarDataGroups = opCarData.GroupBy(x => x.CreateUserId)
-                        .Select(g => new {
+                        .Select(g => new
+                        {
                             uId = g.Key,
                             name = g.ToList().FirstOrDefault()?.CreatleUserName ?? "-",
                             msgTips = $"上月新增OP地接车资源共{g.Count()}条",
@@ -2335,7 +2314,8 @@ And u.UId = {0} And u.FId = 1 ", dto.UserId);
                         })
                         .ToListAsync();
                     var invitationGroups = invitationData.GroupBy(x => x.CreateUserId)
-                        .Select(g => new {
+                        .Select(g => new
+                        {
                             uId = g.Key,
                             name = g.ToList().FirstOrDefault()?.CreatleUserName ?? "-",
                             msgTips = $"上月新增商邀资源共{g.Count()}条",
@@ -2512,7 +2492,8 @@ And u.UId = {0} And u.FId = 1 ", dto.UserId);
                                                 di.VisitEndDate.AddDays(-3).ToString("yyyy-MM-dd").Equals(crrDate)
                          )
                         .GroupBy((sd, ccp, di) => new { di.Id, di.TeamName, ccp.CTable, sd.Name }) //可以多字段
-                        .Select((sd, ccp, di) => new {
+                        .Select((sd, ccp, di) => new
+                        {
                             diId = di.Id,
                             groupName = di.TeamName,
                             groupType = ccp.CTable,
@@ -2588,7 +2569,7 @@ And u.UId = {0} And u.FId = 1 ", dto.UserId);
                     #endregion
 
                     var jobs = new List<string>() { "经理", "主管" };
-                    if (jobs.Contains( currUserInfo.Role)) //经理、主管
+                    if (jobs.Contains(currUserInfo.Role)) //经理、主管
                     {
                         #region 经理、主管
                         //经理、主管(部门下所有人员) --> 日付(-:未审核提示)、团组费用录入提醒(根据团组结束时间-3天 如果对应的数据表里没有这个团组的费用信息)
@@ -2838,7 +2819,8 @@ And u.UId = {0} And u.FId = 1 ", dto.UserId);
                         })
                         .ToListAsync();
                         var invitationGroups = invitationData.GroupBy(x => x.CreateUserId)
-                            .Select(g => new {
+                            .Select(g => new
+                            {
                                 uId = g.Key,
                                 name = g.ToList().FirstOrDefault()?.CreatleUserName ?? "-",
                                 msgTips = $"上月新增商邀资源共{g.Count()}条",
@@ -2919,7 +2901,8 @@ And u.UId = {0} And u.FId = 1 ", dto.UserId);
                         foreach (var item in opTourGuideData) EncryptionProcessor.DecryptProperties(item);
 
                         var opTourGuideDataGroups = opTourGuideData.GroupBy(x => x.CreateUserId)
-                            .Select(g => new {
+                            .Select(g => new
+                            {
                                 uId = g.Key,
                                 name = g.ToList().FirstOrDefault()?.CreatleUserName ?? "-",
                                 msgTips = $"上月新增OP地接导游资源共{g.Count()}条",
@@ -2952,7 +2935,8 @@ And u.UId = {0} And u.FId = 1 ", dto.UserId);
                             })
                             .ToListAsync();
                         var opCarDataGroups = opCarData.GroupBy(x => x.CreateUserId)
-                            .Select(g => new {
+                            .Select(g => new
+                            {
                                 uId = g.Key,
                                 name = g.ToList().FirstOrDefault()?.CreatleUserName ?? "-",
                                 msgTips = $"上月新增OP地接车资源共{g.Count()}条",
@@ -3017,7 +3001,7 @@ And u.UId = {0} And u.FId = 1 ", dto.UserId);
                         msgTips = $"上月累计团组收款共{groupCollectionData.Count}条",
                         Data = groupCollectionGroups,
                     };
-                    
+
                     #endregion
 
                     #region 日付申请未审核数据
@@ -3063,7 +3047,7 @@ And u.UId = {0} And u.FId = 1 ", dto.UserId);
 
                     return Ok(JsonView(new { groupCollectionData = groupCollectionData1, dailyPaymentData = dailyPaymentData1 }));
                 }
-                return Ok(JsonView(false,"其余部门消息提示正在开发者中......"));
+                return Ok(JsonView(false, "其余部门消息提示正在开发者中......"));
             }
             return Ok(JsonView(false));
         }

+ 9 - 3
OASystem/OASystem.Api/Middlewares/RecordAPIOperationMiddleware.cs

@@ -17,9 +17,15 @@ namespace OASystem.API.Middlewares
         private readonly HttpClient _httpClient;
         private readonly IConfiguration _config;
         private readonly SqlSugarClient _sqlSugar;
-        private readonly ILogger<RecordAPIOperationMiddleware> _logger;
 
-        public RecordAPIOperationMiddleware(RequestDelegate next, IConfiguration config, ILogger<RecordAPIOperationMiddleware> logger, HttpClient httpClient, SqlSugarClient sqlSugar)
+        /// <summary>
+        /// 初始化
+        /// </summary>
+        /// <param name="next"></param>
+        /// <param name="config"></param>
+        /// <param name="httpClient"></param>
+        /// <param name="sqlSugar"></param>
+        public RecordAPIOperationMiddleware(RequestDelegate next, IConfiguration config, HttpClient httpClient, SqlSugarClient sqlSugar)
         {
             _next = next;
             _httpClient = httpClient;
@@ -157,7 +163,7 @@ namespace OASystem.API.Middlewares
                 if (context.Request.Headers.ContainsKey("X-Forwarded-For"))
                 {
                     remoteIp = context.Request.Headers["X-Forwarded-For"].ToString().Split(',', StringSplitOptions.RemoveEmptyEntries)[0];
-                    _logger.LogInformation($"IP:{remoteIp}");
+                    //_logger.LogInformation($"IP:{remoteIp}");
                 }
                 else
                 {

+ 1 - 1
OASystem/OASystem.Api/OAMethodLib/ChatGPT/ChatGPTTools.cs

@@ -44,7 +44,7 @@ namespace OASystem.API.OAMethodLib.ChatGPT
         /// post 访问 
         /// </summary>
         /// <param name="url">接口路径</param>
-        /// <param name="formData">请求参数</param>
+        /// <param name="reqData">请求参数</param>
         /// <returns></returns>
         public static async Task<Result> PostChatGPT(string url, CompletionCreateRequest reqData)
         {

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

@@ -46,7 +46,7 @@ namespace OASystem.API.OAMethodLib.ExcelOutput
                 return CreateExcel(_entity);
             }
 
-            return "";
+           // return "";
         }
 
         private string CreateExcel(Bus_ConfItemListInfo _entity)

Різницю між файлами не показано, бо вона завелика
+ 2 - 1
OASystem/OASystem.Api/OAMethodLib/File/AsposeHelper.cs


+ 18 - 16
OASystem/OASystem.Api/OAMethodLib/GeneralMethod.cs

@@ -297,10 +297,12 @@ namespace OASystem.API.OAMethodLib
         #region jwt
 
         /// <summary>
-        ///  获取token 
+        /// 获取token
         /// </summary>
         /// <param name="_config"></param>
         /// <param name="Number"></param>
+        /// <param name="uId"></param>
+        /// <param name="uName"></param>
         /// <param name="exp"></param>
         /// <returns></returns>
         public static async Task<string> GetToken(IConfiguration _config, string Number, int uId, string uName, DateTime exp)
@@ -472,7 +474,6 @@ namespace OASystem.API.OAMethodLib
         /// 业务模块 团组操作权限
         /// 返回可操作的团
         /// </summary>
-        /// <param name="diId">团组Id</param>
         /// <param name="userId">用户Id</param>
         /// <param name="CTable">业务模块Id</param>
         /// <returns></returns>
@@ -872,6 +873,8 @@ namespace OASystem.API.OAMethodLib
         /// 保存操作前汇率
         /// </summary>
         /// <param name="currUserId"></param>
+        /// <param name="diId"></param>
+        /// <param name="linkModule"></param>
         /// <returns></returns>
         public static async Task<bool> RateRecordSave(int currUserId, int diId, string linkModule)
         {
@@ -1056,7 +1059,7 @@ namespace OASystem.API.OAMethodLib
         /// </summary>
         /// <param name="teamRateModels"></param>
         /// <param name="cTable"></param>
-        /// <param name="currencyCode"></param>
+        /// <param name="currencyCodes"></param>
         /// <returns>
         /// string 
         /// eg: CNY 1.0000 
@@ -1631,7 +1634,7 @@ namespace OASystem.API.OAMethodLib
         /// <summary>
         /// 验证数字字符串
         /// </summary>
-        /// <param name="num"></param>
+        /// <param name="numStr"></param>
         /// <returns></returns>
         public static bool IsNumeric(this string numStr)
         {
@@ -1772,7 +1775,7 @@ namespace OASystem.API.OAMethodLib
                     {
                         country = listcode.Find(it => it.Three.Equals(item))?.City ?? "Unknown";
                     }
-                    int days = 0;
+                    //int days = 0;
                     if (airData.Count == 2)
                     {
                         DateTime arr_dt = Convert.ToDateTime(airData[0].ArrivedDate); //抵达时间
@@ -2159,8 +2162,7 @@ namespace OASystem.API.OAMethodLib
         /// 根据数字返回机型型号【2、3开头的就是空客,比如空客320,7开头的就是波音,比如波音777】
         /// 20210903贾文滔
         /// </summary>
-        /// <param name="startDate"></param>
-        /// <param name="endDate"></param>
+        /// <param name="temp"></param>
         /// <returns></returns>
         public static string GetLonger(string temp)
         {
@@ -2313,7 +2315,8 @@ namespace OASystem.API.OAMethodLib
         /// <summary>
         /// 根据月份返回天数
         /// </summary>
-        /// <param name="temp"></param>
+        /// <param name="Month"></param>
+        /// <param name="year"></param>
         /// <returns></returns>
         public static string GetDaysByMonth(string Month, int year)
         {
@@ -2560,7 +2563,7 @@ namespace OASystem.API.OAMethodLib
         /// <summary>
         /// op行程单 团组 城市路径
         /// </summary>
-        /// <param name="diid">团组Id</param>
+        /// <param name="diids">团组Id</param>
         /// <param name="separator">分隔符</param>
         /// <returns></returns>
         public static Dictionary<int, string> GetGroupCityLineItem(List<int> diids, string separator)
@@ -2789,7 +2792,7 @@ namespace OASystem.API.OAMethodLib
                     Res_ThreeCode start_Object = null;
                     Res_ThreeCode end_Object = null;
 
-                    bool isTrade = false;
+                    //bool isTrade = false;
 
                     //air 处理
                     foreach (var tabRow in tabSelect)
@@ -3133,7 +3136,7 @@ namespace OASystem.API.OAMethodLib
         /// <summary>
         /// 根据日期获取星期
         /// </summary>
-        /// <param name="dt"></param>
+        /// <param name="dtStr"></param>
         /// <returns></returns>
         public static string GetWeek(this string dtStr)
         {
@@ -3175,9 +3178,8 @@ namespace OASystem.API.OAMethodLib
         /// <summary>
         /// 三公费用明细 文件下载
         /// </summary>
-        /// <param name="diId"></param>
-        /// <param name="userId"></param>
-        /// <param name="CTable"></param>
+        /// <param name="dto"></param>
+        /// <param name="fileFormat"></param>
         /// <returns></returns>
         public static async Task<JsonView> EnterExitCostDownload(EnterExitCostDownloadDto dto, string fileFormat = "pdf")
         {
@@ -4113,8 +4115,8 @@ namespace OASystem.API.OAMethodLib
 
                         //国际旅费
 
-                        string outsideJJ = "";
-                        string allPriceJJ = "";
+                        //string outsideJJ = "";
+                        //string allPriceJJ = "";
                         if (enterExitCosts.SumJJC == 1 && enterExitCosts.SumGWC == 0)
                         {
                             dic.Add("AirFeeTotal", enterExitCosts.AirJJ.ToString("#0.00"));

+ 1 - 0
OASystem/OASystem.Api/OAMethodLib/GroupStepForDelegation.cs

@@ -398,6 +398,7 @@ Where d.Id={0} And u.Id not in({1})", DepartmentCode.IC, _groupConfig.FilterUser
         /// 刷新团组管控最新状态,或推进流程到下一节点
         /// </summary>
         /// <param name="scheduleId">团组流程Id</param>
+        /// <param name="auto"></param>
         public static async void RefreshWorkStep(int scheduleId, bool auto = false)
         {
             //var _grpScheduleRep = AutofacIocManager.Instance.GetService<GrpScheduleRepository>();

+ 4 - 4
OASystem/OASystem.Api/OAMethodLib/IOOperatorHelper.cs

@@ -53,16 +53,16 @@
         /// <summary>
         /// 移动文件
         /// </summary>
-        /// <param name="sourceFilePath"></param>
-        /// <param name="RecycleBinPath"></param>
+        /// <param name="sourceFileFullPath"></param>
+        /// <param name="recycleBinPath"></param>
         /// <returns></returns>
-        public void MoveFile(string sourceFileFullPath, string RecycleBinPath)
+        public void MoveFile(string sourceFileFullPath, string recycleBinPath)
         {
             //移动文件
             if (!string.IsNullOrEmpty(sourceFileFullPath) && System.IO.File.Exists(sourceFileFullPath))
             {
                 string fileName = Path.GetFileName(sourceFileFullPath);
-                System.IO.File.Move(sourceFileFullPath, RecycleBinPath + fileName);
+                System.IO.File.Move(sourceFileFullPath, recycleBinPath + fileName);
             }
         }
 

+ 30 - 37
OASystem/OASystem.Api/OAMethodLib/PayrollComputation.cs

@@ -21,6 +21,7 @@ namespace OASystem.API.OAMethodLib
         /// </summary>
         /// <param name="pm_WageSheetDattaSources"></param>
         /// <param name="userNames"></param>
+        /// <param name="userId"></param>
         /// <param name="thisYearMonth"></param>
         /// <param name="startDt"></param>
         /// <param name="endDt"></param>
@@ -201,7 +202,7 @@ namespace OASystem.API.OAMethodLib
                             other_deduction = 0.00M;          // 其他 扣款金额
 
                     decimal meal_deduction = 0.00M;           // 餐补 扣款金额
-                    decimal reissuecard_deduction = 0.00M;    // 补卡 扣款金额
+                    //decimal reissuecard_deduction = 0.00M;    // 补卡 扣款金额
 
                     #region 计算日工资 正常日薪 事假日薪 病假日薪
 
@@ -227,7 +228,7 @@ namespace OASystem.API.OAMethodLib
 
                     List<Root> userRoots = new List<Root>();
 
-                    string wx_userid = "";
+                    //string wx_userid = "";
 
 
                     if (_name == "蔡雯")
@@ -263,7 +264,7 @@ 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 则为试用员工
 
@@ -1522,7 +1523,7 @@ namespace OASystem.API.OAMethodLib
                     pm_wsInfo.CreateUserId = userId;
                     pm_wsInfo.CreateTime = DateTime.Now;
                     pm_wsInfo.DeleteUserId = null;
-                    pm_wsInfo.DeleteTime = null;
+                    pm_wsInfo.DeleteTime = string.Empty;
                     #endregion
 
                 }
@@ -1566,7 +1567,7 @@ namespace OASystem.API.OAMethodLib
         /// <summary>
         /// decimal 保留两位小数 不四舍五入
         /// </summary>
-        /// <param name="number"></param>
+        /// <param name="myDecimal"></param>
         /// <returns></returns>
         public static decimal ConvertToDecimal(decimal myDecimal)
         {
@@ -1577,7 +1578,7 @@ namespace OASystem.API.OAMethodLib
         /// <summary>
         /// decimal 保留两位小数 不四舍五入
         /// </summary>
-        /// <param name="number"></param>
+        /// <param name="myDecimal"></param>
         /// <returns></returns>
         public static decimal ConvertToDecimal1(this decimal myDecimal)
         {
@@ -1637,15 +1638,13 @@ namespace OASystem.API.OAMethodLib
         /// 计算类型费用
         /// 病假 事假 计算 按天计算
         /// </summary>
-        /// <param name="leaveType">
-        /// 1年假;2事假;3病假;4调休假;5婚假;6产假;7陪产假;8其他;9丧假
-        /// </param>
-        /// <param name="date_Range_type">
-        /// halfday 全天
-        /// hour  小时
-        /// </param>
+        /// <param name="leaveDetails"></param>
+        /// <param name="leaveType">1年假;2事假;3病假;4调休假;5婚假;6产假;7陪产假;8其他;9丧假</param>
+        /// <param name="date_Range_type"></param>
         /// <param name="startTime"></param>
         /// <param name="endTime"></param>
+        /// <param name="amountPayable"></param>
+        /// <param name="work_days"></param>
         /// <param name="duration"></param>
         /// <param name="mealDeduction"></param>
         /// <param name="typeDeduction"></param>
@@ -1657,7 +1656,7 @@ namespace OASystem.API.OAMethodLib
             decimal personalkLeave_dailywage_day = amountPayable / work_days; //日薪 = 事假日薪 *计算方式:日平均工资 = 当月应发工资 /当月应出勤天数。
 
             //半小时单位
-            decimal halfHour = 7.50M / 0.50M;
+            //decimal halfHour = 7.50M / 0.50M;
 
             switch (leaveType)
             {
@@ -1932,20 +1931,17 @@ namespace OASystem.API.OAMethodLib
         }
 
 
-
         /// <summary>
         /// 计算类型费用
         /// 病假 事假 计算 按小时计算
         /// </summary>
-        /// <param name="leaveType">
-        /// 1年假;2事假;3病假;4调休假;5婚假;6产假;7陪产假;8其他;9丧假
-        /// </param>
-        /// <param name="date_Range_type">
-        /// halfday 全天
-        /// hour  小时
-        /// </param>
+        /// <param name="leaveDetails"></param>
+        /// <param name="leaveType">1年假;2事假;3病假;4调休假;5婚假;6产假;7陪产假;8其他;9丧假</param>
+        /// <param name="date_Range_type"> halfday 全天  hour  小时</param>
         /// <param name="startTime"></param>
         /// <param name="endTime"></param>
+        /// <param name="amountPayable"></param>
+        /// <param name="work_days"></param>
         /// <param name="duration"></param>
         /// <param name="mealDeduction"></param>
         /// <param name="typeDeduction"></param>
@@ -1955,13 +1951,13 @@ namespace OASystem.API.OAMethodLib
             typeDeduction = 0;
             mealDeduction = 0;
 
-            string am_starttime = "08:59";
-            string am_endtime = "13:01";
+            //string am_starttime = "08:59";
+            //string am_endtime = "13:01";
 
             decimal personalkLeave_dailywage_day = amountPayable / work_days; //日薪 = 事假日薪 *计算方式:日平均工资 = 当月应发工资 /当月应出勤天数。
 
             //半小时单位
-            decimal halfHour = 7.50M / 0.50M;
+            //decimal halfHour = 7.50M / 0.50M;
 
             switch (leaveType)
             {
@@ -2034,7 +2030,7 @@ namespace OASystem.API.OAMethodLib
                             if (sj_halfDay > 0)
                             {
                                 LeaveDetails sjDetails = leaveDetails.Where(it => it.StartDt == startTime && it.EndDt == endTime).FirstOrDefault();
-                                decimal sjPrice = 0.00M;
+                                //decimal sjPrice = 0.00M;
                                 if (sjDetails != null)
                                 {
                                     Slice_info sj_slice_Info = sjDetails.SliceInfo;
@@ -2126,7 +2122,7 @@ namespace OASystem.API.OAMethodLib
                             {
                                 LeaveDetails bjDetails = leaveDetails.Where(it => it.StartDt == startTime && it.EndDt == endTime).FirstOrDefault();
 
-                                decimal bjPrice = 0.00M;
+                                //decimal bjPrice = 0.00M;
                                 if (bjDetails != null)
                                 {
                                     Slice_info bj_slice_Info = bjDetails.SliceInfo;
@@ -2212,20 +2208,18 @@ namespace OASystem.API.OAMethodLib
         /// <summary>
         /// 计算类型费用
         /// </summary>
-        /// <param name="date_Range_type">
-        /// halfday 全天
-        /// hour  小时
-        /// </param>
-        /// <param name="startTime"></param>
-        /// <param name="endTime"></param>
+        /// <param name="leaveDetails"></param>
+        /// <param name="date_Range_type"></param>
+        /// <param name="startTime1"></param>
+        /// <param name="endTime1"></param>
         /// <param name="duration"></param>
         /// <param name="mealDeduction"></param>
         public static void CalculateTypeFeeSub(List<LeaveDetails> leaveDetails, string date_Range_type, DateTime startTime1, DateTime endTime1,
             decimal duration, out decimal mealDeduction)
         {
             mealDeduction = 0;
-            string am_starttime = "09:00";
-            string am_endtime = "11:59";
+            //string am_starttime = "09:00";
+            //string am_endtime = "11:59";
 
             string startTime = startTime1.ToString("HH:mm:ss");
             string endTime = endTime1.ToString("HH:mm:ss");
@@ -2365,8 +2359,7 @@ namespace OASystem.API.OAMethodLib
         /// <summary>
         /// 获取时间段内除周末 节假日外的 工作日
         /// </summary>
-        /// <param name="startDt"></param>
-        /// <param name="endDt"></param>
+        /// <param name="yearMonth"></param>
         /// <returns></returns>
         public static async Task<int> GetWorkDays(string yearMonth)
         {

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

@@ -445,7 +445,9 @@ namespace OASystem.API.OAMethodLib.QiYeWeChatAPI.AppNotice
         /// <summary>
         /// CRM统计通知(周)
         /// </summary>
-        /// <param name="info"></param>
+        /// <param name="list"></param>
+        /// <param name="beginDt"></param>
+        /// <param name="endDt"></param>
         /// <returns></returns>
         public static string CRMStatistics_ToUser(List<CRMWeekStatisticsView> list, string beginDt, string endDt)
         {
@@ -472,7 +474,11 @@ namespace OASystem.API.OAMethodLib.QiYeWeChatAPI.AppNotice
         /// <summary>
         /// CRM统计通知(月)
         /// </summary>
-        /// <param name="info"></param>
+        /// <param name="list"></param>
+        /// <param name="beginDt"></param>
+        /// <param name="endDt"></param>
+        /// <param name="totalInsert"></param>
+        /// <param name="totalDelete"></param>
         /// <returns></returns>
         public static string CRMStatistics_Month_ToUser(List<CRMWeekStatisticsView> list, string beginDt, string endDt, int totalInsert, int totalDelete)
         {
@@ -497,7 +503,6 @@ namespace OASystem.API.OAMethodLib.QiYeWeChatAPI.AppNotice
             return result;
         }
 
-
         public static string BlackCodeInfo_ToVisaUser(BlackCodeInfo_ToVisaUser info)
         {
             string result = string.Format(@" `国家出入时间通知`  
@@ -656,7 +661,7 @@ namespace OASystem.API.OAMethodLib.QiYeWeChatAPI.AppNotice
     {
         public string TeamName { get; set; }
 
-        public List<CountryDataTime>  info { get; set; }
+        public List<CountryDataTime> info { get; set; }
 
         public string RefreshDate { get; set; }
     }

+ 14 - 7
OASystem/OASystem.Api/OAMethodLib/QiYeWeChatAPI/AppNotice/Library.cs

@@ -127,7 +127,8 @@ namespace OASystem.API.OAMethodLib.QiYeWeChatAPI.AppNotice
         /// <summary>
         /// 向指定群聊发送- 费用申请 -通知
         /// </summary>
-        /// <param name="diId"></param>
+        /// <param name="Grp_CreditCardPaymentId"></param>
+        /// <param name="sign"></param>
         /// <param name="qwEnum"></param>
         /// <returns></returns>
         public static async Task<bool> SendChatMsg_GroupStatus_ApplyFee(int Grp_CreditCardPaymentId, int sign, QiyeWeChatEnum qwEnum)
@@ -702,6 +703,8 @@ namespace OASystem.API.OAMethodLib.QiYeWeChatAPI.AppNotice
         /// <param name="userId"></param>
         /// <param name="begin"></param>
         /// <param name="end"></param>
+        /// <param name="totalInsert"></param>
+        /// <param name="totalDelete"></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)
         {
@@ -728,6 +731,7 @@ namespace OASystem.API.OAMethodLib.QiYeWeChatAPI.AppNotice
         ///  日付申请提交时推送财务群
         /// </summary>
         /// <param name="dailyPayId"></param>
+        /// <param name="sign"></param>
         /// <param name="qwEnum"></param>
         /// <returns></returns>
         public static async Task<bool> DailyPayReminders_Create_ToCaiwuChat(int dailyPayId, int sign, QiyeWeChatEnum qwEnum)
@@ -887,7 +891,10 @@ namespace OASystem.API.OAMethodLib.QiYeWeChatAPI.AppNotice
         /// <summary>
         /// 三公费用更改通知发送总经理(21)
         /// </summary>
-        /// <param name="sign"></param>
+        /// <param name="diId"></param>
+        /// <param name="receivedUserIds"></param>
+        /// <param name="updateUserId"></param>
+        /// <param name="url"></param>
         /// <returns></returns>
         public static async Task<bool> SendUserMsg_GroupShare_ToGM(int diId, List<string> receivedUserIds, int updateUserId, string url)
         {
@@ -919,7 +926,7 @@ namespace OASystem.API.OAMethodLib.QiYeWeChatAPI.AppNotice
         /// <summary>
         /// 三公费用确认通知发送财务部人员
         /// </summary>
-        /// <param name="sign"></param>
+        /// <param name="diId"></param>
         /// <returns></returns>
         public static async Task<bool> SendUserMsg_GroupShare_ToFinance(int diId)
         {
@@ -1077,16 +1084,16 @@ namespace OASystem.API.OAMethodLib.QiYeWeChatAPI.AppNotice
             return true;
         }
 
-        public static async Task<bool> SendUserMsg_blackAirInfo_ToVisaUser(int diId , List<CountryDataTime> arr)
+        public static async Task<bool> SendUserMsg_blackAirInfo_ToVisaUser(int diId, List<CountryDataTime> arr)
         {
             Grp_DelegationInfo groupInfo = _grpDeleRep.Query<Grp_DelegationInfo>(s => s.Id == diId).First();
 
-            var visaUser =  _grpDeleRep.Query<Sys_Users>(x => x.IsDel == 0 && x.JobPostId == 26)
+            var visaUser = _grpDeleRep.Query<Sys_Users>(x => x.IsDel == 0 && x.JobPostId == 26)
                 .Select(x => x.Id)
                 .ToList();
 
             List<string> userIds = new List<string>() { "235" };
-            userIds.AddRange(visaUser.Select(x=>x.ToString()));
+            userIds.AddRange(visaUser.Select(x => x.ToString()));
             List<string> qwUserIdList = GetQiyeChatUserIdList(userIds);
 
             BlackCodeInfo_ToVisaUser info = new BlackCodeInfo_ToVisaUser()
@@ -1109,7 +1116,7 @@ namespace OASystem.API.OAMethodLib.QiYeWeChatAPI.AppNotice
             return true;
         }
 
-        public static async Task<bool> SendUserMsg_GroupTimeInfo_ToVisaUser(int diId,  string startTime, string endTime)
+        public static async Task<bool> SendUserMsg_GroupTimeInfo_ToVisaUser(int diId, string startTime, string endTime)
         {
             Grp_DelegationInfo groupInfo = _grpDeleRep.Query<Grp_DelegationInfo>(s => s.Id == diId).First();
 

+ 7 - 1
OASystem/OASystem.Api/OAMethodLib/QiYeWeChatAPI/IQiYeWeChatApiService.cs

@@ -67,7 +67,7 @@ namespace OASystem.API.OAMethodLib.QiYeWeChatAPI
         /// </summary>
         /// <param name="startDt"></param>
         /// <param name="endDt"></param>
-        /// <param name="qiyeUid"></param>
+        /// <param name="qiyeUidList"></param>
         /// <returns></returns>
 
         Task<object> QueryAssessmentByUser(DateTime startDt, DateTime endDt, List<string> qiyeUidList);
@@ -177,12 +177,17 @@ namespace OASystem.API.OAMethodLib.QiYeWeChatAPI
         /// <summary>
         /// 获取部门成员
         /// </summary>
+        /// <param name="departmentId"></param>
         /// <returns></returns>
         Task<GroupStatus_UserSimplelistView> GroupStatus_GetUserList(int departmentId = 8402038);
 
         /// <summary>
         /// 创建群聊
         /// </summary>
+        /// <param name="chatName"></param>
+        /// <param name="owner"></param>
+        /// <param name="userList"></param>
+        /// <param name="chatId"></param>
         /// <returns></returns>
         Task<GroupStatus_CreateChatView> GroupStatus_CreateChat(string chatName, string owner, List<string> userList, string chatId);
 
@@ -191,6 +196,7 @@ namespace OASystem.API.OAMethodLib.QiYeWeChatAPI
         /// </summary>
         /// <param name="chatId"></param>
         /// <param name="msgContent"></param>
+        /// <param name="msgType"></param>
         /// <returns></returns>
         Task<ResponseBase> GroupStatus_SendChatMsg_Markdown(string chatId, string msgContent, string msgType = "markdown");
 

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

@@ -12,7 +12,7 @@ namespace OASystem.API.OAMethodLib.Quartz.Business
     {
         private readonly static TaskAllocationRepository _taskAllocationRep = AutofacIocManager.Instance.GetService<TaskAllocationRepository>();
         //private readonly static SqlSugarClient _sqlSugar = AutofacIocManager.Instance.GetService<SqlSugarClient>();
-        private readonly static ILogger _logger;
+        //private readonly static ILogger _logger;
         /// <summary>
         /// 定时任务更改状态
         /// 每天下午六点定时更新

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

@@ -27,24 +27,24 @@ namespace OASystem.API.OAMethodLib.Quartz.Business
             #region 消息处理
             var newDB = _taskAllocationRep._sqlSugar.CopyNew();
             var data = newDB
-                                         .Queryable<Pm_TaskAllocation>()
-                                         .Where(it => it.IsDel == 0 &&
-                                                      !string.IsNullOrEmpty(it.PredictEndTime) &&
-                                                      Convert.ToDateTime(it.PredictEndTime).ToString("yyyy-MM-dd").Equals(DateTime.Now.ToString("yyyy-MM-dd"))
-                                               )
-                                         .ToList();
+                .Queryable<Pm_TaskAllocation>()
+                .Where(it => it.IsDel == 0 &&
+                            !string.IsNullOrEmpty(it.PredictEndTime) &&
+                            Convert.ToDateTime(it.PredictEndTime).ToString("yyyy-MM-dd").Equals(DateTime.Now.ToString("yyyy-MM-dd"))
+                    )
+                .ToList();
             if (data.Count > 0)
             {
                 //处理要任务提醒的员工
                 List<int> primaryIds = new List<int>();
                 primaryIds = data.Select(it => it.Id).ToList();
                 var subData = newDB
-                                                .Queryable<Pm_TaskRelevanceUser>()
-                                                .Where(it => it.IsDel == 0 &&
-                                                             primaryIds.Contains(it.TAId) &&
-                                                             (int)it.TaskStatus <= (int)TaskEnum.UnderWay
-                                                      )
-                                                .ToList();
+                    .Queryable<Pm_TaskRelevanceUser>()
+                    .Where(it => it.IsDel == 0 &&
+                                    primaryIds.Contains(it.TAId) &&
+                                    (int)it.TaskStatus <= (int)TaskEnum.UnderWay
+                            )
+                    .ToList();
 
                 var depDatas = newDB.Queryable<Sys_Department>().Where(it => it.IsDel == 0).ToList();
                 var groupDatas = newDB.Queryable<Grp_DelegationInfo>().Where(it => it.IsDel == 0).ToList();

+ 1 - 1
OASystem/OASystem.Api/OAMethodLib/Quartz/QuartzFactory.cs

@@ -8,7 +8,7 @@ namespace QuzrtzJob.Factory
     {
         //1、声明一个调度工厂
         private ISchedulerFactory _schedulerFactory;
-        private IScheduler _scheduler = default;
+        private IScheduler _scheduler;
         private IJobFactory _IOCjobFactory;
         public QuartzFactory(ISchedulerFactory schedulerFactory, IJobFactory jobFactory)
         {

+ 31 - 3
OASystem/OASystem.Api/OAMethodLib/SignalR/HubClients/IChatClient.cs

@@ -2,17 +2,46 @@
 {
     public interface IChatClient
     {
+        /// <summary>
+        /// 
+        /// </summary>
+        /// <param name="userId"></param>
+        /// <returns></returns>
         Task SignalRLogin(int userId);
 
+        /// <summary>
+        /// 
+        /// </summary>
+        /// <param name="method"></param>
+        /// <param name="message"></param>
+        /// <returns></returns>
         Task SendAsync(string method, object message);
-
+        /// <summary>
+        /// 发送消息给所有用户
+        /// </summary>
+        /// <param name="message"></param>
+        /// <returns></returns>
         Task SendAll(object message);
 
+        /// <summary>
+        /// 发送消息给指定用户
+        /// </summary>
+        /// <param name="message"></param>
+        /// <returns></returns>
         Task SendMessageByUser(object message);
 
+        /// <summary>
+        /// 发送消息给指定用户(自定义)
+        /// </summary>
+        /// <param name="message"></param>
+        /// <returns></returns>
         Task SendCustomUserMessage(object message);
 
-
+        /// <summary>
+        /// 
+        /// </summary>
+        /// <param name="message"></param>
+        /// <returns></returns>
         Task ReceiveMessage(object message);
 
         /// <summary>
@@ -25,7 +54,6 @@
         /// <summary>
         /// 发送消息给所有用户(系统)
         /// </summary>
-        /// <param name="id"></param>
         /// <param name="message"></param>
         /// <returns></returns>
         Task SendSystemToAllUser(string message);

+ 1 - 2
OASystem/OASystem.Api/OAMethodLib/SignalR/Hubs/ChatHub.cs

@@ -63,7 +63,7 @@ namespace OASystem.API.OAMethodLib.Hub.Hubs
                 if (!string.IsNullOrEmpty(token))
                 {
                     TokenModelJwt tokenModelJwt = JwtHelper.SerializeJwt(token.ToString().Split(" ")[1]);
-                    string result = "";
+                   
                     if (tokenModelJwt != null)
                     {
                         var connId = Context.ConnectionId;
@@ -134,7 +134,6 @@ namespace OASystem.API.OAMethodLib.Hub.Hubs
         /// <summary>
         /// 发送消息给所有用户(系统)
         /// </summary>
-        /// <param name="id"></param>
         /// <param name="message"></param>
         /// <returns></returns>
         public async Task SendSystemToAllUser(string message) => await Clients.All.SendAsync("ReceiveMessage", message);

+ 3 - 2
OASystem/OASystem.Api/OAMethodLib/TencentCloudAPI/TencentOCRTools.cs

@@ -300,8 +300,9 @@ namespace OASystem.API.OAMethodLib.TencentCloudAPI
         /// <summary>
         /// 得到适应的大小
         /// </summary>
-        /// <param name="path"></param>
-        /// <returns>string</returns>
+        /// <param name="size"></param>
+        /// <param name="roundCount"></param>
+        /// <returns></returns>
         public static string GetAutoSizeString(double size, int roundCount)
         {
             if (KBCount > size)

+ 1 - 1
OASystem/OASystem.Domain/Dtos/PersonnelModule/TaskAllocationDto.cs

@@ -18,7 +18,7 @@ namespace OASystem.Domain.Dtos.PersonnelModule
         /// <summary>
         /// 用户Id
         /// </summary>
-        public int UserId { get; set; }
+        public new int UserId { get; set; }
 
     }
 

+ 2 - 1
OASystem/OASystem.Domain/Enums/EnumHelper.cs

@@ -76,7 +76,8 @@ namespace OASystem.Domain.Enums
             {
                 if (field.FieldType.IsEnum)
                 {
-                    strValue = ((int)enumType.InvokeMember(field.Name, BindingFlags.GetField, null, null, null)).ToString();
+                    //strValue = ((int)enumType.InvokeMember(field.Name, BindingFlags.GetField, null, null, null)).ToString();
+                    strValue = (enumType.InvokeMember(field.Name, BindingFlags.GetField, null, null, null) as int?)?.ToString() ?? string.Empty;
                     object[] arr = field.GetCustomAttributes(typeDescription, true);
                     if (arr.Length > 0)
                     {

+ 4 - 3
OASystem/OASystem.Infrastructure/OASystem.Infrastructure.csproj

@@ -1,4 +1,4 @@
-<Project Sdk="Microsoft.NET.Sdk">
+<Project Sdk="Microsoft.NET.Sdk">
 
   <PropertyGroup>
     <TargetFramework>net6.0</TargetFramework>
@@ -19,16 +19,17 @@
     <PackageReference Include="Autofac.Extensions.DependencyInjection" Version="8.0.0" />
     <PackageReference Include="AutoMapper" Version="12.0.0" />
     <PackageReference Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="12.0.0" />
+    <PackageReference Include="CommonServiceLocator" Version="2.0.7" />
     <PackageReference Include="Microsoft.AspNetCore.Http.Abstractions" Version="2.2.0" />
     <PackageReference Include="Microsoft.Extensions.Configuration" Version="7.0.0" />
     <PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="7.0.0" />
     <PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="7.0.0" />
     <PackageReference Include="NPOI" Version="2.6.0" />
-    <PackageReference Include="pinyin4net" Version="1.0.0" />
     <PackageReference Include="Serilog.Sinks.File" Version="5.0.0" />
     <PackageReference Include="SqlSugarCore" Version="5.1.3.32" />
     <PackageReference Include="StackExchange.Redis" Version="2.6.96" />
-    <PackageReference Include="XAct.Core.PCL" Version="0.0.5014" />
+    <PackageReference Include="TinyPinyin.Net" Version="1.0.2" />
+    <!--<PackageReference Include="XAct.Core.PCL" Version="0.0.5014" />-->
   </ItemGroup>
 
   <ItemGroup>

+ 2 - 2
OASystem/OASystem.Infrastructure/Repositories/Business/CommonBusRepository.cs

@@ -128,7 +128,7 @@ Inner Join Sys_SetData as s With(Nolock) On t.SdId=s.Id ");
             }
 
 
-            return -1;
+            //return -1;
         }
 
         /// <summary>
@@ -183,7 +183,7 @@ Inner Join Sys_SetData as s With(Nolock) On t.SdId=s.Id ");
                 return -4;
             }
 
-            return -1;
+            //return -1;
         }
 
         #endregion

+ 0 - 1
OASystem/OASystem.Infrastructure/Repositories/CRM/NewClientDataRepository.cs

@@ -31,7 +31,6 @@ using System.Runtime.Intrinsics.Arm;
 using System.Text;
 using System.Threading.Tasks;
 using System.Xml.Linq;
-using XAct;
 using static Google.Protobuf.Reflection.SourceCodeInfo.Types;
 using static OASystem.Domain.Dtos.CRM.NewClientDataQueryDto;
 

+ 1 - 2
OASystem/OASystem.Infrastructure/Repositories/Groups/VisaFeeInfoRepository.cs

@@ -170,8 +170,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
         /// <summary>
         /// List
         /// </summary>
-        /// <param name="portType"></param>
-        /// <param name="diId"></param>
+        /// <param name="dto"></param>
         /// <returns></returns>
         public async Task<Result> _Update(VisaFeeAddAndUpdateDto dto)
         {

+ 1 - 1
OASystem/OASystem.Infrastructure/Repositories/Login/LoginRepository.cs

@@ -146,7 +146,7 @@ namespace OASystem.Infrastructure.Repositories.Login
                 CreateUserId = registerDto.CreateUserId,
                 CreateTime = DateTime.Now, //默认当前时间
                 DeleteUserId = null,  //删除用户时操作该字段
-                DeleteTime = null,   //删除用户时操作该字段
+                DeleteTime = string.Empty,   //删除用户时操作该字段
                 Remark = "",         //备注
                 IsDel = 0
             };

+ 0 - 1
OASystem/OASystem.Infrastructure/Repositories/Resource/CarDataRepository.cs

@@ -4,7 +4,6 @@ using OASystem.Domain.AesEncryption;
 using OASystem.Domain.Dtos.Resource;
 using OASystem.Domain.Entities.Resource;
 using OASystem.Domain.ViewModels.Resource;
-using XAct;
 
 namespace OASystem.Infrastructure.Repositories.Resource
 {

+ 0 - 1
OASystem/OASystem.Infrastructure/Repositories/Resource/HotelDataRepository.cs

@@ -13,7 +13,6 @@ using System.Collections.Generic;
 using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
-using XAct.Users;
 using Result = OASystem.Domain.Result;
 
 namespace OASystem.Infrastructure.Repositories.Resource

+ 1 - 2
OASystem/OASystem.Infrastructure/Repositories/Resource/ResItemInfoRepository.cs

@@ -129,7 +129,6 @@ Job,Mobile,Remark From Res_ItemVendor With(Nolock) {2}
                 return null;
             }
 
-            return null;
         }
 
         /// <summary>
@@ -298,7 +297,7 @@ Where d.Id={0} ", _dto.ItemId);
                 return null;
             }
 
-            return null;
+            //return null;
         }
 
         /// <summary>

+ 14 - 39
OASystem/OASystem.Infrastructure/Tools/CommonFun.cs

@@ -1,15 +1,10 @@
-using Newtonsoft.Json.Linq;
-using Newtonsoft.Json;
-using NPOI.SS.Formula.Functions;
-using OASystem.Domain.ViewModels.Financial;
+using Newtonsoft.Json;
+using Newtonsoft.Json.Linq;
 using OASystem.Domain.ViewModels.Groups;
 using System.Collections;
 using System.Globalization;
 using System.Reflection;
-using System.Reflection.Metadata;
-using System.Security.Cryptography;
-using Pinyin4net.Format;
-using Pinyin4net;
+using TinyPinyin;
 
 namespace OASystem.Infrastructure.Tools;
 
@@ -363,13 +358,13 @@ public static class CommonFun
     /// </summary>
     /// <param name="rates"></param>
     /// <returns></returns>
-    public static string  GetCurrencyChinaToString(List<CurrencyInfo>? rates)
+    public static string GetCurrencyChinaToString(List<CurrencyInfo>? rates)
     {
         string rateStr = string.Empty;
         if (rates == null) return rateStr;
         if (rates.Count <= 0) return rateStr;
 
-        if (rates.Count == 1 )
+        if (rates.Count == 1)
         {
             var rate = rates[0];
             return string.Format("{0}({1}):{2}|", rate.CurrencyName, rate.CurrencyCode, rate.Rate);
@@ -441,7 +436,7 @@ public static class CommonFun
             return -1;
 
         char genderChar = idNumber[16];
-        return int.Parse(genderChar.ToString()) % 2 == 0 ? 1 :0;
+        return int.Parse(genderChar.ToString()) % 2 == 0 ? 1 : 0;
     }
 
 
@@ -561,7 +556,7 @@ public static class CommonFun
                     Console.WriteLine($"{pi.Name}:{ex.Message}");
                 }
 
-                
+
             }
             for (int i = 0; i < list.Count; i++)
             {
@@ -571,7 +566,7 @@ public static class CommonFun
                     object obj = pi.GetValue(list[i], null);
                     tempList.Add(obj);
                 }
-                object[] array = tempList.ToArray();
+                object?[] array = tempList.ToArray();
                 result.LoadDataRow(array, true);
             }
         }
@@ -618,12 +613,12 @@ public static class CommonFun
     /// </summary>
     private static readonly HashSet<string> commonDoubleSurnames = new HashSet<string>
     {
-        "欧阳", "司马", "上官", "夏侯", "诸葛", "东方", "赫连", "皇甫", "尉迟", "公羊", 
-        "澹台", "公冶", "宗政", "濮阳", "淳于", "单于", "太叔", "申屠", "公孙", "仲孙", 
-        "轩辕", "令狐", "钟离", "宇文", "长孙", "慕容", "鲜于", "闾丘", "司徒", "司空", 
+        "欧阳", "司马", "上官", "夏侯", "诸葛", "东方", "赫连", "皇甫", "尉迟", "公羊",
+        "澹台", "公冶", "宗政", "濮阳", "淳于", "单于", "太叔", "申屠", "公孙", "仲孙",
+        "轩辕", "令狐", "钟离", "宇文", "长孙", "慕容", "鲜于", "闾丘", "司徒", "司空",
         "亓官", "司寇", "仉督", "子车", "颛孙", "端木", "巫马", "公西", "漆雕", "乐正",
-        "壤驷", "公良", "拓跋", "夹谷", "宰父", "谷梁", "晋楚", "闫法", "汝鄢", "涂钦", 
-        "段干", "百里", "东郭", "南门", "呼延", "归海", "羊舌", "微生", "岳帅", "缑亢", 
+        "壤驷", "公良", "拓跋", "夹谷", "宰父", "谷梁", "晋楚", "闫法", "汝鄢", "涂钦",
+        "段干", "百里", "东郭", "南门", "呼延", "归海", "羊舌", "微生", "岳帅", "缑亢",
         "况后", "有琴", "梁丘", "左丘", "东门", "西门", "商牟", "佘佴", "伯赏", "南宫"
     };
 
@@ -664,27 +659,7 @@ public static class CommonFun
     {
         if (string.IsNullOrEmpty(chineseName)) return "";
 
-        HanyuPinyinOutputFormat format = new HanyuPinyinOutputFormat
-        {
-            ToneType = HanyuPinyinToneType.WITHOUT_TONE,
-            VCharType = HanyuPinyinVCharType.WITH_V,
-            CaseType = HanyuPinyinCaseType.UPPERCASE
-        };
-
-        string pinyin = string.Empty;
-        foreach (char ch in chineseName)
-        {
-            if (PinyinHelper.ToHanyuPinyinStringArray(ch) != null)
-            {
-                pinyin += PinyinHelper.ToHanyuPinyinStringArray(ch, format)[0];
-            }
-            else
-            {
-                pinyin += ch;
-            }
-        }
-
-        return pinyin;
+        return PinyinHelper.GetPinyin(chineseName, "").ToUpper();
     }
 
 }