|
@@ -1208,6 +1208,7 @@ namespace JLHHJSvr.Helper
|
|
|
AddKeyValue("卷排列长", spring.roll_length == null ? 0 : spring.roll_length);
|
|
|
AddKeyValue("排列宽", spring.arrangement_width == null ? 0 : spring.arrangement_width);
|
|
|
AddKeyValue("排列长", spring.arrangement_height == null ? 0 : spring.arrangement_height);
|
|
|
+ AddKeyValue("弹簧类型id", spring.springtypeid);
|
|
|
}
|
|
|
private void InitReplaceMents(u_bednet bednet, Boolean isCalBed = true, int dannumType = 1, decimal dannumRate = 0)
|
|
|
{
|
|
@@ -1252,6 +1253,7 @@ namespace JLHHJSvr.Helper
|
|
|
AddKeyValue("汇率", bednet.moneyrate);
|
|
|
AddKeyValue("税率", bednet.taxrate);
|
|
|
AddKeyValue("卷包", bednet.if_jb);
|
|
|
+ AddKeyValue("海绵包边", !string.IsNullOrEmpty(bednet.sponge_mtrl_formula) && bednet.sponge_mtrlid > 0 ? 1 : 0);
|
|
|
|
|
|
AddKeyValue("大小单系数", bednet.dannum_rate != null ? bednet.dannum_rate : 0);
|
|
|
var _dannumType = 0;
|
|
@@ -1309,6 +1311,7 @@ namespace JLHHJSvr.Helper
|
|
|
,vartype
|
|
|
,varunit
|
|
|
,formula
|
|
|
+ ,ifmxformula
|
|
|
FROM u_bednet_var";
|
|
|
bednetVarList = new List<u_bednet_var>();
|
|
|
whereList = new List<string>();
|
|
@@ -1317,13 +1320,17 @@ namespace JLHHJSvr.Helper
|
|
|
param = new Dictionary<string, object>();
|
|
|
param.Add("@varkind", 0);
|
|
|
param.Add("@varclass", 2); // 公式
|
|
|
- DbSqlHelper.SelectJoin(cmd, selectStr, ListEx.GetWhereStr(whereList), param, "varid", "varid,varkind,varcode,varname,varclass,vartype,varunit,formula", 0, 0, bednetVarList);
|
|
|
+ DbSqlHelper.SelectJoin(cmd, selectStr, ListEx.GetWhereStr(whereList), param, "varid", "varid,varkind,varcode,varname,varclass,vartype,varunit,formula,ifmxformula", 0, 0, bednetVarList);
|
|
|
|
|
|
- string[] keys = { "车间成本", "不含税出厂价", "部门不含税价", "税金", "部门含税价", "外币价", "计划价" };
|
|
|
+ string[] keys = { "车间成本", "不含税出厂价", "部门不含税价", "税金", "部门含税价", "外币价", "计划价"};
|
|
|
// 添加替换公式变量
|
|
|
foreach (var netvar in bednetVarList)
|
|
|
{
|
|
|
- if (keys.Contains(netvar.varname))
|
|
|
+ if (netvar.ifmxformula > 0)
|
|
|
+ {
|
|
|
+ AddFormulaKeyValue(netvar.varname, netvar.formula);
|
|
|
+ }
|
|
|
+ else if (keys.Contains(netvar.varname))
|
|
|
{
|
|
|
AddFormulaKeyValue(netvar.varname, netvar.formula);
|
|
|
}
|
|
@@ -1492,7 +1499,7 @@ namespace JLHHJSvr.Helper
|
|
|
AddKeyValue("物料名称", mtrl_price.name);
|
|
|
|
|
|
AddKeyValue("裥棉厚度", bednet.sponge_thickness.Value);
|
|
|
- AddKeyValue("海绵厚度", bednet.sponge_thickness.Value);
|
|
|
+ AddKeyValue("海绵包边厚度", bednet.sponge_thickness.Value);
|
|
|
|
|
|
if (bednet.sponge_height.Value > 0)
|
|
|
{
|
|
@@ -1517,6 +1524,10 @@ namespace JLHHJSvr.Helper
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ else
|
|
|
+ {
|
|
|
+ AddKeyValue("海绵包边厚度", 0);
|
|
|
+ }
|
|
|
#endregion 计算 海绵包边 结束
|
|
|
|
|
|
#region 计算 填充海绵 开始
|
|
@@ -1528,7 +1539,7 @@ namespace JLHHJSvr.Helper
|
|
|
AddKeyValue("物料名称", mtrl_price.name);
|
|
|
|
|
|
AddKeyValue("裥棉厚度", bednet.sponge_tc_thickness.Value);
|
|
|
- AddKeyValue("海绵厚度", bednet.sponge_tc_thickness.Value);
|
|
|
+ AddKeyValue("填充海绵厚度", bednet.sponge_tc_thickness.Value);
|
|
|
|
|
|
if (bednet.sponge_tc_height.Value > 0)
|
|
|
{
|
|
@@ -1553,6 +1564,10 @@ namespace JLHHJSvr.Helper
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ else
|
|
|
+ {
|
|
|
+ AddKeyValue("填充海绵厚度", 0);
|
|
|
+ }
|
|
|
#endregion 计算 填充海绵 结束
|
|
|
|
|
|
#region 计算 封边 开始
|
|
@@ -2851,8 +2866,8 @@ namespace JLHHJSvr.Helper
|
|
|
{
|
|
|
|
|
|
// 默认方法
|
|
|
- AddFormulaKeyValue("弹簧排列个数-宽", "if(【卷包】=1,round((【床垫宽】- 2)/(【中心直径】-【卷排列宽】),0),round((【床垫宽】- 2)/(【中心直径】-【排列宽】),0))");
|
|
|
- AddFormulaKeyValue("弹簧排列个数-长", "if(【卷包】=1,round((【床垫长】- 2)/(【中心直径】-【卷排列长】),0),round((【床垫长】- 2)/(【中心直径】-【排列长】),0))");
|
|
|
+ AddFormulaKeyValue("计算弹簧排列个数-宽", "if(【卷包】=1,round((【床垫宽】- 2)/(【中心直径】-【卷排列宽】),0),round((【床垫宽】- 2)/(【中心直径】-【排列宽】),0))");
|
|
|
+ AddFormulaKeyValue("计算弹簧排列个数-长", "if(【卷包】=1,round((【床垫长】- 2)/(【中心直径】-【卷排列长】),0),round((【床垫长】- 2)/(【中心直径】-【排列长】),0))");
|
|
|
|
|
|
InitReplaceMents(bednet);
|
|
|
|
|
@@ -2865,13 +2880,17 @@ namespace JLHHJSvr.Helper
|
|
|
_springid = springList[0].springid;
|
|
|
}
|
|
|
var spring = new u_spring() { springid = _springid };
|
|
|
- DbSqlHelper.SelectOne(cmd, spring, "line_diameter,gram_weight,height,center_diameter,caliber,cyclenum,roll_width,roll_length,arrangement_width,arrangement_height");
|
|
|
+ DbSqlHelper.SelectOne(cmd, spring, "line_diameter,gram_weight,height,center_diameter,caliber,cyclenum,roll_width,roll_length,arrangement_width,arrangement_height,springtypeid");
|
|
|
|
|
|
// 处理相同公式部分
|
|
|
InitMxReplaceMents(bednet, mx, spring);
|
|
|
|
|
|
InitSptringRepaceMents(spring);
|
|
|
|
|
|
+ #region 计算 海绵包边材料成本 开始
|
|
|
+ CalSpringMtrlCol2(bednet, mx, springList, "海绵包边");
|
|
|
+ #endregion 计算 海绵包边材料成本 结束
|
|
|
+
|
|
|
#region 弹簧排列个数-宽
|
|
|
mx.spring_qty_width = Convert.ToInt32(CalculateVarFormula("弹簧排列个数-宽").DecimalValue);
|
|
|
AddKeyValue("弹簧排列个数-宽", mx.spring_qty_width);
|