From d61da53c93aa7edbd704ad75fe6e4b357e670923 Mon Sep 17 00:00:00 2001 From: wjh Date: Wed, 9 Oct 2024 15:21:42 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E5=BA=93=E5=AD=98=E8=AE=A1=E7=AE=97=E6=97=A0=E6=B3=95=E5=AE=8C?= =?UTF-8?q?=E7=BB=93=20(#1582)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-on: https://git.daoyoucloud.com/daoyoucloud/tachybase/pulls/1582 Co-authored-by: wjh Co-committed-by: wjh --- .../@hera/plugin-rental/src/server/services/project-service.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/plugins/@hera/plugin-rental/src/server/services/project-service.ts b/packages/plugins/@hera/plugin-rental/src/server/services/project-service.ts index e950f626f..1751ed931 100644 --- a/packages/plugins/@hera/plugin-rental/src/server/services/project-service.ts +++ b/packages/plugins/@hera/plugin-rental/src/server/services/project-service.ts @@ -25,7 +25,8 @@ export class ProjectService { const SQL = this.sqlLoader.sqlFiles['project_products_inventory']; const query = SQL.replace('${project_id}', model.id); const inventory: any = await this.db.sequelize.query(query); - if (inventory[0][0] && inventory[0][0].count) throw new Error('项目产品尚未结清'); + //NOTE 0.001:根据换算比例精度是3位数 + if (inventory[0][0] && inventory[0][0].count >= 0.001) throw new Error('项目产品尚未结清'); } } }