diff --git a/PerMgr/Tnb.PerMgr.Entities/Consts/ModuleConsts.cs b/PerMgr/Tnb.PerMgr.Entities/Consts/ModuleConsts.cs new file mode 100644 index 00000000..69c95f60 --- /dev/null +++ b/PerMgr/Tnb.PerMgr.Entities/Consts/ModuleConsts.cs @@ -0,0 +1,8 @@ +namespace Tnb.PerMgr; + +public class ModuleConsts +{ + public const string Tag = "PerMgr"; + public const string Area = "per"; + +} \ No newline at end of file diff --git a/PerMgr/Tnb.PerMgr.Entities/Dto/ProcessParamOutput.cs b/PerMgr/Tnb.PerMgr.Entities/Dto/ProcessParamOutput.cs new file mode 100644 index 00000000..2ec9c6da --- /dev/null +++ b/PerMgr/Tnb.PerMgr.Entities/Dto/ProcessParamOutput.cs @@ -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; } + } +} \ No newline at end of file diff --git a/PerMgr/Tnb.PerMgr.Entities/Entity/PerProcessParam.cs b/PerMgr/Tnb.PerMgr.Entities/Entity/PerProcessParam.cs new file mode 100644 index 00000000..5dc10bcf --- /dev/null +++ b/PerMgr/Tnb.PerMgr.Entities/Entity/PerProcessParam.cs @@ -0,0 +1,72 @@ +using JNPF.Common.Contracts; +using JNPF.Common.Security; +using SqlSugar; + +namespace Tnb.PerMgr.Entities; + +/// +/// 工艺参数 +/// +[SugarTable("per_process_param")] +public partial class PerProcessParam : BaseEntity +{ + public PerProcessParam() + { + id = SnowflakeIdHelper.NextId(); + } + /// + /// 名称 + /// + public string name { get; set; } = string.Empty; + + /// + /// 公差类别id + /// + public string tolerance_category_id { get; set; } = string.Empty; + + /// + /// 工艺参数类型id + /// + public string process_param_type_id { get; set; } = string.Empty; + + /// + /// 排序 + /// + public long ordinal { get; set; } + + /// + /// 创建用户 + /// + public string? create_id { get; set; } + + /// + /// 创建时间 + /// + public DateTime? create_time { get; set; } + + /// + /// 修改用户 + /// + public string? modify_id { get; set; } + + /// + /// 修改时间 + /// + public DateTime? modify_time { get; set; } + + /// + /// 所属组织 + /// + public string? org_id { get; set; } + + /// + /// 流程任务Id + /// + public string? f_flowtaskid { get; set; } + + /// + /// 流程引擎Id + /// + public string? f_flowid { get; set; } + +} \ No newline at end of file diff --git a/PerMgr/Tnb.PerMgr.Entities/Entity/PerToleranceCategory.cs b/PerMgr/Tnb.PerMgr.Entities/Entity/PerToleranceCategory.cs new file mode 100644 index 00000000..1e55987c --- /dev/null +++ b/PerMgr/Tnb.PerMgr.Entities/Entity/PerToleranceCategory.cs @@ -0,0 +1,67 @@ +using JNPF.Common.Contracts; +using JNPF.Common.Security; +using SqlSugar; + +namespace Tnb.PerMgr.Entities; + +/// +/// 公差类别 +/// +[SugarTable("per_tolerance_category")] +public partial class PerToleranceCategory : BaseEntity +{ + public PerToleranceCategory() + { + id = SnowflakeIdHelper.NextId(); + } + /// + /// 名称 + /// + public string name { get; set; } = string.Empty; + + /// + /// 类型 1 值 2百分比 + /// + public string type { get; set; } = string.Empty; + + /// + /// 上限 + /// + public decimal upper_value { get; set; } + + /// + /// 下限 + /// + public decimal lower_value { get; set; } + + /// + /// 备注 + /// + public string? remark { get; set; } + + /// + /// 创建用户 + /// + public string? create_id { get; set; } + + /// + /// 创建时间 + /// + public DateTime? create_time { get; set; } + + /// + /// 修改用户 + /// + public string? modify_id { get; set; } + + /// + /// 修改时间 + /// + public DateTime? modify_time { get; set; } + + /// + /// 所属组织 + /// + public string? org_id { get; set; } + +} \ No newline at end of file diff --git a/PerMgr/Tnb.PerMgr.Entities/Tnb.PerMgr.Entities.csproj b/PerMgr/Tnb.PerMgr.Entities/Tnb.PerMgr.Entities.csproj new file mode 100644 index 00000000..39d8435c --- /dev/null +++ b/PerMgr/Tnb.PerMgr.Entities/Tnb.PerMgr.Entities.csproj @@ -0,0 +1,17 @@ + + + + net6.0 + enable + enable + + + + + + + + + + + diff --git a/PerMgr/Tnb.PerMgr.Interfaces/IPerProcessParamService.cs b/PerMgr/Tnb.PerMgr.Interfaces/IPerProcessParamService.cs new file mode 100644 index 00000000..d7cff95c --- /dev/null +++ b/PerMgr/Tnb.PerMgr.Interfaces/IPerProcessParamService.cs @@ -0,0 +1,14 @@ +using Tnb.PerMgr.Entities.Dto; + +namespace Tnb.PerMgr.Interfaces +{ + public interface IPerProcessParamService + { + /// + /// 根据id获取工艺参数信息 + /// + /// + /// + public Task GetProcessParamInfo(Dictionary dic); + } +} \ No newline at end of file diff --git a/PerMgr/Tnb.PerMgr.Interfaces/Tnb.PerMgr.Interfaces.csproj b/PerMgr/Tnb.PerMgr.Interfaces/Tnb.PerMgr.Interfaces.csproj new file mode 100644 index 00000000..6f9a432e --- /dev/null +++ b/PerMgr/Tnb.PerMgr.Interfaces/Tnb.PerMgr.Interfaces.csproj @@ -0,0 +1,13 @@ + + + + net6.0 + enable + enable + + + + + + + diff --git a/PerMgr/Tnb.PerMgr/PerProcessParamService.cs b/PerMgr/Tnb.PerMgr/PerProcessParamService.cs new file mode 100644 index 00000000..e73bd08e --- /dev/null +++ b/PerMgr/Tnb.PerMgr/PerProcessParamService.cs @@ -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 +{ + /// + /// 工艺参数 + /// + [ApiDescriptionSettings(Tag = ModuleConsts.Tag, Area = ModuleConsts.Area, Order = 700)] + [Route("api/[area]/[controller]/[action]")] + public class PerProcessParamService : IPerProcessParamService, IDynamicApiController, ITransient + { + private readonly ISqlSugarRepository _repository; + private readonly IUserManager _userManager; + + public PerProcessParamService(ISqlSugarRepository repository, IUserManager userManager) + { + _userManager = userManager; + _repository = repository; + } + + [HttpPost] + public async Task GetProcessParamInfo(Dictionary dic) + { + string id = dic["id"]; + var db = _repository.AsSugarClient(); + var result = await db.Queryable() + .LeftJoin((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; + } + } +} \ No newline at end of file diff --git a/PerMgr/Tnb.PerMgr/Tnb.PerMgr.csproj b/PerMgr/Tnb.PerMgr/Tnb.PerMgr.csproj new file mode 100644 index 00000000..720e38c1 --- /dev/null +++ b/PerMgr/Tnb.PerMgr/Tnb.PerMgr.csproj @@ -0,0 +1,14 @@ + + + + net6.0 + enable + enable + + + + + + + + diff --git a/Tnb.Server.sln b/Tnb.Server.sln index 04e28095..cbf2b18c 100644 --- a/Tnb.Server.sln +++ b/Tnb.Server.sln @@ -129,6 +129,14 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tnb.BasicData.Entities", "B EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tnb.ProductionMgr.Entities", "ProductionMgr\Tnb.ProductionMgr.Entities\Tnb.ProductionMgr.Entities.csproj", "{57E7491F-7876-451E-BA9F-5B007EBD432D}" 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 GlobalSection(SolutionConfigurationPlatforms) = preSolution 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}.Release|Any CPU.ActiveCfg = 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 GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -364,6 +384,9 @@ Global {CE039C17-0037-457C-A202-486701DB7F17} = {ABE58B5E-610B-4159-BFF0-8B04BF700B3C} {03835631-26A5-442B-9B25-7F81D0A5594A} = {52B19E13-6B04-444C-A38A-B9955B199A98} {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 GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {646DDD1C-F143-42C2-894F-F5C7B3A0CE74} diff --git a/apihost/Tnb.API.Entry/Tnb.API.Entry.csproj b/apihost/Tnb.API.Entry/Tnb.API.Entry.csproj index 211629f1..e3a54fc6 100644 --- a/apihost/Tnb.API.Entry/Tnb.API.Entry.csproj +++ b/apihost/Tnb.API.Entry/Tnb.API.Entry.csproj @@ -37,6 +37,7 @@ + diff --git a/system/Tnb.Systems/System/DataBaseService.cs b/system/Tnb.Systems/System/DataBaseService.cs index 35c1bb6d..54c6977d 100644 --- a/system/Tnb.Systems/System/DataBaseService.cs +++ b/system/Tnb.Systems/System/DataBaseService.cs @@ -639,6 +639,7 @@ public class DataBaseService : IDynamicApiController, ITransient {"eqp_", "Tnb.EquipMgr.Entities" }, {"tool_", "Tnb.EquipMgr.Entities" }, {"qc_", "Tnb.QcMgr.Entities" }, + {"per_", "Tnb.PerMgr.Entities" }, }; var allTables = sugar.DbMaintenance.GetTableInfoList().WhereIF(!string.IsNullOrEmpty(tbName), t => t.Name == tbName); foreach (var tbl in allTables)