jianghaiqing 5 months ago
commit 0351c9c86b

@ -518,11 +518,14 @@ namespace Myshipping.Application.Event
_logger.LogInformation($"根据客户订舱反馈数据 {custOrder.BSNO} 生成了相同的数据 {custOrder.Id}");
//插入订舱台账
var ordId = await servCustOrder.CustomerToOrder(custOrder);
custOrder.BookingId = ordId;
var ord = await servCustOrder.CustomerToOrder(custOrder);
custOrder.BookingId = ord.Id;
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)
{
bookingId = await CustomerToOrder(model);
var ord = await CustomerToOrder(model);
bookingId = ord.Id;
model.BookingId = bookingId; //客户订舱数据与订舱台账数据关联
await _rep.UpdateAsync(model);
@ -1360,6 +1361,7 @@ namespace Myshipping.Application
{
"BC" => BookingOrderSyncTypeEnum.BC,
"CC" => BookingOrderSyncTypeEnum.CC,
"REJECT" => BookingOrderSyncTypeEnum.REJECT,
//"FILE" => BookingOrderSyncTypeEnum.FILE,
_ => null,
};
@ -1673,10 +1675,13 @@ namespace Myshipping.Application
_logger.LogInformation($"根据客户订舱 {recModel.Id} 生成了相同的数据 {model.Id}");
//插入订舱台账
var ordId = await CustomerToOrder(model);
respDtO.OrderId = ordId;
var ord = await CustomerToOrder(model);
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>
/// <returns></returns>
[NonAction]
public async Task<long> CustomerToOrder(BookingCustomerOrder custOrd)
public async Task<BookingOrder> CustomerToOrder(BookingCustomerOrder custOrd)
{
var bkOrder = custOrd.Adapt<BookingOrder>();
bkOrder.Id = YitIdHelper.NextId();
@ -1738,7 +1743,7 @@ namespace Myshipping.Application
await _repFile.InsertAsync(file);
}
return bkOrder.Id;
return bkOrder;
}
/// <summary>

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

@ -10368,7 +10368,7 @@ namespace Myshipping.Application
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)
&& x.TenantId == UserManager.TENANT_ID && x.IsDeleted == false).ToListAsync();
@ -12892,6 +12892,39 @@ namespace Myshipping.Application
/// 接收BC信息更新订舱
/// </summary>
[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")]
[ApiUser(ApiCode = "ReceiveBcInfo")]
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
{
/// <summary>
/// 只同步BC+文件相关字段
/// 只用于同步BC及文件相关字段
/// </summary>
BC = 1,
/// <summary>
/// 只同步CC号
/// 只用于同步CC号
/// </summary>
CC = 2,
/// <summary>
/// 只用于推送订舱拒绝消息
/// </summary>
REJECT = 3,
///// <summary>
///// 只同步文件相关字段
///// </summary>

Loading…
Cancel
Save