From f75aafdd3560685690eba04515068ab894f948d2 Mon Sep 17 00:00:00 2001
From: 18942506660 <18942506660@A18942506660>
Date: Sat, 28 Oct 2023 09:41:03 +0800
Subject: [PATCH] =?UTF-8?q?=E5=87=BA=E5=BA=93=E5=8D=95?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../Controllers/OutStockController.cs | 81 +++++++++++++++++++
.../Controllers/OutStockTaskController.cs | 18 +++++
.../Dto/OutStock/OutStockQueryInfoResponse.cs | 13 +++
.../Dto/OutStock/OutStockQueryRequest.cs | 13 +++
.../Dto/OutStock/SaveOutStockRequest.cs | 13 +++
.../IService/IOutStockService.cs | 13 +++
.../Infrastructure/IOutStockRepositories.cs | 3 +
.../Services/OutStockService.cs | 14 ++++
.../DependencyInjection/AppBuilder.cs | 2 +
.../OutStockRepositories.cs | 10 +++
10 files changed, 180 insertions(+)
create mode 100644 src/WMS.Web.Api/Controllers/OutStockController.cs
create mode 100644 src/WMS.Web.Api/Controllers/OutStockTaskController.cs
create mode 100644 src/WMS.Web.Core/Dto/OutStock/OutStockQueryInfoResponse.cs
create mode 100644 src/WMS.Web.Core/Dto/OutStock/OutStockQueryRequest.cs
create mode 100644 src/WMS.Web.Core/Dto/OutStock/SaveOutStockRequest.cs
create mode 100644 src/WMS.Web.Domain/IService/IOutStockService.cs
create mode 100644 src/WMS.Web.Domain/Services/OutStockService.cs
diff --git a/src/WMS.Web.Api/Controllers/OutStockController.cs b/src/WMS.Web.Api/Controllers/OutStockController.cs
new file mode 100644
index 00000000..c1cce1fe
--- /dev/null
+++ b/src/WMS.Web.Api/Controllers/OutStockController.cs
@@ -0,0 +1,81 @@
+using AutoMapper;
+using Microsoft.AspNetCore.Http;
+using Microsoft.AspNetCore.Mvc;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading.Tasks;
+using WMS.Web.Core.Dto.OutStock;
+using WMS.Web.Core.Internal.Results;
+using WMS.Web.Domain.Infrastructure;
+using WMS.Web.Domain.IService;
+using WMS.Web.Domain.IService.Public;
+using WMS.Web.Domain.Values;
+
+namespace WMS.Web.Api.Controllers
+{
+ ///
+ /// 出库单
+ ///
+ [Route("api/[controller]")]
+ [ApiController]
+ public class OutStockController : ControllerBase
+ {
+ private readonly IMapper _mapper;
+ private readonly ILoginService _loginService;
+ private readonly IOutStockRepositories _repositories;
+ private readonly IOutStockService _takeStockService;
+ public OutStockController(IMapper mapper, ILoginService loginService,
+ IOutStockRepositories repositories, IOutStockService takeStockService)
+ {
+ _mapper = mapper;
+ _loginService = loginService;
+ _repositories = repositories;
+ _takeStockService = takeStockService;
+ }
+ ///
+ /// 列表
+ ///
+ ///
+ ///
+ [HttpPost]
+ [Route("GetList")]
+ public async Task> GetPagedList([FromBody] OutStockQueryRequest dto)
+ {
+ var loginInfo = _loginService.GetLoginInfo(this.HttpContext.Request.Headers["Authorization"]);
+ if (loginInfo == null || loginInfo.UserInfo == null)
+ return ResultPagedList.ReFailure(ResultCodes.Token_Invalid_Error);
+
+ var (list, count) = await _repositories.GetListAsync(dto);
+ var result = ResultPagedList.ReSuccess(list, count);
+ return result;
+ }
+
+ ///
+ /// 保存
+ ///
+ ///
+ ///
+ [HttpPost]
+ [Route("Save")]
+ public async Task Save(List 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 _takeStockService.Save(dto, loginInfo);
+ }
+ ///
+ /// 同步金蝶
+ ///
+ ///
+ ///
+ [HttpGet]
+ [Route("Sync")]
+ public async Task Sync([FromRoute] int id)
+ {
+ return Result.ReSuccess();
+ }
+ }
+}
diff --git a/src/WMS.Web.Api/Controllers/OutStockTaskController.cs b/src/WMS.Web.Api/Controllers/OutStockTaskController.cs
new file mode 100644
index 00000000..43b34a51
--- /dev/null
+++ b/src/WMS.Web.Api/Controllers/OutStockTaskController.cs
@@ -0,0 +1,18 @@
+using Microsoft.AspNetCore.Http;
+using Microsoft.AspNetCore.Mvc;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading.Tasks;
+
+namespace WMS.Web.Api.Controllers
+{
+ ///
+ /// 出库计划单
+ ///
+ [Route("api/[controller]")]
+ [ApiController]
+ public class OutStockTaskController : ControllerBase
+ {
+ }
+}
diff --git a/src/WMS.Web.Core/Dto/OutStock/OutStockQueryInfoResponse.cs b/src/WMS.Web.Core/Dto/OutStock/OutStockQueryInfoResponse.cs
new file mode 100644
index 00000000..d7007b2e
--- /dev/null
+++ b/src/WMS.Web.Core/Dto/OutStock/OutStockQueryInfoResponse.cs
@@ -0,0 +1,13 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace WMS.Web.Core.Dto.OutStock
+{
+ ///
+ /// 出库列表详情
+ ///
+ public class OutStockQueryInfoResponse
+ {
+ }
+}
diff --git a/src/WMS.Web.Core/Dto/OutStock/OutStockQueryRequest.cs b/src/WMS.Web.Core/Dto/OutStock/OutStockQueryRequest.cs
new file mode 100644
index 00000000..f9a18c1b
--- /dev/null
+++ b/src/WMS.Web.Core/Dto/OutStock/OutStockQueryRequest.cs
@@ -0,0 +1,13 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace WMS.Web.Core.Dto.OutStock
+{
+ ///
+ /// 出库单列表请求
+ ///
+ public class OutStockQueryRequest : PaginationBaseRequestDto
+ {
+ }
+}
diff --git a/src/WMS.Web.Core/Dto/OutStock/SaveOutStockRequest.cs b/src/WMS.Web.Core/Dto/OutStock/SaveOutStockRequest.cs
new file mode 100644
index 00000000..da80c997
--- /dev/null
+++ b/src/WMS.Web.Core/Dto/OutStock/SaveOutStockRequest.cs
@@ -0,0 +1,13 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace WMS.Web.Core.Dto.OutStock
+{
+ ///
+ /// 出库单保存
+ ///
+ public class SaveOutStockRequest
+ {
+ }
+}
diff --git a/src/WMS.Web.Domain/IService/IOutStockService.cs b/src/WMS.Web.Domain/IService/IOutStockService.cs
new file mode 100644
index 00000000..2daa146a
--- /dev/null
+++ b/src/WMS.Web.Domain/IService/IOutStockService.cs
@@ -0,0 +1,13 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace WMS.Web.Domain.IService
+{
+ ///
+ /// 出库服务
+ ///
+ public interface IOutStockService
+ {
+ }
+}
diff --git a/src/WMS.Web.Domain/Infrastructure/IOutStockRepositories.cs b/src/WMS.Web.Domain/Infrastructure/IOutStockRepositories.cs
index 71369778..f6ec7a34 100644
--- a/src/WMS.Web.Domain/Infrastructure/IOutStockRepositories.cs
+++ b/src/WMS.Web.Domain/Infrastructure/IOutStockRepositories.cs
@@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
+using WMS.Web.Core.Dto.OutStock;
using WMS.Web.Domain.Entitys;
namespace WMS.Web.Domain.Infrastructure
@@ -10,5 +11,7 @@ namespace WMS.Web.Domain.Infrastructure
{
// 新增
Task Add(OutStock entity, bool isTransaction = true);
+ // 获取列表
+ Task<(List list, int total)> GetListAsync(OutStockQueryRequest dto);
}
}
diff --git a/src/WMS.Web.Domain/Services/OutStockService.cs b/src/WMS.Web.Domain/Services/OutStockService.cs
new file mode 100644
index 00000000..444daabb
--- /dev/null
+++ b/src/WMS.Web.Domain/Services/OutStockService.cs
@@ -0,0 +1,14 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using WMS.Web.Domain.IService;
+
+namespace WMS.Web.Domain.Services
+{
+ ///
+ /// 出库服务
+ ///
+ public class OutStockService: IOutStockService
+ {
+ }
+}
diff --git a/src/WMS.Web.Repositories/DependencyInjection/AppBuilder.cs b/src/WMS.Web.Repositories/DependencyInjection/AppBuilder.cs
index d1fa4aa0..6aa71384 100644
--- a/src/WMS.Web.Repositories/DependencyInjection/AppBuilder.cs
+++ b/src/WMS.Web.Repositories/DependencyInjection/AppBuilder.cs
@@ -236,6 +236,8 @@ namespace WMS.Web.Repositories.DependencyInjection
Services.AddTransient();
Services.AddTransient();
+ Services.AddTransient();
+
}
}
}
diff --git a/src/WMS.Web.Repositories/OutStockRepositories.cs b/src/WMS.Web.Repositories/OutStockRepositories.cs
index c5721bb3..c329f3cb 100644
--- a/src/WMS.Web.Repositories/OutStockRepositories.cs
+++ b/src/WMS.Web.Repositories/OutStockRepositories.cs
@@ -4,6 +4,7 @@ using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
+using WMS.Web.Core.Dto.OutStock;
using WMS.Web.Domain.Entitys;
using WMS.Web.Domain.Infrastructure;
using WMS.Web.Repositories.Configuration;
@@ -57,5 +58,14 @@ namespace WMS.Web.Repositories
}
}
+ ///
+ /// 列表
+ ///
+ ///
+ ///
+ public Task<(List list, int total)> GetListAsync(OutStockQueryRequest dto)
+ {
+ throw new NotImplementedException();
+ }
}
}