From 5c246fa57092bacd4499fd94c6505e57d0cd9a4a Mon Sep 17 00:00:00 2001 From: jianghaiqing Date: Wed, 11 Jan 2023 15:58:10 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=88=91=E7=9A=84=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1=E5=A2=9E=E5=8A=A0=E5=8F=91=E9=80=81=E4=B8=8B=E8=B4=A7?= =?UTF-8?q?=E7=BA=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Entity/TaskManagePlat/TaskBaseInfo.cs | 5 + .../TaskManagePlat/TaskManageDbEntity.cs | 18 +- .../Myshipping.Application.xml | 957 +++++++++++++++++- .../TaskManagePlat/Dtos/TaskBaseInfoDto.cs | 5 + .../Dtos/TaskBookingOrderCargoDto.cs | 44 + .../Dtos/TaskBookingOrderContaDto.cs | 102 ++ .../Dtos/TaskBookingOrderDto.cs | 666 ++++++++++++ .../TaskManagePlat/Dtos/TaskManageMapper.cs | 163 ++- .../Interface/ITaskManageService.cs | 2 +- .../TaskManagePlat/TaskManageService.cs | 270 ++++- 10 files changed, 2217 insertions(+), 15 deletions(-) create mode 100644 Myshipping.Application/Service/TaskManagePlat/Dtos/TaskBookingOrderCargoDto.cs create mode 100644 Myshipping.Application/Service/TaskManagePlat/Dtos/TaskBookingOrderContaDto.cs create mode 100644 Myshipping.Application/Service/TaskManagePlat/Dtos/TaskBookingOrderDto.cs diff --git a/Myshipping.Application/Entity/TaskManagePlat/TaskBaseInfo.cs b/Myshipping.Application/Entity/TaskManagePlat/TaskBaseInfo.cs index 9e883372..8f3c36d3 100644 --- a/Myshipping.Application/Entity/TaskManagePlat/TaskBaseInfo.cs +++ b/Myshipping.Application/Entity/TaskManagePlat/TaskBaseInfo.cs @@ -32,6 +32,11 @@ namespace Myshipping.Application.Entity /// public string STATUS { get; set; } + /// + /// 状态名称 Create-待处理;Retransmit-已转发;Complete-已完成;Cancel-已取消;Pending-已挂起 + /// + public string STATUS_NAME { get; set; } + /// /// 任务标题 /// diff --git a/Myshipping.Application/Entity/TaskManagePlat/TaskManageDbEntity.cs b/Myshipping.Application/Entity/TaskManagePlat/TaskManageDbEntity.cs index a454aa87..0ae23ef0 100644 --- a/Myshipping.Application/Entity/TaskManagePlat/TaskManageDbEntity.cs +++ b/Myshipping.Application/Entity/TaskManagePlat/TaskManageDbEntity.cs @@ -20,46 +20,46 @@ namespace Myshipping.Application.Entity /// /// 创建时间 /// - public virtual DateTime CreatedTime { get; set; } + public DateTime CreatedTime { get; set; } /// /// 修改时间 /// - public virtual DateTime? UpdatedTime { get; set; } + public DateTime? UpdatedTime { get; set; } /// /// 创建人ID /// - public virtual long CreatedUserId { get; set; } + public long CreatedUserId { get; set; } /// /// 创建人名称 /// - public virtual string CreatedUserName { get; set; } + public string CreatedUserName { get; set; } /// /// 修改人ID /// - public virtual long UpdatedUserId { get; set; } + public long UpdatedUserId { get; set; } /// /// 修改人名称 /// - public virtual string UpdatedUserName { get; set; } + public string UpdatedUserName { get; set; } /// /// 租户id /// - public virtual long? TenantId { get; set; } + public long? TenantId { get; set; } /// /// 租户名称 /// - public virtual string TenantName { get; set; } + public string TenantName { get; set; } /// /// 软删除 /// - public virtual bool IsDeleted { get; set; } = false; + public bool IsDeleted { get; set; } = false; } } diff --git a/Myshipping.Application/Myshipping.Application.xml b/Myshipping.Application/Myshipping.Application.xml index 807f39d4..46bc84df 100644 --- a/Myshipping.Application/Myshipping.Application.xml +++ b/Myshipping.Application/Myshipping.Application.xml @@ -3708,6 +3708,11 @@ 状态 Create-待处理;Retransmit-已转发;Complete-已完成;Cancel-已取消;Pending-已挂起 + + + 状态名称 Create-待处理;Retransmit-已转发;Complete-已完成;Cancel-已取消;Pending-已挂起 + + 任务标题 @@ -11242,7 +11247,7 @@ - + 获取打印模板权限 @@ -13876,6 +13881,11 @@ 状态 Create-待处理;Retransmit-已转发;Complete-已完成;Cancel-已取消;Pending-已挂起 + + + 状态名称 Create-待处理;Retransmit-已转发;Complete-已完成;Cancel-已取消;Pending-已挂起 + + 任务标题 @@ -13996,6 +14006,951 @@ 租户名称 + + + 件数 + + + + + 包装 + + + + + 毛重 + + + + + 尺码 + + + + + HS编码 + + + + + 唛头 + + + + + 货描 + + + + + 备注 + + + + + 箱型代码 + + + + + 箱型 + + + + + TEU + + + + + 箱号 + + + + + 封号 + + + + + 件数 + + + + + 包装 + + + + + 毛重 + + + + + 尺码 + + + + + 皮重 + + + + + 箱状态 + + + + + 称重方式 + + + + + 称重重量 + + + + + 称重联系人 + + + + + VGM联系公司 + + + + + VGM联系电话 + + + + + 称重日期 + + + + + VGM地址 + + + + + VGM邮箱 + + + + + 备注 + + + + + 大小箱分类(small-小箱 big-大箱) + + + + + 货物明细 + + + + + 订舱详情 + + + + + 主提单号 + + + + + 分提单号 + + + + + 订舱编号 + + + + + 合约号 + + + + + 客户合同号 + + + + + 发货人代码 + + + + + 收货人代码 + + + + + 通知人代码 + + + + + 发货人 + + + + + 收货人 + + + + + 通知人 + + + + + 第二通知人 + + + + + 场站代码 + + + + + 场站名称 + + + + + 船舶呼号 + + + + + 船名 + + + + + 海关航次 + + + + + 内部航次 + + + + + 开船日期 + + + + + 实际开船日期 + + + + + 预计到港日期 + + + + + 截港日期 + + + + + 截单日期 + + + + + 截VGM时间 + + + + + 收货地代码 + + + + + 收货地 + + + + + 起运港代码 + + + + + 起运港 + + + + + 卸货港代码 + + + + + 卸货港 + + + + + 交货地代码 + + + + + 交货地 + + + + + 目的地代码 + + + + + 目的地 + + + + + 提单份数 + + + + + 副本提单份数 + + + + + 签单方式 1-Seaway 2-正本 3-电放 + + + + + 签单日期 + + + + + 签单地点代码 + + + + + 签单地点 + + + + + 付费方式 + + + + + 预付地点 + + + + + 到付地点 + + + + + 运输条款 + + + + + 唛头 + + + + + HS代码 + + + + + 货描 + + + + + 件数 + + + + + 包装 + + + + + 毛重 + + + + + 尺码 + + + + + 件数大写 + + + + + 集装箱 + + + + + 船公司代号 + + + + + 船公司 + + + + + 货物标识 + + + + + 危险品类别 + + + + + 危险品编号 + + + + + 危险品页号 + + + + + 危险品标签 + + + + + 危险品联系人 + + + + + 温度单位 + + + + + 设置温度 + + + + + 通风度 + + + + + 湿度 + + + + + 最低温度 + + + + + 最高温度 + + + + + 是否SOC箱 + + + + + SO备注 + + + + + SI备注 + + + + + 场站备注 + + + + + 公司ID + + + + + 公司名称 + + + + + 发货人名称 + + + + + 发货人地址1 + + + + + 发货人地址2 + + + + + 发货人地址3 + + + + + 发货人城市 + + + + + 发货人省份代码 + + + + + 发货人邮编 + + + + + 发货人国家代码 + + + + + 发货人联系人 + + + + + 发货人电话 + + + + + 收货人名称 + + + + + 收货人地址1 + + + + + 收货人地址2 + + + + + 收货人地址3 + + + + + 收货人城市 + + + + + 收货人省份代码 + + + + + 收货人邮编 + + + + + 收货人国家代码 + + + + + 收货人联系人 + + + + + 收货人电话 + + + + + 通知人名称 + + + + + 通知人地址1 + + + + + 通知人地址2 + + + + + 通知人地址3 + + + + + 通知人城市 + + + + + 通知人省份代码 + + + + + 通知人邮编 + + + + + 通知人国家代码 + + + + + 通知人联系人 + + + + + 通知人电话 + + + + + PO号 + + + + + 操作id + + + + + 单证id + + + + + 操作 + + + + + 单证 + + + + + 销售ID + + + + + 销售 + + + + + 客服ID + + + + + 客服 + + + + + 客户 + + + + + 订舱代理 + + + + + 船代 + + + + + 报关行 + + + + + 车队 + + + + + 国外代理 + + + + + 客户ID + + + + + 订舱代理ID + + + + + 船代ID + + + + + 报关行ID + + + + + 车队ID + + + + + 国外代理名称 + + + + + 委托方 + + + + + 收货人DOOR地址 + + + + + 发货人DOOR地址 + + + + + SCAC代码 + + + + + ITN编号 + + + + + 预付地点ID + + + + + 到付地点ID + + + + + 客户系统编号 + + + + + 中转港代码 + + + + + 中转港 + + + + + 第三付款地 + + + + + 场站联系人电话 + + + + + 场站联系人邮箱 + + + + + 费用自结 + + + + + 航线代码 + + + + + 航线名称 + + + + + 付款方 + + + + + 发货人税号 + + + + + 收货人税号 + + + + + 通知人税号 + + + + + 是否船开后变更签单方式 1-是 0-否 + + + + + 是否条形中英文章 + + + + + 是否双Shipper + + + + + 是否整箱和拼箱混合 + + + + + 是否多品名 + + + + + 是否拼箱 + + + + + 卸货港国家代码 + + + + + 卸货港国家英文 + + + + + 卸货港国家中文 + + + + + 中转港国家代码 + + + + + 中转港国家英文 + + + + + 中转港国家中文 + + + + + 箱信息 + + + + + 任务详情 + + 费用明细 diff --git a/Myshipping.Application/Service/TaskManagePlat/Dtos/TaskBaseInfoDto.cs b/Myshipping.Application/Service/TaskManagePlat/Dtos/TaskBaseInfoDto.cs index 666cadc2..304099da 100644 --- a/Myshipping.Application/Service/TaskManagePlat/Dtos/TaskBaseInfoDto.cs +++ b/Myshipping.Application/Service/TaskManagePlat/Dtos/TaskBaseInfoDto.cs @@ -35,6 +35,11 @@ namespace Myshipping.Application /// public string Status { get; set; } + /// + /// 状态名称 Create-待处理;Retransmit-已转发;Complete-已完成;Cancel-已取消;Pending-已挂起 + /// + public string StatusName { get; set; } + /// /// 任务标题 /// diff --git a/Myshipping.Application/Service/TaskManagePlat/Dtos/TaskBookingOrderCargoDto.cs b/Myshipping.Application/Service/TaskManagePlat/Dtos/TaskBookingOrderCargoDto.cs new file mode 100644 index 00000000..b082e83a --- /dev/null +++ b/Myshipping.Application/Service/TaskManagePlat/Dtos/TaskBookingOrderCargoDto.cs @@ -0,0 +1,44 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Myshipping.Application +{ + public class TaskBookingOrderCargoDto + { + /// + /// 件数 + /// + public Nullable PKGs { get; set; } + /// + /// 包装 + /// + public string KindPKGs { get; set; } + /// + /// 毛重 + /// + public Nullable KGs { get; set; } + /// + /// 尺码 + /// + public Nullable CBM { get; set; } + /// + /// HS编码 + /// + public string HSCode { get; set; } + /// + /// 唛头 + /// + public string Marks { get; set; } + /// + /// 货描 + /// + public string Description { get; set; } + /// + /// 备注 + /// + public string Remark { get; set; } + } +} diff --git a/Myshipping.Application/Service/TaskManagePlat/Dtos/TaskBookingOrderContaDto.cs b/Myshipping.Application/Service/TaskManagePlat/Dtos/TaskBookingOrderContaDto.cs new file mode 100644 index 00000000..bedbb25e --- /dev/null +++ b/Myshipping.Application/Service/TaskManagePlat/Dtos/TaskBookingOrderContaDto.cs @@ -0,0 +1,102 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Myshipping.Application +{ + public class TaskBookingOrderContaDto + { + /// + /// 箱型代码 + /// + public string ContaType { get; set; } + /// + /// 箱型 + /// + public string ContaTypeName { get; set; } + /// + /// TEU + /// + public Nullable TEU { get; set; } + /// + /// 箱号 + /// + public string ContaNo { get; set; } + /// + /// 封号 + /// + public string SealNo { get; set; } + /// + /// 件数 + /// + public Nullable PKGs { get; set; } + /// + /// 包装 + /// + public string KindPKGs { get; set; } + /// + /// 毛重 + /// + public Nullable KGs { get; set; } + /// + /// 尺码 + /// + public Nullable CBM { get; set; } + /// + /// 皮重 + /// + public Nullable TareWeight { get; set; } + /// + /// 箱状态 + /// + public string ContaStatus { get; set; } + /// + /// 称重方式 + /// + public string WeighType { get; set; } + /// + /// 称重重量 + /// + public Nullable WeighKGs { get; set; } + /// + /// 称重联系人 + /// + public string WeighAttn { get; set; } + /// + /// VGM联系公司 + /// + public string VGMConnCom { get; set; } + /// + /// VGM联系电话 + /// + public string WeighTel { get; set; } + /// + /// 称重日期 + /// + public string WeighDate { get; set; } + /// + /// VGM地址 + /// + public string VGMAddr { get; set; } + /// + /// VGM邮箱 + /// + public string VGMEmail { get; set; } + /// + /// 备注 + /// + public string Remark { get; set; } + + /// + /// 大小箱分类(small-小箱 big-大箱) + /// + public string ContaCategory { get; set; } + + /// + /// 货物明细 + /// + public List CargoList { get; set; } + } +} diff --git a/Myshipping.Application/Service/TaskManagePlat/Dtos/TaskBookingOrderDto.cs b/Myshipping.Application/Service/TaskManagePlat/Dtos/TaskBookingOrderDto.cs new file mode 100644 index 00000000..6392da86 --- /dev/null +++ b/Myshipping.Application/Service/TaskManagePlat/Dtos/TaskBookingOrderDto.cs @@ -0,0 +1,666 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Myshipping.Application +{ + /// + /// 订舱详情 + /// + public class TaskBookingOrderDto + { + /// + /// 主提单号 + /// + public string MasterBlNo { get; set; } + /// + /// 分提单号 + /// + public string HouseBlNo { get; set; } + /// + /// 订舱编号 + /// + public string BookingNo { get; set; } + /// + /// 合约号 + /// + public string ContrNo { get; set; } + /// + /// 客户合同号 + /// + public string ServContrNo { get; set; } + + /// + /// 发货人代码 + /// + public string ShipperId { get; set; } + /// + /// 收货人代码 + /// + public string ConsigneeId { get; set; } + /// + /// 通知人代码 + /// + public string NotifyPartyId { get; set; } + /// + /// 发货人 + /// + public string Shipper { get; set; } + /// + /// 收货人 + /// + public string Consignee { get; set; } + /// + /// 通知人 + /// + public string NotifyParty { get; set; } + /// + /// 第二通知人 + /// + public string NotifyPrt2 { get; set; } + /// + /// 场站代码 + /// + public string YardId { get; set; } + /// + /// 场站名称 + /// + public string Yard { get; set; } + /// + /// 船舶呼号 + /// + public string VesselId { get; set; } + /// + /// 船名 + /// + public string Vessel { get; set; } + /// + /// 海关航次 + /// + public string Voyno { get; set; } + /// + /// 内部航次 + /// + public string VoynoIn { get; set; } + /// + /// 开船日期 + /// + public string ETD { get; set; } + /// + /// 实际开船日期 + /// + public string ATD { get; set; } + /// + /// 预计到港日期 + /// + public string ETA { get; set; } + /// + /// 截港日期 + /// + public string ClosingDate { get; set; } + /// + /// 截单日期 + /// + public string CloseDocDate { get; set; } + /// + /// 截VGM时间 + /// + public string CloseVGMDate { get; set; } + /// + /// 收货地代码 + /// + public string PlaceReceiptId { get; set; } + /// + /// 收货地 + /// + public string PlaceReceipt { get; set; } + /// + /// 起运港代码 + /// + public string PortLoadId { get; set; } + /// + /// 起运港 + /// + public string PortLoad { get; set; } + /// + /// 卸货港代码 + /// + public string PortDischargeId { get; set; } + /// + /// 卸货港 + /// + public string PortDischarge { get; set; } + /// + /// 交货地代码 + /// + public string PlaceDeliveryId { get; set; } + /// + /// 交货地 + /// + public string PlaceDelivery { get; set; } + /// + /// 目的地代码 + /// + public string DestinationId { get; set; } + /// + /// 目的地 + /// + public string Destination { get; set; } + /// + /// 提单份数 + /// + public string NoBill { get; set; } + /// + /// 副本提单份数 + /// + public string CopyNoBill { get; set; } + /// + /// 签单方式 1-Seaway 2-正本 3-电放 + /// + public string IssueType { get; set; } + /// + /// 签单日期 + /// + public string IssueDate { get; set; } + /// + /// 签单地点代码 + /// + public string IssuePlaceId { get; set; } + /// + /// 签单地点 + /// + public string IssuePlace { get; set; } + /// + /// 付费方式 + /// + public string Blfrt { get; set; } + /// + /// 预付地点 + /// + public string PrepardAt { get; set; } + /// + /// 到付地点 + /// + public string PayableAt { get; set; } + /// + /// 运输条款 + /// + public string Service { get; set; } + + /// + /// 唛头 + /// + public string Marks { get; set; } + /// + /// HS代码 + /// + public string HsCode { get; set; } + /// + /// 货描 + /// + public string GoodsDescription { get; set; } + /// + /// 件数 + /// + public Nullable PKGs { get; set; } + /// + /// 包装 + /// + public string KindPKGs { get; set; } + /// + /// 毛重 + /// + public Nullable KGs { get; set; } + /// + /// 尺码 + /// + public Nullable CBM { get; set; } + /// + /// 件数大写 + /// + public string TotalNO { get; set; } + /// + /// 集装箱 + /// + public string CntrTotal { get; set; } + /// + /// 船公司代号 + /// + public string CarrierId { get; set; } + /// + /// 船公司 + /// + public string Carrier { get; set; } + /// + /// 货物标识 + /// + public string CargoId { get; set; } + /// + /// 危险品类别 + /// + public string DClass { get; set; } + /// + /// 危险品编号 + /// + public string DUnno { get; set; } + /// + /// 危险品页号 + /// + public string DPage { get; set; } + /// + /// 危险品标签 + /// + public string DLabel { get; set; } + /// + /// 危险品联系人 + /// + public string DLinkMan { get; set; } + /// + /// 温度单位 + /// + public string TempId { get; set; } + /// + /// 设置温度 + /// + public string TempSet { get; set; } + /// + /// 通风度 + /// + public string Reeferf { get; set; } + /// + /// 湿度 + /// + public string Humidity { get; set; } + /// + /// 最低温度 + /// + public string TempMin { get; set; } + /// + /// 最高温度 + /// + public string TempMax { get; set; } + /// + /// 是否SOC箱 + /// + public Nullable IsContaSOC { get; set; } + /// + /// SO备注 + /// + public string SORemark { get; set; } + /// + /// SI备注 + /// + public string SIRemark { get; set; } + /// + /// 场站备注 + /// + public string YardRemark { get; set; } + /// + /// 公司ID + /// + public string CompId { get; set; } + /// + /// 公司名称 + /// + public string CompName { get; set; } + /// + /// 发货人名称 + /// + public string ShipperName { get; set; } + /// + /// 发货人地址1 + /// + public string ShipperAddr1 { get; set; } + /// + /// 发货人地址2 + /// + public string ShipperAddr2 { get; set; } + /// + /// 发货人地址3 + /// + public string ShipperAddr3 { get; set; } + /// + /// 发货人城市 + /// + public string ShipperCity { get; set; } + /// + /// 发货人省份代码 + /// + public string ShipperProvice { get; set; } + /// + /// 发货人邮编 + /// + public string ShipperPostCode { get; set; } + /// + /// 发货人国家代码 + /// + public string ShipperCountry { get; set; } + /// + /// 发货人联系人 + /// + public string ShipperAttn { get; set; } + /// + /// 发货人电话 + /// + public string ShipperTel { get; set; } + /// + /// 收货人名称 + /// + public string ConsigneeName { get; set; } + /// + /// 收货人地址1 + /// + public string ConsigneeAddr1 { get; set; } + /// + /// 收货人地址2 + /// + public string ConsigneeAddr2 { get; set; } + /// + /// 收货人地址3 + /// + public string ConsigneeAddr3 { get; set; } + /// + /// 收货人城市 + /// + public string ConsigneeCity { get; set; } + /// + /// 收货人省份代码 + /// + public string ConsigneeProvince { get; set; } + /// + /// 收货人邮编 + /// + public string ConsigneePostCode { get; set; } + /// + /// 收货人国家代码 + /// + public string ConsigneeCountry { get; set; } + /// + /// 收货人联系人 + /// + public string ConsigneeAttn { get; set; } + /// + /// 收货人电话 + /// + public string ConsigneeTel { get; set; } + /// + /// 通知人名称 + /// + public string NotifyPartyName { get; set; } + /// + /// 通知人地址1 + /// + public string NotifyPartyAddr1 { get; set; } + /// + /// 通知人地址2 + /// + public string NotifyPartyAddr2 { get; set; } + /// + /// 通知人地址3 + /// + public string NotifyPartyAddr3 { get; set; } + /// + /// 通知人城市 + /// + public string NotifyPartyCity { get; set; } + /// + /// 通知人省份代码 + /// + public string NotifyPartyProvince { get; set; } + /// + /// 通知人邮编 + /// + public string NotifyPartyPostCode { get; set; } + /// + /// 通知人国家代码 + /// + public string NotifyPartyCountry { get; set; } + /// + /// 通知人联系人 + /// + public string NotifyPartyAttn { get; set; } + /// + /// 通知人电话 + /// + public string NotifyPartyTel { get; set; } + /// + /// PO号 + /// + public string PONo { get; set; } + /// + /// 操作id + /// + public string OPID { get; set; } + /// + /// 单证id + /// + public string DOCID { get; set; } + /// + /// 操作 + /// + public string OP { get; set; } + /// + /// 单证 + /// + public string Doc { get; set; } + /// + /// 销售ID + /// + public string SaleId { get; set; } + /// + /// 销售 + /// + public string Sale { get; set; } + /// + /// 客服ID + /// + public string CustserviceId { get; set; } + /// + /// 客服 + /// + public string Custservice { get; set; } + /// + /// 客户 + /// + public string CustserviceName { get; set; } + /// + /// 订舱代理 + /// + public string Forwarder { get; set; } + /// + /// 船代 + /// + public string ShipAgency { get; set; } + /// + /// 报关行 + /// + public string CustomsER { get; set; } + /// + /// 车队 + /// + public string TruckER { get; set; } + /// + /// 国外代理 + /// + public string AgentId { get; set; } + /// + /// 客户ID + /// + public Nullable CustomerId { get; set; } + /// + /// 订舱代理ID + /// + public string ForwarderId { get; set; } + /// + /// 船代ID + /// + public string ShipAgencyId { get; set; } + /// + /// 报关行ID + /// + public string CustomsERId { get; set; } + /// + /// 车队ID + /// + public string TruckERId { get; set; } + /// + /// 国外代理名称 + /// + public string AgentName { get; set; } + /// + /// 委托方 + /// + public string WeiTo { get; set; } + /// + /// 收货人DOOR地址 + /// + public string ConsigneeDoorAddr { get; set; } + /// + /// 发货人DOOR地址 + /// + public string ShipperDoorAddr { get; set; } + /// + /// SCAC代码 + /// + public string SCACCode { get; set; } + /// + /// ITN编号 + /// + public string ITNCode { get; set; } + /// + /// 预付地点ID + /// + public string PrePardAtId { get; set; } + /// + /// 到付地点ID + /// + public string PayableAtId { get; set; } + /// + /// 客户系统编号 + /// + public string CustNo { get; set; } + /// + /// 中转港代码 + /// + public string TransportId { get; set; } + /// + /// 中转港 + /// + public string Transport { get; set; } + /// + /// 第三付款地 + /// + public string ThirdPayAddr { get; set; } + /// + /// 场站联系人电话 + /// + public string YardContractTel { get; set; } + /// + /// 场站联系人邮箱 + /// + public string YardContractEmail { get; set; } + /// + /// 费用自结 + /// + public Nullable FeeSelf { get; set; } + /// + /// 航线代码 + /// + public string LaneCode { get; set; } + /// + /// 航线名称 + /// + public string LaneName { get; set; } + /// + /// 付款方 + /// + public string FreightPayer { get; set; } + + /// + /// 发货人税号 + /// + public string ShipperTaxNo { get; set; } + + /// + /// 收货人税号 + /// + public string ConsigneeTaxNo { get; set; } + + /// + /// 通知人税号 + /// + public string NotifyPartyTaxNo { get; set; } + + /// + /// 是否船开后变更签单方式 1-是 0-否 + /// + public Nullable IsATDChangeIssueType { get; set; } + + /// + /// 是否条形中英文章 + /// + public Nullable IsEngChinaLineBar { get; set; } + + /// + /// 是否双Shipper + /// + public Nullable IsDoubleShipper { get; set; } + + /// + /// 是否整箱和拼箱混合 + /// + public Nullable IsFCLAndLCLMix { get; set; } + + /// + /// 是否多品名 + /// + public Nullable IsMutipleGoods { get; set; } + + /// + /// 是否拼箱 + /// + public Nullable IsContaLCL { get; set; } + + /// + /// 卸货港国家代码 + /// + public string PortDischargeCountryNo { get; set; } + + /// + /// 卸货港国家英文 + /// + public string PortDischargeEN { get; set; } + + /// + /// 卸货港国家中文 + /// + public string PortDischargeCN { get; set; } + + /// + /// 中转港国家代码 + /// + public string TransportCountryNo { get; set; } + + /// + /// 中转港国家英文 + /// + public string TransportEN { get; set; } + + /// + /// 中转港国家中文 + /// + public string TransportCN { get; set; } + + /// + /// 箱信息 + /// + public List ContaList { get; set; } + + /// + /// 任务详情 + /// + public TaskBaseInfoDto TaskBaseInfo { get; set; } + } +} diff --git a/Myshipping.Application/Service/TaskManagePlat/Dtos/TaskManageMapper.cs b/Myshipping.Application/Service/TaskManagePlat/Dtos/TaskManageMapper.cs index 9b8a46c5..9fdb9ae6 100644 --- a/Myshipping.Application/Service/TaskManagePlat/Dtos/TaskManageMapper.cs +++ b/Myshipping.Application/Service/TaskManagePlat/Dtos/TaskManageMapper.cs @@ -80,6 +80,7 @@ namespace Myshipping.Application .Map(dest => dest.TaskType, src => src.TASK_TYPE) .Map(dest => dest.TaskSource, src => src.TASK_SOURCE) .Map(dest => dest.Status, src => src.STATUS) + .Map(dest => dest.StatusName, src => src.STATUS_NAME) .Map(dest => dest.TaskTitle, src => src.TASK_TITLE) .Map(dest => dest.TaskDesp, src => src.TASK_DESP) .Map(dest => dest.OutBusiNo, src => src.OUT_BUSI_NO) @@ -107,7 +108,6 @@ namespace Myshipping.Application .Map(dest => dest.TASK_NO, src => src.TaskNo) .Map(dest => dest.TASK_TYPE, src => src.TaskType) .Map(dest => dest.TASK_SOURCE, src => src.TaskSource) - .Map(dest => dest.STATUS, src => src.Status) .Map(dest => dest.TASK_TITLE, src => src.TaskTitle) .Map(dest => dest.TASK_DESP, src => src.TaskDesp) .Map(dest => dest.OUT_BUSI_NO, src => src.OutBusiNo) @@ -129,6 +129,167 @@ namespace Myshipping.Application .Map(dest => dest.CreatedUserName, src => src.CreatedUserName) .Map(dest => dest.UpdatedUserId, src => src.UpdatedUserId) .Map(dest => dest.UpdatedUserName, src => src.UpdatedUserName); + + + config.ForType() + .Map(dest => dest.MasterBlNo, src => src.MBLNO) + .Map(dest => dest.HouseBlNo, src => src.HBLNO) + .Map(dest => dest.BookingNo, src => src.BOOKINGNO) + .Map(dest => dest.ContrNo, src => src.CONTRACTNO) + .Map(dest => dest.ServContrNo, src => src.SERVICECONTRACTNO) + .Map(dest => dest.ShipperId, src => src.SHIPPERID) + .Map(dest => dest.ConsigneeId, src => src.CONSIGNEEID) + .Map(dest => dest.NotifyPartyId, src => src.NOTIFYPARTYID) + .Map(dest => dest.Shipper, src => src.SHIPPER) + .Map(dest => dest.Consignee, src => src.CONSIGNEE) + .Map(dest => dest.NotifyParty, src => src.NOTIFYPARTY) + .Map(dest => dest.NotifyPrt2, src => src.NOTIFYPARTY2) + .Map(dest => dest.YardId, src => src.YARDID) + .Map(dest => dest.Yard, src => src.YARD) + .Map(dest => dest.VesselId, src => src.VESSELID) + .Map(dest => dest.Vessel, src => src.VESSEL) + .Map(dest => dest.Voyno, src => src.VOYNO) + .Map(dest => dest.VoynoIn, src => src.VOYNOINNER) + .Map(dest => dest.ETD, src => src.ETD) + .Map(dest => dest.ATD, src => src.ATD) + .Map(dest => dest.ETA, src => src.ETA) + .Map(dest => dest.ClosingDate, src => src.CLOSINGDATE.HasValue ? src.CLOSINGDATE.Value.ToString("yyyy-MM-dd HH:mm:ss") : "") + .Map(dest => dest.CloseDocDate, src => src.CLOSEDOCDATE.HasValue ? src.CLOSEDOCDATE.Value.ToString("yyyy-MM-dd HH:mm:ss") : "") + .Map(dest => dest.CloseVGMDate, src => src.CLOSEVGMDATE.HasValue ? src.CLOSEVGMDATE.Value.ToString("yyyy-MM-dd HH:mm:ss") : "") + .Map(dest => dest.PlaceReceiptId, src => src.PLACERECEIPTID) + .Map(dest => dest.PlaceReceipt, src => src.PLACERECEIPT) + .Map(dest => dest.PortLoadId, src => src.PORTLOAD) + .Map(dest => dest.PortLoad, src => src.PORTLOAD) + .Map(dest => dest.PortDischargeId, src => src.PORTDISCHARGEID) + .Map(dest => dest.PortDischarge, src => src.PORTDISCHARGE) + .Map(dest => dest.PlaceDeliveryId, src => src.PLACEDELIVERYID) + .Map(dest => dest.PlaceDelivery, src => src.PLACEDELIVERY) + .Map(dest => dest.DestinationId, src => src.DESTINATIONID) + .Map(dest => dest.Destination, src => src.DESTINATION) + .Map(dest => dest.NoBill, src => src.NOBILL) + .Map(dest => dest.CopyNoBill, src => src.COPYNOBILL) + .Map(dest => dest.IssueType, src => src.ISSUETYPE) + .Map(dest => dest.IssueDate, src => src.ISSUEDATE.HasValue ? src.ISSUEDATE.Value.ToString("yyyy-MM-dd HH:mm:ss") : "") + .Map(dest => dest.IssuePlaceId, src => src.ISSUEPLACEID) + .Map(dest => dest.IssuePlace, src => src.ISSUEPLACE) + .Map(dest => dest.Blfrt, src => src.BLFRT) + .Map(dest => dest.PrepardAt, src => src.PREPARDAT) + .Map(dest => dest.PayableAt, src => src.PAYABLEAT) + .Map(dest => dest.Service, src => src.SERVICE) + .Map(dest => dest.Marks, src => src.MARKS) + .Map(dest => dest.HsCode, src => src.HSCODE) + .Map(dest => dest.GoodsDescription, src => src.DESCRIPTION) + .Map(dest => dest.PKGs, src => src.PKGS) + .Map(dest => dest.KindPKGs, src => src.KINDPKGS) + .Map(dest => dest.KGs, src => src.KGS) + .Map(dest => dest.CBM, src => src.CBM) + .Map(dest => dest.TotalNO, src => src.TOTALNO) + .Map(dest => dest.CntrTotal, src => src.CNTRTOTAL) + .Map(dest => dest.CarrierId, src => src.CARRIERID) + .Map(dest => dest.Carrier, src => src.CARRIER) + .Map(dest => dest.CargoId, src => src.CARGOID) + .Map(dest => dest.DClass, src => src.DCLASS) + .Map(dest => dest.DUnno, src => src.DUNNO) + .Map(dest => dest.DPage, src => src.DPAGE) + .Map(dest => dest.DLabel, src => src.DLABEL) + .Map(dest => dest.DLinkMan, src => src.LINKMAN) + .Map(dest => dest.TempId, src => src.TEMPID) + .Map(dest => dest.TempSet, src => src.TEMPSET) + .Map(dest => dest.Reeferf, src => src.REEFERF) + .Map(dest => dest.Humidity, src => src.HUMIDITY) + .Map(dest => dest.TempMin, src => src.TEMPMIN) + .Map(dest => dest.TempMax, src => src.TEMPMAX) + .Map(dest => dest.IsContaSOC, src => src.ISCONTAINERSOC) + .Map(dest => dest.SORemark, src => src.SOREMARK) + .Map(dest => dest.SIRemark, src => src.SIREMARK) + .Map(dest => dest.YardRemark, src => src.YARDREMARK) + .Map(dest => dest.ShipperName, src => src.SHIPPERNAME) + .Map(dest => dest.ShipperAddr1, src => src.SHIPPERADDR1) + .Map(dest => dest.ShipperAddr2, src => src.SHIPPERADDR2) + .Map(dest => dest.ShipperAddr3, src => src.SHIPPERADDR3) + .Map(dest => dest.ShipperCity, src => src.SHIPPERCITY) + .Map(dest => dest.ShipperProvice, src => src.SHIPPERPROVINCE) + .Map(dest => dest.ShipperPostCode, src => src.SHIPPERPOSTCODE) + .Map(dest => dest.ShipperCountry, src => src.SHIPPERCOUNTRY) + .Map(dest => dest.ShipperAttn, src => src.SHIPPERATTN) + .Map(dest => dest.ShipperTel, src => src.SHIPPERTEL) + .Map(dest => dest.ConsigneeName, src => src.CONSIGNEENAME) + .Map(dest => dest.ConsigneeAddr1, src => src.CONSIGNEEADDR1) + .Map(dest => dest.ConsigneeAddr2, src => src.CONSIGNEEADDR2) + .Map(dest => dest.ConsigneeAddr3, src => src.CONSIGNEEADDR3) + .Map(dest => dest.ConsigneeCity, src => src.CONSIGNEECITY) + .Map(dest => dest.ConsigneeProvince, src => src.CONSIGNEEPROVINCE) + .Map(dest => dest.ConsigneePostCode, src => src.CONSIGNEEPOSTCODE) + .Map(dest => dest.ConsigneeCountry, src => src.CONSIGNEERCOUNTRY) + .Map(dest => dest.ConsigneeAttn, src => src.CONSIGNEEATTN) + .Map(dest => dest.ConsigneeTel, src => src.CONSIGNEETEL) + .Map(dest => dest.NotifyPartyName, src => src.NOTIFYPARTYNAME) + .Map(dest => dest.NotifyPartyAddr1, src => src.NOTIFYPARTYADDR1) + .Map(dest => dest.NotifyPartyAddr2, src => src.NOTIFYPARTYADDR2) + .Map(dest => dest.NotifyPartyAddr3, src => src.NOTIFYPARTYADDR3) + .Map(dest => dest.NotifyPartyCity, src => src.NOTIFYPARTYCITY) + .Map(dest => dest.NotifyPartyProvince, src => src.NOTIFYPARTYPROVINCE) + .Map(dest => dest.NotifyPartyPostCode, src => src.NOTIFYPARTYPOSTCODE) + .Map(dest => dest.NotifyPartyCountry, src => src.NOTIFYPARTYCOUNTRY) + .Map(dest => dest.NotifyPartyAttn, src => src.NOTIFYPARTYATTN) + .Map(dest => dest.NotifyPartyTel, src => src.NOTIFYPARTYTEL) + .Map(dest => dest.CustomsER, src => src.CUSTOMSER) + .Map(dest => dest.TruckER, src => src.TRUCKER) + .Map(dest => dest.AgentId, src => src.AGENTID) + .Map(dest => dest.ForwarderId, src => src.FORWARDERID) + .Map(dest => dest.ShipAgencyId, src => src.SHIPAGENCYID) + .Map(dest => dest.CustomsERId, src => src.CUSTOMSERID) + .Map(dest => dest.TruckERId, src => src.TRUCKERID) + .Map(dest => dest.AgentName, src => src.AGENTNAME) + .Map(dest => dest.ConsigneeDoorAddr, src => src.CONSIGNEEDOORADDR) + .Map(dest => dest.ShipperDoorAddr, src => src.SHIPPERDOORADDR) + .Map(dest => dest.SCACCode, src => src.SCACCODE) + .Map(dest => dest.ITNCode, src => src.ITNCODE) + .Map(dest => dest.PrePardAtId, src => src.PREPARDATID) + .Map(dest => dest.PayableAtId, src => src.PAYABLEATID) + .Map(dest => dest.CustNo, src => src.CUSTNO) + .Map(dest => dest.TransportId, src => src.TRANSPORTID) + .Map(dest => dest.Transport, src => src.TRANSPORT) + .Map(dest => dest.ThirdPayAddr, src => src.THIRDPAYADDR) + .Map(dest => dest.YardContractTel, src => src.YARDCONTRACTTEL) + .Map(dest => dest.YardContractEmail, src => src.YARDCONTRACTEMAIL) + .Map(dest => dest.FeeSelf, src => src.FEESELF) + .Map(dest => dest.LaneCode, src => src.LANECODE) + .Map(dest => dest.LaneName, src => src.LANENAME) + .Map(dest => dest.FreightPayer, src => src.FREIGHTPAYER); + + config.ForType() + .Map(dest => dest.ContaType, src => src.CTNCODE) + .Map(dest => dest.ContaTypeName, src => src.CTNALL) + .Map(dest => dest.TEU, src => src.TEU) + .Map(dest => dest.ContaNo, src => src.CNTRNO) + .Map(dest => dest.SealNo, src => src.SEALNO) + .Map(dest => dest.PKGs, src => src.PKGS) + .Map(dest => dest.KindPKGs, src => src.KINDPKGS) + .Map(dest => dest.KGs, src => src.KGS) + .Map(dest => dest.CBM, src => src.CBM) + .Map(dest => dest.TareWeight, src => src.TAREWEIGHT) + .Map(dest => dest.ContaStatus, src => src.CTNSTATUS) + .Map(dest => dest.WeighType, src => src.WEIGHTYPE) + .Map(dest => dest.WeighKGs, src => src.WEIGHKGS) + .Map(dest => dest.WeighAttn, src => src.WEIGHATTN) + .Map(dest => dest.VGMConnCom, src => src.VGMCONNCOM) + .Map(dest => dest.WeighTel, src => src.WEIGHTEL) + .Map(dest => dest.WeighDate, src => src.WEIGHDATE) + .Map(dest => dest.VGMAddr, src => src.VGMADDR) + .Map(dest => dest.VGMEmail, src => src.VGMEMAIL) + .Map(dest => dest.Remark, src => src.REMARK); + + + config.ForType() + .Map(dest => dest.PKGs, src => src.PKGS) + .Map(dest => dest.KindPKGs, src => src.KINDPKGS) + .Map(dest => dest.KGs, src => src.KGS) + .Map(dest => dest.CBM, src => src.CBM) + .Map(dest => dest.HSCode, src => src.HSCODE) + .Map(dest => dest.Marks, src => src.MARKS) + .Map(dest => dest.Description, src => src.DESCRIPTION) + .Map(dest => dest.Remark, src => src.REMARK); } } } diff --git a/Myshipping.Application/Service/TaskManagePlat/Interface/ITaskManageService.cs b/Myshipping.Application/Service/TaskManagePlat/Interface/ITaskManageService.cs index bca74f42..7cccc785 100644 --- a/Myshipping.Application/Service/TaskManagePlat/Interface/ITaskManageService.cs +++ b/Myshipping.Application/Service/TaskManagePlat/Interface/ITaskManageService.cs @@ -147,7 +147,7 @@ namespace Myshipping.Application /// /// 任务主键 /// 返回结果 - Task GetBookingOrderInfo(string taskPKId); + Task GetBookingOrderInfo(string taskPKId); } diff --git a/Myshipping.Application/Service/TaskManagePlat/TaskManageService.cs b/Myshipping.Application/Service/TaskManagePlat/TaskManageService.cs index ee8368e1..7fe94a40 100644 --- a/Myshipping.Application/Service/TaskManagePlat/TaskManageService.cs +++ b/Myshipping.Application/Service/TaskManagePlat/TaskManageService.cs @@ -12,15 +12,18 @@ using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.RazorPages; using Microsoft.CodeAnalysis.CSharp.Syntax; using Microsoft.Extensions.Logging; +using Myshipping.Application.EDI; using Myshipping.Application.Entity; using Myshipping.Application.Helper; using Myshipping.Core; using Myshipping.Core.Entity; using Myshipping.Core.Service; using MySqlX.XDevAPI.Common; +using Newtonsoft.Json; using Newtonsoft.Json.Linq; using NPOI.HPSF; using NPOI.SS.Formula.Functions; +using NPOI.XSSF.Model; using Org.BouncyCastle.Asn1.X500; using SixLabors.ImageSharp.Processing.Processors.Transforms; using SqlSugar; @@ -62,11 +65,15 @@ namespace Myshipping.Application private readonly SqlSugarRepository _taskLARAPaperInfoRepository; private readonly SqlSugarRepository _bookingOrderRepository; + private readonly SqlSugarRepository _bookingOrderContaRepository; + private readonly SqlSugarRepository _bookingOrderContaCargoRepository; + private readonly SqlSugarRepository _bookingStatusRepository; private readonly IDjyWebsiteAccountConfigService _webAccountConfig; private readonly ISysCacheService _cache; private readonly ILogger _logger; + const string CONST_WEB_ACCOUNT_TYPE = "CmaWeb"; const string CONST_BOOK_ORIGINAL_DOWN_URL_CODE = "bookOriginalDownUrl"; @@ -86,6 +93,9 @@ namespace Myshipping.Application SqlSugarRepository taskChargesHisInfoRepository, SqlSugarRepository bookingOrderRepository, SqlSugarRepository taskLARAPaperInfoRepository, + SqlSugarRepository bookingOrderContaRepository, + SqlSugarRepository bookingOrderContaCargoRepository, + SqlSugarRepository bookingStatusRepository, IDjyWebsiteAccountConfigService webAccountConfig, ISysCacheService cache, ILogger logger) @@ -103,6 +113,9 @@ namespace Myshipping.Application _taskChargesHisInfoRepository = taskChargesHisInfoRepository; _bookingOrderRepository = bookingOrderRepository; _taskLARAPaperInfoRepository = taskLARAPaperInfoRepository; + _bookingOrderContaRepository = bookingOrderContaRepository; + _bookingOrderContaCargoRepository = bookingOrderContaCargoRepository; + _bookingStatusRepository = bookingStatusRepository; _webAccountConfig = webAccountConfig; _cache = cache; @@ -1774,19 +1787,270 @@ namespace Myshipping.Application { TaskManageOrderResultDto result = new TaskManageOrderResultDto(); + string batchNo = IDGen.NextID().ToString(); + + /* + 1、查询任务关联的订舱信息。 + 2、触发下货纸发送。 + 3、发送成功更新任务状态为成功。 + 4、查看用户公司是否配置了反馈地址,如果有配置则触发反馈推送,否则显示反馈失败提示。 + 5、触发扣费 + */ + try + { + var taskInfo = _taskBaseInfoRepository.AsQueryable().First(t => t.PK_ID == taskPKId); + + if (taskInfo == null) + Oops.Oh($"任务信息获取失败"); + + if(taskInfo.TASK_TYPE != TaskBusiTypeEnum.SHIPPING_ORDER.ToString()) + Oops.Oh($"当前任务类型不是{TaskBusiTypeEnum.SHIPPING_ORDER.GetDescription()},不能发送下货纸"); + + if (string.IsNullOrWhiteSpace(taskInfo.BOOK_ORDER_NO)) + Oops.Oh($"任务信息的订舱主键不存在"); + + var orderInfo = _bookingOrderRepository.AsQueryable() + .First(t => t.Id == long.Parse(taskInfo.BOOK_ORDER_NO)); + + if (orderInfo == null) + Oops.Oh($"订舱信息获取失败"); + + //推送下货纸业务 + var rtn = await XiahuozhiHelpler.Send(orderInfo.Id, fileRole); + + if (!rtn.Key) + { + throw Oops.Bah($"发送失败:{rtn.Value}"); + } + + //订舱状态写入 + await SaveBookingStatus(orderInfo.Id, "sta_xhz", "下货纸"); + + taskInfo.STATUS = TaskStatusEnum.Complete.ToString(); + taskInfo.STATUS_NAME = TaskStatusEnum.Complete.GetDescription(); + + taskInfo.COMPLETE_DATE = DateTime.Now; + taskInfo.COMPLETE_DEAL = TaskCompleteDealEnum.MANUAL.ToString(); + taskInfo.COMPLETE_DEAL_NAME = TaskCompleteDealEnum.MANUAL.GetDescription(); + + taskInfo.UpdatedTime = DateTime.Now; + taskInfo.UpdatedUserId = UserManager.UserId; + taskInfo.UpdatedUserName = UserManager.Name; + + //更新任务表 + await _taskBaseInfoRepository.AsUpdateable(taskInfo).UpdateColumns(it => new + { + it.STATUS, + it.STATUS_NAME, + it.COMPLETE_DATE, + it.COMPLETE_DEAL, + it.COMPLETE_DEAL_NAME, + it.UpdatedTime, + it.UpdatedUserId, + it.UpdatedUserName + }).ExecuteCommandAsync(); + + await InnerChargeFeeShippingOrder(taskInfo); + + //反馈用户(这里预留,主要考虑是否通过用户配置确定是否需要推送回执) + await FeedbackXiaHuoZhi(""); + } + catch(Exception ex) + { + throw Oops.Bah($"获取发送下货纸异常,{0}", ex.Message); + } + + return result; + } + + #region 更新订舱的状态 + /// + /// 更新订舱的状态 + /// + /// 订舱主键 + /// 状态代码 + /// 状态名称 + /// + private async Task SaveBookingStatus(long bookingId, string code, string name) + { + var bookSta = _bookingStatusRepository.FirstOrDefault(x => x.BookingId == bookingId && x.StaCode == code); + + if (bookSta == null) + { + //记录状态 + bookSta = new BookingStatus(); + bookSta.BookingId = bookingId; + bookSta.StaCode = code; + bookSta.StaName = name; + bookSta.StaTime = DateTime.Now; + await _bookingStatusRepository.InsertAsync(bookSta); + } + else + { + bookSta.StaTime = DateTime.Now; + await _bookingStatusRepository.UpdateAsync(bookSta); + } + } + #endregion + + #region 扣费 + /// + /// 扣费 + /// + /// 任务信息 + /// 是否执行扣费 true-执行扣费 false-不执行扣费(主要是符合扣费条件但是由于超时没有得到准确回执) + /// 返回回执 + private async Task InnerChargeFeeShippingOrder(TaskBaseInfo taskBaseInfo, bool isCharge = true) + { + TaskManageOrderResultDto result = new TaskManageOrderResultDto { succ = false }; + try + { + decimal balance = 0; + decimal price = 0; + decimal total = 0; + + TaskChargesHisInfo model = new TaskChargesHisInfo + { + PK_ID = IDGen.NextID().ToString(), + TASK_ID = taskBaseInfo.PK_ID, + BEFORE_BALANCE = balance, + PRICE = price, + BUSI_TYPE = "21", + BUSI_TYPE_NAME = String.Empty, + SEND_TYPE = "1001", + SEND_TYPE_NAME = String.Empty, + REMARK = "下货纸", + QTY = 1, + TOTAL_AMOUNT = total, + }; + + if (!isCharge) + { + model.STATUS = TaskChargeStatusEnum.UNKNOW_RESULT.ToString(); + model.STATUS_NAME = TaskChargeStatusEnum.UNKNOW_RESULT.GetDescription(); + } + + //写入记录 + await _taskChargesHisInfoRepository.InsertAsync(model); + + result.succ = false; + result.msg = "扣费失败"; + } + catch (Exception ex) + { + result.succ = false; + result.msg = ex.Message; + } + return result; } + #endregion /// /// 获取订舱详情 /// /// 任务主键 /// 返回结果 - public async Task GetBookingOrderInfo(string taskPKId) + [HttpGet("/TaskManage/GetBookingOrderInfo")] + public async Task GetBookingOrderInfo([FromQuery]string taskPKId) { - TaskManageOrderResultDto result = new TaskManageOrderResultDto(); + TaskBookingOrderDto model = new TaskBookingOrderDto(); - return result; + string batchNo = IDGen.NextID().ToString(); + try + { + var taskInfo = _taskBaseInfoRepository.AsQueryable().First(t => t.PK_ID == taskPKId); + + if (taskInfo == null) + Oops.Oh($"任务信息获取失败"); + + if (string.IsNullOrWhiteSpace(taskInfo.BOOK_ORDER_NO)) + Oops.Oh($"任务信息的订舱主键不存在"); + + var orderInfo = _bookingOrderRepository.AsQueryable() + .First(t => t.Id == long.Parse(taskInfo.BOOK_ORDER_NO)); + + if(orderInfo != null) + { + //订舱 + model = orderInfo.Adapt(); + + var contaList = await _bookingOrderContaRepository.AsQueryable().Where(x => x.BILLID == orderInfo.Id).ToListAsync(); + + //获取集装箱的主键 + var ctnArg = contaList.Select(t => t.Id).ToArray(); + + //查询集装箱所有的货物信息 + var cargoList = await _bookingOrderContaCargoRepository.AsQueryable() + .Where(x => ctnArg.Contains(x.CTNID.Value)).ToListAsync(); + + _logger.LogInformation("批次={no} 提取货物明细完成 数量={total}", batchNo, cargoList.Count); + + if (cargoList.Count > 0) + { + model.ContaList = contaList.GroupJoin(cargoList, l => l.Id, r => r.CTNID, (l, r) => { + var currList = r.ToList(); + + if (currList.Count > 0) + { + var info = l.Adapt(); + info.CargoList = currList.Adapt>(); + + return info; + } + + return l.Adapt(); + + }).ToList(); + } + else + { + model.ContaList = contaList.Adapt>(); + } + + //任务 + model.TaskBaseInfo = taskInfo.Adapt(); + } + + } + catch (Exception ex) + { + throw Oops.Bah($"获取订舱详情异常,{0}", ex.Message); + } + return model; + } + + + private async Task FeedbackXiaHuoZhi(string bsno) + { + /* + var para = commonData.ParamValues.AsNoTracking().FirstOrDefault(x => x.CompId == compid && x.ParaCode == "XHZ_FEEDBACK_URL"); + if (para == null || string.IsNullOrEmpty(para.ItemCode)) + { + msg = "下货纸反馈地址未配置"; + return false; + } + + var feedbask = new BackgroundTaskCommon(); + feedbask.GID = Guid.NewGuid().ToString(); + feedbask.Status = BackgroundTaskCommon.StatusCreate; + feedbask.Type = BackgroundTaskCommon.TypeHttpFeedback; + feedbask.CreateTime = DateTime.Now; + feedbask.ParamData = JsonConvert.SerializeObject(new + { + url = para.ItemCode, + method = "POST", + json = JsonConvert.SerializeObject(new + { + bsno, + status + }) + }); + commonData.BackgroundTaskCommon.Add(feedbask); + + msg = "成功"; + return true; + */ } }