wxw
6 天以前 399eb07af584e1e2f1f7dafcfbb3b2a386cfbf3c
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();
@@ -744,7 +750,7 @@
                    };
                    #region 通过接口发送至erp
                    //系统对接后放开
                    /*var jsonData = JsonConvert.SerializeObject(soInfo);
                    var jsonData = JsonConvert.SerializeObject(soInfo);
                    var response = HttpHelper.DoPost(url, jsonData, "出库单完成上传", "ERP");
@@ -752,7 +758,7 @@
                    if (obj.Success != 0)
                    {
                        throw new Exception("上传失败" + obj.Message);
                    }*/
                    }
                    #endregion
                }
@@ -1949,10 +1955,10 @@
                        //    }
                        //}
                        if (d.Qty != d.CompleteQty)
                        {
                            throw new Exception("当前单据明细中计划数量与拣货数量不符,请核实");
                        }
                        //if (d.Qty != d.CompleteQty)
                        //{
                        //    throw new Exception("当前单据明细中计划数量与拣货数量不符,请核实");
                        //}
                        #region 库存表减去锁定数量与总数量(PDA拣货的时候已经减去数量了)
                        /*var sq = stocks.Where(s => s.SkuNo == d.SkuNo);
                        if (!string.IsNullOrWhiteSpace(d.LotNo))