修复bug
This commit is contained in:
@@ -129,13 +129,9 @@ namespace WMS.Web.Repositories
|
|||||||
};
|
};
|
||||||
if (!string.IsNullOrEmpty(s.SalBillNo))
|
if (!string.IsNullOrEmpty(s.SalBillNo))
|
||||||
{
|
{
|
||||||
Random rd = new Random();
|
|
||||||
var list = JsonConvert.DeserializeObject<List<string>>(s.SalBillNo);
|
var list = JsonConvert.DeserializeObject<List<string>>(s.SalBillNo);
|
||||||
if (list.Count() > 0)
|
if (list.Count() > 0)
|
||||||
{
|
respone.SalBillNo = list[0];
|
||||||
int index = rd.Next(0, list.Count);
|
|
||||||
respone.SalBillNo = list[index];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return respone;
|
return respone;
|
||||||
@@ -202,8 +198,8 @@ namespace WMS.Web.Repositories
|
|||||||
var entity = await _context.SerialNumbers
|
var entity = await _context.SerialNumbers
|
||||||
.GroupJoin(_context.BoxInventory, serial => serial.BoxId, boxInventory => boxInventory.BoxId, (serial, boxInventory) => new { serial, boxInventory })
|
.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 })
|
.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 })
|
.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 })
|
.SelectMany(x => x.box.DefaultIfEmpty(), (p, box) => new { p.serial, p.boxInventory, box })
|
||||||
.FirstOrDefaultAsync(w => serialNumber.Equals(w.serial.SerialNumber));
|
.FirstOrDefaultAsync(w => serialNumber.Equals(w.serial.SerialNumber));
|
||||||
if (entity == null || entity.serial == null) return null;
|
if (entity == null || entity.serial == null) return null;
|
||||||
response.BoxId = entity.serial.BoxId;
|
response.BoxId = entity.serial.BoxId;
|
||||||
|
|||||||
Reference in New Issue
Block a user