|
|
@@ -2082,7 +2082,7 @@ namespace JLHHJSvr.Helper
|
|
|
_mattress.extraList = mattressMxExtra1List;
|
|
|
_mattress.extraCostList = mattressMxExtra2List;
|
|
|
_mattress.subspecsList = mattressSubspecs;
|
|
|
- SaveMattressPro(_mattress,true);
|
|
|
+ SaveMattressPro(_mattress,true,true);
|
|
|
CopyMattressInterface(mattress.mattressid, _mattress.mattressid);
|
|
|
|
|
|
foreach (var sub in _mattress.subspecsList)
|
|
|
@@ -2272,7 +2272,7 @@ namespace JLHHJSvr.Helper
|
|
|
throw new LJCommonException("你没有审核权限");
|
|
|
}
|
|
|
// 检查锁
|
|
|
- LockHelper.CheckLockAll(cmd, BillKeyWord, mattressid, context.tokendata.username);
|
|
|
+ if (LockHelper.CheckIsLock(cmd, MattressHelper.BillKeyWord, mattressid, context.tokendata.username, out string arg_msg)) throw new LJCommonException(arg_msg);
|
|
|
|
|
|
var mattress = new u_mattress() { mattressid = mattressid };
|
|
|
DbSqlHelper.SelectOne(cmd, mattress, "flag,mattresscode,version");
|
|
|
@@ -2304,7 +2304,7 @@ namespace JLHHJSvr.Helper
|
|
|
throw new LJCommonException("你没有取消审核权限");
|
|
|
}
|
|
|
// 检查锁
|
|
|
- LockHelper.CheckLockAll(cmd, BillKeyWord, mattressid, context.tokendata.username);
|
|
|
+ if (LockHelper.CheckIsLock(cmd, MattressHelper.BillKeyWord, mattressid, context.tokendata.username, out string arg_msg)) throw new LJCommonException(arg_msg);
|
|
|
|
|
|
var mattress = new u_mattress() { mattressid = mattressid };
|
|
|
DbSqlHelper.SelectOne(cmd, mattress, "flag,mattresscode,version");
|
|
|
@@ -2335,7 +2335,7 @@ namespace JLHHJSvr.Helper
|
|
|
throw new LJCommonException("你没有业务下单权限");
|
|
|
}
|
|
|
// 检查锁
|
|
|
- LockHelper.CheckLockAll(cmd, BillKeyWord, mattressid, context.tokendata.username);
|
|
|
+ if (LockHelper.CheckIsLock(cmd, MattressHelper.BillKeyWord, mattressid, context.tokendata.username, out string arg_msg)) throw new LJCommonException(arg_msg);
|
|
|
|
|
|
var mattress = new u_mattress() { mattressid = mattressid };
|
|
|
DbSqlHelper.SelectOne(cmd, mattress, "flag,xd_flag,yw_flag,mattresscode,version");
|
|
|
@@ -2370,7 +2370,7 @@ namespace JLHHJSvr.Helper
|
|
|
throw new LJCommonException("你没有取消业务下单权限");
|
|
|
}
|
|
|
// 检查锁
|
|
|
- LockHelper.CheckLockAll(cmd, BillKeyWord, mattressid, context.tokendata.username);
|
|
|
+ if (LockHelper.CheckIsLock(cmd, MattressHelper.BillKeyWord, mattressid, context.tokendata.username, out string arg_msg)) throw new LJCommonException(arg_msg);
|
|
|
|
|
|
var mattress = new u_mattress() { mattressid = mattressid };
|
|
|
DbSqlHelper.SelectOne(cmd, mattress, "js1_flag,js2_flag,xd_flag,yw_flag,mattresscode,version");
|
|
|
@@ -2405,7 +2405,7 @@ namespace JLHHJSvr.Helper
|
|
|
public void MattressYWAudit(int mattressid)
|
|
|
{
|
|
|
// 检查锁
|
|
|
- LockHelper.CheckLockAll(cmd, BillKeyWord, mattressid, context.tokendata.username);
|
|
|
+ if (LockHelper.CheckIsLock(cmd, MattressHelper.BillKeyWord, mattressid, context.tokendata.username, out string arg_msg)) throw new LJCommonException(arg_msg);
|
|
|
|
|
|
var mattress = new u_mattress() { mattressid = mattressid };
|
|
|
DbSqlHelper.SelectOne(cmd, mattress, "yw_flag,version");
|
|
|
@@ -2430,7 +2430,7 @@ namespace JLHHJSvr.Helper
|
|
|
public void MattressYWCancelAudit(int mattressid)
|
|
|
{
|
|
|
// 检查锁
|
|
|
- LockHelper.CheckLockAll(cmd, BillKeyWord, mattressid, context.tokendata.username);
|
|
|
+ if (LockHelper.CheckIsLock(cmd, MattressHelper.BillKeyWord, mattressid, context.tokendata.username, out string arg_msg)) throw new LJCommonException(arg_msg);
|
|
|
|
|
|
var mattress = new u_mattress() { mattressid = mattressid };
|
|
|
DbSqlHelper.SelectOne(cmd, mattress, "yw_flag,js1_flag");
|
|
|
@@ -2460,7 +2460,7 @@ namespace JLHHJSvr.Helper
|
|
|
public void MattressJSAudit(int mattressid)
|
|
|
{
|
|
|
// 检查锁
|
|
|
- LockHelper.CheckLockAll(cmd, BillKeyWord, mattressid, context.tokendata.username);
|
|
|
+ if (LockHelper.CheckIsLock(cmd, MattressHelper.BillKeyWord, mattressid, context.tokendata.username, out string arg_msg)) throw new LJCommonException(arg_msg);
|
|
|
|
|
|
var mattress = new u_mattress() { mattressid = mattressid };
|
|
|
DbSqlHelper.SelectOne(cmd, mattress, "yw_flag,js1_flag,version");
|
|
|
@@ -2491,7 +2491,7 @@ namespace JLHHJSvr.Helper
|
|
|
public void MattressJSCancelAudit(int mattressid)
|
|
|
{
|
|
|
// 检查锁
|
|
|
- LockHelper.CheckLockAll(cmd, BillKeyWord, mattressid, context.tokendata.username);
|
|
|
+ if (LockHelper.CheckIsLock(cmd, MattressHelper.BillKeyWord, mattressid, context.tokendata.username, out string arg_msg)) throw new LJCommonException(arg_msg);
|
|
|
|
|
|
var mattress = new u_mattress() { mattressid = mattressid };
|
|
|
DbSqlHelper.SelectOne(cmd, mattress, "yw_flag,js1_flag,creatmtrl_flag");
|
|
|
@@ -2521,7 +2521,7 @@ namespace JLHHJSvr.Helper
|
|
|
public void MattressJS2Audit(int mattressid)
|
|
|
{
|
|
|
// 检查锁
|
|
|
- LockHelper.CheckLockAll(cmd, BillKeyWord, mattressid, context.tokendata.username);
|
|
|
+ if (LockHelper.CheckIsLock(cmd, MattressHelper.BillKeyWord, mattressid, context.tokendata.username, out string arg_msg)) throw new LJCommonException(arg_msg);
|
|
|
|
|
|
var mattress = new u_mattress() { mattressid = mattressid };
|
|
|
DbSqlHelper.SelectOne(cmd, mattress, "js2_flag,version");
|
|
|
@@ -2546,7 +2546,7 @@ namespace JLHHJSvr.Helper
|
|
|
public void MattressJS2CancelAudit(int mattressid)
|
|
|
{
|
|
|
// 检查锁
|
|
|
- LockHelper.CheckLockAll(cmd, BillKeyWord, mattressid, context.tokendata.username);
|
|
|
+ if (LockHelper.CheckIsLock(cmd, MattressHelper.BillKeyWord, mattressid, context.tokendata.username, out string arg_msg)) throw new LJCommonException(arg_msg);
|
|
|
|
|
|
var mattress = new u_mattress() { mattressid = mattressid };
|
|
|
DbSqlHelper.SelectOne(cmd, mattress, "js2_flag,version");
|
|
|
@@ -2572,7 +2572,11 @@ namespace JLHHJSvr.Helper
|
|
|
/// </summary>
|
|
|
/// <param name="mattress"></param>
|
|
|
/// <param name="ifErp"></param>
|
|
|
- public void SaveMattressPro(u_mattress mattress,bool ifErp = false)
|
|
|
+ public void SaveMattressPro(u_mattress mattress)
|
|
|
+ {
|
|
|
+ SaveMattressPro(mattress, false, false);
|
|
|
+ }
|
|
|
+ public void SaveMattressPro(u_mattress mattress, bool ifErp = false, bool ignoreLock = false)
|
|
|
{
|
|
|
SaveMattressCheck(mattress);
|
|
|
|
|
|
@@ -2713,7 +2717,7 @@ namespace JLHHJSvr.Helper
|
|
|
// 处理子规格
|
|
|
ProcessSubSpecs(mattress, ifErp);
|
|
|
// 解锁
|
|
|
- LockHelper.UnLockBill(cmd, BillKeyWord, mattress.mattressid, context.tokendata.username, 0);
|
|
|
+ if(!ignoreLock) LockHelper.UnLockBill(cmd, BillKeyWord, mattress.mattressid, context.tokendata.username, 0);
|
|
|
}
|
|
|
/// <summary>
|
|
|
/// 初始化子规格
|
|
|
@@ -2861,7 +2865,7 @@ namespace JLHHJSvr.Helper
|
|
|
InitMattressSubSpecs(mattress, child);
|
|
|
|
|
|
MattressCalculateCost(child, child.mxList, child.extraList, child.extraCostList);
|
|
|
- SaveMattressPro(child, ifErp);
|
|
|
+ SaveMattressPro(child, ifErp,true);
|
|
|
}
|
|
|
|
|
|
mattress.subspecsList = subspecsList;
|
|
|
@@ -2954,9 +2958,9 @@ namespace JLHHJSvr.Helper
|
|
|
if (mattressid <= 0) throw new LJCommonException("ID错误,删除床垫报价失败!");
|
|
|
var mattress = GetMattress(mattressid, "mattresscode,flag,js1_flag,xd_flag,parentid");
|
|
|
if (mattress.parentid > 0 && (mattress.js1_flag == 1 || mattress.flag == 1)) return;
|
|
|
- if (mattress.xd_flag == 1) throw new LJCommonException($"床垫报价[{mattress.mattresscode}]已下单,无法删除!");
|
|
|
- if (mattress.js1_flag == 1) throw new LJCommonException($"床垫报价[{mattress.mattresscode}]已产品审核,无法删除!");
|
|
|
- if (mattress.flag == 1) throw new LJCommonException($"床垫报价[{mattress.mattresscode}]已财务审核,无法删除!");
|
|
|
+ if (isDelMain && mattress.xd_flag == 1) throw new LJCommonException($"床垫报价[{mattress.mattresscode}]已下单,无法删除!");
|
|
|
+ if (isDelMain && mattress.js1_flag == 1) throw new LJCommonException($"床垫报价[{mattress.mattresscode}]已产品审核,无法删除!");
|
|
|
+ if (isDelMain && mattress.flag == 1) throw new LJCommonException($"床垫报价[{mattress.mattresscode}]已财务审核,无法删除!");
|
|
|
|
|
|
// 删除所有明细
|
|
|
cmd.CommandText = @"DELETE u_mattress_mx_mtrl WHERE mattressid = @mattressid";
|
|
|
@@ -2998,7 +3002,7 @@ namespace JLHHJSvr.Helper
|
|
|
if (mattress.mattressid > 0 && mattress.parentid == 0)
|
|
|
{
|
|
|
// 检查锁
|
|
|
- LockHelper.CheckLockAll(cmd, BillKeyWord, mattress.mattressid, context.tokendata.username);
|
|
|
+ if (LockHelper.CheckIsLock(cmd, MattressHelper.BillKeyWord, mattress.mattressid, context.tokendata.username, out string arg_msg)) throw new LJCommonException(arg_msg);
|
|
|
// 检测版本控制
|
|
|
CheckBillVersion<u_mattress>(cmd, mattress.mattressid, mattress.version);
|
|
|
}
|