|
|
@ -1,4 +1,5 @@
|
|
|
|
using Furion.DependencyInjection;
|
|
|
|
using Furion.ClayObject.Extensions;
|
|
|
|
|
|
|
|
using Furion.DependencyInjection;
|
|
|
|
using Furion.DistributedIDGenerator;
|
|
|
|
using Furion.DistributedIDGenerator;
|
|
|
|
using Furion.DynamicApiController;
|
|
|
|
using Furion.DynamicApiController;
|
|
|
|
using Furion.FriendlyException;
|
|
|
|
using Furion.FriendlyException;
|
|
|
@ -6,10 +7,12 @@ using Furion.JsonSerialization;
|
|
|
|
using Microsoft.AspNetCore.Authorization;
|
|
|
|
using Microsoft.AspNetCore.Authorization;
|
|
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
using Microsoft.Extensions.Logging;
|
|
|
|
using Microsoft.Extensions.Logging;
|
|
|
|
|
|
|
|
using Myshipping.Core;
|
|
|
|
using StackExchange.Profiling.Internal;
|
|
|
|
using StackExchange.Profiling.Internal;
|
|
|
|
using System;
|
|
|
|
using System;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using System.Linq;
|
|
|
|
using System.Linq;
|
|
|
|
|
|
|
|
using System.Reflection.Emit;
|
|
|
|
using System.Text;
|
|
|
|
using System.Text;
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
|
@ -23,23 +26,26 @@ namespace Myshipping.Application
|
|
|
|
public class EmbedProjectGoodsStatusService: IEmbedProjectGoodsStatusService, IDynamicApiController, ITransient
|
|
|
|
public class EmbedProjectGoodsStatusService: IEmbedProjectGoodsStatusService, IDynamicApiController, ITransient
|
|
|
|
{
|
|
|
|
{
|
|
|
|
private readonly ILogger<BookingTruckService> _logger;
|
|
|
|
private readonly ILogger<BookingTruckService> _logger;
|
|
|
|
|
|
|
|
private readonly IServiceWorkFlowManageService _serviceWorkFlowManageService;
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
///
|
|
|
|
///
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="logger"></param>
|
|
|
|
/// <param name="logger"></param>
|
|
|
|
public EmbedProjectGoodsStatusService(ILogger<BookingTruckService> logger)
|
|
|
|
public EmbedProjectGoodsStatusService(ILogger<BookingTruckService> logger, IServiceWorkFlowManageService serviceWorkFlowManageService)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
_logger = logger;
|
|
|
|
_logger = logger;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_serviceWorkFlowManageService = serviceWorkFlowManageService;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#region 保存服务项目
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
/// 保存服务项目
|
|
|
|
/// 保存服务项目
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="model">修改服务项目详情</param>
|
|
|
|
/// <param name="model">修改服务项目详情</param>
|
|
|
|
/// <returns>返回回执</returns>
|
|
|
|
/// <returns>返回回执</returns>
|
|
|
|
[HttpPost("/EmbedProjectGoodsStatus/SaveServiceProject")]
|
|
|
|
[AllowAnonymous, HttpPost("/EmbedProjectGoodsStatus/SaveServiceProject"), ApiUser(ApiCode = "EmbedServiceProjectStatus")]
|
|
|
|
public async Task<TaskManageOrderResultDto> SaveServiceProject(EmbedServiceProjectDto model)
|
|
|
|
public async Task<TaskManageOrderResultDto> SaveServiceProject(EmbedServiceProjectDto model)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
TaskManageOrderResultDto result = new TaskManageOrderResultDto();
|
|
|
|
TaskManageOrderResultDto result = new TaskManageOrderResultDto();
|
|
|
@ -75,11 +81,11 @@ namespace Myshipping.Application
|
|
|
|
VesselVoyno = "",
|
|
|
|
VesselVoyno = "",
|
|
|
|
OrderNo = "",
|
|
|
|
OrderNo = "",
|
|
|
|
PushType = TrackingPushTypeEnum.Project,
|
|
|
|
PushType = TrackingPushTypeEnum.Project,
|
|
|
|
OperTenantId = 0,
|
|
|
|
OperTenantId = UserManager.TENANT_ID,
|
|
|
|
OperTenantName = "",
|
|
|
|
OperTenantName = UserManager.TENANT_NAME,
|
|
|
|
OpertType = TrackingOperTypeEnum.MANUAL,
|
|
|
|
OpertType = model.OpertType,
|
|
|
|
OperUserId = "",
|
|
|
|
OperUserId = UserManager.UserId.ToString(),
|
|
|
|
OperUserName = "",
|
|
|
|
OperUserName = UserManager.Name,
|
|
|
|
SourceType = TrackingSourceTypeEnum.MANUAL,
|
|
|
|
SourceType = TrackingSourceTypeEnum.MANUAL,
|
|
|
|
ProjectList = model.ProjectCodes.Select(a => new TrackingMessageMainProjectInfo
|
|
|
|
ProjectList = model.ProjectCodes.Select(a => new TrackingMessageMainProjectInfo
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -92,24 +98,24 @@ namespace Myshipping.Application
|
|
|
|
|
|
|
|
|
|
|
|
_logger.LogInformation("批次={no} 推送保存服务项目 msg={msg}", batchNo, JSON.Serialize(msgInfo));
|
|
|
|
_logger.LogInformation("批次={no} 推送保存服务项目 msg={msg}", batchNo, JSON.Serialize(msgInfo));
|
|
|
|
|
|
|
|
|
|
|
|
//var rlt = await _serviceWorkFlowManageService.PushStatus(msgInfo);
|
|
|
|
var rlt = await _serviceWorkFlowManageService.PushStatus(msgInfo);
|
|
|
|
|
|
|
|
|
|
|
|
//DateTime eDate = DateTime.Now;
|
|
|
|
DateTime eDate = DateTime.Now;
|
|
|
|
//TimeSpan ts = eDate.Subtract(bDate);
|
|
|
|
TimeSpan ts = eDate.Subtract(bDate);
|
|
|
|
//var timeDiff = ts.TotalMilliseconds;
|
|
|
|
var timeDiff = ts.TotalMilliseconds;
|
|
|
|
|
|
|
|
|
|
|
|
//_logger.LogInformation("批次={no} 请求完成,耗时:{timeDiff}ms. 结果{msg} result={rlt}", batchNo, timeDiff, (rlt.succ ? "成功" : "失败")
|
|
|
|
_logger.LogInformation("批次={no} 请求完成,耗时:{timeDiff}ms. 结果{msg} result={rlt}", batchNo, timeDiff, (rlt.succ ? "成功" : "失败")
|
|
|
|
// , JSON.Serialize(rlt));
|
|
|
|
, JSON.Serialize(rlt));
|
|
|
|
|
|
|
|
|
|
|
|
//if (!rlt.succ)
|
|
|
|
if (!rlt.succ)
|
|
|
|
//{
|
|
|
|
{
|
|
|
|
// result = rlt;
|
|
|
|
result = rlt;
|
|
|
|
//}
|
|
|
|
}
|
|
|
|
//else
|
|
|
|
else
|
|
|
|
//{
|
|
|
|
{
|
|
|
|
// result.succ = true;
|
|
|
|
result.succ = true;
|
|
|
|
// result.msg = "保存成功";
|
|
|
|
result.msg = "保存成功";
|
|
|
|
//}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
catch (Exception ex)
|
|
|
|
catch (Exception ex)
|
|
|
@ -120,56 +126,377 @@ namespace Myshipping.Application
|
|
|
|
|
|
|
|
|
|
|
|
return result;
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#region 取消服务项目
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
/// 取消服务项目
|
|
|
|
/// 取消服务项目
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="model">修改服务项目详情</param>
|
|
|
|
/// <param name="model">修改服务项目详情</param>
|
|
|
|
/// <returns>返回回执</returns>
|
|
|
|
/// <returns>返回回执</returns>
|
|
|
|
public async Task<TaskManageOrderResultDto> CancelServiceProject(ModifyServiceProjectDto model)
|
|
|
|
[AllowAnonymous, HttpPost("/EmbedProjectGoodsStatus/CancelServiceProject"), ApiUser(ApiCode = "EmbedServiceProjectStatus")]
|
|
|
|
|
|
|
|
public async Task<TaskManageOrderResultDto> CancelServiceProject(EmbedServiceProjectDto model)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
TaskManageOrderResultDto result = new TaskManageOrderResultDto();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
string batchNo = IDGen.NextID().ToString();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
try
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (string.IsNullOrWhiteSpace(model.businessId))
|
|
|
|
|
|
|
|
throw Oops.Oh($"业务主键不能为空");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_logger.LogInformation("批次={no} 请求保存服务项目 modifyjson={msg}", batchNo, JSON.Serialize(model));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
TrackingMessageInfo msgInfo = new TrackingMessageInfo
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
Head = new TrackingMessageHeadInfo
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
GID = IDGen.NextID().ToString(),
|
|
|
|
|
|
|
|
MessageType = "PROJECT",
|
|
|
|
|
|
|
|
ReceiverId = "ServiceProjectStatus",
|
|
|
|
|
|
|
|
ReceiverName = "服务项目和状态",
|
|
|
|
|
|
|
|
SenderId = "BookingOrder",
|
|
|
|
|
|
|
|
SenderName = "海运订舱",
|
|
|
|
|
|
|
|
RequestDate = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"),
|
|
|
|
|
|
|
|
Version = "2.0",
|
|
|
|
|
|
|
|
RequestAction = "AddOrModify",
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
Main = new TrackingMessageMainInfo
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
BusiId = model.businessId,
|
|
|
|
|
|
|
|
BusiSystemCode = "BOOKING_ORDER",
|
|
|
|
|
|
|
|
MBlNo = "",
|
|
|
|
|
|
|
|
VesselVoyno = "",
|
|
|
|
|
|
|
|
OrderNo = "",
|
|
|
|
|
|
|
|
PushType = TrackingPushTypeEnum.Project,
|
|
|
|
|
|
|
|
OperTenantId = UserManager.TENANT_ID,
|
|
|
|
|
|
|
|
OperTenantName = UserManager.TENANT_NAME,
|
|
|
|
|
|
|
|
OpertType = model.OpertType,
|
|
|
|
|
|
|
|
OperUserId = UserManager.UserId.ToString(),
|
|
|
|
|
|
|
|
OperUserName = UserManager.Name,
|
|
|
|
|
|
|
|
SourceType = TrackingSourceTypeEnum.MANUAL,
|
|
|
|
|
|
|
|
ProjectList = model.ProjectCodes.Select(a => new TrackingMessageMainProjectInfo
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
ServiceProjectCode = a,
|
|
|
|
|
|
|
|
}).ToList()
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
DateTime bDate = DateTime.Now;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_logger.LogInformation("批次={no} 推送取消服务项目 msg={msg}", batchNo, JSON.Serialize(msgInfo));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var rlt = await _serviceWorkFlowManageService.CancelStatus(msgInfo);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
DateTime eDate = DateTime.Now;
|
|
|
|
|
|
|
|
TimeSpan ts = eDate.Subtract(bDate);
|
|
|
|
|
|
|
|
var timeDiff = ts.TotalMilliseconds;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_logger.LogInformation("批次={no} 请求完成,耗时:{timeDiff}ms. 结果{msg} result={rlt}", batchNo, timeDiff, (rlt.succ ? "成功" : "失败")
|
|
|
|
|
|
|
|
, JSON.Serialize(rlt));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!rlt.succ)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
result = rlt;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return null;
|
|
|
|
result.succ = true;
|
|
|
|
|
|
|
|
result.msg = "取消成功";
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
result.succ = false;
|
|
|
|
|
|
|
|
result.msg = $"服务项目取消失败,原因:{ex.Message}";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return result;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#region 获取服务项目列表
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
/// 获取服务项目列表
|
|
|
|
/// 获取服务项目列表
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="model">查询服务项目和状态详情</param>
|
|
|
|
/// <param name="model">查询服务项目和状态详情</param>
|
|
|
|
/// <returns>返回回执</returns>
|
|
|
|
/// <returns>返回回执</returns>
|
|
|
|
public async Task<TaskManageOrderResultDto> GetServiceProjectList(QueryServiceProjectWithStatus model)
|
|
|
|
[AllowAnonymous, HttpPost("/EmbedProjectGoodsStatus/GetServiceProjectList"), ApiUser(ApiCode = "EmbedServiceProjectStatus")]
|
|
|
|
|
|
|
|
public async Task<TaskManageOrderResultDto> GetServiceProjectList(EmbedQueryServiceProjectWithStatus model)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
TaskManageOrderResultDto result = new TaskManageOrderResultDto();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
string batchNo = IDGen.NextID().ToString();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
try
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
DateTime bDate = DateTime.Now;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
EmbedQueryServiceProjectWithStatus queryInfo = new EmbedQueryServiceProjectWithStatus
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
businessId = model.businessId,
|
|
|
|
|
|
|
|
QueryType = TrackingQueryTypeEnum.QUERY_SERVICE_PROJECT,
|
|
|
|
|
|
|
|
TenantId = UserManager.TENANT_ID
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
result = await _serviceWorkFlowManageService.GetEnableProjectListCommon(queryInfo);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
DateTime eDate = DateTime.Now;
|
|
|
|
|
|
|
|
TimeSpan ts = eDate.Subtract(bDate);
|
|
|
|
|
|
|
|
var timeDiff = ts.TotalMilliseconds;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_logger.LogInformation("批次={no} id={id} 单票请求服务项目结果 耗时:{timeDiff}ms. ", batchNo, model.businessId, timeDiff);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
catch (Exception ex)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return null;
|
|
|
|
result.succ = false;
|
|
|
|
|
|
|
|
result.msg = $"获取服务项目列表失败,原因:{ex.Message}";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return result;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#region 获取服务项目下的状态列表
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
/// 获取服务项目下的状态列表
|
|
|
|
/// 获取服务项目下的状态列表
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="model">查询服务项目和状态详情</param>
|
|
|
|
/// <param name="model">查询服务项目和状态详情</param>
|
|
|
|
/// <returns>返回回执</returns>
|
|
|
|
/// <returns>返回回执</returns>
|
|
|
|
public async Task<TaskManageOrderResultDto> GetServiceStatusList(QueryServiceProjectWithStatus model)
|
|
|
|
[AllowAnonymous, HttpPost("/EmbedProjectGoodsStatus/GetServiceStatusList"), ApiUser(ApiCode = "EmbedServiceProjectStatus")]
|
|
|
|
|
|
|
|
public async Task<TaskManageOrderResultDto> GetServiceStatusList(EmbedQueryServiceProjectWithStatus model)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
TaskManageOrderResultDto result = new TaskManageOrderResultDto();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
string batchNo = IDGen.NextID().ToString();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
try
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return null;
|
|
|
|
//查询所有服务服务项目和状态时,需要先获取订舱详情
|
|
|
|
|
|
|
|
if (model.QueryType == TrackingQueryTypeEnum.QUERY_SERVICE_ALL)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
DateTime bDate = DateTime.Now;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
EmbedQueryServiceProjectWithStatus queryInfo = new EmbedQueryServiceProjectWithStatus
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
businessId = model.businessId,
|
|
|
|
|
|
|
|
QueryType = TrackingQueryTypeEnum.QUERY_SERVICE_PROJECT,
|
|
|
|
|
|
|
|
TenantId = UserManager.TENANT_ID
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
result = await _serviceWorkFlowManageService.GetEnableStatusListByBusinessCommon(queryInfo);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
DateTime eDate = DateTime.Now;
|
|
|
|
|
|
|
|
TimeSpan ts = eDate.Subtract(bDate);
|
|
|
|
|
|
|
|
var timeDiff = ts.TotalMilliseconds;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_logger.LogInformation("批次={no} id={id} 单票请求服务状态结果 耗时:{timeDiff}ms. ", batchNo, model.businessId, timeDiff);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (model.ProjectCodes == null || (model.ProjectCodes != null && model.ProjectCodes.Length == 0))
|
|
|
|
|
|
|
|
throw Oops.Oh($"服务项目代码不能为空");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//model.TenantId = UserManager.TENANT_ID;
|
|
|
|
|
|
|
|
result = await _serviceWorkFlowManageService.GetEnableStatusListByProject(new QueryServiceProjectWithStatus {
|
|
|
|
|
|
|
|
ProjectCodes = model.ProjectCodes,
|
|
|
|
|
|
|
|
QueryType = model.QueryType,
|
|
|
|
|
|
|
|
TenantId = UserManager.TENANT_ID
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
result.succ = false;
|
|
|
|
|
|
|
|
result.msg = $"获取服务项目下的状态列表失败,原因:{ex.Message}";
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return result;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#region 保存服务状态
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
/// 保存服务状态
|
|
|
|
/// 保存服务状态
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="model">修改服务状态详情</param>
|
|
|
|
/// <param name="model">修改服务状态详情</param>
|
|
|
|
/// <returns>返回回执</returns>
|
|
|
|
/// <returns>返回回执</returns>
|
|
|
|
public async Task<TaskManageOrderResultDto> SaveServiceStatus(ModifyServiceProjectStatusDto model)
|
|
|
|
[AllowAnonymous, HttpPost("/EmbedProjectGoodsStatus/SaveServiceStatus"), ApiUser(ApiCode = "EmbedServiceProjectStatus")]
|
|
|
|
|
|
|
|
public async Task<TaskManageOrderResultDto> SaveServiceStatus(EmbedServiceProjectStatusDto model)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return null;
|
|
|
|
TaskManageOrderResultDto result = new TaskManageOrderResultDto();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
string batchNo = IDGen.NextID().ToString();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
try
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (string.IsNullOrWhiteSpace(model.businessId))
|
|
|
|
|
|
|
|
throw Oops.Oh($"业务主键不能为空");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_logger.LogInformation("批次={no} 请求保存服务项目 modifyjson={msg}", batchNo, JSON.Serialize(model));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
TrackingMessageInfo msgInfo = new TrackingMessageInfo
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
Head = new TrackingMessageHeadInfo
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
GID = IDGen.NextID().ToString(),
|
|
|
|
|
|
|
|
MessageType = "PROJECT",
|
|
|
|
|
|
|
|
ReceiverId = "ServiceProjectStatus",
|
|
|
|
|
|
|
|
ReceiverName = "服务项目和状态",
|
|
|
|
|
|
|
|
SenderId = "BookingOrder",
|
|
|
|
|
|
|
|
SenderName = "海运订舱",
|
|
|
|
|
|
|
|
RequestDate = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"),
|
|
|
|
|
|
|
|
Version = "2.0",
|
|
|
|
|
|
|
|
RequestAction = "AddOrModify",
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
Main = new TrackingMessageMainInfo
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
BusiId = model.businessId,
|
|
|
|
|
|
|
|
BusiSystemCode = "BOOKING_ORDER",
|
|
|
|
|
|
|
|
MBlNo = "",
|
|
|
|
|
|
|
|
VesselVoyno = "",
|
|
|
|
|
|
|
|
OrderNo = "",
|
|
|
|
|
|
|
|
PushType = TrackingPushTypeEnum.Status,
|
|
|
|
|
|
|
|
OperTenantId = UserManager.TENANT_ID,
|
|
|
|
|
|
|
|
OperTenantName = UserManager.TENANT_NAME,
|
|
|
|
|
|
|
|
OpertType = TrackingOperTypeEnum.MANUAL,
|
|
|
|
|
|
|
|
OperUserId = UserManager.UserId.ToString(),
|
|
|
|
|
|
|
|
OperUserName = UserManager.Name,
|
|
|
|
|
|
|
|
SourceType = model.SourceType,
|
|
|
|
|
|
|
|
StatusList = model.StatusCodes.Select(a => new TrackingMessageMainStatusInfo
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
StatusCode = a.StatusCode,
|
|
|
|
|
|
|
|
StatusDate = a.SetActDate,
|
|
|
|
|
|
|
|
StatusVal = a.SetActVal,
|
|
|
|
|
|
|
|
Remark = a.ActRemark
|
|
|
|
|
|
|
|
}).ToList()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
DateTime bDate = DateTime.Now;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_logger.LogInformation("批次={no} 推送保存服务项目 msg={msg}", batchNo, JSON.Serialize(msgInfo));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var rlt = await _serviceWorkFlowManageService.PushStatus(msgInfo);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
DateTime eDate = DateTime.Now;
|
|
|
|
|
|
|
|
TimeSpan ts = eDate.Subtract(bDate);
|
|
|
|
|
|
|
|
var timeDiff = ts.TotalMilliseconds;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_logger.LogInformation("批次={no} 请求完成,耗时:{timeDiff}ms. 结果{msg} result={rlt}", batchNo, timeDiff, (rlt.succ ? "成功" : "失败")
|
|
|
|
|
|
|
|
, JSON.Serialize(rlt));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!rlt.succ)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
result = rlt;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
result.succ = true;
|
|
|
|
|
|
|
|
result.msg = "推送成功";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//这里预留保存完货物状态主动推送东胜
|
|
|
|
|
|
|
|
//var _bookingOrderService = _namedBookingOrderServiceProvider.GetService<ITransient>(nameof(BookingOrderService));
|
|
|
|
|
|
|
|
// await _bookingOrderService.SetBookingGoodsStatus(bookingOrder.Id, true, "手动更新货物状态");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
result.succ = false;
|
|
|
|
|
|
|
|
result.msg = $"服务项目状态推送失败,原因:{ex.Message}";
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return result;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#region 取消服务状态
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
/// 取消服务状态
|
|
|
|
/// 取消服务状态
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="model">修改服务状态详情</param>
|
|
|
|
/// <param name="model">修改服务状态详情</param>
|
|
|
|
/// <returns>返回回执</returns>
|
|
|
|
/// <returns>返回回执</returns>
|
|
|
|
public async Task<TaskManageOrderResultDto> CancelServiceStatus(ModifyServiceProjectStatusDto model)
|
|
|
|
[AllowAnonymous, HttpPost("/EmbedProjectGoodsStatus/CancelServiceStatus"), ApiUser(ApiCode = "EmbedServiceProjectStatus")]
|
|
|
|
|
|
|
|
public async Task<TaskManageOrderResultDto> CancelServiceStatus(EmbedServiceProjectStatusDto model)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
TaskManageOrderResultDto result = new TaskManageOrderResultDto();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
string batchNo = IDGen.NextID().ToString();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
try
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
_logger.LogInformation("批次={no} 请求保存服务项目 modifyjson={msg}", batchNo, JSON.Serialize(model));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
TrackingMessageInfo msgInfo = new TrackingMessageInfo
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
Head = new TrackingMessageHeadInfo
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
GID = IDGen.NextID().ToString(),
|
|
|
|
|
|
|
|
MessageType = "PROJECT",
|
|
|
|
|
|
|
|
ReceiverId = "ServiceProjectStatus",
|
|
|
|
|
|
|
|
ReceiverName = "服务项目和状态",
|
|
|
|
|
|
|
|
SenderId = "BookingOrder",
|
|
|
|
|
|
|
|
SenderName = "海运订舱",
|
|
|
|
|
|
|
|
RequestDate = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"),
|
|
|
|
|
|
|
|
Version = "2.0",
|
|
|
|
|
|
|
|
RequestAction = "AddOrModify",
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
Main = new TrackingMessageMainInfo
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
BusiId = model.businessId,
|
|
|
|
|
|
|
|
BusiSystemCode = "BOOKING_ORDER",
|
|
|
|
|
|
|
|
MBlNo = "",
|
|
|
|
|
|
|
|
VesselVoyno = "",
|
|
|
|
|
|
|
|
OrderNo = "",
|
|
|
|
|
|
|
|
PushType = TrackingPushTypeEnum.Status,
|
|
|
|
|
|
|
|
OperTenantId = UserManager.TENANT_ID,
|
|
|
|
|
|
|
|
OperTenantName = UserManager.TENANT_NAME,
|
|
|
|
|
|
|
|
OpertType = TrackingOperTypeEnum.MANUAL,
|
|
|
|
|
|
|
|
OperUserId = UserManager.UserId.ToString(),
|
|
|
|
|
|
|
|
OperUserName = UserManager.Name,
|
|
|
|
|
|
|
|
SourceType = model.SourceType,
|
|
|
|
|
|
|
|
StatusList = model.StatusCodes.Select(a => new TrackingMessageMainStatusInfo
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return null;
|
|
|
|
StatusCode = a.StatusCode,
|
|
|
|
|
|
|
|
StatusDate = a.SetActDate,
|
|
|
|
|
|
|
|
StatusVal = a.SetActVal,
|
|
|
|
|
|
|
|
Remark = a.ActRemark
|
|
|
|
|
|
|
|
}).ToList()
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
DateTime bDate = DateTime.Now;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_logger.LogInformation("批次={no} 推送保存服务项目 msg={msg}", batchNo, JSON.Serialize(msgInfo));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var rlt = await _serviceWorkFlowManageService.CancelStatus(msgInfo);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
DateTime eDate = DateTime.Now;
|
|
|
|
|
|
|
|
TimeSpan ts = eDate.Subtract(bDate);
|
|
|
|
|
|
|
|
var timeDiff = ts.TotalMilliseconds;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_logger.LogInformation("批次={no} 请求完成,耗时:{timeDiff}ms. 结果{msg} result={rlt}", batchNo, timeDiff, (rlt.succ ? "成功" : "失败")
|
|
|
|
|
|
|
|
, JSON.Serialize(rlt));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!rlt.succ)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
result = rlt;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
result.succ = true;
|
|
|
|
|
|
|
|
result.msg = "推送成功";
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
result.succ = false;
|
|
|
|
|
|
|
|
result.msg = $"服务项目状态推送失败,原因:{ex.Message}";
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|