修复bug
This commit is contained in:
@@ -373,6 +373,8 @@ namespace WMS.Web.Api.Controllers
|
|||||||
return Result<BoxResponse>.ReFailure("箱号" + boxBillNo + "不存在", 800000);
|
return Result<BoxResponse>.ReFailure("箱号" + boxBillNo + "不存在", 800000);
|
||||||
var response = res[0];
|
var response = res[0];
|
||||||
var detail = await _outStockRepositories.GetDetailsByBoxId(response.Id);
|
var detail = await _outStockRepositories.GetDetailsByBoxId(response.Id);
|
||||||
|
if (detail.Count() == 0)
|
||||||
|
return Result<BoxResponse>.ReFailure("箱号" + boxBillNo + "未出库", 800000);
|
||||||
response.Details = detail;
|
response.Details = detail;
|
||||||
response.TotalQty = detail.Sum(s => s.Qty);
|
response.TotalQty = detail.Sum(s => s.Qty);
|
||||||
return Result<BoxResponse>.ReSuccess(response);
|
return Result<BoxResponse>.ReSuccess(response);
|
||||||
|
|||||||
@@ -325,15 +325,16 @@ namespace WMS.Web.Repositories
|
|||||||
.Include(s => s.Details).ThenInclude(s => s.BoxsDetails.Where(w => w.BoxId == boxId))
|
.Include(s => s.Details).ThenInclude(s => s.BoxsDetails.Where(w => w.BoxId == boxId))
|
||||||
.Where(f => f.Details.SelectMany(s => s.BoxsDetails).Where(w => w.BoxId == boxId).Any())
|
.Where(f => f.Details.SelectMany(s => s.BoxsDetails).Where(w => w.BoxId == boxId).Any())
|
||||||
.OrderByDescending(o => o.Id)
|
.OrderByDescending(o => o.Id)
|
||||||
.FirstAsync();
|
.ToListAsync();
|
||||||
List<BoxDetailResponse> details = new List<BoxDetailResponse>();
|
List<BoxDetailResponse> details = new List<BoxDetailResponse>();
|
||||||
|
if (res.Count() == 0) return details;
|
||||||
|
|
||||||
var materials_result = await _erpService.BillQueryForMaterial();
|
var materials_result = await _erpService.BillQueryForMaterial();
|
||||||
if (!materials_result.IsSuccess)
|
if (!materials_result.IsSuccess)
|
||||||
return new List<BoxDetailResponse>();
|
return new List<BoxDetailResponse>();
|
||||||
var materials = materials_result.Data.ToList();
|
var materials = materials_result.Data.ToList();
|
||||||
|
|
||||||
foreach (var d in res.Details)
|
foreach (var d in res.First().Details)
|
||||||
{
|
{
|
||||||
var boxDetail = d.BoxsDetails.FirstOrDefault(f => f.BoxId == boxId);
|
var boxDetail = d.BoxsDetails.FirstOrDefault(f => f.BoxId == boxId);
|
||||||
if (boxDetail == null) continue;
|
if (boxDetail == null) continue;
|
||||||
|
|||||||
Reference in New Issue
Block a user