jianghaiqing 2 years ago
commit d6c7cf2342

@ -14,92 +14,113 @@ namespace Myshipping.Application.Entity
/// <summary>
/// 单据ID
/// </summary>
[Description("单据ID")]
public long? BILLID { get; set; }
/// <summary>
/// 箱型代码
/// </summary>
[Description("箱型代码")]
public string CTNCODE { get; set; }
/// <summary>
/// 箱型
/// </summary>
[Description("箱型")]
public string CTNALL { get; set; }
/// <summary>
/// 箱量
/// </summary>
[Description("箱量")]
public int? CTNNUM { get; set; }
/// <summary>
/// TEU
/// </summary>
[Description("TEU")]
public int? TEU { get; set; }
/// <summary>
/// 箱号
/// </summary>
[Description("箱号")]
public string CNTRNO { get; set; }
/// <summary>
/// 封号
/// </summary>
[Description("封号")]
public string SEALNO { get; set; }
/// <summary>
/// 件数
/// </summary>
[Description("件数")]
public int? PKGS { get; set; }
/// <summary>
/// 包装
/// </summary>
[Description("包装")]
public string KINDPKGS { get; set; }
/// <summary>
/// 毛重
/// </summary>
[Description("毛重")]
public decimal? KGS { get; set; }
/// <summary>
/// 尺码
/// </summary>
[Description("尺码")]
public decimal? CBM { get; set; }
/// <summary>
/// 皮重
/// </summary>
[Description("皮重")]
public decimal? TAREWEIGHT { get; set; }
/// <summary>
/// 箱状态
/// </summary>
[Description("箱状态")]
public string CTNSTATUS { get; set; }
/// <summary>
/// 称重方式
/// </summary>
[Description("称重方式")]
public string WEIGHTYPE { get; set; }
/// <summary>
/// 称重重量
/// </summary>
[Description("称重重量")]
public decimal? WEIGHKGS { get; set; }
/// <summary>
/// 称重联系人
/// </summary>
[Description("称重联系人")]
public string WEIGHATTN { get; set; }
/// <summary>
/// VGM联系公司
/// </summary>
[Description("VGM联系公司")]
public string VGMCONNCOM { get; set; }
/// <summary>
/// VGM联系电话
/// </summary>
[Description("VGM联系电话")]
public string WEIGHTEL { get; set; }
/// <summary>
/// 称重日期
/// </summary>
[Description("称重日期")]
public string WEIGHDATE { get; set; }
/// <summary>
/// VGM地址
/// </summary>
[Description("VGM地址")]
public string VGMADDR { get; set; }
/// <summary>
/// VGM邮箱
/// </summary>
[Description("VGM邮箱")]
public string VGMEMAIL { get; set; }
/// <summary>
/// 备注
/// </summary>
[Description("备注")]
public string REMARK { get; set; }
}
}

@ -14,136 +14,162 @@ namespace Myshipping.Application.Entity
/// <summary>
/// 订舱ID
/// </summary>
[Description("订舱ID")]
public long? BookingId { get; set; }
/// <summary>
/// 委托方
/// </summary>
[Description("委托方")]
public string WeiTuoFang { get; set; }
/// <summary>
/// 发送方EDI代码
/// </summary>
[Description("发送方EDI代码")]
public string SendCode { get; set; }
/// <summary>
/// 接收方EDI代码
/// </summary>
[Description("接收方EDI代码")]
public string ReceiveCode { get; set; }
/// <summary>
/// 通知放EDI代码
/// </summary>
[Description("通知放EDI代码")]
public string NotifyCdoe { get; set; }
/// <summary>
/// 销售EDI代码
/// </summary>
[Description("销售EDI代码")]
public string SalerCode { get; set; }
/// <summary>
/// Master Bol Indicator
/// </summary>
[Description("Master Bol Indicator")]
public string MasterBolIndicator { get; set; }
/// <summary>
/// EMANIFEST HBL
/// </summary>
[Description("EMANIFEST HBL")]
public string EmanifestHbl { get; set; }
/// <summary>
/// 收货人EDI代码
/// </summary>
[Description("收货人EDI代码")]
public string ConsigneeEdiCode { get; set; }
/// <summary>
/// 发货人EDI代码
/// </summary>
[Description("发货人EDI代码")]
public string ShipperEdiCode { get; set; }
/// <summary>
/// EDI联系人名称
/// </summary>
[Description("EDI联系人名称")]
public string EDIAttn { get; set; }
/// <summary>
/// EDI联系人电话
/// </summary>
[Description("EDI联系人电话")]
public string EDIAttnTel { get; set; }
/// <summary>
/// EDI联系人邮箱
/// </summary>
[Description("EDI联系人邮箱")]
public string EDIAttnMail { get; set; }
/// <summary>
/// AMS收货人
/// </summary>
[Description("AMS收货人")]
public string AMSConsignee { get; set; }
/// <summary>
/// AMS通知人
/// </summary>
[Description("AMS通知人")]
public string AMSNotifyParty { get; set; }
/// <summary>
/// 操作英文名称
/// </summary>
[Description("操作英文名称")]
public string OpEName { get; set; }
/// <summary>
/// 操作电话
/// </summary>
[Description("操作电话")]
public string OpTel { get; set; }
/// <summary>
/// 操作邮箱
/// </summary>
[Description("操作邮箱")]
public string OpEmail { get; set; }
/// <summary>
/// ACI HBL
/// </summary>
[Description("ACI HBL")]
public string ACIHBL { get; set; }
/// <summary>
/// S0C C0C
/// </summary>
[Description("S0C C0C")]
public string S0CC0C { get; set; }
/// <summary>
/// 商品名称
/// </summary>
[Description("商品名称")]
public string GoodsName { get; set; }
/// <summary>
/// Master Bol Indicator名称
/// </summary>
[Description("Master Bol Indicator名称")]
public string MasterBolIndicatorName { get; set; }
/// <summary>
/// 销售EDI名称
/// </summary>
[Description("销售EDI名称")]
public string SalerCodeName { get; set; }
/// <summary>
/// 欧盟港口、伊朗港口、KHI
/// </summary>
[Description("欧盟港口、伊朗港口、KHI")]
public string CKHI { get; set; }
/// <summary>
/// 南美东
/// </summary>
[Description("南美东")]
public string CNCM { get; set; }
/// <summary>
/// 巴西线的木质包装情况
/// </summary>
[Description("巴西线的木质包装情况")]
public string WNCM { get; set; }
/// <summary>
/// 订舱人说明
/// </summary>
[Description("订舱人说明")]
public string OrderRemark { get; set; }
}
}

@ -147,7 +147,8 @@ namespace Myshipping.Application
{
List<long> userlist = await _right.GetDataScopeList(351064299098181);
//List<long> userlist = await DataFilterExtensions.GetDataScopeIdList();
var entities = await _rep.AsQueryable().Where(x => x.ParentId == 0)
var entities = await _rep.AsQueryable().
WhereIF(string.IsNullOrWhiteSpace(input.HBLNO),x => x.ParentId == 0)
.WhereIF(!string.IsNullOrWhiteSpace(input.BSNO), u => u.BSNO.Contains(input.BSNO))
.WhereIF(!string.IsNullOrWhiteSpace(input.BSSTATUS), u => u.BSSTATUS == input.BSSTATUS)
.WhereIF(input.BBSDATE != null, u => u.BSDATE >= input.BBSDATE)
@ -3456,67 +3457,5 @@ namespace Myshipping.Application
}
}
#endregion
[HttpGet("/BookingOrder/test")]
public void test() {
var opt = App.GetOptions<TempFileOptions>();
var dirAbs = opt.Path;
var RemainHours = Convert.ToDouble(opt.RemainHours);
var fileFullPath = Path.Combine(App.WebHostEnvironment.WebRootPath, dirAbs);
string[] Files = Directory.GetFiles(fileFullPath); //当前目录下的文件:
foreach (string it in Files)
{
FileInfo fi = new FileInfo(it);
var date = fi.CreationTime.AddHours(RemainHours);
if (date < DateTime.Now)
{
File.Delete(it);
}
}
string[] _Files = Directory.GetDirectories(fileFullPath); //当前目录下的文件夹:
if (_Files.Length>0) {
foreach (string it in _Files)
{
//FileInfo fi = new FileInfo(it);
//var date = fi.CreationTime.AddHours(RemainHours);
//if (date < DateTime.Now)
//{
// File.Delete(it);
//}
test1( it);
}
}
}
public void test1(string path) {
var opt = App.GetOptions<TempFileOptions>();
var RemainHours = Convert.ToDouble(opt.RemainHours);
string[] Files = Directory.GetFiles(path); //当前目录下的文件:
foreach (string it in Files)
{
FileInfo fi = new FileInfo(it);
var date = fi.CreationTime.AddHours(RemainHours);
if (date < DateTime.Now)
{
File.Delete(it);
}
}
string[] _Files = Directory.GetDirectories(path); //当前目录下的文件夹:
if (_Files.Length>0) {
foreach (string it in _Files)
{
test1(it);
}
}
}
}
}

@ -129,6 +129,11 @@ namespace Myshipping.Application
public async Task<dynamic> GetFieldName()
{
BookingOrder order = new BookingOrder();
BookingCtn ctn = new BookingCtn();
BookingEDIExt ext = new BookingEDIExt();
List<Dictionary<string, string>> list = new List<Dictionary<string, string>>();
////bookingorder
Dictionary<string, string> dic = new Dictionary<string, string>();
foreach (PropertyDescriptor descriptor in TypeDescriptor.GetProperties(order))
{
@ -142,7 +147,41 @@ namespace Myshipping.Application
dic.Add(descriptor.Name, descriptor.Description);
}
}
return dic;
list.Add(dic);
Dictionary<string, string> dic1 = new Dictionary<string, string>();
foreach (PropertyDescriptor descriptor in TypeDescriptor.GetProperties(ctn))
{
string name = descriptor.Name;
if (name == "TenantId" || name == "CreatedTime" || name == "UpdatedTime" || name == "CreatedUserId" || name == "CreatedUserName")
{
continue;
}
if (!string.IsNullOrWhiteSpace(descriptor.Description))
{
dic1.Add(descriptor.Name, descriptor.Description);
}
}
list.Add(dic1);
Dictionary<string, string> dic2 = new Dictionary<string, string>();
foreach (PropertyDescriptor descriptor in TypeDescriptor.GetProperties(ext))
{
string name = descriptor.Name;
if (name == "TenantId" || name == "CreatedTime" || name == "UpdatedTime" || name == "CreatedUserId" || name == "CreatedUserName")
{
continue;
}
if (!string.IsNullOrWhiteSpace(descriptor.Description))
{
dic2.Add(descriptor.Name, descriptor.Description);
}
}
list.Add(dic2);
return list;
}
/// <summary>
@ -265,5 +304,9 @@ namespace Myshipping.Application
//var result = new FileStreamResult(new FileStream(Path.Combine(fileFullPath, fileName), FileMode.Open), "application/octet-stream") { FileDownloadName = fileName };
return fileName;
}
}
}

@ -81,4 +81,78 @@ namespace Myshipping.Application.Entity
/// </summary>
public string VoynoInside { get; set; }
}
public class DjyVesselInfoDto {
public virtual long Id { get; set; }
/// <summary>
/// 船名
/// </summary>
public string Vessel { get; set; }
/// <summary>
/// 航次
/// </summary>
public string Voyno { get; set; }
/// <summary>
/// 装货港
/// </summary>
public string PortLoading { get; set; }
/// <summary>
/// 中转港
/// </summary>
public string PortTransit { get; set; }
/// <summary>
/// 卸货港
/// </summary>
public string PortDischarge { get; set; }
/// <summary>
/// 装货港ID
/// </summary>
public string PortLoadingId { get; set; }
/// <summary>
/// 装货港ID
/// </summary>
public string PortTransitId { get; set; }
/// <summary>
/// 卸货港ID
/// </summary>
public string PortDischargeId { get; set; }
/// <summary>
/// 开船日期
/// </summary>
public DateTime? ETD { get; set; }
/// <summary>
/// 截港日期
/// </summary>
public DateTime? ClosingDate { get; set; }
/// <summary>
/// 预抵日期
/// </summary>
public DateTime? ETA { get; set; }
/// <summary>
/// 默认码头
/// </summary>
public string Wharf { get; set; }
/// <summary>
/// 实际离港日期
/// </summary>
public DateTime? ATD { get; set; }
/// <summary>
/// 船公司
/// </summary>
public string CARRIER { get; set; }
/// <summary>
/// 船公司ID
/// </summary>
public string CARRIERID { get; set; }
/// <summary>
/// 内部航次
/// </summary>
public string VoynoInside { get; set; }
}
}

@ -282,13 +282,18 @@ public class LogJobWorker : ISpareTimeWorker, IDynamicApiController, ITransient
{
foreach (string it in _Files)
{
DirectoryInfo fi = new DirectoryInfo(it);
var date = fi.CreationTime.AddHours(RemainHours);
if (date < DateTime.Now)
{
fi.Delete(true);
}
else {
TemporaryDirectories(it);
}
TemporaryDirectories(it);
}
}
}
@ -313,8 +318,11 @@ public class LogJobWorker : ISpareTimeWorker, IDynamicApiController, ITransient
{
TemporaryDirectories(it);
}
}
else
{
DirectoryInfo fi = new DirectoryInfo(path);
fi.Delete(true);
}
}
}

@ -10991,7 +10991,7 @@
<param name="Id"></param>
<returns></returns>
</member>
<member name="M:Myshipping.Core.Service.DjyVesselInfoService.AddOrUpdate(Myshipping.Application.Entity.DjyVesselInfo)">
<member name="M:Myshipping.Core.Service.DjyVesselInfoService.AddOrUpdate(Myshipping.Application.Entity.DjyVesselInfoDto)">
<summary>
新增编辑
</summary>
@ -17006,5 +17006,85 @@
内部航次
</summary>
</member>
<member name="P:Myshipping.Application.Entity.DjyVesselInfoDto.Vessel">
<summary>
船名
</summary>
</member>
<member name="P:Myshipping.Application.Entity.DjyVesselInfoDto.Voyno">
<summary>
航次
</summary>
</member>
<member name="P:Myshipping.Application.Entity.DjyVesselInfoDto.PortLoading">
<summary>
装货港
</summary>
</member>
<member name="P:Myshipping.Application.Entity.DjyVesselInfoDto.PortTransit">
<summary>
中转港
</summary>
</member>
<member name="P:Myshipping.Application.Entity.DjyVesselInfoDto.PortDischarge">
<summary>
卸货港
</summary>
</member>
<member name="P:Myshipping.Application.Entity.DjyVesselInfoDto.PortLoadingId">
<summary>
装货港ID
</summary>
</member>
<member name="P:Myshipping.Application.Entity.DjyVesselInfoDto.PortTransitId">
<summary>
装货港ID
</summary>
</member>
<member name="P:Myshipping.Application.Entity.DjyVesselInfoDto.PortDischargeId">
<summary>
卸货港ID
</summary>
</member>
<member name="P:Myshipping.Application.Entity.DjyVesselInfoDto.ETD">
<summary>
开船日期
</summary>
</member>
<member name="P:Myshipping.Application.Entity.DjyVesselInfoDto.ClosingDate">
<summary>
截港日期
</summary>
</member>
<member name="P:Myshipping.Application.Entity.DjyVesselInfoDto.ETA">
<summary>
预抵日期
</summary>
</member>
<member name="P:Myshipping.Application.Entity.DjyVesselInfoDto.Wharf">
<summary>
默认码头
</summary>
</member>
<member name="P:Myshipping.Application.Entity.DjyVesselInfoDto.ATD">
<summary>
实际离港日期
</summary>
</member>
<member name="P:Myshipping.Application.Entity.DjyVesselInfoDto.CARRIER">
<summary>
船公司
</summary>
</member>
<member name="P:Myshipping.Application.Entity.DjyVesselInfoDto.CARRIERID">
<summary>
船公司ID
</summary>
</member>
<member name="P:Myshipping.Application.Entity.DjyVesselInfoDto.VoynoInside">
<summary>
内部航次
</summary>
</member>
</members>
</doc>

@ -33,9 +33,13 @@ namespace Myshipping.Core.Service
/// <param name="KeyWord"></param>
/// <returns></returns>
[HttpGet("/DjyVesselInfoService/GetListPage")]
public async Task<dynamic> GetListPage([FromQuery] string KeyWord) {
public async Task<dynamic> GetListPage([FromQuery] string KeyWord)
{
return await _rep.AsQueryable().WhereIF(!string.IsNullOrWhiteSpace(KeyWord), x => x.Vessel.Contains(KeyWord)).ToListAsync();
return await _rep.AsQueryable().WhereIF(!string.IsNullOrWhiteSpace(KeyWord), x => x.Vessel.Contains(KeyWord)
|| x.CARRIER.Contains(KeyWord) || x.Voyno.Contains(KeyWord) || x.PortLoading.Contains(KeyWord) || x.PortTransit.Contains(KeyWord) ||
x.PortDischarge.Contains(KeyWord) || x.VoynoInside.Contains(KeyWord)
).ToListAsync();
}
/// <summary>
@ -59,7 +63,7 @@ namespace Myshipping.Core.Service
/// <param name="dto"></param>
/// <returns></returns>
[HttpPost("/DjyVesselInfoService/AddOrUpdate")]
public async Task<long> AddOrUpdate(DjyVesselInfo dto)
public async Task<long> AddOrUpdate(DjyVesselInfoDto dto)
{
if (dto == null)
{
@ -67,11 +71,15 @@ namespace Myshipping.Core.Service
}
if (dto.Id == 0)
{
await _rep.InsertAsync(dto);
var entity = dto.Adapt<DjyVesselInfo>();
await _rep.InsertAsync(entity);
}
else
{
await _rep.AsUpdateable(dto).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommandAsync();
var entity = dto.Adapt<DjyVesselInfo>();
await _rep.AsUpdateable(entity).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommandAsync();
}
return dto.Id;
}
@ -82,31 +90,33 @@ namespace Myshipping.Core.Service
/// </summary>
/// <returns></returns>
[HttpGet("/DjyVesselInfoService/GetList")]
public async Task<dynamic> GetList([FromQuery] string KeyWord, string CarrierID)
public async Task<dynamic> GetList([FromQuery] string CarrierID, string KeyWord = "")
{
//获取船名
List<CodeVessel> list = await _sysCacheService.GetAllCodeVessel();
var tlist = await _rep.AsQueryable().Where(x => x.Vessel.Contains(KeyWord) && x.CARRIERID == CarrierID&&x.ETD>DateTime.Now.AddDays(-7)).
Select(x=> new {
Voyno =x.Voyno,
VoynoInside =x.VoynoInside,
var tlist = await _rep.AsQueryable().WhereIF(!string.IsNullOrWhiteSpace(KeyWord), x => x.Vessel.Contains(KeyWord)).
Where(x=> x.CARRIERID == CarrierID && x.ETD > DateTime.Now.AddDays(-7)).
Select(x => new
{
Voyno = x.Voyno,
VoynoInside = x.VoynoInside,
Vessel = x.Vessel,
ETD =x.ETD,
ETD = x.ETD,
ATD = x.ATD,
}).Take(20).
ToListAsync();
if (tlist.Count() == 0)
{
return list.Where(x => x.Name.Contains(KeyWord)).Select(x => new
return list.WhereIF(!string.IsNullOrWhiteSpace(KeyWord), x => x.Name.Contains(KeyWord)).Select(x => new
{
Voyno = "",
VoynoInside="",
VoynoInside = "",
Vessel = x.Name,
ETD = "",
ATD="",
ATD = "",
}).Take(20).ToList();
}
else

@ -8,7 +8,7 @@ namespace Myshipping.Core.Service
{
public interface IDjyVesselInfoService
{
Task<long> AddOrUpdate(DjyVesselInfo dto);
Task<long> AddOrUpdate(DjyVesselInfoDto dto);
Task<dynamic> GetList(string KeyWord, string CarrierID);
}
}
Loading…
Cancel
Save