|
|
|
@ -1673,21 +1673,39 @@ namespace Myshipping.Application
|
|
|
|
|
if (rtnList.Count(x => x.Success == false) == 0)
|
|
|
|
|
{
|
|
|
|
|
var tCustId = list.First().BookingTenantId;
|
|
|
|
|
_logger.LogInformation($"提交成功,准备自动订舱和审核");
|
|
|
|
|
|
|
|
|
|
//自动订舱和自动审核
|
|
|
|
|
var cust = await _repCustomer.AsQueryable().FirstAsync(x => x.CustSysId == tCustId);
|
|
|
|
|
var cust = await _repCustomer.AsQueryable().Filter(null, true).FirstAsync(x => x.CustSysId == tCustId);
|
|
|
|
|
if (cust != null)
|
|
|
|
|
{
|
|
|
|
|
_logger.LogInformation($"找到客户端租户对应客户:{cust.FullName}");
|
|
|
|
|
|
|
|
|
|
var paraCallApiAuditAuto = await _repCustomerParamValue.AsQueryable().FirstAsync(x => x.CustomerId == cust.Id && x.ParaCode == "BookingCallApiAndAuditAuto");
|
|
|
|
|
if (paraCallApiAuditAuto != null && paraCallApiAuditAuto.ItemCode == "YES")
|
|
|
|
|
{
|
|
|
|
|
foreach (var ordId in ordIdList)
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
_logger.LogInformation($"自动订舱:{ordId}");
|
|
|
|
|
await PostApiSO(ordId);
|
|
|
|
|
_logger.LogInformation($"自动审核:{ordId}");
|
|
|
|
|
await AuditBooking(ordId, true, "系统自动审核");
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
_logger.LogWarning($"自动订舱失败:{ordId},错误信息:{ex.Message}");
|
|
|
|
|
await AuditBooking(ordId, false, ex.Message, notFeedback: true);
|
|
|
|
|
throw ex;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
_logger.LogWarning($"未找到客户,CustSysId:{tCustId}");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return rtnList;
|
|
|
|
@ -1698,9 +1716,9 @@ namespace Myshipping.Application
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[HttpPost("/BookingCustomerOrder/AuditBooking")]
|
|
|
|
|
public async Task AuditBooking(long id, bool accept, string comment)
|
|
|
|
|
public async Task AuditBooking(long id, bool accept, string comment, bool notFeedback = false)
|
|
|
|
|
{
|
|
|
|
|
var model = _rep.FirstOrDefault(x => x.Id == id);
|
|
|
|
|
var model = await _rep.AsQueryable().Filter(null, true).FirstAsync(x => x.Id == id);
|
|
|
|
|
if (model == null)
|
|
|
|
|
{
|
|
|
|
|
throw Oops.Bah("未找到业务信息");
|
|
|
|
@ -1720,6 +1738,9 @@ namespace Myshipping.Application
|
|
|
|
|
model.BSSTATUS = "已驳回";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
JObject jobjRtn = null;
|
|
|
|
|
if (!notFeedback)
|
|
|
|
|
{
|
|
|
|
|
//回推回执
|
|
|
|
|
var feedbackData = new BookingCustomerRecAduitFeedbackDto()
|
|
|
|
|
{
|
|
|
|
@ -1743,11 +1764,12 @@ namespace Myshipping.Application
|
|
|
|
|
|
|
|
|
|
_logger.LogInformation($"回推审核返回:{rtn}");
|
|
|
|
|
|
|
|
|
|
var jobjRtn = JObject.Parse(rtn);
|
|
|
|
|
jobjRtn = JObject.Parse(rtn);
|
|
|
|
|
if (jobjRtn.GetIntValue("code") != 200)
|
|
|
|
|
{
|
|
|
|
|
throw Oops.Bah(jobjRtn.GetStringValue("message"));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await _rep.UpdateAsync(model); //回推成功后,存库
|
|
|
|
@ -1757,7 +1779,7 @@ namespace Myshipping.Application
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//进入订舱台账
|
|
|
|
|
if (accept)
|
|
|
|
|
if (accept && jobjRtn != null)
|
|
|
|
|
{
|
|
|
|
|
var custBookId = jobjRtn.GetStringValue("data"); //返回的客户订舱系统的订舱数据id
|
|
|
|
|
var bkOrder = model.Adapt<BookingOrder>();
|
|
|
|
|