From 19e95f4acc328bbf62a0427fe658d00268019e66 Mon Sep 17 00:00:00 2001 From: zhaowc <526854230@qq.com> Date: 星期一, 07 四月 2025 10:14:34 +0800 Subject: [PATCH] 修改IIS配置 --- Wms/WMS.BLL/BllPdaServer/PdaAsnServer.cs | 208 +++++++++++++++++++++++++++++++++++----------------- 1 files changed, 140 insertions(+), 68 deletions(-) diff --git a/Wms/WMS.BLL/BllPdaServer/PdaAsnServer.cs b/Wms/WMS.BLL/BllPdaServer/PdaAsnServer.cs index 461c9fc..491e79b 100644 --- a/Wms/WMS.BLL/BllPdaServer/PdaAsnServer.cs +++ b/Wms/WMS.BLL/BllPdaServer/PdaAsnServer.cs @@ -1950,6 +1950,14 @@ { try { + if (levelType == "0") + { + throw new Exception("鏈壘鍒拌鐗╂枡鐨勭鍖呰绾у埆"); + } + if (levelType == "3") + { + throw new Exception("鏈皟璇曡绾у埆鍖呰锛�"); + } var list = new List<BllBoxInfo>(); var data = new { BoxNo = boxNo }; @@ -1957,75 +1965,75 @@ #region 娴嬭瘯鐗堟湰 - //璇诲彇json鏂囦欢锛屾坊鍔犳暟鎹� - var ss = AppDomain.CurrentDomain.BaseDirectory; - string filePath = Path.Combine(ss, "CreateBoxInfo.json"); - string json = File.ReadAllText(filePath); - var person = JsonConvert.DeserializeObject<List<BllBoxInfo>>(json); + ////璇诲彇json鏂囦欢锛屾坊鍔犳暟鎹� + //var ss = AppDomain.CurrentDomain.BaseDirectory; + //string filePath = Path.Combine(ss, "CreateBoxInfo.json"); + //string json = File.ReadAllText(filePath); + //var person = JsonConvert.DeserializeObject<List<BllBoxInfo>>(json); var comTime = DateTime.Now; - //娣诲姞绠辩爜淇℃伅琛ㄤ腑 //鏆傛椂杩欎簺鍐�--娣诲姞鏁版嵁锛屽悗缁渶瑕佸拰璧嬬爜绯荤粺瀵规帴鍚� 鏍规嵁鏄庣‘杩斿洖鐨勬暟鎹牸寮忔洿鏀� - foreach (var item in person) - { - if (item.BoxNo!= boxNo) - { - continue; - } + ////娣诲姞绠辩爜淇℃伅琛ㄤ腑 //鏆傛椂杩欎簺鍐�--娣诲姞鏁版嵁锛屽悗缁渶瑕佸拰璧嬬爜绯荤粺瀵规帴鍚� 鏍规嵁鏄庣‘杩斿洖鐨勬暟鎹牸寮忔洿鏀� + //foreach (var item in person) + //{ + // if (item.BoxNo!= boxNo) + // { + // continue; + // } - var sku = Db.Queryable<SysMaterials>().First(m=>m.IsDel =="0" && m.SkuNo == item.SkuNo); - if (sku == null) - { - continue; - } - var boxInfo = new BllBoxInfo() - { - ASNNo = "", - //ASNDetailNo = 0, - OrderCode = "", - //BindNo = 0, - BoxNo = item.BoxNo, - BoxNo2 = item.BoxNo2, - BoxNo3 = item.BoxNo3, - PalletNo = "", - Qty = item.Qty, - FullQty = item.FullQty, - Status = "0", - SkuNo = item.SkuNo, - SkuName = sku.SkuName, - LotNo = item.LotNo, - LotText = item.LotText, - SupplierLot = item.SupplierLot, - ProductionTime = item.ProductionTime, - ExpirationTime = item.ExpirationTime, - //CompleteTime = comTime, - InspectMark = item.InspectMark, - BitBoxMark = item.BitBoxMark, - InspectStatus = item.InspectStatus, - Origin = "璧嬬爜", - Standard = item.Standard, - PackageStandard = item.PackageStandard, - StoreTime = item.StoreTime, - QtyOrd = item.QtyOrd, - QtyCount = item.QtyCount, - CreateUser = 0, - CreateTime = comTime, - }; - list.Add(boxInfo); - } - Db.Insertable(list).ExecuteCommand(); + // var sku = Db.Queryable<SysMaterials>().First(m=>m.IsDel =="0" && m.SkuNo == item.SkuNo); + // if (sku == null) + // { + // continue; + // } + // var boxInfo = new BllBoxInfo() + // { + // ASNNo = "", + // //ASNDetailNo = 0, + // OrderCode = "", + // //BindNo = 0, + // BoxNo = item.BoxNo, + // BoxNo2 = item.BoxNo2, + // BoxNo3 = item.BoxNo3, + // PalletNo = "", + // Qty = item.Qty, + // FullQty = item.FullQty, + // Status = "0", + // SkuNo = item.SkuNo, + // SkuName = sku.SkuName, + // LotNo = item.LotNo, + // LotText = item.LotText, + // SupplierLot = item.SupplierLot, + // ProductionTime = item.ProductionTime, + // ExpirationTime = item.ExpirationTime, + // //CompleteTime = comTime, + // InspectMark = item.InspectMark, + // BitBoxMark = item.BitBoxMark, + // InspectStatus = item.InspectStatus, + // Origin = "璧嬬爜", + // Standard = item.Standard, + // PackageStandard = item.PackageStandard, + // StoreTime = item.StoreTime, + // QtyOrd = item.QtyOrd, + // QtyCount = item.QtyCount, + // CreateUser = 0, + // CreateTime = comTime, + // }; + // list.Add(boxInfo); + //} + //Db.Insertable(list).ExecuteCommand(); #endregion #region 姝e紡鐗堟湰 var token = new Token().GetFuMaToken(fuMaTokenUrl); var getParentVal = levelType == "1" ? "true" : "false"; - var getChildrenVal = levelType == "3" ? "true" : "false"; + var getChildrenVal = levelType == "2" ? "true" : "false"; Dictionary<string, string> paramDic = new Dictionary<string, string> { { "Token", token }, //鍒嗛厤鐨勪护鐗岋紙鍙橀噺锛� { "Barcode", boxNo },//瑕佹煡璇㈢殑鏉$爜 { "getParent", getParentVal },//鏄惁鏌ヨ鐖剁爜 - { "getChildren", getChildrenVal } //鏄惁鏌ヨ瀛愮爜 + { "getChildren", getChildrenVal } //鏄惁鏌ヨ瀛愮爜 aaa }; //绋嬪簭姝e紡鍙戝竷鍚庢斁寮� @@ -2043,17 +2051,17 @@ throw new Exception("浜у搧淇℃伅鎴栫鏀俊鎭负绌�"); } - foreach (var item in fuMaModel.Barcodes) + if (levelType == "1") { - if (item.Barcode != boxNo) + if (fuMaModel.Barcodes.First().Barcode != boxNo) { throw new Exception("鑾峰彇淇℃伅涓嶄竴鑷�"); } - var sku = Db.Queryable<SysMaterials>().First(m => m.IsDel == "0" && m.SkuNo == fuMaModel.Product.ProductCode); + var sku = Db.Queryable<SysMaterials>().First(m => m.IsDel == "0" && m.SkuNo == fuMaModel.MaterialNum); if (sku == null) { - throw new Exception("鏈煡璇㈠埌绠辩爜涓殑鐗╂枡淇℃伅"); + throw new Exception("鏈煡璇㈠埌绠辩爜涓拰璧嬬爜鎻愪緵鐨勭墿鏂欎俊鎭竴鑷寸殑鏁版嵁"); } var boxInfo = new BllBoxInfo() { @@ -2061,23 +2069,21 @@ //ASNDetailNo = 0, OrderCode = "", //BindNo = 0, - BoxNo = item.Barcode, - BoxNo2 = item.Barcode, - BoxNo3 = item.Barcode, + BoxNo = fuMaModel.Barcodes.First().Barcode, PalletNo = "", - Qty = item.BoxItemQty, + Qty = fuMaModel.Barcodes.First().BoxItemQty, FullQty = fuMaModel.BoxItemQty, Status = "0", SkuNo = sku.SkuNo, SkuName = sku.SkuName, - LotNo = item.BatchNo, + LotNo = fuMaModel.Barcodes.First().BatchNo, //LotText = "", //SupplierLot = item.SupplierLot, - ProductionTime = DateTime.Parse(item.ProductionDate), - ExpirationTime = DateTime.Parse(item.ExpirationDate), + ProductionTime = DateTime.Parse(fuMaModel.Barcodes.First().ProductionDate), + ExpirationTime = DateTime.Parse(fuMaModel.Barcodes.First().ExpirationDate), //CompleteTime = comTime, InspectMark = "0", - BitBoxMark = item.Status == "闆剁"? "1":"0", + BitBoxMark = fuMaModel.Barcodes.First().Status == "闆剁" ? "1" : "0", InspectStatus = "0", Origin = "璧嬬爜", Standard = fuMaModel.Product.Spec, @@ -2090,6 +2096,56 @@ }; list.Add(boxInfo); } + else + { + foreach (var item in fuMaModel.Barcodes) + { + if (item.Barcode == boxNo) + { + continue; //鑾峰彇鏀爜鏃剁涓�涓爜涓虹埗鐮� + } + + var sku = Db.Queryable<SysMaterials>().First(m => m.IsDel == "0" && m.SkuNo == fuMaModel.MaterialNum); + if (sku == null) + { + throw new Exception("鏈煡璇㈠埌绠辩爜涓拰璧嬬爜鎻愪緵鐨勭墿鏂欎俊鎭竴鑷寸殑鏁版嵁"); + } + var boxInfo = new BllBoxInfo() + { + ASNNo = "", + //ASNDetailNo = 0, + OrderCode = "", + //BindNo = 0, + BoxNo = item.ParentBarcode, + BoxNo3 = item.Barcode, + PalletNo = "", + Qty = item.MinLevelCount, + FullQty = fuMaModel.BoxItemQty, + Status = "0", + SkuNo = sku.SkuNo, + SkuName = sku.SkuName, + LotNo = item.BatchNo, + //LotText = "", + //SupplierLot = item.SupplierLot, + ProductionTime = DateTime.Parse(item.ProductionDate), + ExpirationTime = DateTime.Parse(item.ExpirationDate), + //CompleteTime = comTime, + InspectMark = "0", + BitBoxMark = item.Status == "闆剁" ? "1" : "0", + InspectStatus = "0", + Origin = "璧嬬爜", + Standard = fuMaModel.Product.AuthorizedNo, + PackageStandard = fuMaModel.Product.PackageSpec, + //StoreTime = item.StoreTime, + //QtyOrd = item.QtyOrd, + QtyCount = (int)fuMaModel.BoxItemQty, + CreateUser = 0, + CreateTime = comTime, + }; + list.Add(boxInfo); + } + } + Db.Insertable(list).ExecuteCommand(); } else @@ -2131,7 +2187,22 @@ var count = Db.Queryable<BllBoxInfo>().Count(m => m.IsDel == "0" && m.Status == "0" && m.BoxNo == model.BoxNo); if (count == 0) { - GetBoxInfoByFuMa(model.BoxNo, url, fuMaTokenUrl,"1"); //浠庤祴鐮佺郴缁熻幏鍙栫鐮佷俊鎭� + //鑾峰彇鐗╂枡鍖呰绾у埆 + string level = "0"; + var levelType = Db.Queryable<SysPackag>().First(w => w.IsDel == "0" && w.PackagNo == detail.SkuNo); + if (levelType.L1Name == "绠�") + { + level = "1"; + } + if (levelType.L2Name == "绠�") + { + level = "2"; + } + if (levelType.L3Name == "绠�") + { + level = "3"; + } + GetBoxInfoByFuMa(model.BoxNo, url, fuMaTokenUrl, level); //浠庤祴鐮佺郴缁熻幏鍙栫鐮佷俊鎭� } } } @@ -2582,6 +2653,7 @@ DateTime proTime; DateTime expTime; + DateTime sortTime; var bl1 = DateTime.TryParse(detail.Lot1, out proTime); var bl2 = DateTime.TryParse(detail.Lot2, out expTime); -- Gitblit v1.8.0