diff --git a/admin.net.pro/Admin.NET/Vistar.Application/Entity/Obj137.cs b/admin.net.pro/Admin.NET/Vistar.Application/Entity/Obj137.cs index c71824c..878ed71 100644 --- a/admin.net.pro/Admin.NET/Vistar.Application/Entity/Obj137.cs +++ b/admin.net.pro/Admin.NET/Vistar.Application/Entity/Obj137.cs @@ -547,12 +547,6 @@ public class Obj137 [SugarColumn(ColumnName = "_SWPDM_94_PDF___", ColumnDescription = "", Length = -1)] public string? _SWPDM_94_PDF___ { get; set; } - /// - /// - /// - [SugarColumn(ColumnName = "_SWPDM_101_PDF___", ColumnDescription = "", Length = -1)] - public string? _SWPDM_101_PDF___ { get; set; } - /// /// /// @@ -565,17 +559,8 @@ public class Obj137 [SugarColumn(ColumnName = "_SWPDM_96_PDF___", ColumnDescription = "", Length = -1)] public string? _SWPDM_96_PDF___ { get; set; } - /// - /// - /// - [SugarColumn(ColumnName = "_SWPDM_97_PDF___", ColumnDescription = "", Length = -1)] - public string? _SWPDM_97_PDF___ { get; set; } - /// - /// - /// - [SugarColumn(ColumnName = "_SWPDM_98_PDF___", ColumnDescription = "", Length = -1)] - public string? _SWPDM_98_PDF___ { get; set; } + /// /// @@ -589,11 +574,7 @@ public class Obj137 [SugarColumn(ColumnName = "_SWPDM_99_PDF___", ColumnDescription = "", Length = -1)] public string? _SWPDM_99_PDF___ { get; set; } - /// - /// - /// - [SugarColumn(ColumnName = "_SWPDM_100_PDF___", ColumnDescription = "", Length = -1)] - public string? _SWPDM_100_PDF___ { get; set; } + /// /// @@ -757,17 +738,7 @@ public class Obj137 [SugarColumn(ColumnName = "_SWPDM_60_SW___", ColumnDescription = "", Length = -1)] public string? _SWPDM_60_SW___ { get; set; } - /// - /// - /// - [SugarColumn(ColumnName = "_SWPDM_124_SW___", ColumnDescription = "", Length = -1)] - public string? _SWPDM_124_SW___ { get; set; } - /// - /// - /// - [SugarColumn(ColumnName = "_SWPDM_102_SW___", ColumnDescription = "", Length = -1)] - public string? _SWPDM_102_SW___ { get; set; } /// /// @@ -919,12 +890,6 @@ public class Obj137 [SugarColumn(ColumnName = "_SWPDM_1202_SW_____", ColumnDescription = "", Length = -1)] public string? _SWPDM_1202_SW_____ { get; set; } - /// - /// - /// - [SugarColumn(ColumnName = "_SWPDM_49_SW___", ColumnDescription = "", Length = -1)] - public string? _SWPDM_49_SW___ { 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 index aa6603b..1ecfb56 100644 --- 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 @@ -191,21 +191,17 @@ public class ProductDesignLibraryOutput 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; } @@ -260,10 +256,6 @@ public class ProductDesignLibraryOutput 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; } @@ -314,7 +306,6 @@ public class ProductDesignLibraryOutput public string? _SWPDM_1202_SW_____ { get; set; } - public string? _SWPDM_49_SW___ { get; set; } public string? _SWPDM_129_SW_____ { 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 index 2ffab57..bf28397 100644 --- a/admin.net.pro/Admin.NET/Vistar.Application/Service/ProductDesignLibrary/ProductDesignLibraryService.cs +++ b/admin.net.pro/Admin.NET/Vistar.Application/Service/ProductDesignLibrary/ProductDesignLibraryService.cs @@ -73,7 +73,7 @@ public class ProductDesignLibraryService : IDynamicApiController, ITransient 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)) + .Where(x => x.CheckedStatus == 0 && x.deleted == false && x.IsLatestVersion == true && x._system_objConfigurationName == "默认" && !x.SWPDMFileName.Contains("SLDDRW")) .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() @@ -189,10 +189,10 @@ public class ProductDesignLibraryService : IDynamicApiController, ITransient { 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)) + .Where(x => x.RecordGuid == input.ParentGuid && x.deleted == false && x._system_objConfigurationName == "默认" && !x.SWPDMFileName.Contains("SLDDRW")) .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)) + .Where(x => x.ConfigId == configid.ConfigID && x.ParentGuid == input.ParentGuid && x.isDeleted == false && x.ParentVersion == parent && (x.fld005577 != "不包含" || x.fld005577 == null)&&x.isSuppressed==false) .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); @@ -207,7 +207,7 @@ public class ProductDesignLibraryService : IDynamicApiController, ITransient [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) && x.fld005530 == "N" && x.fld005529 == "成功" && (x.fld005534 == "A" || x.fld005534 == "M") && x._system_objConfigurationName == "默认" && (x.SWPDMFileName != "SLDDRW" || x.SWPDMFileName == null)).FirstAsync(); + 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) && x.fld005530 == "N" && x.fld005529 == "成功" && (x.fld005534 == "A" || x.fld005534 == "M") && x._system_objConfigurationName == "默认" && !x.SWPDMFileName.Contains("SLDDRW")).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) @@ -244,7 +244,7 @@ public class ProductDesignLibraryService : IDynamicApiController, ITransient 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(); + 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) && x.isSuppressed == false).ToListAsync(); for (int i = 0; i < BomData.Count; i++) { @@ -451,36 +451,40 @@ public class ProductDesignLibraryService : IDynamicApiController, ITransient 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)) + .Where(x => x.CheckedStatus == 0 && x.deleted == false && x.IsLatestVersion == true && (x.fld005530 == "A" || x.fld005530 == "M") && x._system_objConfigurationName == "默认" && !x.SWPDMFileName.Contains("SLDDRW")) .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) + if (!string.IsNullOrEmpty(input[i]._SWPDM_1188_SAP___)) { - 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() + // 验证物料描述长度 + if (input[i]._SWPDM_1188_SAP___.Length > 40) { - materialCode = input[i]._System_objNBS, - code = "失败", - msg = lengthError, - result = lengthError - }); - continue; + 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(); @@ -564,7 +568,7 @@ public class ProductDesignLibraryService : IDynamicApiController, ITransient 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._SWPDM_1202_SW_____ != "不展开" || x._SWPDM_1202_SW_____ == null) && x.fld005530 == "N" && x.fld005529 == "成功" && (x.fld005534 == "A" || x.fld005534 == "M") && x._system_objConfigurationName == "默认" && (x.SWPDMFileName != "SLDDRW" || x.SWPDMFileName == null)) + .Where(x => x.CheckedStatus == 0 && x.deleted == false && x.IsLatestVersion == true && (x._SWPDM_1202_SW_____ != "不展开" || x._SWPDM_1202_SW_____ == null) && x.fld005530 == "N" && x.fld005529 == "成功" && (x.fld005534 == "A" || x.fld005534 == "M") && x._system_objConfigurationName == "默认" && !x.SWPDMFileName.Contains("SLDDRW")) .ToListAsync(); var groupedData = materialData.GroupBy(item => item.RecordGuid) .Select(group => group.OrderByDescending(item => item.VersionIndex).First()) @@ -578,7 +582,7 @@ public class ProductDesignLibraryService : IDynamicApiController, ITransient 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(); + .Where(x => x.ConfigId == configid.ConfigID && x.ParentGuid == item.RecordGuid && x.isDeleted == false && x.ParentVersion == versionIndex && (x.fld005577 != "不包含" || x.fld005577 == null) && x.isSuppressed == false).ToListAsync(); if (bomData.Count == 0) { continue; @@ -618,7 +622,7 @@ public class ProductDesignLibraryService : IDynamicApiController, ITransient 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(); + 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) && x.isSuppressed == false).ToListAsync(); for (int i = 0; i < BomData.Count; i++) { @@ -724,7 +728,7 @@ public class ProductDesignLibraryService : IDynamicApiController, ITransient && x.CheckedStatus == 0 && x.deleted == false && x._system_objConfigurationName == "默认" - && (x.SWPDMFileName != "SLDDRW" || x.SWPDMFileName == null) + && !x.SWPDMFileName.Contains("SLDDRW") && (x._SWPDM_1202_SW_____ != "不展开" || x._SWPDM_1202_SW_____ == null) && x.fld005530 == "N" && x.fld005529 == "成功" @@ -753,8 +757,8 @@ public class ProductDesignLibraryService : IDynamicApiController, ITransient x.RecordGuid == input[0].ParentGuid && x.deleted == false && x.VersionIndex == input[0].ParentVersion - && x._system_objConfigurationName == "默认" - && (x.SWPDMFileName != "SLDDRW" || x.SWPDMFileName == null) + && x._system_objConfigurationName == "默认" + && !x.SWPDMFileName.Contains("SLDDRW") && x.CheckedStatus == 0 && (x._SWPDM_1202_SW_____ != "不展开" || x._SWPDM_1202_SW_____ == null) && x.fld005530 == "N" @@ -867,8 +871,8 @@ public class ProductDesignLibraryService : IDynamicApiController, ITransient x.CheckedStatus == 0 && x.deleted == false && x.IsLatestVersion == true - && x._system_objConfigurationName == "默认" - && (x.SWPDMFileName != "SLDDRW" || x.SWPDMFileName == null) + && x._system_objConfigurationName == "默认" + && !x.SWPDMFileName.Contains("SLDDRW") && (x._SWPDM_1202_SW_____ != "不展开" || x._SWPDM_1202_SW_____ == null) && x.fld005530 == "N" && x.fld005529 == "成功"