diff --git a/src/controllers/EmployeeTempPositionController.ts b/src/controllers/EmployeeTempPositionController.ts index b507734b..3ede0b3e 100644 --- a/src/controllers/EmployeeTempPositionController.ts +++ b/src/controllers/EmployeeTempPositionController.ts @@ -299,7 +299,10 @@ export class EmployeeTempPositionController extends Controller { }); } findData = await this.employeePosDictRepository.find({ - where: { posLevelId: In(findEmpLevels.map((x) => x.id)) }, + where: { + posLevelId: In(findEmpLevels.map((x) => x.id)), + posLevel: { posLevelName: 1 }, + }, relations: ["posType", "posLevel"], order: { posDictName: "ASC", @@ -317,6 +320,7 @@ export class EmployeeTempPositionController extends Controller { } else { //กรณีเลือกค้นหาจาก"ระดับชั้นงาน" แต่กรอกไม่ใช่ number ให้ปล่อยมาหมดเลย findData = await this.employeePosDictRepository.find({ + where: { posLevel: { posLevelName: 1 } }, relations: ["posType", "posLevel"], order: { posDictName: "ASC", @@ -1941,14 +1945,22 @@ export class EmployeeTempPositionController extends Controller { ) { await new permission().PermissionCreate(request, "SYS_ORG_TEMP"); const dataMaster = await this.employeeTempPosMasterRepository.findOne({ - where: { + where: { id: requestBody.posMaster, orgRevision: { orgRevisionIsCurrent: true, - orgRevisionIsDraft: false - } + orgRevisionIsDraft: false, + }, }, - relations: ["positions", "orgRevision", "orgRoot", "orgChild1", "orgChild2", "orgChild3", "orgChild4"], + relations: [ + "positions", + "orgRevision", + "orgRoot", + "orgChild1", + "orgChild2", + "orgChild3", + "orgChild4", + ], }); if (!dataMaster) { throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลตำแหน่งนี้"); @@ -1958,7 +1970,7 @@ export class EmployeeTempPositionController extends Controller { let _child2 = dataMaster.orgChild2?.orgChild2Name; let _child3 = dataMaster.orgChild3?.orgChild3Name; let _child4 = dataMaster.orgChild4?.orgChild4Name; - const Org = + const Org = (_child4 == null ? "" : _child4 + "\n") + (_child3 == null ? "" : _child3 + "\n") + (_child2 == null ? "" : _child2 + "\n") + diff --git a/src/controllers/ImportDataController.ts b/src/controllers/ImportDataController.ts index 7ff8efc7..c8ea9bbf 100644 --- a/src/controllers/ImportDataController.ts +++ b/src/controllers/ImportDataController.ts @@ -3354,6 +3354,7 @@ export class ImportDataController extends Controller { // } // }); } + console.log(">>>>>>>>>>>>>>>>>>> " + _item.citizenId); order = 1; } return new HttpSuccess();