wet 2 years ago
commit 256e0f32d4

@ -59,5 +59,10 @@ namespace Myshipping.Application.Entity
/// 称重方式
/// </summary>
public string WEIGHTYPE { get; set; }
/// <summary>
/// 主单号
/// </summary>
public string MBL_NO { get; set; }
}
}

@ -87,30 +87,37 @@ namespace Myshipping.Application
/// <summary>
/// 开船日期
/// </summary>
/// <example>2022-01-01</example>
public string ETD { get; set; }
/// <summary>
/// 实际开船日期
/// </summary>
/// <example>2022-01-01</example>
public string ATD { get; set; }
/// <summary>
/// 预计到港日期
/// </summary>
/// <example>2022-01-01</example>
public string ETA { get; set; }
/// <summary>
/// 截港日期
/// </summary>
/// <example>2022-01-01</example>
public string ClosingDate { get; set; }
/// <summary>
/// 截单日期
/// </summary>
/// <example>2022-01-01</example>
public string CloseDocDate { get; set; }
/// <summary>
/// 截VGM时间
/// </summary>
/// <example>2022-01-01</example>
public string CloseVGMDate { get; set; }
/// <summary>
/// 收货地代码
/// </summary>
/// <example>CNTAO</example>
public string PlaceReceiptId { get; set; }
/// <summary>
/// 收货地
@ -119,6 +126,7 @@ namespace Myshipping.Application
/// <summary>
/// 起运港代码
/// </summary>
/// <example>CNTAO</example>
public string PortLoadId { get; set; }
/// <summary>
/// 起运港
@ -127,6 +135,7 @@ namespace Myshipping.Application
/// <summary>
/// 卸货港代码
/// </summary>
/// <example>USDCB</example>
public string PortDischargeId { get; set; }
/// <summary>
/// 卸货港
@ -135,6 +144,7 @@ namespace Myshipping.Application
/// <summary>
/// 交货地代码
/// </summary>
/// <example>USDCB</example>
public string PlaceDeliveryId { get; set; }
/// <summary>
/// 交货地
@ -143,6 +153,7 @@ namespace Myshipping.Application
/// <summary>
/// 目的地代码
/// </summary>
/// <example>USDCB</example>
public string DestinationId { get; set; }
/// <summary>
/// 目的地
@ -163,6 +174,7 @@ namespace Myshipping.Application
/// <summary>
/// 签单日期
/// </summary>
/// <example>2022-01-01</example>
public string IssueDate { get; set; }
/// <summary>
/// 签单地点代码
@ -544,6 +556,7 @@ namespace Myshipping.Application
/// <summary>
/// 中转港代码
/// </summary>
/// <example></example>
public string TransportId { get; set; }
/// <summary>
/// 中转港

@ -0,0 +1,39 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Myshipping.Application
{
/// <summary>
///
/// </summary>
public class TaskCompareResultDto
{
/// <summary>
/// 字段代码
/// </summary>
public string Code { get; set; }
/// <summary>
/// 原值
/// </summary>
public object SrcVal { get; set; }
/// <summary>
/// 修改值
/// </summary>
public object TargetVal { get; set; }
/// <summary>
/// 是否不一致
/// </summary>
public bool IsDiff { get; set; } = false;
/// <summary>
/// 字段类型
/// </summary>
public Type ValType { get; set; }
}
}

@ -72,7 +72,8 @@ namespace Myshipping.Application
.Map(dest => dest.KGS, src => src.KGS)
.Map(dest => dest.TAREWEIGHT, src => src.TAREWEIGHT)
.Map(dest => dest.WEIGHKGS, src => src.WEIGHKGS)
.Map(dest => dest.WEIGHTYPE, src => src.WEIGHTYPE);
.Map(dest => dest.WEIGHTYPE, src => src.WEIGHTYPE)
.Map(dest => dest.MBL_NO, src => src.MBLNo);
config.ForType<TaskBaseInfo, TaskBaseInfoDto>()
@ -163,7 +164,7 @@ namespace Myshipping.Application
.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.PortLoadId, src => src.PORTLOADID)
.Map(dest => dest.PortLoad, src => src.PORTLOAD)
.Map(dest => dest.PortDischargeId, src => src.PORTDISCHARGEID)
.Map(dest => dest.PortDischarge, src => src.PORTDISCHARGE)
@ -354,6 +355,237 @@ namespace Myshipping.Application
.Map(dest => dest.CreatedUserName, src => src.CreatedUserName)
.Map(dest => dest.UpdatedUserId, src => src.UpdatedUserId.ToString())
.Map(dest => dest.UpdatedUserName, src => src.UpdatedUserName);
config.ForType<TaskSIFeedBackInfo, TaskSIFeedBackResultBusiDto>()
.Map(dest => dest.Shipper, src => src.SHIPPER)
.Map(dest => dest.Consignee, src => src.CONSIGNEE)
.Map(dest => dest.NotifyParty, src => src.NOTIFYPARTY)
.Map(dest => dest.Marks, src => src.MARKS)
.Map(dest => dest.Description, src => src.DESCRIPTION)
.Map(dest => dest.Remark, src => src.REMARK)
.Map(dest => dest.BLFRT, src => src.BLFRT)
.Map(dest => dest.Service, src => src.SERVICE)
.Map(dest => dest.IssueType, src => src.ISSUETYPE)
.Map(dest => dest.PortLoadId, src => src.PORT_LOADID)
.Map(dest => dest.PortLoad, src => src.PORT_LOAD)
.Map(dest => dest.PortDischargeId, src => src.PORT_DISCHARGEID)
.Map(dest => dest.PortDischarge, src => src.PORT_DISCHARGE)
.Map(dest => dest.PortTransId, src => src.PORT_TRANSID)
.Map(dest => dest.PortTrans, src => src.PORT_TRANS)
.Map(dest => dest.DestinationId, src => src.DESTINATION_ID)
.Map(dest => dest.Destination, src => src.DESTINATION)
.Map(dest => dest.KindPKGS, src => src.KIND_PKGS)
.Map(dest => dest.PKGS, src => src.PKGS)
.Map(dest => dest.ThirdPayAddr, src => src.THIRDPAYADDR);
config.ForType<TaskSIFeedBackContaInfo, TaskSIFeedBackResultContaDto>()
.Map(dest => dest.ContaNo, src => src.CONTA_NO)
.Map(dest => dest.SealNo, src => src.SEAL_NO)
.Map(dest => dest.PKGS, src => src.PKGS)
.Map(dest => dest.KGS, src => src.KGS)
.Map(dest => dest.CBM, src => src.CBM)
.Map(dest => dest.ContaType, src => src.CONTA_TYPE)
.Map(dest => dest.ContaTypeName, src => src.CONTA_TYPE_NAME);
config.ForType<TaskVGMFeedBackInfo, TaskVGMFeedBackDto>()
.Map(dest => dest.ContaNo, src => src.CONTA_NO)
.Map(dest => dest.SealNo, src => src.SEAL_NO)
.Map(dest => dest.ContaType, src => src.CONTA_TYPE)
.Map(dest => dest.ContaTypeName, src => src.CONTA_TYPE_NAME)
.Map(dest => dest.KGS, src => src.KGS)
.Map(dest => dest.TareWeight, src => src.TAREWEIGHT)
.Map(dest => dest.WeighKGs, src => src.WEIGHKGS)
.Map(dest => dest.WeighType, src => src.WEIGHTYPE)
.Map(dest => dest.MBLNo, src => src.MBL_NO);
config.ForType<TaskVGMFeedBackInfo, TaskVgmCompareDto>()
.Map(dest => dest.ContaNo, src => src.CONTA_NO)
.Map(dest => dest.SealNo, src => src.SEAL_NO)
.Map(dest => dest.ContaType, src => src.CONTA_TYPE)
.Map(dest => dest.ContaTypeName, src => src.CONTA_TYPE_NAME)
.Map(dest => dest.KGS, src => src.KGS)
.Map(dest => dest.TareWeight, src => src.TAREWEIGHT)
.Map(dest => dest.WeighKGs, src => src.WEIGHKGS)
.Map(dest => dest.WeighType, src => src.WEIGHTYPE)
.Map(dest => dest.MBLNo, src => src.MBL_NO);
config.ForType<BookingCtn, TaskVgmCompareDto>()
.Map(dest => dest.ContaNo, src => src.CNTRNO)
.Map(dest => dest.SealNo, src => src.SEALNO)
.Map(dest => dest.ContaType, src => src.CTNCODE)
.Map(dest => dest.ContaTypeName, src => src.CTNALL)
.Map(dest => dest.KGS, src => src.KGS)
.Map(dest => dest.TareWeight, src => src.TAREWEIGHT)
.Map(dest => dest.WeighKGs, src => src.WEIGHKGS)
.Map(dest => dest.WeighType, src => src.WEIGHTYPE);
config.ForType<TaskBookingOrderContaDto, BookingCtn>()
.Map(dest => dest.CTNCODE, src => src.ContaType)
.Map(dest => dest.CTNALL, src => src.ContaTypeName)
.Map(dest => dest.TEU, src => src.TEU)
.Map(dest => dest.CNTRNO, src => src.ContaNo)
.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.CTNSTATUS, src => src.ContaStatus)
.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<TaskBookingOrderDto, BookingOrder>()
.Map(dest => dest.MBLNO, src => src.MasterBlNo)
.Map(dest => dest.HBLNO, src => src.HouseBlNo)
.Map(dest => dest.BOOKINGNO, src => src.BookingNo)
.Map(dest => dest.CONTRACTNO, src => src.ContrNo)
.Map(dest => dest.SERVICECONTRACTNO, src => src.ServContrNo)
.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.NOTIFYPARTY2, src => src.NotifyPrt2)
.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.VOYNOINNER, src => src.VoynoIn)
.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)
.Map(dest => dest.CLOSEDOCDATE, src => src.CloseDocDate)
.Map(dest => dest.CLOSEVGMDATE, src => src.CloseVGMDate)
.Map(dest => dest.PLACERECEIPTID, src => src.PlaceReceiptId)
.Map(dest => dest.PLACERECEIPT, src => src.PlaceReceipt)
.Map(dest => dest.PORTLOADID, src => src.PortLoadId)
.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)
.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.DESCRIPTION, src => src.GoodsDescription)
.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.LINKMAN, src => src.DLinkMan)
.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.ISCONTAINERSOC, src => src.IsContaSOC)
.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.SHIPPERPROVINCE, src => src.ShipperProvice)
.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.CONSIGNEERCOUNTRY, src => src.ConsigneeCountry)
.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<TaskVGMFeedBackInfo, BookingCtn>()
.Map(dest => dest.CTNCODE, src => src.CONTA_TYPE)
.Map(dest => dest.CTNALL, src => src.CONTA_TYPE_NAME)
.Map(dest => dest.CNTRNO, src => src.CONTA_NO)
.Map(dest => dest.SEALNO, src => src.SEAL_NO)
.Map(dest => dest.KGS, src => src.KGS)
.Map(dest => dest.TAREWEIGHT, src => src.TAREWEIGHT)
.Map(dest => dest.WEIGHTYPE, src => src.WEIGHTYPE)
.Map(dest => dest.WEIGHKGS, src => src.WEIGHKGS);
}
}
}

@ -50,5 +50,11 @@ namespace Myshipping.Application
/// 称重方式
/// </summary>
public string WEIGHTYPE { get; set; }
/// <summary>
/// 主单号
/// </summary>
public string MBLNo { get; set; }
}
}

@ -0,0 +1,111 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Myshipping.Application
{
public class TaskSIFeedBackResultBusiDto
{
/// <summary>
/// 发货人
/// </summary>
public string Shipper { get; set; }
/// <summary>
/// 收货人
/// </summary>
public string Consignee { get; set; }
/// <summary>
/// 通知人
/// </summary>
public string NotifyParty { get; set; }
/// <summary>
/// 唛头
/// </summary>
public string Marks { get; set; }
/// <summary>
/// 货描
/// </summary>
public string Description { get; set; }
/// <summary>
/// 截单备注
/// </summary>
public string Remark { get; set; }
/// <summary>
/// 付费方式
/// </summary>
public string BLFRT { get; set; }
/// <summary>
/// 运输条款
/// </summary>
/// <example>CY-CY</example>
public string Service { get; set; }
/// <summary>
/// 签单方式
/// </summary>
/// <example>TELEX</example>
public string IssueType { get; set; }
/// <summary>
/// 装货港代码
/// </summary>
/// <example>CNTAO</example>
public string PortLoadId { get; set; }
/// <summary>
/// 装货港
/// </summary>
public string PortLoad { get; set; }
/// <summary>
/// 卸货港代码
/// </summary>
/// <example>GUPIT</example>
public string PortDischargeId { get; set; }
/// <summary>
/// 卸货港
/// </summary>
public string PortDischarge { get; set; }
/// <summary>
/// 中转港代码
/// </summary>
/// <example>GUPIT</example>
public string PortTransId { get; set; }
/// <summary>
/// 中转港
/// </summary>
public string PortTrans { get; set; }
/// <summary>
/// 目的地代码
/// </summary>
/// <example>GUPIT</example>
public string DestinationId { get; set; }
/// <summary>
/// 目的地
/// </summary>
public string Destination { get; set; }
/// <summary>
/// 件数
/// </summary>
public int? PKGS { get; set; }
/// <summary>
/// 包装
/// </summary>
public string KindPKGS { get; set; }
/// <summary>
/// 毛重
/// </summary>
public decimal? KGS { get; set; }
/// <summary>
/// 尺寸
/// </summary>
public decimal? CBM { get; set; }
/// <summary>
/// 第三付款地
/// </summary>
public string ThirdPayAddr { get; set; }
/// <summary>
/// 箱信息
/// </summary>
public List<TaskSIFeedBackResultContaDto> ContaList { get; set; }
}
}

@ -0,0 +1,56 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Myshipping.Application
{
/// <summary>
/// SI集装箱
/// </summary>
public class TaskSIFeedBackResultContaDto
{
/// <summary>
/// 集装箱号
/// </summary>
/// <example>RFCU2088064</example>
public string ContaNo { get; set; }
/// <summary>
/// 铅封号
/// </summary>
/// <example>T090518</example>
public string SealNo { get; set; }
/// <summary>
/// 件数
/// </summary>
/// <example>222</example>
public int PKGS { get; set; }
/// <summary>
/// 重量
/// </summary>
/// <example>1651</example>
public decimal? KGS { get; set; }
/// <summary>
/// 尺寸
/// </summary>
/// <example>9.67</example>
public decimal? CBM { get; set; }
/// <summary>
/// 箱型代码
/// </summary>
/// <example>20GP</example>
public string ContaType { get; set; }
/// <summary>
/// 箱型
/// </summary>
/// <example>20GP</example>
public string ContaTypeName { get; set; }
}
}

@ -0,0 +1,40 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Myshipping.Application
{
/// <summary>
/// SI详情
/// </summary>
public class TaskSIFeedBackResultDto
{
// <summary>
/// 任务主键
/// </summary>
public string TaskId { get; set; }
/// <summary>
/// 订舱详情
/// </summary>
public TaskBookingOrderDto BookingOrder { get; set; }
/// <summary>
/// SI详情
/// </summary>
public TaskSIFeedBackResultBusiDto BusiInfo { get; set; }
/// <summary>
/// SI与订舱主信息比对差异字段列表
/// </summary>
public List<string> SICompareOrderKeyList { get; set; }
/// <summary>
/// SI与订舱集装箱比对差异字段列表
/// </summary>
public List<string> SICompareOrderContaKeyList { get; set; }
}
}

@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Myshipping.Application
{
public class TaskSIModifyDto: TaskBookingOrderDto
{
/// <summary>
/// 任务主键
/// </summary>
public string TaskPKId { get; set; }
}
}

@ -0,0 +1,59 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Myshipping.Application
{
/// <summary>
/// VGM反馈
/// </summary>
public class TaskVGMFeedBackDto
{
/// <summary>
/// 集装箱号
/// </summary>
public string ContaNo { get; set; }
/// <summary>
/// 铅封号
/// </summary>
public string SealNo { get; set; }
/// <summary>
/// 箱型代码
/// </summary>
public string ContaType { get; set; }
/// <summary>
/// 箱型
/// </summary>
public string ContaTypeName { get; set; }
/// <summary>
/// 重量
/// </summary>
public decimal? KGS { get; set; }
/// <summary>
/// 皮重
/// </summary>
public decimal? TareWeight { get; set; }
/// <summary>
/// 称重重量
/// </summary>
public decimal? WeighKGs { get; set; }
/// <summary>
/// 称重方式
/// </summary>
public string WeighType { get; set; }
/// <summary>
/// 主单号
/// </summary>
public string MBLNo { get; set; }
}
}

@ -0,0 +1,30 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Myshipping.Application
{
public class TaskVgmCompareDto : TaskVGMFeedBackDto
{
/// <summary>
/// 比对差异字段
/// </summary>
public List<string> compareDiffList { get; set; }
}
public class TaskVgmCompareResultDto
{
/// <summary>
/// 订舱与VGM反馈差异对比
/// </summary>
public List<TaskVgmCompareDto> bookOrderCompareList { get; set; }
/// <summary>
/// VGM反馈与订舱差异比对
/// </summary>
public List<TaskVgmCompareDto> vgmCompareList { get; set; }
}
}

@ -174,5 +174,35 @@ namespace Myshipping.Application
/// <param name="descSort">排序方法,默认降序</param>
/// <returns>返回结果</returns>
Task<IActionResult> LaraPaperRecordExport(string sortField, int pageNo = 1, int pageSize = 30, bool descSort = true);
/// <summary>
/// 保存SI信息
/// </summary>
/// <param name="model">订舱信息</param>
/// <returns>返回结果</returns>
Task<TaskManageOrderResultDto> SaveBookingSI(TaskBookingOrderDto model);
/// <summary>
/// 获取SI反馈信息
/// </summary>
/// <param name="taskPKId">任务主键</param>
/// <returns>返回结果</returns>
Task<TaskSIFeedBackResultDto> GetSIFeedBackInfo(string taskPKId);
/// <summary>
/// 获取VGM比较结果
/// </summary>
/// <param name="taskPKId">任务主键</param>
/// <returns>返回结果</returns>
Task<TaskVgmCompareResultDto> GetVGMCompareResult(string taskPKId);
/// <summary>
/// 更新订舱VGM比较更新
/// </summary>
/// <param name="taskPKId">任务主键</param>
/// <returns>返回结果</returns>
Task<TaskManageOrderResultDto> SaveBookingVGM(string taskPKId);
}
}

@ -4,6 +4,7 @@ using Furion.DistributedIDGenerator;
using Furion.DynamicApiController;
using Furion.FriendlyException;
using Furion.JsonSerialization;
using Furion.Localization;
using Furion.RemoteRequest;
using Furion.RemoteRequest.Extensions;
using Mapster;
@ -25,9 +26,12 @@ using Newtonsoft.Json.Linq;
using Npoi.Mapper;
using NPOI.HPSF;
using NPOI.HSSF.UserModel;
using NPOI.OpenXmlFormats;
using NPOI.POIFS.Crypt.Dsig;
using NPOI.SS.Formula.Eval;
using NPOI.SS.Formula.Functions;
using NPOI.SS.UserModel;
using NPOI.Util;
using NPOI.XSSF.Model;
using Org.BouncyCastle.Asn1.X500;
using SixLabors.ImageSharp.Processing.Processors.Transforms;
@ -2435,7 +2439,7 @@ namespace Myshipping.Application
/// <param name="pageSize">页码容量</param>
/// <param name="descSort">排序方法,默认降序</param>
/// <returns>返回结果</returns>
[HttpGet("/TaskManage/GetLaraPaperRecordPage")]
[HttpGet("/TaskManage/LaraPaperRecordExport")]
public async Task<IActionResult> LaraPaperRecordExport([FromQuery] string sortField,[FromQuery] int pageNo = 1, [FromQuery] int pageSize = 30, [FromQuery] bool descSort = true)
{
QueryTaskManageBaseDto querySearch = new QueryTaskManageBaseDto
@ -2465,6 +2469,7 @@ namespace Myshipping.Application
return new FileStreamResult(ms, "application/vnd.ms-excel") { FileDownloadName = $"{DateTime.Now.ToString("yyyyMMddHHmmss")}_LaraPaperRecord.xls" };
}
#region 导出提单纸登记记录生成Excel
/// <summary>
/// 导出提单纸登记记录生成Excel
/// </summary>
@ -2529,6 +2534,735 @@ namespace Myshipping.Application
return ms;
}
#endregion
#region 保存SI信息
/// <summary>
/// 保存SI信息
/// </summary>
/// <param name="model">订舱信息</param>
/// <returns>返回结果</returns>
[HttpPost("/TaskManage/SaveBookingSI")]
public async Task<TaskManageOrderResultDto> SaveBookingSI(TaskBookingOrderDto model)
{
TaskManageOrderResultDto result = new TaskManageOrderResultDto();
/*
1
2
3
*/
try
{
if (string.IsNullOrWhiteSpace(model.TaskBaseInfo.PKId))
throw Oops.Oh($"任务主键TaskBaseInfo.PKId不能为空");
var taskInfo = _taskBaseInfoRepository.AsQueryable().First(t => t.PK_ID == model.TaskBaseInfo.PKId);
if (taskInfo == null)
throw Oops.Oh($"任务信息获取失败");
if (string.IsNullOrWhiteSpace(taskInfo.BOOK_ORDER_NO))
throw Oops.Oh($"任务信息的订舱主键不存在");
if (taskInfo.TASK_TYPE != TaskBusiTypeEnum.SI_FEEDBACK.ToString())
throw Oops.Oh($"当前任务类型不是{TaskBusiTypeEnum.SI_FEEDBACK.GetDescription()}");
//取订舱详情(包含集装箱)
var bookOrderList = _bookingOrderRepository.EntityContext.Queryable<BookingOrder>()
.LeftJoin(_bookingOrderRepository.EntityContext.Queryable<BookingCtn>(),(bk, ctn) => bk.Id == ctn.BILLID)
.Where((bk, ctn) => bk.Id == long.Parse(taskInfo.BOOK_ORDER_NO) && bk.TenantId == UserManager.TENANT_ID)
.Select((bk, ctn) => new { bk = bk, ctn = ctn }).ToList();
var orderInfo = bookOrderList.FirstOrDefault().bk;
List<BookingCtn> orderCtnList = new List<BookingCtn>();
//这里是左连接查询,解决集装箱为空的情况
if(bookOrderList.Any(t=>t.ctn.Id > 0))
orderCtnList = bookOrderList.Select(t => t.ctn).ToList();
var mdBookingOrder = model.Adapt<BookingOrder>();
mdBookingOrder.Id = orderInfo.Id;
mdBookingOrder.UpdatedTime = DateTime.Now;
mdBookingOrder.UpdatedUserId = UserManager.UserId;
mdBookingOrder.UpdatedUserName = UserManager.Name;
//比对主订舱信息
var orderDiff = InnerCompare(orderInfo, mdBookingOrder);
//比对箱信息
var contaList = model.ContaList.Select(x => x.Adapt<BookingCtn>()).ToList();
/**/
//这里参考原有的更新逻辑只更新了SI回执有的字段信息其他字段不更新如果后期有调整可以自行增加更新字段
await _bookingOrderRepository.AsUpdateable(mdBookingOrder).UpdateColumns(it => new
{
it.UpdatedTime,
it.UpdatedUserId,
it.UpdatedUserName,
it.SHIPPER,
it.CONSIGNEE,
it.NOTIFYPARTY,
it.MARKS,
it.DESCRIPTION,
it.BLFRT,
it.SERVICE,
it.ISSUETYPE,
it.PORTLOADID,
it.PORTLOAD,
it.PORTDISCHARGEID,
it.PORTDISCHARGE,
it.TRANSPORTID,
it.TRANSPORT,
it.DESTINATIONID,
it.DESTINATION,
it.PKGS,
it.KINDPKGS,
it.KGS,
it.CBM,
it.THIRDPAYADDR,
it.SIREMARK
}).ExecuteCommandAsync();
var ctnlist = await _bookingOrderContaRepository.AsQueryable().Where(x => x.BILLID == mdBookingOrder.Id).ToListAsync();
var si2orderCtnList = contaList.GroupJoin(ctnlist, l => l.CNTRNO?.Trim(), r => r.CNTRNO?.Trim(), (l, r) => {
var currInfo = r.FirstOrDefault();
if(currInfo == null)
{
l.BILLID = orderInfo.Id;
l.CreatedTime = DateTime.Now;
l.CreatedUserId = UserManager.UserId;
l.CreatedUserName = UserManager.Name;
l.UpdatedTime = l.CreatedTime;
l.UpdatedUserId = UserManager.UserId;
l.UpdatedUserName = UserManager.Name;
return new { OperType = "insert", obj = l };
}
else
{
currInfo.Id = l.Id;
currInfo.BILLID = l.BILLID;
currInfo.UpdatedTime = DateTime.Now;
currInfo.UpdatedUserId = UserManager.UserId;
currInfo.UpdatedUserName = UserManager.Name;
return new { OperType = "update", obj = currInfo };
}
}).ToList();
var delList = ctnlist.GroupJoin(contaList, l => l.CNTRNO?.Trim(), r => r.CNTRNO?.Trim(), (l, r) => {
var currInfo = r.FirstOrDefault();
if (currInfo == null)
{
l.UpdatedTime = DateTime.Now;
l.UpdatedUserId = UserManager.UserId;
l.UpdatedUserName = UserManager.Name;
return new { OperType = "delete", obj = l };
}
return new { OperType = string.Empty, obj = l };
}).Where(t=>t.OperType != string.Empty).ToList();
if (delList.Count > 0)
si2orderCtnList.AddRange(delList);
if (si2orderCtnList.Count > 0)
{
si2orderCtnList.ForEach(async ctn =>
{
if (ctn.OperType == "insert")
{
//插入
await _bookingOrderContaRepository.InsertAsync(ctn.obj);
}
else if (ctn.OperType == "update")
{
//更新
await _bookingOrderContaRepository.AsUpdateable(ctn.obj).UpdateColumns(it => new
{
it.CTNALL,
it.SEALNO,
it.PKGS,
it.KGS,
it.CBM,
it.UpdatedTime,
it.UpdatedUserId,
it.UpdatedUserName,
}).ExecuteCommandAsync();
}
else if (ctn.OperType == "delete")
{
await _bookingOrderContaRepository.DeleteAsync(x => x.Id == ctn.obj.Id);
}
});
}
result.succ = true;
result.msg = "保存SI信息成功";
}
catch(Exception ex)
{
throw Oops.Bah($"保存SI信息异常,{0}", ex.Message);
}
return result;
}
#endregion
#region 获取SI反馈信息
/// <summary>
/// 获取SI反馈信息
/// </summary>
/// <param name="taskPKId">任务主键</param>
/// <returns>返回结果</returns>
[HttpGet("/TaskManage/GetSIFeedBackInfo")]
public async Task<TaskSIFeedBackResultDto> GetSIFeedBackInfo(string taskPKId)
{
TaskSIFeedBackResultDto model = new TaskSIFeedBackResultDto();
try
{
var taskInfo = _taskBaseInfoRepository.AsQueryable().First(t => t.PK_ID == taskPKId);
if (taskInfo == null)
throw Oops.Oh($"任务信息获取失败");
if (string.IsNullOrWhiteSpace(taskInfo.BOOK_ORDER_NO))
throw Oops.Oh($"任务信息的订舱主键不存在");
if (taskInfo.TASK_TYPE != TaskBusiTypeEnum.SI_FEEDBACK.ToString())
throw Oops.Oh($"当前任务类型不是{TaskBusiTypeEnum.SI_FEEDBACK.GetDescription()}");
var bookOrderList = _bookingOrderRepository.EntityContext.Queryable<BookingOrder>()
.InnerJoin<BookingCtn>((bk, ctn) => bk.Id == ctn.BILLID)
.Where((bk, ctn) => bk.Id == long.Parse(taskInfo.BOOK_ORDER_NO) && bk.TenantId == UserManager.TENANT_ID)
.Select((bk, ctn) => new { bk = bk, ctn = ctn }).ToList();
var orderInfo = bookOrderList.FirstOrDefault().bk;
model.TaskId = taskInfo.PK_ID;
var siFeedBackList = _taskSIFeedBackInfoRepository.EntityContext.Queryable<TaskSIFeedBackInfo>()
.InnerJoin<TaskSIFeedBackContaInfo>((si, ctn) => si.PK_ID == ctn.P_PKID)
.Where((si, ctn) => si.TASK_PKID == model.TaskId && si.TenantId == UserManager.TENANT_ID)
.Select((si, ctn) => new { si = si, ctn = ctn }).ToList();
if (siFeedBackList.Count == 0)
throw Oops.Oh($"SI反馈信息不存在");
var siFeedBackInfo = siFeedBackList.FirstOrDefault().si;
var resultInfo = siFeedBackInfo.Adapt<TaskSIFeedBackResultBusiDto>();
resultInfo.ContaList = siFeedBackList.Select(t => t.ctn.Adapt<TaskSIFeedBackResultContaDto>()).ToList();
model.BusiInfo = resultInfo;
if (orderInfo != null)
{
//订舱
model.BookingOrder = orderInfo.Adapt<TaskBookingOrderDto>();
}
//进行数据比对确认差异字段KEY
var mainDiff = await InnerCompareMainInfoDiff(orderInfo, siFeedBackInfo);
model.SICompareOrderKeyList = mainDiff;
var contaDiff = await InnerCompareContaInfoDiff(bookOrderList.Select(t=>t.ctn).ToList(),
siFeedBackList.Select(t=>t.ctn).ToList());
model.SICompareOrderContaKeyList = contaDiff;
}
catch (Exception ex)
{
throw Oops.Bah($"获取获取单票账单详情异常,{0}", ex.Message);
}
return model;
}
#endregion
private List<TaskCompareResultDto> InnerCompare(object srcModel,object targetModel)
{
List<TaskCompareResultDto> list = new List<TaskCompareResultDto>();
if(srcModel is BookingOrder)
{
var srcBK = (BookingOrder)srcModel;
var targetBK = (BookingOrder)targetModel;
var bookProps = typeof(BookingOrder).GetProperties();
list = bookProps.Select(prop =>
{
var bk1Val = prop.GetValue(srcBK);
var bk2Val = prop.GetValue(targetBK);
if (prop.PropertyType == typeof(string))
{
string st1 = (bk1Val as string).AdjustString();
string st2 = (bk2Val as string).AdjustString();
if (st1 != st2)
{
return new TaskCompareResultDto { Code = prop.Name, SrcVal = bk1Val, TargetVal = bk2Val, IsDiff = true, ValType = prop.PropertyType };
}
return new TaskCompareResultDto { Code = prop.Name, SrcVal = bk1Val, TargetVal = bk2Val, IsDiff = false, ValType = prop.PropertyType };
}
else if (prop.PropertyType == typeof(int?))
{
var dt1 = bk1Val as int?;
var dt2 = bk2Val as int?;
if (dt1 != dt2)
{
return new TaskCompareResultDto { Code = prop.Name, SrcVal = bk1Val, TargetVal = bk2Val, IsDiff = true, ValType = prop.PropertyType };
}
return new TaskCompareResultDto { Code = prop.Name, SrcVal = bk1Val, TargetVal = bk2Val, IsDiff = true, ValType = prop.PropertyType };
}
else if (prop.PropertyType == typeof(decimal?))
{
var dt1 = bk1Val as decimal?;
var dt2 = bk2Val as decimal?;
if (dt1 != dt2)
{
return new TaskCompareResultDto { Code = prop.Name, SrcVal = bk1Val, TargetVal = bk2Val, IsDiff = true, ValType = prop.PropertyType };
}
return new TaskCompareResultDto { Code = prop.Name, SrcVal = bk1Val, TargetVal = bk2Val, IsDiff = true, ValType = prop.PropertyType };
}
if (bk1Val != bk2Val)
return new TaskCompareResultDto { Code = prop.Name, SrcVal = bk1Val, TargetVal = bk2Val, IsDiff = true, ValType = prop.PropertyType };
return new TaskCompareResultDto { Code = prop.Name, SrcVal = bk1Val, TargetVal = bk2Val, IsDiff = false, ValType = prop.PropertyType };
}).ToList();
}
return list;
}
#region 比较主信息
/// <summary>
/// 比较主信息
/// </summary>
/// <param name="bookingOrder">订舱详情</param>
/// <param name="taskSIFeedBackInfo">SI反馈详情</param>
/// <returns>返回差异</returns>
private async Task<List<string>> InnerCompareMainInfoDiff(BookingOrder bookingOrder, TaskSIFeedBackInfo taskSIFeedBackInfo)
{
List<string> resultList = new List<string>();
//需要比对的字段
var compareField = new string[] { "SHIPPER", "CONSIGNEE", "NOTIFYPARTY", "MARKS", "DESCRIPTION", "BLFRT", "SERVICE", "ISSUETYPE", "PORTLOAD", "PORTDISCHARGE",
"TRANSPORT", "DESTINATION", "PKGS", "KGS", "CBM", "KINDPKGS", "THIRDPAYADDR" };
var bookProps = typeof(BookingOrder).GetProperties();
var feedProps = typeof(TaskSIFeedBackInfo).GetProperties();
resultList = bookProps.GroupJoin(feedProps, l => l.Name.ToUpper(),
r => r.Name.ToUpper(), (l, r) =>
{
if (compareField.Any(x => x.Equals(l.Name, StringComparison.OrdinalIgnoreCase)))
{
var currList = r.ToList();
if (currList.Count > 0)
{
var si = r.FirstOrDefault();
var bkVal = l.GetValue(bookingOrder);
var siVal = si.GetValue(taskSIFeedBackInfo);
if (l.PropertyType == typeof(string))
{
string st1 = (bkVal as string).AdjustString();
string st2 = (siVal as string).AdjustString();
if (!st1.Equals(st2))
{
return l.Name.ToUpper();
}
return string.Empty;
}
else if (l.PropertyType == typeof(int?))
{
var dt1 = bkVal as int?;
var dt2 = siVal as int?;
if (!dt1.Equals(dt2))
{
return l.Name.ToUpper();
}
return string.Empty;
}
else if (l.PropertyType == typeof(decimal?))
{
var dt1 = bkVal as decimal?;
var dt2 = siVal as decimal?;
if (!dt1.Equals(dt2))
{
return l.Name.ToUpper();
}
return string.Empty;
}
}
return string.Empty;
}
return string.Empty;
}).Where(t => !string.IsNullOrWhiteSpace(t)).ToList();
return resultList;
}
#endregion
#region 比较箱信息
/// <summary>
/// 比较箱信息
/// </summary>
/// <param name="bookContaList">订舱箱信息</param>
/// <param name="siContaList">SI反馈箱信息</param>
/// <returns>返回差异</returns>
private async Task<List<string>> InnerCompareContaInfoDiff(List<BookingCtn> bookContaList,List<TaskSIFeedBackContaInfo> siContaList)
{
List<string> resultList = new List<string>();
var bookProps = typeof(BookingCtn).GetProperties();
var feedProps = typeof(TaskSIFeedBackContaInfo).GetProperties();
resultList = siContaList.GroupJoin(bookContaList, l => l.CONTA_NO, r => r.CNTRNO, (l, r) =>
{
var currList = r.ToList();
if (currList.Count > 0)
{
var bkCtn = currList.FirstOrDefault();
if (!l.KGS.Equals(bkCtn.KGS)
|| !l.PKGS.Equals(bkCtn.PKGS)
|| !l.SEAL_NO.Equals(bkCtn.SEALNO)
|| !l.CONTA_TYPE.Equals(bkCtn.CTNALL)
|| !l.CBM.Equals(bkCtn.CBM))
{
return l.CONTA_NO;
}
return String.Empty;
}
return l.CONTA_NO;
}).Where(t => !string.IsNullOrWhiteSpace(t)).ToList();
return resultList;
}
#endregion
#region 获取VGM比较结果
/// <summary>
/// 获取VGM比较结果
/// </summary>
/// <param name="taskPKId">任务主键</param>
/// <returns>返回结果</returns>
[HttpGet("/TaskManage/GetVGMCompareResult")]
public async Task<TaskVgmCompareResultDto> GetVGMCompareResult(string taskPKId)
{
TaskVgmCompareResultDto model = new TaskVgmCompareResultDto();
List<TaskVgmCompareDto> list = new List<TaskVgmCompareDto>();
List<TaskVgmCompareDto> list2 = new List<TaskVgmCompareDto>();
try
{
var taskInfo = _taskBaseInfoRepository.AsQueryable().First(t => t.PK_ID == taskPKId);
if (taskInfo == null)
throw Oops.Oh($"任务信息获取失败");
if (string.IsNullOrWhiteSpace(taskInfo.BOOK_ORDER_NO))
throw Oops.Oh($"任务信息的订舱主键不存在");
if (taskInfo.TASK_TYPE != TaskBusiTypeEnum.VGM_COMPARE.ToString())
throw Oops.Oh($"当前任务类型不是{TaskBusiTypeEnum.VGM_COMPARE.GetDescription()}");
var vgmList = _taskVGMFeedBackInfoRepository.AsQueryable().Where(t => t.TASK_PKID == taskInfo.PK_ID)
.ToList();
if(vgmList.Count == 0)
throw Oops.Oh($"VGM反馈信息不存在");
var contaList = _bookingOrderContaRepository.AsQueryable().Where(t => t.BILLID == long.Parse(taskInfo.BOOK_ORDER_NO)).ToList();
list = contaList.GroupJoin(vgmList, l => l.CNTRNO?.Trim(), r => r.CONTA_NO?.Trim(), (l, r) => {
var currInfo = r.FirstOrDefault();
TaskVgmCompareDto md = l.Adapt<TaskVgmCompareDto>();
if (currInfo != null)
{
if(!l.SEALNO.Equals(currInfo.SEAL_NO))
{
md.compareDiffList.Add(nameof(TaskVgmCompareDto.SealNo));
}
if (!l.CTNCODE.Equals(currInfo.CONTA_TYPE))
{
md.compareDiffList.Add(nameof(TaskVgmCompareDto.ContaType));
}
if (!l.CTNALL.Equals(currInfo.CONTA_TYPE_NAME))
{
md.compareDiffList.Add(nameof(TaskVgmCompareDto.ContaTypeName));
}
if (!l.KGS.Equals(currInfo.KGS))
{
md.compareDiffList.Add(nameof(TaskVgmCompareDto.KGS));
}
if (!l.TAREWEIGHT.Equals(currInfo.TAREWEIGHT))
{
md.compareDiffList.Add(nameof(TaskVgmCompareDto.TareWeight));
}
if (!l.WEIGHKGS.Equals(currInfo.WEIGHKGS))
{
md.compareDiffList.Add(nameof(TaskVgmCompareDto.WeighKGs));
}
if (!l.WEIGHTYPE.Equals(currInfo.WEIGHTYPE))
{
md.compareDiffList.Add(nameof(TaskVgmCompareDto.WeighType));
}
}
else
{
md.compareDiffList = new List<string> { nameof(TaskVgmCompareDto.ContaNo),
nameof(TaskVgmCompareDto.SealNo),
nameof(TaskVgmCompareDto.ContaType),
nameof(TaskVgmCompareDto.ContaTypeName),
nameof(TaskVgmCompareDto.KGS),
nameof(TaskVgmCompareDto.TareWeight),
nameof(TaskVgmCompareDto.WeighKGs),
nameof(TaskVgmCompareDto.WeighType),
};
}
return md;
}).ToList();
model.bookOrderCompareList = list;
list2 = vgmList.GroupJoin(contaList, l => l.CONTA_NO?.Trim(), r => r.CNTRNO?.Trim(), (l, r) => {
var currInfo = r.FirstOrDefault();
TaskVgmCompareDto md = l.Adapt<TaskVgmCompareDto>();
if (currInfo != null)
{
if (!l.SEAL_NO.Equals(currInfo.SEALNO))
{
md.compareDiffList.Add(nameof(TaskVgmCompareDto.SealNo));
}
if (!l.CONTA_TYPE.Equals(currInfo.CTNCODE))
{
md.compareDiffList.Add(nameof(TaskVgmCompareDto.ContaType));
}
if (!l.CONTA_TYPE_NAME.Equals(currInfo.CTNALL))
{
md.compareDiffList.Add(nameof(TaskVgmCompareDto.ContaTypeName));
}
if (!l.KGS.Equals(currInfo.KGS))
{
md.compareDiffList.Add(nameof(TaskVgmCompareDto.KGS));
}
if (!l.TAREWEIGHT.Equals(currInfo.TAREWEIGHT))
{
md.compareDiffList.Add(nameof(TaskVgmCompareDto.TareWeight));
}
if (!l.WEIGHKGS.Equals(currInfo.WEIGHKGS))
{
md.compareDiffList.Add(nameof(TaskVgmCompareDto.WeighKGs));
}
if (!l.WEIGHTYPE.Equals(currInfo.WEIGHTYPE))
{
md.compareDiffList.Add(nameof(TaskVgmCompareDto.WeighType));
}
}
else
{
md.compareDiffList = new List<string> { nameof(TaskVgmCompareDto.ContaNo),
nameof(TaskVgmCompareDto.SealNo),
nameof(TaskVgmCompareDto.ContaType),
nameof(TaskVgmCompareDto.ContaTypeName),
nameof(TaskVgmCompareDto.KGS),
nameof(TaskVgmCompareDto.TareWeight),
nameof(TaskVgmCompareDto.WeighKGs),
nameof(TaskVgmCompareDto.WeighType),
};
}
return md;
}).ToList();
model.vgmCompareList = list2;
}
catch (Exception ex)
{
throw Oops.Bah($"获取VGM比较结果异常,{0}", ex.Message);
}
return model;
}
#endregion
#region 更新订舱VGM比较更新
/// <summary>
/// 更新订舱VGM比较更新
/// </summary>
/// <param name="taskPKId">任务主键</param>
/// <returns>返回结果</returns>
[HttpPost("/TaskManage/SaveBookingVGM")]
public async Task<TaskManageOrderResultDto> SaveBookingVGM(string taskPKId)
{
TaskManageOrderResultDto result = new TaskManageOrderResultDto();
try
{
var taskInfo = _taskBaseInfoRepository.AsQueryable().First(t => t.PK_ID == taskPKId);
if (taskInfo == null)
throw Oops.Oh($"任务信息获取失败");
if (string.IsNullOrWhiteSpace(taskInfo.BOOK_ORDER_NO))
throw Oops.Oh($"任务信息的订舱主键不存在");
if (taskInfo.TASK_TYPE != TaskBusiTypeEnum.VGM_COMPARE.ToString())
throw Oops.Oh($"当前任务类型不是{TaskBusiTypeEnum.VGM_COMPARE.GetDescription()}");
//取订舱详情(包含集装箱)
var bookOrderList = _bookingOrderRepository.EntityContext.Queryable<BookingOrder>()
.LeftJoin(_bookingOrderRepository.EntityContext.Queryable<BookingCtn>(), (bk, ctn) => bk.Id == ctn.BILLID)
.Where((bk, ctn) => bk.Id == long.Parse(taskInfo.BOOK_ORDER_NO) && bk.TenantId == UserManager.TENANT_ID)
.Select((bk, ctn) => new { bk = bk, ctn = ctn }).ToList();
var orderInfo = bookOrderList.FirstOrDefault().bk;
List<BookingCtn> orderCtnList = new List<BookingCtn>();
//这里是左连接查询,解决集装箱为空的情况
if (bookOrderList.Any(t => t.ctn.Id > 0))
orderCtnList = bookOrderList.Select(t => t.ctn).ToList();
var contaList = _taskVGMFeedBackInfoRepository.AsQueryable().Where(t => t.TASK_PKID == taskInfo.PK_ID).ToList();
var si2orderCtnList = contaList.GroupJoin(orderCtnList, l => l.CONTA_NO?.Trim(), r => r.CNTRNO?.Trim(), (l, r) => {
var currInfo = r.FirstOrDefault();
var contaInfo = l.Adapt<BookingCtn>();
if (currInfo == null)
{
contaInfo.BILLID = orderInfo.Id;
contaInfo.CreatedTime = DateTime.Now;
contaInfo.CreatedUserId = UserManager.UserId;
contaInfo.CreatedUserName = UserManager.Name;
contaInfo.UpdatedTime = contaInfo.CreatedTime;
contaInfo.UpdatedUserId = UserManager.UserId;
contaInfo.UpdatedUserName = UserManager.Name;
return new { OperType = "insert", obj = contaInfo };
}
else
{
currInfo.Id = contaInfo.Id;
currInfo.BILLID = contaInfo.BILLID;
currInfo.UpdatedTime = DateTime.Now;
currInfo.UpdatedUserId = UserManager.UserId;
currInfo.UpdatedUserName = UserManager.Name;
return new { OperType = "update", obj = currInfo };
}
}).ToList();
var delList = orderCtnList.GroupJoin(contaList, l => l.CNTRNO?.Trim(), r => r.CONTA_NO?.Trim(), (l, r) => {
var currInfo = r.FirstOrDefault();
if (currInfo == null)
{
l.UpdatedTime = DateTime.Now;
l.UpdatedUserId = UserManager.UserId;
l.UpdatedUserName = UserManager.Name;
return new { OperType = "delete", obj = l };
}
return new { OperType = string.Empty, obj = l };
}).Where(t => t.OperType != string.Empty).ToList();
if (delList.Count > 0)
si2orderCtnList.AddRange(delList);
if (si2orderCtnList.Count > 0)
{
si2orderCtnList.ForEach(async ctn =>
{
if (ctn.OperType == "insert")
{
//插入
await _bookingOrderContaRepository.InsertAsync(ctn.obj);
}
else if (ctn.OperType == "update")
{
//更新
await _bookingOrderContaRepository.AsUpdateable(ctn.obj).UpdateColumns(it => new
{
it.CTNALL,
it.SEALNO,
it.PKGS,
it.KGS,
it.CBM,
it.UpdatedTime,
it.UpdatedUserId,
it.UpdatedUserName,
}).ExecuteCommandAsync();
}
else if (ctn.OperType == "delete")
{
await _bookingOrderContaRepository.DeleteAsync(x => x.Id == ctn.obj.Id);
}
});
}
result.succ = true;
result.msg = "更新订舱成功";
}
catch(Exception ex)
{
throw Oops.Bah($"更新订舱VGM比较更新异常,{0}", ex.Message);
}
return result;
}
#endregion
}
#region 样本业务提取帮助类
@ -2555,4 +3289,28 @@ namespace Myshipping.Application
}
}
#endregion
#region 整理文本数据
public static class CompareObjExtension
{
/// <summary>
/// 整理文本数据
/// </summary>
/// <param name="str">文本</param>
/// <returns></returns>
public static string AdjustString(this string str)
{
if (string.IsNullOrWhiteSpace(str))
return str;
var rtn = str.Replace("\r\n", "\n").Trim();
if (rtn.EndsWith("\n"))
{
rtn = rtn.Substring(0, rtn.Length - 1);
}
return rtn;
}
}
#endregion
}

Loading…
Cancel
Save