|
|
@ -27,7 +27,9 @@ using Myshipping.Core.Service;
|
|
|
|
using Newtonsoft.Json;
|
|
|
|
using Newtonsoft.Json;
|
|
|
|
using Newtonsoft.Json.Linq;
|
|
|
|
using Newtonsoft.Json.Linq;
|
|
|
|
using NPOI.SS.Formula.PTG;
|
|
|
|
using NPOI.SS.Formula.PTG;
|
|
|
|
|
|
|
|
using NPOI.XWPF.UserModel;
|
|
|
|
using RabbitMQ.Client;
|
|
|
|
using RabbitMQ.Client;
|
|
|
|
|
|
|
|
using StackExchange.Profiling.Internal;
|
|
|
|
using System;
|
|
|
|
using System;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using System.Data;
|
|
|
|
using System.Data;
|
|
|
@ -854,120 +856,6 @@ namespace Myshipping.Application
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
|
|
/// 查询船期数据EMC(即将作废,用QueryShipInfo接口替代)
|
|
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
|
|
[HttpGet("/BookingCustomerOrder/QueryShipInfoEMC")]
|
|
|
|
|
|
|
|
public async Task<dynamic> QueryShipInfoEMC(long custOrdId)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
var allSysConfig = await _cache.GetAllSysConfig();
|
|
|
|
|
|
|
|
var sCfgSpiderUrl = allSysConfig.FirstOrDefault(x => x.Code == "BookingPostApiServerAddr" && x.GroupCode == "DJY_CONST");
|
|
|
|
|
|
|
|
if (sCfgSpiderUrl == null)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
throw Oops.Bah("订舱API的爬虫URL地址未配置,请联系管理员");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var sCfgUserKey = allSysConfig.FirstOrDefault(x => x.Code == "BookingPostApiKey" && x.GroupCode == "DJY_CONST");
|
|
|
|
|
|
|
|
var sCfgUserSecret = allSysConfig.FirstOrDefault(x => x.Code == "BookingPostApiSecret" && x.GroupCode == "DJY_CONST");
|
|
|
|
|
|
|
|
if (sCfgUserKey == null || sCfgUserSecret == null)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
throw Oops.Bah("订舱API的KEY和密钥未配置,请联系管理员");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var apiUrl = sCfgSpiderUrl.Value;
|
|
|
|
|
|
|
|
if (!apiUrl.EndsWith("/"))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
apiUrl += "/";
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
apiUrl += "v1/emc/ship/query";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var custOrder = await _rep.AsQueryable().FirstAsync(x => x.Id == custOrdId);
|
|
|
|
|
|
|
|
var ctns = await _repCtn.AsQueryable().Where(x => x.BILLID == custOrdId).ToListAsync();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var mappingCtn = await _cache.GetAllMappingCtn();
|
|
|
|
|
|
|
|
var mappingPortLoad = await _cache.GetAllMappingPortLoad();
|
|
|
|
|
|
|
|
var mappingPort = await _cache.GetAllMappingPort();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//收货地
|
|
|
|
|
|
|
|
var mapPlaceReceipt = mappingPortLoad.FirstOrDefault(x => x.Module == "DjyCustBooking" && x.CarrierCode == "EMC" && x.Code == custOrder.PLACERECEIPTCODE);
|
|
|
|
|
|
|
|
if (mapPlaceReceipt == null)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
throw Oops.Bah($"未找到收货地映射信息:{custOrder.PLACERECEIPTCODE}");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//起运港
|
|
|
|
|
|
|
|
var mapPortLoad = mappingPortLoad.FirstOrDefault(x => x.Module == "DjyCustBooking" && x.CarrierCode == "EMC" && x.Code == custOrder.PORTLOADCODE);
|
|
|
|
|
|
|
|
if (mapPortLoad == null)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
throw Oops.Bah($"未找到起运港映射信息:{custOrder.PORTLOADCODE}");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//卸货港
|
|
|
|
|
|
|
|
var mapPort = mappingPort.FirstOrDefault(x => x.Module == "DjyCustBooking" && x.CarrierCode == "EMC" && x.Code == custOrder.PORTDISCHARGECODE);
|
|
|
|
|
|
|
|
if (mapPort == null)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
throw Oops.Bah($"未找到卸货港映射信息:{custOrder.PORTDISCHARGECODE}");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//目的地
|
|
|
|
|
|
|
|
var mapDestination = mappingPort.FirstOrDefault(x => x.Module == "DjyCustBooking" && x.CarrierCode == "EMC" && x.Code == custOrder.DESTINATIONCODE);
|
|
|
|
|
|
|
|
if (mapDestination == null)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
throw Oops.Bah($"未找到目的地映射信息:{custOrder.DESTINATIONCODE}");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//箱型转换
|
|
|
|
|
|
|
|
var disCtnCode = ctns.Select(x => x.CTNCODE).Distinct().ToList();
|
|
|
|
|
|
|
|
var mapCtnCode = new List<string>();
|
|
|
|
|
|
|
|
foreach (var ctnall in disCtnCode)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
var mapCtn = mappingCtn.FirstOrDefault(x => x.Module == "DjyCustBooking" && x.CarrierCode == "EMC" && x.Code == ctnall);
|
|
|
|
|
|
|
|
if (mapCtn == null)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
throw Oops.Bah($"未找到箱型映射信息:{ctnall}");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
mapCtnCode.Add(mapCtn.MapName);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var postModel = new
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
userKey = sCfgUserKey.Value,
|
|
|
|
|
|
|
|
userSecret = sCfgUserSecret.Value,
|
|
|
|
|
|
|
|
webAccount = custOrder.BookingAccount,
|
|
|
|
|
|
|
|
webPassword = custOrder.BookingPassword,
|
|
|
|
|
|
|
|
searchConditionDate = custOrder.ETD.Value.AddDays(-7).ToString("yyyy-MM-dd"),
|
|
|
|
|
|
|
|
originName = mapPlaceReceipt.MapName,
|
|
|
|
|
|
|
|
destinationName = mapDestination.MapName,
|
|
|
|
|
|
|
|
polPortName = mapPortLoad.MapName,
|
|
|
|
|
|
|
|
podPortName = mapPort.MapName,
|
|
|
|
|
|
|
|
serviceType = custOrder.ServiceType,
|
|
|
|
|
|
|
|
serviceMode = custOrder.ServiceMode,
|
|
|
|
|
|
|
|
bookingOffice = custOrder.BookingAddr,
|
|
|
|
|
|
|
|
isReefer = "N",
|
|
|
|
|
|
|
|
contractType = custOrder.ContractType,
|
|
|
|
|
|
|
|
contractNo = custOrder.CONTRACTNO,
|
|
|
|
|
|
|
|
containerTypeList = mapCtnCode
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_logger.LogInformation($"发送查询API数据给爬虫({apiUrl}):{postModel.ToJsonString()}");
|
|
|
|
|
|
|
|
var rtnQuery = await apiUrl.SetBody(postModel)
|
|
|
|
|
|
|
|
.PostAsStringAsync();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_logger.LogInformation($"爬虫返回:{rtnQuery}");
|
|
|
|
|
|
|
|
var jobjRtnQuery = JObject.Parse(rtnQuery);
|
|
|
|
|
|
|
|
if (jobjRtnQuery.GetIntValue("code") != 200)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
throw Oops.Bah($"查询船期数据出错:{jobjRtnQuery.GetStringValue("msg")}");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
var jarrVessel = jobjRtnQuery.GetJArrayValue("data");
|
|
|
|
|
|
|
|
return jarrVessel;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
/// 查询船期数据
|
|
|
|
/// 查询船期数据
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
@ -1291,49 +1179,50 @@ namespace Myshipping.Application
|
|
|
|
//进入客户订舱系统的订舱台账
|
|
|
|
//进入客户订舱系统的订舱台账
|
|
|
|
if (recModel.Accept)
|
|
|
|
if (recModel.Accept)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var bkOrder = model.Adapt<BookingOrder>();
|
|
|
|
bookingId = await CustomerToOrder(model);
|
|
|
|
bkOrder.Id = YitIdHelper.NextId();
|
|
|
|
//var bkOrder = model.Adapt<BookingOrder>();
|
|
|
|
bkOrder.BSSTATUS = "已录入";
|
|
|
|
//bkOrder.Id = YitIdHelper.NextId();
|
|
|
|
bkOrder.ParentId = 0;
|
|
|
|
//bkOrder.BSSTATUS = "已录入";
|
|
|
|
bkOrder.LANENAME = bkOrder.LANECODE;
|
|
|
|
//bkOrder.ParentId = 0;
|
|
|
|
await _repOrder.InsertAsync(bkOrder);
|
|
|
|
//bkOrder.LANENAME = bkOrder.LANECODE;
|
|
|
|
|
|
|
|
//await _repOrder.InsertAsync(bkOrder);
|
|
|
|
model.BookingId = bkOrder.Id; //客户订舱数据与订舱台账数据关联
|
|
|
|
|
|
|
|
bookingId = bkOrder.Id;
|
|
|
|
//model.BookingId = bkOrder.Id; //客户订舱数据与订舱台账数据关联
|
|
|
|
await _rep.UpdateAsync(model);
|
|
|
|
//bookingId = bkOrder.Id;
|
|
|
|
|
|
|
|
//await _rep.UpdateAsync(model);
|
|
|
|
var bkEdiExt = new BookingEDIExt();
|
|
|
|
|
|
|
|
bkEdiExt.Id = YitIdHelper.NextId();
|
|
|
|
//var bkEdiExt = new BookingEDIExt();
|
|
|
|
bkEdiExt.BookingId = bkOrder.Id;
|
|
|
|
//bkEdiExt.Id = YitIdHelper.NextId();
|
|
|
|
bkEdiExt.SalerCode = model.SaleCode;
|
|
|
|
//bkEdiExt.BookingId = bkOrder.Id;
|
|
|
|
await _repEdiExt.InsertAsync(bkEdiExt);
|
|
|
|
//bkEdiExt.SalerCode = model.SaleCode;
|
|
|
|
|
|
|
|
//await _repEdiExt.InsertAsync(bkEdiExt);
|
|
|
|
var ctnList = await _repCtn.AsQueryable().Filter(null, true).Where(x => x.BILLID == model.Id).ToListAsync();
|
|
|
|
|
|
|
|
foreach (var ctn in ctnList)
|
|
|
|
//var ctnList = await _repCtn.AsQueryable().Filter(null, true).Where(x => x.BILLID == model.Id).ToListAsync();
|
|
|
|
{
|
|
|
|
//foreach (var ctn in ctnList)
|
|
|
|
ctn.Id = YitIdHelper.NextId();
|
|
|
|
//{
|
|
|
|
ctn.BILLID = bkOrder.Id;
|
|
|
|
// ctn.Id = YitIdHelper.NextId();
|
|
|
|
await _repCtn.InsertAsync(ctn);
|
|
|
|
// ctn.BILLID = bkOrder.Id;
|
|
|
|
}
|
|
|
|
// await _repCtn.InsertAsync(ctn);
|
|
|
|
|
|
|
|
//}
|
|
|
|
//服务项目
|
|
|
|
|
|
|
|
var servList = await _repServiceItem.Where(x => x.BookingId == model.Id).ToListAsync();
|
|
|
|
////服务项目
|
|
|
|
foreach (var serv in servList)
|
|
|
|
//var servList = await _repServiceItem.Where(x => x.BookingId == model.Id).ToListAsync();
|
|
|
|
{
|
|
|
|
//foreach (var serv in servList)
|
|
|
|
serv.Id = YitIdHelper.NextId();
|
|
|
|
//{
|
|
|
|
serv.BookingId = bkOrder.Id;
|
|
|
|
// serv.Id = YitIdHelper.NextId();
|
|
|
|
await _repServiceItem.InsertAsync(serv);
|
|
|
|
// serv.BookingId = bkOrder.Id;
|
|
|
|
}
|
|
|
|
// await _repServiceItem.InsertAsync(serv);
|
|
|
|
|
|
|
|
//}
|
|
|
|
//附件
|
|
|
|
|
|
|
|
var files = await _repFile.AsQueryable().Filter(null, true).Where(x => x.BookingId == model.Id && x.IsDeleted == false).ToListAsync();
|
|
|
|
////附件
|
|
|
|
foreach (var file in files)
|
|
|
|
//var files = await _repFile.AsQueryable().Filter(null, true).Where(x => x.BookingId == model.Id && x.IsDeleted == false).ToListAsync();
|
|
|
|
{
|
|
|
|
//foreach (var file in files)
|
|
|
|
file.Id = YitIdHelper.NextId();
|
|
|
|
//{
|
|
|
|
file.BookingId = bkOrder.Id;
|
|
|
|
// file.Id = YitIdHelper.NextId();
|
|
|
|
|
|
|
|
// file.BookingId = bkOrder.Id;
|
|
|
|
await _repFile.InsertAsync(file);
|
|
|
|
|
|
|
|
}
|
|
|
|
// await _repFile.InsertAsync(file);
|
|
|
|
|
|
|
|
//}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -1769,9 +1658,125 @@ namespace Myshipping.Application
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endregion
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#region 多订舱编号
|
|
|
|
|
|
|
|
else if (feedbackType == BookingFeedbackType.OneToMulti.ToString())
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
var recModel = JsonConvert.DeserializeObject<BookingCustomerMultiCustNODto>(jsonContent);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var id = Convert.ToInt64(recModel.Id);
|
|
|
|
|
|
|
|
var model = _rep.AsQueryable().Filter(null, true).First(x => x.Id == id);
|
|
|
|
|
|
|
|
if (model == null)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
throw Oops.Bah("未找到数据");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var lstResp = new List<BookingCustomerMultiCustNORespDto>();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var ctns = await _repCtn.AsQueryable().Filter(null, true).Where(x => x.BILLID == id && x.IsDeleted == false).ToListAsync();
|
|
|
|
|
|
|
|
foreach (var bookNO in recModel.ListCustNO)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
var respDtO = new BookingCustomerMultiCustNORespDto();
|
|
|
|
|
|
|
|
lstResp.Add(respDtO);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//生成id并插入客户订舱数据
|
|
|
|
|
|
|
|
model.Id = YitIdHelper.NextId();
|
|
|
|
|
|
|
|
model.BOOKINGNO = $"BK{YitIdHelper.NextId()}";
|
|
|
|
|
|
|
|
JObject jobjExt = null;
|
|
|
|
|
|
|
|
if (!string.IsNullOrEmpty(model.ExtendData))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
jobjExt = JObject.Parse(model.ExtendData);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
jobjExt = new JObject();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
jobjExt["CustNO"] = bookNO;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await _rep.InsertAsync(model);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
foreach (var ctn in ctns)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
ctn.Id = YitIdHelper.NextId();
|
|
|
|
|
|
|
|
ctn.BILLID = model.Id;
|
|
|
|
|
|
|
|
await _repCtn.InsertAsync(ctn);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
respDtO.CustOrderId = model.Id;
|
|
|
|
|
|
|
|
respDtO.BookingNO = model.BOOKINGNO;
|
|
|
|
|
|
|
|
respDtO.CustNO = bookNO;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_logger.LogInformation($"根据客户订舱 {recModel.Id} 生成了相同的数据 {model.Id}");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//插入订舱台账
|
|
|
|
|
|
|
|
var ordId = await CustomerToOrder(model);
|
|
|
|
|
|
|
|
respDtO.OrderId = ordId;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_logger.LogInformation($"生成了订舱台账数据 {ordId}");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_logger.LogInformation($"反馈给运营端生成的数据 {lstResp.ToJsonString()}");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return lstResp;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
return null;
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
|
|
/// 客户订舱数据生成订舱台账
|
|
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
|
|
[NonAction]
|
|
|
|
|
|
|
|
public async Task<long> CustomerToOrder(BookingCustomerOrder custOrd)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
var bkOrder = custOrd.Adapt<BookingOrder>();
|
|
|
|
|
|
|
|
bkOrder.Id = YitIdHelper.NextId();
|
|
|
|
|
|
|
|
bkOrder.BSSTATUS = "已录入";
|
|
|
|
|
|
|
|
bkOrder.ParentId = 0;
|
|
|
|
|
|
|
|
bkOrder.LANENAME = bkOrder.LANECODE;
|
|
|
|
|
|
|
|
await _repOrder.InsertAsync(bkOrder);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
custOrd.BookingId = bkOrder.Id; //客户订舱数据与订舱台账数据关联
|
|
|
|
|
|
|
|
await _rep.UpdateAsync(custOrd);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var bkEdiExt = new BookingEDIExt();
|
|
|
|
|
|
|
|
bkEdiExt.Id = YitIdHelper.NextId();
|
|
|
|
|
|
|
|
bkEdiExt.BookingId = bkOrder.Id;
|
|
|
|
|
|
|
|
bkEdiExt.SalerCode = custOrd.SaleCode;
|
|
|
|
|
|
|
|
await _repEdiExt.InsertAsync(bkEdiExt);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var ctnList = await _repCtn.AsQueryable().Filter(null, true).Where(x => x.BILLID == custOrd.Id).ToListAsync();
|
|
|
|
|
|
|
|
foreach (var ctn in ctnList)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
ctn.Id = YitIdHelper.NextId();
|
|
|
|
|
|
|
|
ctn.BILLID = bkOrder.Id;
|
|
|
|
|
|
|
|
await _repCtn.InsertAsync(ctn);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//服务项目
|
|
|
|
|
|
|
|
var servList = await _repServiceItem.Where(x => x.BookingId == custOrd.Id).ToListAsync();
|
|
|
|
|
|
|
|
foreach (var serv in servList)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
serv.Id = YitIdHelper.NextId();
|
|
|
|
|
|
|
|
serv.BookingId = bkOrder.Id;
|
|
|
|
|
|
|
|
await _repServiceItem.InsertAsync(serv);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//附件
|
|
|
|
|
|
|
|
var files = await _repFile.AsQueryable().Filter(null, true).Where(x => x.BookingId == custOrd.Id && x.IsDeleted == false).ToListAsync();
|
|
|
|
|
|
|
|
foreach (var file in files)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
file.Id = YitIdHelper.NextId();
|
|
|
|
|
|
|
|
file.BookingId = bkOrder.Id;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await _repFile.InsertAsync(file);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return bkOrder.Id;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
/// 导入
|
|
|
|
/// 导入
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
@ -2300,7 +2305,8 @@ namespace Myshipping.Application
|
|
|
|
}
|
|
|
|
}
|
|
|
|
catch (Exception ex)
|
|
|
|
catch (Exception ex)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
_logger.LogWarning($"自动订舱失败:{ord},错误信息:{ex.Message}");
|
|
|
|
_logger.LogError($"自动订舱失败:{ord},错误信息:{ex.Message}");
|
|
|
|
|
|
|
|
_logger.LogError(ex.StackTrace);
|
|
|
|
await AuditBooking(ord.Id, false, ex.Message);
|
|
|
|
await AuditBooking(ord.Id, false, ex.Message);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -2443,28 +2449,41 @@ namespace Myshipping.Application
|
|
|
|
extObj = JObject.Parse(model.ExtendData);
|
|
|
|
extObj = JObject.Parse(model.ExtendData);
|
|
|
|
if (model.CARRIERID == "COSCO")
|
|
|
|
if (model.CARRIERID == "COSCO")
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var bookingNO = extObj.GetStringValue("BookingNO");
|
|
|
|
var custNO = extObj.GetStringValue("CustNO");
|
|
|
|
bkOrder.CUSTNO = bookingNO;
|
|
|
|
if (!string.IsNullOrEmpty(custNO))
|
|
|
|
await _repOrder.AsUpdateable(bkOrder).UpdateColumns(x => new { x.CUSTNO }).ExecuteCommandAsync();
|
|
|
|
{
|
|
|
|
CustomerBookingSyncHelper.SendCustomerBookingSync((long)id, BookingOrderSyncTypeEnum.CC.ToString());
|
|
|
|
bkOrder.CUSTNO = custNO;
|
|
|
|
_logger.LogInformation($"回写订舱号并回推客户端:{id} {bookingNO}");
|
|
|
|
await _repOrder.AsUpdateable(bkOrder).UpdateColumns(x => new { x.CUSTNO }).ExecuteCommandAsync();
|
|
|
|
|
|
|
|
CustomerBookingSyncHelper.SendCustomerBookingSync(id, BookingOrderSyncTypeEnum.CC.ToString());
|
|
|
|
|
|
|
|
_logger.LogInformation($"回写订舱号并回推客户端:{id} {custNO}");
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (model.CARRIERID == "EMC")
|
|
|
|
else if (model.CARRIERID == "EMC")
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var bookingNOArr = extObj.GetJArrayValue("BookingNO");
|
|
|
|
var custNOArr = extObj.GetJArrayValue("CustNO");
|
|
|
|
if (bookingNOArr.Count == 1)
|
|
|
|
if (custNOArr.Count > 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
bkOrder.CUSTNO = bookingNOArr.First().ToString();
|
|
|
|
var custNO = custNOArr.First().ToString();
|
|
|
|
|
|
|
|
bkOrder.CUSTNO = custNO;
|
|
|
|
await _repOrder.AsUpdateable(bkOrder).UpdateColumns(x => new { x.CUSTNO }).ExecuteCommandAsync();
|
|
|
|
await _repOrder.AsUpdateable(bkOrder).UpdateColumns(x => new { x.CUSTNO }).ExecuteCommandAsync();
|
|
|
|
CustomerBookingSyncHelper.SendCustomerBookingSync((long)id, BookingOrderSyncTypeEnum.CC.ToString());
|
|
|
|
CustomerBookingSyncHelper.SendCustomerBookingSync(id, BookingOrderSyncTypeEnum.CC.ToString());
|
|
|
|
_logger.LogInformation($"回写订舱号并回推客户端:{id} {bkOrder.CUSTNO}");
|
|
|
|
_logger.LogInformation($"回写订舱号并回推客户端:{id} {bkOrder.CUSTNO}");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//有多票订舱编号,后台自动创建数据并对应
|
|
|
|
|
|
|
|
custNOArr.RemoveAt(0);
|
|
|
|
|
|
|
|
if (custNOArr.Count > 0)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
CustomerBookingSyncHelper.SendCustomerMultiCustNOSync(new BookingCustomerMultiCustNODto()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
Id = model.BSNO,
|
|
|
|
|
|
|
|
ListCustNO = custNOArr.Select(x => x.ToString()).ToList()
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//扣费
|
|
|
|
//扣费
|
|
|
|
if (accept)
|
|
|
|
if (accept)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -2472,6 +2491,24 @@ namespace Myshipping.Application
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
|
|
/// 测试多票订舱编号
|
|
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
|
|
[HttpGet("/BookingCustomerOrder/TestMultiBookingNO"), AllowAnonymous]
|
|
|
|
|
|
|
|
public async Task TestMultiBookingNO(long id)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
JArray bookingNOArr = new JArray
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
"Test001",
|
|
|
|
|
|
|
|
"Test002"
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
CustomerBookingSyncHelper.SendCustomerMultiCustNOSync(new BookingCustomerMultiCustNODto()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
Id = id.ToString(),
|
|
|
|
|
|
|
|
ListCustNO = bookingNOArr.Select(x => x.ToString()).ToList()
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
/// 接收客户订舱系统取消提交的数据
|
|
|
|
/// 接收客户订舱系统取消提交的数据
|
|
|
@ -2684,8 +2721,16 @@ namespace Myshipping.Application
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var staLog = new BookingStatusLog();
|
|
|
|
var staLog = new BookingStatusLog();
|
|
|
|
staLog.Status = status;
|
|
|
|
staLog.Status = status;
|
|
|
|
staLog.CreatedUserId = UserManager.UserId;
|
|
|
|
if (App.User.FindFirst(ClaimConst.CLAINM_USERID) == null)
|
|
|
|
staLog.CreatedUserName = UserManager.Name;
|
|
|
|
{
|
|
|
|
|
|
|
|
staLog.CreatedUserId = 0;
|
|
|
|
|
|
|
|
staLog.CreatedUserName = "系统";
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
staLog.CreatedUserId = UserManager.UserId;
|
|
|
|
|
|
|
|
staLog.CreatedUserName = UserManager.Name;
|
|
|
|
|
|
|
|
}
|
|
|
|
staLog.CreatedTime = DateTime.Now;
|
|
|
|
staLog.CreatedTime = DateTime.Now;
|
|
|
|
staLog.OpTime = DateTime.Now;
|
|
|
|
staLog.OpTime = DateTime.Now;
|
|
|
|
staLog.BookingId = bookId;
|
|
|
|
staLog.BookingId = bookId;
|
|
|
|