Browse Source

修改删除操作的提示信息和审核逻辑

在 `DecreasePaymentsRepository.cs` 文件中,更新了删除操作的错误提示信息,将 `ccpInfo` 为 `null` 的提示更改为“数据不存在,不可删除!”。同时,新增审核状态列表,并在删除前增加对手动审核和付款状态的检查,以提高删除操作的安全性。
Lyyyi 1 day ago
parent
commit
305f74ed70

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

@@ -507,8 +507,14 @@ namespace OASystem.Infrastructure.Repositories.Groups
 
             var ccpInfo =await _sqlSugar.Queryable<Grp_CreditCardPayment>()
                 .FirstAsync(x => x.CId == id && x.CTable == 98 && x.IsDel == 0);
-            if (ccpInfo == null) return new Result(-2, "删除失败!");
-            if (ccpInfo.IsAuditGM > 0) return new Result(-2, "该费用已审核,不可删除!");
+            if (ccpInfo == null) return new Result(-2, "数据不存在,不可删除!");
+
+            var auditStatus = new List<int>() {
+                    1, // 已通过
+            };
+
+            if (auditStatus.Any(x => x == ccpInfo.IsAuditGM)) return new Result(-2, "该费用已手动审核,不可删除!");
+
             if (ccpInfo.IsPay == 1) return new Result(-2, "该费用已付款,不可删除!");
 
             _sqlSugar.BeginTran();