|
|
|
@ -721,17 +721,18 @@ namespace Myshipping.Application
|
|
|
|
|
[HttpPost("/BookingOrder/AddRemark")]
|
|
|
|
|
public async Task AddRemark(BookingRemarkDto dto)
|
|
|
|
|
{
|
|
|
|
|
if (dto.Id==0)
|
|
|
|
|
if (dto.Id == 0)
|
|
|
|
|
{
|
|
|
|
|
var entity = dto.Adapt<BookingRemark>();
|
|
|
|
|
await _bookingremark.InsertAsync(entity);
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
var entity= _bookingremark.FirstOrDefault(x => x.Id == dto.Id);
|
|
|
|
|
entity.Remark = dto.Remark;
|
|
|
|
|
await _bookingremark.AsUpdateable(entity).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommandAsync();
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
var entity = _bookingremark.FirstOrDefault(x => x.Id == dto.Id);
|
|
|
|
|
entity.Remark = dto.Remark;
|
|
|
|
|
await _bookingremark.AsUpdateable(entity).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommandAsync();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
@ -875,7 +876,7 @@ namespace Myshipping.Application
|
|
|
|
|
/// 调用运踪接口
|
|
|
|
|
/// </summary>
|
|
|
|
|
[HttpGet("/BookingOrder/SendTrace")]
|
|
|
|
|
public async Task SendTrace(string BusinessId, string YARDID, string YARD, string MBLNO,string CARRIER="",string CARRIERID="",bool isbook=false)
|
|
|
|
|
public async Task SendTrace(string BusinessId, string YARDID, string YARD, string MBLNO, string CARRIER = "", string CARRIERID = "", bool isbook = false)
|
|
|
|
|
{
|
|
|
|
|
_logger.LogInformation("调用运踪接口提单号:" + MBLNO + " 调用运踪接口");
|
|
|
|
|
var key = _webAccountConfig.GetAccountConfig("seae_billtraceurl", UserManager.UserId).Result;
|
|
|
|
@ -945,7 +946,7 @@ namespace Myshipping.Application
|
|
|
|
|
Code = t.Code,
|
|
|
|
|
Value = t.Value
|
|
|
|
|
}).ToListAsync();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#region 订舱状态
|
|
|
|
|
if (item.Status == "舱单")
|
|
|
|
|
{
|
|
|
|
@ -1007,7 +1008,7 @@ namespace Myshipping.Application
|
|
|
|
|
bookingStatus.BookingId = item.BookingId;
|
|
|
|
|
bookingStatus.StaCode = "sta_zhuangchuan";
|
|
|
|
|
bookingStatus.StaName = dicdatalist.Where(x => x.Code == "sta_zhuangchuan").Select(x => x.Value).FirstOrDefault();
|
|
|
|
|
bookingStatus.StaTime = item.detail.Max(x=>x.OPTime);
|
|
|
|
|
bookingStatus.StaTime = item.detail.Max(x => x.OPTime);
|
|
|
|
|
bookingStatus.StaCate = "book_sta_cate_billtrace";
|
|
|
|
|
await _repBookingStatus.InsertAsync(bookingStatus);
|
|
|
|
|
}
|
|
|
|
@ -1272,17 +1273,37 @@ namespace Myshipping.Application
|
|
|
|
|
/// 获取放舱pdf
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="bookingId"></param>
|
|
|
|
|
/// <param name="type">类型,1:pdf、2:xlsx、3:docx</param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[HttpGet("/BookingOrder/LetterYardPdf")]
|
|
|
|
|
public async Task<IActionResult> LetterYardPdf(long bookingId)
|
|
|
|
|
public async Task<IActionResult> LetterYardPdf(long bookingId, int type = 1)
|
|
|
|
|
{
|
|
|
|
|
var letterYard = await _repLetterYard.FirstOrDefaultAsync(x => x.BookingId == bookingId);
|
|
|
|
|
if (letterYard == null)
|
|
|
|
|
{
|
|
|
|
|
throw Oops.Bah("放舱信息未找到,请先保存数据");
|
|
|
|
|
}
|
|
|
|
|
var bs = await GetReportFile(bookingId, "fangcang", 1);
|
|
|
|
|
var fileName = HttpUtility.UrlEncode($"{bookingId}_{DateTime.Now.Ticks}.pdf", Encoding.GetEncoding("UTF-8"));
|
|
|
|
|
|
|
|
|
|
var fileType = "";
|
|
|
|
|
if (type == 1)
|
|
|
|
|
{
|
|
|
|
|
fileType = ".pdf";
|
|
|
|
|
}
|
|
|
|
|
else if (type == 2)
|
|
|
|
|
{
|
|
|
|
|
fileType = ".xlsx";
|
|
|
|
|
}
|
|
|
|
|
else if (type == 3)
|
|
|
|
|
{
|
|
|
|
|
fileType = ".docx";
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
throw Oops.Bah("类型参数不正确");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var bs = await GetReportFile(bookingId, "fangcang", type);
|
|
|
|
|
var fileName = HttpUtility.UrlEncode($"{bookingId}_{DateTime.Now.Ticks}{fileType}", Encoding.GetEncoding("UTF-8"));
|
|
|
|
|
var result = new FileContentResult(bs, "application/octet-stream") { FileDownloadName = fileName };
|
|
|
|
|
return result;
|
|
|
|
|
|
|
|
|
@ -1409,16 +1430,18 @@ namespace Myshipping.Application
|
|
|
|
|
{
|
|
|
|
|
throw Oops.Bah("类型参数不正确");
|
|
|
|
|
}
|
|
|
|
|
var mblno= await _rep.AsQueryable().Where(x=>x.Id==bookingId).Select(x=>x.MBLNO).FirstAsync();
|
|
|
|
|
|
|
|
|
|
var typeObj = (await _cache.GetAllDictData()).First(x => x.TypeCode == "booking_template_type" && x.Code == typeCode);
|
|
|
|
|
|
|
|
|
|
var mblno = await _rep.AsQueryable().Where(x => x.Id == bookingId).Select(x => x.MBLNO).FirstAsync();
|
|
|
|
|
string fileName = string.Empty;
|
|
|
|
|
if (string.IsNullOrWhiteSpace(mblno))
|
|
|
|
|
{
|
|
|
|
|
fileName = HttpUtility.UrlEncode($"{bookingId}_{DateTime.Now.Ticks}.{fileType}", Encoding.GetEncoding("UTF-8"));////名称
|
|
|
|
|
|
|
|
|
|
fileName = $"{bookingId}_{typeObj.Value.ValidFileName()}_{DateTime.Now.Ticks}{fileType}";////名称
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
|
|
|
|
|
fileName = HttpUtility.UrlEncode($"{mblno}_{DateTime.Now.Ticks}.{fileType}", Encoding.GetEncoding("UTF-8"));////名称
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
fileName = $"{mblno}_{typeObj.Value.ValidFileName()}_{DateTime.Now.Ticks}{fileType}";////名称
|
|
|
|
|
}
|
|
|
|
|
//var result = new FileContentResult(bs, "application/octet-stream") { FileDownloadName = fileName };
|
|
|
|
|
var opt = App.GetOptions<TempFileOptions>().Path;
|
|
|
|
@ -1701,7 +1724,7 @@ namespace Myshipping.Application
|
|
|
|
|
var yardset = _cache.GetAllMappingYard().Result.FirstOrDefault(y => y.Code == order.YARDID && y.Module == "BookingTxxp");
|
|
|
|
|
if (yardset == null)
|
|
|
|
|
{
|
|
|
|
|
throw Oops.Bah(BookingErrorCode.BOOK120, order.YARDID);
|
|
|
|
|
throw Oops.Bah(BookingErrorCode.BOOK120, $"{order.YARDID}(提箱小票)");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var ctns = await _repCtn.Where(x => x.BILLID == bookingId).ToListAsync();
|
|
|
|
@ -1722,7 +1745,7 @@ namespace Myshipping.Application
|
|
|
|
|
var expCode = ctns.Select(x => x.CTNCODE).Distinct().Except(ctnMapping.Select(y => y.Code)).ToList();
|
|
|
|
|
if (expCode.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
throw Oops.Bah(BookingErrorCode.BOOK123, string.Join(',', expCode));
|
|
|
|
|
throw Oops.Bah(BookingErrorCode.BOOK123, $"{string.Join(',', expCode)}(提箱小票)");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var user = await _repUser.FirstOrDefaultAsync(x => x.Id == UserManager.UserId);
|
|
|
|
@ -1845,7 +1868,7 @@ namespace Myshipping.Application
|
|
|
|
|
var yardset = _cache.GetAllMappingYard().Result.FirstOrDefault(y => y.Code == order.YARDID && y.Module == "BookingVgm");
|
|
|
|
|
if (yardset == null)
|
|
|
|
|
{
|
|
|
|
|
throw Oops.Bah(BookingErrorCode.BOOK120, order.YARDID);
|
|
|
|
|
throw Oops.Bah(BookingErrorCode.BOOK120, $"{order.YARDID}(VGM)");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//校验箱子数据录入
|
|
|
|
@ -1857,15 +1880,15 @@ namespace Myshipping.Application
|
|
|
|
|
//箱型映射
|
|
|
|
|
var ctnMapping = await _cache.GetAllMappingCtn();
|
|
|
|
|
ctnMapping = ctnMapping.Where(x => x.Module == "BookingVgm").ToList();
|
|
|
|
|
if (ctnMapping.Count == 0)
|
|
|
|
|
{
|
|
|
|
|
throw Oops.Bah(BookingErrorCode.BOOK122);
|
|
|
|
|
}
|
|
|
|
|
//if (ctnMapping.Count == 0)
|
|
|
|
|
//{
|
|
|
|
|
// throw Oops.Bah(BookingErrorCode.BOOK122);
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
var expCode = ctns.Select(x => x.CTNCODE).Distinct().Except(ctnMapping.Select(y => y.Code)).ToList();
|
|
|
|
|
if (expCode.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
throw Oops.Bah(BookingErrorCode.BOOK123, string.Join(',', expCode));
|
|
|
|
|
throw Oops.Bah(BookingErrorCode.BOOK123, $"{string.Join(',', expCode)}(VGM)");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//接收反馈地址
|
|
|
|
@ -2497,7 +2520,9 @@ namespace Myshipping.Application
|
|
|
|
|
|
|
|
|
|
await _bookingfile.InsertAsync(bookFile);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#region 下载订舱、截单EDI
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 下载订舱、截单EDI
|
|
|
|
|