|
@@ -109,7 +109,7 @@ module.exports = app => {
|
|
|
* @return {Promise<*>}
|
|
|
*/
|
|
|
async getAuditors(stageId, times = 1, order_sort = 'asc') {
|
|
|
- const sql = 'SELECT la.aid, la.times, la.order, la.status, la.opinion, la.begin_time, la.end_time, la.audit_type, la.audit_order,' +
|
|
|
+ const sql = 'SELECT la.id, la.aid, la.times, la.order, la.status, la.opinion, la.begin_time, la.end_time, la.audit_type, la.audit_order,' +
|
|
|
' pa.name, pa.company, pa.role, pa.mobile, pa.telephone, pa.sign_path' +
|
|
|
` FROM ${this.tableName} la LEFT JOIN ${this.ctx.service.projectAccount.tableName} pa ON la.aid = pa.id` +
|
|
|
' WHERE la.sid = ? AND la.times = ?' +
|
|
@@ -1032,7 +1032,7 @@ module.exports = app => {
|
|
|
opinion: null,
|
|
|
}
|
|
|
});
|
|
|
- await transaction.update(this.tableName, updateData);
|
|
|
+ await transaction.updateRows(this.tableName, updateData);
|
|
|
// 计算并合同支付最终数据
|
|
|
const [yfPay, sfPay] = await this.ctx.service.stagePay.calcAllStagePays(stage, transaction);
|
|
|
const stageTp = {
|
|
@@ -1044,12 +1044,12 @@ module.exports = app => {
|
|
|
sf_tp: sfPay.tp,
|
|
|
};
|
|
|
await transaction.update(this.ctx.service.stage.tableName, {
|
|
|
- id: stageId,
|
|
|
- times,
|
|
|
+ id: stage.id,
|
|
|
+ times: stage.times,
|
|
|
...stageTp,
|
|
|
- tp_history: JSON.stringify(this.ctx.stage.tp_history.filter(x => { return x.times < times; })),
|
|
|
+ tp_history: JSON.stringify(this.ctx.stage.tp_history.filter(x => { return x.times < stage.times; })),
|
|
|
cache_time_r: this.ctx.stage.cache_time_l,
|
|
|
- status: times === 1 ? auditConst.status.uncheck : auditConst.status.checkNo,
|
|
|
+ status: stage.times === 1 ? auditConst.status.uncheck : auditConst.status.checkNo,
|
|
|
});
|
|
|
|
|
|
// 计量明细:重复数据删除原报,新增数据修改为原报
|
|
@@ -1064,9 +1064,9 @@ module.exports = app => {
|
|
|
// 其他台账明细:不需更新历史
|
|
|
|
|
|
// 更新标段计量数据缓存
|
|
|
- const preFlow = times > 1 ? await this.getLastestAuditors(stageId, times, auditConst.status.checkNo): null;
|
|
|
+ const preFlow = stage.times > 1 ? await this.getLastestAuditors(stage.id, stage.times, auditConst.status.checkNo): null;
|
|
|
const curFlow = [{ aid: this.ctx.stage.user_id, order: 1, status: auditConst.status.uncheck}];
|
|
|
- await this.ctx.service.tenderCache.updateStageCache4Flow(transaction, this.ctx.stage, times === 1 ? auditConst.status.uncheck : auditConst.status.checkNo,
|
|
|
+ await this.ctx.service.tenderCache.updateStageCache4Flow(transaction, this.ctx.stage, stage.times === 1 ? auditConst.status.uncheck : auditConst.status.checkNo,
|
|
|
curFlow, preFlow, ledgerTp, stageTp);
|
|
|
// 上报/审批 - 检查三方特殊推送
|
|
|
await this.ctx.service.specMsg.addStageMsg(transaction, this.ctx.session.sessionProject.id, this.ctx.stage, pushOperate.stage.flow);
|
|
@@ -1146,8 +1146,8 @@ module.exports = app => {
|
|
|
this.ctx.stage.tp_history.push({ times, order: selfAuditor.order + 1, ...stageTp });
|
|
|
// 同步 期信息
|
|
|
await transaction.update(this.ctx.service.stage.tableName, {
|
|
|
- id: stageId,
|
|
|
- times,
|
|
|
+ id: stage.id,
|
|
|
+ times: stage.times,
|
|
|
...stageTp,
|
|
|
tp_history: JSON.stringify(this.ctx.stage.tp_history),
|
|
|
cache_time_r: this.ctx.stage.cache_time_l,
|
|
@@ -1164,9 +1164,9 @@ module.exports = app => {
|
|
|
await this.ctx.service.stageTempLand.updateHistory4TimesOrder(stage, stage.times, [selfAuditor.order + 1], transaction);
|
|
|
|
|
|
// 更新标段计量数据缓存
|
|
|
- await this.ctx.service.tenderCache.updateStageCache4Flow(transaction, this.ctx.stage, this.ctx.stage.status, checkingAuditors, checkCancelAuditors, ledgerTp, stageTp);
|
|
|
+ await this.ctx.service.tenderCache.updateStageCache4Flow(transaction, stage, stage.status, checkingAuditors, checkCancelAuditors, ledgerTp, stageTp);
|
|
|
// 上报/审批 - 检查三方特殊推送
|
|
|
- await this.ctx.service.specMsg.addStageMsg(transaction, this.ctx.session.sessionProject.id, this.ctx.stage, pushOperate.stage.flow);
|
|
|
+ await this.ctx.service.specMsg.addStageMsg(transaction, this.ctx.session.sessionProject.id, stage, pushOperate.stage.flow);
|
|
|
await transaction.commit();
|
|
|
} catch(err) {
|
|
|
await transaction.rollback();
|
|
@@ -1234,8 +1234,8 @@ module.exports = app => {
|
|
|
stage.tp_history.push({ times, order: selfAuditor.order + 1, ...stageTp });
|
|
|
// 同步 期信息
|
|
|
await transaction.update(this.ctx.service.stage.tableName, {
|
|
|
- id: stageId,
|
|
|
- times,
|
|
|
+ id: stage.id,
|
|
|
+ times: stage.times,
|
|
|
...stageTp,
|
|
|
status: auditConst.status.checking,
|
|
|
tp_history: JSON.stringify(stage.tp_history),
|