ตำแหน่งลูกจ้างชัวคราว

This commit is contained in:
mamoss 2025-04-29 15:33:00 +07:00
parent 137748408f
commit 8d87ba0317
6 changed files with 43 additions and 2875 deletions

View file

@ -1907,7 +1907,9 @@ export class ProfileEmployeeController extends Controller {
: "1=1",
)
.andWhere(
retireType != undefined && retireType != null ? `profileEmployee.leaveType = :retireType` : "1=1",
retireType != undefined && retireType != null
? `profileEmployee.leaveType = :retireType`
: "1=1",
{ retireType: retireType },
)
.andWhere("profileEmployee.employeeClass LIKE :type", {
@ -2033,7 +2035,7 @@ export class ProfileEmployeeController extends Controller {
positionId: _data.positionIdTemp,
posmasterId: _data.posmasterIdTemp,
position: _data.position,
posNo:
posNo:
_data.profileSalary[0].posNoAbb && _data.profileSalary[0].posNo
? _data.profileSalary[0].posNoAbb + _data.profileSalary[0].posNo
: _data.profileSalary[0].posNo || "",
@ -2443,11 +2445,19 @@ export class ProfileEmployeeController extends Controller {
posLevel: _data.posLevel == null ? null : _data.posLevel.posLevelName,
posType: _data.posType == null ? null : _data.posType.posTypeName,
posTypeShortName: _data.posType == null ? null : _data.posType.posTypeShortName,
posLevelTemp: _data.posLevelNameTemp,
posTypeTemp: _data.posTypeNameTemp,
posTypeShortNameTemp: _data.posTypeShortNameTemp,
posLevelId: _data.posLevel == null ? null : _data.posLevel.id,
posTypeId: _data.posType == null ? null : _data.posType.id,
positionId: _data.positionIdTemp,
posmasterId: _data.posmasterIdTemp,
position: _data.position,
positionTemp: _data.positionTemp,
posNo: _data.employeeClass == "TEMP" ? _data.posMasterNoTemp : shortName,
employeeClass: _data.employeeClass == null ? null : _data.employeeClass,
govAge: Extension.CalculateGovAge(_data.dateAppoint, 0, 0),
@ -2518,6 +2528,12 @@ export class ProfileEmployeeController extends Controller {
(_child2 == null ? "" : _child2 + "\n") +
(_child1 == null ? "" : _child1 + "\n") +
(_root == null ? "" : _root),
orgTemp:
(_data.child4Temp == null ? "" : _data.child4Temp + "\n") +
(_data.child3Temp == null ? "" : _data.child3Temp + "\n") +
(_data.child2Temp == null ? "" : _data.child2Temp + "\n") +
(_data.child1Temp == null ? "" : _data.child1Temp + "\n") +
(_data.rootTemp == null ? "" : _data.rootTemp),
};
}),
);
@ -3670,10 +3686,18 @@ export class ProfileEmployeeController extends Controller {
profileEmp.positionFieldTemp = body.positionField;
profileEmp.posTypeIdTemp = String(body.posTypeId);
profileEmp.posTypeNameTemp = body.posTypeName;
if (body.posTypeId != null) {
const posTypeTemp = await this.posTypeRepo.findOne({
where: { id: body.posTypeId },
});
if (posTypeTemp != null) {
profileEmp.posTypeShortNameTemp = posTypeTemp.posTypeShortName;
}
}
profileEmp.posLevelIdTemp = String(body.posLevelId);
profileEmp.posLevelNameTemp = body.posLevelName;
profileEmp.statusTemp = "PENDING";
this.profileRepo.merge(profileEmp, body);
// this.profileRepo.merge(profileEmp, body);
await this.profileRepo.save(profileEmp);
return new HttpSuccess();
}

View file

@ -405,6 +405,14 @@ export class ProfileEmployee extends EntityBase {
})
posTypeNameTemp: string;
@Column({
nullable: true,
comment: "ประเภทชื่อย่อ",
length: 40,
default: null,
})
posTypeShortNameTemp: string;
@Column({
nullable: true,
comment: "id ระดับ",
@ -787,7 +795,7 @@ export class ProfileEmployee extends EntityBase {
@OneToMany(() => StateOperatorUser, (v) => v.profile)
stateOperatorUsers: StateOperatorUser[];
@OneToMany(() => PositionSalaryEditHistory, (v) => v.profileEmployee)
positionSalaryEditHistory: PositionSalaryEditHistory[];

View file

@ -24,7 +24,9 @@ export class ProfileInsignia extends EntityBase {
profileEmployeeId: string;
@Column({
nullable: true,
comment: "ปีที่ยื่นขอ",
default: null,
})
year: number;

View file

@ -5,7 +5,11 @@ import { Insignia } from "./Insignia";
@Entity("profileInsigniaHistory")
export class ProfileInsigniaHistory extends EntityBase {
@Column({ comment: "ปีที่ยื่นขอ" })
@Column({
nullable: true,
comment: "ปีที่ยื่นขอ",
default: null,
})
year: number;
@Column({ nullable: true, length: 20, comment: "ลำดับที่", default: null })

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long