添加供应商
This commit is contained in:
@@ -181,6 +181,12 @@
|
|||||||
</summary>
|
</summary>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="M:Yi.Framework.ApiMicroservice.Controllers.ERP.SupplierController.GetList">
|
||||||
|
<summary>
|
||||||
|
查
|
||||||
|
</summary>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
<member name="T:Yi.Framework.ApiMicroservice.Controllers.AccountController">
|
<member name="T:Yi.Framework.ApiMicroservice.Controllers.AccountController">
|
||||||
<summary>
|
<summary>
|
||||||
账户管理
|
账户管理
|
||||||
|
|||||||
@@ -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<SupplierController> _logger;
|
||||||
|
private readonly ISupplierService _supplierService;
|
||||||
|
public SupplierController(ILogger<SupplierController> logger, ISupplierService supplierService)
|
||||||
|
{
|
||||||
|
_logger = logger;
|
||||||
|
_supplierService = supplierService;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 查
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpGet]
|
||||||
|
public async Task<Result<List<SupplierGetListOutput>>> GetList()
|
||||||
|
{
|
||||||
|
var result = await _supplierService.GetListAsync();
|
||||||
|
|
||||||
|
return Result<List<SupplierGetListOutput>>.Success().SetData(result);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -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
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -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<SupplierCreateUpdateInput, SupplierEntity>();
|
||||||
|
CreateMap<SupplierEntity, SupplierGetListOutput>();
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -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<long>
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 供应商编码
|
||||||
|
/// </summary>
|
||||||
|
public string Code { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 供应商名称
|
||||||
|
/// </summary>
|
||||||
|
public string Name { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 供应商地址
|
||||||
|
/// </summary>
|
||||||
|
public string Address { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 电话
|
||||||
|
/// </summary>
|
||||||
|
public long Phone { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 传真
|
||||||
|
/// </summary>
|
||||||
|
public string Fax { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 邮箱
|
||||||
|
/// </summary>
|
||||||
|
public string Email { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -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<long>
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 供应商编码
|
||||||
|
/// </summary>
|
||||||
|
public string Code { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 供应商名称
|
||||||
|
/// </summary>
|
||||||
|
public string Name { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 供应商地址
|
||||||
|
/// </summary>
|
||||||
|
public string Address { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 电话
|
||||||
|
/// </summary>
|
||||||
|
public long Phone { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 传真
|
||||||
|
/// </summary>
|
||||||
|
public string Fax { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 邮箱
|
||||||
|
/// </summary>
|
||||||
|
public string Email { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -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<SupplierGetListOutput, long, SupplierCreateUpdateInput>
|
||||||
|
{
|
||||||
|
Task<List<SupplierGetListOutput>> GetListAsync();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -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<SupplierEntity, SupplierGetListOutput, long, SupplierCreateUpdateInput>, ISupplierService
|
||||||
|
{
|
||||||
|
public SupplierService(IRepository<SupplierEntity> repository, IMapper mapper) : base(repository, mapper)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<List<SupplierGetListOutput>> GetListAsync()
|
||||||
|
{
|
||||||
|
return await MapToGetListOutputDtosAsync(await Repository.GetListAsync());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user