wet 1 year ago
commit 07dc2969af

@ -44,5 +44,10 @@ namespace Myshipping.Application
/// 值类型 STRING-字符 DATETIME-日期
/// </summary>
public string VAL_TYPE { get; set; }
/// <summary>
/// 流程版本号
/// </summary>
public string WF_VERSION { get; set; }
}
}

@ -44,5 +44,10 @@ namespace Myshipping.Application
/// 值类型 STRING-字符 DATETIME-日期
/// </summary>
public string VAL_TYPE { get; set; }
/// <summary>
/// 流程版本号
/// </summary>
public string WF_VERSION { get; set; }
}
}

@ -32,5 +32,10 @@ namespace Myshipping.Application.Entity
/// 服务项目主键
/// </summary>
public string SERVICE_PROJECT_ID { get; set; }
/// <summary>
/// 流程版本号
/// </summary>
public string WF_VERSION { get; set; }
}
}

@ -38,7 +38,7 @@ namespace Myshipping.Application.Entity
/// <summary>
/// 发布人
/// </summary>
public string PUBLISH_ER { get; set; }
public long PUBLISH_ER { get; set; }
/// <summary>
/// 发布人名称

@ -41,7 +41,8 @@ namespace Myshipping.Application
SqlSugarRepository<ServiceWorkFlowActivitiesInfo> serviceWorkFlowActivitiesInfoRepository,
SqlSugarRepository<ServiceWorkFlowProjectRelation> serviceWorkFlowProjectRelationRepository,
SqlSugarRepository<ServiceWorkFlowActivitiesRelation> serviceWorkFlowActivitiesRelationRepository,
SqlSugarRepository<ServiceWorkFlowActivitiesSubRelation> serviceWorkFlowActivitiesSubRelationRepository)
SqlSugarRepository<ServiceWorkFlowActivitiesSubRelation> serviceWorkFlowActivitiesSubRelationRepository,
SqlSugarRepository<ServiceWorkFlowReleaseInfo> serviceWorkFlowReleaseInfoRepository)
{
_serviceWorkFlowBaseRepository = serviceWorkFlowBaseRepository;
_serviceWorkFlowActivitiesInfoRepository = serviceWorkFlowActivitiesInfoRepository;
@ -50,6 +51,7 @@ namespace Myshipping.Application
_logger = logger;
_serviceWorkFlowActivitiesSubRelationRepository = serviceWorkFlowActivitiesSubRelationRepository;
_serviceWorkFlowReleaseInfoRepository = serviceWorkFlowReleaseInfoRepository;
}
/// <summary>
@ -238,15 +240,15 @@ namespace Myshipping.Application
//批量删除服务流程与服务项目关系(物理删除)
_serviceWorkFlowProjectRelationRepository.EntityContext.Deleteable<ServiceWorkFlowProjectRelation>()
.EnableQueryFilter().Where(a => a.SERVICE_WORKFLOW_ID == entity.PK_ID).ExecuteCommand();
.EnableQueryFilter().Where(a => a.SERVICE_WORKFLOW_ID == entity.PK_ID && a.WF_VERSION == "DEVELOP").ExecuteCommand();
//批量删除服务流程与服务活动关系(物理删除)
_serviceWorkFlowActivitiesRelationRepository.EntityContext.Deleteable<ServiceWorkFlowActivitiesRelation>()
.EnableQueryFilter().Where(a => a.SERVICE_WORKFLOW_ID == entity.PK_ID).ExecuteCommand();
.EnableQueryFilter().Where(a => a.SERVICE_WORKFLOW_ID == entity.PK_ID && a.WF_VERSION == "DEVELOP").ExecuteCommand();
//批量删除服务流程活动与子活动的关系(物理删除)
_serviceWorkFlowActivitiesSubRelationRepository.EntityContext.Deleteable<ServiceWorkFlowActivitiesSubRelation>()
.EnableQueryFilter().Where(a => a.SERVICE_WORKFLOW_ID == entity.PK_ID).ExecuteCommand();
.EnableQueryFilter().Where(a => a.SERVICE_WORKFLOW_ID == entity.PK_ID && a.WF_VERSION == "DEVELOP").ExecuteCommand();
}
//服务流程与服务项目关系
@ -256,6 +258,7 @@ namespace Myshipping.Application
PK_ID = IDGen.NextID().ToString(),
SERVICE_WORKFLOW_ID = entity.PK_ID,
SERVICE_PROJECT_ID = info.ServiceProject.PKId,
WF_VERSION = "DEVELOP"
};
//插入关系
@ -273,7 +276,8 @@ namespace Myshipping.Application
SERVICE_ACTIVITIES_ID = sku.PKId,
SORT_NO = sku.SortNo,
IS_CONTAINS_SUB = sku.IsContainsSub,
VAL_TYPE = !string.IsNullOrWhiteSpace(sku.ValType)? sku.ValType: StatusSKUValTypeEnum.DATETIME.ToString()
VAL_TYPE = !string.IsNullOrWhiteSpace(sku.ValType)? sku.ValType: StatusSKUValTypeEnum.DATETIME.ToString(),
WF_VERSION = "DEVELOP"
};
await _serviceWorkFlowActivitiesRelationRepository.InsertAsync(wfRelationActivities);
@ -288,7 +292,8 @@ namespace Myshipping.Application
SERVICE_WORKFLOW_ID = entity.PK_ID,
SERVICE_ACTIVITIES_ID = sku.PKId,
SUB_SERVICE_ACTIVITIES_ID = sub.PKId,
SORT_NO = sub.SortNo
SORT_NO = sub.SortNo,
WF_VERSION = "DEVELOP"
};
await _serviceWorkFlowActivitiesSubRelationRepository.InsertAsync(wfRelationActivitiesSub);
@ -998,15 +1003,41 @@ namespace Myshipping.Application
if (model == null)
throw Oops.Oh($"服务流程获取失败,服务流程信息不存在或已作废", typeof(InvalidOperationException));
var lastReleaseInfo = _serviceWorkFlowReleaseInfoRepository.AsQueryable()
.First(a => a.SERVICE_WORKFLOW_ID == model.PK_ID && a.IS_DEL == 0);
int currNum = lastReleaseInfo == null ? 1 : lastReleaseInfo.TOTAL_NUM;
ServiceWorkFlowReleaseInfo releaseInfo = new ServiceWorkFlowReleaseInfo
{
PK_ID = IDGen.NextID().ToString(),
SERVICE_WORKFLOW_ID = model.PK_ID,
LAST_PK_ID = lastReleaseInfo.PK_ID,
PUBLISH_DATE = DateTime.Now,
IS_DEL = 0,
PUBLISH_ER = UserManager.UserId,
PUBLISH_NAME = UserManager.Name,
TOTAL_NUM = currNum + 1,
};
//写入发布表
_serviceWorkFlowReleaseInfoRepository.Insert(releaseInfo);
model.RELEASE_VERSION = releaseInfo.RELEASE_VERSION;
model.UpdatedTime = DateTime.Now;
model.UpdatedUserId = UserManager.UserId;
model.UpdatedUserName = UserManager.Name;
await _serviceWorkFlowBaseRepository.AsUpdateable(model).UpdateColumns(it => new
{
it.RELEASE_VERSION,
it.UpdatedTime,
it.UpdatedUserId,
it.UpdatedUserName,
}).ExecuteCommandAsync();
result.succ = true;
result.msg = "执行成功";
result.msg = "发布成功";
}
catch (Exception ex)

@ -43,26 +43,25 @@ public sealed class LoggingFileComponent : IServiceComponent
return string.Format(fileName, DateTime.UtcNow);
};
options.FileSizeLimitBytes = 5000 * 1024;
//options.MessageFormat = (logMsg) =>
//{
// var stringBuilder = new StringBuilder();
// stringBuilder.AppendLine("【日志级别】:" + logMsg.LogLevel);
// stringBuilder.AppendLine("【日志时间】:" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
// stringBuilder.AppendLine("【日志内容】:" + logMsg.Message);
// if (logMsg.Exception != null)
// {
// stringBuilder.AppendLine("【异常信息】:" + logMsg.Exception);
// }
// stringBuilder.AppendLine("【ManagedThreadId】" + System.Threading.Thread.CurrentThread.ManagedThreadId);
// if (logMsg.Context != null && logMsg.Context.Properties != null && logMsg.Context.Properties.Count > 0)
// {
// foreach (var prop in logMsg.Context.Properties)
// {
// stringBuilder.AppendLine($"【属性】{prop.Key}{prop.Value}");
// }
// }
// return stringBuilder.ToString();
//};
options.MessageFormat = (logMsg) =>
{
var stringBuilder = new StringBuilder();
stringBuilder.AppendLine($"[{logMsg.LogLevel}] [{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.ffffff")}] [{logMsg.LogName}] [{System.Threading.Thread.CurrentThread.ManagedThreadId}] ");
stringBuilder.AppendLine($" {logMsg.Message}");
if (logMsg.Exception != null)
{
stringBuilder.AppendLine(logMsg.Exception.Message);
stringBuilder.AppendLine(logMsg.Exception.StackTrace);
}
if (logMsg.Context != null && logMsg.Context.Properties != null && logMsg.Context.Properties.Count > 0)
{
foreach (var prop in logMsg.Context.Properties)
{
stringBuilder.AppendLine($"{prop.Key}{prop.Value}");
}
}
return stringBuilder.ToString();
};
}
}

Loading…
Cancel
Save