任务单作废接口

This commit is contained in:
tongfei
2023-11-15 15:20:34 +08:00
parent eb4d812b9b
commit b5af69bb1a
6 changed files with 90 additions and 1 deletions

View File

@@ -85,7 +85,21 @@ namespace WMS.Web.Api.Controllers
return Task.FromResult(Result<string>.ReSuccess(res));
}
/// <summary>
/// 作废
/// </summary>
/// <param name="dto"></param>
/// <returns></returns>
[HttpPost]
[Route("Repeal")]
public async Task<Result> Repeal([FromBody]OperateRequest dto)
{
var loginInfo = _loginService.GetLoginInfo(this.HttpContext.Request.Headers["Authorization"]);
if (loginInfo == null || loginInfo.UserInfo == null)
return Result.ReFailure(ResultCodes.Token_Invalid_Error);
return await _inStockTaskService.Repeal(dto, loginInfo);
}
/// <summary>
/// 刷新

View File

@@ -140,6 +140,13 @@
<param name="dto"></param>
<returns></returns>
</member>
<member name="M:WMS.Web.Api.Controllers.InStockTaskController.Repeal(WMS.Web.Core.Dto.OperateRequest)">
<summary>
作废
</summary>
<param name="dto"></param>
<returns></returns>
</member>
<member name="M:WMS.Web.Api.Controllers.InStockTaskController.Refresh(WMS.Web.Core.Dto.OperateRequest)">
<summary>
刷新

View File

@@ -555,6 +555,11 @@
<param name="sourceBillNo"></param>
<param name="createTime"></param>
</member>
<member name="M:WMS.Web.Domain.Entitys.InStockTask.Repeal(System.Int32)">
<summary>
作废
</summary>
</member>
<member name="M:WMS.Web.Domain.Entitys.InStockTask.MakeBillNo(System.Int32)">
<summary>
创建订单号
@@ -1774,6 +1779,13 @@
<param name="sourceBillNos"></param>
<returns></returns>
</member>
<member name="M:WMS.Web.Domain.Infrastructure.IOutStockTaskRepositories.GetListByBillNo(System.Collections.Generic.List{System.String})">
<summary>
列表-根据订单号
</summary>
<param name="billNos"></param>
<returns></returns>
</member>
<member name="M:WMS.Web.Domain.Infrastructure.IOutStockTaskRepositories.EditEntityList(System.Collections.Generic.List{WMS.Web.Domain.Entitys.OutStockTask},System.Boolean)">
修改实体集合
</member>
@@ -2028,6 +2040,14 @@
<param name="billNos"></param>
<returns></returns>
</member>
<member name="M:WMS.Web.Domain.IService.IInStockTaskService.Repeal(WMS.Web.Core.Dto.OperateRequest,WMS.Web.Core.Dto.Login.LoginInDto)">
<summary>
作废
</summary>
<param name="dto"></param>
<param name="loginInfo"></param>
<returns></returns>
</member>
<member name="T:WMS.Web.Domain.IService.IInventoryService">
<summary>
即时库存-服务接口
@@ -2393,7 +2413,7 @@
<summary>
同步金蝶数据 不传源订单号则更新所有
</summary>
<param name="sourceBillNos"></param>
<param name="billNos"></param>
<returns></returns>
</member>
<member name="T:WMS.Web.Domain.IService.Public.ISingleDataService">
@@ -3070,6 +3090,14 @@
<param name="isTransaction"></param>
<returns></returns>
</member>
<member name="M:WMS.Web.Domain.Services.InStockTaskService.Repeal(WMS.Web.Core.Dto.OperateRequest,WMS.Web.Core.Dto.Login.LoginInDto)">
<summary>
作废
</summary>
<param name="dto"></param>
<param name="loginInfo"></param>
<returns></returns>
</member>
<member name="T:WMS.Web.Domain.Services.InventoryService">
<summary>
即时库存-服务

View File

@@ -80,6 +80,14 @@ namespace WMS.Web.Domain.Entitys
this.CreateTime = createTime;
}
/// <summary>
/// 作废
/// </summary>
public void Repeal(int creatorId)
{
this.Status = InstockStatus.Repeal;
}
/// <summary>
/// 创建订单号

View File

@@ -2,7 +2,9 @@
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
using WMS.Web.Core.Dto;
using WMS.Web.Core.Dto.InStockTask;
using WMS.Web.Core.Dto.Login;
using WMS.Web.Core.Internal.Results;
namespace WMS.Web.Domain.IService
@@ -64,5 +66,13 @@ namespace WMS.Web.Domain.IService
/// <param name="billNos"></param>
/// <returns></returns>
Task<Result> Sysn(List<string> billNos = null);
/// <summary>
/// 作废
/// </summary>
/// <param name="dto"></param>
/// <param name="loginInfo"></param>
/// <returns></returns>
Task<Result> Repeal(OperateRequest dto, LoginInDto loginInfo);
}
}

View File

@@ -5,8 +5,10 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WMS.Web.Core.Dto;
using WMS.Web.Core.Dto.Erp;
using WMS.Web.Core.Dto.InStockTask;
using WMS.Web.Core.Dto.Login;
using WMS.Web.Core.Internal.Results;
using WMS.Web.Domain.Entitys;
using WMS.Web.Domain.Infrastructure;
@@ -319,5 +321,25 @@ namespace WMS.Web.Domain.Services
return Result.ReSuccess();
}
/// <summary>
/// 作废
/// </summary>
/// <param name="dto"></param>
/// <param name="loginInfo"></param>
/// <returns></returns>
public async Task<Result> Repeal(OperateRequest dto, LoginInDto loginInfo)
{
var list = await _inStockTaskRepositories.GetList(dto.Ids);
foreach (var entity in list)
{
//作废
entity.Repeal(loginInfo.UserInfo.StaffId);
}
var isSuccess = await _inStockTaskRepositories.UpdateRange(list, true);
if (!isSuccess) return Result.ReFailure(ResultCodes.DateWriteError);
return Result.ReSuccess();
}
}
}