修改服务状态加载方法

optimize
jianghaiqing 1 year ago
parent e819764f3b
commit 2c07c90b2c

@ -2479,7 +2479,7 @@ namespace Myshipping.Application
TenantId = bookingOrder.TenantId.Value TenantId = bookingOrder.TenantId.Value
}; };
result = await _serviceWorkFlowManageService.GetEnableProjectList(queryInfo); result = await _serviceWorkFlowManageService.GetEnableStatusListByBusiness(queryInfo);
} }
else else
{ {

@ -134,6 +134,22 @@ namespace Myshipping.Application
/// </summary> /// </summary>
public bool HasChild { get; set; } = false; public bool HasChild { get; set; } = false;
/// <summary>
/// 是否已完成
/// </summary>
public bool IsYield { get; set; }
/// <summary>
/// 完成时间
/// </summary>
public Nullable<DateTime> ActDate { get; set; }
/// <summary>
/// 状态值
/// </summary>
public string ActVal { get; set; }
/// <summary> /// <summary>
/// 子状态列表 /// 子状态列表
/// </summary> /// </summary>

@ -41,6 +41,11 @@ namespace Myshipping.Application
/// </summary> /// </summary>
public Nullable<DateTime> ActDate { get; set; } public Nullable<DateTime> ActDate { get; set; }
/// <summary>
/// 流程ID
/// </summary>
public string WFPKId { get; set; }
/// <summary> /// <summary>
/// 状态列表 /// 状态列表
/// </summary> /// </summary>

@ -660,6 +660,7 @@ namespace Myshipping.Application
showModel.ServiceProjectName = runInfo.SERVICE_PROJECT_NAME; showModel.ServiceProjectName = runInfo.SERVICE_PROJECT_NAME;
showModel.IsYield = runInfo.IS_YIELD; showModel.IsYield = runInfo.IS_YIELD;
showModel.ActDate = runInfo.ACT_DATE; showModel.ActDate = runInfo.ACT_DATE;
showModel.WFPKId = runInfo.SERVICE_WF_ID;
showModel.ActivitiesList = currList.Where(t => t.Sub.IS_SUB == 0) showModel.ActivitiesList = currList.Where(t => t.Sub.IS_SUB == 0)
.Select(t => .Select(t =>
@ -1483,12 +1484,6 @@ namespace Myshipping.Application
{ {
var statuList = await _serviceWorkFlowBaseService.GetEnableProjectWithStatusList(model.TenantId.ToString()); 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 Head = new TrackingMessageHeadInfo
@ -1510,9 +1505,62 @@ namespace Myshipping.Application
TenantId = model.TenantId.ToString(), TenantId = model.TenantId.ToString(),
} }
}; };
//在获取运行表已有的记录 //在获取运行表已有的记录
var runList = InnerGetRunListBySingleBusiness(messageInfo); var runList = InnerGetRunListBySingleBusiness(messageInfo);
*/
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))
{
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.succ = true;
result.ext = resultList; result.ext = resultList;
} }

Loading…
Cancel
Save