From fc4fc7ed3f566196b91e2807699f50d42a056152 Mon Sep 17 00:00:00 2001 From: zhou keda <1315948824@qq.com> Date: Wed, 9 Oct 2024 13:42:39 +0800 Subject: [PATCH] =?UTF-8?q?erp=E7=A0=94=E5=8F=91=E9=A1=B9=E7=9B=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Entity/ErpEntity/ErpBdProject.cs | 12 +++++++ .../IErpInfoService.cs | 11 ++++++ .../Tnb.ProductionMgr/ErpInfoService.cs | 35 +++++++++++++++++++ 3 files changed, 58 insertions(+) create mode 100644 ProductionMgr/Tnb.ProductionMgr.Entities/Entity/ErpEntity/ErpBdProject.cs create mode 100644 ProductionMgr/Tnb.ProductionMgr.Interfaces/IErpInfoService.cs create mode 100644 ProductionMgr/Tnb.ProductionMgr/ErpInfoService.cs diff --git a/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/ErpEntity/ErpBdProject.cs b/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/ErpEntity/ErpBdProject.cs new file mode 100644 index 00000000..a59adf4f --- /dev/null +++ b/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/ErpEntity/ErpBdProject.cs @@ -0,0 +1,12 @@ +using SqlSugar; + +namespace Tnb.ProductionMgr.Entities.Entity.ErpEntity +{ + [SugarTable("ERP_BD_PROJECT")] + public class ErpBdProject + { + public string ID { get; set; } + public string CODE { get; set; } + public string NAME { get; set; } + } +} \ No newline at end of file diff --git a/ProductionMgr/Tnb.ProductionMgr.Interfaces/IErpInfoService.cs b/ProductionMgr/Tnb.ProductionMgr.Interfaces/IErpInfoService.cs new file mode 100644 index 00000000..a781b55f --- /dev/null +++ b/ProductionMgr/Tnb.ProductionMgr.Interfaces/IErpInfoService.cs @@ -0,0 +1,11 @@ +namespace Tnb.ProductionMgr.Interfaces +{ + public interface IErpInfoService + { + /// + /// 获取研发项目 + /// + /// + public Task GetProjects(); + } +} \ No newline at end of file diff --git a/ProductionMgr/Tnb.ProductionMgr/ErpInfoService.cs b/ProductionMgr/Tnb.ProductionMgr/ErpInfoService.cs new file mode 100644 index 00000000..900b9f74 --- /dev/null +++ b/ProductionMgr/Tnb.ProductionMgr/ErpInfoService.cs @@ -0,0 +1,35 @@ +using JNPF.Common.Core.Manager; +using JNPF.DependencyInjection; +using JNPF.DynamicApiController; +using JNPF.Systems.Interfaces.System; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using SqlSugar; +using Tnb.BasicData.Entities; +using Tnb.ProductionMgr.Entities.Entity.ErpEntity; +using Tnb.ProductionMgr.Interfaces; + +namespace Tnb.ProductionMgr +{ + [ApiDescriptionSettings(Tag = ModuleConst.Tag, Area = ModuleConst.Area, Order = 700)] + [Route("api/[area]/[controller]/[action]")] + public class ErpInfoService : IErpInfoService, IDynamicApiController, ITransient + { + private readonly ISqlSugarClient _db; + private readonly IUserManager _userManager; + + public ErpInfoService(ISqlSugarRepository repository, + IUserManager userManager) + { + _userManager = userManager; + _db = repository.AsSugarClient(); + } + + [HttpPost] + public async Task GetProjects() + { + var erpdb = _db.AsTenant().GetConnection("erpdb"); + return await erpdb.Queryable().ToListAsync(); + } + } +} \ No newline at end of file