修改EDI 增加订舱包装和集装箱包装必须一致校验

optimize
jianghaiqing 2 years ago
parent bb932a8df4
commit 3c1fa1e213

@ -3501,7 +3501,10 @@ namespace Myshipping.Application
_logger.LogInformation("批次={no}提取订单EDI信息完成", batchNo);
CheckBookingOrClosingEDI(order);
//箱信息
var contaList = _repCtn.AsQueryable().Where(t => t.BILLID == order.Id).ToList();
CheckBookingOrClosingEDI(order, contaList);
EDIRouteEnum ediRouteEnum = GetEDIRoute(order.CARRIERID);
@ -3965,10 +3968,6 @@ namespace Myshipping.Application
primaryModel.KINGTAREWEIGHT = ediExtModel.KingTareweight.HasValue ? ediExtModel.KingTareweight.Value : 0;
//箱信息
var contaList = _repCtn.AsQueryable().Where(t => t.BILLID == order.Id).ToList();
_logger.LogInformation("批次={no} 提取箱完成 数量={total}", batchNo, contaList.Count);
primaryModel.CTNLIST = new List<MsOpSeaeCtnEDIBaseModel>();
@ -4676,7 +4675,7 @@ namespace Myshipping.Application
/// </summary>
/// <param name="order"></param>
[NonAction]
private void CheckBookingOrClosingEDI(BookingOrder order)
private void CheckBookingOrClosingEDI(BookingOrder order,List<BookingCtn> ctnList)
{
if (string.IsNullOrWhiteSpace(order.CARRIERID))
throw Oops.Bah("船公司必须填写");
@ -4686,6 +4685,13 @@ namespace Myshipping.Application
if (string.IsNullOrWhiteSpace(order.KINDPKGS))
throw Oops.Bah("包装种类未填写");
//增加箱包装和主信息的包装是否一致校验
if(ctnList.Any(a=>a.KINDPKGS != order.KINDPKGS))
{
throw Oops.Bah("集装箱包装和订舱包装不一致,请修改");
}
}
#endregion

Loading…
Cancel
Save