wet 2 years ago
commit 12394e5bdc

@ -44,11 +44,11 @@ namespace Myshipping.Application
const string CONST_MAPPING_BC_MODULE_ROUTE = "BC_DOWN_RT"; const string CONST_MAPPING_BC_MODULE_ROUTE = "BC_DOWN_RT";
const string CONST_MAPPING_DRAFT_MODULE_ROUTE = "DRAFT_DOWN_RT"; const string CONST_MAPPING_DRAFT_MODULE_ROUTE = "DRAFT_DOWN_RT";
const string CONST_MAPPING_MANIALLO_CHK_MODULE_ROUTE = "MANI_ALLO_CHK_RT"; const string CONST_MAPPING_MANIALLO_CHK_MODULE_ROUTE = "MANI_ALLOC_CHK_RT";
const string CONST_FORMAT_BC_URL = "{0}_bc_down_url"; const string CONST_FORMAT_BC_URL = "{0}_bc_down_url";
const string CONST_FORMAT_DRAFT_URL = "{0}_draft_down_url"; const string CONST_FORMAT_DRAFT_URL = "{0}_draft_down_url";
const string CONST_FORMAT_MANIALLO_CHK_URL = "{0}_maniallo_chk_url"; const string CONST_FORMAT_MANIALLO_CHK_URL = "{0}_manialloc_chk_url";
const string CONST_FORMAT_WEB = "{0}_Web"; const string CONST_FORMAT_WEB = "{0}_Web";
@ -1032,6 +1032,15 @@ namespace Myshipping.Application
throw Oops.Bah($"主提单号不能为空"); throw Oops.Bah($"主提单号不能为空");
} }
else
{
if (Regex.IsMatch(bookingOrder.MBLNO, "\\bESL\\w+"))
{
_logger.LogInformation("批次={no} id={id} 主提单号没填写参考号,无法继续", batchNo, bookingOrder.Id);
throw Oops.Oh($"主提单号不是有效的参考号");
}
}
var bcOrDraftRouteCfg = _cache.GetAllMappingCarrier().GetAwaiter().GetResult() var bcOrDraftRouteCfg = _cache.GetAllMappingCarrier().GetAwaiter().GetResult()
.FirstOrDefault(t => t.Module.Equals(CONST_MAPPING_MANIALLO_CHK_MODULE_ROUTE, StringComparison.OrdinalIgnoreCase) .FirstOrDefault(t => t.Module.Equals(CONST_MAPPING_MANIALLO_CHK_MODULE_ROUTE, StringComparison.OrdinalIgnoreCase)
@ -1097,6 +1106,12 @@ namespace Myshipping.Application
if (rlt.status == 1) if (rlt.status == 1)
{ {
if(rlt.data == null || string.IsNullOrWhiteSpace(rlt.data.esl_no))
{
_logger.LogInformation("批次={no} 舱位分配查询失败ESL号不存在", batchNo);
throw Oops.Oh($"查询ESL号失败");
}
_logger.LogInformation("批次={no} 舱位分配查询成功", batchNo); _logger.LogInformation("批次={no} 舱位分配查询成功", batchNo);
/* /*

@ -1808,27 +1808,24 @@ namespace Myshipping.Application
{ {
bookingTruckSyncDto.OperType = "Delete"; bookingTruckSyncDto.OperType = "Delete";
//这里增加判断如果派车回写里包含车队信息,自动回写到订舱信息里 var bookingOrder = _bookingOrderRepository.AsQueryable()
if (!string.IsNullOrWhiteSpace(info.TruckCode)) .First(a => a.Id == bookingTruckInfo.BookingId);
{
var bookingOrder = _bookingOrderRepository.AsQueryable()
.First(a => a.Id == bookingTruckInfo.BookingId);
if (bookingOrder != null && string.IsNullOrWhiteSpace(bookingOrder.TRUCKERID)) if (bookingOrder != null)
{ {
_logger.LogInformation("判断回写需要更新去掉订舱的车队 id={id} truck={truck}", bookingTruckInfo.BookingId, info.TruckName); _logger.LogInformation("判断回写需要更新去掉订舱的车队 id={id} truckid={truckid} truck={truck}",
bookingTruckInfo.BookingId, bookingOrder.TRUCKERID, bookingOrder.TRUCKER);
bookingOrder.TRUCKERID = null; bookingOrder.TRUCKERID = null;
bookingOrder.TRUCKER = null; bookingOrder.TRUCKER = null;
await _bookingOrderRepository.AsUpdateable(bookingOrder).UpdateColumns(it => new await _bookingOrderRepository.AsUpdateable(bookingOrder).UpdateColumns(it => new
{ {
it.TRUCKERID, it.TRUCKERID,
it.TRUCKER it.TRUCKER
}).ExecuteCommandAsync(); }).ExecuteCommandAsync();
_logger.LogInformation("判断回写需要更新去掉订舱的车队,更新完成"); _logger.LogInformation("判断回写需要更新去掉订舱的车队,更新完成");
}
} }
} }
else else

Loading…
Cancel
Save