yangle
2022-06-22 69dfb9f737317867c4646d04e86a94c8c626a879
WebAPI/Controllers/JHGL/Gy_RoutingBillController.cs
@@ -428,18 +428,11 @@
                    return objJsonResult;
                }
                string hnumber = "";
                if (tb2.Rows.Count > 0)
                {
                    hnumber = DBUtility.ClsPub.isStrNull(tb2.Rows[0]["产品代码"].ToString());
                }
                for (int i = 0; i <= tb2.Rows.Count - 1; i++)
                {
                    string sHNumber = "";
                    if (DBUtility.ClsPub.isStrNull(tb2.Rows[i]["产品代码"].ToString()) != "")
                    {
                        //
                        sHNumber = DBUtility.ClsPub.isStrNull(tb2.Rows[i]["产品代码"].ToString());
                        //审核代码是否合理
                        if (!DBUtility.ClsPub.AllowNumber(sHNumber))
@@ -451,41 +444,14 @@
                            return objJsonResult;
                        }
                        if (hnumber == DBUtility.ClsPub.isStrNull(tb2.Rows[i]["产品代码"].ToString()))
                        //得到物料内码
                        if (!oMaterHlp.GetInfoByNumber(sHNumber))
                        {
                            //得到物料内码
                            if (!oMaterHlp.GetInfoByNumber(sHNumber))
                            {
                                objJsonResult.code = "0";
                                objJsonResult.count = 0;
                                objJsonResult.Message = "第" + (i+1).ToString() + "行," + sHNumber + "没有找到对应的物料!";
                                objJsonResult.data = null;
                                return objJsonResult;
                            }
                        }
                        else
                        {
                            hnumber = DBUtility.ClsPub.isStrNull(tb2.Rows[i]["产品代码"].ToString());
                            sHNumber = DBUtility.ClsPub.isStrNull(tb2.Rows[i]["产品代码"].ToString());
                            //审核代码是否合理
                            if (!DBUtility.ClsPub.AllowNumber(sHNumber))
                            {
                                objJsonResult.code = "0";
                                objJsonResult.count = 0;
                                objJsonResult.Message = "物料代码中不能出现连续‘.’并且首位末位不能为‘.’!";
                                objJsonResult.data = null;
                                return objJsonResult;
                            }
                            //得到物料内码
                            if (!oMaterHlp.GetInfoByNumber(sHNumber))
                            {
                                objJsonResult.code = "0";
                                objJsonResult.count = 0;
                                objJsonResult.Message = "第" + (i + 1).ToString() + "行," + sHNumber + "没有找到对应的物料!";
                                objJsonResult.data = null;
                                return objJsonResult;
                            }
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "第" + (i + 1).ToString() + "行," + sHNumber + "没有找到对应的物料!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                    }
                    else