From fd018555faf4d2b2ad200cd0034912291499697e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E6=B7=B3?= Date: Fri, 6 Jan 2023 15:40:46 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E9=87=87=E8=B4=AD=E8=AE=A2?= =?UTF-8?q?=E5=8D=95=E4=BE=9B=E5=BA=94=E5=95=86=E4=B8=8B=E6=8B=89=E5=88=97?= =?UTF-8?q?=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Config/SwaggerDoc.xml | 6 +++ .../Controllers/BBS/AgreeController.cs | 1 - .../Controllers/ERP/SupplierController.cs | 13 +++++ .../yi-sqlsugar-dev.db | Bin 286720 -> 286720 bytes .../ERP/Purchase/PurchaseGetListOutput.cs | 2 + .../ERP/Purchase/PurchaseCreateInput.cs | 2 + .../Yi.Framework.Model/Base/Entity.cs | 2 +- .../ERP/Entitys/PurchaseEntity.cs | 5 ++ .../Yi.Framework.Model.csproj | 2 +- .../ERP/PurchaseService.cs | 7 +-- .../CommonExtend/ServiceLocator.cs | 1 - Yi.Vue3.x.RuoYi/src/api/erp/supplierApi.js | 8 +++ .../src/views/ERP/purchase/index.vue | 51 +++++++++++++++--- 13 files changed, 85 insertions(+), 15 deletions(-) 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 2256c9276ca260b0c2068282d61fa1a90097b0af..508e029b9bf5fecc68a1e2d26a91869d1b27a207 100644 GIT binary patch delta 1877 zcmZux|7#m%7=Q1*>*bQ%-FxY}giuSf^-J9Bm)yN+zLjlkRYCSkp;IaZEpx%f`DGm& znM8M8R2<0IX3?z7p%$r*DhO5MZ!1L*e~A4-2U8}f*p4#hepvqipS$-ixw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S{|*NJyZk$VD%S8%-@(u9vz(Y^h* zJu{nvAxAiaD8o|*{_}j3`I2}ec-6TpxUD&Va31HFz!A?L%Av<5%dW)A!TO1rf#oK{ zQ>KfP1qC*5H%MYGV&?$b48jc4=UX!wZoiz#oWZ#LhBcEjBa5{joA~qqTPDlx71_)k FUjXq{OZET& 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 @@ -