|
|
|
@ -2003,29 +2003,84 @@ namespace Myshipping.Application
|
|
|
|
|
int lastWFSortNo = 0;
|
|
|
|
|
int calcNum = 1;
|
|
|
|
|
|
|
|
|
|
var allStatus = statuList.SelectMany(b => {
|
|
|
|
|
var curArg = b.StatusList.SelectMany(x => x.SubStatusList).ToList();
|
|
|
|
|
//var allStatus = statuList.SelectMany(b => {
|
|
|
|
|
// var curArg = b.StatusList.SelectMany(x => x.SubStatusList).ToList();
|
|
|
|
|
|
|
|
|
|
if (curArg == null)
|
|
|
|
|
curArg = new List<ServiceProjectStatusDto>();
|
|
|
|
|
// if (curArg == null)
|
|
|
|
|
// curArg = new List<ServiceProjectStatusDto>();
|
|
|
|
|
|
|
|
|
|
curArg.AddRange(b.StatusList);
|
|
|
|
|
// curArg.AddRange(b.StatusList);
|
|
|
|
|
|
|
|
|
|
return curArg;
|
|
|
|
|
}).ToList();
|
|
|
|
|
// return curArg;
|
|
|
|
|
//}).ToList();
|
|
|
|
|
|
|
|
|
|
var resultList = statuList.Join(runList, l => l.WFPKId, r => r.WFPKId,
|
|
|
|
|
var resultList = statuList.Join(runList, l => l.WFPKId,
|
|
|
|
|
r => r.WFPKId,
|
|
|
|
|
(l, r) => {
|
|
|
|
|
|
|
|
|
|
var runInfo = r;
|
|
|
|
|
|
|
|
|
|
var rltList = new List<ServiceProjectStatusDto>();
|
|
|
|
|
|
|
|
|
|
if (runInfo.IsYield == 1)
|
|
|
|
|
if (runInfo.ActivitiesList == null || (runInfo.ActivitiesList != null && runInfo.ActivitiesList.Count == 0))
|
|
|
|
|
{
|
|
|
|
|
if(runInfo.ActivitiesList == null ||(runInfo.ActivitiesList != null && runInfo.ActivitiesList.Count == 0))
|
|
|
|
|
{
|
|
|
|
|
l.StatusList.ForEach(b => {
|
|
|
|
|
l.StatusList.ForEach(b => {
|
|
|
|
|
rltList.Add(new ServiceProjectStatusDto
|
|
|
|
|
{
|
|
|
|
|
ActPKId = b.ActPKId,
|
|
|
|
|
ActSortNo = b.ActSortNo,
|
|
|
|
|
ShowName = b.ShowName,
|
|
|
|
|
IsYield = false,
|
|
|
|
|
StatusSKUCode = b.StatusSKUCode,
|
|
|
|
|
ActRemark = b.ActRemark,
|
|
|
|
|
WFSortNo = l.SortNo,
|
|
|
|
|
CalcSortNo = (decimal)b.ActSortNo,
|
|
|
|
|
SortNo = b.SortNo
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
if (b.SubStatusList != null && b.SubStatusList.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
rltList.AddRange(b.SubStatusList.Select(c => new ServiceProjectStatusDto
|
|
|
|
|
{
|
|
|
|
|
ActPKId = c.ActPKId,
|
|
|
|
|
ActSortNo = c.ActSortNo,
|
|
|
|
|
ShowName = c.ShowName,
|
|
|
|
|
IsYield = false,
|
|
|
|
|
StatusSKUCode = c.StatusSKUCode,
|
|
|
|
|
ActRemark = c.ActRemark,
|
|
|
|
|
WFSortNo = l.SortNo,
|
|
|
|
|
CalcSortNo = (decimal)b.ActSortNo + (c.ActSortNo * 0.001m),
|
|
|
|
|
SortNo = c.SortNo
|
|
|
|
|
}).ToList());
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
l.StatusList.ForEach(b => {
|
|
|
|
|
|
|
|
|
|
var eRunInfo = runInfo.ActivitiesList
|
|
|
|
|
.FirstOrDefault(p => p.ActId == b.ActPKId);
|
|
|
|
|
|
|
|
|
|
if(eRunInfo != null)
|
|
|
|
|
{
|
|
|
|
|
rltList.Add(new ServiceProjectStatusDto
|
|
|
|
|
{
|
|
|
|
|
ActPKId = eRunInfo.ActId,
|
|
|
|
|
ActSortNo = eRunInfo.ExecSortNo,
|
|
|
|
|
ShowName = eRunInfo.ShowName,
|
|
|
|
|
IsYield = eRunInfo.IsYield == 1 ? true : false,
|
|
|
|
|
StatusSKUCode = eRunInfo.StatusSKUCode,
|
|
|
|
|
ActDate = eRunInfo.ActDate,
|
|
|
|
|
ActVal = eRunInfo.ActVal,
|
|
|
|
|
ActRemark = eRunInfo.ActRemark,
|
|
|
|
|
WFSortNo = l.SortNo,
|
|
|
|
|
CalcSortNo = (decimal)eRunInfo.ExecSortNo,
|
|
|
|
|
SortNo = b.SortNo
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
rltList.Add(new ServiceProjectStatusDto
|
|
|
|
|
{
|
|
|
|
|
ActPKId = b.ActPKId,
|
|
|
|
@ -2038,69 +2093,49 @@ namespace Myshipping.Application
|
|
|
|
|
CalcSortNo = (decimal)b.ActSortNo,
|
|
|
|
|
SortNo = b.SortNo
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(b.SubStatusList != null && b.SubStatusList.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
rltList.AddRange(b.SubStatusList.Select(c => new ServiceProjectStatusDto
|
|
|
|
|
{
|
|
|
|
|
ActPKId = c.ActPKId,
|
|
|
|
|
ActSortNo = c.ActSortNo,
|
|
|
|
|
ShowName = c.ShowName,
|
|
|
|
|
IsYield = false,
|
|
|
|
|
StatusSKUCode = c.StatusSKUCode,
|
|
|
|
|
ActRemark = c.ActRemark,
|
|
|
|
|
WFSortNo = l.SortNo,
|
|
|
|
|
CalcSortNo = (decimal)b.ActSortNo + (c.ActSortNo * 0.001m),
|
|
|
|
|
SortNo = c.SortNo
|
|
|
|
|
}).ToList());
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
runInfo.ActivitiesList.ForEach(b => {
|
|
|
|
|
var pSkuInfo = allStatus.FirstOrDefault(x => x.SkuPKId == b.StatusSKUId);
|
|
|
|
|
|
|
|
|
|
rltList.Add(new ServiceProjectStatusDto
|
|
|
|
|
{
|
|
|
|
|
ActPKId = b.ActId,
|
|
|
|
|
ActSortNo = b.ExecSortNo,
|
|
|
|
|
ShowName = b.ShowName,
|
|
|
|
|
IsYield = b.IsYield == 1 ? true : false,
|
|
|
|
|
ActDate = b.ActDate,
|
|
|
|
|
ActVal = b.ActVal,
|
|
|
|
|
StatusSKUCode = b.StatusSKUCode,
|
|
|
|
|
ActRemark = b.ActRemark,
|
|
|
|
|
WFSortNo = l.SortNo,
|
|
|
|
|
CalcSortNo = (decimal)b.ExecSortNo,
|
|
|
|
|
SortNo = pSkuInfo != null? pSkuInfo.SortNo:0,
|
|
|
|
|
});
|
|
|
|
|
if (b.SubStatusList != null && b.SubStatusList.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
b.SubStatusList.ForEach(sb => {
|
|
|
|
|
var eSubRunInfo = runInfo.ActivitiesList
|
|
|
|
|
.FirstOrDefault(p => p.ActId == sb.ActPKId);
|
|
|
|
|
|
|
|
|
|
if (b.SubList != null && b.SubList.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
b.SubList.ForEach(c =>
|
|
|
|
|
if(eSubRunInfo != null)
|
|
|
|
|
{
|
|
|
|
|
var subSkuInfo = allStatus.FirstOrDefault(x => x.SkuPKId == c.StatusSKUId);
|
|
|
|
|
|
|
|
|
|
rltList.Add(new ServiceProjectStatusDto
|
|
|
|
|
{
|
|
|
|
|
ActPKId = c.ActId,
|
|
|
|
|
ActSortNo = c.ExecSortNo,
|
|
|
|
|
ShowName = c.ShowName,
|
|
|
|
|
IsYield = c.IsYield == 1 ? true : false,
|
|
|
|
|
ActDate = c.ActDate,
|
|
|
|
|
ActVal = c.ActVal,
|
|
|
|
|
StatusSKUCode = c.StatusSKUCode,
|
|
|
|
|
ActRemark = c.ActRemark,
|
|
|
|
|
ActPKId = eSubRunInfo.ActId,
|
|
|
|
|
ActSortNo = eSubRunInfo.ExecSortNo,
|
|
|
|
|
ShowName = eSubRunInfo.ShowName,
|
|
|
|
|
IsYield = eSubRunInfo.IsYield == 1 ? true : false,
|
|
|
|
|
StatusSKUCode = eSubRunInfo.StatusSKUCode,
|
|
|
|
|
ActDate = eSubRunInfo.ActDate,
|
|
|
|
|
ActVal = eSubRunInfo.ActVal,
|
|
|
|
|
ActRemark = eSubRunInfo.ActRemark,
|
|
|
|
|
WFSortNo = l.SortNo,
|
|
|
|
|
CalcSortNo = (decimal)b.ExecSortNo + (c.ExecSortNo * 0.001m),
|
|
|
|
|
SortNo = subSkuInfo.SortNo
|
|
|
|
|
CalcSortNo = (decimal)eSubRunInfo.ExecSortNo,
|
|
|
|
|
SortNo = sb.SortNo
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
rltList.Add(new ServiceProjectStatusDto
|
|
|
|
|
{
|
|
|
|
|
ActPKId = sb.ActPKId,
|
|
|
|
|
ActSortNo = sb.ActSortNo,
|
|
|
|
|
ShowName = sb.ShowName,
|
|
|
|
|
IsYield = false,
|
|
|
|
|
StatusSKUCode = sb.StatusSKUCode,
|
|
|
|
|
ActRemark = sb.ActRemark,
|
|
|
|
|
WFSortNo = l.SortNo,
|
|
|
|
|
CalcSortNo = (decimal)b.ActSortNo + (sb.ActSortNo * 0.001m),
|
|
|
|
|
SortNo = sb.SortNo
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (rltList != null && rltList.Count > 0)
|
|
|
|
|