Merge branch 'develop' into dev
All checks were successful
Build & Deploy on Dev / build (push) Successful in 57s
All checks were successful
Build & Deploy on Dev / build (push) Successful in 57s
This commit is contained in:
commit
ad075d5ad3
6 changed files with 5703 additions and 1804 deletions
|
|
@ -1,23 +1,21 @@
|
|||
# Build Stage
|
||||
FROM node:lts-alpine AS build-stage
|
||||
FROM node:20.19.4-alpine AS build-stage
|
||||
|
||||
# Create app directory
|
||||
WORKDIR /app
|
||||
|
||||
# Install app dependencies
|
||||
COPY package*.json ./
|
||||
|
||||
RUN npm ci
|
||||
#RUN npm ci
|
||||
RUN npm install
|
||||
|
||||
# Copy source files and build the app
|
||||
COPY . .
|
||||
RUN npm run build
|
||||
|
||||
# Production Stage
|
||||
FROM node:lts-alpine
|
||||
|
||||
ENV NODE_ENV production
|
||||
USER node
|
||||
FROM node:20.19.4-alpine
|
||||
ENV NODE_ENV=production
|
||||
|
||||
# Create app directory
|
||||
WORKDIR /app
|
||||
|
|
@ -27,7 +25,9 @@ COPY --from=build-stage /app/dist ./dist
|
|||
|
||||
# Install only production dependencies
|
||||
COPY package*.json ./
|
||||
RUN npm ci --production
|
||||
#RUN npm ci --production
|
||||
RUN npm install
|
||||
USER node
|
||||
|
||||
# Define the entrypoint and default command
|
||||
# If you have a custom entrypoint script
|
||||
|
|
|
|||
53
package-lock.json
generated
53
package-lock.json
generated
|
|
@ -5072,39 +5072,6 @@
|
|||
"url": "https://github.com/sponsors/isaacs"
|
||||
}
|
||||
},
|
||||
"node_modules/typeorm-cli/node_modules/iconv-lite": {
|
||||
"version": "0.6.3",
|
||||
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz",
|
||||
"integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==",
|
||||
"optional": true,
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"safer-buffer": ">= 2.1.2 < 3.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/typeorm-cli/node_modules/long": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz",
|
||||
"integrity": "sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==",
|
||||
"optional": true,
|
||||
"peer": true
|
||||
},
|
||||
"node_modules/typeorm-cli/node_modules/lru-cache": {
|
||||
"version": "6.0.0",
|
||||
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz",
|
||||
"integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==",
|
||||
"optional": true,
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"yallist": "^4.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=10"
|
||||
}
|
||||
},
|
||||
"node_modules/typeorm-cli/node_modules/mkdirp": {
|
||||
"version": "0.5.6",
|
||||
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz",
|
||||
|
|
@ -5121,26 +5088,6 @@
|
|||
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
|
||||
"integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w=="
|
||||
},
|
||||
"node_modules/typeorm-cli/node_modules/mysql2": {
|
||||
"version": "2.3.3",
|
||||
"resolved": "https://registry.npmjs.org/mysql2/-/mysql2-2.3.3.tgz",
|
||||
"integrity": "sha512-wxJUev6LgMSgACDkb/InIFxDprRa6T95+VEoR+xPvtngtccNH2dGjEB/fVZ8yg1gWv1510c9CvXuJHi5zUm0ZA==",
|
||||
"optional": true,
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"denque": "^2.0.1",
|
||||
"generate-function": "^2.3.1",
|
||||
"iconv-lite": "^0.6.3",
|
||||
"long": "^4.0.0",
|
||||
"lru-cache": "^6.0.0",
|
||||
"named-placeholders": "^1.1.2",
|
||||
"seq-queue": "^0.0.5",
|
||||
"sqlstring": "^2.3.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 8.0"
|
||||
}
|
||||
},
|
||||
"node_modules/typeorm-cli/node_modules/reflect-metadata": {
|
||||
"version": "0.1.14",
|
||||
"resolved": "https://registry.npmjs.org/reflect-metadata/-/reflect-metadata-0.1.14.tgz",
|
||||
|
|
|
|||
|
|
@ -1559,6 +1559,12 @@ export class CommandController extends Controller {
|
|||
return new HttpSuccess();
|
||||
}
|
||||
|
||||
@Get("cornjob/cronjobUpdateRetirementStatus")
|
||||
async runCronjobUpdateRetirementStatus() {
|
||||
await this.cronjobUpdateRetirementStatus();
|
||||
return new HttpSuccess();
|
||||
}
|
||||
|
||||
/**
|
||||
* API รายละเอียดรายการคำสั่ง tab4 คำสั่ง
|
||||
*
|
||||
|
|
@ -3541,19 +3547,19 @@ export class CommandController extends Controller {
|
|||
profile.lastUpdateFullName = req.user.name;
|
||||
profile.lastUpdatedAt = new Date();
|
||||
const clearProfile = await checkCommandType(String(item.commandId));
|
||||
|
||||
|
||||
//ปั๊มประวัติก่อนลบตำแหน่ง
|
||||
const curRevision = await this.orgRevisionRepo.findOne({
|
||||
where: { orgRevisionIsCurrent: true, orgRevisionIsDraft: false }
|
||||
})
|
||||
where: { orgRevisionIsCurrent: true, orgRevisionIsDraft: false },
|
||||
});
|
||||
|
||||
if(curRevision){
|
||||
if (curRevision) {
|
||||
const curPosMaster = await this.posMasterRepository.findOne({
|
||||
where:{
|
||||
where: {
|
||||
current_holderId: profile.id,
|
||||
orgRevisionId: curRevision.id
|
||||
}
|
||||
})
|
||||
orgRevisionId: curRevision.id,
|
||||
},
|
||||
});
|
||||
if (curPosMaster && clearProfile.LeaveType != "RETIRE_OUT_EMP") {
|
||||
await CreatePosMasterHistoryOfficer(curPosMaster.id, req, "DELETE");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2355,6 +2355,7 @@ export class PositionController extends Controller {
|
|||
.addOrderBy("orgChild3.orgChild3Order", "ASC")
|
||||
.addOrderBy("orgChild4.orgChild4Order", "ASC")
|
||||
.addOrderBy("posMaster.posMasterOrder", "ASC")
|
||||
.addOrderBy("posMaster.posMasterCreatedAt", "ASC")
|
||||
.skip((body.page - 1) * body.pageSize)
|
||||
.take(body.pageSize)
|
||||
.getManyAndCount();
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -1,6 +1,7 @@
|
|||
import { AppDataSource } from "../database/data-source";
|
||||
import { EmployeePosMaster } from "../entities/EmployeePosMaster";
|
||||
import { EmployeeTempPosMaster } from "../entities/EmployeeTempPosMaster";
|
||||
import { OrgRevision } from "../entities/OrgRevision";
|
||||
import { PosMaster } from "../entities/PosMaster";
|
||||
import { PosMasterEmployeeHistory } from "../entities/PosMasterEmployeeHistory";
|
||||
import { PosMasterEmployeeTempHistory } from "../entities/PosMasterEmployeeTempHistory";
|
||||
|
|
@ -17,6 +18,7 @@ export async function CreatePosMasterHistoryOfficer(
|
|||
await AppDataSource.transaction(async (manager) => {
|
||||
const repoPosmaster = manager.getRepository(PosMaster);
|
||||
const repoHistory = manager.getRepository(PosMasterHistory);
|
||||
const repoOrgRevision = manager.getRepository(OrgRevision);
|
||||
|
||||
const pm = await repoPosmaster.findOne({
|
||||
where: { id: posMasterId },
|
||||
|
|
@ -31,11 +33,20 @@ export async function CreatePosMasterHistoryOfficer(
|
|||
"orgChild3",
|
||||
"orgChild4",
|
||||
"current_holder",
|
||||
"next_holder",
|
||||
],
|
||||
});
|
||||
|
||||
if (!pm) return false;
|
||||
if (!pm.ancestorDNA) return false;
|
||||
|
||||
const checkCurrentRevision = await repoOrgRevision.findOne({
|
||||
where:{
|
||||
id: pm.orgRevisionId,
|
||||
orgRevisionIsCurrent: true,
|
||||
orgRevisionIsDraft: false
|
||||
}
|
||||
})
|
||||
const _null: any = null;
|
||||
const h = new PosMasterHistory();
|
||||
const selectedPosition =
|
||||
|
|
@ -44,9 +55,15 @@ export async function CreatePosMasterHistoryOfficer(
|
|||
: null;
|
||||
h.ancestorDNA = pm.ancestorDNA ? pm.ancestorDNA : _null;
|
||||
if(!type || type != "DELETE"){
|
||||
h.prefix = pm.current_holder?.prefix || _null;
|
||||
h.firstName = pm.current_holder?.firstName || _null;
|
||||
h.lastName = pm.current_holder?.lastName || _null;
|
||||
if(checkCurrentRevision){
|
||||
h.prefix = pm.current_holder?.prefix || _null;
|
||||
h.firstName = pm.current_holder?.firstName || _null;
|
||||
h.lastName = pm.current_holder?.lastName || _null;
|
||||
}else{
|
||||
h.prefix = pm.next_holder?.prefix || _null;
|
||||
h.firstName = pm.next_holder?.firstName || _null;
|
||||
h.lastName = pm.next_holder?.lastName || _null;
|
||||
}
|
||||
h.position = selectedPosition?.positionName ?? _null;
|
||||
h.posType = selectedPosition?.posType?.posTypeName ?? _null;
|
||||
h.posLevel = selectedPosition?.posLevel?.posLevelName ?? _null;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue