diff --git a/admin.net.pro/Admin.NET/Vistar.Application/Service/ProductDesignLibrary/Dto/BomPageProductDesignLibraryInput.cs b/admin.net.pro/Admin.NET/Vistar.Application/Service/ProductDesignLibrary/Dto/BomPageProductDesignLibraryInput.cs new file mode 100644 index 0000000..facba87 --- /dev/null +++ b/admin.net.pro/Admin.NET/Vistar.Application/Service/ProductDesignLibrary/Dto/BomPageProductDesignLibraryInput.cs @@ -0,0 +1,230 @@ +// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。 +// +// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。 +// +// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任! + +using Admin.NET.Core; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Vistar.Application.Service.ProductDesignLibrary.Dto; +public class BomPageProductDesignLibraryInput : BasePageInput +{ + /// + /// 子物料描述 + /// + public string? Description { get; set; } + + /// + /// 子物料编码 + /// + public string? PartNumber { get; set; } + + /// + /// 父Guid + /// + public string ParentGuid { get; set; } + + public string ChildGuid { get; set; } + + public long ChildObjID { get; set; } + + public long ConfigId { get; set; } + + public int? childVersion { get; set; } + + public int ParentVersion { get; set; } + + public bool? isDeleted { get; set; } + + public long ConfigInstanceID { get; set; } + + public long? ChildConfigID { get; set; } + + public long? CreatedUserID { get; set; } + + public long? ModifiedUserID { get; set; } + + public DateTime? CreatedDate { get; set; } + + public DateTime? ModifiedDate { get; set; } + + public double? Quantity { get; set; } + + public DateTime? EffectiveFrom { get; set; } + + public DateTime? EffectiveTo { get; set; } + + public string? Revision { get; set; } + + public string? Marker { get; set; } + + public string Type { get; set; } + + public long? ConfigParent { get; set; } + + public long? OrderIndex { get; set; } + + + public string? _conf_24_tralala { get; set; } + + public string? _conf_28_hello { get; set; } + + public string? _conf_28_sss { get; set; } + + public string? conf_29_sss { get; set; } + + public byte[]? RecordImage { get; set; } + + public string? Folder { get; set; } + + public int? CheckedStatus { get; set; } + + public string? _TestConfigurimi_tralala { get; set; } + + public string? _TestConfigurimi_asfasd { get; set; } + + public long ParentObjectID { get; set; } + + public string? conf_30_somefields { get; set; } + + public string? conf_30_TestNBS { get; set; } + + public DateTime? conf_30_testDate { get; set; } + + public long? conf_30_testNumber { get; set; } + + public string? conf_30_TestList { get; set; } + + public long? conf_30_testListNo { get; set; } + + public double? conf_30_testListdecimal { get; set; } + + public string? conf_33_Comments { get; set; } + + //public string? conf_33_SerialNo. { get; set; } + public string? conf_33_SerialNo { get; set; } + + public long? conf_33_TestContacts2 { get; set; } + + public long? conf_33_TestContacts2_Rec { get; set; } + + public string? conf_6_Comments { get; set; } + + public string? conf_6_SerialNumber { get; set; } + + public int? ChildSwFileType { get; set; } + + public int? ParentSwFileType { get; set; } + + public string? conf_19_Serial { get; set; } + + public string? conf_19_Comments { get; set; } + + public string? conf_21_Comments { get; set; } + + public string? conf_19_testList { get; set; } + + public string? conf_21_BuyStage { get; set; } + + public string? conf_19_testconfigfieldnbs { get; set; } + + public string? conf_32_Comments { get; set; } + + public bool? isSuppressed { get; set; } + + public bool isAddedFromSW { get; set; } + + public double? QtyManual { get; set; } + + public long? SWPDMXrefId { get; set; } + + public string? SwConfiguration { get; set; } + + public bool inContext { get; set; } + + public string PrimaryFile { get; set; } + + public bool bKeepQuantityInSync { get; set; } + + public string? BOMGuid { get; set; } + + public bool IsPDMReference { get; set; } + + public string? BOMGuidCopiedFrom { get; set; } + + public int? SWPDMXRefConfigurationID { get; set; } + + public string? SWPDMXRefConfigurationName { get; set; } + + public string? fld004492 { get; set; } + + public string? fld004670 { get; set; } + + public string? fld004671 { get; set; } + + public string? fld004691 { get; set; } + + public string? fld004936 { get; set; } + + public string? fld004937 { get; set; } + + public string? fld004938 { get; set; } + + public string? fld004939 { get; set; } + + public string? fld004940 { get; set; } + + public string? fld004941 { get; set; } + + public double? fld004994 { get; set; } + + public string? fld004995 { get; set; } + + public string? fld004996 { get; set; } + + public string? fld004997 { get; set; } + + public double? fld005017 { get; set; } + + public string? fld005018 { get; set; } + + public string? fld005019 { get; set; } + + public string? fld005020 { get; set; } + public long? fld005296 { get; set; } + public long? fld005298 { get; set; } + public string? fld005541 { get; set; } + public string? fld005542 { get; set; } + public string? fld005543 { get; set; } + public string? fld005544 { get; set; } + public string? fld005545 { get; set; } + public string? fld005546 { get; set; } + public string? fld005547 { get; set; } + + /// + /// 工时 + /// + public string fld005571 { get; set; } + /// + /// 工时单位 + /// + public string fld005572 { get; set; } + /// + /// 控制码 + /// + public string fld005573 { get; set; } + /// + /// 组号 + /// + public string fld005574 { get; set; } + /// + /// 基本数量 + /// + public string fld005575 { get; set; } + +} diff --git a/admin.net.pro/Admin.NET/Vistar.Application/Service/ProductDesignLibrary/Dto/ProductDesignLibraryBomOutput.cs b/admin.net.pro/Admin.NET/Vistar.Application/Service/ProductDesignLibrary/Dto/ProductDesignLibraryBomOutput.cs new file mode 100644 index 0000000..d766903 --- /dev/null +++ b/admin.net.pro/Admin.NET/Vistar.Application/Service/ProductDesignLibrary/Dto/ProductDesignLibraryBomOutput.cs @@ -0,0 +1,474 @@ +// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。 +// +// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。 +// +// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任! + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Vistar.Application.Service.ProductDesignLibrary.Dto; +public class ProductDesignLibraryBomOutput +{ + /// + /// + /// + public string ParentGuid { get; set; } + + /// + /// + /// + public string ChildGuid { get; set; } + + /// + /// + /// + public long ChildObjID { get; set; } + + /// + /// + /// + public long ConfigId { get; set; } + + /// + /// + /// + public int? childVersion { get; set; } + + /// + /// + /// + public int ParentVersion { get; set; } + + /// + /// + /// + public bool? isDeleted { get; set; } + + /// + /// + /// + public long ConfigInstanceID { get; set; } + + /// + /// + /// + public long? ChildConfigID { get; set; } + + /// + /// + /// + public long? CreatedUserID { get; set; } + + /// + /// + /// + public long? ModifiedUserID { get; set; } + + /// + /// + /// + public DateTime? CreatedDate { get; set; } + + /// + /// + /// + public DateTime? ModifiedDate { get; set; } + + /// + /// + /// + public double? Quantity { get; set; } + + /// + /// + /// + public string? Description { get; set; } + + /// + /// + /// + public DateTime? EffectiveFrom { get; set; } + + /// + /// + /// + public DateTime? EffectiveTo { get; set; } + + /// + /// + /// + public string? Revision { get; set; } + + /// + /// + /// + public string? Marker { get; set; } + + /// + /// + /// + public string Type { get; set; } + + /// + /// + /// + public long? ConfigParent { get; set; } + + /// + /// + /// + public long? OrderIndex { get; set; } + + /// + /// + /// + public string? PartNumber { get; set; } + + /// + /// + /// + public string? _conf_24_tralala { get; set; } + + /// + /// + /// + public string? _conf_28_hello { get; set; } + + /// + /// + /// + public string? _conf_28_sss { get; set; } + + /// + /// + /// + public string? conf_29_sss { get; set; } + + /// + /// + /// + public byte[]? RecordImage { get; set; } + + /// + /// + /// + public string? Folder { get; set; } + + /// + /// + /// + public int? CheckedStatus { get; set; } + + /// + /// + /// + public string? _TestConfigurimi_tralala { get; set; } + + /// + /// + /// + public string? _TestConfigurimi_asfasd { get; set; } + + /// + /// + /// + public long ParentObjectID { get; set; } + + /// + /// + /// + public string? conf_30_somefields { get; set; } + + /// + /// + /// + public string? conf_30_TestNBS { get; set; } + + /// + /// + /// + public DateTime? conf_30_testDate { get; set; } + + /// + /// + /// + public long? conf_30_testNumber { get; set; } + + /// + /// + /// + public string? conf_30_TestList { get; set; } + + /// + /// + /// + public long? conf_30_testListNo { get; set; } + + /// + /// + /// + public double? conf_30_testListdecimal { get; set; } + + /// + /// + /// + public string? conf_33_Comments { get; set; } + + /// + /// + /// + //public string? conf_33_SerialNo. { get; set; } + public string? conf_33_SerialNo { get; set; } + + /// + /// + /// + public long? conf_33_TestContacts2 { get; set; } + + /// + /// + /// + public long? conf_33_TestContacts2_Rec { get; set; } + + /// + /// + /// + public string? conf_6_Comments { get; set; } + + /// + /// + /// + public string? conf_6_SerialNumber { get; set; } + + /// + /// + /// + public int? ChildSwFileType { get; set; } + + /// + /// + /// + public int? ParentSwFileType { get; set; } + + /// + /// + /// + public string? conf_19_Serial { get; set; } + + /// + /// + /// + public string? conf_19_Comments { get; set; } + + /// + /// + /// + public string? conf_21_Comments { get; set; } + + /// + /// + /// + public string? conf_19_testList { get; set; } + + /// + /// + /// + public string? conf_21_BuyStage { get; set; } + + /// + /// + /// + public string? conf_19_testconfigfieldnbs { get; set; } + + /// + /// + /// + public string? conf_32_Comments { get; set; } + + /// + /// + /// + public bool? isSuppressed { get; set; } + + /// + /// + /// + public bool isAddedFromSW { get; set; } + + /// + /// + /// + public double? QtyManual { get; set; } + + /// + /// + /// + public long? SWPDMXrefId { get; set; } + + /// + /// + /// + public string? SwConfiguration { get; set; } + + /// + /// + /// + public bool inContext { get; set; } + + /// + /// + /// + public string PrimaryFile { get; set; } + + /// + /// + /// + public bool bKeepQuantityInSync { get; set; } + + /// + /// + /// + public string? BOMGuid { get; set; } + + /// + /// + /// + public bool IsPDMReference { get; set; } + + /// + /// + /// + public string? BOMGuidCopiedFrom { get; set; } + + /// + /// + /// + public int? SWPDMXRefConfigurationID { get; set; } + + /// + /// + /// + public string? SWPDMXRefConfigurationName { get; set; } + + /// + /// + /// + public string? fld004492 { get; set; } + + /// + /// + /// + public string? fld004670 { get; set; } + + /// + /// + /// + public string? fld004671 { get; set; } + + /// + /// + /// + public string? fld004691 { get; set; } + + /// + /// + /// + public string? fld004936 { get; set; } + + /// + /// + /// + public string? fld004937 { get; set; } + + /// + /// + /// + public string? fld004938 { get; set; } + + /// + /// + /// + public string? fld004939 { get; set; } + + /// + /// + /// + public string? fld004940 { get; set; } + + /// + /// + /// + public string? fld004941 { get; set; } + + /// + /// + /// + public double? fld004994 { get; set; } + + /// + /// + /// + public string? fld004995 { get; set; } + + /// + /// + /// + public string? fld004996 { get; set; } + + /// + /// + /// + public string? fld004997 { get; set; } + + /// + /// + /// + public double? fld005017 { get; set; } + + /// + /// + /// + public string? fld005018 { get; set; } + + /// + /// + /// + public string? fld005019 { get; set; } + + /// + /// + /// + public string? fld005020 { get; set; } + public string? fld005541 { get; set; } + public string? fld005542 { get; set; } + public string? fld005543 { get; set; } + public string? fld005544 { get; set; } + public string? fld005545 { get; set; } + public string? fld005546 { get; set; } + public string? fld005547 { get; set; } + + /// + /// 工时 + /// + public string fld005571 { get; set; } + /// + /// 工时单位 + /// + public string fld005572 { get; set; } + /// + /// 控制码 + /// + public string fld005573 { get; set; } + /// + /// 组号 + /// + public string fld005574 { get; set; } + /// + /// 基本数量 + /// + public string fld005575 { get; set; } +} diff --git a/admin.net.pro/Admin.NET/Vistar.Application/Service/ProductDesignLibrary/Dto/ProductDesignLibraryInput.cs b/admin.net.pro/Admin.NET/Vistar.Application/Service/ProductDesignLibrary/Dto/ProductDesignLibraryInput.cs new file mode 100644 index 0000000..3b5a1a4 --- /dev/null +++ b/admin.net.pro/Admin.NET/Vistar.Application/Service/ProductDesignLibrary/Dto/ProductDesignLibraryInput.cs @@ -0,0 +1,502 @@ +// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。 +// +// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。 +// +// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任! + +using Admin.NET.Core; +using SqlSugar; +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Vistar.Application.Service.ProductDesignLibrary.Dto; +/// +/// 产品设计库输入参数 +/// +public class ProductDesignLibraryInput +{ + public long idRecord { get; set; } + + public int? CheckedStatus { get; set; } + + public int? VersionIndex { get; set; } + + public bool? IsLatestVersion { get; set; } + + public DateTime? CreatedDate { get; set; } + + public DateTime? VersionCreatedDate { get; set; } + + public DateTime? dateModified { get; set; } + + public long? UserCreatedId { get; set; } + + public long? VersionUserCreatedId { get; set; } + + public long? UserModifiedId { get; set; } + + public string? RecordGuid { get; set; } + + public bool? isVisibilityNormal { get; set; } + + public bool? deleted { get; set; } + + public string? SubObjectGuid { get; set; } + + public bool? PreviousStatus { get; set; } + + public string? revision { get; set; } + + public byte[]? Record_image160_160 { get; set; } + + public byte[]? Record_Image320_240 { get; set; } + + public byte[]? Record_ImageMax { get; set; } + + public string? _System_objNBS { get; set; } + + public string? _System_ObjDescription { get; set; } + + public DateTime? _System_Effectivity_Begin { get; set; } + + public DateTime? _System_Effectivity_End { get; set; } + + public string? CheckedOutPc { get; set; } + + public long? StageId { get; set; } + + public long? ProjectManager { get; set; } + + public long? ProjectManager_Rec { get; set; } + + public bool? EnableNotifications { get; set; } + + public long? GroupObjId { get; set; } + + public bool? _CheckOutInProgress { get; set; } + + public string? ParentRecordGuid { get; set; } + + public string? MaterialType { get; set; } + + public bool? _System_NeedSWRebuild { get; set; } + + public string? _system_objConfigurationName { get; set; } + + public bool? _system_objConfigurationType { get; set; } + + public string? _system_objConfigurationGuid { get; set; } + + public string ShowBomFromConfiguration { get; set; } + + public string _System_ObjNbsAuto { get; set; } + + public long? PreviousIdRecord { get; set; } + + public string? _System_DerivedFrom { get; set; } + + public bool? _system_objLinkedCompare { get; set; } + + public string? _System_WebLink { get; set; } + + public bool? isReleasedVersion { get; set; } + + public string? _System_DerivedFrom_RecordGuid { get; set; } + + public long? SWPDMDocumentId { get; set; } + + public long? SWPDMConfigurationID { get; set; } + + public string? SWPDMConfigurationName { get; set; } + + public long? SWPDMActiveConfigurationId { get; set; } + + public string? SWPDMActiveConfigurationName { get; set; } + + public string? SWPDMFileName { get; set; } + + public long? SWPDMConfigPersistID { get; set; } + + public int? SWPDMStatusId { get; set; } + + public string? SWPDMStatusName { get; set; } + + public bool? _SWPDM_1179__SW_Detailing_Mode_ { get; set; } + + public string? _SWPDM_2__SW_Last_Saved_With_ { get; set; } + + public string? _SWPDM_111_A___ { get; set; } + + public string? _SWPDM_1172_BOM_BOM__ { get; set; } + + public string? _SWPDM_112_BOM___2 { get; set; } + + public string? _SWPDM_113_BOM___ { get; set; } + + public string? _SWPDM_115_BOM___ { get; set; } + + public string? _SWPDM_116_BOM___ { get; set; } + + public string? _SWPDM_117_BOM_____ { get; set; } + + public string? _SWPDM_51_BOM_____ { get; set; } + + public string? _SWPDM_118_BOM_____ { get; set; } + + public string? _SWPDM_119_BOM___ { get; set; } + + public string? _SWPDM_114_BOM_____ { get; set; } + + public string? _SWPDM_120_BOM______ { get; set; } + + public string? _SWPDM_121_BOM___ { get; set; } + + public string? _SWPDM_122_BOW___1 { get; set; } + + public string? _SWPDM_123_BOW___ { get; set; } + + public string? _SWPDM_84_DWG___ { get; set; } + + public string? _SWPDM_82_DWG___ { get; set; } + + public string? _SWPDM_80_DWG_____ { get; set; } + + public string? _SWPDM_76_DWG___ { get; set; } + + public string? _SWPDM_77_DWG___ { get; set; } + + public string? _SWPDM_78_DWG___ { get; set; } + + public string? _SWPDM_79_DWG___ { get; set; } + + public string? _SWPDM_83_DWG___ { get; set; } + + public string? _SWPDM_81_DWG___ { get; set; } + + public string? _SWPDM_92_FB___ { get; set; } + + public string? _SWPDM_86_FB_____ { get; set; } + + public string? _SWPDM_87_FB_____ { get; set; } + + public string? _SWPDM_88_FB_____ { get; set; } + + public string? _SWPDM_89_FB_____ { get; set; } + + public string? _SWPDM_90_FB______ { get; set; } + + public string? _SWPDM_85_FB____ { get; set; } + + public string? _SWPDM_91_FB_____ { get; set; } + public string? _SWPDM_94_PDF___ { get; set; } + + public string? _SWPDM_101_PDF___ { get; set; } + + public string? _SWPDM_95_PDF_____ { get; set; } + + public string? _SWPDM_96_PDF___ { get; set; } + + public string? _SWPDM_97_PDF___ { get; set; } + + public string? _SWPDM_98_PDF___ { get; set; } + + public string? _SWPDM_93_PDF___ { get; set; } + + public string? _SWPDM_99_PDF___ { get; set; } + + public string? _SWPDM_100_PDF___ { get; set; } + + public string? _SWPDM_1194_q { get; set; } + + public string? _SWPDM_1196_SAP_____ { get; set; } + + public string? _SWPDM_1199_SAP___ { get; set; } + + public string? _SWPDM_1187_SAP___ { get; set; } + + public double? _SWPDM_1190_SAP___ { get; set; } + + public string? _SWPDM_1191_SAP___ { get; set; } + + public string? _SWPDM_1188_SAP___ { get; set; } + + public string? _SWPDM_1197_SAP_____ { get; set; } + + public string? _SWPDM_1210_SAP_____ { get; set; } + + public string? _SWPDM_1189_SAP___ID_____ { get; set; } + + public string? _SWPDM_1200_SAP_____ { get; set; } + public string? _SWPDM_1208_SAP___BOM___ { get; set; } + + public string? _SWPDM_1201_SAP_____ { get; set; } + + public string? _SWPDM_1198_SAP_____ { get; set; } + + public string? _SWPDM_1193_SAP___ { get; set; } + + public string? _SWPDM_1195_SAP_____ { get; set; } + + public string? _SWPDM_1186_SAP_____ { get; set; } + + public string? _SWPDM_1209_SAP_____ { get; set; } + + public string? _SWPDM_1203_SAP____ { get; set; } + + public string? _SWPDM_1185_SAP___ { get; set; } + + public string? _SWPDM_1192_SAP_____ { get; set; } + + public string? _SWPDM_1184_SIP_____ { get; set; } + + public string? _SWPDM_1183_SIP_____ { get; set; } + + public string? _SWPDM_1182_SOP_____ { get; set; } + + public string? _SWPDM_1181_SOP_____ { get; set; } + + public string? _SWPDM_46_SW___ { get; set; } + + public string? _SWPDM_60_SW___ { get; set; } + + public string? _SWPDM_124_SW___ { get; set; } + + public string? _SWPDM_102_SW___ { get; set; } + + public string? _SWPDM_56_SW____ { get; set; } + + public string? _SWPDM_57_SW______ { get; set; } + + public string? _SWPDM_61_SW_____ { get; set; } + + public string? _SWPDM_62_SW___ { get; set; } + + public string? _SWPDM_125_SW___ { get; set; } + + public string? _SWPDM_126_SW___ { get; set; } + + public string? _SWPDM_127_SW_____ { get; set; } + + public string? _SWPDM_1205_SW_______ { get; set; } + + public string? _SWPDM_47_SW___ { get; set; } + + public string? _SWPDM_48_SW_____ { get; set; } + + public string? _SWPDM_54_SW___ { get; set; } + + public string? _SWPDM_55_SW_____ { get; set; } + + public string? _SWPDM_66_SW___ { get; set; } + + public string? _SWPDM_154_SW_____ { get; set; } + + public string? _SWPDM_63_SW___ { get; set; } + + public string? _SWPDM_64_SW___ { get; set; } + + public string? _SWPDM_65_SW___ { get; set; } + + public string? _SWPDM_128_SW_____ { get; set; } + + public string? _SWPDM_1206_SW_______ { get; set; } + + public string? _SWPDM_52_SW___ { get; set; } + + public string? _SWPDM_53_SW_____ { get; set; } + + public string? _SWPDM_58_SW___ { get; set; } + + public string? _SWPDM_59_SW_____ { get; set; } + + public string? _SWPDM_1178_SW_____ { get; set; } + + public string? _SWPDM_1202_SW_____ { get; set; } + + public string? _SWPDM_49_SW___ { get; set; } + + public string? _SWPDM_129_SW_____ { get; set; } + + public string? _SWPDM_1207_SW_______ { get; set; } + + public string? _SWPDM_130_SW___ { get; set; } + + public string? _SWPDM_50_SW_____ { get; set; } + + public string? _SWPDM_131_SW_____ { get; set; } + + public string? _SWPDM_155_SW_____ { get; set; } + + public string? _SWPDM_1175_SW_____ { get; set; } + + public string? _SWPDM_1177_SW_____ { get; set; } + + public string? _SWPDM_1170_SW___ { get; set; } + + public string? _SWPDM_1171_SW_____ { get; set; } + + public string? _SWPDM_1173_SW____ { get; set; } + + public string? _SWPDM_132_SW_____ { get; set; } + + public string? _SWPDM_1204_SW_______ { get; set; } + + public string? _SWPDM_133_SW____ { get; set; } + + public string? _SWPDM_67_SW___ { get; set; } + + public string? _SWPDM_1174_SW___ { get; set; } + + public string? _SWPDM_1168_TEMP_____ { get; set; } + + public string? _SWPDM_1167_TEMP_____ { get; set; } + + public string? _SWPDM_1166_TEMP_____ { get; set; } + + public string? _SWPDM_1165_TEMP____ { get; set; } + + public string? _SWPDM_1164_TEMP_______ { get; set; } + + public string? _SWPDM_1163_TEMP_______ { get; set; } + + public string? _SWPDM_1162_TEMP_____ { get; set; } + + public string? _SWPDM_1161_TEMP_____ { get; set; } + + public string? _SWPDM_1160_TEMP_______ { get; set; } + + public string? _SWPDM_1159_TEMP_______ { get; set; } + + public string? _SWPDM_1176_TEMP_____ { get; set; } + + public string? _SWPDM_1158_TEMP____ { get; set; } + + public string? _SWPDM_134_TY___ { get; set; } + + public string? _SWPDM_135_TY______ { get; set; } + + public string? _SWPDM_136_TY_____ { get; set; } + + public string? _SWPDM_137_TY_____ { get; set; } + + public string? _SWPDM_138_TY_____ { get; set; } + + public string? _SWPDM_139_WD_____ { get; set; } + + public string? _SWPDM_140_WD____ { get; set; } + + public string? _SWPDM_141_WD___ { get; set; } + + public string? _SWPDM_142_WJJ_____ { get; set; } + + public string? _SWPDM_143_WJJ____ { get; set; } + + public string? _SWPDM_144_WJJ___ { get; set; } + + public string? _SWPDM_68_XM___ { get; set; } + + public string? _SWPDM_69_XM_____ { get; set; } + + public string? _SWPDM_70_XM_____ { get; set; } + + public string? _SWPDM_1169_XM_____ { get; set; } + + public string? _SWPDM_145_XM_____ { get; set; } + + public string? _SWPDM_146_XM_____ { get; set; } + + public string? _SWPDM_73_XM_____ { get; set; } + + public string? _SWPDM_74_XM_____ { get; set; } + + public string? _SWPDM_71_XM______ { get; set; } + + public string? _SWPDM_72_XM____ { get; set; } + + public string? _SWPDM_75_XM_____ { get; set; } + + public string? _SWPDM_1155_XM_________ { get; set; } + + public string? _SWPDM_103___ { get; set; } + + public string? _SWPDM_104___ { get; set; } + + public string? _SWPDM_147_____ { get; set; } + + public string? _SWPDM_1211_____ { get; set; } + + public string? _SWPDM_1212_______ { get; set; } + + public string? _SWPDM_107___ { get; set; } + + public string? _SWPDM_148_____ { get; set; } + + public string? _SWPDM_108______ { get; set; } + + public string? _SWPDM_149_______ { get; set; } + + public string? _SWPDM_110_______ { get; set; } + + public string? _SWPDM_150________ { get; set; } + + public string? _SWPDM_151________ { get; set; } + + public string? _SWPDM_152________ { get; set; } + + public string? _SWPDM_109______ { get; set; } + + public string? _SWPDM_105___ { get; set; } + + public string? _SWPDM_106_____ { get; set; } + + public string? _SWPDM_153_____ { get; set; } + + public string? fld005529 { get; set; } + + public string? fld005530 { get; set; } + + public string? fld005531 { get; set; } + + public DateTime? fld005532 { get; set; } + + public string? fld005533 { get; set; } + + public string? fld005534 { get; set; } + + public string? fld005535 { get; set; } + + public string? fld005536 { get; set; } + + public string? fld005537 { get; set; } + + public string? fld005538 { get; set; } + + public DateTime? fld005539 { get; set; } + + public DateTime? fld005540 { get; set; } + + public int? fld005678 { get; set; } + public int? fld005679 { get; set; } + public string? fld005679_Rec { get; set; } + public DateTime? fld005680 { get; set; } +} + +/// +/// 产品设计库分页查询输入参数 +/// +public class PageProductDesignLibraryInput : BasePageInput +{ + /// + /// 物料编码 + /// + public string? _System_objNBS { get; set; } + + /// + /// 物料描述 + /// + public string? _SWPDM_1188_SAP___ { get; set; } +} diff --git a/admin.net.pro/Admin.NET/Vistar.Application/Service/ProductDesignLibrary/Dto/ProductDesignLibraryOutput.cs b/admin.net.pro/Admin.NET/Vistar.Application/Service/ProductDesignLibrary/Dto/ProductDesignLibraryOutput.cs new file mode 100644 index 0000000..aa6603b --- /dev/null +++ b/admin.net.pro/Admin.NET/Vistar.Application/Service/ProductDesignLibrary/Dto/ProductDesignLibraryOutput.cs @@ -0,0 +1,482 @@ +// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。 +// +// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。 +// +// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任! + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Vistar.Application.Service.ProductDesignLibrary.Dto; +/// +/// 产品设计库输出参数 +/// +public class ProductDesignLibraryOutput +{ + public long idRecord { get; set; } + + public int? CheckedStatus { get; set; } + + public int? VersionIndex { get; set; } + + public bool? IsLatestVersion { get; set; } + + public DateTime? CreatedDate { get; set; } + + public DateTime? VersionCreatedDate { get; set; } + + public DateTime? dateModified { get; set; } + + public long? UserCreatedId { get; set; } + + public long? VersionUserCreatedId { get; set; } + + public long? UserModifiedId { get; set; } + + public string? RecordGuid { get; set; } + + public bool? isVisibilityNormal { get; set; } + + public bool? deleted { get; set; } + + public string? SubObjectGuid { get; set; } + + public bool? PreviousStatus { get; set; } + + public string? revision { get; set; } + + public byte[]? Record_image160_160 { get; set; } + + public byte[]? Record_Image320_240 { get; set; } + + public byte[]? Record_ImageMax { get; set; } + + public string? _System_objNBS { get; set; } + + public string? _System_ObjDescription { get; set; } + + public DateTime? _System_Effectivity_Begin { get; set; } + + public DateTime? _System_Effectivity_End { get; set; } + + public string? CheckedOutPc { get; set; } + + public long? StageId { get; set; } + + public long? ProjectManager { get; set; } + + public long? ProjectManager_Rec { get; set; } + + public bool? EnableNotifications { get; set; } + + public long? GroupObjId { get; set; } + + public bool? _CheckOutInProgress { get; set; } + + public string? ParentRecordGuid { get; set; } + + public string? MaterialType { get; set; } + + public bool? _System_NeedSWRebuild { get; set; } + + public string? _system_objConfigurationName { get; set; } + + public bool? _system_objConfigurationType { get; set; } + + public string? _system_objConfigurationGuid { get; set; } + + public string ShowBomFromConfiguration { get; set; } + + public string _System_ObjNbsAuto { get; set; } + + public long? PreviousIdRecord { get; set; } + + public string? _System_DerivedFrom { get; set; } + + public bool? _system_objLinkedCompare { get; set; } + + public string? _System_WebLink { get; set; } + + public bool? isReleasedVersion { get; set; } + + public string? _System_DerivedFrom_RecordGuid { get; set; } + + public long? SWPDMDocumentId { get; set; } + + public long? SWPDMConfigurationID { get; set; } + + public string? SWPDMConfigurationName { get; set; } + + public long? SWPDMActiveConfigurationId { get; set; } + + public string? SWPDMActiveConfigurationName { get; set; } + + public string? SWPDMFileName { get; set; } + + public long? SWPDMConfigPersistID { get; set; } + + public int? SWPDMStatusId { get; set; } + + public string? SWPDMStatusName { get; set; } + + public bool? _SWPDM_1179__SW_Detailing_Mode_ { get; set; } + + public string? _SWPDM_2__SW_Last_Saved_With_ { get; set; } + + public string? _SWPDM_111_A___ { get; set; } + + public string? _SWPDM_1172_BOM_BOM__ { get; set; } + + public string? _SWPDM_112_BOM___2 { get; set; } + + public string? _SWPDM_113_BOM___ { get; set; } + + public string? _SWPDM_115_BOM___ { get; set; } + + public string? _SWPDM_116_BOM___ { get; set; } + + public string? _SWPDM_117_BOM_____ { get; set; } + + public string? _SWPDM_51_BOM_____ { get; set; } + + public string? _SWPDM_118_BOM_____ { get; set; } + + public string? _SWPDM_119_BOM___ { get; set; } + + public string? _SWPDM_114_BOM_____ { get; set; } + + public string? _SWPDM_120_BOM______ { get; set; } + + public string? _SWPDM_121_BOM___ { get; set; } + + public string? _SWPDM_122_BOW___1 { get; set; } + + public string? _SWPDM_123_BOW___ { get; set; } + + public string? _SWPDM_84_DWG___ { get; set; } + + public string? _SWPDM_82_DWG___ { get; set; } + + public string? _SWPDM_80_DWG_____ { get; set; } + + public string? _SWPDM_76_DWG___ { get; set; } + + public string? _SWPDM_77_DWG___ { get; set; } + + public string? _SWPDM_78_DWG___ { get; set; } + + public string? _SWPDM_79_DWG___ { get; set; } + + public string? _SWPDM_83_DWG___ { get; set; } + + public string? _SWPDM_81_DWG___ { get; set; } + + public string? _SWPDM_92_FB___ { get; set; } + + public string? _SWPDM_86_FB_____ { get; set; } + + public string? _SWPDM_87_FB_____ { get; set; } + + public string? _SWPDM_88_FB_____ { get; set; } + + public string? _SWPDM_89_FB_____ { get; set; } + + public string? _SWPDM_90_FB______ { get; set; } + + public string? _SWPDM_85_FB____ { get; set; } + + public string? _SWPDM_91_FB_____ { get; set; } + public string? _SWPDM_94_PDF___ { get; set; } + + public string? _SWPDM_101_PDF___ { get; set; } + + public string? _SWPDM_95_PDF_____ { get; set; } + + public string? _SWPDM_96_PDF___ { get; set; } + + public string? _SWPDM_97_PDF___ { get; set; } + + public string? _SWPDM_98_PDF___ { get; set; } + + public string? _SWPDM_93_PDF___ { get; set; } + + public string? _SWPDM_99_PDF___ { get; set; } + + public string? _SWPDM_100_PDF___ { get; set; } + + public string? _SWPDM_1194_q { get; set; } + + public string? _SWPDM_1196_SAP_____ { get; set; } + + public string? _SWPDM_1199_SAP___ { get; set; } + + public string? _SWPDM_1187_SAP___ { get; set; } + + public double? _SWPDM_1190_SAP___ { get; set; } + + public string? _SWPDM_1191_SAP___ { get; set; } + + public string? _SWPDM_1188_SAP___ { get; set; } + + public string? _SWPDM_1197_SAP_____ { get; set; } + + public string? _SWPDM_1210_SAP_____ { get; set; } + + public string? _SWPDM_1189_SAP___ID_____ { get; set; } + + public string? _SWPDM_1200_SAP_____ { get; set; } + public string? _SWPDM_1208_SAP___BOM___ { get; set; } + + public string? _SWPDM_1201_SAP_____ { get; set; } + + public string? _SWPDM_1198_SAP_____ { get; set; } + + public string? _SWPDM_1193_SAP___ { get; set; } + + public string? _SWPDM_1195_SAP_____ { get; set; } + + public string? _SWPDM_1186_SAP_____ { get; set; } + + public string? _SWPDM_1209_SAP_____ { get; set; } + + public string? _SWPDM_1203_SAP____ { get; set; } + + public string? _SWPDM_1185_SAP___ { get; set; } + + public string? _SWPDM_1192_SAP_____ { get; set; } + + public string? _SWPDM_1184_SIP_____ { get; set; } + + public string? _SWPDM_1183_SIP_____ { get; set; } + + public string? _SWPDM_1182_SOP_____ { get; set; } + + public string? _SWPDM_1181_SOP_____ { get; set; } + + public string? _SWPDM_46_SW___ { get; set; } + + public string? _SWPDM_60_SW___ { get; set; } + + public string? _SWPDM_124_SW___ { get; set; } + + public string? _SWPDM_102_SW___ { get; set; } + + public string? _SWPDM_56_SW____ { get; set; } + + public string? _SWPDM_57_SW______ { get; set; } + + public string? _SWPDM_61_SW_____ { get; set; } + + public string? _SWPDM_62_SW___ { get; set; } + + public string? _SWPDM_125_SW___ { get; set; } + + public string? _SWPDM_126_SW___ { get; set; } + + public string? _SWPDM_127_SW_____ { get; set; } + + public string? _SWPDM_1205_SW_______ { get; set; } + + public string? _SWPDM_47_SW___ { get; set; } + + public string? _SWPDM_48_SW_____ { get; set; } + + public string? _SWPDM_54_SW___ { get; set; } + + public string? _SWPDM_55_SW_____ { get; set; } + + public string? _SWPDM_66_SW___ { get; set; } + + public string? _SWPDM_154_SW_____ { get; set; } + + public string? _SWPDM_63_SW___ { get; set; } + + public string? _SWPDM_64_SW___ { get; set; } + + public string? _SWPDM_65_SW___ { get; set; } + + public string? _SWPDM_128_SW_____ { get; set; } + + public string? _SWPDM_1206_SW_______ { get; set; } + + public string? _SWPDM_52_SW___ { get; set; } + + public string? _SWPDM_53_SW_____ { get; set; } + + public string? _SWPDM_58_SW___ { get; set; } + + public string? _SWPDM_59_SW_____ { get; set; } + + public string? _SWPDM_1178_SW_____ { get; set; } + + public string? _SWPDM_1202_SW_____ { get; set; } + + public string? _SWPDM_49_SW___ { get; set; } + + public string? _SWPDM_129_SW_____ { get; set; } + + public string? _SWPDM_1207_SW_______ { get; set; } + + public string? _SWPDM_130_SW___ { get; set; } + + public string? _SWPDM_50_SW_____ { get; set; } + + public string? _SWPDM_131_SW_____ { get; set; } + + public string? _SWPDM_155_SW_____ { get; set; } + + public string? _SWPDM_1175_SW_____ { get; set; } + + public string? _SWPDM_1177_SW_____ { get; set; } + + public string? _SWPDM_1170_SW___ { get; set; } + + public string? _SWPDM_1171_SW_____ { get; set; } + + public string? _SWPDM_1173_SW____ { get; set; } + + public string? _SWPDM_132_SW_____ { get; set; } + + public string? _SWPDM_1204_SW_______ { get; set; } + + public string? _SWPDM_133_SW____ { get; set; } + + public string? _SWPDM_67_SW___ { get; set; } + + public string? _SWPDM_1174_SW___ { get; set; } + + public string? _SWPDM_1168_TEMP_____ { get; set; } + + public string? _SWPDM_1167_TEMP_____ { get; set; } + + public string? _SWPDM_1166_TEMP_____ { get; set; } + + public string? _SWPDM_1165_TEMP____ { get; set; } + + public string? _SWPDM_1164_TEMP_______ { get; set; } + + public string? _SWPDM_1163_TEMP_______ { get; set; } + + public string? _SWPDM_1162_TEMP_____ { get; set; } + + public string? _SWPDM_1161_TEMP_____ { get; set; } + + public string? _SWPDM_1160_TEMP_______ { get; set; } + + public string? _SWPDM_1159_TEMP_______ { get; set; } + + public string? _SWPDM_1176_TEMP_____ { get; set; } + + public string? _SWPDM_1158_TEMP____ { get; set; } + + public string? _SWPDM_134_TY___ { get; set; } + + public string? _SWPDM_135_TY______ { get; set; } + + public string? _SWPDM_136_TY_____ { get; set; } + + public string? _SWPDM_137_TY_____ { get; set; } + + public string? _SWPDM_138_TY_____ { get; set; } + + public string? _SWPDM_139_WD_____ { get; set; } + + public string? _SWPDM_140_WD____ { get; set; } + + public string? _SWPDM_141_WD___ { get; set; } + + public string? _SWPDM_142_WJJ_____ { get; set; } + + public string? _SWPDM_143_WJJ____ { get; set; } + + public string? _SWPDM_144_WJJ___ { get; set; } + + public string? _SWPDM_68_XM___ { get; set; } + + public string? _SWPDM_69_XM_____ { get; set; } + + public string? _SWPDM_70_XM_____ { get; set; } + + public string? _SWPDM_1169_XM_____ { get; set; } + + public string? _SWPDM_145_XM_____ { get; set; } + + public string? _SWPDM_146_XM_____ { get; set; } + + public string? _SWPDM_73_XM_____ { get; set; } + + public string? _SWPDM_74_XM_____ { get; set; } + + public string? _SWPDM_71_XM______ { get; set; } + + public string? _SWPDM_72_XM____ { get; set; } + + public string? _SWPDM_75_XM_____ { get; set; } + + public string? _SWPDM_1155_XM_________ { get; set; } + + public string? _SWPDM_103___ { get; set; } + + public string? _SWPDM_104___ { get; set; } + + public string? _SWPDM_147_____ { get; set; } + + public string? _SWPDM_1211_____ { get; set; } + + public string? _SWPDM_1212_______ { get; set; } + + public string? _SWPDM_107___ { get; set; } + + public string? _SWPDM_148_____ { get; set; } + + public string? _SWPDM_108______ { get; set; } + + public string? _SWPDM_149_______ { get; set; } + + public string? _SWPDM_110_______ { get; set; } + + public string? _SWPDM_150________ { get; set; } + + public string? _SWPDM_151________ { get; set; } + + public string? _SWPDM_152________ { get; set; } + + public string? _SWPDM_109______ { get; set; } + + public string? _SWPDM_105___ { get; set; } + + public string? _SWPDM_106_____ { get; set; } + + public string? _SWPDM_153_____ { get; set; } + + public string? fld005529 { get; set; } + + public string? fld005530 { get; set; } + + public string? fld005531 { get; set; } + + public DateTime? fld005532 { get; set; } + + public string? fld005533 { get; set; } + + public string? fld005534 { get; set; } + + public string? fld005535 { get; set; } + + public string? fld005536 { get; set; } + + public string? fld005537 { get; set; } + + public string? fld005538 { get; set; } + + public DateTime? fld005539 { get; set; } + + public DateTime? fld005540 { get; set; } + public int? fld005678 { get; set; } + public int? fld005679 { get; set; } + public string? fld005679_Rec { get; set; } + public DateTime? fld005680 { get; set; } +} diff --git a/admin.net.pro/Admin.NET/Vistar.Application/Service/ProductDesignLibrary/ProductDesignLibraryService.cs b/admin.net.pro/Admin.NET/Vistar.Application/Service/ProductDesignLibrary/ProductDesignLibraryService.cs new file mode 100644 index 0000000..5698864 --- /dev/null +++ b/admin.net.pro/Admin.NET/Vistar.Application/Service/ProductDesignLibrary/ProductDesignLibraryService.cs @@ -0,0 +1,948 @@ +// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。 +// +// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。 +// +// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任! + +using Admin.NET.Core; +using Admin.NET.Core.Service; +using Furion.DependencyInjection; +using Furion.DynamicApiController; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Vistar.Application.Common; +using Vistar.Application.Const; +using Vistar.Application.Entity; +using Vistar.Application.SapService.Dto; +using Vistar.Application.Service.ProductDesignLibrary.Dto; +using Vistar.Application.Util; + +namespace Vistar.Application.Service.ProductDesignLibrary; +/// +/// 产品设计库服务 +/// +[ApiDescriptionSettings(ApplicationConst.GroupName, Name = "ProductDesignLibrary", Order = 100)] +public class ProductDesignLibraryService : IDynamicApiController, ITransient +{ + private readonly SqlSugarRepository _obj137Rep; + private readonly SysConfigService _sysConfigService; + public SapService.SapService _sapService; + private readonly SqlSugarRepository _configurationsRep; + private readonly SqlSugarRepository _configurationDataRep; + public SqlSugarRepository _obj118Rep; + public Common.DataValidationService _dataValidationService; + public SqlSugarRepository _obj122Rep; + public SqlSugarRepository _obj121Rep; + + public ProductDesignLibraryService( + SqlSugarRepository obj137Rep, + SysConfigService sysConfigService, + SapService.SapService sapService, + SqlSugarRepository configurationsRep, + SqlSugarRepository configurationDataRep, + SqlSugarRepository obj118Rep, + DataValidationService dataValidationService, + SqlSugarRepository obj122Rep, + SqlSugarRepository obj121Rep + ) + { + _obj137Rep = obj137Rep; + _sysConfigService = sysConfigService; + _sapService = sapService; + _configurationsRep = configurationsRep; + _configurationDataRep = configurationDataRep; + _obj118Rep = obj118Rep; + _dataValidationService = dataValidationService; + _obj122Rep = obj122Rep; + _obj121Rep = obj121Rep; + } + + /// + /// 分页查询产品设计库 + /// + /// + /// + [ApiDescriptionSettings(Name = "page", Description = "分页查询", Order = 1000), HttpPost] + [DisplayName("分页查询产品设计库")] + public async Task> Page(PageProductDesignLibraryInput input) + { + var query = await _obj137Rep.AsQueryable() + .Where(x => x.CheckedStatus == 0 && x.deleted == false && x.IsLatestVersion == true && x._system_objConfigurationName == "默认" && (x.SWPDMFileName!= "SLDDRW" || x.SWPDMFileName==null)) + .WhereIF(!string.IsNullOrWhiteSpace(input._System_objNBS), u => u._System_objNBS.Contains(input._System_objNBS.Trim())) + .WhereIF(!string.IsNullOrWhiteSpace(input._SWPDM_1188_SAP___), u => u._SWPDM_1188_SAP___.Contains(input._SWPDM_1188_SAP___.Trim())) + .Select() + .ToPagedListAsync(input.Page, input.PageSize); + return query; + } + + /// + /// 产品设计库-同步到 SAP + /// + /// + [ApiDescriptionSettings(Name = "syncToSAP"), HttpPost] + [DisplayName("产品设计库-同步到 SAP")] + public async Task SyncToSAP(ProductDesignLibraryInput input) + { + const string lengthError = "物料描述长度大于40,请检查!"; + + // 验证物料描述长度 + if (input._SWPDM_1188_SAP___.Length > 40) + { + await _obj137Rep.AsUpdateable() + .SetColumns(it => new Obj137 + { + fld005532 = DateTime.Now, + fld005530 = "N", + fld005531 = lengthError, + fld005529 = "失败" + }) + .Where(it => it.idRecord == input.idRecord) + .ExecuteCommandAsync().ConfigureAwait(false); + + return new SapOutput + { + code = "失败", + msg = lengthError, + result = lengthError + }; + } + + //获取时间戳精确到毫秒,sap要求每次调用生成不重复guid + string millisecondTimestamp = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds().ToString(); + + var sapMaterialInput = new SapMaterialInput() + { + Reqkeyid = "", + Businessid = "", + Messageid = "", + Sndprn = "PLM", + Rcvprn = "SAP", + Requser = await _sysConfigService.GetConfigValueByCode(ConfigConst.SapUserName), + Note1 = "", + Note2 = "", + Note3 = "", + Zwbid = millisecondTimestamp, + Matnr = input._System_objNBS, + Mbrsh = input._SWPDM_1185_SAP___, + Mtart = input._SWPDM_1186_SAP_____, + Maktx = input._SWPDM_1188_SAP___, + Meins = input._SWPDM_126_SW___, + Matkl = input._SWPDM_1203_SAP____, + Bismt = input._SWPDM_1189_SAP___ID_____, + Groes = input._SWPDM_1200_SAP_____, + Normt = input._SWPDM_65_SW___, + Ferth = input._SWPDM_62_SW___, + Zeinr = input._SWPDM_61_SW_____, + Mstae = input._SWPDM_1209_SAP_____, + Raube = "", + Mhdrz = "", + Mhdhb = "", + Werks = input._SWPDM_1187_SAP___, + Beskz = input._SWPDM_1196_SAP_____, + Sobsl = input._SWPDM_1198_SAP_____, + Schgt = input._SWPDM_1197_SAP_____, + Rgekz = input._SWPDM_1199_SAP___, + Zbom = input._SWPDM_1208_SAP___BOM___ + }; + + var apiOutput = await _sapService.SapMaterialApi(sapMaterialInput); + string codeVal = apiOutput.code == "S" ? "成功" : "失败"; + var msg = apiOutput.msg; + if (apiOutput.msg == "") + { + msg = "同步成功"; + } + + await _obj137Rep.AsUpdateable() + .SetColumns(it => new Obj137 + { + fld005532 = DateTime.Now, + fld005529 = codeVal, + fld005530 = "N", + fld005531 = msg + }) + .Where(it => it.idRecord == input.idRecord) + .ExecuteCommandAsync(); + var output = new SapOutput() + { + parameter = apiOutput.parameter, + code = codeVal, + msg = msg, + result = apiOutput.result + }; + return output; + } + /// + /// 获取BOM + /// + /// + /// + [ApiDescriptionSettings(Name = "GetBOM", Description = "获取BOM", Order = 1000), HttpPost] + [DisplayName("获取BOM")] + public async Task> GetBOM(BomPageProductDesignLibraryInput input) + { + var configid = await _configurationsRep.AsQueryable().Where(x => x.ObjectId == 137 && x.ConfigSystemName == "SolidWorks").FirstAsync(); + var parent = await _obj137Rep.AsQueryable() + .Where(x => x.RecordGuid == input.ParentGuid && x.deleted == false && x._system_objConfigurationName == "默认" && (x.SWPDMFileName != "SLDDRW" || x.SWPDMFileName == null)) + .MaxAsync(x => x.VersionIndex); + var BomData = await _configurationDataRep.AsQueryable() + .Where(x => x.ConfigId == configid.ConfigID && x.ParentGuid == input.ParentGuid && x.isDeleted == false && x.ParentVersion == parent && (x.fld005577 != "不包含"||x.fld005577==null)) + .WhereIF(!string.IsNullOrWhiteSpace(input.Description), u => u.Description.Contains(input.Description.Trim())) + .WhereIF(!string.IsNullOrWhiteSpace(input.PartNumber), u => u.PartNumber.Contains(input.PartNumber.Trim())) + .Select().ToPagedListAsync(input.Page, input.PageSize); + return BomData; + } + /// + /// 产品设计库-Bom同步到SAP + /// + /// + /// + [ApiDescriptionSettings(Name = "SyncToSAPBom"), HttpPost] + [DisplayName("产品设计库-Bom同步到SAP")] + public async Task SyncToSAPBom(List input) + { + var ParentData = await _obj137Rep.AsQueryable().Where(x => x.RecordGuid == input[0].ParentGuid && x.deleted == false && x.VersionIndex == input[0].ParentVersion && (x._SWPDM_1202_SW_____ != "不展开"||x._SWPDM_1202_SW_____==null)).FirstAsync(); + var EcnData = await _obj118Rep.AsQueryable().Where(x => x.RecordGuid == ParentData.fld005679_Rec && x.deleted == false).OrderByDescending(x => x.VersionIndex).FirstAsync(); + var ecn = ""; + if (EcnData != null) + { + ecn = EcnData._System_objNBS; + } + + var itemDataList = new List(); + + for (int i = 0; i < input.Count; i++) + { + var Verification = await _dataValidationService.VerificationMaterial(input[i].ChildObjID, input[i].PartNumber, input[i].ChildGuid); + if (Verification == "不存在") + { + continue; + } + //int sun = i + 1; + var itemData = new ItemData() + { + POSNR = "",//组件序号 sun.ToString() + IDNRK = input[i].PartNumber,//组件物料号 + MENGE = input[i].QtyManual.ToString(),//组件数量 + SORTF = input[i].fld005541, + ITISOB = input[i].fld005542, + ALPGR = input[i].fld005543, + ALPRF = input[i].fld005544, + ZDELETE = input[i].fld005545, + POSTP = input[i].fld005546, + ZYFMK = input[i].fld005547 + }; + itemDataList.Add(itemData); + } + + if (!string.IsNullOrEmpty(ParentData.fld005686)) + { + var configid = await _configurationsRep.AsQueryable().Where(x => x.ObjectId == 137 && x.ConfigSystemName == "SolidWorks").FirstAsync(); + var BomData = await _configurationDataRep.AsQueryable().Where(x => x.ConfigId == configid.ConfigID && x.ParentGuid == input[0].ParentGuid && x.isDeleted == false && x.ParentVersion == Convert.ToInt32(ParentData.fld005686) && (x.fld005577 != "不包含" || x.fld005577 == null)).ToListAsync(); + for (int i = 0; i < BomData.Count; i++) + { + + var itemList = itemDataList.Where(x => x.IDNRK == BomData[i].PartNumber).ToList(); + if (itemList.Count == 0) + { + var Verification = await _dataValidationService.VerificationMaterial(BomData[i].ChildObjID, BomData[i].PartNumber, BomData[i].ChildGuid); + if (Verification == "不存在") + { + continue; + } + //int sun = i + 1; + var itemData = new ItemData() + { + POSNR = "",//组件序号 sun.ToString() + IDNRK = BomData[i].PartNumber,//组件物料号 + MENGE = BomData[i].QtyManual.ToString(),//组件数量 + SORTF = BomData[i].fld005541, + ITISOB = BomData[i].fld005542, + ALPGR = BomData[i].fld005543, + ALPRF = BomData[i].fld005544, + ZDELETE = "X", + POSTP = BomData[i].fld005546, + ZYFMK = BomData[i].fld005547 + }; + itemDataList.Add(itemData); + } + + } + } + + //获取时间戳精确到毫秒,sap要求每次调用生成不重复guid + string millisecondTimestamp = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds().ToString(); + var fld005678 = ParentData.fld005678 ?? 1; + var isreq = new IS_REQ() + { + ReqKeyId = "", + BusinessId = "", + MessageId = "", + SndPrn = "PLM", + RcvPrn = "SAP", + ReqUser = await _sysConfigService.GetConfigValueByCode(ConfigConst.SapUserName), + Note1 = "", + Note2 = "", + Note3 = "", + Zwbid = millisecondTimestamp, + Matnr = ParentData._System_objNBS,//父物料编码 + Werks = ParentData._SWPDM_1187_SAP___,//工厂 + Bmeng = fld005678.ToString(), + Aennr = ecn, + Datuv = ParentData.fld005680.ToString(), + ItemList = itemDataList + }; + var apiOutput = await _sapService.SapBomApi(isreq); + string codeVal = apiOutput.code == "S" ? "成功" : "失败"; + await _obj137Rep.AsUpdateable() + .SetColumns(it => new Obj137 + { + fld005539 = DateTime.Now, + fld005533 = codeVal, + fld005534 = "N", + fld005535 = apiOutput.msg, + fld005686 = input[0].ParentVersion.ToString() + }) + .Where(it => it.idRecord == ParentData.idRecord) + .ExecuteCommandAsync(); + var msg = apiOutput.msg; + if (apiOutput.msg == "") + { + msg = "同步成功"; + } + var output = new SapOutput() + { + parameter = apiOutput.parameter, + code = codeVal, + msg = msg, + result = apiOutput.result + }; + return output; + } + /// + /// 产品设计库-批量同步到SAP + /// + /// + /// + [ApiDescriptionSettings(Name = "BatchSyncToSAP"), HttpPost] + [DisplayName("产品设计库-批量同步到SAP")] + public async Task> BatchSyncToSAP(List input) + { + const string lengthError = "物料描述长度大于40,请检查!"; + const string synchronized = "该物料编码已同步!"; + var SapOutputList = new List(); + var Requser = await _sysConfigService.GetConfigValueByCode(ConfigConst.SapUserName); + for (int i = 0; i < input.Count; i++) + { + // 验证物料描述长度 + if (input[i]._SWPDM_1188_SAP___.Length > 40) + { + await _obj137Rep.AsUpdateable() + .SetColumns(it => new Obj137 + { + fld005532 = DateTime.Now, + fld005530 = "N", + fld005531 = lengthError, + fld005529 = "失败" + }) + .Where(it => it.idRecord == input[i].idRecord) + .ExecuteCommandAsync().ConfigureAwait(false); + + SapOutputList.Add(new SapOutput() + { + materialCode = input[i]._System_objNBS, + code = "失败", + msg = lengthError, + result = lengthError + }); + continue; + } + if (input[i].fld005530 != "A" && input[i].fld005530 != "M") + { + SapOutputList.Add(new SapOutput() + { + materialCode = input[i]._System_objNBS, + code = "失败", + msg = synchronized, + result = synchronized + }); + continue; + } + //获取时间戳精确到毫秒,sap要求每次调用生成不重复guid + string millisecondTimestamp = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds().ToString(); + var sapMaterialInput = new SapMaterialInput() + { + Reqkeyid = "", + Businessid = "", + Messageid = "", + Sndprn = "PLM", + Rcvprn = "SAP", + Requser = Requser, + Note1 = "", + Note2 = "", + Note3 = "", + Zwbid = millisecondTimestamp, + Matnr = input[i]._System_objNBS, + Mbrsh = input[i]._SWPDM_1185_SAP___, + Mtart = input[i]._SWPDM_1186_SAP_____, + Maktx = input[i]._SWPDM_1188_SAP___, + Meins = input[i]._SWPDM_126_SW___, + Matkl = input[i]._SWPDM_1203_SAP____, + Bismt = input[i]._SWPDM_1189_SAP___ID_____, + Groes = input[i]._SWPDM_1200_SAP_____, + Normt = input[i]._SWPDM_65_SW___, + Ferth = input[i]._SWPDM_62_SW___, + Zeinr = input[i]._SWPDM_61_SW_____, + Mstae = input[i]._SWPDM_1209_SAP_____, + Raube = "", + Mhdrz = "", + Mhdhb = "", + Werks = input[i]._SWPDM_1187_SAP___, + Beskz = input[i]._SWPDM_1196_SAP_____, + Sobsl = input[i]._SWPDM_1198_SAP_____, + Schgt = input[i]._SWPDM_1197_SAP_____, + Rgekz = input[i]._SWPDM_1199_SAP___, + Zbom = input[i]._SWPDM_1208_SAP___BOM___ + }; + var sapOutput = await _sapService.SapMaterialApi(sapMaterialInput); + string codeVal = sapOutput.code == "S" ? "成功" : "失败"; + string msg = sapOutput.msg; + + if (sapOutput.msg == "") + { + msg = "同步成功"; + } + await _obj137Rep.AsUpdateable() + .SetColumns(it => new Obj137 + { + fld005532 = DateTime.Now, + fld005529 = codeVal, + fld005530 = "N", + fld005531 = msg + }) + .Where(it => it.idRecord == input[i].idRecord) + .ExecuteCommandAsync(); + var output = new SapOutput() + { + parameter = sapOutput.parameter, + materialCode = input[0]._System_objNBS, + code = codeVal, + msg = msg, + result = sapOutput.result + }; + SapOutputList.Add(output); + } + + return SapOutputList; + } + /// + /// 产品设计库-定时同步到SAP + /// + /// + [ApiDescriptionSettings(Name = "TimingSyncToSAP"), HttpGet] + [DisplayName("产品设计库-定时同步到SAP")] + [AllowAnonymous] + public async Task> TimingSyncToSAP() + { + var input = await _obj137Rep.AsQueryable() + .Where(x => x.CheckedStatus == 0 && x.deleted == false && x.IsLatestVersion == true && (x.fld005530 == "A" || x.fld005530 == "M") && x._system_objConfigurationName == "默认" && (x.SWPDMFileName != "SLDDRW" || x.SWPDMFileName == null)) + .ToListAsync(); + const string lengthError = "物料描述长度大于40,请检查!"; + var SapOutputList = new List(); + var Requser = await _sysConfigService.GetConfigValueByCode(ConfigConst.SapUserName); + for (int i = 0; i < input.Count; i++) + { + // 验证物料描述长度 + if (input[i]._SWPDM_1188_SAP___.Length > 40) + { + await _obj137Rep.AsUpdateable() + .SetColumns(it => new Obj137 + { + fld005532 = DateTime.Now, + fld005530 = "N", + fld005531 = lengthError, + fld005529 = "失败" + }) + .Where(it => it.idRecord == input[i].idRecord) + .ExecuteCommandAsync().ConfigureAwait(false); + + SapOutputList.Add(new SapOutput() + { + materialCode = input[i]._System_objNBS, + code = "失败", + msg = lengthError, + result = lengthError + }); + continue; + } + + //获取时间戳精确到毫秒,sap要求每次调用生成不重复guid + string millisecondTimestamp = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds().ToString(); + var sapMaterialInput = new SapMaterialInput() + { + Reqkeyid = "", + Businessid = "", + Messageid = "", + Sndprn = "PLM", + Rcvprn = "SAP", + Requser = Requser, + Note1 = "", + Note2 = "", + Note3 = "", + Zwbid = millisecondTimestamp, + Matnr = input[i]._System_objNBS, + Mbrsh = input[i]._SWPDM_1185_SAP___, + Mtart = input[i]._SWPDM_1186_SAP_____, + Maktx = input[i]._SWPDM_1188_SAP___, + Meins = input[i]._SWPDM_126_SW___, + Matkl = input[i]._SWPDM_1203_SAP____, + Bismt = input[i]._SWPDM_1189_SAP___ID_____, + Groes = input[i]._SWPDM_1200_SAP_____, + Normt = input[i]._SWPDM_65_SW___, + Ferth = input[i]._SWPDM_62_SW___, + Zeinr = input[i]._SWPDM_61_SW_____, + Mstae = input[i]._SWPDM_1209_SAP_____, + Raube = "", + Mhdrz = "", + Mhdhb = "", + Werks = input[i]._SWPDM_1187_SAP___, + Beskz = input[i]._SWPDM_1196_SAP_____, + Sobsl = input[i]._SWPDM_1198_SAP_____, + Schgt = input[i]._SWPDM_1197_SAP_____, + Rgekz = input[i]._SWPDM_1199_SAP___, + Zbom = input[i]._SWPDM_1208_SAP___BOM___ + }; + var sapOutput = await _sapService.SapMaterialApi(sapMaterialInput); + string codeVal = sapOutput.code == "S" ? "成功" : "失败"; + string msg = sapOutput.msg; + + if (sapOutput.msg == "") + { + msg = "同步成功"; + } + await _obj137Rep.AsUpdateable() + .SetColumns(it => new Obj137 + { + fld005532 = DateTime.Now, + fld005529 = codeVal, + fld005530 = "N", + fld005531 = msg + }) + .Where(it => it.idRecord == input[i].idRecord) + .ExecuteCommandAsync(); + var output = new SapOutput() + { + parameter = sapOutput.parameter, + materialCode = input[0]._System_objNBS, + code = codeVal, + msg = msg, + result = sapOutput.result + }; + SapOutputList.Add(output); + } + + return SapOutputList; + } + /// + /// 产品设计库-定时同步 BOM 到 SAP + /// + /// + [ApiDescriptionSettings(Name = "TimingSyncToSAPBom"), HttpGet] + [DisplayName("产品设计库-定时同步 Bom 到 SAP")] + [AllowAnonymous] + public async Task> TimingSyncToSAPBom() + { + var sapOutputList = new List(); + var sapUserName = await _sysConfigService.GetConfigValueByCode(ConfigConst.SapUserName); + // 配置 + var configid = await _configurationsRep.AsQueryable().Where(x => x.ObjectId == 137 && x.ConfigSystemName == "SolidWorks").FirstAsync(); + + var materialData = await _obj137Rep.AsQueryable() + .Where(x => x.CheckedStatus == 0 && x.deleted == false && x.IsLatestVersion == true && (x.fld005530 == "A" || x.fld005530 == "M") && x._system_objConfigurationName == "默认" && x.SWPDMFileName != "SLDDRW") + .ToListAsync(); + var groupedData = materialData.GroupBy(item => item.RecordGuid) + .Select(group => group.OrderByDescending(item => item.VersionIndex).First()) + .ToList(); + + foreach (var item in groupedData) + { + // 获取版本号 + var versionIndex = item.VersionIndex; + // 获取 ECN guid + var ecnGuid = item.fld005679_Rec; + // 查询 BOM + var bomData = await _configurationDataRep.AsQueryable() + .Where(x => x.ConfigId == configid.ConfigID && x.ParentGuid == item.RecordGuid && x.isDeleted == false && x.ParentVersion == versionIndex && (x.fld005577 != "不包含" || x.fld005577 == null)).ToListAsync(); + if (bomData.Count == 0) + { + continue; + } + // 查询 ECN 编码 + var ecnData = await _obj118Rep.AsQueryable().Where(x => x.RecordGuid == ecnGuid && x.deleted == false).OrderByDescending(x => x.VersionIndex).FirstAsync(); + var ecn = ecnData != null ? ecnData._System_objNBS : ""; + + var itemDataList = new List(); + foreach (var bomItem in bomData) + { + var verification = await _dataValidationService.VerificationMaterial(bomItem.ChildObjID, bomItem.PartNumber, bomItem.ChildGuid); + if (verification == "不存在") + { + continue; + } + + var itemData = new ItemData + { + POSNR = (bomData.IndexOf(bomItem) + 1).ToString(), + IDNRK = bomItem.PartNumber, + MENGE = bomItem.QtyManual.ToString(), + SORTF = bomItem.fld005541, + ITISOB = bomItem.fld005542, + ALPGR = bomItem.fld005543, + ALPRF = bomItem.fld005544, + ZDELETE = bomItem.fld004940, + POSTP = bomItem.fld005546, + ZYFMK = bomItem.fld005547 + }; + itemDataList.Add(itemData); + + } + + var ParentData = await _obj137Rep.AsQueryable().Where(x => x.RecordGuid == bomData[0].ParentGuid && x.deleted == false && x.VersionIndex == bomData[0].ParentVersion).FirstAsync(); + + if (!string.IsNullOrEmpty(ParentData.fld005686)) + { + var configidold = await _configurationsRep.AsQueryable().Where(x => x.ObjectId == 137 && x.ConfigSystemName == "SolidWorks").FirstAsync(); + var BomData = await _configurationDataRep.AsQueryable().Where(x => x.ConfigId == configidold.ConfigID && x.ParentGuid == bomData[0].ParentGuid && x.isDeleted == false && x.ParentVersion == Convert.ToInt32(ParentData.fld005686) && (x.fld005577 != "不包含" || x.fld005577 == null)).ToListAsync(); + for (int i = 0; i < BomData.Count; i++) + { + + var itemList = itemDataList.Where(x => x.IDNRK == BomData[i].PartNumber).ToList(); + if (itemList.Count == 0) + { + var Verification = await _dataValidationService.VerificationMaterial(BomData[i].ChildObjID, BomData[i].PartNumber, BomData[i].ChildGuid); + if (Verification == "不存在") + { + continue; + } + //int sun = i + 1; + var itemData = new ItemData() + { + POSNR = "",//组件序号 sun.ToString() + IDNRK = BomData[i].PartNumber,//组件物料号 + MENGE = BomData[i].QtyManual.ToString(),//组件数量 + SORTF = BomData[i].fld005541, + ITISOB = BomData[i].fld005542, + ALPGR = BomData[i].fld005543, + ALPRF = BomData[i].fld005544, + ZDELETE = "X", + POSTP = BomData[i].fld005546, + ZYFMK = BomData[i].fld005547 + }; + itemDataList.Add(itemData); + } + + } + } + + // 获取时间戳精确到毫秒,sap 要求每次调用生成不重复 guid + string millisecondTimestamp = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds().ToString(); + + var fld005678 = item.fld005678 ?? 1; + + var isreq = new IS_REQ + { + ReqKeyId = "", + BusinessId = "", + MessageId = "", + SndPrn = "PLM", + RcvPrn = "SAP", + ReqUser = sapUserName, + Note1 = "", + Note2 = "", + Note3 = "", + Zwbid = millisecondTimestamp, + Matnr = item._System_objNBS, + Werks = item._SWPDM_1187_SAP___, + Bmeng = fld005678.ToString(), + Aennr = ecn, + Datuv = item.fld005680.ToString(), + ItemList = itemDataList + }; + + var apiOutput = await _sapService.SapBomApi(isreq); + string codeVal = apiOutput.code == "S" ? "成功" : "失败"; + await _obj137Rep.AsUpdateable() + .SetColumns(it => new Obj137 + { + fld005539 = DateTime.Now, + fld005533 = codeVal, + fld005534 = "N", + fld005535 = apiOutput.msg, + fld005686 = bomData[0].ParentVersion.ToString() + }) + .Where(it => it.idRecord == item.idRecord) + .ExecuteCommandAsync(); + + var msg = apiOutput.msg; + if (string.IsNullOrEmpty(msg)) + { + msg = "同步成功"; + } + + var output = new SapOutput + { + parameter = apiOutput.parameter, + materialCode = item._System_objNBS, + code = codeVal, + msg = msg, + result = apiOutput.result + }; + sapOutputList.Add(output); + } + return sapOutputList; + } + + /// + /// 产品设计库-获取工艺路线 + /// + /// + /// + [ApiDescriptionSettings(Name = "GetProcessRoute", Description = "获取工艺路线", Order = 1000), HttpPost] + [DisplayName("获取工艺路线")] + public async Task> GetProcessRoute(BomPageProductDesignLibraryInput input) + { + var configid = await _configurationsRep.AsQueryable().Where(x => x.ObjectId == 137 && x.ConfigSystemName == "pBOM").FirstAsync(); + var parent = await _obj137Rep.AsQueryable() + .Where(x => x.RecordGuid == input.ParentGuid && x.deleted == false && x._system_objConfigurationName == "默认" && (x.SWPDMFileName != "SLDDRW" || x.SWPDMFileName == null)) + .MaxAsync(x => x.VersionIndex); + var BomData = await _configurationDataRep.AsQueryable() + .Where(x => x.ConfigId == configid.ConfigID && x.ParentGuid == input.ParentGuid && x.isDeleted == false && x.ParentVersion == parent) + .WhereIF(!string.IsNullOrWhiteSpace(input.Description), u => u.Description.Contains(input.Description.Trim())) + .WhereIF(!string.IsNullOrWhiteSpace(input.PartNumber), u => u.PartNumber.Contains(input.PartNumber.Trim())) + .Select().ToPagedListAsync(input.Page, input.PageSize); + return BomData; + } + + /// + /// 产品设计库-工艺路线同步到SAP + /// + /// + /// + [ApiDescriptionSettings(Name = "SyncToSAPProcessRoute"), HttpPost] + [DisplayName("产品设计库-工艺路线同步到SAP")] + public async Task SyncToSAPProcessRoute(List input) + { + var ParentData = await _obj137Rep.AsQueryable() + .Where(x => x.RecordGuid == input[0].ParentGuid && x.deleted == false && x.VersionIndex == input[0].ParentVersion && x._system_objConfigurationName == "默认" && (x.SWPDMFileName != "SLDDRW" || x.SWPDMFileName == null)) + .FirstAsync(); + + var itemDataList = new List(); + + for (int i = 0; i < input.Count; i++) + { + var Verification = await _dataValidationService.VerificationMaterial(input[i].ChildObjID, input[i].PartNumber, input[i].ChildGuid); + if (Verification == "不存在") + { + continue; + } + + //获取工序描述 + var procedureDescription = await _obj122Rep.AsQueryable().Where(x => x.RecordGuid == input[i].ChildGuid).ToListAsync(); + //获取工作中心 + var workCenter = await _obj121Rep.AsQueryable().Where(x => x.RecordGuid == procedureDescription[0].fld005059_Rec).ToListAsync(); + //int sun = i + 1; + var itemData = new SapProcessRouteItemData() + { + VORNR = input[i].Marker, + LTXA1 = procedureDescription[0]._System_ObjDescription, + ARBPL = workCenter[0]._System_objNBS, + VGW01 = input[i].fld005571.ToString(), + VGE01 = input[i].fld005572, + STEUS = input[i].fld005573, + BMSCH = input[i].fld005575.ToString() + + }; + itemDataList.Add(itemData); + } + + //获取时间戳精确到毫秒,sap要求每次调用生成不重复guid + string millisecondTimestamp = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds().ToString(); + + var Datuv = ParentData.fld005680.ToString(); + if (!string.IsNullOrEmpty(Datuv)) + { + Datuv = ParentData.fld005680.ToDateTime().ToString("yyyy-MM-dd"); + } + + var isreq = new SapProcessRouteIS_REQ() + { + ReqKeyId = "", + BusinessId = "", + MessageId = "", + SndPrn = "PLM", + RcvPrn = "SAP", + ReqUser = await _sysConfigService.GetConfigValueByCode(ConfigConst.SapUserName), + Note1 = "", + Note2 = "", + Note3 = "", + Zwbid = millisecondTimestamp, + Matnr = ParentData._System_objNBS, + Werks = ParentData._SWPDM_1187_SAP___, + Datuv = Datuv, + Plnal = "", + + ItemList = itemDataList + }; + var apiOutput = await _sapService.SapProcessRouteApi(isreq); + string codeVal = apiOutput.code == "S" ? "成功" : "失败"; + await _obj137Rep.AsUpdateable() + .SetColumns(it => new Obj137 + { + fld005540 = DateTime.Now, + fld005536 = codeVal, + fld005537 = "N", + fld005538 = apiOutput.msg + }) + .Where(it => it.idRecord == ParentData.idRecord) + .ExecuteCommandAsync(); + var msg = apiOutput.msg; + if (apiOutput.msg == "") + { + msg = "同步成功"; + } + var output = new SapOutput() + { + parameter = apiOutput.parameter, + code = codeVal, + msg = msg, + result = apiOutput.result + }; + return output; + } + + /// + /// 产品设计库-定时同步工艺路线到SAP + /// + /// + [ApiDescriptionSettings(Name = "TimingSyncToSAPProcessRoute"), HttpGet] + [DisplayName("产品设计库-定时同步工艺路线到SAP")] + [AllowAnonymous] + public async Task> TimingSyncToSAPProcessRoute() + { + var sapOutputList = new List(); + var sapUserName = await _sysConfigService.GetConfigValueByCode(ConfigConst.SapUserName); + // 配置 + var configid = await _configurationsRep.AsQueryable().Where(x => x.ObjectId == 137 && x.ConfigSystemName == "pBOM").FirstAsync(); + + //查询需要同步的产品 + var materialData = await _obj137Rep.AsQueryable() + .Where(x => x.CheckedStatus == 0 && x.deleted == false && x.IsLatestVersion == true && x.fld005529 == "成功" && (x.fld005537 == "A" || x.fld005537 == "M") && x._system_objConfigurationName == "默认" && (x.SWPDMFileName != "SLDDRW" || x.SWPDMFileName == null)) + .ToListAsync(); + //分组查询最大版本的物料 + var groupedData = materialData.GroupBy(item => item.RecordGuid) + .Select(group => group.OrderByDescending(item => item.VersionIndex).First()) + .ToList(); + + foreach (var item in groupedData) + { + // 获取版本号 + var versionIndex = item.VersionIndex; + // 查询 BOM + var processRouteData = await _configurationDataRep.AsQueryable() + .Where(x => x.ConfigId == configid.ConfigID && x.ParentGuid == item.RecordGuid && x.isDeleted == false && x.ParentVersion == versionIndex).ToListAsync(); + if (processRouteData.Count == 0) + { + continue; + } + var itemDataList = new List(); + + foreach (var processRouteItem in processRouteData) + { + var verification = await _dataValidationService.VerificationMaterial(processRouteItem.ChildObjID, processRouteItem.PartNumber, processRouteItem.ChildGuid); + if (verification == "不存在") + { + continue; + } + //获取工序描述 + var procedureDescription = await _obj122Rep.AsQueryable().Where(x => x.RecordGuid == processRouteItem.ChildGuid).ToListAsync(); + //获取工作中心 + var workCenter = await _obj121Rep.AsQueryable().Where(x => x.RecordGuid == procedureDescription[0].fld005059_Rec).ToListAsync(); + var itemData = new SapProcessRouteItemData() + { + VORNR = processRouteItem.Marker, + LTXA1 = procedureDescription[0]._System_ObjDescription, + ARBPL = workCenter[0]._System_objNBS, + VGW01 = processRouteItem.fld005571.ToString(), + VGE01 = processRouteItem.fld005572, + STEUS = processRouteItem.fld005573, + BMSCH = processRouteItem.fld005575.ToString() + + }; + itemDataList.Add(itemData); + } + //获取时间戳精确到毫秒,sap要求每次调用生成不重复guid + string millisecondTimestamp = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds().ToString(); + + var Datuv = item.fld005680.ToString(); + + if (!string.IsNullOrEmpty(Datuv)) + { + Datuv = item.fld005680.ToDateTime().ToString("yyyy-MM-dd"); + } + var isreq = new SapProcessRouteIS_REQ() + { + ReqKeyId = "", + BusinessId = "", + MessageId = "", + SndPrn = "PLM", + RcvPrn = "SAP", + ReqUser = await _sysConfigService.GetConfigValueByCode(ConfigConst.SapUserName), + Note1 = "", + Note2 = "", + Note3 = "", + Zwbid = millisecondTimestamp, + Matnr = item._System_objNBS, + Werks = item._SWPDM_1187_SAP___, + Datuv = Datuv, + Plnal = "", + + ItemList = itemDataList + }; + + var apiOutput = await _sapService.SapProcessRouteApi(isreq); + string codeVal = apiOutput.code == "S" ? "成功" : "失败"; + await _obj137Rep.AsUpdateable() + .SetColumns(it => new Obj137 + { + fld005540 = DateTime.Now, + fld005536 = codeVal, + fld005537 = "N", + fld005538 = apiOutput.msg + }) + .Where(it => it.idRecord == item.idRecord) + .ExecuteCommandAsync(); + var msg = apiOutput.msg; + if (apiOutput.msg == "") + { + msg = "同步成功"; + } + var output = new SapOutput() + { + parameter = apiOutput.parameter, + code = codeVal, + msg = msg, + result = apiOutput.result + }; + + sapOutputList.Add(output); + } + return sapOutputList; + } + +} diff --git a/admin.net.pro/Web/src/api/materialManagement/productDesignLibrary.ts b/admin.net.pro/Web/src/api/materialManagement/productDesignLibrary.ts new file mode 100644 index 0000000..fe45af6 --- /dev/null +++ b/admin.net.pro/Web/src/api/materialManagement/productDesignLibrary.ts @@ -0,0 +1,63 @@ +import request from '/@/utils/request'; +enum Api { + PageProductDesignLibrary = '/api/productDesignLibrary/page', + SyncToSAPProductDesignLibrary = '/api/productDesignLibrary/SyncToSAP', + GetBOMProductDesignLibrary = '/api/productDesignLibrary/getBOM', + SyncToSAPBomProductDesignLibrary = '/api/productDesignLibrary/syncToSAPBom', + BatchSyncToSAPProductDesignLibrary = '/api/productDesignLibrary/batchSyncToSAP', + GetetProcessRouteProductDesignLibrary = '/api/productDesignLibrary/getProcessRoute', + SyncToSAPProcessRouteProductDesignLibrary = '/api/productDesignLibrary/syncToSAPProcessRoute' +} + +// 分页查询产品管理 +export const PageProductDesignLibrary = (params?: any) => + request({ + url: Api.PageProductDesignLibrary, + method: 'post', + data: params, + }); + +// 同步到SAP +export const SyncToSAPProductDesignLibrary = (params?: any) => + request({ + url: Api.SyncToSAPProductDesignLibrary, + method: 'post', + data: params, + }); +// 分页查询产品管理BOM +export const GetBOMProductDesignLibrary = (params?: any) => + request({ + url: Api.GetBOMProductDesignLibrary, + method: 'post', + data: params, + }); + +// BOM同步到sap +export const SyncToSAPBomProductDesignLibrary = (params?: any) => + request({ + url: Api.SyncToSAPBomProductDesignLibrary, + method: 'post', + data: params, + }); +// 批量同步到SAP +export const BatchSyncToSAPProductDesignLibrary = (params?: any) => + request({ + url: Api.BatchSyncToSAPProductDesignLibrary, + method: 'post', + data: params, + }); + +// 分页查询工艺路线 +export const GetetProcessRouteProductDesignLibrary = (params?: any) => + request({ + url: Api.GetetProcessRouteProductDesignLibrary, + method: 'post', + data: params, + }); +// 工艺路线同步到sap +export const SyncToSAPProcessRouteProductDesignLibrary = (params?: any) => + request({ + url: Api.SyncToSAPProcessRouteProductDesignLibrary, + method: 'post', + data: params, + }); \ No newline at end of file diff --git a/admin.net.pro/Web/src/views/materialManagement/productDesignLibrary/index.vue b/admin.net.pro/Web/src/views/materialManagement/productDesignLibrary/index.vue new file mode 100644 index 0000000..52915c5 --- /dev/null +++ b/admin.net.pro/Web/src/views/materialManagement/productDesignLibrary/index.vue @@ -0,0 +1,493 @@ + + + + + + + + + + + + + + + + + + 查询 + 重置 + + + + + + + + 批量同步到SAP + + + + + + 同步BOM + + + + 工艺路线 + + + + 同步到SAP + + + + + + + + + + + + + + + + BOM同步到SAP + + + + + + + + + + + + + + + + 工艺路线同步到SAP + + + + + + + + + \ No newline at end of file