From dbdee689acd9f622bbe62201976e095c7228967d Mon Sep 17 00:00:00 2001 From: liuying <1427574514@qq.com> Date: 周二, 10 12月 2024 13:41:00 +0800 Subject: [PATCH] pda --- LA24030_LuLiPackageLine_Print/LA24030_LuLiPackageLine_PrintService/WindowsFormsApplication1/Form1.cs | 16 +++++++++++----- 1 files changed, 11 insertions(+), 5 deletions(-) diff --git a/LA24030_LuLiPackageLine_Print/LA24030_LuLiPackageLine_PrintService/WindowsFormsApplication1/Form1.cs b/LA24030_LuLiPackageLine_Print/LA24030_LuLiPackageLine_PrintService/WindowsFormsApplication1/Form1.cs index 528d7b8..445ea10 100644 --- a/LA24030_LuLiPackageLine_Print/LA24030_LuLiPackageLine_PrintService/WindowsFormsApplication1/Form1.cs +++ b/LA24030_LuLiPackageLine_Print/LA24030_LuLiPackageLine_PrintService/WindowsFormsApplication1/Form1.cs @@ -312,10 +312,10 @@ Dictionary<string, object> data = new Dictionary<string, object>(); if (printClassifyEnum == PrintClassifyEnum.鍖呰鏉$爜) { - data.Add("Info4", item.Info4);//鍚堝悓鍗曞彿 + data.Add("Info4", item.Info4 ?? "");//鍚堝悓鍗曞彿 data.Add("Info5", item.Info5 ?? "");//鐢熶骇鍗曞彿 data.Add("Info6", "绗�" + (item.Info6 ?? "") + "鍖�");//绗嚑鍖� - data.Add("bar", item.PackageCode);//浜岀淮鐮侊紙鍖呭彿锛� + data.Add("bar", item.PackageCode ?? "");//浜岀淮鐮侊紙鍖呭彿锛� data.Add("Info7", item.Info7 ?? "");//缁忛攢搴� data.Add("Info8", item.Info8 ?? "");//浜у搧 data.Add("Info9", item.PackageCode ?? "");//鍖呰缂栫爜 @@ -325,13 +325,19 @@ data.Add("Info13", item.Info13 ?? "");//褰撳墠鍖呴潰绉� data.Add("printTime", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")); - var finsiList = mycontext.mes_package_gather.Where(x => x.Info5 == item.Info5 && x.UpiStatus >= (int)UpiStatusEnum.宸插悎鍖�); + var finsiList = mycontext.mes_package_gather.Where(x => x.Info5 == item.Info5 && x.UpiStatus >= (int)UpiStatusEnum.宸插悎鍖�).ToList(); double leijisaomiaomj = 0; foreach (var aa in finsiList) { - leijisaomiaomj += Convert.ToDouble(aa.Info13); + if (!string.IsNullOrEmpty(aa.Info13)) + { + leijisaomiaomj += Convert.ToDouble(aa.Info13); + } } - leijisaomiaomj += Convert.ToDouble(item.Info13); + if (!string.IsNullOrEmpty(item.Info13)) + { + leijisaomiaomj += Convert.ToDouble(item.Info13); + } data.Add("leijisaomiaomj", leijisaomiaomj);//绱鎵弿闈㈢Н //鏌ヨ涓� 鍖呮暟鎹� -- Gitblit v1.9.3