修复bug

This commit is contained in:
18942506660
2023-12-09 10:45:12 +08:00
parent d72c90f1ef
commit ad598e25f5

View File

@@ -129,13 +129,9 @@ namespace WMS.Web.Repositories
};
if (!string.IsNullOrEmpty(s.SalBillNo))
{
Random rd = new Random();
var list = JsonConvert.DeserializeObject<List<string>>(s.SalBillNo);
if (list.Count() > 0)
{
int index = rd.Next(0, list.Count);
respone.SalBillNo = list[index];
}
respone.SalBillNo = list[0];
}
return respone;
@@ -202,8 +198,8 @@ namespace WMS.Web.Repositories
var entity = await _context.SerialNumbers
.GroupJoin(_context.BoxInventory, serial => serial.BoxId, boxInventory => boxInventory.BoxId, (serial, boxInventory) => new { serial, boxInventory })
.SelectMany(x => x.boxInventory.DefaultIfEmpty(), (p, boxInventory) => new { p.serial, boxInventory })
.GroupJoin(_context.Box, s => s.serial.BoxId, box => box.Id, (s, box) => new { s.serial,s.boxInventory, box })
.SelectMany(x => x.box.DefaultIfEmpty(), (p, box) => new { p.serial,p.boxInventory, box })
.GroupJoin(_context.Box, s => s.serial.BoxId, box => box.Id, (s, box) => new { s.serial, s.boxInventory, box })
.SelectMany(x => x.box.DefaultIfEmpty(), (p, box) => new { p.serial, p.boxInventory, box })
.FirstOrDefaultAsync(w => serialNumber.Equals(w.serial.SerialNumber));
if (entity == null || entity.serial == null) return null;
response.BoxId = entity.serial.BoxId;