wanghaomei 6 months ago
commit 92cc9f99b2

@ -827,6 +827,9 @@ namespace Myshipping.Application.EDI
r.WriteLine("TSR+30+2'");
}
//2024-05-22 少了一行计数追加上 JHQ
//icount = icount + 1;
var str_pay = "";
if (bill.BLFRT.IndexOf("PREPAID") >= 0)
str_pay = bill.PREPARDAT;
@ -869,9 +872,9 @@ namespace Myshipping.Application.EDI
}
/*件重尺*/
r.WriteLine("CNT+7:" + Math.Round(bill.KGS,3) + ":KGM'");//按照四舍五入的国际标准
r.WriteLine("CNT+7:" + Math.Round(bill.KGS, 3) + ":KGM'");//按照四舍五入的国际标准
r.WriteLine("CNT+11:" + bill.PKGS.ToString() + "'");
r.WriteLine("CNT+15:" + Math.Round(bill.CBM,3) + ":MTQ'");
r.WriteLine("CNT+15:" + Math.Round(bill.CBM, 3) + ":MTQ'");
icount = icount + 3;
@ -906,23 +909,31 @@ namespace Myshipping.Application.EDI
}
if (InttrEdi.UseForWarderCode)
if (bill.CARRIEREDICODE == "ANNU" || bill.CARRIEREDICODE == "CMDU" || bill.CARRIEREDICODE == "CHNL")
{
r.WriteLine("RFF+FF:" + bill.ORDERNO.Trim() + "'");
r.WriteLine("RFF+ON:" + bill.ORDERNO.Trim() + "'");
icount = icount + 2;
icount = icount + 1;
}
else
{
if (bill.ORDERNO.Trim() != "")
if (InttrEdi.UseForWarderCode)
{
r.WriteLine("RFF+FF:" + bill.ORDERNO.Trim() + "'");
r.WriteLine("RFF+ON:" + bill.ORDERNO.Trim() + "'");
icount = icount + 2;
}
else
{
if (bill.ORDERNO.Trim() != "")
{
r.WriteLine("RFF+FF:" + bill.ORDERNO.Trim() + "'");
r.WriteLine("RFF+ON:" + bill.ORDERNO.Trim() + "'");
icount = icount + 2;
}
}
}
if (bill.CARRIEREDICODE != "COSU")
if (bill.CARRIEREDICODE != "COSU" && !string.IsNullOrWhiteSpace(bill.MBLNO))
{
if (bill.CARRIEREDICODE == "HLCU")
{
@ -936,6 +947,7 @@ namespace Myshipping.Application.EDI
}
icount = icount + 2;
}
r.WriteLine("RFF+CT:" + bill.CONTRACTNO + "'");
if (bill.BLFRT.IndexOf("PREPAID") >= 0)
@ -1256,6 +1268,7 @@ namespace Myshipping.Application.EDI
else
r.WriteLine("NAD+FW+++" + formatEdiStr("txt", bill.WEITUO) + "'");
icount = icount + 1;
}
else
{
@ -1263,7 +1276,7 @@ namespace Myshipping.Application.EDI
if (InttrEdi.UseForWarderCode)
{
r.WriteLine("NAD+FW+" + InttrEdi.ForWarderCode + ":160:86++" + InttrEdi.ForWarderName + "'");
icount++;
icount = icount + 1;
}
else
{
@ -1271,6 +1284,8 @@ namespace Myshipping.Application.EDI
r.WriteLine("NAD+FW+" + InttrEdi.SENDCODE + ":160:86++" + InttrEdi.SENDNAME.Substring(0, 35) + "+" + InttrEdi.SENDNAME.Substring(35) + "'");
else
r.WriteLine("NAD+FW+" + InttrEdi.SENDCODE + ":160:86++" + InttrEdi.SENDNAME + "'");
icount = icount + 1;
}
}

@ -1053,6 +1053,11 @@ namespace Myshipping.Application.Entity
/// </summary>
public string SERVICECODE { get; set; }
/// <summary>
/// 是否为舱位拆票后生成的订舱
/// </summary>
public bool IsSplit { get; set; }
/// <summary>
/// 分单操作ID
/// </summary>

@ -391,5 +391,10 @@ namespace Myshipping.Application
/// 处理时间
/// </summary>
public Nullable<DateTime> PROCESS_DATE { get; set; }
/// <summary>
/// 计费日期
/// </summary>
public Nullable<DateTime> PRICE_CALCULATION_DATE { get; set; }
}
}

@ -0,0 +1,64 @@
using Myshipping.Application.Entity;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Myshipping.Application
{
/// <summary>
/// 重要任务提醒明细
/// </summary>
[SugarTable("task_caution_notice_detail")]
[Description("重要任务提醒明细")]
public class TaskCautionNoticeDetailInfo : TaskManageDbEntity
{
/// <summary>
/// 任务提醒主键
/// </summary>
public string P_ID { get; set; }
/// <summary>
/// 通知人ID
/// </summary>
public string NOTIFY_USER_ID { get; set; }
/// <summary>
/// 被通知人名称
/// </summary>
public string NOTIFY_USER_NAME { get; set; }
/// <summary>
/// 被通知方式
/// </summary>
public string NOTIFY_METHOD { get; set; }
/// <summary>
/// 被通知人手机
/// </summary>
public string NOTIFY_MOBILE { get; set; }
/// <summary>
/// 被通知人邮箱
/// </summary>
public string NOTIFY_EMAIL { get; set; }
/// <summary>
/// 状态
/// </summary>
public string STATUS { get; set; }
/// <summary>
/// 状态名称
/// </summary>
public string STATUS_NAME { get; set; }
/// <summary>
/// 重试次数
/// </summary>
public int RETRY_NUM { get; set; }
}
}

@ -0,0 +1,94 @@
using Myshipping.Application.Entity;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Myshipping.Application
{
/// <summary>
/// 重要任务提醒
/// </summary>
[SugarTable("task_caution_notice")]
[Description("重要任务提醒")]
public class TaskCautionNoticeInfo : TaskManageDbEntity
{
/// <summary>
/// 任务主键
/// </summary>
public string TASK_ID { get; set; }
/// <summary>
/// 来源系统
/// </summary>
public string SOURCE_SYSTEM { get; set; }
/// <summary>
/// 来源业务类型
/// </summary>
public string SOURCE_BUSI_TYPE { get; set; }
/// <summary>
/// 来源业务类型名称
/// </summary>
public string SOURCE_BUSI_TYPENAME { get; set; }
/// <summary>
/// 通知内容
/// </summary>
public string NOTIFY_CONTENT { get; set; }
/// <summary>
/// 提单号
/// </summary>
public string MBL_NO { get; set; }
/// <summary>
/// 船公司
/// </summary>
public string CARRIER { get; set; }
/// <summary>
/// 是否计费周差异 1-是 0-否
/// </summary>
public bool IS_WEEK_DIFF { get; set; }
/// <summary>
/// 是否计费日差异 1-是 0-否
/// </summary>
public bool IS_PRICE_DATE_DIFF { get; set; }
/// <summary>
/// 是否转为中转 1-是 0-否
/// </summary>
public bool IS_TRANSFER { get; set; }
/// <summary>
/// 是否船名变化 1-是 0-否
/// </summary>
public bool IS_VESSEL_CHANGE { get; set; }
/// <summary>
/// 是否截止时间提前 1-是 0-否
/// </summary>
public bool IS_CUT_DATE_ADVANCED { get; set; }
/// <summary>
/// 订舱ID
/// </summary>
public Nullable<long> BOOKING_ID { get; set; }
/// <summary>
/// 舱位ID
/// </summary>
public Nullable<long> BOOKING_SLOT_ID { get; set; }
/// <summary>
/// 任务ID
/// </summary>
public string SOURCE_TASK_ID { get; set; }
}
}

@ -0,0 +1,74 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Myshipping.Application
{
/// <summary>
/// 重要提醒任务类型枚举
/// </summary>
public enum CautionNoticeTaskEnum
{
/// <summary>
/// 计费周差异
/// </summary>
[Description("计费周差异")]
WeekAt,
/// <summary>
/// 计费日期差异
/// </summary>
[Description("计费日期差异")]
PriceCalcDate,
/// <summary>
/// 直达转为中转
/// </summary>
[Description("直达转为中转")]
ChangeTransfer,
/// <summary>
/// 船名航次变化
/// </summary>
[Description("船名航次变化")]
ChangeVesselVoyno,
/// <summary>
/// 截止时间提前
/// </summary>
[Description("截止时间提前")]
CutDateAdvanced
}
public enum CautionNoticeMethodEnum
{
/// <summary>
/// 钉钉消息
/// </summary>
[Description("钉钉消息")]
DingDing,
/// <summary>
/// 邮件提醒
/// </summary>
[Description("邮件提醒")]
Email
}
public enum TaskCautionNoticeStatusEnum
{
/// <summary>
/// 暂存
/// </summary>
[Description("暂存")]
TEMP,
/// <summary>
/// 消息发送成功
/// </summary>
[Description("消息发送成功")]
SUCC,
/// <summary>
/// 消息发送失败
/// </summary>
[Description("消息发送失败")]
FAILURE
}
}

@ -149,15 +149,46 @@ namespace Myshipping.Application.Event
else
{
// 已使用舱位数
stockObj.USE_NUM = lstAllocKeyList.DistinctBy(x => x.BOOKING_SLOT_ID).Count();
//stockObj.USE_NUM = lstAllocKeyList.DistinctBy(x => x.BOOKING_SLOT_ID).Count();
// 订舱引用表主键列表
var lstAllocIdList = lstAllocKeyList.Select(x => x.Id).ToList();
var allocIdList = lstAllocKeyList.Select(x => x.Id).ToList();
var allocSlotIdList = lstAllocKeyList.Select(x => x.BOOKING_SLOT_ID).Distinct().ToList();
var userCtnNumList = await _repAllocCtn.AsQueryable().Filter(null, true)
.Where(x => !x.IsDeleted && allocIdList.Contains(x.SLOT_ALLOC_ID))
.GroupBy(x => x.SLOT_ALLOC_ID)
.Select(x => new
{
x.SLOT_ALLOC_ID,
CTNNUM = SqlFunc.AggregateSum(x.CTNNUM)
}).ToListAsync();
var hasCtnNumList = await _repCtn.AsQueryable().Filter(null, true)
.Where(x => !x.IsDeleted && allocSlotIdList.Contains(x.SLOT_ID))
.GroupBy(x => x.SLOT_ID)
.Select(x => new
{
x.SLOT_ID,
CTNNUM = SqlFunc.AggregateSum(x.CTNNUM)
})
.ToListAsync();
var useNum = 0;
foreach (long slotId in allocSlotIdList)
{
List<long> temp1 = lstAllocKeyList.Where(x => x.BOOKING_SLOT_ID == slotId).Select(x => x.Id).ToList();
var userNum = userCtnNumList.Where(x => temp1.Contains(x.SLOT_ALLOC_ID)).Sum(x => x.CTNNUM);
var hasNum = hasCtnNumList.Where(x => x.SLOT_ID == slotId).Sum(x => x.CTNNUM);
if (userNum >= hasNum)
{
useNum++;
}
}
// 已使用舱位数
stockObj.USE_NUM = useNum;
// 已使用的箱型箱量
var userCtnList = await _repAllocCtn.AsQueryable()
.Filter(null, true)
.Where(x => !x.IsDeleted && lstAllocIdList.Contains(x.SLOT_ALLOC_ID))
.Where(x => !x.IsDeleted && allocIdList.Contains(x.SLOT_ALLOC_ID))
.GroupBy(x => x.CTNALL)
.Select(x => new
{

@ -0,0 +1,167 @@
using Furion;
using Furion.DependencyInjection;
using Furion.DistributedIDGenerator;
using Furion.EventBus;
using Furion.FriendlyException;
using Furion.JsonSerialization;
using MathNet.Numerics.LinearAlgebra.Factorization;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Myshipping.Application.Entity;
using Myshipping.Core;
using NPOI.SS.Formula.Functions;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Myshipping.Application.Event
{
/// <summary>
/// 重要通知任务订阅
/// </summary>
public class CautionNoticeTaskSubscriber : IEventSubscriber
{
private IServiceProvider _services { get; }
private readonly ILogger<CautionNoticeTaskSubscriber> _logger;
private readonly INamedServiceProvider<ITaskManageService> _namedTaskManageServiceProvider;
public CautionNoticeTaskSubscriber(IServiceProvider services, ILogger<CautionNoticeTaskSubscriber> logger,
INamedServiceProvider<ITaskManageService> namedTaskManageServiceProvider)
{
_services = services;
_logger = logger;
_namedTaskManageServiceProvider = namedTaskManageServiceProvider;
}
/// <summary>
/// 新增重要通知任务
/// </summary>
/// <param name="context">订阅上下文</param>
/// <returns></returns>
[EventSubscribe("CautionNoticeTask:Add")]
public async Task CautionNoticeTaskAdd(EventHandlerExecutingContext context)
{
_logger.LogInformation($"收到更新订阅请求:{context.Source.Payload}");
var paraObj = context.Source.Payload;
using var scope = _services.CreateScope();
var bookingRepo = scope.ServiceProvider.GetRequiredService<SqlSugarRepository<BookingOrder>>();
var bookingSlotRepo = scope.ServiceProvider.GetRequiredService<SqlSugarRepository<BookingSlotBase>>();
var service = _namedTaskManageServiceProvider.GetService(nameof(TaskManageService));
DateTime nowDate = DateTime.Now;
/*
1
2OPOP
3OP
*/
CautionNoticeTaskDto dto = GetInfo(paraObj);
//生成任务
if (dto.cautionNoticeType == CautionNoticeTaskEnum.WeekAt)
{
TaskManageOrderMessageInfo messageInfo = new TaskManageOrderMessageInfo
{
Head = new TaskManageOrderMessageHeadInfo
{
GID = IDGen.NextID().ToString(),
MessageType = "CAUTION_TASK",
SenderId = "CautionNoticeTask",
SenderName = "重要提醒任务生成",
ReceiverId = "TaskManage",
ReceiverName = "任务台",
RequestDate = nowDate.ToString("yyyy-MM-dd HH:mm:ss.fff"),
Version = "1.0",
RequestAction = "Add"
},
Main = new TaskManageOrderMessageMainInfo
{
TaskType = TaskBaseTypeEnum.CAUTION_NOTICE,
}
};
BookingSlotBase slotInfo = null;
BookingOrder bookingOrder = null;
string mblNo = string.Empty;
string vesselVoyno = string.Empty;
string etd = string.Empty;
if (dto.bookingSlotId > 0)
{
slotInfo = bookingSlotRepo.AsQueryable().Filter(null, true).First(x => x.Id == dto.bookingSlotId);
}
if (dto.bookingId > 0)
{
bookingOrder = bookingRepo.AsQueryable().Filter(null, true).First(x => x.Id == dto.bookingId);
}
messageInfo.Main.TaskTenatId = slotInfo.TenantId;
messageInfo.Main.TaskTenatName = slotInfo.TenantName;
if (slotInfo != null)
{
if (slotInfo.CARRIERID.Equals("MSK", StringComparison.OrdinalIgnoreCase))
{
mblNo = slotInfo.SLOT_BOOKING_NO;
messageInfo.Main.MBlNo = slotInfo.SLOT_BOOKING_NO;
messageInfo.Main.ETD = slotInfo.ETD;
vesselVoyno = $"{(slotInfo.VESSEL ?? "")}/{slotInfo.VOYNO ?? ""}";
messageInfo.Main.VesselVoyno = vesselVoyno;
messageInfo.Main.TaskUserId = dto.userId.ToString();
messageInfo.Main.TaskUserName = dto.userName;
messageInfo.Main.CarrierId = slotInfo.CARRIERID;
}
}
if (bookingOrder != null)
{
messageInfo.Main.CustomerId = bookingOrder.CUSTOMERID;
messageInfo.Main.CustomerName = bookingOrder.CUSTOMERNAME;
}
messageInfo.Main.TaskTitle = $"重要提醒-计费周发生变更 {vesselVoyno} {etd} BLNo:{mblNo}";
messageInfo.Main.TaskDesp = $"重要提醒-计费周发生变更 {vesselVoyno} {etd} BLNo:{mblNo}";
messageInfo.Main.CautionNoticeInfo = new TaskManageOrderCautionNoticeInfo
{
};
var rlt = await service.CreateTaskJob(messageInfo);
}
}
private CautionNoticeTaskDto GetInfo(object payload)
{
CautionNoticeTaskDto dto = null;
try
{
dto = JSON.Deserialize<CautionNoticeTaskDto>(JSON.Serialize(payload));
}
catch(Exception ex)
{
_logger.LogInformation($"解析订阅参数失败,原因:{ex.Message}");
throw Oops.Bah($"解析订阅参数失败,原因:{ex.Message}");
}
return dto;
}
}
}

@ -1545,7 +1545,7 @@ namespace Myshipping.Application
//陈冠宇提订舱编号不允许重复
if (!string.IsNullOrWhiteSpace(input.CUSTNO))
{
var et = await _rep.AsQueryable().Filter(null, true).AnyAsync(x => x.IsDeleted == false && x.CUSTNO == input.CUSTNO && x.TenantId == UserManager.TENANT_ID && x.ParentId == 0 && x.Id != input.Id);
var et = await _rep.AsQueryable().Filter(null, true).AnyAsync(x => x.IsDeleted == false && x.IsSplit == false && x.CUSTNO == input.CUSTNO && x.TenantId == UserManager.TENANT_ID && x.ParentId == 0 && x.Id != input.Id);
if (et)
{
throw Oops.Bah("当前订舱编号已存在,请勿重复录入!");
@ -12758,5 +12758,68 @@ namespace Myshipping.Application
}
#endregion
#region 批量更新订舱的详情
/// <summary>
/// 批量更新订舱的详情
/// </summary>
/// <param name="dto">请求参数</param>
/// <returns></returns>
[HttpPost("/BookingOrder/BatchUpdateOrder")]
public async Task BatchUpdateOrder(BatchUpdate dto)
{
if (dto == null)
{
throw Oops.Bah("请求参数不能为空");
}
if(dto.Id.Count == 0)
throw Oops.Bah("未选中需要更新的订舱数据,请重新选择");
string version = Guid.NewGuid().ToString();
// 记录日志
var oldOrderList = await _rep.AsQueryable().Filter(null, true).Where(x => dto.Id.Contains(x.Id) && x.IsDeleted == false).ToListAsync();
if(dto.Id.Count != oldOrderList.Count)
throw Oops.Bah("订舱数据获取失败,部分订舱数据未获取到,订舱数据为空或已作废");
//oldOrderList.ForEach()
foreach (var oldOrder in oldOrderList)
{
var newOrder = oldOrder.Adapt<BookingOrder>();
newOrder.VERSION = version;
newOrder.VESSEL = dto.VESSEL;
newOrder.VOYNOINNER = dto.VOYNOINNER;
newOrder.ETD = dto.ETD;
newOrder.VOYNO = dto.VOYNO;
newOrder.PORTDISCHARGEID = dto.PORTDISCHARGEID;
newOrder.PORTDISCHARGE = dto.PORTDISCHARGE;
newOrder.DESTINATIONID = dto.DESTINATIONID;
newOrder.DESTINATION = dto.DESTINATION;
newOrder.CLOSINGDATE = dto.CLOSINGDATE;
newOrder.CLOSEDOCDATE = dto.CLOSEDOCDATE;
await SaveLog(newOrder, oldOrder, "批量编辑台账");
}
await _rep.UpdateAsync(x => dto.Id.Contains(x.Id), x => new BookingOrder
{
VERSION = version,
VESSEL = dto.VESSEL,
VOYNOINNER = dto.VOYNOINNER,
ETD = dto.ETD,
VOYNO = dto.VOYNO,
PORTDISCHARGEID = dto.PORTDISCHARGEID,
PORTDISCHARGE = dto.PORTDISCHARGE,
DESTINATIONID = dto.DESTINATIONID,
DESTINATION = dto.DESTINATION,
CLOSINGDATE = dto.CLOSINGDATE,
CLOSEDOCDATE = dto.CLOSEDOCDATE
});
await SendBookingOrder(dto.Id.ToArray());
}
#endregion
}
}

@ -62,6 +62,11 @@ namespace Myshipping.Application.Service.BookingOrder.Dto
/// 截单日期
/// </summary>
public DateTime? CLOSEDOCDATE { get; set; }
/// <summary>
/// 强制更新字段列表(默认只更新有值的字段,如果需要强制更新为空请将字段填写到此列表)
/// </summary>
public List<string> enforceUpdateField { get; set; }
}
/// <summary>

@ -9,7 +9,7 @@ namespace Myshipping.Application
/// <summary>
/// 订舱主表输出参数
/// </summary>
public class BookingOrderDto
public class BookingOrderDto
{
/// <summary>
/// 主键
@ -718,7 +718,7 @@ namespace Myshipping.Application
public string SourceName { get; set; }
#region 船舶日期相关
@ -858,6 +858,11 @@ namespace Myshipping.Application
/// </summary>
public BookingExtendState ExtendState { get; set; }
/// <summary>
/// 是否为舱位拆票后生成的订舱
/// </summary>
public bool IsSplit { get; set; }
/// <summary>
/// 分单操作ID
/// </summary>

@ -149,6 +149,11 @@ namespace Myshipping.Application
/// <returns>返回回执</returns>
Task<BookingOrderOutput> Save(SaveBookingOrderInput input);
/// <summary>
/// 批量更新订舱的详情
/// </summary>
/// <param name="dto">请求参数</param>
/// <returns></returns>
Task BatchUpdateOrder(BatchUpdate dto);
}
}

@ -1,4 +1,5 @@
using System;
using Myshipping.Application.Service.BookingSlot.Dto;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@ -126,5 +127,10 @@ namespace Myshipping.Application
/// 卖价
/// </summary>
public decimal? SELLING_PRICE { get; set; }
/// <summary>
/// 舱位箱信息
/// </summary>
public List<BookingSlotCtnDto> CtnList { get; set; }
}
}

@ -42,7 +42,8 @@ namespace Myshipping.Application
.Map(dest => dest.PortDischarge, src => src.PORTDISCHARGE)
.Map(dest => dest.Portload, src => src.PORTLOAD)
.Map(dest => dest.TransferPort1, src => src.TRANSFER_PORT_1)
.Map(dest => dest.TransferPort2, src => src.TRANSFER_PORT_2);
.Map(dest => dest.TransferPort2, src => src.TRANSFER_PORT_2)
.Map(dest => dest.PriceCalculationDate, src => src.PRICE_CALCULATION_DATE);
config.ForType<BookingSlotBaseApiSaveDto, TaskBCInfoDto>()
.Map(dest => dest.CarrierId, src => src.CARRIERID)
@ -73,7 +74,8 @@ namespace Myshipping.Application
.Map(dest => dest.PortDischarge, src => src.PORTDISCHARGE)
.Map(dest => dest.Portload, src => src.PORTLOAD)
.Map(dest => dest.TransferPort1, src => src.TRANSFER_PORT_1)
.Map(dest => dest.TransferPort2, src => src.TRANSFER_PORT_2);
.Map(dest => dest.TransferPort2, src => src.TRANSFER_PORT_2)
.Map(dest => dest.PriceCalculationDate, src => src.PRICE_CALCULATION_DATE);
config.ForType<TaskBCInfoReadDto, TaskBCInfoDto>()
.Map(dest => dest.CarrierId, src => src.CarrierId)

@ -22,10 +22,6 @@ namespace Myshipping.Application
Task<TaskManageOrderResultDto> ApiReceive(string jsonData, IFormFile file = null, IFormFile modifyFile = null);
Task<BookingSlotBaseSaveOutput> Detail(long id);
/// <summary>
/// 查询可用的舱位及箱子
/// </summary>
Task<SqlSugarPagedList<BookingSlotBaseWithCtnDto>> GetAvailableSlots(BookingSlotBaseDto input, PageWithTotal pageInfo);
/// <summary>
/// 查询可用的舱位及箱子列表
@ -52,8 +48,9 @@ namespace Myshipping.Application
/// <param name="slots">待引入的舱位列表</param>
/// <param name="bookingOrderId">待关联的订舱记录</param>
/// <param name="isCheck">是否进行剩余量检查</param>
/// <param name="generateModel">额外的用于生成管理记录的信息</param>
/// <returns>(是否成功,提示消息)</returns>
Task<(bool isSuccess, string message)> ImportSlots(List<BookingSlotBaseWithCtnDto> slots, long bookingOrderId, bool isCheck);
Task<(bool isSuccess, string message)> ImportSlots(List<BookingSlotBaseWithCtnDto> slots, long bookingOrderId, bool isCheck, BookingGenerateDto generateModel = null);
Task<dynamic> PageStock(BookingSlotStockPageInput input);
Task RefreshStock(BookingSlotStockUpdateModel input);
@ -122,12 +119,12 @@ namespace Myshipping.Application
Task<BookingSlotWithOrderDto> SearchBookingSlotWithOrderByNo(string slotBookingNo, long tenantId);
/// <summary>
/// 校验是否可以生成订舱订单
/// </summary>
/// <param name="id">舱位主键</param>
/// <returns>返回回执</returns>
Task<TaskManageOrderResultDto> ValidateCreateBookingOrder(long id);
///// <summary>
///// 校验是否可以生成订舱订单
///// </summary>
///// <param name="id">舱位主键</param>
///// <returns>返回回执</returns>
//Task<TaskManageOrderResultDto> ValidateCreateBookingOrder(long id);
/// <summary>
/// 批量发送邮件提醒(发送客户)
@ -153,5 +150,14 @@ namespace Myshipping.Application
/// <param name="reqBatchNo">请求批次号用来区分对应的哪个批次任务</param>
/// <returns></returns>
Task PushCompareBCInfo(TaskBCInfoDto bcSrcDto, TaskBCInfoDto bcTargetDto, long slotId, string reqBatchNo);
/// <summary>
/// 估算差异重要提醒
/// </summary>
/// <param name="bcSrcDto">原舱位详情</param>
/// <param name="bcTargetDto">新舱位详情</param>
/// <param name="slotId">舱位ID</param>
/// <returns></returns>
Task MeasureDiffCautionTask(TaskBCInfoDto bcSrcDto, TaskBCInfoDto bcTargetDto, long slotId);
}
}

@ -0,0 +1,63 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Myshipping.Application
{
public class CautionNoticeTaskDto
{
/// <summary>
/// WeekAt-计费周差异 PriceCalcDate-计费周差异
/// </summary>
public CautionNoticeTaskEnum cautionNoticeType { get; set; }
/// <summary>
/// 订舱ID
/// </summary>
public Nullable<long> bookingId { get; set; }
/// <summary>
/// 舱位ID
/// </summary>
public Nullable<long> bookingSlotId { get; set; }
/// <summary>
/// 任务ID
/// </summary>
public string taskPKId { get; set; }
/// <summary>
/// 创建日期
/// </summary>
public DateTime createTime { get; set; }
/// <summary>
/// 原值
/// </summary>
public string origVal { get; set; }
/// <summary>
/// 新值
/// </summary>
public string newVal { get; set; }
/// <summary>
/// 租户ID
/// </summary>
public long tenentId { get; set; }
/// <summary>
/// 用户ID
/// </summary>
public long userId { get; set; }
/// <summary>
/// 用户名称
/// </summary>
public string userName { get; set; }
}
}

@ -0,0 +1,115 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Myshipping.Application
{
/// <summary>
/// 重要提醒任务
/// </summary>
public class TaskManageOrderCautionNoticeInfo
{
/// <summary>
/// WeekAt-计费周差异 PriceCalcDate-计费周差异
/// </summary>
public CautionNoticeTaskEnum CautionNoticeType { get; set; }
/// <summary>
/// 订舱ID
/// </summary>
public Nullable<long> BookingId { get; set; }
/// <summary>
/// 舱位ID
/// </summary>
public Nullable<long> BookingSlotId { get; set; }
/// <summary>
/// 任务ID
/// </summary>
public string TaskPKId { get; set; }
/// <summary>
/// 创建日期
/// </summary>
public DateTime CreateTime { get; set; }
/// <summary>
/// 原值
/// </summary>
public string OrigVal { get; set; }
/// <summary>
/// 新值
/// </summary>
public string NewVal { get; set; }
/// <summary>
/// 提单号
/// </summary>
public string MBlNo { get; set; }
/// <summary>
/// 船公司
/// </summary>
public string Carrier { get; set; }
/// <summary>
/// 来源系统
/// </summary>
public string SourceSystem { get; set; }
/// <summary>
/// 来源业务类型
/// </summary>
public string SourceBusiType { get; set; }
/// <summary>
/// 来源业务类型名称
/// </summary>
public string SourceBusiTypeName { get; set; }
/// <summary>
/// 通知内容
/// </summary>
public string NotifyContent { get; set; }
/// <summary>
/// 消息列表
/// </summary>
public List<TaskManageOrderCautionNoticeDetailInfo> NoticeList { get; set; }
}
/// <summary>
///
/// </summary>
public class TaskManageOrderCautionNoticeDetailInfo
{
/// <summary>
/// 重要提醒消息类型
/// </summary>
public CautionNoticeMethodEnum CautionNoticeType { get; set; }
/// <summary>
/// 用户ID
/// </summary>
public string UserId { get; set; }
/// <summary>
/// 用户名称
/// </summary>
public string UserName { get; set; }
/// <summary>
/// 用户手机号
/// </summary>
public string Mobile { get; set; }
/// <summary>
/// 用户邮箱
/// </summary>
public string Email { get; set; }
}
}

@ -376,5 +376,10 @@ namespace Myshipping.Application
/// 批次号
/// </summary>
public string BatchNo { get; set; }
/// <summary>
/// 计费日期
/// </summary>
public Nullable<DateTime> PriceCalculationDate { get; set; }
}
}

@ -817,7 +817,8 @@ namespace Myshipping.Application
.Map(dest => dest.SECOND_ETD, src => src.SecondETD)
.Map(dest => dest.SECOND_ETA, src => src.SecondETA)
.Map(dest => dest.BOOKING_COMFIRM_DATE, src => src.BookingConfirmDate)
.Map(dest => dest.BATCH_NO, src => src.BatchNo);
.Map(dest => dest.BATCH_NO, src => src.BatchNo)
.Map(dest => dest.PRICE_CALCULATION_DATE, src => src.PriceCalculationDate);
config.ForType<TaskBCCTNInfo, TaskBCCTNInfoDto>()
.Map(dest => dest.CtnCode, src => src.CTNCODE)
@ -1143,6 +1144,21 @@ namespace Myshipping.Application
.Map(dest => dest.HSCode, src => src.HSCODE)
.Map(dest => dest.Description, src => src.DESCRIPTION)
.Map(dest => dest.KindPKGS, src => src.KINDPKGS);
config.ForType<TaskManageOrderCautionNoticeInfo, TaskCautionNoticeInfo>()
.Map(dest => dest.MBL_NO, src => src.MBlNo)
.Map(dest => dest.CARRIER, src => src.Carrier)
.Map(dest => dest.BOOKING_ID, src => src.BookingId)
.Map(dest => dest.BOOKING_SLOT_ID, src => src.BookingSlotId)
.Map(dest => dest.SOURCE_TASK_ID, src => src.TaskPKId)
.Map(dest => dest.NOTIFY_CONTENT, src => src.NotifyContent);
config.ForType<TaskManageOrderCautionNoticeDetailInfo, TaskCautionNoticeDetailInfo>()
.Map(dest => dest.NOTIFY_USER_ID, src => src.UserId)
.Map(dest => dest.NOTIFY_USER_NAME, src => src.UserName)
.Map(dest => dest.NOTIFY_EMAIL, src => src.Email)
.Map(dest => dest.NOTIFY_MOBILE, src => src.Mobile);
}
}
}

@ -346,5 +346,10 @@ namespace Myshipping.Application
/// 批次号
/// </summary>
public string BatchNo { get; set; }
/// <summary>
/// 计费时间
/// </summary>
public Nullable<DateTime> PriceCalculationDate { get; set; }
}
}

@ -234,5 +234,10 @@ namespace Myshipping.Application
/// 格式单
/// </summary>
public TaskManageOrderDraftInfo DraftInfo { get; set; }
}
/// <summary>
/// 重要通知
/// </summary>
public TaskManageOrderCautionNoticeInfo CautionNoticeInfo { get; set; }
}
}

@ -42,9 +42,9 @@ namespace Myshipping.Application
/// <summary>
/// 刷新预甩货对应订舱
/// </summary>
/// <param name="nominationId">预甩货主键</param>
/// <param name="taskPkId">预甩货主任务主键</param>
/// <returns>返回回执</returns>
Task<TaskManageOrderResultDto> RefreshBookingOrder(string nominationId);
Task<TaskManageOrderResultDto> RefreshBookingOrder(string taskPkId);
/// <summary>
/// 查看分享链接

@ -595,7 +595,7 @@ namespace Myshipping.Application
/// <summary>
/// 转移任务(将任务指定给其他人)
/// </summary>
/// <param name="taskPKId">BC任务主键</param>
/// <param name="taskPKId">BC任务主键,若多条以逗号分隔</param>
/// <param name="userId">用户ID</param>
/// <returns>返回回执</returns>
[HttpGet("/TaskManageBC/TransferTask")]
@ -605,16 +605,8 @@ namespace Myshipping.Application
try
{
/*
1
*/
var bcTaskInfo = await _taskBaseRepository.AsQueryable().FirstAsync(u => u.PK_ID == taskPKId);
if (bcTaskInfo == null)
{
throw Oops.Oh($"任务主键{taskPKId}无法获取业务信息");
}
if(userId < 0)
//判断用户信息有效性
if (userId < 0)
throw Oops.Oh($"指定用户ID不能为空");
var targetUserId = _sysUserRepository.AsQueryable().First(u => u.Id == userId);
@ -622,46 +614,56 @@ namespace Myshipping.Application
if (targetUserId == null)
throw Oops.Oh($"指定用户不存在");
string[] strings = taskPKId.Split(',');
if (bcTaskInfo.IS_PUBLIC == 1)
foreach (var item in strings)
{
bcTaskInfo.IS_PUBLIC = 0;
var bcTaskInfo = await _taskBaseRepository.AsQueryable().FirstAsync(u => u.PK_ID == item);
if (bcTaskInfo == null)
{
throw Oops.Oh($"任务主键{item}无法获取业务信息");
}
bcTaskInfo.CreatedUserId = targetUserId.Id;
bcTaskInfo.CreatedUserName = targetUserId.Name;
if (bcTaskInfo.IS_PUBLIC == 1)
{
bcTaskInfo.IS_PUBLIC = 0;
bcTaskInfo.RealUserId = targetUserId.Id;
bcTaskInfo.RealUserName = targetUserId.Name;
bcTaskInfo.UpdatedTime = DateTime.Now;
bcTaskInfo.UpdatedUserId = targetUserId.Id;
bcTaskInfo.UpdatedUserName = targetUserId.Name;
bcTaskInfo.UpdatedTime = DateTime.Now;
bcTaskInfo.UpdatedUserId = targetUserId.Id;
bcTaskInfo.UpdatedUserName = targetUserId.Name;
await _taskBaseRepository.AsUpdateable(bcTaskInfo).IgnoreColumns(it => new
await _taskBaseRepository.AsUpdateable(bcTaskInfo).IgnoreColumns(it => new
{
it.TenantId,
it.CreatedTime,
it.IsDeleted,
it.TASK_NO,
it.TASK_TYPE,
it.TASK_SOURCE
}).ExecuteCommandAsync();
}
else
{
it.TenantId,
it.CreatedTime,
it.IsDeleted,
it.TASK_NO,
it.TASK_TYPE,
it.TASK_SOURCE
}).ExecuteCommandAsync();
}
else
{
bcTaskInfo.CreatedUserId = targetUserId.Id;
bcTaskInfo.CreatedUserName = targetUserId.Name;
bcTaskInfo.RealUserId = targetUserId.Id;
bcTaskInfo.RealUserName = targetUserId.Name;
bcTaskInfo.UpdatedTime = DateTime.Now;
bcTaskInfo.UpdatedUserId = targetUserId.Id;
bcTaskInfo.UpdatedUserName = targetUserId.Name;
bcTaskInfo.UpdatedTime = DateTime.Now;
bcTaskInfo.UpdatedUserId = targetUserId.Id;
bcTaskInfo.UpdatedUserName = targetUserId.Name;
await _taskBaseRepository.AsUpdateable(bcTaskInfo).IgnoreColumns(it => new
{
it.TenantId,
it.CreatedTime,
it.IsDeleted,
it.TASK_NO,
it.TASK_TYPE,
it.TASK_SOURCE
}).ExecuteCommandAsync();
await _taskBaseRepository.AsUpdateable(bcTaskInfo).IgnoreColumns(it => new
{
it.TenantId,
it.CreatedTime,
it.IsDeleted,
it.TASK_NO,
it.TASK_TYPE,
it.TASK_SOURCE
}).ExecuteCommandAsync();
}
}
result.succ = true;

@ -602,10 +602,10 @@ namespace Myshipping.Application
/// <summary>
/// 刷新预甩货对应订舱
/// </summary>
/// <param name="nominationId">预甩货主键</param>
/// <param name="taskPkId">预甩货主键</param>
/// <returns>返回回执</returns>
[HttpGet("/TaskManageRollingNomination/RefreshBookingOrder")]
public async Task<TaskManageOrderResultDto> RefreshBookingOrder(string nominationId)
public async Task<TaskManageOrderResultDto> RefreshBookingOrder(string taskPkId)
{
TaskManageOrderResultDto result = new TaskManageOrderResultDto();
@ -616,17 +616,17 @@ namespace Myshipping.Application
*/
var list = _taskRollingNominationInfoRepository.AsQueryable().Filter(null, true)
.InnerJoin<TaskRollingNominationDetailInfo>((nom, detail) => nom.PK_ID == detail.NOM_ID)
.Where((nom, detail) => nom.PK_ID == nominationId
.Where((nom, detail) => nom.TASK_ID == taskPkId
&& detail.IsDeleted == false && !detail.BOOKING_ID.HasValue)
.Select((nom, detail) => detail).ToList();
if (list.Count > 0)
{
var mblNoArg = list.Select(a=>a.SHIPMENT).Distinct().ToList();
var mblNoArg = list.Select(a => a.SHIPMENT?.Trim()).Distinct().ToList();
var orderList = _bookingOrderRepository.AsQueryable()
.Where(a => mblNoArg.Contains(a.MBLNO) && !a.ParentId.HasValue && a.IsDeleted == false).ToList();
.Where(a => mblNoArg.Contains(a.MBLNO) && (a.ParentId == null || a.ParentId == 0) && a.IsDeleted == false).ToList();
DateTime nowDate = DateTime.Now;
@ -659,6 +659,9 @@ namespace Myshipping.Application
}
}
result.succ = true;
result.msg = "对应订舱完成";
}
catch (Exception ex)
{
@ -1278,7 +1281,7 @@ namespace Myshipping.Application
model.LoadDetailList = list.Select(a => a.Adapt<TaskRollingNominationShipDetailShowDto>()).ToList();
if (model.From != null && model.From.Count > 0)
if (model.From != null && model.From.Count > 1)
{
var firstLoadDetail = model.LoadDetailList.FirstOrDefault();
@ -1566,7 +1569,7 @@ namespace Myshipping.Application
//原船
if (!string.IsNullOrWhiteSpace(fromShipInfo.VESSEL) && !string.IsNullOrWhiteSpace(fromShipInfo.VOYNO))
{
baseHtml = baseHtml.Replace("#VesselVoyno#", $"{fromShipInfo.VESSEL} / {fromShipInfo.VOYNO}");
baseHtml = baseHtml.Replace("#VesselVoyno#", $"{fromShipInfo.VESSEL}/{fromShipInfo.VOYNO}");
}
else
{
@ -1585,7 +1588,7 @@ namespace Myshipping.Application
//换船
if (!string.IsNullOrWhiteSpace(toShipInfo.VESSEL) && !string.IsNullOrWhiteSpace(toShipInfo.VOYNO))
{
baseHtml = baseHtml.Replace("#newVesselVoyno#", $"{toShipInfo.VESSEL} / {toShipInfo.VOYNO}");
baseHtml = baseHtml.Replace("#newVesselVoyno#", $"{toShipInfo.VESSEL}/{toShipInfo.VOYNO}");
}
else
{

@ -115,6 +115,8 @@ namespace Myshipping.Application
private readonly SqlSugarRepository<TaskPODDischargeGateoutFullInfo> _taskPODDischargeGateoutFullInfoRepository;
private readonly SqlSugarRepository<TaskPODDischargeGateoutFullDetailInfo> _taskPODDischargeGateoutFullDetailInfoRepository;
private readonly SqlSugarRepository<TaskCautionNoticeInfo> _taskCautionNoticeInfoRepository;
private readonly SqlSugarRepository<TaskCautionNoticeDetailInfo> _taskCautionNoticeDetailInfoRepository;
private readonly IDjyWebsiteAccountConfigService _webAccountConfig;
private readonly ISysCacheService _cache;
@ -176,6 +178,8 @@ namespace Myshipping.Application
SqlSugarRepository<TaskDraftInfo> taskDraftInfoRepository,
SqlSugarRepository<TaskPODDischargeGateoutFullInfo> taskPODDischargeGateoutFullInfoRepository,
SqlSugarRepository<TaskPODDischargeGateoutFullDetailInfo> taskPODDischargeGateoutFullDetailInfoRepository,
SqlSugarRepository<TaskCautionNoticeInfo> taskCautionNoticeInfoRepository,
SqlSugarRepository<TaskCautionNoticeDetailInfo> taskCautionNoticeDetailInfoRepository,
INamedServiceProvider<IBookingOrderService> namedBookingOrderServiceProvider,
IDjyWebsiteAccountConfigService webAccountConfig,
ISysCacheService cache,
@ -239,6 +243,9 @@ namespace Myshipping.Application
_taskPODDischargeGateoutFullDetailInfoRepository = taskPODDischargeGateoutFullDetailInfoRepository;
_namedBookingMSKAPIServiceProvider = namedBookingMSKAPIServiceProvider;
_taskCautionNoticeInfoRepository = taskCautionNoticeInfoRepository;
_taskCautionNoticeDetailInfoRepository = taskCautionNoticeDetailInfoRepository;
}
#region 创建任务
@ -1400,6 +1407,69 @@ namespace Myshipping.Application
}
#endregion
#region 重要提醒
if (info.Main.TaskType == TaskBaseTypeEnum.CAUTION_NOTICE)
{
TaskCautionNoticeInfo taskCautionNoticeInfo = info.Main.CautionNoticeInfo.Adapt<TaskCautionNoticeInfo>();
taskCautionNoticeInfo.PK_ID = IDGen.NextID().ToString();
taskCautionNoticeInfo.TASK_ID = taskInfo.PK_ID;
taskCautionNoticeInfo.CreatedTime = taskInfo.CreatedTime;
taskCautionNoticeInfo.UpdatedTime = taskInfo.CreatedTime;
taskCautionNoticeInfo.CreatedUserId = taskInfo.CreatedUserId;
taskCautionNoticeInfo.CreatedUserName = taskInfo.CreatedUserName;
taskCautionNoticeInfo.TenantId = taskInfo.TenantId;
taskCautionNoticeInfo.TenantName = taskInfo.TenantName;
if (info.Main.CautionNoticeInfo.CautionNoticeType == CautionNoticeTaskEnum.WeekAt)
{
taskCautionNoticeInfo.IS_WEEK_DIFF = true;
}
else if (info.Main.CautionNoticeInfo.CautionNoticeType == CautionNoticeTaskEnum.PriceCalcDate)
{
taskCautionNoticeInfo.IS_PRICE_DATE_DIFF = true;
}
else if (info.Main.CautionNoticeInfo.CautionNoticeType == CautionNoticeTaskEnum.ChangeVesselVoyno)
{
taskCautionNoticeInfo.IS_VESSEL_CHANGE = true;
}
else if (info.Main.CautionNoticeInfo.CautionNoticeType == CautionNoticeTaskEnum.ChangeTransfer)
{
taskCautionNoticeInfo.IS_TRANSFER = true;
}
else if (info.Main.CautionNoticeInfo.CautionNoticeType == CautionNoticeTaskEnum.CutDateAdvanced)
{
taskCautionNoticeInfo.IS_CUT_DATE_ADVANCED = true;
}
await _taskCautionNoticeInfoRepository.InsertAsync(taskCautionNoticeInfo);
//异步写入集装箱
info.Main.CautionNoticeInfo.NoticeList.ForEach(async notice =>
{
var noticeInfo = notice.Adapt<TaskCautionNoticeDetailInfo>();
noticeInfo.PK_ID = IDGen.NextID().ToString();
noticeInfo.P_ID = taskCautionNoticeInfo.PK_ID;
noticeInfo.CreatedTime = taskInfo.CreatedTime;
noticeInfo.UpdatedTime = taskInfo.CreatedTime;
noticeInfo.CreatedUserId = taskInfo.CreatedUserId;
noticeInfo.CreatedUserName = taskInfo.CreatedUserName;
noticeInfo.TenantId = taskInfo.TenantId;
noticeInfo.TenantName = taskInfo.TenantName;
noticeInfo.STATUS = TaskCautionNoticeStatusEnum.TEMP.ToString();
noticeInfo.STATUS_NAME = TaskCautionNoticeStatusEnum.TEMP.GetDescription();
await _taskCautionNoticeDetailInfoRepository.InsertAsync(noticeInfo);
});
}
#endregion
if (info.Main.SerialMsgInfo != null)
{
var storeInfo = new TaskStoreMsgInfo

@ -1604,7 +1604,8 @@ namespace Myshipping.Application
if (b.StatusSKUCode.Equals(st.StatusCode, StringComparison.OrdinalIgnoreCase))
return true;
if (b.SubStatusList != null && b.SubStatusList.Any(c => c.StatusSKUCode.Equals(st.StatusCode, StringComparison.OrdinalIgnoreCase)))
if (b.SubStatusList != null && b.SubStatusList.Any(c => !string.IsNullOrWhiteSpace(c.StatusSKUCode)
&& c.StatusSKUCode.Equals(st.StatusCode, StringComparison.OrdinalIgnoreCase)))
return true;
return false;
@ -1617,7 +1618,7 @@ namespace Myshipping.Application
=> a.Main.SERVICE_WF_ID == rt.WFPKId).ToList();
if(runList.Any(b
=>b.Detail.STATUS_SKU_CODE.Equals(st.StatusCode,StringComparison.OrdinalIgnoreCase)))
=> b.Detail != null && !string.IsNullOrWhiteSpace(b.Detail.STATUS_SKU_CODE) && b.Detail.STATUS_SKU_CODE.Equals(st.StatusCode,StringComparison.OrdinalIgnoreCase)))
{
var detail = runList.FirstOrDefault(b
=> b.Detail.STATUS_SKU_CODE.Equals(st.StatusCode, StringComparison.OrdinalIgnoreCase));

@ -57,7 +57,7 @@
<PackageReference Include="RabbitMQ.Client" Version="6.5.0" />
<PackageReference Include="SqlSugarCore" Version="5.1.2.6" />
<PackageReference Include="System.Drawing.Common" Version="6.0.0" />
<PackageReference Include="System.Linq.Dynamic.Core" Version="1.2.20" />
<PackageReference Include="System.Linq.Dynamic.Core" Version="1.3.14" />
<PackageReference Include="System.Text.Encoding.CodePages" Version="6.0.0" />
<PackageReference Include="TinyPinyin.Net" Version="1.0.2" />
<PackageReference Include="UAParser" Version="3.1.47" />

@ -19844,6 +19844,11 @@
长TAB键的识别替换空格
</summary>
</member>
<member name="M:Myshipping.Core.LetterIndexUtil.GetNextLetter(System.Char)">
<summary>
根据当前字母获取它在26个英文字母中的下一个字母
</summary>
</member>
<member name="T:Myshipping.Core.MachineUtil">
<summary>
获取服务器信息

@ -0,0 +1,13 @@
namespace Myshipping.Core;
public static class LetterIndexUtil
{
/// <summary>
/// 根据当前字母获取它在26个英文字母中的下一个字母
/// </summary>
public static char GetNextLetter(char currentLetter)
{
if (currentLetter == 'z') return 'a';
if (currentLetter == 'Z') return 'A';
return (char)(currentLetter + 1);
}
}
Loading…
Cancel
Save