修改订舱查询服务项目(不修改原来的方法,新增方法)

optimize
jianghaiqing 1 year ago
parent 225b3fbcb6
commit 3861acedb8

@ -129,6 +129,7 @@ namespace Myshipping.Application
private readonly IBookingGoodsStatusConfigService _GoodsConfig;
private readonly SqlSugarRepository<BookingLineOpMgrConfig> _repLineOpMgrConfig;
private readonly SqlSugarRepository<SysEmp> _repSysEmp;
const string CONST_MAPPING_MODULE = "BOOK_OR_CLOSING";
const string CONST_MAPPING_MODULE_ROUTE = "BOOK_OR_CLOSING_RT";
@ -8598,5 +8599,7 @@ namespace Myshipping.Application
await SendBookingOrder(orderlist.ToArray());
}
}
}

@ -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>>

@ -0,0 +1,27 @@
using Myshipping.Application.Entity;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Myshipping.Application
{
/// <summary>
///
/// </summary>
public class BookingAttachedDataDto
{
/// <summary>
/// 订舱备注
/// </summary>
public List<BookingRemark> remark { get; set; }
/// <summary>
/// 订舱附件
/// </summary>
public List<BookingFile> file { get; set; }
}
}

@ -0,0 +1,25 @@
using Myshipping.Application.Service.BookingOrder.Dto;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Myshipping.Application
{
/// <summary>
/// 订舱日志
/// </summary>
public class BookingLogDataDto
{
/// <summary>
/// 货运动态日志
/// </summary>
public List<BookingStatusLogDto> statuslog { get; set; }
/// <summary>
/// 订舱操作日志
/// </summary>
public List<BookingLogDto> log { get; set; }
}
}

@ -77,5 +77,7 @@ namespace Myshipping.Application
Task AutoYardData(long bookId);
}
}

@ -73,5 +73,19 @@ namespace Myshipping.Application
/// <param name="model">规则意见详情</param>
/// <returns>返回回执</returns>
Task<TaskManageOrderResultDto> GetRuleOpinionLog(RulesEngineUserFeedBackDto model);
/// <summary>
/// 获取订舱数据接口 备注 、 文件 、服务项目
/// </summary>
/// <param name="bookingId">订舱ID</param>
/// <returns>返回服务状态列表</returns>
Task<BookingAttachedDataDto> GetAllDataVNTWO(long bookingId);
/// <summary>
/// 获取订舱数据接口 日志、状态日志
/// </summary>
/// <param name="bookingId">订舱ID</param>
/// <returns>返回日志详情</returns>
Task<BookingLogDataDto> GetAllLogDataVNTWO(long bookingId);
}
}

Loading…
Cancel
Save