zhangxiaofeng 8 months ago
commit d4730a5646

@ -859,9 +859,9 @@ namespace Myshipping.Application.EDI
}
/*件重尺*/
r.WriteLine("CNT+7:" + bill.KGS.ToString("0.###") + ":KGM'");//按照四舍五入的国际标准
r.WriteLine("CNT+7:" + Math.Round(bill.KGS,3) + ":KGM'");//按照四舍五入的国际标准
r.WriteLine("CNT+11:" + bill.PKGS.ToString() + "'");
r.WriteLine("CNT+15:" + bill.CBM.ToString("0.###") + ":MTQ'");
r.WriteLine("CNT+15:" + Math.Round(bill.CBM,3) + ":MTQ'");
icount = icount + 3;
@ -1328,8 +1328,8 @@ namespace Myshipping.Application.EDI
}
r.WriteLine("MEA+AAE+WT+KGM:" + bill.KGS.ToString("0.###") + "'");
r.WriteLine("MEA+AAE+AAW+MTQ:" + bill.CBM.ToString("0.###") + "'");
r.WriteLine("MEA+AAE+WT+KGM:" + Math.Round(bill.KGS,3) + "'");
r.WriteLine("MEA+AAE+AAW+MTQ:" + Math.Round(bill.CBM,3) + "'");
icount = icount + 2;
Shipping = formatEdiStr("txt", bill.MARKS);
@ -1444,10 +1444,14 @@ namespace Myshipping.Application.EDI
string filename = InttrEdi.filerpath + "\\" + InttrEdi.BSLIST[0].MBLNO + DateTime.Now.ToString("yyyyMMddHHmmssfff") + ".txt";
if (System.IO.File.Exists(filename))
{
System.IO.File.Delete(filename);
}
//如果是部署linux需要修改路径
if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
filename = filename.Replace("\\", "/");
//if (System.IO.File.Exists(filename))
//{
// System.IO.File.Delete(filename);
//}
FileStream f = new FileStream(filename, FileMode.Create);
StreamWriter r = new StreamWriter(f, Encoding.Default);
@ -1487,9 +1491,13 @@ namespace Myshipping.Application.EDI
str_pay = bill.PREPARDAT;
if (bill.BLFRTEDICODE.IndexOf("COLLECT") >= 0)
str_pay = bill.PAYABLEAT;
/*
r.WriteLine("FTX+AAI+++" + bill.BLFRTEDICODE + " Payable at " + str_pay + " " + bill.SERVICEEDICODE + " "
+ bill.PKGS.ToString() + bill.KINDPKGS + "'");
icount = icount + 5;
*/
icount = icount + 3;
var Shipping = "";
Shipping = formatEdiStr("txt", bill.SIREMARK);
@ -1525,9 +1533,9 @@ namespace Myshipping.Application.EDI
icount = icount + 1;
}
r.WriteLine("CNT+7:" + Math.Round(Convert.ToDecimal(bill.KGS), 3) + ":KGM'");
r.WriteLine("CNT+7:" + Math.Round(bill.KGS, 3) + ":KGM'");
r.WriteLine("CNT+11:" + bill.PKGS.ToString() + "'");
r.WriteLine("CNT+15:" + Math.Round(Convert.ToDecimal(bill.CBM), 3) + ":MTQ'");
r.WriteLine("CNT+15:" + Math.Round(bill.CBM, 3) + ":MTQ'");
icount = icount + 3;
@ -1646,7 +1654,7 @@ namespace Myshipping.Application.EDI
r.WriteLine("LOC+11+" + bill.PORTDISCHARGEID + ":139:6:" + bill.PORTDISCHARGE + "'");
icount = icount + 4;
if (bill.DESTINATION != "")
if (!string.IsNullOrWhiteSpace(bill.DESTINATION))
{
r.WriteLine("LOC+7+" + bill.DESTINATIONID + ":139:6:" + bill.DESTINATION + "'");
icount = icount + 1;
@ -1904,7 +1912,8 @@ namespace Myshipping.Application.EDI
icount = icount + 5;
var copynum = GetBillNum(bill.COPYNOBILL);
if (bill.ISSUETYPE == "正本")
//正本
if (bill.ISSUETYPE.Equals("ORIGINAL", StringComparison.OrdinalIgnoreCase))
{
r.WriteLine("DOC+706+++" + GetBillNum(bill.NOBILL) + "'");
icount = icount + 1;
@ -1915,15 +1924,17 @@ namespace Myshipping.Application.EDI
}
}
else if (bill.ISSUETYPE == "海运单" || bill.ISSUETYPE.ToUpper() == "SEAWAY" || bill.ISSUETYPE.ToUpper() == "SEAWAY BILL" || bill.ISSUETYPE.ToUpper() == "WAYBILL" || bill.ISSUETYPE.ToUpper() == "SWB正本"
else if (bill.ISSUETYPE.Equals("SEAWAY BILL", StringComparison.OrdinalIgnoreCase) || bill.ISSUETYPE == "海运单" || bill.ISSUETYPE.ToUpper() == "SEAWAY" || bill.ISSUETYPE.ToUpper() == "SEAWAY BILL" || bill.ISSUETYPE.ToUpper() == "WAYBILL" || bill.ISSUETYPE.ToUpper() == "SWB正本"
|| bill.ISSUETYPE.ToUpper() == "SWB无正本")
{
//海运单
r.WriteLine("DOC+710+++" + GetBillNum(bill.NOBILL) + "'");
icount = icount + 1;
}
else if (bill.ISSUETYPE.ToUpper() == "BILL COPY" || bill.ISSUETYPE == "电放")
else if (bill.ISSUETYPE.Equals("TELEX", StringComparison.OrdinalIgnoreCase) || bill.ISSUETYPE.ToUpper() == "BILL COPY" || bill.ISSUETYPE == "电放")
{
//电放
r.WriteLine("DOC+706+++" + GetBillNum(bill.NOBILL) + "'");
icount = icount + 1;
if (copynum != "")
@ -2003,8 +2014,8 @@ namespace Myshipping.Application.EDI
icount = icount + 1;
}
r.WriteLine("MEA+AAE+WT+KGM:" + Math.Round(Convert.ToDecimal(bill.KGS), 3) + "'");
r.WriteLine("MEA+AAE+AAW+MTQ:" + Math.Round(Convert.ToDecimal(bill.CBM), 3) + "'");
r.WriteLine("MEA+AAE+WT+KGM:" + Math.Round(bill.KGS, 3) + "'");
r.WriteLine("MEA+AAE+AAW+MTQ:" + Math.Round(bill.CBM, 3) + "'");
icount = icount + 2;
@ -2038,8 +2049,8 @@ namespace Myshipping.Application.EDI
foreach (var ctn in bill.CTNLIST)
{
r.WriteLine("SGP+" + ctn.CNTRNO + "+" + ctn.PKGS.ToString() + "'");
r.WriteLine("MEA+AAE+WT+KGM:" + Math.Round(Convert.ToDecimal(ctn.KGS), 3) + "'");
r.WriteLine("MEA+AAE+AAW+MTQ:" + Math.Round(Convert.ToDecimal(ctn.CBM), 3) + "'");
r.WriteLine("MEA+AAE+WT+KGM:" + Math.Round(ctn.KGS, 3) + "'");
r.WriteLine("MEA+AAE+AAW+MTQ:" + Math.Round(ctn.CBM, 3) + "'");
icount = icount + 3;
}
#endregion
@ -2079,9 +2090,9 @@ namespace Myshipping.Application.EDI
}
//MEA+AAE+WT+KGM:3000'
//MEA+AAE+AAW+MTQ:110.11'
r.WriteLine("MEA+AAE+WT+KGM:" + ctngood.KGS.ToString("0.###") + "'");
r.WriteLine("MEA+AAE+WT+KGM:" + Math.Round(ctngood.KGS,3) + "'");
icount++;
r.WriteLine("MEA+AAE+AAW+MTQ:" + ctngood.CBM.ToString("0.###") + "'");
r.WriteLine("MEA+AAE+AAW+MTQ:" + Math.Round(ctngood.CBM,3) + "'");
icount++;
//PCI++MARKS AND NUMBERS:FOR MATERIAL 1: OUR PONUMBER: PO_123456'
//if (isbill != 1)
@ -2115,9 +2126,9 @@ namespace Myshipping.Application.EDI
//SGP+MSCU1234567+100'
r.WriteLine("SGP+" + ctngood.CNTRNO + "+" + ctngood.PKGS.ToString() + "'");
//MEA+AAE+WT+KGM:1000'
r.WriteLine("MEA+AAE+WT+KGM:" + Math.Round(Convert.ToDecimal(ctngood.KGS), 3) + "'");
r.WriteLine("MEA+AAE+WT+KGM:" + Math.Round(ctngood.KGS, 3) + "'");
//MEA+AAE+AAW+MTQ:50.11'
r.WriteLine("MEA+AAE+AAW+MTQ:" + Math.Round(Convert.ToDecimal(ctngood.CBM), 3) + "'");
r.WriteLine("MEA+AAE+AAW+MTQ:" + Math.Round(ctngood.CBM, 3) + "'");
icount = icount + 3;
i = i + 1;
}
@ -2261,8 +2272,10 @@ namespace Myshipping.Application.EDI
r.WriteLine("EQD+CN+" + ctn.CNTRNO + "+" + ctn.CTNALLCODE + "+1'");
else
r.WriteLine("EQD+CN+" + ctn.CNTRNO + "+" + ctn.CTNALLCODE + "+2'");
r.WriteLine("MEA+AAE+WT+KGM:" + Math.Round(Convert.ToDecimal(ctn.KGS), 3) + "'");
r.WriteLine("MEA+AAE+AAW+MTQ:" + Math.Round(Convert.ToDecimal(ctn.CBM), 3) + "'");
r.WriteLine("MEA+AAE+WT+KGM:" + Math.Round(ctn.KGS, 3) + "'");
r.WriteLine("MEA+AAE+AAW+MTQ:" + Math.Round(ctn.CBM, 3) + "'");
icount = icount + 3;
if (bill.CARGOID == "R")

@ -7324,7 +7324,10 @@ namespace Myshipping.Application
{
_logger.LogInformation("批次={no} 主题单号为空 MBLNO={mblno} 取订舱编号补到主提单号 custno={custno}", batchNo, primaryModel.MBLNO, order.CUSTNO);
primaryModel.MBLNO = order.CUSTNO;
if (model.sendType.Equals("B", StringComparison.OrdinalIgnoreCase))
{
primaryModel.MBLNO = order.CUSTNO;
}
}
}

@ -169,27 +169,32 @@ namespace Myshipping.Application
if (taskBase == null)
throw Oops.Oh($"任务主键{taskPkId}无法获取业务信息");
var vgmOrder = _taskVGMInfoRepository.AsQueryable().First(a => a.TASK_ID == taskBase.PK_ID);
var vgmOrderList = _taskVGMInfoRepository.AsQueryable().Where(a => a.TASK_ID == taskBase.PK_ID).ToList();
if (vgmOrder == null)
if (vgmOrderList.Count > 0)
throw Oops.Oh($"任务主键{taskPkId}无法获取VGM信息");
var vgmPkList = vgmOrderList.Select(a => a.PK_ID).ToList();
var CtnList = _taskVGMCtnInfoRepository.AsQueryable()
.Where(a => a.P_ID == vgmOrder.PK_ID).ToList();
.Where(a => vgmPkList.Contains(a.P_ID)).ToList();
if (CtnList.Count > 0)
{
list = CtnList.OrderBy(p => p.P_ID).ThenBy(p => p.CNTRNO).Select(p =>
{
TaskVGMShowDto model = vgmOrder.Adapt<TaskVGMShowDto>();
vgmOrderList.ForEach(v => {
model.CntrNo = p.CNTRNO;
model.VGMWeight = p.VGM_WEIGHT;
model.VGMWeightMethod = p.VGM_METHOD;
model.VGMWeightUnit = p.VGM_WEIGHT_UNIT;
list.AddRange(CtnList.Where(p => p.P_ID == v.PK_ID).OrderBy(p => p.CNTRNO).Select(p =>
{
TaskVGMShowDto model = v.Adapt<TaskVGMShowDto>();
return model;
}).ToList();
model.CntrNo = p.CNTRNO;
model.VGMWeight = p.VGM_WEIGHT;
model.VGMWeightMethod = p.VGM_METHOD;
model.VGMWeightUnit = p.VGM_WEIGHT_UNIT;
return model;
}).ToList());
});
}
return list;

Loading…
Cancel
Save