|
|
|
@ -14,6 +14,7 @@ using Microsoft.Extensions.Logging;
|
|
|
|
|
using Microsoft.Extensions.Options;
|
|
|
|
|
using Myshipping.Application.ConfigOption;
|
|
|
|
|
using Myshipping.Application.Entity;
|
|
|
|
|
using Myshipping.Application.Service.BookingOrder.Dto;
|
|
|
|
|
using Myshipping.Core;
|
|
|
|
|
using Myshipping.Core.Entity;
|
|
|
|
|
using Myshipping.Core.Service;
|
|
|
|
@ -53,11 +54,18 @@ namespace Myshipping.Application
|
|
|
|
|
private readonly IBookingOrderService _bookingOrderService;
|
|
|
|
|
private readonly ILogger<BookingTruckService> _logger;
|
|
|
|
|
private readonly SqlSugarRepository<BookingOrder> _bookingOrderRepository;
|
|
|
|
|
private readonly SqlSugarRepository<BookingFile> _bookingfile;
|
|
|
|
|
private readonly SqlSugarRepository<BookingFile> _bookingFileRepository;
|
|
|
|
|
private readonly SqlSugarRepository<DjyWebsiteAccountConfig> _djyWebsiteAccountConfigRepository;
|
|
|
|
|
private readonly SqlSugarRepository<SysUser> _sysUserRepository;
|
|
|
|
|
private readonly SqlSugarRepository<BookingLetteryard> _bookingLetteryardRepository;
|
|
|
|
|
private readonly SqlSugarRepository<TaskBCInfo> _taskBCInfoRepository;
|
|
|
|
|
private readonly SqlSugarRepository<BookingStatusLog> _statuslogRepository;
|
|
|
|
|
private readonly SqlSugarRepository<BookingStatusLogDetail> _statuslogdetailRepository;
|
|
|
|
|
private readonly SqlSugarRepository<BookingLog> _bookinglogRepository;
|
|
|
|
|
private readonly SqlSugarRepository<BookingLogDetail> _bookinglogdetailRepository;
|
|
|
|
|
private readonly SqlSugarRepository<BookingRemark> _bookingRemarkRepository;
|
|
|
|
|
|
|
|
|
|
private readonly IServiceWorkFlowBaseService _serviceWorkFlowBaseService;
|
|
|
|
|
|
|
|
|
|
const string CONST_MAPPING_BC_MODULE_ROUTE = "BC_DOWN_RT";
|
|
|
|
|
const string CONST_MAPPING_DRAFT_MODULE_ROUTE = "DRAFT_DOWN_RT";
|
|
|
|
@ -73,22 +81,32 @@ namespace Myshipping.Application
|
|
|
|
|
const string CONST_BC_FILE_READ_URL = "bc_file_pdf_read_url";
|
|
|
|
|
|
|
|
|
|
public BookingValueAddedService(ISysCacheService cache, ILogger<BookingTruckService> logger,
|
|
|
|
|
SqlSugarRepository<BookingOrder> bookingOrderRepository, SqlSugarRepository<BookingFile> bookingfile,
|
|
|
|
|
SqlSugarRepository<BookingOrder> bookingOrderRepository,
|
|
|
|
|
SqlSugarRepository<DjyWebsiteAccountConfig> djyWebsiteAccountConfigRepository, SqlSugarRepository<SysUser> sysUserRepository,
|
|
|
|
|
SqlSugarRepository<BookingLetteryard> bookingLetteryardRepository, IBookingOrderService bookingOrderService
|
|
|
|
|
, SqlSugarRepository<TaskBCInfo> taskBCInfoRepository)
|
|
|
|
|
, SqlSugarRepository<TaskBCInfo> taskBCInfoRepository, IServiceWorkFlowBaseService serviceWorkFlowBaseService,
|
|
|
|
|
SqlSugarRepository<BookingStatusLog> statuslogRepository, SqlSugarRepository<BookingStatusLogDetail> statuslogdetailRepository,
|
|
|
|
|
SqlSugarRepository<BookingLog> bookinglogRepository, SqlSugarRepository<BookingLogDetail> bookinglogdetailRepository,
|
|
|
|
|
SqlSugarRepository<BookingRemark> bookingRemarkRepository, SqlSugarRepository<BookingFile> bookingFileRepository)
|
|
|
|
|
{
|
|
|
|
|
_cache = cache;
|
|
|
|
|
_logger = logger;
|
|
|
|
|
|
|
|
|
|
_bookingOrderRepository = bookingOrderRepository;
|
|
|
|
|
_bookingfile = bookingfile;
|
|
|
|
|
|
|
|
|
|
_djyWebsiteAccountConfigRepository = djyWebsiteAccountConfigRepository;
|
|
|
|
|
_sysUserRepository = sysUserRepository;
|
|
|
|
|
_bookingLetteryardRepository = bookingLetteryardRepository;
|
|
|
|
|
_bookingOrderService = bookingOrderService;
|
|
|
|
|
_taskBCInfoRepository = taskBCInfoRepository;
|
|
|
|
|
|
|
|
|
|
_serviceWorkFlowBaseService = serviceWorkFlowBaseService;
|
|
|
|
|
_statuslogRepository = statuslogRepository;
|
|
|
|
|
_statuslogdetailRepository = statuslogdetailRepository;
|
|
|
|
|
_bookinglogRepository = bookinglogRepository;
|
|
|
|
|
_bookinglogdetailRepository = bookinglogdetailRepository;
|
|
|
|
|
_bookingRemarkRepository = bookingRemarkRepository;
|
|
|
|
|
_bookingFileRepository = bookingFileRepository;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -384,7 +402,7 @@ namespace Myshipping.Application
|
|
|
|
|
BookingId = boookId,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
await _bookingfile.InsertAsync(bookFile);
|
|
|
|
|
await _bookingFileRepository.InsertAsync(bookFile);
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
@ -1916,6 +1934,109 @@ namespace Myshipping.Application
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取订舱数据接口 备注 、 文件 、服务项目
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="bookingId">订舱ID</param>
|
|
|
|
|
/// <returns>返回服务状态列表</returns>
|
|
|
|
|
public async Task<BookingAttachedDataDto> GetAllDataVNTWO(long bookingId)
|
|
|
|
|
{
|
|
|
|
|
BookingAttachedDataDto resultDto = new BookingAttachedDataDto();
|
|
|
|
|
|
|
|
|
|
if (bookingId == 0)
|
|
|
|
|
{
|
|
|
|
|
throw Oops.Oh($"订舱ID不能为空");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var orderInfo = _bookingOrderRepository.AsQueryable().Filter(null, true).First(a => a.Id == bookingId);
|
|
|
|
|
|
|
|
|
|
//订舱备注列表
|
|
|
|
|
var remarklist = await _bookingRemarkRepository.AsQueryable().Where(u => u.PId == bookingId)
|
|
|
|
|
.ToListAsync();
|
|
|
|
|
|
|
|
|
|
resultDto.remark = remarklist;
|
|
|
|
|
|
|
|
|
|
//订舱附件列表
|
|
|
|
|
var filelist = await _bookingFileRepository.AsQueryable().Filter(null, true)
|
|
|
|
|
.Where(u => u.BookingId == bookingId).ToListAsync();
|
|
|
|
|
|
|
|
|
|
resultDto.file = filelist;
|
|
|
|
|
|
|
|
|
|
var projectList = await _serviceWorkFlowBaseService.GetEnableProjectList(orderInfo.TenantId.Value.ToString());
|
|
|
|
|
|
|
|
|
|
if (projectList != null && projectList.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
//resultDto = BookingServiceItem
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return resultDto;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#region 获取订舱数据接口 日志、状态日志
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取订舱数据接口 日志、状态日志
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="bookingId">订舱ID</param>
|
|
|
|
|
/// <returns>返回日志详情</returns>
|
|
|
|
|
public async Task<BookingLogDataDto> GetAllLogDataVNTWO(long bookingId)
|
|
|
|
|
{
|
|
|
|
|
BookingLogDataDto resultDto = new BookingLogDataDto();
|
|
|
|
|
|
|
|
|
|
var statusLogList = _statuslogRepository.AsQueryable().Filter(null, true)
|
|
|
|
|
.LeftJoin<BookingStatusLogDetail>((a, b) => a.Id == b.PId)
|
|
|
|
|
.Where((a, b) => a.BookingId == bookingId)
|
|
|
|
|
.Select((a, b) => new { Base = a, Detail = b })
|
|
|
|
|
.ToList();
|
|
|
|
|
|
|
|
|
|
if (statusLogList.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
resultDto.statuslog = statusLogList.OrderByDescending(a => a.Base.OpTime)
|
|
|
|
|
.GroupBy(a => a.Base.Id)
|
|
|
|
|
.Select(a =>
|
|
|
|
|
{
|
|
|
|
|
var currList = a.ToList();
|
|
|
|
|
|
|
|
|
|
var baseDto = currList.FirstOrDefault().Base.Adapt<BookingStatusLogDto>();
|
|
|
|
|
|
|
|
|
|
if (currList.Any(b => b.Detail != null))
|
|
|
|
|
{
|
|
|
|
|
baseDto.detail = currList.Where(b => b.Detail != null)
|
|
|
|
|
.Select(b => b.Detail.Adapt<BookingStatusLogDetailDto>()).ToList();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return baseDto;
|
|
|
|
|
}).ToList();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var logList = _bookinglogRepository.AsQueryable()
|
|
|
|
|
.LeftJoin<BookingLogDetail>((a, b) => a.Id == b.PId)
|
|
|
|
|
.Where((a, b) => a.BookingId == bookingId)
|
|
|
|
|
.Select((a, b) => new { Base = a, Detail = b })
|
|
|
|
|
.ToList();
|
|
|
|
|
|
|
|
|
|
if (logList.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
resultDto.log = logList.GroupBy(a => a.Base.Id)
|
|
|
|
|
.Select(a =>
|
|
|
|
|
{
|
|
|
|
|
var currList = a.ToList();
|
|
|
|
|
|
|
|
|
|
var baseDto = currList.FirstOrDefault().Base.Adapt<BookingLogDto>();
|
|
|
|
|
|
|
|
|
|
if (currList.Any(b => b.Detail != null))
|
|
|
|
|
{
|
|
|
|
|
baseDto.details = currList.Where(b => b.Detail != null)
|
|
|
|
|
.Select(b => b.Detail).ToList();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return baseDto;
|
|
|
|
|
}).ToList();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return resultDto;
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public class DateTimeJsonConverter : System.Text.Json.Serialization.JsonConverter<Nullable<DateTime>>
|
|
|
|
|