优化接口

This commit is contained in:
tongfei
2024-04-12 17:16:22 +08:00
parent 825a7312eb
commit f2b53a7e0a
4 changed files with 7 additions and 7 deletions

View File

@@ -187,7 +187,7 @@ namespace WMS.Web.Api.Controllers
x.MaterialSubStocks = materialSubStocks.Where(t => t.MaterialNumber == x.MaterialNumber && t.StockCode == x.StockCode && t.OrgCode == x.OrgCode).Select(x => x.SubStock).ToList();
});
//排除入库数量为0的
//排除入库数量为0的
var result= list.Where(x => x.WaitSlefQty != 0).ToList();
return ResultList<SourceBillNoQueryResponse>.ReSuccess(result);

View File

@@ -58,7 +58,7 @@ namespace WMS.Web.Domain.Infrastructure
/// <param name="entity"></param>
/// <param name="isTransaction"></param>
/// <returns></returns>
Task<InStock> Update(InStock entity, bool isTransaction = true);
Task<bool> Update(InStock entity, bool isTransaction = true);
/// <summary>
/// 批量修改

View File

@@ -794,7 +794,7 @@ namespace WMS.Web.Domain.Services
}
//最好一条一条执行,否则执行失败 但是金蝶那边又同步成功 就会造成数据比价乱
var isSuccess = await sc_InStockRepositories.Update(entity, true);
if (entity == null) return Result.ReFailure(ResultCodes.DateWriteError);
if (!isSuccess) return Result.ReFailure(ResultCodes.DateWriteError);
return Result.ReSuccess();
}

View File

@@ -171,7 +171,7 @@ namespace WMS.Web.Repositories
/// </summary>
/// <param name="dto"></param>
/// <returns></returns>
public async Task<InStock> Update(InStock entity, bool isTransaction = true)
public async Task<bool> Update(InStock entity, bool isTransaction = true)
{
IDbContextTransaction _transaction = null;
if (isTransaction)
@@ -183,7 +183,7 @@ namespace WMS.Web.Repositories
.Include(s => s.ErpDetails)
.FirstOrDefaultAsync(f => f.Id == entity.Id);
if (model == null)
return null;
return false;
_mapper.Map(entity, model);
//子集单独映射
_mapper.ToMapList(entity.Details, model.Details);
@@ -192,13 +192,13 @@ namespace WMS.Web.Repositories
await _context.SaveChangesAsync();
if (_transaction != null)
_transaction.Commit();
return model;
return true;
}
catch (Exception ex)
{
if (_transaction != null)
_transaction.Rollback();
return null;
return false;
}
}