diff --git a/Myshipping.Application/Service/TrackingSystem/Dtos/ServiceProjectWithStatusDto.cs b/Myshipping.Application/Service/TrackingSystem/Dtos/ServiceProjectWithStatusDto.cs index 74edb012..3f602305 100644 --- a/Myshipping.Application/Service/TrackingSystem/Dtos/ServiceProjectWithStatusDto.cs +++ b/Myshipping.Application/Service/TrackingSystem/Dtos/ServiceProjectWithStatusDto.cs @@ -163,5 +163,15 @@ namespace Myshipping.Application /// 触发器列表 /// public List TriggerList { get; set; } + + /// + /// 分组名称 + /// + public string GroupName { get; set; } + + /// + /// 服务流程排序值 + /// + public int WFSortNo { get; set; } } } diff --git a/Myshipping.Application/Service/TrackingSystem/ServiceWorkFlowManageService.cs b/Myshipping.Application/Service/TrackingSystem/ServiceWorkFlowManageService.cs index edd4ce2d..04fcb895 100644 --- a/Myshipping.Application/Service/TrackingSystem/ServiceWorkFlowManageService.cs +++ b/Myshipping.Application/Service/TrackingSystem/ServiceWorkFlowManageService.cs @@ -1530,7 +1530,9 @@ namespace Myshipping.Application //在获取运行表已有的记录 var runList = InnerGetRunListBySingleBusiness(messageInfo); - + + int lastWFSortNo = 0; + int calcNum = 1; var resultList = statuList.Join(runList, l => l.WFPKId, r => r.WFPKId, (l, r) => { @@ -1550,7 +1552,8 @@ namespace Myshipping.Application ShowName = b.ShowName, IsYield = false, StatusSKUCode = b.StatusSKUCode, - ActRemark = b.ActRemark + ActRemark = b.ActRemark, + WFSortNo = l.SortNo }); if(b.SubStatusList != null && b.SubStatusList.Count > 0) @@ -1562,7 +1565,8 @@ namespace Myshipping.Application ShowName = c.ShowName, IsYield = false, StatusSKUCode = b.StatusSKUCode, - ActRemark = b.ActRemark + ActRemark = b.ActRemark, + WFSortNo = l.SortNo }).ToList()); } }); @@ -1578,13 +1582,32 @@ namespace Myshipping.Application ActDate = b.ActDate, ActVal = b.ActVal, StatusSKUCode = b.StatusSKUCode, - ActRemark = b.ActRemark + ActRemark = b.ActRemark, + WFSortNo = l.SortNo }).ToList(); } } - + return rltList; - }).SelectMany(b=>b).ToList(); + }).SelectMany(b => b).OrderBy(b => b.WFSortNo).Select(b => { + if(lastWFSortNo == 0) + { + b.GroupName = calcNum.ToString(); + lastWFSortNo = b.WFSortNo; + } + else if(b.WFSortNo == lastWFSortNo) + { + b.GroupName = calcNum.ToString(); + } + else + { + ++calcNum; + lastWFSortNo = b.WFSortNo; + b.GroupName = calcNum.ToString(); + } + + return b; + }).OrderBy(b => b.WFSortNo).ThenBy(b=>b.ActSortNo).ToList(); result.succ = true;