修改货物运输计划已变更任务

master
jianghaiqing 6 months ago
parent 4f176a2765
commit 5e75a274a1

@ -1,4 +1,5 @@
using SqlSugar;
using Myshipping.Application.Entity;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.ComponentModel;
@ -6,7 +7,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Myshipping.Application.Entity.TaskManagePlat
namespace Myshipping.Application
{
/// <summary>
/// 货物运输计划已变更明细

@ -0,0 +1,162 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Myshipping.Application
{
/// <summary>
/// 您的货物运输计划已变更
/// </summary>
public class TaskTransPlanHasChangeShowDto
{
/// <summary>
/// 订舱编号
/// </summary>
public string BookingNo { get; set; }
/// <summary>
/// 提单号码
/// </summary>
public string BillNo { get; set; }
/// <summary>
/// 派生自原单号
/// </summary>
public string OrigBillNo { get; set; }
/// <summary>
/// 集装箱号列表
/// </summary>
public List<string> ContaNoList { get; set; }
/// <summary>
/// 船公司代码
/// </summary>
public string Carrier { get; set; }
/// <summary>
/// 变更原因
/// </summary>
public string ChangeReasonNotes { get; set; }
/// <summary>
/// 出运计划
/// </summary>
public TaskTransportPlanHasChangeDetailShow From { get; set; }
/// <summary>
/// 到达计划
/// </summary>
public TaskTransportPlanHasChangeDetailShow To { get; set; }
}
/// <summary>
/// 您的货物运输计划已变更明细
/// </summary>
public class TaskTransportPlanHasChangeDetailShow
{
/// <summary>
/// 港口变更明细
/// </summary>
public List<TaskTransPlanHasChangePortShow> portList { get; set; }
/// <summary>
/// 日期变更明细ETD或者ATD
/// </summary>
public List<TaskTransPlanHasChangeDateShow> dateList { get; set; }
/// <summary>
/// 船名航次变更
/// </summary>
public List<TaskTransPlanHasChangeVesselShow> vesselList { get; set; }
}
/// <summary>
/// 您的货物运输计划已变更-港口
/// </summary>
public class TaskTransPlanHasChangePortShow
{
/// <summary>
/// 顺序号
/// </summary>
public int Indx { get; set; }
/// <summary>
/// 港口名
/// </summary>
public string PortName { get; set; }
/// <summary>
/// 国家
/// </summary>
public string CountryCode { get; set; }
/// <summary>
/// 码头
/// </summary>
public string TerminalName { get; set; }
/// <summary>
/// 是否被作废掉了
/// </summary>
public bool IsRemoved { get; set; } = false;
}
/// <summary>
/// 您的货物运输计划已变更-日期
/// </summary>
public class TaskTransPlanHasChangeDateShow
{
/// <summary>
/// 顺序号
/// </summary>
public int Indx { get; set; }
/// <summary>
/// 提取日期文本
/// </summary>
public string OrigDateTxt { get; set; }
/// <summary>
/// 日期
/// </summary>
public DateTime DateVal { get; set; }
/// <summary>
/// 是否被作废掉了
/// </summary>
public bool IsRemoved { get; set; } = false;
}
/// <summary>
/// 您的货物运输计划已变更-船名航次
/// </summary>
public class TaskTransPlanHasChangeVesselShow
{
/// <summary>
/// 顺序号
/// </summary>
public int Indx { get; set; }
/// <summary>
/// 船名
/// </summary>
public string Vessel { get; set; }
/// <summary>
/// 航次
/// </summary>
public string Voyno { get; set; }
/// <summary>
/// 船旗
/// </summary>
public string Flag { get; set; }
/// <summary>
/// 是否被作废掉了
/// </summary>
public bool IsRemoved { get; set; } = false;
}
}

@ -0,0 +1,42 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Myshipping.Application
{
/// <summary>
/// 货物运输计划已变更服务
/// </summary>
public interface ITaskTransPlanHasChangeService
{
/// <summary>
/// 获取货物运输计划已变更详情
/// </summary>
/// <param name="taskPkId">货物运输计划已变更任务主键</param>
/// <returns>返回详情</returns>
Task<TaskTransPlanHasChangeShowDto> GetInfoByTaskId(string taskPkId);
/// <summary>
/// 自动转发货物运输计划已变更
/// </summary>
/// <param name="taskPKId">货物运输计划已变更任务主键</param>
/// <returns>返回回执</returns>
Task<TaskManageOrderResultDto> AutoTransferNotice(string taskPKId);
/// <summary>
/// 检索对应的订舱订单
/// </summary>
/// <param name="taskPKId">货物运输计划已变更任务主键</param>
/// <returns>返回回执</returns>
Task<TaskManageOrderResultDto> QueryVBookingOrder(string taskPKId);
/// <summary>
/// 发送邮件通知给客户
/// </summary>
/// <param name="taskPKId">货物运输计划已变更主键</param>
/// <returns>返回回执</returns>
Task<TaskManageOrderResultDto> SendEmailToCustomer(string taskPKId);
}
}

@ -0,0 +1,173 @@
using Furion.DependencyInjection;
using Furion.DynamicApiController;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using Myshipping.Application.Entity;
using Myshipping.Core.Entity;
using Myshipping.Core.Service;
using Myshipping.Core;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Furion.FriendlyException;
using NPOI.POIFS.Storage;
using Yitter.IdGenerator;
using Furion.DistributedIDGenerator;
using System.Text.RegularExpressions;
using Furion;
using Myshipping.Application.Helper;
using HtmlAgilityPack;
using Myshipping.Application.ConfigOption;
using Myshipping.Application.Enum;
using System.IO;
using StackExchange.Profiling.Internal;
using Furion.JsonSerialization;
using MySqlX.XDevAPI.Common;
using Furion.RemoteRequest.Extensions;
using Newtonsoft.Json;
using System.Net.Http;
using NPOI.Util;
namespace Myshipping.Application
{
/// <summary>
/// 货物运输计划已变更
/// </summary>
[ApiDescriptionSettings("Application", Name = "TaskTransPlanHasChange", Order = 10)]
public class TaskTransPlanHasChangeService : ITaskTransPlanHasChangeService, IDynamicApiController, ITransient
{
private readonly ISysCacheService _cache;
private readonly ILogger<TaskCautionNoticeService> _logger;
private readonly SqlSugarRepository<TaskBaseInfo> _taskBaseRepository;
private readonly SqlSugarRepository<TaskTransPlanHasChangeInfo> _taskTransPlanHasChangeInfoRepository;
private readonly SqlSugarRepository<TaskTransPlanHasChangeDetailInfo> _taskTransPlanHasChangeDetailInfoRepository;
private readonly SqlSugarRepository<DjyUserMailAccount> _djyUserMailAccount;
private readonly SqlSugarRepository<BookingOrder> _bookingOrderRepository;
private readonly SqlSugarRepository<BookingOrderContact> _bookingOrderContactRepository;
private readonly SqlSugarRepository<SysUser> _sysUserRepository;
private readonly SqlSugarRepository<BookingPrintTemplate> _repPrintTemplate;
private readonly SqlSugarRepository<TaskFileInfo> _taskFileRepository;
public TaskTransPlanHasChangeService(ISysCacheService cache, ILogger<TaskCautionNoticeService> logger,
SqlSugarRepository<TaskBaseInfo> taskBaseRepository,
SqlSugarRepository<TaskTransPlanHasChangeInfo> taskTransPlanHasChangeInfoRepository,
SqlSugarRepository<TaskTransPlanHasChangeDetailInfo> taskTransPlanHasChangeDetailInfoRepository,
SqlSugarRepository<DjyUserMailAccount> djyUserMailAccount,
SqlSugarRepository<BookingOrderContact> bookingOrderContactRepository,
SqlSugarRepository<SysUser> sysUserRepository,
SqlSugarRepository<BookingPrintTemplate> repPrintTemplate,
SqlSugarRepository<TaskFileInfo> taskFileRepository,
SqlSugarRepository<BookingOrder> bookingOrderRepository)
{
_cache = cache;
_logger = logger;
_taskBaseRepository = taskBaseRepository;
_taskTransPlanHasChangeInfoRepository = taskTransPlanHasChangeInfoRepository;
_taskTransPlanHasChangeDetailInfoRepository = taskTransPlanHasChangeDetailInfoRepository;
_djyUserMailAccount = djyUserMailAccount;
_bookingOrderRepository = bookingOrderRepository;
_bookingOrderContactRepository = bookingOrderContactRepository;
_sysUserRepository = sysUserRepository;
_repPrintTemplate = repPrintTemplate;
_taskFileRepository = taskFileRepository;
}
#region 获取货物运输计划已变更详情
/// <summary>
/// 获取货物运输计划已变更详情
/// </summary>
/// <param name="taskPkId">货物运输计划已变更任务主键</param>
/// <returns>返回详情</returns>
[HttpGet("/TaskTransPlanHasChange/GetInfoByTaskId")]
public async Task<TaskTransPlanHasChangeShowDto> GetInfoByTaskId(string taskPkId)
{
TaskTransPlanHasChangeShowDto dto = new TaskTransPlanHasChangeShowDto();
var taskBase = _taskBaseRepository.AsQueryable().First(a => a.PK_ID == taskPkId);
if (taskBase == null)
throw Oops.Oh($"任务主键{taskPkId}无法获取业务信息");
var entityInfo = _taskTransPlanHasChangeInfoRepository.AsQueryable().First(a => a.TASK_ID == taskBase.PK_ID);
if (entityInfo == null)
throw Oops.Oh($"货物运输计划已变更主键{taskPkId}无法获取业务信息");
var detailList = _taskTransPlanHasChangeDetailInfoRepository.AsQueryable()
.Where(a => a.P_ID == entityInfo.PK_ID).ToList();
if(detailList.Count > 0)
{
var ctnList = detailList.Where(a => a.COLUMN_TYPE.Equals("CTN", StringComparison.OrdinalIgnoreCase)).ToList();
dto.ContaNoList = ctnList.Select(a => a.CONTA_NO).ToList();
var fromList = detailList.Where(a => !string.IsNullOrWhiteSpace(a.PLAN_TYPE) && a.PLAN_TYPE.Equals("FROM", StringComparison.OrdinalIgnoreCase)).ToList();
dto.From = new TaskTransportPlanHasChangeDetailShow
{
portList = new List<TaskTransPlanHasChangePortShow>(),
dateList = new List<TaskTransPlanHasChangeDateShow>(),
vesselList = new List<TaskTransPlanHasChangeVesselShow>()
};
dto.From.portList = fromList.Where(a => !string.IsNullOrWhiteSpace(a.COLUMN_TYPE) && a.COLUMN_TYPE.Equals("PORT", StringComparison.OrdinalIgnoreCase))
.Select(a =>
{
return new TaskTransPlanHasChangePortShow
{
Indx = a.SORT_NO,
PortName = a.PORTLOAD,
//CountryCode = a.
};
}).ToList();
var toList = detailList.Where(a => !string.IsNullOrWhiteSpace(a.PLAN_TYPE) && a.PLAN_TYPE.Equals("TO", StringComparison.OrdinalIgnoreCase)).ToList();
}
return dto;
}
#endregion
#region 自动转发货物运输计划已变更
/// <summary>
/// 自动转发货物运输计划已变更
/// </summary>
/// <param name="taskPKId">货物运输计划已变更任务主键</param>
/// <returns>返回回执</returns>
public async Task<TaskManageOrderResultDto> AutoTransferNotice(string taskPKId)
{
return null;
}
#endregion
#region 检索对应的订舱订单
/// <summary>
/// 检索对应的订舱订单
/// </summary>
/// <param name="taskPKId">货物运输计划已变更任务主键</param>
/// <returns>返回回执</returns>
public async Task<TaskManageOrderResultDto> QueryVBookingOrder(string taskPKId)
{
return null;
}
#endregion
#region 发送邮件通知给客户
/// <summary>
/// 发送邮件通知给客户
/// </summary>
/// <param name="taskPKId">货物运输计划已变更主键</param>
/// <returns>返回回执</returns>
public async Task<TaskManageOrderResultDto> SendEmailToCustomer(string taskPKId)
{
return null;
}
#endregion
}
}
Loading…
Cancel
Save