😎生产物料管理功能实现
This commit is contained in:
parent
1ba505ed19
commit
aa508e9cfa
@ -812,5 +812,6 @@ public class Obj109
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnName = "fld005040", ColumnDescription = "", Length = -1)]
|
[SugarColumn(ColumnName = "fld005040", ColumnDescription = "", Length = -1)]
|
||||||
public string? fld005040 { get; set; }
|
public string? fld005040 { get; set; }
|
||||||
|
public string fld005281 { get; set; }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -27,7 +27,7 @@ public class Obj112
|
|||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnName = "CheckedStatus", ColumnDescription = "")]
|
[SugarColumn(ColumnName = "CheckedStatus", ColumnDescription = "")]
|
||||||
public bool? CheckedStatus { get; set; }
|
public int? CheckedStatus { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
|
@ -311,7 +311,7 @@ public class ProductManagementService : IDynamicApiController, ITransient
|
|||||||
});
|
});
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (input[i].fld004312 == "N")
|
if (input[i].fld004312 != "A" || input[i].fld004312 != "M")
|
||||||
{
|
{
|
||||||
SapOutputList.Add(new SapOutput()
|
SapOutputList.Add(new SapOutput()
|
||||||
{
|
{
|
||||||
|
@ -0,0 +1,347 @@
|
|||||||
|
// 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.ProductionMaterialsManagement.Dto;
|
||||||
|
/// <summary>
|
||||||
|
/// 生产物料管理输入参数
|
||||||
|
/// </summary>
|
||||||
|
public class ProductionMaterialsManagementInput
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
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; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public string? _system_objConfigurationName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public bool? _system_objConfigurationType { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public string? _system_objConfigurationGuid { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public string ShowBomFromConfiguration { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public string _System_ObjNbsAuto { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public string? _System_DerivedFrom { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public string? _System_DerivedFrom_RecordGuid { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public bool? _system_objLinkedCompare { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public bool? isReleasedVersion { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public string? _System_WebLink { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public bool? LinkDrw { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public string? ParentRecordGuid { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 品牌
|
||||||
|
/// </summary>
|
||||||
|
public string? fld004592 { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 材料
|
||||||
|
/// </summary>
|
||||||
|
public string? fld004593 { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 单位
|
||||||
|
/// </summary>
|
||||||
|
public string? fld004594 { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 行业领域
|
||||||
|
/// </summary>
|
||||||
|
public string? fld004595 { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 物料类型
|
||||||
|
/// </summary>
|
||||||
|
public string? fld004596 { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 工厂
|
||||||
|
/// </summary>
|
||||||
|
public string? fld004597 { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 物料描述
|
||||||
|
/// </summary>
|
||||||
|
public string? fld004598 { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 物料组
|
||||||
|
/// </summary>
|
||||||
|
public string? fld004599 { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 采购类型
|
||||||
|
/// </summary>
|
||||||
|
public string? fld004600 { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 特殊采购
|
||||||
|
/// </summary>
|
||||||
|
public string? fld004601 { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 散装物料
|
||||||
|
/// </summary>
|
||||||
|
public string? fld004602 { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 反冲
|
||||||
|
/// </summary>
|
||||||
|
public string? fld004603 { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 物料同步状态
|
||||||
|
/// </summary>
|
||||||
|
public string? fld004604 { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 物料同步信息
|
||||||
|
/// </summary>
|
||||||
|
public string? fld004605 { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 物料同步时间
|
||||||
|
/// </summary>
|
||||||
|
public DateTime? fld004606 { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 物料同步标识 A:新增 M:修改 D:停用 N:已处理
|
||||||
|
/// </summary>
|
||||||
|
public string? fld004607 { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 创建人员
|
||||||
|
/// </summary>
|
||||||
|
public long? fld004608 { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 创建人员ID
|
||||||
|
/// </summary>
|
||||||
|
public string? fld004608_Rec { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 创建日期
|
||||||
|
/// </summary>
|
||||||
|
public DateTime? fld004609 { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 审核人员
|
||||||
|
/// </summary>
|
||||||
|
public long? fld004610 { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 审核人员ID
|
||||||
|
/// </summary>
|
||||||
|
public string? fld004610_Rec { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 审核日期
|
||||||
|
/// </summary>
|
||||||
|
public DateTime? fld004611 { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 物料状态
|
||||||
|
/// </summary>
|
||||||
|
public string? fld004612 { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 一级分类代号
|
||||||
|
/// </summary>
|
||||||
|
public string? fld004613 { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 二级分类代号
|
||||||
|
/// </summary>
|
||||||
|
public string? fld004614 { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 三级分类代号
|
||||||
|
/// </summary>
|
||||||
|
public string? fld004615 { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 四级分类代号
|
||||||
|
/// </summary>
|
||||||
|
public string? fld004616 { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 一级分类
|
||||||
|
/// </summary>
|
||||||
|
public string? fld004617 { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 二级分类
|
||||||
|
/// </summary>
|
||||||
|
public string? fld004618 { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 三级分类
|
||||||
|
/// </summary>
|
||||||
|
public string? fld004619 { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 四级分类
|
||||||
|
/// </summary>
|
||||||
|
public string? fld004620 { get; set; }
|
||||||
|
|
||||||
|
public string? fld004695 { get; set; }
|
||||||
|
|
||||||
|
public string? fld004696 { get; set; }
|
||||||
|
|
||||||
|
public string? fld004697 { get; set; }
|
||||||
|
|
||||||
|
public string? fld004901 { get; set; }
|
||||||
|
|
||||||
|
public string? fld004902 { get; set; }
|
||||||
|
|
||||||
|
public string? fld004903 { get; set; }
|
||||||
|
|
||||||
|
public string? fld004904 { get; set; }
|
||||||
|
|
||||||
|
public double? fld004905 { get; set; }
|
||||||
|
|
||||||
|
public double? fld004907 { get; set; }
|
||||||
|
|
||||||
|
public string? fld004908 { get; set; }
|
||||||
|
|
||||||
|
public string? fld004909 { get; set; }
|
||||||
|
|
||||||
|
public string? fld004910 { get; set; }
|
||||||
|
|
||||||
|
public string? fld004911 { get; set; }
|
||||||
|
|
||||||
|
public string? fld004973 { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 生产物料管理查询输入参数
|
||||||
|
/// </summary>
|
||||||
|
public class PageProductionMaterialsManagementInput : BasePageInput
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 物料编码
|
||||||
|
/// </summary>
|
||||||
|
public string? _System_objNBS { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 物料描述
|
||||||
|
/// </summary>
|
||||||
|
public string? fld004598 { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 创建时间
|
||||||
|
/// </summary>
|
||||||
|
public DateTime? fld004609 { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 创建时间范围
|
||||||
|
/// </summary>
|
||||||
|
public DateTime?[] fld004609Range { get; set; }
|
||||||
|
}
|
@ -0,0 +1,315 @@
|
|||||||
|
// 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.ProductionMaterialsManagement.Dto;
|
||||||
|
/// <summary>
|
||||||
|
/// 生产物料管理输出参数
|
||||||
|
/// </summary>
|
||||||
|
public class ProductionMaterialsManagementOutput
|
||||||
|
{
|
||||||
|
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; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public string? _system_objConfigurationName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public bool? _system_objConfigurationType { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public string? _system_objConfigurationGuid { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public string ShowBomFromConfiguration { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public string _System_ObjNbsAuto { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public string? _System_DerivedFrom { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public string? _System_DerivedFrom_RecordGuid { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public bool? _system_objLinkedCompare { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public bool? isReleasedVersion { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public string? _System_WebLink { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public bool? LinkDrw { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public string? ParentRecordGuid { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 品牌
|
||||||
|
/// </summary>
|
||||||
|
public string? fld004592 { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 材料
|
||||||
|
/// </summary>
|
||||||
|
public string? fld004593 { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 单位
|
||||||
|
/// </summary>
|
||||||
|
public string? fld004594 { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 行业领域
|
||||||
|
/// </summary>
|
||||||
|
public string? fld004595 { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 物料类型
|
||||||
|
/// </summary>
|
||||||
|
public string? fld004596 { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 工厂
|
||||||
|
/// </summary>
|
||||||
|
public string? fld004597 { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 物料描述
|
||||||
|
/// </summary>
|
||||||
|
public string? fld004598 { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 物料组
|
||||||
|
/// </summary>
|
||||||
|
public string? fld004599 { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 采购类型
|
||||||
|
/// </summary>
|
||||||
|
public string? fld004600 { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 特殊采购
|
||||||
|
/// </summary>
|
||||||
|
public string? fld004601 { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 散装物料
|
||||||
|
/// </summary>
|
||||||
|
public string? fld004602 { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 反冲
|
||||||
|
/// </summary>
|
||||||
|
public string? fld004603 { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 物料同步状态
|
||||||
|
/// </summary>
|
||||||
|
public string? fld004604 { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 物料同步信息
|
||||||
|
/// </summary>
|
||||||
|
public string? fld004605 { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 物料同步时间
|
||||||
|
/// </summary>
|
||||||
|
public DateTime? fld004606 { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 物料同步标识 A:新增 M:修改 D:停用 N:已处理
|
||||||
|
/// </summary>
|
||||||
|
public string? fld004607 { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 创建人员
|
||||||
|
/// </summary>
|
||||||
|
public long? fld004608 { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 创建人员ID
|
||||||
|
/// </summary>
|
||||||
|
public string? fld004608_Rec { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 创建日期
|
||||||
|
/// </summary>
|
||||||
|
public DateTime? fld004609 { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 审核人员
|
||||||
|
/// </summary>
|
||||||
|
public long? fld004610 { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 审核人员ID
|
||||||
|
/// </summary>
|
||||||
|
public string? fld004610_Rec { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 审核日期
|
||||||
|
/// </summary>
|
||||||
|
public DateTime? fld004611 { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 物料状态
|
||||||
|
/// </summary>
|
||||||
|
public string? fld004612 { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 一级分类代号
|
||||||
|
/// </summary>
|
||||||
|
public string? fld004613 { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 二级分类代号
|
||||||
|
/// </summary>
|
||||||
|
public string? fld004614 { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 三级分类代号
|
||||||
|
/// </summary>
|
||||||
|
public string? fld004615 { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 四级分类代号
|
||||||
|
/// </summary>
|
||||||
|
public string? fld004616 { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 一级分类
|
||||||
|
/// </summary>
|
||||||
|
public string? fld004617 { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 二级分类
|
||||||
|
/// </summary>
|
||||||
|
public string? fld004618 { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 三级分类
|
||||||
|
/// </summary>
|
||||||
|
public string? fld004619 { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 四级分类
|
||||||
|
/// </summary>
|
||||||
|
public string? fld004620 { get; set; }
|
||||||
|
|
||||||
|
public string? fld004695 { get; set; }
|
||||||
|
|
||||||
|
public string? fld004696 { get; set; }
|
||||||
|
|
||||||
|
public string? fld004697 { get; set; }
|
||||||
|
|
||||||
|
public string? fld004901 { get; set; }
|
||||||
|
|
||||||
|
public string? fld004902 { get; set; }
|
||||||
|
|
||||||
|
public string? fld004903 { get; set; }
|
||||||
|
|
||||||
|
public string? fld004904 { get; set; }
|
||||||
|
|
||||||
|
public double? fld004905 { get; set; }
|
||||||
|
|
||||||
|
public double? fld004907 { get; set; }
|
||||||
|
|
||||||
|
public string? fld004908 { get; set; }
|
||||||
|
|
||||||
|
public string? fld004909 { get; set; }
|
||||||
|
|
||||||
|
public string? fld004910 { get; set; }
|
||||||
|
|
||||||
|
public string? fld004911 { get; set; }
|
||||||
|
|
||||||
|
public string? fld004973 { get; set; }
|
||||||
|
}
|
@ -0,0 +1,394 @@
|
|||||||
|
// 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.ProductionMaterialsManagement.Dto;
|
||||||
|
using Vistar.Application.Util;
|
||||||
|
|
||||||
|
namespace Vistar.Application.Service.ProductionMaterialsManagement;
|
||||||
|
/// <summary>
|
||||||
|
/// 生产物料管理服务
|
||||||
|
/// </summary>
|
||||||
|
[ApiDescriptionSettings(ApplicationConst.GroupName, Name = "ProductionMaterialsManagement", Order = 100)]
|
||||||
|
public class ProductionMaterialsManagementService : IDynamicApiController, ITransient
|
||||||
|
{
|
||||||
|
private readonly SqlSugarRepository<Obj112> _obj112Rep;
|
||||||
|
private readonly SysConfigService _sysConfigService;
|
||||||
|
public SapService.SapService _sapService;
|
||||||
|
private readonly SqlSugarRepository<Configurations> _configurationsRep;
|
||||||
|
private readonly SqlSugarRepository<ConfigurationData> _configurationDataRep;
|
||||||
|
|
||||||
|
public ProductionMaterialsManagementService(
|
||||||
|
SqlSugarRepository<Obj112> obj112Rep,
|
||||||
|
SysConfigService sysConfigService,
|
||||||
|
SapService.SapService sapService,
|
||||||
|
SqlSugarRepository<Configurations> configurationsRep,
|
||||||
|
SqlSugarRepository<ConfigurationData> configurationDataRep
|
||||||
|
)
|
||||||
|
{
|
||||||
|
_obj112Rep = obj112Rep;
|
||||||
|
_sysConfigService = sysConfigService;
|
||||||
|
_sapService = sapService;
|
||||||
|
_configurationsRep = configurationsRep;
|
||||||
|
_configurationDataRep = configurationDataRep;
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 分页查询生产物料管理
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="input"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[ApiDescriptionSettings(Name = "page", Description = "分页查询生产物料管理", Order = 1000), HttpPost]
|
||||||
|
[DisplayName("分页查询生产物料管理")]
|
||||||
|
public async Task<SqlSugarPagedList<ProductionMaterialsManagementOutput>> Page(PageProductionMaterialsManagementInput input)
|
||||||
|
{
|
||||||
|
var query = await _obj112Rep.AsQueryable()
|
||||||
|
.Where(x => x.CheckedStatus == 7 && x.deleted == false && x.IsLatestVersion == true)
|
||||||
|
.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])
|
||||||
|
.Select<ProductionMaterialsManagementOutput>()
|
||||||
|
.ToPagedListAsync(input.Page, input.PageSize);
|
||||||
|
return query;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 生产物料管理-同步到 SAP
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
[ApiDescriptionSettings(Name = "syncToSAP"), HttpPost]
|
||||||
|
[DisplayName("生产物料管理-同步到 SAP")]
|
||||||
|
public async Task<SapOutput> SyncToSAP(ProductionMaterialsManagementInput input)
|
||||||
|
{
|
||||||
|
const string lengthError = "项目描述长度大于40,请检查!";
|
||||||
|
|
||||||
|
// 验证物料描述长度
|
||||||
|
if (input.fld004598.Length > 40)
|
||||||
|
{
|
||||||
|
await _obj112Rep.AsUpdateable()
|
||||||
|
.SetColumns(it => new Obj112
|
||||||
|
{
|
||||||
|
fld004606 = DateTime.Now,
|
||||||
|
fld004607 = "N",
|
||||||
|
fld004605 = lengthError,
|
||||||
|
fld004604 = "失败"
|
||||||
|
})
|
||||||
|
.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<string>(ConfigConst.SapUserName),
|
||||||
|
Note1 = "",
|
||||||
|
Note2 = "",
|
||||||
|
Note3 = "",
|
||||||
|
Zwbid = millisecondTimestamp,
|
||||||
|
Matnr = input._System_objNBS,
|
||||||
|
Mbrsh = input.fld004595,
|
||||||
|
Mtart = input.fld004596,
|
||||||
|
Maktx = input.fld004598,
|
||||||
|
Meins = input.fld004594,
|
||||||
|
Matkl = input.fld004599,
|
||||||
|
Bismt = input.fld004902,
|
||||||
|
Groes = input.fld004901,
|
||||||
|
Normt = input.fld004592,
|
||||||
|
Ferth = input.fld004593,
|
||||||
|
Zeinr = input.fld004903,
|
||||||
|
Mstae = input.fld004696,
|
||||||
|
Raube = input.fld004904,
|
||||||
|
Mhdrz = input.fld004905.ToString(),
|
||||||
|
Mhdhb = input.fld004907.ToString(),
|
||||||
|
Werks = input.fld004597,
|
||||||
|
Beskz = input.fld004600,
|
||||||
|
Sobsl = input.fld004601,
|
||||||
|
Schgt = input.fld004602,
|
||||||
|
Rgekz = input.fld004603,
|
||||||
|
Zbom = input.fld004695
|
||||||
|
};
|
||||||
|
|
||||||
|
var apiOutput = await _sapService.SapMaterialApi(sapMaterialInput);
|
||||||
|
string codeVal = apiOutput.code == "S" ? "成功" : "失败";
|
||||||
|
var msg = apiOutput.msg;
|
||||||
|
if (apiOutput.msg == "")
|
||||||
|
{
|
||||||
|
msg = "同步成功";
|
||||||
|
}
|
||||||
|
|
||||||
|
await _obj112Rep.AsUpdateable()
|
||||||
|
.SetColumns(it => new Obj112
|
||||||
|
{
|
||||||
|
fld004606 = DateTime.Now,
|
||||||
|
fld004604 = codeVal,
|
||||||
|
fld004607 = "N",
|
||||||
|
fld004605 = msg
|
||||||
|
})
|
||||||
|
.Where(it => it.idRecord == input.idRecord)
|
||||||
|
.ExecuteCommandAsync();
|
||||||
|
var output = new SapOutput()
|
||||||
|
{
|
||||||
|
parameter = apiOutput.parameter,
|
||||||
|
code = codeVal,
|
||||||
|
msg = msg,
|
||||||
|
result = apiOutput.result
|
||||||
|
};
|
||||||
|
return output;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 生产物料管理-批量同步到SAP
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="input"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[ApiDescriptionSettings(Name = "BatchSyncToSAP"), HttpPost]
|
||||||
|
[DisplayName("生产物料管理-批量同步到SAP")]
|
||||||
|
public async Task<List<SapOutput>> BatchSyncToSAP(List<ProductionMaterialsManagementInput> input)
|
||||||
|
{
|
||||||
|
const string lengthError = "物料描述长度大于40,请检查!";
|
||||||
|
const string synchronized = "该项目编号已同步!";
|
||||||
|
var SapOutputList = new List<SapOutput>();
|
||||||
|
var Requser = await _sysConfigService.GetConfigValueByCode<string>(ConfigConst.SapUserName);
|
||||||
|
for (int i = 0; i < input.Count; i++)
|
||||||
|
{
|
||||||
|
// 验证物料描述长度
|
||||||
|
if (input[i].fld004598.Length > 40)
|
||||||
|
{
|
||||||
|
await _obj112Rep.AsUpdateable()
|
||||||
|
.SetColumns(it => new Obj112
|
||||||
|
{
|
||||||
|
fld004606 = DateTime.Now,
|
||||||
|
fld004607 = "N",
|
||||||
|
fld004605 = lengthError,
|
||||||
|
fld004604 = "失败"
|
||||||
|
})
|
||||||
|
.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].fld004607 != "A"|| input[i].fld004607 != "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<string>(ConfigConst.SapUserName),
|
||||||
|
Note1 = "",
|
||||||
|
Note2 = "",
|
||||||
|
Note3 = "",
|
||||||
|
Zwbid = millisecondTimestamp,
|
||||||
|
Matnr = input[i]._System_objNBS,
|
||||||
|
Mbrsh = input[i].fld004595,
|
||||||
|
Mtart = input[i].fld004596,
|
||||||
|
Maktx = input[i].fld004598,
|
||||||
|
Meins = input[i].fld004594,
|
||||||
|
Matkl = input[i].fld004599,
|
||||||
|
Bismt = input[i].fld004902,
|
||||||
|
Groes = input[i].fld004901,
|
||||||
|
Normt = input[i].fld004592,
|
||||||
|
Ferth = input[i].fld004593,
|
||||||
|
Zeinr = input[i].fld004903,
|
||||||
|
Mstae = input[i].fld004696,
|
||||||
|
Raube = input[i].fld004904,
|
||||||
|
Mhdrz = input[i].fld004905.ToString(),
|
||||||
|
Mhdhb = input[i].fld004907.ToString(),
|
||||||
|
Werks = input[i].fld004597,
|
||||||
|
Beskz = input[i].fld004600,
|
||||||
|
Sobsl = input[i].fld004601,
|
||||||
|
Schgt = input[i].fld004602,
|
||||||
|
Rgekz = input[i].fld004603,
|
||||||
|
Zbom = input[i].fld004695
|
||||||
|
};
|
||||||
|
var sapOutput = await _sapService.SapMaterialApi(sapMaterialInput);
|
||||||
|
string codeVal = sapOutput.code == "S" ? "成功" : "失败";
|
||||||
|
string msg = sapOutput.msg;
|
||||||
|
|
||||||
|
if (sapOutput.msg == "")
|
||||||
|
{
|
||||||
|
msg = "同步成功";
|
||||||
|
}
|
||||||
|
await _obj112Rep.AsUpdateable()
|
||||||
|
.SetColumns(it => new Obj112
|
||||||
|
{
|
||||||
|
fld004606 = DateTime.Now,
|
||||||
|
fld004604 = codeVal,
|
||||||
|
fld004607 = "N",
|
||||||
|
fld004605 = 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;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 生产物料管理-定时同步到SAP
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
[ApiDescriptionSettings(Name = "TimingSyncToSAP"), HttpGet]
|
||||||
|
[DisplayName("生产物料管理-定时同步到SAP")]
|
||||||
|
[AllowAnonymous]
|
||||||
|
public async Task<List<SapOutput>> TimingSyncToSAP()
|
||||||
|
{
|
||||||
|
var input = await _obj112Rep.AsQueryable()
|
||||||
|
.Where(x => x.CheckedStatus == 7 && x.deleted == false && x.IsLatestVersion == true&&(x.fld004607=="A"||x.fld004607 == "M"))
|
||||||
|
.ToListAsync();
|
||||||
|
const string lengthError = "物料描述长度大于40,请检查!";
|
||||||
|
var SapOutputList = new List<SapOutput>();
|
||||||
|
var Requser = await _sysConfigService.GetConfigValueByCode<string>(ConfigConst.SapUserName);
|
||||||
|
for (int i = 0; i < input.Count; i++)
|
||||||
|
{
|
||||||
|
// 验证物料描述长度
|
||||||
|
if (input[i].fld004598.Length > 40)
|
||||||
|
{
|
||||||
|
await _obj112Rep.AsUpdateable()
|
||||||
|
.SetColumns(it => new Obj112
|
||||||
|
{
|
||||||
|
fld004606 = DateTime.Now,
|
||||||
|
fld004607 = "N",
|
||||||
|
fld004605 = lengthError,
|
||||||
|
fld004604 = "失败"
|
||||||
|
})
|
||||||
|
.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<string>(ConfigConst.SapUserName),
|
||||||
|
Note1 = "",
|
||||||
|
Note2 = "",
|
||||||
|
Note3 = "",
|
||||||
|
Zwbid = millisecondTimestamp,
|
||||||
|
Matnr = input[i]._System_objNBS,
|
||||||
|
Mbrsh = input[i].fld004595,
|
||||||
|
Mtart = input[i].fld004596,
|
||||||
|
Maktx = input[i].fld004598,
|
||||||
|
Meins = input[i].fld004594,
|
||||||
|
Matkl = input[i].fld004599,
|
||||||
|
Bismt = input[i].fld004902,
|
||||||
|
Groes = input[i].fld004901,
|
||||||
|
Normt = input[i].fld004592,
|
||||||
|
Ferth = input[i].fld004593,
|
||||||
|
Zeinr = input[i].fld004903,
|
||||||
|
Mstae = input[i].fld004696,
|
||||||
|
Raube = input[i].fld004904,
|
||||||
|
Mhdrz = input[i].fld004905.ToString(),
|
||||||
|
Mhdhb = input[i].fld004907.ToString(),
|
||||||
|
Werks = input[i].fld004597,
|
||||||
|
Beskz = input[i].fld004600,
|
||||||
|
Sobsl = input[i].fld004601,
|
||||||
|
Schgt = input[i].fld004602,
|
||||||
|
Rgekz = input[i].fld004603,
|
||||||
|
Zbom = input[i].fld004695
|
||||||
|
};
|
||||||
|
var sapOutput = await _sapService.SapMaterialApi(sapMaterialInput);
|
||||||
|
string codeVal = sapOutput.code == "S" ? "成功" : "失败";
|
||||||
|
string msg = sapOutput.msg;
|
||||||
|
|
||||||
|
if (sapOutput.msg == "")
|
||||||
|
{
|
||||||
|
msg = "同步成功";
|
||||||
|
}
|
||||||
|
await _obj112Rep.AsUpdateable()
|
||||||
|
.SetColumns(it => new Obj112
|
||||||
|
{
|
||||||
|
fld004606 = DateTime.Now,
|
||||||
|
fld004604 = codeVal,
|
||||||
|
fld004607 = "N",
|
||||||
|
fld004605 = 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;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -368,6 +368,7 @@ public class ProjectManagementInput
|
|||||||
public DateTime? fld004949 { get; set; }
|
public DateTime? fld004949 { get; set; }
|
||||||
|
|
||||||
public string? fld005040 { get; set; }
|
public string? fld005040 { get; set; }
|
||||||
|
public string fld005281 { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -394,6 +395,4 @@ public class PageProjectManagementInput : BasePageInput
|
|||||||
/// 创建时间范围
|
/// 创建时间范围
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public DateTime?[] fld004683Range { get; set; }
|
public DateTime?[] fld004683Range { get; set; }
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -370,4 +370,5 @@ public class ProjectManagementOutput
|
|||||||
public DateTime? fld004949 { get; set; }
|
public DateTime? fld004949 { get; set; }
|
||||||
|
|
||||||
public string? fld005040 { get; set; }
|
public string? fld005040 { get; set; }
|
||||||
|
public string fld005281 { get; set; }
|
||||||
}
|
}
|
||||||
|
@ -120,14 +120,14 @@ public class ProjectManagementService : IDynamicApiController, ITransient
|
|||||||
Mbrsh = input.fld004521,
|
Mbrsh = input.fld004521,
|
||||||
Mtart = input.fld004519,
|
Mtart = input.fld004519,
|
||||||
Maktx = input.fld004502,
|
Maktx = input.fld004502,
|
||||||
Meins = "",//sssssssss基本计量单位
|
Meins = input.fld005281,
|
||||||
Matkl = input.fld004520,
|
Matkl = input.fld004520,
|
||||||
Bismt = input.fld004684,
|
Bismt = input.fld004684,
|
||||||
Groes = input.fld004685,
|
Groes = input.fld004685,
|
||||||
Normt = input.fld004924,
|
Normt = input.fld004924,
|
||||||
Ferth = input.fld004925,
|
Ferth = input.fld004925,
|
||||||
Zeinr = input.fld004926,
|
Zeinr = input.fld004926,
|
||||||
Mstae = "",//sssssssssss跨工厂物料状态
|
Mstae = input.fld004927,
|
||||||
Raube = input.fld004932,
|
Raube = input.fld004932,
|
||||||
Mhdrz = input.fld004933.ToString(),
|
Mhdrz = input.fld004933.ToString(),
|
||||||
Mhdhb = input.fld004934.ToString(),
|
Mhdhb = input.fld004934.ToString(),
|
||||||
@ -205,7 +205,7 @@ public class ProjectManagementService : IDynamicApiController, ITransient
|
|||||||
});
|
});
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (input[i].fld004510 == "N")
|
if (input[i].fld004510 != "A" || input[i].fld004510 != "M")
|
||||||
{
|
{
|
||||||
SapOutputList.Add(new SapOutput()
|
SapOutputList.Add(new SapOutput()
|
||||||
{
|
{
|
||||||
@ -234,14 +234,14 @@ public class ProjectManagementService : IDynamicApiController, ITransient
|
|||||||
Mbrsh = input[i].fld004521,
|
Mbrsh = input[i].fld004521,
|
||||||
Mtart = input[i].fld004519,
|
Mtart = input[i].fld004519,
|
||||||
Maktx = input[i].fld004502,
|
Maktx = input[i].fld004502,
|
||||||
Meins = "",//sssssssss基本计量单位
|
Meins = input[i].fld005281,
|
||||||
Matkl = input[i].fld004520,
|
Matkl = input[i].fld004520,
|
||||||
Bismt = input[i].fld004684,
|
Bismt = input[i].fld004684,
|
||||||
Groes = input[i].fld004685,
|
Groes = input[i].fld004685,
|
||||||
Normt = input[i].fld004924,
|
Normt = input[i].fld004924,
|
||||||
Ferth = input[i].fld004925,
|
Ferth = input[i].fld004925,
|
||||||
Zeinr = input[i].fld004926,
|
Zeinr = input[i].fld004926,
|
||||||
Mstae = "",//sssssssssss跨工厂物料状态
|
Mstae = input[i].fld004927,
|
||||||
Raube = input[i].fld004932,
|
Raube = input[i].fld004932,
|
||||||
Mhdrz = input[i].fld004933.ToString(),
|
Mhdrz = input[i].fld004933.ToString(),
|
||||||
Mhdhb = input[i].fld004934.ToString(),
|
Mhdhb = input[i].fld004934.ToString(),
|
||||||
@ -405,7 +405,7 @@ public class ProjectManagementService : IDynamicApiController, ITransient
|
|||||||
public async Task<List<SapOutput>> TimingSyncToSAP()
|
public async Task<List<SapOutput>> TimingSyncToSAP()
|
||||||
{
|
{
|
||||||
var input = await _obj109Rep.AsQueryable()
|
var input = await _obj109Rep.AsQueryable()
|
||||||
.Where(x => (x.CheckedStatus == 0 || x.CheckedStatus == 1) && x.deleted == false && x.IsLatestVersion == true && x.fld005040 == "发布")
|
.Where(x => (x.CheckedStatus == 0 || x.CheckedStatus == 1) && x.deleted == false && x.IsLatestVersion == true && x.fld005040 == "发布" && (x.fld004510 == "A" || x.fld004510 == "M"))
|
||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
const string lengthError = "物料描述长度大于40,请检查!";
|
const string lengthError = "物料描述长度大于40,请检查!";
|
||||||
var SapOutputList = new List<SapOutput>();
|
var SapOutputList = new List<SapOutput>();
|
||||||
@ -454,14 +454,14 @@ public class ProjectManagementService : IDynamicApiController, ITransient
|
|||||||
Mbrsh = input[i].fld004521,
|
Mbrsh = input[i].fld004521,
|
||||||
Mtart = input[i].fld004519,
|
Mtart = input[i].fld004519,
|
||||||
Maktx = input[i].fld004502,
|
Maktx = input[i].fld004502,
|
||||||
Meins = "",//sssssssss基本计量单位
|
Meins = input[i].fld005281,
|
||||||
Matkl = input[i].fld004520,
|
Matkl = input[i].fld004520,
|
||||||
Bismt = input[i].fld004684,
|
Bismt = input[i].fld004684,
|
||||||
Groes = input[i].fld004685,
|
Groes = input[i].fld004685,
|
||||||
Normt = input[i].fld004924,
|
Normt = input[i].fld004924,
|
||||||
Ferth = input[i].fld004925,
|
Ferth = input[i].fld004925,
|
||||||
Zeinr = input[i].fld004926,
|
Zeinr = input[i].fld004926,
|
||||||
Mstae = "",//sssssssssss跨工厂物料状态
|
Mstae = input[i].fld004927,
|
||||||
Raube = input[i].fld004932,
|
Raube = input[i].fld004932,
|
||||||
Mhdrz = input[i].fld004933.ToString(),
|
Mhdrz = input[i].fld004933.ToString(),
|
||||||
Mhdhb = input[i].fld004934.ToString(),
|
Mhdhb = input[i].fld004934.ToString(),
|
||||||
|
@ -24,6 +24,12 @@
|
|||||||
</Content>
|
</Content>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<Compile Remove="Service\ProductionMaterialsManagement\新文件夹\**" />
|
||||||
|
<EmbeddedResource Remove="Service\ProductionMaterialsManagement\新文件夹\**" />
|
||||||
|
<None Remove="Service\ProductionMaterialsManagement\新文件夹\**" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|
||||||
<ProjectReference Include="..\Admin.NET.Core\Admin.NET.Core.csproj" />
|
<ProjectReference Include="..\Admin.NET.Core\Admin.NET.Core.csproj" />
|
||||||
|
@ -0,0 +1,30 @@
|
|||||||
|
import request from '/@/utils/request';
|
||||||
|
enum Api {
|
||||||
|
PageProductionMaterialsManagement = '/api/productionMaterialsManagement/page',
|
||||||
|
SyncToSAPProductionMaterialsManagement = '/api/productionMaterialsManagement/SyncToSAP',
|
||||||
|
BatchSyncToSAPProductionMaterialsManagement = '/api/productionMaterialsManagement/batchSyncToSAP'
|
||||||
|
}
|
||||||
|
|
||||||
|
// 分页查询产品管理
|
||||||
|
export const PageProductionMaterialsManagement = (params?: any) =>
|
||||||
|
request({
|
||||||
|
url: Api.PageProductionMaterialsManagement,
|
||||||
|
method: 'post',
|
||||||
|
data: params,
|
||||||
|
});
|
||||||
|
|
||||||
|
// 同步到SAP
|
||||||
|
export const SyncToSAPProductionMaterialsManagement = (params?: any) =>
|
||||||
|
request({
|
||||||
|
url: Api.SyncToSAPProductionMaterialsManagement,
|
||||||
|
method: 'post',
|
||||||
|
data: params,
|
||||||
|
});
|
||||||
|
|
||||||
|
// 批量同步到SAP
|
||||||
|
export const BatchSyncToSAPProductionMaterialsManagement = (params?: any) =>
|
||||||
|
request({
|
||||||
|
url: Api.BatchSyncToSAPProductionMaterialsManagement,
|
||||||
|
method: 'post',
|
||||||
|
data: params,
|
||||||
|
});
|
@ -0,0 +1,226 @@
|
|||||||
|
<template>
|
||||||
|
<div class="productionMaterialsManagement-container">
|
||||||
|
<el-card shadow="hover"
|
||||||
|
:body-style="{ padding: '20px 20px 16px 10px', display: 'flex', width: '100%', height: '100%', alignItems: 'start' }">
|
||||||
|
<el-form :model="state.queryParams" ref="queryForm" :show-message="false" :inlineMessage="true"
|
||||||
|
label-width="auto" style="flex: 1 1 0%" @submit.prevent="handleQuery">
|
||||||
|
<el-row :gutter="10">
|
||||||
|
<el-col :xs="24" :sm="12" :md="8" :lg="5" :xl="6" class="mb5">
|
||||||
|
<el-form-item label="物料编号" prop="_System_objNBS">
|
||||||
|
<el-input v-model="state.queryParams._System_objNBS" placeholder="物料编码" clearable
|
||||||
|
@keyup.enter.native="handleQuery" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :xs="24" :sm="12" :md="8" :lg="5" :xl="6" class="mb5">
|
||||||
|
<el-form-item label="物料描述" prop="fld004598">
|
||||||
|
<el-input v-model="state.queryParams.fld004598" placeholder="物料描述" clearable
|
||||||
|
@keyup.enter.native="handleQuery" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :xs="24" :sm="12" :md="8" :lg="5" :xl="6" class="mb5">
|
||||||
|
<el-form-item label="创建时间" prop="fld004609">
|
||||||
|
<el-date-picker type="daterange" v-model="state.queryParams.fld004609Range"
|
||||||
|
value-format="YYYY-MM-DD HH:mm:ss" start-placeholder="开始日期" end-placeholder="结束日期"
|
||||||
|
:default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]" unlink-panels />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :xs="24" :sm="12" :md="8" :lg="6" :xl="6" class="mb5">
|
||||||
|
<el-button type="primary" icon="ele-Search" @click="handleQuery"
|
||||||
|
v-auth="'productionMaterialsManagement/page'" :loading="options.loading"> 查询 </el-button>
|
||||||
|
<el-button icon="ele-Refresh" @click="resetQuery" :loading="options.loading"> 重置 </el-button>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
</el-card>
|
||||||
|
|
||||||
|
<el-card class="full-table" shadow="hover" style="margin-top: 5px">
|
||||||
|
<vxe-grid ref="xGrid" class="xGrid-style" v-bind="options" v-on="gridEvents">
|
||||||
|
|
||||||
|
<template #toolbar_tools>
|
||||||
|
<el-button style="position: absolute; left: 0" icon="ele-Promotion" size="small" text=""
|
||||||
|
type="success" @click="batchSyncToSAP" v-auth="'projectManagement/batchSyncToSAP'"> 批量同步到SAP
|
||||||
|
</el-button>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<template #row_buttons="{ row }">
|
||||||
|
<el-tooltip content="同步到ERP" placement="top">
|
||||||
|
<el-button icon="ele-Promotion" size="small" text="" type="success" @click="syncToSAP(row)"
|
||||||
|
v-auth="'productionMaterialsManagement/syncToSAP'" v-if="row.fld004607=='A'||row.fld004607=='M'"> 同步到SAP </el-button>
|
||||||
|
</el-tooltip>
|
||||||
|
</template>
|
||||||
|
</vxe-grid>
|
||||||
|
|
||||||
|
</el-card>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup name="productionMaterialsManagement">
|
||||||
|
import { onMounted, reactive, ref } from 'vue';
|
||||||
|
import { ElMessageBox, ElMessage } from "element-plus";
|
||||||
|
import { auth } from '/@/utils/authFunction';
|
||||||
|
|
||||||
|
import { VxeGridInstance, VxeGridListeners, VxeGridPropTypes } from 'vxe-table';
|
||||||
|
import { useVxeTable } from '/@/hooks/useVxeTableOptionsHook';
|
||||||
|
import { Local } from '/@/utils/storage';
|
||||||
|
|
||||||
|
import { formatDate } from '/@/utils/formatTime';
|
||||||
|
import { PageProductionMaterialsManagement, SyncToSAPProductionMaterialsManagement, BatchSyncToSAPProductionMaterialsManagement } from '/@/api/materialManagement/productionMaterialsManagement';
|
||||||
|
import { disable } from 'ol/rotationconstraint';
|
||||||
|
|
||||||
|
// 变量
|
||||||
|
const state = reactive({
|
||||||
|
showAdvanceQueryUI: false,
|
||||||
|
queryParams: {
|
||||||
|
searchKey: undefined,
|
||||||
|
_System_objNBS: undefined,
|
||||||
|
fld004598: undefined,
|
||||||
|
fld004609: undefined,
|
||||||
|
fld004609Range: undefined,
|
||||||
|
},
|
||||||
|
localPageParam: {
|
||||||
|
pageSize: 50 as number,
|
||||||
|
defaultSort: { field: 'createTime', order: 'asc', descStr: 'desc' },
|
||||||
|
},
|
||||||
|
visible: false,
|
||||||
|
title: '',
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
const xGrid = ref<VxeGridInstance>();
|
||||||
|
|
||||||
|
// 重置操作
|
||||||
|
const resetQuery = async () => {
|
||||||
|
state.queryParams.searchKey = undefined,
|
||||||
|
state.queryParams._System_objNBS = undefined,
|
||||||
|
state.queryParams.fld004598 = undefined,
|
||||||
|
state.queryParams.fld004609 = undefined,
|
||||||
|
await xGrid.value?.commitProxy('reload');
|
||||||
|
};
|
||||||
|
|
||||||
|
// 查询api
|
||||||
|
const handleQueryApi = async (page: VxeGridPropTypes.ProxyAjaxQueryPageParams, sort: VxeGridPropTypes.ProxyAjaxQuerySortCheckedParams) => {
|
||||||
|
const params = Object.assign(state.queryParams, { page: page.currentPage, pageSize: page.pageSize, field: sort.field, order: sort.order, descStr: 'desc' });
|
||||||
|
var data = PageProductionMaterialsManagement(params)
|
||||||
|
return data;
|
||||||
|
};
|
||||||
|
|
||||||
|
// 查询操作
|
||||||
|
const handleQuery = async (reset = false) => {
|
||||||
|
options.loading = true;
|
||||||
|
await xGrid.value?.commitProxy('query');
|
||||||
|
options.loading = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
// 本地存储参数
|
||||||
|
const localPageParamKey = 'localPageParam:projectManagement';
|
||||||
|
|
||||||
|
// 表格事件
|
||||||
|
const gridEvents: VxeGridListeners = {
|
||||||
|
// 只对 pager-config 配置时有效,分页发生改变时会触发该事件
|
||||||
|
async pageChange({ pageSize }) {
|
||||||
|
state.localPageParam.pageSize = pageSize;
|
||||||
|
Local.set(localPageParamKey, state.localPageParam);
|
||||||
|
},
|
||||||
|
// 当排序条件发生变化时会触发该事件
|
||||||
|
async sortChange({ field, order }) {
|
||||||
|
state.localPageParam.defaultSort = { field: field, order: order!, descStr: 'desc' };
|
||||||
|
Local.set(localPageParamKey, state.localPageParam);
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
// 表格参数配置
|
||||||
|
const options = useVxeTable(
|
||||||
|
{
|
||||||
|
id: 'productionMaterialsManagement',
|
||||||
|
name: '产品管理',
|
||||||
|
columns: [
|
||||||
|
{ type: 'checkbox', title: '', width: 60},
|
||||||
|
{ type: 'seq', title: '序号', width: 60 },
|
||||||
|
{ field: '_System_objNBS', title: '项目编号', minWidth: 100, showOverflow: 'tooltip', sortable: false },
|
||||||
|
{ field: '_System_ObjDescription', title: '项目名称', minWidth: 100, showOverflow: 'tooltip', sortable: false },
|
||||||
|
{ field: 'fld004609', title: '创建时间', minWidth: 100, showOverflow: 'tooltip', sortable: false },
|
||||||
|
{ field: 'fld004604', title: '物料同步状态', minWidth: 100, showOverflow: 'tooltip', sortable: false },
|
||||||
|
{ field: 'fld004606', title: '物料同步时间', minWidth: 100, showOverflow: 'tooltip', sortable: false },
|
||||||
|
{ field: 'fld004607', title: '物料同步标识', minWidth: 100, showOverflow: 'tooltip', sortable: false },
|
||||||
|
{ field: 'fld004605', title: '物料同步信息', minWidth: 100, showOverflow: 'tooltip', sortable: false },
|
||||||
|
|
||||||
|
{ title: '操作', fixed: 'right', width: 300, showOverflow: true, slots: { default: 'row_buttons' } },
|
||||||
|
],
|
||||||
|
},
|
||||||
|
// vxeGrid配置参数(此处可覆写任何参数),参考vxe-table官方文档
|
||||||
|
{
|
||||||
|
// 代理配置
|
||||||
|
proxyConfig: { autoLoad: true, ajax: { query: ({ page, sort }) => handleQueryApi(page, sort) } },
|
||||||
|
// 排序配置
|
||||||
|
sortConfig: { defaultSort: Local.get(localPageParamKey)?.defaultSort || state.localPageParam.defaultSort },
|
||||||
|
// 分页配置
|
||||||
|
pagerConfig: { pageSize: Local.get(localPageParamKey)?.pageSize || state.localPageParam.pageSize },
|
||||||
|
// 工具栏配置
|
||||||
|
toolbarConfig: { export: false },
|
||||||
|
// 行设置
|
||||||
|
// rowConfig: { height: 80 },
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
// 页面初始化
|
||||||
|
onMounted(() => {
|
||||||
|
});
|
||||||
|
|
||||||
|
// 同步到SAP
|
||||||
|
const syncToSAP = async (row: any) => {
|
||||||
|
options.loading = true;
|
||||||
|
ElMessageBox.confirm(`确定要同步物料吗?`, '提示', {
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning',
|
||||||
|
})
|
||||||
|
.then(async () => {
|
||||||
|
var data = await SyncToSAPProductionMaterialsManagement(row);
|
||||||
|
await handleQuery();
|
||||||
|
if (data.data.result.code == "成功") {
|
||||||
|
ElMessage.success("同步成功");
|
||||||
|
} else {
|
||||||
|
ElMessage.error("同步失败");
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(() => { });
|
||||||
|
options.loading = false;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
//物料批量同步到SAP
|
||||||
|
const batchSyncToSAP = async () => {
|
||||||
|
options.loading = true;
|
||||||
|
var data = xGrid.value?.getCheckboxRecords();
|
||||||
|
|
||||||
|
ElMessageBox.confirm(`确定要批量同步物料吗?`, '提示', {
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning',
|
||||||
|
})
|
||||||
|
.then(async () => {
|
||||||
|
var output = await BatchSyncToSAPProductionMaterialsManagement(data);
|
||||||
|
await handleQuery();
|
||||||
|
var succeed = 0;
|
||||||
|
var error = 0;
|
||||||
|
for (let i = 0; i < output.data.result.length; i++) {
|
||||||
|
var code = output.data.result[i].code
|
||||||
|
if (code == "成功") {
|
||||||
|
succeed++
|
||||||
|
} else {
|
||||||
|
error++
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ElMessageBox.alert("同步成功:" + succeed + ";" + "同步失败:" + error, '批量同步结果', {
|
||||||
|
// 如果你想禁用它的自动对焦
|
||||||
|
// autofocus: false,
|
||||||
|
confirmButtonText: 'OK'
|
||||||
|
})
|
||||||
|
})
|
||||||
|
.catch(() => { });
|
||||||
|
options.loading = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
</script>
|
Loading…
Reference in New Issue
Block a user