|
@@ -567,9 +567,12 @@ namespace JLHHJSvr.Helper
|
|
|
decimal cost = 0;
|
|
|
if (isCalBed)
|
|
|
{
|
|
|
- foreach(var itemCost in extraCosts)
|
|
|
+ if (extraCosts != null)
|
|
|
{
|
|
|
- cost += itemCost.price.Value * itemCost.qty.Value;
|
|
|
+ foreach (var itemCost in extraCosts)
|
|
|
+ {
|
|
|
+ cost += itemCost.price.Value * itemCost.qty.Value;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
else
|
|
@@ -581,9 +584,12 @@ namespace JLHHJSvr.Helper
|
|
|
decimal cost1 = 0;
|
|
|
if (isCalBed)
|
|
|
{
|
|
|
- foreach (var itemPro in extraProcesses)
|
|
|
+ if (extraProcesses != null)
|
|
|
{
|
|
|
- cost1 += itemPro.price.Value * itemPro.qty.Value;
|
|
|
+ foreach (var itemPro in extraProcesses)
|
|
|
+ {
|
|
|
+ cost1 += itemPro.price.Value * itemPro.qty.Value;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
else
|
|
@@ -1096,7 +1102,29 @@ namespace JLHHJSvr.Helper
|
|
|
#endregion
|
|
|
|
|
|
// 新公式排除床网计算
|
|
|
- if (t.formulatype != 99) aa.Add(_costamt);
|
|
|
+ if (t.formulatype != 99)
|
|
|
+ {
|
|
|
+ if (new List<int> { 101, 102 }.Contains(t.formulatype.Value))
|
|
|
+ {
|
|
|
+ /// 內布套 需要勾选了标记才纳入计算
|
|
|
+ if (mattress.if_n_butao != null && mattress.if_n_butao.Value > 0)
|
|
|
+ {
|
|
|
+ aa.Add(_costamt);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else if (new List<int> { 103 }.Contains(t.formulatype.Value))
|
|
|
+ {
|
|
|
+ /// 顶布裥棉 需要勾选了标记才纳入计算
|
|
|
+ if (mattress.if_w_butao != null && mattress.if_w_butao.Value > 0)
|
|
|
+ {
|
|
|
+ aa.Add(_costamt);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ aa.Add(_costamt);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
else
|
|
|
{
|
|
@@ -1716,7 +1744,7 @@ namespace JLHHJSvr.Helper
|
|
|
public List<u_mattress_mx_mtrl> GetMattressMxMtrl(int mattressid,List<string> extraWhere = null)
|
|
|
{
|
|
|
var mxList = new List<u_mattress_mx_mtrl>();
|
|
|
- var outputFields = @"mattressmxid, mattressid, formulakind, formula, formulaid, mtrlid, mtrlname, price, gram_weight, cloth_width, if_inputqty, qty , costamt, if_areaprice, formulatype, sortcode, if_mtrl, if_success, replace_formula, priceunit, shrinkage, name, dannum1_rate, dannum2_rate, dannum3_rate, dannum4_rate, thickness, chastr, xu, useqty, useformula, replace_useformula , gydscrp, mattress_width, mattress_length";
|
|
|
+ var outputFields = @"mattressmxid, mattressid, formulakind, formula, formulaid, mtrlid, mtrlname, price, gram_weight, cloth_width, if_inputqty, qty , costamt, if_areaprice, formulatype, sortcode, if_mtrl, if_success, replace_formula, priceunit, shrinkage, name, dannum1_rate, dannum2_rate, dannum3_rate, dannum4_rate, thickness, chastr, xu, useqty, useformula, replace_useformula , gydscrp, mattress_width, mattress_length, spring_qty_width, spring_qty_length";
|
|
|
var selectStr = @"
|
|
|
SELECT
|
|
|
u_mattress_mx_mtrl.mattressmxid,
|
|
@@ -1755,7 +1783,9 @@ namespace JLHHJSvr.Helper
|
|
|
u_mattress_mx_mtrl.replace_useformula ,
|
|
|
u_mattress_mx_mtrl.gydscrp,
|
|
|
u_mattress_mx_mtrl.mattress_width,
|
|
|
- u_mattress_mx_mtrl.mattress_length
|
|
|
+ u_mattress_mx_mtrl.mattress_length,
|
|
|
+ CASE WHEN u_mattress_formula.formulatype = 99 THEN vv_bednetmx.spring_qty_width ELSE 0 END AS spring_qty_width,
|
|
|
+ CASE WHEN u_mattress_formula.formulatype = 99 THEN vv_bednetmx.spring_qty_length ELSE 0 END AS spring_qty_length
|
|
|
From u_mattress_mx_mtrl
|
|
|
Left join u_mattress_formula On u_mattress_formula.formulaid = u_mattress_mx_mtrl.formulaid
|
|
|
left outer join u_mtrl_price on u_mattress_mx_mtrl.mtrlid = u_mtrl_price.mtrlid
|
|
@@ -1778,7 +1808,13 @@ namespace JLHHJSvr.Helper
|
|
|
|
|
|
FROM u_bednet
|
|
|
inner join u_bednet_type ON u_bednet_type.bednettypeid = u_bednet.bednettypeid
|
|
|
- ) as vv_bednet ON vv_bednet.bednetid = u_mattress_mx_mtrl.mtrlid";
|
|
|
+ ) as vv_bednet ON vv_bednet.bednetid = u_mattress_mx_mtrl.mtrlid
|
|
|
+ Left OUTER JOIN (
|
|
|
+ SELECT u_bednetmx.bednetid,
|
|
|
+ u_bednetmx.spring_qty_width,
|
|
|
+ u_bednetmx.spring_qty_length
|
|
|
+ FROM u_bednetmx
|
|
|
+ ) AS vv_bednetmx ON vv_bednetmx.bednetid = u_mattress_mx_mtrl.mtrlid ";
|
|
|
|
|
|
var whereList = new List<string>();
|
|
|
whereList.Add("u_mattress_mx_mtrl.mattressid = @mattressid");
|