wxw
15 小时以前 b1e84f41539a893949c29dbb23390a882c2a452f
Wms/WMS.BLL/BllSoServer/ExportNoticeServer.cs
@@ -337,11 +337,11 @@
                {
                    //客户信息
                    var customer = Db.Queryable<SysCustomer>().First(m => m.IsDel == "0" && m.CustomerNo == model.customerNo);
                    if (customer == null)
                    if (customer != null)
                    {
                        throw new Exception("客户信息不存在!");
                        //throw new Exception("客户信息不存在!");
                        CustomerName = customer.CustomerName;
                    }
                    CustomerName = customer.CustomerName;
                }
                //承运商信息
@@ -612,19 +612,25 @@
                        
                        CreateUser = 0,
                    };
                    if (houseNo == "1000" || houseNo == "1001" || houseNo == "2000")
                    {
                        notice.WareHouseNo = "W01";
                    }
                    else if (houseNo == "2001")
                    if (houseNo == "1000" || houseNo == "1001" || houseNo == "2000" || houseNo == "2002" || houseNo == "2003" || houseNo == "2004")
                    {
                        notice.WareHouseNo = "W02";
                    }
                    else if (houseNo == "4000")
                    {
                        notice.WareHouseNo = "W01";
                    }
                    else
                    {
                        throw new Exception("发出仓库异常");
                        // houseNo抛异常,避免出现非W01,W02的值
                        throw new Exception($"不支持的发出仓库编号:{houseNo},仅支持生成W01和W02仓库的单据");
                    }
                    //额外校验(可选,双重保障)
                    if (notice.WareHouseNo != "W01" && notice.WareHouseNo != "W02")
                    {
                        throw new Exception($"仓库编号异常:{notice.WareHouseNo},仅允许W01和W02");
                    }
                    var n = Db.Insertable<BllExportNotice>(notice).ExecuteCommand();
                    var m = Db.Insertable<BllExportNoticeDetail>(list).ExecuteCommand();