diff --git a/BasicData/Tnb.BasicData.Entitys/Consts/DictConst.cs b/BasicData/Tnb.BasicData.Entitys/Consts/DictConst.cs index 66363946..ff942440 100644 --- a/BasicData/Tnb.BasicData.Entitys/Consts/DictConst.cs +++ b/BasicData/Tnb.BasicData.Entitys/Consts/DictConst.cs @@ -1,4 +1,4 @@ -namespace Tnb.BasicData.Entitys; +namespace Tnb.BasicData; public static class DictConst { diff --git a/BasicData/Tnb.BasicData.Entitys/Dto/ParentMaterial/EbomTreeOutput.cs b/BasicData/Tnb.BasicData.Entitys/Dto/BasEbom/EbomTreeOutput.cs similarity index 98% rename from BasicData/Tnb.BasicData.Entitys/Dto/ParentMaterial/EbomTreeOutput.cs rename to BasicData/Tnb.BasicData.Entitys/Dto/BasEbom/EbomTreeOutput.cs index 6f681b9b..e6062a07 100644 --- a/BasicData/Tnb.BasicData.Entitys/Dto/ParentMaterial/EbomTreeOutput.cs +++ b/BasicData/Tnb.BasicData.Entitys/Dto/BasEbom/EbomTreeOutput.cs @@ -1,4 +1,4 @@ -namespace Tnb.BasicData.Entitys.Dto +namespace Tnb.BasicData.Entities.Dto { public class EbomTreeOutput { diff --git a/BasicData/Tnb.BasicData.Entitys/Dto/ParentMaterial/EbomTreeQueryInput.cs b/BasicData/Tnb.BasicData.Entitys/Dto/BasEbom/EbomTreeQueryInput.cs similarity index 89% rename from BasicData/Tnb.BasicData.Entitys/Dto/ParentMaterial/EbomTreeQueryInput.cs rename to BasicData/Tnb.BasicData.Entitys/Dto/BasEbom/EbomTreeQueryInput.cs index 9c4dfea5..4d8a7550 100644 --- a/BasicData/Tnb.BasicData.Entitys/Dto/ParentMaterial/EbomTreeQueryInput.cs +++ b/BasicData/Tnb.BasicData.Entitys/Dto/BasEbom/EbomTreeQueryInput.cs @@ -1,4 +1,4 @@ -namespace Tnb.BasicData.Entitys.Dto +namespace Tnb.BasicData.Entities.Dto { public class EbomTreeQueryInput { diff --git a/BasicData/Tnb.BasicData.Entitys/Dto/ProcessManage/RouteLineTreeOutput.cs b/BasicData/Tnb.BasicData.Entitys/Dto/ProcessManage/RouteLineTreeOutput.cs index d3279972..aab0daec 100644 --- a/BasicData/Tnb.BasicData.Entitys/Dto/ProcessManage/RouteLineTreeOutput.cs +++ b/BasicData/Tnb.BasicData.Entitys/Dto/ProcessManage/RouteLineTreeOutput.cs @@ -5,7 +5,7 @@ using System.Text; using System.Threading.Tasks; using JNPF.Common.Security; -namespace Tnb.BasicData.Entitys.Dto.ProcessManage +namespace Tnb.BasicData.Entities.Dto { /// /// 工艺路线模版左侧树输出参数 diff --git a/BasicData/Tnb.BasicData.Entitys/Entity/BasEbomD.cs b/BasicData/Tnb.BasicData.Entitys/Entity/BasEbomD.cs index 979f226e..31ca2af2 100644 --- a/BasicData/Tnb.BasicData.Entitys/Entity/BasEbomD.cs +++ b/BasicData/Tnb.BasicData.Entitys/Entity/BasEbomD.cs @@ -1,7 +1,7 @@ using SqlSugar; using Tnb.Common.Contracts; -namespace Tnb.BasicData.Entitys.Entity +namespace Tnb.BasicData.Entities { /// ///物料清单子表 diff --git a/BasicData/Tnb.BasicData.Entitys/Entity/BasEbomH.cs b/BasicData/Tnb.BasicData.Entitys/Entity/BasEbomH.cs index 3dcaff75..3064d18c 100644 --- a/BasicData/Tnb.BasicData.Entitys/Entity/BasEbomH.cs +++ b/BasicData/Tnb.BasicData.Entitys/Entity/BasEbomH.cs @@ -1,7 +1,7 @@ using SqlSugar; using Tnb.Common.Contracts; -namespace Tnb.BasicData.Entitys.Entity +namespace Tnb.BasicData.Entities { /// ///物料清单父表 diff --git a/BasicData/Tnb.BasicData.Entitys/Entity/BasMaterial.cs b/BasicData/Tnb.BasicData.Entitys/Entity/BasMaterial.cs index d67f5249..da4c31b6 100644 --- a/BasicData/Tnb.BasicData.Entitys/Entity/BasMaterial.cs +++ b/BasicData/Tnb.BasicData.Entitys/Entity/BasMaterial.cs @@ -1,6 +1,6 @@ using SqlSugar; using Tnb.Common.Contracts; -namespace Tnb.BasicData.Entitys.Entity +namespace Tnb.BasicData.Entities { /// ///物料信息 diff --git a/BasicData/Tnb.BasicData.Entitys/Entity/BasMaterialUnit.cs b/BasicData/Tnb.BasicData.Entitys/Entity/BasMaterialUnit.cs index 7bd37dbd..b87ceec5 100644 --- a/BasicData/Tnb.BasicData.Entitys/Entity/BasMaterialUnit.cs +++ b/BasicData/Tnb.BasicData.Entitys/Entity/BasMaterialUnit.cs @@ -1,7 +1,7 @@ using SqlSugar; using Tnb.Common.Contracts; -namespace Tnb.BasicData.Entitys.Entity +namespace Tnb.BasicData.Entities { /// ///物料单位 diff --git a/BasicData/Tnb.BasicData.Entitys/Entity/BasMbom.cs b/BasicData/Tnb.BasicData.Entitys/Entity/BasMbom.cs new file mode 100644 index 00000000..f9ae86da --- /dev/null +++ b/BasicData/Tnb.BasicData.Entitys/Entity/BasMbom.cs @@ -0,0 +1,129 @@ +using SqlSugar; +using Tnb.Common.Contracts; + +namespace Tnb.BasicData.Entities +{ + /// + ///生产bom + /// + [SugarTable("bas_mbom")] + public class BasMbom : BaseEntity + { + public BasMbom(){ + + + } + /// + /// Desc:扩展字段 + /// Default: + /// Nullable:True + /// + public string extras {get;set;} + + /// + /// Desc:物料id + /// Default: + /// Nullable:False + /// + public string material_id {get;set;} + + /// + /// Desc:数量 + /// Default: + /// Nullable:False + /// + public int num {get;set;} + + /// + /// Desc:有效结束时间 + /// Default: + /// Nullable:True + /// + public DateTime? end_time {get;set;} + + /// + /// Desc:所属组织id + /// Default:NULL::character varying + /// Nullable:True + /// + public string org_id {get;set;} + + /// + /// Desc:单位 + /// Default:NULL::character varying + /// Nullable:True + /// + public string unit_id {get;set;} + + /// + /// Desc:备注 + /// Default:NULL::character varying + /// Nullable:True + /// + public string remark {get;set;} + + /// + /// Desc:有效开始时间 + /// Default: + /// Nullable:True + /// + public DateTime? start_time {get;set;} + + /// + /// Desc:工艺路线id + /// Default: + /// Nullable:False + /// + public string route_id {get;set;} + + /// + /// Desc:创建时间 + /// Default: + /// Nullable:True + /// + public DateTime? create_time {get;set;} + + /// + /// Desc:修改时间 + /// Default: + /// Nullable:True + /// + public DateTime? modify_time {get;set;} + + /// + /// Desc:版本号 + /// Default:NULL::character varying + /// Nullable:True + /// + public string version {get;set;} + + /// + /// Desc:物料清单id + /// Default:NULL::character varying + /// Nullable:True + /// + public string ebom_id {get;set;} + + /// + /// Desc:物料均在首道工序投产 + /// Default:NULL::character varying + /// Nullable:True + /// + public string is_first {get;set;} + + /// + /// Desc:创建用户 + /// Default:NULL::character varying + /// Nullable:True + /// + public string create_id {get;set;} + + /// + /// Desc:修改用户 + /// Default:NULL::character varying + /// Nullable:True + /// + public string modify_id {get;set;} + + } +} \ No newline at end of file diff --git a/BasicData/Tnb.BasicData.Entitys/Entity/BasMbomInput.cs b/BasicData/Tnb.BasicData.Entitys/Entity/BasMbomInput.cs new file mode 100644 index 00000000..54f7d5f7 --- /dev/null +++ b/BasicData/Tnb.BasicData.Entitys/Entity/BasMbomInput.cs @@ -0,0 +1,58 @@ +using SqlSugar; +using Tnb.Common.Contracts; + +namespace Tnb.BasicData.Entities +{ + /// + ///生产bom子表投入物料 + /// + [SugarTable("bas_mbom_input")] + public class BasMbomInput : BaseEntity + { + public BasMbomInput() + { + } + + /// + /// Desc:生产bomid + /// Default: + /// Nullable:False + /// + public string mbom_id { get; set; } + + /// + /// Desc:生产bom子表id + /// Default: + /// Nullable:False + /// + public string mbom_process_id { get; set; } + + /// + /// Desc:工序id + /// Default: + /// Nullable:False + /// + public string process_id { get; set; } + + /// + /// Desc:物料id + /// Default: + /// Nullable:False + /// + public string material_id { get; set; } + + /// + /// Desc:数量 + /// Default: + /// Nullable:False + /// + public int num { get; set; } + + /// + /// Desc:所属组织id + /// Default:NULL::character varying + /// Nullable:True + /// + public string org_id { get; set; } + } +} \ No newline at end of file diff --git a/BasicData/Tnb.BasicData.Entitys/Entity/BasMbomOutput.cs b/BasicData/Tnb.BasicData.Entitys/Entity/BasMbomOutput.cs new file mode 100644 index 00000000..01718078 --- /dev/null +++ b/BasicData/Tnb.BasicData.Entitys/Entity/BasMbomOutput.cs @@ -0,0 +1,58 @@ +using SqlSugar; +using Tnb.Common.Contracts; + +namespace Tnb.BasicData.Entities +{ + /// + ///生产bom子表产出物料 + /// + [SugarTable("bas_mbom_output")] + public class BasMbomOutput : BaseEntity + { + public BasMbomOutput() + { + } + + /// + /// Desc:生产bomid + /// Default: + /// Nullable:False + /// + public string mbom_id { get; set; } + + /// + /// Desc:工序id + /// Default: + /// Nullable:False + /// + public string process_id { get; set; } + + /// + /// Desc:物料id + /// Default: + /// Nullable:False + /// + public string material_id { get; set; } + + /// + /// Desc:生产bom子表id + /// Default: + /// Nullable:False + /// + public string mbom_process_id { get; set; } + + /// + /// Desc:产出数量(可小数分数) + /// Default: + /// Nullable:False + /// + public string num { get; set; } + + /// + /// Desc:所属组织id + /// Default:NULL::character varying + /// Nullable:True + /// + public string org_id { get; set; } + } +} \ No newline at end of file diff --git a/BasicData/Tnb.BasicData.Entitys/Entity/BasMbomOutputExt.cs b/BasicData/Tnb.BasicData.Entitys/Entity/BasMbomOutputExt.cs new file mode 100644 index 00000000..9df18795 --- /dev/null +++ b/BasicData/Tnb.BasicData.Entitys/Entity/BasMbomOutputExt.cs @@ -0,0 +1,51 @@ +using SqlSugar; +using Tnb.Common.Contracts; + +namespace Tnb.BasicData.Entities +{ + /// + ///生产bom子表物料信息 + /// + [SugarTable("bas_mbom_output_ext")] + public class BasMbomOutputExt : BaseEntity + { + public BasMbomOutputExt() + { + } + + /// + /// Desc:工序id + /// Default: + /// Nullable:False + /// + public string process_id { get; set; } + + /// + /// Desc:生产bomid + /// Default: + /// Nullable:False + /// + public string mbom_id { get; set; } + + /// + /// Desc:生产bom子表id + /// Default: + /// Nullable:False + /// + public string mbom_process_id { get; set; } + + /// + /// Desc:副产出管控 0 不启用 1 启用 + /// Default: + /// Nullable:False + /// + public string byproduct_status { get; set; } + + /// + /// Desc:所属组织id + /// Default:NULL::character varying + /// Nullable:True + /// + public string org_id { get; set; } + } +} \ No newline at end of file diff --git a/BasicData/Tnb.BasicData.Entitys/Entity/BasMbomProcess.cs b/BasicData/Tnb.BasicData.Entitys/Entity/BasMbomProcess.cs new file mode 100644 index 00000000..56ba219b --- /dev/null +++ b/BasicData/Tnb.BasicData.Entitys/Entity/BasMbomProcess.cs @@ -0,0 +1,51 @@ +using SqlSugar; +using Tnb.Common.Contracts; + +namespace Tnb.BasicData.Entities +{ + /// + ///生产bom子表 + /// + [SugarTable("bas_mbom_process")] + public class BasMbomProcess : BaseEntity + { + public BasMbomProcess() + { + } + + /// + /// Desc:所属组织id + /// Default: + /// Nullable:False + /// + public string org_id { get; set; } + + /// + /// Desc:生产bomid + /// Default: + /// Nullable:False + /// + public string mbom_id { get; set; } + + /// + /// Desc:工序id + /// Default: + /// Nullable:False + /// + public string process_id { get; set; } + + /// + /// Desc:准备时间 + /// Default: + /// Nullable:False + /// + public decimal preparation_time { get; set; } + + /// + /// Desc:工位 + /// Default:NULL::character varying + /// Nullable:True + /// + public string station { get; set; } + } +} \ No newline at end of file diff --git a/BasicData/Tnb.BasicData.Entitys/Entity/BasRoute.cs b/BasicData/Tnb.BasicData.Entitys/Entity/BasRoute.cs deleted file mode 100644 index f17141a1..00000000 --- a/BasicData/Tnb.BasicData.Entitys/Entity/BasRoute.cs +++ /dev/null @@ -1,118 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using JNPF.Common.Contracts; -using SqlSugar; -using Tnb.Common.Contracts; - -namespace Tnb.BasicData.Entitys.Entity -{ - /// - ///工艺路线 - /// - [SugarTable("bas_route")] - public class BasRoute : BaseEntity - { - public BasRoute(){ - - - } - - /// - /// Desc:编号 - /// Default: - /// Nullable:False - /// - [SugarColumn(ColumnName="code")] - public string Code {get;set;} - - /// - /// Desc:名称 - /// Default: - /// Nullable:False - /// - [SugarColumn(ColumnName="name")] - public string Name {get;set;} - - /// - /// Desc:有效开始时间 - /// Default: - /// Nullable:True - /// - [SugarColumn(ColumnName="start_time")] - public DateTime? StartTime {get;set;} - - /// - /// Desc:有效结束时间 - /// Default: - /// Nullable:True - /// - [SugarColumn(ColumnName="end_time")] - public DateTime? EndTime {get;set;} - - /// - /// Desc:0 未发布 1 已发布 - /// Default: - /// Nullable:False - /// - [SugarColumn(ColumnName="status")] - public string Status {get;set;} - - /// - /// Desc:创建时间 - /// Default: - /// Nullable:True - /// - [SugarColumn(ColumnName="create_time")] - public DateTime? CreateTime {get;set;} - - /// - /// Desc:修改时间 - /// Default: - /// Nullable:True - /// - [SugarColumn(ColumnName="modify_time")] - public DateTime? ModifyTime {get;set;} - - /// - /// Desc:是否永远有效 - /// Default: - /// Nullable:False - /// - [SugarColumn(ColumnName="is_always_valid")] - public int IsAlwaysValid {get;set;} - - /// - /// Desc:所属组织ID - /// Default:NULL::character varying - /// Nullable:True - /// - [SugarColumn(ColumnName="org_id")] - public string OrgId {get;set;} - - /// - /// Desc:创建用户 - /// Default:NULL::character varying - /// Nullable:True - /// - [SugarColumn(ColumnName="create_id")] - public string CreateId {get;set;} - - /// - /// Desc:修改用户 - /// Default:NULL::character varying - /// Nullable:True - /// - [SugarColumn(ColumnName="modify_id")] - public string ModifyId {get;set;} - - /// - /// Desc:备注 - /// Default:NULL::character varying - /// Nullable:True - /// - [SugarColumn(ColumnName="remark")] - public string Remark {get;set;} - - } -} diff --git a/BasicData/Tnb.BasicData.Entitys/Entity/BasRouteD.cs b/BasicData/Tnb.BasicData.Entitys/Entity/BasRouteD.cs new file mode 100644 index 00000000..77a58e4d --- /dev/null +++ b/BasicData/Tnb.BasicData.Entitys/Entity/BasRouteD.cs @@ -0,0 +1,156 @@ +using SqlSugar; +using Tnb.Common.Contracts; + +namespace Tnb.BasicData.Entities +{ + /// + ///工艺路线子表 + /// + [SugarTable("bas_route_d")] + public class BasRouteD : BaseEntity + { + public BasRouteD() + { + } + + /// + /// Desc:工艺路线ID + /// Default: + /// Nullable:False + /// + public string route_id { get; set; } + + /// + /// Desc:工序id + /// Default: + /// Nullable:False + /// + public string process_id { get; set; } + + /// + /// Desc:处理时间 + /// Default: + /// Nullable:True + /// + public decimal? process_time { get; set; } + + /// + /// Desc:排序码 + /// Default: + /// Nullable:True + /// + public long? ordinal { get; set; } + + /// + /// Desc:状态 + /// Default: + /// Nullable:True + /// + public int? status { get; set; } + + /// + /// Desc:准备时间(秒) + /// Default: + /// Nullable:True + /// + public decimal? preparation_time { get; set; } + + /// + /// Desc:产出比 + /// Default: + /// Nullable:True + /// + public decimal? output_ratio { get; set; } + + /// + /// Desc:所属组织id + /// Default:NULL::character varying + /// Nullable:True + /// + public string org_id { get; set; } + + /// + /// Desc:工序代码 + /// Default:NULL::character varying + /// Nullable:True + /// + public string process_code { get; set; } + + /// + /// Desc:工序名称 + /// Default:NULL::character varying + /// Nullable:True + /// + public string process_name { get; set; } + + /// + /// Desc:备注 + /// Default:NULL::character varying + /// Nullable:True + /// + public string remark { get; set; } + + /// + /// Desc:单次扫码 + /// Default:NULL::character varying + /// Nullable:True + /// + public string single_scan_type { get; set; } + + /// + /// Desc:工位 + /// Default:NULL::character varying + /// Nullable:True + /// + public string station { get; set; } + + /// + /// Desc:一码到底 + /// Default:NULL::character varying + /// Nullable:True + /// + public string only_scan_type { get; set; } + + /// + /// Desc:用料追溯关系 + /// Default:NULL::character varying + /// Nullable:True + /// + public string material_traced_back_relationship { get; set; } + + /// + /// Desc:不合格产品投产 + /// Default:NULL::character varying + /// Nullable:True + /// + public string defective_products_put_into_production { get; set; } + + /// + /// Desc:报告模板 + /// Default:NULL::character varying + /// Nullable:True + /// + public string report_template { get; set; } + + /// + /// Desc:附件 + /// Default:NULL::character varying + /// Nullable:True + /// + public string attachment { get; set; } + + /// + /// Desc:接续方式 1 前序结束之后可以开始 2 前序开始后可以开始 + /// Default:NULL::character varying + /// Nullable:True + /// + public string connection_method { get; set; } + + /// + /// Desc:生产描述 + /// Default:NULL::character varying + /// Nullable:True + /// + public string descrip { get; set; } + } +} \ No newline at end of file diff --git a/BasicData/Tnb.BasicData.Entitys/Entity/BasRouteH.cs b/BasicData/Tnb.BasicData.Entitys/Entity/BasRouteH.cs new file mode 100644 index 00000000..366d9577 --- /dev/null +++ b/BasicData/Tnb.BasicData.Entitys/Entity/BasRouteH.cs @@ -0,0 +1,107 @@ +using SqlSugar; +using Tnb.Common.Contracts; + +namespace Tnb.BasicData.Entities +{ + /// + ///工艺路线 + /// + [SugarTable("bas_route_h")] + public class BasRouteH : BaseEntity + { + public BasRouteH() + { + } + + /// + /// Desc:编号 + /// Default: + /// Nullable:False + /// + public string code { get; set; } + + /// + /// Desc:名称 + /// Default: + /// Nullable:False + /// + public string name { get; set; } + + /// + /// Desc:有效开始时间 + /// Default: + /// Nullable:True + /// + public DateTime? start_time { get; set; } + + /// + /// Desc:有效结束时间 + /// Default: + /// Nullable:True + /// + public DateTime? end_time { get; set; } + + /// + /// Desc:0 未发布 1 已发布 + /// Default: + /// Nullable:False + /// + public string status { get; set; } + + /// + /// Desc:创建时间 + /// Default: + /// Nullable:True + /// + public DateTime? create_time { get; set; } + + /// + /// Desc:修改时间 + /// Default: + /// Nullable:True + /// + public DateTime? modify_time { get; set; } + + /// + /// Desc:是否永远有效 + /// Default: + /// Nullable:False + /// + public int is_always_valid { get; set; } + + /// + /// Desc:扩展字段 + /// Default: + /// Nullable:True + /// + public string extras { get; set; } + + /// + /// Desc:所属组织ID + /// Default:NULL::character varying + /// Nullable:True + /// + public string org_id { get; set; } + + /// + /// Desc:创建用户 + /// Default:NULL::character varying + /// Nullable:True + /// + public string create_id { get; set; } + + /// + /// Desc:修改用户 + /// Default:NULL::character varying + /// Nullable:True + /// + public string modify_id { get; set; } + + /// + /// Desc:备注 + /// Default:NULL::character varying + /// Nullable:True + /// + public string remark { get; set; } + } +} \ No newline at end of file diff --git a/BasicData/Tnb.BasicData.Entitys/Mapper/Mapper.cs b/BasicData/Tnb.BasicData.Entitys/Mapper/Mapper.cs index 62a2b39b..12c508bc 100644 --- a/BasicData/Tnb.BasicData.Entitys/Mapper/Mapper.cs +++ b/BasicData/Tnb.BasicData.Entitys/Mapper/Mapper.cs @@ -1,15 +1,14 @@ using Mapster; using SqlSugar; -using Tnb.BasicData.Entitys.Dto.ProcessManage; -using Tnb.BasicData.Entitys.Entity; +using Tnb.BasicData.Entities.Dto; -namespace Tnb.BasicData.Entitys.Mapper +namespace Tnb.BasicData.Entities { public class Mapper : IRegister { public void Register(TypeAdapterConfig config) { - config.ForType(); + config.ForType(); } } } diff --git a/BasicData/Tnb.BasicData.Interfaces/IBasEbomService.cs b/BasicData/Tnb.BasicData.Interfaces/IBasEbomService.cs new file mode 100644 index 00000000..b51afb7d --- /dev/null +++ b/BasicData/Tnb.BasicData.Interfaces/IBasEbomService.cs @@ -0,0 +1,9 @@ +using Tnb.BasicData.Entities.Dto; + +namespace Tnb.BasicData.Interfaces +{ + public interface IBasEbomService + { + public Task GetTree(EbomTreeQueryInput queryInput); + } +} \ No newline at end of file diff --git a/BasicData/Tnb.BasicData.Interfaces/IBasMaterialService.cs b/BasicData/Tnb.BasicData.Interfaces/IBasMaterialService.cs new file mode 100644 index 00000000..3fce3259 --- /dev/null +++ b/BasicData/Tnb.BasicData.Interfaces/IBasMaterialService.cs @@ -0,0 +1,7 @@ +namespace Tnb.BasicData.Interfaces +{ + public interface IBasMaterialService + { + + } +} \ No newline at end of file diff --git a/BasicData/Tnb.BasicData.Interfaces/IBasMbomService.cs b/BasicData/Tnb.BasicData.Interfaces/IBasMbomService.cs new file mode 100644 index 00000000..97007bfc --- /dev/null +++ b/BasicData/Tnb.BasicData.Interfaces/IBasMbomService.cs @@ -0,0 +1,7 @@ +namespace Tnb.BasicData.Interfaces +{ + public interface IBasMbomService + { + + } +} \ No newline at end of file diff --git a/BasicData/Tnb.BasicData.Interfaces/IBasRouteService.cs b/BasicData/Tnb.BasicData.Interfaces/IBasRouteService.cs new file mode 100644 index 00000000..e986bd82 --- /dev/null +++ b/BasicData/Tnb.BasicData.Interfaces/IBasRouteService.cs @@ -0,0 +1,17 @@ +namespace Tnb.BasicData.Interfaces +{ + public interface IBasRouteService + { + /// + /// 发布工艺路线 + /// + /// 工艺路线id id + public Task Publish(Dictionary parameters); + + /// + /// 复制工艺路线 + /// + /// 工艺路线id id + public Task Copy(Dictionary parameters); + } +} \ No newline at end of file diff --git a/BasicData/Tnb.BasicData/EbomService.cs b/BasicData/Tnb.BasicData/BasEbomService.cs similarity index 82% rename from BasicData/Tnb.BasicData/EbomService.cs rename to BasicData/Tnb.BasicData/BasEbomService.cs index 080d490f..b91dd36a 100644 --- a/BasicData/Tnb.BasicData/EbomService.cs +++ b/BasicData/Tnb.BasicData/BasEbomService.cs @@ -4,10 +4,9 @@ using JNPF.DynamicApiController; using JNPF.Systems.Interfaces.System; using Microsoft.AspNetCore.Mvc; using SqlSugar; -using Tnb.BasicData.Entitys.Entity; -using Tnb.BasicData.Entitys.Dto; -using Tnb.BasicData.Entitys; -using JNPF.Common.Const; +using Tnb.BasicData.Entities; +using Tnb.BasicData.Entities.Dto; +using Tnb.BasicData.Interfaces; namespace Tnb.BasicData { @@ -16,13 +15,13 @@ namespace Tnb.BasicData /// [ApiDescriptionSettings(Tag = ModuleConst.Tag, Area = ModuleConst.Area, Order = 1102)] [Route("api/[area]/[controller]/[action]")] - public class EbomService : IDynamicApiController, ITransient + public class BasEbomService : IBasEbomService,IDynamicApiController, ITransient { private readonly ISqlSugarRepository _repository; private readonly DataBaseManager _dbManager; private readonly IDictionaryDataService _dictionaryDataService; - public EbomService( + public BasEbomService( ISqlSugarRepository repository,DataBaseManager dbManager,IDictionaryDataService dictionaryDataService) { _repository = repository; @@ -53,7 +52,7 @@ namespace Tnb.BasicData .LeftJoin((a,b)=>a.ebom_id==b.id) .LeftJoin((a,b,c)=>a.material_id==c.id) .LeftJoin((a,b,c,d)=>a.material_id==d.material_id) - .LeftJoin((a,b,c,d,e)=>d.route_id==e.id) + .LeftJoin((a,b,c,d,e)=>d.route_id==e.id) .LeftJoin((a,b,c,d,e,f)=>a.substitute_material_id==f.id) .Where((a,b,c)=>a.ebom_id==queryInput.ebomId) .Select((a,b,c,d,e,f)=>new EbomTreeOutput @@ -62,11 +61,12 @@ namespace Tnb.BasicData material_id_descrip = c.descrip, material_id_remark = c.remark, material_id_unit_id = c.unit_id, + material_id_id = c.id, feeding_control = a.feeding_control, loss_rate = a.loss_rate, quantity = a.quantity, require_weight = a.require_weight, - route_name = e.Name, + route_name = e.name, version = d.version, substitute_material_id = f.name, hasChildren = SqlFunc.Subqueryable().Where(x=>x.material_id==a.material_id).Any(), @@ -82,7 +82,7 @@ namespace Tnb.BasicData .LeftJoin((a,b)=>a.ebom_id==b.id) .LeftJoin((a,b,c)=>a.material_id==c.id) .LeftJoin((a,b,c,d)=>a.material_id==d.material_id) - .LeftJoin((a,b,c,d,e)=>d.route_id==e.id) + .LeftJoin((a,b,c,d,e)=>d.route_id==e.id) .LeftJoin((a,b,c,d,e,f)=>a.substitute_material_id==f.id) .Where((a,b,c)=>b.material_id==queryInput.materialId && a.ebom_id==b.id) .Select((a,b,c,d,e,f)=>new EbomTreeOutput @@ -91,11 +91,12 @@ namespace Tnb.BasicData material_id_descrip = c.descrip, material_id_remark = c.remark, material_id_unit_id = c.unit_id, + material_id_id = c.id, feeding_control = a.feeding_control, loss_rate = a.loss_rate, quantity = a.quantity, require_weight = a.require_weight, - route_name = e.Name, + route_name = e.name, version = d.version, substitute_material_id = f.name, hasChildren = SqlFunc.Subqueryable().Where(x=>x.material_id==a.material_id).Any(), @@ -109,9 +110,15 @@ namespace Tnb.BasicData } + /// + /// 根据物料ID获取版本号和工艺路线 + /// + /// 物料id materialId + /// [HttpPost] - public async Task> GetEbomVersionAndRouteName(string materialId) + public async Task> GetEbomVersionAndRouteName(Dictionary parameters) { + string materialId = parameters["materialId"]; var db = _repository.AsSugarClient(); // var momDbLink = await _repository.AsSugarClient().Queryable().FirstAsync(x => x.FullName == DbName.TNBMON); @@ -121,17 +128,20 @@ namespace Tnb.BasicData // } var ebom = await db.Queryable() - .LeftJoin((a,b)=>a.route_id==b.id) + .LeftJoin((a,b)=>a.route_id==b.id) + .OrderByDescending((a,b)=>a.create_time) .Where((a,b) => a.material_id == materialId) .Select((a,b)=>new { + a.id, a.version, - b.Name, - }).SingleAsync(); + b.name, + }).FirstAsync(); return new Dictionary() { ["version"] = ebom?.version, - ["routeName"] = ebom?.Name + ["routeName"] = ebom?.name, + ["routeId"] = ebom?.id , }; } diff --git a/BasicData/Tnb.BasicData/BasMaterialService.cs b/BasicData/Tnb.BasicData/BasMaterialService.cs new file mode 100644 index 00000000..f855644e --- /dev/null +++ b/BasicData/Tnb.BasicData/BasMaterialService.cs @@ -0,0 +1,89 @@ +using JNPF.Common.Core.Manager; +using JNPF.DependencyInjection; +using JNPF.DynamicApiController; +using JNPF.Systems.Interfaces.System; +using Microsoft.AspNetCore.Mvc; +using SqlSugar; +using Tnb.BasicData.Entities; +using Tnb.BasicData.Interfaces; + +namespace Tnb.BasicData +{ + /// + /// 物料档案 + /// + [ApiDescriptionSettings(Tag = ModuleConst.Tag, Area = ModuleConst.Area, Order = 1102)] + [Route("api/[area]/[controller]/[action]")] + public class BasMaterialService : IBasMaterialService,IDynamicApiController, ITransient + { + private readonly ISqlSugarRepository _repository; + private readonly DataBaseManager _dbManager; + private readonly IDictionaryDataService _dictionaryDataService; + + public BasMaterialService( + ISqlSugarRepository repository,DataBaseManager dbManager,IDictionaryDataService dictionaryDataService) + { + _repository = repository; + _dbManager = dbManager; + _dictionaryDataService = dictionaryDataService; + } + + // [HttpPost] + // public async Task> GetEbomVersionAndRouteName(Dictionary parameters) + // { + // string materialId = parameters["materialId"]; + // var db = _repository.AsSugarClient(); + // var dic = await _dictionaryDataService.GetDicByKey(DicTypeKey.MeasurementUnit); + // // var momDbLink = await _repository.AsSugarClient().Queryable().FirstAsync(x => x.FullName == DbName.TNBMON); + // // if (momDbLink != null) + // // { + // // db = _dbManager.ChangeDataBase(momDbLink); + // // } + // + // var ebom = await db.Queryable() + // .LeftJoin((a,b)=>a.route_id==b.id) + // .Where((a,b) => a.material_id == materialId) + // .Select((a,b)=>new + // { + // a.id, + // a.version, + // b.name, + // }).SingleAsync(); + // return new Dictionary() + // { + // ["version"] = ebom?.version, + // ["routeName"] = ebom?.name, + // ["routeId"] = ebom?.id + // }; + // } + + // [HttpPost] + // public async Task> GetMaterialUnits(Dictionary parameters) + // { + // string materialId = parameters["materialId"]; + // var db = _repository.AsSugarClient(); + // + // var type = await db.Queryable().Where(x => x.EnCode == DictConst.MeasurementUnit) + // .SingleAsync(); + // string typeId = type?.Id; + // var queryable1 = db.Queryable() + // .LeftJoin((a,b)=>a.unit_id==b.EnCode && b.DictionaryTypeId==typeId) + // .Where((a,b) => a.Id == materialId) + // .Select((a,b)=> new ElementSelectDto + // { + // value = b.EnCode, + // label = b.FullName, + // }); + // var queryable2 = db.Queryable() + // .LeftJoin((a,b)=>a.pickunit_id==b.EnCode && b.DictionaryTypeId==typeId) + // .Where((a,b) => a.Id == materialId) + // .Select((a,b)=> new ElementSelectDto + // { + // value = b.EnCode, + // label = b.FullName, + // }); + // List data = await db.Union(queryable1, queryable2).ToListAsync(); + // return data; + // } + } +} \ No newline at end of file diff --git a/BasicData/Tnb.BasicData/BasMbomService.cs b/BasicData/Tnb.BasicData/BasMbomService.cs new file mode 100644 index 00000000..30b65047 --- /dev/null +++ b/BasicData/Tnb.BasicData/BasMbomService.cs @@ -0,0 +1,32 @@ +using JNPF.Common.Core.Manager; +using JNPF.DependencyInjection; +using JNPF.DynamicApiController; +using JNPF.Systems.Interfaces.System; +using Microsoft.AspNetCore.Mvc; +using SqlSugar; +using Tnb.BasicData.Entities; +using Tnb.BasicData.Interfaces; + +namespace Tnb.BasicData +{ + /// + /// 生产bom + /// + [ApiDescriptionSettings(Tag = ModuleConst.Tag, Area = ModuleConst.Area, Order = 1102)] + [Route("api/[area]/[controller]/[action]")] + public class BasMbomService : IBasMbomService,IDynamicApiController, ITransient + { + private readonly ISqlSugarRepository _repository; + private readonly DataBaseManager _dbManager; + private readonly IDictionaryDataService _dictionaryDataService; + + public BasMbomService( + ISqlSugarRepository repository,DataBaseManager dbManager,IDictionaryDataService dictionaryDataService) + { + _repository = repository; + _dbManager = dbManager; + _dictionaryDataService = dictionaryDataService; + } + + } +} \ No newline at end of file diff --git a/BasicData/Tnb.BasicData/BasRouteService.cs b/BasicData/Tnb.BasicData/BasRouteService.cs new file mode 100644 index 00000000..1a1f37fb --- /dev/null +++ b/BasicData/Tnb.BasicData/BasRouteService.cs @@ -0,0 +1,76 @@ +using JNPF.Common.Core.Manager; +using JNPF.Common.Security; +using JNPF.DependencyInjection; +using JNPF.DynamicApiController; +using Microsoft.AspNetCore.Mvc; +using SqlSugar; +using Tnb.BasicData.Entities; +using Tnb.BasicData.Interfaces; + +namespace Tnb.BasicData +{ + /// + /// 物料清单 + /// + [ApiDescriptionSettings(Tag = ModuleConst.Tag, Area = ModuleConst.Area, Order = 701)] + [Route("api/[area]/[controller]/[action]")] + public class BasRouteService : IBasRouteService,IDynamicApiController, ITransient + { + private readonly ISqlSugarRepository _repository; + + + public BasRouteService( + UserManager userManager, + ISqlSugarRepository repository) + { + _repository = repository; + } + + /// + /// 发布工艺路线 + /// + /// 工艺路线id id + [HttpPost] + public async Task Publish(Dictionary parameters) + { + string id = parameters["id"]; + + await _repository.UpdateAsync(x => new BasRouteH() + { + status = "1", + }, x => x.id == id); + } + + /// + /// 复制工艺路线 + /// + /// 工艺路线id id + [HttpPost] + public async Task Copy(Dictionary parameters) + { + string id = parameters["id"]; + BasRouteH basRouteH = await _repository.GetByIdAsync(id); + + List basRouteDs = await _repository.AsSugarClient().Queryable().Where(x => x.route_id == id).ToListAsync(); + + string newId = SnowflakeIdHelper.NextId(); + basRouteH.id = newId; + basRouteH.code += "_复制的请修改"; + basRouteH.name += "_复制的请修改"; + + DbResult result = await _repository.AsSugarClient().Ado.UseTranAsync(async () => + { + await _repository.InsertAsync(basRouteH); + foreach (BasRouteD basRouteD in basRouteDs) + { + basRouteD.id = SnowflakeIdHelper.NextId(); + basRouteD.route_id = newId; + } + + await _repository.AsSugarClient().Insertable(basRouteDs).ExecuteCommandAsync(); + }); + + return result.IsSuccess ? "复制成功" : result.ErrorMessage; + } + } +} \ No newline at end of file diff --git a/BasicData/Tnb.BasicData/MaterialService.cs b/BasicData/Tnb.BasicData/MaterialService.cs deleted file mode 100644 index af81ef71..00000000 --- a/BasicData/Tnb.BasicData/MaterialService.cs +++ /dev/null @@ -1,88 +0,0 @@ -using JNPF.Common.Core.Manager; -using JNPF.DependencyInjection; -using JNPF.DynamicApiController; -using JNPF.Systems.Entitys.System; -using JNPF.Systems.Interfaces.System; -using Microsoft.AspNetCore.Mvc; -using SqlSugar; -using Tnb.BasicData.Entitys; -using Tnb.BasicData.Entitys.Entity; - -namespace Tnb.BasicData -{ - /// - /// 物料档案 - /// - [ApiDescriptionSettings(Tag = ModuleConst.Tag, Area = ModuleConst.Area, Order = 1102)] - [Route("api/[area]/[controller]/[action]")] - public class MaterialService : IDynamicApiController, ITransient - { - private readonly ISqlSugarRepository _repository; - private readonly DataBaseManager _dbManager; - private readonly IDictionaryDataService _dictionaryDataService; - - public MaterialService( - ISqlSugarRepository repository,DataBaseManager dbManager,IDictionaryDataService dictionaryDataService) - { - _repository = repository; - _dbManager = dbManager; - _dictionaryDataService = dictionaryDataService; - } - - [HttpPost] - public async Task> GetEbomVersionAndRouteName(string materialId) - { - var db = _repository.AsSugarClient(); - var dic = await _dictionaryDataService.GetDicByKey(DictConst.MeasurementUnit); - // var momDbLink = await _repository.AsSugarClient().Queryable().FirstAsync(x => x.FullName == DbName.TNBMON); - // if (momDbLink != null) - // { - // db = _dbManager.ChangeDataBase(momDbLink); - // } - - var ebom = await db.Queryable() - .LeftJoin((a,b)=>a.route_id==b.id) - .Where((a,b) => a.material_id == materialId) - .Select((a,b)=>new - { - a.id, - a.version, - b.Name, - }).SingleAsync(); - return new Dictionary() - { - ["version"] = ebom?.version, - ["routeName"] = ebom?.Name, - ["routeId"] = ebom?.id - }; - } - - [HttpPost] - public async Task> GetMaterialUnits(string materialId) - { - var db = _repository.AsSugarClient(); - - var type = await db.Queryable().Where(x => x.EnCode == DictConst.MeasurementUnit) - .SingleAsync(); - string typeId = type?.Id; - var queryable1 = db.Queryable() - .LeftJoin((a,b)=>a.unit_id==b.EnCode && b.DictionaryTypeId==typeId) - .Where((a,b) => a.id == materialId) - .Select((a,b)=> new ElementSelectDto - { - value = b.EnCode, - label = b.FullName, - }); - var queryable2 = db.Queryable() - .LeftJoin((a,b)=>a.pickunit_id==b.EnCode && b.DictionaryTypeId==typeId) - .Where((a,b) => a.id == materialId) - .Select((a,b)=> new ElementSelectDto - { - value = b.EnCode, - label = b.FullName, - }); - List data = await db.Union(queryable1, queryable2).ToListAsync(); - return data; - } - } -} \ No newline at end of file diff --git a/ProductionMgr/Tnb.ProductionMgr/PrdMoService.cs b/ProductionMgr/Tnb.ProductionMgr/PrdMoService.cs index 4da1bcf1..52714c7f 100644 --- a/ProductionMgr/Tnb.ProductionMgr/PrdMoService.cs +++ b/ProductionMgr/Tnb.ProductionMgr/PrdMoService.cs @@ -9,7 +9,6 @@ using Mapster; using Microsoft.AspNetCore.Mvc; using SqlSugar; using Tnb.BasicData; -using Tnb.BasicData.Entitys; using Tnb.BasicData.Entitys.Entity; using Tnb.EquipMgr.Entities; using Tnb.ProductionMgr.Entities; diff --git a/apihost/Tnb.API.Entry/Configurations/Cors.json b/apihost/Tnb.API.Entry/Configurations/Cors.json index 0e26fc64..0378afda 100644 --- a/apihost/Tnb.API.Entry/Configurations/Cors.json +++ b/apihost/Tnb.API.Entry/Configurations/Cors.json @@ -1,7 +1,7 @@ { "CorsAccessorSettings": { "PolicyName": "JNPFCorsAccessor", - "WithOrigins": [ "http://localhost:9230", "http://localhost:8080" ], + "WithOrigins": [ "http://192.168.10.12:9230", "http://localhost:8080" ], "WithExposedHeaders": [ "access-token", "x-access-token", "Content-Disposition" ] } } \ No newline at end of file