工艺管理
This commit is contained in:
45
PerMgr/Tnb.PerMgr/PerProcessParamService.cs
Normal file
45
PerMgr/Tnb.PerMgr/PerProcessParamService.cs
Normal 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user