jianghaiqing 2 years ago
commit 600bb5f3ee

@ -579,6 +579,7 @@ namespace Myshipping.Application
it.TenantName, it.TenantName,
it.IsDeleted, it.IsDeleted,
it.BOOKINGNO, it.BOOKINGNO,
it.BSSTATUSNAME,
it.YgtETD, it.YgtETD,
it.LstShipOrderCompareId, it.LstShipOrderCompareId,
it.LstShipOrderCompareDate, it.LstShipOrderCompareDate,
@ -1600,7 +1601,7 @@ namespace Myshipping.Application
var t = list.Union<GoodsStatusQuery>(config).OrderBy(x => x.Sort).DistinctBy(x => x.StatusName).ToList(); var t = list.Union<GoodsStatusQuery>(config).OrderBy(x => x.Sort).DistinctBy(x => x.StatusName).ToList();
if (t != null) if (t != null)
{ {
var StatusName = t.OrderByDescending(x => x.FinishTime).Select(x => x.StatusName).First(); var StatusName = t.Where(x=>x.FinishTime!=null).OrderByDescending(x => x.FinishTime).Select(x => x.StatusName).First();
order.BSSTATUSNAME = StatusName; order.BSSTATUSNAME = StatusName;
await _rep.AsUpdateable(order).IgnoreColumns(it => new await _rep.AsUpdateable(order).IgnoreColumns(it => new
@ -1617,20 +1618,22 @@ namespace Myshipping.Application
} }
return t;
}
List<long> tslist = new List<long>();
tslist.Add((long)input.BookingId); List<long> tslist = new List<long>();
var itemcode = _cache.GetAllTenantParam().Result.Where(x => x.ParaCode == "BOOKING_DATA_PUSH" && x.TenantId == UserManager.TENANT_ID).Select(x => x.ItemCode).FirstOrDefault(); tslist.Add((long)input.BookingId);
if (!string.IsNullOrEmpty(itemcode)) var itemcode = _cache.GetAllTenantParam().Result.Where(x => x.ParaCode == "BOOKING_DATA_PUSH" && x.TenantId == UserManager.TENANT_ID).Select(x => x.ItemCode).FirstOrDefault();
{ if (!string.IsNullOrEmpty(itemcode))
if (itemcode == "true") {
await SendBookingOrder(tslist.ToArray()); if (itemcode == "true")
_logger.LogInformation(input.BookingId + "货物状态推送成功!"); await SendBookingOrder(tslist.ToArray());
_logger.LogInformation(input.BookingId + "货物状态推送成功!");
}
return t;
} }
return null; return null;
} }
@ -2704,45 +2707,82 @@ namespace Myshipping.Application
} }
} }
if (name.Split('.')[0].ToLower() == "order" && name.Split('.')[1].ToLower() == "_PKGS"&& _name== "_PKGS") if (name.Split('.')[0].ToLower() == "order" && name.Split('.')[1].ToLower() == "_pkgs" && _name == "pkgs")
{ {
var value = string.Empty;
if (order.PKGS!=null) {
if (order.PKGS.ToString().Split('.').Count() > 1&&Convert.ToInt32(order.PKGS.ToString().Split('.')[1])>0)
{
value = string.Format("{0:F3}", order.PKGS);
}
else {
value = order.PKGS.ToString().Split('.')[0];
}
}
ICell cell = row.GetCell(_cellNum - 1); ICell cell = row.GetCell(_cellNum - 1);
if (cell != null) if (cell != null)
{ {
row.Cells[_cellNum - 1].SetCellValue(order.PKGS + "(" + order.KINDPKGS + ")");
row.Cells[_cellNum - 1].SetCellValue(value + order.KINDPKGS );
} }
else else
{ {
row.CreateCell(_cellNum - 1).SetCellValue(order.PKGS + "(" + order.KINDPKGS + ")"); row.CreateCell(_cellNum - 1).SetCellValue(value + order.KINDPKGS );
} }
} }
if (name.Split('.')[0].ToLower() == "order" && name.Split('.')[1].ToLower() == "_KGS"&& _name == "_KGS") if (name.Split('.')[0].ToLower() == "order" && name.Split('.')[1].ToLower() == "_kgs" && _name == "kgs")
{ {
var value = string.Empty;
if (order.KGS != null)
{
if (order.KGS.ToString().Split('.').Count() > 1 && Convert.ToInt32(order.KGS.ToString().Split('.')[1]) > 0)
{
value = string.Format("{0:F3}", order.KGS);
}
else
{
value = order.KGS.ToString().Split('.')[0];
}
}
ICell cell = row.GetCell(_cellNum - 1); ICell cell = row.GetCell(_cellNum - 1);
if (cell != null) if (cell != null)
{ {
row.Cells[_cellNum - 1].SetCellValue(order.KGS + "(KGS)"); row.Cells[_cellNum - 1].SetCellValue(value + "KGS");
} }
else else
{ {
row.CreateCell(_cellNum - 1).SetCellValue(order.KGS + "(KGS)"); row.CreateCell(_cellNum - 1).SetCellValue(value + "KGS");
} }
} }
if (name.Split('.')[0].ToLower() == "order" && name.Split('.')[1].ToLower() == "_CBM" && _name == "_CBM") if (name.Split('.')[0].ToLower() == "order" && name.Split('.')[1].ToLower() == "_cbm" && _name == "cbm")
{ {
var value = string.Empty;
if (order.CBM != null)
{
if (order.CBM.ToString().Split('.').Count() > 1 && Convert.ToInt32(order.CBM.ToString().Split('.')[1]) > 0)
{
value = string.Format("{0:F3}", order.CBM);
}
else
{
value = order.CBM.ToString().Split('.')[0];
}
}
ICell cell = row.GetCell(_cellNum - 1); ICell cell = row.GetCell(_cellNum - 1);
if (cell != null) if (cell != null)
{ {
row.Cells[_cellNum - 1].SetCellValue(order.CBM + "(CBM)"); row.Cells[_cellNum - 1].SetCellValue(value + "CBM");
} }
else else
{ {
row.CreateCell(_cellNum - 1).SetCellValue(order.CBM + "(CBM)"); row.CreateCell(_cellNum - 1).SetCellValue(value + "CBM");
} }
} }
@ -2840,6 +2880,7 @@ namespace Myshipping.Application
} }
srow.CreateCell(_cellNum - 1).SetCellValue(value); srow.CreateCell(_cellNum - 1).SetCellValue(value);
} }
} }
} }
if (name.Split('.')[0].ToLower() == "edi") if (name.Split('.')[0].ToLower() == "edi")
@ -4290,7 +4331,7 @@ namespace Myshipping.Application
//这里除了TSL订舱编号默认都对应到业务编号订舱保存时自动生成 //这里除了TSL订舱编号默认都对应到业务编号订舱保存时自动生成
if (ediRouteEnum == EDIRouteEnum.TSL) if (ediRouteEnum == EDIRouteEnum.TSL)
{ {
if(string.IsNullOrWhiteSpace(order.CUSTNO)) if (string.IsNullOrWhiteSpace(order.CUSTNO))
throw Oops.Bah($"船公司是{order.CARRIERID} 订舱编号不能为空"); throw Oops.Bah($"船公司是{order.CARRIERID} 订舱编号不能为空");
primaryModel.ORDERNO = order.CUSTNO; primaryModel.ORDERNO = order.CUSTNO;
@ -4299,7 +4340,7 @@ namespace Myshipping.Application
{ {
primaryModel.ORDERNO = order.BOOKINGNO; primaryModel.ORDERNO = order.BOOKINGNO;
} }
var curBasePkgs = basePkgsList.FirstOrDefault(p => p.Name.Equals(order.KINDPKGS, StringComparison.OrdinalIgnoreCase)); var curBasePkgs = basePkgsList.FirstOrDefault(p => p.Name.Equals(order.KINDPKGS, StringComparison.OrdinalIgnoreCase));

Loading…
Cancel
Save