From 714d1a36c4031b1e4557020f17dc5cb78859696b Mon Sep 17 00:00:00 2001
From: chenchun <454313500@qq.com>
Date: Mon, 2 Jan 2023 17:27:12 +0800
Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=BE=9B=E5=BA=94=E5=95=86?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../Config/SwaggerDoc.xml | 6 +++
.../Controllers/ERP/SupplierController.cs | 33 +++++++++++++++
.../ERP/Supplier/ConstConfig/SupplierConst.cs | 12 ++++++
.../Supplier/MapperConfig/SupplierProfile.cs | 20 +++++++++
.../ERP/Supplier/SupplierCreateUpdateInput.cs | 41 +++++++++++++++++++
.../ERP/Supplier/SupplierGetListOutput.cs | 40 ++++++++++++++++++
.../ERP/ISupplierService.cs | 15 +++++++
.../ERP/SupplierService.cs | 26 ++++++++++++
8 files changed, 193 insertions(+)
create mode 100644 Yi.Framework.Net6/Yi.Framework.ApiMicroservice/Controllers/ERP/SupplierController.cs
create mode 100644 Yi.Framework.Net6/Yi.Framework.DtoModel/ERP/Supplier/ConstConfig/SupplierConst.cs
create mode 100644 Yi.Framework.Net6/Yi.Framework.DtoModel/ERP/Supplier/MapperConfig/SupplierProfile.cs
create mode 100644 Yi.Framework.Net6/Yi.Framework.DtoModel/ERP/Supplier/SupplierCreateUpdateInput.cs
create mode 100644 Yi.Framework.Net6/Yi.Framework.DtoModel/ERP/Supplier/SupplierGetListOutput.cs
create mode 100644 Yi.Framework.Net6/Yi.Framework.Interface/ERP/ISupplierService.cs
create mode 100644 Yi.Framework.Net6/Yi.Framework.Service/ERP/SupplierService.cs
diff --git a/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/Config/SwaggerDoc.xml b/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/Config/SwaggerDoc.xml
index 7842f01f..e936bdbf 100644
--- a/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/Config/SwaggerDoc.xml
+++ b/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/Config/SwaggerDoc.xml
@@ -181,6 +181,12 @@
+
+
+ 查
+
+
+
账户管理
diff --git a/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/Controllers/ERP/SupplierController.cs b/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/Controllers/ERP/SupplierController.cs
new file mode 100644
index 00000000..0d6f5b00
--- /dev/null
+++ b/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/Controllers/ERP/SupplierController.cs
@@ -0,0 +1,33 @@
+using Brick.IFServer.Controllers;
+using Microsoft.AspNetCore.Mvc;
+using Yi.Framework.Common.Models;
+using Yi.Framework.DtoModel.ERP.Supplier;
+using Yi.Framework.Interface.ERP;
+
+namespace Yi.Framework.ApiMicroservice.Controllers.ERP
+{
+ [ApiController]
+ [Route("[controller]")]
+ public class SupplierController:ControllerBase
+ {
+ private readonly ILogger _logger;
+ private readonly ISupplierService _supplierService;
+ public SupplierController(ILogger logger, ISupplierService supplierService)
+ {
+ _logger = logger;
+ _supplierService = supplierService;
+ }
+
+ ///
+ /// 查
+ ///
+ ///
+ [HttpGet]
+ public async Task>> GetList()
+ {
+ var result = await _supplierService.GetListAsync();
+
+ return Result>.Success().SetData(result);
+ }
+ }
+}
diff --git a/Yi.Framework.Net6/Yi.Framework.DtoModel/ERP/Supplier/ConstConfig/SupplierConst.cs b/Yi.Framework.Net6/Yi.Framework.DtoModel/ERP/Supplier/ConstConfig/SupplierConst.cs
new file mode 100644
index 00000000..a923042a
--- /dev/null
+++ b/Yi.Framework.Net6/Yi.Framework.DtoModel/ERP/Supplier/ConstConfig/SupplierConst.cs
@@ -0,0 +1,12 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Yi.Framework.DtoModel.ERP.Supplier.ConstConfig
+{
+ public class SupplierConst
+ {
+ }
+}
diff --git a/Yi.Framework.Net6/Yi.Framework.DtoModel/ERP/Supplier/MapperConfig/SupplierProfile.cs b/Yi.Framework.Net6/Yi.Framework.DtoModel/ERP/Supplier/MapperConfig/SupplierProfile.cs
new file mode 100644
index 00000000..decb6804
--- /dev/null
+++ b/Yi.Framework.Net6/Yi.Framework.DtoModel/ERP/Supplier/MapperConfig/SupplierProfile.cs
@@ -0,0 +1,20 @@
+using AutoMapper;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Yi.Framework.Model.ERP.Entitys;
+
+namespace Yi.Framework.DtoModel.ERP.Supplier.MapperConfig
+{
+ public class SupplierProfile:Profile
+ {
+ public SupplierProfile()
+ {
+ CreateMap();
+ CreateMap();
+
+ }
+ }
+}
diff --git a/Yi.Framework.Net6/Yi.Framework.DtoModel/ERP/Supplier/SupplierCreateUpdateInput.cs b/Yi.Framework.Net6/Yi.Framework.DtoModel/ERP/Supplier/SupplierCreateUpdateInput.cs
new file mode 100644
index 00000000..abbac95e
--- /dev/null
+++ b/Yi.Framework.Net6/Yi.Framework.DtoModel/ERP/Supplier/SupplierCreateUpdateInput.cs
@@ -0,0 +1,41 @@
+using SqlSugar;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Yi.Framework.Model.Base;
+
+namespace Yi.Framework.DtoModel.ERP.Supplier
+{
+ public class SupplierCreateUpdateInput : EntityDto
+ {
+ ///
+ /// 供应商编码
+ ///
+ public string Code { get; set; }
+
+ ///
+ /// 供应商名称
+ ///
+ public string Name { get; set; }
+
+ ///
+ /// 供应商地址
+ ///
+ public string Address { get; set; }
+
+ ///
+ /// 电话
+ ///
+ public long Phone { get; set; }
+ ///
+ /// 传真
+ ///
+ public string Fax { get; set; }
+ ///
+ /// 邮箱
+ ///
+ public string Email { get; set; }
+ }
+}
diff --git a/Yi.Framework.Net6/Yi.Framework.DtoModel/ERP/Supplier/SupplierGetListOutput.cs b/Yi.Framework.Net6/Yi.Framework.DtoModel/ERP/Supplier/SupplierGetListOutput.cs
new file mode 100644
index 00000000..7513c005
--- /dev/null
+++ b/Yi.Framework.Net6/Yi.Framework.DtoModel/ERP/Supplier/SupplierGetListOutput.cs
@@ -0,0 +1,40 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Yi.Framework.Model.Base;
+
+namespace Yi.Framework.DtoModel.ERP.Supplier
+{
+ public class SupplierGetListOutput: EntityDto
+ {
+ ///
+ /// 供应商编码
+ ///
+ public string Code { get; set; }
+
+ ///
+ /// 供应商名称
+ ///
+ public string Name { get; set; }
+
+ ///
+ /// 供应商地址
+ ///
+ public string Address { get; set; }
+
+ ///
+ /// 电话
+ ///
+ public long Phone { get; set; }
+ ///
+ /// 传真
+ ///
+ public string Fax { get; set; }
+ ///
+ /// 邮箱
+ ///
+ public string Email { get; set; }
+ }
+}
diff --git a/Yi.Framework.Net6/Yi.Framework.Interface/ERP/ISupplierService.cs b/Yi.Framework.Net6/Yi.Framework.Interface/ERP/ISupplierService.cs
new file mode 100644
index 00000000..8e0d9f3b
--- /dev/null
+++ b/Yi.Framework.Net6/Yi.Framework.Interface/ERP/ISupplierService.cs
@@ -0,0 +1,15 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Yi.Framework.DtoModel.ERP.Supplier;
+using Yi.Framework.Interface.Base.Crud;
+
+namespace Yi.Framework.Interface.ERP
+{
+ public interface ISupplierService : ICrudAppService
+ {
+ Task> GetListAsync();
+ }
+}
diff --git a/Yi.Framework.Net6/Yi.Framework.Service/ERP/SupplierService.cs b/Yi.Framework.Net6/Yi.Framework.Service/ERP/SupplierService.cs
new file mode 100644
index 00000000..fbd94364
--- /dev/null
+++ b/Yi.Framework.Net6/Yi.Framework.Service/ERP/SupplierService.cs
@@ -0,0 +1,26 @@
+using AutoMapper;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Yi.Framework.DtoModel.ERP.Supplier;
+using Yi.Framework.Interface.ERP;
+using Yi.Framework.Model.ERP.Entitys;
+using Yi.Framework.Repository;
+using Yi.Framework.Service.Base.Crud;
+
+namespace Yi.Framework.Service.ERP
+{
+ public class SupplierService : CrudAppService, ISupplierService
+ {
+ public SupplierService(IRepository repository, IMapper mapper) : base(repository, mapper)
+ {
+ }
+
+ public async Task> GetListAsync()
+ {
+ return await MapToGetListOutputDtosAsync(await Repository.GetListAsync());
+ }
+ }
+}