|
|
|
@ -11,6 +11,7 @@ using Myshipping.Application.Entity;
|
|
|
|
|
using Myshipping.Application.Helper;
|
|
|
|
|
using Myshipping.Core;
|
|
|
|
|
using Myshipping.Core.Entity;
|
|
|
|
|
using MySqlX.XDevAPI.Common;
|
|
|
|
|
using SqlSugar;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
@ -921,7 +922,64 @@ namespace Myshipping.Application
|
|
|
|
|
[HttpPost("/ServiceWorkFlowBase/PublishRelease")]
|
|
|
|
|
public async Task<TaskManageOrderResultDto> PublishRelease([FromBody]string[] pkIds)
|
|
|
|
|
{
|
|
|
|
|
return new TaskManageOrderResultDto();
|
|
|
|
|
TaskManageOrderResultDto result = new TaskManageOrderResultDto();
|
|
|
|
|
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
if (pkIds.Length == 0)
|
|
|
|
|
{
|
|
|
|
|
throw Oops.Oh($"服务流程主键数组不能为空", typeof(InvalidOperationException));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var list = _serviceWorkFlowBaseRepository.AsQueryable()
|
|
|
|
|
.Where(a => pkIds.Contains(a.PK_ID)).ToList();
|
|
|
|
|
|
|
|
|
|
if (list.Count == 0)
|
|
|
|
|
throw Oops.Oh($"服务流程获取失败,请服务流程信息是否存在", typeof(InvalidOperationException));
|
|
|
|
|
|
|
|
|
|
if (list.Count != pkIds.Length)
|
|
|
|
|
throw Oops.Oh($"部分服务流程获取失败,请服务流程信息是否存在", typeof(InvalidOperationException));
|
|
|
|
|
|
|
|
|
|
List<TaskManageOrderResultDto> rltList = new List<TaskManageOrderResultDto>();
|
|
|
|
|
|
|
|
|
|
//list.ForEach(pr => {
|
|
|
|
|
|
|
|
|
|
// rltList.Add(InnerExcuteServiceWF(pr, OperateTypeEnum.Delete).GetAwaiter().GetResult());
|
|
|
|
|
//});
|
|
|
|
|
|
|
|
|
|
result.succ = true;
|
|
|
|
|
result.msg = rltList.FirstOrDefault().msg;
|
|
|
|
|
|
|
|
|
|
result.ext = rltList;
|
|
|
|
|
|
|
|
|
|
var succ = rltList.Count(x => x.succ);
|
|
|
|
|
var fail = rltList.Count(x => !x.succ);
|
|
|
|
|
|
|
|
|
|
if (succ > 0)
|
|
|
|
|
{
|
|
|
|
|
result.batchTotal = succ.ToString();
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
result.batchTotal = "- ";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (fail > 0)
|
|
|
|
|
{
|
|
|
|
|
result.batchTotal += "/" + fail.ToString();
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
result.batchTotal += " -";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
result.succ = false;
|
|
|
|
|
result.msg = $"启用服务项目异常,原因:{ex.Message}";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#region 获取展示服务流程时间轴列表
|
|
|
|
|