wet 2 years ago
commit ac38b8d3c0

@ -63,5 +63,22 @@ namespace Myshipping.Application.Entity
/// 备注 /// 备注
/// </summary> /// </summary>
public string Remark { get; set; } public string Remark { get; set; }
/// <summary>
/// 场站代码
/// </summary>
public string YARDID { get; set; }
/// <summary>
/// 场站
/// </summary>
public string YARD { get; set; }
/// <summary>
/// 场站联系人
/// </summary>
public string YARDCONTRACT { get; set; }
/// <summary>
/// 场站联系人电话
/// </summary>
public string YARDCONTRACTTEL { get; set; }
} }
} }

@ -2465,6 +2465,26 @@
备注 备注
</summary> </summary>
</member> </member>
<member name="P:Myshipping.Application.Entity.BookingLetteryard.YARDID">
<summary>
场站代码
</summary>
</member>
<member name="P:Myshipping.Application.Entity.BookingLetteryard.YARD">
<summary>
场站
</summary>
</member>
<member name="P:Myshipping.Application.Entity.BookingLetteryard.YARDCONTRACT">
<summary>
场站联系人
</summary>
</member>
<member name="P:Myshipping.Application.Entity.BookingLetteryard.YARDCONTRACTTEL">
<summary>
场站联系人电话
</summary>
</member>
<member name="T:Myshipping.Application.Entity.BookingLog"> <member name="T:Myshipping.Application.Entity.BookingLog">
<summary> <summary>
舱单日志 舱单日志
@ -7148,6 +7168,26 @@
备注 备注
</summary> </summary>
</member> </member>
<member name="P:Myshipping.Application.BookingLetteryardInput.YARDID">
<summary>
场站代码
</summary>
</member>
<member name="P:Myshipping.Application.BookingLetteryardInput.YARD">
<summary>
场站
</summary>
</member>
<member name="P:Myshipping.Application.BookingLetteryardInput.YARDCONTRACT">
<summary>
场站联系人
</summary>
</member>
<member name="P:Myshipping.Application.BookingLetteryardInput.YARDCONTRACTTEL">
<summary>
场站联系人电话
</summary>
</member>
<member name="T:Myshipping.Application.AddBookingLetteryardInput"> <member name="T:Myshipping.Application.AddBookingLetteryardInput">
<summary> <summary>
入货通知新增输入参数 入货通知新增输入参数
@ -9205,6 +9245,16 @@
租户名称 租户名称
</summary> </summary>
</member> </member>
<member name="P:Myshipping.Application.QueryBookingPrintTemplateInput.IsMain">
<summary>
主单
</summary>
</member>
<member name="P:Myshipping.Application.QueryBookingPrintTemplateInput.IsSub">
<summary>
分单
</summary>
</member>
<member name="T:Myshipping.Application.BookingPrintTemplateOutput"> <member name="T:Myshipping.Application.BookingPrintTemplateOutput">
<summary> <summary>
订舱打印模板输出参数 订舱打印模板输出参数

@ -284,7 +284,7 @@ namespace Myshipping.Application
.WhereIF(!string.IsNullOrWhiteSpace(input.LANECODE), u => u.LANECODE == input.LANECODE) .WhereIF(!string.IsNullOrWhiteSpace(input.LANECODE), u => u.LANECODE == input.LANECODE)
.WhereIF(!string.IsNullOrWhiteSpace(input.LANENAME), u => u.LANENAME.Contains(input.LANENAME)) .WhereIF(!string.IsNullOrWhiteSpace(input.LANENAME), u => u.LANENAME.Contains(input.LANENAME))
.WhereIF(!string.IsNullOrWhiteSpace(input.FREIGHTPAYER), u => u.FREIGHTPAYER.Contains(input.FREIGHTPAYER)) .WhereIF(!string.IsNullOrWhiteSpace(input.FREIGHTPAYER), u => u.FREIGHTPAYER.Contains(input.FREIGHTPAYER))
.WhereIF(userlist!=null&&userlist.Count()>0, u => userlist.Contains((long)u.CreatedUserId)) .WhereIF(userlist != null && userlist.Count() > 0, u => userlist.Contains((long)u.CreatedUserId))
.OrderBy(PageInputOrder.OrderBuilder(input.SortField, input.descSort)) .OrderBy(PageInputOrder.OrderBuilder(input.SortField, input.descSort))
.ToPagedListAsync(input.PageNo, input.PageSize); .ToPagedListAsync(input.PageNo, input.PageSize);
@ -298,7 +298,8 @@ namespace Myshipping.Application
if (sta != null) { item.bookstatus = sta; } if (sta != null) { item.bookstatus = sta; }
var st = await _bookingremark.AsQueryable().Where(x => x.PId == item.Id).ToListAsync(); var st = await _bookingremark.AsQueryable().Where(x => x.PId == item.Id).ToListAsync();
if (st != null) { item.bookremark = st; } if (st != null) { item.bookremark = st; }
if (!string.IsNullOrWhiteSpace( item.ETD)) { if (!string.IsNullOrWhiteSpace(item.ETD))
{
item.ETD = Convert.ToDateTime(item.ETD).ToString("yyyy-MM-dd"); item.ETD = Convert.ToDateTime(item.ETD).ToString("yyyy-MM-dd");
} }
} }
@ -948,7 +949,7 @@ namespace Myshipping.Application
bookingStatusLog.BookingId = Convert.ToInt64(item.BusinessId); bookingStatusLog.BookingId = Convert.ToInt64(item.BusinessId);
bookingStatusLog.Category = "ship"; bookingStatusLog.Category = "ship";
bookingStatusLog.CreatedTime = DateTime.Now; bookingStatusLog.CreatedTime = DateTime.Now;
if (string.IsNullOrWhiteSpace( item.YardCode) && !string.IsNullOrWhiteSpace( item.CARRIERID )) if (string.IsNullOrWhiteSpace(item.YardCode) && !string.IsNullOrWhiteSpace(item.CARRIERID))
{ {
bookingStatusLog.Status = "订阅目的港"; bookingStatusLog.Status = "订阅目的港";
} }
@ -1163,7 +1164,10 @@ namespace Myshipping.Application
FromName = user.Name, FromName = user.Name,
FromTel = user.Tel, FromTel = user.Tel,
FromMail = user.Email, FromMail = user.Email,
YARDID = order.YARDID,
YARD = order.YARD,
YARDCONTRACT = order.YARDCONTRACT,
YARDCONTRACTTEL = order.YARDCONTRACTTEL,
}; };
} }
@ -1636,7 +1640,7 @@ namespace Myshipping.Application
{ {
//当前公司所有已配置的模板 //当前公司所有已配置的模板
var allList = await _repPrintTemplate.AsQueryable() var allList = await _repPrintTemplate.AsQueryable()
.Filter(null, true).InnerJoin<BookingPrinttemplateRight>((d,t)=>d.Id==t.PrintTemplateId&&t.SysUserId==UserManager.UserId) .Filter(null, true).InnerJoin<BookingPrinttemplateRight>((d, t) => d.Id == t.PrintTemplateId && t.SysUserId == UserManager.UserId)
.Where(d => d.TenantId == UserManager.TENANT_ID) .Where(d => d.TenantId == UserManager.TENANT_ID)
.Select(d => new .Select(d => new
{ {
@ -2468,7 +2472,7 @@ namespace Myshipping.Application
var curBasePkgs = basePkgsList.FirstOrDefault(p => p.Name.Equals(order.KINDPKGS, StringComparison.OrdinalIgnoreCase)); var curBasePkgs = basePkgsList.FirstOrDefault(p => p.Name.Equals(order.KINDPKGS, StringComparison.OrdinalIgnoreCase));
if(curBasePkgs == null) if (curBasePkgs == null)
throw Oops.Bah($"包装{order.KINDPKGS}的基础数据代码未找到"); throw Oops.Bah($"包装{order.KINDPKGS}的基础数据代码未找到");
var ediPkgs = ediPkgsList.FirstOrDefault(x => x.Code.Equals(curBasePkgs.Code, StringComparison.OrdinalIgnoreCase)); var ediPkgs = ediPkgsList.FirstOrDefault(x => x.Code.Equals(curBasePkgs.Code, StringComparison.OrdinalIgnoreCase));

@ -74,6 +74,23 @@ namespace Myshipping.Application
/// </summary> /// </summary>
public virtual string Remark { get; set; } public virtual string Remark { get; set; }
/// <summary>
/// 场站代码
/// </summary>
public string YARDID { get; set; }
/// <summary>
/// 场站
/// </summary>
public string YARD { get; set; }
/// <summary>
/// 场站联系人
/// </summary>
public string YARDCONTRACT { get; set; }
/// <summary>
/// 场站联系人电话
/// </summary>
public string YARDCONTRACTTEL { get; set; }
} }
/// <summary> /// <summary>

@ -51,11 +51,12 @@ namespace Myshipping.Application
[HttpGet("/BookingPrintTemplate/page")] [HttpGet("/BookingPrintTemplate/page")]
public async Task<dynamic> Page([FromQuery] QueryBookingPrintTemplateInput input) public async Task<dynamic> Page([FromQuery] QueryBookingPrintTemplateInput input)
{ {
_rep.Context.QueryFilter.Clear(); var entities = await _rep.AsQueryable().Filter(null, true)
var entities = await _rep.AsQueryable()
.WhereIF(!string.IsNullOrWhiteSpace(input.TypeName), u => u.TypeName.Contains(input.TypeName.Trim())) .WhereIF(!string.IsNullOrWhiteSpace(input.TypeName), u => u.TypeName.Contains(input.TypeName.Trim()))
.WhereIF(!string.IsNullOrWhiteSpace(input.FileName), u => u.FileName.Contains(input.FileName.Trim())) .WhereIF(!string.IsNullOrWhiteSpace(input.FileName), u => u.FileName.Contains(input.FileName.Trim()))
.WhereIF(!string.IsNullOrWhiteSpace(input.TenantName), u => u.FileName.Contains(input.TenantName.Trim())) .WhereIF(!string.IsNullOrWhiteSpace(input.TenantName), u => u.TenantName.Contains(input.TenantName.Trim()))
.WhereIF(input.IsMain.HasValue, u => u.IsMain == input.IsMain)
.WhereIF(input.IsSub.HasValue, u => u.IsSub == input.IsSub)
.ToPagedListAsync(input.PageNo, input.PageSize); .ToPagedListAsync(input.PageNo, input.PageSize);
return entities.XnPagedResult(); return entities.XnPagedResult();
} }
@ -116,6 +117,8 @@ namespace Myshipping.Application
TypeName = input.TypeName, TypeName = input.TypeName,
TenantId = input.TenantId, TenantId = input.TenantId,
TenantName = input.TenantName, TenantName = input.TenantName,
IsMain = input.IsMain,
IsSub = input.IsSub,
}; };
await _rep.InsertAsync(newFile); await _rep.InsertAsync(newFile);
using (var stream = File.Create(fileAbsPath)) using (var stream = File.Create(fileAbsPath))
@ -134,20 +137,6 @@ namespace Myshipping.Application
[HttpPost("/BookingPrintTemplate/edit")] [HttpPost("/BookingPrintTemplate/edit")]
public async Task Update(IFormFile file, [FromForm] UpdateBookingPrintTemplateInput input) public async Task Update(IFormFile file, [FromForm] UpdateBookingPrintTemplateInput input)
{ {
//未上传打印模板文件
if (file == null || file.Length == 0)
{
throw Oops.Bah(BookingErrorCode.BOOK113);
}
var opt = App.GetOptions<PrintTemplateOptions>();
var originalFilename = file.FileName; // 文件原始名称
var fileSuffix = Path.GetExtension(file.FileName).ToLower(); // 文件后缀
if (!opt.fileType.Contains(fileSuffix))
{
throw Oops.Bah(BookingErrorCode.BOOK114);
}
var cc = _rep.AsQueryable().Filter(null, true).Count(c => c.TenantId == input.TenantId && c.TypeCode == input.TypeCode && c.Id != input.Id); var cc = _rep.AsQueryable().Filter(null, true).Count(c => c.TenantId == input.TenantId && c.TypeCode == input.TypeCode && c.Id != input.Id);
if (cc > 0) if (cc > 0)
{ {
@ -162,33 +151,44 @@ namespace Myshipping.Application
entity = input.Adapt(entity); entity = input.Adapt(entity);
var dirAbs = string.Empty; if (file != null)
if (string.IsNullOrEmpty(opt.basePath))
{
dirAbs = Path.Combine(App.WebHostEnvironment.WebRootPath, opt.relativePath);
}
else
{ {
dirAbs = Path.Combine(opt.basePath, opt.relativePath); var opt = App.GetOptions<PrintTemplateOptions>();
} var originalFilename = file.FileName; // 文件原始名称
var fileSuffix = Path.GetExtension(file.FileName).ToLower(); // 文件后缀
if (!opt.fileType.Contains(fileSuffix))
{
throw Oops.Bah(BookingErrorCode.BOOK114);
}
if (!Directory.Exists(dirAbs)) var dirAbs = string.Empty;
Directory.CreateDirectory(dirAbs); if (string.IsNullOrEmpty(opt.basePath))
{
dirAbs = Path.Combine(App.WebHostEnvironment.WebRootPath, opt.relativePath);
}
else
{
dirAbs = Path.Combine(opt.basePath, opt.relativePath);
}
if (!Directory.Exists(dirAbs))
Directory.CreateDirectory(dirAbs);
// 先存库获取Id
var fileSaveName = $"{entity.Id}{fileSuffix}".ToLower();
var fileRelaPath = Path.Combine(opt.relativePath, fileSaveName).ToLower();
var fileAbsPath = Path.Combine(dirAbs, fileSaveName).ToLower();
// 先存库获取Id entity.FileName = originalFilename;
var fileSaveName = $"{entity.Id}{fileSuffix}".ToLower(); entity.FilePath = fileRelaPath;
var fileRelaPath = Path.Combine(opt.relativePath, fileSaveName).ToLower();
var fileAbsPath = Path.Combine(dirAbs, fileSaveName).ToLower();
entity.FileName = originalFilename; using (var stream = File.Create(fileAbsPath))
entity.FilePath = fileRelaPath; {
await _rep.UpdateAsync(entity); await file.CopyToAsync(stream);
using (var stream = File.Create(fileAbsPath)) }
{
await file.CopyToAsync(stream);
} }
await _rep.UpdateAsync(entity);
} }
/// <summary> /// <summary>

@ -94,5 +94,14 @@ namespace Myshipping.Application
/// </summary> /// </summary>
public string TenantName { get; set; } public string TenantName { get; set; }
/// <summary>
/// 主单
/// </summary>
public bool? IsMain { get; set; }
/// <summary>
/// 分单
/// </summary>
public bool? IsSub { get; set; }
} }
} }

@ -132,5 +132,9 @@ namespace Myshipping.Core.Entity
/// 客服 /// 客服
/// </summary> /// </summary>
public string CUSTSERVICE { get; set; } public string CUSTSERVICE { get; set; }
/// <summary>
/// 提单信息
/// </summary>
public string TIDANINFO { get; set; }
} }
} }

@ -1744,6 +1744,11 @@
客服 客服
</summary> </summary>
</member> </member>
<member name="P:Myshipping.Core.Entity.DjyCustomer.TIDANINFO">
<summary>
提单信息
</summary>
</member>
<member name="T:Myshipping.Core.Entity.DjyCustomerContact"> <member name="T:Myshipping.Core.Entity.DjyCustomerContact">
<summary> <summary>
@ -9646,6 +9651,11 @@
客服 客服
</summary> </summary>
</member> </member>
<member name="P:Myshipping.Core.Service.DjyCustomerInput.TIDANINFO">
<summary>
提单信息
</summary>
</member>
<member name="T:Myshipping.Core.Service.AddDjyCustomerInput"> <member name="T:Myshipping.Core.Service.AddDjyCustomerInput">
<summary> <summary>
订舱客户新增输入参数 订舱客户新增输入参数

@ -157,6 +157,10 @@ namespace Myshipping.Core.Service
/// 客服 /// 客服
/// </summary> /// </summary>
public string CUSTSERVICE { get; set; } public string CUSTSERVICE { get; set; }
/// <summary>
/// 提单信息
/// </summary>
public string TIDANINFO { get; set; }
public List<AddDjyCustomerContactInput> Contacts { get; set; } public List<AddDjyCustomerContactInput> Contacts { get; set; }

@ -12,6 +12,7 @@ using System.Web.Mvc;
using Myshipping.Report.DB; using Myshipping.Report.DB;
using Myshipping.Application.Entity; using Myshipping.Application.Entity;
using System.Text; using System.Text;
using Myshipping.Core.Entity;
namespace Myshipping.Report.Controllers namespace Myshipping.Report.Controllers
{ {
@ -171,10 +172,20 @@ namespace Myshipping.Report.Controllers
log.Debug($"准备获取订舱数据:{bookingId}"); log.Debug($"准备获取订舱数据:{bookingId}");
var order = sqlSugarClient.Queryable<BookingOrder>().First(x => x.Id == bookingId); var order = sqlSugarClient.Queryable<BookingOrder>().First(x => x.Id == bookingId);
var ctns = sqlSugarClient.Queryable<BookingCtn>().Where(x => x.BILLID == bookingId).ToList(); var ctns = sqlSugarClient.Queryable<BookingCtn>().Where(x => x.BILLID == bookingId).ToList();
var letterYard = sqlSugarClient.Queryable<BookingLetteryard>().First(x => x.BookingId == bookingId);
DjyCustomer customer = null;
if (!string.IsNullOrEmpty(order.AGENTID)) //根据国外代理,获取客户的提单信息
{
customer = sqlSugarClient.Queryable<DjyCustomer>().First(x => x.CodeName == order.AGENTID && x.TenantId == order.TenantId);
}
var strObj = JsonConvert.SerializeObject(new var strObj = JsonConvert.SerializeObject(new
{ {
order = order, order = order,
ctns = ctns ctns = ctns,
letterYard,
agentCustomer = customer,
}); });
log.Debug($"订舱数据:{strObj}"); log.Debug($"订舱数据:{strObj}");

@ -175,9 +175,18 @@
<Compile Include="..\Myshipping.Application\Entity\BookingCtnDetail.cs"> <Compile Include="..\Myshipping.Application\Entity\BookingCtnDetail.cs">
<Link>DB\BookingCtnDetail.cs</Link> <Link>DB\BookingCtnDetail.cs</Link>
</Compile> </Compile>
<Compile Include="..\Myshipping.Application\Entity\BookingLetteryard.cs">
<Link>DB\BookingLetteryard.cs</Link>
</Compile>
<Compile Include="..\Myshipping.Application\Entity\BookingOrder.cs"> <Compile Include="..\Myshipping.Application\Entity\BookingOrder.cs">
<Link>DB\BookingOrder.cs</Link> <Link>DB\BookingOrder.cs</Link>
</Compile> </Compile>
<Compile Include="..\Myshipping.Core\Entity\DJY\DjyCustomer.cs">
<Link>DB\DjyCustomer.cs</Link>
</Compile>
<Compile Include="..\Myshipping.Core\Entity\DJY\DjyCustomerContact.cs">
<Link>DB\DjyCustomerContact.cs</Link>
</Compile>
<Compile Include="App_Start\FilterConfig.cs" /> <Compile Include="App_Start\FilterConfig.cs" />
<Compile Include="App_Start\RouteConfig.cs" /> <Compile Include="App_Start\RouteConfig.cs" />
<Compile Include="Controllers\ReportController.cs" /> <Compile Include="Controllers\ReportController.cs" />

Loading…
Cancel
Save