Browse Source

清理引用并优化条件判断逻辑

在 `FeeAuditRepository.cs` 文件中,移除了多个不必要的引用,并将 `PriceName.Contains` 的参数从双引号改为单引号。同时,使用 C# 9.0 的简化语法初始化 `List<int>`。

在 `GoodsRepository.cs` 文件中,修改了条件判断逻辑,从 `if (editSub > 0)` 改为 `if (editSub < 1)`,可能会影响事务的回滚行为。
LEIYI 1 month ago
parent
commit
f3d8ece2c0

+ 2 - 10
OASystem/OASystem.Infrastructure/Repositories/Groups/FeeAuditRepository.cs

@@ -1,16 +1,8 @@
 using EyeSoft.Extensions;
 using EyeSoft.Extensions;
-using EyeSoft.Logging;
-using NPOI.SS.Formula.Functions;
 using OASystem.Domain;
 using OASystem.Domain;
 using OASystem.Domain.Entities.Groups;
 using OASystem.Domain.Entities.Groups;
 using OASystem.Domain.Entities.Resource;
 using OASystem.Domain.Entities.Resource;
 using OASystem.Domain.ViewModels.Groups;
 using OASystem.Domain.ViewModels.Groups;
-using SqlSugar;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
 
 
 namespace OASystem.Infrastructure.Repositories.Groups
 namespace OASystem.Infrastructure.Repositories.Groups
 {
 {
@@ -432,7 +424,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
                 var ids = new List<int>();
                 var ids = new List<int>();
                 foreach (var item in otherFeeDatas)
                 foreach (var item in otherFeeDatas)
                 {
                 {
-                    if (item.PriceName.Contains("、"))
+                    if (item.PriceName.Contains('、'))
                     {
                     {
                         var priceNames = item.PriceName.Split('、');
                         var priceNames = item.PriceName.Split('、');
                         foreach (var priceName in priceNames)
                         foreach (var priceName in priceNames)
@@ -855,7 +847,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
             if (diId < 1) {  return _view; }
             if (diId < 1) {  return _view; }
             if (dataId < 1) { return _view; }
             if (dataId < 1) { return _view; }
 
 
-            List<int> stids = new List<int>() { 17, 66 };
+            List<int> stids = new() { 17, 66 };
             var setData = _sqlSugar.Queryable<Sys_SetData>().Where(x => x.IsDel == 0 && stids.Contains(x.STid)).ToList();
             var setData = _sqlSugar.Queryable<Sys_SetData>().Where(x => x.IsDel == 0 && stids.Contains(x.STid)).ToList();
             string _teamCurrency = string.Empty;
             string _teamCurrency = string.Empty;
 
 

+ 1 - 1
OASystem/OASystem.Infrastructure/Repositories/PersonnelModule/GoodsRepository.cs

@@ -2974,7 +2974,7 @@ namespace OASystem.Infrastructure.Repositories.PersonnelModule
                 .Where(x => x.GoodsReceiveId == id)
                 .Where(x => x.GoodsReceiveId == id)
                 .ExecuteCommandAsync();
                 .ExecuteCommandAsync();
 
 
-            if (editSub > 0)
+            if (editSub < 1)
             {
             {
                 _sqlSugar.RollbackTran();
                 _sqlSugar.RollbackTran();
                 return _jv;
                 return _jv;