场站映射增加船司选项

optimize
wanghaomei 2 years ago
parent dd498a5770
commit bb89acfe7d

@ -3109,10 +3109,10 @@ namespace Myshipping.Application
await _repOrderUrl.InsertAsync(ordUrl); await _repOrderUrl.InsertAsync(ordUrl);
} }
if (!string.IsNullOrEmpty(ordUrl.UrlTxxp)) //if (!string.IsNullOrEmpty(ordUrl.UrlTxxp))
{ //{
return ordUrl.UrlTxxp; // return ordUrl.UrlTxxp;
} //}
//校验船公司 //校验船公司
if (string.IsNullOrEmpty(order.CARRIERID)) 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) 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(); 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(); var expCode = ctns.Select(x => x.CTNCODE).Distinct().Except(ctnMapping.Select(y => y.Code)).ToList();
if (expCode.Count > 0) 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); var user = await _repUser.FirstOrDefaultAsync(x => x.Id == UserManager.UserId);

@ -68,5 +68,10 @@ namespace Myshipping.Core.Entity
/// </summary> /// </summary>
public string Remark { get; set; } public string Remark { get; set; }
/// <summary>
/// 船司代码
/// </summary>
public string CarrierCode { get; set; }
} }
} }

Loading…
Cancel
Save