海运出口放舱通知修改

usertest
cjy 3 months ago
parent 012fed5808
commit c228518869

@ -39,10 +39,6 @@ namespace DS.WMS.Core.Op.Dtos
/// </summary>
public string ToAttnMobile { get; set; }
/// <summary>
/// ATTN传真
/// </summary>
public string ToAttnFax { get; set; }
/// <summary>
/// ATTN邮箱
/// </summary>
public string ToAttnEmail { get; set; }
@ -59,67 +55,10 @@ namespace DS.WMS.Core.Op.Dtos
/// </summary>
public string FromMobile { get; set; }
/// <summary>
/// FROM传真
/// </summary>
public string FromFax { get; set; }
/// <summary>
/// FROM邮箱
/// </summary>
public string FromEmail { get; set; }
/// <summary>
/// 主提单号
/// </summary>
public string MBLNO { get; set; }
/// <summary>
/// 分提单号
/// </summary>
public string HBLNO { get; set; }
/// <summary>
/// 委托编号
/// </summary>
public string CustomerNo { get; set; }
/// <summary>
/// 委托单位Id
/// </summary>
public long CustomerId { get; set; }
/// <summary>
/// 委托单位名称
/// </summary>
public string CustomerName { get; set; }
/// <summary>
/// 卸货港Id
/// </summary>
public long? DischargePortId { get; set; }
/// <summary>
/// 卸货港
/// </summary>
public string DischargePort { get; set; }
/// <summary>
/// 船名航次
/// </summary>
public string VesselVoyNo { get; set; }
/// <summary>
/// 开船日期
/// </summary>
public DateTime? ETD { get; set; }
/// <summary>
/// 目的地
/// </summary>
public string Destination { get; set; }
/// <summary>
/// 件重尺
/// </summary>
public string PKC { get; set; }
/// <summary>
/// 货物描述
/// </summary>
public string Description { get; set; }
/// <summary>
/// 提箱场站
/// </summary>
@ -128,11 +67,8 @@ namespace DS.WMS.Core.Op.Dtos
/// <summary>
/// 提箱场站名称
/// </summary>
public string YardName { get; set; }
/// <summary>
/// 地址
/// </summary>
public string YardAddress { get; set; }
public string Yard { get; set; }
/// <summary>
/// 电话
/// </summary>
@ -143,51 +79,6 @@ namespace DS.WMS.Core.Op.Dtos
/// </summary>
public long YardAttn { get; set; }
/// <summary>
/// 入货场站
/// </summary>
public long? ReceiveYardId { get; set; }
/// <summary>
/// 入货场站名称
/// </summary>
public string ReceiveYardName { get; set; }
/// <summary>
/// 入货地址
/// </summary>
public string ReceiveAddress { get; set; }
/// <summary>
/// 入货电话
/// </summary>
public string ReceiveTel { get; set; }
/// <summary>
/// 入货联系人
/// </summary>
public long ReceiveAttn { get; set; }
/// <summary>
/// Desc:单证Id
/// </summary>
public long Doc { get; set; }
/// <summary>
/// Desc:单证人员名称
/// </summary>
public string DocName { get; set; }
/// <summary>
/// 单证电话
/// </summary>
public string DocTel { get; set; }
/// <summary>
/// 单证传真
/// </summary>
public string DocFax { get; set; }
/// <summary>
/// 单证邮箱
/// </summary>
public string DocEmail { get; set; }
/// <summary>
/// 截港日期
/// </summary>
@ -201,42 +92,39 @@ namespace DS.WMS.Core.Op.Dtos
/// 截VGM日期
/// </summary>
public DateTime CloseVGMDate { get; set; }
/// <summary>
/// 出口海关
/// 备注
/// </summary>
public string ExportCustoms { get; set; }
public string Remark { get; set; }
/// <summary>
/// 海关代码
/// 主提单号
/// </summary>
public string CustomsCode { get; set; }
public string MBLNO { get; set; }
/// <summary>
/// 报关代码
/// 分提单号
/// </summary>
public string DeclarationCode { get; set; }
public string HBLNO { get; set; }
/// <summary>
/// 备注
/// 委托编号
/// </summary>
public string Remark { get; set; }
public string CustomerNo { get; set; }
/// <summary>
/// 提箱时间
/// 委托单位Id
/// </summary>
public DateTime PickUpTime { get; set; }
public long CustomerId { get; set; }
/// <summary>
/// 入货时间
/// 委托单位名称
/// </summary>
public DateTime ReceiveTime { get; set; }
public string CustomerName { get; set; }
/// <summary>
/// 箱型箱量
/// </summary>
public string CntrTotal { get; set; }
/// 开船日期
/// </summary>
public string ETD { get; set; }
/// <summary>
/// 创建时间
/// </summary>

@ -40,10 +40,6 @@ namespace DS.WMS.Core.Op.Dtos
/// </summary>
public string ToAttnMobile { get; set; }
/// <summary>
/// ATTN传真
/// </summary>
public string ToAttnFax { get; set; }
/// <summary>
/// ATTN邮箱
/// </summary>
public string ToAttnEmail { get; set; }
@ -60,51 +56,10 @@ namespace DS.WMS.Core.Op.Dtos
/// </summary>
public string FromMobile { get; set; }
/// <summary>
/// FROM传真
/// </summary>
public string FromFax { get; set; }
/// <summary>
/// FROM邮箱
/// </summary>
public string FromEmail { get; set; }
/// <summary>
/// 主提单号
/// </summary>
public string MBLNO { get; set; }
/// <summary>
/// 卸货港Id
/// </summary>
public long? DischargePortId { get; set; }
/// <summary>
/// 卸货港
/// </summary>
public string DischargePort { get; set; }
/// <summary>
/// 船名航次
/// </summary>
public string VesselVoyNo { get; set; }
/// <summary>
/// 开船日期
/// </summary>
public DateTime? ETD { get; set; }
/// <summary>
/// 目的地
/// </summary>
public string Destination { get; set; }
/// <summary>
/// 件重尺
/// </summary>
public string PKC { get; set; }
/// <summary>
/// 货物描述
/// </summary>
public string Description { get; set; }
/// <summary>
/// 提箱场站
/// </summary>
@ -113,11 +68,8 @@ namespace DS.WMS.Core.Op.Dtos
/// <summary>
/// 提箱场站名称
/// </summary>
public string YardName { get; set; }
/// <summary>
/// 地址
/// </summary>
public string YardAddress { get; set; }
public string Yard { get; set; }
/// <summary>
/// 电话
/// </summary>
@ -128,51 +80,6 @@ namespace DS.WMS.Core.Op.Dtos
/// </summary>
public long YardAttn { get; set; }
/// <summary>
/// 入货场站
/// </summary>
public long? ReceiveYardId { get; set; }
/// <summary>
/// 入货场站名称
/// </summary>
public string ReceiveYardName { get; set; }
/// <summary>
/// 入货地址
/// </summary>
public string ReceiveAddress { get; set; }
/// <summary>
/// 入货电话
/// </summary>
public string ReceiveTel { get; set; }
/// <summary>
/// 入货联系人
/// </summary>
public long ReceiveAttn { get; set; }
/// <summary>
/// Desc:单证Id
/// </summary>
public long Doc { get; set; }
/// <summary>
/// Desc:单证人员名称
/// </summary>
public string DocName { get; set; }
/// <summary>
/// 单证电话
/// </summary>
public string DocTel { get; set; }
/// <summary>
/// 单证传真
/// </summary>
public string DocFax { get; set; }
/// <summary>
/// 单证邮箱
/// </summary>
public string DocEmail { get; set; }
/// <summary>
/// 截港日期
/// </summary>
@ -186,40 +93,12 @@ namespace DS.WMS.Core.Op.Dtos
/// 截VGM日期
/// </summary>
public DateTime CloseVGMDate { get; set; }
/// <summary>
/// 出口海关
/// </summary>
public string ExportCustoms { get; set; }
/// <summary>
/// 海关代码
/// </summary>
public string CustomsCode { get; set; }
/// <summary>
/// 报关代码
/// </summary>
public string DeclarationCode { get; set; }
/// <summary>
/// 备注
/// </summary>
public string Remark { get; set; }
/// <summary>
/// 提箱时间
/// </summary>
public DateTime PickUpTime { get; set; }
/// <summary>
/// 入货时间
/// </summary>
public DateTime ReceiveTime { get; set; }
/// <summary>
/// 箱型箱量
/// </summary>
public string CntrTotal { get; set; }
}
}

@ -28,16 +28,11 @@
/// ATTN电话
/// </summary>
public string ToAttnTel { get; set; }
/// <summary>
/// ATTN手机号
/// </summary>
public string ToAttnMobile { get; set; }
/// <summary>
/// ATTN传真
/// </summary>
public string ToAttnFax { get; set; }
/// <summary>
/// ATTN邮箱
/// </summary>
public string ToAttnEmail { get; set; }
@ -54,67 +49,10 @@
/// </summary>
public string FromMobile { get; set; }
/// <summary>
/// FROM传真
/// </summary>
public string FromFax { get; set; }
/// <summary>
/// FROM邮箱
/// </summary>
public string FromEmail { get; set; }
/// <summary>
/// 主提单号
/// </summary>
public string MBLNO { get; set; }
/// <summary>
/// 分提单号
/// </summary>
public string HBLNO { get; set; }
/// <summary>
/// 委托编号
/// </summary>
public string CustomerNo { get; set; }
/// <summary>
/// 委托单位Id
/// </summary>
public long CustomerId { get; set; }
/// <summary>
/// 委托单位名称
/// </summary>
public string CustomerName { get; set; }
/// <summary>
/// 卸货港Id
/// </summary>
public long? DischargePortId { get; set; }
/// <summary>
/// 卸货港
/// </summary>
public string DischargePort { get; set; }
/// <summary>
/// 船名航次
/// </summary>
public string VesselVoyNo { get; set; }
/// <summary>
/// 开船日期
/// </summary>
public DateTime? ETD { get; set; }
/// <summary>
/// 目的地
/// </summary>
public string Destination { get; set; }
/// <summary>
/// 件重尺
/// </summary>
public string PKC { get; set; }
/// <summary>
/// 货物描述
/// </summary>
public string Description { get; set; }
/// <summary>
/// 提箱场站
/// </summary>
@ -123,11 +61,8 @@
/// <summary>
/// 提箱场站名称
/// </summary>
public string YardName { get; set; }
/// <summary>
/// 地址
/// </summary>
public string YardAddress { get; set; }
public string Yard { get; set; }
/// <summary>
/// 电话
/// </summary>
@ -138,51 +73,6 @@
/// </summary>
public long YardAttn { get; set; }
/// <summary>
/// 入货场站
/// </summary>
public long? ReceiveYardId { get; set; }
/// <summary>
/// 入货场站名称
/// </summary>
public string ReceiveYardName { get; set; }
/// <summary>
/// 入货地址
/// </summary>
public string ReceiveAddress { get; set; }
/// <summary>
/// 入货电话
/// </summary>
public string ReceiveTel { get; set; }
/// <summary>
/// 入货联系人
/// </summary>
public long ReceiveAttn { get; set; }
/// <summary>
/// Desc:单证Id
/// </summary>
public long Doc { get; set; }
/// <summary>
/// Desc:单证人员名称
/// </summary>
public string DocName { get; set; }
/// <summary>
/// 单证电话
/// </summary>
public string DocTel { get; set; }
/// <summary>
/// 单证传真
/// </summary>
public string DocFax { get; set; }
/// <summary>
/// 单证邮箱
/// </summary>
public string DocEmail { get; set; }
/// <summary>
/// 截港日期
/// </summary>
@ -196,39 +86,17 @@
/// 截VGM日期
/// </summary>
public DateTime CloseVGMDate { get; set; }
/// <summary>
/// 出口海关
/// </summary>
public string ExportCustoms { get; set; }
/// <summary>
/// 海关代码
/// </summary>
public string CustomsCode { get; set; }
/// <summary>
/// 报关代码
/// </summary>
public string DeclarationCode { get; set; }
/// <summary>
/// 备注
/// </summary>
public string Remark { get; set; }
/// <summary>
/// 提箱时间
/// </summary>
public DateTime PickUpTime { get; set; }
/// <summary>
/// 入货时间
/// 创建时间
/// </summary>
public DateTime ReceiveTime { get; set; }
public DateTime CreateTime { get; set; }
/// <summary>
/// 箱型箱量
/// </summary>
public string CntrTotal { get; set; }
/// <summary>
/// 订单链接地址
/// </summary>

@ -36,11 +36,6 @@ namespace DS.WMS.Core.Op.Entity
[SugarColumn(ColumnDescription = "ATTN电话", IsNullable = true, Length = 30)]
public string ToAttnTel { get; set; }
/// <summary>
/// ATTN传真
/// </summary>
[SugarColumn(ColumnDescription = "ATTN传真", IsNullable = true, Length = 30)]
public string ToAttnFax { get; set; }
/// <summary>
/// ATTN手机号
/// </summary>
[SugarColumn(ColumnDescription = "ATTN手机号", IsNullable = true, Length = 30)]
@ -66,61 +61,11 @@ namespace DS.WMS.Core.Op.Entity
[SugarColumn(ColumnDescription = "FROM手机号", IsNullable = true, Length = 100)]
public string FromMobile { get; set; }
/// <summary>
/// FROM传真
/// </summary>
[SugarColumn(ColumnDescription = "FROM传真", IsNullable = true, Length = 100)]
public string FromFax { get; set; }
/// <summary>
/// FROM邮箱
/// </summary>
[SugarColumn(ColumnDescription = "FROM邮箱", IsNullable = true, Length = 100)]
public string FromEmail { get; set; }
/// <summary>
/// 主提单号
/// </summary>
[SqlSugar.SugarColumn(ColumnDescription = "主提单号", IsNullable = false, Length = 30)]
public string MBLNO { get; set; }
/// <summary>
/// 卸货港Id
/// </summary>
[SugarColumn(ColumnDescription = "卸货港Id", IsNullable = true)]
public long? DischargePortId { get; set; }
/// <summary>
/// 卸货港
/// </summary>
[SugarColumn(ColumnDescription = "卸货港", Length = 60, IsNullable = true)]
public string DischargePort { get; set; }
/// <summary>
/// 船名航次
/// </summary>
[SugarColumn(ColumnDescription = "卸货港", Length = 100, IsNullable = true)]
public string VesselVoyNo { get; set; }
/// <summary>
/// 开船日期
/// </summary>
[SugarColumn(ColumnDescription = "开船日期", IsNullable = true)]
public DateTime? ETD { get; set; }
/// <summary>
/// 目的地
/// </summary>
[SugarColumn(ColumnDescription = "目的地", IsNullable = true, Length = 60)]
public string Destination { get; set; }
/// <summary>
/// 件重尺
/// </summary>
[SugarColumn(ColumnDescription = "件重尺", IsNullable = true, Length = 100)]
public string PKC { get; set; }
/// <summary>
/// 货物描述
/// </summary>
[SugarColumn(ColumnDescription = "货物描述", IsNullable = true, ColumnDataType = StaticConfig.CodeFirst_BigString)]
public string Description { get; set; }
public string FromEmail { get; set; }
/// <summary>
/// 提箱场站
/// </summary>
@ -131,12 +76,8 @@ namespace DS.WMS.Core.Op.Entity
/// 提箱场站名称
/// </summary>
[SugarColumn(ColumnDescription = "提箱场站名称", Length = 60, IsNullable = true)]
public string YardName { get; set; }
/// <summary>
/// 地址
/// </summary>
[SugarColumn(ColumnDescription = "地址", IsNullable = true, Length = 200)]
public string YardAddress { get; set; }
public string Yard { get; set; }
/// <summary>
/// 电话
/// </summary>
@ -147,62 +88,7 @@ namespace DS.WMS.Core.Op.Entity
/// 提箱联系人
/// </summary>
[SugarColumn(ColumnDescription = "提箱联系人")]
public long YardAttn { get; set; }
/// <summary>
/// 入货场站
/// </summary>
[SugarColumn(ColumnDescription = "入货场站Id", IsNullable = true)]
public long? ReceiveYardId { get; set; }
/// <summary>
/// 入货场站名称
/// </summary>
[SugarColumn(ColumnDescription = "入货场站名称", Length = 60, IsNullable = true)]
public string ReceiveYardName { get; set; }
/// <summary>
/// 入货地址
/// </summary>
[SugarColumn(ColumnDescription = "入货地址", IsNullable = true, Length = 200)]
public string ReceiveAddress { get; set; }
/// <summary>
/// 入货电话
/// </summary>
[SugarColumn(ColumnDescription = "入货电话", IsNullable = true, Length = 100)]
public string ReceiveTel { get; set; }
/// <summary>
/// 入货联系人
/// </summary>
[SugarColumn(ColumnDescription = "入货联系人")]
public long ReceiveAttn { get; set; }
/// <summary>
/// Desc:单证Id
/// </summary>
[SugarColumn(ColumnDescription = "单证Id",IsNullable = true)]
public long Doc { get; set; }
/// <summary>
/// Desc:单证人员名称
/// </summary>
[SugarColumn(ColumnDescription = "单证人员名称", IsNullable = true, Length = 100)]
public string DocName { get; set; }
/// <summary>
/// 单证电话
/// </summary>
[SugarColumn(ColumnDescription = "单证电话", IsNullable = true, Length = 100)]
public string DocTel { get; set; }
/// <summary>
/// 单证传真
/// </summary>
[SugarColumn(ColumnDescription = "单证传真", IsNullable = true, Length = 100)]
public string DocFax { get; set; }
/// <summary>
/// 单证邮箱
/// </summary>
[SugarColumn(ColumnDescription = "单证邮箱", IsNullable = true, Length = 100)]
public string DocEmail { get; set; }
public long YardAttn { get; set; }
/// <summary>
/// 截港日期
@ -220,60 +106,13 @@ namespace DS.WMS.Core.Op.Entity
/// </summary>
[SugarColumn(ColumnDescription = "截VGM日期", IsNullable = true)]
public DateTime CloseVGMDate { get; set; }
/// <summary>
/// 出口海关
/// </summary>
[SugarColumn(ColumnDescription = "出口海关", IsNullable = true, Length = 100)]
public string ExportCustoms { get; set; }
/// <summary>
/// 海关代码
/// </summary>
[SugarColumn(ColumnDescription = "海关代码", IsNullable = true, Length = 100)]
public string CustomsCode { get; set; }
/// <summary>
/// 报关代码
/// </summary>
[SugarColumn(ColumnDescription = "报关代码", IsNullable = true, Length = 100)]
public string DeclarationCode { get; set; }
/// <summary>
/// 备注
/// </summary>
[SugarColumn(ColumnDescription = "备注", IsNullable = true, ColumnDataType = StaticConfig.CodeFirst_BigString)]
public string Remark { get; set; }
/// <summary>
/// 提箱小票地址
/// </summary>
[SugarColumn(ColumnDescription = "提箱小票地址", IsNullable = true, Length = 260)]
public string PickReceiptUrl { get; set; }
/// <summary>
/// 提箱时间
/// </summary>
[SugarColumn(ColumnDescription = "提箱时间", IsNullable = true)]
public DateTime PickUpTime { get; set; }
/// <summary>
/// VGM链接
/// </summary>
[SugarColumn(ColumnDescription = "VGM链接", IsNullable = true, Length = 260)]
public string VgmUrl { get; set; }
/// <summary>
/// VGM&SI链接
/// </summary>
[SugarColumn(ColumnDescription = "VGM&SI链接", IsNullable = true, Length = 260)]
public string VgmSiUrl { get; set; }
/// <summary>
/// 入货时间
/// </summary>
[SugarColumn(ColumnDescription = "入货时间", IsNullable = true)]
public DateTime ReceiveTime { get; set; }
/// <summary>
/// 箱型箱量
/// </summary>
[SugarColumn(ColumnDescription = "箱型箱量", IsNullable = true,Length =100)]
public string CntrTotal { get; set; }
}
}

@ -4,11 +4,16 @@ using DS.Module.Core.Data;
using DS.Module.Core.Extensions;
using DS.Module.SqlSugar;
using DS.Module.UserModule;
using DS.WMS.Core.Code.Entity;
using DS.WMS.Core.Map.Entity;
using DS.WMS.Core.Op.Dtos;
using DS.WMS.Core.Op.EDI;
using DS.WMS.Core.Op.Entity;
using DS.WMS.Core.Op.Interface;
using DS.WMS.Core.Sys.Entity;
using Mapster;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Identity;
using Microsoft.Extensions.DependencyInjection;
using NLog;
using Org.BouncyCastle.Ocsp;
@ -26,6 +31,7 @@ namespace DS.WMS.Core.Op.Method
private readonly ISaasDbService saasService;
private static readonly Logger _logger = LogManager.GetCurrentClassLogger();
private readonly ISeaExportCommonService seaComService;
private readonly IWebHostEnvironment _environment;
/// <summary>
///
/// </summary>
@ -36,7 +42,8 @@ namespace DS.WMS.Core.Op.Method
db = _serviceProvider.GetRequiredService<ISqlSugarClient>();
user = _serviceProvider.GetRequiredService<IUser>();
saasService = _serviceProvider.GetRequiredService<ISaasDbService>();
seaComService = _serviceProvider.GetRequiredService<ISeaExportCommonService>();
_environment = _serviceProvider.GetRequiredService<IWebHostEnvironment>();
}
public DataResult<List<OpBusinessYardRes>> GetListByPage(PageRequest request)
@ -55,15 +62,17 @@ namespace DS.WMS.Core.Op.Method
//序列化查询条件
var whereList = db.ConfigQuery.Context.Utilities.JsonToConditionalModels(request.QueryCondition);
var data = await tenantDb.Queryable<BusinessYard>()
.LeftJoin<SeaExport>((a,b)=>a.BusinessId == b.Id)
.Select((a,b)=> new OpBusinessYardHistoryRes
.LeftJoin<SeaExport>((a, b) => a.BusinessId == b.Id)
.Select((a, b) => new OpBusinessYardHistoryRes
{
CreateTime = a.CreateTime,
HBLNO = b.HBLNO,
CustomerId = b.CustomerId,
CustomerName =b.CustomerName,
CustomerNo =b.CustomerNo,
},true)
CreateTime = a.CreateTime,
ETD = b.ETD.HasValue ? b.ETD.Value.Date.ToString("yyyy-MM-dd") : "",
MBLNO = b.MBLNO,
HBLNO = b.HBLNO,
CustomerId = b.CustomerId,
CustomerName = b.CustomerName,
CustomerNo = b.CustomerNo,
}, true)
.Where(whereList).ToQueryPageAsync(request.PageCondition);
return data;
}
@ -121,7 +130,7 @@ namespace DS.WMS.Core.Op.Method
var data = tenantDb.Queryable<BusinessYard>()
.Where(a => a.Id == long.Parse(id))
.Select<OpBusinessYardRes>()
.Mapper(it=>
.Mapper(it =>
it.Urls = tenantDb.Queryable<BookingOrderUrl>().Where(x => x.BusinessId == it.BusinessId).Select<BookingOrderUrlRes>().First()
)
.First();
@ -151,5 +160,161 @@ namespace DS.WMS.Core.Op.Method
return DataResult.Successed("删除成功!", MultiLanguageConst.DataDelSuccess);
}
// public async Task<DataResult> SendLetterYard(string id)
// {
// var tenant = db.Queryable<SysTenant>().FirstAsync(t => t.Id == long.Parse(user.TenantId));
// var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
// var bookingId = long.Parse(id);
// var order = await tenantDb.Queryable<SeaExport>().FirstAsync(x => x.Id == bookingId);
// var userInfo = await tenantDb.Queryable<SysUser>().FirstAsync(u => u.Id == order.CreateBy);
// var letterYard = await tenantDb.Queryable<BusinessYard>().FirstAsync(x => x.BusinessId == bookingId);
// if (letterYard.IsNull())
// {
// return await Task.FromResult(DataResult.Failed("放舱信息未找到,请先保存数据"));
// }
// if (string.IsNullOrEmpty(letterYard.ToAttnEmail))
// {
// return await Task.FromResult(DataResult.Failed("ATTN MAIL未正确填写"));
// }
// if (string.IsNullOrEmpty(letterYard.FromEmail))
// {
// return await Task.FromResult(DataResult.Failed("FROM MAIL未正确填写"));
// }
// var mailAcc = await tenantDb.Queryable<CodeUserEmail>().FirstAsync(x => x.CreateBy == long.Parse(user.UserId) && x.MailAccount == letterYard.FromEmail && x.SmtpPort > 0 && x.SmtpServer != null && x.SmtpServer != "");
// if (mailAcc == null)
// {
// return await Task.FromResult(DataResult.Failed("用户邮箱未设置或smtp未正确配置"));
// }
// var orderUrl = await tenantDb.Queryable<BookingOrderUrl>().FirstAsync(u => u.BusinessId == bookingId);
// //if (orderUrl == null)
// //{
// // throw Oops.Bah("未生成链接信息,请重新保存数据");
// //}
// #region 保存放舱文件,并挂载到订舱附件
// var printTemplate = await db.Queryable<SysPrintTemplate>().FirstAsync(t => t.TemplateCode == "release_the_cabin");
// if (printTemplate.IsNull())
// {
// return await Task.FromResult(DataResult.Failed("打印模板代码[release_the_cabin]未设置"));
// }
// var bs = await GenPrintFile(bookingId, printTemplate);
// var basePath = AppSetting.app(new string[] { "FileSettings", "BasePath" });
// var relativePath = AppSetting.app(new string[] { "FileSettings", "RelativePath" });
// var dirAbs = string.Empty;
// var fileRelaPath = string.Empty;
// var fileAbsPath = string.Empty;
// var fileSaveName = $"放舱通知_{order.MBLNO}_{DateTime.Now.Ticks}.pdf"; // 文件原始名称
// if (string.IsNullOrEmpty(basePath))
// {
// dirAbs = Path.Combine(_environment.WebRootPath, relativePath);
// }
// else
// {
// dirAbs = Path.Combine(basePath, relativePath);
// }
// if (!Directory.Exists(dirAbs))
// Directory.CreateDirectory(dirAbs);
// fileRelaPath = Path.Combine(relativePath, fileSaveName).ToLower();
// fileAbsPath = Path.Combine(dirAbs, fileSaveName).ToLower();
// File.WriteAllBytes(fileAbsPath, bs);
// //挂载附件
// var bookFile = new OpFile
// {
// FileName = fileSaveName,
// FilePath = fileRelaPath,
// TypeCode = "ruhuotongzhi",
// TypeName = ".pdf",
// LinkId = order.Id,
// };
// await tenantDb.Insertable(bookFile).ExecuteCommandAsync();
// #endregion
// //货运动态
// var bookingStatusLog = new BookingStatusLog()
// {
// BusinessId = bookingId,
// Status = $"放舱给客户",
// Group = "ship",
// OpTime = DateTime.Now,
// MBLNO = order.MBLNO
// };
// await tenantDb.Insertable(bookingStatusLog).ExecuteCommandAsync();
// //订舱状态
// await seaComService.SaveBookingStatus(bookingId, "sta_letter_yard", "放舱");
// #region 发送邮件
// var carrCode = seaComService.GetCarrierCode(order.CarrierId, tenantDb);
// var mailSubject = $"放舱信息:{order.MBLNO}/{carrCode}/{order.Vessel}/{order.Voyno}/PO:{order.CustomerNo}/{userInfo.TenantName}";
// var extContent = string.Empty;
// if (order.CargoId == "R") //冻柜
// {
// extContent = $"温度:{order.TemperatureSet}{order.TemperatureUnit} <br/>通风:{order.ReeferQuantity} <br/>湿度:{order.Humidity}<br/>";
// }
// else if (order.CargoId == "D") //危险品
// {
// extContent = $"危险品等级:{order.DangerClass} <br/>危险品编号:{order.DangerNo}<br/>";
// }
// var linkContent = string.Empty;
// if (orderUrl != null)
// {
// linkContent = $@"提箱小票链接:<a href='{orderUrl.UrlTxxp}'>{orderUrl.UrlTxxp}</a><br/>
//提交VGM链接<a href='{orderUrl.UrlVgm}'>{orderUrl.UrlVgm}</a><br/>";
// }
// var mailContent = $@"TO:{order.CustomerName}贵司委托我司代理订舱出口的货物信息如下,详情请见附件,谢谢!<br/>
//提单号:{order.MBLNO}<br/>
//船名航次:{order.Vessel}/{order.Voyno}<br/>
//目的港:{order.DischargePort}<br/>
//预计船期:{(order.ETD.HasValue ? order.ETD.Value.Date.ToString("yyyy-MM-dd") : "")}<br/>
//场站:{order.Yard}<br/>
//船代:{order.ShipAgency}<br/>
//预计截港时间:{order.ClosingDate}<br/>
//预计截单时间:{order.CloseDocDate}<br/>
//截VGM时间{order.CloseVgmDate}<br/>
//{extContent}
//备注:{order.YardRemark}<br/>
//{linkContent}
//<br/>
// <span style='color:red;'>温馨提示:</span><br/>
// <span style='color:red;'>如果分票报关,请回箱前通知场站及我司。</span><br/>
// <span style='color:red;'>开船及截港时间以码头具体计划为准。</span><br/>
// <span style='color:red;'>若贵司自输VGM请不要通过VGM链接提交数据否则我司收取相关VGM申报费用。</span><br/>
//<br/>
// 订舱代理联系人:{user.UserName}<br/>
// 电话:{userInfo.Tel} 手机:{userInfo.Phone}<br/>
// 邮箱:{userInfo.Email}
//<br/>";
// var sendResult = await MailSendHelper.SendMail(mailAcc, mailSubject, mailContent, letterYard.ToAttnEmail, new KeyValuePair<string, byte[]>($"放舱通知_{order.MBLNO}.pdf", bs));
// if (!sendResult.Key)
// {
// _logger.Error($"放舱邮件发送失败:从{mailAcc.MailAccount}到{letterYard.ToAttnEmail},主题 {mailSubject}");
// return await Task.FromResult(DataResult.Failed($"邮件发送失败:{sendResult.Value}"));
// }
// #endregion
// //设置货物状态-放舱
// await seaComService.SetGoodsStatus("YFC", bookingId, tenantDb);
// return await Task.FromResult(DataResult.Successed("发送成功"));
// }
}
}

@ -995,75 +995,8 @@ namespace DS.WMS.Core.Op.Method
await tenantDb.Updateable(bookStatus).ExecuteCommandAsync();
}
}
#endregion
//#region 设定保存订舱的货物状态
///// <summary>
///// 设定保存订舱的货物状态并同步东胜
///// </summary>
///// <param name="bookingId"></param>
///// <param name="isAutoSyncDS">是否默认同步东胜 true-自动同步 false-不自动同步</param>
///// <param name="fromFunc">调用方模块名</param>
///// <returns></returns>
//public async Task SetBookingGoodsStatus(long bookingId, bool isAutoSyncDS = false, string fromFunc = null)
//{
// var bookingOrder = _rep.AsQueryable().Filter(null, true)
// .First(a => a.Id == bookingId);
// QueryServiceProjectWithStatus queryInfo = new QueryServiceProjectWithStatus
// {
// BookingId = bookingId,
// QueryType = TrackingQueryTypeEnum.QUERY_SERVICE_PROJECT,
// TenantId = bookingOrder.TenantId.Value
// };
// var queryRlt = await _serviceWorkFlowManageService.GetEnableStatusListByBusiness(queryInfo);
// if (queryRlt.succ)
// {
// var statusList = JSON.Deserialize<List<ServiceProjectStatusDto>>(JSON.Serialize(queryRlt.ext));
// if (statusList != null)
// {
// var maxStatus = statusList.Where(a => a.IsYield)
// .OrderByDescending(a => a.SortNo)
// .FirstOrDefault();
// var model = _rep.AsQueryable().Filter(null, true)
// .First(a => a.Id == bookingId);
// var oldModel = model.Adapt<BookingOrder>();
// if (maxStatus != null)
// {
// model.BSSTATUSNAME = maxStatus.ShowName;
// }
// else
// {
// model.BSSTATUSNAME = string.Empty;
// }
// //model.VERSION = IDGen.NextID().ToString().Replace("-", "");
// //更新订舱
// _rep.AsUpdateable(model)
// .UpdateColumns(it => new
// {
// it.BSSTATUSNAME,
// //it.VERSION
// }).ExecuteCommand();
// // 保存日志
// await SaveLog(model, oldModel, fromFunc);
// //推送东胜
// if (isAutoSyncDS)
// //推送东胜
// await SendBookingOrder(new long[] { bookingId });
// }
// }
//}
//#endregion
#endregion
#region 发送XHZ

Loading…
Cancel
Save