|
@@ -89,6 +89,8 @@ module.exports = app => {
|
|
|
if (!transaction) throw '缺少参数';
|
|
|
// 审批人数据锁定
|
|
|
const lockConfirm = await this.getAllDataByCondition({ where: { sid: stage.id, times: stage.curTimes, uid: uid } });
|
|
|
+ if (lockConfirm.length === 0) return;
|
|
|
+
|
|
|
const insertData = [];
|
|
|
lockConfirm.forEach(x => {
|
|
|
delete x.id;
|
|
@@ -112,7 +114,11 @@ module.exports = app => {
|
|
|
insertData.push(kc);
|
|
|
}
|
|
|
}
|
|
|
- await transaction.insert(this.tableName, insertData);
|
|
|
+ if (insertData.length > 0) await transaction.insert(this.tableName, insertData);
|
|
|
+ }
|
|
|
+
|
|
|
+ async cancelLock(stage, uid, transaction) {
|
|
|
+ await transaction.update(this.tableName, { lock: 0 }, { sid: stage.id, times: stage.curTimes, uid });
|
|
|
}
|
|
|
|
|
|
async getLockedId(tender, stage) {
|