From dae8445d5fd484e873caa195b02f014a664005a3 Mon Sep 17 00:00:00 2001 From: lyx <2027667395@qq.com> Date: Thu, 21 Mar 2024 19:00:15 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=9B=B4=E5=8F=91=E5=8D=95=E8=BF=90?= =?UTF-8?q?=E8=BE=93=E5=8D=95=E5=BD=95=E5=85=A5=E5=A4=B1=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../@hera/plugin-rental/src/server/services/record-service.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/plugins/@hera/plugin-rental/src/server/services/record-service.ts b/packages/plugins/@hera/plugin-rental/src/server/services/record-service.ts index b83bfedea..91d6d62f4 100644 --- a/packages/plugins/@hera/plugin-rental/src/server/services/record-service.ts +++ b/packages/plugins/@hera/plugin-rental/src/server/services/record-service.ts @@ -34,6 +34,8 @@ export class RecordService { if (!values) { return; } + // 运输单的创建会走订单的update,如果存在waybill一定是在录运输单 + if (values.waybill) return; if (values.record_category === RecordTypes.purchaseDirect || values.record_category === RecordTypes.rentDirect) { const deleteDatas = await this.db.getRepository('records').find({ where: { direct_record_id: model.id } }); // 删除订单多对多项目表数据 @@ -62,6 +64,8 @@ export class RecordService { * @param options */ async recordsAfterSave(model: MagicAttributeModel, options: CreateOptions): Promise { + // 运输单导致的订单更新不必走以下订单逻辑,减少性能消耗,有vaybill一定是运输单录入 + if (options.values.waybill) return; // 订单新建更新后(根据合同确定出入库字段) await this._setProject(model, options); // 订单发生变化时更新对应结算单的状态(需要重新计算)