|
@@ -254,7 +254,7 @@ module.exports = app => {
|
|
|
const transaction = await this.db.beginTransaction();
|
|
|
try {
|
|
|
for (const d of datas) {
|
|
|
- const stageBills = await this.getLastestStageData(this.ctx.tender.id, this.ctx.stage.id, d.lid);
|
|
|
+ const stageBills = await this.getLastestStageData2(this.ctx.tender.id, this.ctx.stage.id, d.lid);
|
|
|
const ledgerBills = await this.ctx.service.ledger.getDataById(d.lid);
|
|
|
if (!stageBills || stageBills.times !== this.ctx.stage.curTimes || stageBills.order !== this.ctx.stage.curOrder) {
|
|
|
await this._insertStageBillsData(transaction, d, stageBills, ledgerBills);
|
|
@@ -269,7 +269,7 @@ module.exports = app => {
|
|
|
await transaction.rollback();
|
|
|
throw err;
|
|
|
}
|
|
|
- return await this.getLastestStageData(this.ctx.tender.id, this.ctx.stage.id, this._.map(datas, 'lid'));
|
|
|
+ return await this.getLastestStageData2(this.ctx.tender.id, this.ctx.stage.id, this._.map(datas, 'lid'));
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -307,7 +307,7 @@ module.exports = app => {
|
|
|
*/
|
|
|
async calc(tid, sid, lid, transaction) {
|
|
|
const info = this.ctx.tender.info;
|
|
|
- const stageBills = await this.getLastestStageData(tid, sid, lid);
|
|
|
+ const stageBills = await this.getLastestStageData2(tid, sid, lid);
|
|
|
const ledgerBills = await this.ctx.service.ledger.getDataById(lid);
|
|
|
if (!ledgerBills) {
|
|
|
throw '提交数据错误';
|
|
@@ -342,7 +342,7 @@ module.exports = app => {
|
|
|
}
|
|
|
|
|
|
async updateStageBillsCalcType(data) {
|
|
|
- const stageBills = await this.getLastestStageData(this.ctx.tender.id, this.ctx.stage.id, data.id);
|
|
|
+ const stageBills = await this.getLastestStageData2(this.ctx.tender.id, this.ctx.stage.id, data.id);
|
|
|
const updateData = { contract_qty: null, contract_tp: null };
|
|
|
|
|
|
const transaction = await this.db.beginTransaction();
|
|
@@ -364,7 +364,7 @@ module.exports = app => {
|
|
|
}
|
|
|
|
|
|
const bills = await this.ctx.service.ledger.getDataById(data.id);
|
|
|
- const curStageData = await this.getLastestStageData(this.ctx.tender.id, this.ctx.stage.id, [data.id]);
|
|
|
+ const curStageData = await this.getLastestStageData2(this.ctx.tender.id, this.ctx.stage.id, [data.id]);
|
|
|
return { bills: [bills], curStageData };
|
|
|
}
|
|
|
|
|
@@ -495,7 +495,7 @@ module.exports = app => {
|
|
|
const result = loadTree.getUpdateData();
|
|
|
if (result.errors.length > 100) throw '您导入的数据存在大量数据错误,请您仔细检查';
|
|
|
|
|
|
- const stageBills = await this.getLastestStageData(this.ctx.tender.id, this.ctx.stage.id);
|
|
|
+ const stageBills = await this.getLastestStageData2(this.ctx.tender.id, this.ctx.stage.id);
|
|
|
const updateStageBills = [], insertStageBills = [];
|
|
|
for (const u of result.update) {
|
|
|
const sb = stageBills.find(x => { return x.lid === u.lid; });
|