|
|
|
@ -19,6 +19,7 @@ using Myshipping.Application.Service.BookingLabel.Dto;
|
|
|
|
|
using Myshipping.Application.Service.BookingOrder.Dto;
|
|
|
|
|
using Myshipping.Application.Service.BookingSlot.Dto;
|
|
|
|
|
using Myshipping.Core;
|
|
|
|
|
using Myshipping.Core.Const;
|
|
|
|
|
using Myshipping.Core.Entity;
|
|
|
|
|
using Myshipping.Core.Service;
|
|
|
|
|
using NPOI.XSSF.UserModel;
|
|
|
|
@ -72,6 +73,7 @@ namespace Myshipping.Application
|
|
|
|
|
private readonly IBookingValueAddedService _bookingValueAddedService;
|
|
|
|
|
private readonly IBookingLabelService _bookingLabelService;
|
|
|
|
|
private readonly IDjyTenantParamService _djyTenantParamService;
|
|
|
|
|
private readonly ISysDataUserMenu _sysDataUserMenuService;
|
|
|
|
|
|
|
|
|
|
const string CONST_BC_FILE_CODE = "bc";
|
|
|
|
|
const string CONST_BC_FILE_NAME = "Booking Confirmation";
|
|
|
|
@ -112,7 +114,8 @@ namespace Myshipping.Application
|
|
|
|
|
INamedServiceProvider<ITaskManageService> namedTaskManageServiceProvider,
|
|
|
|
|
SqlSugarRepository<SysUser> sysUserRepository,
|
|
|
|
|
IDjyTenantParamService djyTenantParamService,
|
|
|
|
|
SqlSugarRepository<BookingPrintTemplate> repPrintTemplate)
|
|
|
|
|
SqlSugarRepository<BookingPrintTemplate> repPrintTemplate,
|
|
|
|
|
ISysDataUserMenu sysDataUserMenuService)
|
|
|
|
|
{
|
|
|
|
|
_repBase = repBase;
|
|
|
|
|
_repCtn = repCtn;
|
|
|
|
@ -142,6 +145,7 @@ namespace Myshipping.Application
|
|
|
|
|
_namedTaskManageServiceProvider = namedTaskManageServiceProvider;
|
|
|
|
|
|
|
|
|
|
_djyTenantParamService = djyTenantParamService;
|
|
|
|
|
_sysDataUserMenuService = sysDataUserMenuService;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#region 舱位
|
|
|
|
@ -779,7 +783,7 @@ namespace Myshipping.Application
|
|
|
|
|
|
|
|
|
|
throw Oops.Bah($"slotId={model.Id} 映射推送的舱位请求对应异常,原因:{ex.Message}");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_logger.LogInformation($"slotId={model.Id} 开始处理重要提醒");
|
|
|
|
|
//执行差异重要提醒
|
|
|
|
@ -1768,6 +1772,26 @@ namespace Myshipping.Application
|
|
|
|
|
{
|
|
|
|
|
ISugarQueryable<BookingSlotBase> select = null;
|
|
|
|
|
|
|
|
|
|
// 判断是否启用了委托单位查看控制权限
|
|
|
|
|
var tenantParamList = await _cache.GetAllTenantParam();
|
|
|
|
|
var isEnableCustomerAuthority = tenantParamList.FirstOrDefault(x => x.TenantId == UserManager.TENANT_ID
|
|
|
|
|
&& x.ParaCode == TenantParamCode.IS_ENABLE_CUSTOMER_AUTHORITY)?.ItemCode == "YES";
|
|
|
|
|
List<long> userList = null;
|
|
|
|
|
List<string> userListStr = null;
|
|
|
|
|
if (isEnableCustomerAuthority)
|
|
|
|
|
{
|
|
|
|
|
userList = await _sysDataUserMenuService.GetDataScopeList(MenuConst.MenuDjyCustomer);
|
|
|
|
|
if (userList == null || userList.Count == 0)
|
|
|
|
|
{
|
|
|
|
|
isEnableCustomerAuthority = false;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
userListStr = userList.Select(x => x.ToString()).ToList();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 箱型筛选
|
|
|
|
|
string[] ctnCodeArr = null;
|
|
|
|
|
if (!string.IsNullOrEmpty(input.CTN_STAT))
|
|
|
|
@ -1806,12 +1830,25 @@ namespace Myshipping.Application
|
|
|
|
|
.WhereIF(!string.IsNullOrEmpty(input.LANENAME), u => u.LANENAME.Contains(input.LANENAME))
|
|
|
|
|
.WhereIF(input.WEEK_AT != null, u => u.WEEK_AT == input.WEEK_AT)
|
|
|
|
|
|
|
|
|
|
.WhereIF(isEnableCustomerAuthority, u => SqlFunc.Subqueryable<BookingSlotAllocation>()
|
|
|
|
|
.Where(x => x.BOOKING_SLOT_ID == u.Id)
|
|
|
|
|
.NotAny()
|
|
|
|
|
|| SqlFunc.Subqueryable<BookingSlotAllocation>()
|
|
|
|
|
.Where(x => x.BOOKING_SLOT_ID == u.Id
|
|
|
|
|
&& userList.Contains((long)x.CreatedUserId)
|
|
|
|
|
|| userListStr.Contains(x.OPID)
|
|
|
|
|
|| userListStr.Contains(x.SALEID)
|
|
|
|
|
|| userListStr.Contains(x.DOCID)
|
|
|
|
|
|| userListStr.Contains(x.CUSTSERVICEID))
|
|
|
|
|
.Any())
|
|
|
|
|
|
|
|
|
|
// 标签筛选
|
|
|
|
|
.WhereIF(input.LabelIdArray != null && input.LabelIdArray.Length > 0,
|
|
|
|
|
u => SqlFunc.Subqueryable<BookingLabelAllocation>()
|
|
|
|
|
.Where(x => x.BusinessId == u.Id && input.LabelIdArray.Contains(x.LabelId))
|
|
|
|
|
.Any());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (ctnCodeArr != null && ctnCodeArr.Length > 0)
|
|
|
|
|
{
|
|
|
|
|
var tempSelect = select as ISugarQueryable<BookingSlotBase, BookingSlotCtn>;
|
|
|
|
|