jianghaiqing 5 months ago
commit 0351c9c86b

@ -518,11 +518,14 @@ namespace Myshipping.Application.Event
_logger.LogInformation($"根据客户订舱反馈数据 {custOrder.BSNO} 生成了相同的数据 {custOrder.Id}"); _logger.LogInformation($"根据客户订舱反馈数据 {custOrder.BSNO} 生成了相同的数据 {custOrder.Id}");
//插入订舱台账 //插入订舱台账
var ordId = await servCustOrder.CustomerToOrder(custOrder); var ord = await servCustOrder.CustomerToOrder(custOrder);
custOrder.BookingId = ordId; custOrder.BookingId = ord.Id;
await repoCutomerOrder.AsUpdateable(custOrder).UpdateColumns(x => new { x.BookingId }).ExecuteCommandAsync(); await repoCutomerOrder.AsUpdateable(custOrder).UpdateColumns(x => new { x.BookingId }).ExecuteCommandAsync();
_logger.LogInformation($"生成了订舱台账数据 {ordId}"); ord.BSNO = item.GetStringValue("OrderId");
await repoOrder.AsUpdateable(ord).UpdateColumns(x => new { x.BSNO }).ExecuteCommandAsync();
_logger.LogInformation($"生成了订舱台账数据 {ord.Id}");
} }
} }

@ -1180,7 +1180,8 @@ namespace Myshipping.Application
//进入客户订舱系统的订舱台账 //进入客户订舱系统的订舱台账
if (recModel.Accept) if (recModel.Accept)
{ {
bookingId = await CustomerToOrder(model); var ord = await CustomerToOrder(model);
bookingId = ord.Id;
model.BookingId = bookingId; //客户订舱数据与订舱台账数据关联 model.BookingId = bookingId; //客户订舱数据与订舱台账数据关联
await _rep.UpdateAsync(model); await _rep.UpdateAsync(model);
@ -1360,6 +1361,7 @@ namespace Myshipping.Application
{ {
"BC" => BookingOrderSyncTypeEnum.BC, "BC" => BookingOrderSyncTypeEnum.BC,
"CC" => BookingOrderSyncTypeEnum.CC, "CC" => BookingOrderSyncTypeEnum.CC,
"REJECT" => BookingOrderSyncTypeEnum.REJECT,
//"FILE" => BookingOrderSyncTypeEnum.FILE, //"FILE" => BookingOrderSyncTypeEnum.FILE,
_ => null, _ => null,
}; };
@ -1673,10 +1675,13 @@ namespace Myshipping.Application
_logger.LogInformation($"根据客户订舱 {recModel.Id} 生成了相同的数据 {model.Id}"); _logger.LogInformation($"根据客户订舱 {recModel.Id} 生成了相同的数据 {model.Id}");
//插入订舱台账 //插入订舱台账
var ordId = await CustomerToOrder(model); var ord = await CustomerToOrder(model);
respDtO.OrderId = ordId; model.BookingId = ord.Id;
await _rep.AsUpdateable(model).UpdateColumns(x => new { x.BookingId }).ExecuteCommandAsync();
_logger.LogInformation($"生成了订舱台账数据 {ordId}"); respDtO.OrderId = ord.Id;
_logger.LogInformation($"生成了订舱台账数据 {ord.Id}");
} }
@ -1693,7 +1698,7 @@ namespace Myshipping.Application
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
[NonAction] [NonAction]
public async Task<long> CustomerToOrder(BookingCustomerOrder custOrd) public async Task<BookingOrder> CustomerToOrder(BookingCustomerOrder custOrd)
{ {
var bkOrder = custOrd.Adapt<BookingOrder>(); var bkOrder = custOrd.Adapt<BookingOrder>();
bkOrder.Id = YitIdHelper.NextId(); bkOrder.Id = YitIdHelper.NextId();
@ -1738,7 +1743,7 @@ namespace Myshipping.Application
await _repFile.InsertAsync(file); await _repFile.InsertAsync(file);
} }
return bkOrder.Id; return bkOrder;
} }
/// <summary> /// <summary>

@ -534,6 +534,7 @@ namespace Myshipping.Application
/// <summary> /// <summary>
/// 通知人联系人姓 /// 通知人联系人姓
/// </summary> /// </summary>
public string NotifypartLastName { get; set; }
/// <summary> /// <summary>
/// 通知人电话国家代码 /// 通知人电话国家代码

@ -10350,7 +10350,7 @@ namespace Myshipping.Application
} }
} }
var ctn = await _repCtn.AsQueryable().Filter(null, true).Where(x => x.BILLID == item.Id && x.IsDeleted == false).ToListAsync(); var ctn = await _repCtn.AsQueryable().Filter(null, true).Where(x => x.BILLID == item.Id && x.IsDeleted == false).ToListAsync();
dto.ctnInputs = ctn.Adapt<List<BookingCtnDto>>(); dto.ctnInputs = ctn.Adapt<List<BookingCtnDto>>();
foreach (var it in dto.ctnInputs) foreach (var it in dto.ctnInputs)
@ -10368,7 +10368,7 @@ namespace Myshipping.Application
if (item.SPLIT_OR_MERGE_FLAG.Value == 2) if (item.SPLIT_OR_MERGE_FLAG.Value == 2)
{ {
//如果当前是主票 //如果当前是主票
if(dto.CUSTNO.Equals(dto.HBLNO,StringComparison.OrdinalIgnoreCase)) if (dto.CUSTNO.Equals(dto.HBLNO, StringComparison.OrdinalIgnoreCase))
{ {
var allOrderList = await _rep.AsQueryable().Filter(null, true).Where(x => dto.HBLNO == x.HBLNO && (x.SPLIT_OR_MERGE_FLAG != null && x.SPLIT_OR_MERGE_FLAG == 2) var allOrderList = await _rep.AsQueryable().Filter(null, true).Where(x => dto.HBLNO == x.HBLNO && (x.SPLIT_OR_MERGE_FLAG != null && x.SPLIT_OR_MERGE_FLAG == 2)
&& x.TenantId == UserManager.TENANT_ID && x.IsDeleted == false).ToListAsync(); && x.TenantId == UserManager.TENANT_ID && x.IsDeleted == false).ToListAsync();
@ -10376,7 +10376,7 @@ namespace Myshipping.Application
if (allOrderList.Count > 0) if (allOrderList.Count > 0)
{ {
var allOrderIds = allOrderList.Select(x => x.Id).ToList(); var allOrderIds = allOrderList.Select(x => x.Id).ToList();
var currCtn = await _repCtn.AsQueryable().Filter(null, true).Where(x => x.BILLID != null && allOrderIds.Contains(x.BILLID.Value) var currCtn = await _repCtn.AsQueryable().Filter(null, true).Where(x => x.BILLID != null && allOrderIds.Contains(x.BILLID.Value)
&& x.IsDeleted == false).ToListAsync(); && x.IsDeleted == false).ToListAsync();
dto.ctnInputs = currCtn.Adapt<List<BookingCtnDto>>(); dto.ctnInputs = currCtn.Adapt<List<BookingCtnDto>>();
@ -12892,6 +12892,39 @@ namespace Myshipping.Application
/// 接收BC信息更新订舱 /// 接收BC信息更新订舱
/// </summary> /// </summary>
[AllowAnonymous] [AllowAnonymous]
[HttpPost("/BookingOrder/ReceiveBookingReject")]
[ApiUser(ApiCode = "ReceiveBookingReject")]
public async Task<ReceiveBcInfoResultDto> ReceiveBookingReject(ReceiveBookingRejectInputDto input)
{
// 客户订舱:运营端发送订舱数据给客户端
if (App.Configuration["RunType"] == CommonConst.RUN_TYPE_DJY)
{
return new ReceiveBcInfoResultDto(false, "非运营端,接收失败");
}
if (string.IsNullOrWhiteSpace(input.CUSTNO))
{
return new ReceiveBcInfoResultDto(false, "CUSTNO不能为空");
}
var list = await _rep.AsQueryable().Filter(null, true).Where(x => x.CUSTNO == input.CUSTNO)
.ToListAsync();
if (list.Count == 0)
{
string msg = $"通过CUSTNO查询订舱用于推送拒绝请求时未查询到数据CUSTNO【{input.CUSTNO}】,结束";
_logger.LogInformation(msg);
return new ReceiveBcInfoResultDto(false, msg);
}
_logger.LogInformation($"通过CUSTNO查询订舱用于推送拒绝请求时查询到{list.Count}条数据CUSTNO【{input.CUSTNO}】,开始推送客户端");
foreach (var item in list)
{
CustomerBookingSyncHelper.SendCustomerBookingSync(item.Id, BookingOrderSyncTypeEnum.REJECT.ToString());
}
return new ReceiveBcInfoResultDto(true, $"接收成功,共匹配到{list.Count}条订舱记录");
}
/// <summary>
/// 接收BC信息更新订舱
/// </summary>
[AllowAnonymous]
[HttpPost("/BookingOrder/ReceiveBcInfo")] [HttpPost("/BookingOrder/ReceiveBcInfo")]
[ApiUser(ApiCode = "ReceiveBcInfo")] [ApiUser(ApiCode = "ReceiveBcInfo")]
public async Task<ReceiveBcInfoResultDto> ReceiveBcInfo(ReceiveBcInfoDto input) public async Task<ReceiveBcInfoResultDto> ReceiveBcInfo(ReceiveBcInfoDto input)

@ -0,0 +1,7 @@
namespace Myshipping.Application.Service.BookingOrder.Dto
{
public class ReceiveBookingRejectInputDto
{
public string CUSTNO { get; set; }
}
}

@ -6,13 +6,17 @@
public enum BookingOrderSyncTypeEnum public enum BookingOrderSyncTypeEnum
{ {
/// <summary> /// <summary>
/// 只同步BC+文件相关字段 /// 只用于同步BC及文件相关字段
/// </summary> /// </summary>
BC = 1, BC = 1,
/// <summary> /// <summary>
/// 只同步CC号 /// 只用于同步CC号
/// </summary> /// </summary>
CC = 2, CC = 2,
/// <summary>
/// 只用于推送订舱拒绝消息
/// </summary>
REJECT = 3,
///// <summary> ///// <summary>
///// 只同步文件相关字段 ///// 只同步文件相关字段
///// </summary> ///// </summary>

Loading…
Cancel
Save