optimize
wet 2 years ago
parent 6faacbcbe0
commit f52551a9eb

@ -110,6 +110,7 @@ namespace Myshipping.Application
private readonly SqlSugarRepository<BookingServiceItem> _serviceItem;
private readonly SqlSugarRepository<BookingGoodsStatus> _goodsStatus;
private readonly SqlSugarRepository<BookingGoodsStatusConfig> _goodsStatusConfig;
private readonly SqlSugarRepository<DjyCustomer> _djycustomer;
private readonly IHttpContextAccessor _httpContextAccessor;
private readonly IBookingGoodsStatusConfigService _GoodsConfig;
const string CONST_MAPPING_MODULE = "BOOK_OR_CLOSING";
@ -122,7 +123,7 @@ namespace Myshipping.Application
SqlSugarRepository<SysDictData> dicdata, SqlSugarRepository<BookingStatusLog> statuslog, SqlSugarRepository<BookingStatusLogDetail> statuslogdetail,
ILogger<BookingOrderService> logger, ISysCacheService cache, IDjyWebsiteAccountConfigService webAccountConfig, ISysDataUserMenu right,
SqlSugarRepository<BookingPrintTemplate> repPrintTemplate, SqlSugarRepository<BookingLetteryard> repLetterYard, SqlSugarRepository<SysUser> repUser,
SqlSugarRepository<BookingOrderUrl> repOrderUrl, SqlSugarRepository<BookingOrderContact> repOrderContact, SqlSugarRepository<BookingSampleBill> repSampleBill,
SqlSugarRepository<BookingOrderUrl> repOrderUrl, SqlSugarRepository<BookingOrderContact> repOrderContact, SqlSugarRepository<BookingSampleBill> repSampleBill, SqlSugarRepository<DjyCustomer> djycustomer,
SqlSugarRepository<BookingExcelTemplate> excelrep, SqlSugarRepository<DjyUserMailAccount> repUserMail, SqlSugarRepository<BookingGoodsStatus> goodsStatus, SqlSugarRepository<BookingGoodsStatusConfig> goodsStatusConfig,
SqlSugarRepository<SysTenant> repTenant, SqlSugarRepository<BookingStatus> repBookingStatus, SqlSugarRepository<BookingEDIExt> bookingEDIExt, SqlSugarRepository<BookingServiceItem> serviceItem,
IHttpContextAccessor httpContextAccessor,IBookingGoodsStatusConfigService GoodsConfig)
@ -156,6 +157,7 @@ namespace Myshipping.Application
this._serviceItem = serviceItem;
this._goodsStatus = goodsStatus;
this._goodsStatusConfig = goodsStatusConfig;
this._djycustomer = djycustomer;
_httpContextAccessor = httpContextAccessor;
_GoodsConfig = GoodsConfig;
}
@ -3317,7 +3319,6 @@ namespace Myshipping.Application
{
return await InnerBookingOrClosingEDI(model);
}
#endregion
[NonAction]
public async Task<string> InnerBookingOrClosingEDI(BookingOrClosingEDIOrderDto model)
@ -4019,6 +4020,7 @@ namespace Myshipping.Application
await _bookingfile.InsertAsync(bookFile);
}
#endregion
#region 下载订舱、截单EDI
/// <summary>
@ -5033,5 +5035,36 @@ namespace Myshipping.Application
}
#endregion
/// <summary>
///获取下拉前10条接口
/// </summary>
/// <returns></returns>
public async Task<dynamic> GetAllSelectData()
{
////报关行
var BGH= _djycustomer.Where(x => x.PropString == "customs_broker").Take(10).ToList();
//车队
var CD = _djycustomer.Where(x => x.PropString == "fleet").Take(10).ToList();
//国外代理
return null;
}
}
}

@ -806,7 +806,14 @@ namespace Myshipping.Application.Service.BookingOrder.Dto
/// </summary>
public string EPCode { get; set; }
/// <summary>
/// 单证备注
/// </summary>
public string DZRemark { get; set; }
/// <summary>
/// 操作备注
/// </summary>
public string CZRemark { get; set; }
public List<BookingStatus> bookstatus { get; set; }
public List<BookingRemark> bookremark { get; set; }

@ -138,7 +138,7 @@ namespace Myshipping.Application
entity.Vessel = model.Vessel.ToUpper().Trim();
if (!string.IsNullOrEmpty( entity.CARRIER)) {
entity.CARRIERID = _cache.GetAllCodeCarrier().Result.Where(x => x.CnName == entity.CARRIER).Select(x => x.Code).First();
entity.CARRIERID = _cache.GetAllCodeCarrier().Result.Where(x => x.CnName == entity.CARRIER).Select(x => x.Code).FirstOrDefault();
}
if (m == null)
{
@ -227,24 +227,24 @@ namespace Myshipping.Application
}
if (!string.IsNullOrEmpty(entity.CUSTOMSER))
{
entity.CUSTOMSERID = djycustomer.Result.Where(x => x.ShortName == entity.CUSTOMSER && x.PropString == "customs_broker").Select(x => x.CodeName).First();
entity.CUSTOMSERID = djycustomer.Result.Where(x => x.ShortName == entity.CUSTOMSER && x.PropString == "customs_broker").Select(x => x.CodeName).FirstOrDefault();
}
if (!string.IsNullOrEmpty(entity.TRUCKER))
{
entity.TRUCKERID = djycustomer.Result.Where(x => x.ShortName == entity.TRUCKER && x.PropString == "fleet").Select(x => x.CodeName).First();
entity.TRUCKERID = djycustomer.Result.Where(x => x.ShortName == entity.TRUCKER && x.PropString == "fleet").Select(x => x.CodeName).FirstOrDefault();
}
if (!string.IsNullOrEmpty(entity.CUSTOMERNAME))
{
entity.CUSTOMERID = djycustomer.Result.Where(x => x.ShortName == entity.CUSTOMERNAME && x.PropString == "consignor").Select(x => x.Id).First();
entity.CUSTOMERID = djycustomer.Result.Where(x => x.ShortName == entity.CUSTOMERNAME && x.PropString == "consignor").Select(x => x.Id).FirstOrDefault();
}
if (!string.IsNullOrEmpty(entity.FORWARDER))
{
entity.FORWARDERID = djycustomer.Result.Where(x => x.ShortName == entity.FORWARDER && x.PropString == "booking_agent").Select(x => x.CodeName).First();
entity.FORWARDERID = djycustomer.Result.Where(x => x.ShortName == entity.FORWARDER && x.PropString == "booking_agent").Select(x => x.CodeName).FirstOrDefault();
}
if (!string.IsNullOrEmpty(entity.CARRIER))
{
entity.CARRIERID = _cache.GetAllCodeCarrier().Result.Where(x => x.CnName == entity.CARRIER).Select(x => x.Code).First();
entity.CARRIERID = _cache.GetAllCodeCarrier().Result.Where(x => x.CnName == entity.CARRIER).Select(x => x.Code).FirstOrDefault();
}
entity.CreatedUserId = user.Result.Id;
entity.CreatedUserName = user.Result.Name.ToString();
@ -259,7 +259,7 @@ namespace Myshipping.Application
ctnentity.BILLID = entity.Id;
ctnentity.CreatedUserId = user.Result.Id;
ctnentity.CreatedUserName = user.Result.Name;
ctnentity.CTNCODE = ctncode.Where(x => x.Name == ctnentity.CTNALL).Select(x => x.Code).First();
ctnentity.CTNCODE = ctncode.Where(x => x.Name == ctnentity.CTNALL).Select(x => x.Code).FirstOrDefault();
await _repCtn.InsertAsync(ctnentity);
//这里保存有可能没有添加多品名,所有箱下没有货物信息
@ -357,24 +357,24 @@ namespace Myshipping.Application
}
if (!string.IsNullOrEmpty(fdentity.CUSTOMSER))
{
fdentity.CUSTOMSERID = djycustomer.Result.Where(x => x.ShortName == fdentity.CUSTOMSER && x.PropString == "customs_broker").Select(x => x.CodeName).First();
fdentity.CUSTOMSERID = djycustomer.Result.Where(x => x.ShortName == fdentity.CUSTOMSER && x.PropString == "customs_broker").Select(x => x.CodeName).FirstOrDefault();
}
if (!string.IsNullOrEmpty(fdentity.TRUCKER))
{
fdentity.TRUCKERID = djycustomer.Result.Where(x => x.ShortName == fdentity.TRUCKER && x.PropString == "fleet").Select(x => x.CodeName).First();
fdentity.TRUCKERID = djycustomer.Result.Where(x => x.ShortName == fdentity.TRUCKER && x.PropString == "fleet").Select(x => x.CodeName).FirstOrDefault();
}
if (!string.IsNullOrEmpty(fdentity.CUSTOMERNAME))
{
fdentity.CUSTOMERID = djycustomer.Result.Where(x => x.ShortName == fdentity.CUSTOMERNAME && x.PropString == "consignor").Select(x => x.Id).First();
fdentity.CUSTOMERID = djycustomer.Result.Where(x => x.ShortName == fdentity.CUSTOMERNAME && x.PropString == "consignor").Select(x => x.Id).FirstOrDefault();
}
if (!string.IsNullOrEmpty(fdentity.FORWARDER))
{
fdentity.FORWARDERID = djycustomer.Result.Where(x => x.ShortName == fdentity.FORWARDER && x.PropString == "booking_agent").Select(x => x.CodeName).First();
fdentity.FORWARDERID = djycustomer.Result.Where(x => x.ShortName == fdentity.FORWARDER && x.PropString == "booking_agent").Select(x => x.CodeName).FirstOrDefault();
}
if (!string.IsNullOrEmpty(entity.CARRIER))
{
fdentity.CARRIERID = _cache.GetAllCodeCarrier().Result.Where(x => x.CnName == entity.CARRIER).Select(x => x.Code).First();
fdentity.CARRIERID = _cache.GetAllCodeCarrier().Result.Where(x => x.CnName == entity.CARRIER).Select(x => x.Code).FirstOrDefault();
}
fdentity.MBLNO = entity.MBLNO;
fdentity.CreatedUserId = user.Result.Id;
@ -391,7 +391,7 @@ namespace Myshipping.Application
ctnentity.BILLID = fdentity.Id;
ctnentity.CreatedUserId = user.Result.Id;
ctnentity.CreatedUserName = user.Result.Name;
ctnentity.CTNCODE = ctncode.Where(x => x.Name == ctnentity.CTNALL).Select(x => x.Code).First();
ctnentity.CTNCODE = ctncode.Where(x => x.Name == ctnentity.CTNALL).Select(x => x.Code).FirstOrDefault();
await _repCtn.InsertAsync(ctnentity);
//这里保存有可能没有添加多品名,所有箱下没有货物信息
@ -500,24 +500,24 @@ namespace Myshipping.Application
}
if (!string.IsNullOrEmpty(entity.CUSTOMSER))
{
entity.CUSTOMSERID = djycustomer.Result.Where(x => x.ShortName == entity.CUSTOMSER && x.PropString == "customs_broker").Select(x => x.CodeName).First();
entity.CUSTOMSERID = djycustomer.Result.Where(x => x.ShortName == entity.CUSTOMSER && x.PropString == "customs_broker").Select(x => x.CodeName).FirstOrDefault();
}
if (!string.IsNullOrEmpty(entity.TRUCKER))
{
entity.TRUCKERID = djycustomer.Result.Where(x => x.ShortName == entity.TRUCKER && x.PropString == "fleet").Select(x => x.CodeName).First();
entity.TRUCKERID = djycustomer.Result.Where(x => x.ShortName == entity.TRUCKER && x.PropString == "fleet").Select(x => x.CodeName).FirstOrDefault();
}
if (!string.IsNullOrEmpty(entity.CUSTOMERNAME))
{
entity.CUSTOMERID = djycustomer.Result.Where(x => x.ShortName == entity.CUSTOMERNAME && x.PropString == "consignor").Select(x => x.Id).First();
entity.CUSTOMERID = djycustomer.Result.Where(x => x.ShortName == entity.CUSTOMERNAME && x.PropString == "consignor").Select(x => x.Id).FirstOrDefault();
}
if (!string.IsNullOrEmpty(entity.FORWARDER))
{
entity.FORWARDERID = djycustomer.Result.Where(x => x.ShortName == entity.FORWARDER && x.PropString == "booking_agent").Select(x => x.CodeName).First();
entity.FORWARDERID = djycustomer.Result.Where(x => x.ShortName == entity.FORWARDER && x.PropString == "booking_agent").Select(x => x.CodeName).FirstOrDefault();
}
if (!string.IsNullOrEmpty(entity.CARRIER))
{
entity.CARRIERID = _cache.GetAllCodeCarrier().Result.Where(x => x.CnName == entity.CARRIER).Select(x => x.Code).First();
entity.CARRIERID = _cache.GetAllCodeCarrier().Result.Where(x => x.CnName == entity.CARRIER).Select(x => x.Code).FirstOrDefault();
}
entity.IsDeleted = false;
await _rep.AsUpdateable(entity).IgnoreColumns(it => new
@ -539,7 +539,7 @@ namespace Myshipping.Application
ctnentity.BILLID = main.Id;
ctnentity.CreatedUserId = user.Result.Id;
ctnentity.CreatedUserName = user.Result.Name;
ctnentity.CTNCODE = ctncode.Where(x => x.Name == ctnentity.CTNALL).Select(x => x.Code).First();
ctnentity.CTNCODE = ctncode.Where(x => x.Name == ctnentity.CTNALL).Select(x => x.Code).FirstOrDefault();
await _repCtn.InsertAsync(ctnentity);
if (item.ctnDetailInputs != null)
{
@ -698,24 +698,24 @@ namespace Myshipping.Application
}
if (!string.IsNullOrEmpty(fdentity.CUSTOMSER))
{
fdentity.CUSTOMSERID = djycustomer.Result.Where(x => x.ShortName == fdentity.CUSTOMSER && x.PropString == "customs_broker").Select(x => x.CodeName).First();
fdentity.CUSTOMSERID = djycustomer.Result.Where(x => x.ShortName == fdentity.CUSTOMSER && x.PropString == "customs_broker").Select(x => x.CodeName).FirstOrDefault();
}
if (!string.IsNullOrEmpty(fdentity.TRUCKER))
{
fdentity.TRUCKERID = djycustomer.Result.Where(x => x.ShortName == fdentity.TRUCKER && x.PropString == "fleet").Select(x => x.CodeName).First();
fdentity.TRUCKERID = djycustomer.Result.Where(x => x.ShortName == fdentity.TRUCKER && x.PropString == "fleet").Select(x => x.CodeName).FirstOrDefault();
}
if (!string.IsNullOrEmpty(fdentity.CUSTOMERNAME))
{
fdentity.CUSTOMERID = djycustomer.Result.Where(x => x.ShortName == fdentity.CUSTOMERNAME && x.PropString == "consignor").Select(x => x.Id).First();
fdentity.CUSTOMERID = djycustomer.Result.Where(x => x.ShortName == fdentity.CUSTOMERNAME && x.PropString == "consignor").Select(x => x.Id).FirstOrDefault();
}
if (!string.IsNullOrEmpty(fdentity.FORWARDER))
{
fdentity.FORWARDERID = djycustomer.Result.Where(x => x.ShortName == fdentity.FORWARDER && x.PropString == "booking_agent").Select(x => x.CodeName).First();
fdentity.FORWARDERID = djycustomer.Result.Where(x => x.ShortName == fdentity.FORWARDER && x.PropString == "booking_agent").Select(x => x.CodeName).FirstOrDefault();
}
if (!string.IsNullOrEmpty(entity.CARRIER))
{
fdentity.CARRIERID = _cache.GetAllCodeCarrier().Result.Where(x => x.CnName == entity.CARRIER).Select(x => x.Code).First();
fdentity.CARRIERID = _cache.GetAllCodeCarrier().Result.Where(x => x.CnName == entity.CARRIER).Select(x => x.Code).FirstOrDefault();
}
await _rep.AsUpdateable(fdentity).IgnoreColumns(it => new
{
@ -736,7 +736,7 @@ namespace Myshipping.Application
ctnentity.BILLID = fdmain.Id;
ctnentity.CreatedUserId = user.Result.Id;
ctnentity.CreatedUserName = user.Result.Name;
ctnentity.CTNCODE = ctncode.Where(x => x.Name == ctnentity.CTNALL).Select(x => x.Code).First();
ctnentity.CTNCODE = ctncode.Where(x => x.Name == ctnentity.CTNALL).Select(x => x.Code).FirstOrDefault();
await _repCtn.InsertAsync(ctnentity);
if (it.ctnDetailInputs != null)
{
@ -972,24 +972,24 @@ namespace Myshipping.Application
}
if (!string.IsNullOrEmpty(entity.CUSTOMSER))
{
entity.CUSTOMSERID = djycustomer.Result.Where(x => x.ShortName == entity.CUSTOMSER && x.PropString == "customs_broker").Select(x => x.CodeName).First();
entity.CUSTOMSERID = djycustomer.Result.Where(x => x.ShortName == entity.CUSTOMSER && x.PropString == "customs_broker").Select(x => x.CodeName).FirstOrDefault();
}
if (!string.IsNullOrEmpty(entity.TRUCKER))
{
entity.TRUCKERID = djycustomer.Result.Where(x => x.ShortName == entity.TRUCKER && x.PropString == "fleet").Select(x => x.CodeName).First();
entity.TRUCKERID = djycustomer.Result.Where(x => x.ShortName == entity.TRUCKER && x.PropString == "fleet").Select(x => x.CodeName).FirstOrDefault();
}
if (!string.IsNullOrEmpty(entity.CUSTOMERNAME))
{
entity.CUSTOMERID = djycustomer.Result.Where(x => x.ShortName == entity.CUSTOMERNAME && x.PropString == "consignor").Select(x => x.Id).First();
entity.CUSTOMERID = djycustomer.Result.Where(x => x.ShortName == entity.CUSTOMERNAME && x.PropString == "consignor").Select(x => x.Id).FirstOrDefault();
}
if (!string.IsNullOrEmpty(entity.FORWARDER))
{
entity.FORWARDERID = djycustomer.Result.Where(x => x.ShortName == entity.FORWARDER && x.PropString == "booking_agent").Select(x => x.CodeName).First();
entity.FORWARDERID = djycustomer.Result.Where(x => x.ShortName == entity.FORWARDER && x.PropString == "booking_agent").Select(x => x.CodeName).FirstOrDefault();
}
if (!string.IsNullOrEmpty(entity.CARRIER))
{
entity.CARRIERID = _cache.GetAllCodeCarrier().Result.Where(x => x.CnName == entity.CARRIER).Select(x => x.Code).First();
entity.CARRIERID = _cache.GetAllCodeCarrier().Result.Where(x => x.CnName == entity.CARRIER).Select(x => x.Code).FirstOrDefault();
}
entity.CreatedUserId = user.Result.Id;
entity.CreatedUserName = user.Result.Name.ToString();
@ -1004,7 +1004,7 @@ namespace Myshipping.Application
ctnentity.BILLID = entity.Id;
ctnentity.CreatedUserId = user.Result.Id;
ctnentity.CreatedUserName = user.Result.Name;
ctnentity.CTNCODE = ctncode.Where(x => x.Name == ctnentity.CTNALL).Select(x => x.Code).First();
ctnentity.CTNCODE = ctncode.Where(x => x.Name == ctnentity.CTNALL).Select(x => x.Code).FirstOrDefault();
await _repCtn.InsertAsync(ctnentity);
//这里保存有可能没有添加多品名,所有箱下没有货物信息
@ -1100,24 +1100,24 @@ namespace Myshipping.Application
}
if (!string.IsNullOrEmpty(fdentity.CUSTOMSER))
{
fdentity.CUSTOMSERID = djycustomer.Result.Where(x => x.ShortName == fdentity.CUSTOMSER && x.PropString == "customs_broker").Select(x => x.CodeName).First();
fdentity.CUSTOMSERID = djycustomer.Result.Where(x => x.ShortName == fdentity.CUSTOMSER && x.PropString == "customs_broker").Select(x => x.CodeName).FirstOrDefault();
}
if (!string.IsNullOrEmpty(fdentity.TRUCKER))
{
fdentity.TRUCKERID = djycustomer.Result.Where(x => x.ShortName == fdentity.TRUCKER && x.PropString == "fleet").Select(x => x.CodeName).First();
fdentity.TRUCKERID = djycustomer.Result.Where(x => x.ShortName == fdentity.TRUCKER && x.PropString == "fleet").Select(x => x.CodeName).FirstOrDefault();
}
if (!string.IsNullOrEmpty(fdentity.CUSTOMERNAME))
{
fdentity.CUSTOMERID = djycustomer.Result.Where(x => x.ShortName == fdentity.CUSTOMERNAME && x.PropString == "consignor").Select(x => x.Id).First();
fdentity.CUSTOMERID = djycustomer.Result.Where(x => x.ShortName == fdentity.CUSTOMERNAME && x.PropString == "consignor").Select(x => x.Id).FirstOrDefault();
}
if (!string.IsNullOrEmpty(fdentity.FORWARDER))
{
fdentity.FORWARDERID = djycustomer.Result.Where(x => x.ShortName == fdentity.FORWARDER && x.PropString == "booking_agent").Select(x => x.CodeName).First();
fdentity.FORWARDERID = djycustomer.Result.Where(x => x.ShortName == fdentity.FORWARDER && x.PropString == "booking_agent").Select(x => x.CodeName).FirstOrDefault();
}
if (!string.IsNullOrEmpty(entity.CARRIER))
{
fdentity.CARRIER = entity.CARRIER;
fdentity.CARRIERID = _cache.GetAllCodeCarrier().Result.Where(x => x.CnName == entity.CARRIER).Select(x => x.Code).First();
fdentity.CARRIERID = _cache.GetAllCodeCarrier().Result.Where(x => x.CnName == entity.CARRIER).Select(x => x.Code).FirstOrDefault();
}
fdentity.MBLNO = entity.MBLNO;
fdentity.CreatedUserId = user.Result.Id;
@ -1134,7 +1134,7 @@ namespace Myshipping.Application
ctnentity.BILLID = fdentity.Id;
ctnentity.CreatedUserId = user.Result.Id;
ctnentity.CreatedUserName = user.Result.Name;
ctnentity.CTNCODE = ctncode.Where(x => x.Name == ctnentity.CTNALL).Select(x => x.Code).First();
ctnentity.CTNCODE = ctncode.Where(x => x.Name == ctnentity.CTNALL).Select(x => x.Code).FirstOrDefault();
await _repCtn.InsertAsync(ctnentity);
//这里保存有可能没有添加多品名,所有箱下没有货物信息
@ -1240,24 +1240,24 @@ namespace Myshipping.Application
}
if (!string.IsNullOrEmpty(entity.CUSTOMSER))
{
entity.CUSTOMSERID = djycustomer.Result.Where(x => x.ShortName == entity.CUSTOMSER && x.PropString == "customs_broker").Select(x => x.CodeName).First();
entity.CUSTOMSERID = djycustomer.Result.Where(x => x.ShortName == entity.CUSTOMSER && x.PropString == "customs_broker").Select(x => x.CodeName).FirstOrDefault();
}
if (!string.IsNullOrEmpty(entity.TRUCKER))
{
entity.TRUCKERID = djycustomer.Result.Where(x => x.ShortName == entity.TRUCKER && x.PropString == "fleet").Select(x => x.CodeName).First();
entity.TRUCKERID = djycustomer.Result.Where(x => x.ShortName == entity.TRUCKER && x.PropString == "fleet").Select(x => x.CodeName).FirstOrDefault();
}
if (!string.IsNullOrEmpty(entity.CUSTOMERNAME))
{
entity.CUSTOMERID = djycustomer.Result.Where(x => x.ShortName == entity.CUSTOMERNAME && x.PropString == "consignor").Select(x => x.Id).First();
entity.CUSTOMERID = djycustomer.Result.Where(x => x.ShortName == entity.CUSTOMERNAME && x.PropString == "consignor").Select(x => x.Id).FirstOrDefault();
}
if (!string.IsNullOrEmpty(entity.FORWARDER))
{
entity.FORWARDERID = djycustomer.Result.Where(x => x.ShortName == entity.FORWARDER && x.PropString == "booking_agent").Select(x => x.CodeName).First();
entity.FORWARDERID = djycustomer.Result.Where(x => x.ShortName == entity.FORWARDER && x.PropString == "booking_agent").Select(x => x.CodeName).FirstOrDefault();
}
if (!string.IsNullOrEmpty(entity.CARRIER))
{
entity.CARRIER = entity.CARRIER;
entity.CARRIERID = _cache.GetAllCodeCarrier().Result.Where(x => x.CnName == entity.CARRIER).Select(x => x.Code).First();
entity.CARRIERID = _cache.GetAllCodeCarrier().Result.Where(x => x.CnName == entity.CARRIER).Select(x => x.Code).FirstOrDefault();
}
await _rep.AsUpdateable(entity).IgnoreColumns(it => new
{
@ -1278,7 +1278,7 @@ namespace Myshipping.Application
ctnentity.BILLID = main.Id;
ctnentity.CreatedUserId = user.Result.Id;
ctnentity.CreatedUserName = user.Result.Name;
ctnentity.CTNCODE = ctncode.Where(x => x.Name == ctnentity.CTNALL).Select(x => x.Code).First();
ctnentity.CTNCODE = ctncode.Where(x => x.Name == ctnentity.CTNALL).Select(x => x.Code).FirstOrDefault();
await _repCtn.InsertAsync(ctnentity);
if (item.ctnDetailInputs != null)
{
@ -1435,24 +1435,24 @@ namespace Myshipping.Application
}
if (!string.IsNullOrEmpty(fdentity.CUSTOMSER))
{
fdentity.CUSTOMSERID = djycustomer.Result.Where(x => x.ShortName == fdentity.CUSTOMSER && x.PropString == "customs_broker").Select(x => x.CodeName).First();
fdentity.CUSTOMSERID = djycustomer.Result.Where(x => x.ShortName == fdentity.CUSTOMSER && x.PropString == "customs_broker").Select(x => x.CodeName).FirstOrDefault();
}
if (!string.IsNullOrEmpty(fdentity.TRUCKER))
{
fdentity.TRUCKERID = djycustomer.Result.Where(x => x.ShortName == fdentity.TRUCKER && x.PropString == "fleet").Select(x => x.CodeName).First();
fdentity.TRUCKERID = djycustomer.Result.Where(x => x.ShortName == fdentity.TRUCKER && x.PropString == "fleet").Select(x => x.CodeName).FirstOrDefault();
}
if (!string.IsNullOrEmpty(fdentity.CUSTOMERNAME))
{
fdentity.CUSTOMERID = djycustomer.Result.Where(x => x.ShortName == fdentity.CUSTOMERNAME && x.PropString == "consignor").Select(x => x.Id).First();
fdentity.CUSTOMERID = djycustomer.Result.Where(x => x.ShortName == fdentity.CUSTOMERNAME && x.PropString == "consignor").Select(x => x.Id).FirstOrDefault();
}
if (!string.IsNullOrEmpty(fdentity.FORWARDER))
{
fdentity.FORWARDERID = djycustomer.Result.Where(x => x.ShortName == fdentity.FORWARDER && x.PropString == "booking_agent").Select(x => x.CodeName).First();
fdentity.FORWARDERID = djycustomer.Result.Where(x => x.ShortName == fdentity.FORWARDER && x.PropString == "booking_agent").Select(x => x.CodeName).FirstOrDefault();
}
if (!string.IsNullOrEmpty(entity.CARRIER))
{
fdentity.CARRIER = entity.CARRIER;
fdentity.CARRIERID = _cache.GetAllCodeCarrier().Result.Where(x => x.CnName == entity.CARRIER).Select(x => x.Code).First();
fdentity.CARRIERID = _cache.GetAllCodeCarrier().Result.Where(x => x.CnName == entity.CARRIER).Select(x => x.Code).FirstOrDefault();
}
await _rep.AsUpdateable(fdentity).IgnoreColumns(it => new
{
@ -1473,7 +1473,7 @@ namespace Myshipping.Application
ctnentity.BILLID = fdmain.Id;
ctnentity.CreatedUserId = user.Result.Id;
ctnentity.CreatedUserName = user.Result.Name;
ctnentity.CTNCODE = ctncode.Where(x => x.Name == ctnentity.CTNALL).Select(x => x.Code).First();
ctnentity.CTNCODE = ctncode.Where(x => x.Name == ctnentity.CTNALL).Select(x => x.Code).FirstOrDefault();
await _repCtn.InsertAsync(ctnentity);
if (it.ctnDetailInputs != null)
{

Loading…
Cancel
Save