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

This commit is contained in:
锦麟 王
2026-08-17 10:20:04 +08:00
105 changed files with 4044 additions and 1588 deletions
@@ -93,7 +93,8 @@ namespace YLErp.Web.Controllers
var creditProcess = list.Where(s => s.processType == "CreditProcess").OrderBy(s => s.order).ToList();
var outCashProcess = list.Where(s => s.processType == "OutCashProcess").OrderBy(s => s.order).ToList();
var clientProcess = list.Where(s => s.processType == "ClientProcess").OrderBy(s => s.order).ThenBy(s => s.parentNode).ThenBy(s => s.node).ToList();
return Json(new { OpenProcess = openProcess, TradeProcess = tradeProcess, CloseProcess = closeProcess, CreditProcess = creditProcess, OutCashProcess= outCashProcess,ClientProcess = clientProcess });
var clientBlackProcess = list.Where(s => s.processType == "ClientBlackProcess").OrderBy(s => s.order).ThenBy(s => s.parentNode).ThenBy(s => s.node).ToList();
return Json(new { OpenProcess = openProcess, TradeProcess = tradeProcess, CloseProcess = closeProcess, CreditProcess = creditProcess, OutCashProcess= outCashProcess,ClientProcess = clientProcess, ClientBlackProcess = clientBlackProcess });
}
@@ -232,4 +233,4 @@ namespace YLErp.Web.Controllers
return Json(sList);
}
}
}
}
+2 -2
View File
@@ -2529,7 +2529,7 @@ namespace YLErp.Web.Controllers
return JsonError(error);
}
var clientblack = clientDB.client_black.FirstOrDefault(c => c.Name == client.Name);
if (clientblack != null)
if (clientblack != null && YLErp.Modules.ClientModule.ClientBlackApprovalPolicy.IsEffective(clientblack.State))
{
return JsonError("该客户为黑名单客户,禁止取消休眠");
}
@@ -3402,4 +3402,4 @@ namespace YLErp.Web.Controllers
return JsonSuccess();
}
}
}
}
+81 -31
View File
@@ -5,6 +5,19 @@ namespace YLErp.Web.Controllers
{
public class clientblackController : BaseController
{
public static List<SelectListItem> GetClientBlackStates()
{
return new List<SelectListItem>
{
new() { Text = client_black., Value = client_black. },
new() { Text = client_black., Value = client_black. },
new() { Text = client_black., Value = client_black. },
new() { Text = client_black., Value = client_black. },
new() { Text = client_black., Value = client_black. },
new() { Text = client_black., Value = client_black. }
};
}
[MyAuthorize("客户管理-黑名单客户")]
public ActionResult clientblacklist()
{
@@ -55,38 +68,75 @@ namespace YLErp.Web.Controllers
}
public ActionResult DeleteClientBlack(string ids)
{
var datalist = ids.Split(',');
var list = new List<int>();
foreach (var item in datalist)
try
{
var data = clientDB.client_black.Find(int.Parse(item));
if (data == null)
{
return JsonError("未找到要删除的数据");
}
else
{
var clitid = clientDB.client.Where(c => c.Name == data.Name).FirstOrDefault();
if (clitid != null)
{
clientDB.ClientAuditLog.Add(new ClientAuditLog
{
ClientId = clitid.id,
OptType = "移除黑名单",
Changes = string.Empty,
DataType = "00",
OptId = UserId,
OptName = UserName,
OptDate = DateTime.Now
});
}
clientDB.client_black.Remove(data);
}
var datalist = ids.Split(',', StringSplitOptions.RemoveEmptyEntries).Select(int.Parse).ToList();
var service = new ClientBlackService(CurUser);
service.DeleteClientBlack(datalist);
return JsonSuccess(service.ProcessList().Any() ? "已经提交删除审批!" : "删除成功");
}
clientDB.SaveChanges();
return JsonSuccess("删除成功");
catch (Exception ex)
{
return JsonError(ex.GetBaseException().Message);
}
}
[MyAuthorize("客户管理-黑名单审批")]
public ActionResult clientblackApproval()
{
return View();
}
[HttpPost, MyAuthorize("客户管理-黑名单审批")]
public JsonResult clientblackApprovalQuery(ClientBlackReq req)
{
return Json(new ClientBlackService(CurUser).ClientBlackApprovalQuery(req));
}
[HttpPost, MyAuthorize("客户管理-黑名单客户提交审批")]
public JsonResult clientblackSubmit(string ids)
{
var idList = ids.Split(',', StringSplitOptions.RemoveEmptyEntries).Select(int.Parse).ToList();
new ClientBlackService(CurUser).SubmitApprovalClientBlack(idList);
return JsonSuccess("提交审批成功");
}
[HttpPost, MyAuthorize("客户管理-黑名单客户撤回提交审批")]
public JsonResult clientblackWithdraw(string ids)
{
var idList = ids.Split(',', StringSplitOptions.RemoveEmptyEntries).Select(int.Parse).ToList();
new ClientBlackService(CurUser).WithdrawApprovalClientBlack(idList, out var withdrawCount, out var msg);
if (withdrawCount == 0)
{
return JsonError(string.IsNullOrWhiteSpace(msg)
? "所选记录当前状态无法撤回审批"
: $"以下记录已进入后续节点无法撤回:{msg}");
}
return JsonSuccess("撤回审批成功" + (string.IsNullOrWhiteSpace(msg) ? "" : $",以下记录已进入后续节点无法撤回:{msg}"));
}
[HttpPost, MyAuthorize("客户管理-黑名单审批")]
public JsonResult Auditclientblack(ClientBlackAuditReq req)
{
new ClientBlackService(CurUser).AuditClientBlack(req);
return JsonSuccess("审批成功");
}
[MyAuthorize("客户管理-黑名单审批")]
public ActionResult clientblackView(string enid)
{
var id = DataProtectHelper.DecryptInt(enid);
var item = clientDB.client_black.FirstOrDefault(x => x.id == id);
return View(item);
}
[MyAuthorize("客户管理-黑名单客户")]
public ActionResult clientblackLogList(int id)
{
var logs = clientDB.client_blacklog.Where(x => x.ClientBlackId == id)
.OrderByDescending(x => x.id)
.ToList();
return View(logs);
}
@@ -101,4 +151,4 @@ namespace YLErp.Web.Controllers
return File(bytes, xlsxMimeType, $"黑名单导出-{DateTime.Now:yyyy-MM-dd}.xlsx");
}
}
}
}
@@ -98,6 +98,10 @@ namespace YLErp.Web.Controllers
else
{
r.ValidStatus = false;
r.DataSource = ExDividendDataSources.Manual;
r.OptId = CurUser.UserId;
r.OptName = CurUser.UserName;
r.OptDate = DateTime.Now;
yldb.SaveChanges();
return JsonSuccess("删除成功");
}