Merge branch 'develop'

* develop:
  migrate #2043
  เฉพาะคำสั่ง C-PM-10 ให้ตัด profilesNotiRequest ที่ส่ง noti ครั้งแรกออก เพราะ UI ปิด Tab นี้
  เฉพาะคำสั่ง C-PM-10 ให้ตัด receiverUserId ที่ส่ง noti ครั้งแรกออก #1995
  fix รายชื่อราชการที่เลื่อนเงินเดือน (isPunish) salary/gen เส้นเก่า
  #2036
This commit is contained in:
Warunee Tamkoo 2025-11-29 10:04:30 +07:00
commit 319933467f
8 changed files with 61 additions and 38 deletions

View file

@ -132,6 +132,8 @@ export class EducationLevelController extends Controller {
"id",
"name",
"rank",
"educationLevel",
"isHigh",
"createdAt",
"lastUpdatedAt",
"createdFullName",
@ -157,6 +159,8 @@ export class EducationLevelController extends Controller {
"id",
"name",
"rank",
"educationLevel",
"isHigh",
"createdAt",
"lastUpdatedAt",
"createdFullName",

View file

@ -280,8 +280,8 @@ export class OrganizationUnauthorizeController extends Controller {
`${new Date(x.date).getFullYear()}-${String(new Date(x.date).getMonth() + 1).padStart(2, "0")}-${String(new Date(x.date).getDate() + 1).padStart(2, "0")}T00:00:00.000Z`,
) <= datePeriodEnd,
).length > 0
? true
: false,
? false
: true,
isSuspension: item.current_holder.dateRetire == null ? false : true,
isAbsent: item.current_holder.profileDisciplines.length > 0 ? true : false,
isLeave: item.current_holder.profileLeaves.length > 0 ? true : false,
@ -740,8 +740,8 @@ export class OrganizationUnauthorizeController extends Controller {
`${new Date(x.date).getFullYear()}-${String(new Date(x.date).getMonth() + 1).padStart(2, "0")}-${String(new Date(x.date).getDate() + 1).padStart(2, "0")}T00:00:00.000Z`,
) <= datePeriodEnd,
).length > 0
? true
: false,
? false
: true,
isSuspension: item.current_holder.dateRetire == null ? false : true,
isAbsent: item.current_holder.profileDisciplines.length > 0 ? true : false,
isLeave: item.current_holder.profileLeaves.length > 0 ? true : false,

View file

@ -3302,10 +3302,7 @@ export class ProfileController extends Controller {
citizenIdDigits[10] * 3 +
citizenIdDigits[11] * 2;
const calStp2 = cal % 11;
let chkDigit = 11 - calStp2;
if (chkDigit >= 10) {
chkDigit = 0;
}
const chkDigit = (11 - calStp2) % 10;
if (citizenIdDigits[12] !== chkDigit) {
throw new HttpError(HttpStatus.NOT_FOUND, "ข้อมูลรหัสบัตรประจำตัวประชาชนไม่ถูกต้อง");
@ -3338,10 +3335,7 @@ export class ProfileController extends Controller {
citizenIdDigits[10] * 3 +
citizenIdDigits[11] * 2;
const calStp2 = cal % 11;
let chkDigit = 11 - calStp2;
if (chkDigit >= 10) {
chkDigit = 0;
}
const chkDigit = (11 - calStp2) % 10;
// else if(chkDigit === 11){
// chkDigit = cal % 10;
// }
@ -3416,10 +3410,7 @@ export class ProfileController extends Controller {
citizenIdDigits[10] * 3 +
citizenIdDigits[11] * 2;
const calStp2 = cal % 11;
let chkDigit = 11 - calStp2;
if (chkDigit >= 10) {
chkDigit = 0;
}
const chkDigit = (11 - calStp2) % 10;
if (citizenIdDigits[12] !== chkDigit) {
throw new HttpError(HttpStatus.NOT_FOUND, "ข้อมูลรหัสบัตรประจำตัวประชาชนไม่ถูกต้อง");
@ -3484,10 +3475,7 @@ export class ProfileController extends Controller {
citizenIdDigits[10] * 3 +
citizenIdDigits[11] * 2;
const calStp2 = cal % 11;
let chkDigit = 11 - calStp2;
if (chkDigit >= 10) {
chkDigit = 0;
}
const chkDigit = (11 - calStp2) % 10;
if (citizenIdDigits[12] !== chkDigit) {
throw new HttpError(HttpStatus.NOT_FOUND, "ข้อมูลรหัสบัตรประจำตัวประชาชนไม่ถูกต้อง");
@ -5249,10 +5237,7 @@ export class ProfileController extends Controller {
citizenIdDigits[10] * 3 +
citizenIdDigits[11] * 2;
const calStp2 = cal % 11;
let chkDigit = 11 - calStp2;
if (chkDigit >= 10) {
chkDigit = 0;
}
const chkDigit = (11 - calStp2) % 10;
if (citizenIdDigits[12] !== chkDigit) {
throw new HttpError(HttpStatus.NOT_FOUND, "ข้อมูลรหัสบัตรประจำตัวประชาชนไม่ถูกต้อง");

View file

@ -1891,10 +1891,7 @@ export class ProfileEmployeeController extends Controller {
citizenIdDigits[10] * 3 +
citizenIdDigits[11] * 2;
const calStp2 = cal % 11;
let chkDigit = 11 - calStp2;
if (chkDigit >= 10) {
chkDigit = 0;
}
const chkDigit = (11 - calStp2) % 10;
if (citizenIdDigits[12] !== chkDigit) {
throw new HttpError(HttpStatus.NOT_FOUND, "ข้อมูลรหัสบัตรประจำตัวประชาชนไม่ถูกต้อง");
@ -1983,10 +1980,7 @@ export class ProfileEmployeeController extends Controller {
citizenIdDigits[10] * 3 +
citizenIdDigits[11] * 2;
const calStp2 = cal % 11;
let chkDigit = 11 - calStp2;
if (chkDigit >= 10) {
chkDigit = 0;
}
const chkDigit = (11 - calStp2) % 10;
if (citizenIdDigits[12] !== chkDigit) {
throw new HttpError(HttpStatus.NOT_FOUND, "ข้อมูลรหัสบัตรประจำตัวประชาชนไม่ถูกต้อง");

View file

@ -17,6 +17,21 @@ export class EducationLevel extends EntityBase {
default: null,
})
rank: number;
@Column({
nullable: true,
comment: "ขีดจำกัดวุฒิการศึกษา",
length: 50,
default: null,
})
educationLevel?: string;
@Column({
nullable: true,
comment: "วุฒิการศึกษาสูงสุด",
default: null,
})
isHigh?: boolean;
}
export class CreateEducationLevel {
@ -25,6 +40,12 @@ export class CreateEducationLevel {
@Column()
rank: number;
@Column()
educationLevel?: string;
@Column()
isHigh?: boolean;
}
export type UpdateEducationLevel = Partial<CreateEducationLevel>;

View file

@ -275,10 +275,7 @@ class Extension {
citizenIdDigits[10] * 3 +
citizenIdDigits[11] * 2;
const calStp2 = cal % 11;
let chkDigit = 11 - calStp2;
if (chkDigit >= 10) {
chkDigit = 0;
}
const chkDigit = (11 - calStp2) % 10;
// if (citizenIdDigits[12] !== chkDigit) {
// throw new HttpError(HttpStatus.NOT_FOUND, "ข้อมูลรหัสบัตรประจำตัวประชาชนไม่ถูกต้อง");

View file

@ -0,0 +1,16 @@
import { MigrationInterface, QueryRunner } from "typeorm";
export class UpdateTableEducationLeaveAddFields1764244579743 implements MigrationInterface {
name = 'UpdateTableEducationLeaveAddFields1764244579743'
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`ALTER TABLE \`educationLevel\` ADD \`educationLevel\` varchar(50) NULL COMMENT 'ขีดจำกัดวุฒิการศึกษา'`);
await queryRunner.query(`ALTER TABLE \`educationLevel\` ADD \`isHigh\` tinyint NULL COMMENT 'วุฒิการศึกษาสูงสุด'`);
}
public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`ALTER TABLE \`educationLevel\` DROP COLUMN \`isHigh\``);
await queryRunner.query(`ALTER TABLE \`educationLevel\` DROP COLUMN \`educationLevel\``);
}
}

View file

@ -445,7 +445,6 @@ async function handler_command_noti(msg: amqp.ConsumeMessage): Promise<boolean>
isSendNotification: true,
}))
: [];
const payloadStr = await PayloadSendNoti(command.id);
const profilesSendRequest = new CallAPI()
.PostData(
@ -475,7 +474,14 @@ async function handler_command_noti(msg: amqp.ConsumeMessage): Promise<boolean>
console.error("Full error object:", error);
});
await Promise.all([profilesNotiRequest, profilesSendRequest]);
/*เฉพาะคำสั่ง C-PM-10 ให้ตัด profilesNotiRequest ที่ส่ง noti ครั้งแรกออก*/
if (command && command.commandType && ["C-PM-10"].includes(command.commandType.code)) {
await Promise.all([profilesSendRequest]);
}
else {
await Promise.all([profilesNotiRequest, profilesSendRequest]);
}
console.log("[AMQ] Send Notification Success");
return true;