|
|
|
@ -36,10 +36,10 @@ namespace Myshipping.Application
|
|
|
|
|
private readonly SqlSugarRepository<BookingOrder> _repOrder;
|
|
|
|
|
|
|
|
|
|
private readonly SqlSugarRepository<BookingPrintTemplate> _repPrintTemplate;
|
|
|
|
|
private readonly SqlSugarRepository<BookingPrintTemplateShare> _repPrintTemplateShare;
|
|
|
|
|
private readonly SqlSugarRepository<BookingTemplateShare> _repPrintTemplateShare;
|
|
|
|
|
private readonly ILogger<BookingTemplate> _logger;
|
|
|
|
|
|
|
|
|
|
public BookingTemplateService(SqlSugarRepository<BookingTemplate> rep, SqlSugarRepository<BookingOrder> repOrder, SqlSugarRepository<BookingPrintTemplate> repPrintTemplate, SqlSugarRepository<BookingPrintTemplateShare> repPrintTemplateShare,ILogger<BookingTemplate> logger)
|
|
|
|
|
public BookingTemplateService(SqlSugarRepository<BookingTemplate> rep, SqlSugarRepository<BookingOrder> repOrder, SqlSugarRepository<BookingPrintTemplate> repPrintTemplate, SqlSugarRepository<BookingTemplateShare> repPrintTemplateShare,ILogger<BookingTemplate> logger)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -133,7 +133,7 @@ namespace Myshipping.Application
|
|
|
|
|
/// <param name="dto"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[HttpPost("/BookingTemplate/SaveTemplateShare")]
|
|
|
|
|
public async Task SaveTemplateShare(List<BookingPrintTemplateShareDto> dto)
|
|
|
|
|
public async Task SaveTemplateShare(List<BookingTemplateShareDto> dto)
|
|
|
|
|
{
|
|
|
|
|
if (dto==null|| dto.Count==0) {
|
|
|
|
|
|
|
|
|
@ -141,7 +141,7 @@ namespace Myshipping.Application
|
|
|
|
|
}
|
|
|
|
|
foreach (var item in dto)
|
|
|
|
|
{
|
|
|
|
|
var entity = item.Adapt<BookingPrintTemplateShare>();
|
|
|
|
|
var entity = item.Adapt<BookingTemplateShare>();
|
|
|
|
|
if (entity.Id == 0)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
@ -184,12 +184,15 @@ namespace Myshipping.Application
|
|
|
|
|
/// 获取分享列表
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public async Task<dynamic> GetTemplateShare() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[HttpGet("/BookingTemplate/GetTemplateShare")]
|
|
|
|
|
public async Task<dynamic> GetTemplateShare(string TemplateName)
|
|
|
|
|
{
|
|
|
|
|
var TemplateIds=_repPrintTemplateShare.AsQueryable().Filter(null, true).Where(x => x.IsDeleted == false && x.ShareToId == UserManager.UserId).Select(x => x.TemplateId).ToList();
|
|
|
|
|
|
|
|
|
|
var list =await _rep.AsQueryable().Filter(null, true).Where(x => x.IsDeleted == false && (TemplateIds.Contains(x.Id) || x.CreatedUserId == UserManager.UserId)).
|
|
|
|
|
WhereIF(!string.IsNullOrEmpty(TemplateName),x=>x.Title.Contains(TemplateName)).ToListAsync();
|
|
|
|
|
|
|
|
|
|
return null;
|
|
|
|
|
return list;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|