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

移除重复数据检查逻辑

在 `DecreasePaymentsRepository.cs` 文件中,注释掉了对 `Grp_DecreasePayments` 表的查询和存在性检查逻辑。添加数据时不再检查是否已有相同的数据存在,直接进行添加操作。
Lyyyi 1 тиждень тому
батько
коміт
a64d939248

+ 8 - 8
OASystem/OASystem.Infrastructure/Repositories/Groups/DecreasePaymentsRepository.cs

@@ -167,13 +167,13 @@ namespace OASystem.Infrastructure.Repositories.Groups
             {
                 string selectSql = string.Format(@"select * from Grp_DecreasePayments where PriceName='{0}' and IsDel={1} and DiId={2}"
                                                 , dto.PriceName, 0, dto.DiId);
-                var DecreasePayments = await _sqlSugar.SqlQueryable<Grp_DecreasePayments>(selectSql).FirstAsync();//查询是否存在
-                if (DecreasePayments != null)
-                {
-                    return new JsonView() { Code = 400, Msg = "该数据已存在,请勿重复添加!" };
-                }
-                else//不存在,可添加
-                {
+                //var DecreasePayments = await _sqlSugar.SqlQueryable<Grp_DecreasePayments>(selectSql).FirstAsync();//查询是否存在
+                //if (DecreasePayments != null)
+                //{
+                //    return new JsonView() { Code = 400, Msg = "该数据已存在,请勿重复添加!" };
+                //}
+                //else//不存在,可添加
+                //{
                     id = await AddAsyncReturnId(grp_Decrease);
                     if (id < 1)
                     {
@@ -289,7 +289,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
 
                     RollbackTran();
                     return new JsonView() { Code = 400, Msg = "添加失败!" };
-                }
+               // }
             }
             else if (dto.Status == 2)
             {