|
|
@@ -412,19 +412,19 @@ module.exports = app => {
|
|
|
};
|
|
|
const result = await transaction.insert(this.tableName, insert_data);
|
|
|
// 获取所有期数据
|
|
|
- const materials = await this.ctx.service.material.getAllDataByCondition({
|
|
|
+ const materials = await this.ctx.service.material.getAllDataByCondition({ where: {
|
|
|
tid: this.ctx.tender.id,
|
|
|
- });
|
|
|
+ } });
|
|
|
// const qi_order = high_material.status === auditConst.status.uncheck || high_material.status === auditConst.status.checkNo ? high_material.order - 1 : high_material;
|
|
|
// const qi_order = high_material.status === auditConst.status.uncheck || high_material.status === auditConst.status.checkNo ? high_material.order - 1 : high_material;
|
|
|
const insert_history_data = [];
|
|
|
const insert_stage_data = [];
|
|
|
for (const m of materials) {
|
|
|
if (m.is_stage_self && m.is_new_exponent) {
|
|
|
- const materialStages = await this.ctx.service.materialStage.getAllDataByCondition({
|
|
|
+ const materialStages = await this.ctx.service.materialStage.getAllDataByCondition({ where: {
|
|
|
tid: this.ctx.tender.id,
|
|
|
mid: m.id,
|
|
|
- });
|
|
|
+ } });
|
|
|
for (const ms of materialStages) {
|
|
|
const one_stage_insert = {
|
|
|
tid: this.ctx.tender.id,
|
|
|
@@ -464,6 +464,7 @@ module.exports = app => {
|
|
|
if (insert_stage_data.length > 0) await transaction.insert(this.ctx.service.materialExponentShard.tableName, insert_stage_data);
|
|
|
await transaction.commit();
|
|
|
} catch (err) {
|
|
|
+ console.log(err);
|
|
|
await transaction.rollback();
|
|
|
throw err;
|
|
|
}
|