|
@@ -208,7 +208,7 @@ module.exports = app => {
|
|
const orgCache = await this.getDataById(stage.tid);
|
|
const orgCache = await this.getDataById(stage.tid);
|
|
const data = { id: stage.tid, stage_status: status };
|
|
const data = { id: stage.tid, stage_status: status };
|
|
if (ledgerTp) data.ledger_tp = JSON.stringify(ledgerTp);
|
|
if (ledgerTp) data.ledger_tp = JSON.stringify(ledgerTp);
|
|
- const tp = JSON.parse(orgCache.stage_flow_cur_tp);
|
|
|
|
|
|
+ const tp = orgCache.stage_flow_cur_tp ? JSON.parse(orgCache.stage_flow_cur_tp) : (orgCache.stage_flow_pre_tp ? JSON.parse(orgCache.stage_flow_pre_tp) : {});
|
|
if (stageTp) this._.assign(tp, stageTp);
|
|
if (stageTp) this._.assign(tp, stageTp);
|
|
if (pcTp) this._.assign(tp, pcTp);
|
|
if (pcTp) this._.assign(tp, pcTp);
|
|
if (preAuditor) {
|
|
if (preAuditor) {
|
|
@@ -253,7 +253,7 @@ module.exports = app => {
|
|
}
|
|
}
|
|
|
|
|
|
async updateAdvanceCache(tid) {
|
|
async updateAdvanceCache(tid) {
|
|
- const advance_tp = await this.ctx.service.advance.getSumAdvance(tender.id);
|
|
|
|
|
|
+ const advance_tp = await this.ctx.service.advance.getSumAdvance(tid);
|
|
await this.db.update(this.tableName, { id: tid, advance_tp });
|
|
await this.db.update(this.tableName, { id: tid, advance_tp });
|
|
}
|
|
}
|
|
|
|
|