|
@@ -94,6 +94,17 @@ namespace JLHHJSvr.Helper
|
|
|
CulcalateCost(bednet, mxlist, springList, isNewFormula);
|
|
|
|
|
|
CulcalateWeight(bednet, mxlist, springList);
|
|
|
+
|
|
|
+
|
|
|
+ if (formula_replacements_hide.Count > 0)
|
|
|
+ {
|
|
|
+ foreach (var replacement in formula_replacements_hide)
|
|
|
+ {
|
|
|
+ var _key = replacement.Key.Replace("【", "").Replace("】", "");
|
|
|
+ var value = CalculateVarFormula(_key).DecimalValue;
|
|
|
+ AddKeyValue(_key, value);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
/// <summary>
|
|
|
/// 获取损耗率
|
|
@@ -206,7 +217,6 @@ namespace JLHHJSvr.Helper
|
|
|
mx.spring_mtrl_cost = Calculate(mx.spring_mtrl_cost_replace_formula, out rp_formula, "弹簧材料总成本").DecimalValue;
|
|
|
mx.spring_mtrl_cost_replace_formula = rp_formula;
|
|
|
|
|
|
-
|
|
|
#region 获取损耗率,计算
|
|
|
if (isNewFormula)
|
|
|
{
|
|
@@ -323,6 +333,18 @@ namespace JLHHJSvr.Helper
|
|
|
mx.hard_around_mtrl_cost = Calculate(mx.hard_around_mtrl_cost_replace_formula, out rp_formula, "四周加硬材料成本").DecimalValue;
|
|
|
mx.hard_around_mtrl_cost_replace_formula = rp_formula;
|
|
|
bednet.hard_around_mtrl_cost += mx.hard_around_mtrl_cost;
|
|
|
+
|
|
|
+ #region 获取损耗率,计算
|
|
|
+ if (isNewFormula)
|
|
|
+ {
|
|
|
+ decimal? _rate = GetSumhaoRate(0);
|
|
|
+ bednet.hard_around_mtrl_cost += mx.hard_around_mtrl_cost * (1 + _rate);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ bednet.hard_around_mtrl_cost += mx.hard_around_mtrl_cost;
|
|
|
+ }
|
|
|
+ #endregion
|
|
|
AddKeyValue("四周加硬材料成本", bednet.hard_around_mtrl_cost);
|
|
|
AddFormulaMxKeyValue("【四周加硬材料成本】", bednet.hard_around_mtrl_formula);
|
|
|
}
|
|
@@ -407,7 +429,7 @@ namespace JLHHJSvr.Helper
|
|
|
if (mtrlPrice != null)
|
|
|
{
|
|
|
decimal? _rate = GetSumhaoRate(mtrlPrice.mtrltype.Value);
|
|
|
- bednet.fabrics1_mtrl_cost = bednet.fabrics2_mtrl_cost * (1 + _rate);
|
|
|
+ bednet.fabrics2_mtrl_cost = bednet.fabrics2_mtrl_cost * (1 + _rate);
|
|
|
}
|
|
|
}
|
|
|
#endregion
|
|
@@ -833,6 +855,10 @@ namespace JLHHJSvr.Helper
|
|
|
AddKeyValue("钢丝重量", bednet.spring_weight_qty);
|
|
|
AddFormulaWeightKeyValue("【钢丝重量】", bednet.spring_weight_formula, true, 1);
|
|
|
}
|
|
|
+ else
|
|
|
+ {
|
|
|
+ AddKeyValue("钢丝重量", 0);
|
|
|
+ }
|
|
|
#endregion 计算 钢丝重量 结束
|
|
|
|
|
|
#region 计算 边铁重量 开始
|
|
@@ -844,6 +870,10 @@ namespace JLHHJSvr.Helper
|
|
|
AddKeyValue("边铁重量", bednet.side_iron_weight_qty);
|
|
|
AddFormulaWeightKeyValue("【边铁重量】", bednet.side_iron_weight_formula);
|
|
|
}
|
|
|
+ else
|
|
|
+ {
|
|
|
+ AddKeyValue("边铁重量", 0);
|
|
|
+ }
|
|
|
#endregion 计算 边铁重量 结束
|
|
|
|
|
|
#region 计算 四周加硬重量 开始
|
|
@@ -855,6 +885,10 @@ namespace JLHHJSvr.Helper
|
|
|
AddKeyValue("四周加硬重量", bednet.hard_around_weight_qty);
|
|
|
AddFormulaWeightKeyValue("【四周加硬重量】", bednet.hard_around_weight_formula);
|
|
|
}
|
|
|
+ else
|
|
|
+ {
|
|
|
+ AddKeyValue("四周加硬重量", 0);
|
|
|
+ }
|
|
|
#endregion 计算 四周加硬重量 结束
|
|
|
|
|
|
#region 计算 入袋无纺布重量 开始
|
|
@@ -866,6 +900,10 @@ namespace JLHHJSvr.Helper
|
|
|
AddKeyValue("入袋无纺布重量", bednet.fabrics1_weight_qty);
|
|
|
AddFormulaWeightKeyValue("【入袋无纺布重量】", bednet.fabrics1_weight_formula);
|
|
|
}
|
|
|
+ else
|
|
|
+ {
|
|
|
+ AddKeyValue("入袋无纺布重量", 0);
|
|
|
+ }
|
|
|
#endregion 计算 入袋无纺布重量 结束
|
|
|
|
|
|
#region 计算 面底无纺布重量 开始
|
|
@@ -877,6 +915,10 @@ namespace JLHHJSvr.Helper
|
|
|
AddKeyValue("面底无纺布重量", bednet.fabrics2_weight_qty);
|
|
|
AddFormulaWeightKeyValue("【面底无纺布重量】", bednet.fabrics2_weight_formula);
|
|
|
}
|
|
|
+ else
|
|
|
+ {
|
|
|
+ AddKeyValue("面底无纺布重量", 0);
|
|
|
+ }
|
|
|
#endregion 计算 面底无纺布重量 结束
|
|
|
|
|
|
#region 计算 上垫层重量 开始
|
|
@@ -891,6 +933,10 @@ namespace JLHHJSvr.Helper
|
|
|
AddKeyValue("上/下垫层重量", bednet.felt_weight_qty);
|
|
|
AddFormulaWeightKeyValue("【上/下垫层重量】", bednet.felt_weight_formula);
|
|
|
}
|
|
|
+ else
|
|
|
+ {
|
|
|
+ AddKeyValue("上/下垫层重量", 0);
|
|
|
+ }
|
|
|
#endregion 计算 上垫层重量 结束
|
|
|
|
|
|
#region 计算 下垫层重量 开始
|
|
@@ -905,6 +951,10 @@ namespace JLHHJSvr.Helper
|
|
|
AddKeyValue("上/下垫层重量", bednet.felt_weight_qty);
|
|
|
AddFormulaWeightKeyValue("【上/下垫层重量】", bednet.felt_weight_formula);
|
|
|
}
|
|
|
+ else
|
|
|
+ {
|
|
|
+ AddKeyValue("四周加硬重量", 0);
|
|
|
+ }
|
|
|
|
|
|
bednet.felt_weight_replace_formula += felt_weight_formula_replace_formula;
|
|
|
bednet.felt_weight_replace_formula += Environment.NewLine;
|
|
@@ -921,6 +971,10 @@ namespace JLHHJSvr.Helper
|
|
|
AddKeyValue("C钉/夹码重量", bednet.cnail_weight_qty);
|
|
|
AddFormulaWeightKeyValue("【C钉/夹码重量】", bednet.cnail_weight_formula);
|
|
|
}
|
|
|
+ else
|
|
|
+ {
|
|
|
+ AddKeyValue("C钉/夹码重量", 0);
|
|
|
+ }
|
|
|
#endregion 计算 C钉/夹码重量 结束
|
|
|
|
|
|
#region 计算 海绵包边重量 开始
|
|
@@ -932,6 +986,10 @@ namespace JLHHJSvr.Helper
|
|
|
AddKeyValue("海绵包边重量", bednet.sponge_weight_qty);
|
|
|
AddFormulaWeightKeyValue("【海绵包边重量】", bednet.sponge_weight_formula);
|
|
|
}
|
|
|
+ else
|
|
|
+ {
|
|
|
+ AddKeyValue("海绵包边重量", 0);
|
|
|
+ }
|
|
|
#endregion 计算 海绵包边重量 结束
|
|
|
|
|
|
#region 计算 填充海绵重量 开始
|
|
@@ -945,6 +1003,10 @@ namespace JLHHJSvr.Helper
|
|
|
AddKeyValue("填充海绵重量", bednet.sponge_weight_tc_qty);
|
|
|
AddFormulaWeightKeyValue("【填充海绵重量】", bednet.sponge_weight_tc_formula);
|
|
|
}
|
|
|
+ else
|
|
|
+ {
|
|
|
+ AddKeyValue("填充海绵重量", 0);
|
|
|
+ }
|
|
|
#endregion 计算 填充海绵重量 结束
|
|
|
|
|
|
#region 计算 封边材料重量 开始
|
|
@@ -958,6 +1020,10 @@ namespace JLHHJSvr.Helper
|
|
|
AddKeyValue("封边材料重量", bednet.edge_weight_qty);
|
|
|
AddFormulaWeightKeyValue("【封边材料重量】", bednet.edge_weight_formula);
|
|
|
}
|
|
|
+ else
|
|
|
+ {
|
|
|
+ AddKeyValue("封边材料重量", 0);
|
|
|
+ }
|
|
|
#endregion 计算 封边材料重量 结束
|
|
|
|
|
|
#region 计算 弹叉材料重量 开始
|
|
@@ -969,6 +1035,10 @@ namespace JLHHJSvr.Helper
|
|
|
AddKeyValue("弹叉材料重量", bednet.fork_weight_qty);
|
|
|
AddFormulaWeightKeyValue("【弹叉材料重量】", bednet.fork_weight_formula);
|
|
|
}
|
|
|
+ else
|
|
|
+ {
|
|
|
+ AddKeyValue("弹叉材料重量", 0);
|
|
|
+ }
|
|
|
#endregion 计算 弹叉材料重量 结束
|
|
|
}
|
|
|
|
|
@@ -1687,8 +1757,9 @@ namespace JLHHJSvr.Helper
|
|
|
private TData CalculateVarFormula(string varname)
|
|
|
{
|
|
|
varname = $"【{varname}】";
|
|
|
- if (!formula_replacements.ContainsKey(varname)) return null;
|
|
|
- return Calculate(formula_replacements[varname].value, varname);
|
|
|
+ if (formula_replacements.ContainsKey(varname)) return Calculate(formula_replacements[varname].value, varname);
|
|
|
+ if (formula_replacements_hide.ContainsKey(varname)) return Calculate(formula_replacements_hide[varname].value, varname);
|
|
|
+ return null;
|
|
|
}
|
|
|
private void replaceFormulas(ref string expression)
|
|
|
{
|