|
|
|
@ -3109,10 +3109,10 @@ namespace Myshipping.Application
|
|
|
|
|
await _repOrderUrl.InsertAsync(ordUrl);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!string.IsNullOrEmpty(ordUrl.UrlTxxp))
|
|
|
|
|
{
|
|
|
|
|
return ordUrl.UrlTxxp;
|
|
|
|
|
}
|
|
|
|
|
//if (!string.IsNullOrEmpty(ordUrl.UrlTxxp))
|
|
|
|
|
//{
|
|
|
|
|
// return ordUrl.UrlTxxp;
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
//校验船公司
|
|
|
|
|
if (string.IsNullOrEmpty(order.CARRIERID))
|
|
|
|
@ -3135,10 +3135,16 @@ namespace Myshipping.Application
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//场站转换
|
|
|
|
|
var yardset = _cache.GetAllMappingYard().Result.FirstOrDefault(y => y.Code == order.YARDID && y.Module == "BookingTxxp");
|
|
|
|
|
var yardsetList = _cache.GetAllMappingYard().Result.Where(y => y.Code == order.YARDID && y.Module == "BookingTxxp" && (y.CarrierCode == null || y.CarrierCode == "" || y.CarrierCode == order.CARRIERID)).ToList();
|
|
|
|
|
if (yardsetList.Count == 0)
|
|
|
|
|
{
|
|
|
|
|
throw Oops.Bah(BookingErrorCode.BOOK120, $"{order.YARD} {order.CARRIER}(提箱小票)");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var yardset = yardsetList.FirstOrDefault(x => x.CarrierCode == order.CARRIERID);
|
|
|
|
|
if (yardset == null)
|
|
|
|
|
{
|
|
|
|
|
throw Oops.Bah(BookingErrorCode.BOOK120, $"{order.YARDID}(提箱小票)");
|
|
|
|
|
yardset = yardsetList.FirstOrDefault(x => x.CarrierCode == null || x.CarrierCode == "");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var ctns = await _repCtn.Where(x => x.BILLID == bookingId).ToListAsync();
|
|
|
|
@ -3159,7 +3165,8 @@ 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)}(提箱小票)");
|
|
|
|
|
var expName = ctns.Where(x => expCode.Contains(x.CTNCODE)).Select(x => x.CTNALL).Distinct().ToList();
|
|
|
|
|
throw Oops.Bah(BookingErrorCode.BOOK123, $"{string.Join(',', expName)}(提箱小票)");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var user = await _repUser.FirstOrDefaultAsync(x => x.Id == UserManager.UserId);
|
|
|
|
|