|
|
|
@ -33,6 +33,7 @@ namespace Myshipping.Application.Service.BookingOrder
|
|
|
|
|
private readonly ISysCacheService _cache;
|
|
|
|
|
private readonly IDjyWebsiteAccountConfigService _webAccountConfig;
|
|
|
|
|
private readonly ILogger<BookingMSKAPIService> _logger;
|
|
|
|
|
private readonly ISysDataUserMenu _sysDataUserMenuService;
|
|
|
|
|
|
|
|
|
|
const string CONST_MSK_API_COMMODITY_URL = "MSKApiCommodity";
|
|
|
|
|
const string CONST_MSK_API_BOOKING_URL = "MSKApiBooking";
|
|
|
|
@ -41,6 +42,7 @@ namespace Myshipping.Application.Service.BookingOrder
|
|
|
|
|
|
|
|
|
|
public BookingMSKAPIService(ILogger<BookingMSKAPIService> logger, ISysCacheService cache,
|
|
|
|
|
IDjyWebsiteAccountConfigService webAccountConfig, SqlSugarRepository<BookingDeliveryRecord> bookingDeliveryRecordRep,
|
|
|
|
|
ISysDataUserMenu sysDataUserMenuService,
|
|
|
|
|
SqlSugarRepository<BookingDeliveryRecordCtn> bookingDeliveryRecordCtnRep)
|
|
|
|
|
{
|
|
|
|
|
_logger = logger;
|
|
|
|
@ -48,7 +50,7 @@ namespace Myshipping.Application.Service.BookingOrder
|
|
|
|
|
_webAccountConfig = webAccountConfig;
|
|
|
|
|
_bookingDeliveryRecordRep = bookingDeliveryRecordRep;
|
|
|
|
|
_bookingDeliveryRecordCtnRep = bookingDeliveryRecordCtnRep;
|
|
|
|
|
|
|
|
|
|
_sysDataUserMenuService = sysDataUserMenuService;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#region 检索海运船期详情
|
|
|
|
@ -984,20 +986,27 @@ namespace Myshipping.Application.Service.BookingOrder
|
|
|
|
|
//这里因为返回给前端的台账数据是DTO,所以这里排序时候需要转换成Entity对应的字段
|
|
|
|
|
if (!string.IsNullOrWhiteSpace(QuerySearch.SortField))
|
|
|
|
|
entityOrderCol = MapsterExtHelper.GetAdaptProperty<BookingDeliveryRecordDto, BookingDeliveryRecord>(QuerySearch.SortField);
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
|
|
//菜单375504048771141=我的任务台账
|
|
|
|
|
List<long> userlist = await _sysDataUserMenuService.GetDataScopeList(MenuConst.MenuTaskManage);
|
|
|
|
|
List<long> userlist = await _sysDataUserMenuService.GetDataScopeList(MenuConst.MenuMSKApi);
|
|
|
|
|
|
|
|
|
|
if (userlist == null)
|
|
|
|
|
userlist = new List<long> { UserManager.UserId };
|
|
|
|
|
bool isAdmin = false;
|
|
|
|
|
|
|
|
|
|
if (userlist.Count > 0)
|
|
|
|
|
if(userlist == null)
|
|
|
|
|
{
|
|
|
|
|
isAdmin = true;
|
|
|
|
|
userlist = new List<long>();
|
|
|
|
|
}
|
|
|
|
|
else if (userlist != null && userlist.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
userlist.Add(UserManager.UserId);
|
|
|
|
|
userlist = userlist.Distinct().ToList();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
_logger.LogInformation("任务台账权限范围 {list}", userlist);
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var entities = await _bookingDeliveryRecordRep.AsQueryable()
|
|
|
|
|
.Where(t => isAdmin || userlist.Contains(t.CreatedUserId.Value))
|
|
|
|
|
.WhereIF(createBegin != DateTime.MinValue, t => t.CreatedTime.HasValue && t.CreatedTime.Value >= createBegin)
|
|
|
|
|
.WhereIF(createEnd != DateTime.MinValue, t => t.CreatedTime.HasValue && t.CreatedTime.Value < createEnd)
|
|
|
|
|
.WhereIF(updateBegin != DateTime.MinValue, t => t.UpdatedTime.HasValue && t.UpdatedTime.Value >= updateBegin)
|
|
|
|
@ -1293,6 +1302,7 @@ namespace Myshipping.Application.Service.BookingOrder
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="ids">马士基API订舱ID组</param>
|
|
|
|
|
/// <returns>返回执行结果消息</returns>
|
|
|
|
|
[HttpPost("/BookingMSKAPI/BatchSend")]
|
|
|
|
|
public async Task<string> BatchSend(long[] ids)
|
|
|
|
|
{
|
|
|
|
|
var list = await _bookingDeliveryRecordRep.AsQueryable()
|
|
|
|
@ -1313,6 +1323,7 @@ namespace Myshipping.Application.Service.BookingOrder
|
|
|
|
|
/// <param name="id">马士基API订舱ID</param>
|
|
|
|
|
/// <param name="copyNum">需要复制生成记录</param>
|
|
|
|
|
/// <returns>返回执行结果消息</returns>
|
|
|
|
|
[HttpGet("/BookingMSKAPI/BatchSend")]
|
|
|
|
|
public async Task<string> BatchCopy(long id, int copyNum)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|