Browse Source

处理项目null问题

Lyyyi 6 days ago
parent
commit
da58f901e9

+ 10 - 14
OASystem/OASystem.Api/Controllers/AuthController.cs

@@ -1,8 +1,4 @@
-
-using Flurl.Http.Configuration;
-using Microsoft.AspNetCore.SignalR;
-using Microsoft.EntityFrameworkCore.Metadata.Internal;
-using NPOI.SS.Formula.Functions;
+using Microsoft.AspNetCore.SignalR;
 using OASystem.API.OAMethodLib;
 using OASystem.API.OAMethodLib.Hotmail;
 using OASystem.API.OAMethodLib.Hub.HubClients;
@@ -55,15 +51,15 @@ namespace OASystem.API.Controllers
         /// <param name="hotmailService"></param>
         /// <param name="httpClientFactory"></param>
         public AuthController(
-            IConfiguration config, 
-            LoginRepository loginRep, 
-            IMapper mapper, 
+            IConfiguration config,
+            LoginRepository loginRep,
+            IMapper mapper,
             MessageRepository message,
-            SystemMenuPermissionRepository sysMenuPermRep, 
-            IQiYeWeChatApiService qiYeWeChatApiService, 
+            SystemMenuPermissionRepository sysMenuPermRep,
+            IQiYeWeChatApiService qiYeWeChatApiService,
             MessageRepository messageRep,
             DeviceTokenRepository deviceRep,
-            IHubContext<ChatHub,IChatClient> hubContext, 
+            IHubContext<ChatHub, IChatClient> hubContext,
             HotmailService hotmailService,
             System.Net.Http.IHttpClientFactory httpClientFactory)
         {
@@ -506,7 +502,7 @@ namespace OASystem.API.Controllers
             var sb = new StringBuilder();
 
             foreach (var hotmailConfig in hotmailConfigs)
-            { 
+            {
                 var result = await _hotmailService.ForceRefreshTokenAsync(hotmailConfig.UserName);
                 sb.AppendLine($"User: {hotmailConfig.UserName} -> {result};");
             }
@@ -545,7 +541,7 @@ namespace OASystem.API.Controllers
                     { "grant_type", "authorization_code" },
                     // 换取时再次明确 scope 
                     { "scope", "openid offline_access Mail.ReadWrite Mail.Send User.Read" }
-                    
+
                 };
 
                 var response = await httpClient.PostAsync("https://login.microsoftonline.com/common/oauth2/v2.0/token", new FormUrlEncodedContent(tokenRequest));
@@ -666,7 +662,7 @@ namespace OASystem.API.Controllers
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
         public IActionResult RateTest()
         {
-            return Ok(JsonView(true, $"限流测试 - IP:{HttpContext.Connection.RemoteIpAddress?.ToString()}", null, GetRequestCount()));
+            return Ok(JsonView(true, $"限流测试 - IP:{HttpContext.Connection.RemoteIpAddress?.ToString()}", "", GetRequestCount()));
         }
 
         private static int _requestCount = 0;

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

@@ -4516,7 +4516,7 @@ FROM
 
         private static bool TryGetNonEmptyStringProperty(JsonElement root, string propertyName, out string value)
         {
-            value = null;
+            value = string.Empty;
 
             if (root.TryGetProperty(propertyName, out JsonElement propertyElement))
             {

+ 0 - 2
OASystem/OASystem.Api/Controllers/PersonnelModuleController.cs

@@ -3169,10 +3169,8 @@ OPTION (MAXRECURSION 0); -- 允许无限递归      ";
         /// <summary>
         /// 省外员工统一分析
         /// </summary>
-        /// <param name="userId"></param>
         /// <param name="start"></param>
         /// <param name="end"></param>
-        /// <param name="createUserId"></param>
         /// <returns></returns>
         [HttpGet]
         public async Task<IActionResult> AiPerformanceAnalysis_otherProvincesEmployeeAsync(DateTime start, DateTime end)

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

@@ -187,7 +187,7 @@ namespace OASystem.API.OAMethodLib.QiYeWeChatAPI
         /// <param name="limit">拉取条数</param>
         /// <param name="filters">过滤条件</param>
         /// <returns></returns>
-        Task<JournalRecordListView> GetJournalRecordListAsync(DateTime startTime, DateTime endTime, int cursor = 0, int limit = 10, List<JournalFilter> filters = null);
+        Task<JournalRecordListView> GetJournalRecordListAsync(DateTime startTime, DateTime endTime, int cursor = 0, int limit = 10, List<JournalFilter>? filters = null);
 
         /// <summary>
         /// 获取汇报记录详情

+ 2 - 2
OASystem/OASystem.Api/OAMethodLib/QiYeWeChatAPI/QiYeWeChatApiService.cs

@@ -1478,7 +1478,7 @@ namespace OASystem.API.OAMethodLib.QiYeWeChatAPI
         DateTime endTime,
         string newCursor = "",
         int size = 100,
-        List<IQiYeWeChatApiService.FilterCondition> filters = null)
+        List<IQiYeWeChatApiService.FilterCondition>? filters = null)
         {
             //申请人企业微信Id验证
             var creator = filters?.FirstOrDefault(f => f.key == "creator")?.value ?? "";
@@ -1670,7 +1670,7 @@ namespace OASystem.API.OAMethodLib.QiYeWeChatAPI
         /// <param name="limit"></param>
         /// <param name="filters"></param>
         /// <returns></returns>
-        public async Task<JournalRecordListView> GetJournalRecordListAsync(DateTime startTime, DateTime endTime, int cursor = 0, int limit = 10, List<JournalFilter> filters = null)
+        public async Task<JournalRecordListView> GetJournalRecordListAsync(DateTime startTime, DateTime endTime, int cursor = 0, int limit = 10, List<JournalFilter>? filters = null)
         {
             JournalRecordListView result = new JournalRecordListView();
 

+ 1 - 1
OASystem/OASystem.Domain/Entities/Groups/Grp_AirTicketReservations.cs

@@ -281,7 +281,7 @@ public class CustTicketInfo
     /// <summary>
     /// 退票记录
     /// </summary>
-    public RefundRecord RefundRecord { get; set; } = new RefundRecord();
+    public RefundRecord? RefundRecord { get; set; }
 
 }
 

+ 6 - 6
OASystem/OASystem.Domain/ViewModels/PersonnelModule/GoodsInfoView.cs

@@ -226,12 +226,12 @@ namespace OASystem.Domain.ViewModels.PersonnelModule
 
         //public GoodsStorageAuditPerView[] AuditPers { get; set; }
 
-        /// <summary>
-        /// 审核权限
-        /// true:有
-        /// false:无
-        /// </summary>
-        public bool IsAuditPer { get; set; } = false;
+        ///// <summary>
+        ///// 审核权限
+        ///// true:有
+        ///// false:无
+        ///// </summary>
+        //public new bool IsAuditPer { get; set; } = false;
 
     }
 

+ 3 - 3
OASystem/OASystem.Domain/ViewModels/QiYeWeChat/CheckInView.cs

@@ -586,9 +586,9 @@ namespace OASystem.Domain.ViewModels.QiYeWeChat
     /// </summary>
     public class HolidayConf : WorkdayConf { }
 
-    /// <summary>
-    /// 申请或打卡相关配置
-    /// </summary>
+    ///// <summary>
+    ///// 申请或打卡相关配置
+    ///// </summary>
     //public class ApplyInfo
     //{
     //    /// <summary>休息扣除配置</summary>