Merge remote-tracking branch 'origin/glms/feature/1.4.2' into glms/feature/1.4.2-margin

This commit is contained in:
锦麟 王
2026-08-24 09:40:03 +08:00
338 changed files with 9170 additions and 64604 deletions
@@ -33,6 +33,11 @@ namespace YLErp.Modules.ClientModule
return state == client_black. || state == client_black.;
}
public static bool CanDeleteDraft(string state)
{
return state == client_black. || state == client_black.;
}
public static ClientBlackRemovalResult GetRemovalResult(bool hasApprovalProcess)
{
return hasApprovalProcess
@@ -114,7 +114,7 @@ namespace YLErp.Modules.ClientModule
.ToList();
}
public void DeleteClientBlack(IEnumerable<int> ids)
public int DeleteClientBlack(IEnumerable<int> ids)
{
var idList = ids?.Distinct().ToList() ?? new List<int>();
if (idList.Count == 0)
@@ -129,8 +129,16 @@ namespace YLErp.Modules.ClientModule
}
var hasProcess = ProcessList().Any();
var submitRemovalApprovalCount = 0;
foreach (var row in rows)
{
if (ClientBlackApprovalPolicy.CanDeleteDraft(row.State))
{
DbContext.client_black.Remove(row);
ClientBlackCategoryLog(row.id, "已删除");
continue;
}
if (!ClientBlackApprovalPolicy.CanRequestRemoval(row.State))
{
throw new ServiceException($"黑名单客户{row.Name}当前状态不允许移出");
@@ -144,6 +152,7 @@ namespace YLErp.Modules.ClientModule
row.ApprovalOptName = UserName;
row.ApprovalOptDate = DateTime.Now;
ClientBlackCategoryLog(row.id, client_black.);
submitRemovalApprovalCount++;
}
else
{
@@ -152,6 +161,7 @@ namespace YLErp.Modules.ClientModule
}
DbContext.SaveChanges();
return submitRemovalApprovalCount;
}
public void WithdrawApprovalClientBlack(List<int> ids, out int withdrawCount, out string msg)