From 131fe767b944c547d68bcb1a186c3f63726f5e21 Mon Sep 17 00:00:00 2001 From: jianghaiqing Date: Tue, 8 Aug 2023 15:36:17 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=8A=B6=E6=80=81=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Dtos/ServiceProjectWithStatusDto.cs | 10 ++++++ .../ServiceWorkFlowManageService.cs | 35 +++++++++++++++---- 2 files changed, 39 insertions(+), 6 deletions(-) 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;