|
|
@@ -1748,10 +1748,10 @@ namespace JLHHJSvr.Helper
|
|
|
u_mattress_mx_mtrl.sidecover,
|
|
|
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
|
|
|
- left outer join u_mtrltype on u_mtrltype.mtrltypeid = u_mtrl_price.mtrltype
|
|
|
+ From u_mattress_mx_mtrl WITH (NOLOCK)
|
|
|
+ Left join u_mattress_formula WITH (NOLOCK) On u_mattress_formula.formulaid = u_mattress_mx_mtrl.formulaid
|
|
|
+ left outer join u_mtrl_price WITH (NOLOCK) on u_mattress_mx_mtrl.mtrlid = u_mtrl_price.mtrlid
|
|
|
+ left outer join u_mtrltype WITH (NOLOCK) on u_mtrltype.mtrltypeid = u_mtrl_price.mtrltype
|
|
|
Left OUTER JOIN (
|
|
|
select
|
|
|
mtrlid,
|
|
|
@@ -1856,10 +1856,10 @@ namespace JLHHJSvr.Helper
|
|
|
ISNULL(u_bednetmx.spring_qty_length, 0) AS spring_qty_length,
|
|
|
ISNULL(u_bednet.iffork, 0) AS bednet_iffork,
|
|
|
ISNULL(u_bednet.fork_qty, 0) AS bednet_fork_qty
|
|
|
- FROM u_mattress_mx_mtrl
|
|
|
- LEFT JOIN u_mattress_formula On u_mattress_formula.formulaid = u_mattress_mx_mtrl.formulaid
|
|
|
- LEFT OUTER JOIN u_bednetmx on u_bednetmx.bednetid = u_mattress_mx_mtrl.mtrlid
|
|
|
- LEFT OUTER JOIN u_bednet on u_bednetmx.bednetid = u_bednet.bednetid
|
|
|
+ FROM u_mattress_mx_mtrl WITH (NOLOCK)
|
|
|
+ LEFT JOIN u_mattress_formula WITH (NOLOCK) On u_mattress_formula.formulaid = u_mattress_mx_mtrl.formulaid
|
|
|
+ LEFT OUTER JOIN u_bednetmx WITH (NOLOCK) on u_bednetmx.bednetid = u_mattress_mx_mtrl.mtrlid
|
|
|
+ LEFT OUTER JOIN u_bednet WITH (NOLOCK) on u_bednetmx.bednetid = u_bednet.bednetid
|
|
|
";
|
|
|
var whereList = new List<string>();
|
|
|
whereList.Add("u_mattress_formula.formulatype = 99");
|
|
|
@@ -1887,9 +1887,9 @@ namespace JLHHJSvr.Helper
|
|
|
u_mattress_formula.formulatype,
|
|
|
u_mattress_mx_mtrl.qty,
|
|
|
vv_mtrl_price.mtrlname
|
|
|
- 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_mtrl_price.mtrlid = u_mattress_mx_mtrl.mtrlid
|
|
|
+ FROM u_mattress_mx_mtrl WITH (NOLOCK)
|
|
|
+ LEFT JOIN u_mattress_formula WITH (NOLOCK) On u_mattress_formula.formulaid = u_mattress_mx_mtrl.formulaid
|
|
|
+ LEFT OUTER JOIN u_mtrl_price WITH (NOLOCK) on u_mtrl_price.mtrlid = u_mattress_mx_mtrl.mtrlid
|
|
|
Left OUTER JOIN (
|
|
|
select
|
|
|
mtrlid,
|
|
|
@@ -2001,8 +2001,8 @@ namespace JLHHJSvr.Helper
|
|
|
if (mattress.mattress_length > 0 && mattress.mattress_width > 0)
|
|
|
{
|
|
|
cmd.CommandText = @"SELECT u_mattress_mx_mtrl.mtrlid
|
|
|
- FROM u_mattress_mx_mtrl
|
|
|
- INNER JOIN u_mattress_formula ON u_mattress_formula.formulaid = u_mattress_mx_mtrl.formulaid
|
|
|
+ FROM u_mattress_mx_mtrl WITH (NOLOCK)
|
|
|
+ INNER JOIN u_mattress_formula WITH (NOLOCK) ON u_mattress_formula.formulaid = u_mattress_mx_mtrl.formulaid
|
|
|
WHERE u_mattress_formula.formulakind = 99
|
|
|
AND u_mattress_mx_mtrl.mattressid = @mattressid
|
|
|
AND u_mattress_mx_mtrl.mtrlid > 0";
|
|
|
@@ -2158,8 +2158,8 @@ namespace JLHHJSvr.Helper
|
|
|
{
|
|
|
cmd.CommandText = @"UPDATE u_mattress_mx_mtrl
|
|
|
SET mtrlid = @new_mtrlid
|
|
|
- FROM u_mattress_mx_mtrl
|
|
|
- INNER JOIN u_mattress_formula ON u_mattress_formula.formulaid = u_mattress_mx_mtrl.formulaid
|
|
|
+ FROM u_mattress_mx_mtrl WITH (NOLOCK)
|
|
|
+ INNER JOIN u_mattress_formula WITH (NOLOCK) ON u_mattress_formula.formulaid = u_mattress_mx_mtrl.formulaid
|
|
|
WHERE u_mattress_formula.formulakind = 99
|
|
|
AND u_mattress_mx_mtrl.mattressid = @new_mattressid
|
|
|
AND u_mattress_mx_mtrl.mtrlid = @old_mtrld";
|
|
|
@@ -2582,13 +2582,13 @@ namespace JLHHJSvr.Helper
|
|
|
DbSqlHelper.Update(cmd, "u_mattress", null, mattress, "mattressid", fields);
|
|
|
|
|
|
// 删除所有明细
|
|
|
- cmd.CommandText = @"DELETE u_mattress_mx_mtrl WHERE mattressid = @mattressid";
|
|
|
+ cmd.CommandText = @"DELETE u_mattress_mx_mtrl WITH (ROWLOCK) WHERE mattressid = @mattressid";
|
|
|
cmd.Parameters.Clear();
|
|
|
cmd.Parameters.AddWithValue("@mattressid", mattress.mattressid);
|
|
|
cmd.ExecuteNonQuery();
|
|
|
|
|
|
// 删除所有额外费用明细
|
|
|
- cmd.CommandText = @"DELETE u_mattress_mx_extra WHERE mattressid = @mattressid";
|
|
|
+ cmd.CommandText = @"DELETE u_mattress_mx_extra WITH (ROWLOCK) WHERE mattressid = @mattressid";
|
|
|
cmd.Parameters.Clear();
|
|
|
cmd.Parameters.AddWithValue("@mattressid", mattress.mattressid);
|
|
|
cmd.ExecuteNonQuery();
|
|
|
@@ -2950,19 +2950,19 @@ namespace JLHHJSvr.Helper
|
|
|
if (mattress.erp_mtrlid > 0) throw new LJCommonException($"床垫报价[{mattress.mattresscode}]已生成L1物料,无法删除!");
|
|
|
|
|
|
// 删除所有明细
|
|
|
- cmd.CommandText = @"DELETE u_mattress_mx_mtrl WHERE mattressid = @mattressid";
|
|
|
+ cmd.CommandText = @"DELETE u_mattress_mx_mtrl WITH (ROWLOCK) WHERE mattressid = @mattressid";
|
|
|
cmd.Parameters.Clear();
|
|
|
cmd.Parameters.AddWithValue("@mattressid", mattressid);
|
|
|
cmd.ExecuteNonQuery();
|
|
|
|
|
|
// 删除所有额外费用明细
|
|
|
- cmd.CommandText = @"DELETE u_mattress_mx_extra WHERE mattressid = @mattressid";
|
|
|
+ cmd.CommandText = @"DELETE u_mattress_mx_extra WITH (ROWLOCK) WHERE mattressid = @mattressid";
|
|
|
cmd.Parameters.Clear();
|
|
|
cmd.Parameters.AddWithValue("@mattressid", mattressid);
|
|
|
cmd.ExecuteNonQuery();
|
|
|
|
|
|
// 删除主表
|
|
|
- cmd.CommandText = @"DELETE u_mattress WHERE mattressid = @mattressid";
|
|
|
+ cmd.CommandText = @"DELETE u_mattress WITH (ROWLOCK) WHERE mattressid = @mattressid";
|
|
|
cmd.Parameters.Clear();
|
|
|
cmd.Parameters.AddWithValue("@mattressid", mattressid);
|
|
|
cmd.ExecuteNonQuery();
|