工艺管理
This commit is contained in:
8
PerMgr/Tnb.PerMgr.Entities/Consts/ModuleConsts.cs
Normal file
8
PerMgr/Tnb.PerMgr.Entities/Consts/ModuleConsts.cs
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
namespace Tnb.PerMgr;
|
||||||
|
|
||||||
|
public class ModuleConsts
|
||||||
|
{
|
||||||
|
public const string Tag = "PerMgr";
|
||||||
|
public const string Area = "per";
|
||||||
|
|
||||||
|
}
|
||||||
11
PerMgr/Tnb.PerMgr.Entities/Dto/ProcessParamOutput.cs
Normal file
11
PerMgr/Tnb.PerMgr.Entities/Dto/ProcessParamOutput.cs
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
namespace Tnb.PerMgr.Entities.Dto
|
||||||
|
{
|
||||||
|
public class ProcessParamOutput
|
||||||
|
{
|
||||||
|
public string name { get; set; }
|
||||||
|
|
||||||
|
public decimal upper_value { get; set; }
|
||||||
|
|
||||||
|
public decimal lower_value { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
72
PerMgr/Tnb.PerMgr.Entities/Entity/PerProcessParam.cs
Normal file
72
PerMgr/Tnb.PerMgr.Entities/Entity/PerProcessParam.cs
Normal file
@@ -0,0 +1,72 @@
|
|||||||
|
using JNPF.Common.Contracts;
|
||||||
|
using JNPF.Common.Security;
|
||||||
|
using SqlSugar;
|
||||||
|
|
||||||
|
namespace Tnb.PerMgr.Entities;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 工艺参数
|
||||||
|
/// </summary>
|
||||||
|
[SugarTable("per_process_param")]
|
||||||
|
public partial class PerProcessParam : BaseEntity<string>
|
||||||
|
{
|
||||||
|
public PerProcessParam()
|
||||||
|
{
|
||||||
|
id = SnowflakeIdHelper.NextId();
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 名称
|
||||||
|
/// </summary>
|
||||||
|
public string name { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 公差类别id
|
||||||
|
/// </summary>
|
||||||
|
public string tolerance_category_id { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 工艺参数类型id
|
||||||
|
/// </summary>
|
||||||
|
public string process_param_type_id { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 排序
|
||||||
|
/// </summary>
|
||||||
|
public long ordinal { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 创建用户
|
||||||
|
/// </summary>
|
||||||
|
public string? create_id { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 创建时间
|
||||||
|
/// </summary>
|
||||||
|
public DateTime? create_time { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 修改用户
|
||||||
|
/// </summary>
|
||||||
|
public string? modify_id { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 修改时间
|
||||||
|
/// </summary>
|
||||||
|
public DateTime? modify_time { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 所属组织
|
||||||
|
/// </summary>
|
||||||
|
public string? org_id { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 流程任务Id
|
||||||
|
/// </summary>
|
||||||
|
public string? f_flowtaskid { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 流程引擎Id
|
||||||
|
/// </summary>
|
||||||
|
public string? f_flowid { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
67
PerMgr/Tnb.PerMgr.Entities/Entity/PerToleranceCategory.cs
Normal file
67
PerMgr/Tnb.PerMgr.Entities/Entity/PerToleranceCategory.cs
Normal file
@@ -0,0 +1,67 @@
|
|||||||
|
using JNPF.Common.Contracts;
|
||||||
|
using JNPF.Common.Security;
|
||||||
|
using SqlSugar;
|
||||||
|
|
||||||
|
namespace Tnb.PerMgr.Entities;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 公差类别
|
||||||
|
/// </summary>
|
||||||
|
[SugarTable("per_tolerance_category")]
|
||||||
|
public partial class PerToleranceCategory : BaseEntity<string>
|
||||||
|
{
|
||||||
|
public PerToleranceCategory()
|
||||||
|
{
|
||||||
|
id = SnowflakeIdHelper.NextId();
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 名称
|
||||||
|
/// </summary>
|
||||||
|
public string name { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 类型 1 值 2百分比
|
||||||
|
/// </summary>
|
||||||
|
public string type { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 上限
|
||||||
|
/// </summary>
|
||||||
|
public decimal upper_value { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 下限
|
||||||
|
/// </summary>
|
||||||
|
public decimal lower_value { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 备注
|
||||||
|
/// </summary>
|
||||||
|
public string? remark { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 创建用户
|
||||||
|
/// </summary>
|
||||||
|
public string? create_id { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 创建时间
|
||||||
|
/// </summary>
|
||||||
|
public DateTime? create_time { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 修改用户
|
||||||
|
/// </summary>
|
||||||
|
public string? modify_id { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 修改时间
|
||||||
|
/// </summary>
|
||||||
|
public DateTime? modify_time { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 所属组织
|
||||||
|
/// </summary>
|
||||||
|
public string? org_id { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
17
PerMgr/Tnb.PerMgr.Entities/Tnb.PerMgr.Entities.csproj
Normal file
17
PerMgr/Tnb.PerMgr.Entities/Tnb.PerMgr.Entities.csproj
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<TargetFramework>net6.0</TargetFramework>
|
||||||
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
|
<Nullable>enable</Nullable>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\..\common\Tnb.Common\Tnb.Common.csproj" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<Folder Include="Model" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
</Project>
|
||||||
14
PerMgr/Tnb.PerMgr.Interfaces/IPerProcessParamService.cs
Normal file
14
PerMgr/Tnb.PerMgr.Interfaces/IPerProcessParamService.cs
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
using Tnb.PerMgr.Entities.Dto;
|
||||||
|
|
||||||
|
namespace Tnb.PerMgr.Interfaces
|
||||||
|
{
|
||||||
|
public interface IPerProcessParamService
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 根据id获取工艺参数信息
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="dic"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public Task<ProcessParamOutput> GetProcessParamInfo(Dictionary<string,string> dic);
|
||||||
|
}
|
||||||
|
}
|
||||||
13
PerMgr/Tnb.PerMgr.Interfaces/Tnb.PerMgr.Interfaces.csproj
Normal file
13
PerMgr/Tnb.PerMgr.Interfaces/Tnb.PerMgr.Interfaces.csproj
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<TargetFramework>net6.0</TargetFramework>
|
||||||
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
|
<Nullable>enable</Nullable>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\Tnb.PerMgr.Entities\Tnb.PerMgr.Entities.csproj" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
</Project>
|
||||||
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
14
PerMgr/Tnb.PerMgr/Tnb.PerMgr.csproj
Normal file
14
PerMgr/Tnb.PerMgr/Tnb.PerMgr.csproj
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
<Import Project="$(SolutionDir)\common.props" />
|
||||||
|
<PropertyGroup>
|
||||||
|
<TargetFramework>net6.0</TargetFramework>
|
||||||
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
|
<Nullable>enable</Nullable>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\..\visualdev\Tnb.VisualDev.Engine\Tnb.VisualDev.Engine.csproj" />
|
||||||
|
<ProjectReference Include="..\Tnb.PerMgr.Interfaces\Tnb.PerMgr.Interfaces.csproj" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
</Project>
|
||||||
@@ -129,6 +129,14 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tnb.BasicData.Entities", "B
|
|||||||
EndProject
|
EndProject
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tnb.ProductionMgr.Entities", "ProductionMgr\Tnb.ProductionMgr.Entities\Tnb.ProductionMgr.Entities.csproj", "{57E7491F-7876-451E-BA9F-5B007EBD432D}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tnb.ProductionMgr.Entities", "ProductionMgr\Tnb.ProductionMgr.Entities\Tnb.ProductionMgr.Entities.csproj", "{57E7491F-7876-451E-BA9F-5B007EBD432D}"
|
||||||
EndProject
|
EndProject
|
||||||
|
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "PerMgr", "PerMgr", "{74AB6486-1090-4CC9-9D1A-F1245E3ECFC3}"
|
||||||
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tnb.PerMgr", "PerMgr\Tnb.PerMgr\Tnb.PerMgr.csproj", "{D41946CF-09C6-4CA4-A1F4-42E7E1538BF7}"
|
||||||
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tnb.PerMgr.Entities", "PerMgr\Tnb.PerMgr.Entities\Tnb.PerMgr.Entities.csproj", "{42AD083D-D199-4B09-ADD8-89251011C959}"
|
||||||
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tnb.PerMgr.Interfaces", "PerMgr\Tnb.PerMgr.Interfaces\Tnb.PerMgr.Interfaces.csproj", "{F3656494-27D3-4BD7-B831-8D909DFBD7B9}"
|
||||||
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
Debug|Any CPU = Debug|Any CPU
|
Debug|Any CPU = Debug|Any CPU
|
||||||
@@ -315,6 +323,18 @@ Global
|
|||||||
{57E7491F-7876-451E-BA9F-5B007EBD432D}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{57E7491F-7876-451E-BA9F-5B007EBD432D}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{57E7491F-7876-451E-BA9F-5B007EBD432D}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{57E7491F-7876-451E-BA9F-5B007EBD432D}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{57E7491F-7876-451E-BA9F-5B007EBD432D}.Release|Any CPU.Build.0 = Release|Any CPU
|
{57E7491F-7876-451E-BA9F-5B007EBD432D}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{D41946CF-09C6-4CA4-A1F4-42E7E1538BF7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{D41946CF-09C6-4CA4-A1F4-42E7E1538BF7}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{D41946CF-09C6-4CA4-A1F4-42E7E1538BF7}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{D41946CF-09C6-4CA4-A1F4-42E7E1538BF7}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{42AD083D-D199-4B09-ADD8-89251011C959}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{42AD083D-D199-4B09-ADD8-89251011C959}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{42AD083D-D199-4B09-ADD8-89251011C959}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{42AD083D-D199-4B09-ADD8-89251011C959}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{F3656494-27D3-4BD7-B831-8D909DFBD7B9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{F3656494-27D3-4BD7-B831-8D909DFBD7B9}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{F3656494-27D3-4BD7-B831-8D909DFBD7B9}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{F3656494-27D3-4BD7-B831-8D909DFBD7B9}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
HideSolutionNode = FALSE
|
HideSolutionNode = FALSE
|
||||||
@@ -364,6 +384,9 @@ Global
|
|||||||
{CE039C17-0037-457C-A202-486701DB7F17} = {ABE58B5E-610B-4159-BFF0-8B04BF700B3C}
|
{CE039C17-0037-457C-A202-486701DB7F17} = {ABE58B5E-610B-4159-BFF0-8B04BF700B3C}
|
||||||
{03835631-26A5-442B-9B25-7F81D0A5594A} = {52B19E13-6B04-444C-A38A-B9955B199A98}
|
{03835631-26A5-442B-9B25-7F81D0A5594A} = {52B19E13-6B04-444C-A38A-B9955B199A98}
|
||||||
{57E7491F-7876-451E-BA9F-5B007EBD432D} = {ABE58B5E-610B-4159-BFF0-8B04BF700B3C}
|
{57E7491F-7876-451E-BA9F-5B007EBD432D} = {ABE58B5E-610B-4159-BFF0-8B04BF700B3C}
|
||||||
|
{D41946CF-09C6-4CA4-A1F4-42E7E1538BF7} = {74AB6486-1090-4CC9-9D1A-F1245E3ECFC3}
|
||||||
|
{42AD083D-D199-4B09-ADD8-89251011C959} = {74AB6486-1090-4CC9-9D1A-F1245E3ECFC3}
|
||||||
|
{F3656494-27D3-4BD7-B831-8D909DFBD7B9} = {74AB6486-1090-4CC9-9D1A-F1245E3ECFC3}
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||||
SolutionGuid = {646DDD1C-F143-42C2-894F-F5C7B3A0CE74}
|
SolutionGuid = {646DDD1C-F143-42C2-894F-F5C7B3A0CE74}
|
||||||
|
|||||||
@@ -37,6 +37,7 @@
|
|||||||
<ProjectReference Include="..\..\BasicData\Tnb.BasicData\Tnb.BasicData.csproj" />
|
<ProjectReference Include="..\..\BasicData\Tnb.BasicData\Tnb.BasicData.csproj" />
|
||||||
<ProjectReference Include="..\..\EquipMgr\Tnb.EquipMgr\Tnb.EquipMgr.csproj" />
|
<ProjectReference Include="..\..\EquipMgr\Tnb.EquipMgr\Tnb.EquipMgr.csproj" />
|
||||||
<ProjectReference Include="..\..\message\Tnb.Message\Tnb.Message.csproj" />
|
<ProjectReference Include="..\..\message\Tnb.Message\Tnb.Message.csproj" />
|
||||||
|
<ProjectReference Include="..\..\PerMgr\Tnb.PerMgr\Tnb.PerMgr.csproj" />
|
||||||
<ProjectReference Include="..\..\ProductionMgr\Tnb.ProductionMgr\Tnb.ProductionMgr.csproj" />
|
<ProjectReference Include="..\..\ProductionMgr\Tnb.ProductionMgr\Tnb.ProductionMgr.csproj" />
|
||||||
<ProjectReference Include="..\..\QcMgr\Tnb.QcMgr\Tnb.QcMgr.csproj" />
|
<ProjectReference Include="..\..\QcMgr\Tnb.QcMgr\Tnb.QcMgr.csproj" />
|
||||||
<ProjectReference Include="..\..\system\Tnb.OAuth\Tnb.OAuth.csproj" />
|
<ProjectReference Include="..\..\system\Tnb.OAuth\Tnb.OAuth.csproj" />
|
||||||
|
|||||||
@@ -639,6 +639,7 @@ public class DataBaseService : IDynamicApiController, ITransient
|
|||||||
{"eqp_", "Tnb.EquipMgr.Entities" },
|
{"eqp_", "Tnb.EquipMgr.Entities" },
|
||||||
{"tool_", "Tnb.EquipMgr.Entities" },
|
{"tool_", "Tnb.EquipMgr.Entities" },
|
||||||
{"qc_", "Tnb.QcMgr.Entities" },
|
{"qc_", "Tnb.QcMgr.Entities" },
|
||||||
|
{"per_", "Tnb.PerMgr.Entities" },
|
||||||
};
|
};
|
||||||
var allTables = sugar.DbMaintenance.GetTableInfoList().WhereIF(!string.IsNullOrEmpty(tbName), t => t.Name == tbName);
|
var allTables = sugar.DbMaintenance.GetTableInfoList().WhereIF(!string.IsNullOrEmpty(tbName), t => t.Name == tbName);
|
||||||
foreach (var tbl in allTables)
|
foreach (var tbl in allTables)
|
||||||
|
|||||||
Reference in New Issue
Block a user