diff --git a/src/WMS.Web.Domain/Services/ChangeMoveBoxService.cs b/src/WMS.Web.Domain/Services/ChangeMoveBoxService.cs index 46847aa8..0183fc4a 100644 --- a/src/WMS.Web.Domain/Services/ChangeMoveBoxService.cs +++ b/src/WMS.Web.Domain/Services/ChangeMoveBoxService.cs @@ -73,11 +73,14 @@ namespace WMS.Web.Domain.Services if (d.DestBoxId == 0) { var dBox = await _boxRepositories.GetByNo(d.DestBoxBillNo); - var res = await CreateBox(d); - if (!res.IsSuccess) return res; - dBox = await _boxRepositories.GetByNo(d.DestBoxBillNo); - dto.First().DestBoxId = dBox.Id; - isAddBox = true; + if (dBox == null) + { + var res = await CreateBox(d); + if (!res.IsSuccess) return res; + dBox = await _boxRepositories.GetByNo(d.DestBoxBillNo); + dto.First().DestBoxId = dBox.Id; + isAddBox = true; + } } } //1.有原箱时 需要判断 物料对应的序列号是否存在 @@ -232,6 +235,7 @@ namespace WMS.Web.Domain.Services Qty = d.Qty, SerialNumbers = s }; + response.Details.Add(dr); } list.Add(response); return await _boxService.Sync(list);