😎新增wbs创建、wbs修改接口
This commit is contained in:
parent
55904956e7
commit
632bb7ba48
@ -0,0 +1,301 @@
|
|||||||
|
// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
|
||||||
|
//
|
||||||
|
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
|
||||||
|
//
|
||||||
|
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
|
||||||
|
|
||||||
|
using Admin.NET.Core;
|
||||||
|
using SqlSugar;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
namespace Vistar.Application.Entity;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[SugarTable("CasesStagesMain","")]
|
||||||
|
[Tenant("启威星 1.94.4.74")]
|
||||||
|
public class CasesStagesMain
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[Required]
|
||||||
|
[SugarColumn(ColumnName = "StageId", IsIdentity = true, ColumnDescription = "", IsPrimaryKey = true)]
|
||||||
|
public long StageId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[Required]
|
||||||
|
[SugarColumn(ColumnName = "CaseId", ColumnDescription = "")]
|
||||||
|
public int CaseId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "UsersInvolved", ColumnDescription = "", Length = -1)]
|
||||||
|
public string? UsersInvolved { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[Required]
|
||||||
|
[SugarColumn(ColumnName = "Description", ColumnDescription = "", Length = 250)]
|
||||||
|
public string Description { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "ResponsibleUser", ColumnDescription = "")]
|
||||||
|
public long? ResponsibleUser { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "lastUserModified", ColumnDescription = "")]
|
||||||
|
public int? lastUserModified { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[Required]
|
||||||
|
[SugarColumn(ColumnName = "OrderIndex", ColumnDescription = "")]
|
||||||
|
public long OrderIndex { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "Duration", ColumnDescription = "")]
|
||||||
|
public Single? Duration { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "Start", ColumnDescription = "")]
|
||||||
|
public DateTime? Start { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "Finish", ColumnDescription = "")]
|
||||||
|
public DateTime? Finish { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "DueDate", ColumnDescription = "")]
|
||||||
|
public DateTime? DueDate { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[Required]
|
||||||
|
[SugarColumn(ColumnName = "Progress", ColumnDescription = "")]
|
||||||
|
public int Progress { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "Predecessor", ColumnDescription = "", Length = 50)]
|
||||||
|
public string? Predecessor { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[Required]
|
||||||
|
[SugarColumn(ColumnName = "isFinished", ColumnDescription = "")]
|
||||||
|
public bool isFinished { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "BackStatus", ColumnDescription = "", Length = 255)]
|
||||||
|
public string? BackStatus { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "ForewordStatus", ColumnDescription = "", Length = 255)]
|
||||||
|
public string? ForewordStatus { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "BackStageId", ColumnDescription = "")]
|
||||||
|
public long? BackStageId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "AllowToChooseUser", ColumnDescription = "")]
|
||||||
|
public bool? AllowToChooseUser { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "ActualStatus", ColumnDescription = "", Length = 255)]
|
||||||
|
public string? ActualStatus { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "Delay", ColumnDescription = "")]
|
||||||
|
public int? Delay { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "RecordGuid", ColumnDescription = "", Length = 40)]
|
||||||
|
public string? RecordGuid { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "WhoCanMoveForeword", ColumnDescription = "")]
|
||||||
|
public long? WhoCanMoveForeword { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "ParentStageId", ColumnDescription = "")]
|
||||||
|
public long? ParentStageId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "StageType", ColumnDescription = "", Length = 50)]
|
||||||
|
public string? StageType { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "OriginalStage", ColumnDescription = "")]
|
||||||
|
public long? OriginalStage { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "ProgressType", ColumnDescription = "")]
|
||||||
|
public int? ProgressType { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "EnableNotifications", ColumnDescription = "")]
|
||||||
|
public bool? EnableNotifications { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "LongDescription", ColumnDescription = "", Length = -1)]
|
||||||
|
public string? LongDescription { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "indentLevel", ColumnDescription = "")]
|
||||||
|
public int? indentLevel { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "IconIndex", ColumnDescription = "")]
|
||||||
|
public int? IconIndex { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "work", ColumnDescription = "")]
|
||||||
|
public Single? work { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "CompletedWork", ColumnDescription = "")]
|
||||||
|
public Single? CompletedWork { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "Interruptions", ColumnDescription = "", Length = -1)]
|
||||||
|
public string? Interruptions { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "dueWork", ColumnDescription = "")]
|
||||||
|
public Single? dueWork { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "Markers", ColumnDescription = "", Length = -1)]
|
||||||
|
public string? Markers { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "DueCompletedWork", ColumnDescription = "")]
|
||||||
|
public Single? DueCompletedWork { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "ChildGroupObjId", ColumnDescription = "")]
|
||||||
|
public long? ChildGroupObjId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "ChildObjId", ColumnDescription = "")]
|
||||||
|
public long? ChildObjId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "ChildRecordGuid", ColumnDescription = "", Length = 40)]
|
||||||
|
public string? ChildRecordGuid { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "GroupObjId", ColumnDescription = "")]
|
||||||
|
public long? GroupObjId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "splits", ColumnDescription = "", Length = 1000)]
|
||||||
|
public string? splits { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "IsAutoSchedule", ColumnDescription = "")]
|
||||||
|
public bool? IsAutoSchedule { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "PreferredStartDate", ColumnDescription = "")]
|
||||||
|
public object? PreferredStartDate { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "HasAConstraint", ColumnDescription = "")]
|
||||||
|
public bool? HasAConstraint { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "AnyUserCanAddTimeSheets", ColumnDescription = "")]
|
||||||
|
public bool? AnyUserCanAddTimeSheets { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "ExactWork", ColumnDescription = "")]
|
||||||
|
public double? ExactWork { get; set; }
|
||||||
|
|
||||||
|
}
|
@ -817,4 +817,9 @@ public class Obj109
|
|||||||
public string fld005300 { get; set; }
|
public string fld005300 { get; set; }
|
||||||
public string fld005753 { get; set; }
|
public string fld005753 { get; set; }
|
||||||
|
|
||||||
|
public string fld006774 { get; set; }
|
||||||
|
public DateTime fld006775 { get; set; }
|
||||||
|
public string fld006776 { get; set; }
|
||||||
|
public string fld006993 { get; set; }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
299
admin.net.pro/Admin.NET/Vistar.Application/Entity/Obj126.cs
Normal file
299
admin.net.pro/Admin.NET/Vistar.Application/Entity/Obj126.cs
Normal file
@ -0,0 +1,299 @@
|
|||||||
|
// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
|
||||||
|
//
|
||||||
|
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
|
||||||
|
//
|
||||||
|
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
|
||||||
|
|
||||||
|
using Admin.NET.Core;
|
||||||
|
using SqlSugar;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
namespace Vistar.Application.Entity;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[SugarTable("OBJ126","")]
|
||||||
|
[Tenant("启威星 1.94.4.74")]
|
||||||
|
public class Obj126
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[Required]
|
||||||
|
[SugarColumn(ColumnName = "idRecord", IsIdentity = true, ColumnDescription = "", IsPrimaryKey = true)]
|
||||||
|
public long idRecord { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "CheckedStatus", ColumnDescription = "")]
|
||||||
|
public bool? CheckedStatus { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "VersionIndex", ColumnDescription = "")]
|
||||||
|
public int? VersionIndex { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "IsLatestVersion", ColumnDescription = "")]
|
||||||
|
public bool? IsLatestVersion { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "CreatedDate", ColumnDescription = "")]
|
||||||
|
public DateTime? CreatedDate { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "VersionCreatedDate", ColumnDescription = "")]
|
||||||
|
public DateTime? VersionCreatedDate { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "StageId", ColumnDescription = "")]
|
||||||
|
public long? StageId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "dateModified", ColumnDescription = "")]
|
||||||
|
public DateTime? dateModified { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "UserCreatedId", ColumnDescription = "")]
|
||||||
|
public long? UserCreatedId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "VersionUserCreatedId", ColumnDescription = "")]
|
||||||
|
public long? VersionUserCreatedId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "UserModifiedId", ColumnDescription = "")]
|
||||||
|
public long? UserModifiedId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "RecordGuid", ColumnDescription = "", Length = 40)]
|
||||||
|
public string? RecordGuid { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "isVisibilityNormal", ColumnDescription = "")]
|
||||||
|
public bool? isVisibilityNormal { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "deleted", ColumnDescription = "")]
|
||||||
|
public bool? deleted { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "SubObjectGuid", ColumnDescription = "", Length = 40)]
|
||||||
|
public string? SubObjectGuid { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "PreviousStatus", ColumnDescription = "")]
|
||||||
|
public bool? PreviousStatus { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "revision", ColumnDescription = "", Length = 10)]
|
||||||
|
public string? revision { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "Record_image160_160", ColumnDescription = "")]
|
||||||
|
public byte[]? Record_image160_160 { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "Record_Image320_240", ColumnDescription = "")]
|
||||||
|
public byte[]? Record_Image320_240 { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "Record_ImageMax", ColumnDescription = "")]
|
||||||
|
public byte[]? Record_ImageMax { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "_System_objNBS", ColumnDescription = "", Length = 100)]
|
||||||
|
public string? _System_objNBS { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "_System_ObjDescription", ColumnDescription = "", Length = 200)]
|
||||||
|
public string? _System_ObjDescription { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "_System_Effectivity_Begin", ColumnDescription = "")]
|
||||||
|
public DateTime? _System_Effectivity_Begin { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "_System_Effectivity_End", ColumnDescription = "")]
|
||||||
|
public DateTime? _System_Effectivity_End { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "ParentRecordId", ColumnDescription = "")]
|
||||||
|
public long? ParentRecordId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "CheckedOutPc", ColumnDescription = "", Length = 255)]
|
||||||
|
public string? CheckedOutPc { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "EnableNotifications", ColumnDescription = "")]
|
||||||
|
public bool? EnableNotifications { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "GroupObjId", ColumnDescription = "")]
|
||||||
|
public long? GroupObjId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "ParentStageId", ColumnDescription = "")]
|
||||||
|
public long? ParentStageId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "_CheckOutInProgress", ColumnDescription = "")]
|
||||||
|
public bool? _CheckOutInProgress { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "Progress", ColumnDescription = "")]
|
||||||
|
public double? Progress { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "StartDate", ColumnDescription = "")]
|
||||||
|
public DateTime? StartDate { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "EndDate", ColumnDescription = "")]
|
||||||
|
public DateTime? EndDate { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "DueDate", ColumnDescription = "")]
|
||||||
|
public DateTime? DueDate { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "ProjectIdRecord", ColumnDescription = "")]
|
||||||
|
public long? ProjectIdRecord { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[Required]
|
||||||
|
[SugarColumn(ColumnName = "_System_ObjNbsAuto", ColumnDescription = "", Length = 50)]
|
||||||
|
public string _System_ObjNbsAuto { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "_System_WebLink", ColumnDescription = "", Length = 500)]
|
||||||
|
public string? _System_WebLink { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "isReleasedVersion", ColumnDescription = "")]
|
||||||
|
public bool? isReleasedVersion { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "fld006743", ColumnDescription = "", Length = -1)]
|
||||||
|
public string? fld006743 { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "fld006745", ColumnDescription = "", Length = -1)]
|
||||||
|
public string? fld006745 { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "fld006746", ColumnDescription = "")]
|
||||||
|
public DateTime? fld006746 { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "fld006747", ColumnDescription = "", Length = -1)]
|
||||||
|
public string? fld006747 { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "fld006770", ColumnDescription = "", Length = -1)]
|
||||||
|
public string? fld006770 { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "fld006771", ColumnDescription = "", Length = -1)]
|
||||||
|
public string? fld006771 { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "fld006772", ColumnDescription = "")]
|
||||||
|
public DateTime? fld006772 { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "fld006773", ColumnDescription = "", Length = -1)]
|
||||||
|
public string? fld006773 { get; set; }
|
||||||
|
public DateTime? fld006934 { get; set; }
|
||||||
|
public string? fld006990 { get; set; }
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,36 @@
|
|||||||
|
// 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.ProjectManagement.Dto;
|
||||||
|
public class WbsInput
|
||||||
|
{
|
||||||
|
public long projectIdRecord { get; set; }
|
||||||
|
public long stageIdRecord { get; set; }
|
||||||
|
public int? CheckedStatus { get; set; }
|
||||||
|
public string RecordGuid { get; set; }
|
||||||
|
public int? indentLevel { get; set; }
|
||||||
|
public long OrderIndex { get; set; }
|
||||||
|
public string Description { get; set; }
|
||||||
|
public string ChildRecordGuid { get; set; }
|
||||||
|
public string fld006745 { get; set; }
|
||||||
|
public string _System_objNBS { get; set; }
|
||||||
|
public DateTime? StartDate { get; set; }
|
||||||
|
public DateTime? EndDate { get; set; }
|
||||||
|
public DateTime? fld006934 { get; set; }
|
||||||
|
public DateTime? fld006746 { get; set; }
|
||||||
|
public string fld006770 { get; set; }
|
||||||
|
public string fld004502 { get; set; }
|
||||||
|
public string System_objNBS109 { get; set; }
|
||||||
|
public string fld004506 { get; set; }
|
||||||
|
public string fld006747 { get; set; }
|
||||||
|
public string fld006771 { get; set; }
|
||||||
|
}
|
@ -1,9 +1,15 @@
|
|||||||
using Admin.NET.Core;
|
using Admin.NET.Core;
|
||||||
using Admin.NET.Core.Service;
|
using Admin.NET.Core.Service;
|
||||||
|
using COSXML.Network;
|
||||||
|
using Elastic.Clients.Elasticsearch;
|
||||||
using Furion.DependencyInjection;
|
using Furion.DependencyInjection;
|
||||||
using Furion.DynamicApiController;
|
using Furion.DynamicApiController;
|
||||||
using Microsoft.AspNetCore.Authorization;
|
using Microsoft.AspNetCore.Authorization;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
|
using OfficeOpenXml.FormulaParsing.Excel.Functions.Math;
|
||||||
|
using RazorEngine;
|
||||||
|
using SqlSugar;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
@ -34,6 +40,9 @@ public class ProjectManagementService : IDynamicApiController, ITransient
|
|||||||
public Common.DataValidationService _dataValidationService;
|
public Common.DataValidationService _dataValidationService;
|
||||||
public SqlSugarRepository<Obj122> _obj122Rep;
|
public SqlSugarRepository<Obj122> _obj122Rep;
|
||||||
public SqlSugarRepository<Obj121> _obj121Rep;
|
public SqlSugarRepository<Obj121> _obj121Rep;
|
||||||
|
public SqlSugarRepository<Obj126> _obj126Rep;
|
||||||
|
public SqlSugarRepository<CasesStagesMain> _casesStagesMainRep;
|
||||||
|
private readonly IServiceScopeFactory _scopeFactory;
|
||||||
|
|
||||||
public ProjectManagementService(
|
public ProjectManagementService(
|
||||||
SqlSugarRepository<Obj109> obj109Rep,
|
SqlSugarRepository<Obj109> obj109Rep,
|
||||||
@ -44,7 +53,10 @@ public class ProjectManagementService : IDynamicApiController, ITransient
|
|||||||
SqlSugarRepository<Obj118> obj118Rep,
|
SqlSugarRepository<Obj118> obj118Rep,
|
||||||
DataValidationService dataValidationService,
|
DataValidationService dataValidationService,
|
||||||
SqlSugarRepository<Obj122> obj122Rep,
|
SqlSugarRepository<Obj122> obj122Rep,
|
||||||
SqlSugarRepository<Obj121> obj121Rep
|
SqlSugarRepository<Obj121> obj121Rep,
|
||||||
|
SqlSugarRepository<Obj126> obj126Rep,
|
||||||
|
SqlSugarRepository<CasesStagesMain> casesStagesMainRep,
|
||||||
|
IServiceScopeFactory scopeFactory
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
_obj109Rep = obj109Rep;
|
_obj109Rep = obj109Rep;
|
||||||
@ -56,6 +68,9 @@ public class ProjectManagementService : IDynamicApiController, ITransient
|
|||||||
_dataValidationService = dataValidationService;
|
_dataValidationService = dataValidationService;
|
||||||
_obj122Rep = obj122Rep;
|
_obj122Rep = obj122Rep;
|
||||||
_obj121Rep = obj121Rep;
|
_obj121Rep = obj121Rep;
|
||||||
|
_obj126Rep = obj126Rep;
|
||||||
|
_casesStagesMainRep = casesStagesMainRep;
|
||||||
|
_scopeFactory = scopeFactory;
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 分页查询项目管理
|
/// 分页查询项目管理
|
||||||
@ -526,7 +541,7 @@ public class ProjectManagementService : IDynamicApiController, ITransient
|
|||||||
var configid = await _configurationsRep.AsQueryable().Where(x => x.ObjectId == 109 && x.ConfigSystemName == "mBOM").FirstAsync();
|
var configid = await _configurationsRep.AsQueryable().Where(x => x.ObjectId == 109 && x.ConfigSystemName == "mBOM").FirstAsync();
|
||||||
|
|
||||||
var materialData = await _obj109Rep.AsQueryable()
|
var materialData = await _obj109Rep.AsQueryable()
|
||||||
.Where(x => (x.CheckedStatus == 0 || x.CheckedStatus == 1) && x.deleted == false && x.IsLatestVersion == true && x.fld005040 == "发布" &&x.fld004510=="N" && x.fld004509 == "成功" && (x.fld004514 == "A" || x.fld004514 == "M"))
|
.Where(x => (x.CheckedStatus == 0 || x.CheckedStatus == 1) && x.deleted == false && x.IsLatestVersion == true && x.fld005040 == "发布" && x.fld004510 == "N" && x.fld004509 == "成功" && (x.fld004514 == "A" || x.fld004514 == "M"))
|
||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
var groupedData = materialData.GroupBy(item => item.RecordGuid)
|
var groupedData = materialData.GroupBy(item => item.RecordGuid)
|
||||||
.Select(group => group.OrderByDescending(item => item.VersionIndex).First())
|
.Select(group => group.OrderByDescending(item => item.VersionIndex).First())
|
||||||
@ -756,7 +771,7 @@ public class ProjectManagementService : IDynamicApiController, ITransient
|
|||||||
|
|
||||||
//查询需要同步的产品
|
//查询需要同步的产品
|
||||||
var materialData = await _obj109Rep.AsQueryable()
|
var materialData = await _obj109Rep.AsQueryable()
|
||||||
.Where(x => (x.CheckedStatus == 0 || x.CheckedStatus == 1) && x.deleted == false && x.IsLatestVersion == true && x.fld005040 == "发布" &&x.fld004510=="N" && x.fld004509 == "成功" && (x.fld004514 == "A" || x.fld004514 == "M"))
|
.Where(x => (x.CheckedStatus == 0 || x.CheckedStatus == 1) && x.deleted == false && x.IsLatestVersion == true && x.fld005040 == "发布" && x.fld004510 == "N" && x.fld004509 == "成功" && (x.fld004514 == "A" || x.fld004514 == "M"))
|
||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
//分组查询最大版本的物料
|
//分组查询最大版本的物料
|
||||||
var groupedData = materialData.GroupBy(item => item.RecordGuid)
|
var groupedData = materialData.GroupBy(item => item.RecordGuid)
|
||||||
@ -858,4 +873,808 @@ public class ProjectManagementService : IDynamicApiController, ITransient
|
|||||||
}
|
}
|
||||||
return sapOutputList;
|
return sapOutputList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 向SAP创建WBS
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
public async Task<List<SapOutput>> WbsInSapCreate()
|
||||||
|
{
|
||||||
|
using var serviceScope = _scopeFactory.CreateScope();
|
||||||
|
var sysEnumService = serviceScope.ServiceProvider.GetRequiredService<SysEnumService>();
|
||||||
|
var db = serviceScope.ServiceProvider.GetRequiredService<ISqlSugarClient>().AsTenant().GetConnectionScope("启威星 1.94.4.74").CopyNew();
|
||||||
|
var syncData = db.Queryable<Obj109>()
|
||||||
|
.InnerJoin<CasesStagesMain>((x, y) => x.RecordGuid == y.RecordGuid)
|
||||||
|
.InnerJoin<Obj126>((x, y, z) => y.ChildRecordGuid == z.RecordGuid)
|
||||||
|
.Where((x, y) => x.deleted == false && x.fld006774 == "A" && (x.fld006993 == "" || x.fld006993 == null) && (x.CheckedStatus == 0 || x.CheckedStatus == 1) && y.indentLevel < 4)
|
||||||
|
//&& SqlFunc.Subqueryable<Obj109>().Where(x=>x.RecordGuid==x.RecordGuid).Max(s=>s.idRecord)==x.idRecord) (x.fld006776 == "" || x.fld006776 == null)
|
||||||
|
.Select((x, y, z) => new WbsInput
|
||||||
|
{
|
||||||
|
projectIdRecord = x.idRecord,
|
||||||
|
CheckedStatus = x.CheckedStatus,
|
||||||
|
RecordGuid = x.RecordGuid,
|
||||||
|
indentLevel = y.indentLevel,
|
||||||
|
OrderIndex = y.OrderIndex,
|
||||||
|
Description = y.Description,
|
||||||
|
ChildRecordGuid = y.ChildRecordGuid,
|
||||||
|
fld006745 = z.fld006745,
|
||||||
|
_System_objNBS = z._System_objNBS,
|
||||||
|
StartDate = z.StartDate,
|
||||||
|
EndDate = z.EndDate,
|
||||||
|
fld006934 = z.fld006934,
|
||||||
|
fld006746 = z.fld006746,
|
||||||
|
fld006770 = z.fld006770,
|
||||||
|
stageIdRecord = z.idRecord,
|
||||||
|
System_objNBS109 = x._System_objNBS
|
||||||
|
|
||||||
|
})
|
||||||
|
.ToList();
|
||||||
|
var syncList = syncData.GroupBy(record => record.RecordGuid)
|
||||||
|
.Select(group => new
|
||||||
|
{
|
||||||
|
WbsData = group.ToList()
|
||||||
|
});
|
||||||
|
|
||||||
|
var syncList2 = syncData.GroupBy(record => record.RecordGuid).ToList();
|
||||||
|
List<SapOutput> sapOutputs = new List<SapOutput>();
|
||||||
|
foreach (var item in syncList)
|
||||||
|
{
|
||||||
|
var output = await WbsSapParams(item.WbsData);
|
||||||
|
sapOutputs.Add(output);
|
||||||
|
}
|
||||||
|
return sapOutputs;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="list"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public async Task<SapOutput> WbsSapParams(List<WbsInput> list)
|
||||||
|
{
|
||||||
|
var sapInputItem = new List<SapCreateWBSItem>();
|
||||||
|
List<long> ints = new List<long>();
|
||||||
|
|
||||||
|
string hierarchicalCoding1 = "";
|
||||||
|
string hierarchicalCoding2 = "";
|
||||||
|
string hierarchicalCoding3 = "";
|
||||||
|
string hierarchicalCoding4 = "";
|
||||||
|
int i = 0;
|
||||||
|
long projectIdRecord = 0;
|
||||||
|
var sortList = list.OrderBy(x => x.OrderIndex).ToList();
|
||||||
|
foreach (var item in sortList)
|
||||||
|
{
|
||||||
|
projectIdRecord = item.projectIdRecord;
|
||||||
|
//if (string.IsNullOrEmpty(item.fld006745))
|
||||||
|
//{
|
||||||
|
// var errParam = new SapOutput()
|
||||||
|
// {
|
||||||
|
// materialCode=item.System_objNBS109,
|
||||||
|
// code = "失败",
|
||||||
|
// msg = "请检查WBS标识",
|
||||||
|
// };
|
||||||
|
// return errParam;
|
||||||
|
//}
|
||||||
|
|
||||||
|
ints.Add(item.stageIdRecord);
|
||||||
|
i++;
|
||||||
|
string StartDate = "";
|
||||||
|
if (item.StartDate.HasValue)
|
||||||
|
{
|
||||||
|
StartDate = item.StartDate.ToDateTime().ToString("yyyy-MM-dd");
|
||||||
|
}
|
||||||
|
string EndDate = "";
|
||||||
|
if (item.EndDate.HasValue)
|
||||||
|
{
|
||||||
|
EndDate = item.EndDate.ToDateTime().ToString("yyyy-MM-dd");
|
||||||
|
}
|
||||||
|
|
||||||
|
string fld006934 = "";
|
||||||
|
if (item.fld006934.HasValue)
|
||||||
|
{
|
||||||
|
fld006934 = item.fld006934.ToDateTime().ToString("yyyy-MM-dd");
|
||||||
|
}
|
||||||
|
|
||||||
|
string fld006746 = "";
|
||||||
|
if (item.fld006746.HasValue)
|
||||||
|
{
|
||||||
|
fld006746 = item.fld006746.ToDateTime().ToString("yyyy-MM-dd");
|
||||||
|
}
|
||||||
|
string fld006770 = "";
|
||||||
|
if (!string.IsNullOrEmpty(item.fld006770))
|
||||||
|
{
|
||||||
|
string[] parts = item.fld006770.Split('-');
|
||||||
|
fld006770 = parts[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (item.indentLevel == 0)
|
||||||
|
{
|
||||||
|
hierarchicalCoding1 = item.fld006745;
|
||||||
|
|
||||||
|
//var itemData = new SapCreateWBSItem
|
||||||
|
//{
|
||||||
|
// Zwbid = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds() + i.ToString(),
|
||||||
|
// Pspid = hierarchicalCoding1,
|
||||||
|
// Pspnr = "",
|
||||||
|
// Pspnr2 = hierarchicalCoding1,
|
||||||
|
// Post1 = item.Description,
|
||||||
|
// Pstrt = StartDate,
|
||||||
|
// Pende = EndDate,
|
||||||
|
// Istrt = fld006934,
|
||||||
|
// Iende = fld006746,
|
||||||
|
// Usr00 = "",
|
||||||
|
// Prart = fld006770,
|
||||||
|
// Zresv1 = "",
|
||||||
|
// Zresv2 = "",
|
||||||
|
// Zresv3 = "",
|
||||||
|
// Zresv4 = "",
|
||||||
|
// Zresv5 = ""
|
||||||
|
//};
|
||||||
|
//sapInputItem.Add(itemData);
|
||||||
|
|
||||||
|
}
|
||||||
|
if (item.indentLevel == 1)
|
||||||
|
{
|
||||||
|
hierarchicalCoding2 = item.fld006745;
|
||||||
|
|
||||||
|
var itemData = new SapCreateWBSItem
|
||||||
|
{
|
||||||
|
Zwbid = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds() + i.ToString(),
|
||||||
|
Pspid = hierarchicalCoding1,
|
||||||
|
Pspnr = hierarchicalCoding1,
|
||||||
|
Pspnr2 = hierarchicalCoding2,
|
||||||
|
Post1 = item.Description,
|
||||||
|
Pstrt = StartDate,
|
||||||
|
Pende = EndDate,
|
||||||
|
Istrt = fld006934,
|
||||||
|
Iende = fld006746,
|
||||||
|
Usr00 = "",
|
||||||
|
Prart = fld006770,
|
||||||
|
Zresv1 = "",
|
||||||
|
Zresv2 = "",
|
||||||
|
Zresv3 = "",
|
||||||
|
Zresv4 = "",
|
||||||
|
Zresv5 = ""
|
||||||
|
};
|
||||||
|
if (fld006770 == "6")
|
||||||
|
{
|
||||||
|
itemData.Pspnr = "";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!string.IsNullOrEmpty(item.fld006745))
|
||||||
|
{
|
||||||
|
sapInputItem.Add(itemData);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (item.indentLevel == 2)
|
||||||
|
{
|
||||||
|
hierarchicalCoding3 = item.fld006745;
|
||||||
|
var itemData = new SapCreateWBSItem
|
||||||
|
{
|
||||||
|
Zwbid = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds() + i.ToString(),
|
||||||
|
Pspid = hierarchicalCoding1,
|
||||||
|
Pspnr = hierarchicalCoding2,
|
||||||
|
Pspnr2 = hierarchicalCoding3,
|
||||||
|
Post1 = item.Description,
|
||||||
|
Pstrt = StartDate,
|
||||||
|
Pende = EndDate,
|
||||||
|
Istrt = fld006934,
|
||||||
|
Iende = fld006746,
|
||||||
|
Usr00 = "",
|
||||||
|
Prart = fld006770,
|
||||||
|
Zresv1 = "",
|
||||||
|
Zresv2 = "",
|
||||||
|
Zresv3 = "",
|
||||||
|
Zresv4 = "",
|
||||||
|
Zresv5 = ""
|
||||||
|
};
|
||||||
|
if (fld006770 == "6")
|
||||||
|
{
|
||||||
|
itemData.Pspnr = "";
|
||||||
|
}
|
||||||
|
if (!string.IsNullOrEmpty(item.fld006745))
|
||||||
|
{
|
||||||
|
sapInputItem.Add(itemData);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (item.indentLevel == 3)
|
||||||
|
{
|
||||||
|
hierarchicalCoding4 = item.fld006745;
|
||||||
|
var itemData = new SapCreateWBSItem
|
||||||
|
{
|
||||||
|
Zwbid = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds() + i.ToString(),
|
||||||
|
Pspid = hierarchicalCoding1,
|
||||||
|
Pspnr = hierarchicalCoding3,
|
||||||
|
Pspnr2 = hierarchicalCoding4,
|
||||||
|
Post1 = item.Description,
|
||||||
|
Pstrt = StartDate,
|
||||||
|
Pende = EndDate,
|
||||||
|
Istrt = fld006934,
|
||||||
|
Iende = fld006746,
|
||||||
|
Usr00 = "",
|
||||||
|
Prart = fld006770,
|
||||||
|
Zresv1 = "",
|
||||||
|
Zresv2 = "",
|
||||||
|
Zresv3 = "",
|
||||||
|
Zresv4 = "",
|
||||||
|
Zresv5 = ""
|
||||||
|
};
|
||||||
|
if (fld006770 == "6")
|
||||||
|
{
|
||||||
|
itemData.Pspnr = "";
|
||||||
|
}
|
||||||
|
if (!string.IsNullOrEmpty(item.fld006745))
|
||||||
|
{
|
||||||
|
sapInputItem.Add(itemData);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
var sapInput = new SapCreateWBSInput
|
||||||
|
{
|
||||||
|
ReqKeyId = "",
|
||||||
|
BusinessId = "",
|
||||||
|
MessageId = "",
|
||||||
|
SndPrn = "PLM",
|
||||||
|
RcvPrn = "SAP",
|
||||||
|
ReqUser = await _sysConfigService.GetConfigValueByCode<string>(ConfigConst.SapUserName),
|
||||||
|
Note1 = "",
|
||||||
|
Note2 = "",
|
||||||
|
Note3 = "",
|
||||||
|
SapCreateWBSItem = sapInputItem
|
||||||
|
};
|
||||||
|
|
||||||
|
var output = await _sapService.SapCreateWBS(sapInput);
|
||||||
|
|
||||||
|
if (output.code == "S")
|
||||||
|
{
|
||||||
|
//await _obj126Rep.AsUpdateable()
|
||||||
|
// .SetColumns(it => it.fld006772 == DateTime.Now && it.fld006771 == "N" && it.fld006773 == output.msg && it.fld006990 == "成功")
|
||||||
|
// .Where(it => ints.Contains(it.idRecord))
|
||||||
|
// .ExecuteCommandAsync();
|
||||||
|
//await _obj109Rep.AsUpdateable()
|
||||||
|
// .SetColumns(it => it.fld006775 == DateTime.Now && it.fld006774 == "N" && it.fld006776 == output.msg && it.fld006993 == "成功")
|
||||||
|
// .Where(it => it.idRecord == projectIdRecord)
|
||||||
|
// .ExecuteCommandAsync();
|
||||||
|
|
||||||
|
foreach (var item in ints)
|
||||||
|
{
|
||||||
|
await UpdateObj126(item, output.msg, "创建成功");
|
||||||
|
}
|
||||||
|
await UpdateObj109(projectIdRecord, output.msg, "创建成功");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//await _obj109Rep.AsUpdateable()
|
||||||
|
// .SetColumns(it => it.fld006775 == DateTime.Now && it.fld006774 == "N" && it.fld006776 == output.msg)
|
||||||
|
// .Where(it => it.idRecord == projectIdRecord)
|
||||||
|
// .ExecuteCommandAsync();
|
||||||
|
await UpdateObj109(projectIdRecord, output.msg, "创建失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return output;
|
||||||
|
|
||||||
|
}
|
||||||
|
private async Task UpdateObj109(long idRecord, string msg, string creationState)
|
||||||
|
{
|
||||||
|
if (creationState == "创建成功")
|
||||||
|
{
|
||||||
|
await _obj109Rep.AsUpdateable()
|
||||||
|
.SetColumns(it => new Obj109
|
||||||
|
{
|
||||||
|
fld006775 = DateTime.Now,
|
||||||
|
fld006774 = "N",
|
||||||
|
fld006776 = msg,
|
||||||
|
fld006993 = "成功"
|
||||||
|
})
|
||||||
|
.Where(it => it.idRecord == idRecord)
|
||||||
|
.ExecuteCommandAsync();
|
||||||
|
}
|
||||||
|
if (creationState == "修改成功" || creationState == "创建失败" || creationState == "修改失败")
|
||||||
|
{
|
||||||
|
await _obj109Rep.AsUpdateable()
|
||||||
|
.SetColumns(it => new Obj109
|
||||||
|
{
|
||||||
|
fld006775 = DateTime.Now,
|
||||||
|
fld006774 = "N",
|
||||||
|
fld006776 = msg
|
||||||
|
})
|
||||||
|
.Where(it => it.idRecord == idRecord)
|
||||||
|
.ExecuteCommandAsync();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private async Task UpdateObj126(long idRecord, string msg, string creationState)
|
||||||
|
{
|
||||||
|
if (creationState == "创建成功")
|
||||||
|
{
|
||||||
|
await _obj126Rep.AsUpdateable()
|
||||||
|
.SetColumns(it => new Obj126
|
||||||
|
{
|
||||||
|
fld006772 = DateTime.Now,
|
||||||
|
fld006771 = "N",
|
||||||
|
fld006773 = msg,
|
||||||
|
fld006990 = creationState
|
||||||
|
})
|
||||||
|
.Where(it => it.idRecord == idRecord)
|
||||||
|
.ExecuteCommandAsync();
|
||||||
|
}
|
||||||
|
if (creationState == "创建失败" || creationState == "修改成功"|| creationState == "修改失败")
|
||||||
|
{
|
||||||
|
await _obj126Rep.AsUpdateable()
|
||||||
|
.SetColumns(it => new Obj126
|
||||||
|
{
|
||||||
|
fld006772 = DateTime.Now,
|
||||||
|
fld006771 = "N",
|
||||||
|
fld006773 = msg
|
||||||
|
})
|
||||||
|
.Where(it => it.idRecord == idRecord)
|
||||||
|
.ExecuteCommandAsync();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 向SAP更新WBS
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
public async Task<List<SapOutput>> WbsInSapUpdate()
|
||||||
|
{
|
||||||
|
using var serviceScope = _scopeFactory.CreateScope();
|
||||||
|
var sysEnumService = serviceScope.ServiceProvider.GetRequiredService<SysEnumService>();
|
||||||
|
var db = serviceScope.ServiceProvider.GetRequiredService<ISqlSugarClient>().AsTenant().GetConnectionScope("启威星 1.94.4.74").CopyNew();
|
||||||
|
var syncData = db.Queryable<Obj109>()
|
||||||
|
.InnerJoin<CasesStagesMain>((x, y) => x.RecordGuid == y.RecordGuid)
|
||||||
|
.InnerJoin<Obj126>((x, y, z) => y.ChildRecordGuid == z.RecordGuid)
|
||||||
|
.Where((x, y) => x.deleted == false && x.fld006774 == "A" && (x.CheckedStatus == 0 || x.CheckedStatus == 1) && x.fld006993 == "成功" && y.indentLevel < 4) //&& (x.fld006776 == "" || x.fld006776 == null)
|
||||||
|
.Select((x, y, z) => new WbsInput
|
||||||
|
{
|
||||||
|
projectIdRecord = x.idRecord,
|
||||||
|
CheckedStatus = x.CheckedStatus,
|
||||||
|
RecordGuid = x.RecordGuid,
|
||||||
|
indentLevel = y.indentLevel,
|
||||||
|
OrderIndex = y.OrderIndex,
|
||||||
|
Description = y.Description,
|
||||||
|
ChildRecordGuid = y.ChildRecordGuid,
|
||||||
|
fld006745 = z.fld006745,
|
||||||
|
_System_objNBS = z._System_objNBS,
|
||||||
|
StartDate = z.StartDate,
|
||||||
|
EndDate = z.EndDate,
|
||||||
|
fld006934 = z.fld006934,
|
||||||
|
fld006746 = z.fld006746,
|
||||||
|
fld006770 = z.fld006770,
|
||||||
|
stageIdRecord = z.idRecord,
|
||||||
|
fld004502 = x.fld004502,
|
||||||
|
System_objNBS109 = x._System_objNBS,
|
||||||
|
fld004506 = x.fld004506,
|
||||||
|
fld006747 = z.fld006747,
|
||||||
|
fld006771=z.fld006771
|
||||||
|
|
||||||
|
})
|
||||||
|
.ToList();
|
||||||
|
var syncList = syncData.GroupBy(record => record.RecordGuid)
|
||||||
|
.Select(group => new
|
||||||
|
{
|
||||||
|
WbsData = group.ToList()
|
||||||
|
});
|
||||||
|
|
||||||
|
var syncList2 = syncData.GroupBy(record => record.RecordGuid).ToList();
|
||||||
|
|
||||||
|
List<SapOutput> sapOutputs = new List<SapOutput>();
|
||||||
|
foreach (var item in syncList)
|
||||||
|
{
|
||||||
|
List<SapOutput> output = await WbsSapUpdateParams(item.WbsData);
|
||||||
|
sapOutputs.AddRange(output);
|
||||||
|
}
|
||||||
|
return sapOutputs;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<List<SapOutput>> WbsSapUpdateParams(List<WbsInput> list)
|
||||||
|
{
|
||||||
|
var sapOutput = new List<SapOutput>();
|
||||||
|
var sapUpdateInputItem = new List<SapUpdateWBSItem>();
|
||||||
|
var sapCreateInputItem = new List<SapCreateWBSItem>();
|
||||||
|
List<long> intsCreate = new List<long>();
|
||||||
|
List<long> intsUpdate = new List<long>();
|
||||||
|
|
||||||
|
|
||||||
|
string hierarchicalCoding1 = "";
|
||||||
|
string hierarchicalCoding2 = "";
|
||||||
|
string hierarchicalCoding3 = "";
|
||||||
|
string hierarchicalCoding4 = "";
|
||||||
|
int i = 0;
|
||||||
|
long projectIdRecord = 0;
|
||||||
|
var sortList = list.OrderBy(x => x.OrderIndex).ToList();
|
||||||
|
foreach (var item in sortList)
|
||||||
|
{
|
||||||
|
projectIdRecord = item.projectIdRecord;
|
||||||
|
//if (string.IsNullOrEmpty(item.fld006745))
|
||||||
|
//{
|
||||||
|
// var errParam = new SapOutput()
|
||||||
|
// {
|
||||||
|
// materialCode=item.System_objNBS109,
|
||||||
|
// code = "失败",
|
||||||
|
// msg = "请检查WBS标识",
|
||||||
|
// };
|
||||||
|
// sapOutput.Add(errParam);
|
||||||
|
// return sapOutput;
|
||||||
|
//}
|
||||||
|
|
||||||
|
//if (item.fld006771 == "M")
|
||||||
|
//{
|
||||||
|
// intsUpdate.Add(item.stageIdRecord);
|
||||||
|
//}
|
||||||
|
//else
|
||||||
|
//{
|
||||||
|
// intsCreate.Add(item.stageIdRecord);
|
||||||
|
//}
|
||||||
|
i++;
|
||||||
|
string StartDate = "";
|
||||||
|
if (item.StartDate.HasValue)
|
||||||
|
{
|
||||||
|
StartDate = item.StartDate.ToDateTime().ToString("yyyy-MM-dd");
|
||||||
|
}
|
||||||
|
string EndDate = "";
|
||||||
|
if (item.EndDate.HasValue)
|
||||||
|
{
|
||||||
|
EndDate = item.EndDate.ToDateTime().ToString("yyyy-MM-dd");
|
||||||
|
}
|
||||||
|
|
||||||
|
string fld006934 = "";
|
||||||
|
if (item.fld006934.HasValue)
|
||||||
|
{
|
||||||
|
fld006934 = item.fld006934.ToDateTime().ToString("yyyy-MM-dd");
|
||||||
|
}
|
||||||
|
|
||||||
|
string fld006746 = "";
|
||||||
|
if (item.fld006746.HasValue)
|
||||||
|
{
|
||||||
|
fld006746 = item.fld006746.ToDateTime().ToString("yyyy-MM-dd");
|
||||||
|
}
|
||||||
|
string fld006770 = "";
|
||||||
|
if (!string.IsNullOrEmpty(item.fld006770))
|
||||||
|
{
|
||||||
|
string[] parts = item.fld006770.Split('-');
|
||||||
|
fld006770 = parts[0];
|
||||||
|
}
|
||||||
|
string fld004506 = "";
|
||||||
|
if (!string.IsNullOrEmpty(item.fld004506))
|
||||||
|
{
|
||||||
|
fld004506 = await _dataValidationService.ProjProcStatus(item.fld004506);
|
||||||
|
}
|
||||||
|
string fld006747 = "";
|
||||||
|
if (!string.IsNullOrEmpty(item.fld006747))
|
||||||
|
{
|
||||||
|
fld006747 = await _dataValidationService.ProjProcStatus(item.fld006747);
|
||||||
|
}
|
||||||
|
string System_objNBS109 = item.System_objNBS109;
|
||||||
|
if (item.indentLevel == 0)
|
||||||
|
{
|
||||||
|
hierarchicalCoding1 = item.fld006745;
|
||||||
|
if (item.fld006771 == "M")
|
||||||
|
{
|
||||||
|
intsUpdate.Add(item.stageIdRecord);
|
||||||
|
var itemData = new SapUpdateWBSItem
|
||||||
|
{
|
||||||
|
Zwbid = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds() + i.ToString(),
|
||||||
|
Pspid = System_objNBS109,
|
||||||
|
Post1Proj = item.fld004502,
|
||||||
|
Pspnr = hierarchicalCoding1,
|
||||||
|
Post1 = item.Description,
|
||||||
|
Pstrt = StartDate,
|
||||||
|
Pende = EndDate,
|
||||||
|
Istrt = fld006934,
|
||||||
|
Iende = fld006746,
|
||||||
|
Usr00 = "",
|
||||||
|
Prart = fld006770,
|
||||||
|
SystemStatus = fld004506,
|
||||||
|
SystemStatus2 = fld006747,
|
||||||
|
Zresv1 = "",
|
||||||
|
Zresv2 = "",
|
||||||
|
Zresv3 = "",
|
||||||
|
Zresv4 = "",
|
||||||
|
Zresv5 = ""
|
||||||
|
};
|
||||||
|
sapUpdateInputItem.Add(itemData);
|
||||||
|
}
|
||||||
|
//if (item.fld006771 == "" || item.fld006771 ==null)
|
||||||
|
//{
|
||||||
|
// var itemCreateData = new SapCreateWBSItem
|
||||||
|
// {
|
||||||
|
// Zwbid = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds() + i.ToString(),
|
||||||
|
// Pspid = System_objNBS109,
|
||||||
|
// Pspnr = "",
|
||||||
|
// Pspnr2 = hierarchicalCoding1,
|
||||||
|
// Post1 = item.Description,
|
||||||
|
// Pstrt = StartDate,
|
||||||
|
// Pende = EndDate,
|
||||||
|
// Istrt = fld006934,
|
||||||
|
// Iende = fld006746,
|
||||||
|
// Usr00 = "",
|
||||||
|
// Prart = fld006770,
|
||||||
|
// Zresv1 = "",
|
||||||
|
// Zresv2 = "",
|
||||||
|
// Zresv3 = "",
|
||||||
|
// Zresv4 = "",
|
||||||
|
// Zresv5 = ""
|
||||||
|
// };
|
||||||
|
// sapCreateInputItem.Add(itemCreateData);
|
||||||
|
//}
|
||||||
|
|
||||||
|
}
|
||||||
|
if (item.indentLevel == 1)
|
||||||
|
{
|
||||||
|
hierarchicalCoding2 = item.fld006745;
|
||||||
|
if (item.fld006771 == "M")
|
||||||
|
{
|
||||||
|
intsUpdate.Add(item.stageIdRecord);
|
||||||
|
var itemData = new SapUpdateWBSItem
|
||||||
|
{
|
||||||
|
Zwbid = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds() + i.ToString(),
|
||||||
|
Pspid = System_objNBS109,
|
||||||
|
Post1Proj = item.fld004502,
|
||||||
|
Pspnr = hierarchicalCoding2,
|
||||||
|
Post1 = item.Description,
|
||||||
|
Pstrt = StartDate,
|
||||||
|
Pende = EndDate,
|
||||||
|
Istrt = fld006934,
|
||||||
|
Iende = fld006746,
|
||||||
|
Usr00 = "",
|
||||||
|
Prart = fld006770,
|
||||||
|
SystemStatus = fld004506,
|
||||||
|
SystemStatus2 = fld006747,
|
||||||
|
Zresv1 = "",
|
||||||
|
Zresv2 = "",
|
||||||
|
Zresv3 = "",
|
||||||
|
Zresv4 = "",
|
||||||
|
Zresv5 = ""
|
||||||
|
};
|
||||||
|
sapUpdateInputItem.Add(itemData);
|
||||||
|
}
|
||||||
|
if (item.fld006771 == "" || item.fld006771 == null)
|
||||||
|
{
|
||||||
|
var itemData = new SapCreateWBSItem
|
||||||
|
{
|
||||||
|
Zwbid = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds() + i.ToString(),
|
||||||
|
Pspid = System_objNBS109,
|
||||||
|
Pspnr = hierarchicalCoding1,
|
||||||
|
Pspnr2 = hierarchicalCoding2,
|
||||||
|
Post1 = item.Description,
|
||||||
|
Pstrt = StartDate,
|
||||||
|
Pende = EndDate,
|
||||||
|
Istrt = fld006934,
|
||||||
|
Iende = fld006746,
|
||||||
|
Usr00 = "",
|
||||||
|
Prart = fld006770,
|
||||||
|
Zresv1 = "",
|
||||||
|
Zresv2 = "",
|
||||||
|
Zresv3 = "",
|
||||||
|
Zresv4 = "",
|
||||||
|
Zresv5 = ""
|
||||||
|
};
|
||||||
|
if (fld006770 == "6")
|
||||||
|
{
|
||||||
|
itemData.Pspnr = "";
|
||||||
|
}
|
||||||
|
if (!string.IsNullOrEmpty(item.fld006745))
|
||||||
|
{
|
||||||
|
intsCreate.Add(item.stageIdRecord);
|
||||||
|
sapCreateInputItem.Add(itemData);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (item.indentLevel == 2)
|
||||||
|
{
|
||||||
|
hierarchicalCoding3 = item.fld006745;
|
||||||
|
if (item.fld006771 == "M")
|
||||||
|
{
|
||||||
|
intsUpdate.Add(item.stageIdRecord);
|
||||||
|
var itemData = new SapUpdateWBSItem
|
||||||
|
{
|
||||||
|
Zwbid = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds() + i.ToString(),
|
||||||
|
Pspid = System_objNBS109,
|
||||||
|
Post1Proj = item.fld004502,
|
||||||
|
Pspnr = hierarchicalCoding3,
|
||||||
|
Post1 = item.Description,
|
||||||
|
Pstrt = StartDate,
|
||||||
|
Pende = EndDate,
|
||||||
|
Istrt = fld006934,
|
||||||
|
Iende = fld006746,
|
||||||
|
Usr00 = "",
|
||||||
|
Prart = fld006770,
|
||||||
|
SystemStatus = fld004506,
|
||||||
|
SystemStatus2 = fld006747,
|
||||||
|
Zresv1 = "",
|
||||||
|
Zresv2 = "",
|
||||||
|
Zresv3 = "",
|
||||||
|
Zresv4 = "",
|
||||||
|
Zresv5 = ""
|
||||||
|
};
|
||||||
|
sapUpdateInputItem.Add(itemData);
|
||||||
|
}
|
||||||
|
if (item.fld006771 == "" || item.fld006771 == null)
|
||||||
|
{
|
||||||
|
var itemData = new SapCreateWBSItem
|
||||||
|
{
|
||||||
|
Zwbid = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds() + i.ToString(),
|
||||||
|
Pspid = System_objNBS109,
|
||||||
|
Pspnr = hierarchicalCoding2,
|
||||||
|
Pspnr2 = hierarchicalCoding3,
|
||||||
|
Post1 = item.Description,
|
||||||
|
Pstrt = StartDate,
|
||||||
|
Pende = EndDate,
|
||||||
|
Istrt = fld006934,
|
||||||
|
Iende = fld006746,
|
||||||
|
Usr00 = "",
|
||||||
|
Prart = fld006770,
|
||||||
|
Zresv1 = "",
|
||||||
|
Zresv2 = "",
|
||||||
|
Zresv3 = "",
|
||||||
|
Zresv4 = "",
|
||||||
|
Zresv5 = ""
|
||||||
|
};
|
||||||
|
if (fld006770 == "6")
|
||||||
|
{
|
||||||
|
itemData.Pspnr = "";
|
||||||
|
}
|
||||||
|
if (!string.IsNullOrEmpty(item.fld006745))
|
||||||
|
{
|
||||||
|
intsCreate.Add(item.stageIdRecord);
|
||||||
|
sapCreateInputItem.Add(itemData);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
if (item.indentLevel == 3)
|
||||||
|
{
|
||||||
|
hierarchicalCoding4 = item.fld006745;
|
||||||
|
if (item.fld006771 == "M")
|
||||||
|
{
|
||||||
|
intsUpdate.Add(item.stageIdRecord);
|
||||||
|
var itemData = new SapUpdateWBSItem
|
||||||
|
{
|
||||||
|
Zwbid = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds() + i.ToString(),
|
||||||
|
Pspid = System_objNBS109,
|
||||||
|
Post1Proj = item.fld004502,
|
||||||
|
Pspnr = hierarchicalCoding4,
|
||||||
|
Post1 = item.Description,
|
||||||
|
Pstrt = StartDate,
|
||||||
|
Pende = EndDate,
|
||||||
|
Istrt = fld006934,
|
||||||
|
Iende = fld006746,
|
||||||
|
Usr00 = "",
|
||||||
|
Prart = fld006770,
|
||||||
|
SystemStatus = fld004506,
|
||||||
|
SystemStatus2 = fld006747,
|
||||||
|
Zresv1 = "",
|
||||||
|
Zresv2 = "",
|
||||||
|
Zresv3 = "",
|
||||||
|
Zresv4 = "",
|
||||||
|
Zresv5 = ""
|
||||||
|
};
|
||||||
|
sapUpdateInputItem.Add(itemData);
|
||||||
|
}
|
||||||
|
if (item.fld006771 == "" || item.fld006771 == null)
|
||||||
|
{
|
||||||
|
var itemData = new SapCreateWBSItem
|
||||||
|
{
|
||||||
|
Zwbid = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds() + i.ToString(),
|
||||||
|
Pspid = System_objNBS109,
|
||||||
|
Pspnr = hierarchicalCoding3,
|
||||||
|
Pspnr2 = hierarchicalCoding4,
|
||||||
|
Post1 = item.Description,
|
||||||
|
Pstrt = StartDate,
|
||||||
|
Pende = EndDate,
|
||||||
|
Istrt = fld006934,
|
||||||
|
Iende = fld006746,
|
||||||
|
Usr00 = "",
|
||||||
|
Prart = fld006770,
|
||||||
|
Zresv1 = "",
|
||||||
|
Zresv2 = "",
|
||||||
|
Zresv3 = "",
|
||||||
|
Zresv4 = "",
|
||||||
|
Zresv5 = ""
|
||||||
|
};
|
||||||
|
if (fld006770 == "6")
|
||||||
|
{
|
||||||
|
itemData.Pspnr = "";
|
||||||
|
}
|
||||||
|
if (!string.IsNullOrEmpty(item.fld006745))
|
||||||
|
{
|
||||||
|
intsCreate.Add(item.stageIdRecord);
|
||||||
|
sapCreateInputItem.Add(itemData);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (sapCreateInputItem.Count > 0)
|
||||||
|
{
|
||||||
|
var sapInput = new SapCreateWBSInput
|
||||||
|
{
|
||||||
|
ReqKeyId = "",
|
||||||
|
BusinessId = "",
|
||||||
|
MessageId = "",
|
||||||
|
SndPrn = "PLM",
|
||||||
|
RcvPrn = "SAP",
|
||||||
|
ReqUser = await _sysConfigService.GetConfigValueByCode<string>(ConfigConst.SapUserName),
|
||||||
|
Note1 = "",
|
||||||
|
Note2 = "",
|
||||||
|
Note3 = "",
|
||||||
|
SapCreateWBSItem = sapCreateInputItem
|
||||||
|
};
|
||||||
|
var output = await _sapService.SapCreateWBS(sapInput);
|
||||||
|
sapOutput.Add(output);
|
||||||
|
if (output.code == "S")
|
||||||
|
{
|
||||||
|
//await _obj126Rep.AsUpdateable()
|
||||||
|
// .SetColumns(it => it.fld006772 == DateTime.Now && it.fld006771 == "N" && it.fld006773 == output.msg && it.fld006990 == "成功")
|
||||||
|
// .Where(it => intsCreate.Contains(it.idRecord))
|
||||||
|
// .ExecuteCommandAsync();
|
||||||
|
//await _obj109Rep.AsUpdateable().SetColumns(it => it.fld006775 == DateTime.Now && it.fld006774 == "N" && it.fld006776 == output.msg).Where(it => it.idRecord == projectIdRecord).ExecuteCommandAsync();
|
||||||
|
|
||||||
|
foreach (var item in intsCreate)
|
||||||
|
{
|
||||||
|
await UpdateObj126(item, output.msg, "创建成功");
|
||||||
|
}
|
||||||
|
await UpdateObj109(projectIdRecord, output.msg, "修改成功");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
foreach (var item in intsCreate)
|
||||||
|
{
|
||||||
|
await UpdateObj126(item, output.msg, "修改失败");
|
||||||
|
}
|
||||||
|
await UpdateObj109(projectIdRecord, output.msg, "创建失败");
|
||||||
|
}
|
||||||
|
//await _obj109Rep.AsUpdateable().SetColumns(it => it.fld006775 == DateTime.Now && it.fld006774 == "N" && it.fld006776 == output.msg).Where(it => it.idRecord == projectIdRecord).ExecuteCommandAsync();
|
||||||
|
}
|
||||||
|
if (sapUpdateInputItem.Count > 0)
|
||||||
|
{
|
||||||
|
var sapInput = new SapUpdateWBSInput
|
||||||
|
{
|
||||||
|
ReqKeyId = "",
|
||||||
|
BusinessId = "",
|
||||||
|
MessageId = "",
|
||||||
|
SndPrn = "PLM",
|
||||||
|
RcvPrn = "SAP",
|
||||||
|
ReqUser = await _sysConfigService.GetConfigValueByCode<string>(ConfigConst.SapUserName),
|
||||||
|
Note1 = "",
|
||||||
|
Note2 = "",
|
||||||
|
Note3 = "",
|
||||||
|
SapUpdateWBSItem = sapUpdateInputItem
|
||||||
|
};
|
||||||
|
var output = await _sapService.SapUpdateWBS(sapInput);
|
||||||
|
sapOutput.Add(output);
|
||||||
|
if (output.code == "S")
|
||||||
|
{
|
||||||
|
//await _obj126Rep.AsUpdateable()
|
||||||
|
// .SetColumns(it => it.fld006772 == DateTime.Now && it.fld006771 == "N" && it.fld006773 == output.msg && it.fld006990 == "成功")
|
||||||
|
// .Where(it => intsUpdate.Contains(it.idRecord))
|
||||||
|
// .ExecuteCommandAsync();
|
||||||
|
//await _obj109Rep.AsUpdateable().SetColumns(it=>it.fld006775==DateTime.Now&&it.fld006774=="N"&&it.fld006776== output.msg).Where(it=>it.idRecord== projectIdRecord).ExecuteCommandAsync();
|
||||||
|
|
||||||
|
foreach (var item in intsUpdate)
|
||||||
|
{
|
||||||
|
await UpdateObj126(item, output.msg, "修改成功");
|
||||||
|
}
|
||||||
|
await UpdateObj109(projectIdRecord, output.msg, "修改成功");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
foreach (var item in intsUpdate)
|
||||||
|
{
|
||||||
|
await UpdateObj126(item, output.msg, "修改失败");
|
||||||
|
}
|
||||||
|
await UpdateObj109(projectIdRecord, output.msg, "修改失败");
|
||||||
|
}
|
||||||
|
//await _obj109Rep.AsUpdateable().SetColumns(it => it.fld006775 == DateTime.Now && it.fld006774 == "N" && it.fld006776 == output.msg).Where(it => it.idRecord == projectIdRecord).ExecuteCommandAsync();
|
||||||
|
}
|
||||||
|
return sapOutput;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -16,11 +16,11 @@ namespace Vistar.Application.Util;
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public class SapOutput
|
public class SapOutput
|
||||||
{
|
{
|
||||||
public string parameter { get; set; }
|
public string? parameter { get; set; }
|
||||||
public string? materialCode { get; set; }
|
public string? materialCode { get; set; }
|
||||||
public string code { get; set; }
|
public string? code { get; set; }
|
||||||
public string msg { get; set; }
|
public string? msg { get; set; }
|
||||||
public string result { get; set; }
|
public string? result { get; set; }
|
||||||
public string? banfn { get; set; }
|
public string? banfn { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user