工艺管理

This commit is contained in:
2023-06-02 16:57:46 +08:00
parent 5b83328369
commit 579aa750ad
12 changed files with 286 additions and 0 deletions

View File

@@ -0,0 +1,45 @@
using JNPF.Common.Core.Manager;
using JNPF.DependencyInjection;
using JNPF.DynamicApiController;
using Microsoft.AspNetCore.Mvc;
using SqlSugar;
using Tnb.PerMgr.Entities;
using Tnb.PerMgr.Entities.Dto;
using Tnb.PerMgr.Interfaces;
namespace Tnb.PerMgr
{
/// <summary>
/// 工艺参数
/// </summary>
[ApiDescriptionSettings(Tag = ModuleConsts.Tag, Area = ModuleConsts.Area, Order = 700)]
[Route("api/[area]/[controller]/[action]")]
public class PerProcessParamService : IPerProcessParamService, IDynamicApiController, ITransient
{
private readonly ISqlSugarRepository<PerProcessParam> _repository;
private readonly IUserManager _userManager;
public PerProcessParamService(ISqlSugarRepository<PerProcessParam> repository, IUserManager userManager)
{
_userManager = userManager;
_repository = repository;
}
[HttpPost]
public async Task<ProcessParamOutput> GetProcessParamInfo(Dictionary<string, string> dic)
{
string id = dic["id"];
var db = _repository.AsSugarClient();
var result = await db.Queryable<PerProcessParam>()
.LeftJoin<PerToleranceCategory>((a, b) => a.tolerance_category_id == b.id)
.Where((a, b) => a.id == id)
.Select((a, b) => new ProcessParamOutput()
{
name = a.name,
upper_value = b.upper_value,
lower_value = b.lower_value,
}).SingleAsync();
return result;
}
}
}