Merge branch 'develop' into adiDev
This commit is contained in:
commit
428df7d08a
63 changed files with 226 additions and 13741 deletions
72
.github/workflows/release.yaml
vendored
72
.github/workflows/release.yaml
vendored
|
|
@ -67,40 +67,40 @@ jobs:
|
|||
docker compose pull
|
||||
docker compose up -d
|
||||
echo "${{ steps.gen_ver.outputs.image_ver }}"> success
|
||||
# - name: Notify Discord Success
|
||||
# if: success()
|
||||
# run: |
|
||||
# curl -H "Content-Type: application/json" \
|
||||
# -X POST \
|
||||
# -d '{
|
||||
# "embeds": [{
|
||||
# "title": "✅ Deployment Success!",
|
||||
# "description": "**Details:**\n- Image: `${{env.IMAGE_NAME}}`\n- Version: `${{ steps.gen_ver.outputs.image_ver }}`\n- Deployed by: `${{github.actor}}`",
|
||||
# "color": 3066993,
|
||||
# "footer": {
|
||||
# "text": "Release Notification",
|
||||
# "icon_url": "https://example.com/success-icon.png"
|
||||
# },
|
||||
# "timestamp": "'$(date -u +%Y-%m-%dT%H:%M:%SZ)'"
|
||||
# }]
|
||||
# }' \
|
||||
# ${{ secrets.DISCORD_WEBHOOK }}
|
||||
- name: Notify Discord Success
|
||||
if: success()
|
||||
run: |
|
||||
curl -H "Content-Type: application/json" \
|
||||
-X POST \
|
||||
-d '{
|
||||
"embeds": [{
|
||||
"title": "✅ Deployment Success!",
|
||||
"description": "**Details:**\n- Image: `${{env.IMAGE_NAME}}`\n- Version: `${{ steps.gen_ver.outputs.image_ver }}`\n- Deployed by: `${{github.actor}}`",
|
||||
"color": 3066993,
|
||||
"footer": {
|
||||
"text": "Release Notification",
|
||||
"icon_url": "https://example.com/success-icon.png"
|
||||
},
|
||||
"timestamp": "'$(date -u +%Y-%m-%dT%H:%M:%SZ)'"
|
||||
}]
|
||||
}' \
|
||||
${{ secrets.DISCORD_WEBHOOK }}
|
||||
|
||||
# - name: Notify Discord Failure
|
||||
# if: failure()
|
||||
# run: |
|
||||
# curl -H "Content-Type: application/json" \
|
||||
# -X POST \
|
||||
# -d '{
|
||||
# "embeds": [{
|
||||
# "title": "❌ Deployment Failed!",
|
||||
# "description": "**Details:**\n- Image: `${{env.IMAGE_NAME}}`\n- Version: `${{ steps.gen_ver.outputs.image_ver }}`\n- Attempted by: `${{github.actor}}`",
|
||||
# "color": 15158332,
|
||||
# "footer": {
|
||||
# "text": "Release Notification",
|
||||
# "icon_url": "https://example.com/failure-icon.png"
|
||||
# },
|
||||
# "timestamp": "'$(date -u +%Y-%m-%dT%H:%M:%SZ)'"
|
||||
# }]
|
||||
# }' \
|
||||
# ${{ secrets.DISCORD_WEBHOOK }}
|
||||
- name: Notify Discord Failure
|
||||
if: failure()
|
||||
run: |
|
||||
curl -H "Content-Type: application/json" \
|
||||
-X POST \
|
||||
-d '{
|
||||
"embeds": [{
|
||||
"title": "❌ Deployment Failed!",
|
||||
"description": "**Details:**\n- Image: `${{env.IMAGE_NAME}}`\n- Version: `${{ steps.gen_ver.outputs.image_ver }}`\n- Attempted by: `${{github.actor}}`",
|
||||
"color": 15158332,
|
||||
"footer": {
|
||||
"text": "Release Notification",
|
||||
"icon_url": "https://example.com/failure-icon.png"
|
||||
},
|
||||
"timestamp": "'$(date -u +%Y-%m-%dT%H:%M:%SZ)'"
|
||||
}]
|
||||
}' \
|
||||
${{ secrets.DISCORD_WEBHOOK }}
|
||||
|
|
|
|||
|
|
@ -20,88 +20,88 @@ import * as fs from "fs";
|
|||
import * as path from "path";
|
||||
const { createConnection } = require("typeorm");
|
||||
import csvParser from "csv-parser";
|
||||
import { HR_PERSONAL_OFFICER_FAMILY } from "../entities/HR_PERSONAL_OFFICER_FAMILY";
|
||||
import { HR_PERSONAL_OFFICER_FAMILY } from "../entities/mis/HR_PERSONAL_OFFICER_FAMILY";
|
||||
|
||||
const BATCH_SIZE = 1000;
|
||||
// import { EducationMis } from "../entities/EducationMis";
|
||||
import { EducationMis } from "../entities/EducationMis";
|
||||
import { ProvinceImport } from "../entities/ProvinceImport";
|
||||
import { AmphurImport } from "../entities/AmphurImport";
|
||||
import { SubDistrictImport } from "../entities/SubDistrictImport";
|
||||
import { EducationMis } from "../entities/mis/EducationMis";
|
||||
import { ProvinceImport } from "../entities/mis/ProvinceImport";
|
||||
import { AmphurImport } from "../entities/mis/AmphurImport";
|
||||
import { SubDistrictImport } from "../entities/mis/SubDistrictImport";
|
||||
import { Province } from "../entities/Province";
|
||||
import { District } from "../entities/District";
|
||||
import { SubDistrict } from "../entities/SubDistrict";
|
||||
import { HR_EDUCATION } from "../entities/HR_EDUCATION";
|
||||
import { HR_PERSONAL_OFFICER_ADDRESS } from "../entities/HR_PERSONAL_OFFICER_ADDRESS";
|
||||
import { HR_EDUCATION_EMP } from "../entities/HR_EDUCATION_EMP";
|
||||
import { HR_PERSONAL_EMP_ADDRESS } from "../entities/HR_PERSONAL_EMP_ADDRESS";
|
||||
import { HR_PERSONAL_EMP_FAMILY } from "../entities/HR_PERSONAL_EMP_FAMILY";
|
||||
import { HR_EDUCATION } from "../entities/mis/HR_EDUCATION";
|
||||
import { HR_PERSONAL_OFFICER_ADDRESS } from "../entities/mis/HR_PERSONAL_OFFICER_ADDRESS";
|
||||
import { HR_EDUCATION_EMP } from "../entities/mis/HR_EDUCATION_EMP";
|
||||
import { HR_PERSONAL_EMP_ADDRESS } from "../entities/mis/HR_PERSONAL_EMP_ADDRESS";
|
||||
import { HR_PERSONAL_EMP_FAMILY } from "../entities/mis/HR_PERSONAL_EMP_FAMILY";
|
||||
import { OrgRoot } from "../entities/OrgRoot";
|
||||
import { OrgChild1 } from "../entities/OrgChild1";
|
||||
import { OrgChild2 } from "../entities/OrgChild2";
|
||||
import { OrgChild3 } from "../entities/OrgChild3";
|
||||
import { OrgChild4 } from "../entities/OrgChild4";
|
||||
import { IMPORT_ORG } from "../entities/IMPORT_ORG";
|
||||
import { IMPORT_ORG } from "../entities/mis/IMPORT_ORG";
|
||||
import { OrgRevision } from "../entities/OrgRevision";
|
||||
import { OFFICER } from "../entities/OFFICER";
|
||||
import { OFFICER } from "../entities/mis/OFFICER";
|
||||
import { Position } from "../entities/Position";
|
||||
import { PosMaster } from "../entities/PosMaster";
|
||||
import { positionOfficer } from "../entities/positionOfficer";
|
||||
import { PosExecutive } from "../entities/PosExecutive";
|
||||
import { EducationLevel } from "../entities/EducationLevel";
|
||||
import { HR_FUND_COURSE_CODE } from "../entities/HR_FUND_COURSE_CODE";
|
||||
import { HR_MAJOR_CODE } from "../entities/HR_MAJOR_CODE";
|
||||
import { HR_FUND_COURSE_CODE } from "../entities/mis/HR_FUND_COURSE_CODE";
|
||||
import { HR_MAJOR_CODE } from "../entities/mis/HR_MAJOR_CODE";
|
||||
// import { uuidv7 } from "uuidv7";
|
||||
import { ProfileSalaries } from "../entities/ProfileSalaries";
|
||||
import { HR_POSITION_OFFICER } from "../entities/HR_POSITION_OFFICER";
|
||||
import { EMPLOYEE } from "../entities/EMPLOYEE";
|
||||
import { ProfileSalaries } from "../entities/mis/ProfileSalaries";
|
||||
import { HR_POSITION_OFFICER } from "../entities/mis/HR_POSITION_OFFICER";
|
||||
import { EMPLOYEE } from "../entities/mis/EMPLOYEE";
|
||||
import { EmployeePosLevel } from "../entities/EmployeePosLevel";
|
||||
import { EmployeePosType } from "../entities/EmployeePosType";
|
||||
import { EmployeePosMaster } from "../entities/EmployeePosMaster";
|
||||
import { EmployeePosition } from "../entities/EmployeePosition";
|
||||
import { HR_POSITION_EMPLOYEE } from "../entities/HR_POSITION_EMPLOYEE";
|
||||
import { HR_POSITION_EMPLOYEE } from "../entities/mis/HR_POSITION_EMPLOYEE";
|
||||
import { ProfileDiscipline } from "../entities/ProfileDiscipline";
|
||||
import { ProfileInsignia } from "../entities/ProfileInsignia";
|
||||
import { HR_DISCIPLINE_EMP } from "../entities/HR_DISCIPLINE_EMP";
|
||||
import { HR_DISCIPLINE } from "../entities/HR_DISCIPLINE";
|
||||
import { HR_INSIGNIA } from "../entities/HR_INSIGNIA";
|
||||
import { HR_INSIGNIA_EMP } from "../entities/HR_INSIGNIA_EMP";
|
||||
import { HR_DISCIPLINE_EMP } from "../entities/mis/HR_DISCIPLINE_EMP";
|
||||
import { HR_DISCIPLINE } from "../entities/mis/HR_DISCIPLINE";
|
||||
import { HR_INSIGNIA } from "../entities/mis/HR_INSIGNIA";
|
||||
import { HR_INSIGNIA_EMP } from "../entities/mis/HR_INSIGNIA_EMP";
|
||||
import { Insignia } from "../entities/Insignia";
|
||||
import { ProfileChildren } from "../entities/ProfileChildren";
|
||||
import { ProfileChangeName } from "../entities/ProfileChangeName";
|
||||
import { HR_CHILDEN } from "../entities/HR_CHILDEN";
|
||||
import { HR_CHILDEN_EMP } from "../entities/HR_CHILDEN_EMP";
|
||||
import { HR_CHANGENAME } from "../entities/HR_CHANGENAME";
|
||||
import { HR_CHANGENAME_EMP } from "../entities/HR_CHANGENAME_EMP";
|
||||
import { HR_CHILDEN } from "../entities/mis/HR_CHILDEN";
|
||||
import { HR_CHILDEN_EMP } from "../entities/mis/HR_CHILDEN_EMP";
|
||||
import { HR_CHANGENAME } from "../entities/mis/HR_CHANGENAME";
|
||||
import { HR_CHANGENAME_EMP } from "../entities/mis/HR_CHANGENAME_EMP";
|
||||
import { ProfileHonor } from "../entities/ProfileHonor";
|
||||
import { ProfileAbility } from "../entities/ProfileAbility";
|
||||
import { ProfileDuty } from "../entities/ProfileDuty";
|
||||
import { ProfileNopaid } from "../entities/ProfileNopaid";
|
||||
import { ProfileOther } from "../entities/ProfileOther";
|
||||
import { ProfileCertificate } from "../entities/ProfileCertificate";
|
||||
import { ProfileAbilitys } from "../entities/ProfileAbilitys";
|
||||
import { ProfileCertificates } from "../entities/ProfileCertificates";
|
||||
import { ProfileDutys } from "../entities/ProfileDutys";
|
||||
import { ProfileHonors } from "../entities/ProfileHonors";
|
||||
import { ProfileNopaids } from "../entities/ProfileNopaids";
|
||||
import { ProfileOthers } from "../entities/ProfileOthers";
|
||||
import { ProfileDisciplines } from "../entities/ProfileDisciplines";
|
||||
import { ProfileChangeNames } from "../entities/ProfileChangeNames";
|
||||
import { ProfileChildrens } from "../entities/ProfileChildrens";
|
||||
import { ProfileEducations } from "../entities/ProfileEducations";
|
||||
import { ProfileInsignias } from "../entities/ProfileInsignias";
|
||||
import { ProfileAbilitys } from "../entities/mis/ProfileAbilitys";
|
||||
import { ProfileCertificates } from "../entities/mis/ProfileCertificates";
|
||||
import { ProfileDutys } from "../entities/mis/ProfileDutys";
|
||||
import { ProfileHonors } from "../entities/mis/ProfileHonors";
|
||||
import { ProfileNopaids } from "../entities/mis/ProfileNopaids";
|
||||
import { ProfileOthers } from "../entities/mis/ProfileOthers";
|
||||
import { ProfileDisciplines } from "../entities/mis/ProfileDisciplines";
|
||||
import { ProfileChangeNames } from "../entities/mis/ProfileChangeNames";
|
||||
import { ProfileChildrens } from "../entities/mis/ProfileChildrens";
|
||||
import { ProfileEducations } from "../entities/mis/ProfileEducations";
|
||||
import { ProfileInsignias } from "../entities/mis/ProfileInsignias";
|
||||
import { ProfileLeave } from "../entities/ProfileLeave";
|
||||
import { ProfileLeaves } from "../entities/ProfileLeaves";
|
||||
import { ProfileLeaves } from "../entities/mis/ProfileLeaves";
|
||||
import { ProfileSalaryTemp } from "../entities/ProfileSalaryTemp";
|
||||
import { ProfileTraining } from "../entities/ProfileTraining";
|
||||
import { ProfileTrainings } from "../entities/ProfileTrainings";
|
||||
import { EMPLOYEETEMP } from "../entities/EMPLOYEETEMP";
|
||||
import { HR_CHANGENAME_EMPTEMP } from "../entities/HR_CHANGENAME_EMPTEMP";
|
||||
import { HR_DISCIPLINE_EMPTEMP } from "../entities/HR_DISCIPLINE_EMPTEMP";
|
||||
import { HR_EDUCATION_EMPTEMP } from "../entities/HR_EDUCATION_EMPTEMP";
|
||||
import { HR_PERSONAL_EMPTEMP_ADDRESS } from "../entities/HR_PERSONAL_EMPTEMP_ADDRESS";
|
||||
import { HR_PERSONAL_EMPTEMP_FAMILY } from "../entities/HR_PERSONAL_EMPTEMP_FAMILY";
|
||||
import { HR_POSITION_EMPLOYEETEMP } from "../entities/HR_POSITION_EMPLOYEETEMP";
|
||||
import { ProfileTrainings } from "../entities/mis/ProfileTrainings";
|
||||
import { EMPLOYEETEMP } from "../entities/mis/EMPLOYEETEMP";
|
||||
import { HR_CHANGENAME_EMPTEMP } from "../entities/mis/HR_CHANGENAME_EMPTEMP";
|
||||
import { HR_DISCIPLINE_EMPTEMP } from "../entities/mis/HR_DISCIPLINE_EMPTEMP";
|
||||
import { HR_EDUCATION_EMPTEMP } from "../entities/mis/HR_EDUCATION_EMPTEMP";
|
||||
import { HR_PERSONAL_EMPTEMP_ADDRESS } from "../entities/mis/HR_PERSONAL_EMPTEMP_ADDRESS";
|
||||
import { HR_PERSONAL_EMPTEMP_FAMILY } from "../entities/mis/HR_PERSONAL_EMPTEMP_FAMILY";
|
||||
import { HR_POSITION_EMPLOYEETEMP } from "../entities/mis/HR_POSITION_EMPLOYEETEMP";
|
||||
import { positionOfficer } from "../entities/mis/positionOfficer";
|
||||
@Route("api/v1/org/upload")
|
||||
@Tags("UPLOAD")
|
||||
@Security("bearerAuth")
|
||||
|
|
|
|||
|
|
@ -1149,7 +1149,7 @@ export class ProfileController extends Controller {
|
|||
where: {
|
||||
profileId: id,
|
||||
commandCode: In(["5", "6"]),
|
||||
isEntry: false,
|
||||
// isEntry: false,
|
||||
},
|
||||
order: { order: "ASC" },
|
||||
});
|
||||
|
|
@ -1317,15 +1317,11 @@ export class ProfileController extends Controller {
|
|||
.createQueryBuilder("profileLeave")
|
||||
.leftJoinAndSelect("profileLeave.leaveType", "leaveType")
|
||||
.select([
|
||||
"profileLeave.leaveTypeId",
|
||||
"profileLeave.dateLeaveStart",
|
||||
"profileLeave.dateLeaveEnd",
|
||||
"leaveType.name as name",
|
||||
"leaveType.code as code",
|
||||
"profileLeave.status",
|
||||
"profileLeave.profileId",
|
||||
"profileLeave.leaveDays",
|
||||
"profileLeave.reason",
|
||||
"profileLeave.dateLeaveStart AS dateLeaveStart",
|
||||
"profileLeave.dateLeaveEnd AS dateLeaveEnd",
|
||||
"profileLeave.leaveDays AS leaveDays",
|
||||
"profileLeave.reason AS reason",
|
||||
"leaveType.name as name"
|
||||
])
|
||||
.where("profileLeave.profileId = :profileId", { profileId: id })
|
||||
.andWhere("leaveType.code IN (:...codes)", { codes: ["LV-008", "LV-009", "LV-010"] })
|
||||
|
|
@ -1335,13 +1331,12 @@ export class ProfileController extends Controller {
|
|||
const leaves2 =
|
||||
leave2_raw.length > 0
|
||||
? leave2_raw.map((item) => ({
|
||||
date: item.dateLeaveStart
|
||||
? Extension.ToThaiNumber(Extension.ToThaiFullDate2(item.dateLeaveStart))
|
||||
: item.dateLeaveEnd
|
||||
? " - " + Extension.ToThaiNumber(Extension.ToThaiFullDate2(item.dateLeaveEnd))
|
||||
: "",
|
||||
date: item.dateLeaveStart && item.dateLeaveEnd
|
||||
? Extension.ToThaiNumber(Extension.ToThaiFullDate2(item.dateLeaveStart)) + " - "
|
||||
+ Extension.ToThaiNumber(Extension.ToThaiFullDate2(item.dateLeaveEnd))
|
||||
: "-",
|
||||
type: item.name || "-",
|
||||
leaveDays: item.leaveDays ? Extension.ToThaiNumber(item.leaveDays) : "-",
|
||||
leaveDays: item.leaveDays ? Extension.ToThaiNumber(item.leaveDays.toString()) : "-",
|
||||
reason: item.reason || "-",
|
||||
}))
|
||||
: [
|
||||
|
|
@ -1611,7 +1606,7 @@ export class ProfileController extends Controller {
|
|||
where: {
|
||||
profileId: id,
|
||||
commandCode: "7",
|
||||
isEntry: false,
|
||||
// isEntry: false,
|
||||
},
|
||||
order: { order: "ASC" },
|
||||
});
|
||||
|
|
@ -1688,6 +1683,17 @@ export class ProfileController extends Controller {
|
|||
(profiles.currentZipCode ? " " + profiles.currentZipCode : ""),
|
||||
)
|
||||
: "";
|
||||
|
||||
let portfolio:any
|
||||
await new CallAPI()
|
||||
.GetData(req, `/development/portfolio/kk1/${profiles?.keycloak}`)
|
||||
.then((x) => {
|
||||
portfolio = x.result;
|
||||
})
|
||||
.catch(() => {});
|
||||
if (!portfolio)
|
||||
portfolio = [{name: "-", year: "-"}]
|
||||
|
||||
const data = {
|
||||
fullName: `${profiles?.prefix}${profiles?.firstName} ${profiles?.lastName}`,
|
||||
prefix: profiles?.prefix != null ? profiles.prefix : "",
|
||||
|
|
@ -1841,6 +1847,7 @@ export class ProfileController extends Controller {
|
|||
assessments,
|
||||
profileAbility,
|
||||
otherIncome,
|
||||
portfolio
|
||||
};
|
||||
|
||||
return new HttpSuccess({
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ import {
|
|||
Route,
|
||||
Security,
|
||||
Tags,
|
||||
Query
|
||||
} from "tsoa";
|
||||
import { AppDataSource } from "../database/data-source";
|
||||
import HttpSuccess from "../interfaces/http-success";
|
||||
|
|
@ -25,6 +26,7 @@ import {
|
|||
} from "../entities/ProfileDevelopment";
|
||||
import permission from "../interfaces/permission";
|
||||
import { DevelopmentProject } from "../entities/DevelopmentProject";
|
||||
import { In, Brackets } from "typeorm";
|
||||
@Route("api/v1/org/profile-employee/development")
|
||||
@Tags("ProfileDevelopment")
|
||||
@Security("bearerAuth")
|
||||
|
|
@ -48,15 +50,60 @@ export class ProfileDevelopmentEmployeeController extends Controller {
|
|||
}
|
||||
|
||||
@Get("{profileId}")
|
||||
public async getDevelopment(@Path() profileId: string, @Request() req: RequestWithUser) {
|
||||
public async getDevelopment(
|
||||
@Path() profileId: string,
|
||||
@Request() req: RequestWithUser,
|
||||
@Query("page") page: number = 1,
|
||||
@Query("pageSize") pageSize: number = 10,
|
||||
@Query() searchKeyword: string = "",
|
||||
) {
|
||||
let _workflow = await new permission().Workflow(req, profileId, "SYS_REGISTRY_EMP");
|
||||
if (_workflow == false)
|
||||
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_EMP", profileId);
|
||||
const lists = await this.developmentRepository.find({
|
||||
where: { profileEmployeeId: profileId },
|
||||
order: { createdAt: "ASC" },
|
||||
});
|
||||
return new HttpSuccess(lists);
|
||||
const [profileDevelopment, total] = await AppDataSource.getRepository(ProfileDevelopment)
|
||||
.createQueryBuilder("profileDevelopment")
|
||||
.where({ profileEmployeeId: profileId })
|
||||
.andWhere(
|
||||
new Brackets((qb) => {
|
||||
qb.where(
|
||||
searchKeyword != undefined && searchKeyword != null && searchKeyword != ""
|
||||
? "profileDevelopment.name LIKE :keyword"
|
||||
: "1=1",
|
||||
{
|
||||
keyword: `%${searchKeyword}%`,
|
||||
},
|
||||
)
|
||||
.orWhere(
|
||||
searchKeyword != undefined && searchKeyword != null && searchKeyword != ""
|
||||
? "profileDevelopment.developmentTarget LIKE :keyword"
|
||||
: "1=1",
|
||||
{
|
||||
keyword: `%${searchKeyword}%`,
|
||||
},
|
||||
)
|
||||
.orWhere(
|
||||
searchKeyword != undefined && searchKeyword != null && searchKeyword != ""
|
||||
? "profileDevelopment.developmentResults LIKE :keyword"
|
||||
: "1=1",
|
||||
{
|
||||
keyword: `%${searchKeyword}%`,
|
||||
},
|
||||
)
|
||||
.orWhere(
|
||||
searchKeyword != undefined && searchKeyword != null && searchKeyword != ""
|
||||
? "profileDevelopment.developmentReport LIKE :keyword"
|
||||
: "1=1",
|
||||
{
|
||||
keyword: `%${searchKeyword}%`,
|
||||
},
|
||||
);
|
||||
}),
|
||||
)
|
||||
.orderBy("profileDevelopment.createdAt", "ASC")
|
||||
.skip((page - 1) * pageSize)
|
||||
.take(pageSize)
|
||||
.getManyAndCount();
|
||||
return new HttpSuccess({ data: profileDevelopment, total });
|
||||
}
|
||||
|
||||
@Get("history/{developmentId}")
|
||||
|
|
|
|||
|
|
@ -1144,7 +1144,7 @@ export class ProfileEmployeeController extends Controller {
|
|||
where: {
|
||||
profileEmployeeId: id,
|
||||
commandCode: In(["5", "6"]),
|
||||
isEntry: false,
|
||||
// isEntry: false,
|
||||
},
|
||||
order: { order: "ASC" },
|
||||
});
|
||||
|
|
@ -1310,15 +1310,11 @@ export class ProfileEmployeeController extends Controller {
|
|||
.createQueryBuilder("profileLeave")
|
||||
.leftJoinAndSelect("profileLeave.leaveType", "leaveType")
|
||||
.select([
|
||||
"profileLeave.leaveTypeId",
|
||||
"profileLeave.dateLeaveStart",
|
||||
"profileLeave.dateLeaveEnd",
|
||||
"leaveType.name as name",
|
||||
"leaveType.code as code",
|
||||
"profileLeave.status",
|
||||
"profileLeave.profileEmployeeId",
|
||||
"profileLeave.leaveDays",
|
||||
"profileLeave.reason",
|
||||
"profileLeave.dateLeaveStart AS dateLeaveStart",
|
||||
"profileLeave.dateLeaveEnd AS dateLeaveEnd",
|
||||
"profileLeave.leaveDays AS leaveDays",
|
||||
"profileLeave.reason AS reason",
|
||||
"leaveType.name as name"
|
||||
])
|
||||
.where("profileLeave.profileEmployeeId = :profileId", { profileId: id })
|
||||
.andWhere("leaveType.code IN (:...codes)", { codes: ["LV-008", "LV-009", "LV-010"] })
|
||||
|
|
@ -1328,13 +1324,12 @@ export class ProfileEmployeeController extends Controller {
|
|||
const leaves2 =
|
||||
leave2_raw.length > 0
|
||||
? leave2_raw.map((item) => ({
|
||||
date: item.dateLeaveStart
|
||||
? Extension.ToThaiNumber(Extension.ToThaiFullDate2(item.dateLeaveStart))
|
||||
: item.dateLeaveEnd
|
||||
? " - " + Extension.ToThaiNumber(Extension.ToThaiFullDate2(item.dateLeaveEnd))
|
||||
: "",
|
||||
date: item.dateLeaveStart && item.dateLeaveEnd
|
||||
? Extension.ToThaiNumber(Extension.ToThaiFullDate2(item.dateLeaveStart)) + " - "
|
||||
+ Extension.ToThaiNumber(Extension.ToThaiFullDate2(item.dateLeaveEnd))
|
||||
: "-",
|
||||
type: item.name || "-",
|
||||
leaveDays: item.leaveDays ? Extension.ToThaiNumber(item.leaveDays) : "-",
|
||||
leaveDays: item.leaveDays ? Extension.ToThaiNumber(item.leaveDays.toString()) : "-",
|
||||
reason: item.reason || "-",
|
||||
}))
|
||||
: [
|
||||
|
|
@ -1601,7 +1596,7 @@ export class ProfileEmployeeController extends Controller {
|
|||
where: {
|
||||
profileEmployeeId: id,
|
||||
commandCode: "7",
|
||||
isEntry: false,
|
||||
// isEntry: false,
|
||||
},
|
||||
order: { order: "ASC" },
|
||||
});
|
||||
|
|
|
|||
|
|
@ -47,9 +47,7 @@ export const AppDataSource = new DataSource({
|
|||
logging: true,
|
||||
// timezone: "Z",
|
||||
entities:
|
||||
process.env.NODE_ENV !== "production"
|
||||
? ["src/entities/**/*.ts"]
|
||||
: ["dist/entities/**/*{.ts,.js}"],
|
||||
process.env.NODE_ENV !== "production" ? ["src/entities/*.ts"] : ["dist/entities/*{.ts,.js}"],
|
||||
migrations:
|
||||
process.env.NODE_ENV !== "production"
|
||||
? ["src/migration/**/*.ts"]
|
||||
|
|
|
|||
|
|
@ -77,8 +77,8 @@ export class ProfileAbility extends EntityBase {
|
|||
profileEmployeeId: string;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
comment: "ข้อมูลจาก Entry",
|
||||
default: false,
|
||||
})
|
||||
isEntry: boolean;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { Entity, Column } from "typeorm";
|
||||
import { EntityBase } from "./base/Base";
|
||||
import { EntityBase } from "../base/Base";
|
||||
|
||||
@Entity("amphurImport")
|
||||
export class AmphurImport extends EntityBase {
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
import { Entity, Column } from "typeorm";
|
||||
import { EntityBase } from "./base/Base";
|
||||
import { EntityBase } from "../base/Base";
|
||||
|
||||
@Entity("educationMis")
|
||||
export class EducationMis extends EntityBase {
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
import { Entity, Column } from "typeorm";
|
||||
import { EntityBase } from "./base/Base";
|
||||
import { EntityBase } from "../base/Base";
|
||||
|
||||
@Entity("ProfileAbilitys")
|
||||
export class ProfileAbilitys extends EntityBase {
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
import { Entity, Column } from "typeorm";
|
||||
import { EntityBase } from "./base/Base";
|
||||
import { EntityBase } from "../base/Base";
|
||||
|
||||
@Entity("ProfileCertificates")
|
||||
export class ProfileCertificates extends EntityBase {
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
import { Entity, Column } from "typeorm";
|
||||
import { EntityBase } from "./base/Base";
|
||||
import { EntityBase } from "../base/Base";
|
||||
|
||||
@Entity("ProfileChangeNames")
|
||||
export class ProfileChangeNames extends EntityBase {
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
import { Column, Entity } from "typeorm";
|
||||
import { EntityBase } from "./base/Base";
|
||||
import { EntityBase } from "../base/Base";
|
||||
|
||||
@Entity("ProfileChildrens")
|
||||
export class ProfileChildrens extends EntityBase {
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
import { Entity, Column } from "typeorm";
|
||||
import { EntityBase } from "./base/Base";
|
||||
import { EntityBase } from "../base/Base";
|
||||
|
||||
@Entity("ProfileDisciplines")
|
||||
export class ProfileDisciplines extends EntityBase {
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
import { Entity, Column } from "typeorm";
|
||||
import { EntityBase } from "./base/Base";
|
||||
import { EntityBase } from "../base/Base";
|
||||
|
||||
@Entity("ProfileDutys")
|
||||
export class ProfileDutys extends EntityBase {
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
import { Entity, Column } from "typeorm";
|
||||
import { EntityBase } from "./base/Base";
|
||||
import { EntityBase } from "../base/Base";
|
||||
|
||||
@Entity("ProfileEducations")
|
||||
export class ProfileEducations extends EntityBase {
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
import { Entity, Column } from "typeorm";
|
||||
import { EntityBase } from "./base/Base";
|
||||
import { EntityBase } from "../base/Base";
|
||||
|
||||
@Entity("ProfileHonors")
|
||||
export class ProfileHonors extends EntityBase {
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
import { Entity, Column } from "typeorm";
|
||||
import { EntityBase } from "./base/Base";
|
||||
import { EntityBase } from "../base/Base";
|
||||
|
||||
@Entity("ProfileInsignias")
|
||||
export class ProfileInsignias extends EntityBase {
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
import { Entity, Column } from "typeorm";
|
||||
import { EntityBase } from "./base/Base";
|
||||
import { EntityBase } from "../base/Base";
|
||||
|
||||
@Entity("ProfileLeaveSummary")
|
||||
export class ProfileLeaves extends EntityBase {
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
import { Entity, Column } from "typeorm";
|
||||
import { EntityBase } from "./base/Base";
|
||||
import { EntityBase } from "../base/Base";
|
||||
|
||||
@Entity("ProfileNopaids")
|
||||
export class ProfileNopaids extends EntityBase {
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
import { Entity, Column } from "typeorm";
|
||||
import { EntityBase } from "./base/Base";
|
||||
import { EntityBase } from "../base/Base";
|
||||
|
||||
@Entity("ProfileOthers")
|
||||
export class ProfileOthers extends EntityBase {
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
import { Entity, Column, Double } from "typeorm";
|
||||
import { EntityBase } from "./base/Base";
|
||||
import { EntityBase } from "../base/Base";
|
||||
|
||||
@Entity("ProfileSalaries")
|
||||
export class ProfileSalaries extends EntityBase {
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
import { Entity, Column } from "typeorm";
|
||||
import { EntityBase } from "./base/Base";
|
||||
import { EntityBase } from "../base/Base";
|
||||
|
||||
@Entity("ProfileTrainings")
|
||||
export class ProfileTrainings extends EntityBase {
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
import { Entity, Column } from "typeorm";
|
||||
import { EntityBase } from "./base/Base";
|
||||
import { EntityBase } from "../base/Base";
|
||||
|
||||
@Entity("provinceImport")
|
||||
export class ProvinceImport extends EntityBase {
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
import { Entity, Column } from "typeorm";
|
||||
import { EntityBase } from "./base/Base";
|
||||
import { EntityBase } from "../base/Base";
|
||||
|
||||
@Entity("subDistrictImport")
|
||||
export class SubDistrictImport extends EntityBase {
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
34
src/migration/1754401420685-update210720261141.ts
Normal file
34
src/migration/1754401420685-update210720261141.ts
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
import { MigrationInterface, QueryRunner } from "typeorm";
|
||||
|
||||
export class Update2107202611411754401420685 implements MigrationInterface {
|
||||
name = 'Update2107202611411754401420685'
|
||||
|
||||
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(`ALTER TABLE \`commandRecive\` ADD \`posNo\` varchar(255) NULL COMMENT 'เลขที่ตำแหน่ง'`);
|
||||
await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` ADD \`birthDateOld\` datetime NULL COMMENT 'วันเกิดเดิม โดยจะบันทึกเมื่อมีการแก้ไขข้อมูลส่วนตัว'`);
|
||||
await queryRunner.query(`ALTER TABLE \`profileHistory\` ADD \`birthDateOld\` datetime NULL COMMENT 'วันเกิดเดิม โดยจะบันทึกเมื่อมีการแก้ไขข้อมูลส่วนตัว'`);
|
||||
await queryRunner.query(`ALTER TABLE \`profileTraining\` CHANGE \`isEntry\` \`isEntry\` tinyint NOT NULL COMMENT 'ข้อมูลจาก Entry' DEFAULT 0`);
|
||||
await queryRunner.query(`ALTER TABLE \`metaStateOperator\` CHANGE \`createdFullName\` \`createdFullName\` varchar(200) NOT NULL COMMENT 'ชื่อ User ที่สร้างข้อมูล' DEFAULT 'System Administrator'`);
|
||||
await queryRunner.query(`ALTER TABLE \`metaStateOperator\` CHANGE \`lastUpdateFullName\` \`lastUpdateFullName\` varchar(200) NOT NULL COMMENT 'ชื่อ User ที่แก้ไขข้อมูลล่าสุด' DEFAULT 'System Administrator'`);
|
||||
await queryRunner.query(`ALTER TABLE \`metaWorkflow\` CHANGE \`createdFullName\` \`createdFullName\` varchar(200) NOT NULL COMMENT 'ชื่อ User ที่สร้างข้อมูล' DEFAULT 'System Administrator'`);
|
||||
await queryRunner.query(`ALTER TABLE \`metaWorkflow\` CHANGE \`lastUpdateFullName\` \`lastUpdateFullName\` varchar(200) NOT NULL COMMENT 'ชื่อ User ที่แก้ไขข้อมูลล่าสุด' DEFAULT 'System Administrator'`);
|
||||
await queryRunner.query(`ALTER TABLE \`metaState\` CHANGE \`createdFullName\` \`createdFullName\` varchar(200) NOT NULL COMMENT 'ชื่อ User ที่สร้างข้อมูล' DEFAULT 'System Administrator'`);
|
||||
await queryRunner.query(`ALTER TABLE \`metaState\` CHANGE \`lastUpdateFullName\` \`lastUpdateFullName\` varchar(200) NOT NULL COMMENT 'ชื่อ User ที่แก้ไขข้อมูลล่าสุด' DEFAULT 'System Administrator'`);
|
||||
await queryRunner.query(`ALTER TABLE \`profileSalaryHistory\` ADD CONSTRAINT \`FK_f1ded3e1f83ab2437f739a14f38\` FOREIGN KEY (\`profileSalaryId\`) REFERENCES \`profileSalary\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`);
|
||||
}
|
||||
|
||||
public async down(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(`ALTER TABLE \`profileSalaryHistory\` DROP FOREIGN KEY \`FK_f1ded3e1f83ab2437f739a14f38\``);
|
||||
await queryRunner.query(`ALTER TABLE \`metaState\` CHANGE \`lastUpdateFullName\` \`lastUpdateFullName\` varchar(200) NOT NULL COMMENT 'ชื่อ User ที่แก้ไขข้อมูลล่าสุด' DEFAULT 'string'`);
|
||||
await queryRunner.query(`ALTER TABLE \`metaState\` CHANGE \`createdFullName\` \`createdFullName\` varchar(200) NOT NULL COMMENT 'ชื่อ User ที่สร้างข้อมูล' DEFAULT 'string'`);
|
||||
await queryRunner.query(`ALTER TABLE \`metaWorkflow\` CHANGE \`lastUpdateFullName\` \`lastUpdateFullName\` varchar(200) NOT NULL COMMENT 'ชื่อ User ที่แก้ไขข้อมูลล่าสุด' DEFAULT 'string'`);
|
||||
await queryRunner.query(`ALTER TABLE \`metaWorkflow\` CHANGE \`createdFullName\` \`createdFullName\` varchar(200) NOT NULL COMMENT 'ชื่อ User ที่สร้างข้อมูล' DEFAULT 'string'`);
|
||||
await queryRunner.query(`ALTER TABLE \`metaStateOperator\` CHANGE \`lastUpdateFullName\` \`lastUpdateFullName\` varchar(200) NOT NULL COMMENT 'ชื่อ User ที่แก้ไขข้อมูลล่าสุด' DEFAULT 'string'`);
|
||||
await queryRunner.query(`ALTER TABLE \`metaStateOperator\` CHANGE \`createdFullName\` \`createdFullName\` varchar(200) NOT NULL COMMENT 'ชื่อ User ที่สร้างข้อมูล' DEFAULT 'string'`);
|
||||
await queryRunner.query(`ALTER TABLE \`profileTraining\` CHANGE \`isEntry\` \`isEntry\` tinyint NOT NULL DEFAULT '0'`);
|
||||
await queryRunner.query(`ALTER TABLE \`profileHistory\` DROP COLUMN \`birthDateOld\``);
|
||||
await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` DROP COLUMN \`birthDateOld\``);
|
||||
await queryRunner.query(`ALTER TABLE \`commandRecive\` DROP COLUMN \`posNo\``);
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue