|
|
|
@ -65,6 +65,7 @@ namespace Myshipping.Application
|
|
|
|
|
public async Task<SqlSugarPagedList<BookingCustomerOrderListOutput>> PageData(BookingCustomerOrderQueryInput input)
|
|
|
|
|
{
|
|
|
|
|
var query = _rep.AsQueryable().Filter(null, true).Where(x => x.TenantId == UserManager.TENANT_ID)
|
|
|
|
|
.Where(x => !x.IsDeleted)
|
|
|
|
|
.WhereIF(!string.IsNullOrEmpty(input.BOOKINGNO), x => x.BOOKINGNO.Contains(input.BOOKINGNO))
|
|
|
|
|
.WhereIF(!string.IsNullOrEmpty(input.VESSEL), x => x.VESSEL.Contains(input.VESSEL))
|
|
|
|
|
.WhereIF(!string.IsNullOrEmpty(input.VOYNO), x => x.VOYNO.Contains(input.VOYNO))
|
|
|
|
@ -357,19 +358,25 @@ namespace Myshipping.Application
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 删除
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="id"></param>
|
|
|
|
|
/// <param name="ids"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[HttpPost("/BookingCustomerOrder/Delete")]
|
|
|
|
|
public async Task Delete(long id)
|
|
|
|
|
public async Task Delete(List<long> ids)
|
|
|
|
|
{
|
|
|
|
|
var entity = await _rep.AsQueryable().Filter(null, true).FirstAsync(x => x.Id == id);
|
|
|
|
|
if (entity.BSSTATUS != "已录入" && entity.BSSTATUS != "已驳回")
|
|
|
|
|
var list = await _rep.AsQueryable().Filter(null, true).Where(x => ids.Contains(x.Id)).ToListAsync();
|
|
|
|
|
|
|
|
|
|
var canNotDelList = list.Where(x => x.BSSTATUS != "已录入" && x.BSSTATUS != "已驳回");
|
|
|
|
|
if (canNotDelList.Any())
|
|
|
|
|
{
|
|
|
|
|
throw Oops.Bah("当前状态不能删除");
|
|
|
|
|
var errMsg = string.Join("\r\n", canNotDelList.Select(x => $"{x.BOOKINGNO}的数据当前状态不能删除").ToList());
|
|
|
|
|
throw Oops.Bah(errMsg);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
entity.IsDeleted = true;
|
|
|
|
|
await _rep.UpdateAsync(entity);
|
|
|
|
|
list.ForEach(x =>
|
|
|
|
|
{
|
|
|
|
|
x.IsDeleted = true;
|
|
|
|
|
_rep.Update(x);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
@ -389,9 +396,9 @@ namespace Myshipping.Application
|
|
|
|
|
throw Oops.Bah("大简云接收订舱URL地址未配置,请联系管理员");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var userId = _cache.GetAllTenantParam().Result.FirstOrDefault(x => x.TenantId == UserManager.TENANT_ID && x.ParaCode == "DjyBookingReceiveUserId");
|
|
|
|
|
var userSecret = _cache.GetAllTenantParam().Result.FirstOrDefault(x => x.TenantId == UserManager.TENANT_ID && x.ParaCode == "DjyBookingReceiveUserSecret");
|
|
|
|
|
if (userId == null || string.IsNullOrEmpty(userId.ItemCode) || userSecret == null || string.IsNullOrEmpty(userSecret.ItemCode))
|
|
|
|
|
var userId = _cache.GetAllSysConfig().Result.FirstOrDefault(x => x.Code == "DjyBookingReceiveUserId");
|
|
|
|
|
var userSecret = _cache.GetAllSysConfig().Result.FirstOrDefault(x => x.Code == "DjyBookingReceiveUserSecret");
|
|
|
|
|
if (userId == null || string.IsNullOrEmpty(userId.Value) || userSecret == null || string.IsNullOrEmpty(userSecret.Value))
|
|
|
|
|
{
|
|
|
|
|
throw Oops.Bah("大简云接收订舱用户key和秘钥未配置,请联系管理员");
|
|
|
|
|
}
|
|
|
|
@ -450,12 +457,12 @@ namespace Myshipping.Application
|
|
|
|
|
|
|
|
|
|
submitUrl += "BookingCustomerOrder/ReceiveBooking";
|
|
|
|
|
|
|
|
|
|
_logger.LogInformation($"提交订舱数据({submitUrl},{userId.ItemCode},{userSecret.ItemCode}):{JsonConvert.SerializeObject(sendList)}");
|
|
|
|
|
_logger.LogInformation($"提交订舱数据({submitUrl},{userId.Value},{userSecret.Value}):{JsonConvert.SerializeObject(sendList)}");
|
|
|
|
|
|
|
|
|
|
var rtn = await submitUrl
|
|
|
|
|
.SetHeaders(new Dictionary<string, object> {
|
|
|
|
|
{ CommonConst.API_USER_HEADER_KEY, userId.ItemCode},
|
|
|
|
|
{ CommonConst.API_USER_HEADER_SECRET, userSecret.ItemCode}
|
|
|
|
|
{ CommonConst.API_USER_HEADER_KEY, userId.Value},
|
|
|
|
|
{ CommonConst.API_USER_HEADER_SECRET, userSecret.Value}
|
|
|
|
|
})
|
|
|
|
|
.SetBody(sendList)
|
|
|
|
|
.PostAsStringAsync();
|
|
|
|
@ -526,9 +533,9 @@ namespace Myshipping.Application
|
|
|
|
|
throw Oops.Bah("大简云接收订舱URL地址未配置,请联系管理员");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var userId = _cache.GetAllTenantParam().Result.FirstOrDefault(x => x.TenantId == UserManager.TENANT_ID && x.ParaCode == "DjyBookingReceiveUserId");
|
|
|
|
|
var userSecret = _cache.GetAllTenantParam().Result.FirstOrDefault(x => x.TenantId == UserManager.TENANT_ID && x.ParaCode == "DjyBookingReceiveUserSecret");
|
|
|
|
|
if (userId == null || string.IsNullOrEmpty(userId.ItemCode) || userSecret == null || string.IsNullOrEmpty(userSecret.ItemCode))
|
|
|
|
|
var userId = _cache.GetAllSysConfig().Result.FirstOrDefault(x => x.Code == "DjyBookingReceiveUserId");
|
|
|
|
|
var userSecret = _cache.GetAllSysConfig().Result.FirstOrDefault(x => x.Code == "DjyBookingReceiveUserSecret");
|
|
|
|
|
if (userId == null || string.IsNullOrEmpty(userId.Value) || userSecret == null || string.IsNullOrEmpty(userSecret.Value))
|
|
|
|
|
{
|
|
|
|
|
throw Oops.Bah("大简云接收订舱用户key和秘钥未配置,请联系管理员");
|
|
|
|
|
}
|
|
|
|
@ -555,12 +562,12 @@ namespace Myshipping.Application
|
|
|
|
|
|
|
|
|
|
submitUrl += "BookingCustomerOrder/CancelBooking";
|
|
|
|
|
|
|
|
|
|
_logger.LogInformation($"取消提交订舱数据({submitUrl},{userId.ItemCode},{userSecret.ItemCode}):{JsonConvert.SerializeObject(sendList)}");
|
|
|
|
|
_logger.LogInformation($"取消提交订舱数据({submitUrl},{userId.Value},{userSecret.Value}):{JsonConvert.SerializeObject(sendList)}");
|
|
|
|
|
|
|
|
|
|
var rtn = await submitUrl
|
|
|
|
|
.SetHeaders(new Dictionary<string, object> {
|
|
|
|
|
{ CommonConst.API_USER_HEADER_KEY, userId.ItemCode},
|
|
|
|
|
{ CommonConst.API_USER_HEADER_SECRET, userSecret.ItemCode}
|
|
|
|
|
{ CommonConst.API_USER_HEADER_KEY, userId.Value},
|
|
|
|
|
{ CommonConst.API_USER_HEADER_SECRET, userSecret.Value}
|
|
|
|
|
})
|
|
|
|
|
.SetBody(sendList)
|
|
|
|
|
.PostAsStringAsync();
|
|
|
|
@ -856,19 +863,19 @@ namespace Myshipping.Application
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//回推回执
|
|
|
|
|
var recFeedbackConfig = _cache.GetAllSysConfig().Result.FirstOrDefault(x => x.Code == "DjyBookingCustomerRecAuditFeedbackURL");
|
|
|
|
|
var recFeedbackConfig = _cache.GetAllSysConfig().Result.FirstOrDefault(x => x.Code == "DjyBookingCustomerRecFeedbackURL");
|
|
|
|
|
if (recFeedbackConfig == null || string.IsNullOrEmpty(recFeedbackConfig.Value))
|
|
|
|
|
{
|
|
|
|
|
throw Oops.Bah("回推订舱审核结果的URL地址未配置,请联系管理员");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var recFeedbackUserKey = _cache.GetAllSysConfig().Result.FirstOrDefault(x => x.Code == "DjyBookingCustomerRecAuditFeedbackUserKey");
|
|
|
|
|
var recFeedbackUserKey = _cache.GetAllSysConfig().Result.FirstOrDefault(x => x.Code == "DjyBookingCustomerRecFeedbackUserKey");
|
|
|
|
|
if (recFeedbackUserKey == null || string.IsNullOrEmpty(recFeedbackUserKey.Value))
|
|
|
|
|
{
|
|
|
|
|
throw Oops.Bah("回推订舱审核结果的用户KEY未配置,请联系管理员");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var recFeedbackUserSecret = _cache.GetAllSysConfig().Result.FirstOrDefault(x => x.Code == "DjyBookingCustomerRecAuditFeedbackUserSecret");
|
|
|
|
|
var recFeedbackUserSecret = _cache.GetAllSysConfig().Result.FirstOrDefault(x => x.Code == "DjyBookingCustomerRecFeedbackUserSecret");
|
|
|
|
|
if (recFeedbackUserSecret == null || string.IsNullOrEmpty(recFeedbackUserSecret.Value))
|
|
|
|
|
{
|
|
|
|
|
throw Oops.Bah("回推订舱审核结果的用户秘钥未配置,请联系管理员");
|
|
|
|
@ -881,9 +888,17 @@ namespace Myshipping.Application
|
|
|
|
|
Comment = comment
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
_logger.LogInformation($"回推审核数据:{JsonConvert.SerializeObject(sendObj)}");
|
|
|
|
|
var feedbackUrl = recFeedbackConfig.Value;
|
|
|
|
|
if (!feedbackUrl.EndsWith("/"))
|
|
|
|
|
{
|
|
|
|
|
feedbackUrl += "/";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
feedbackUrl += "BookingCustomerOrder/RecBookingAuditFeedback";
|
|
|
|
|
|
|
|
|
|
_logger.LogInformation($"回推审核数据:{JsonConvert.SerializeObject(sendObj)},URL:{feedbackUrl}");
|
|
|
|
|
|
|
|
|
|
var rtn = await recFeedbackConfig.Value
|
|
|
|
|
var rtn = await feedbackUrl
|
|
|
|
|
.SetHeaders(new Dictionary<string, object> {
|
|
|
|
|
{ CommonConst.API_USER_HEADER_KEY, recFeedbackUserKey.Value},
|
|
|
|
|
{ CommonConst.API_USER_HEADER_SECRET, recFeedbackUserSecret.Value}
|
|
|
|
|