新增下货纸比对

usertest
jianghaiqing 4 months ago
parent eab290907e
commit b689af2ef6

@ -29,9 +29,9 @@
<Folder Include="TaskPlat\Interface\TransplanHasChange\" />
<Folder Include="TaskPlat\Interface\POLContainerNotPickUp\" />
<Folder Include="TaskPlat\Interface\Draft\" />
<Folder Include="TaskPlat\Interface\ShippingOrderCompare\" />
<Folder Include="TaskPlat\Interface\PODDischargeGateoutFull\" />
<Folder Include="TaskPlat\Interface\RollingNomination\" />
<Folder Include="TaskPlat\Method\Draft\" />
</ItemGroup>
<ItemGroup>

@ -196,4 +196,45 @@ namespace DS.WMS.Core.Op.Dtos
/// </summary>
public string Reason { get; set; }
}
/// <summary>
/// 下货纸比对回写
/// </summary>
public class ShippingOrderCompareCallBackInfo
{
/// <summary>
/// 请求主键
/// </summary>
public string reqBusiId { get; set; }
/// <summary>
/// 比对ID
/// </summary>
public string compareId { get; set; }
/// <summary>
/// 下货纸比对方式 MANUAL-手动 AUTO-自动
/// </summary>
public string compareMode { get; set; } = "AUTO";
/// <summary>
/// 比对结果代码
/// </summary>
public string compareRltCode { get; set; }
/// <summary>
/// 比对结果名称
/// </summary>
public string compareRltName { get; set; }
/// <summary>
/// 比对日期
/// </summary>
public DateTime compareDate { get; set; }
/// <summary>
/// 比对详情
/// </summary>
public List<CompareResultDetailInfo> compareDetailList { get; set; }
}
}

@ -1388,4 +1388,35 @@ public class SeaExport : BaseOrgModel<long>
/// </summary>
[SugarColumn(ColumnDescription = "申请箱使", IsNullable = true, Length = 100)]
public string ApplyCtnRemark { get; set; }
/// <summary>
/// 最后下货纸比对状态 NO_DIFF-无异常;DIFF-有差异;NO_YARD-无场站数据;EXPT-异常
/// </summary>
[SugarColumn(ColumnDescription = "最后下货纸比对状态", IsNullable = true, Length = 20)]
public string LstShipOrderCompareRlt { get; set; }
/// <summary>
/// 最后下货纸比对时间
/// </summary>
[SugarColumn(ColumnDescription = "最后下货纸比对时间", IsNullable = true)]
public Nullable<DateTime> LstShipOrderCompareDate { get; set; }
/// <summary>
/// 最后下货纸比对批次号
/// </summary>
[SugarColumn(ColumnDescription = "最后下货纸比对批次号", IsNullable = true, Length = 64)]
public string LstShipOrderCompareId { get; set; }
/// <summary>
/// 最后下货纸比对状态 NO_DIFF-无异常;DIFF-有差异;NO_YARD-无场站数据;EXPT-异常
/// </summary>
[SugarColumn(ColumnDescription = "最后下货纸比对状态", IsNullable = true, Length = 30)]
public string LstShipOrderCompareRltName { get; set; }
/// <summary>
/// 最后下货纸比对方式 MANUAL-手动 AUTO-自动
/// </summary>
[SugarColumn(ColumnDescription = "最后下货纸比对方式 MANUAL-手动 AUTO-自动", IsNullable = true, Length = 20)]
public string LstShipOrderCompareMode { get; set; }
}

@ -201,6 +201,7 @@ namespace DS.WMS.Core.TaskPlat.Dtos.Mapper
.Map(dest => dest.RETURN_CTN_YARD, src => src.ReturnCTNYard);
}
//
{
TypeAdapterConfig<TaskCutDateChangeDetailInfo, TaskCutDateChangeShowDto>.NewConfig().TwoWays()
.Map(dest => dest.MBLNo, src => src.MBL_NO)
@ -227,6 +228,7 @@ namespace DS.WMS.Core.TaskPlat.Dtos.Mapper
.Map(dest => dest.VoucherCutoffTime, src => src.VOUCHER_CUT_DATE);
}
//
{
TypeAdapterConfig<SeaExport, TaskBookingOrderDto>.NewConfig().TwoWays()
.Map(dest => dest.MasterBlNo, src => src.MBLNO)
@ -234,14 +236,14 @@ namespace DS.WMS.Core.TaskPlat.Dtos.Mapper
.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.ToString())
.Map(dest => dest.ConsigneeId, src => src.ConsigneeId.ToString())
.Map(dest => dest.NotifyPartyId, src => src.NotifyPartyId.ToString())
.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.SecondNotifyParty)
.Map(dest => dest.YardId, src => src.YardId.ToString())
.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)
@ -250,24 +252,24 @@ namespace DS.WMS.Core.TaskPlat.Dtos.Mapper
.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.ReceiptPlaceId.ToString())
//.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.ReceiptPlaceId)
.Map(dest => dest.PlaceReceipt, src => src.ReceiptPlace)
.Map(dest => dest.PortLoadId, src => src.LoadPortId.ToString())
.Map(dest => dest.PortLoadId, src => src.LoadPortId)
.Map(dest => dest.PortLoad, src => src.LoadPort)
.Map(dest => dest.PortDischargeId, src => src.DischargePortId.ToString())
.Map(dest => dest.PortDischargeId, src => src.DischargePortId)
.Map(dest => dest.PortDischarge, src => src.DischargePort)
.Map(dest => dest.PlaceDeliveryId, src => src.DeliveryPlaceId.ToString())
.Map(dest => dest.PlaceDeliveryId, src => src.DeliveryPlaceId)
.Map(dest => dest.PlaceDelivery, src => src.DeliveryPlace)
.Map(dest => dest.DestinationId, src => src.DestinationId.ToString())
.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.ToString())
//.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.MBLFrt)
.Map(dest => dest.PrepardAt, src => src.PrepareAt)
@ -282,7 +284,7 @@ namespace DS.WMS.Core.TaskPlat.Dtos.Mapper
.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.ToString())
.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.DangerClass)
@ -290,7 +292,6 @@ namespace DS.WMS.Core.TaskPlat.Dtos.Mapper
.Map(dest => dest.DPage, src => src.DangerPage)
.Map(dest => dest.DLabel, src => src.DangerLabel)
.Map(dest => dest.DLinkMan, src => src.LinkMan)
//.Map(dest => dest.TempId, src => src.Temperature)
.Map(dest => dest.TempSet, src => src.TemperatureSet)
.Map(dest => dest.Reeferf, src => src.ReeferQuantity)
.Map(dest => dest.Humidity, src => src.Humidity)
@ -300,62 +301,28 @@ namespace DS.WMS.Core.TaskPlat.Dtos.Mapper
.Map(dest => dest.SORemark, src => src.BookingRemark)
.Map(dest => dest.SIRemark, src => src.CloseDocRemark)
.Map(dest => dest.YardRemark, src => src.YardRemark)
//.Map(dest => dest.ShipperName, src => src.Shipper)
//.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.Consignee)
//.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.NotifyParty)
//.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.ToString())
.Map(dest => dest.ForwarderId, src => src.ForwarderId.ToString())
.Map(dest => dest.ShipAgencyId, src => src.ShipAgencyId.ToString())
.Map(dest => dest.CustomsERId, src => src.CustomserId.ToString())
.Map(dest => dest.TruckERId, src => src.TruckerId.ToString())
.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.Agent)
//.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.PrepareAtId.ToString())
.Map(dest => dest.PayableAtId, src => src.PayableAtId.ToString())
.Map(dest => dest.PrePardAtId, src => src.PrepareAtId)
.Map(dest => dest.PayableAtId, src => src.PayableAtId)
.Map(dest => dest.CustNo, src => src.CustomerNo)
.Map(dest => dest.TransportId, src => src.TransPortId.ToString())
.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.YardTel)
.Map(dest => dest.YardContractEmail, src => src.YardATTN)
//.Map(dest => dest.FeeSelf, src => src.fees)
.Map(dest => dest.LaneCode, src => src.LaneId.ToString())
.Map(dest => dest.LaneCode, src => src.LaneId)
.Map(dest => dest.LaneName, src => src.Lane);
//.Map(dest => dest.FreightPayer, src => src.fri);
}
//
{
TypeAdapterConfig<OpCtn, TaskBookingOrderContaDto>.NewConfig().TwoWays()
.Map(dest => dest.ContaType, src => src.CtnCode)
@ -379,7 +346,7 @@ namespace DS.WMS.Core.TaskPlat.Dtos.Mapper
.Map(dest => dest.VGMEmail, src => src.VGMEmail);
//.Map(dest => dest.Remark, src => src.REMARK);
}
//
{
TypeAdapterConfig<OpCtnDetail, TaskBookingOrderCargoDto>.NewConfig().TwoWays()
.Map(dest => dest.PKGs, src => src.PKGS)

@ -0,0 +1,359 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DS.WMS.Core.TaskPlat.Dtos
{
public class TaskMessageInfoDto
{
/// <summary>
/// 表头
/// </summary>
public TaskMessageHead Head { get; set; }
/// <summary>
/// 表体
/// </summary>
public TaskMessageMain Main { get; set; }
}
/// <summary>
/// 报文表体
/// </summary>
public class TaskMessageMain
{
/// <summary>
/// 业务惟一主键
/// </summary>
public string BusiPKId { get; set; }
/// <summary>
/// 比对ID
/// </summary>
public string TaskCompareId { get; set; }
/// <summary>
/// 用户ID
/// </summary>
public string UserId { get; set; }
/// <summary>
/// 用户名称
/// </summary>
public string UserName { get; set; }
/// <summary>
/// 用户邮件
/// </summary>
public string UserEmail { get; set; }
/// <summary>
/// 租户ID
/// </summary>
public string TenantId { get; set; }
/// <summary>
/// 租户名称
/// </summary>
public string TenantName { get; set; }
/// <summary>
/// 场站代码
/// </summary>
public string YardCode { get; set; }
/// <summary>
/// 场站中文名称
/// </summary>
public string YardCName { get; set; }
/// <summary>
/// 船名英文名
/// </summary>
public string VesselName { get; set; }
/// <summary>
/// 船名中文名
/// </summary>
public string VesselCName { get; set; }
/// <summary>
/// 航次号
/// </summary>
public string VoyNo { get; set; }
/// <summary>
/// 主提单号
/// </summary>
public string MasterBlNo { get; set; }
/// <summary>
/// 分提单号
/// </summary>
public string HouseBlNo { get; set; }
/// <summary>
/// 订舱编号
/// </summary>
public string BookingNo { get; set; }
/// <summary>
/// 起运港代码
/// </summary>
public string PortLoadId { get; set; }
/// <summary>
/// 起运港
/// </summary>
public string PortLoad { get; set; }
/// <summary>
/// 卸货港代码
/// </summary>
public string PortDischargeId { get; set; }
/// <summary>
/// 卸货港
/// </summary>
public string PortDischarge { get; set; }
/// <summary>
/// 中转港代码
/// </summary>
public string TransportId { get; set; }
/// <summary>
/// 中转港
/// </summary>
public string Transport { get; set; }
/// <summary>
/// 交货地代码
/// </summary>
public string PlaceDeliveryId { get; set; }
/// <summary>
/// 交货地
/// </summary>
public string PlaceDelivery { get; set; }
/// <summary>
/// 目的港代码
/// </summary>
public string DestinationId { get; set; }
/// <summary>
/// 目的港
/// </summary>
public string Destination { get; set; }
/// <summary>
/// 件数
/// </summary>
public Int32 PKGs { get; set; }
/// <summary>
/// 毛重
/// </summary>
public Nullable<decimal> KGs { get; set; }
/// <summary>
/// 尺码
/// </summary>
public Nullable<decimal> CBM { get; set; }
/// <summary>
/// 主等级(危险品)
/// </summary>
public string DClass { get; set; }
/// <summary>
/// 国际危险品编号(危险品)
/// </summary>
public string DUNNo { get; set; }
/// <summary>
/// 副等级(危险品)
/// </summary>
public string FuDClass { get; set; }
/// <summary>
/// 副国际危险品编号(危险品)
/// </summary>
public string FuDUNNo { get; set; }
/// <summary>
/// 海污(危险品)
/// </summary>
public string HaiWu { get; set; }
/// <summary>
/// 温度(冻柜)
/// </summary>
public string TempSet { get; set; }
/// <summary>
/// 通风(冻柜)
/// </summary>
public string Reeferf { get; set; }
/// <summary>
/// 湿度(冻柜)
/// </summary>
public string Humidity { get; set; }
/// <summary>
/// 货描
/// </summary>
public string GoodsDescription { get; set; }
/// <summary>
/// 船公司代码
/// </summary>
public string CarrierCode { get; set; }
/// <summary>
/// 箱信息列表
/// </summary>
public List<TaskMessageCtnInfo> ContaList { get; set; }
}
/// <summary>
/// 箱信息
/// </summary>
public class TaskMessageCtnInfo
{
/// <summary>
/// 集装箱箱型代码
/// </summary>
public string ContaType { get; set; }
/// <summary>
/// 集装箱箱型名称
/// </summary>
public string ContaTypeName { get; set; }
/// <summary>
/// 集装箱箱号
/// </summary>
public string ContaNo { get; set; }
/// <summary>
/// 铅封号
/// </summary>
public string SealNo { get; set; }
/// <summary>
/// 包装
/// </summary>
public string KindPKGs { get; set; }
/// <summary>
/// 皮重
/// </summary>
public string TareWeight { get; set; }
/// <summary>
/// 件数
/// </summary>
public Int32 PKGs { get; set; }
/// <summary>
/// 毛重
/// </summary>
public Nullable<decimal> KGs { get; set; }
/// <summary>
/// 尺码
/// </summary>
public Nullable<decimal> CBM { get; set; }
/// <summary>
/// 箱量
/// </summary>
public int CtnNum { get; set; }
}
/// <summary>
/// 报文表头
/// </summary>
public class TaskMessageHead : WebAPIHeadBase
{
}
public class WebAPIHeadBase
{
/// <summary>
/// 报文惟一主键
/// </summary>
/// <example>08dab66c-96a1-4f90-8606-2626e06202ad</example>
[Required(ErrorMessage = "必填")]
public string GID { get; set; }
/// <summary>
/// 报文类型 BUSI_RULE-业务规则校验
/// </summary>
/// <example>BUSI_RULE</example>
[Required(ErrorMessage = "必填")]
public string MessageType { get; set; }
/// <summary>
/// 发送方代码
/// </summary>
/// <example>CUSTOMER1</example>
[Required(ErrorMessage = "必填")]
public string SenderId { get; set; }
/// <summary>
/// 发送方名称
/// </summary>
/// <example>企业A</example>
[Required(ErrorMessage = "必填")]
public string SenderName { get; set; }
/// <summary>
/// 接收方代码
/// </summary>
/// <example>RulesEngine</example>
[Required(ErrorMessage = "必填")]
public string ReceiverId { get; set; }
/// <summary>
/// 接收方名称
/// </summary>
/// <example>大简云规则引擎</example>
[Required(ErrorMessage = "必填")]
public string ReceiverName { get; set; }
/// <summary>
/// 请求方登录TOKEN可以是真实的登录人TOKEN或者是服务模拟登录人TOKEN
/// </summary>
/// <example>eyJhbGciOiJSUzI1NiIsImtpZCI6IkQ1RTkxMDI5OUU0RURFNUZEM0EwNTJBMEFDRDUzMUQzIiwidHlwIjoiYXQrand0In0</example>
public string Token { get; set; }
/// <summary>
/// 版本号 默认1.0
/// </summary>
/// <example>1.0</example>
[Required(ErrorMessage = "必填")]
public string Version { get; set; } = "1.0";
/// <summary>
/// 请求时间
/// </summary>
/// <example>2022-10-10 10:00:00</example>
public string RequestDate { get; set; }
/// <summary>
/// 请求操作类型
/// </summary>
/// <example>Add</example>
[Required(ErrorMessage = "必填")]
public string RequestAction { get; set; } = "Add";
}
}

@ -0,0 +1,72 @@
using DS.Module.Core.Data;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DS.WMS.Core.TaskPlat.Entity
{
/// <summary>
/// 格式单比对反馈记录表
/// </summary>
[SugarTable("draft_compare_feedback_record", "格式单比对反馈记录表")]
public class DraftCompareFeedBackRecord : BaseModelV2<long>
{
/// <summary>
/// 订舱主键,关联订舱主表ID
/// </summary>
[SugarColumn(ColumnDescription = "订舱主键,关联订舱主表ID", IsNullable = false)]
public long BOOKING_ID { get; set; }
/// <summary>
/// 主提单号
/// </summary>
[SugarColumn(ColumnDescription = "主提单号", IsNullable = false)]
public string MBLNO { get; set; }
/// <summary>
/// 比对主键
/// </summary>
[SugarColumn(ColumnDescription = "比对主键", IsNullable = false)]
public string TASK_COMPARE_ID { get; set; }
/// <summary>
/// 是否识别问题 1-时 0-否
/// </summary>
[SugarColumn(ColumnDescription = "是否识别问题 1-时 0-否", IsNullable = false)]
public bool IS_OCR_ERROR { get; set; }
/// <summary>
/// 是否订舱录入问题 1-是 0-否
/// </summary>
[SugarColumn(ColumnDescription = "是否订舱录入问题 1-是 0-否", IsNullable = false)]
public bool IS_EDIT_ERROR { get; set; }
/// <summary>
/// 是否代理录入问题 1-是 0-否
/// </summary>
[SugarColumn(ColumnDescription = "是否代理录入问题 1-是 0-否", IsNullable = false)]
public bool IS_AGENT_ERROR { get; set; }
/// <summary>
/// 备注
/// </summary>
[SugarColumn(ColumnDescription = "备注", IsNullable = false)]
public string NOTES { get; set; }
/// <summary>
/// 比对类型 DRAFT-格式单比对SHIPORDER-下货纸比对
/// </summary>
[SugarColumn(ColumnDescription = "比对类型", IsNullable = false)]
public string COMPARE_TYPE { get; set; }
/// <summary>
/// 比对完成时间
/// </summary>
[SugarColumn(ColumnDescription = "比对完成时间", IsNullable = false)]
public Nullable<DateTime> COMPARE_TIME { get; set; }
}
}

@ -0,0 +1,52 @@
using DS.WMS.Core.Op.Dtos;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DS.WMS.Core.TaskPlat.Interface
{
/// <summary>
/// 下货纸比对
/// </summary>
public interface ITaskShippingOrderCompareService
{
/// <summary>
/// 执行下货纸比对
/// </summary>
/// <param name="bookingId">订舱主键</param>
/// <returns>返回回执</returns>
Task<TaskManageExcuteResultDto> ExcuteShippingOrderCompareAsync(string bookingId);
/// <summary>
/// 批量执行下货纸比对
/// </summary>
/// <param name="bookingIds">订舱主键组</param>
/// <returns>返回回执</returns>
Task<TaskManageExcuteResultDto> ExcuteShippingOrderCompareBatchAsync(string[] bookingIds);
/// <summary>
/// 下货纸自动比对回写状态
/// </summary>
/// <param name="model">比对回写详情</param>
/// <returns>返回回执</returns>
Task<TaskManageExcuteResultDto> AutoTaskShippingOrderCompareCallBackAsync(ShippingOrderCompareCallBackInfo model);
/// <summary>
/// 自动执行下货纸比对
/// </summary>
/// <param name="bookingId">订舱主键</param>
/// <returns>返回回执</returns>
Task<TaskManageExcuteResultDto> ExcuteAutoShippingOrderCompareAsync(string bookingId);
/// <summary>
/// 获取下货纸比对结果
/// </summary>
/// <param name="bookingId">订舱主键</param>
/// <returns>返回回执</returns>
Task<TaskManageExcuteResultDto> GetShippingOrderCompareResult(long bookingId);
}
}

@ -0,0 +1,725 @@
using DS.Module.Core;
using DS.Module.Core.Attributes;
using DS.Module.Core.Helpers;
using DS.Module.DjyServiceStatus;
using DS.Module.SqlSugar;
using DS.Module.UserModule;
using DS.WMS.Core.Invoice.Dtos;
using DS.WMS.Core.Op.Dtos;
using DS.WMS.Core.Op.Entity;
using DS.WMS.Core.TaskPlat.Dtos;
using DS.WMS.Core.TaskPlat.Entity;
using DS.WMS.Core.TaskPlat.Interface;
using Mapster;
using Masuit.Tools.Systems;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.DependencyInjection;
using Newtonsoft.Json;
using NLog;
using NPOI.SS.Formula.Functions;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.Json.Nodes;
using System.Threading.Tasks;
namespace DS.WMS.Core.TaskPlat.Method
{
/// <summary>
///
/// </summary>
public class TaskShippingOrderCompareService : ITaskShippingOrderCompareService
{
private readonly IServiceProvider _serviceProvider;
private readonly ISqlSugarClient db;
private readonly IUser user;
private readonly ISaasDbService saasService;
private readonly IDjyServiceStatusService _djyServiceStatusService;
private readonly string shippingOrderCompareUrl;
private readonly string shippingOrderCompareResultUrl;
private static readonly NLog.Logger Logger = LogManager.GetCurrentClassLogger();
public TaskShippingOrderCompareService(IServiceProvider serviceProvider)
{
_serviceProvider = serviceProvider;
db = _serviceProvider.GetRequiredService<ISqlSugarClient>();
user = _serviceProvider.GetRequiredService<IUser>();
saasService = _serviceProvider.GetRequiredService<ISaasDbService>();
_djyServiceStatusService = _serviceProvider.GetRequiredService<IDjyServiceStatusService>();
shippingOrderCompareUrl = AppSetting.app(new string[] { "ShippingOrderCompare", "Url" });
shippingOrderCompareResultUrl = AppSetting.app(new string[] { "ShippingOrderCompare", "ResultUrl" });
}
/// <summary>
/// 执行下货纸比对
/// </summary>
/// <param name="bookingId">订舱主键</param>
/// <returns>返回回执</returns>
[HttpGet("/TaskShippingOrderCompare/ExcuteShippingOrderCompare")]
public async Task<TaskManageExcuteResultDto> ExcuteShippingOrderCompareAsync(string bookingId)
{
string batchNo = GuidHelper.GetSnowflakeId();
Logger.Log(NLog.LogLevel.Info, "批次={no}获取订舱数据请求规则 {id}", batchNo, bookingId);
/*
1
2
3
4
5
*/
return await InnerExcuteShippingOrderCompareAsync(bookingId);
}
#region 执行下货纸比对
/// <summary>
/// 执行下货纸比对
/// </summary>
/// <param name="bookingId">订舱主键</param>
/// <param name="LstShipOrderCompareMode">比对模式MANUAL-手工 AUTO-自动)</param>
/// <returns>返回回执</returns>
private async Task<TaskManageExcuteResultDto> InnerExcuteShippingOrderCompareAsync(string bookingId,
string LstShipOrderCompareMode = "MANUAL")
{
string batchNo = GuidHelper.GetSnowflakeId();
Logger.Log(NLog.LogLevel.Info, "批次={no}获取订舱数据请求规则 {id}", batchNo, bookingId);
/*
1
2
3
4
5
*/
TaskManageExcuteResultDto result = new TaskManageExcuteResultDto();
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
try
{
DateTime nowDate = DateTime.Now;
long id = long.Parse(bookingId);
var model = tenantDb.Queryable<SeaExport>()
.First(a => a.Id == id);
if (model == null)
throw new Exception($"订舱主键{bookingId}无法获取业务信息");
Logger.Log(NLog.LogLevel.Info, "批次={no}获取订舱数据完成", batchNo);
//附主信息
var mainInfo = model.Adapt<TaskMessageMain>();
mainInfo.BusiPKId = model.Id.ToString();
mainInfo.UserId = user.UserId;
mainInfo.UserName = user.UserName;
//mainInfo.UserEmail = user.;
var contaList = await tenantDb.Queryable<OpCtn>()
.Where(x => long.Parse(x.BSNO) == model.Id).ToListAsync();
Logger.Log(NLog.LogLevel.Info, "批次={no} 提取箱完成 数量={total}", batchNo, contaList.Count);
if (contaList.Count > 0)
{
mainInfo.ContaList = contaList.Adapt<List<TaskMessageCtnInfo>>();
}
var msgModel = GetMessageInfo(batchNo, mainInfo);
Logger.Log(NLog.LogLevel.Info, "批次={no} 对应请求报文完成 msg={msg}", batchNo, JsonConvert.SerializeObject(msgModel));
DateTime bDate = DateTime.Now;
var compareResult = await ExcuteCompare(msgModel);
DateTime eDate = DateTime.Now;
TimeSpan ts = eDate.Subtract(bDate);
var timeDiff = ts.TotalMilliseconds;
Logger.Log(NLog.LogLevel.Info, "批次={no} 请求完成,耗时:{timeDiff}ms. 结果{msg}", batchNo, timeDiff, compareResult.succ ? "成功" : "失败");
if (compareResult == null)
throw new Exception($"订舱主键{bookingId}请求下货纸比对失败,返回为空");
var orderInfo = tenantDb.Queryable<SeaExport>()
.First(x => x.Id == id);
if (orderInfo != null)
{
var oldOrderInfo = orderInfo.Adapt<SeaExport>();
orderInfo.LstShipOrderCompareDate = bDate;
if (compareResult.succ)
{
orderInfo.LstShipOrderCompareMode = LstShipOrderCompareMode;
/*
isComplete
1
2
*/
bool isComplete = false;
bool isBefore = false;
//需要细分状态,返场前和返场后
if (compareResult.yardStatInfo != null)
{
var yardStatInfo = compareResult.yardStatInfo as YardStatInfo;
//如果场站集装箱都有了返场时间,即认为下货纸自动任务结束
if (yardStatInfo.LstReturnYardDate.HasValue && yardStatInfo.ContaNum >= 1 &&
yardStatInfo.ContaNum == yardStatInfo.ExistsReturnYardDateCtnNum)
{
isComplete = true;
}
//判断 有箱号的条数跟总计箱数量不一致 认为是反场前比对
if ((yardStatInfo.ExistsCtnNo < yardStatInfo.ContaNum))
isBefore = true;
}
DateTime etd = DateTime.MinValue;
if (model.ATD.HasValue)
{
etd = model.ATD.Value;
}
else if (model.ETD.HasValue)
{
etd = model.ETD.Value;
}
if (etd != DateTime.MinValue && etd <= DateTime.Now)
isComplete = true;
if (compareResult.extra.IsExistsDiff)
{
if (isComplete)
{
orderInfo.LstShipOrderCompareRlt = "DIFF";
orderInfo.LstShipOrderCompareRltName = "有差异";
}
else
{
bool isBeforeEqual = false;
var checkList = compareResult.extra.ShowDetailList.Where(b =>
(b.PCode == null || b.PCode == "") && b.IsDisplay &&
(b.FieldCode.ToUpper() != "PKGS" && b.FieldCode.ToUpper() != "KGS" && b.FieldCode.ToUpper() != "CBM"))
.ToList();
if (!checkList.Any(t => t.IsDiff))
{
isBeforeEqual = true;
}
if (isBefore)
{
if (isBeforeEqual)
{
orderInfo.LstShipOrderCompareRlt = "BEFORE_EQUAL";
orderInfo.LstShipOrderCompareRltName = "返场前比对正常";
}
else
{
orderInfo.LstShipOrderCompareRlt = "BEFORE_DIFF";
orderInfo.LstShipOrderCompareRltName = "返场前比对有差异";
}
}
else
{
orderInfo.LstShipOrderCompareRlt = "DIFF_U";
orderInfo.LstShipOrderCompareRltName = "有差异未结束";
}
}
}
else
{
if (isComplete)
{
orderInfo.LstShipOrderCompareRlt = "NO_DIFF";
orderInfo.LstShipOrderCompareRltName = "正常";
//比对成功后触发下货纸比对状态
var pushModel = new EmbedServiceProjectStatusDto
{
businessId = bookingId,
SourceType = 1,
StatusCodes = new List<EmbedServiceProjectStatusDetailDto> {
new EmbedServiceProjectStatusDetailDto{
StatusCode = "XHZBDCHG"
}
}
};
var saveStatusRlt = await _djyServiceStatusService.SaveServiceStatus(pushModel);
Logger.Log(NLog.LogLevel.Info, "批次={no} 异步推送下货纸比对状态完成,结果={rlt}", batchNo, JsonConvert.SerializeObject(saveStatusRlt));
}
else
{
if (isBefore)
{
orderInfo.LstShipOrderCompareRlt = "BEFORE_EQUAL";
orderInfo.LstShipOrderCompareRltName = "返场前比对正常";
}
else
{
orderInfo.LstShipOrderCompareRlt = "NO_DIFF_U";
orderInfo.LstShipOrderCompareRltName = "正常未结束";
//比对成功后触发下货纸比对状态
var pushModel = new EmbedServiceProjectStatusDto
{
businessId = bookingId,
SourceType = 1,
StatusCodes = new List<EmbedServiceProjectStatusDetailDto> {
new EmbedServiceProjectStatusDetailDto{
StatusCode = "XHZBDCHG"
}
}
};
var saveStatusRlt = await _djyServiceStatusService.SaveServiceStatus(pushModel);
Logger.Log(NLog.LogLevel.Info, "批次={no} 异步推送下货纸比对状态完成,结果={rlt}", batchNo, JsonConvert.SerializeObject(saveStatusRlt));
}
}
}
}
else
{
orderInfo.LstShipOrderCompareRlt = "NO_YARD";
orderInfo.LstShipOrderCompareRltName = "无动态";
}
if (compareResult.extra != null)
orderInfo.LstShipOrderCompareId = compareResult.extra.TaskCompareId;
//更新
await tenantDb.Updateable<SeaExport>(orderInfo).UpdateColumns(it => new
{
it.LstShipOrderCompareId,
it.LstShipOrderCompareDate,
it.LstShipOrderCompareRlt,
it.LstShipOrderCompareRltName,
it.LstShipOrderCompareMode,
}).ExecuteCommandAsync();
// 记录日志
//await _bookingOrderService.SaveLog(orderInfo, oldOrderInfo, "下货纸比对");
}
result.succ = compareResult.succ;
result.msg = compareResult.msg;
result.extra = compareResult.extra;
result.extra2 = compareResult.extra2;
result.total = compareResult.total;
result.yardStatInfo = compareResult.yardStatInfo;
Logger.Log(NLog.LogLevel.Info, "批次={no} 请求下货纸比对返回结果{msg}", batchNo, JsonConvert.SerializeObject(compareResult));
Logger.Log(NLog.LogLevel.Info, "批次={no} 返回结果{msg}", batchNo, JsonConvert.SerializeObject(result));
}
catch (Exception ex)
{
result.succ = false;
result.msg = $"请求下货纸比对异常,{ex.Message}";
}
return result;
}
#endregion
#region 生成请求规则报文
/// <summary>
/// 生成请求规则报文
/// </summary>
/// <param name="batchNo">批次号</param>
/// <param name="mainInfo">订舱主业务信息</param>
/// <returns>返回请求报文类</returns>
private TaskMessageInfoDto GetMessageInfo(string batchNo, TaskMessageMain mainInfo)
{
DateTime nowDate = DateTime.Now;
TaskMessageInfoDto msgModel = new TaskMessageInfoDto();
msgModel.Head = new TaskMessageHead
{
GID = batchNo,
MessageType = "SHIP_ORDER_COMPARE",
SenderId = AppSetting.app(new string[] { "ExcuteRuleService", "RulesEngineSender" }),
SenderName = AppSetting.app(new string[] { "ExcuteRuleService", "RulesEngineSenderName" }),
ReceiverId = "RulesEngine",
ReceiverName = "大简云规则引擎",
Version = "1.0",
RequestDate = nowDate.ToString("yyyy-MM-dd HH:mm:ss"),
RequestAction = "Compare",
};
msgModel.Main = mainInfo;
return msgModel;
}
#endregion
#region 请求下货纸比对
/// <summary>
/// 请求下货纸比对
/// </summary>
/// <param name="BusinessMsg"></param>
/// <returns></returns>
private async Task<TaskManageExcuteResultDto> ExcuteCompare(TaskMessageInfoDto info)
{
TaskManageExcuteResultDto model = null;
/*
1URL
2JSON
3POST
4
*/
try
{
//var res = await url.OnClientCreating(client => {
// // client 为 HttpClient 对象
// client.Timeout = TimeSpan.FromMinutes(15); // 设置超时时间 15分钟
//}).SetHttpMethod(HttpMethod.Post)
// .SetBody(JsonConvert.SerializeObject(info), "application/json")
// .SetContentEncoding(Encoding.UTF8)
//.PostAsync();
var jsonBody = JsonConvert.SerializeObject(info);
var res = RequestHelper.Post(jsonBody, shippingOrderCompareUrl);
Logger.Log(NLog.LogLevel.Info, string.Format("批次={no} 对应请求报文完成 res={res}", info.Head.GID, res));
if (!string.IsNullOrWhiteSpace(res))
{
//var userResult = await res.Content.ReadAsStringAsync();
model = JsonConvert.DeserializeObject<TaskManageExcuteResultDto>(res);
}
}
catch (Exception ex)
{
//写日志
if (ex is HttpRequestException)
throw new Exception("请求失败");
}
return model;
}
#endregion
#region 请求下货纸比对结果
/// <summary>
/// 请求下货纸比对结果
/// </summary>
/// <param name="bookingId">订舱主键</param>
/// <returns></returns>
/// <exception cref="Exception"></exception>
public async Task<TaskManageExcuteResultDto> GetShippingOrderCompareResult(long bookingId)
{
string batchNo = GuidHelper.GetSnowflakeId();
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
TaskManageExcuteResultDto result = new TaskManageExcuteResultDto();
try
{
var model = tenantDb.Queryable<SeaExport>()
.First(a => a.Id == bookingId);
DateTime nowDate = DateTime.Now;
TaskMessageInfoDto msgModel = new TaskMessageInfoDto
{
Head = new TaskMessageHead
{
GID = batchNo,
MessageType = "DRAFT_COMPARE",
SenderId = AppSetting.app(new string[] { "ExcuteRuleService", "RulesEngineSender" }),
SenderName = AppSetting.app(new string[] { "ExcuteRuleService", "RulesEngineSenderName" }),
ReceiverId = "RulesEngine",
ReceiverName = "大简云规则引擎",
Version = "1.0",
RequestDate = nowDate.ToString("yyyy-MM-dd HH:mm:ss"),
RequestAction = "Compare",
},
Main = new TaskMessageMain
{
BusiPKId = bookingId.ToString(),
TaskCompareId = model.LstShipOrderCompareId,
}
};
Logger.Log(NLog.LogLevel.Info, $"开始请求查询 msg={JsonConvert.SerializeObject(msgModel)}");
result = await GetCompareResult(msgModel);
if (result != null && result.extra != null && !string.IsNullOrWhiteSpace(result.extra.TaskCompareId))
{
var feedBack = tenantDb.Queryable<DraftCompareFeedBackRecord>().First(a => a.BOOKING_ID == bookingId
&& a.TASK_COMPARE_ID == result.extra.TaskCompareId);
if (feedBack != null)
{
result.extra.ManualFeedBackResult = new FeedBackResult
{
OperNote = feedBack.NOTES,
OperTime = feedBack.CreateTime,
OperUser = feedBack.CreateUserName,
Reason = (feedBack.IS_OCR_ERROR ? "识别问题 " : "") + (feedBack.IS_EDIT_ERROR ? "录入问题 " : "") + (feedBack.IS_AGENT_ERROR ? "代理录入问题 " : "")
};
}
}
}
catch (Exception ex)
{
Logger.Log(NLog.LogLevel.Info, "获取Draft比对结果异常原因{error}", ex.Message);
throw new Exception($"获取Draft比对结果异常原因{ex.Message}");
}
return result;
}
#endregion
#region 获取Draft比对结果
/// <summary>
/// 获取Draft比对结果
/// </summary>
/// <param name="info">请求报文</param>
/// <returns>返回回执</returns>
private async Task<TaskManageExcuteResultDto> GetCompareResult(TaskMessageInfoDto info)
{
TaskManageExcuteResultDto model = null;
try
{
//var res = await url.SetHttpMethod(HttpMethod.Post)
// .SetBody(JSON.Serialize(info), "application/json")
// .SetContentEncoding(Encoding.UTF8)
//.PostAsync();
var jsonBody = JsonConvert.SerializeObject(info);
var res = RequestHelper.Post(jsonBody, shippingOrderCompareResultUrl);
Logger.Log(NLog.LogLevel.Info, string.Format("批次={no} 对应请求报文完成 res={res}", info.Head.GID, res));
if (!string.IsNullOrWhiteSpace(res))
{
//var userResult = await res.Content.ReadAsStringAsync();
Logger.Log(NLog.LogLevel.Info, "对应请求报文 userResult={userResult}", res);
model = JsonConvert.DeserializeObject<TaskManageExcuteResultDto>(res);
}
}
catch (Exception ex)
{
//写日志
if (ex is HttpRequestException)
throw new Exception("请求失败");
}
return model;
}
#endregion
public async Task<TaskManageExcuteResultDto> ExcuteShippingOrderCompareBatchAsync([FromBody] string[] bookingIds)
{
TaskManageExcuteResultDto result = new TaskManageExcuteResultDto();
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
try
{
var ids = bookingIds.Select(a => long.Parse(a)).Distinct().ToArray();
var list = tenantDb.Queryable<SeaExport>().Where(t => ids.Contains(t.Id)).ToList();
if (list.Count != ids.Length)
{
var noRecord = string.Join(",", ids.GroupJoin(list, l => l, r => r.Id, (l, r) =>
{
var currList = r.ToList();
if (r.Count() > 0)
return 0;
return l;
}).Where(t => t > 0).ToArray());
throw new Exception($"以下主键信息 {noRecord} 检索失败或者已作废过");
}
//这里单票下货纸比对时,等待结果返回
if (ids.Length == 1)
{
result = await InnerExcuteShippingOrderCompareAsync(list.FirstOrDefault().Id.ToString());
}
else
{
List<Task<TaskManageExcuteResultDto>> listOfTasks = new List<Task<TaskManageExcuteResultDto>>();
list.ForEach(entity =>
{
listOfTasks.Add(InnerExcuteShippingOrderCompareAsync(entity.Id.ToString()));
});
await Task.WhenAll<TaskManageExcuteResultDto>(listOfTasks);
result.succ = true;
result.msg = "比对完成";
string rltMsg = string.Empty;
result.rows = listOfTasks.Select(a =>
{
var origId = a.Result.extra.OrigPKId;
var order = list.FirstOrDefault(x => x.Id == long.Parse(origId));
if (a.Result.succ)
{
if (a.Result.total > 0)
{
return new { MblNo = order.MBLNO, Msg = "比对异常", IsDiff = true, rlt = a.Result.succ };
}
return new { MblNo = order.MBLNO, Msg = "比对一致", IsDiff = false, rlt = a.Result.succ };
}
return new { MblNo = order?.MBLNO, Msg = "比对一致", IsDiff = false, rlt = a.Result.succ };
}).ToList();
}
}
catch (Exception ex)
{
result.succ = false;
result.msg = $"请求下货纸比对异常,{ex.Message}";
}
return result;
}
#region 下货纸自动比对回写状态
/// <summary>
/// 下货纸自动比对回写状态
/// </summary>
/// <param name="model">比对回写详情</param>
/// <returns>返回回执</returns>
public async Task<TaskManageExcuteResultDto> AutoTaskShippingOrderCompareCallBackAsync([FromBody] ShippingOrderCompareCallBackInfo model)
{
TaskManageExcuteResultDto result = new TaskManageExcuteResultDto();
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
try
{
if (string.IsNullOrWhiteSpace(model.reqBusiId))
throw new Exception($"订舱主键{model.reqBusiId}不能为空");
if (string.IsNullOrWhiteSpace(model.compareId))
throw new Exception($"比对ID{model.compareId}不能为空");
if (string.IsNullOrWhiteSpace(model.compareMode))
throw new Exception($"下货纸比对方式不能为空{model.compareMode}不能为空");
if (string.IsNullOrWhiteSpace(model.compareRltCode))
throw new Exception($"比对结果代码{model.compareRltCode}不能为空");
if (string.IsNullOrWhiteSpace(model.compareRltName))
throw new Exception($"比对结果名称{model.compareId}不能为空");
var bookingOrder = await tenantDb.Queryable<SeaExport>()
.FirstAsync(a => a.Id == long.Parse(model.reqBusiId));
if (bookingOrder == null)
{
throw new Exception($"订舱信息检索失败ID={model.reqBusiId}");
}
var oldBookingOrder = bookingOrder.Adapt<SeaExport>();
bookingOrder.LstShipOrderCompareId = model.compareId;
bookingOrder.LstShipOrderCompareDate = model.compareDate;
bookingOrder.LstShipOrderCompareRlt = model.compareRltCode;
bookingOrder.LstShipOrderCompareRltName = model.compareRltName;
bookingOrder.LstShipOrderCompareMode = model.compareMode;
//更新
await tenantDb.Updateable<SeaExport>(bookingOrder).UpdateColumns(it => new
{
it.LstShipOrderCompareId,
it.LstShipOrderCompareDate,
it.LstShipOrderCompareRlt,
it.LstShipOrderCompareRltName,
it.LstShipOrderCompareMode,
}).ExecuteCommandAsync();
//await _bookingOrderService.SaveLog(bookingOrder, oldBookingOrder, "下货纸自动比对回写状态");
result.succ = true;
result.msg = "更新完成";
}
catch (Exception ex)
{
result.succ = false;
result.msg = $"下货纸自动比对回写状态失败,{ex.Message}";
}
return result;
}
#endregion
#region 自动执行下货纸比对
/// <summary>
/// 自动执行下货纸比对
/// </summary>
/// <param name="bookingId">订舱主键</param>
/// <returns>返回回执</returns>
public async Task<TaskManageExcuteResultDto> ExcuteAutoShippingOrderCompareAsync(string bookingId)
{
string batchNo = GuidHelper.GetSnowflakeId();
Logger.Log(NLog.LogLevel.Info, "批次={no}获取订舱数据请求规则 {id}", batchNo, bookingId);
/*
1
2
3
4
5
*/
return await InnerExcuteShippingOrderCompareAsync(bookingId, "AUTO");
}
#endregion
}
}

@ -1,6 +1,7 @@
using Amazon.Runtime.Internal.Util;
using DS.Module.Core;
using DS.Module.Core.Constants;
using DS.Module.Core.Helpers;
using DS.Module.DjyServiceStatus;
using DS.Module.SqlSugar;
using DS.Module.UserModule;
@ -24,6 +25,7 @@ using DS.WMS.Core.TaskPlat.Dtos;
using DS.WMS.Core.TaskPlat.Entity;
using DS.WMS.Core.TaskPlat.Interface;
using HtmlAgilityPack;
using LanguageExt.Common;
using Mapster;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Identity;
@ -35,6 +37,7 @@ using NLog;
using NPOI.XWPF.UserModel;
using SqlSugar;
using System.Security.Cryptography;
using System.Text.Json.Nodes;
using System.Text.RegularExpressions;
namespace DS.WMS.Core.TaskPlat.Method
@ -66,7 +69,8 @@ namespace DS.WMS.Core.TaskPlat.Method
//自动转发是否默认抄送操作
const string CONST_AUTO_TRANS_EMAIL_OP_CCTO = "AUTO_TRANS_EMAIL_OP_CCTO";
const string EMAIL_API_URL = "email_api_url";
public TaskManageBCService(IUser user,
ILogger<TaskManageBCService> logger,
@ -1941,10 +1945,10 @@ namespace DS.WMS.Core.TaskPlat.Method
bool result = false;
string msg = string.Empty;
var emailUrl = "";
var emailUrl = configService.GetConfig(EMAIL_API_URL, long.Parse(user.TenantId), false).GetAwaiter().GetResult()?.Data?.Value;
if (emailUrl == null)
throw new Exception("字典未配置 url_set->email_api_url 请联系管理员");
throw new Exception(MultiLanguageConst.GetDescription(nameof(MultiLanguageConst.CurrTenantEmailApiUrlNull)));
System.IO.FileStream file = new System.IO.FileStream(filePath, FileMode.Open, FileAccess.Read);
int SplitSize = 5242880;//5M分片长度
@ -1976,10 +1980,13 @@ namespace DS.WMS.Core.TaskPlat.Method
DateTime bDate = DateTime.Now;
HttpResponseMessage res = null;
string res = string.Empty;
try
{
var jsonBody = JsonConvert.SerializeObject(emailList);
res = RequestHelper.Post(jsonBody, emailUrl);
//res = await emailUrl.SetBody(emailList, "application/json").PostAsync();
}
catch (Exception ex)
@ -1995,11 +2002,11 @@ namespace DS.WMS.Core.TaskPlat.Method
Logger.Log(NLog.LogLevel.Info, $"发送邮件返回:{JsonConvert.SerializeObject(res)}");
if (res != null && res.StatusCode == System.Net.HttpStatusCode.OK)
if (!string.IsNullOrWhiteSpace(res))
{
var userResult = await res.Content.ReadAsStringAsync();
//var userResult = await res.Content.ReadAsStringAsync();
var respObj = JsonConvert.DeserializeAnonymousType(userResult, new
var respObj = JsonConvert.DeserializeAnonymousType(res, new
{
Success = false,
Message = string.Empty,
@ -2010,7 +2017,10 @@ namespace DS.WMS.Core.TaskPlat.Method
msg = respObj.Message;
}
return DataResult.Successed("");
if(!result)
return DataResult.Failed(msg);
return DataResult.Successed(msg);
}
#endregion
@ -2035,6 +2045,9 @@ namespace DS.WMS.Core.TaskPlat.Method
/// <returns>返回回执</returns>
public async Task<DataResult> SyncBookingSlotChange(long taskPKId)
{
bool result = false;
string msg = string.Empty;
/*
* Amendment
1
@ -2077,19 +2090,34 @@ namespace DS.WMS.Core.TaskPlat.Method
if(paramConfig.Equals("ENABLE", StringComparison.OrdinalIgnoreCase))
{
await GenerateSendEmail(taskBcInfo, taskBaseInfo, orderInfo);
var sendRlt = await GenerateSendEmail(taskBcInfo, taskBaseInfo, orderInfo);
return sendRlt;
}
else
{
Logger.Log(NLog.LogLevel.Info, $"taskPKId={taskPKId} 未配置自动发送邮件");
}
}
else
{
//终止执行
Logger.Log(NLog.LogLevel.Info, $"taskPKId={taskPKId} 获取订舱详情失败没有对应舱位ID");
}
}
catch (Exception ex)
{
{
result = false;
msg = $"处理异常,原因:{ex.Message}";
Logger.Log(NLog.LogLevel.Info, $"taskPKId={taskPKId} 处理异常,原因:{ex.Message}");
}
return DataResult.Successed("");
if (!result)
return DataResult.Failed(msg);
return DataResult.Successed(msg);
}
#endregion
}

@ -1,64 +1,64 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"AllowedHosts": "*",
"JwtSettings": {
"Issuer": "vol.core.owner",
"Audience": "vol.core",
"User": "C5ABA9E202D94C43A3CA66002BF77FAF",
"SecretKey": "sdfsdfsrty45634kkhllghtdgdfss345t678fs"
},
"Cors": {
"PolicyName": "WMSCore.API",
"Url": "http://localhost:8000,http://localhost:5999,http://localhost:8088,http://localhost:5173,http://0.0.0.0:5999,http://0.0.0.0:9995,http://localhost:9995,http://rm-m5e06xxqpa68a68ry5o.mysql.rds.aliyuncs.com:9995,http://localhost:3000,https://localhost:3100,http://47.104.255.182:3100,http://47.104.255.182:3110,https://localhost:3110,http://localhost:8080,http://localhost:8081,http://localhost:8082,http://localhost:8083,http://localhost:8084"
},
"DBInfo": {
"DefaultDbConnId": "1288018625843826688",
"DefaultDbType": 0,
"DefaultDbString": "server=rm-m5e06xxqpa68a68ry5o.mysql.rds.aliyuncs.com;port=3306;uid=rulesengine_admin;pwd=Rule1qaz2wsx!QAZ;database=shippingweb8_dev",
"DBS": [
{
"ConnId": "1288018625843826680",
"DBType": 0,
"Enabled": false,
"HitRate": 40,
"Connection": "server=rm-m5e06xxqpa68a68ry5o.mysql.rds.aliyuncs.com;port=3306;uid=rulesengine_admin;pwd=Rule1qaz2wsx!QAZ;database=shippingweb8_log"
}
]
},
"SwaggerDoc": {
"ContactName": "WmsOpAPI",
"ContactEmail": "Wms API.Core@xxx.com",
"ContactUrl": "https://www.xxx.com",
"Version": "1.0",
"Title": "Wms Op API",
"Description": "Wms Op API"
},
"Middleware": {
"RecordAccessLogs": {
"Enabled": true,
"IgnoreApis": "/api/permission/getnavigationbar,/api/monitor/getids4users,/api/monitor/getaccesslogs,/api/monitor/server,/api/monitor/getactiveusers,/api/monitor/server,"
}
},
"FileSettings": {
"BasePath": "", //使
"RelativePath": "LinkAttach",
"FileType": [ ".xls", ".xlsx", ".pdf", ".jpg", ".png", ".txt", ".pms" ]
},
//
"PrintTemplate": {
"BasePath": "", //使
"RelativePath": "Upload/PrintTemplate",
"FileType": [ ".frx", ".xls" ]
},
"TempFile": {
"Path": "TempFiles",
"RemainHours": 2
},
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"AllowedHosts": "*",
"JwtSettings": {
"Issuer": "vol.core.owner",
"Audience": "vol.core",
"User": "C5ABA9E202D94C43A3CA66002BF77FAF",
"SecretKey": "sdfsdfsrty45634kkhllghtdgdfss345t678fs"
},
"Cors": {
"PolicyName": "WMSCore.API",
"Url": "http://localhost:8000,http://localhost:5999,http://localhost:8088,http://localhost:5173,http://0.0.0.0:5999,http://0.0.0.0:9995,http://localhost:9995,http://rm-m5e06xxqpa68a68ry5o.mysql.rds.aliyuncs.com:9995,http://localhost:3000,https://localhost:3100,http://47.104.255.182:3100,http://47.104.255.182:3110,https://localhost:3110,http://localhost:8080,http://localhost:8081,http://localhost:8082,http://localhost:8083,http://localhost:8084"
},
"DBInfo": {
"DefaultDbConnId": "1288018625843826688",
"DefaultDbType": 0,
"DefaultDbString": "server=rm-m5e06xxqpa68a68ry5o.mysql.rds.aliyuncs.com;port=3306;uid=rulesengine_admin;pwd=Rule1qaz2wsx!QAZ;database=shippingweb8_dev",
"DBS": [
{
"ConnId": "1288018625843826680",
"DBType": 0,
"Enabled": false,
"HitRate": 40,
"Connection": "server=rm-m5e06xxqpa68a68ry5o.mysql.rds.aliyuncs.com;port=3306;uid=rulesengine_admin;pwd=Rule1qaz2wsx!QAZ;database=shippingweb8_log"
}
]
},
"SwaggerDoc": {
"ContactName": "WmsOpAPI",
"ContactEmail": "Wms API.Core@xxx.com",
"ContactUrl": "https://www.xxx.com",
"Version": "1.0",
"Title": "Wms Op API",
"Description": "Wms Op API"
},
"Middleware": {
"RecordAccessLogs": {
"Enabled": true,
"IgnoreApis": "/api/permission/getnavigationbar,/api/monitor/getids4users,/api/monitor/getaccesslogs,/api/monitor/server,/api/monitor/getactiveusers,/api/monitor/server,"
}
},
"FileSettings": {
"BasePath": "", //使
"RelativePath": "LinkAttach",
"FileType": [ ".xls", ".xlsx", ".pdf", ".jpg", ".png", ".txt", ".pms" ]
},
//
"PrintTemplate": {
"BasePath": "", //使
"RelativePath": "Upload/PrintTemplate",
"FileType": [ ".frx", ".xls" ]
},
"TempFile": {
"Path": "TempFiles",
"RemainHours": 2
},
"PrintService": {
"IP": "60.209.125.238",
"Port": "3009",
@ -82,21 +82,27 @@
"CancelServiceStatusUrl": "/EmbedProjectGoodsStatus/CancelServiceStatus",
"GetEnableProjectDictTreeList": "/EmbedProjectGoodsStatus/GetEnableProjectDictTreeList"
},
"ExcuteRuleService": {
"IP": "47.104.73.97",
"Port": "7115",
"SenderKey": "SEFBZkh5V3R1TGxtdlBIcTF4QmNMWURCS08vb2EvTzVxS0F0eDFKdlgyS3lKVUx6K3JRRE94Q2kvcWZMRytZeWxyVkhLdk9hRGpzVStPamhIUXd5NU9FMjhFTktwUlZ2eThJZGlQd3p5dUk9",
"SendUrl": "/api/RulesEngineManage/ExcuteWorkFlow"
},
"MSKAPIService": {
"UserKey": "wu",
"UserSecret": "123456",
"Environment": "TEST"
},
"RedisInfo": {
"RedisConfig": "rm-m5e06xxqpa68a68ry5o.mysql.rds.aliyuncs.com:36379,password=,defaultDatabase=15"
},
"BCCompare": {
"Url": "http://localhost:5110/api/TaskBookingAmendmentParser/ExcuteBookingAmendmentCompare"
}
"ExcuteRuleService": {
"IP": "47.104.73.97",
"Port": "7115",
"SenderKey": "SEFBZkh5V3R1TGxtdlBIcTF4QmNMWURCS08vb2EvTzVxS0F0eDFKdlgyS3lKVUx6K3JRRE94Q2kvcWZMRytZeWxyVkhLdk9hRGpzVStPamhIUXd5NU9FMjhFTktwUlZ2eThJZGlQd3p5dUk9",
"SendUrl": "/api/RulesEngineManage/ExcuteWorkFlow",
"RulesEngineSender": "Dongsheng8",
"RulesEngineSenderName": "东胜8"
},
"MSKAPIService": {
"UserKey": "wu",
"UserSecret": "123456",
"Environment": "TEST"
},
"RedisInfo": {
"RedisConfig": "rm-m5e06xxqpa68a68ry5o.mysql.rds.aliyuncs.com:36379,password=,defaultDatabase=15"
},
"BCCompare": {
"Url": "http://localhost:5110/api/TaskBookingAmendmentParser/ExcuteBookingAmendmentCompare"
},
"ShippingOrderCompare": {
"Url": "http://118.190.144.189:7115/api/TaskShippingOrderCompare/ExcuteShippingOrderCompare",
"ResultUrl": "http://118.190.144.189:7115/api/TaskShippingOrderCompare/CompareResult"
}
}

Loading…
Cancel
Save