This commit is contained in:
tongfei
2024-03-29 18:16:22 +08:00
4 changed files with 19 additions and 18 deletions

View File

@@ -88,7 +88,7 @@ namespace WMS.Web.Api.Controllers
return Result.ReFailure(ResultCodes.Token_Invalid_Error);
var entity = await _repositories.Get(dto.Id);
if (entity == null)
if (entity == null || entity.IsDelete == true)
return Result.ReFailure(ResultCodes.SubscribeNotificationNoData);
//修改
//修改了名字或者编码后 验重

View File

@@ -33,12 +33,12 @@ namespace WMS.Web.Domain.Entitys
/// 电话
/// </summary>
[Column("Telephones")]
public List<string> Telephones { get; set; }
public List<string> Telephones { get; set; } = new List<string>();
/// <summary>
/// 邮件
/// </summary>
[Column("Emails")]
public List<string> Emails { get; set; }
public List<string> Emails { get; set; } = new List<string>();
/// <summary>
/// 是否删除
/// </summary>

View File

@@ -285,22 +285,23 @@ namespace WMS.Web.Repositories
var materials = materials_result.Data.ToList();
var entity = await _context.SerialNumbers_Ops
.GroupJoin(_context.BoxInventory.Include(x => x.Details), 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 })
.FirstOrDefaultAsync(w => serialNumber.Equals(w.serial.SerialNumber));
if (entity == null || entity.serial == null) return null;
//.GroupJoin(_context.BoxInventory.Include(x => x.Details), 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 })
.FirstOrDefaultAsync(w => serialNumber.Equals(w.SerialNumber));
if (entity == null) return null;
response.IsOldOps = true;
response.BoxId = entity.serial.BoxId;
response.BoxBillNo = entity?.box?.BoxBillNo ?? "";
response.SubStockCode = entity?.boxInventory?.SubStockCode ?? "";
response.SerialNumber = entity.serial.SerialNumber;
response.MaterialName = _erpBasicDataExtendService.GetMaterialName(materials, entity.serial.MaterialNumber);
response.MaterialNumber = entity.serial.MaterialNumber;
response.Specifications = _erpBasicDataExtendService.GetMaterialSpecifications(materials, entity.serial.MaterialNumber);
if (entity.boxInventory != null)
response.IsBoxInventory = entity.boxInventory.Details.SelectMany(s => s.SerialNumbers).Where(w => serialNumber.Equals(w)).Count() >= 1 ? true : false;
response.IsBoxInventory = true;//如果是老ops序列号 默认有库存
response.BoxId = 0;
response.BoxBillNo = "";
response.SubStockCode = "";
response.SerialNumber = entity.SerialNumber;
response.MaterialName = _erpBasicDataExtendService.GetMaterialName(materials, entity.MaterialNumber);
response.MaterialNumber = entity.MaterialNumber;
response.Specifications = _erpBasicDataExtendService.GetMaterialSpecifications(materials, entity.MaterialNumber);
//if (entity.boxInventory != null)
// response.IsBoxInventory = entity.boxInventory.Details.SelectMany(s => s.SerialNumbers).Where(w => serialNumber.Equals(w)).Count() >= 1 ? true : false;
return response;