|
@@ -470,20 +470,8 @@ module.exports = app => {
|
|
|
await this.ctx.helper.sendWechat(nextAudit.aid, smsTypeConst.const.JL, smsTypeConst.judge.approval.toString(), wxConst.template.stage, wechatData);
|
|
|
} else {
|
|
|
await this.ctx.service.tenderTag.saveTenderTag(this.ctx.tender.id, {stage_time: new Date()}, transaction);
|
|
|
- let his_id;
|
|
|
- if (this.ctx.tender.measureType === measureType.tz.value) {
|
|
|
- const ledgerHis = await this.ctx.service.ledgerHistory.getLatestHistory(this.ctx.tender.id);
|
|
|
- his_id = ledgerHis.id;
|
|
|
- } else {
|
|
|
- const sbCount = await this.ctx.service.ledger.count({ tender_id: this.ctx.stage.tid });
|
|
|
- const spCount = await this.ctx.service.pos.count({ tid: this.ctx.stage.tid });
|
|
|
- const ledgerHis = await this.ctx.service.ledgerHistory.getLatestHistory(this.ctx.tender.id);
|
|
|
- if (sbCount > ledgerHis.bills_count || spCount > ledgerHis.pos_count) {
|
|
|
- his_id = await this.ctx.service.ledgerHistory.backupStageLedgerHistory(this.ctx.stage);
|
|
|
- } else {
|
|
|
- his_id = ledgerHis.id;
|
|
|
- }
|
|
|
- }
|
|
|
+ const his_id = await this.ctx.service.ledgerHistory.backupStageLedgerHistory(this.ctx.stage);
|
|
|
+
|
|
|
// 本期结束
|
|
|
// 生成截止本期数据 final数据
|
|
|
await this.ctx.service.stageBillsFinal.generateFinalData(transaction, this.ctx.tender, this.ctx.stage);
|