增加请求规则引擎的集装箱和货物明细

booking_auth_dev
jianghaiqing 2 years ago
parent 681099c7ad
commit afb3837795

@ -5359,6 +5359,156 @@
租户ID
</summary>
</member>
<member name="P:Myshipping.Application.RulesEngineOrderBookingContaCargoInfo.PKGs">
<summary>
件数
</summary>
</member>
<member name="P:Myshipping.Application.RulesEngineOrderBookingContaCargoInfo.KindPKGs">
<summary>
包装
</summary>
</member>
<member name="P:Myshipping.Application.RulesEngineOrderBookingContaCargoInfo.KGs">
<summary>
毛重
</summary>
</member>
<member name="P:Myshipping.Application.RulesEngineOrderBookingContaCargoInfo.CBM">
<summary>
尺码
</summary>
</member>
<member name="P:Myshipping.Application.RulesEngineOrderBookingContaCargoInfo.HSCode">
<summary>
HS编码
</summary>
</member>
<member name="P:Myshipping.Application.RulesEngineOrderBookingContaCargoInfo.Marks">
<summary>
唛头
</summary>
</member>
<member name="P:Myshipping.Application.RulesEngineOrderBookingContaCargoInfo.Description">
<summary>
货描
</summary>
</member>
<member name="P:Myshipping.Application.RulesEngineOrderBookingContaCargoInfo.Remark">
<summary>
备注
</summary>
</member>
<member name="T:Myshipping.Application.RulesEngineOrderBookingContaInfo">
<summary>
集装箱信息
</summary>
</member>
<member name="P:Myshipping.Application.RulesEngineOrderBookingContaInfo.ContaType">
<summary>
箱型代码
</summary>
</member>
<member name="P:Myshipping.Application.RulesEngineOrderBookingContaInfo.ContaTypeName">
<summary>
箱型
</summary>
</member>
<member name="P:Myshipping.Application.RulesEngineOrderBookingContaInfo.TEU">
<summary>
TEU
</summary>
</member>
<member name="P:Myshipping.Application.RulesEngineOrderBookingContaInfo.ContaNo">
<summary>
箱号
</summary>
</member>
<member name="P:Myshipping.Application.RulesEngineOrderBookingContaInfo.SealNo">
<summary>
封号
</summary>
</member>
<member name="P:Myshipping.Application.RulesEngineOrderBookingContaInfo.PKGs">
<summary>
件数
</summary>
</member>
<member name="P:Myshipping.Application.RulesEngineOrderBookingContaInfo.KindPKGs">
<summary>
包装
</summary>
</member>
<member name="P:Myshipping.Application.RulesEngineOrderBookingContaInfo.KGs">
<summary>
毛重
</summary>
</member>
<member name="P:Myshipping.Application.RulesEngineOrderBookingContaInfo.CBM">
<summary>
尺码
</summary>
</member>
<member name="P:Myshipping.Application.RulesEngineOrderBookingContaInfo.TareWeight">
<summary>
皮重
</summary>
</member>
<member name="P:Myshipping.Application.RulesEngineOrderBookingContaInfo.ContaStatus">
<summary>
箱状态
</summary>
</member>
<member name="P:Myshipping.Application.RulesEngineOrderBookingContaInfo.WeighType">
<summary>
称重方式
</summary>
</member>
<member name="P:Myshipping.Application.RulesEngineOrderBookingContaInfo.WeighKGs">
<summary>
称重重量
</summary>
</member>
<member name="P:Myshipping.Application.RulesEngineOrderBookingContaInfo.WeighAttn">
<summary>
称重联系人
</summary>
</member>
<member name="P:Myshipping.Application.RulesEngineOrderBookingContaInfo.VGMConnCom">
<summary>
VGM联系公司
</summary>
</member>
<member name="P:Myshipping.Application.RulesEngineOrderBookingContaInfo.WeighTel">
<summary>
VGM联系电话
</summary>
</member>
<member name="P:Myshipping.Application.RulesEngineOrderBookingContaInfo.WeighDate">
<summary>
称重日期
</summary>
</member>
<member name="P:Myshipping.Application.RulesEngineOrderBookingContaInfo.VGMAddr">
<summary>
VGM地址
</summary>
</member>
<member name="P:Myshipping.Application.RulesEngineOrderBookingContaInfo.VGMEmail">
<summary>
VGM邮箱
</summary>
</member>
<member name="P:Myshipping.Application.RulesEngineOrderBookingContaInfo.Remark">
<summary>
备注
</summary>
</member>
<member name="P:Myshipping.Application.RulesEngineOrderBookingContaInfo.CargoList">
<summary>
货物明细
</summary>
</member>
<member name="P:Myshipping.Application.RulesEngineOrderBookingMainInfo.ProjectCode">
<summary>
项目代码(可以填多个,主要是标识要进行的规则过滤)
@ -6126,6 +6276,11 @@
是否拼箱
</summary>
</member>
<member name="P:Myshipping.Application.RulesEngineOrderBookingMainBusinessInfo.ContaList">
<summary>
箱信息
</summary>
</member>
<member name="T:Myshipping.Application.RulesEngineOrderBookingMessageInfo">
<summary>
海运订舱规则请求报文
@ -6327,7 +6482,7 @@
请求规则平台
</summary>
</member>
<member name="M:Myshipping.Application.RulesEngineClientService.#ctor(Myshipping.Core.SqlSugarRepository{Myshipping.Application.Entity.BookingOrder})">
<member name="M:Myshipping.Application.RulesEngineClientService.#ctor(Myshipping.Core.SqlSugarRepository{Myshipping.Application.Entity.BookingOrder},Myshipping.Core.SqlSugarRepository{Myshipping.Application.Entity.BookingCtn},Myshipping.Core.SqlSugarRepository{Myshipping.Application.Entity.BookingCtnDetail})">
<summary>
</summary>

@ -276,6 +276,71 @@ namespace Myshipping.Application
.Map(dest => dest.LaneName, src => src.LANENAME)
.Map(dest => dest.FreightPayer, src => src.FREIGHTPAYER);
config.ForType<BookingCtn, RulesEngineOrderBookingContaInfo>()
.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<BookingCtnDto, RulesEngineOrderBookingContaInfo>()
.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<BookingCtnDetail, RulesEngineOrderBookingContaCargoInfo>()
.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);
config.ForType<BookingCtnDetailDto, RulesEngineOrderBookingContaCargoInfo>()
.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);
}
}
}

@ -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 RulesEngineOrderBookingContaCargoInfo
{
/// <summary>
/// 件数
/// </summary>
public Nullable<int> PKGs { get; set; }
/// <summary>
/// 包装
/// </summary>
public string KindPKGs { get; set; }
/// <summary>
/// 毛重
/// </summary>
public Nullable<decimal> KGs { get; set; }
/// <summary>
/// 尺码
/// </summary>
public Nullable<decimal> CBM { get; set; }
/// <summary>
/// HS编码
/// </summary>
public string HSCode { get; set; }
/// <summary>
/// 唛头
/// </summary>
public string Marks { get; set; }
/// <summary>
/// 货描
/// </summary>
public string Description { get; set; }
/// <summary>
/// 备注
/// </summary>
public string Remark { get; set; }
}
}

@ -0,0 +1,100 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Myshipping.Application
{
/// <summary>
/// 集装箱信息
/// </summary>
public class RulesEngineOrderBookingContaInfo
{
/// <summary>
/// 箱型代码
/// </summary>
public string ContaType { get; set; }
/// <summary>
/// 箱型
/// </summary>
public string ContaTypeName { get; set; }
/// <summary>
/// TEU
/// </summary>
public Nullable<int> TEU { get; set; }
/// <summary>
/// 箱号
/// </summary>
public string ContaNo { get; set; }
/// <summary>
/// 封号
/// </summary>
public string SealNo { get; set; }
/// <summary>
/// 件数
/// </summary>
public Nullable<int> PKGs { get; set; }
/// <summary>
/// 包装
/// </summary>
public string KindPKGs { get; set; }
/// <summary>
/// 毛重
/// </summary>
public Nullable<decimal> KGs { get; set; }
/// <summary>
/// 尺码
/// </summary>
public Nullable<decimal> CBM { get; set; }
/// <summary>
/// 皮重
/// </summary>
public Nullable<decimal> TareWeight { get; set; }
/// <summary>
/// 箱状态
/// </summary>
public string ContaStatus { get; set; }
/// <summary>
/// 称重方式
/// </summary>
public string WeighType { get; set; }
/// <summary>
/// 称重重量
/// </summary>
public Nullable<decimal> WeighKGs { get; set; }
/// <summary>
/// 称重联系人
/// </summary>
public string WeighAttn { get; set; }
/// <summary>
/// VGM联系公司
/// </summary>
public string VGMConnCom { get; set; }
/// <summary>
/// VGM联系电话
/// </summary>
public string WeighTel { get; set; }
/// <summary>
/// 称重日期
/// </summary>
public string WeighDate { get; set; }
/// <summary>
/// VGM地址
/// </summary>
public string VGMAddr { get; set; }
/// <summary>
/// VGM邮箱
/// </summary>
public string VGMEmail { get; set; }
/// <summary>
/// 备注
/// </summary>
public string Remark { get; set; }
/// <summary>
/// 货物明细
/// </summary>
public List<RulesEngineOrderBookingContaCargoInfo> CargoList { get; set; }
}
}

@ -641,5 +641,10 @@ namespace Myshipping.Application
/// 是否拼箱
/// </summary>
public Nullable<bool> IsContaLCL { get; set; }
/// <summary>
/// 箱信息
/// </summary>
public List<RulesEngineOrderBookingContaInfo> ContaList { get; set; }
}
}

@ -26,12 +26,19 @@ namespace Myshipping.Application
public class RulesEngineClientService: IRulesEngineClientService, IDynamicApiController, ITransient
{
private readonly SqlSugarRepository<BookingOrder> _bookingOrderRepository;
private readonly SqlSugarRepository<BookingCtn> _bookingOrderContaRepository;
private readonly SqlSugarRepository<BookingCtnDetail> _bookingOrderContaCargoRepository;
/// <summary>
///
/// </summary>
public RulesEngineClientService(SqlSugarRepository<BookingOrder> bookingOrderRepository)
public RulesEngineClientService(SqlSugarRepository<BookingOrder> bookingOrderRepository,
SqlSugarRepository<BookingCtn> bookingOrderContaRepository,
SqlSugarRepository<BookingCtnDetail> bookingOrderContaCargoRepository)
{
_bookingOrderRepository = bookingOrderRepository;
_bookingOrderContaRepository = bookingOrderContaRepository;
_bookingOrderContaCargoRepository = bookingOrderContaCargoRepository;
}
@ -40,6 +47,8 @@ namespace Myshipping.Application
/// </summary>
/// <param name="model">海运订舱请求业务</param>
/// <returns>返回用户信息</returns>
[ApiDescriptionSettings(LowercaseRoute = false, SplitCamelCase = false)]
[HttpPost]
public async Task<RulesEngineExcuteResultDto> ExcuteRulesOceanBookingByMsg(RulesEngineOrderBookingMessageInfo model)
{
RulesEngineExcuteResultDto result = new RulesEngineExcuteResultDto();
@ -68,6 +77,7 @@ namespace Myshipping.Application
/// </summary>
/// <param name="bookingId">海运订舱主键</param>
/// <returns>返回用户信息</returns>
[ApiDescriptionSettings(LowercaseRoute = false, SplitCamelCase = false)]
[HttpGet]
public async Task<RulesEngineExcuteResultDto> ExcuteRulesOceanBooking(string bookingId)
{
@ -113,6 +123,39 @@ namespace Myshipping.Application
msgModel.Main.BusinessInfo = model.Adapt<RulesEngineOrderBookingMainBusinessInfo>();
var contaList = await _bookingOrderContaRepository.AsQueryable().Where(x => x.BILLID == model.Id).ToListAsync();
if (contaList.Count > 0)
{
msgModel.Main.BusinessInfo.ContaList = contaList.Adapt<List<RulesEngineOrderBookingContaInfo>>();
var cargoList = await _bookingOrderContaCargoRepository.AsQueryable()
.Where(x=> contaList.Any(a=>a.Id == x.CTNID)).ToListAsync();
if(cargoList.Count > 0)
{
msgModel.Main.BusinessInfo.ContaList = contaList.GroupJoin(cargoList, l => l.Id, r => r.CTNID, (l, r) => {
var currList = r.ToList();
if (currList.Count > 0)
{
var info = l.Adapt<RulesEngineOrderBookingContaInfo>();
info.CargoList = currList.Adapt<List<RulesEngineOrderBookingContaCargoInfo>>();
return info;
}
return l.Adapt<RulesEngineOrderBookingContaInfo>();
}).ToList();
}
else
{
msgModel.Main.BusinessInfo.ContaList = contaList.Adapt<List<RulesEngineOrderBookingContaInfo>>();
}
}
var ruleResult = await ExcuteRulesEngine(msgModel);
if(ruleResult == null)
@ -143,6 +186,7 @@ namespace Myshipping.Application
/// </summary>
/// <param name="model">海运订舱报文类</param>
/// <returns>返回回执</returns>
[ApiDescriptionSettings(LowercaseRoute = false, SplitCamelCase = false)]
[HttpPost]
public async Task<RulesEngineExcuteResultDto> ExcuteRulesOceanBookingByModel(BookingOrderDto model)
{
@ -162,7 +206,7 @@ namespace Myshipping.Application
DateTime nowDate = DateTime.Now;
//var model =
//if()
// _bookingOrderRepository.AsQueryable().InSingle(bookingId);
@ -192,6 +236,39 @@ namespace Myshipping.Application
msgModel.Main.BusinessInfo = model.Adapt<RulesEngineOrderBookingMainBusinessInfo>();
var contaList = await _bookingOrderContaRepository.AsQueryable().Where(x => x.BILLID == model.Id).ToListAsync();
if (contaList.Count > 0)
{
msgModel.Main.BusinessInfo.ContaList = contaList.Adapt<List<RulesEngineOrderBookingContaInfo>>();
var cargoList = await _bookingOrderContaCargoRepository.AsQueryable()
.Where(x => contaList.Any(a => a.Id == x.CTNID)).ToListAsync();
if (cargoList.Count > 0)
{
msgModel.Main.BusinessInfo.ContaList = contaList.GroupJoin(cargoList, l => l.Id, r => r.CTNID, (l, r) =>
{
var currList = r.ToList();
if (currList.Count > 0)
{
var info = l.Adapt<RulesEngineOrderBookingContaInfo>();
info.CargoList = currList.Adapt<List<RulesEngineOrderBookingContaCargoInfo>>();
return info;
}
return l.Adapt<RulesEngineOrderBookingContaInfo>();
}).ToList();
}
else
{
msgModel.Main.BusinessInfo.ContaList = contaList.Adapt<List<RulesEngineOrderBookingContaInfo>>();
}
}
var ruleResult = await ExcuteRulesEngine(msgModel);
if (ruleResult == null)

@ -6645,7 +6645,7 @@
</member>
<member name="M:Myshipping.Core.Service.CommonDBService.AddOrUpdateMappingCtn(Myshipping.Core.Entity.MappingCtn)">
<summary>
新增编辑船公司映射信息
新增编辑箱型映射信息
</summary>
</member>
<member name="M:Myshipping.Core.Service.CommonDBService.FrtList(Myshipping.Core.Service.NameQueryDto)">
@ -6653,6 +6653,21 @@
付费方式
</summary>
</member>
<member name="M:Myshipping.Core.Service.CommonDBService.AddFrt(Myshipping.Core.Entity.CodeFrt)">
<summary>
新增付费方式
</summary>
</member>
<member name="M:Myshipping.Core.Service.CommonDBService.MappingFrtList(Myshipping.Core.Service.MappingQueryDto)">
<summary>
获取付费映射列表信息
</summary>
</member>
<member name="M:Myshipping.Core.Service.CommonDBService.AddOrUpdateMappingFrt(Myshipping.Core.Entity.MappingFrt)">
<summary>
新增编辑付费映射信息
</summary>
</member>
<member name="P:Myshipping.Core.Service.MappingQueryDto.Module">
<summary>
模块
@ -6734,6 +6749,23 @@
</summary>
<returns></returns>
</member>
<member name="M:Myshipping.Core.Service.ICommonDBService.GetAllMappingCtn">
<summary>
获取箱型映射
</summary>
<returns></returns>
</member>
<member name="M:Myshipping.Core.Service.ICommonDBService.GetAllFrt">
<summary>
付费方式
</summary>
<returns></returns>
</member>
<member name="M:Myshipping.Core.Service.ICommonDBService.GetAllMappingFrt">
<summary>
付费方式映射
</summary>
</member>
<member name="M:Myshipping.Core.Service.CommonService.GetEntityInfos(System.Boolean)">
<summary>
获取库表信息

Loading…
Cancel
Save