From 16904ad985977f8007386a23741018dedc964256 Mon Sep 17 00:00:00 2001 From: jianghaiqing Date: Tue, 8 Aug 2023 16:02:06 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=9C=8D=E5=8A=A1=E7=8A=B6?= =?UTF-8?q?=E6=80=81=E8=8E=B7=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Dtos/ServiceProjectWithStatusDto.cs | 5 ++ .../ServiceWorkFlowManageService.cs | 52 +++++++++++++------ 2 files changed, 42 insertions(+), 15 deletions(-) diff --git a/Myshipping.Application/Service/TrackingSystem/Dtos/ServiceProjectWithStatusDto.cs b/Myshipping.Application/Service/TrackingSystem/Dtos/ServiceProjectWithStatusDto.cs index 3f602305..1afd351f 100644 --- a/Myshipping.Application/Service/TrackingSystem/Dtos/ServiceProjectWithStatusDto.cs +++ b/Myshipping.Application/Service/TrackingSystem/Dtos/ServiceProjectWithStatusDto.cs @@ -173,5 +173,10 @@ namespace Myshipping.Application /// 服务流程排序值 /// public int WFSortNo { get; set; } + + /// + /// 计算排序值 + /// + public decimal CalcSortNo { get; set; } } } diff --git a/Myshipping.Application/Service/TrackingSystem/ServiceWorkFlowManageService.cs b/Myshipping.Application/Service/TrackingSystem/ServiceWorkFlowManageService.cs index 04fcb895..dc8fe111 100644 --- a/Myshipping.Application/Service/TrackingSystem/ServiceWorkFlowManageService.cs +++ b/Myshipping.Application/Service/TrackingSystem/ServiceWorkFlowManageService.cs @@ -1553,7 +1553,8 @@ namespace Myshipping.Application IsYield = false, StatusSKUCode = b.StatusSKUCode, ActRemark = b.ActRemark, - WFSortNo = l.SortNo + WFSortNo = l.SortNo, + CalcSortNo = (decimal)b.ActSortNo, }); if(b.SubStatusList != null && b.SubStatusList.Count > 0) @@ -1566,25 +1567,46 @@ namespace Myshipping.Application IsYield = false, StatusSKUCode = b.StatusSKUCode, ActRemark = b.ActRemark, - WFSortNo = l.SortNo + WFSortNo = l.SortNo, + CalcSortNo = (decimal)b.ActSortNo + (c.ActSortNo * 0.001m) }).ToList()); } }); } else { - rltList = runInfo.ActivitiesList.Select(b => 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 - }).ToList(); + runInfo.ActivitiesList.ForEach(b => { + 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 + }); + + if (b.SubList != null && b.SubList.Count > 0) + { + rltList.AddRange(b.SubList.Select(c => 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, + WFSortNo = l.SortNo, + CalcSortNo = (decimal)b.ExecSortNo + (c.ExecSortNo * 0.001m) + }).ToList()); + } + }); } } @@ -1607,7 +1629,7 @@ namespace Myshipping.Application } return b; - }).OrderBy(b => b.WFSortNo).ThenBy(b=>b.ActSortNo).ToList(); + }).OrderBy(b => b.WFSortNo).ThenBy(b=>b.CalcSortNo).ToList(); result.succ = true;