fix ข้อมูลตำแหน่ง-เงินเดือน (หน่วยงานที่ออกคำสั่งไม่แสดง) #1394
This commit is contained in:
parent
d4f745c61f
commit
921e23f81a
3 changed files with 245 additions and 9 deletions
|
|
@ -27,6 +27,7 @@ import { TenurePositionOfficer } from "../entities/TenurePositionOfficer";
|
|||
import { TenureLevelOfficer } from "../entities/TenureLevelOfficer";
|
||||
import { TenurePositionEmployee } from "../entities/TenurePositionEmployee";
|
||||
import { TenureLevelEmployee } from "../entities/TenureLevelEmployee";
|
||||
import { Command } from "../entities/Command";
|
||||
@Route("api/v1/org/profile/salary")
|
||||
@Tags("ProfileSalary")
|
||||
@Security("bearerAuth")
|
||||
|
|
@ -39,6 +40,7 @@ export class ProfileSalaryController extends Controller {
|
|||
private positionEmployeeRepo = AppDataSource.getRepository(TenurePositionEmployee);
|
||||
private levelOfficerRepo = AppDataSource.getRepository(TenureLevelOfficer);
|
||||
private levelEmployeeRepo = AppDataSource.getRepository(TenureLevelEmployee);
|
||||
private commandRepository = AppDataSource.getRepository(Command);
|
||||
|
||||
@Get("TenurePositionOfficer")
|
||||
public async cronjobTenurePositionOfficer() {
|
||||
|
|
@ -671,8 +673,24 @@ export class ProfileSalaryController extends Controller {
|
|||
order: { order: "DESC" },
|
||||
});
|
||||
const before = null;
|
||||
let _posNumCodeSit: string = ""
|
||||
const _command = await this.commandRepository.findOne({
|
||||
where: { id: body.commandId ?? "" }
|
||||
});
|
||||
if (_command) {
|
||||
if (_command?.isBangkok == "OFFICE") _posNumCodeSit = "สำนักปลัดกรุงเทพมหานคร"
|
||||
else if (_command?.isBangkok == "BANGKOK") _posNumCodeSit = "กรุงเทพมหานคร"
|
||||
else {
|
||||
let _profileAdmin = await this.profileRepo.findOne({
|
||||
where: { keycloak: _command?.createdUserId.toString()},
|
||||
relations: ["current_holders", "current_holders.orgRoot",]
|
||||
});
|
||||
_posNumCodeSit = _profileAdmin?.current_holders
|
||||
.find(x => x.orgRoot.orgRootName)?.orgRoot.orgRootName ?? ""
|
||||
}
|
||||
}
|
||||
const data = new ProfileSalary();
|
||||
|
||||
data.posNumCodeSit = _posNumCodeSit;
|
||||
const meta = {
|
||||
order: dest_item == null ? 1 : dest_item.order + 1,
|
||||
createdUserId: req.user.sub,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue