From 019bdfcd1da3033c045cb804975146887e73b22e Mon Sep 17 00:00:00 2001 From: AdisakKanthawilang Date: Thu, 29 Feb 2024 17:49:39 +0700 Subject: [PATCH 1/8] fix sort posMasterNo --- src/controllers/PositionController.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/controllers/PositionController.ts b/src/controllers/PositionController.ts index b09d4184..9a8b782e 100644 --- a/src/controllers/PositionController.ts +++ b/src/controllers/PositionController.ts @@ -1497,7 +1497,10 @@ export class PositionController extends Controller { posMaster.orgChild4Id = org.id; posMaster.orgRevisionId = org.orgRevisionId; } - } + } + const allPosMasterNo = posMasters.map(posMaster => posMaster.posMasterNo); + const maxPosMasterNo = Math.max(...allPosMasterNo); + posMaster.posMasterNo = maxPosMasterNo + 1; posMaster.createdUserId = request.user.sub; posMaster.createdFullName = request.user.name; posMaster.lastUpdateUserId = request.user.sub; From ba76e787b00b8aa8b9f986b6906b25871673a99e Mon Sep 17 00:00:00 2001 From: AdisakKanthawilang Date: Fri, 1 Mar 2024 11:17:57 +0700 Subject: [PATCH 2/8] =?UTF-8?q?=E0=B9=81=E0=B8=81=E0=B9=89=E0=B9=84?= =?UTF-8?q?=E0=B8=82=E0=B8=84=E0=B9=89=E0=B8=99=E0=B8=AB=E0=B8=B2=E0=B8=8A?= =?UTF-8?q?=E0=B8=B7=E0=B9=88=E0=B8=AD=E0=B8=84=E0=B8=99=E0=B8=84=E0=B8=A3?= =?UTF-8?q?=E0=B8=AD=E0=B8=87=20master/list?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/controllers/PositionController.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/controllers/PositionController.ts b/src/controllers/PositionController.ts index 614a56b1..16ca8fb4 100644 --- a/src/controllers/PositionController.ts +++ b/src/controllers/PositionController.ts @@ -1096,6 +1096,21 @@ export class PositionController extends Controller { .andWhere(revisionCondition); }), ) + .orWhere( + new Brackets((qb) => { + qb.andWhere( + body.keyword != null && body.keyword != "" + ? `CONCAT(next_holder.prefix, next_holder.firstName, next_holder.lastName) like '%${body.keyword}%'` + : "1=1", + { + keyword: `%${body.keyword}%`, + }, + ) + .andWhere(checkChildConditions) + .andWhere(typeCondition) + .andWhere(revisionCondition); + }), + ) .orderBy("posMaster.posMasterOrder", "ASC") .skip((body.page - 1) * body.pageSize) .take(body.pageSize) From 4d3769e4b4597283d97d004a15b0e96bba05f036 Mon Sep 17 00:00:00 2001 From: AdisakKanthawilang Date: Fri, 1 Mar 2024 12:16:54 +0700 Subject: [PATCH 3/8] label name --- src/controllers/OrganizationController.ts | 5 +++++ src/controllers/PositionController.ts | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/src/controllers/OrganizationController.ts b/src/controllers/OrganizationController.ts index d43499c0..881721f8 100644 --- a/src/controllers/OrganizationController.ts +++ b/src/controllers/OrganizationController.ts @@ -718,6 +718,7 @@ export class OrganizationController extends Controller { orgTreeFax: orgRoot.orgRootFax, orgRevisionId: orgRoot.orgRevisionId, orgRootName: orgRoot.orgRootName, + labelName: orgRoot.orgRootName + " " + orgRoot.orgRootCode + "00" +" "+ orgRoot.orgRootShortName, totalPosition: await this.posMasterRepository.count({ where: { orgRevisionId: orgRoot.orgRevisionId, orgRootId: orgRoot.id }, }), @@ -824,6 +825,7 @@ export class OrganizationController extends Controller { orgTreeFax: orgChild1.orgChild1Fax, orgRevisionId: orgRoot.orgRevisionId, orgRootName: orgRoot.orgRootName, + labelName: orgChild1.orgChild1Name + " " + orgChild1.orgChild1Code + "00" +" "+ orgChild1.orgChild1ShortName, totalPosition: await this.posMasterRepository.count({ where: { orgRevisionId: orgRoot.orgRevisionId, orgChild1Id: orgChild1.id }, }), @@ -930,6 +932,7 @@ export class OrganizationController extends Controller { orgTreeFax: orgChild2.orgChild2Fax, orgRevisionId: orgRoot.orgRevisionId, orgRootName: orgRoot.orgRootName, + labelName: orgChild2.orgChild2Name + " " + orgChild2.orgChild2Code + "00" +" "+ orgChild2.orgChild2ShortName, totalPosition: await this.posMasterRepository.count({ where: { orgRevisionId: orgRoot.orgRevisionId, @@ -1039,6 +1042,7 @@ export class OrganizationController extends Controller { orgTreeFax: orgChild3.orgChild3Fax, orgRevisionId: orgRoot.orgRevisionId, orgRootName: orgRoot.orgRootName, + labelName: orgChild3.orgChild3Name + " " + orgChild3.orgChild3Code + "00" +" "+ orgChild3.orgChild3ShortName, totalPosition: await this.posMasterRepository.count({ where: { orgRevisionId: orgRoot.orgRevisionId, @@ -1148,6 +1152,7 @@ export class OrganizationController extends Controller { orgTreeFax: orgChild4.orgChild4Fax, orgRevisionId: orgRoot.orgRevisionId, orgRootName: orgRoot.orgRootName, + labelName: orgChild4.orgChild4Name + " " + orgChild4.orgChild4Code + "00" +" "+ orgChild4.orgChild4ShortName, totalPosition: await this.posMasterRepository.count({ where: { orgRevisionId: orgRoot.orgRevisionId, diff --git a/src/controllers/PositionController.ts b/src/controllers/PositionController.ts index 16ca8fb4..c7d30262 100644 --- a/src/controllers/PositionController.ts +++ b/src/controllers/PositionController.ts @@ -944,6 +944,7 @@ export class PositionController extends Controller { let checkChildConditions: any = {}; let keywordAsInt: any; let searchShortName = ""; + let labelName = ""; let searchShortName0 = `CONCAT(orgRoot.orgRootShortName,posMaster.posMasterNoPrefix,posMaster.posMasterNo,posMaster.posMasterNoSuffix)`; let searchShortName1 = `CONCAT(orgChild1.orgChild1ShortName,posMaster.posMasterNoPrefix,posMaster.posMasterNo,posMaster.posMasterNoSuffix)`; let searchShortName2 = `CONCAT(orgChild2.orgChild2ShortName,posMaster.posMasterNoPrefix,posMaster.posMasterNo,posMaster.posMasterNoSuffix)`; @@ -1155,6 +1156,7 @@ export class PositionController extends Controller { ) { body.type = 0; shortName = posMaster.orgRoot.orgRootShortName; + // labelName = posMaster.orgRoot.orgRootName+" "+posMaster.orgRoot.orgRootCode + "00"+" "+posMaster.orgRoot.orgRootShortName; } else if ( posMaster.orgRootId !== null && posMaster.orgChild1Id !== null && @@ -1163,6 +1165,7 @@ export class PositionController extends Controller { ) { body.type = 1; shortName = posMaster.orgChild1.orgChild1ShortName; + // labelName = posMaster.orgChild1.orgChild1Name+" "+posMaster.orgChild1.orgChild1Code + "00"+" "+posMaster.orgChild1.orgChild1ShortName; } else if ( posMaster.orgRootId !== null && posMaster.orgChild1Id !== null && @@ -1171,6 +1174,7 @@ export class PositionController extends Controller { ) { body.type = 2; shortName = posMaster.orgChild2.orgChild2ShortName; + // labelName = posMaster.orgChild2.orgChild2Name+" "+posMaster.orgChild2.orgChild2Code + "00"+" "+posMaster.orgChild2.orgChild2ShortName; } else if ( posMaster.orgRootId !== null && posMaster.orgChild1Id !== null && @@ -1179,6 +1183,7 @@ export class PositionController extends Controller { ) { body.type = 3; shortName = posMaster.orgChild3.orgChild3ShortName; + // labelName = posMaster.orgChild3.orgChild3Name+" "+posMaster.orgChild3.orgChild3Code + "00"+" "+posMaster.orgChild3.orgChild3ShortName; } else if ( posMaster.orgRootId !== null && posMaster.orgChild1Id !== null && @@ -1187,6 +1192,7 @@ export class PositionController extends Controller { ) { body.type = 4; shortName = posMaster.orgChild4.orgChild4ShortName; + // labelName = posMaster.orgChild4.orgChild4Name+" "+posMaster.orgChild4.orgChild4Code + "00"+" "+posMaster.orgChild4.orgChild4ShortName; } return { @@ -1208,6 +1214,7 @@ export class PositionController extends Controller { ? null : `${posMaster.next_holder.prefix}${posMaster.next_holder.firstName} ${posMaster.next_holder.lastName}`, orgShortname: shortName, + // labelName: labelName, isSit: posMaster.isSit, profilePosition: profile == null || profile.position == null ? null : profile.position, profilePostype: type == null || type.posTypeName == null ? null : type.posTypeName, From 7b29823f9e18db8869bdf80b0920251078dc4889 Mon Sep 17 00:00:00 2001 From: AdisakKanthawilang Date: Fri, 1 Mar 2024 13:58:04 +0700 Subject: [PATCH 4/8] fix --- src/controllers/OrganizationController.ts | 8 +++---- src/controllers/PositionController.ts | 29 +++++++++++++++++++++++ 2 files changed, 33 insertions(+), 4 deletions(-) diff --git a/src/controllers/OrganizationController.ts b/src/controllers/OrganizationController.ts index 881721f8..01591b8b 100644 --- a/src/controllers/OrganizationController.ts +++ b/src/controllers/OrganizationController.ts @@ -825,7 +825,7 @@ export class OrganizationController extends Controller { orgTreeFax: orgChild1.orgChild1Fax, orgRevisionId: orgRoot.orgRevisionId, orgRootName: orgRoot.orgRootName, - labelName: orgChild1.orgChild1Name + " " + orgChild1.orgChild1Code + "00" +" "+ orgChild1.orgChild1ShortName, + labelName: orgChild1.orgChild1Name + " " + orgRoot.orgRootCode +orgChild1.orgChild1Code +" "+ orgChild1.orgChild1ShortName, totalPosition: await this.posMasterRepository.count({ where: { orgRevisionId: orgRoot.orgRevisionId, orgChild1Id: orgChild1.id }, }), @@ -932,7 +932,7 @@ export class OrganizationController extends Controller { orgTreeFax: orgChild2.orgChild2Fax, orgRevisionId: orgRoot.orgRevisionId, orgRootName: orgRoot.orgRootName, - labelName: orgChild2.orgChild2Name + " " + orgChild2.orgChild2Code + "00" +" "+ orgChild2.orgChild2ShortName, + labelName: orgChild2.orgChild2Name + " " + orgRoot.orgRootCode +orgChild2.orgChild2Code +" "+ orgChild2.orgChild2ShortName, totalPosition: await this.posMasterRepository.count({ where: { orgRevisionId: orgRoot.orgRevisionId, @@ -1042,7 +1042,7 @@ export class OrganizationController extends Controller { orgTreeFax: orgChild3.orgChild3Fax, orgRevisionId: orgRoot.orgRevisionId, orgRootName: orgRoot.orgRootName, - labelName: orgChild3.orgChild3Name + " " + orgChild3.orgChild3Code + "00" +" "+ orgChild3.orgChild3ShortName, + labelName: orgChild3.orgChild3Name + " " + orgRoot.orgRootCode +orgChild3.orgChild3Code +" "+ orgChild3.orgChild3ShortName, totalPosition: await this.posMasterRepository.count({ where: { orgRevisionId: orgRoot.orgRevisionId, @@ -1152,7 +1152,7 @@ export class OrganizationController extends Controller { orgTreeFax: orgChild4.orgChild4Fax, orgRevisionId: orgRoot.orgRevisionId, orgRootName: orgRoot.orgRootName, - labelName: orgChild4.orgChild4Name + " " + orgChild4.orgChild4Code + "00" +" "+ orgChild4.orgChild4ShortName, + labelName: orgChild4.orgChild4Name + " " + orgRoot.orgRootCode +orgChild4.orgChild4Code +" "+ orgChild4.orgChild4ShortName, totalPosition: await this.posMasterRepository.count({ where: { orgRevisionId: orgRoot.orgRevisionId, diff --git a/src/controllers/PositionController.ts b/src/controllers/PositionController.ts index c7d30262..c38b325e 100644 --- a/src/controllers/PositionController.ts +++ b/src/controllers/PositionController.ts @@ -1473,6 +1473,12 @@ export class PositionController extends Controller { posMaster.orgRootId = org.id; posMaster.orgRevisionId = org.orgRevisionId; } + const lastPosMasterNo = await this.posMasterRepository.find({ + where:{ + orgRootId:requestBody.id, + orgChild1Id: Not(IsNull()) + } + }) } if (requestBody.type == 1) { const org = await this.child1Repository.findOne({ @@ -1483,6 +1489,12 @@ export class PositionController extends Controller { posMaster.orgChild1Id = org.id; posMaster.orgRevisionId = org.orgRevisionId; } + const lastPosMasterNo = await this.posMasterRepository.find({ + where:{ + orgChild1Id:requestBody.id, + orgChild2Id: Not(IsNull()) + } + }) } if (requestBody.type == 2) { const org = await this.child2Repository.findOne({ @@ -1494,6 +1506,12 @@ export class PositionController extends Controller { posMaster.orgChild2Id = org.id; posMaster.orgRevisionId = org.orgRevisionId; } + const lastPosMasterNo = await this.posMasterRepository.find({ + where:{ + orgChild2Id:requestBody.id, + orgChild3Id: Not(IsNull()) + } + }) } if (requestBody.type == 3) { const org = await this.child3Repository.findOne({ @@ -1507,6 +1525,12 @@ export class PositionController extends Controller { posMaster.orgRevisionId = org.orgRevisionId; } } + const lastPosMasterNo = await this.posMasterRepository.find({ + where:{ + orgChild3Id:requestBody.id, + orgChild4Id: Not(IsNull()) + } + }) if (requestBody.type == 4) { const org = await this.child4Repository.findOne({ where: { id: requestBody.id }, @@ -1519,6 +1543,11 @@ export class PositionController extends Controller { posMaster.orgChild4Id = org.id; posMaster.orgRevisionId = org.orgRevisionId; } + const lastPosMasterNo = await this.posMasterRepository.find({ + where:{ + orgChild4Id:requestBody.id + } + }) } const allPosMasterNo = posMasters.map(posMaster => posMaster.posMasterNo); const maxPosMasterNo = Math.max(...allPosMasterNo); From 16d718baa48a7752030a88b93e5e99b320d8749d Mon Sep 17 00:00:00 2001 From: AdisakKanthawilang Date: Fri, 1 Mar 2024 15:17:35 +0700 Subject: [PATCH 5/8] fix --- src/controllers/PositionController.ts | 96 ++++++++++++++++++--------- 1 file changed, 63 insertions(+), 33 deletions(-) diff --git a/src/controllers/PositionController.ts b/src/controllers/PositionController.ts index c38b325e..cccedd9d 100644 --- a/src/controllers/PositionController.ts +++ b/src/controllers/PositionController.ts @@ -1086,7 +1086,7 @@ export class PositionController extends Controller { new Brackets((qb) => { qb.andWhere( body.keyword != null && body.keyword != "" - ? `CONCAT(current_holder.prefix, current_holder.firstName, current_holder.lastName) like '%${body.keyword}%'` + ? `CONCAT(current_holder.prefix, current_holder.firstName," ",current_holder.lastName) like '%${body.keyword}%'` : "1=1", { keyword: `%${body.keyword}%`, @@ -1101,7 +1101,7 @@ export class PositionController extends Controller { new Brackets((qb) => { qb.andWhere( body.keyword != null && body.keyword != "" - ? `CONCAT(next_holder.prefix, next_holder.firstName, next_holder.lastName) like '%${body.keyword}%'` + ? `CONCAT(next_holder.prefix, next_holder.firstName," ",next_holder.lastName) like '%${body.keyword}%'` : "1=1", { keyword: `%${body.keyword}%`, @@ -1473,12 +1473,6 @@ export class PositionController extends Controller { posMaster.orgRootId = org.id; posMaster.orgRevisionId = org.orgRevisionId; } - const lastPosMasterNo = await this.posMasterRepository.find({ - where:{ - orgRootId:requestBody.id, - orgChild1Id: Not(IsNull()) - } - }) } if (requestBody.type == 1) { const org = await this.child1Repository.findOne({ @@ -1489,12 +1483,6 @@ export class PositionController extends Controller { posMaster.orgChild1Id = org.id; posMaster.orgRevisionId = org.orgRevisionId; } - const lastPosMasterNo = await this.posMasterRepository.find({ - where:{ - orgChild1Id:requestBody.id, - orgChild2Id: Not(IsNull()) - } - }) } if (requestBody.type == 2) { const org = await this.child2Repository.findOne({ @@ -1506,12 +1494,6 @@ export class PositionController extends Controller { posMaster.orgChild2Id = org.id; posMaster.orgRevisionId = org.orgRevisionId; } - const lastPosMasterNo = await this.posMasterRepository.find({ - where:{ - orgChild2Id:requestBody.id, - orgChild3Id: Not(IsNull()) - } - }) } if (requestBody.type == 3) { const org = await this.child3Repository.findOne({ @@ -1525,12 +1507,6 @@ export class PositionController extends Controller { posMaster.orgRevisionId = org.orgRevisionId; } } - const lastPosMasterNo = await this.posMasterRepository.find({ - where:{ - orgChild3Id:requestBody.id, - orgChild4Id: Not(IsNull()) - } - }) if (requestBody.type == 4) { const org = await this.child4Repository.findOne({ where: { id: requestBody.id }, @@ -1543,14 +1519,68 @@ export class PositionController extends Controller { posMaster.orgChild4Id = org.id; posMaster.orgRevisionId = org.orgRevisionId; } - const lastPosMasterNo = await this.posMasterRepository.find({ - where:{ - orgChild4Id:requestBody.id - } - }) } - const allPosMasterNo = posMasters.map(posMaster => posMaster.posMasterNo); - const maxPosMasterNo = Math.max(...allPosMasterNo); + const type0LastPosMasterNo = requestBody.type == 0 + ? await this.posMasterRepository.find({ + where: { + orgRootId: requestBody.id, + orgChild1Id: IsNull(), + }, + }) + : []; + + const type1LastPosMasterNo = requestBody.type == 1 + ? await this.posMasterRepository.find({ + where: { + orgChild1Id: requestBody.id, + orgChild2Id: IsNull(), + }, + }) + : []; + + const type2LastPosMasterNo = requestBody.type == 2 + ? await this.posMasterRepository.find({ + where: { + orgChild2Id: requestBody.id, + orgChild3Id: IsNull(), + }, + }) + : []; + + const type3LastPosMasterNo = requestBody.type == 3 + ? await this.posMasterRepository.find({ + where: { + orgChild3Id: requestBody.id, + orgChild4Id: IsNull(), + }, + }) + : []; + + const type4LastPosMasterNo = requestBody.type == 4 + ? await this.posMasterRepository.find({ + where: { + orgChild4Id: requestBody.id, + }, + }) + : []; + + const allLastPosMasterNo = [ + ...type0LastPosMasterNo, + ...type1LastPosMasterNo, + ...type2LastPosMasterNo, + ...type3LastPosMasterNo, + ...type4LastPosMasterNo, + ]; + console.log("allLast>>>>>>>>:",allLastPosMasterNo); + console.log("type>>>>>>>>:",requestBody.type); + console.log("data>>>>>>>>:",type2LastPosMasterNo); + + const maxPosMasterNo = Math.max( + ...allLastPosMasterNo.map((pos) => pos.posMasterNo), + 0 + ); + + console.log("max>>>>>>>>:",maxPosMasterNo); posMaster.posMasterNo = maxPosMasterNo + 1; posMaster.createdUserId = request.user.sub; posMaster.createdFullName = request.user.name; From 4c2f7120ce54224f5b82645629647de427e366e2 Mon Sep 17 00:00:00 2001 From: AdisakKanthawilang Date: Fri, 1 Mar 2024 15:37:30 +0700 Subject: [PATCH 6/8] fix --- src/controllers/PositionController.ts | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/src/controllers/PositionController.ts b/src/controllers/PositionController.ts index cccedd9d..b08ba73e 100644 --- a/src/controllers/PositionController.ts +++ b/src/controllers/PositionController.ts @@ -1156,7 +1156,6 @@ export class PositionController extends Controller { ) { body.type = 0; shortName = posMaster.orgRoot.orgRootShortName; - // labelName = posMaster.orgRoot.orgRootName+" "+posMaster.orgRoot.orgRootCode + "00"+" "+posMaster.orgRoot.orgRootShortName; } else if ( posMaster.orgRootId !== null && posMaster.orgChild1Id !== null && @@ -1165,7 +1164,6 @@ export class PositionController extends Controller { ) { body.type = 1; shortName = posMaster.orgChild1.orgChild1ShortName; - // labelName = posMaster.orgChild1.orgChild1Name+" "+posMaster.orgChild1.orgChild1Code + "00"+" "+posMaster.orgChild1.orgChild1ShortName; } else if ( posMaster.orgRootId !== null && posMaster.orgChild1Id !== null && @@ -1174,7 +1172,6 @@ export class PositionController extends Controller { ) { body.type = 2; shortName = posMaster.orgChild2.orgChild2ShortName; - // labelName = posMaster.orgChild2.orgChild2Name+" "+posMaster.orgChild2.orgChild2Code + "00"+" "+posMaster.orgChild2.orgChild2ShortName; } else if ( posMaster.orgRootId !== null && posMaster.orgChild1Id !== null && @@ -1183,7 +1180,6 @@ export class PositionController extends Controller { ) { body.type = 3; shortName = posMaster.orgChild3.orgChild3ShortName; - // labelName = posMaster.orgChild3.orgChild3Name+" "+posMaster.orgChild3.orgChild3Code + "00"+" "+posMaster.orgChild3.orgChild3ShortName; } else if ( posMaster.orgRootId !== null && posMaster.orgChild1Id !== null && @@ -1192,7 +1188,6 @@ export class PositionController extends Controller { ) { body.type = 4; shortName = posMaster.orgChild4.orgChild4ShortName; - // labelName = posMaster.orgChild4.orgChild4Name+" "+posMaster.orgChild4.orgChild4Code + "00"+" "+posMaster.orgChild4.orgChild4ShortName; } return { @@ -1214,7 +1209,6 @@ export class PositionController extends Controller { ? null : `${posMaster.next_holder.prefix}${posMaster.next_holder.firstName} ${posMaster.next_holder.lastName}`, orgShortname: shortName, - // labelName: labelName, isSit: posMaster.isSit, profilePosition: profile == null || profile.position == null ? null : profile.position, profilePostype: type == null || type.posTypeName == null ? null : type.posTypeName, @@ -1571,17 +1565,19 @@ export class PositionController extends Controller { ...type3LastPosMasterNo, ...type4LastPosMasterNo, ]; - console.log("allLast>>>>>>>>:",allLastPosMasterNo); - console.log("type>>>>>>>>:",requestBody.type); - console.log("data>>>>>>>>:",type2LastPosMasterNo); const maxPosMasterNo = Math.max( ...allLastPosMasterNo.map((pos) => pos.posMasterNo), 0 ); - console.log("max>>>>>>>>:",maxPosMasterNo); + const maxPosMasterOrder = Math.max( + ...allLastPosMasterNo.map((pos) => pos.posMasterOrder), + 0 + ); + posMaster.posMasterNo = maxPosMasterNo + 1; + posMaster.posMasterNo = maxPosMasterOrder + 1; posMaster.createdUserId = request.user.sub; posMaster.createdFullName = request.user.name; posMaster.lastUpdateUserId = request.user.sub; From 3e8f43537f9765ea310036e7d9123f429e69a122 Mon Sep 17 00:00:00 2001 From: AdisakKanthawilang Date: Fri, 1 Mar 2024 15:43:03 +0700 Subject: [PATCH 7/8] fix --- src/controllers/PositionController.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/controllers/PositionController.ts b/src/controllers/PositionController.ts index b08ba73e..5719e096 100644 --- a/src/controllers/PositionController.ts +++ b/src/controllers/PositionController.ts @@ -1577,7 +1577,7 @@ export class PositionController extends Controller { ); posMaster.posMasterNo = maxPosMasterNo + 1; - posMaster.posMasterNo = maxPosMasterOrder + 1; + posMaster.posMasterOrder = maxPosMasterOrder + 1; posMaster.createdUserId = request.user.sub; posMaster.createdFullName = request.user.name; posMaster.lastUpdateUserId = request.user.sub; From 2bb68463be5f4156517c27c768f47a81ee511b13 Mon Sep 17 00:00:00 2001 From: AdisakKanthawilang Date: Mon, 4 Mar 2024 09:23:51 +0700 Subject: [PATCH 8/8] fix bug --- src/controllers/PositionController.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/controllers/PositionController.ts b/src/controllers/PositionController.ts index 5719e096..444fa865 100644 --- a/src/controllers/PositionController.ts +++ b/src/controllers/PositionController.ts @@ -1079,7 +1079,7 @@ export class PositionController extends Controller { ) .andWhere(checkChildConditions) .andWhere(typeCondition) - .andWhere(revisionCondition); + .andWhere(revisionCondition) }), ) .orWhere(