diff --git a/FactorySystemApi/Controllers/FormulaController.cs b/FactorySystemApi/Controllers/FormulaController.cs index 047c3f2..37ba9ba 100644 --- a/FactorySystemApi/Controllers/FormulaController.cs +++ b/FactorySystemApi/Controllers/FormulaController.cs @@ -403,11 +403,12 @@ namespace FactorySystemApi.Controllers { foreach(BomModel bom in subBomList) { - if (bom.Type == "a" || bom.Type == "f") + string bomType = bom.Type.ToLower(); // 转小写 + if (bomType == "a" || bomType == "f") { bom.ABomType = "20"; } - else if (bom.Type == "b" || bom.Type == "bb" || bom.Type == "i" || bom.Type == "iz") + else if (bomType == "b" || bomType == "bb" || bomType == "i" || bomType == "iz") { bom.ABomType = "30"; } diff --git a/FactorySystemBll/FormulaBll.cs b/FactorySystemBll/FormulaBll.cs index c21f9af..fea04d0 100644 --- a/FactorySystemBll/FormulaBll.cs +++ b/FactorySystemBll/FormulaBll.cs @@ -176,6 +176,25 @@ namespace FactorySystemBll } } + // 按照协同物料清单下来的逻辑修改配方物料类型 + string ftype = temp.FType.ToLower(); + if (ftype == "f") + { + temp.FType = "10"; + } + else if (ftype == "a") + { + temp.FType = "20"; + } + else if (ftype == "b" || ftype == "bb" || ftype == "i" || ftype == "iz") + { + temp.FType = "30"; + } + else + { + temp.FType = "40"; + } + TBasicCode bType = typeList.Find(s => s.FName == temp.FType || s.FValue == temp.FType); if (bType != null) temp.FType = bType.FValue; insertList.Add(temp);