|
|
|
@ -290,13 +290,17 @@ 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)
|
|
|
|
|
{
|
|
|
|
|
BookingPrinttemplateRight right = new BookingPrinttemplateRight();
|
|
|
|
|
right.SysUserId = input.SysUserId;
|
|
|
|
|
right.PrintTemplateId = item;
|
|
|
|
|
await _repRight.InsertAsync(right);
|
|
|
|
|
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));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|