优化接口
This commit is contained in:
@@ -49,13 +49,13 @@ namespace WMS.Web.Api.Controllers
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 上架
|
||||
/// 上架-采购订单
|
||||
/// </summary>
|
||||
/// <param name="dto"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[Route("Shelf")]
|
||||
public async Task<Result> Shelf([FromBody] SaveInStockRequest dto)
|
||||
public async Task<Result> Shelf([FromBody] PurchaseShelfRequest dto)
|
||||
{
|
||||
var loginInfo = _loginService.GetLoginInfo(this.HttpContext.Request.Headers["Authorization"]);
|
||||
if (loginInfo == null || loginInfo.UserInfo == null)
|
||||
@@ -64,6 +64,18 @@ namespace WMS.Web.Api.Controllers
|
||||
return await _inStockService.Shelf(dto, loginInfo);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 上架-非采购订单
|
||||
/// </summary>
|
||||
/// <param name="dto"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[Route("ShelfOther")]
|
||||
public async Task<Result> ShelfOther([FromBody] SaveInStockRequest dto)
|
||||
{
|
||||
return Result.ReSuccess();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 通过箱号获取到入库任务单数据
|
||||
/// </summary>
|
||||
|
||||
@@ -61,9 +61,16 @@
|
||||
<param name="dto"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:WMS.Web.Api.Controllers.InStockController.Shelf(WMS.Web.Core.Dto.InStock.SaveInStockRequest)">
|
||||
<member name="M:WMS.Web.Api.Controllers.InStockController.Shelf(WMS.Web.Core.Dto.InStock.PurchaseShelfRequest)">
|
||||
<summary>
|
||||
上架
|
||||
上架-采购订单
|
||||
</summary>
|
||||
<param name="dto"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:WMS.Web.Api.Controllers.InStockController.ShelfOther(WMS.Web.Core.Dto.InStock.SaveInStockRequest)">
|
||||
<summary>
|
||||
上架-非采购订单
|
||||
</summary>
|
||||
<param name="dto"></param>
|
||||
<returns></returns>
|
||||
|
||||
@@ -907,7 +907,7 @@
|
||||
</member>
|
||||
<member name="P:WMS.Web.Core.Dto.InStockTask.InStockTaskDetailsInfoDto.Fid">
|
||||
<summary>
|
||||
单据头ID
|
||||
单据ID(等同-入库任务单ID)
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:WMS.Web.Core.Dto.InStockTask.InStockTaskDetailsInfoDto.MaterialId">
|
||||
@@ -942,7 +942,7 @@
|
||||
</member>
|
||||
<member name="P:WMS.Web.Core.Dto.InStockTask.InStockTaskInfoDto.Id">
|
||||
<summary>
|
||||
ID
|
||||
单据ID(等同-入库任务单ID)
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:WMS.Web.Core.Dto.InStockTask.InStockTaskInfoDto.BillNo">
|
||||
@@ -967,7 +967,7 @@
|
||||
</member>
|
||||
<member name="P:WMS.Web.Core.Dto.InStockTask.InStockTaskBillNoQueryResponse.Id">
|
||||
<summary>
|
||||
ID
|
||||
单据ID(等同-入库任务单ID)
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:WMS.Web.Core.Dto.InStockTask.InStockTaskBillNoQueryResponse.DetailsId">
|
||||
@@ -1037,7 +1037,7 @@
|
||||
</member>
|
||||
<member name="P:WMS.Web.Core.Dto.InStockTask.UpdateInStockTaskBoxRequest.TaskId">
|
||||
<summary>
|
||||
入库任务单ID
|
||||
单据ID(等同-入库任务单ID)
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:WMS.Web.Core.Dto.InStockTask.UpdateInStockTaskBoxRequest.BoxId">
|
||||
@@ -1062,7 +1062,7 @@
|
||||
</member>
|
||||
<member name="P:WMS.Web.Core.Dto.InStockTask.UpdateInStockTaskDetailsRequest.Fid">
|
||||
<summary>
|
||||
单据头ID
|
||||
单据ID(等同-入库任务单ID)
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:WMS.Web.Core.Dto.InStockTask.UpdateInStockTaskDetailsRequest.MaterialId">
|
||||
@@ -1082,7 +1082,7 @@
|
||||
</member>
|
||||
<member name="P:WMS.Web.Core.Dto.InStockTask.UpdateInStockTaskRequest.Id">
|
||||
<summary>
|
||||
单据ID
|
||||
单据ID(等同-入库任务单ID)
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:WMS.Web.Core.Dto.InStockTask.UpdateInStockTaskRequest.Boxs">
|
||||
@@ -1405,11 +1405,26 @@
|
||||
同步成功或者失败
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:WMS.Web.Core.Dto.InStock.PurchaseShelfRequest">
|
||||
<summary>
|
||||
采购上架-请求对象
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:WMS.Web.Core.Dto.InStock.PurchaseShelfRequest.Details">
|
||||
<summary>
|
||||
明细
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:WMS.Web.Core.Dto.InStock.SaveInStockDetailsRequest">
|
||||
<summary>
|
||||
保存入库单明细-请求对象
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:WMS.Web.Core.Dto.InStock.SaveInStockDetailsRequest.TaskId">
|
||||
<summary>
|
||||
单据ID(等同-入库任务单ID)
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:WMS.Web.Core.Dto.InStock.SaveInStockDetailsRequest.SourceBillNo">
|
||||
<summary>
|
||||
来源单号
|
||||
@@ -1450,21 +1465,6 @@
|
||||
保存入库单-请求对象
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:WMS.Web.Core.Dto.InStock.SaveInStockRequest.Type">
|
||||
<summary>
|
||||
入库类型
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:WMS.Web.Core.Dto.InStock.SaveInStockRequest.TaskId">
|
||||
<summary>
|
||||
任务单ID
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:WMS.Web.Core.Dto.InStock.SaveInStockRequest.Details">
|
||||
<summary>
|
||||
明细
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:WMS.Web.Core.Dto.Inventory.BoxInventoryQueryRequest">
|
||||
<summary>
|
||||
箱库存-查询请求对象
|
||||
|
||||
@@ -269,11 +269,6 @@
|
||||
ID
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:WMS.Web.Domain.Entitys.InStock.TaskId">
|
||||
<summary>
|
||||
任务单ID
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:WMS.Web.Domain.Entitys.InStock.BillNo">
|
||||
<summary>
|
||||
单据编号
|
||||
@@ -330,6 +325,11 @@
|
||||
单据头ID
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:WMS.Web.Domain.Entitys.InStockDetails.TaskId">
|
||||
<summary>
|
||||
任务单ID
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:WMS.Web.Domain.Entitys.InStockDetails.SourceBillNo">
|
||||
<summary>
|
||||
来源单号
|
||||
@@ -1391,9 +1391,9 @@
|
||||
<param name="loginInfo"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:WMS.Web.Domain.IService.IInStockService.Shelf(WMS.Web.Core.Dto.InStock.SaveInStockRequest,WMS.Web.Core.Dto.Login.LoginInDto)">
|
||||
<member name="M:WMS.Web.Domain.IService.IInStockService.Shelf(WMS.Web.Core.Dto.InStock.PurchaseShelfRequest,WMS.Web.Core.Dto.Login.LoginInDto)">
|
||||
<summary>
|
||||
上架
|
||||
上架-采购订单
|
||||
</summary>
|
||||
<param name="instock"></param>
|
||||
<param name="loginInfo"></param>
|
||||
@@ -1406,15 +1406,6 @@
|
||||
<param name="boxBillNo"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:WMS.Web.Domain.IService.IInStockService.Save(WMS.Web.Core.Dto.InStock.SaveInStockRequest,System.Int32,System.Boolean)">
|
||||
<summary>
|
||||
保存-出库单
|
||||
</summary>
|
||||
<param name="dto"></param>
|
||||
<param name="staffId"></param>
|
||||
<param name="isTransaction"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:WMS.Web.Domain.IService.IInStockService.Update(WMS.Web.Core.Dto.InStockTask.UpdateInStockTaskRequest,System.Int32,System.Boolean,System.Boolean)">
|
||||
<summary>
|
||||
修改-入库任务信息
|
||||
@@ -2000,9 +1991,9 @@
|
||||
<param name="loginInfo"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:WMS.Web.Domain.Services.InStockService.Shelf(WMS.Web.Core.Dto.InStock.SaveInStockRequest,WMS.Web.Core.Dto.Login.LoginInDto)">
|
||||
<member name="M:WMS.Web.Domain.Services.InStockService.Shelf(WMS.Web.Core.Dto.InStock.PurchaseShelfRequest,WMS.Web.Core.Dto.Login.LoginInDto)">
|
||||
<summary>
|
||||
上架
|
||||
上架-采购订单
|
||||
</summary>
|
||||
<param name="instock"></param>
|
||||
<param name="loginInfo"></param>
|
||||
@@ -2015,9 +2006,9 @@
|
||||
<param name="boxBillNo"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:WMS.Web.Domain.Services.InStockService.Save(WMS.Web.Core.Dto.InStock.SaveInStockRequest,System.Int32,System.Boolean)">
|
||||
<member name="M:WMS.Web.Domain.Services.InStockService.Save(WMS.Web.Core.Dto.InStock.PurchaseShelfRequest,WMS.Web.Domain.Values.InstockType,System.Int32,System.Boolean)">
|
||||
<summary>
|
||||
保存-出库单
|
||||
采购上架-保存
|
||||
</summary>
|
||||
<param name="dto"></param>
|
||||
<param name="staffId"></param>
|
||||
|
||||
17
src/WMS.Web.Core/Dto/InStock/PurchaseShelfRequest.cs
Normal file
17
src/WMS.Web.Core/Dto/InStock/PurchaseShelfRequest.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace WMS.Web.Core.Dto.InStock
|
||||
{
|
||||
/// <summary>
|
||||
/// 采购上架-请求对象
|
||||
/// </summary>
|
||||
public class PurchaseShelfRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 明细
|
||||
/// </summary>
|
||||
public List<SaveInStockDetailsRequest> Details { get; set; } = new List<SaveInStockDetailsRequest>();
|
||||
}
|
||||
}
|
||||
@@ -10,6 +10,12 @@ namespace WMS.Web.Core.Dto.InStock
|
||||
/// </summary>
|
||||
public class SaveInStockDetailsRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 单据ID(等同-入库任务单ID)
|
||||
/// </summary>
|
||||
[Required(ErrorMessage = "任务单ID不能为空")]
|
||||
public int TaskId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 来源单号
|
||||
///</summary>
|
||||
|
||||
@@ -10,22 +10,7 @@ namespace WMS.Web.Core.Dto.InStock
|
||||
/// </summary>
|
||||
public class SaveInStockRequest
|
||||
{
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 入库类型
|
||||
/// </summary>
|
||||
[Required(ErrorMessage = "入库类型不能为空")]
|
||||
public int Type { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 任务单ID
|
||||
/// </summary>
|
||||
[Required(ErrorMessage = "任务单ID不能为空")]
|
||||
public int TaskId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 明细
|
||||
/// </summary>
|
||||
public List<SaveInStockDetailsRequest> Details { get; set; } = new List<SaveInStockDetailsRequest>();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace WMS.Web.Core.Dto.InStockTask
|
||||
/// </summary>
|
||||
public int Id { get; set; }
|
||||
/// <summary>
|
||||
/// 单据头ID
|
||||
/// 单据ID(等同-入库任务单ID)
|
||||
/// </summary>
|
||||
public int Fid { get; set; }
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace WMS.Web.Core.Dto.InStockTask
|
||||
public class InStockTaskInfoDto
|
||||
{
|
||||
/// <summary>
|
||||
/// ID
|
||||
/// 单据ID(等同-入库任务单ID)
|
||||
/// </summary>
|
||||
public int Id { get; set; }
|
||||
/// <summary>
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace WMS.Web.Core.Dto.InStockTask
|
||||
public class InStockTaskBillNoQueryResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// ID
|
||||
/// 单据ID(等同-入库任务单ID)
|
||||
/// </summary>
|
||||
public int Id { get; set; }
|
||||
/// <summary>
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace WMS.Web.Core.Dto.InStockTask
|
||||
/// </summary>
|
||||
public override int Id { get; set; } = 0;
|
||||
/// <summary>
|
||||
/// 入库任务单ID
|
||||
/// 单据ID(等同-入库任务单ID)
|
||||
/// </summary>
|
||||
public int TaskId { get; set; }
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace WMS.Web.Core.Dto.InStockTask
|
||||
/// </summary>
|
||||
public override int Id { get; set; } = 0;
|
||||
/// <summary>
|
||||
/// 单据头ID
|
||||
/// 单据ID(等同-入库任务单ID)
|
||||
/// </summary>
|
||||
public int Fid { get; set; }
|
||||
/// <summary>
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace WMS.Web.Core.Dto.InStockTask
|
||||
public class UpdateInStockTaskRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 单据ID
|
||||
/// 单据ID(等同-入库任务单ID)
|
||||
/// </summary>
|
||||
[Required(ErrorMessage = "唯一编号不能未空")]
|
||||
public int Id { get; set; }
|
||||
|
||||
@@ -17,12 +17,7 @@ namespace WMS.Web.Domain.Entitys
|
||||
/// ID
|
||||
/// </summary>
|
||||
public int Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 任务单ID
|
||||
/// </summary>
|
||||
public int TaskId { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 单据编号
|
||||
/// </summary>
|
||||
|
||||
@@ -20,6 +20,11 @@ namespace WMS.Web.Domain.Entitys
|
||||
/// 单据头ID
|
||||
/// </summary>
|
||||
public int Fid { get; set; }
|
||||
/// <summary>
|
||||
/// 任务单ID
|
||||
/// </summary>
|
||||
public int TaskId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 来源单号
|
||||
/// </summary>
|
||||
|
||||
@@ -7,6 +7,7 @@ using WMS.Web.Core.Dto.InStock;
|
||||
using WMS.Web.Core.Dto.InStockTask;
|
||||
using WMS.Web.Core.Dto.Login;
|
||||
using WMS.Web.Core.Internal.Results;
|
||||
using WMS.Web.Domain.Values;
|
||||
|
||||
namespace WMS.Web.Domain.IService
|
||||
{
|
||||
@@ -32,12 +33,12 @@ namespace WMS.Web.Domain.IService
|
||||
Task<Result> Receive(UpdateInStockTaskRequest dto, LoginInDto loginInfo);
|
||||
|
||||
/// <summary>
|
||||
/// 上架
|
||||
/// 上架-采购订单
|
||||
/// </summary>
|
||||
/// <param name="instock"></param>
|
||||
/// <param name="loginInfo"></param>
|
||||
/// <returns></returns>
|
||||
Task<Result> Shelf(SaveInStockRequest instock, LoginInDto loginInfo);
|
||||
Task<Result> Shelf(PurchaseShelfRequest instock, LoginInDto loginInfo);
|
||||
|
||||
/// <summary>
|
||||
/// 获取任务单:根据箱号信息
|
||||
@@ -46,15 +47,6 @@ namespace WMS.Web.Domain.IService
|
||||
/// <returns></returns>
|
||||
Task<Result<InStockTaskInfoDto>> GetInfoByBox(string boxBillNo);
|
||||
|
||||
/// <summary>
|
||||
/// 保存-出库单
|
||||
/// </summary>
|
||||
/// <param name="dto"></param>
|
||||
/// <param name="staffId"></param>
|
||||
/// <param name="isTransaction"></param>
|
||||
/// <returns></returns>
|
||||
Task<Result> Save(SaveInStockRequest dto, int staffId, bool isTransaction = true);
|
||||
|
||||
/// <summary>
|
||||
/// 修改-入库任务信息
|
||||
/// </summary>
|
||||
|
||||
@@ -79,24 +79,22 @@ namespace WMS.Web.Domain.Services
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 上架
|
||||
/// 上架-采购订单
|
||||
/// </summary>
|
||||
/// <param name="instock"></param>
|
||||
/// <param name="loginInfo"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<Result> Shelf(SaveInStockRequest instock, LoginInDto loginInfo)
|
||||
public async Task<Result> Shelf(PurchaseShelfRequest instock, LoginInDto loginInfo)
|
||||
{
|
||||
IDbContextTransaction _transaction = _transactionRepositories.GetTransaction();
|
||||
bool isRollback = false;
|
||||
bool isTransaction = false;
|
||||
|
||||
//1.添加入库单:(同步金蝶在save方法里面进行)
|
||||
var save_result = await this.Save(instock, loginInfo.UserInfo.StaffId, isTransaction);
|
||||
var save_result = await this.Save(instock, InstockType.Purchase, loginInfo.UserInfo.StaffId, isTransaction);
|
||||
if (!save_result.IsSuccess) isRollback = true;
|
||||
{
|
||||
//2.修改入库任务单
|
||||
var ids = new List<int>();
|
||||
ids.Add(instock.TaskId);
|
||||
var ids = instock.Details.GroupBy(x => x.TaskId).Select(x => x.Key).ToList();
|
||||
var result = await this.UpdateRange(ids, loginInfo.UserInfo.StaffId, false, isTransaction);
|
||||
if (!result.IsSuccess) isRollback = true;
|
||||
}
|
||||
@@ -142,17 +140,16 @@ namespace WMS.Web.Domain.Services
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 保存-出库单
|
||||
/// 采购上架-保存
|
||||
/// </summary>
|
||||
/// <param name="dto"></param>
|
||||
/// <param name="staffId"></param>
|
||||
/// <param name="isTransaction"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<Result> Save(SaveInStockRequest dto, int staffId, bool isTransaction = true)
|
||||
private async Task<Result> Save(PurchaseShelfRequest dto, InstockType type, int staffId, bool isTransaction = true)
|
||||
{
|
||||
var entity = new InStock();
|
||||
entity.Type = (InstockType)dto.Type;
|
||||
entity.TaskId = dto.TaskId;
|
||||
entity.Type = type;
|
||||
entity.Details = _mapper.Map<List<InStockDetails>>(dto.Details);
|
||||
entity.Create(staffId);
|
||||
|
||||
|
||||
@@ -201,7 +201,7 @@ namespace WMS.Web.Repositories
|
||||
|
||||
var list = await query.Select(s => new InStockTaskBillNoQueryResponse()
|
||||
{
|
||||
Id=s.detail.Id,
|
||||
Id=s.order.Id,
|
||||
DetailsId=s.detail.Id,
|
||||
SourceBillNo=s.order.SourceBillNo,
|
||||
MaterialId=s.detail.MaterialId,
|
||||
|
||||
Reference in New Issue
Block a user