优化接口
This commit is contained in:
@@ -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();
|
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();
|
var result= list.Where(x => x.WaitSlefQty != 0).ToList();
|
||||||
|
|
||||||
return ResultList<SourceBillNoQueryResponse>.ReSuccess(result);
|
return ResultList<SourceBillNoQueryResponse>.ReSuccess(result);
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ namespace WMS.Web.Domain.Infrastructure
|
|||||||
/// <param name="entity"></param>
|
/// <param name="entity"></param>
|
||||||
/// <param name="isTransaction"></param>
|
/// <param name="isTransaction"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
Task<InStock> Update(InStock entity, bool isTransaction = true);
|
Task<bool> Update(InStock entity, bool isTransaction = true);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 批量修改
|
/// 批量修改
|
||||||
|
|||||||
@@ -794,7 +794,7 @@ namespace WMS.Web.Domain.Services
|
|||||||
}
|
}
|
||||||
//最好一条一条执行,否则执行失败 但是金蝶那边又同步成功 就会造成数据比价乱
|
//最好一条一条执行,否则执行失败 但是金蝶那边又同步成功 就会造成数据比价乱
|
||||||
var isSuccess = await sc_InStockRepositories.Update(entity, true);
|
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();
|
return Result.ReSuccess();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -171,7 +171,7 @@ namespace WMS.Web.Repositories
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="dto"></param>
|
/// <param name="dto"></param>
|
||||||
/// <returns></returns>
|
/// <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;
|
IDbContextTransaction _transaction = null;
|
||||||
if (isTransaction)
|
if (isTransaction)
|
||||||
@@ -183,7 +183,7 @@ namespace WMS.Web.Repositories
|
|||||||
.Include(s => s.ErpDetails)
|
.Include(s => s.ErpDetails)
|
||||||
.FirstOrDefaultAsync(f => f.Id == entity.Id);
|
.FirstOrDefaultAsync(f => f.Id == entity.Id);
|
||||||
if (model == null)
|
if (model == null)
|
||||||
return null;
|
return false;
|
||||||
_mapper.Map(entity, model);
|
_mapper.Map(entity, model);
|
||||||
//子集单独映射
|
//子集单独映射
|
||||||
_mapper.ToMapList(entity.Details, model.Details);
|
_mapper.ToMapList(entity.Details, model.Details);
|
||||||
@@ -192,13 +192,13 @@ namespace WMS.Web.Repositories
|
|||||||
await _context.SaveChangesAsync();
|
await _context.SaveChangesAsync();
|
||||||
if (_transaction != null)
|
if (_transaction != null)
|
||||||
_transaction.Commit();
|
_transaction.Commit();
|
||||||
return model;
|
return true;
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
if (_transaction != null)
|
if (_transaction != null)
|
||||||
_transaction.Rollback();
|
_transaction.Rollback();
|
||||||
return null;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user