diff --git a/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/Config/SwaggerDoc.xml b/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/Config/SwaggerDoc.xml index 5dcfb119..8651f6b6 100644 --- a/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/Config/SwaggerDoc.xml +++ b/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/Config/SwaggerDoc.xml @@ -283,6 +283,12 @@ + + + 全查 + + + 分页查 diff --git a/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/Controllers/BBS/AgreeController.cs b/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/Controllers/BBS/AgreeController.cs index e76c7a02..78796c5e 100644 --- a/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/Controllers/BBS/AgreeController.cs +++ b/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/Controllers/BBS/AgreeController.cs @@ -1,7 +1,6 @@ using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Logging; -using Org.BouncyCastle.Asn1.IsisMtt.X509; using System; using System.Collections.Generic; using System.Linq; diff --git a/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/Controllers/ERP/SupplierController.cs b/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/Controllers/ERP/SupplierController.cs index a0a9481f..5096e3b0 100644 --- a/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/Controllers/ERP/SupplierController.cs +++ b/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/Controllers/ERP/SupplierController.cs @@ -2,6 +2,7 @@ using Microsoft.AspNetCore.Mvc; using Yi.Framework.Common.Models; using Yi.Framework.DtoModel.ERP.Supplier; using Yi.Framework.Interface.ERP; +using Yi.Framework.Service.ERP; namespace Yi.Framework.ApiMicroservice.Controllers.ERP { @@ -17,6 +18,18 @@ namespace Yi.Framework.ApiMicroservice.Controllers.ERP _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.ApiMicroservice/yi-sqlsugar-dev.db b/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/yi-sqlsugar-dev.db index 2256c927..508e029b 100644 Binary files a/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/yi-sqlsugar-dev.db and b/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/yi-sqlsugar-dev.db differ diff --git a/Yi.Framework.Net6/Yi.Framework.DTOModel/ERP/Purchase/PurchaseGetListOutput.cs b/Yi.Framework.Net6/Yi.Framework.DTOModel/ERP/Purchase/PurchaseGetListOutput.cs index f7ecdfdf..241b623e 100644 --- a/Yi.Framework.Net6/Yi.Framework.DTOModel/ERP/Purchase/PurchaseGetListOutput.cs +++ b/Yi.Framework.Net6/Yi.Framework.DTOModel/ERP/Purchase/PurchaseGetListOutput.cs @@ -15,6 +15,8 @@ namespace Yi.Framework.DtoModel.ERP.Purchase public string Buyer { get; set; } = string.Empty; public long TotalMoney { get; set; } public long PaidMoney { get; set; } + + public string SupplierName { get; set; } = string.Empty; public PurchaseStateEnum PurchaseState { get; set; } } } diff --git a/Yi.Framework.Net6/Yi.Framework.DtoModel/ERP/Purchase/PurchaseCreateInput.cs b/Yi.Framework.Net6/Yi.Framework.DtoModel/ERP/Purchase/PurchaseCreateInput.cs index 8317359a..7de37c45 100644 --- a/Yi.Framework.Net6/Yi.Framework.DtoModel/ERP/Purchase/PurchaseCreateInput.cs +++ b/Yi.Framework.Net6/Yi.Framework.DtoModel/ERP/Purchase/PurchaseCreateInput.cs @@ -16,6 +16,8 @@ namespace Yi.Framework.DtoModel.ERP.Purchase public DateTime? NeedTime { get; set; } public string Buyer { get; set; } = string.Empty; + public long SupplierId { get; set; } + public List? PurchaseDetails { get; set; } } } diff --git a/Yi.Framework.Net6/Yi.Framework.Model/Base/Entity.cs b/Yi.Framework.Net6/Yi.Framework.Model/Base/Entity.cs index 6775a079..6d6fb88d 100644 --- a/Yi.Framework.Net6/Yi.Framework.Model/Base/Entity.cs +++ b/Yi.Framework.Net6/Yi.Framework.Model/Base/Entity.cs @@ -8,7 +8,7 @@ namespace Yi.Framework.Model.Base { public class Entity : IEntity { - public Key Id { get; set; }=default(Key)!; + public Key Id { get; set; } public object[] GetKeys() { diff --git a/Yi.Framework.Net6/Yi.Framework.Model/ERP/Entitys/PurchaseEntity.cs b/Yi.Framework.Net6/Yi.Framework.Model/ERP/Entitys/PurchaseEntity.cs index cce541b0..7a9dffc4 100644 --- a/Yi.Framework.Net6/Yi.Framework.Model/ERP/Entitys/PurchaseEntity.cs +++ b/Yi.Framework.Net6/Yi.Framework.Model/ERP/Entitys/PurchaseEntity.cs @@ -27,6 +27,11 @@ namespace Yi.Framework.Model.ERP.Entitys /// public Guid? TenantId { get; set; } + /// + /// 供应商id + /// + public long SupplierId { get; set; } + /// /// 采购单号 /// diff --git a/Yi.Framework.Net6/Yi.Framework.Model/Yi.Framework.Model.csproj b/Yi.Framework.Net6/Yi.Framework.Model/Yi.Framework.Model.csproj index 65794c4f..fae07b7d 100644 --- a/Yi.Framework.Net6/Yi.Framework.Model/Yi.Framework.Model.csproj +++ b/Yi.Framework.Net6/Yi.Framework.Model/Yi.Framework.Model.csproj @@ -15,7 +15,7 @@ - + diff --git a/Yi.Framework.Net6/Yi.Framework.Service/ERP/PurchaseService.cs b/Yi.Framework.Net6/Yi.Framework.Service/ERP/PurchaseService.cs index be10575f..782319ec 100644 --- a/Yi.Framework.Net6/Yi.Framework.Service/ERP/PurchaseService.cs +++ b/Yi.Framework.Net6/Yi.Framework.Service/ERP/PurchaseService.cs @@ -30,10 +30,11 @@ namespace Yi.Framework.Service.ERP { RefAsync 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)) + .LeftJoin((p, s) => p.SupplierId == s.Id) + .WhereIF(input.Code is not null, u => u.Code.Contains(input.Code)) + .Select((p, s) => new PurchaseGetListOutput { SupplierName = s.Name },true) .ToPageListAsync(page.PageNum, page.PageSize, totalNumber); - return new PageModel> { Total = totalNumber.Value, Data = await MapToGetListOutputDtosAsync(data) }; + return new PageModel> { Total = totalNumber.Value, Data = data }; } public override async Task CreateAsync(PurchaseCreateInput input) diff --git a/Yi.Framework.Net6/Yi.Framework.WebCore/CommonExtend/ServiceLocator.cs b/Yi.Framework.Net6/Yi.Framework.WebCore/CommonExtend/ServiceLocator.cs index dc63df14..99f328a5 100644 --- a/Yi.Framework.Net6/Yi.Framework.WebCore/CommonExtend/ServiceLocator.cs +++ b/Yi.Framework.Net6/Yi.Framework.WebCore/CommonExtend/ServiceLocator.cs @@ -1,7 +1,6 @@ using Microsoft.AspNetCore.Http; using Microsoft.Extensions.DependencyInjection; using System; -using Ubiety.Dns.Core.Common; namespace Yi.Framework.WebCore.CommonExtend { diff --git a/Yi.Vue3.x.RuoYi/src/api/erp/supplierApi.js b/Yi.Vue3.x.RuoYi/src/api/erp/supplierApi.js index 8694b055..72dec607 100644 --- a/Yi.Vue3.x.RuoYi/src/api/erp/supplierApi.js +++ b/Yi.Vue3.x.RuoYi/src/api/erp/supplierApi.js @@ -1,5 +1,13 @@ import request from '@/utils/request' +// 全查询 +export function allData() { + return request({ + url: '/supplier/getList', + method: 'get' + }) +} + // 分页查询 export function listData(query) { return request({ diff --git a/Yi.Vue3.x.RuoYi/src/views/ERP/purchase/index.vue b/Yi.Vue3.x.RuoYi/src/views/ERP/purchase/index.vue index 41697b5c..e2d28b26 100644 --- a/Yi.Vue3.x.RuoYi/src/views/ERP/purchase/index.vue +++ b/Yi.Vue3.x.RuoYi/src/views/ERP/purchase/index.vue @@ -70,7 +70,7 @@ - + @@ -136,9 +136,22 @@ - - - + + + + + + + + + + + @@ -166,11 +179,11 @@ -