|
|
|
@ -6,7 +6,6 @@ using Furion.EventBus;
|
|
|
|
|
using Furion.Extensions;
|
|
|
|
|
using Furion.FriendlyException;
|
|
|
|
|
using Furion.JsonSerialization;
|
|
|
|
|
using Furion.RemoteRequest.Extensions;
|
|
|
|
|
using Mapster;
|
|
|
|
|
using Microsoft.AspNetCore.Authorization;
|
|
|
|
|
using Microsoft.AspNetCore.Http;
|
|
|
|
@ -20,15 +19,10 @@ using Myshipping.Application.Service.BookingOrder.Dto;
|
|
|
|
|
using Myshipping.Application.Service.BookingSlot.Dto;
|
|
|
|
|
using Myshipping.Core;
|
|
|
|
|
using Myshipping.Core.Service;
|
|
|
|
|
using MySqlX.XDevAPI.Common;
|
|
|
|
|
using NPOI.XWPF.UserModel;
|
|
|
|
|
using Org.BouncyCastle.Asn1.Tsp;
|
|
|
|
|
using SqlSugar;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Collections.Specialized;
|
|
|
|
|
using System.ComponentModel;
|
|
|
|
|
using System.Drawing.Imaging;
|
|
|
|
|
using System.IO;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Net.Http;
|
|
|
|
@ -36,9 +30,7 @@ using System.Net.Http.Headers;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using System.Web;
|
|
|
|
|
using Yitter.IdGenerator;
|
|
|
|
|
using static Aliyun.OSS.Model.CreateSelectObjectMetaInputFormatModel;
|
|
|
|
|
|
|
|
|
|
namespace Myshipping.Application
|
|
|
|
|
{
|
|
|
|
@ -56,7 +48,7 @@ namespace Myshipping.Application
|
|
|
|
|
private readonly SqlSugarRepository<BookingFile> _bookingFileRepository;
|
|
|
|
|
private readonly SqlSugarRepository<BookingSlotCompare> _bookingSlotCompareRepository;
|
|
|
|
|
private readonly SqlSugarRepository<BookingOrderContact> _bookingOrderContactRepository;
|
|
|
|
|
|
|
|
|
|
private readonly SqlSugarRepository<BookingOrder> _repBookingOrder;
|
|
|
|
|
private readonly SqlSugarRepository<BookingLog> _repBookingLog;
|
|
|
|
|
private readonly SqlSugarRepository<BookingLogDetail> _repBookingLogDetail;
|
|
|
|
|
private readonly SqlSugarRepository<BookingFile> _bookingfile;
|
|
|
|
@ -97,7 +89,8 @@ namespace Myshipping.Application
|
|
|
|
|
SqlSugarRepository<BookingSlotCompare> bookingSlotCompareRepository,
|
|
|
|
|
SqlSugarRepository<BookingOrderContact> bookingOrderContactRepository,
|
|
|
|
|
INamedServiceProvider<IBookingOrderService> namedBookingOrderServiceProvider,
|
|
|
|
|
IBookingValueAddedService bookingValueAddedService)
|
|
|
|
|
IBookingValueAddedService bookingValueAddedService,
|
|
|
|
|
SqlSugarRepository<BookingOrder> repBookingOrder)
|
|
|
|
|
{
|
|
|
|
|
_repBase = repBase;
|
|
|
|
|
_repCtn = repCtn;
|
|
|
|
@ -118,6 +111,7 @@ namespace Myshipping.Application
|
|
|
|
|
_namedBookingOrderServiceProvider = namedBookingOrderServiceProvider;
|
|
|
|
|
_bookingOrderContactRepository = bookingOrderContactRepository;
|
|
|
|
|
_bookingValueAddedService = bookingValueAddedService;
|
|
|
|
|
_repBookingOrder = repBookingOrder;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#region 舱位
|
|
|
|
@ -156,7 +150,6 @@ namespace Myshipping.Application
|
|
|
|
|
{
|
|
|
|
|
isNeedUpdateOldStock = true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
await _repBase.UpdateAsync(model);
|
|
|
|
|
|
|
|
|
|
if (isNeedUpdateOldStock)
|
|
|
|
@ -175,14 +168,106 @@ namespace Myshipping.Application
|
|
|
|
|
}));
|
|
|
|
|
}
|
|
|
|
|
await _repCtn.DeleteAsync(x => x.SLOT_ID == model.Id);
|
|
|
|
|
if (input.CtnList != null)
|
|
|
|
|
{
|
|
|
|
|
foreach (var ctn in input.CtnList)
|
|
|
|
|
{
|
|
|
|
|
var newCtn = ctn.Adapt<BookingSlotCtn>();
|
|
|
|
|
newCtn.SLOT_ID = model.Id;
|
|
|
|
|
await _repCtn.InsertAsync(newCtn);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await InsLog("Update", model.Id, typeof(BookingSlotBaseSaveInput), oldObj, input, "CtnList");
|
|
|
|
|
#region 关联订舱信息修改
|
|
|
|
|
if (input.BookingSlotSaleInfoList != null)
|
|
|
|
|
{
|
|
|
|
|
var bookingOrderService = App.GetService<IBookingOrderService>();
|
|
|
|
|
foreach (var item in input.BookingSlotSaleInfoList)
|
|
|
|
|
{
|
|
|
|
|
if (!item.UpdateFlag)
|
|
|
|
|
{
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var allocation = await _repAllocation.FirstOrDefaultAsync(x => x.Id == item.Id);
|
|
|
|
|
if (allocation == null)
|
|
|
|
|
{
|
|
|
|
|
throw Oops.Oh($"保存失败,原因:更新关联订舱时未查询到订舱(关联表Id:{item.Id})");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 更新关联表
|
|
|
|
|
item.Adapt(allocation);
|
|
|
|
|
_repAllocation.CurrentBeginTran();
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
await _repAllocation.AsUpdateable(allocation).UpdateColumns(x => new
|
|
|
|
|
{
|
|
|
|
|
x.CUSTOMERID,
|
|
|
|
|
x.CUSTOMERNAME,
|
|
|
|
|
x.CUSTSERVICE,
|
|
|
|
|
x.CUSTSERVICEID,
|
|
|
|
|
x.SALE,
|
|
|
|
|
x.SALEID,
|
|
|
|
|
x.SHIPPER,
|
|
|
|
|
x.SALE_TIME,
|
|
|
|
|
x.GOODSNAME,
|
|
|
|
|
x.SELLING_PRICE,
|
|
|
|
|
x.UpdatedUserId,
|
|
|
|
|
x.UpdatedUserName,
|
|
|
|
|
x.UpdatedTime,
|
|
|
|
|
}).ExecuteCommandAsync();
|
|
|
|
|
|
|
|
|
|
// 更新订舱表
|
|
|
|
|
var bookingOrder = await _repBookingOrder.FirstOrDefaultAsync(x => x.Id == allocation.BOOKING_ID);
|
|
|
|
|
var oldBookingOrder = bookingOrder.Adapt<BookingOrder>();
|
|
|
|
|
if (bookingOrder != null)
|
|
|
|
|
{
|
|
|
|
|
bookingOrder.CUSTOMERID = allocation.CUSTOMERID;
|
|
|
|
|
bookingOrder.CUSTOMERNAME = allocation.CUSTOMERNAME;
|
|
|
|
|
bookingOrder.CUSTSERVICE = allocation.CUSTSERVICE;
|
|
|
|
|
bookingOrder.CUSTSERVICEID = allocation.CUSTSERVICEID;
|
|
|
|
|
bookingOrder.SALE = allocation.SALE;
|
|
|
|
|
bookingOrder.SALEID = allocation.SALEID;
|
|
|
|
|
|
|
|
|
|
await _repBookingOrder.AsUpdateable(bookingOrder).UpdateColumns(x => new
|
|
|
|
|
{
|
|
|
|
|
x.CUSTOMERID,
|
|
|
|
|
x.CUSTOMERNAME,
|
|
|
|
|
x.CUSTSERVICE,
|
|
|
|
|
x.CUSTSERVICEID,
|
|
|
|
|
x.SALE,
|
|
|
|
|
x.SALEID,
|
|
|
|
|
x.UpdatedUserId,
|
|
|
|
|
x.UpdatedUserName,
|
|
|
|
|
x.UpdatedTime,
|
|
|
|
|
}).ExecuteCommandAsync();
|
|
|
|
|
|
|
|
|
|
//Parallel.For(0, 1, (n) =>
|
|
|
|
|
//{
|
|
|
|
|
bookingOrderService.SaveLog(bookingOrder, oldBookingOrder, "舱位关联更新");
|
|
|
|
|
|
|
|
|
|
// 推送东胜
|
|
|
|
|
bookingOrderService.SendBookingOrder(new long[] { allocation.BOOKING_ID });
|
|
|
|
|
//});
|
|
|
|
|
}
|
|
|
|
|
_repAllocation.CurrentCommitTran();
|
|
|
|
|
}
|
|
|
|
|
catch (Exception)
|
|
|
|
|
{
|
|
|
|
|
_repAllocation.CurrentRollbackTran();
|
|
|
|
|
throw;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
//Parallel.For(0, 1, (n) =>
|
|
|
|
|
//{
|
|
|
|
|
InsLog("Update", model.Id, typeof(BookingSlotBaseSaveInput), oldObj, input,
|
|
|
|
|
nameof(BookingSlotBaseApiSaveDto.CtnList),
|
|
|
|
|
nameof(BookingSlotBaseApiSaveDto.BookingSlotSaleInfoList));
|
|
|
|
|
//});
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
@ -220,6 +305,135 @@ namespace Myshipping.Application
|
|
|
|
|
return await Detail(model.Id);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 直接在台账页数据列表上进行保存
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[HttpPost("/BookingSlot/SaveDataInList")]
|
|
|
|
|
public async Task<BookingSlotBaseSaveOutput> SaveDataInList(BookingSlotBaseSaveDataInListInputDto input)
|
|
|
|
|
{
|
|
|
|
|
long slotBaseId = 0;
|
|
|
|
|
if (input.SlotBase != null)
|
|
|
|
|
{
|
|
|
|
|
slotBaseId = input.SlotBase.GetLongValue("Id");
|
|
|
|
|
if (slotBaseId == 0)
|
|
|
|
|
{
|
|
|
|
|
throw Oops.Bah("修改舱位信息需要提供参数:Id");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var model = await _repBase.FirstOrDefaultAsync(x => x.Id == slotBaseId);
|
|
|
|
|
if (model == null)
|
|
|
|
|
{
|
|
|
|
|
throw Oops.Bah("未查询到舱位信息,请刷新页面");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var type = typeof(BookingSlotBase);
|
|
|
|
|
var properties = type.GetProperties();
|
|
|
|
|
List<string> updateColumns = new(input.SlotBase.Count + 3)
|
|
|
|
|
{
|
|
|
|
|
"UpdatedTime","UpdatedUserId","UpdatedUserName"
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
foreach (var item in input.SlotBase)
|
|
|
|
|
{
|
|
|
|
|
if (item.Key == "Id")
|
|
|
|
|
{
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
updateColumns.Add(item.Key);
|
|
|
|
|
var property = properties.FirstOrDefault(x => x.Name.Equals(item.Key, StringComparison.OrdinalIgnoreCase))
|
|
|
|
|
?? throw Oops.Bah($"参数有误,该属性不存在:{item.Key}");
|
|
|
|
|
if (property.PropertyType == typeof(string) || property.PropertyType == typeof(string))
|
|
|
|
|
{
|
|
|
|
|
property.SetValue(model, input.SlotBase.GetStringValue(item.Key));
|
|
|
|
|
}
|
|
|
|
|
else if (property.PropertyType == typeof(int) || property.PropertyType == typeof(int?))
|
|
|
|
|
{
|
|
|
|
|
property.SetValue(model, input.SlotBase.GetIntValue(item.Key));
|
|
|
|
|
}
|
|
|
|
|
else if (property.PropertyType == typeof(long) || property.PropertyType == typeof(long?))
|
|
|
|
|
{
|
|
|
|
|
property.SetValue(model, input.SlotBase.GetLongValue(item.Key));
|
|
|
|
|
}
|
|
|
|
|
else if (property.PropertyType == typeof(DateTime) || property.PropertyType == typeof(DateTime?))
|
|
|
|
|
{
|
|
|
|
|
property.SetValue(model, input.SlotBase.GetDateTimeValue(item.Key));
|
|
|
|
|
}
|
|
|
|
|
else if (property.PropertyType == typeof(bool) || property.PropertyType == typeof(bool?))
|
|
|
|
|
{
|
|
|
|
|
property.SetValue(model, input.SlotBase.GetBooleanValue(item.Key));
|
|
|
|
|
}
|
|
|
|
|
else if (property.PropertyType == typeof(decimal) || property.PropertyType == typeof(decimal?))
|
|
|
|
|
{
|
|
|
|
|
property.SetValue(model, input.SlotBase.GetDecimalValue(item.Key));
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
throw new Exception($"需要维护此类型:{property.PropertyType},请联系管理员");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
await _repBase.AsUpdateable(model).UpdateColumns(updateColumns.ToArray()).ExecuteCommandAsync();
|
|
|
|
|
}
|
|
|
|
|
if (input.SlotSaleInfo != null)
|
|
|
|
|
{
|
|
|
|
|
var allocationId = input.SlotSaleInfo.GetLongValue("Id");
|
|
|
|
|
if (allocationId == 0)
|
|
|
|
|
{
|
|
|
|
|
throw Oops.Bah("修改订舱信息需要提供参数:Id");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var model = await _repAllocation.FirstOrDefaultAsync(x => x.Id == allocationId);
|
|
|
|
|
if (model == null)
|
|
|
|
|
{
|
|
|
|
|
throw Oops.Bah("未查询到关联的订舱信息,请刷新页面");
|
|
|
|
|
}
|
|
|
|
|
slotBaseId = model.BOOKING_SLOT_ID;
|
|
|
|
|
|
|
|
|
|
var update1 = _repAllocation.Context.Updateable<BookingSlotAllocation>();
|
|
|
|
|
var update2 = _repBookingOrder.Context.Updateable<BookingOrder>();
|
|
|
|
|
foreach (var item in input.SlotSaleInfo)
|
|
|
|
|
{
|
|
|
|
|
if (item.Key == "Id")
|
|
|
|
|
{
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
if (item.Key.Equals("CUSTOMERNAME", StringComparison.OrdinalIgnoreCase))
|
|
|
|
|
{
|
|
|
|
|
var value = input.SlotSaleInfo.GetStringValue(item.Key);
|
|
|
|
|
update1.SetColumns(x => x.CUSTOMERNAME == value);
|
|
|
|
|
update2.SetColumns(x => x.CUSTOMERNAME == value);
|
|
|
|
|
}
|
|
|
|
|
else if (item.Key.Equals("CUSTOMERID", StringComparison.OrdinalIgnoreCase))
|
|
|
|
|
{
|
|
|
|
|
var value = input.SlotSaleInfo.GetLongValue(item.Key);
|
|
|
|
|
update1.SetColumns(x => x.CUSTOMERID == value);
|
|
|
|
|
update2.SetColumns(x => x.CUSTOMERID == value);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
throw Oops.Bah($"需要维护此字段:{item.Key},请联系管理员");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
_repAllocation.CurrentBeginTran();
|
|
|
|
|
await update1.Where(x => x.Id == model.Id).ExecuteCommandAsync();
|
|
|
|
|
await update2.Where(x => x.Id == model.BOOKING_ID).ExecuteCommandAsync();
|
|
|
|
|
_repAllocation.CurrentCommitTran();
|
|
|
|
|
|
|
|
|
|
var bookingOrderService = App.GetService<IBookingOrderService>();
|
|
|
|
|
await bookingOrderService.SendBookingOrder(new long[] { model.BOOKING_ID });
|
|
|
|
|
}
|
|
|
|
|
catch (Exception)
|
|
|
|
|
{
|
|
|
|
|
_repAllocation.CurrentRollbackTran();
|
|
|
|
|
throw;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return await Detail(slotBaseId);
|
|
|
|
|
}
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取订舱舱位
|
|
|
|
|
/// </summary>
|
|
|
|
@ -250,6 +464,28 @@ namespace Myshipping.Application
|
|
|
|
|
|
|
|
|
|
rtn.LogList = list;
|
|
|
|
|
|
|
|
|
|
// 赋值关联的订舱列表
|
|
|
|
|
// 查询舱位绑定的销售信息,赋值到舱位对象中
|
|
|
|
|
List<BookingSlotSaleInfoDto> saleInfoList = await _repAllocation.AsQueryable()
|
|
|
|
|
.Where(x => x.BOOKING_SLOT_ID == id)
|
|
|
|
|
.Select(x => new BookingSlotSaleInfoDto
|
|
|
|
|
{
|
|
|
|
|
Id = x.Id,
|
|
|
|
|
BOOKING_ID = x.BOOKING_ID,
|
|
|
|
|
BOOKING_SLOT_ID = x.BOOKING_SLOT_ID,
|
|
|
|
|
CUSTOMERID = x.CUSTOMERID,
|
|
|
|
|
CUSTOMERNAME = x.CUSTOMERNAME,
|
|
|
|
|
CUSTSERVICEID = x.CUSTSERVICEID,
|
|
|
|
|
CUSTSERVICE = x.CUSTSERVICE,
|
|
|
|
|
SALEID = x.SALEID,
|
|
|
|
|
SALE = x.SALE,
|
|
|
|
|
SALE_TIME = x.SALE_TIME,
|
|
|
|
|
SHIPPER = x.SHIPPER,
|
|
|
|
|
GOODSNAME = x.GOODSNAME,
|
|
|
|
|
SELLING_PRICE = x.SELLING_PRICE
|
|
|
|
|
}).ToListAsync();
|
|
|
|
|
rtn.BookingSlotSaleInfoList = saleInfoList;
|
|
|
|
|
|
|
|
|
|
return rtn;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -554,7 +790,7 @@ namespace Myshipping.Application
|
|
|
|
|
await _repCtn.InsertAsync(newCtn);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
await InsLog("Update", model.Id, typeof(BookingSlotBaseApiSaveDto), oldObj, dto.DataObj, "CtnList");
|
|
|
|
|
await InsLog("Update", model.Id, typeof(BookingSlotBaseApiSaveDto), oldObj, dto.DataObj, nameof(BookingSlotBaseApiSaveDto.CtnList), nameof(BookingSlotBaseApiSaveDto.BookingSlotSaleInfoList));
|
|
|
|
|
|
|
|
|
|
string batchNo = IDGen.NextID().ToString();
|
|
|
|
|
|
|
|
|
@ -732,7 +968,7 @@ namespace Myshipping.Application
|
|
|
|
|
CreatedUserName = UserManager.Name,
|
|
|
|
|
Module = "Slot"
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
List<BookingLogDetail> waitInsertLogList = new();
|
|
|
|
|
foreach (PropertyDescriptor descriptor in TypeDescriptor.GetProperties(objType))
|
|
|
|
|
{
|
|
|
|
|
if (excepProp.Contains(descriptor.Name))
|
|
|
|
@ -740,52 +976,29 @@ namespace Myshipping.Application
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var compResult = false;
|
|
|
|
|
var oldValue = descriptor.GetValue(objOld);
|
|
|
|
|
var newValue = descriptor.GetValue(objNew);
|
|
|
|
|
if (oldValue != null && newValue != null)
|
|
|
|
|
{
|
|
|
|
|
if (descriptor.PropertyType == typeof(string))
|
|
|
|
|
{
|
|
|
|
|
compResult = oldValue.ToString() == newValue.ToString();
|
|
|
|
|
}
|
|
|
|
|
else if (descriptor.PropertyType == typeof(DateTime) || descriptor.PropertyType == typeof(DateTime?))
|
|
|
|
|
{
|
|
|
|
|
compResult = Convert.ToDateTime(oldValue) == Convert.ToDateTime(newValue);
|
|
|
|
|
}
|
|
|
|
|
else if (descriptor.PropertyType == typeof(decimal) || descriptor.PropertyType == typeof(float) || descriptor.PropertyType == typeof(double)
|
|
|
|
|
|| descriptor.PropertyType == typeof(decimal?) || descriptor.PropertyType == typeof(float?) || descriptor.PropertyType == typeof(double?))
|
|
|
|
|
{
|
|
|
|
|
compResult = Convert.ToDecimal(oldValue) == Convert.ToDecimal(newValue);
|
|
|
|
|
}
|
|
|
|
|
else if (descriptor.PropertyType == typeof(int) || descriptor.PropertyType == typeof(long)
|
|
|
|
|
|| descriptor.PropertyType == typeof(int?) || descriptor.PropertyType == typeof(long?))
|
|
|
|
|
{
|
|
|
|
|
compResult = Convert.ToInt64(oldValue) == Convert.ToInt64(newValue);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
compResult = oldValue == newValue;
|
|
|
|
|
}
|
|
|
|
|
var oldValue = descriptor.GetValue(objOld)?.ToString();
|
|
|
|
|
var newValue = descriptor.GetValue(objNew)?.ToString();
|
|
|
|
|
|
|
|
|
|
if (!compResult)
|
|
|
|
|
if (oldValue != newValue)
|
|
|
|
|
{
|
|
|
|
|
var fieldName = descriptor.Name;
|
|
|
|
|
if (!string.IsNullOrWhiteSpace(descriptor.Description))
|
|
|
|
|
{
|
|
|
|
|
fieldName = descriptor.Description;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
await _repBookingLogDetail.InsertReturnSnowflakeIdAsync(new BookingLogDetail
|
|
|
|
|
waitInsertLogList.Add(new BookingLogDetail
|
|
|
|
|
{
|
|
|
|
|
PId = bid,
|
|
|
|
|
Field = fieldName,
|
|
|
|
|
OldValue = $"{oldValue}",
|
|
|
|
|
NewValue = $"{newValue}",
|
|
|
|
|
OldValue = oldValue switch { "True" => "是", "False" => "否", _ => oldValue },
|
|
|
|
|
NewValue = newValue switch { "True" => "是", "False" => "否", _ => newValue },
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (waitInsertLogList.Any())
|
|
|
|
|
{
|
|
|
|
|
await _repBookingLogDetail.InsertAsync(waitInsertLogList);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
@ -1134,23 +1347,31 @@ namespace Myshipping.Application
|
|
|
|
|
{
|
|
|
|
|
var entities = await _repBase.AsQueryable()
|
|
|
|
|
.WhereIF(!string.IsNullOrEmpty(input.SLOT_BOOKING_NO), u => u.SLOT_BOOKING_NO.Contains(input.SLOT_BOOKING_NO))
|
|
|
|
|
.WhereIF(input.STATUS == 1, u => !u.IS_CANCELLATION)
|
|
|
|
|
.WhereIF(input.STATUS == 2, u => u.IS_CANCELLATION)
|
|
|
|
|
.WhereIF(!string.IsNullOrEmpty(input.VESSEL), u => u.VESSEL.Contains(input.VESSEL))
|
|
|
|
|
.WhereIF(!string.IsNullOrEmpty(input.VOYNO), u => u.VOYNO.Contains(input.VOYNO))
|
|
|
|
|
.WhereIF(!string.IsNullOrEmpty(input.PORTLOAD), u => u.PORTLOAD.Contains(input.PORTLOAD))
|
|
|
|
|
.WhereIF(!string.IsNullOrEmpty(input.PORTDISCHARGE), u => u.PORTLOAD.Contains(input.PORTLOAD))
|
|
|
|
|
.WhereIF(!string.IsNullOrEmpty(input.CARRIER), u => u.CARRIER.Contains(input.CARRIER))
|
|
|
|
|
.WhereIF(!string.IsNullOrEmpty(input.LANENAME), u => u.LANENAME.Contains(input.LANENAME))
|
|
|
|
|
.WhereIF(!string.IsNullOrEmpty(input.CARRIAGE_TYPE), u => u.CARRIAGE_TYPE == input.CARRIAGE_TYPE)
|
|
|
|
|
.WhereIF(!string.IsNullOrEmpty(input.BOOKING_SLOT_TYPE), u => u.BOOKING_SLOT_TYPE == input.BOOKING_SLOT_TYPE)
|
|
|
|
|
.WhereIF(!string.IsNullOrEmpty(input.CTN_STAT), u => u.CTN_STAT.Contains(input.CTN_STAT))
|
|
|
|
|
.WhereIF(!string.IsNullOrEmpty(input.VGM_RLT_STAT), u => u.VGM_RLT_STAT == input.VGM_RLT_STAT)
|
|
|
|
|
.WhereIF(!string.IsNullOrEmpty(input.SI_RLT_STAT), u => u.SI_RLT_STAT == input.SI_RLT_STAT)
|
|
|
|
|
.WhereIF(!string.IsNullOrEmpty(input.PORTDISCHARGE), u => u.PORTDISCHARGE.Contains(input.PORTDISCHARGE))
|
|
|
|
|
|
|
|
|
|
.WhereIF(input.ETD_START.HasValue, u => u.ETD >= input.ETD_START.Value)
|
|
|
|
|
.WhereIF(input.ETD_END.HasValue, u => u.ETD < input.ETD_END.Value.AddDays(1))
|
|
|
|
|
.WhereIF(input.ETA_START.HasValue, u => u.ETA >= input.ETA_START.Value)
|
|
|
|
|
.WhereIF(input.ETA_END.HasValue, u => u.ETA < input.ETA_END.Value.AddDays(1))
|
|
|
|
|
.WhereIF(input.STATUS == 1, u => !u.IS_CANCELLATION)
|
|
|
|
|
.WhereIF(input.STATUS == 2, u => u.IS_CANCELLATION)
|
|
|
|
|
.WhereIF(!string.IsNullOrEmpty(input.CreatedUserName), u => u.CreatedUserName.Contains(input.CreatedUserName))
|
|
|
|
|
.WhereIF(!string.IsNullOrEmpty(input.UpdatedUserName), u => u.UpdatedUserName.Contains(input.UpdatedUserName))
|
|
|
|
|
|
|
|
|
|
.WhereIF(!string.IsNullOrEmpty(input.CARRIER), u => u.CARRIER.Contains(input.CARRIER))
|
|
|
|
|
.WhereIF(!string.IsNullOrEmpty(input.CONTRACT_NO), u => u.CONTRACT_NO.Contains(input.CONTRACT_NO))
|
|
|
|
|
.WhereIF(!string.IsNullOrEmpty(input.SI_RLT_STAT), u => u.SI_RLT_STAT == input.SI_RLT_STAT)
|
|
|
|
|
.WhereIF(!string.IsNullOrEmpty(input.VGM_RLT_STAT), u => u.VGM_RLT_STAT == input.VGM_RLT_STAT)
|
|
|
|
|
.WhereIF(!string.IsNullOrEmpty(input.CARRIAGE_TYPE), u => u.CARRIAGE_TYPE == input.CARRIAGE_TYPE)
|
|
|
|
|
.WhereIF(!string.IsNullOrEmpty(input.BOOKING_SLOT_TYPE), u => u.BOOKING_SLOT_TYPE == input.BOOKING_SLOT_TYPE)
|
|
|
|
|
|
|
|
|
|
.WhereIF(!string.IsNullOrEmpty(input.LANENAME), u => u.LANENAME.Contains(input.LANENAME))
|
|
|
|
|
.WhereIF(!string.IsNullOrEmpty(input.CTN_STAT), u => u.CTN_STAT.Contains(input.CTN_STAT))
|
|
|
|
|
.WhereIF(!string.IsNullOrEmpty(input.WEEK_AT), u => u.WEEK_AT.Contains(input.WEEK_AT))
|
|
|
|
|
.OrderByDescending(u => u.CreatedTime)
|
|
|
|
|
.ToPagedListAsync(input.PageNo, input.PageSize);
|
|
|
|
|
|
|
|
|
|
var result = entities.Adapt<SqlSugarPagedList<BookingSlotBaseListOutput>>();
|
|
|
|
@ -1163,9 +1384,14 @@ namespace Myshipping.Application
|
|
|
|
|
.Where(x => slotIds.Contains(x.BOOKING_SLOT_ID))
|
|
|
|
|
.Select(x => new BookingSlotSaleInfoDto
|
|
|
|
|
{
|
|
|
|
|
Id = x.Id,
|
|
|
|
|
BOOKING_ID = x.BOOKING_ID,
|
|
|
|
|
BOOKING_SLOT_ID = x.BOOKING_SLOT_ID,
|
|
|
|
|
CUSTOMERID = x.CUSTOMERID,
|
|
|
|
|
CUSTOMERNAME = x.CUSTOMERNAME,
|
|
|
|
|
CUSTSERVICEID = x.CUSTSERVICEID,
|
|
|
|
|
CUSTSERVICE = x.CUSTSERVICE,
|
|
|
|
|
SALEID = x.SALEID,
|
|
|
|
|
SALE = x.SALE,
|
|
|
|
|
SALE_TIME = x.SALE_TIME,
|
|
|
|
|
SHIPPER = x.SHIPPER,
|
|
|
|
|