|
|
|
@ -2306,6 +2306,10 @@ namespace Myshipping.Application
|
|
|
|
|
{
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 通过租户参数判断这一票的租户是否启用了舱位引入功能
|
|
|
|
|
var isCancelAllocationSlot = tenantParamList.FirstOrDefault(x => x.TenantId == order.TenantId && x.ParaCode == TenantParamCode.ENABLE_SLOT_ABILITY)?.ItemCode;
|
|
|
|
|
|
|
|
|
|
var mblno = order.MBLNO;
|
|
|
|
|
|
|
|
|
|
// 将待删除的订舱单id存放到Cache中。目的:使用SendBookingOrder()推送订舱单数据前通过Cache判断是否正在走删除逻辑,来决定是否推送(如果是正在处理删除逻辑的数据,则不推送)
|
|
|
|
@ -2349,6 +2353,12 @@ namespace Myshipping.Application
|
|
|
|
|
// 取消订阅运踪
|
|
|
|
|
waitUnsubscribeBilltrace.Add(new BillTraceUnsubscribeList(Id.ToString(), mblno));
|
|
|
|
|
|
|
|
|
|
if (isCancelAllocationSlot == "YES")
|
|
|
|
|
{
|
|
|
|
|
// 取消关联舱位
|
|
|
|
|
await CancelAllocationSlot(Id);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 记录日志
|
|
|
|
|
var newOrder = order.Adapt<BookingOrder>();
|
|
|
|
|
newOrder.IsDeleted = true;
|
|
|
|
@ -2379,6 +2389,12 @@ namespace Myshipping.Application
|
|
|
|
|
// 取消订阅运踪
|
|
|
|
|
waitUnsubscribeBilltrace.Add(new BillTraceUnsubscribeList(Id.ToString(), mblno));
|
|
|
|
|
|
|
|
|
|
if (isCancelAllocationSlot == "YES")
|
|
|
|
|
{
|
|
|
|
|
// 取消关联舱位
|
|
|
|
|
await CancelAllocationSlot(Id);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 记录日志
|
|
|
|
|
var newOrder = order.Adapt<BookingOrder>();
|
|
|
|
|
newOrder.IsDeleted = true;
|
|
|
|
@ -4256,25 +4272,25 @@ namespace Myshipping.Application
|
|
|
|
|
{
|
|
|
|
|
string value = null;
|
|
|
|
|
|
|
|
|
|
var fieldType = item.Field.Split('.')[0].ToLower();
|
|
|
|
|
var fieldProperty = item.Field.Split('.')[1];
|
|
|
|
|
if (fieldType == "order")
|
|
|
|
|
var destName = item.Field.Split('.')[0].ToLower();
|
|
|
|
|
var fieldName = item.Field.Split('.')[1];
|
|
|
|
|
if (destName == "order" || destName == "suborder")
|
|
|
|
|
{
|
|
|
|
|
if (order != null)
|
|
|
|
|
{
|
|
|
|
|
value = typeof(BookingOrder).GetProperty(fieldProperty).GetValue(order)?.ToString();
|
|
|
|
|
value = typeof(BookingOrder).GetProperty(fieldName).GetValue(order)?.ToString();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if (fieldType == "edi")
|
|
|
|
|
else if (destName == "edi")
|
|
|
|
|
{
|
|
|
|
|
if (edi != null)
|
|
|
|
|
{
|
|
|
|
|
value = typeof(BookingEDIExt).GetProperty(fieldProperty).GetValue(edi)?.ToString();
|
|
|
|
|
value = typeof(BookingEDIExt).GetProperty(fieldName).GetValue(edi)?.ToString();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if (fieldType == "userinfo")
|
|
|
|
|
else if (destName == "userinfo")
|
|
|
|
|
{
|
|
|
|
|
var propertyLower = fieldProperty.ToLower();
|
|
|
|
|
var propertyLower = fieldName.ToLower();
|
|
|
|
|
switch (propertyLower)
|
|
|
|
|
{
|
|
|
|
|
case "username":
|
|
|
|
@ -4291,6 +4307,18 @@ namespace Myshipping.Application
|
|
|
|
|
value = null; break;
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
else if (destName == "other")
|
|
|
|
|
{
|
|
|
|
|
var propertyLower = fieldName.ToLower();
|
|
|
|
|
switch (propertyLower)
|
|
|
|
|
{
|
|
|
|
|
case "printdate":
|
|
|
|
|
value = DateTime.Now.ToString("yyyy-MM-dd");
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
value = null; break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (!string.IsNullOrWhiteSpace(value))
|
|
|
|
|
{
|
|
|
|
|
foreach (var itemTemp in group)
|
|
|
|
@ -4320,13 +4348,15 @@ namespace Myshipping.Application
|
|
|
|
|
{
|
|
|
|
|
var name = entity.Where(x => x.Row == _row && x.Column == _cellNum).Select(x => x.Field).FirstOrDefault();
|
|
|
|
|
|
|
|
|
|
if (name.Split('.')[0].ToLower() == "order")
|
|
|
|
|
var destName = name.Split('.')[0].ToLower();
|
|
|
|
|
|
|
|
|
|
if (destName == "order" || destName == "suborder")
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
foreach (PropertyDescriptor descriptor in TypeDescriptor.GetProperties(order))
|
|
|
|
|
{
|
|
|
|
|
var _name = descriptor.Name.ToLower();
|
|
|
|
|
if (name.Split('.')[0].ToLower() == "order" && name.Split('.')[1].ToLower() == _name)
|
|
|
|
|
if (name.Split('.')[1].ToLower() == _name)
|
|
|
|
|
{
|
|
|
|
|
var value = descriptor.GetValue(order) != null ? descriptor.GetValue(order).ToString() : "";
|
|
|
|
|
ICell cell = row.GetCell(_cellNum - 1);
|
|
|
|
@ -4344,7 +4374,7 @@ namespace Myshipping.Application
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (name.Split('.')[0].ToLower() == "order" && name.Split('.')[1].ToLower() == "_pkgs" && _name == "pkgs")
|
|
|
|
|
if (name.Split('.')[1].ToLower() == "_pkgs" && _name == "pkgs")
|
|
|
|
|
{
|
|
|
|
|
var value = string.Empty;
|
|
|
|
|
if (order.PKGS != null)
|
|
|
|
@ -4371,7 +4401,7 @@ namespace Myshipping.Application
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
if (name.Split('.')[0].ToLower() == "order" && name.Split('.')[1].ToLower() == "_kgs" && _name == "kgs")
|
|
|
|
|
if (name.Split('.')[1].ToLower() == "_kgs" && _name == "kgs")
|
|
|
|
|
{
|
|
|
|
|
var value = string.Empty;
|
|
|
|
|
if (order.KGS != null)
|
|
|
|
@ -4399,7 +4429,7 @@ namespace Myshipping.Application
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
if (name.Split('.')[0].ToLower() == "order" && name.Split('.')[1].ToLower() == "_cbm" && _name == "cbm")
|
|
|
|
|
if (name.Split('.')[1].ToLower() == "_cbm" && _name == "cbm")
|
|
|
|
|
{
|
|
|
|
|
var value = string.Empty;
|
|
|
|
|
if (order.CBM != null)
|
|
|
|
@ -4430,7 +4460,7 @@ namespace Myshipping.Application
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (name.Split('.')[0].ToLower() == "edi")
|
|
|
|
|
if (destName == "edi")
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
foreach (PropertyDescriptor descriptor in TypeDescriptor.GetProperties(edi))
|
|
|
|
@ -4458,7 +4488,7 @@ namespace Myshipping.Application
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (name.Split('.')[0].ToLower() == "userinfo")
|
|
|
|
|
if (destName == "userinfo")
|
|
|
|
|
{
|
|
|
|
|
ICell cell = row.GetCell(_cellNum - 1);
|
|
|
|
|
var value = string.Empty;
|
|
|
|
@ -4491,6 +4521,26 @@ namespace Myshipping.Application
|
|
|
|
|
row.CreateCell(_cellNum - 1).SetCellValue(value);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (destName == "other")
|
|
|
|
|
{
|
|
|
|
|
ICell cell = row.GetCell(_cellNum - 1);
|
|
|
|
|
var fieldName = name.Split('.')[1].ToLower();
|
|
|
|
|
var value = fieldName switch
|
|
|
|
|
{
|
|
|
|
|
"printdate" => DateTime.Now.ToString("yyyy-MM-dd"),
|
|
|
|
|
_ => "",
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
if (cell != null)
|
|
|
|
|
{
|
|
|
|
|
row.Cells[_cellNum - 1].SetCellValue(value);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
row.CreateCell(_cellNum - 1).SetCellValue(value);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -4504,13 +4554,13 @@ namespace Myshipping.Application
|
|
|
|
|
if (entity.Where(x => x.Row == _row && x.Column == _cellNum).Count() > 0)
|
|
|
|
|
{
|
|
|
|
|
var name = entity.Where(x => x.Row == _row && x.Column == _cellNum).Select(x => x.Field).FirstOrDefault();
|
|
|
|
|
|
|
|
|
|
if (name.Split('.')[0].ToLower() == "order")
|
|
|
|
|
var destName = name.Split('.')[0].ToLower();
|
|
|
|
|
if (destName == "order" || destName == "suborder")
|
|
|
|
|
{
|
|
|
|
|
foreach (PropertyDescriptor descriptor in TypeDescriptor.GetProperties(order))
|
|
|
|
|
{
|
|
|
|
|
var _name = descriptor.Name.ToLower();
|
|
|
|
|
if (name.Split('.')[1].ToLower() == _name && name.Split('.')[0].ToLower() == "order")
|
|
|
|
|
if (name.Split('.')[1].ToLower() == _name)
|
|
|
|
|
{
|
|
|
|
|
var value = descriptor.GetValue(order) != null ? descriptor.GetValue(order).ToString() : "";
|
|
|
|
|
if (descriptor.PropertyType.FullName.Contains("DateTime"))
|
|
|
|
@ -4522,7 +4572,7 @@ namespace Myshipping.Application
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (name.Split('.')[0].ToLower() == "edi")
|
|
|
|
|
if (destName == "edi")
|
|
|
|
|
{
|
|
|
|
|
foreach (PropertyDescriptor descriptor in TypeDescriptor.GetProperties(edi))
|
|
|
|
|
{
|
|
|
|
@ -4539,7 +4589,7 @@ namespace Myshipping.Application
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (name.Split('.')[0].ToLower() == "userinfo")
|
|
|
|
|
if (destName == "userinfo")
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
var value = string.Empty;
|
|
|
|
@ -4567,6 +4617,18 @@ namespace Myshipping.Application
|
|
|
|
|
srow.CreateCell(_cellNum - 1).SetCellValue(value);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (destName == "other")
|
|
|
|
|
{
|
|
|
|
|
var fieldName = name.Split('.')[1].ToLower();
|
|
|
|
|
var value = fieldName switch
|
|
|
|
|
{
|
|
|
|
|
"printdate" => DateTime.Now.ToString("yyyy-MM-dd"),
|
|
|
|
|
_ => "",
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
srow.CreateCell(_cellNum - 1).SetCellValue(value);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -9680,16 +9742,24 @@ namespace Myshipping.Application
|
|
|
|
|
BookingCtn ctn = new BookingCtn();
|
|
|
|
|
BookingEDIExt edi = new BookingEDIExt();
|
|
|
|
|
Dictionary<string, string> dic = new Dictionary<string, string>();
|
|
|
|
|
Dictionary<string, string> dic4 = new Dictionary<string, string>();
|
|
|
|
|
foreach (PropertyDescriptor descriptor in TypeDescriptor.GetProperties(order))
|
|
|
|
|
{
|
|
|
|
|
string name = descriptor.Name;
|
|
|
|
|
if (name == "TenantId" || name == "CreatedTime" || name == "UpdatedTime" || name == "CreatedUserId" || name == "CreatedUserName")
|
|
|
|
|
if (name == "TenantId" || name == "CreatedTime" || name == "UpdatedTime" || name == "CreatedUserId")
|
|
|
|
|
{
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
if (name == "CreatedUserName")
|
|
|
|
|
{
|
|
|
|
|
dic.Add("order.CreatedUserName", "录入人");
|
|
|
|
|
dic4.Add("suborder.CreatedUserName", "录入人");
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
if (!string.IsNullOrWhiteSpace(descriptor.Description))
|
|
|
|
|
{
|
|
|
|
|
dic.Add("order." + descriptor.Name, descriptor.Description);
|
|
|
|
|
dic4.Add("suborder." + descriptor.Name, descriptor.Description);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
@ -9735,12 +9805,19 @@ namespace Myshipping.Application
|
|
|
|
|
dic3.Add("userinfo.useremail", "当前登录人邮箱");
|
|
|
|
|
dic3.Add("userinfo.usertenant", "当前登录人所在公司");
|
|
|
|
|
|
|
|
|
|
Dictionary<string, string> dic5 = new Dictionary<string, string>()
|
|
|
|
|
{
|
|
|
|
|
{"other.PrintDate", "打印日期" }
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
var dynamic = new
|
|
|
|
|
{
|
|
|
|
|
order = dic,
|
|
|
|
|
ctn = dic1,
|
|
|
|
|
edi = dic2,
|
|
|
|
|
userinfo = dic3
|
|
|
|
|
userinfo = dic3,
|
|
|
|
|
suborder = dic4,
|
|
|
|
|
other = dic5
|
|
|
|
|
};
|
|
|
|
|
return dynamic;
|
|
|
|
|
}
|
|
|
|
@ -11805,9 +11882,21 @@ namespace Myshipping.Application
|
|
|
|
|
[HttpPost("/BookingOrder/CancelAllocationSlot")]
|
|
|
|
|
public async Task CancelAllocationSlot(long id)
|
|
|
|
|
{
|
|
|
|
|
var slotList = await _repSlotAllocation.AsQueryable().Where(a => a.BOOKING_ID == id).ToListAsync();
|
|
|
|
|
var slotIdList = slotList.Select(s => s.Id);
|
|
|
|
|
var slotList = await _repSlotAllocation.AsQueryable().Where(a => a.BOOKING_ID == id).Select(x => new
|
|
|
|
|
{
|
|
|
|
|
x.Id,
|
|
|
|
|
x.BOOKING_SLOT_TYPE,
|
|
|
|
|
x.CARRIERID,
|
|
|
|
|
x.CONTRACT_NO,
|
|
|
|
|
x.VESSEL,
|
|
|
|
|
x.VOYNO,
|
|
|
|
|
x.PLACERECEIPT,
|
|
|
|
|
x.PLACEDELIVERY
|
|
|
|
|
}).ToListAsync();
|
|
|
|
|
|
|
|
|
|
if (slotList.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
var slotIdList = slotList.Select(s => s.Id);
|
|
|
|
|
await _repSlotAllocation.Context.Updateable<BookingSlotAllocation>()
|
|
|
|
|
.SetColumns(a => a.IsDeleted == true)
|
|
|
|
|
.SetColumns(a => a.UpdatedTime == DateTime.Now)
|
|
|
|
@ -11839,6 +11928,7 @@ namespace Myshipping.Application
|
|
|
|
|
}));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 客户订舱系统代码独有的逻辑——2024年2月27日迁移自客户订舱系统
|
|
|
|
|