zhaowc
2025-04-01 1650f3fe1467d21074b597042861c46f3a8c4447
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 };
@@ -2019,7 +2027,7 @@
                #region 正式版本
                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 }, //分配的令牌(变量)
@@ -2043,9 +2051,9 @@
                        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("获取信息不一致");
                        }
@@ -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); //从赋码系统获取箱码信息
                            }
                        }
                    }