Merge branch 'develop' into adiDev

This commit is contained in:
AdisakKanthawilang 2025-03-28 13:59:16 +07:00
commit 90d92f8d20
3 changed files with 49 additions and 12 deletions

View file

@ -337,6 +337,8 @@ export class OrgChild1Controller {
orgChild1Name: requestBody.orgChild1Name,
orgChild1ShortName: requestBody.orgChild1ShortName,
orgChild1Code: requestBody.orgChild1Code,
orgChild1Rank: requestBody.orgChild1Rank != null ? requestBody.orgChild1Rank : _null,
orgChild1RankSub: requestBody.orgChild1RankSub,
DEPARTMENT_CODE: requestBody.DEPARTMENT_CODE != null ? requestBody.DEPARTMENT_CODE : _null,
DIVISION_CODE: requestBody.DIVISION_CODE != null ? requestBody.DIVISION_CODE : _null,
SECTION_CODE: requestBody.SECTION_CODE != null ? requestBody.SECTION_CODE : _null,

View file

@ -7560,13 +7560,24 @@ export class OrganizationController extends Controller {
*/
@Get("root/search/sort")
async searchSortRootLevelType(@Request() request: RequestWithUser) {
const root = await this.orgRootRepository.find({
const root1 = await this.orgRootRepository.find({
where: {
orgRevision: { orgRevisionIsDraft: false, orgRevisionIsCurrent: true },
DEPARTMENT_CODE: Not("50"),
},
order: { isDeputy: "DESC", DEPARTMENT_CODE: "ASC", orgRootName: "ASC" },
order: { isDeputy: "DESC", orgRootOrder: "ASC" },
select: ["orgRootName"],
});
const root2 = await this.orgRootRepository.find({
where: {
orgRevision: { orgRevisionIsDraft: false, orgRevisionIsCurrent: true },
DEPARTMENT_CODE: "50",
},
order: { orgRootName: "ASC" },
select: ["orgRootName"],
});
const root = [...root1, ...root2];
const child1 = await this.child1Repository.find({
where: {
orgRevision: { orgRevisionIsDraft: false, orgRevisionIsCurrent: true },

View file

@ -274,6 +274,12 @@ export class OrganizationDotnetController extends Controller {
async GetProfileByKeycloakIdAsync(@Path() keycloakId: string) {
const profile = await this.profileRepo.findOne({
relations: [
"registrationProvince",
"registrationDistrict",
"registrationSubDistrict",
"currentProvince",
"currentDistrict",
"currentSubDistrict",
"posLevel",
"posType",
"profileSalary",
@ -303,6 +309,12 @@ export class OrganizationDotnetController extends Controller {
if (!profile) {
const profile = await this.profileEmpRepo.findOne({
relations: [
"registrationProvince",
"registrationDistrict",
"registrationSubDistrict",
"currentProvince",
"currentDistrict",
"currentSubDistrict",
"posLevel",
"posType",
"profileSalary",
@ -524,10 +536,17 @@ export class OrganizationDotnetController extends Controller {
registrationProvinceId: profile.registrationProvinceId,
registrationDistrictId: profile.registrationDistrictId,
registrationSubDistrictId: profile.registrationSubDistrictId,
registrationProvince: profile.registrationProvince.name,
registrationDistrict: profile.registrationDistrict.name,
registrationSubDistrict: profile.registrationSubDistrict.name,
registrationZipCode: profile.registrationZipCode,
currentAddress: profile.currentAddress,
currentProvinceId: profile.currentProvinceId,
currentDistrictId: profile.currentDistrictId,
currentSubDistrictId: profile.currentSubDistrictId,
currentProvince: profile.currentProvince.name,
currentDistrict: profile.currentDistrict.name,
currentSubDistrict: profile.currentSubDistrict.name,
currentZipCode: profile.currentZipCode,
dutyTimeId: profile.dutyTimeId,
dutyTimeEffectiveDate: profile.dutyTimeEffectiveDate,
@ -810,10 +829,17 @@ export class OrganizationDotnetController extends Controller {
registrationProvinceId: profile.registrationProvinceId,
registrationDistrictId: profile.registrationDistrictId,
registrationSubDistrictId: profile.registrationSubDistrictId,
registrationProvince: profile.registrationProvince.id,
registrationDistrict: profile.registrationDistrict.id,
registrationSubDistrict: profile.registrationSubDistrict.id,
registrationZipCode: profile.registrationZipCode,
currentAddress: profile.currentAddress,
currentProvinceId: profile.currentProvinceId,
currentDistrictId: profile.currentDistrictId,
currentSubDistrictId: profile.currentSubDistrictId,
currentProvince: profile.currentProvince.id,
currentDistrict: profile.currentDistrict.id,
currentSubDistrict: profile.currentSubDistrict.id,
currentZipCode: profile.currentZipCode,
dutyTimeId: profile.dutyTimeId,
dutyTimeEffectiveDate: profile.dutyTimeEffectiveDate,
@ -3319,12 +3345,11 @@ export class OrganizationDotnetController extends Controller {
where: { orgRevisionIsCurrent: true },
});
if(body.revisionId){
if (body.revisionId) {
findRevision = await this.orgRevisionRepo.findOne({
where: { id: body.revisionId },
});
}
const profile_ = await Promise.all(
profile.map((item: Profile) => {
@ -3490,12 +3515,11 @@ export class OrganizationDotnetController extends Controller {
where: { orgRevisionIsCurrent: true },
});
if(body.revisionId){
if (body.revisionId) {
findRevision = await this.orgRevisionRepo.findOne({
where: { id: body.revisionId },
});
}
const profile_ = await Promise.all(
profile.map((item: Profile) => {
@ -3638,11 +3662,11 @@ export class OrganizationDotnetController extends Controller {
],
});
let findRevision = await this.orgRevisionRepo.findOne({
let findRevision = await this.orgRevisionRepo.findOne({
where: { orgRevisionIsCurrent: true },
});
if(body.revisionId){
if (body.revisionId) {
findRevision = await this.orgRevisionRepo.findOne({
where: { id: body.revisionId },
});
@ -3791,11 +3815,11 @@ export class OrganizationDotnetController extends Controller {
],
});
let findRevision = await this.orgRevisionRepo.findOne({
let findRevision = await this.orgRevisionRepo.findOne({
where: { orgRevisionIsCurrent: true },
});
if(body.revisionId){
if (body.revisionId) {
findRevision = await this.orgRevisionRepo.findOne({
where: { id: body.revisionId },
});