Merge branch 'develop' of github.com:Frappet/bma-ehr-organization into develop
This commit is contained in:
commit
eb0f81e943
1 changed files with 48 additions and 32 deletions
|
|
@ -83,6 +83,7 @@ import { OrgChild2 } from "../entities/OrgChild2";
|
|||
import { OrgChild3 } from "../entities/OrgChild3";
|
||||
import { OrgChild4 } from "../entities/OrgChild4";
|
||||
import { ProfileSalaryHistory } from "../entities/ProfileSalaryHistory";
|
||||
import { ProfileAssistance } from "../entities/ProfileAssistance";
|
||||
|
||||
@Route("api/v1/org/profile")
|
||||
@Tags("Profile")
|
||||
|
|
@ -134,6 +135,7 @@ export class ProfileController extends Controller {
|
|||
private profileAssessmentsRepository = AppDataSource.getRepository(ProfileAssessment);
|
||||
private profileAbilityRepo = AppDataSource.getRepository(ProfileAbility);
|
||||
private permissionProflileRepository = AppDataSource.getRepository(PermissionProfile);
|
||||
private profileAssistanceRepository = AppDataSource.getRepository(ProfileAssistance);
|
||||
|
||||
/**
|
||||
* report ประวัติแบบย่อ ข้าราชการ
|
||||
|
|
@ -1073,7 +1075,7 @@ export class ProfileController extends Controller {
|
|||
},
|
||||
];
|
||||
const training_raw = await this.trainingRepository.find({
|
||||
select: ["startDate", "endDate", "place", "department", "name"],
|
||||
select: ["place", "department", "name", "duration"],
|
||||
where: { profileId: id },
|
||||
order: { createdAt: "ASC" },
|
||||
});
|
||||
|
|
@ -1081,36 +1083,21 @@ export class ProfileController extends Controller {
|
|||
training_raw.length > 0
|
||||
? training_raw.map((item) => ({
|
||||
institute: item.department ?? "",
|
||||
start:
|
||||
item.startDate == null
|
||||
? ""
|
||||
: Extension.ToThaiNumber(Extension.ToThaiFullDate2(item.startDate)),
|
||||
end:
|
||||
item.endDate == null
|
||||
? ""
|
||||
: Extension.ToThaiNumber(Extension.ToThaiFullDate2(item.endDate)),
|
||||
date:
|
||||
item.startDate && item.endDate
|
||||
? `${Extension.ToThaiNumber(Extension.ToThaiFullDate2(item.startDate))} - ${Extension.ToThaiNumber(Extension.ToThaiFullDate2(item.endDate))}`
|
||||
: "",
|
||||
level: "",
|
||||
degree: item.name,
|
||||
field: "",
|
||||
degree: item.name ? Extension.ToThaiNumber(item.name) : "",
|
||||
place: item.place ? Extension.ToThaiNumber(item.place) : "",
|
||||
duration: item.duration ? Extension.ToThaiNumber(item.duration) : "",
|
||||
}))
|
||||
: [
|
||||
{
|
||||
institute: "-",
|
||||
start: "-",
|
||||
end: "-",
|
||||
date: "-",
|
||||
level: "-",
|
||||
degree: "-",
|
||||
field: "-",
|
||||
place: "-",
|
||||
duration: "-"
|
||||
},
|
||||
];
|
||||
|
||||
const discipline_raw = await this.disciplineRepository.find({
|
||||
select: ["refCommandDate", "refCommandNo", "detail"],
|
||||
select: ["refCommandDate", "refCommandNo", "detail", "level"],
|
||||
where: { profileId: id },
|
||||
order: { createdAt: "ASC" },
|
||||
});
|
||||
|
|
@ -1251,6 +1238,7 @@ export class ProfileController extends Controller {
|
|||
refCommandDate: item.refCommandDate
|
||||
? Extension.ToThaiNumber(Extension.ToThaiFullDate2(item.refCommandDate))
|
||||
: "",
|
||||
note: item.note ? Extension.ToThaiNumber(item.note) : "",
|
||||
}))
|
||||
: [
|
||||
{
|
||||
|
|
@ -1453,10 +1441,17 @@ export class ProfileController extends Controller {
|
|||
];
|
||||
|
||||
const actposition_raw = await this.profileActpositionRepo.find({
|
||||
select: ["dateStart", "dateEnd", "position"],
|
||||
where: { profileId: id },
|
||||
order: { createdAt: "ASC" },
|
||||
});
|
||||
const actposition =
|
||||
const assistance_raw = await this.profileAssistanceRepository.find({
|
||||
select: ["dateStart", "dateEnd", "commandName", "agency", "document"],
|
||||
where: { profileId: id },
|
||||
order: { createdAt: "ASC" },
|
||||
});
|
||||
|
||||
const _actposition =
|
||||
actposition_raw.length > 0
|
||||
? actposition_raw.map((item) => ({
|
||||
date: item.dateStart
|
||||
|
|
@ -1464,22 +1459,43 @@ export class ProfileController extends Controller {
|
|||
: "" + item.dateEnd
|
||||
? " - " + Extension.ToThaiNumber(Extension.ToThaiFullDate2(item.dateEnd))
|
||||
: "",
|
||||
refCommandDate: item.refCommandDate
|
||||
? Extension.ToThaiNumber(Extension.ToThaiFullDate2(item.refCommandDate))
|
||||
: "",
|
||||
refCommandNo: item.refCommandNo ? Extension.ToThaiNumber(item.refCommandNo) : "",
|
||||
position: item.position,
|
||||
posNo: item.posNo,
|
||||
position: item.position ? Extension.ToThaiNumber(item.position) : "",
|
||||
commandName: "รักษาการในตำแหน่ง",
|
||||
agency: "",
|
||||
document: ""
|
||||
}))
|
||||
: [
|
||||
{
|
||||
date: "-",
|
||||
refCommandDate: "-",
|
||||
refCommandNo: "-",
|
||||
position: "-",
|
||||
posNo: "-",
|
||||
commandName: "-",
|
||||
agency: "-",
|
||||
document: "-"
|
||||
},
|
||||
];
|
||||
const _assistance =
|
||||
assistance_raw.length > 0
|
||||
? assistance_raw.map((item) => ({
|
||||
date: item.dateStart
|
||||
? Extension.ToThaiNumber(Extension.ToThaiFullDate2(item.dateStart))
|
||||
: "" + item.dateEnd
|
||||
? " - " + Extension.ToThaiNumber(Extension.ToThaiFullDate2(item.dateEnd))
|
||||
: "",
|
||||
position: "",
|
||||
commandName: item.commandName ? Extension.ToThaiNumber(item.commandName): "",
|
||||
agency: item.agency ? Extension.ToThaiNumber(item.agency): "",
|
||||
document: item.document ? Extension.ToThaiNumber(item.document): "",
|
||||
}))
|
||||
: [
|
||||
{
|
||||
date: "-",
|
||||
position: "-",
|
||||
commandName: "-",
|
||||
agency: "-",
|
||||
document: "-"
|
||||
},
|
||||
];
|
||||
const actposition = [..._actposition, ..._assistance]
|
||||
const duty_raw = await this.dutyRepository.find({
|
||||
where: { profileId: id },
|
||||
order: { createdAt: "ASC" },
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue