Merge remote-tracking branch 'origin/glms/feature/1.4.2' into glms/feature/1.4.2-margin
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user