From 174be3a53abde98ae4e77c9146c34237f6af75e3 Mon Sep 17 00:00:00 2001 From: Bright Date: Wed, 13 Nov 2024 13:31:41 +0700 Subject: [PATCH] fix --- src/controllers/CommandController.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/controllers/CommandController.ts b/src/controllers/CommandController.ts index 537236ce..dbe5c5db 100644 --- a/src/controllers/CommandController.ts +++ b/src/controllers/CommandController.ts @@ -3041,7 +3041,7 @@ export class CommandController extends Controller { const orgRevision = await this.orgRevisionRepo.findOne({ where: { id: posMasters[0].orgRevisionId } }); - if (orgRevision != null) { + if (orgRevision != null && orgRevision.isLock == false) { await this.orgRevisionRepo.update(orgRevision.id, { isLock: true, }); @@ -3547,7 +3547,8 @@ export class CommandController extends Controller { where: { id: revisionId }, relations: ["posMasters"] }); - if (orgRevision != null && !orgRevision?.posMasters.filter(x => x.statusReport === "REPORT") + if (orgRevision != null && !["REPORT"].includes( + orgRevision.posMasters.find(x => x.statusReport === "REPORT")?.statusReport || "") ) { await this.orgRevisionRepo.update(orgRevision.id, { isLock: false,