打印模板权限

optimize
wet 2 years ago
parent e7770aa659
commit 1a8cb1cdeb

@ -290,14 +290,18 @@ namespace Myshipping.Application
throw Oops.Bah("未上传正确数据");
}
await _repRight.DeleteAsync(x => x.SysUserId == input.SysUserId);
// await _repRight.DeleteAsync(x => x.SysUserId == input.SysUserId);
foreach (var item in input.PrintTemplateId)
{
var ent = _repRight.FirstOrDefault(x => x.SysUserId == input.SysUserId && x.PrintTemplateId == item);
if (ent==null) {
BookingPrinttemplateRight right = new BookingPrinttemplateRight();
right.SysUserId = input.SysUserId;
right.PrintTemplateId = item;
await _repRight.InsertAsync(right);
}
}
}
/// <summary>
/// 获取打印模板权限
@ -311,6 +315,7 @@ namespace Myshipping.Application
WhereIF(userId != 0, d => d.SysUserId == userId).
Select((d, t) => new BookingPrinttemplateDto
{
Id=d.Id,
PrintTemplateId=t.Id,
SysUserId=d.SysUserId,
TypeCode = t.TypeCode,
@ -327,5 +332,16 @@ namespace Myshipping.Application
}
return list;
}
/// <summary>
/// 删除打印模板权限
/// </summary>
/// <param name="Ids"></param>
/// <returns></returns>
[HttpGet("/BookingPrintTemplate/DeletePrinttemplateRight")]
public async Task DeletePrinttemplateRight(List<long> Ids) {
await _repRight.DeleteAsync(x => Ids.Contains(x.Id));
}
}
}

@ -21,7 +21,7 @@ namespace Myshipping.Application.Service.BookingPrintTemplate.Dto
public class BookingPrinttemplateDto
{
public long Id { get; set; }
public long PrintTemplateId { get; set; }
public long SysUserId { get; set; }
public string TypeCode { get; set; }

@ -191,5 +191,12 @@ namespace Myshipping.Application
return await _excelsubrep.AsQueryable().Where( x => x.Pid==Id).ToListAsync();
}
}
}

Loading…
Cancel
Save