|
|
|
@ -130,8 +130,12 @@ namespace Myshipping.Application
|
|
|
|
|
private readonly SqlSugarRepository<BookingLineOpMgrConfig> _repLineOpMgrConfig;
|
|
|
|
|
private readonly SqlSugarRepository<SysEmp> _repSysEmp;
|
|
|
|
|
private readonly SqlSugarRepository<Booking_AutoYardImport> _repAutoYard;
|
|
|
|
|
|
|
|
|
|
private readonly SqlSugarRepository<BookingExtendState> _repextendstate;
|
|
|
|
|
|
|
|
|
|
private readonly IServiceWorkFlowManageService _serviceWorkFlowManageService;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const string CONST_MAPPING_MODULE = "BOOK_OR_CLOSING";
|
|
|
|
|
const string CONST_MAPPING_MODULE_ROUTE = "BOOK_OR_CLOSING_RT";
|
|
|
|
|
private const string PrintRecentListTypeKey = "booking_print_recent_list";
|
|
|
|
@ -145,7 +149,7 @@ namespace Myshipping.Application
|
|
|
|
|
SqlSugarRepository<BookingLog> bookinglog, SqlSugarRepository<BookingLogDetail> bookinglogdetail, SqlSugarRepository<BookingRemark> bookingremark,
|
|
|
|
|
SqlSugarRepository<BookingFile> bookingfile, SqlSugarRepository<DjyUserConfig> repUserConfig, SqlSugarRepository<BookingPrintTemplate> repPrint,
|
|
|
|
|
SqlSugarRepository<SysDictData> dicdata, SqlSugarRepository<BookingStatusLog> statuslog, SqlSugarRepository<BookingStatusLogDetail> statuslogdetail,
|
|
|
|
|
SqlSugarRepository<BookingTemplateShare> repPrintTemplateShare, SqlSugarRepository<DjyVesselInfo> vesselInfo,
|
|
|
|
|
SqlSugarRepository<BookingTemplateShare> repPrintTemplateShare, SqlSugarRepository<DjyVesselInfo> vesselInfo, SqlSugarRepository<BookingExtendState> repextendstate,
|
|
|
|
|
ILogger<BookingOrderService> logger, ISysCacheService cache, IDjyWebsiteAccountConfigService webAccountConfig, ISysDataUserMenu right, SqlSugarRepository<ParaGoodsInfo> paraGoodsInfoRepository,
|
|
|
|
|
SqlSugarRepository<BookingPrintTemplate> repPrintTemplate, SqlSugarRepository<BookingLetteryard> repLetterYard, SqlSugarRepository<SysUser> repUser, SqlSugarRepository<BookingTemplate> bookingTemplate,
|
|
|
|
|
SqlSugarRepository<BookingOrderUrl> repOrderUrl, SqlSugarRepository<BookingOrderContact> repOrderContact, SqlSugarRepository<BookingSampleBill> repSampleBill, SqlSugarRepository<DjyCustomer> djycustomer,
|
|
|
|
@ -193,13 +197,11 @@ namespace Myshipping.Application
|
|
|
|
|
this._repPrintTemplateShare = repPrintTemplateShare;
|
|
|
|
|
_httpContextAccessor = httpContextAccessor;
|
|
|
|
|
_GoodsConfig = GoodsConfig;
|
|
|
|
|
|
|
|
|
|
_djyWebsiteAccountConfigRepository = djyWebsiteAccountConfigRepository;
|
|
|
|
|
|
|
|
|
|
this._repLineOpMgrConfig = repLineOpMgrConfig;
|
|
|
|
|
this._repSysEmp = repSysEmp;
|
|
|
|
|
this._repAutoYard = repAutoYard;
|
|
|
|
|
|
|
|
|
|
this._repextendstate = repextendstate;
|
|
|
|
|
_serviceWorkFlowManageService = serviceWorkFlowManageService;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -985,7 +987,7 @@ namespace Myshipping.Application
|
|
|
|
|
{
|
|
|
|
|
if (App.Configuration["ServiceStatusOpenAuto"] == "1")
|
|
|
|
|
{
|
|
|
|
|
await SetGoodsStatusCancel("YDC",Id);
|
|
|
|
|
await SetGoodsStatusCancel("YDC", Id);
|
|
|
|
|
|
|
|
|
|
await SetBookingOrderGoodsStatus(Id);
|
|
|
|
|
}
|
|
|
|
@ -1362,11 +1364,15 @@ namespace Myshipping.Application
|
|
|
|
|
{
|
|
|
|
|
long Id = Convert.ToInt64(ar);
|
|
|
|
|
var order = _rep.AsQueryable().Filter(null, true).Where(x => x.Id == Id).First();
|
|
|
|
|
var et = await _rep.AsQueryable().Filter(null, true).WhereIF(!string.IsNullOrWhiteSpace(order.MBLNO),x => x.MBLNO == order.MBLNO).Where(x => x.IsDeleted == false && x.TenantId == UserManager.TENANT_ID && x.ParentId == 0 && x.Id != Id).FirstAsync();
|
|
|
|
|
if (et != null)
|
|
|
|
|
if (!string.IsNullOrEmpty(order.MBLNO))
|
|
|
|
|
{
|
|
|
|
|
throw Oops.Bah("当前主提单号已存在,无法恢复!");
|
|
|
|
|
var et = await _rep.AsQueryable().Filter(null, true).Where(x => x.MBLNO == order.MBLNO && x.IsDeleted == false && x.TenantId == UserManager.TENANT_ID && x.ParentId == 0 && x.Id != Id).FirstAsync();
|
|
|
|
|
if (et != null)
|
|
|
|
|
{
|
|
|
|
|
throw Oops.Bah("当前主提单号已存在,无法恢复!");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var ctnlist = await _repCtn.AsQueryable().Where(x => x.BILLID == Id).Select(x => x.Id).ToListAsync();
|
|
|
|
|
await _repCtn.UpdateAsync(x => x.BILLID == Id, x => new BookingCtn { IsDeleted = false });
|
|
|
|
|
await _ctndetailrep.UpdateAsync(x => ctnlist.Contains((long)x.CTNID), x => new BookingCtnDetail { IsDeleted = false });
|
|
|
|
@ -8819,6 +8825,9 @@ HLCUTA12307DPXJ3 以这票为例 6个柜
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#region 同步东胜
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// /批量提单号同步东胜
|
|
|
|
|
/// </summary>
|
|
|
|
@ -8857,6 +8866,7 @@ HLCUTA12307DPXJ3 以这票为例 6个柜
|
|
|
|
|
|
|
|
|
|
await SendBookingOrder(orderlist.ToArray());
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 推送服务状态
|
|
|
|
|
/// <summary>
|
|
|
|
@ -9044,6 +9054,102 @@ HLCUTA12307DPXJ3 以这票为例 6个柜
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 提箱小票CMA
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 提箱小票CMA
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="Id"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[HttpPost("/BookingOrder/SaveBookingTxxp")]
|
|
|
|
|
public async Task<dynamic> SaveBookingTxxp(long Id)
|
|
|
|
|
{
|
|
|
|
|
//获取url
|
|
|
|
|
var url = _cache.GetAllDictData().Result.Where(x => x.TypeCode == "bookingTxxpUrl").Select(x => x.Value).FirstOrDefault();
|
|
|
|
|
//亿通账号
|
|
|
|
|
var ytAcc = _webAccountConfig.GetAccountConfig("CmaWeb", UserManager.UserId).Result;
|
|
|
|
|
if (ytAcc == null)
|
|
|
|
|
{
|
|
|
|
|
throw Oops.Bah(BookingErrorCode.BOOK119);
|
|
|
|
|
}
|
|
|
|
|
var order = _rep.FirstOrDefault(x => x.Id == Id);
|
|
|
|
|
//条件判断 目前只支持CMA 的数据
|
|
|
|
|
if (order.CARRIERID != "CMA")
|
|
|
|
|
{
|
|
|
|
|
throw Oops.Bah("船公司目前只支持CMA");
|
|
|
|
|
}
|
|
|
|
|
if (string.IsNullOrEmpty(order.VESSEL))
|
|
|
|
|
{
|
|
|
|
|
throw Oops.Bah("船名不能为空");
|
|
|
|
|
}
|
|
|
|
|
if (string.IsNullOrEmpty(order.MBLNO))
|
|
|
|
|
{
|
|
|
|
|
throw Oops.Bah("船名不能为空");
|
|
|
|
|
}
|
|
|
|
|
var json = new
|
|
|
|
|
{
|
|
|
|
|
custname = "DJY",
|
|
|
|
|
custpsw = "123",
|
|
|
|
|
username = ytAcc.Account,
|
|
|
|
|
password = ytAcc.Password,
|
|
|
|
|
company = "CMA",
|
|
|
|
|
vessel = order.VESSEL
|
|
|
|
|
}.ToJsonString();
|
|
|
|
|
BookingExtendState extends = new BookingExtendState();
|
|
|
|
|
var rtn = await url.SetBody(json).PostAsStringAsync();
|
|
|
|
|
JObject jobjRtn = JObject.Parse(rtn);
|
|
|
|
|
var status = jobjRtn.GetValue("status").ToString();
|
|
|
|
|
if (status != "1")
|
|
|
|
|
{
|
|
|
|
|
//不等于1 返回结果错误
|
|
|
|
|
throw Oops.Bah(jobjRtn.GetValue("message").ToString());
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
var jarrData = jobjRtn.GetValue("message") as JArray;
|
|
|
|
|
foreach (JObject item in jarrData)
|
|
|
|
|
{
|
|
|
|
|
//订舱号(单号)
|
|
|
|
|
var mb = item.GetStringValue("bookingno"); //提单号
|
|
|
|
|
if (mb == order.MBLNO)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
var noApply = item.GetIntValue("noApply"); //未申请
|
|
|
|
|
var applyNoPrint = item.GetIntValue("applyNoPrint"); //已申请未打印
|
|
|
|
|
var print = item.GetIntValue("print"); //已打印
|
|
|
|
|
extends = _repextendstate.FirstOrDefault(x => x.bookingId == Id);
|
|
|
|
|
if (extends == null)
|
|
|
|
|
{
|
|
|
|
|
extends.bookingId = Id;
|
|
|
|
|
extends.noApply = noApply;
|
|
|
|
|
extends.applyNoPrint = applyNoPrint;
|
|
|
|
|
extends.print = print;
|
|
|
|
|
await _repextendstate.InsertAsync(extends);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
extends.noApply = noApply;
|
|
|
|
|
extends.applyNoPrint = applyNoPrint;
|
|
|
|
|
extends.print = print;
|
|
|
|
|
await _repextendstate.AsUpdateable(extends).IgnoreColumns().ExecuteCommandAsync();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return extends;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|