|
@@ -992,6 +992,7 @@ module.exports = app => {
|
|
|
const transaction = await this.db.beginTransaction();
|
|
|
const time = new Date();
|
|
|
try {
|
|
|
+ await this._updateTender(transaction);
|
|
|
if (this.ctx.stage.cancancel === 1) {
|
|
|
// 原报撤回,判断是否为多次,多次则为退回状态
|
|
|
// 整理当前流程审核人状态更新
|
|
@@ -1041,6 +1042,9 @@ module.exports = app => {
|
|
|
await this.ctx.service.stageOther.updateHistory(this.ctx.stage, transaction);
|
|
|
await this.ctx.service.stageSafeProd.updateHistory(this.ctx.stage, transaction);
|
|
|
await this.ctx.service.stageTempLand.updateHistory(this.ctx.stage, transaction);
|
|
|
+ // 先覆盖再删除
|
|
|
+ await this.ctx.service.stageBills.updateAuditStageBills(stageId, this.ctx.stage.user_id, this.ctx.stage.times, 0, curAudit.aid, this.ctx.stage.times, 1, transaction);
|
|
|
+ await this.ctx.service.stagePos.updateAuditStagePos(stageId, this.ctx.stage.user_id, this.ctx.stage.times, 0, curAudit.aid, this.ctx.stage.times, 1, transaction);
|
|
|
} else if (this.ctx.stage.cancancel === 2) {
|
|
|
const tpData = await this.ctx.service.stageBills.getSumTotalPrice(this.ctx.stage);
|
|
|
// 整理当前流程审核人状态更新
|
|
@@ -1117,6 +1121,10 @@ module.exports = app => {
|
|
|
await this.ctx.service.stageSafeProd.updateHistory(this.ctx.stage, transaction);
|
|
|
await this.ctx.service.stageTempLand.updateHistory(this.ctx.stage, transaction);
|
|
|
|
|
|
+ // 先覆盖再删除
|
|
|
+ await this.ctx.service.stageBills.updateAuditStageBills(stageId, preAudit.aid, this.ctx.stage.times, curAudit.order + 1, curAudit.aid, this.ctx.stage.times, curAudit.order, transaction);
|
|
|
+ await this.ctx.service.stagePos.updateAuditStagePos(stageId, preAudit.aid, this.ctx.stage.times, curAudit.order + 1, curAudit.aid, this.ctx.stage.times, curAudit.order, transaction);
|
|
|
+
|
|
|
// 锁定本人数据,保留锁定数据相关确认状态
|
|
|
// await this.ctx.service.stageAuditAss.lockConfirm4CheckNoPre(this.ctx.stage, curAudit.aid, preAudit.aid, transaction);
|
|
|
} else if (this.ctx.stage.cancancel === 3) {
|
|
@@ -1196,6 +1204,10 @@ module.exports = app => {
|
|
|
await this.ctx.service.stageSafeProd.updateHistory(this.ctx.stage, transaction);
|
|
|
await this.ctx.service.stageTempLand.updateHistory(this.ctx.stage, transaction);
|
|
|
|
|
|
+ // 先覆盖再删除
|
|
|
+ await this.ctx.service.stageBills.updateAuditStageBills(stageId, preAudit.aid, this.ctx.stage.times, curAudit.order + 1, curAudit.aid, this.ctx.stage.times, curAudit.order, transaction);
|
|
|
+ await this.ctx.service.stagePos.updateAuditStagePos(stageId, preAudit.aid, this.ctx.stage.times, curAudit.order + 1, curAudit.aid, this.ctx.stage.times, curAudit.order, transaction);
|
|
|
+
|
|
|
// 锁定本人数据,保留锁定数据相关确认状态
|
|
|
// await this.ctx.service.stageAuditAss.lockConfirm4CheckNoPre(this.ctx.stage, curAudit.aid, preAudit.aid, transaction);
|
|
|
} else if (this.ctx.stage.cancancel === 4) {
|
|
@@ -1271,6 +1283,10 @@ module.exports = app => {
|
|
|
await this.ctx.service.stageOther.updateHistory(this.ctx.stage, transaction);
|
|
|
await this.ctx.service.stageSafeProd.updateHistory(this.ctx.stage, transaction);
|
|
|
await this.ctx.service.stageTempLand.updateHistory(this.ctx.stage, transaction);
|
|
|
+
|
|
|
+ // 先覆盖再删除
|
|
|
+ await this.ctx.service.stageBills.updateAuditStageBills(stageId, curAudit.aid, this.ctx.stage.times - 1, curAudit.order + 2, this.ctx.stage.user_id, this.ctx.stage.times, 0, transaction);
|
|
|
+ await this.ctx.service.stagePos.updateAuditStagePos(stageId, curAudit.aid, this.ctx.stage.times - 1, curAudit.order + 2, this.ctx.stage.user_id, this.ctx.stage.times, 0, transaction);
|
|
|
}
|
|
|
// 上报/审批 - 检查三方特殊推送
|
|
|
await this.ctx.service.specMsg.addStageMsg(transaction, this.ctx.session.sessionProject.id, this.ctx.stage, pushOperate.stage.flow);
|