jianghaiqing 5 months ago
commit 975f171678

@ -1705,6 +1705,7 @@ namespace Myshipping.Application
[NonAction] [NonAction]
public async Task<BookingOrder> CustomerToOrder(BookingCustomerOrder custOrd) public async Task<BookingOrder> CustomerToOrder(BookingCustomerOrder custOrd)
{ {
_logger.LogInformation($"准备根据客户订舱数据生成订舱台账:{custOrd.BOOKINGNO}");
var bkOrder = custOrd.Adapt<BookingOrder>(); var bkOrder = custOrd.Adapt<BookingOrder>();
bkOrder.Id = YitIdHelper.NextId(); bkOrder.Id = YitIdHelper.NextId();
bkOrder.BSSTATUS = "已录入"; bkOrder.BSSTATUS = "已录入";
@ -2364,59 +2365,21 @@ namespace Myshipping.Application
//日志动态 //日志动态
SaveAuditLog($"{(accept ? "" : "")}", id, remark: $"审核意见:{comment}"); SaveAuditLog($"{(accept ? "" : "")}", id, remark: $"审核意见:{comment}");
//进入订舱台账 //进入订舱台账
if (accept) if (accept)
{ {
var custBookId = jobjRtn.GetStringValue("data"); //返回的客户订舱系统的订舱数据id var custBookId = jobjRtn.GetStringValue("data"); //返回的客户订舱系统的订舱数据id
var bkOrder = model.Adapt<BookingOrder>(); _logger.LogInformation($"收到客户端返回的订舱台账id{custBookId}");
bkOrder.Id = YitIdHelper.NextId();
bkOrder.BSNO = custBookId;
bkOrder.BSSTATUS = "已录入";
bkOrder.CUSTOMERNAME = model.BookingTenantName;
bkOrder.ParentId = 0;
bkOrder.LANENAME = bkOrder.LANECODE;
bkOrder.OPID = UserManager.UserId.ToString();
bkOrder.OP = UserManager.Name;
await _repOrder.InsertAsync(bkOrder);
_logger.LogInformation($"审核通过进入订舱台账客户订舱ID{model.Id}订舱台账ID{bkOrder.Id},系统编号:{model.BOOKINGNO}"); var bkOrder = await CustomerToOrder(model);
bkOrder.BSNO = custBookId;
var bkEdiExt = new BookingEDIExt(); await _repOrder.AsUpdateable(bkOrder).UpdateColumns(x => new { x.BSNO }).ExecuteCommandAsync();
bkEdiExt.Id = YitIdHelper.NextId();
bkEdiExt.BookingId = bkOrder.Id;
bkEdiExt.SalerCode = model.SaleCode;
await _repEdiExt.InsertAsync(bkEdiExt);
model.BookingId = bkOrder.Id; //客户订舱数据与订舱台账数据关联 model.BookingId = bkOrder.Id; //客户订舱数据与订舱台账数据关联
await _rep.UpdateAsync(model); await _rep.UpdateAsync(model);
var ctnList = await _repCtn.AsQueryable().Filter(null, true).Where(x => x.BILLID == model.Id).ToListAsync(); _logger.LogInformation($"审核通过进入订舱台账客户订舱ID{model.Id}订舱台账ID{bkOrder.Id},系统编号:{model.BOOKINGNO}");
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 == model.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 == model.Id && x.IsDeleted == false).ToListAsync();
foreach (var file in files)
{
file.Id = YitIdHelper.NextId();
file.BookingId = bkOrder.Id;
await _repFile.InsertAsync(file);
}
//订舱编号回写 //订舱编号回写
JObject extObj = null; JObject extObj = null;

Loading…
Cancel
Save