using Yitter.IdGenerator;
namespace Admin.NET.Plugin.AiDOP.Supply;
///
/// 物料需求计划服务
///
/// 【租户安全边界】租户一律经 从认证后 JWT 解析,
/// 无有效租户即拒绝,不读前端 tenantId、无默认回退。
///
/// 原实现:类级 [AllowAnonymous] + 多处以 _userManager.TenantId 拼接条件
/// (if (TenantId > 0) / tenantId <= 0 || 跳过形态)。匿名请求下 TenantId=0,
/// 租户过滤整体被跳过,等价于未认证可跨租户读/软删/发布需求计划。
///
///
[ApiDescriptionSettings(Order = 305, Description = "物料需求计划")]
[Route("api/Supply")]
[NonUnify]
public class DemandScheduleService : IDynamicApiController, ITransient
{
private readonly ISqlSugarClient _db;
private readonly SqlSugarRepository _rep;
private readonly UserManager _userManager;
public DemandScheduleService(
ISqlSugarClient db,
SqlSugarRepository rep,
UserManager userManager)
{
_db = db;
_rep = rep;
_userManager = userManager;
}
[DisplayName("物料需求计划列表")]
[HttpGet("demand-schedule/list")]
public async Task