瀏覽代碼

修复bug

ellisran 1 周之前
父節點
當前提交
77316ae550

+ 3 - 3
app/controller/change_controller.js

@@ -2399,9 +2399,9 @@ module.exports = app => {
                 if (exist) {
                     throw '该审核人已存在,请勿重复添加';
                 }
-                const shenpiInfo = await ctx.service.shenpiAudit.getDataByCondition({ tid: ctx.tender.id, sp_type: shenpiConst.sp_type.change, sp_status: shenpiConst.sp_status.gdzs });
-                const is_gdzs = shenpiInfo && ctx.tender.info.shenpi.change === shenpiConst.sp_status.gdzs ? 1 : 0;
-                const result = await ctx.service.changeProjectAudit.addAuditor(ctx.change.id, id, ctx.change.times, is_gdzs);
+                // const shenpiInfo = await ctx.service.shenpiAudit.getDataByCondition({ tid: ctx.tender.id, sp_type: shenpiConst.sp_type.change, sp_status: shenpiConst.sp_status.gdzs });
+                // const is_gdzs = shenpiInfo && ctx.tender.info.shenpi.change === shenpiConst.sp_status.gdzs ? 1 : 0;
+                const result = await ctx.service.changeProjectAudit.addAuditor(ctx.change.id, id, ctx.change.times);
                 if (!result) {
                     throw '添加审核人失败';
                 }

+ 3 - 1
app/controller/quality_controller.js

@@ -811,7 +811,9 @@ module.exports = app => {
                         if (exist) {
                             throw '该审核人已存在,请勿重复添加';
                         }
-                        const result = await ctx.service.qualityInspectionAudit.addAuditor(ctx.inspection.id, id, ctx.inspection.times);
+                        const shenpiInfo = await ctx.service.shenpiAudit.getDataByCondition({ tid: ctx.tender.id, sp_type: shenpiConst.sp_type.inspection, sp_status: shenpiConst.sp_status.gdzs });
+                        const is_gdzs = shenpiInfo && ctx.tender.info.shenpi.inspection === shenpiConst.sp_status.gdzs ? 1 : 0;
+                        const result = await ctx.service.qualityInspectionAudit.addAuditor(ctx.inspection.id, id, ctx.inspection.times, is_gdzs);
                         if (!result) {
                             throw '添加审核人失败';
                         }

+ 3 - 1
app/controller/safe_controller.js

@@ -821,7 +821,9 @@ module.exports = app => {
                         if (exist) {
                             throw '该审核人已存在,请勿重复添加';
                         }
-                        const result = await ctx.service.safeInspectionAudit.addAuditor(ctx.inspection.id, id, ctx.inspection.times);
+                        const shenpiInfo = await ctx.service.shenpiAudit.getDataByCondition({ tid: ctx.tender.id, sp_type: shenpiConst.sp_type.safe_inspection, sp_status: shenpiConst.sp_status.gdzs });
+                        const is_gdzs = shenpiInfo && ctx.tender.info.shenpi.safe_inspection === shenpiConst.sp_status.gdzs ? 1 : 0;
+                        const result = await ctx.service.safeInspectionAudit.addAuditor(ctx.inspection.id, id, ctx.inspection.times, is_gdzs);
                         if (!result) {
                             throw '添加审核人失败';
                         }

+ 1 - 1
app/service/change_apply_audit.js

@@ -1373,7 +1373,7 @@ module.exports = app => {
                             updateData.push({ id: x.id, order: x.order - 1, audit_order: x.audit_order - 1 });
                         });
                         if (updateData.length > 0) {
-                            await transaction.updateRows(updateData);
+                            await transaction.updateRows(this.tableName, updateData);
                         }
                         order = order - 1;
                     }

+ 1 - 1
app/service/change_audit.js

@@ -403,7 +403,7 @@ module.exports = app => {
                             updateData.push({id: x.id, usite: x.usite - 1, usort: x.usort - 1, audit_order: x.audit_order - 1});
                         });
                         if (updateData.length > 0) {
-                            await transaction.updateRows(updateData);
+                            await transaction.updateRows(this.tableName, updateData);
                         }
                         order = order - 1;
                         audit_order = audit_order - 1;

+ 1 - 1
app/service/change_plan_audit.js

@@ -1444,7 +1444,7 @@ module.exports = app => {
                             updateData.push({ id: x.id, order: x.order - 1, audit_order: x.audit_order - 1 });
                         });
                         if (updateData.length > 0) {
-                            await transaction.updateRows(updateData);
+                            await transaction.updateRows(this.tableName, updateData);
                         }
                         order = order - 1;
                     }

+ 1 - 1
app/service/change_project_audit.js

@@ -1509,7 +1509,7 @@ module.exports = app => {
                             updateData.push({ id: x.id, order: x.order - 1, audit_order: x.audit_order - 1 });
                         });
                         if (updateData.length > 0) {
-                            await transaction.updateRows(updateData);
+                            await transaction.updateRows(this.tableName, updateData);
                         }
                         order = order - 1;
                     }

+ 1 - 1
app/service/ledger_audit.js

@@ -997,7 +997,7 @@ module.exports = app => {
                             updateData.push({id: x.id, audit_order: x.audit_order - 1});
                         });
                         if (updateData.length > 0) {
-                            await transaction.updateRows(updateData);
+                            await transaction.updateRows(this.tableName, updateData);
                         }
                         order = order - 1;
                     }

+ 1 - 1
app/service/material_audit.js

@@ -1197,7 +1197,7 @@ module.exports = app => {
                             updateData.push({id: x.id, order: x.order - 1, audit_order: x.audit_order - 1});
                         });
                         if (updateData.length > 0) {
-                            await transaction.updateRows(updateData);
+                            await transaction.updateRows(this.tableName, updateData);
                         }
                         order = order - 1;
                     }

+ 1 - 1
app/service/phase_pay_audit.js

@@ -273,7 +273,7 @@ module.exports = app => {
                             updateData.push({id: x.id, active_order: x.active_order - 1, audit_order: x.audit_order - 1});
                         });
                         if (updateData.length > 0) {
-                            await transaction.updateRows(updateData);
+                            await transaction.updateRows(this.tableName, updateData);
                         }
                         auditOrder = auditOrder - 1;
                     }

+ 1 - 1
app/service/quality_inspection_audit.js

@@ -381,7 +381,7 @@ module.exports = app => {
                             updateData.push({id: x.id, order: x.order - 1, audit_order: x.audit_order - 1});
                         });
                         if (updateData.length > 0) {
-                            await transaction.updateRows(updateData);
+                            await transaction.updateRows(this.tableName, updateData);
                         }
                         order = order - 1;
                     }

+ 1 - 1
app/service/revise_audit.js

@@ -1117,7 +1117,7 @@ module.exports = app => {
                             updateData.push({id: x.id, audit_order: x.audit_order - 1});
                         });
                         if (updateData.length > 0) {
-                            await transaction.updateRows(updateData);
+                            await transaction.updateRows(this.tableName, updateData);
                         }
                         order = order - 1;
                     }

+ 1 - 1
app/service/safe_inspection_audit.js

@@ -381,7 +381,7 @@ module.exports = app => {
                             updateData.push({id: x.id, order: x.order - 1, audit_order: x.audit_order - 1});
                         });
                         if (updateData.length > 0) {
-                            await transaction.updateRows(updateData);
+                            await transaction.updateRows(this.tableName, updateData);
                         }
                         order = order - 1;
                     }

+ 1 - 1
app/service/safe_stage_audit.js

@@ -399,7 +399,7 @@ module.exports = app => {
                             updateData.push({id: x.id, active_order: x.active_order - 1, audit_order: x.audit_order - 1});
                         });
                         if (updateData.length > 0) {
-                            await transaction.updateRows(updateData);
+                            await transaction.updateRows(this.tableName, updateData);
                         }
                         auditOrder = auditOrder - 1;
                     }

+ 1 - 1
app/service/settle_audit.js

@@ -295,7 +295,7 @@ module.exports = app => {
                             updateData.push({id: x.id, active_order: x.active_order - 1, audit_order: x.audit_order - 1});
                         });
                         if (updateData.length > 0) {
-                            await transaction.updateRows(updateData);
+                            await transaction.updateRows(this.tableName, updateData);
                         }
                         auditOrder = auditOrder - 1;
                     }

+ 1 - 1
app/service/stage_audit.js

@@ -2046,7 +2046,7 @@ module.exports = app => {
                             updateData.push({id: x.id, order: x.order - 1, audit_order: x.audit_order - 1});
                         });
                         if (updateData.length > 0) {
-                            await transaction.updateRows(updateData);
+                            await transaction.updateRows(this.tableName, updateData);
                         }
                         order = order - 1;
                     }