新增内嵌服务项目和货物状态接口

master
jianghaiqing 7 months ago
parent e1c326da0a
commit 0bcb6501c4

@ -0,0 +1,24 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Myshipping.Application
{
/// <summary>
/// 内嵌服务项目请求
/// </summary>
public class EmbedServiceProjectDto
{
/// <summary>
/// 业务主键
/// </summary>
public string businessId { get; set; }
/// <summary>
/// 服务项目代码
/// </summary>
public string[] ProjectCodes { get; set; }
}
}

@ -0,0 +1,175 @@
using Furion.DependencyInjection;
using Furion.DistributedIDGenerator;
using Furion.DynamicApiController;
using Furion.FriendlyException;
using Furion.JsonSerialization;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using StackExchange.Profiling.Internal;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Myshipping.Application
{
/// <summary>
/// 内嵌服务项目和货物状态
/// </summary>
[AllowAnonymous, ApiDescriptionSettings("Application", Name = "EmbedProjectGoodsStatus", Order = 20)]
public class EmbedProjectGoodsStatusService: IEmbedProjectGoodsStatusService, IDynamicApiController, ITransient
{
private readonly ILogger<BookingTruckService> _logger;
/// <summary>
///
/// </summary>
/// <param name="logger"></param>
public EmbedProjectGoodsStatusService(ILogger<BookingTruckService> logger)
{
_logger = logger;
}
/// <summary>
/// 保存服务项目
/// </summary>
/// <param name="model">修改服务项目详情</param>
/// <returns>返回回执</returns>
[HttpPost("/EmbedProjectGoodsStatus/SaveServiceProject")]
public async Task<TaskManageOrderResultDto> SaveServiceProject(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 = 0,
OperTenantName = "",
OpertType = TrackingOperTypeEnum.MANUAL,
OperUserId = "",
OperUserName = "",
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.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 = "保存成功";
//}
}
catch (Exception ex)
{
result.succ = false;
result.msg = $"服务项目保存失败,原因:{ex.Message}";
}
return result;
}
/// <summary>
/// 取消服务项目
/// </summary>
/// <param name="model">修改服务项目详情</param>
/// <returns>返回回执</returns>
public async Task<TaskManageOrderResultDto> CancelServiceProject(ModifyServiceProjectDto model)
{
return null;
}
/// <summary>
/// 获取服务项目列表
/// </summary>
/// <param name="model">查询服务项目和状态详情</param>
/// <returns>返回回执</returns>
public async Task<TaskManageOrderResultDto> GetServiceProjectList(QueryServiceProjectWithStatus model)
{
return null;
}
/// <summary>
/// 获取服务项目下的状态列表
/// </summary>
/// <param name="model">查询服务项目和状态详情</param>
/// <returns>返回回执</returns>
public async Task<TaskManageOrderResultDto> GetServiceStatusList(QueryServiceProjectWithStatus model)
{
return null;
}
/// <summary>
/// 保存服务状态
/// </summary>
/// <param name="model">修改服务状态详情</param>
/// <returns>返回回执</returns>
public async Task<TaskManageOrderResultDto> SaveServiceStatus(ModifyServiceProjectStatusDto model)
{
return null;
}
/// <summary>
/// 取消服务状态
/// </summary>
/// <param name="model">修改服务状态详情</param>
/// <returns>返回回执</returns>
public async Task<TaskManageOrderResultDto> CancelServiceStatus(ModifyServiceProjectStatusDto model)
{
return null;
}
}
}

@ -0,0 +1,54 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Myshipping.Application
{
public interface IEmbedProjectGoodsStatusService
{
/// <summary>
/// 保存服务项目
/// </summary>
/// <param name="model">修改服务项目详情</param>
/// <returns>返回回执</returns>
Task<TaskManageOrderResultDto> SaveServiceProject(EmbedServiceProjectDto model);
/// <summary>
/// 取消服务项目
/// </summary>
/// <param name="model">修改服务项目详情</param>
/// <returns>返回回执</returns>
Task<TaskManageOrderResultDto> CancelServiceProject(ModifyServiceProjectDto model);
/// <summary>
/// 获取服务项目列表
/// </summary>
/// <param name="model">查询服务项目和状态详情</param>
/// <returns>返回回执</returns>
Task<TaskManageOrderResultDto> GetServiceProjectList(QueryServiceProjectWithStatus model);
/// <summary>
/// 获取服务项目下的状态列表
/// </summary>
/// <param name="model">查询服务项目和状态详情</param>
/// <returns>返回回执</returns>
Task<TaskManageOrderResultDto> GetServiceStatusList(QueryServiceProjectWithStatus model);
/// <summary>
/// 保存服务状态
/// </summary>
/// <param name="model">修改服务状态详情</param>
/// <returns>返回回执</returns>
Task<TaskManageOrderResultDto> SaveServiceStatus(ModifyServiceProjectStatusDto model);
/// <summary>
/// 取消服务状态
/// </summary>
/// <param name="model">修改服务状态详情</param>
/// <returns>返回回执</returns>
Task<TaskManageOrderResultDto> CancelServiceStatus(ModifyServiceProjectStatusDto model);
}
}
Loading…
Cancel
Save