From 46ee4ea9947e1e52a7d3e2ab8a75c173122f2f5e Mon Sep 17 00:00:00 2001 From: bairubing Date: Fri, 27 Sep 2024 09:34:44 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=98=8E=E8=A1=8C=E6=94=BF=E7=89=A9?= =?UTF-8?q?=E6=96=99=E5=8A=9F=E8=83=BD=E5=AE=9E=E7=8E=B0=EF=BC=8C=E7=89=A9?= =?UTF-8?q?=E6=96=99=E5=90=8C=E6=AD=A5=E3=80=81BOM=E5=90=8C=E6=AD=A5?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Vistar.Application/Entity/Obj110.cs | 2 +- .../Vistar.Application/Entity/Obj133.cs | 14 +- ...AdministrativeMaterialManagementService.cs | 395 ++++++++++++++++++ .../AdministrativeMaterialManagementInput.cs | 191 +++++++++ .../AdministrativeMaterialManagementOutput.cs | 163 ++++++++ .../Dto/ProductManagementInput.cs | 2 +- .../Dto/ProductManagementOutput.cs | 2 +- .../ProductManagementService.cs | 6 +- .../ProductionMaterialsManagementService.cs | 6 +- .../ProjectManagementService.cs | 32 +- .../administrativeMaterialManagement.ts | 32 ++ admin.net.pro/Web/src/utils/request.ts | 2 +- .../index.vue | 226 ++++++++++ .../productManagement/index.vue | 2 +- .../projectManagement/index.vue | 2 +- 15 files changed, 1047 insertions(+), 30 deletions(-) create mode 100644 admin.net.pro/Admin.NET/Vistar.Application/Service/AdministrativeMaterialManagement/AdministrativeMaterialManagementService.cs create mode 100644 admin.net.pro/Admin.NET/Vistar.Application/Service/AdministrativeMaterialManagement/Dto/AdministrativeMaterialManagementInput.cs create mode 100644 admin.net.pro/Admin.NET/Vistar.Application/Service/AdministrativeMaterialManagement/Dto/AdministrativeMaterialManagementOutput.cs create mode 100644 admin.net.pro/Web/src/api/materialManagement/administrativeMaterialManagement.ts create mode 100644 admin.net.pro/Web/src/views/materialManagement/administrativeMaterialManagement/index.vue diff --git a/admin.net.pro/Admin.NET/Vistar.Application/Entity/Obj110.cs b/admin.net.pro/Admin.NET/Vistar.Application/Entity/Obj110.cs index 1da226d..cf78aed 100644 --- a/admin.net.pro/Admin.NET/Vistar.Application/Entity/Obj110.cs +++ b/admin.net.pro/Admin.NET/Vistar.Application/Entity/Obj110.cs @@ -714,7 +714,7 @@ public class Obj110 /// /// [SugarColumn(ColumnName = "fld004895", ColumnDescription = "", Length = -1)] - public long? fld004895 { get; set; } + public double? fld004895 { get; set; }//long /// /// diff --git a/admin.net.pro/Admin.NET/Vistar.Application/Entity/Obj133.cs b/admin.net.pro/Admin.NET/Vistar.Application/Entity/Obj133.cs index aa1c790..063566b 100644 --- a/admin.net.pro/Admin.NET/Vistar.Application/Entity/Obj133.cs +++ b/admin.net.pro/Admin.NET/Vistar.Application/Entity/Obj133.cs @@ -27,7 +27,7 @@ public class Obj133 /// /// [SugarColumn(ColumnName = "CheckedStatus", ColumnDescription = "")] - public bool? CheckedStatus { get; set; } + public int? CheckedStatus { get; set; } /// /// @@ -444,5 +444,15 @@ public class Obj133 /// [SugarColumn(ColumnName = "fld004974", ColumnDescription = "", Length = -1)] public string? fld004974 { get; set; } - + /// + /// + /// + [SugarColumn(ColumnName = "fld005285", ColumnDescription = "", Length = -1)] + public long? fld005285 { get; set; } + + /// + /// + /// + [SugarColumn(ColumnName = "fld005287", ColumnDescription = "", Length = -1)] + public long? fld005287 { get; set; } } diff --git a/admin.net.pro/Admin.NET/Vistar.Application/Service/AdministrativeMaterialManagement/AdministrativeMaterialManagementService.cs b/admin.net.pro/Admin.NET/Vistar.Application/Service/AdministrativeMaterialManagement/AdministrativeMaterialManagementService.cs new file mode 100644 index 0000000..9760355 --- /dev/null +++ b/admin.net.pro/Admin.NET/Vistar.Application/Service/AdministrativeMaterialManagement/AdministrativeMaterialManagementService.cs @@ -0,0 +1,395 @@ +// 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.Const; +using Vistar.Application.Entity; +using Vistar.Application.SapService.Dto; +using Vistar.Application.Service.AdministrativeMaterialManagement.Dto; +using Vistar.Application.Util; + +namespace Vistar.Application.Service.AdministrativeMaterialManagement; +/// +/// 行政物料管理服务 +/// +[ApiDescriptionSettings(ApplicationConst.GroupName, Name = "AdministrativeMaterialManagement", Order = 100)] +public class AdministrativeMaterialManagementService : IDynamicApiController, ITransient +{ + private readonly SqlSugarRepository _obj133Rep; + private readonly SysConfigService _sysConfigService; + public SapService.SapService _sapService; + private readonly SqlSugarRepository _configurationsRep; + private readonly SqlSugarRepository _configurationDataRep; + + public AdministrativeMaterialManagementService( + SqlSugarRepository obj133Rep, + SysConfigService sysConfigService, + SapService.SapService sapService, + SqlSugarRepository configurationsRep, + SqlSugarRepository configurationDataRep + ) + { + _obj133Rep = obj133Rep; + _sysConfigService = sysConfigService; + _sapService = sapService; + _configurationsRep = configurationsRep; + _configurationDataRep = configurationDataRep; + } + + /// + /// 分页查询行政物料管理 + /// + /// + /// + [ApiDescriptionSettings(Name = "page", Description = "分页查询行政物料管理", Order = 1000), HttpPost] + [DisplayName("分页查询行政物料管理")] + public async Task> Page(PageAdministrativeMaterialManagementInput input) + { + var query = await _obj133Rep.AsQueryable() + .Where(x => x.CheckedStatus == 7 && x.deleted == false && x.IsLatestVersion == true&&x.fld004974=="发布") + .WhereIF(!string.IsNullOrWhiteSpace(input._System_objNBS), u => u._System_objNBS.Contains(input._System_objNBS.Trim())) + .WhereIF(!string.IsNullOrWhiteSpace(input.fld004824), u => u.fld004824.Contains(input.fld004824.Trim())) + .WhereIF(input.fld004847Range != null && input.fld004847Range.Length == 2, u => u.fld004847 >= input.fld004847Range[0] && u.fld004847 <= input.fld004847Range[1]) + .Select() + .ToPagedListAsync(input.Page, input.PageSize); + return query; + } + + /// + /// 行政物料管理-同步到 SAP + /// + /// + [ApiDescriptionSettings(Name = "syncToSAP"), HttpPost] + [DisplayName("行政物料管理-同步到 SAP")] + public async Task SyncToSAP(AdministrativeMaterialManagementInput input) + { + const string lengthError = "项目描述长度大于40,请检查!"; + + // 验证物料描述长度 + if (input.fld004824.Length > 40) + { + await _obj133Rep.AsUpdateable() + .SetColumns(it => new Obj133 + { + fld004923 = DateTime.Now, + fld004922 = "N", + fld004921 = lengthError, + fld004920 = "失败" + }) + .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.fld004852, + Mtart = input.fld004851, + Maktx = input.fld004824, + Meins = input.fld004823, + Matkl = input.fld004850, + Bismt = input.fld004912, + Groes = input.fld004913, + Normt = input.fld004822, + Ferth = input.fld004914, + Zeinr = input.fld004915, + Mstae = input.fld004857, + Raube = input.fld004917, + Mhdrz = input.fld005285.ToString(), + Mhdhb = input.fld005287.ToString(), + Werks = input.fld004856, + Beskz = input.fld004855, + Sobsl = input.fld004854, + Schgt = input.fld004853, + Rgekz = input.fld004916, + Zbom = input.fld004858 + }; + + var apiOutput = await _sapService.SapMaterialApi(sapMaterialInput); + string codeVal = apiOutput.code == "S" ? "成功" : "失败"; + var msg = apiOutput.msg; + if (apiOutput.msg == "") + { + msg = "同步成功"; + } + + await _obj133Rep.AsUpdateable() + .SetColumns(it => new Obj133 + { + fld004923 = DateTime.Now, + fld004920 = codeVal, + fld004922 = "N", + fld004921 = msg + }) + .Where(it => it.idRecord == input.idRecord) + .ExecuteCommandAsync(); + 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].fld004824.Length > 40) + { + await _obj133Rep.AsUpdateable() + .SetColumns(it => new Obj133 + { + fld004923 = DateTime.Now, + fld004922 = "N", + fld004921 = lengthError, + fld004920 = "失败" + }) + .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].fld004922 != "A" && input[i].fld004922 != "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 = await _sysConfigService.GetConfigValueByCode(ConfigConst.SapUserName), + Note1 = "", + Note2 = "", + Note3 = "", + Zwbid = millisecondTimestamp, + Matnr = input[i]._System_objNBS, + Mbrsh = input[i].fld004852, + Mtart = input[i].fld004851, + Maktx = input[i].fld004824, + Meins = input[i].fld004823, + Matkl = input[i].fld004850, + Bismt = input[i].fld004912, + Groes = input[i].fld004913, + Normt = input[i].fld004822, + Ferth = input[i].fld004914, + Zeinr = input[i].fld004915, + Mstae = input[i].fld004857, + Raube = input[i].fld004917, + Mhdrz = input[i].fld005285.ToString(), + Mhdhb = input[i].fld005287.ToString(), + Werks = input[i].fld004856, + Beskz = input[i].fld004855, + Sobsl = input[i].fld004854, + Schgt = input[i].fld004853, + Rgekz = input[i].fld004916, + Zbom = input[i].fld004858 + }; + var sapOutput = await _sapService.SapMaterialApi(sapMaterialInput); + string codeVal = sapOutput.code == "S" ? "成功" : "失败"; + string msg = sapOutput.msg; + + if (sapOutput.msg == "") + { + msg = "同步成功"; + } + await _obj133Rep.AsUpdateable() + .SetColumns(it => new Obj133 + { + fld004923 = DateTime.Now, + fld004920 = codeVal, + fld004922 = "N", + fld004921 = 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 _obj133Rep.AsQueryable() + .Where(x => x.CheckedStatus == 7 && x.deleted == false && x.IsLatestVersion == true && (x.fld004922 == "A" || x.fld004922 == "M") && x.fld004974 == "发布") + .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].fld004824.Length > 40) + { + await _obj133Rep.AsUpdateable() + .SetColumns(it => new Obj133 + { + fld004923 = DateTime.Now, + fld004922 = "N", + fld004921 = lengthError, + fld004920 = "失败" + }) + .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 = await _sysConfigService.GetConfigValueByCode(ConfigConst.SapUserName), + Note1 = "", + Note2 = "", + Note3 = "", + Zwbid = millisecondTimestamp, + Matnr = input[i]._System_objNBS, + Mbrsh = input[i].fld004852, + Mtart = input[i].fld004851, + Maktx = input[i].fld004824, + Meins = input[i].fld004823, + Matkl = input[i].fld004850, + Bismt = input[i].fld004912, + Groes = input[i].fld004913, + Normt = input[i].fld004822, + Ferth = input[i].fld004914, + Zeinr = input[i].fld004915, + Mstae = input[i].fld004857, + Raube = input[i].fld004917, + Mhdrz = input[i].fld005285.ToString(), + Mhdhb = input[i].fld005287.ToString(), + Werks = input[i].fld004856, + Beskz = input[i].fld004855, + Sobsl = input[i].fld004854, + Schgt = input[i].fld004853, + Rgekz = input[i].fld004916, + Zbom = input[i].fld004858 + }; + var sapOutput = await _sapService.SapMaterialApi(sapMaterialInput); + string codeVal = sapOutput.code == "S" ? "成功" : "失败"; + string msg = sapOutput.msg; + + if (sapOutput.msg == "") + { + msg = "同步成功"; + } + await _obj133Rep.AsUpdateable() + .SetColumns(it => new Obj133 + { + fld004923 = DateTime.Now, + fld004920 = codeVal, + fld004922 = "N", + fld004921 = 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; + } + +} diff --git a/admin.net.pro/Admin.NET/Vistar.Application/Service/AdministrativeMaterialManagement/Dto/AdministrativeMaterialManagementInput.cs b/admin.net.pro/Admin.NET/Vistar.Application/Service/AdministrativeMaterialManagement/Dto/AdministrativeMaterialManagementInput.cs new file mode 100644 index 0000000..2601635 --- /dev/null +++ b/admin.net.pro/Admin.NET/Vistar.Application/Service/AdministrativeMaterialManagement/Dto/AdministrativeMaterialManagementInput.cs @@ -0,0 +1,191 @@ +// 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.AdministrativeMaterialManagement.Dto; +/// +/// 行政物料管理输入参数 +/// +public class AdministrativeMaterialManagementInput +{ + 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? GroupObjId { get; set; } + + public bool? _CheckOutInProgress { get; set; } + + public bool? EnableNotifications { 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 string? _System_DerivedFrom { get; set; } + + public string? _System_DerivedFrom_RecordGuid { get; set; } + + public bool? _system_objLinkedCompare { get; set; } + + public bool? isReleasedVersion { get; set; } + + public string? _System_WebLink { get; set; } + + public bool? LinkDrw { get; set; } + + public string? ParentRecordGuid { get; set; } + + public string? fld004822 { get; set; } + + public string? fld004823 { get; set; } + + public string? fld004824 { get; set; } + + public string? fld004825 { get; set; } + + public long? fld004846 { get; set; } + + public string? fld004846_Rec { get; set; } + + public DateTime? fld004847 { get; set; } + + public long? fld004848 { get; set; } + + public string? fld004848_Rec { get; set; } + + public DateTime? fld004849 { get; set; } + + public string? fld004850 { get; set; } + + public string? fld004851 { get; set; } + + public string? fld004852 { get; set; } + + public string? fld004853 { get; set; } + + public string? fld004854 { get; set; } + + public string? fld004855 { get; set; } + + public string? fld004856 { get; set; } + + public string? fld004857 { get; set; } + + public string? fld004858 { get; set; } + + public string? fld004912 { get; set; } + + public string? fld004913 { get; set; } + + public string? fld004914 { get; set; } + + public string? fld004915 { get; set; } + + public string? fld004916 { get; set; } + + public string? fld004917 { get; set; } + + public string? fld004918 { get; set; } + + public string? fld004919 { get; set; } + + public string? fld004920 { get; set; } + + public string? fld004921 { get; set; } + + public string? fld004922 { get; set; } + + public DateTime? fld004923 { get; set; } + + public string? fld004974 { get; set; } + + public long? fld005285 { get; set; } + public long? fld005287 { get; set; } +} +/// +/// 行政物料管理查询输入参数 +/// +public class PageAdministrativeMaterialManagementInput : BasePageInput +{ + /// + /// 物料编码 + /// + public string? _System_objNBS { get; set; } + + /// + /// 物料描述 + /// + public string? fld004824 { get; set; } + + /// + /// 创建时间 + /// + public DateTime? fld004847 { get; set; } + + /// + /// 创建时间范围 + /// + public DateTime?[] fld004847Range { get; set; } +} \ No newline at end of file diff --git a/admin.net.pro/Admin.NET/Vistar.Application/Service/AdministrativeMaterialManagement/Dto/AdministrativeMaterialManagementOutput.cs b/admin.net.pro/Admin.NET/Vistar.Application/Service/AdministrativeMaterialManagement/Dto/AdministrativeMaterialManagementOutput.cs new file mode 100644 index 0000000..e649355 --- /dev/null +++ b/admin.net.pro/Admin.NET/Vistar.Application/Service/AdministrativeMaterialManagement/Dto/AdministrativeMaterialManagementOutput.cs @@ -0,0 +1,163 @@ +// 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.AdministrativeMaterialManagement.Dto; +/// +/// 行政物料管理输出参数 +/// +public class AdministrativeMaterialManagementOutput +{ + 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? GroupObjId { get; set; } + + public bool? _CheckOutInProgress { get; set; } + + public bool? EnableNotifications { 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 string? _System_DerivedFrom { get; set; } + + public string? _System_DerivedFrom_RecordGuid { get; set; } + + public bool? _system_objLinkedCompare { get; set; } + + public bool? isReleasedVersion { get; set; } + + public string? _System_WebLink { get; set; } + + public bool? LinkDrw { get; set; } + + public string? ParentRecordGuid { get; set; } + + public string? fld004822 { get; set; } + + public string? fld004823 { get; set; } + + public string? fld004824 { get; set; } + + public string? fld004825 { get; set; } + + public long? fld004846 { get; set; } + + public string? fld004846_Rec { get; set; } + + public DateTime? fld004847 { get; set; } + + public long? fld004848 { get; set; } + + public string? fld004848_Rec { get; set; } + + public DateTime? fld004849 { get; set; } + + public string? fld004850 { get; set; } + + public string? fld004851 { get; set; } + + public string? fld004852 { get; set; } + + public string? fld004853 { get; set; } + + public string? fld004854 { get; set; } + + public string? fld004855 { get; set; } + + public string? fld004856 { get; set; } + + public string? fld004857 { get; set; } + + public string? fld004858 { get; set; } + + public string? fld004912 { get; set; } + + public string? fld004913 { get; set; } + + public string? fld004914 { get; set; } + + public string? fld004915 { get; set; } + + public string? fld004916 { get; set; } + + public string? fld004917 { get; set; } + + public string? fld004918 { get; set; } + + public string? fld004919 { get; set; } + + public string? fld004920 { get; set; } + + public string? fld004921 { get; set; } + + public string? fld004922 { get; set; } + + public DateTime? fld004923 { get; set; } + + public string? fld004974 { get; set; } + public long? fld005285 { get; set; } + public long? fld005287 { get; set; } + +} diff --git a/admin.net.pro/Admin.NET/Vistar.Application/Service/MaterialManagement/Dto/ProductManagementInput.cs b/admin.net.pro/Admin.NET/Vistar.Application/Service/MaterialManagement/Dto/ProductManagementInput.cs index f7b7be3..40bc6e4 100644 --- a/admin.net.pro/Admin.NET/Vistar.Application/Service/MaterialManagement/Dto/ProductManagementInput.cs +++ b/admin.net.pro/Admin.NET/Vistar.Application/Service/MaterialManagement/Dto/ProductManagementInput.cs @@ -480,7 +480,7 @@ public class ProductManagementBaseInput /// /// /// - public string? fld004895 { get; set; } + public double? fld004895 { get; set; } /// /// diff --git a/admin.net.pro/Admin.NET/Vistar.Application/Service/MaterialManagement/Dto/ProductManagementOutput.cs b/admin.net.pro/Admin.NET/Vistar.Application/Service/MaterialManagement/Dto/ProductManagementOutput.cs index 78499da..7bdfd20 100644 --- a/admin.net.pro/Admin.NET/Vistar.Application/Service/MaterialManagement/Dto/ProductManagementOutput.cs +++ b/admin.net.pro/Admin.NET/Vistar.Application/Service/MaterialManagement/Dto/ProductManagementOutput.cs @@ -242,7 +242,7 @@ public class ProductManagementOutput public string? fld004887 { get; set; } - public long? fld004895 { get; set; } + public double? fld004895 { get; set; } public float? fld004942 { get; set; } diff --git a/admin.net.pro/Admin.NET/Vistar.Application/Service/MaterialManagement/ProductManagementService.cs b/admin.net.pro/Admin.NET/Vistar.Application/Service/MaterialManagement/ProductManagementService.cs index a9c194d..e8fe28b 100644 --- a/admin.net.pro/Admin.NET/Vistar.Application/Service/MaterialManagement/ProductManagementService.cs +++ b/admin.net.pro/Admin.NET/Vistar.Application/Service/MaterialManagement/ProductManagementService.cs @@ -128,7 +128,7 @@ public class ProductManagementService : IDynamicApiController, ITransient Mstae = input.fld004699, Raube = input.fld004877, Mhdrz = input.fld004876, - Mhdhb = input.fld004895, + Mhdhb = input.fld004895.ToString(), Werks = input.fld004325, Beskz = input.fld004490, Sobsl = input.fld004491, @@ -311,7 +311,7 @@ public class ProductManagementService : IDynamicApiController, ITransient }); continue; } - if (input[i].fld004312 != "A" || input[i].fld004312 != "M") + if (input[i].fld004312 != "A" && input[i].fld004312 != "M") { SapOutputList.Add(new SapOutput() { @@ -350,7 +350,7 @@ public class ProductManagementService : IDynamicApiController, ITransient Mstae = input[i].fld004699, Raube = input[i].fld004877, Mhdrz = input[i].fld004876, - Mhdhb = input[i].fld004895, + Mhdhb = input[i].fld004895.ToString(), Werks = input[i].fld004325, Beskz = input[i].fld004490, Sobsl = input[i].fld004491, diff --git a/admin.net.pro/Admin.NET/Vistar.Application/Service/ProductionMaterialsManagement/ProductionMaterialsManagementService.cs b/admin.net.pro/Admin.NET/Vistar.Application/Service/ProductionMaterialsManagement/ProductionMaterialsManagementService.cs index d5fbdd1..c3f2220 100644 --- a/admin.net.pro/Admin.NET/Vistar.Application/Service/ProductionMaterialsManagement/ProductionMaterialsManagementService.cs +++ b/admin.net.pro/Admin.NET/Vistar.Application/Service/ProductionMaterialsManagement/ProductionMaterialsManagementService.cs @@ -59,7 +59,7 @@ public class ProductionMaterialsManagementService : IDynamicApiController, ITran public async Task> Page(PageProductionMaterialsManagementInput input) { var query = await _obj112Rep.AsQueryable() - .Where(x => x.CheckedStatus == 7 && x.deleted == false && x.IsLatestVersion == true) + .Where(x => x.CheckedStatus == 7 && x.deleted == false && x.IsLatestVersion == true && x.fld004973=="发布") .WhereIF(!string.IsNullOrWhiteSpace(input._System_objNBS), u => u._System_objNBS.Contains(input._System_objNBS.Trim())) .WhereIF(!string.IsNullOrWhiteSpace(input.fld004598), u => u.fld004598.Contains(input.fld004598.Trim())) .WhereIF(input.fld004609Range != null && input.fld004609Range.Length == 2, u => u.fld004609 >= input.fld004609Range[0] && u.fld004609 <= input.fld004609Range[1]) @@ -204,7 +204,7 @@ public class ProductionMaterialsManagementService : IDynamicApiController, ITran }); continue; } - if (input[i].fld004607 != "A"|| input[i].fld004607 != "M") + if (input[i].fld004607 != "A"&& input[i].fld004607 != "M") { SapOutputList.Add(new SapOutput() { @@ -292,7 +292,7 @@ public class ProductionMaterialsManagementService : IDynamicApiController, ITran public async Task> TimingSyncToSAP() { var input = await _obj112Rep.AsQueryable() - .Where(x => x.CheckedStatus == 7 && x.deleted == false && x.IsLatestVersion == true&&(x.fld004607=="A"||x.fld004607 == "M")) + .Where(x => x.CheckedStatus == 7 && x.deleted == false && x.IsLatestVersion == true&&(x.fld004607=="A"||x.fld004607 == "M") && x.fld004973 == "发布") .ToListAsync(); const string lengthError = "物料描述长度大于40,请检查!"; var SapOutputList = new List(); diff --git a/admin.net.pro/Admin.NET/Vistar.Application/Service/ProjectManagement/ProjectManagementService.cs b/admin.net.pro/Admin.NET/Vistar.Application/Service/ProjectManagement/ProjectManagementService.cs index 86fc1d5..7b0f57e 100644 --- a/admin.net.pro/Admin.NET/Vistar.Application/Service/ProjectManagement/ProjectManagementService.cs +++ b/admin.net.pro/Admin.NET/Vistar.Application/Service/ProjectManagement/ProjectManagementService.cs @@ -122,7 +122,7 @@ public class ProjectManagementService : IDynamicApiController, ITransient Maktx = input.fld004502, Meins = input.fld005281, Matkl = input.fld004520, - Bismt = input.fld004684, + Bismt = input.fld004686, Groes = input.fld004685, Normt = input.fld004924, Ferth = input.fld004925, @@ -132,8 +132,8 @@ public class ProjectManagementService : IDynamicApiController, ITransient Mhdrz = input.fld004933.ToString(), Mhdhb = input.fld004934.ToString(), Werks = input.fld004522, - Beskz = input.fld004929, - Sobsl = input.fld004928, + Beskz = input.fld004928, + Sobsl = input.fld004929, Schgt = input.fld004930, Rgekz = input.fld004931, Zbom = input.fld004935 @@ -151,9 +151,9 @@ public class ProjectManagementService : IDynamicApiController, ITransient .SetColumns(it => new Obj109 { fld004508 = DateTime.Now, - fld004510 = codeVal, - fld004507 = "N", - fld004509 = msg + fld004507=msg, + fld004509=codeVal, + fld004510 = "N" }) .Where(it => it.idRecord == input.idRecord) .ExecuteCommandAsync(); @@ -205,7 +205,7 @@ public class ProjectManagementService : IDynamicApiController, ITransient }); continue; } - if (input[i].fld004510 != "A" || input[i].fld004510 != "M") + if (input[i].fld004510 != "A" && input[i].fld004510 != "M") { SapOutputList.Add(new SapOutput() { @@ -236,7 +236,7 @@ public class ProjectManagementService : IDynamicApiController, ITransient Maktx = input[i].fld004502, Meins = input[i].fld005281, Matkl = input[i].fld004520, - Bismt = input[i].fld004684, + Bismt = input[i].fld004686, Groes = input[i].fld004685, Normt = input[i].fld004924, Ferth = input[i].fld004925, @@ -246,8 +246,8 @@ public class ProjectManagementService : IDynamicApiController, ITransient Mhdrz = input[i].fld004933.ToString(), Mhdhb = input[i].fld004934.ToString(), Werks = input[i].fld004522, - Beskz = input[i].fld004929, - Sobsl = input[i].fld004928, + Beskz = input[i].fld004928, + Sobsl = input[i].fld004929, Schgt = input[i].fld004930, Rgekz = input[i].fld004931, Zbom = input[i].fld004935 @@ -264,9 +264,9 @@ public class ProjectManagementService : IDynamicApiController, ITransient .SetColumns(it => new Obj109 { fld004508 = DateTime.Now, - fld004510 = "N", - fld004507 = lengthError, - fld004509 = "失败" + fld004507 = msg, + fld004509 = codeVal, + fld004510 = "N" }) .Where(it => it.idRecord == input[i].idRecord) .ExecuteCommandAsync(); @@ -456,7 +456,7 @@ public class ProjectManagementService : IDynamicApiController, ITransient Maktx = input[i].fld004502, Meins = input[i].fld005281, Matkl = input[i].fld004520, - Bismt = input[i].fld004684, + Bismt = input[i].fld004686, Groes = input[i].fld004685, Normt = input[i].fld004924, Ferth = input[i].fld004925, @@ -466,8 +466,8 @@ public class ProjectManagementService : IDynamicApiController, ITransient Mhdrz = input[i].fld004933.ToString(), Mhdhb = input[i].fld004934.ToString(), Werks = input[i].fld004522, - Beskz = input[i].fld004929, - Sobsl = input[i].fld004928, + Beskz = input[i].fld004928, + Sobsl = input[i].fld004929, Schgt = input[i].fld004930, Rgekz = input[i].fld004931, Zbom = input[i].fld004935 diff --git a/admin.net.pro/Web/src/api/materialManagement/administrativeMaterialManagement.ts b/admin.net.pro/Web/src/api/materialManagement/administrativeMaterialManagement.ts new file mode 100644 index 0000000..6a9a7b6 --- /dev/null +++ b/admin.net.pro/Web/src/api/materialManagement/administrativeMaterialManagement.ts @@ -0,0 +1,32 @@ +import request from '/@/utils/request'; +enum Api { + PageAdministrativeMaterialManagement = '/api/administrativeMaterialManagement/page', + SyncToSAPAdministrativeMaterialManagement = '/api/administrativeMaterialManagement/SyncToSAP', + BatchSyncToSAPAdministrativeMaterialManagement = '/api/administrativeMaterialManagement/batchSyncToSAP' +} + +// 分页查询产品管理 +export const PageAdministrativeMaterialManagement = (params?: any) => + request({ + url: Api.PageAdministrativeMaterialManagement, + method: 'post', + data: params, + }); + +// 同步到SAP +export const SyncToSAPAdministrativeMaterialManagement = (params?: any) => + request({ + url: Api.SyncToSAPAdministrativeMaterialManagement, + method: 'post', + data: params, + }); + +// 批量同步到SAP +export const BatchSyncToSAPAdministrativeMaterialManagement = (params?: any) => + request({ + url: Api.BatchSyncToSAPAdministrativeMaterialManagement, + method: 'post', + data: params, + }); + + \ No newline at end of file diff --git a/admin.net.pro/Web/src/utils/request.ts b/admin.net.pro/Web/src/utils/request.ts index c84b56e..c7a7862 100644 --- a/admin.net.pro/Web/src/utils/request.ts +++ b/admin.net.pro/Web/src/utils/request.ts @@ -5,7 +5,7 @@ import { Local, Session } from '/@/utils/storage'; // 配置新建一个 axios 实例 export const service = axios.create({ baseURL: window.__env__.VITE_API_URL as any, - timeout: 50000, + timeout: 60000,//50000 headers: { 'Content-Type': 'application/json' }, }); diff --git a/admin.net.pro/Web/src/views/materialManagement/administrativeMaterialManagement/index.vue b/admin.net.pro/Web/src/views/materialManagement/administrativeMaterialManagement/index.vue new file mode 100644 index 0000000..d680929 --- /dev/null +++ b/admin.net.pro/Web/src/views/materialManagement/administrativeMaterialManagement/index.vue @@ -0,0 +1,226 @@ + + + \ No newline at end of file diff --git a/admin.net.pro/Web/src/views/materialManagement/productManagement/index.vue b/admin.net.pro/Web/src/views/materialManagement/productManagement/index.vue index d1a9d84..2a3ab1c 100644 --- a/admin.net.pro/Web/src/views/materialManagement/productManagement/index.vue +++ b/admin.net.pro/Web/src/views/materialManagement/productManagement/index.vue @@ -49,7 +49,7 @@