修改任务台

master
jianghaiqing 8 months ago
parent 329bff261b
commit 3bc4a78757

@ -156,5 +156,15 @@ namespace Myshipping.Application
/// </summary>
[Description("VGM未提交")]
VGM_MISSING,
/// <summary>
/// 目的港未提货
/// </summary>
[Description("目的港未提货")]
POD_DISCHARGE_FULL,
/// <summary>
/// 目的港未返空箱
/// </summary>
[Description("目的港未返空箱")]
POD_GATEOUT_FULL,
}
}

@ -52,6 +52,7 @@
<ItemGroup>
<Folder Include="Entity\Fee\" />
<Folder Include="Service\TaskManagePlat\Dtos\Draft\" />
</ItemGroup>
</Project>

@ -95,5 +95,15 @@ namespace Myshipping.Application
/// 截关时间文本 海关放行截止时间(Customs Clearance Deadline)
/// </summary>
public string ClosingDateTxt { get; set; }
/// <summary>
/// 船公司
/// </summary>
public string Carrier { get; set; }
/// <summary>
/// 通知接收时间
/// </summary>
public Nullable<DateTime> NoticeDate { get; set; }
}
}

@ -0,0 +1,90 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Myshipping.Application
{
/// <summary>
///
/// </summary>
public class TaskPODDischargeGateoutFullDto
{
/// <summary>
/// 主键
/// </summary>
public string PKId { get; set; }
/// <summary>
/// 任务主键
/// </summary>
public string TaskId { get; set; }
/// <summary>
/// 主单号
/// </summary>
public string MBlNo { get; set; }
/// <summary>
/// 船公司
/// </summary>
public string Carrier { get; set; }
/// <summary>
/// 箱号
/// </summary>
public string CtnNo { get; set; }
/// <summary>
/// 收货人
/// </summary>
public string CNee { get; set; }
/// <summary>
/// 卸货日期
/// </summary>
public Nullable<DateTime> DischargeDate { get; set; }
/// <summary>
/// 卸货港
/// </summary>
public string DischargePort { get; set; }
/// <summary>
/// 超期天数
/// </summary>
public Nullable<int> OverdueDays { get; set; }
/// <summary>
/// 通知接收时间
/// </summary>
public Nullable<DateTime> NoticeDate { get; set; }
/// <summary>
/// 订舱ID
/// </summary>
public Nullable<long> BookingId { get; set; }
/// <summary>
/// 已发消息提醒 1-已发 0-未发
/// </summary>
public bool IsNotice { get; set; }
/// <summary>
/// 消息提醒时间
/// </summary>
public Nullable<DateTime> SendNoticeDate { get; set; }
/// <summary>
/// 通知类型 CHARGE_FULL-卸船未提货GATEOUT_FULL-提箱未返空箱
/// </summary>
public string NoticeType { get; set; }
/// <summary>
/// 通知类型 CHARGE_FULL-卸船未提货GATEOUT_FULL-提箱未返空箱
/// </summary>
public string NoticeTypeName { get; set; }
}
}

@ -0,0 +1,21 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Myshipping.Application
{
public class TaskPODDischargeGateoutFullShowDto : TaskPODDischargeGateoutFullDto
{
/// <summary>
/// 是否已完成
/// </summary>
public bool IsComplete { get; set; }
/// <summary>
/// 完成时间
/// </summary>
public Nullable<DateTime> CompleteTime { get; set; }
}
}

@ -0,0 +1,54 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Myshipping.Application
{
/// <summary>
/// 截单回执
/// </summary>
public class TaskSISubmittedDto
{
/// <summary>
/// 主键
/// </summary>
public string PKId { get; set; }
/// <summary>
/// 任务主键
/// </summary>
public string TaskId { get; set; }
/// <summary>
/// 主单号
/// </summary>
public string MBlNo { get; set; }
/// <summary>
/// 船公司
/// </summary>
public string Carrier { get; set; }
/// <summary>
/// 通知接收时间
/// </summary>
public Nullable<DateTime> NoticeDate { get; set; }
/// <summary>
/// 订舱ID
/// </summary>
public Nullable<long> BookingId { get; set; }
/// <summary>
/// 提取签单方式名称
/// </summary>
public string TakeIssueTypeName { get; set; }
/// <summary>
/// 签单方式名称
/// </summary>
public string IssueType { get; set; }
}
}

@ -0,0 +1,21 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Myshipping.Application
{
public class TaskSISubmittedShowDto: TaskSISubmittedDto
{
/// <summary>
/// 是否已完成
/// </summary>
public bool IsComplete { get; set; }
/// <summary>
/// 完成时间
/// </summary>
public Nullable<DateTime> CompleteTime { get; set; }
}
}

@ -1018,7 +1018,54 @@ namespace Myshipping.Application
.Map(dest => dest.VGMCutoffTimeTxt, src => src.VGM_CUT_TXT)
.Map(dest => dest.ClosingDate, src => src.CLOSING_DATE)
.Map(dest => dest.ClosingDateTxt, src => src.CLOSING_DATE_TXT);
}
config.ForType<TaskManageOrderSIFeedBackInfo, TaskSISubmitted>()
.Map(dest => dest.MBL_NO, src => src.MblNo)
.Map(dest => dest.CARRIER, src => src.Carrier)
.Map(dest => dest.TAKE_ISSUETYPE_NAME, src => src.TakeIssueTypeName)
.Map(dest => dest.ISSUETYPE, src => src.IssueType)
.Map(dest => dest.NOTICE_DATE, src => src.NoticeDate);
config.ForType<TaskManageOrderDraftInfo, TaskDraftInfo>()
.Map(dest => dest.MBL_NO, src => src.MBlNo)
.Map(dest => dest.CARRIER, src => src.Carrier)
.Map(dest => dest.NOTICE_DATE, src => src.NoticeDate);
config.ForType<TaskManageOrderPODDischargeGateoutFull, TaskPODDischargeGateoutFullInfo>()
.Map(dest => dest.MBL_NO, src => src.MBlNo)
.Map(dest => dest.CARRIER, src => src.Carrier)
.Map(dest => dest.NOTICE_TYPE, src => src.NoticeType)
.Map(dest => dest.NOTICE_TYPE_NAME, src => src.NoticeTypeName)
.Map(dest => dest.NOTICE_DATE, src => src.NoticeDate);
config.ForType<TaskManageOrderPODDischargeGateoutFullDetail, TaskPODDischargeGateoutFullDetailInfo>()
.Map(dest => dest.MBL_NO, src => src.MBlNo)
.Map(dest => dest.CTN_NO, src => src.CtnNo)
.Map(dest => dest.CNEE, src => src.Cnee)
.Map(dest => dest.DISCHARGE_PORT, src => src.DischargePort)
.Map(dest => dest.DISCHARGE_DATE, src => src.DischargeDate)
.Map(dest => dest.OVERDUE_DAYS, src => src.OverdueDays);
config.ForType<TaskSISubmitted, TaskSISubmittedShowDto>()
.Map(dest => dest.MBlNo, src => src.MBL_NO)
.Map(dest => dest.Carrier, src => src.CARRIER)
.Map(dest => dest.TakeIssueTypeName, src => src.TAKE_ISSUETYPE_NAME)
.Map(dest => dest.IssueType, src => src.ISSUETYPE)
.Map(dest => dest.BookingId, src => src.BOOKING_ID);
config.ForType<TaskPODDischargeGateoutFullDetailInfo, TaskPODDischargeGateoutFullShowDto>()
.Map(dest => dest.MBlNo, src => src.MBL_NO)
.Map(dest => dest.CtnNo, src => src.CTN_NO)
.Map(dest => dest.CNee, src => src.CNEE)
.Map(dest => dest.DischargeDate, src => src.DISCHARGE_DATE)
.Map(dest => dest.DischargePort, src => src.DISCHARGE_PORT)
.Map(dest => dest.OverdueDays, src => src.OVERDUE_DAYS)
.Map(dest => dest.BookingId, src => src.BOOKING_ID)
.Map(dest => dest.IsNotice, src => src.IS_NOTICE)
.Map(dest => dest.SendNoticeDate, src => src.SEND_NOTICE_DATE);
}
}
}

@ -0,0 +1,29 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Myshipping.Application
{
/// <summary>
///
/// </summary>
public class TaskManageOrderDraftInfo
{
/// <summary>
/// 主单号
/// </summary>
public string MBlNo { get; set; }
/// <summary>
/// 船公司
/// </summary>
public string Carrier { get; set; }
/// <summary>
/// 通知接收时间
/// </summary>
public Nullable<DateTime> NoticeDate { get; set; }
}
}

@ -219,5 +219,15 @@ namespace Myshipping.Application
/// VGM回执
/// </summary>
public List<TaskManageOrderVGMInfo> VGMFeedBack { get; set; }
}
/// <summary>
/// 目的港未提货未返箱
/// </summary>
public TaskManageOrderPODDischargeGateoutFull PODDischargeGateoutFull { get; set; }
/// <summary>
/// 格式单
/// </summary>
public TaskManageOrderDraftInfo DraftInfo { get; set; }
}
}

@ -0,0 +1,80 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Myshipping.Application
{
/// <summary>
/// 任务目的港未提货未返箱
/// </summary>
public class TaskManageOrderPODDischargeGateoutFull
{
/// <summary>
/// 主单号
/// </summary>
public string MBlNo { get; set; }
/// <summary>
/// 船公司
/// </summary>
public string Carrier { get; set; }
/// <summary>
/// 通知类型 CHARGE_FULL-卸船未提货GATEOUT_FULL-提箱未返空箱
/// </summary>
public string NoticeType { get; set; }
/// <summary>
/// 通知类型名称 CHARGE_FULL-卸船未提货GATEOUT_FULL-提箱未返空箱
/// </summary>
public string NoticeTypeName { get; set; }
/// <summary>
/// 通知接收时间
/// </summary>
public Nullable<DateTime> NoticeDate { get; set; }
/// <summary>
/// 明细
/// </summary>
public List<TaskManageOrderPODDischargeGateoutFullDetail> DetailList { get; set; }
}
/// <summary>
/// 任务目的港未提货未返箱明细
/// </summary>
public class TaskManageOrderPODDischargeGateoutFullDetail
{
/// <summary>
/// 主单号
/// </summary>
public string MBlNo { get; set; }
/// <summary>
/// 箱号
/// </summary>
public string CtnNo { get; set; }
/// <summary>
/// 收货人
/// </summary>
public string Cnee { get; set; }
/// <summary>
/// 收货人
/// </summary>
public Nullable<DateTime> DischargeDate { get; set; }
/// <summary>
/// 卸货港
/// </summary>
public string DischargePort { get; set; }
/// <summary>
/// 超期天数
/// </summary>
public Nullable<int> OverdueDays { get; set; }
}
}

@ -12,10 +12,26 @@ namespace Myshipping.Application
/// </summary>
public class TaskManageOrderSIFeedBackInfo
{
/// <summary>
/// 提单号
/// </summary>
public string MblNo { get; set; }
/// <summary>
/// 船公司
/// </summary>
public string Carrier { get; set; }
/// <summary>
/// 船公司
/// </summary>
public Nullable<DateTime> NoticeDate { get; set; }
/// <summary>
/// 发货人
/// </summary>
public string Shipper { get; set; }
/// <summary>
/// 收货人
/// </summary>
@ -50,6 +66,13 @@ namespace Myshipping.Application
/// </summary>
/// <example>TELEX</example>
public string IssueType { get; set; }
/// <summary>
/// 提取签单方式
/// </summary>
/// <example>TELEX</example>
public string TakeIssueTypeName { get; set; }
/// <summary>
/// 装货港代码
/// </summary>

@ -11,15 +11,30 @@ namespace Myshipping.Application
/// <summary>
/// 获取截止时间变更详情
/// </summary>
/// <param name="pkId">截止时间主键</param>
/// <param name="pkId">截止时间变更主键</param>
/// <returns>返回回执</returns>
Task<List<TaskCutDateChangeShowDto>> GetInfo(string pkId);
/// <summary>
/// 通过任务主键获取截止时间变更详情
/// </summary>
/// <param name="taskPkId">截止时间任务主键</param>
/// <param name="taskPkId">截止时间变更任务主键</param>
/// <returns>返回回执</returns>
Task<List<TaskCutDateChangeShowDto>> GetInfoByTaskId(string taskPkId);
/// <summary>
/// 重新处理截止时间变更任务
/// 对未匹配订舱订单的任务记录,重新对应订单订单
/// </summary>
/// <param name="taskPkId">截止时间变更任务主键</param>
/// <returns>返回回执</returns>
Task<TaskManageOrderResultDto> SearchAndConnectBookingInfo(string taskPkId);
/// <summary>
/// 推送及时消息
/// </summary>
/// <param name="taskPkId">截止时间变更任务主键</param>
/// <returns>返回回执</returns>
Task<TaskManageOrderResultDto> SendInstantMessage(string taskPkId);
}
}

@ -0,0 +1,43 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Myshipping.Application.Service.TaskManagePlat.Interface
{
/// <summary>
/// 任务目的港未提货未返箱
/// </summary>
public interface ITaskManagePODDischargeGateoutFullService
{
/// <summary>
/// 获取目的港未提货未返箱详情
/// </summary>
/// <param name="pkId">目的港未提货未返箱主键</param>
/// <returns>返回回执</returns>
Task<List<TaskPODDischargeGateoutFullShowDto>> GetInfo(string pkId);
/// <summary>
/// 通过任务主键获取目的港未提货未返箱详情
/// </summary>
/// <param name="taskPkId">目的港未提货未返箱任务主键</param>
/// <returns>返回回执</returns>
Task<List<TaskPODDischargeGateoutFullShowDto>> GetInfoByTaskId(string taskPkId);
/// <summary>
/// 推送及时消息
/// </summary>
/// <param name="taskPkId">目的港未提货未返箱任务主键</param>
/// <returns>返回回执</returns>
Task<TaskManageOrderResultDto> SendInstantMessage(string taskPkId);
/// <summary>
/// 重新处理目的港未提货未返箱任务
/// 对未匹配目的港未提货未返箱的任务记录重新对应订单
/// </summary>
/// <param name="taskPkId">目的港未提货未返箱任务主键</param>
/// <returns>返回回执</returns>
Task<TaskManageOrderResultDto> SearchAndConnectBookingInfo(string taskPkId);
}
}

@ -0,0 +1,43 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Myshipping.Application
{
/// <summary>
/// 截单回执任务
/// </summary>
public interface ITaskManageSISubmittedService
{
/// <summary>
/// 获取截单回执详情
/// </summary>
/// <param name="pkId">截单回执主键</param>
/// <returns>返回回执</returns>
Task<TaskSISubmittedShowDto> GetInfo(string pkId);
/// <summary>
/// 通过任务主键获取截单回执详情
/// </summary>
/// <param name="taskPkId">截单回执任务主键</param>
/// <returns>返回回执</returns>
Task<TaskSISubmittedShowDto> GetInfoByTaskId(string taskPkId);
/// <summary>
/// 同步更新订舱订单的截单状态
/// </summary>
/// <param name="taskPkId">截单回执任务主键</param>
/// <returns>返回回执</returns>
Task<TaskManageOrderResultDto> SyncBookingSIStatus(string taskPkId);
/// <summary>
/// 重新处理截单任务
/// 对未匹配订舱订单的任务记录重新对应订单订单
/// </summary>
/// <param name="taskPkId">截单回执任务主键</param>
/// <returns>返回回执</returns>
Task<TaskManageOrderResultDto> SearchAndConnectBookingInfo(string taskPkId);
}
}

@ -4,6 +4,11 @@ using Mapster;
using Microsoft.AspNetCore.Mvc;
using Myshipping.Application.Entity;
using Myshipping.Core;
using Myshipping.Core.Helper;
using Npoi.Mapper;
using NPOI.OpenXmlFormats.Wordprocessing;
using Org.BouncyCastle.Crypto;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
@ -21,21 +26,24 @@ namespace Myshipping.Application
private readonly SqlSugarRepository<TaskCutDateChangeInfo> _taskCutDateChangeInfoRepository;
private readonly SqlSugarRepository<TaskCutDateChangeDetailInfo> _taskCutDateChangeDetailInfoRepository;
private readonly SqlSugarRepository<TaskBaseInfo> _taskBaseRepository;
private readonly SqlSugarRepository<BookingOrder> _bookingOrderRepository;
public TaskManageCutDateChangeService(SqlSugarRepository<TaskCutDateChangeInfo> taskCutDateChangeInfoRepository,
SqlSugarRepository<TaskCutDateChangeDetailInfo> taskCutDateChangeDetailInfoRepository,
SqlSugarRepository<TaskBaseInfo> taskBaseRepository)
SqlSugarRepository<TaskBaseInfo> taskBaseRepository,
SqlSugarRepository<BookingOrder> bookingOrderRepository)
{
_taskCutDateChangeInfoRepository = taskCutDateChangeInfoRepository;
_taskCutDateChangeDetailInfoRepository = taskCutDateChangeDetailInfoRepository;
_taskBaseRepository = taskBaseRepository;
_bookingOrderRepository = bookingOrderRepository;
}
#region 获取截止时间变更详情
/// <summary>
/// 获取截止时间变更详情
/// </summary>
/// <param name="pkId">截止时间主键</param>
/// <param name="pkId">截止时间变更主键</param>
/// <returns>返回回执</returns>
[HttpGet("/TaskManageCutDate/GetInfo")]
public async Task<List<TaskCutDateChangeShowDto>> GetInfo(string pkId)
@ -56,6 +64,8 @@ namespace Myshipping.Application
{
TaskCutDateChangeShowDto model = p.Adapt<TaskCutDateChangeShowDto>();
model.NoticeDate = cutChangeOrder.NOTICE_DATE;
model.Carrier = cutChangeOrder.CARRIER;
return model;
}).ToList();
@ -69,7 +79,7 @@ namespace Myshipping.Application
/// <summary>
/// 通过任务主键获取截止时间变更详情
/// </summary>
/// <param name="taskPkId">截止时间任务主键</param>
/// <param name="taskPkId">截止时间变更任务主键</param>
/// <returns>返回回执</returns>
[HttpGet("/TaskManageCutDate/GetInfoByTaskId")]
public async Task<List<TaskCutDateChangeShowDto>> GetInfoByTaskId(string taskPkId)
@ -95,6 +105,8 @@ namespace Myshipping.Application
{
TaskCutDateChangeShowDto model = p.Adapt<TaskCutDateChangeShowDto>();
model.NoticeDate = cutChangeOrder.NOTICE_DATE;
model.Carrier = cutChangeOrder.CARRIER;
return model;
}).ToList();
@ -103,5 +115,149 @@ namespace Myshipping.Application
return list;
}
#endregion
#region 重新处理截止时间变更任务
/// <summary>
/// 重新处理截止时间变更任务
/// 对未匹配订舱订单的任务记录,重新对应订单订单
/// </summary>
/// <param name="taskPkId">截止时间变更任务主键</param>
/// <returns>返回回执</returns>
public async Task<TaskManageOrderResultDto> SearchAndConnectBookingInfo(string taskPkId)
{
TaskManageOrderResultDto result = new TaskManageOrderResultDto();
var taskBase = _taskBaseRepository.AsQueryable().First(a => a.PK_ID == taskPkId);
if (taskBase == null)
throw Oops.Oh($"任务主键{taskPkId}无法获取业务信息");
var cutDateChange = _taskCutDateChangeInfoRepository.AsQueryable().First(a => a.TASK_ID == taskBase.PK_ID);
if (cutDateChange == null)
throw Oops.Oh($"截止时间变更主键{taskPkId}无法获取业务信息");
var detailList = _taskCutDateChangeDetailInfoRepository.AsQueryable()
.Where(a => a.P_ID == cutDateChange.PK_ID).ToList();
//如果都有订单订单记录,则提示错误不进行对应
if (!detailList.Any(t => !t.BOOKING_ID.HasValue))
{
throw Oops.Oh($"当前截止时间变更已有匹配的订舱订单,不能执行操作");
}
var mblList = detailList.Select(a => a.MBL_NO).Distinct().ToList();
var bookingList = _bookingOrderRepository.AsQueryable().Filter(null, true)
.Where(a => mblList.Contains(a.MBLNO) && a.IsDeleted == false && (a.ParentId == null || a.ParentId == 0)).ToList();
if (bookingList.Count == 0)
throw Oops.Oh($"提单号未提取有效的订舱订单");
List<string> msgList = new List<string>();
detailList.ForEach(async t =>
{
//只处理没有订舱ID的记录
if (!t.BOOKING_ID.HasValue)
{
var currBook = bookingList.FirstOrDefault(p => p.MBLNO == t.MBL_NO);
if (currBook != null)
{
t.BOOKING_ID = currBook.Id;
t.UpdatedUserId = UserManager.UserId;
t.UpdatedUserName = UserManager.Name;
//更新任务BC
await _taskCutDateChangeDetailInfoRepository.AsUpdateable(t).UpdateColumns(it => new
{
it.BOOKING_ID,
it.UpdatedTime,
it.UpdatedUserId,
it.UpdatedUserName
}).ExecuteCommandAsync();
}
else
{
msgList.Add(t.MBL_NO);
}
}
});
if (msgList.Count > 0)
throw Oops.Oh($"提单号{(string.Join(",", msgList.ToArray()))}未提取有效的订舱订单");
result.succ = true;
result.msg = "成功";
return result;
}
#endregion
#region 推送及时消息
/// <summary>
/// 推送及时消息
/// </summary>
/// <param name="taskPkId">截止时间任务主键</param>
/// <returns>返回回执</returns>
public async Task<TaskManageOrderResultDto> SendInstantMessage(string taskPkId)
{
TaskManageOrderResultDto result = new TaskManageOrderResultDto();
var taskBase = _taskBaseRepository.AsQueryable().First(a => a.PK_ID == taskPkId);
if (taskBase == null)
throw Oops.Oh($"任务主键{taskPkId}无法获取业务信息");
var cutDateChange = _taskCutDateChangeInfoRepository.AsQueryable().First(a => a.TASK_ID == taskBase.PK_ID);
if (cutDateChange == null)
throw Oops.Oh($"截止时间变更主键{taskPkId}无法获取业务信息");
var detailList = _taskCutDateChangeDetailInfoRepository.AsQueryable()
.Where(a => a.P_ID == cutDateChange.PK_ID).ToList();
//如果都有订单订单记录,则提示错误不进行对应
if (!detailList.Any(t => t.BOOKING_ID.HasValue))
{
throw Oops.Oh($"当前截止时间变更没有匹配的订舱订单,不能执行操作");
}
var ids = detailList.Where(a => a.BOOKING_ID.HasValue).Select(a => a.BOOKING_ID.Value).ToList();
var bookingList = _bookingOrderRepository.AsQueryable().Filter(null, true)
.Where(a => ids.Contains(a.Id) && a.IsDeleted == false && (a.ParentId == null || a.ParentId == 0)).ToList();
if (bookingList.Count == 0)
throw Oops.Oh($"提单号未提取有效的订舱订单");
Dictionary<string, List<string>> msgList = new Dictionary<string, List<string>>();
msgList = bookingList.GroupBy(a => a.OP).Select(a =>
{
var currList = a.ToList();
return new { Key = a.Key, list = currList.Select(a => a.MBLNO).ToList() };
}).ToDictionary(a => a.Key, b => b.list);
if (msgList.Count > 0)
{
msgList.ForEach(t =>
{
DingTalkGroupHelper.SendDingTalkGroupMessage("KangqianNotify", "截止时间变更消息", $"@{t.Key} 收到如下提单号{(string.Join(",",t.Value.ToArray()))}的截止时间变更消息");
});
}
if(detailList.Any(t=>!t.BOOKING_ID.HasValue))
throw Oops.Oh($"提单号{(string.Join(",", detailList.Where(t => !t.BOOKING_ID.HasValue).Select(t=>t.MBL_NO).ToArray()))}未提取有效的订舱订单");
result.succ = true;
result.msg = "成功";
return result;
}
#endregion
}
}

@ -0,0 +1,278 @@
using Furion.DynamicApiController;
using Furion.FriendlyException;
using Mapster;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using Myshipping.Application.Entity;
using Myshipping.Application.Service.TaskManagePlat.Interface;
using Myshipping.Core;
using Myshipping.Core.Helper;
using Npoi.Mapper;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Myshipping.Application
{
/// <summary>
/// 任务目的港未提货未返箱
/// </summary>
[ApiDescriptionSettings("Application", Name = "PODDischargeGateoutFull", Order = 10)]
public class TaskManagePODDischargeGateoutFullService: ITaskManagePODDischargeGateoutFullService, IDynamicApiController
{
private readonly SqlSugarRepository<TaskPODDischargeGateoutFullInfo> _taskPODDischargeGateoutFullInfoRep;
private readonly SqlSugarRepository<TaskPODDischargeGateoutFullDetailInfo> _taskPODDischargeGateoutFullDetailInfoRep;
private readonly SqlSugarRepository<TaskBaseInfo> _taskBaseRepository;
private readonly ILogger<TaskManagePODDischargeGateoutFullService> _logger;
private readonly SqlSugarRepository<BookingOrder> _bookingOrderRepository;
public TaskManagePODDischargeGateoutFullService(ILogger<TaskManagePODDischargeGateoutFullService> logger,
SqlSugarRepository<TaskPODDischargeGateoutFullInfo> taskPODDischargeGateoutFullInfoRep,
SqlSugarRepository<TaskPODDischargeGateoutFullDetailInfo> taskPODDischargeGateoutFullDetailInfoRep,
SqlSugarRepository<TaskBaseInfo> taskBaseRepository,
SqlSugarRepository<BookingOrder> bookingOrderRepository)
{
_taskPODDischargeGateoutFullInfoRep = taskPODDischargeGateoutFullInfoRep;
_taskBaseRepository = taskBaseRepository;
_taskPODDischargeGateoutFullDetailInfoRep = taskPODDischargeGateoutFullDetailInfoRep;
_logger = logger;
_bookingOrderRepository = bookingOrderRepository;
}
#region 获取目的港未提货未返箱详情
/// <summary>
/// 获取目的港未提货未返箱详情
/// </summary>
/// <param name="pkId">目的港未提货未返箱主键</param>
/// <returns>返回回执</returns>
[HttpGet("/PODDischargeGateoutFull/GetInfo")]
public async Task<List<TaskPODDischargeGateoutFullShowDto>> GetInfo(string pkId)
{
List<TaskPODDischargeGateoutFullShowDto> list = new List<TaskPODDischargeGateoutFullShowDto>();
var dischargeFull = _taskPODDischargeGateoutFullInfoRep.AsQueryable()
.First(a => a.PK_ID == pkId);
if (dischargeFull == null)
throw Oops.Oh($"目的港未提货未返箱主键{pkId}无法获取业务信息");
var dischargeFullDetail = _taskPODDischargeGateoutFullDetailInfoRep.AsQueryable()
.Where(a => a.P_ID == dischargeFull.PK_ID).ToList();
var taskBase = _taskBaseRepository.AsQueryable().First(a => a.PK_ID == dischargeFull.TASK_ID);
if (taskBase == null)
throw Oops.Oh($"任务主键无法获取业务信息");
list = dischargeFullDetail.Select(x => {
var dto = x.Adapt<TaskPODDischargeGateoutFullShowDto>();
dto.PKId = dischargeFull.PK_ID;
dto.TaskId = dischargeFull.TASK_ID;
dto.IsComplete = taskBase.IS_COMPLETE == 1 ? true : false;
dto.CompleteTime = taskBase.COMPLETE_DATE;
dto.NoticeType = dischargeFull.NOTICE_TYPE;
dto.NoticeTypeName = dischargeFull.NOTICE_TYPE_NAME;
return dto;
}).ToList();
return list;
}
#endregion
#region 通过任务主键获取目的港未提货未返箱详情
/// <summary>
/// 通过任务主键获取目的港未提货未返箱详情
/// </summary>
/// <param name="taskPkId">目的港未提货未返箱任务主键</param>
/// <returns>返回回执</returns>
[HttpGet("/PODDischargeGateoutFull/GetInfoByTaskId")]
public async Task<List<TaskPODDischargeGateoutFullShowDto>> GetInfoByTaskId(string taskPkId)
{
List<TaskPODDischargeGateoutFullShowDto> list = new List<TaskPODDischargeGateoutFullShowDto>();
var taskBase = _taskBaseRepository.AsQueryable().First(a => a.PK_ID == taskPkId);
if (taskBase == null)
throw Oops.Oh($"任务主键{taskPkId}无法获取业务信息");
var dischargeFull = _taskPODDischargeGateoutFullInfoRep.AsQueryable().First(a => a.TASK_ID == taskBase.PK_ID);
if (dischargeFull == null)
throw Oops.Oh($"目的港未提货未返箱主键{taskPkId}无法获取业务信息");
var dischargeFullDetail = _taskPODDischargeGateoutFullDetailInfoRep.AsQueryable()
.Where(a => a.P_ID == dischargeFull.PK_ID).ToList();
list = dischargeFullDetail.Select(x => {
var dto = x.Adapt<TaskPODDischargeGateoutFullShowDto>();
dto.PKId = dischargeFull.PK_ID;
dto.TaskId = dischargeFull.TASK_ID;
dto.IsComplete = taskBase.IS_COMPLETE == 1 ? true : false;
dto.CompleteTime = taskBase.COMPLETE_DATE;
dto.NoticeType = dischargeFull.NOTICE_TYPE;
dto.NoticeTypeName = dischargeFull.NOTICE_TYPE_NAME;
return dto;
}).ToList();
return list;
}
#endregion
#region 推送及时消息
/// <summary>
/// 推送及时消息
/// </summary>
/// <param name="taskPkId">目的港未提货未返箱任务主键</param>
/// <returns>返回回执</returns>
[HttpGet("/PODDischargeGateoutFull/SendInstantMessage")]
public async Task<TaskManageOrderResultDto> SendInstantMessage(string taskPkId)
{
TaskManageOrderResultDto result = new TaskManageOrderResultDto();
var taskBase = _taskBaseRepository.AsQueryable().First(a => a.PK_ID == taskPkId);
if (taskBase == null)
throw Oops.Oh($"任务主键{taskPkId}无法获取业务信息");
var dischargeFull = _taskPODDischargeGateoutFullInfoRep.AsQueryable().First(a => a.TASK_ID == taskBase.PK_ID);
if (dischargeFull == null)
throw Oops.Oh($"目的港未提货未返箱主键{taskPkId}无法获取业务信息");
var detailList = _taskPODDischargeGateoutFullDetailInfoRep.AsQueryable()
.Where(a => a.P_ID == dischargeFull.PK_ID).ToList();
//如果都有订单订单记录,则提示错误不进行对应
if (!detailList.Any(t => t.BOOKING_ID.HasValue))
{
throw Oops.Oh($"当前目的港未提货未返箱没有匹配的订舱订单,不能执行操作");
}
var ids = detailList.Where(a => a.BOOKING_ID.HasValue).Select(a => a.BOOKING_ID.Value).ToList();
var bookingList = _bookingOrderRepository.AsQueryable().Filter(null, true)
.Where(a => ids.Contains(a.Id) && a.IsDeleted == false && (a.ParentId == null || a.ParentId == 0)).ToList();
if (bookingList.Count == 0)
throw Oops.Oh($"提单号未提取有效的订舱订单");
Dictionary<string, List<string>> msgList = new Dictionary<string, List<string>>();
msgList = bookingList.GroupBy(a => a.OP).Select(a =>
{
var currList = a.ToList();
return new { Key = a.Key, list = currList.Select(a => a.MBLNO).ToList() };
}).ToDictionary(a => a.Key, b => b.list);
if (msgList.Count > 0)
{
msgList.ForEach(t =>
{
string title = "目的港未提货消息";
if (dischargeFull.NOTICE_TYPE == "GATEOUT_FULL")
title = "提箱未返空箱消息";
DingTalkGroupHelper.SendDingTalkGroupMessage("KangqianNotify", title, $"@{t.Key} 收到如下提单号{(string.Join(",", t.Value.ToArray()))}的{title}消息");
});
}
if (detailList.Any(t => !t.BOOKING_ID.HasValue))
throw Oops.Oh($"提单号{(string.Join(",", detailList.Where(t => !t.BOOKING_ID.HasValue).Select(t => t.MBL_NO).ToArray()))}未提取有效的订舱订单");
result.succ = true;
result.msg = "成功";
return result;
}
#endregion
#region 重新处理目的港未提货未返箱任务
/// <summary>
/// 重新处理目的港未提货未返箱任务
/// 对未匹配目的港未提货未返箱的任务记录重新对应订单
/// </summary>
/// <param name="taskPkId">目的港未提货未返箱任务主键</param>
/// <returns>返回回执</returns>
[HttpGet("/PODDischargeGateoutFull/SearchAndConnectBookingInfo")]
public async Task<TaskManageOrderResultDto> SearchAndConnectBookingInfo(string taskPkId)
{
TaskManageOrderResultDto result = new TaskManageOrderResultDto();
var taskBase = _taskBaseRepository.AsQueryable().First(a => a.PK_ID == taskPkId);
if (taskBase == null)
throw Oops.Oh($"任务主键{taskPkId}无法获取业务信息");
var dischargeFull = _taskPODDischargeGateoutFullInfoRep.AsQueryable().First(a => a.TASK_ID == taskBase.PK_ID);
if (dischargeFull == null)
throw Oops.Oh($"目的港未提货未返箱主键{taskPkId}无法获取业务信息");
var detailList = _taskPODDischargeGateoutFullDetailInfoRep.AsQueryable()
.Where(a => a.P_ID == dischargeFull.PK_ID).ToList();
//如果都有订单订单记录,则提示错误不进行对应
if (!detailList.Any(t => !t.BOOKING_ID.HasValue))
{
throw Oops.Oh($"目的港未提货未返箱已有匹配的订舱订单,不能执行操作");
}
var mblList = detailList.Select(a => a.MBL_NO).Distinct().ToList();
var bookingList = _bookingOrderRepository.AsQueryable().Filter(null, true)
.Where(a => mblList.Contains(a.MBLNO) && a.IsDeleted == false && (a.ParentId == null || a.ParentId == 0)).ToList();
if (bookingList.Count == 0)
throw Oops.Oh($"提单号未提取有效的订舱订单");
List<string> msgList = new List<string>();
detailList.ForEach(async t =>
{
//只处理没有订舱ID的记录
if (!t.BOOKING_ID.HasValue)
{
var currBook = bookingList.FirstOrDefault(p => p.MBLNO == t.MBL_NO);
if (currBook != null)
{
t.BOOKING_ID = currBook.Id;
t.UpdatedUserId = UserManager.UserId;
t.UpdatedUserName = UserManager.Name;
//更新任务BC
await _taskPODDischargeGateoutFullDetailInfoRep.AsUpdateable(t).UpdateColumns(it => new
{
it.BOOKING_ID,
it.UpdatedTime,
it.UpdatedUserId,
it.UpdatedUserName
}).ExecuteCommandAsync();
}
else
{
msgList.Add(t.MBL_NO);
}
}
});
if (msgList.Count > 0)
throw Oops.Oh($"提单号{(string.Join(",", msgList.ToArray()))}未提取有效的订舱订单");
result.succ = true;
result.msg = "成功";
return result;
}
#endregion
}
}

@ -0,0 +1,219 @@
using Furion.DynamicApiController;
using Furion.FriendlyException;
using Furion.JsonSerialization;
using ICSharpCode.SharpZipLib.Zip;
using Mapster;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using Myshipping.Application.Entity;
using Myshipping.Core;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Myshipping.Application
{
/// <summary>
/// 截单回执
/// </summary>
[ApiDescriptionSettings("Application", Name = "TaskManageSISubmitted", Order = 10)]
public class TaskManageSISubmittedService : ITaskManageSISubmittedService, IDynamicApiController
{
private readonly SqlSugarRepository<TaskSISubmitted> _taskSISubmittedRepository;
private readonly SqlSugarRepository<TaskBaseInfo> _taskBaseRepository;
private readonly SqlSugarRepository<BookingOrder> _bookingOrderRepository;
private readonly ILogger<TaskManageSISubmittedService> _logger;
private readonly IBookingValueAddedService _bookingValueAddedService;
public TaskManageSISubmittedService(ILogger<TaskManageSISubmittedService> logger,
SqlSugarRepository<TaskSISubmitted> taskSISubmittedRepository,
SqlSugarRepository<TaskBaseInfo> taskBaseRepository,
SqlSugarRepository<BookingOrder> bookingOrderRepository,
IBookingValueAddedService bookingValueAddedService)
{
_logger = logger;
_taskSISubmittedRepository = taskSISubmittedRepository;
_taskBaseRepository = taskBaseRepository;
_bookingOrderRepository = bookingOrderRepository;
_bookingValueAddedService = bookingValueAddedService;
}
#region 获取截单回执详情
/// <summary>
/// 获取截单回执详情
/// </summary>
/// <param name="pkId">截单回执主键</param>
/// <returns>返回回执</returns>
[HttpGet("/TaskManageSISubmitted/GetInfo")]
public async Task<TaskSISubmittedShowDto> GetInfo(string pkId)
{
TaskSISubmittedShowDto dto = new TaskSISubmittedShowDto();
var siSubmitted = _taskSISubmittedRepository.AsQueryable().First(a => a.PK_ID == pkId);
if (siSubmitted == null)
throw Oops.Oh($"截单回执主键{pkId}无法获取业务信息");
var taskBase = _taskBaseRepository.AsQueryable().First(a => a.PK_ID == siSubmitted.TASK_ID);
if (taskBase == null)
throw Oops.Oh($"任务主键无法获取业务信息");
dto = siSubmitted.Adapt<TaskSISubmittedShowDto>();
if (dto != null)
{
dto.IsComplete = taskBase.IS_COMPLETE == 1 ? true : false;
dto.CompleteTime = taskBase.COMPLETE_DATE;
}
return dto;
}
#endregion
#region 通过任务主键获取截单回执详情
/// <summary>
/// 通过任务主键获取截单回执详情
/// </summary>
/// <param name="taskPkId">截单回执任务主键</param>
/// <returns>返回回执</returns>
[HttpGet("/TaskManageSISubmitted/GetInfoByTaskId")]
public async Task<TaskSISubmittedShowDto> GetInfoByTaskId(string taskPkId)
{
TaskSISubmittedShowDto dto = new TaskSISubmittedShowDto();
var taskBase = _taskBaseRepository.AsQueryable().First(a => a.PK_ID == taskPkId);
if (taskBase == null)
throw Oops.Oh($"任务主键{taskPkId}无法获取业务信息");
var siSubmitted = _taskSISubmittedRepository.AsQueryable().First(a => a.TASK_ID == taskBase.PK_ID);
if (siSubmitted == null)
throw Oops.Oh($"截单回执主键{taskPkId}无法获取业务信息");
dto = siSubmitted.Adapt<TaskSISubmittedShowDto>();
if (dto != null)
{
dto.IsComplete = taskBase.IS_COMPLETE == 1 ? true : false;
dto.CompleteTime = taskBase.COMPLETE_DATE;
}
return dto;
}
#endregion
#region 同步更新订舱订单的截单状态
/// <summary>
/// 同步更新订舱订单的截单状态
/// </summary>
/// <param name="taskPkId">截单回执任务主键</param>
/// <returns>返回回执</returns>
[HttpGet("/TaskManageSISubmitted/SyncBookingSIStatus")]
public async Task<TaskManageOrderResultDto> SyncBookingSIStatus(string taskPkId)
{
TaskManageOrderResultDto result = new TaskManageOrderResultDto();
var taskBase = _taskBaseRepository.AsQueryable().First(a => a.PK_ID == taskPkId);
if (taskBase == null)
throw Oops.Oh($"任务主键{taskPkId}无法获取业务信息");
var siSubmitted = _taskSISubmittedRepository.AsQueryable().First(a => a.TASK_ID == taskBase.PK_ID);
if (siSubmitted == null)
throw Oops.Oh($"截单回执主键{taskPkId}无法获取业务信息");
if(!siSubmitted.BOOKING_ID.HasValue|| siSubmitted.BOOKING_ID.Value < 1)
throw Oops.Oh($"当前截单回执未匹配到对应的订舱订单,请重对应截单");
var bookingOrder = _bookingOrderRepository.AsQueryable()
.FirstAsync(a => a.Id == siSubmitted.BOOKING_ID.Value);
if (bookingOrder == null)
throw Oops.Oh($"订舱订单信息获取失败");
//推送截单货物状态
var pushModel = new ModifyServiceProjectStatusDto
{
BookingId = bookingOrder.Id,
SourceType = TrackingSourceTypeEnum.AUTO,
StatusCodes = new List<ModifyServiceProjectStatusDetailDto> {
new ModifyServiceProjectStatusDetailDto { StatusCode = "JD" } }
};
if (siSubmitted.NOTICE_DATE.HasValue)
{
pushModel.StatusCodes[0].SetActDate = siSubmitted.NOTICE_DATE.Value;
}
var saveStatusRlt = await _bookingValueAddedService.SaveServiceStatus(pushModel);
_logger.LogInformation("请求JSON={json} 异步推送服务状态[JD 截单]完成,结果={rlt}", JSON.Serialize(pushModel), JSON.Serialize(saveStatusRlt));
result.succ = true;
result.msg = "成功";
return result;
}
#endregion
#region 重新处理截单任务
/// <summary>
/// 重新处理截单任务
/// 对未匹配订舱订单的任务记录重新对应订单订单
/// </summary>
/// <param name="taskPkId">截单回执任务主键</param>
/// <returns>返回回执</returns>
[HttpGet("/TaskManageSISubmitted/SearchAndConnectBookingInfo")]
public async Task<TaskManageOrderResultDto> SearchAndConnectBookingInfo(string taskPkId)
{
TaskManageOrderResultDto result = new TaskManageOrderResultDto();
var taskBase = _taskBaseRepository.AsQueryable().First(a => a.PK_ID == taskPkId);
if (taskBase == null)
throw Oops.Oh($"任务主键{taskPkId}无法获取业务信息");
var siSubmitted = _taskSISubmittedRepository.AsQueryable().First(a => a.TASK_ID == taskBase.PK_ID);
if (siSubmitted == null)
throw Oops.Oh($"截单回执主键{taskPkId}无法获取业务信息");
if (siSubmitted.BOOKING_ID.HasValue)
throw Oops.Oh($"当前截单回执已有匹配的订舱订单");
string mblNo = siSubmitted.MBL_NO.ToUpper().Trim();
var bookingInfo = _bookingOrderRepository.AsQueryable().Filter(null, true)
.FirstAsync(a => a.MBLNO == mblNo && a.IsDeleted == false && (a.ParentId == null || a.ParentId == 0));
if(bookingInfo == null)
throw Oops.Oh($"提单号{mblNo}未提取有效的订舱订单");
siSubmitted.BOOKING_ID = bookingInfo.Id;
siSubmitted.UpdatedUserId = UserManager.UserId;
siSubmitted.UpdatedUserName = UserManager.Name;
//更新任务BC
await _taskSISubmittedRepository.AsUpdateable(siSubmitted).UpdateColumns(it => new
{
it.BOOKING_ID,
it.UpdatedTime,
it.UpdatedUserId,
it.UpdatedUserName
}).ExecuteCommandAsync();
result.succ = true;
result.msg = "成功";
return result;
}
#endregion
}
}

@ -74,7 +74,7 @@ namespace Myshipping.Application
public class TaskManageService : ITaskManageService, IDynamicApiController, ITransient
{
private readonly SqlSugarRepository<TaskBaseInfo> _taskBaseInfoRepository;
private readonly SqlSugarRepository<TaskSIFeedBackInfo> _taskSIFeedBackInfoRepository;
private readonly SqlSugarRepository<TaskSISubmitted> _taskSISubmittedRepository;
private readonly SqlSugarRepository<TaskSIFeedBackContaInfo> _taskSIFeedBackContaInfoRepository;
private readonly SqlSugarRepository<TaskBillFeeDetailInfo> _taskBillFeeDetailInfoRepository;
private readonly SqlSugarRepository<TaskFileInfo> _taskFileInfoRepository;
@ -109,6 +109,10 @@ namespace Myshipping.Application
private readonly SqlSugarRepository<TaskRollingNominationInfo> _taskRollingNominationInfoRepository;
private readonly SqlSugarRepository<TaskRollingNominationShipInfo> _taskRollingNominationShipInfoRepository;
private readonly SqlSugarRepository<TaskRollingNominationDetailInfo> _taskRollingNominationDetailInfoRepository;
private readonly SqlSugarRepository<TaskDraftInfo> _taskDraftInfoRepository;
private readonly SqlSugarRepository<TaskPODDischargeGateoutFullInfo> _taskPODDischargeGateoutFullInfoRepository;
private readonly SqlSugarRepository<TaskPODDischargeGateoutFullDetailInfo> _taskPODDischargeGateoutFullDetailInfoRepository;
private readonly IDjyWebsiteAccountConfigService _webAccountConfig;
private readonly ISysCacheService _cache;
@ -132,7 +136,7 @@ namespace Myshipping.Application
const int LARA_PARER_DRAFT_VAR = 3;
public TaskManageService(SqlSugarRepository<TaskBaseInfo> taskBaseInfoRepository,
SqlSugarRepository<TaskSIFeedBackInfo> taskSIFeedBackInfoRepository,
SqlSugarRepository<TaskSISubmitted> taskSISubmittedRepository,
SqlSugarRepository<TaskSIFeedBackContaInfo> taskSIFeedBackContaInfoRepository,
SqlSugarRepository<TaskBillFeeDetailInfo> taskBillFeeDetailInfoRepository,
SqlSugarRepository<TaskFileInfo> taskFileInfoRepository,
@ -164,6 +168,9 @@ namespace Myshipping.Application
SqlSugarRepository<TaskRollingNominationDetailInfo> taskRollingNominationDetailInfoRepository,
SqlSugarRepository<BookingCtnVGM> bookingCtnVGMRepository,
SqlSugarRepository<BookingSlotBase> bookingSlotBaseRepository,
SqlSugarRepository<TaskDraftInfo> taskDraftInfoRepository,
SqlSugarRepository<TaskPODDischargeGateoutFullInfo> taskPODDischargeGateoutFullInfoRepository,
SqlSugarRepository<TaskPODDischargeGateoutFullDetailInfo> taskPODDischargeGateoutFullDetailInfoRepository,
INamedServiceProvider<IBookingOrderService> namedBookingOrderServiceProvider,
IDjyWebsiteAccountConfigService webAccountConfig,
ISysCacheService cache,
@ -174,7 +181,7 @@ namespace Myshipping.Application
ILogger<BookingOrderService> logger)
{
_taskBaseInfoRepository = taskBaseInfoRepository;
_taskSIFeedBackInfoRepository = taskSIFeedBackInfoRepository;
_taskSISubmittedRepository = taskSISubmittedRepository;
_taskSIFeedBackContaInfoRepository = taskSIFeedBackContaInfoRepository;
_taskBillFeeDetailInfoRepository = taskBillFeeDetailInfoRepository;
_taskFileInfoRepository = taskFileInfoRepository;
@ -219,6 +226,9 @@ namespace Myshipping.Application
_logger = logger;
_bookingSlotBaseRepository = bookingSlotBaseRepository;
_taskDraftInfoRepository = taskDraftInfoRepository;
_taskPODDischargeGateoutFullInfoRepository = taskPODDischargeGateoutFullInfoRepository;
_taskPODDischargeGateoutFullDetailInfoRepository = taskPODDischargeGateoutFullDetailInfoRepository;
}
#region 创建任务
@ -565,21 +575,22 @@ namespace Myshipping.Application
if (info.Main.SIFeedBack == null)
throw Oops.Oh($"任务类型={info.Main.TaskType.ToString()} SIFeedBack信息必传");
TaskSIFeedBackInfo taskSIFeedBackInfo = info.Main.SIFeedBack.Adapt<TaskSIFeedBackInfo>();
TaskSISubmitted taskSISubmitted = info.Main.SIFeedBack.Adapt<TaskSISubmitted>();
taskSIFeedBackInfo.PK_ID = IDGen.NextID().ToString();
taskSIFeedBackInfo.TASK_PKID = taskInfo.PK_ID;
taskSISubmitted.PK_ID = IDGen.NextID().ToString();
taskSISubmitted.TASK_ID = taskInfo.PK_ID;
taskSIFeedBackInfo.CreatedTime = taskInfo.CreatedTime;
taskSIFeedBackInfo.UpdatedTime = taskInfo.CreatedTime;
taskSISubmitted.CreatedTime = taskInfo.CreatedTime;
taskSISubmitted.UpdatedTime = taskInfo.CreatedTime;
taskSIFeedBackInfo.CreatedUserId = taskInfo.CreatedUserId;
taskSIFeedBackInfo.CreatedUserName = taskInfo.CreatedUserName;
taskSIFeedBackInfo.TenantId = taskInfo.TenantId;
taskSIFeedBackInfo.TenantName = taskInfo.TenantName;
taskSISubmitted.CreatedUserId = taskInfo.CreatedUserId;
taskSISubmitted.CreatedUserName = taskInfo.CreatedUserName;
taskSISubmitted.TenantId = taskInfo.TenantId;
taskSISubmitted.TenantName = taskInfo.TenantName;
await _taskSIFeedBackInfoRepository.InsertAsync(taskSIFeedBackInfo);
await _taskSISubmittedRepository.InsertAsync(taskSISubmitted);
/*
//SI反馈箱信息入库
if (info.Main.SIFeedBack.ContaList != null && info.Main.SIFeedBack.ContaList.Count > 0)
{
@ -600,7 +611,7 @@ namespace Myshipping.Application
await _taskSIFeedBackContaInfoRepository.InsertAsync(contaInfo);
});
}
}*/
}
#endregion
@ -1234,7 +1245,66 @@ namespace Myshipping.Application
#endregion
#region DRAFT转发客户
if (info.Main.TaskType == TaskBaseTypeEnum.DRAFT)
{
TaskDraftInfo taskDraftInfo = info.Main.DraftInfo.Adapt<TaskDraftInfo>();
taskDraftInfo.PK_ID = IDGen.NextID().ToString();
taskDraftInfo.TASK_ID = taskInfo.PK_ID;
taskDraftInfo.CreatedTime = taskInfo.CreatedTime;
taskDraftInfo.UpdatedTime = taskInfo.CreatedTime;
taskDraftInfo.CreatedUserId = taskInfo.CreatedUserId;
taskDraftInfo.CreatedUserName = taskInfo.CreatedUserName;
taskDraftInfo.TenantId = taskInfo.TenantId;
taskDraftInfo.TenantName = taskInfo.TenantName;
await _taskDraftInfoRepository.InsertAsync(taskDraftInfo);
}
#endregion
#region 任务目的港未提货/任务目的港提货未返空
if (info.Main.TaskType == TaskBaseTypeEnum.POD_DISCHARGE_FULL)
{
TaskPODDischargeGateoutFullInfo dischargeGateout = info.Main.PODDischargeGateoutFull.Adapt<TaskPODDischargeGateoutFullInfo>();
dischargeGateout.PK_ID = IDGen.NextID().ToString();
dischargeGateout.TASK_ID = taskInfo.PK_ID;
dischargeGateout.CreatedTime = taskInfo.CreatedTime;
dischargeGateout.UpdatedTime = taskInfo.CreatedTime;
dischargeGateout.CreatedUserId = taskInfo.CreatedUserId;
dischargeGateout.CreatedUserName = taskInfo.CreatedUserName;
dischargeGateout.TenantId = taskInfo.TenantId;
dischargeGateout.TenantName = taskInfo.TenantName;
await _taskPODDischargeGateoutFullInfoRepository.InsertAsync(dischargeGateout);
//明细入库
if (info.Main.PODDischargeGateoutFull.DetailList != null
&& info.Main.PODDischargeGateoutFull.DetailList.Count > 0)
{
info.Main.PODDischargeGateoutFull.DetailList.ForEach(async ctn =>
{
var detailInfo = ctn.Adapt<TaskPODDischargeGateoutFullDetailInfo>();
detailInfo.PK_ID = IDGen.NextID().ToString();
detailInfo.P_ID = dischargeGateout.PK_ID;
detailInfo.CreatedTime = taskInfo.CreatedTime;
detailInfo.UpdatedTime = taskInfo.CreatedTime;
detailInfo.CreatedUserId = taskInfo.CreatedUserId;
detailInfo.CreatedUserName = taskInfo.CreatedUserName;
detailInfo.TenantId = taskInfo.TenantId;
detailInfo.TenantName = taskInfo.TenantName;
await _taskPODDischargeGateoutFullDetailInfoRepository.InsertAsync(detailInfo);
});
}
}
#endregion
if (info.Main.SerialMsgInfo != null)
@ -4162,7 +4232,7 @@ namespace Myshipping.Application
model.TaskId = taskInfo.PK_ID;
var siFeedBackList = _taskSIFeedBackInfoRepository.EntityContext.Queryable<TaskSIFeedBackInfo>()
var siFeedBackList = _taskSISubmittedRepository.EntityContext.Queryable<TaskSIFeedBackInfo>()
.InnerJoin<TaskSIFeedBackContaInfo>((si, ctn) => si.PK_ID == ctn.P_PKID)
.Where((si, ctn) => si.TASK_PKID == model.TaskId && si.TenantId == UserManager.TENANT_ID)
.Select((si, ctn) => new { si = si, ctn = ctn }).ToList();

Loading…
Cancel
Save