jianghaiqing 1 year ago
commit 45b6ac0a56

@ -120,6 +120,7 @@ namespace Myshipping.Application
private readonly SqlSugarRepository<ParaGoodsInfo> _paraGoodsInfoRepository;
private readonly SqlSugarRepository<ParaContractNoInfo> _paraContractNoInfoRepository;
private readonly SqlSugarRepository<DjyWebsiteAccountConfig> _djyWebsiteAccountConfigRepository;
private readonly SqlSugarRepository<BookingTemplateShare> _repPrintTemplateShare;
private readonly IHttpContextAccessor _httpContextAccessor;
private readonly ISysOrgService _orgService;
private readonly IBookingGoodsStatusConfigService _GoodsConfig;
@ -136,6 +137,7 @@ namespace Myshipping.Application
SqlSugarRepository<BookingLog> bookinglog, SqlSugarRepository<BookingLogDetail> bookinglogdetail, SqlSugarRepository<BookingRemark> bookingremark,
SqlSugarRepository<BookingFile> bookingfile, SqlSugarRepository<DjyUserConfig> repUserConfig, SqlSugarRepository<BookingPrintTemplate> repPrint,
SqlSugarRepository<SysDictData> dicdata, SqlSugarRepository<BookingStatusLog> statuslog, SqlSugarRepository<BookingStatusLogDetail> statuslogdetail,
SqlSugarRepository<BookingTemplateShare> repPrintTemplateShare,
ILogger<BookingOrderService> logger, ISysCacheService cache, IDjyWebsiteAccountConfigService webAccountConfig, ISysDataUserMenu right, SqlSugarRepository<ParaGoodsInfo> paraGoodsInfoRepository,
SqlSugarRepository<BookingPrintTemplate> repPrintTemplate, SqlSugarRepository<BookingLetteryard> repLetterYard, SqlSugarRepository<SysUser> repUser, SqlSugarRepository<BookingTemplate> bookingTemplate,
SqlSugarRepository<BookingOrderUrl> repOrderUrl, SqlSugarRepository<BookingOrderContact> repOrderContact, SqlSugarRepository<BookingSampleBill> repSampleBill, SqlSugarRepository<DjyCustomer> djycustomer,
@ -178,6 +180,7 @@ namespace Myshipping.Application
this._paraGoodsInfoRepository = paraGoodsInfoRepository;
this._paraContractNoInfoRepository = paraContractNoInfoRepository;
this._orgService = orgService;
this._repPrintTemplateShare = repPrintTemplateShare;
_httpContextAccessor = httpContextAccessor;
_GoodsConfig = GoodsConfig;
@ -8149,9 +8152,13 @@ namespace Myshipping.Application
x.lineRel.CarrierCode
}).Take(10).ToList();
});
var STemplate = _bookingTemplate.Where(x => x.Type == "10" && x.CreatedUserId == UserManager.UserId).Take(10).ToList();
var FTemplate = _bookingTemplate.Where(x => x.Type == "20" && x.CreatedUserId == UserManager.UserId).Take(10).ToList();
var TTemplate = _bookingTemplate.Where(x => x.Type == "30" && x.CreatedUserId == UserManager.UserId).Take(10).ToList();
var TemplateIds = _repPrintTemplateShare.AsQueryable().Filter(null, true).Where(x => x.IsDeleted == false && x.ShareToId == UserManager.UserId).Select(x => x.TemplateId).ToList();
var STemplate = _bookingTemplate.AsQueryable().Filter(null, true).Where(x => x.IsDeleted == false && (TemplateIds.Contains(x.Id) || x.CreatedUserId == UserManager.UserId)&&
x.Type == "10" && x.CreatedUserId == UserManager.UserId).Take(10).ToList();
var FTemplate = _bookingTemplate.AsQueryable().Filter(null, true).Where(x => x.IsDeleted == false && (TemplateIds.Contains(x.Id) || x.CreatedUserId == UserManager.UserId) &&
x.Type == "20" && x.CreatedUserId == UserManager.UserId).Take(10).ToList();
var TTemplate = _bookingTemplate.AsQueryable().Filter(null, true).Where(x => x.IsDeleted == false && (TemplateIds.Contains(x.Id) || x.CreatedUserId == UserManager.UserId) &&
x.Type == "30" && x.CreatedUserId == UserManager.UserId).Take(10).ToList();
var WTDW = _djycustomer.Where(x => x.PropString.Contains("consignor") && x.TenantId == UserManager.TENANT_ID).Take(10).ToList();
var DCDL = _djycustomer.Where(x => x.PropString.Contains("booking_agent") && x.TenantId == UserManager.TENANT_ID).Take(10).ToList();
var Forwarder = _cache.GetAllCodeForwarder().Result.Take(10).ToList();

@ -185,12 +185,13 @@ namespace Myshipping.Application
/// </summary>
/// <returns></returns>
[HttpGet("/BookingTemplate/GetTemplateShare")]
public async Task<dynamic> GetTemplateShare(string TemplateName)
public async Task<dynamic> GetTemplateShare(string TemplateName,string Type)
{
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();
WhereIF(!string.IsNullOrEmpty(TemplateName),x=>x.Title.Contains(TemplateName)).
WhereIF(!string.IsNullOrEmpty(Type), x => x.Type.Contains(Type)).ToListAsync();
return list;
}

Loading…
Cancel
Save