金蝶同步wms
This commit is contained in:
@@ -92,50 +92,5 @@ namespace WMS.Web.Domain.Services
|
||||
{
|
||||
return Task.FromResult(Result.ReSuccess());
|
||||
}
|
||||
/// <summary>
|
||||
/// 出库任务作废
|
||||
/// </summary>
|
||||
/// <param name="dto"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<Result> Repeal(OperateRequest dto, LoginInDto loginInfo)
|
||||
{
|
||||
var list = await _outStockTaskRepositories.GetEntityList(dto.Ids);
|
||||
foreach (var entity in list)
|
||||
{
|
||||
//作废
|
||||
entity.Repeal(loginInfo.UserInfo.StaffId);
|
||||
}
|
||||
var isSuccess = await _outStockTaskRepositories.EditEntityList(list, true);
|
||||
if (!isSuccess) return Result.ReFailure(ResultCodes.DateWriteError);
|
||||
|
||||
return Result.ReSuccess();
|
||||
}
|
||||
/// <summary>
|
||||
/// 出库任务合并
|
||||
/// </summary>
|
||||
/// <param name="dto"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<Result> merge(OperateRequest dto, LoginInDto loginInfo)
|
||||
{
|
||||
var list = await _outStockTaskRepositories.GetEntityList(dto.Ids);
|
||||
// 2:符合合并数据逻辑:出库状态为”待拣货”+出库类型为:销售出库+发货组织一致+收货客户一致+发货仓库一致
|
||||
OutStockTask entity = new OutStockTask();
|
||||
var res = entity.Merge(list, loginInfo.UserInfo.StaffId);
|
||||
if (!res.IsSuccess) return res;
|
||||
|
||||
IDbContextTransaction _transaction = _transactionRepositories.GetTransaction();
|
||||
bool isRollback = false;
|
||||
bool isSuccess = true;
|
||||
entity = await _outStockTaskRepositories.Add(entity, false);
|
||||
if (entity == null) isRollback = true;
|
||||
isSuccess = await _outStockTaskRepositories.DeleteEntityList(list.Select(s => s.Id).ToList(), false);
|
||||
if (isSuccess == false) isRollback = true;
|
||||
//提交事务
|
||||
isSuccess = _transactionRepositories.CommitTransaction(isRollback, _transaction);
|
||||
if (!isSuccess)
|
||||
return Result.ReFailure(ResultCodes.DateWriteError);
|
||||
|
||||
return Result.ReSuccess();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user