Merge branch 'develop' of github.com:Frappet/hrms-api-org into develop
All checks were successful
Build & Deploy on Dev / build (push) Successful in 1m11s
All checks were successful
Build & Deploy on Dev / build (push) Successful in 1m11s
This commit is contained in:
commit
dda36a05a9
4 changed files with 53 additions and 17 deletions
|
|
@ -251,7 +251,7 @@ export class EmployeeTempPositionController extends Controller {
|
|||
switch (type) {
|
||||
case "positionName":
|
||||
findData = await this.employeePosDictRepository.find({
|
||||
where: { posDictName: Like(`%${keyword}%`), posLevel: { posLevelName: 1 } },
|
||||
where: { posDictName: Like(`%${keyword}%`), posLevel: { posLevelName: "1" } },
|
||||
relations: ["posType", "posLevel"],
|
||||
order: {
|
||||
posDictName: "ASC",
|
||||
|
|
@ -274,7 +274,7 @@ export class EmployeeTempPositionController extends Controller {
|
|||
select: ["id"],
|
||||
});
|
||||
findData = await this.employeePosDictRepository.find({
|
||||
where: { posTypeId: In(findEmpTypes.map((x) => x.id)), posLevel: { posLevelName: 1 } },
|
||||
where: { posTypeId: In(findEmpTypes.map((x) => x.id)), posLevel: { posLevelName: "1" } },
|
||||
relations: ["posType", "posLevel"],
|
||||
order: {
|
||||
posDictName: "ASC",
|
||||
|
|
@ -292,19 +292,19 @@ export class EmployeeTempPositionController extends Controller {
|
|||
break;
|
||||
|
||||
case "positionLevel":
|
||||
if (!isNaN(Number(keyword))) {
|
||||
if (!keyword) {
|
||||
let findEmpLevels;
|
||||
if (Number(keyword) === 0) {
|
||||
if (keyword === "0") {
|
||||
findEmpLevels = await this.employeePosLevelRepository.find();
|
||||
} else {
|
||||
findEmpLevels = await this.employeePosLevelRepository.find({
|
||||
where: { posLevelName: Number(keyword) },
|
||||
where: { posLevelName: keyword },
|
||||
});
|
||||
}
|
||||
findData = await this.employeePosDictRepository.find({
|
||||
where: {
|
||||
posLevelId: In(findEmpLevels.map((x) => x.id)),
|
||||
posLevel: { posLevelName: 1 },
|
||||
posLevel: { posLevelName: "1" },
|
||||
},
|
||||
relations: ["posType", "posLevel"],
|
||||
order: {
|
||||
|
|
@ -323,7 +323,7 @@ export class EmployeeTempPositionController extends Controller {
|
|||
} else {
|
||||
//กรณีเลือกค้นหาจาก"ระดับชั้นงาน" แต่กรอกไม่ใช่ number ให้ปล่อยมาหมดเลย
|
||||
findData = await this.employeePosDictRepository.find({
|
||||
where: { posLevel: { posLevelName: 1 } },
|
||||
where: { posLevel: { posLevelName: "1" } },
|
||||
relations: ["posType", "posLevel"],
|
||||
order: {
|
||||
posDictName: "ASC",
|
||||
|
|
@ -343,7 +343,7 @@ export class EmployeeTempPositionController extends Controller {
|
|||
|
||||
default:
|
||||
findData = await this.employeePosDictRepository.find({
|
||||
where: { posLevel: { posLevelName: 1 } },
|
||||
where: { posLevel: { posLevelName: "1" } },
|
||||
relations: ["posType", "posLevel"],
|
||||
order: {
|
||||
posDictName: "ASC",
|
||||
|
|
|
|||
|
|
@ -395,12 +395,14 @@ export class ImportDataController extends Controller {
|
|||
}
|
||||
|
||||
var positionType = "";
|
||||
var positionLevel = 0;
|
||||
// var positionLevel = 0;
|
||||
var positionLevel = "0";
|
||||
const workLevel = item.WORK_LEVEL;
|
||||
const part1 = workLevel.split("/")[0]; // "ส 2"
|
||||
const value2 = part1.split(" ")[1]; // "2"
|
||||
if (value2) {
|
||||
positionLevel = parseInt(value2);
|
||||
// positionLevel = parseInt(value2);
|
||||
positionLevel = value2;
|
||||
}
|
||||
if (item.CATEGORY_SAL_CODE == "11") {
|
||||
positionType = "บริการพื้นฐาน";
|
||||
|
|
@ -530,12 +532,14 @@ export class ImportDataController extends Controller {
|
|||
}
|
||||
|
||||
var positionType = "";
|
||||
var positionLevel = 0;
|
||||
// var positionLevel = 0;
|
||||
var positionLevel = "0";
|
||||
const value2 = item.POSITION_LEVEL;
|
||||
// const part1 = workLevel.split("/")[0]; // "ส 2"
|
||||
// const value2 = part1.split(" ")[1]; // "2"
|
||||
if (value2) {
|
||||
positionLevel = parseInt(value2);
|
||||
// positionLevel = parseInt(value2);
|
||||
positionLevel = value2;
|
||||
}
|
||||
if (item.CATEGORY_SAL_CODE == "11") {
|
||||
positionType = "บริการพื้นฐาน";
|
||||
|
|
@ -4340,12 +4344,14 @@ export class ImportDataController extends Controller {
|
|||
|
||||
let position = new EmployeePosition();
|
||||
var positionType = "";
|
||||
var positionLevel = 0;
|
||||
// var positionLevel = 0;
|
||||
var positionLevel = "0";
|
||||
const workLevel = item.WORK_LEVEL;
|
||||
const part1 = workLevel.split("/")[0]; // "ส 2"
|
||||
const value2 = part1.split(" ")[1]; // "2"
|
||||
if (value2) {
|
||||
positionLevel = parseInt(value2);
|
||||
// positionLevel = parseInt(value2);
|
||||
positionLevel = value2;
|
||||
}
|
||||
if (item.CATEGORY_SAL_CODE == "11") {
|
||||
positionType = "บริการพื้นฐาน";
|
||||
|
|
|
|||
|
|
@ -14,9 +14,13 @@ enum EmployeePosLevelAuthoritys {
|
|||
export class EmployeePosLevel extends EntityBase {
|
||||
@Column({
|
||||
comment: "ชื่อระดับชั้นงาน",
|
||||
type: "int",
|
||||
// type: "int",
|
||||
nullable: true,
|
||||
length: 255,
|
||||
default: null,
|
||||
})
|
||||
posLevelName: number;
|
||||
// posLevelName: number;
|
||||
posLevelName: string;
|
||||
|
||||
@Column({
|
||||
comment: "ระดับของระดับชั้นงาน",
|
||||
|
|
@ -59,7 +63,7 @@ export class EmployeePosLevel extends EntityBase {
|
|||
|
||||
export class CreateEmployeePosLevel {
|
||||
@Column()
|
||||
posLevelName: number;
|
||||
posLevelName: string;
|
||||
|
||||
@Column()
|
||||
posLevelRank: number;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,26 @@
|
|||
import { MigrationInterface, QueryRunner } from "typeorm";
|
||||
|
||||
export class UpdateEmployeePosLevelChangeDatatypeFieldPosLevelName1771910056470 implements MigrationInterface {
|
||||
name = 'UpdateEmployeePosLevelChangeDatatypeFieldPosLevelName1771910056470'
|
||||
|
||||
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||
// await queryRunner.query(`ALTER TABLE \`employeePosLevel\` DROP COLUMN \`posLevelName\``);
|
||||
// await queryRunner.query(`ALTER TABLE \`employeePosLevel\` ADD \`posLevelName\` varchar(255) NULL COMMENT 'ชื่อระดับชั้นงาน'`);
|
||||
await queryRunner.query(`
|
||||
ALTER TABLE \`employeePosLevel\`
|
||||
MODIFY \`posLevelName\` varchar(255) NULL
|
||||
COMMENT 'ชื่อระดับชั้นงาน'
|
||||
`);
|
||||
}
|
||||
|
||||
public async down(queryRunner: QueryRunner): Promise<void> {
|
||||
// await queryRunner.query(`ALTER TABLE \`employeePosLevel\` DROP COLUMN \`posLevelName\``);
|
||||
// await queryRunner.query(`ALTER TABLE \`employeePosLevel\` ADD \`posLevelName\` int NOT NULL COMMENT 'ชื่อระดับชั้นงาน'`);
|
||||
await queryRunner.query(`
|
||||
ALTER TABLE \`employeePosLevel\`
|
||||
MODIFY \`posLevelName\` int NOT NULL
|
||||
COMMENT 'ชื่อระดับชั้นงาน'
|
||||
`);
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue