diff --git a/.vs/WMS.Web/DesignTimeBuild/.dtbcache.v2 b/.vs/WMS.Web/DesignTimeBuild/.dtbcache.v2 index c636cfb0..99a82242 100644 Binary files a/.vs/WMS.Web/DesignTimeBuild/.dtbcache.v2 and b/.vs/WMS.Web/DesignTimeBuild/.dtbcache.v2 differ diff --git a/src/WMS.Web.Api/Controllers/TestController.cs b/src/WMS.Web.Api/Controllers/TestController.cs index 1fbd201d..cb35eef8 100644 --- a/src/WMS.Web.Api/Controllers/TestController.cs +++ b/src/WMS.Web.Api/Controllers/TestController.cs @@ -87,8 +87,8 @@ namespace WMS.Web.Api.Controllers [HttpGet] [Route("hj")] public async Task TestHJ() - {// - var b= await _boxService.Sync(null); + { + //var b= await _boxService.Sync(null); //var list = await _outStockTaskRepositories.GetEntityList(new List { 14321 }); //await _outStockRepositories.GetEntityListBySerialNumbers(new List() { "131VU-32C5A" }); diff --git a/src/WMS.Web.Api/wwwroot/WMS.Web.Domain.xml b/src/WMS.Web.Api/wwwroot/WMS.Web.Domain.xml index 3d31cb23..b22a842f 100644 --- a/src/WMS.Web.Api/wwwroot/WMS.Web.Domain.xml +++ b/src/WMS.Web.Api/wwwroot/WMS.Web.Domain.xml @@ -1046,6 +1046,11 @@ 作废 + + + 反作废 + + 创建订单号 @@ -1914,6 +1919,11 @@ 作废 + + + 反作废 + + 合并 diff --git a/src/WMS.Web.Domain/Entitys/InstockTask.cs b/src/WMS.Web.Domain/Entitys/InstockTask.cs index 5cf95dd4..9a745305 100644 --- a/src/WMS.Web.Domain/Entitys/InstockTask.cs +++ b/src/WMS.Web.Domain/Entitys/InstockTask.cs @@ -127,6 +127,19 @@ namespace WMS.Web.Domain.Entitys } + /// + /// 反作废 + /// + public void NoRepeal(int repealerId, List detailsIds) + { + this.RepealerId = 0; + this.RepealTime = null; + //明细行作废 + this.Details.Where(x => detailsIds.Contains(x.Id)).ToList().ForEach(x => { x.IsRepeal = false; }); + + this.ChangeInstockStatus();//重新计算单据的状态 + } + /// /// 创建订单号 diff --git a/src/WMS.Web.Domain/Entitys/OutStockTask.cs b/src/WMS.Web.Domain/Entitys/OutStockTask.cs index 7f765cdd..1384008f 100644 --- a/src/WMS.Web.Domain/Entitys/OutStockTask.cs +++ b/src/WMS.Web.Domain/Entitys/OutStockTask.cs @@ -207,6 +207,27 @@ namespace WMS.Web.Domain.Entitys GenerateStatus(); } /// + /// 反作废 + /// + public void NoRepeal(int creatorId, List 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; + } + /// /// 合并 /// /// diff --git a/src/WMS.Web.Domain/Services/InStockTaskService.cs b/src/WMS.Web.Domain/Services/InStockTaskService.cs index 84ab2ffa..02493b6a 100644 --- a/src/WMS.Web.Domain/Services/InStockTaskService.cs +++ b/src/WMS.Web.Domain/Services/InStockTaskService.cs @@ -672,9 +672,20 @@ namespace WMS.Web.Domain.Services /// /// /// - public Task NoRepeal(OperateRequest dto, LoginInDto loginInfo) + public async Task 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(); } } } diff --git a/src/WMS.Web.Domain/Services/OutStockTaskService.cs b/src/WMS.Web.Domain/Services/OutStockTaskService.cs index 275c9b14..1521cb18 100644 --- a/src/WMS.Web.Domain/Services/OutStockTaskService.cs +++ b/src/WMS.Web.Domain/Services/OutStockTaskService.cs @@ -98,9 +98,20 @@ namespace WMS.Web.Domain.Services /// /// /// - public Task NoRepeal(OperateRequest dto, LoginInDto loginInfo) + public async Task NoRepeal(OperateRequest dto, LoginInDto loginInfo) { - throw new NotImplementedException(); + var list = await _outStockTaskRepositories.GetEntityListByDetailIds(dto.Ids); + foreach (var entity in list) + { + List 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(); } /// /// 出库任务合并