反作废

This commit is contained in:
18942506660
2024-06-14 10:59:19 +08:00
parent 8d17b858ee
commit b5fd86f270
7 changed files with 72 additions and 6 deletions

View File

@@ -87,8 +87,8 @@ namespace WMS.Web.Api.Controllers
[HttpGet]
[Route("hj")]
public async Task<string> TestHJ()
{//
var b= await _boxService.Sync(null);
{
//var b= await _boxService.Sync(null);
//var list = await _outStockTaskRepositories.GetEntityList(new List<int> { 14321 });
//await _outStockRepositories.GetEntityListBySerialNumbers(new List<string>() { "131VU-32C5A" });

View File

@@ -1046,6 +1046,11 @@
作废
</summary>
</member>
<member name="M:WMS.Web.Domain.Entitys.InStockTask.NoRepeal(System.Int32,System.Collections.Generic.List{System.Int32})">
<summary>
反作废
</summary>
</member>
<member name="M:WMS.Web.Domain.Entitys.InStockTask.MakeBillNo(System.Int32)">
<summary>
创建订单号
@@ -1914,6 +1919,11 @@
作废
</summary>
</member>
<member name="M:WMS.Web.Domain.Entitys.OutStockTask.NoRepeal(System.Int32,System.Collections.Generic.List{System.Int32})">
<summary>
反作废
</summary>
</member>
<member name="M:WMS.Web.Domain.Entitys.OutStockTask.Merge(System.Collections.Generic.List{WMS.Web.Domain.Entitys.OutStockTask},System.Int32)">
<summary>
合并

View File

@@ -127,6 +127,19 @@ namespace WMS.Web.Domain.Entitys
}
/// <summary>
/// 反作废
/// </summary>
public void NoRepeal(int repealerId, List<int> detailsIds)
{
this.RepealerId = 0;
this.RepealTime = null;
//明细行作废
this.Details.Where(x => detailsIds.Contains(x.Id)).ToList().ForEach(x => { x.IsRepeal = false; });
this.ChangeInstockStatus();//重新计算单据的状态
}
/// <summary>
/// 创建订单号

View File

@@ -207,6 +207,27 @@ namespace WMS.Web.Domain.Entitys
GenerateStatus();
}
/// <summary>
/// 反作废
/// </summary>
public void NoRepeal(int creatorId, List<int> ids)
{
this.OperatorId = 0;
this.OperateTime = null;
foreach (var d in this.Details.Where(w => ids.Contains(w.Id)))
{
d.IsRepeal = false;
}
var details = this.Details.Where(w => w.IsRepeal != true).ToList();
if (details.Where(w => w.RealityQty <= 0).Count() == details.Count())
this.Status = OutStockStatus.Wait;
else if (details.Where(w => w.RealityQty >= w.AccruedQty).Count() == details.Count())
this.Status = OutStockStatus.Already;
else
this.Status = OutStockStatus.Part;
}
/// <summary>
/// 合并
/// </summary>
/// <param name="list"></param>

View File

@@ -672,9 +672,20 @@ namespace WMS.Web.Domain.Services
/// <param name="loginInfo"></param>
/// <returns></returns>
/// <exception cref="NotImplementedException"></exception>
public Task<Result> NoRepeal(OperateRequest dto, LoginInDto loginInfo)
public async Task<Result> NoRepeal(OperateRequest dto, LoginInDto loginInfo)
{
throw new NotImplementedException();
var list = await _inStockTaskRepositories.GetListByDetailIds(dto.Ids);
foreach (var entity in list)
{
var det_ids = entity.Details.Select(s => s.Id).ToList();
var change_ids = det_ids.Intersect(dto.Ids).ToList();
//作废
entity.NoRepeal(loginInfo.UserInfo.StaffId, change_ids);
}
var isSuccess = await _inStockTaskRepositories.UpdateRange(list, true);
if (!isSuccess) return Result.ReFailure(ResultCodes.DateWriteError);
return Result.ReSuccess();
}
}
}

View File

@@ -98,9 +98,20 @@ namespace WMS.Web.Domain.Services
/// <param name="loginInfo"></param>
/// <returns></returns>
/// <exception cref="NotImplementedException"></exception>
public Task<Result> NoRepeal(OperateRequest dto, LoginInDto loginInfo)
public async Task<Result> NoRepeal(OperateRequest dto, LoginInDto loginInfo)
{
throw new NotImplementedException();
var list = await _outStockTaskRepositories.GetEntityListByDetailIds(dto.Ids);
foreach (var entity in list)
{
List<int> e_ids = entity.Details.Select(s => s.Id).ToList();
var j_ids = e_ids.Intersect(dto.Ids).ToList();
//反作废
entity.NoRepeal(loginInfo.UserInfo.StaffId, j_ids);
}
var isSuccess = await _outStockTaskRepositories.EditEntityList(list, true);
if (!isSuccess) return Result.ReFailure(ResultCodes.DateWriteError);
return Result.ReSuccess();
}
/// <summary>
/// 出库任务合并