Merge branch 'develop' of github.com:Frappet/bma-ehr-organization into develop
This commit is contained in:
commit
c56bf76b71
5 changed files with 48 additions and 14 deletions
|
|
@ -1455,6 +1455,7 @@ export class CommandController extends Controller {
|
||||||
templateDoc: string | null;
|
templateDoc: string | null;
|
||||||
posmasterId: string;
|
posmasterId: string;
|
||||||
positionId: string;
|
positionId: string;
|
||||||
|
commandId?: string | null;
|
||||||
}[];
|
}[];
|
||||||
},
|
},
|
||||||
) {
|
) {
|
||||||
|
|
@ -1464,7 +1465,7 @@ export class CommandController extends Controller {
|
||||||
if (!profile) {
|
if (!profile) {
|
||||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลทะเบียนประวัตินี้");
|
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลทะเบียนประวัตินี้");
|
||||||
}
|
}
|
||||||
|
let _null: any = null;
|
||||||
const dest_item = await this.salaryRepo.findOne({
|
const dest_item = await this.salaryRepo.findOne({
|
||||||
where: { profileId: item.profileId },
|
where: { profileId: item.profileId },
|
||||||
order: { order: "DESC" },
|
order: { order: "DESC" },
|
||||||
|
|
@ -1485,10 +1486,9 @@ export class CommandController extends Controller {
|
||||||
Object.assign(data, { ...item, ...meta });
|
Object.assign(data, { ...item, ...meta });
|
||||||
const history = new ProfileSalaryHistory();
|
const history = new ProfileSalaryHistory();
|
||||||
Object.assign(history, { ...data, id: undefined });
|
Object.assign(history, { ...data, id: undefined });
|
||||||
|
|
||||||
await this.salaryRepo.save(data, { data: req });
|
await this.salaryRepo.save(data, { data: req });
|
||||||
setLogDataDiff(req, { before, after: data });
|
setLogDataDiff(req, { before, after: data });
|
||||||
history.profileSalaryId = data.id;
|
history.commandId = item.commandId??_null;
|
||||||
await this.salaryHistoryRepo.save(history, { data: req });
|
await this.salaryHistoryRepo.save(history, { data: req });
|
||||||
|
|
||||||
const posMaster = await this.posMasterRepository.findOne({
|
const posMaster = await this.posMasterRepository.findOne({
|
||||||
|
|
@ -1573,6 +1573,7 @@ export class CommandController extends Controller {
|
||||||
templateDoc: string | null;
|
templateDoc: string | null;
|
||||||
posmasterId: string;
|
posmasterId: string;
|
||||||
positionId: string;
|
positionId: string;
|
||||||
|
commandId?: string | null;
|
||||||
}[];
|
}[];
|
||||||
},
|
},
|
||||||
) {
|
) {
|
||||||
|
|
@ -1706,6 +1707,7 @@ export class CommandController extends Controller {
|
||||||
isLeave: boolean;
|
isLeave: boolean;
|
||||||
leaveReason?: string | null;
|
leaveReason?: string | null;
|
||||||
dateLeave?: Date | null;
|
dateLeave?: Date | null;
|
||||||
|
commandId?: string | null;
|
||||||
}[];
|
}[];
|
||||||
},
|
},
|
||||||
) {
|
) {
|
||||||
|
|
@ -1857,6 +1859,7 @@ export class CommandController extends Controller {
|
||||||
positionLevel: string | null;
|
positionLevel: string | null;
|
||||||
refCommandNo: string | null;
|
refCommandNo: string | null;
|
||||||
templateDoc: string | null;
|
templateDoc: string | null;
|
||||||
|
commandId?: string | null;
|
||||||
}[];
|
}[];
|
||||||
},
|
},
|
||||||
) {
|
) {
|
||||||
|
|
@ -1978,6 +1981,7 @@ export class CommandController extends Controller {
|
||||||
detail?: string | null;
|
detail?: string | null;
|
||||||
level?: string | null;
|
level?: string | null;
|
||||||
unStigma?: string | null;
|
unStigma?: string | null;
|
||||||
|
commandId?: string | null;
|
||||||
}[];
|
}[];
|
||||||
},
|
},
|
||||||
) {
|
) {
|
||||||
|
|
@ -2092,6 +2096,7 @@ export class CommandController extends Controller {
|
||||||
date?: Date | null;
|
date?: Date | null;
|
||||||
refCommandNo?: string | null;
|
refCommandNo?: string | null;
|
||||||
salaryRef?: string | null;
|
salaryRef?: string | null;
|
||||||
|
commandId?: string | null;
|
||||||
}[];
|
}[];
|
||||||
},
|
},
|
||||||
) {
|
) {
|
||||||
|
|
@ -2171,6 +2176,7 @@ export class CommandController extends Controller {
|
||||||
date?: Date | null;
|
date?: Date | null;
|
||||||
refCommandNo?: string | null;
|
refCommandNo?: string | null;
|
||||||
salaryRef?: string | null;
|
salaryRef?: string | null;
|
||||||
|
commandId?: string | null;
|
||||||
}[];
|
}[];
|
||||||
},
|
},
|
||||||
) {
|
) {
|
||||||
|
|
@ -2208,6 +2214,7 @@ export class CommandController extends Controller {
|
||||||
date: item.date,
|
date: item.date,
|
||||||
refCommandNo: item.refCommandNo,
|
refCommandNo: item.refCommandNo,
|
||||||
templateDoc: item.salaryRef,
|
templateDoc: item.salaryRef,
|
||||||
|
commandId: item.commandId,
|
||||||
position: profile.profileSalary.length > 0 ? profile.profileSalary[0].position : null,
|
position: profile.profileSalary.length > 0 ? profile.profileSalary[0].position : null,
|
||||||
positionType:
|
positionType:
|
||||||
profile.profileSalary.length > 0 ? profile.profileSalary[0].positionType : null,
|
profile.profileSalary.length > 0 ? profile.profileSalary[0].positionType : null,
|
||||||
|
|
@ -2462,6 +2469,7 @@ export class CommandController extends Controller {
|
||||||
refId: string;
|
refId: string;
|
||||||
commandAffectDate: Date | null;
|
commandAffectDate: Date | null;
|
||||||
commandNo: string | null;
|
commandNo: string | null;
|
||||||
|
commandId?: string | null;
|
||||||
commandYear: number;
|
commandYear: number;
|
||||||
templateDoc: string | null;
|
templateDoc: string | null;
|
||||||
amount: Double | null;
|
amount: Double | null;
|
||||||
|
|
@ -2488,6 +2496,7 @@ export class CommandController extends Controller {
|
||||||
profileEmployeeId: profile.id,
|
profileEmployeeId: profile.id,
|
||||||
date: new Date(),
|
date: new Date(),
|
||||||
amount: item.amount,
|
amount: item.amount,
|
||||||
|
commandId: item.commandId,
|
||||||
positionSalaryAmount: item.positionSalaryAmount,
|
positionSalaryAmount: item.positionSalaryAmount,
|
||||||
mouthSalaryAmount: item.mouthSalaryAmount,
|
mouthSalaryAmount: item.mouthSalaryAmount,
|
||||||
posNo: profile.posMasterNoTemp,
|
posNo: profile.posMasterNoTemp,
|
||||||
|
|
@ -2628,6 +2637,7 @@ export class CommandController extends Controller {
|
||||||
refId: string;
|
refId: string;
|
||||||
commandAffectDate: Date | null;
|
commandAffectDate: Date | null;
|
||||||
commandNo: string | null;
|
commandNo: string | null;
|
||||||
|
commandId?: string | null;
|
||||||
commandYear: number;
|
commandYear: number;
|
||||||
templateDoc: string | null;
|
templateDoc: string | null;
|
||||||
amount: Double | null;
|
amount: Double | null;
|
||||||
|
|
@ -2766,6 +2776,7 @@ export class CommandController extends Controller {
|
||||||
refId: string;
|
refId: string;
|
||||||
commandAffectDate: Date | null;
|
commandAffectDate: Date | null;
|
||||||
commandNo: string | null;
|
commandNo: string | null;
|
||||||
|
commandId?: string | null;
|
||||||
commandYear: number;
|
commandYear: number;
|
||||||
templateDoc: string | null;
|
templateDoc: string | null;
|
||||||
amount: Double | null;
|
amount: Double | null;
|
||||||
|
|
@ -2795,6 +2806,7 @@ export class CommandController extends Controller {
|
||||||
profileId: profile.id,
|
profileId: profile.id,
|
||||||
date: new Date(),
|
date: new Date(),
|
||||||
amount: item.amount,
|
amount: item.amount,
|
||||||
|
commandId: item.commandId,
|
||||||
positionSalaryAmount: item.positionSalaryAmount,
|
positionSalaryAmount: item.positionSalaryAmount,
|
||||||
mouthSalaryAmount: item.mouthSalaryAmount,
|
mouthSalaryAmount: item.mouthSalaryAmount,
|
||||||
posNo: "",
|
posNo: "",
|
||||||
|
|
|
||||||
|
|
@ -121,7 +121,6 @@ export class ProfileSalaryController extends Controller {
|
||||||
Object.assign(data, { ...body, ...meta });
|
Object.assign(data, { ...body, ...meta });
|
||||||
const history = new ProfileSalaryHistory();
|
const history = new ProfileSalaryHistory();
|
||||||
Object.assign(history, { ...data, id: undefined });
|
Object.assign(history, { ...data, id: undefined });
|
||||||
|
|
||||||
await this.salaryRepo.save(data, { data: req });
|
await this.salaryRepo.save(data, { data: req });
|
||||||
setLogDataDiff(req, { before, after: data });
|
setLogDataDiff(req, { before, after: data });
|
||||||
history.profileSalaryId = data.id;
|
history.profileSalaryId = data.id;
|
||||||
|
|
|
||||||
|
|
@ -203,6 +203,7 @@ export class CreateProfileSalaryEmployee {
|
||||||
profileEmployeeId: string | null;
|
profileEmployeeId: string | null;
|
||||||
date?: Date | null;
|
date?: Date | null;
|
||||||
amount?: Double | null;
|
amount?: Double | null;
|
||||||
|
commandId: string | null;
|
||||||
positionSalaryAmount?: Double | null;
|
positionSalaryAmount?: Double | null;
|
||||||
mouthSalaryAmount?: Double | null;
|
mouthSalaryAmount?: Double | null;
|
||||||
posNo: string | null;
|
posNo: string | null;
|
||||||
|
|
|
||||||
|
|
@ -233,9 +233,9 @@ export function commandTypePath(commandCode: string): string | null {
|
||||||
case "C-PM-10":
|
case "C-PM-10":
|
||||||
return "/probation/report/command10/officer/report";
|
return "/probation/report/command10/officer/report";
|
||||||
case "C-PM-11":
|
case "C-PM-11":
|
||||||
return "/probation/report/command11/officer/report";
|
return "/probation/report/command11/officer/report";//PROBATION
|
||||||
case "C-PM-12":
|
case "C-PM-12":
|
||||||
return "/probation/report/command12/officer/report";
|
return "/probation/report/command12/officer/report";//PROBATION
|
||||||
case "C-PM-13":
|
case "C-PM-13":
|
||||||
return "/placement/transfer/command/report";
|
return "/placement/transfer/command/report";
|
||||||
case "C-PM-14":
|
case "C-PM-14":
|
||||||
|
|
@ -253,7 +253,7 @@ export function commandTypePath(commandCode: string): string | null {
|
||||||
case "C-PM-20":
|
case "C-PM-20":
|
||||||
return "/discipline/result/command20/report";
|
return "/discipline/result/command20/report";
|
||||||
case "C-PM-21":
|
case "C-PM-21":
|
||||||
return "/org/command/command21/employee/report";
|
return "/org/command/command21/employee/report";//ORG
|
||||||
case "C-PM-22":
|
case "C-PM-22":
|
||||||
return "/placement/appointment/employee-appoint/report";
|
return "/placement/appointment/employee-appoint/report";
|
||||||
case "C-PM-23":
|
case "C-PM-23":
|
||||||
|
|
@ -277,21 +277,21 @@ export function commandTypePath(commandCode: string): string | null {
|
||||||
case "C-PM-32":
|
case "C-PM-32":
|
||||||
return "/discipline/result/command32/report";
|
return "/discipline/result/command32/report";
|
||||||
case "C-PM-33":
|
case "C-PM-33":
|
||||||
return "/salary/report/command/officer/report";
|
return "/salary/report/command/officer/report";//SALARY
|
||||||
case "C-PM-34":
|
case "C-PM-34":
|
||||||
return "/salary/report/command/officer/report";
|
return "/salary/report/command/officer/report";//SALARY
|
||||||
case "C-PM-35":
|
case "C-PM-35":
|
||||||
return "/salary/report/command/officer/report";
|
return "/salary/report/command/officer/report";//SALARY
|
||||||
case "C-PM-36":
|
case "C-PM-36":
|
||||||
return "/salary/report/command/employee/report";
|
return "/salary/report/command/employee/report";//SALARY
|
||||||
case "C-PM-37":
|
case "C-PM-37":
|
||||||
return "/salary/report/command/employee/report";
|
return "/salary/report/command/employee/report";//SALARY
|
||||||
case "C-PM-38":
|
case "C-PM-38":
|
||||||
return "/org/command/command38/officer/report";
|
return "/org/command/command38/officer/report";//ORG
|
||||||
case "C-PM-39":
|
case "C-PM-39":
|
||||||
return "/placement/appointment/slip/report";
|
return "/placement/appointment/slip/report";
|
||||||
case "C-PM-40":
|
case "C-PM-40":
|
||||||
return "/org/command/command40/officer/report";
|
return "/org/command/command40/officer/report";//ORG
|
||||||
case "C-PM-41":
|
case "C-PM-41":
|
||||||
return "/retirement/resign/leave-cancel/report";
|
return "/retirement/resign/leave-cancel/report";
|
||||||
default:
|
default:
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,22 @@
|
||||||
|
import { MigrationInterface, QueryRunner } from "typeorm";
|
||||||
|
|
||||||
|
export class UpdateTableMigration102120241729492903054 implements MigrationInterface {
|
||||||
|
name = 'UpdateTableMigration102120241729492903054'
|
||||||
|
|
||||||
|
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||||
|
await queryRunner.query(`CREATE TABLE \`commandSend\` (\`id\` varchar(36) NOT NULL, \`createdAt\` datetime(6) NOT NULL COMMENT 'สร้างข้อมูลเมื่อ' DEFAULT CURRENT_TIMESTAMP(6), \`createdUserId\` varchar(40) NOT NULL COMMENT 'User Id ที่สร้างข้อมูล' DEFAULT '00000000-0000-0000-0000-000000000000', \`lastUpdatedAt\` datetime(6) NOT NULL COMMENT 'แก้ไขข้อมูลล่าสุดเมื่อ' DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), \`lastUpdateUserId\` varchar(40) NOT NULL COMMENT 'User Id ที่แก้ไขข้อมูล' DEFAULT '00000000-0000-0000-0000-000000000000', \`createdFullName\` varchar(200) NOT NULL COMMENT 'ชื่อ User ที่สร้างข้อมูล' DEFAULT 'string', \`lastUpdateFullName\` varchar(200) NOT NULL COMMENT 'ชื่อ User ที่แก้ไขข้อมูลล่าสุด' DEFAULT 'string', \`citizenId\` varchar(255) NULL COMMENT 'เลขประจำตัวประชาชน', \`prefix\` varchar(255) NULL COMMENT 'คำนำหน้า', \`firstName\` varchar(255) NULL COMMENT 'ชื่อ', \`lastName\` varchar(255) NULL COMMENT 'สกุล', \`position\` varchar(255) NULL COMMENT 'ตำแหน่ง', \`org\` varchar(255) NULL COMMENT 'หน่วยงาน', \`commandId\` varchar(40) NOT NULL COMMENT 'คีย์นอก(FK)ของตาราง command', \`profileId\` varchar(40) NOT NULL COMMENT 'คีย์นอก(FK)ของตาราง profile', PRIMARY KEY (\`id\`)) ENGINE=InnoDB`);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`profileSalaryHistory\` ADD \`commandId\` varchar(40) NULL COMMENT 'คีย์นอก(FK)ของตาราง command'`);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`commandSend\` ADD CONSTRAINT \`FK_71884cff2519003c997c4129374\` FOREIGN KEY (\`commandId\`) REFERENCES \`command\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`commandSend\` ADD CONSTRAINT \`FK_4f257ba4ce200ddc0726156a00d\` FOREIGN KEY (\`profileId\`) REFERENCES \`profile\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`profileSalaryHistory\` ADD CONSTRAINT \`FK_8ba1f49c8315bf86848ebcb29f5\` FOREIGN KEY (\`commandId\`) REFERENCES \`command\`(\`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_8ba1f49c8315bf86848ebcb29f5\``);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`commandSend\` DROP FOREIGN KEY \`FK_4f257ba4ce200ddc0726156a00d\``);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`commandSend\` DROP FOREIGN KEY \`FK_71884cff2519003c997c4129374\``);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`profileSalaryHistory\` DROP COLUMN \`commandId\``);
|
||||||
|
await queryRunner.query(`DROP TABLE \`commandSend\``);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue