|
|
|
@ -12,6 +12,7 @@ using Microsoft.Extensions.Options;
|
|
|
|
|
using Myshipping.Application.Entity;
|
|
|
|
|
using Myshipping.Core;
|
|
|
|
|
using Myshipping.Core.Entity;
|
|
|
|
|
using Npoi.Mapper;
|
|
|
|
|
using NPOI.OpenXmlFormats.Vml;
|
|
|
|
|
using NPOI.SS.Formula.Functions;
|
|
|
|
|
using NPOI.SS.Formula.PTG;
|
|
|
|
@ -202,6 +203,18 @@ namespace Myshipping.Application
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
await _serviceWorkFlowRunInfoRepository.InsertAsync(serviceWorkFlowRunInfo);
|
|
|
|
|
|
|
|
|
|
#region 写入运行日志
|
|
|
|
|
var runLog = serviceWorkFlowRunInfo.Adapt<ServiceWorkFlowRunLogInfo>();
|
|
|
|
|
runLog.PK_ID = IDGen.NextID().ToString();
|
|
|
|
|
runLog.RUN_ID = serviceWorkFlowRunInfo.PK_ID;
|
|
|
|
|
runLog.BATCH_NO = batchNo;
|
|
|
|
|
runLog.OPER_TYPE = TrackingRunOperTypeEnum.PUSH_PROJECT.ToString();
|
|
|
|
|
runLog.EXEC_RESULT = "SUCC";
|
|
|
|
|
runLog.EXEC_NOTE = "Insert";
|
|
|
|
|
|
|
|
|
|
await _serviceWorkFlowRunLogInfoRepository.InsertAsync(runLog);
|
|
|
|
|
#endregion
|
|
|
|
|
}
|
|
|
|
|
else if (tsk.OperType == "Update")
|
|
|
|
|
{
|
|
|
|
@ -216,6 +229,18 @@ namespace Myshipping.Application
|
|
|
|
|
it.ACT_DATE,
|
|
|
|
|
it.IS_YIELD,
|
|
|
|
|
}).ExecuteCommandAsync();
|
|
|
|
|
|
|
|
|
|
#region 写入运行日志
|
|
|
|
|
var runLog = runInfo.Adapt<ServiceWorkFlowRunLogInfo>();
|
|
|
|
|
runLog.PK_ID = IDGen.NextID().ToString();
|
|
|
|
|
runLog.RUN_ID = runInfo.PK_ID;
|
|
|
|
|
runLog.BATCH_NO = batchNo;
|
|
|
|
|
runLog.OPER_TYPE = TrackingRunOperTypeEnum.PUSH_PROJECT.ToString();
|
|
|
|
|
runLog.EXEC_RESULT = "SUCC";
|
|
|
|
|
runLog.EXEC_NOTE = "Update";
|
|
|
|
|
|
|
|
|
|
await _serviceWorkFlowRunLogInfoRepository.InsertAsync(runLog);
|
|
|
|
|
#endregion
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
@ -326,6 +351,18 @@ namespace Myshipping.Application
|
|
|
|
|
//写入run主表
|
|
|
|
|
await _serviceWorkFlowRunInfoRepository.InsertAsync(serviceWorkFlowRunInfo);
|
|
|
|
|
|
|
|
|
|
#region 写入运行日志
|
|
|
|
|
var runLog = serviceWorkFlowRunInfo.Adapt<ServiceWorkFlowRunLogInfo>();
|
|
|
|
|
runLog.PK_ID = IDGen.NextID().ToString();
|
|
|
|
|
runLog.RUN_ID = serviceWorkFlowRunInfo.PK_ID;
|
|
|
|
|
runLog.BATCH_NO = batchNo;
|
|
|
|
|
runLog.OPER_TYPE = TrackingRunOperTypeEnum.PUSH_STATUS.ToString();
|
|
|
|
|
runLog.EXEC_RESULT = "SUCC";
|
|
|
|
|
runLog.EXEC_NOTE = "Insert";
|
|
|
|
|
|
|
|
|
|
await _serviceWorkFlowRunLogInfoRepository.InsertAsync(runLog);
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
//获取状态最大数
|
|
|
|
|
int endNum = rt.StatusList.Max(sku => sku.ActSortNo);
|
|
|
|
|
|
|
|
|
@ -388,6 +425,19 @@ namespace Myshipping.Application
|
|
|
|
|
//写入run活动表
|
|
|
|
|
await _serviceWorkFlowRunActivitiesInfoRepository.InsertAsync(activitiesRunInfo);
|
|
|
|
|
|
|
|
|
|
#region 写入运行日志
|
|
|
|
|
var runLog = activitiesRunInfo.Adapt<ServiceWorkFlowRunLogInfo>();
|
|
|
|
|
runLog.PK_ID = IDGen.NextID().ToString();
|
|
|
|
|
runLog.RUN_ID = activitiesRunInfo.RUN_ID;
|
|
|
|
|
runLog.RUN_DETAIL_ID = activitiesRunInfo.PK_ID;
|
|
|
|
|
runLog.BATCH_NO = batchNo;
|
|
|
|
|
runLog.OPER_TYPE = TrackingRunOperTypeEnum.PUSH_STATUS.ToString();
|
|
|
|
|
runLog.EXEC_RESULT = "SUCC";
|
|
|
|
|
runLog.EXEC_NOTE = "Insert";
|
|
|
|
|
|
|
|
|
|
await _serviceWorkFlowRunLogInfoRepository.InsertAsync(runLog);
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
if (sku.SubStatusList != null && sku.SubStatusList.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
string lastSubActId = string.Empty;
|
|
|
|
@ -451,6 +501,19 @@ namespace Myshipping.Application
|
|
|
|
|
|
|
|
|
|
await _serviceWorkFlowRunActivitiesInfoRepository.InsertAsync(activitiesSubRunInfo);
|
|
|
|
|
|
|
|
|
|
#region 写入运行日志
|
|
|
|
|
var runLog = activitiesSubRunInfo.Adapt<ServiceWorkFlowRunLogInfo>();
|
|
|
|
|
runLog.PK_ID = IDGen.NextID().ToString();
|
|
|
|
|
runLog.RUN_ID = activitiesSubRunInfo.RUN_ID;
|
|
|
|
|
runLog.RUN_DETAIL_ID = activitiesSubRunInfo.PK_ID;
|
|
|
|
|
runLog.BATCH_NO = batchNo;
|
|
|
|
|
runLog.OPER_TYPE = TrackingRunOperTypeEnum.PUSH_STATUS.ToString();
|
|
|
|
|
runLog.EXEC_RESULT = "SUCC";
|
|
|
|
|
runLog.EXEC_NOTE = "Insert";
|
|
|
|
|
|
|
|
|
|
await _serviceWorkFlowRunLogInfoRepository.InsertAsync(runLog);
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
lastSubActId = activitiesSubRunInfo.PK_ID;
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
@ -484,6 +547,18 @@ namespace Myshipping.Application
|
|
|
|
|
it.UpdatedUserId,
|
|
|
|
|
it.UpdatedUserName
|
|
|
|
|
}).ExecuteCommandAsync();
|
|
|
|
|
|
|
|
|
|
#region 写入运行日志
|
|
|
|
|
var runLog = runEntity.Adapt<ServiceWorkFlowRunLogInfo>();
|
|
|
|
|
runLog.PK_ID = IDGen.NextID().ToString();
|
|
|
|
|
runLog.RUN_ID = runEntity.PK_ID;
|
|
|
|
|
runLog.BATCH_NO = batchNo;
|
|
|
|
|
runLog.OPER_TYPE = TrackingRunOperTypeEnum.PUSH_STATUS.ToString();
|
|
|
|
|
runLog.EXEC_RESULT = "SUCC";
|
|
|
|
|
runLog.EXEC_NOTE = "Update";
|
|
|
|
|
|
|
|
|
|
await _serviceWorkFlowRunLogInfoRepository.InsertAsync(runLog);
|
|
|
|
|
#endregion
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//批量写入活动表
|
|
|
|
@ -550,6 +625,19 @@ namespace Myshipping.Application
|
|
|
|
|
//写入run活动表
|
|
|
|
|
await _serviceWorkFlowRunActivitiesInfoRepository.InsertAsync(activitiesRunInfo);
|
|
|
|
|
|
|
|
|
|
#region 写入运行日志
|
|
|
|
|
var runLog = activitiesRunInfo.Adapt<ServiceWorkFlowRunLogInfo>();
|
|
|
|
|
runLog.PK_ID = IDGen.NextID().ToString();
|
|
|
|
|
runLog.RUN_ID = activitiesRunInfo.RUN_ID;
|
|
|
|
|
runLog.RUN_DETAIL_ID = activitiesRunInfo.PK_ID;
|
|
|
|
|
runLog.BATCH_NO = batchNo;
|
|
|
|
|
runLog.OPER_TYPE = TrackingRunOperTypeEnum.PUSH_STATUS.ToString();
|
|
|
|
|
runLog.EXEC_RESULT = "SUCC";
|
|
|
|
|
runLog.EXEC_NOTE = "Insert";
|
|
|
|
|
|
|
|
|
|
await _serviceWorkFlowRunLogInfoRepository.InsertAsync(runLog);
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
if (sku.SubStatusList != null && sku.SubStatusList.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
string lastSubActId = string.Empty;
|
|
|
|
@ -614,6 +702,19 @@ namespace Myshipping.Application
|
|
|
|
|
|
|
|
|
|
await _serviceWorkFlowRunActivitiesInfoRepository.InsertAsync(activitiesSubRunInfo);
|
|
|
|
|
|
|
|
|
|
#region 写入运行日志
|
|
|
|
|
var runLog = activitiesSubRunInfo.Adapt<ServiceWorkFlowRunLogInfo>();
|
|
|
|
|
runLog.PK_ID = IDGen.NextID().ToString();
|
|
|
|
|
runLog.RUN_ID = activitiesSubRunInfo.RUN_ID;
|
|
|
|
|
runLog.RUN_DETAIL_ID = activitiesSubRunInfo.PK_ID;
|
|
|
|
|
runLog.BATCH_NO = batchNo;
|
|
|
|
|
runLog.OPER_TYPE = TrackingRunOperTypeEnum.PUSH_STATUS.ToString();
|
|
|
|
|
runLog.EXEC_RESULT = "SUCC";
|
|
|
|
|
runLog.EXEC_NOTE = "Insert";
|
|
|
|
|
|
|
|
|
|
await _serviceWorkFlowRunLogInfoRepository.InsertAsync(runLog);
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
lastSubActId = activitiesSubRunInfo.PK_ID;
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
@ -644,6 +745,18 @@ namespace Myshipping.Application
|
|
|
|
|
it.UpdatedUserId,
|
|
|
|
|
it.UpdatedUserName
|
|
|
|
|
}).ExecuteCommandAsync();
|
|
|
|
|
|
|
|
|
|
#region 写入运行日志
|
|
|
|
|
var runLog = runEntity.Adapt<ServiceWorkFlowRunLogInfo>();
|
|
|
|
|
runLog.PK_ID = IDGen.NextID().ToString();
|
|
|
|
|
runLog.RUN_ID = runEntity.PK_ID;
|
|
|
|
|
runLog.BATCH_NO = batchNo;
|
|
|
|
|
runLog.OPER_TYPE = TrackingRunOperTypeEnum.PUSH_STATUS.ToString();
|
|
|
|
|
runLog.EXEC_RESULT = "SUCC";
|
|
|
|
|
runLog.EXEC_NOTE = "Update";
|
|
|
|
|
|
|
|
|
|
await _serviceWorkFlowRunLogInfoRepository.InsertAsync(runLog);
|
|
|
|
|
#endregion
|
|
|
|
|
}
|
|
|
|
|
//只需要更新完成标记和完成时间
|
|
|
|
|
rt.StatusList.ForEach(async sku =>
|
|
|
|
@ -694,6 +807,19 @@ namespace Myshipping.Application
|
|
|
|
|
it.UpdatedUserId,
|
|
|
|
|
it.UpdatedUserName
|
|
|
|
|
}).ExecuteCommandAsync();
|
|
|
|
|
|
|
|
|
|
#region 写入运行日志
|
|
|
|
|
var runLog = activitiesRunInfo.Adapt<ServiceWorkFlowRunLogInfo>();
|
|
|
|
|
runLog.PK_ID = IDGen.NextID().ToString();
|
|
|
|
|
runLog.RUN_ID = activitiesRunInfo.RUN_ID;
|
|
|
|
|
runLog.RUN_DETAIL_ID = activitiesRunInfo.PK_ID;
|
|
|
|
|
runLog.BATCH_NO = batchNo;
|
|
|
|
|
runLog.OPER_TYPE = TrackingRunOperTypeEnum.PUSH_STATUS.ToString();
|
|
|
|
|
runLog.EXEC_RESULT = "SUCC";
|
|
|
|
|
runLog.EXEC_NOTE = "Update";
|
|
|
|
|
|
|
|
|
|
await _serviceWorkFlowRunLogInfoRepository.InsertAsync(runLog);
|
|
|
|
|
#endregion
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (sku.SubStatusList != null && sku.SubStatusList.Count > 0)
|
|
|
|
@ -747,6 +873,19 @@ namespace Myshipping.Application
|
|
|
|
|
it.UpdatedUserId,
|
|
|
|
|
it.UpdatedUserName
|
|
|
|
|
}).ExecuteCommandAsync();
|
|
|
|
|
|
|
|
|
|
#region 写入运行日志
|
|
|
|
|
var runLog = activitiesSubRunInfo.Adapt<ServiceWorkFlowRunLogInfo>();
|
|
|
|
|
runLog.PK_ID = IDGen.NextID().ToString();
|
|
|
|
|
runLog.RUN_ID = activitiesSubRunInfo.RUN_ID;
|
|
|
|
|
runLog.RUN_DETAIL_ID = activitiesSubRunInfo.PK_ID;
|
|
|
|
|
runLog.BATCH_NO = batchNo;
|
|
|
|
|
runLog.OPER_TYPE = TrackingRunOperTypeEnum.PUSH_STATUS.ToString();
|
|
|
|
|
runLog.EXEC_RESULT = "SUCC";
|
|
|
|
|
runLog.EXEC_NOTE = "Update";
|
|
|
|
|
|
|
|
|
|
await _serviceWorkFlowRunLogInfoRepository.InsertAsync(runLog);
|
|
|
|
|
#endregion
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
@ -1533,6 +1672,7 @@ namespace Myshipping.Application
|
|
|
|
|
|
|
|
|
|
int lastWFSortNo = 0;
|
|
|
|
|
int calcNum = 1;
|
|
|
|
|
|
|
|
|
|
var resultList = statuList.Join(runList, l => l.WFPKId, r => r.WFPKId,
|
|
|
|
|
(l, r) => {
|
|
|
|
|
|
|
|
|
@ -1610,6 +1750,11 @@ namespace Myshipping.Application
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (rltList != null && rltList.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
var maxSort = rltList.Max(t => t.CalcSortNo);
|
|
|
|
|
rltList.FirstOrDefault(t => t.CalcSortNo == maxSort).IsEnd = true;
|
|
|
|
|
}
|
|
|
|
|
return rltList;
|
|
|
|
|
}).SelectMany(b => b).OrderBy(b => b.WFSortNo).Select(b => {
|
|
|
|
|
if(lastWFSortNo == 0)
|
|
|
|
|