新增服务发布

optimize
jianghaiqing 1 year ago
parent 934246ebc4
commit 2f0d61d385

@ -1,12 +1,68 @@
using System; using Myshipping.Core;
using SqlSugar;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace Myshipping.Application.Entity namespace Myshipping.Application.Entity
{ {
internal class ServiceWorkFlowReleaseInfo [Tenant(CommonConst.MasterDb)]
[SugarTable("service_workflow_release")]
[Description("服务流程发布表")]
public class ServiceWorkFlowReleaseInfo
{ {
/// <summary>
/// 主键
/// </summary>
[SugarColumn(ColumnDescription = "主键", IsPrimaryKey = true)]
public string PK_ID { get; set; }
/// <summary>
/// 服务流程主键
/// </summary>
public string SERVICE_WORKFLOW_ID { get; set; }
/// <summary>
/// 发布版本
/// </summary>
public string RELEASE_VERSION { get; set; }
/// <summary>
/// 发布日期
/// </summary>
public DateTime PUBLISH_DATE { get; set; }
/// <summary>
/// 发布人
/// </summary>
public string PUBLISH_ER { get; set; }
/// <summary>
/// 发布人名称
/// </summary>
public string PUBLISH_NAME { get; set; }
/// <summary>
/// 是否作废 1-已作废 0-未作废(默认未作废)
/// </summary>
public int IS_DEL { get; set; }
/// <summary>
/// 上一版本主键
/// </summary>
public string LAST_PK_ID { get; set; }
/// <summary>
/// 累计计数
/// </summary>
public int TOTAL_NUM { get; set; }
/// <summary>
/// 报文MD5
/// </summary>
public string MSG_MD5 { get; set; }
} }
} }

@ -33,8 +33,7 @@ namespace Myshipping.Application
private readonly SqlSugarRepository<ServiceWorkFlowProjectRelation> _serviceWorkFlowProjectRelationRepository; private readonly SqlSugarRepository<ServiceWorkFlowProjectRelation> _serviceWorkFlowProjectRelationRepository;
private readonly SqlSugarRepository<ServiceWorkFlowActivitiesRelation> _serviceWorkFlowActivitiesRelationRepository; private readonly SqlSugarRepository<ServiceWorkFlowActivitiesRelation> _serviceWorkFlowActivitiesRelationRepository;
private readonly SqlSugarRepository<ServiceWorkFlowActivitiesSubRelation> _serviceWorkFlowActivitiesSubRelationRepository; private readonly SqlSugarRepository<ServiceWorkFlowActivitiesSubRelation> _serviceWorkFlowActivitiesSubRelationRepository;
private readonly SqlSugarRepository<ServiceWorkFlowReleaseInfo> _serviceWorkFlowReleaseInfoRepository;
private readonly ILogger<ServiceWorkFlowBaseService> _logger; private readonly ILogger<ServiceWorkFlowBaseService> _logger;
public ServiceWorkFlowBaseService(SqlSugarRepository<ServiceWorkFlowBaseInfo> serviceWorkFlowBaseRepository, public ServiceWorkFlowBaseService(SqlSugarRepository<ServiceWorkFlowBaseInfo> serviceWorkFlowBaseRepository,
@ -942,10 +941,10 @@ namespace Myshipping.Application
List<TaskManageOrderResultDto> rltList = new List<TaskManageOrderResultDto>(); List<TaskManageOrderResultDto> rltList = new List<TaskManageOrderResultDto>();
//list.ForEach(pr => { list.ForEach(pr =>
{
// rltList.Add(InnerExcuteServiceWF(pr, OperateTypeEnum.Delete).GetAwaiter().GetResult()); rltList.Add(InnerPublishReleasServiceWF(pr).GetAwaiter().GetResult());
//}); });
result.succ = true; result.succ = true;
result.msg = rltList.FirstOrDefault().msg; result.msg = rltList.FirstOrDefault().msg;
@ -982,6 +981,44 @@ namespace Myshipping.Application
return result; return result;
} }
#region 发布服务流程内部方法
/// <summary>
/// 发布服务流程内部方法
/// </summary>
/// <param name="model">服务流程详情</param>
/// <returns>返回回执</returns>
private async Task<TaskManageOrderResultDto> InnerPublishReleasServiceWF(ServiceWorkFlowBaseInfo model)
{
TaskManageOrderResultDto result = new TaskManageOrderResultDto();
result.bno = model?.SERVICE_WORKFLOW_NAME;
try
{
if (model == null)
throw Oops.Oh($"服务流程获取失败,服务流程信息不存在或已作废", typeof(InvalidOperationException));
model.UpdatedTime = DateTime.Now;
model.UpdatedUserId = UserManager.UserId;
model.UpdatedUserName = UserManager.Name;
result.succ = true;
result.msg = "执行成功";
}
catch (Exception ex)
{
result.succ = false;
result.msg = $"执行启用异常,原因:{ex.Message}";
}
return result;
}
#endregion
#region 获取展示服务流程时间轴列表 #region 获取展示服务流程时间轴列表
/// <summary> /// <summary>
/// 获取展示服务流程时间轴列表 /// 获取展示服务流程时间轴列表

Loading…
Cancel
Save