diff --git a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs index 2a422ee3..a9e37195 100644 --- a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs +++ b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs @@ -475,7 +475,8 @@ namespace Myshipping.Application var entity = input.Adapt(); if (input.Id == 0) { - if (string.IsNullOrEmpty( entity.VOYNO)) { + if (string.IsNullOrEmpty(entity.VOYNO)) + { entity.VOYNO = entity.VOYNOINNER; } @@ -3468,6 +3469,11 @@ namespace Myshipping.Application //船公司网站账号 var carrWebAccMap = _cache.GetAllDictData().Result.FirstOrDefault(x => x.TypeCode == "carrier_web_account_mapping" && x.Code == order.CARRIERID); + if (carrWebAccMap == null) + { + throw Oops.Bah("不支持的船公司或账号映射未配置"); + } + var webacc = _webAccountConfig.GetAccountConfig(carrWebAccMap.Value, UserManager.UserId).Result; if (webacc == null) { @@ -3559,7 +3565,7 @@ namespace Myshipping.Application BoxInfo = ctns.Select(c => new { index = idx++, - boxType = c.CTNALL, + boxType = c.CTNALL.Replace("'", ""), boxcount = c.CTNNUM.HasValue ? c.CTNNUM.Value : 0, code = c.CNTRNO, sealCode = c.SEALNO, @@ -5601,7 +5607,7 @@ namespace Myshipping.Application var ctnDetailInputs = await _ctndetailrep.AsQueryable().Filter(null, true).Where(x => x.CTNID == it.Id).ToListAsync(); it.ctnDetailInputs = ctnDetailInputs.Adapt>(); } - + var BookingEDIExt = await _bookingEDIExt.AsQueryable().Filter(null, true).Where(x => x.BookingId == item.Id).FirstAsync(); if (BookingEDIExt != null) { diff --git a/Myshipping.Core/Service/Dict/SysDictDataService.cs b/Myshipping.Core/Service/Dict/SysDictDataService.cs index 36902da4..108a652e 100644 --- a/Myshipping.Core/Service/Dict/SysDictDataService.cs +++ b/Myshipping.Core/Service/Dict/SysDictDataService.cs @@ -72,7 +72,7 @@ public class SysDictDataService : ISysDictDataService, IDynamicApiController, IT [HttpPost("/sysDictData/add")] public async Task AddDictData(AddDictDataInput input) { - var isExist = await _sysDictDataRep.AnyAsync(u => (u.Code == input.Code || u.Value == input.Value) && u.TypeId == input.TypeId); + var isExist = await _sysDictDataRep.AnyAsync(u => u.Code == input.Code && u.TypeId == input.TypeId); if (isExist) throw Oops.Oh(ErrorCode.D3003); var dictData = input.Adapt(); @@ -199,7 +199,7 @@ public class SysDictDataService : ISysDictDataService, IDynamicApiController, IT /// /// [NonAction] - public async Task CacheData(bool falg=false) + public async Task CacheData(bool falg = false) { if (falg) { @@ -218,7 +218,9 @@ public class SysDictDataService : ISysDictDataService, IDynamicApiController, IT }).ToListAsync(); await _cache.SetAllDictData(list); } - } else { + } + else + { var list = await _sysDictDataRep.AsQueryable().InnerJoin((d, t) => d.TypeId == t.Id).Filter(null, true).Where((d, t) => t.Status == CommonStatus.ENABLE && d.Status == CommonStatus.ENABLE).Select((d, t) => new DictDataDto { Id = d.Id, @@ -232,10 +234,10 @@ public class SysDictDataService : ISysDictDataService, IDynamicApiController, IT }).ToListAsync(); await _cache.SetAllDictData(list); } - - - + + + } - + }