zhangxiaofeng 8 months ago
commit 42fae8dbc7

@ -12,7 +12,7 @@ namespace Myshipping.Application
/// <summary> /// <summary>
/// 任务截止时间变更明细 /// 任务截止时间变更明细
/// </summary> /// </summary>
[SugarTable("task_cut_date_change_info")] [SugarTable("task_cut_date_change_detail_info")]
[Description(" 任务截止时间变更明细")] [Description(" 任务截止时间变更明细")]
public class TaskCutDateChangeDetailInfo : TaskManageDbEntity public class TaskCutDateChangeDetailInfo : TaskManageDbEntity
{ {

@ -245,6 +245,20 @@ namespace Myshipping.Application
bookingStatusLog.MBLNO = mblno; bookingStatusLog.MBLNO = mblno;
await _repStatuslog.InsertAsync(bookingStatusLog); await _repStatuslog.InsertAsync(bookingStatusLog);
//发送服务状态
var pushModel = new ModifyServiceProjectStatusDto
{
BookingId = bookingId,
SourceType = TrackingSourceTypeEnum.AUTO,
StatusCodes = new List<ModifyServiceProjectStatusDetailDto> {
new ModifyServiceProjectStatusDetailDto { StatusCode = "Yfanchang", SetActDate = bookingStatusLog.OpTime } }
};
var saveStatusRlt = await _bookingValueAddedService.SaveServiceStatus(pushModel);
_logger.LogInformation("请求JSON={json} 异步推送服务状态完成,结果={rlt}", JSON.Serialize(pushModel), JSON.Serialize(saveStatusRlt));
foreach (var dt in yarddto) foreach (var dt in yarddto)
{ {
var BookingStatusLogDetail = new BookingStatusLogDetail(); var BookingStatusLogDetail = new BookingStatusLogDetail();

@ -0,0 +1,41 @@
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Myshipping.Application
{
public interface ITaskManageDRAFTService
{
/// <summary>
/// 获取DRAFT详情
/// </summary>
/// <param name="pkId">DRAFT主键</param>
/// <returns>返回回执</returns>
Task<TaskManageOrderResultDto> GetInfo(string pkId);
/// <summary>
/// 通过任务主键获取DRAFT详情
/// </summary>
/// <param name="taskPkId">DRAFT任务主键</param>
/// <returns>返回回执</returns>
Task<TaskManageOrderResultDto> GetInfoByTaskId(string taskPkId);
/// <summary>
/// 任务ID下载附件
/// </summary>
/// <param name="taskPKId">DRAFT任务主键</param>
/// <param name="fileCategory">附件分类代码</param>
/// <returns>返回数据流</returns>
Task<IActionResult> DownloadFile(string taskPKId, string fileCategory = "BC");
/// <summary>
/// 发送邮件
/// </summary>
/// <param name="taskPKId">DRAFT任务主键</param>
/// <returns>返回回执</returns>
Task<TaskManageOrderResultDto> SendEmail(string taskPKId);
}
}

@ -286,6 +286,13 @@ namespace Myshipping.Application
/// <returns>返回结果</returns> /// <returns>返回结果</returns>
//Task<List<TaskBaseInfoDto>> GetTaskList(QueryTaskManageDto queryTaskManageDto); //Task<List<TaskBaseInfoDto>> GetTaskList(QueryTaskManageDto queryTaskManageDto);
/// <summary>
/// 创建DRAFT任务
/// </summary>
/// <param name="file">文件</param>
/// <param name="modifyFile">BC变更内容后文件</param>
/// <param name="jsonData">BC任务详情JSON</param>
/// <returns>返回回执</returns>
Task<TaskManageOrderResultDto> CreateDRAFTTaskJob(IFormFile file, IFormFile modifyFile, string jsonData);
} }
} }

@ -0,0 +1,110 @@
using Furion.DynamicApiController;
using Furion.FriendlyException;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using Myshipping.Application.Entity;
using Myshipping.Core;
using Myshipping.Core.Service;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Myshipping.Application
{
/// <summary>
/// DRAFT任务
/// </summary>
[ApiDescriptionSettings("Application", Name = "TaskManageDRAFT", Order = 10)]
public class TaskManageDRAFTService: ITaskManageDRAFTService, IDynamicApiController
{
private readonly ISysCacheService _cache;
private readonly ILogger<TaskManageDRAFTService> _logger;
private readonly SqlSugarRepository<TaskBaseInfo> _taskBaseRepository;
public TaskManageDRAFTService(SqlSugarRepository<TaskBCInfo> taskBCInfoRepository,
ILogger<TaskManageDRAFTService> logger)
{
_logger = logger;
}
#region 获取DRAFT详情
/// <summary>
/// 获取DRAFT详情
/// </summary>
/// <param name="pkId">DRAFT主键</param>
/// <returns>返回回执</returns>
public async Task<TaskManageOrderResultDto> GetInfo(string pkId)
{
TaskManageOrderResultDto result = new TaskManageOrderResultDto();
try
{
//var bcOrder = _taskBCInfoRepository.AsQueryable().First(a => a.PK_ID == pkId);
//if (bcOrder == null)
// throw Oops.Oh($"BC主键{pkId}无法获取业务信息");
//var BCCtnList = _taskBCCTNInfoRepository.AsQueryable().Where(a => a.P_ID == pkId).ToList();
//TaskBCShowBaseDto model = bcOrder.Adapt<TaskBCShowBaseDto>();
//if (BCCtnList.Count > 0)
// model.CtnList = BCCtnList.Adapt<List<TaskBCCTNInfoDto>>();
//var fileList = _taskFileRepository.AsQueryable().Where(a => a.TASK_PKID == bcOrder.TASK_ID).ToList();
//if (fileList.Count > 0)
// model.FileList = fileList.Adapt<List<TaskFileDto>>();
}
catch (Exception ex)
{
result.succ = false;
result.msg = $"获取BC详情异常原因{ex.Message}";
}
return result;
}
#endregion
#region 通过任务主键获取DRAFT详情
/// <summary>
/// 通过任务主键获取DRAFT详情
/// </summary>
/// <param name="taskPkId">DRAFT任务主键</param>
/// <returns>返回回执</returns>
public async Task<TaskManageOrderResultDto> GetInfoByTaskId(string taskPkId)
{
return null;
}
#endregion
#region 任务ID下载附件
/// <summary>
/// 任务ID下载附件
/// </summary>
/// <param name="taskPKId">DRAFT任务主键</param>
/// <param name="fileCategory">附件分类代码</param>
/// <returns>返回数据流</returns>
public Task<IActionResult> DownloadFile(string taskPKId, string fileCategory = "DRAFT")
{
return null;
}
#endregion
#region 发送邮件
/// <summary>
/// 发送邮件
/// </summary>
/// <param name="taskPKId">DRAFT任务主键</param>
/// <returns>返回回执</returns>
public async Task<TaskManageOrderResultDto> SendEmail(string taskPKId)
{
return null;
}
#endregion
}
}

@ -1233,6 +1233,10 @@ namespace Myshipping.Application
} }
#endregion #endregion
#region DRAFT转发客户
#endregion
if (info.Main.SerialMsgInfo != null) if (info.Main.SerialMsgInfo != null)
{ {
var storeInfo = new TaskStoreMsgInfo var storeInfo = new TaskStoreMsgInfo
@ -5603,6 +5607,43 @@ namespace Myshipping.Application
} }
#endregion #endregion
#region 创建DRAFT任务
/// <summary>
/// 创建DRAFT任务
/// </summary>
/// <param name="file">文件</param>
/// <param name="modifyFile">BC变更内容后文件</param>
/// <param name="jsonData">BC任务详情JSON</param>
/// <returns>返回回执</returns>
[AllowAnonymous, HttpPost("/TaskManage/CreateDRAFTTaskJob"), ApiUser(ApiCode = "BCTaskManage")]
public async Task<TaskManageOrderResultDto> CreateDRAFTTaskJob(IFormFile file, IFormFile modifyFile, [FromForm] string jsonData)
{
TaskManageOrderResultDto result = new TaskManageOrderResultDto();
string batchNo = IDGen.NextID().ToString();
_logger.LogInformation("批次={no} 接收到创建任务报文 报文={msg}", batchNo, jsonData);
try
{
TaskManageOrderMessageInfo info = JSON.Deserialize<TaskManageOrderMessageInfo>(jsonData);
if (info == null)
throw Oops.Bah("jsonData请求内容错误无法反序列化报文");
result = await InitTaskJob(info, batchNo, file, modifyFile);
}
catch (Exception ex)
{
result.succ = false;
result.msg = $"请求任务异常,{ex.Message}";
}
return result;
}
#endregion
#region 获取文件类型 #region 获取文件类型
/// <summary> /// <summary>
/// 获取文件类型 /// 获取文件类型

Loading…
Cancel
Save