|
@@ -424,8 +424,10 @@ module.exports = app => {
|
|
|
const tpData = await this.ctx.service.stageBills.getSumTotalPrice(this.ctx.stage);
|
|
|
const stageInfo = await this.ctx.service.stage.getDataById(stageId);
|
|
|
|
|
|
- const transaction = await this.db.beginTransaction();
|
|
|
+ // 计算并合同支付最终数据
|
|
|
+ const [yfPay, sfPay, stagePays] = await this.ctx.service.stagePay.calcAllStagePays(this.ctx.stage);
|
|
|
|
|
|
+ const transaction = await this.db.beginTransaction();
|
|
|
try {
|
|
|
const ledgerTp = await this._updateTender(transaction);
|
|
|
// 添加通知
|
|
@@ -460,8 +462,6 @@ module.exports = app => {
|
|
|
end_time: time,
|
|
|
});
|
|
|
await this.ctx.service.noticeAgain.stopNoticeAgain(transaction, this.tableName, selfAudit.id);
|
|
|
- // 计算并合同支付最终数据
|
|
|
- const [yfPay, sfPay, stagePays] = await this.ctx.service.stagePay.calcAllStagePays(this.ctx.stage, transaction);
|
|
|
const stageTp = {
|
|
|
contract_tp: tpData.contract_tp,
|
|
|
qc_tp: tpData.qc_tp,
|
|
@@ -574,10 +574,10 @@ module.exports = app => {
|
|
|
await this.ctx.service.stageTempLand.addInitialStageData(ns, this.ctx.stage, transaction);
|
|
|
}
|
|
|
const preStageTp = {
|
|
|
- pre_contract_tp: this.ctx.helper.sum([this.ctx.stage.pre_contract_tp, stageTp.contract_tp, stageTp.contract_pc_tp]),
|
|
|
- pre_qc_tp: this.ctx.helper.sum([this.ctx.stage.pre_qc_tp, stageTp.qc_tp, stageTp.qc_pc_tp]),
|
|
|
- pre_positive_qc_tp: this.ctx.helper.sum([this.ctx.stage.pre_positive_qc_tp, stageTp.positive_qc_tp, stageTp.positive_qc_pc_tp]),
|
|
|
- pre_negative_qc_tp: this.ctx.helper.sum([this.ctx.stage.pre_negative_qc_tp, stageTp.negative_qc_tp, stageTp.negative_qc_pc_tp]),
|
|
|
+ pre_contract_tp: this.ctx.helper.sum([this.ctx.stage.pre_contract_tp, stageTp.contract_tp, this.ctx.stage.contract_pc_tp]),
|
|
|
+ pre_qc_tp: this.ctx.helper.sum([this.ctx.stage.pre_qc_tp, stageTp.qc_tp, this.ctx.stage.qc_pc_tp]),
|
|
|
+ pre_positive_qc_tp: this.ctx.helper.sum([this.ctx.stage.pre_positive_qc_tp, stageTp.positive_qc_tp, this.ctx.stage.positive_qc_pc_tp]),
|
|
|
+ pre_negative_qc_tp: this.ctx.helper.sum([this.ctx.stage.pre_negative_qc_tp, stageTp.negative_qc_tp, this.ctx.stage.negative_qc_pc_tp]),
|
|
|
pre_yf_tp: this.ctx.helper.add(this.ctx.stage.pre_yf_tp, stageTp.yf_tp),
|
|
|
pre_sf_tp: this.ctx.helper.add(this.ctx.stage.pre_sf_tp, stageTp.sf_tp),
|
|
|
};
|