From ed5dc43e42c390e1e04838c3b388691ea580886c Mon Sep 17 00:00:00 2001 From: 18942506660 <18942506660@A18942506660> Date: Mon, 30 Oct 2023 15:22:03 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=93=E5=BA=93=E5=92=8C=E4=BB=93=E4=BD=8D?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/SysConfigController.cs | 42 ++++++- src/WMS.Web.Api/wwwroot/WMS.Web.Api.xml | 15 +++ src/WMS.Web.Api/wwwroot/WMS.Web.Core.xml | 105 +++++++++++++----- src/WMS.Web.Api/wwwroot/WMS.Web.Domain.xml | 13 +++ .../Dto/SingleData/NameRequest.cs | 25 +++++ .../Dto/SingleData/SubStockRequest.cs | 26 +++++ .../SysStaffResponse.cs | 2 +- .../Dto/SingleData/UcStockResponse.cs | 32 ++++++ .../Infrastructure/IBasicsRepositories.cs | 13 ++- .../BasicsRepositories.cs | 21 +++- 10 files changed, 260 insertions(+), 34 deletions(-) create mode 100644 src/WMS.Web.Core/Dto/SingleData/NameRequest.cs create mode 100644 src/WMS.Web.Core/Dto/SingleData/SubStockRequest.cs rename src/WMS.Web.Core/Dto/{Basics => SingleData}/SysStaffResponse.cs (95%) create mode 100644 src/WMS.Web.Core/Dto/SingleData/UcStockResponse.cs diff --git a/src/WMS.Web.Api/Controllers/SysConfigController.cs b/src/WMS.Web.Api/Controllers/SysConfigController.cs index 5fd87e7d..63dc72ad 100644 --- a/src/WMS.Web.Api/Controllers/SysConfigController.cs +++ b/src/WMS.Web.Api/Controllers/SysConfigController.cs @@ -6,7 +6,10 @@ using System.Linq; using System.Threading.Tasks; using WMS.Web.Core; using WMS.Web.Core.Dto; +using WMS.Web.Core.Dto.SingleData; using WMS.Web.Core.Internal.Results; +using WMS.Web.Domain.Infrastructure; +using WMS.Web.Domain.IService.Public; using WMS.Web.Domain.Values; namespace WMS.Web.Api.Controllers @@ -18,8 +21,12 @@ namespace WMS.Web.Api.Controllers [ApiController] public class SysConfigController : ControllerBase { - public SysConfigController() + private readonly ILoginService _loginService; + private readonly IBasicsRepositories _basicsRepositories; + public SysConfigController(ILoginService loginService, IBasicsRepositories basicsRepositories) { + _loginService = loginService; + _basicsRepositories = basicsRepositories; } /// @@ -51,5 +58,38 @@ namespace WMS.Web.Api.Controllers //1 return Task.FromResult(Result.ReSuccess(response)); } + + /// + /// 获取仓库 + /// + /// 仓库模糊匹配 不必填 + /// + [HttpGet] + [Route("GetUcStock")] + public async Task> GetUcStock([FromQuery] string name) + { + var loginInfo = _loginService.GetLoginInfo(this.HttpContext.Request.Headers["Authorization"]); + if (loginInfo == null || loginInfo.UserInfo == null) + return ResultList.ReFailure(ResultCodes.Token_Invalid_Error); + var r = await _basicsRepositories.GetUcStockAsync(name, loginInfo.UserInfo.CompanyId); + return ResultList.ReSuccess(r); + } + + /// + /// 根据仓库获取仓位 + /// + /// 仓库id + /// 仓库模糊匹配 不必填 + /// + [HttpGet] + [Route("GetSubUcStock/{id}")] + public async Task>> GetSubUcStock([FromRoute] int id, [FromQuery] string name) + { + var loginInfo = _loginService.GetLoginInfo(this.HttpContext.Request.Headers["Authorization"]); + if (loginInfo == null || loginInfo.UserInfo == null) + return Result>.ReFailure(ResultCodes.Token_Invalid_Error); + var r = await _basicsRepositories.GetSubUcStockAsync(id, name); + return Result>.ReSuccess(r); + } } } diff --git a/src/WMS.Web.Api/wwwroot/WMS.Web.Api.xml b/src/WMS.Web.Api/wwwroot/WMS.Web.Api.xml index 17126da2..8b90cabe 100644 --- a/src/WMS.Web.Api/wwwroot/WMS.Web.Api.xml +++ b/src/WMS.Web.Api/wwwroot/WMS.Web.Api.xml @@ -175,6 +175,21 @@ + + + 获取仓库 + + 仓库模糊匹配 不必填 + + + + + 根据仓库获取仓位 + + 仓库id + 仓库模糊匹配 不必填 + + 盘点单 diff --git a/src/WMS.Web.Api/wwwroot/WMS.Web.Core.xml b/src/WMS.Web.Api/wwwroot/WMS.Web.Core.xml index 7a3974e5..7d203781 100644 --- a/src/WMS.Web.Api/wwwroot/WMS.Web.Core.xml +++ b/src/WMS.Web.Api/wwwroot/WMS.Web.Core.xml @@ -85,36 +85,6 @@ - - - 员工响应 - - - - - StaffID - - - - - 名称 - - - - - 部门ID - - - - - 电话 - - - - - 是否禁用:true为禁用,false为启用 - - 改箱列表请求 @@ -1445,6 +1415,16 @@ 每页条数 不传默认每页10 条 + + + 名称请求对象 + + + + + 名称 + + 单点数据-请求统一对象 @@ -1485,6 +1465,71 @@ 是否禁用:true为禁用,false为启用 + + + 仓位 + + + + + 仓库ID + + + + + 员工响应 + + + + + StaffID + + + + + 名称 + + + + + 部门ID + + + + + 电话 + + + + + 是否禁用:true为禁用,false为启用 + + + + + 仓库响应 + + + + + id + + + + + 名称 + + + + + 编码 + + + + + 是否禁用:true为禁用,false为启用 + + 盘点单明细 diff --git a/src/WMS.Web.Api/wwwroot/WMS.Web.Domain.xml b/src/WMS.Web.Api/wwwroot/WMS.Web.Domain.xml index ebaf8f8c..b86e63ee 100644 --- a/src/WMS.Web.Api/wwwroot/WMS.Web.Domain.xml +++ b/src/WMS.Web.Api/wwwroot/WMS.Web.Domain.xml @@ -975,6 +975,19 @@ + + + 根据仓库获取子仓库 + + 仓库id + + + + + 获取仓库 + + + wms入库单-仓储接口 diff --git a/src/WMS.Web.Core/Dto/SingleData/NameRequest.cs b/src/WMS.Web.Core/Dto/SingleData/NameRequest.cs new file mode 100644 index 00000000..e0f1d7ac --- /dev/null +++ b/src/WMS.Web.Core/Dto/SingleData/NameRequest.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace WMS.Web.Core.Dto.SingleData +{ + /// + /// 名称请求对象 + /// + public class NameRequest:SingleDataRequest + { + public NameRequest() { } + + public NameRequest(string name,int companyId) + { + this.Name = name; + this.CompanyId = companyId; + } + + /// + /// 名称 + /// + public string Name { get; set; } + } +} diff --git a/src/WMS.Web.Core/Dto/SingleData/SubStockRequest.cs b/src/WMS.Web.Core/Dto/SingleData/SubStockRequest.cs new file mode 100644 index 00000000..1973b991 --- /dev/null +++ b/src/WMS.Web.Core/Dto/SingleData/SubStockRequest.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace WMS.Web.Core.Dto.SingleData +{ + /// + /// 仓位 + /// + public class SubStockRequest:NameRequest + { + + public SubStockRequest() { } + public SubStockRequest(int stockId,string name,int companyId) + { + this.StockId = stockId; + this.Name = name; + this.CompanyId = companyId; + } + + /// + /// 仓库ID + /// + public int StockId { get; set; } + } +} diff --git a/src/WMS.Web.Core/Dto/Basics/SysStaffResponse.cs b/src/WMS.Web.Core/Dto/SingleData/SysStaffResponse.cs similarity index 95% rename from src/WMS.Web.Core/Dto/Basics/SysStaffResponse.cs rename to src/WMS.Web.Core/Dto/SingleData/SysStaffResponse.cs index 4deab981..6dc1b790 100644 --- a/src/WMS.Web.Core/Dto/Basics/SysStaffResponse.cs +++ b/src/WMS.Web.Core/Dto/SingleData/SysStaffResponse.cs @@ -2,7 +2,7 @@ using System.Collections.Generic; using System.Text; -namespace WMS.Web.Core.Dto.Basics +namespace WMS.Web.Core.Dto.SingleData { /// /// 员工响应 diff --git a/src/WMS.Web.Core/Dto/SingleData/UcStockResponse.cs b/src/WMS.Web.Core/Dto/SingleData/UcStockResponse.cs new file mode 100644 index 00000000..80258981 --- /dev/null +++ b/src/WMS.Web.Core/Dto/SingleData/UcStockResponse.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations.Schema; +using System.Text; + +namespace WMS.Web.Core.Dto.SingleData +{ + /// + /// 仓库响应 + /// + public class UcStockResponse + { + /// + /// id + /// + public int Id { get; set; } + /// + /// 名称 + /// + public string Name { get; set; } + /// + /// 编码 + /// + public string Code { get; set; } + /// + /// 是否禁用:true为禁用,false为启用 + /// + public bool Disable { get; set; } + + + } +} diff --git a/src/WMS.Web.Domain/Infrastructure/IBasicsRepositories.cs b/src/WMS.Web.Domain/Infrastructure/IBasicsRepositories.cs index 8f515ad0..d059a4d0 100644 --- a/src/WMS.Web.Domain/Infrastructure/IBasicsRepositories.cs +++ b/src/WMS.Web.Domain/Infrastructure/IBasicsRepositories.cs @@ -2,7 +2,7 @@ using System.Collections.Generic; using System.Text; using System.Threading.Tasks; -using WMS.Web.Core.Dto.Basics; +using WMS.Web.Core.Dto.SingleData; namespace WMS.Web.Domain.Infrastructure { @@ -17,5 +17,16 @@ namespace WMS.Web.Domain.Infrastructure /// /// Task> GetStaffListAsync(int CompanyId); + /// + /// 根据仓库获取子仓库 + /// + /// 仓库id + /// + Task> GetSubUcStockAsync(int id, string name); + /// + /// 获取仓库 + /// + /// + Task> GetUcStockAsync(string name, int companyId); } } diff --git a/src/WMS.Web.Repositories/BasicsRepositories.cs b/src/WMS.Web.Repositories/BasicsRepositories.cs index a0a80e18..c73b0b20 100644 --- a/src/WMS.Web.Repositories/BasicsRepositories.cs +++ b/src/WMS.Web.Repositories/BasicsRepositories.cs @@ -4,7 +4,6 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using WMS.Web.Core.Dto.Basics; using WMS.Web.Core.Dto.SingleData; using WMS.Web.Core.Internal.Results; using WMS.Web.Domain.Infrastructure; @@ -50,5 +49,25 @@ namespace WMS.Web.Repositories return null; return result.Data.ToList(); } + + public async Task> GetSubUcStockAsync(int id, string name) + { + var result = await _singleDataService.GetSysConfigData, SubStockRequest> + (new SubStockRequest(id, name, _loginService.CompanyId), + SysConfigAction.GetWareouseByCustomerAndCompany); + if (!result.Success) + return null; + return result.Data.ToList(); + } + + public async Task> GetUcStockAsync(string name, int companyId) + { + var result = await _singleDataService.GetSysConfigData, NameRequest> + (new NameRequest(name, companyId), + SysConfigAction.GetWarehouseByNameAndCompany); + if (!result.Success) + return null; + return result.Data.ToList(); + } } }