添加供应商定义模块
This commit is contained in:
@@ -181,12 +181,40 @@
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Yi.Framework.ApiMicroservice.Controllers.ERP.SupplierController.GetList">
|
||||
<member name="M:Yi.Framework.ApiMicroservice.Controllers.ERP.SupplierController.PageList(Yi.Framework.DtoModel.ERP.Supplier.SupplierCreateUpdateInput,Yi.Framework.Common.Models.PageParModel)">
|
||||
<summary>
|
||||
查
|
||||
分页查
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Yi.Framework.ApiMicroservice.Controllers.ERP.SupplierController.GetById(System.Int64)">
|
||||
<summary>
|
||||
单查
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Yi.Framework.ApiMicroservice.Controllers.ERP.SupplierController.Create(Yi.Framework.DtoModel.ERP.Supplier.SupplierCreateUpdateInput)">
|
||||
<summary>
|
||||
增
|
||||
</summary>
|
||||
<param name="input"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Yi.Framework.ApiMicroservice.Controllers.ERP.SupplierController.Update(System.Int64,Yi.Framework.DtoModel.ERP.Supplier.SupplierCreateUpdateInput)">
|
||||
<summary>
|
||||
更
|
||||
</summary>
|
||||
<param name="id"></param>
|
||||
<param name="input"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Yi.Framework.ApiMicroservice.Controllers.ERP.SupplierController.Del(System.Collections.Generic.List{System.Int64})">
|
||||
<summary>
|
||||
删
|
||||
</summary>
|
||||
<param name="ids"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="T:Yi.Framework.ApiMicroservice.Controllers.AccountController">
|
||||
<summary>
|
||||
账户管理
|
||||
|
||||
@@ -7,8 +7,8 @@ using Yi.Framework.Interface.ERP;
|
||||
namespace Yi.Framework.ApiMicroservice.Controllers.ERP
|
||||
{
|
||||
[ApiController]
|
||||
[Route("[controller]")]
|
||||
public class SupplierController:ControllerBase
|
||||
[Route("api/[controller]/[action]")]
|
||||
public class SupplierController : ControllerBase
|
||||
{
|
||||
private readonly ILogger<SupplierController> _logger;
|
||||
private readonly ISupplierService _supplierService;
|
||||
@@ -19,15 +19,64 @@ namespace Yi.Framework.ApiMicroservice.Controllers.ERP
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查
|
||||
/// 分页查
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
public async Task<Result<List<SupplierGetListOutput>>> GetList()
|
||||
public async Task<Result> PageList([FromQuery] SupplierCreateUpdateInput input, [FromQuery] PageParModel page)
|
||||
{
|
||||
var result = await _supplierService.GetListAsync();
|
||||
var result = await _supplierService.PageListAsync(input, page);
|
||||
return Result.Success().SetData(result);
|
||||
}
|
||||
|
||||
return Result<List<SupplierGetListOutput>>.Success().SetData(result);
|
||||
/// <summary>
|
||||
/// 单查
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
[Route("{id}")]
|
||||
public async Task<Result> GetById(long id)
|
||||
{
|
||||
var result = await _supplierService.GetByIdAsync(id);
|
||||
return Result.Success().SetData(result);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 增
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<Result> Create(SupplierCreateUpdateInput input)
|
||||
{
|
||||
var result = await _supplierService.CreateAsync(input);
|
||||
return Result.Success().SetData(result);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 更
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPut]
|
||||
[Route("{id}")]
|
||||
public async Task<Result> Update(long id, SupplierCreateUpdateInput input)
|
||||
{
|
||||
var result = await _supplierService.UpdateAsync(id, input);
|
||||
return Result.Success().SetData(result);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 删
|
||||
/// </summary>
|
||||
/// <param name="ids"></param>
|
||||
/// <returns></returns>
|
||||
[HttpDelete]
|
||||
public async Task<Result> Del(List<long> ids)
|
||||
{
|
||||
await _supplierService.DeleteAsync(ids);
|
||||
return Result.Success();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Binary file not shown.
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Yi.Framework.Common.Models;
|
||||
using Yi.Framework.DtoModel.ERP.Supplier;
|
||||
using Yi.Framework.Interface.Base.Crud;
|
||||
|
||||
@@ -10,6 +11,6 @@ namespace Yi.Framework.Interface.ERP
|
||||
{
|
||||
public interface ISupplierService : ICrudAppService<SupplierGetListOutput, long, SupplierCreateUpdateInput>
|
||||
{
|
||||
Task<List<SupplierGetListOutput>> GetListAsync();
|
||||
Task<PageModel<List<SupplierGetListOutput>>> PageListAsync(SupplierCreateUpdateInput input, PageParModel page);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ namespace Yi.Framework.Model.RABC.SeedData
|
||||
{
|
||||
Id = SnowFlakeSingle.Instance.NextId(),
|
||||
DictLabel = "显示",
|
||||
DictValue = "0",
|
||||
DictValue = "true",
|
||||
DictType = "sys_show_hide",
|
||||
OrderNum = 100,
|
||||
Remark = "显示菜单",
|
||||
@@ -66,7 +66,7 @@ namespace Yi.Framework.Model.RABC.SeedData
|
||||
{
|
||||
Id = SnowFlakeSingle.Instance.NextId(),
|
||||
DictLabel = "隐藏",
|
||||
DictValue = "1",
|
||||
DictValue = "false",
|
||||
DictType = "sys_show_hide",
|
||||
OrderNum = 99,
|
||||
Remark = "隐藏菜单",
|
||||
|
||||
@@ -6,10 +6,6 @@
|
||||
<Nullable>disable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.AspNetCore.Http.Abstractions" Version="2.2.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Yi.Framework.Model\Yi.Framework.Model.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
@@ -68,7 +68,8 @@ namespace Yi.Framework.Service.Base.Crud
|
||||
|
||||
TryToSetTenantId(entity);
|
||||
|
||||
await Repository.InsertAsync(entity);
|
||||
//这边需要进行判断,实体是什么guid还是雪花id
|
||||
await Repository.InsertReturnSnowflakeIdAsync(entity);
|
||||
|
||||
var entitydto = await MapToGetOutputDtoAsync(entity);
|
||||
return entitydto;
|
||||
@@ -80,7 +81,7 @@ namespace Yi.Framework.Service.Base.Crud
|
||||
/// <param name="ids"></param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="NotImplementedException"></exception>
|
||||
public virtual Task DeleteAsync(IEnumerable<TKey> ids)
|
||||
public virtual Task DeleteAsync(IEnumerable<TKey> ids)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
@@ -110,7 +111,7 @@ namespace Yi.Framework.Service.Base.Crud
|
||||
/// <param name="idEntity"></param>
|
||||
/// <param name="dto"></param>
|
||||
/// <returns></returns>
|
||||
protected virtual Task UpdateValidAsync(TEntity idEntity, TUpdateInput dto)
|
||||
protected virtual Task UpdateValidAsync(TEntity idEntity, TUpdateInput dto)
|
||||
{
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
using AutoMapper;
|
||||
using SqlSugar;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Yi.Framework.Common.Models;
|
||||
using Yi.Framework.DtoModel.ERP.Supplier;
|
||||
using Yi.Framework.Interface.ERP;
|
||||
using Yi.Framework.Model.ERP.Entitys;
|
||||
@@ -17,10 +19,14 @@ namespace Yi.Framework.Service.ERP
|
||||
public SupplierService(IRepository<SupplierEntity> repository, IMapper mapper) : base(repository, mapper)
|
||||
{
|
||||
}
|
||||
|
||||
public async Task<List<SupplierGetListOutput>> GetListAsync()
|
||||
public async Task<PageModel<List<SupplierGetListOutput>>> PageListAsync(SupplierCreateUpdateInput input, PageParModel page)
|
||||
{
|
||||
return await MapToGetListOutputDtosAsync(await Repository.GetListAsync());
|
||||
RefAsync<int> totalNumber = 0;
|
||||
var data = await Repository._DbQueryable
|
||||
.WhereIF(input.Code is not null,u=>u.Code.Contains(input.Code))
|
||||
.WhereIF(input.Name is not null, u => u.Name.Contains(input.Name))
|
||||
.ToPageListAsync(page.PageNum, page.PageSize, totalNumber);
|
||||
return new PageModel<List<SupplierGetListOutput>> { Total = totalNumber.Value, Data = await MapToGetListOutputDtosAsync(data) };
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -118,6 +118,7 @@ namespace Yi.Framework.WebCore.AspNetCoreExtensions
|
||||
{
|
||||
sb.Append($"\r\n参数:{i.ParameterName},参数值:{i.Value}");
|
||||
}
|
||||
sb.Append( $"\r\n 完整SQL:{UtilMethods.GetSqlString(DbType.MySql, s, p)}");
|
||||
_logger?.LogInformation(sb.ToString());
|
||||
}
|
||||
|
||||
|
||||
@@ -19,11 +19,12 @@ namespace Yi.Framework.WebCore.MiddlewareExtend
|
||||
public class ErrorHandExtension
|
||||
{
|
||||
private readonly RequestDelegate next;
|
||||
private readonly ILogger<ErrorHandExtension> _logger;
|
||||
//private readonly IErrorHandle _errorHandle;
|
||||
public ErrorHandExtension(RequestDelegate next/*, IErrorHandle errorHandle*/)
|
||||
public ErrorHandExtension(RequestDelegate next, ILoggerFactory loggerFactory /*, IErrorHandle errorHandle*/)
|
||||
{
|
||||
this.next = next;
|
||||
//this._logger = loggerFactory.CreateLogger<ErrorHandExtension>();
|
||||
this._logger = loggerFactory.CreateLogger<ErrorHandExtension>();
|
||||
//_errorHandle = errorHandle;
|
||||
}
|
||||
|
||||
@@ -40,6 +41,7 @@ namespace Yi.Framework.WebCore.MiddlewareExtend
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError("系统错误",ex);
|
||||
//await _errorHandle.Invoer(context, ex);
|
||||
var statusCode = context.Response.StatusCode;
|
||||
if (ex is ArgumentException)
|
||||
|
||||
Reference in New Issue
Block a user