no message
This commit is contained in:
parent
3d8b66d3cc
commit
25a7a8e1a8
4 changed files with 65 additions and 1 deletions
|
|
@ -2759,6 +2759,25 @@ export class CommandController extends Controller {
|
|||
) {
|
||||
return new HttpSuccess();
|
||||
}
|
||||
@Post("command38/officer/report/delete")
|
||||
public async command38SalaryOfficerDelete(
|
||||
@Request() req: RequestWithUser,
|
||||
@Body()
|
||||
body: {
|
||||
refIds: {
|
||||
refId: string;
|
||||
commandAffectDate: Date | null;
|
||||
commandNo: string | null;
|
||||
commandYear: number;
|
||||
templateDoc: string | null;
|
||||
amount: Double | null;
|
||||
positionSalaryAmount: Double | null;
|
||||
mouthSalaryAmount: Double | null;
|
||||
}[];
|
||||
},
|
||||
) {
|
||||
return new HttpSuccess();
|
||||
}
|
||||
|
||||
commandTypePath(commandCode: string) {
|
||||
switch (commandCode) {
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ import { Profile } from "../entities/Profile";
|
|||
import { CreateProfileEdit, EditProfileEdit, ProfileEdit } from "../entities/ProfileEdit";
|
||||
import { RequestWithUser } from "../middlewares/user";
|
||||
import { Brackets } from "typeorm";
|
||||
import CallAPI from "../interfaces/call-api";
|
||||
|
||||
@Route("api/v1/org/profile/edit")
|
||||
@Tags("ProfileEdit")
|
||||
|
|
@ -184,7 +185,10 @@ export class ProfileEditController extends Controller {
|
|||
|
||||
@Post()
|
||||
public async newProfileEdit(@Request() req: RequestWithUser, @Body() body: CreateProfileEdit) {
|
||||
const profile = await this.profileRepo.findOneBy({ keycloak: req.user.sub });
|
||||
const profile = await this.profileRepo.findOne({
|
||||
where: { keycloak: req.user.sub },
|
||||
relations: ["posLevel", "posLevel.posLevelName", "posType", "posType.posTypeName"],
|
||||
});
|
||||
if (!profile) {
|
||||
throw new HttpError(HttpStatus.BAD_REQUEST, "ไม่พบ profile ดังกล่าว");
|
||||
}
|
||||
|
|
@ -203,6 +207,17 @@ export class ProfileEditController extends Controller {
|
|||
data.status = "PENDING";
|
||||
await this.profileEditRepo.save(data);
|
||||
|
||||
await new CallAPI()
|
||||
.PostData(req, "/org/workflow/add-workflow", {
|
||||
refId: data.id,
|
||||
sysName: "REGISTRY_PROFILE",
|
||||
posLevelName: profile.posLevel.posLevelName,
|
||||
posTypeName: profile.posType.posTypeName,
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error("Error calling API:", error);
|
||||
});
|
||||
|
||||
return new HttpSuccess(data.id);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -141,6 +141,20 @@ export class ProfileSalary extends EntityBase {
|
|||
})
|
||||
order: number;
|
||||
|
||||
@Column({
|
||||
comment: "วันที่",
|
||||
type: "datetime",
|
||||
nullable: true,
|
||||
})
|
||||
dateGovernment: Date;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "เข้ารับราชการ",
|
||||
default: null,
|
||||
})
|
||||
isGovernment: boolean;
|
||||
|
||||
@OneToMany(() => ProfileSalaryHistory, (profileSalaryHistory) => profileSalaryHistory.histories)
|
||||
profileSalaryHistories: ProfileSalaryHistory[];
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,16 @@
|
|||
import { MigrationInterface, QueryRunner } from "typeorm";
|
||||
|
||||
export class UpdateProfilesalaryDateGovernment1729159077554 implements MigrationInterface {
|
||||
name = 'UpdateProfilesalaryDateGovernment1729159077554'
|
||||
|
||||
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(`ALTER TABLE \`profileSalary\` ADD \`dateGovernment\` datetime NULL COMMENT 'วันที่'`);
|
||||
await queryRunner.query(`ALTER TABLE \`profileSalary\` ADD \`isGovernment\` tinyint NULL COMMENT 'เข้ารับราชการ'`);
|
||||
}
|
||||
|
||||
public async down(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(`ALTER TABLE \`profileSalary\` DROP COLUMN \`isGovernment\``);
|
||||
await queryRunner.query(`ALTER TABLE \`profileSalary\` DROP COLUMN \`dateGovernment\``);
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue