ellisran 2 дней назад
Родитель
Сommit
cbcf9fd98c
1 измененных файлов с 2 добавлено и 2 удалено
  1. 2 2
      app/middleware/safe_inspection_check.js

+ 2 - 2
app/middleware/safe_inspection_check.js

@@ -78,7 +78,7 @@ module.exports = options => {
                 // 进一步比较审批流是否与审批流程设置的相同,不同则替换为固定审批流或固定的终审
                 const auditList = yield this.service.safeInspectionAudit.getAllDataByCondition({ where: { qiid: inspection.id, times: inspection.times, is_rectification: 0 }, orders: [['order', 'asc']] });
                 if (shenpi_status === shenpiConst.sp_status.gdspl) {
-                    const shenpiList = yield this.service.shenpiAudit.getAllDataByCondition({ where: { tid: inspection.tid, sp_type: shenpiConst.sp_type.inspection, sp_status: shenpi_status } });
+                    const shenpiList = yield this.service.shenpiAudit.getAllDataByCondition({ where: { tid: inspection.tid, sp_type: shenpiConst.sp_type.safe_inspection, sp_status: shenpi_status } });
                     // 判断2个id数组是否相同,不同则删除原审批流,切换成固定的审批流
                     let sameAudit = auditList.length === shenpiList.length;
                     if (sameAudit) {
@@ -95,7 +95,7 @@ module.exports = options => {
                         yield this.service.safeInspection.loadUser(inspection);
                     }
                 } else if (shenpi_status === shenpiConst.sp_status.gdzs) {
-                    const shenpiInfo = yield this.service.shenpiAudit.getDataByCondition({ tid: inspection.tid, sp_type: shenpiConst.sp_type.inspection, sp_status: shenpi_status });
+                    const shenpiInfo = yield this.service.shenpiAudit.getDataByCondition({ tid: inspection.tid, sp_type: shenpiConst.sp_type.safe_inspection, sp_status: shenpi_status });
                     // 判断最后一个id是否与固定终审id相同,不同则删除原审批流中如果存在的id和添加终审
                     const lastAuditors = auditList.filter(x => { x.order === auditList[auditList.length - 1].order; });
                     if (shenpiInfo && (lastAuditors.length === 0 || (lastAuditors.length > 1 || shenpiInfo.audit_id !== lastAuditors[0].aid))) {