|
|
@ -12,6 +12,7 @@ using Microsoft.Extensions.Options;
|
|
|
|
using Myshipping.Application.Entity;
|
|
|
|
using Myshipping.Application.Entity;
|
|
|
|
using Myshipping.Core;
|
|
|
|
using Myshipping.Core;
|
|
|
|
using Myshipping.Core.Entity;
|
|
|
|
using Myshipping.Core.Entity;
|
|
|
|
|
|
|
|
using Npoi.Mapper;
|
|
|
|
using NPOI.OpenXmlFormats.Vml;
|
|
|
|
using NPOI.OpenXmlFormats.Vml;
|
|
|
|
using NPOI.SS.Formula.Functions;
|
|
|
|
using NPOI.SS.Formula.Functions;
|
|
|
|
using NPOI.SS.Formula.PTG;
|
|
|
|
using NPOI.SS.Formula.PTG;
|
|
|
@ -202,6 +203,18 @@ namespace Myshipping.Application
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
await _serviceWorkFlowRunInfoRepository.InsertAsync(serviceWorkFlowRunInfo);
|
|
|
|
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")
|
|
|
|
else if (tsk.OperType == "Update")
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -216,6 +229,18 @@ namespace Myshipping.Application
|
|
|
|
it.ACT_DATE,
|
|
|
|
it.ACT_DATE,
|
|
|
|
it.IS_YIELD,
|
|
|
|
it.IS_YIELD,
|
|
|
|
}).ExecuteCommandAsync();
|
|
|
|
}).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主表
|
|
|
|
//写入run主表
|
|
|
|
await _serviceWorkFlowRunInfoRepository.InsertAsync(serviceWorkFlowRunInfo);
|
|
|
|
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);
|
|
|
|
int endNum = rt.StatusList.Max(sku => sku.ActSortNo);
|
|
|
|
|
|
|
|
|
|
|
@ -388,6 +425,19 @@ namespace Myshipping.Application
|
|
|
|
//写入run活动表
|
|
|
|
//写入run活动表
|
|
|
|
await _serviceWorkFlowRunActivitiesInfoRepository.InsertAsync(activitiesRunInfo);
|
|
|
|
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)
|
|
|
|
if (sku.SubStatusList != null && sku.SubStatusList.Count > 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
string lastSubActId = string.Empty;
|
|
|
|
string lastSubActId = string.Empty;
|
|
|
@ -451,6 +501,19 @@ namespace Myshipping.Application
|
|
|
|
|
|
|
|
|
|
|
|
await _serviceWorkFlowRunActivitiesInfoRepository.InsertAsync(activitiesSubRunInfo);
|
|
|
|
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;
|
|
|
|
lastSubActId = activitiesSubRunInfo.PK_ID;
|
|
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
@ -484,6 +547,18 @@ namespace Myshipping.Application
|
|
|
|
it.UpdatedUserId,
|
|
|
|
it.UpdatedUserId,
|
|
|
|
it.UpdatedUserName
|
|
|
|
it.UpdatedUserName
|
|
|
|
}).ExecuteCommandAsync();
|
|
|
|
}).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活动表
|
|
|
|
//写入run活动表
|
|
|
|
await _serviceWorkFlowRunActivitiesInfoRepository.InsertAsync(activitiesRunInfo);
|
|
|
|
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)
|
|
|
|
if (sku.SubStatusList != null && sku.SubStatusList.Count > 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
string lastSubActId = string.Empty;
|
|
|
|
string lastSubActId = string.Empty;
|
|
|
@ -614,6 +702,19 @@ namespace Myshipping.Application
|
|
|
|
|
|
|
|
|
|
|
|
await _serviceWorkFlowRunActivitiesInfoRepository.InsertAsync(activitiesSubRunInfo);
|
|
|
|
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;
|
|
|
|
lastSubActId = activitiesSubRunInfo.PK_ID;
|
|
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
@ -644,6 +745,18 @@ namespace Myshipping.Application
|
|
|
|
it.UpdatedUserId,
|
|
|
|
it.UpdatedUserId,
|
|
|
|
it.UpdatedUserName
|
|
|
|
it.UpdatedUserName
|
|
|
|
}).ExecuteCommandAsync();
|
|
|
|
}).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 =>
|
|
|
|
rt.StatusList.ForEach(async sku =>
|
|
|
@ -694,6 +807,19 @@ namespace Myshipping.Application
|
|
|
|
it.UpdatedUserId,
|
|
|
|
it.UpdatedUserId,
|
|
|
|
it.UpdatedUserName
|
|
|
|
it.UpdatedUserName
|
|
|
|
}).ExecuteCommandAsync();
|
|
|
|
}).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)
|
|
|
|
if (sku.SubStatusList != null && sku.SubStatusList.Count > 0)
|
|
|
@ -747,6 +873,19 @@ namespace Myshipping.Application
|
|
|
|
it.UpdatedUserId,
|
|
|
|
it.UpdatedUserId,
|
|
|
|
it.UpdatedUserName
|
|
|
|
it.UpdatedUserName
|
|
|
|
}).ExecuteCommandAsync();
|
|
|
|
}).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 lastWFSortNo = 0;
|
|
|
|
int calcNum = 1;
|
|
|
|
int calcNum = 1;
|
|
|
|
|
|
|
|
|
|
|
|
var resultList = statuList.Join(runList, l => l.WFPKId, r => r.WFPKId,
|
|
|
|
var resultList = statuList.Join(runList, l => l.WFPKId, r => r.WFPKId,
|
|
|
|
(l, r) => {
|
|
|
|
(l, r) => {
|
|
|
|
|
|
|
|
|
|
|
@ -1609,7 +1749,12 @@ 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;
|
|
|
|
return rltList;
|
|
|
|
}).SelectMany(b => b).OrderBy(b => b.WFSortNo).Select(b => {
|
|
|
|
}).SelectMany(b => b).OrderBy(b => b.WFSortNo).Select(b => {
|
|
|
|
if(lastWFSortNo == 0)
|
|
|
|
if(lastWFSortNo == 0)
|
|
|
|