添加供应商定义模块
This commit is contained in:
@@ -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) };
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user