From 2c07c90b2cd3e01af136e7f11001428a614ec783 Mon Sep 17 00:00:00 2001 From: jianghaiqing Date: Fri, 4 Aug 2023 18:00:54 +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=E5=8A=A0=E8=BD=BD=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BookingOrder/BookingValueAddedService.cs | 2 +- .../Dtos/ServiceProjectWithStatusDto.cs | 16 +++++ .../Dtos/ServiceWorkFlowRunDto.cs | 5 ++ .../ServiceWorkFlowManageService.cs | 64 ++++++++++++++++--- 4 files changed, 78 insertions(+), 9 deletions(-) diff --git a/Myshipping.Application/Service/BookingOrder/BookingValueAddedService.cs b/Myshipping.Application/Service/BookingOrder/BookingValueAddedService.cs index fb291819..fb3f44c9 100644 --- a/Myshipping.Application/Service/BookingOrder/BookingValueAddedService.cs +++ b/Myshipping.Application/Service/BookingOrder/BookingValueAddedService.cs @@ -2479,7 +2479,7 @@ namespace Myshipping.Application TenantId = bookingOrder.TenantId.Value }; - result = await _serviceWorkFlowManageService.GetEnableProjectList(queryInfo); + result = await _serviceWorkFlowManageService.GetEnableStatusListByBusiness(queryInfo); } else { diff --git a/Myshipping.Application/Service/TrackingSystem/Dtos/ServiceProjectWithStatusDto.cs b/Myshipping.Application/Service/TrackingSystem/Dtos/ServiceProjectWithStatusDto.cs index c81ac913..80025a59 100644 --- a/Myshipping.Application/Service/TrackingSystem/Dtos/ServiceProjectWithStatusDto.cs +++ b/Myshipping.Application/Service/TrackingSystem/Dtos/ServiceProjectWithStatusDto.cs @@ -134,6 +134,22 @@ namespace Myshipping.Application /// public bool HasChild { get; set; } = false; + /// + /// 是否已完成 + /// + public bool IsYield { get; set; } + + /// + /// 完成时间 + /// + public Nullable ActDate { get; set; } + + /// + /// 状态值 + /// + public string ActVal { get; set; } + + /// /// 子状态列表 /// diff --git a/Myshipping.Application/Service/TrackingSystem/Dtos/ServiceWorkFlowRunDto.cs b/Myshipping.Application/Service/TrackingSystem/Dtos/ServiceWorkFlowRunDto.cs index 99158850..a6216aa4 100644 --- a/Myshipping.Application/Service/TrackingSystem/Dtos/ServiceWorkFlowRunDto.cs +++ b/Myshipping.Application/Service/TrackingSystem/Dtos/ServiceWorkFlowRunDto.cs @@ -41,6 +41,11 @@ namespace Myshipping.Application /// public Nullable ActDate { get; set; } + /// + /// 流程ID + /// + public string WFPKId { get; set; } + /// /// 状态列表 /// diff --git a/Myshipping.Application/Service/TrackingSystem/ServiceWorkFlowManageService.cs b/Myshipping.Application/Service/TrackingSystem/ServiceWorkFlowManageService.cs index 9a89d39e..16c28bf6 100644 --- a/Myshipping.Application/Service/TrackingSystem/ServiceWorkFlowManageService.cs +++ b/Myshipping.Application/Service/TrackingSystem/ServiceWorkFlowManageService.cs @@ -660,6 +660,7 @@ namespace Myshipping.Application showModel.ServiceProjectName = runInfo.SERVICE_PROJECT_NAME; showModel.IsYield = runInfo.IS_YIELD; showModel.ActDate = runInfo.ACT_DATE; + showModel.WFPKId = runInfo.SERVICE_WF_ID; showModel.ActivitiesList = currList.Where(t => t.Sub.IS_SUB == 0) .Select(t => @@ -1483,13 +1484,7 @@ namespace Myshipping.Application { var statuList = await _serviceWorkFlowBaseService.GetEnableProjectWithStatusList(model.TenantId.ToString()); - var resultList = statuList.Where(a => model.ProjectCodes.Contains(a.ProjectCode)) - .OrderBy(a => a.SortNo) - .SelectMany(a => a.StatusList.OrderBy(b => b.SortNo)) - .ToList(); - - /* - TrackingQueryMessageInfo messageInfo = new TrackingQueryMessageInfo + TrackingQueryMessageInfo messageInfo = new TrackingQueryMessageInfo { Head = new TrackingMessageHeadInfo { @@ -1510,9 +1505,62 @@ namespace Myshipping.Application TenantId = model.TenantId.ToString(), } }; + //在获取运行表已有的记录 var runList = InnerGetRunListBySingleBusiness(messageInfo); - */ + + var resultList = statuList.Join(runList, l => l.WFPKId, r => r.WFPKId, + (l, r) => { + + var runInfo = r; + + var rltList = new List(); + + if (runInfo.IsYield == 1) + { + if(runInfo.ActivitiesList == null ||(runInfo.ActivitiesList != null && runInfo.ActivitiesList.Count == 0)) + { + l.StatusList.ForEach(b => { + rltList.Add(new ServiceProjectStatusDto + { + ActPKId = b.ActPKId, + ActSortNo = b.ActSortNo, + ShowName = b.ShowName, + IsYield = false + + }); + + 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 + + }).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 + }).ToList(); + } + } + + return rltList; + }).SelectMany(b=>b).ToList(); + + result.succ = true; result.ext = resultList; }