标记同步成功
This commit is contained in:
@@ -1139,7 +1139,7 @@ namespace WMS.Web.Domain.Services
|
||||
list.SelectMany(s => s.Details)
|
||||
.Where(w => t_boxIds.Contains(w.BoxId))
|
||||
.ForEach(f => f.UnBind = true);
|
||||
|
||||
|
||||
if (list.Count != 0)
|
||||
{
|
||||
var isSuccess = await _inStockRepositories.UpdateRange(list, isTransaction);
|
||||
@@ -1148,5 +1148,30 @@ namespace WMS.Web.Domain.Services
|
||||
}
|
||||
return Result.ReSuccess();
|
||||
}
|
||||
/// <summary>
|
||||
/// 标记同步成功
|
||||
/// </summary>
|
||||
/// <param name="dto"></param>
|
||||
/// <param name="loginInfo"></param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="NotImplementedException"></exception>
|
||||
public async Task<Result> SyncSuccess(List<SyncSuccessRequest> dto, LoginInDto loginInfo)
|
||||
{
|
||||
_logger.LogInformation($"标记同步成功:{JsonConvert.SerializeObject(dto)} 操作人:{loginInfo.UserInfo.StaffId},{loginInfo.UserInfo.Nickname}");
|
||||
|
||||
var ids = dto.Select(s => s.Id).ToList();
|
||||
var entityList = await _inStockRepositories.GetList(ids);
|
||||
foreach (var d in dto)
|
||||
{
|
||||
var entity = entityList.FirstOrDefault(f => f.Id == d.Id);
|
||||
if (entity == null) return Result.ReFailure(ResultCodes.NoDateError);
|
||||
var res = entity.OperationSyncSuccess(d.SourceBillNo, d.MaterialNumber, d.ErpBillNo);
|
||||
if (!res.IsSuccess) return res;
|
||||
}
|
||||
var isSuccess = await _inStockRepositories.UpdateRange(entityList, true);
|
||||
if (!isSuccess) return Result.ReFailure(ResultCodes.DateWriteError);
|
||||
|
||||
return Result.ReSuccess();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user