jianghaiqing 1 year ago
commit 6b47bfba34

@ -124,6 +124,16 @@ namespace Myshipping.Application.EDI
{ {
return new KeyValuePair<bool, string>(false, "中创站代码未配置"); return new KeyValuePair<bool, string>(false, "中创站代码未配置");
} }
//针对和川这种公共库不同的船司代码,需要匹配转换为当前的船司代码才能逻辑判断
var hlcCode = "HLC";
var mapCodeHLC = mappingCarrierLetterYard.FirstOrDefault(x => x.MapCode == "HLC");
if (mapCodeHLC != null)
{
hlcCode = mapCodeHLC.Code;
}
#region 港联捷场站 #region 港联捷场站
if (order.YARDID == yardCodeGLJ.Value) if (order.YARDID == yardCodeGLJ.Value)
@ -162,14 +172,6 @@ namespace Myshipping.Application.EDI
StringBuilder sbData = new StringBuilder(); StringBuilder sbData = new StringBuilder();
sbData.AppendLine($"01:{order.VESSEL}:{order.VOYNO}"); //船名 航次 sbData.AppendLine($"01:{order.VESSEL}:{order.VOYNO}"); //船名 航次
//针对和川这种公共库不同的船司代码,需要匹配转换为当前的船司代码才能逻辑判断
var hlcCode = "HLC";
var mapCodeHLC = mappingCarrierLetterYard.FirstOrDefault(x => x.MapCode == "HLC");
if (mapCodeHLC != null)
{
hlcCode = mapCodeHLC.Code;
}
// 12:提单号:中转港:目的港:货代代码:船公司:HPL参考号:特殊说明 // 12:提单号:中转港:目的港:货代代码:船公司:HPL参考号:特殊说明
sbData.AppendLine($"12:{order.MBLNO}:{order.TRANSPORTID}:{order.PORTDISCHARGEID}:{paraXHZ.ItemCode}:{GetCarrierEDICode(order.CARRIERID, "XHZ_GLJ")}:{(order.CARRIERID == hlcCode ? order.CUSTNO : "")}:{ExchangeStr(order.YARDREMARK)}"); //主提单 中转港代码 目的港代码 货代代码 船公司 HPL参考号 备注 sbData.AppendLine($"12:{order.MBLNO}:{order.TRANSPORTID}:{order.PORTDISCHARGEID}:{paraXHZ.ItemCode}:{GetCarrierEDICode(order.CARRIERID, "XHZ_GLJ")}:{(order.CARRIERID == hlcCode ? order.CUSTNO : "")}:{ExchangeStr(order.YARDREMARK)}"); //主提单 中转港代码 目的港代码 货代代码 船公司 HPL参考号 备注
//2021-8-17报文中不能体现英文字符①【:】②【,】,以空格代替 //2021-8-17报文中不能体现英文字符①【:】②【,】,以空格代替
@ -511,7 +513,7 @@ namespace Myshipping.Application.EDI
listJoinStr.Add("00:IFCSUM:BK:" + filerole + ":" + ftpset.SENDCODE + ":" + ftpset.RECEIVECODE + ":" + DateTime.Now.ToString("yyyyMMddHHmm") + ":2.1'"); listJoinStr.Add("00:IFCSUM:BK:" + filerole + ":" + ftpset.SENDCODE + ":" + ftpset.RECEIVECODE + ":" + DateTime.Now.ToString("yyyyMMddHHmm") + ":2.1'");
//提单号 //提单号
listJoinStr.Add("02:" + order.Id.ToString() + ":" + order.MBLNO.Trim() + ":" + order.SERVICE + ":" + ftpset.SENDNAME + ":" + ftpset.RECEIVECODE + "::::::::::" + order.CONTRACTNO + "::'"); listJoinStr.Add("02:" + order.Id.ToString() + ":" + order.MBLNO.Trim() + ":" + order.SERVICE + ":" + ftpset.SENDNAME + ":" + ftpset.RECEIVECODE + "::::::::::" + order.CONTRACTNO + ":" + (order.CARRIERID == hlcCode ? order.CUSTNO : "") + ":'");
//提单地址 //提单地址
var ISSUETYPE = ""; var ISSUETYPE = "";
@ -757,15 +759,6 @@ namespace Myshipping.Application.EDI
StringBuilder sbData = new StringBuilder(); StringBuilder sbData = new StringBuilder();
sbData.AppendLine($"01:{order.VESSEL}:{order.VOYNO}"); //船名 航次 sbData.AppendLine($"01:{order.VESSEL}:{order.VOYNO}"); //船名 航次
//针对和川这种公共库不同的船司代码,需要匹配转换为当前的船司代码才能逻辑判断
var hlcCode = "HLC";
var mapCodeHLC = mappingCarrierLetterYard.FirstOrDefault(x => x.MapCode == "HLC");
if (mapCodeHLC != null)
{
hlcCode = mapCodeHLC.Code;
}
sbData.AppendLine($"12:{order.MBLNO}:{order.TRANSPORTID}:{order.PORTDISCHARGEID}:{paraXHZ.ItemCode}:{GetCarrierEDICode(order.CARRIERID, "XHZ_GLX")}:{(order.CARRIERID == hlcCode ? order.CUSTNO : "")}:{order.PORTDISCHARGE}"); //主提单 中转港代码 目的港代码 货代代码 船公司 HPL参考号 备注 sbData.AppendLine($"12:{order.MBLNO}:{order.TRANSPORTID}:{order.PORTDISCHARGEID}:{paraXHZ.ItemCode}:{GetCarrierEDICode(order.CARRIERID, "XHZ_GLX")}:{(order.CARRIERID == hlcCode ? order.CUSTNO : "")}:{order.PORTDISCHARGE}"); //主提单 中转港代码 目的港代码 货代代码 船公司 HPL参考号 备注
var despStr = ExchangeStr(order.DESCRIPTION.Replace(":", " ").Replace(",", " ")).Replace("\r\n", " ").Replace("\n", " "); var despStr = ExchangeStr(order.DESCRIPTION.Replace(":", " ").Replace(",", " ")).Replace("\r\n", " ").Replace("\n", " ");
if (despStr.Length > 100) if (despStr.Length > 100)

@ -472,6 +472,7 @@ namespace Myshipping.Application
} }
else else
{ {
//货物状态
itgoodsStatus = _goodsStatus.AsQueryable().LeftJoin(_goodsStatusConfig.AsQueryable(), itgoodsStatus = _goodsStatus.AsQueryable().LeftJoin(_goodsStatusConfig.AsQueryable(),
(goods, config) => config.Id == goods.ConfigId && bookingidlist.Contains((long)goods.bookingId)). (goods, config) => config.Id == goods.ConfigId && bookingidlist.Contains((long)goods.bookingId)).
OrderBy((goods, config) => config.Sort). OrderBy((goods, config) => config.Sort).
@ -513,11 +514,13 @@ namespace Myshipping.Application
ticks = DateTime.Now; ticks = DateTime.Now;
_logger.LogInformation($"PageData Stage 5 {et.TotalMilliseconds}"); _logger.LogInformation($"PageData Stage 5 {et.TotalMilliseconds}");
} }
//货运状态列表
var statusloglist = _repStatuslog.AsQueryable().Filter(null, true).Where(x => bookingidlist.Contains((long)x.BookingId) && (x.Status == "提箱" || x.Status == "返场") && x.IsDeleted == false).ToList(); var statusloglist = _repStatuslog.AsQueryable().Filter(null, true).Where(x => bookingidlist.Contains((long)x.BookingId) && (x.Status == "提箱" || x.Status == "返场") && x.IsDeleted == false).ToList();
var statuslogId = statusloglist.Select(x => x.Id).ToList(); var statuslogId = statusloglist.Select(x => x.Id).ToList();
//运踪状态
var statuslogdetaillist = _statuslogdetail.AsQueryable().Where(x => statuslogId.Contains(x.PId)).ToList(); var statuslogdetaillist = _statuslogdetail.AsQueryable().Where(x => statuslogId.Contains(x.PId)).ToList();
var BookingStatusList = _repBookingStatus.AsQueryable().Filter(null, true).Where(x => bookingidlist.Contains((long)x.BookingId)).ToList(); var BookingStatusList = _repBookingStatus.AsQueryable().Filter(null, true).Where(x => bookingidlist.Contains((long)x.BookingId)).ToList();
var bookingremarkList = _bookingremark.AsQueryable().Filter(null, true).Where(x => bookingidlist.Contains(x.PId)).ToList(); var bookingremarkList = _bookingremark.AsQueryable().Filter(null, true).Where(x => bookingidlist.Contains(x.PId)).ToList();
@ -795,7 +798,7 @@ namespace Myshipping.Application
throw Oops.Bah("当前PONO已存在,请勿重复录入!"); throw Oops.Bah("当前PONO已存在,请勿重复录入!");
} }
} }
//版本号 //版本号避免多人同时操作数据错乱
if (!string.IsNullOrWhiteSpace(input.VERSION) && input.Id != 0) if (!string.IsNullOrWhiteSpace(input.VERSION) && input.Id != 0)
{ {
var et = await _rep.AsQueryable().Filter(null, true).Where(x => x.IsDeleted == false && x.VERSION == input.VERSION && x.Id == input.Id).FirstAsync(); var et = await _rep.AsQueryable().Filter(null, true).Where(x => x.IsDeleted == false && x.VERSION == input.VERSION && x.Id == input.Id).FirstAsync();
@ -805,6 +808,7 @@ namespace Myshipping.Application
} }
} }
var entity = input.Adapt<BookingOrder>(); var entity = input.Adapt<BookingOrder>();
//存在船名航次引入船期数据
if (!string.IsNullOrEmpty(input.VESSEL) && !string.IsNullOrEmpty(input.VOYNO)) if (!string.IsNullOrEmpty(input.VESSEL) && !string.IsNullOrEmpty(input.VOYNO))
{ {
var vesselInfo = _vesselInfo.AsQueryable().Filter(null, true).Where(x => x.IsDeleted == false && x.TenantId == UserManager.UserId && x.Vessel == input.VESSEL && x.Voyno == input.VESSEL && x.ATD != null).ToList().FirstOrDefault(); var vesselInfo = _vesselInfo.AsQueryable().Filter(null, true).Where(x => x.IsDeleted == false && x.TenantId == UserManager.UserId && x.Vessel == input.VESSEL && x.Voyno == input.VESSEL && x.ATD != null).ToList().FirstOrDefault();
@ -816,6 +820,7 @@ namespace Myshipping.Application
} }
} }
//判断是否订阅运踪目的港起运港标识
if (!string.IsNullOrEmpty(entity.MBLNO)) if (!string.IsNullOrEmpty(entity.MBLNO))
{ {
if (!string.IsNullOrEmpty(entity.CARRIERID) && !string.IsNullOrEmpty(entity.YARDID)) if (!string.IsNullOrEmpty(entity.CARRIERID) && !string.IsNullOrEmpty(entity.YARDID))
@ -902,7 +907,7 @@ namespace Myshipping.Application
var mlist = await _rep.AsQueryable().Filter(null, true).Where(x => x.Id == input.Id).FirstAsync(); var mlist = await _rep.AsQueryable().Filter(null, true).Where(x => x.Id == input.Id).FirstAsync();
var rightlist = await _right.GetDataScopeList(MenuConst.MenuBookingOrder, true); var rightlist = await _right.GetDataScopeList(MenuConst.MenuBookingOrder, true);
_logger.LogInformation("保存权限范围:"+rightlist.ToJsonString()); _logger.LogInformation("保存权限范围:"+rightlist.ToJsonString());
//除现有配置权限外 操作和本人具有编辑权限
if (rightlist!=null&&!( if (rightlist!=null&&!(
mlist.OPID == UserManager.UserId.ToString() || mlist.OP == UserManager.Name.ToString() || mlist.OPID == UserManager.UserId.ToString() || mlist.OP == UserManager.Name.ToString() ||
mlist.DOCID == UserManager.UserId.ToString() || mlist.DOC == UserManager.Name.ToString() || mlist.DOCID == UserManager.UserId.ToString() || mlist.DOC == UserManager.Name.ToString() ||

Loading…
Cancel
Save