|
|
|
@ -327,7 +327,7 @@ namespace Myshipping.Application
|
|
|
|
|
await _serviceWorkFlowRunInfoRepository.InsertAsync(serviceWorkFlowRunInfo);
|
|
|
|
|
|
|
|
|
|
//获取状态最大数
|
|
|
|
|
int endNum = rt.StatusList.Max(sku => sku.SortNo);
|
|
|
|
|
int endNum = rt.StatusList.Max(sku => sku.ActSortNo);
|
|
|
|
|
|
|
|
|
|
string lastActId = string.Empty;
|
|
|
|
|
|
|
|
|
@ -337,9 +337,9 @@ namespace Myshipping.Application
|
|
|
|
|
{
|
|
|
|
|
PK_ID = IDGen.NextID().ToString(),
|
|
|
|
|
RUN_ID = serviceWorkFlowRunInfo.PK_ID,
|
|
|
|
|
EXEC_SORT_NO = sku.SortNo,
|
|
|
|
|
IS_START = sku.SortNo == 1 ? 1 : 0,
|
|
|
|
|
IS_END = sku.SortNo == endNum ? 1 : 0,
|
|
|
|
|
EXEC_SORT_NO = sku.ActSortNo,
|
|
|
|
|
IS_START = sku.ActSortNo == 1 ? 1 : 0,
|
|
|
|
|
IS_END = sku.ActSortNo == endNum ? 1 : 0,
|
|
|
|
|
ACT_ID = sku.ActPKId,
|
|
|
|
|
STATUS_SKU_CODE = sku.StatusSKUCode,
|
|
|
|
|
STATUS_SKU_ID = sku.SkuPKId,
|
|
|
|
@ -354,7 +354,7 @@ namespace Myshipping.Application
|
|
|
|
|
TenantId = info.Main.OperTenantId,
|
|
|
|
|
TenantName = info.Main.OperTenantName,
|
|
|
|
|
IsDeleted = false,
|
|
|
|
|
SOURCE_TYPE = info.Main.SourceType.ToString(),
|
|
|
|
|
SOURCE_TYPE = info.Main.SourceType.ToString()
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
if (st.StatusCode.Equals(sku.StatusSKUCode,StringComparison.OrdinalIgnoreCase))
|
|
|
|
@ -371,6 +371,7 @@ namespace Myshipping.Application
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
activitiesRunInfo.ACT_VAL = st.StatusVal;
|
|
|
|
|
activitiesRunInfo.ACT_REMARK = st.Remark;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//写入run活动表
|
|
|
|
@ -386,9 +387,9 @@ namespace Myshipping.Application
|
|
|
|
|
{
|
|
|
|
|
PK_ID = IDGen.NextID().ToString(),
|
|
|
|
|
RUN_ID = serviceWorkFlowRunInfo.PK_ID,
|
|
|
|
|
EXEC_SORT_NO = sub.SortNo,
|
|
|
|
|
IS_START = sub.SortNo == 1 ? 1 : 0,
|
|
|
|
|
IS_END = sub.SortNo == endNum ? 1 : 0,
|
|
|
|
|
EXEC_SORT_NO = sub.ActSortNo,
|
|
|
|
|
IS_START = sub.ActSortNo == 1 ? 1 : 0,
|
|
|
|
|
IS_END = sub.ActSortNo == endNum ? 1 : 0,
|
|
|
|
|
ACT_ID = sub.ActPKId,
|
|
|
|
|
STATUS_SKU_CODE = sub.StatusSKUCode,
|
|
|
|
|
STATUS_SKU_ID = sub.SkuPKId,
|
|
|
|
@ -421,6 +422,7 @@ namespace Myshipping.Application
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
activitiesSubRunInfo.ACT_VAL = st.StatusVal;
|
|
|
|
|
activitiesSubRunInfo.ACT_REMARK = st.Remark;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!string.IsNullOrWhiteSpace(lastSubActId))
|
|
|
|
@ -437,7 +439,8 @@ namespace Myshipping.Application
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (runList.Any(b => b.Detail == null))
|
|
|
|
|
if (runList.Any(b
|
|
|
|
|
=> b.Detail == null || (b.Detail != null && string.IsNullOrWhiteSpace(b.Detail.PK_ID))))
|
|
|
|
|
{
|
|
|
|
|
var runMain = runList.FirstOrDefault().Main;
|
|
|
|
|
//需要补充活动表明细
|
|
|
|
@ -465,7 +468,7 @@ namespace Myshipping.Application
|
|
|
|
|
//批量写入活动表
|
|
|
|
|
#region 批量写入活动表
|
|
|
|
|
//获取状态最大数
|
|
|
|
|
int endNum = rt.StatusList.Max(sku => sku.SortNo);
|
|
|
|
|
int endNum = rt.StatusList.Max(sku => sku.ActSortNo);
|
|
|
|
|
|
|
|
|
|
string lastActId = string.Empty;
|
|
|
|
|
|
|
|
|
@ -475,9 +478,9 @@ namespace Myshipping.Application
|
|
|
|
|
{
|
|
|
|
|
PK_ID = IDGen.NextID().ToString(),
|
|
|
|
|
RUN_ID = runEntity.PK_ID,
|
|
|
|
|
EXEC_SORT_NO = sku.SortNo,
|
|
|
|
|
IS_START = sku.SortNo == 1 ? 1 : 0,
|
|
|
|
|
IS_END = sku.SortNo == endNum ? 1 : 0,
|
|
|
|
|
EXEC_SORT_NO = sku.ActSortNo,
|
|
|
|
|
IS_START = sku.ActSortNo == 1 ? 1 : 0,
|
|
|
|
|
IS_END = sku.ActSortNo == endNum ? 1 : 0,
|
|
|
|
|
ACT_ID = sku.ActPKId,
|
|
|
|
|
STATUS_SKU_CODE = sku.StatusSKUCode,
|
|
|
|
|
STATUS_SKU_ID = sku.SkuPKId,
|
|
|
|
@ -509,6 +512,7 @@ namespace Myshipping.Application
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
activitiesRunInfo.ACT_VAL = st.StatusVal;
|
|
|
|
|
activitiesRunInfo.ACT_REMARK = st.Remark;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//写入run活动表
|
|
|
|
@ -524,9 +528,9 @@ namespace Myshipping.Application
|
|
|
|
|
{
|
|
|
|
|
PK_ID = IDGen.NextID().ToString(),
|
|
|
|
|
RUN_ID = runEntity.PK_ID,
|
|
|
|
|
EXEC_SORT_NO = sub.SortNo,
|
|
|
|
|
IS_START = sub.SortNo == 1 ? 1 : 0,
|
|
|
|
|
IS_END = sub.SortNo == endNum ? 1 : 0,
|
|
|
|
|
EXEC_SORT_NO = sub.ActSortNo,
|
|
|
|
|
IS_START = sub.ActSortNo == 1 ? 1 : 0,
|
|
|
|
|
IS_END = sub.ActSortNo == endNum ? 1 : 0,
|
|
|
|
|
ACT_ID = sub.ActPKId,
|
|
|
|
|
STATUS_SKU_CODE = sub.StatusSKUCode,
|
|
|
|
|
STATUS_SKU_ID = sub.SkuPKId,
|
|
|
|
@ -559,6 +563,7 @@ namespace Myshipping.Application
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
activitiesSubRunInfo.ACT_VAL = st.StatusVal;
|
|
|
|
|
activitiesSubRunInfo.ACT_REMARK = st.Remark;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!string.IsNullOrWhiteSpace(lastSubActId))
|
|
|
|
@ -576,7 +581,90 @@ namespace Myshipping.Application
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
//只需要更新完成标记和完成时间
|
|
|
|
|
rt.StatusList.ForEach(async sku =>
|
|
|
|
|
{
|
|
|
|
|
var currRunDetail = runList.FirstOrDefault(p =>
|
|
|
|
|
p.Detail.STATUS_SKU_CODE.Equals(sku.StatusSKUCode)).Detail;
|
|
|
|
|
|
|
|
|
|
var activitiesRunInfo = _serviceWorkFlowRunActivitiesInfoRepository.AsQueryable()
|
|
|
|
|
.First(p=>p.PK_ID == currRunDetail.PK_ID);
|
|
|
|
|
|
|
|
|
|
if (st.StatusCode.Equals(sku.StatusSKUCode, StringComparison.OrdinalIgnoreCase))
|
|
|
|
|
{
|
|
|
|
|
activitiesRunInfo.IS_YIELD = 1;
|
|
|
|
|
|
|
|
|
|
if (st.StatusDate.HasValue)
|
|
|
|
|
{
|
|
|
|
|
activitiesRunInfo.ACT_DATE = st.StatusDate.Value;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
activitiesRunInfo.ACT_DATE = nowDate;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
activitiesRunInfo.ACT_VAL = st.StatusVal;
|
|
|
|
|
activitiesRunInfo.ACT_REMARK = st.Remark;
|
|
|
|
|
|
|
|
|
|
activitiesRunInfo.UpdatedTime = nowDate;
|
|
|
|
|
activitiesRunInfo.CreatedUserId = long.Parse(info.Main.OperUserId);
|
|
|
|
|
activitiesRunInfo.CreatedUserName = info.Main.OperUserName;
|
|
|
|
|
|
|
|
|
|
await _serviceWorkFlowRunActivitiesInfoRepository.AsUpdateable(activitiesRunInfo)
|
|
|
|
|
.UpdateColumns(it => new
|
|
|
|
|
{
|
|
|
|
|
it.ACT_DATE,
|
|
|
|
|
it.IS_YIELD,
|
|
|
|
|
it.ACT_REMARK,
|
|
|
|
|
it.UpdatedTime,
|
|
|
|
|
it.UpdatedUserId,
|
|
|
|
|
it.UpdatedUserName
|
|
|
|
|
}).ExecuteCommandAsync();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (sku.SubStatusList != null && sku.SubStatusList.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
sku.SubStatusList.ForEach(async sub => {
|
|
|
|
|
|
|
|
|
|
var currRunDetailSub = runList.FirstOrDefault(p =>
|
|
|
|
|
p.Detail.STATUS_SKU_CODE.Equals(sub.StatusSKUCode)).Detail;
|
|
|
|
|
|
|
|
|
|
var activitiesSubRunInfo = _serviceWorkFlowRunActivitiesInfoRepository.AsQueryable()
|
|
|
|
|
.First(p=> currRunDetailSub.STATUS_SKU_CODE.Equals(sub.StatusSKUCode));
|
|
|
|
|
|
|
|
|
|
if (st.StatusCode.Equals(sub.StatusSKUCode, StringComparison.OrdinalIgnoreCase))
|
|
|
|
|
{
|
|
|
|
|
activitiesSubRunInfo.IS_YIELD = 1;
|
|
|
|
|
|
|
|
|
|
if (st.StatusDate.HasValue)
|
|
|
|
|
{
|
|
|
|
|
activitiesSubRunInfo.ACT_DATE = st.StatusDate.Value;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
activitiesSubRunInfo.ACT_DATE = nowDate;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
activitiesSubRunInfo.ACT_VAL = st.StatusVal;
|
|
|
|
|
activitiesSubRunInfo.ACT_REMARK = st.Remark;
|
|
|
|
|
|
|
|
|
|
activitiesSubRunInfo.UpdatedTime = nowDate;
|
|
|
|
|
activitiesSubRunInfo.CreatedUserId = long.Parse(info.Main.OperUserId);
|
|
|
|
|
activitiesSubRunInfo.CreatedUserName = info.Main.OperUserName;
|
|
|
|
|
|
|
|
|
|
await _serviceWorkFlowRunActivitiesInfoRepository.AsUpdateable(activitiesSubRunInfo)
|
|
|
|
|
.UpdateColumns(it => new
|
|
|
|
|
{
|
|
|
|
|
it.ACT_DATE,
|
|
|
|
|
it.IS_YIELD,
|
|
|
|
|
it.ACT_REMARK,
|
|
|
|
|
it.UpdatedTime,
|
|
|
|
|
it.UpdatedUserId,
|
|
|
|
|
it.UpdatedUserName
|
|
|
|
|
}).ExecuteCommandAsync();
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
@ -639,12 +727,13 @@ namespace Myshipping.Application
|
|
|
|
|
.LeftJoin<ServiceWorkFlowRunActivitiesInfo>((m, s) => m.PK_ID == s.RUN_ID)
|
|
|
|
|
.LeftJoin<ServiceWorkFlowProjectRelation>((m, s, rela) =>
|
|
|
|
|
m.SERVICE_WF_ID == rela.SERVICE_WORKFLOW_ID && m.RELEASE_VERSION == rela.WF_VERSION)
|
|
|
|
|
.LeftJoin<ServiceProjectBaseInfo>((m, s, rela, p) =>
|
|
|
|
|
.InnerJoin<ServiceProjectBaseInfo>((m, s, rela, p) =>
|
|
|
|
|
rela.SERVICE_PROJECT_ID == p.PK_ID)
|
|
|
|
|
.Where((m, s, rela, p)
|
|
|
|
|
=> m.BUSI_SYSTEM_CODE == info.Main.BusiSystemCode && m.BUSI_ID == info.Main.BusiId &&
|
|
|
|
|
(info.Main.ServiceProjectCodeList == null || info.Main.ServiceProjectCodeList.Contains(p.SERVICE_PROJECT_CODE)))
|
|
|
|
|
.Select((m, s) => new { Run = m, Sub = s }).ToList();
|
|
|
|
|
.Select((m, s,rela,p) =>
|
|
|
|
|
new { Run = m, Sub = s }).ToList();
|
|
|
|
|
|
|
|
|
|
var resultList = runList.GroupBy(a => a.Run.PK_ID)
|
|
|
|
|
.Select(a => {
|
|
|
|
@ -662,7 +751,8 @@ namespace Myshipping.Application
|
|
|
|
|
showModel.ActDate = runInfo.ACT_DATE;
|
|
|
|
|
showModel.WFPKId = runInfo.SERVICE_WF_ID;
|
|
|
|
|
|
|
|
|
|
showModel.ActivitiesList = currList.Where(t => t.Sub.IS_SUB == 0)
|
|
|
|
|
showModel.ActivitiesList = currList.Where(t =>
|
|
|
|
|
!string.IsNullOrWhiteSpace(t.Sub.PK_ID) && t.Sub.IS_SUB == 0)
|
|
|
|
|
.Select(t =>
|
|
|
|
|
{
|
|
|
|
|
var runModel = new ServiceWorkFlowActivitiesRunDto
|
|
|
|
@ -679,14 +769,16 @@ namespace Myshipping.Application
|
|
|
|
|
ShowName = t.Sub.SHOW_NAME,
|
|
|
|
|
SourceType = t.Sub.SOURCE_TYPE,
|
|
|
|
|
StatusSKUCode = t.Sub.STATUS_SKU_CODE,
|
|
|
|
|
StatusSKUId = t.Sub.STATUS_SKU_ID
|
|
|
|
|
StatusSKUId = t.Sub.STATUS_SKU_ID,
|
|
|
|
|
ActRemark = t.Sub.ACT_REMARK,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
return runModel;
|
|
|
|
|
}).ToList();
|
|
|
|
|
|
|
|
|
|
var subList =
|
|
|
|
|
currList.Where(t => t.Sub.IS_SUB == 1)
|
|
|
|
|
currList.Where(t =>
|
|
|
|
|
!string.IsNullOrWhiteSpace(t.Sub.PK_ID) && t.Sub.IS_SUB == 1)
|
|
|
|
|
.Select(t => t.Sub).ToList();
|
|
|
|
|
|
|
|
|
|
showModel.ActivitiesList = showModel.ActivitiesList.GroupJoin(subList,
|
|
|
|
@ -713,7 +805,8 @@ namespace Myshipping.Application
|
|
|
|
|
ShowName = x.SHOW_NAME,
|
|
|
|
|
SourceType = x.SOURCE_TYPE,
|
|
|
|
|
StatusSKUCode = x.STATUS_SKU_CODE,
|
|
|
|
|
StatusSKUId = x.STATUS_SKU_ID
|
|
|
|
|
StatusSKUId = x.STATUS_SKU_ID,
|
|
|
|
|
ActRemark = x.ACT_REMARK
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
return subModel;
|
|
|
|
@ -1526,8 +1619,9 @@ namespace Myshipping.Application
|
|
|
|
|
ActPKId = b.ActPKId,
|
|
|
|
|
ActSortNo = b.ActSortNo,
|
|
|
|
|
ShowName = b.ShowName,
|
|
|
|
|
IsYield = false
|
|
|
|
|
|
|
|
|
|
IsYield = false,
|
|
|
|
|
StatusSKUCode = b.StatusSKUCode,
|
|
|
|
|
ActRemark = b.ActRemark
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
if(b.SubStatusList != null && b.SubStatusList.Count > 0)
|
|
|
|
@ -1537,8 +1631,9 @@ namespace Myshipping.Application
|
|
|
|
|
ActPKId = c.ActPKId,
|
|
|
|
|
ActSortNo = c.ActSortNo,
|
|
|
|
|
ShowName = c.ShowName,
|
|
|
|
|
IsYield = false
|
|
|
|
|
|
|
|
|
|
IsYield = false,
|
|
|
|
|
StatusSKUCode = b.StatusSKUCode,
|
|
|
|
|
ActRemark = b.ActRemark
|
|
|
|
|
}).ToList());
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
@ -1552,7 +1647,9 @@ namespace Myshipping.Application
|
|
|
|
|
ShowName = b.ShowName,
|
|
|
|
|
IsYield = b.IsYield == 1 ? true : false,
|
|
|
|
|
ActDate = b.ActDate,
|
|
|
|
|
ActVal = b.ActVal
|
|
|
|
|
ActVal = b.ActVal,
|
|
|
|
|
StatusSKUCode = b.StatusSKUCode,
|
|
|
|
|
ActRemark = b.ActRemark
|
|
|
|
|
}).ToList();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|