add command code 20
All checks were successful
Build & Deploy on Dev / build (push) Successful in 1m3s
All checks were successful
Build & Deploy on Dev / build (push) Successful in 1m3s
This commit is contained in:
parent
b1210d51e8
commit
757da877f6
8 changed files with 268 additions and 218 deletions
|
|
@ -30,7 +30,7 @@ import {
|
|||
UpdateProfileFather,
|
||||
UpdateProfileMother,
|
||||
UpdateProfileCouple,
|
||||
UpdatePrivacyDto
|
||||
UpdatePrivacyDto,
|
||||
} from "../entities/Profile";
|
||||
import { Brackets, In, IsNull, Like, Not } from "typeorm";
|
||||
import { OrgRevision } from "../entities/OrgRevision";
|
||||
|
|
@ -280,7 +280,7 @@ export class ProfileController extends Controller {
|
|||
// ],
|
||||
where: {
|
||||
profileId: id,
|
||||
commandCode: In(["1", "2", "3", "4", "8", "10", "11", "12", "15", "16"]),
|
||||
commandCode: In(["1", "2", "3", "4", "8", "10", "11", "12", "15", "16", "20"]),
|
||||
},
|
||||
order: { order: "ASC" },
|
||||
});
|
||||
|
|
@ -1428,7 +1428,7 @@ export class ProfileController extends Controller {
|
|||
const position_raw = await this.salaryRepo.find({
|
||||
where: {
|
||||
profileId: id,
|
||||
commandCode: In(["1", "2", "3", "4", "8", "10", "11", "12", "15", "16"]),
|
||||
commandCode: In(["1", "2", "3", "4", "8", "10", "11", "12", "15", "16", "20"]),
|
||||
isEntry: false,
|
||||
},
|
||||
order: { order: "ASC" },
|
||||
|
|
@ -5186,7 +5186,7 @@ export class ProfileController extends Controller {
|
|||
@Put("privacy")
|
||||
async updatePrivacy(
|
||||
@Request() request: { user: Record<string, any> },
|
||||
@Body() body: UpdatePrivacyDto
|
||||
@Body() body: UpdatePrivacyDto,
|
||||
) {
|
||||
let isEmployee = false;
|
||||
let profile: any = null;
|
||||
|
|
@ -5220,15 +5220,12 @@ export class ProfileController extends Controller {
|
|||
break;
|
||||
|
||||
default:
|
||||
throw new HttpError(
|
||||
HttpStatus.BAD_REQUEST,
|
||||
"system ไม่ถูกต้อง"
|
||||
);
|
||||
throw new HttpError(HttpStatus.BAD_REQUEST, "system ไม่ถูกต้อง");
|
||||
}
|
||||
profile.lastUpdateUserId = request.user.sub;
|
||||
profile.lastUpdateFullName = request.user.name;
|
||||
profile.lastUpdatedAt = new Date();
|
||||
|
||||
|
||||
if (isEmployee) {
|
||||
await this.profileEmpRepo.save(profile, { data: request });
|
||||
} else {
|
||||
|
|
@ -7418,7 +7415,7 @@ export class ProfileController extends Controller {
|
|||
posNo: null,
|
||||
privacyCheckin: profile.privacyCheckin,
|
||||
privacyUser: profile.privacyUser,
|
||||
privacyMgt : profile.privacyMgt,
|
||||
privacyMgt: profile.privacyMgt,
|
||||
isDeputy: root?.isDeputy ?? false,
|
||||
// root?.orgRootShortName && posMaster?.posMasterNo
|
||||
// ? `${root?.orgRootShortName} ${posMaster?.posMasterNo}`
|
||||
|
|
@ -7591,7 +7588,7 @@ export class ProfileController extends Controller {
|
|||
posNo: null,
|
||||
privacyCheckin: profile.privacyCheckin,
|
||||
privacyUser: profile.privacyUser,
|
||||
privacyMgt : profile.privacyMgt,
|
||||
privacyMgt: profile.privacyMgt,
|
||||
isDeputy: root?.isDeputy ?? false,
|
||||
// root?.orgRootShortName && posMaster?.posMasterNo
|
||||
// ? `${root?.orgRootShortName} ${posMaster?.posMasterNo}`
|
||||
|
|
@ -10940,12 +10937,12 @@ export class ProfileController extends Controller {
|
|||
.skip((page - 1) * pageSize)
|
||||
.take(pageSize)
|
||||
.getManyAndCount();
|
||||
|
||||
|
||||
const mapDataProfile = await Promise.all(
|
||||
findProfile.map(async (item: Profile) => {
|
||||
const fullName = `${item.prefix} ${item.firstName} ${item.lastName}`;
|
||||
let shortName = null;
|
||||
let root = null;
|
||||
let root = null;
|
||||
let posMasterNo = null;
|
||||
if (item.isLeave == false) {
|
||||
shortName =
|
||||
|
|
@ -10956,14 +10953,15 @@ export class ProfileController extends Controller {
|
|||
null
|
||||
? `${item.current_holders.find((x) => x.orgRevisionId == findRevision.id)?.orgChild4.orgChild4ShortName} ${item.current_holders.find((x) => x.orgRevisionId == findRevision.id)?.posMasterNo}`
|
||||
: item.current_holders.find((x) => x.orgRevisionId == findRevision.id) != null &&
|
||||
item.current_holders.find((x) => x.orgRevisionId == findRevision.id)?.orgChild3 !=
|
||||
null
|
||||
item.current_holders.find((x) => x.orgRevisionId == findRevision.id)
|
||||
?.orgChild3 != null
|
||||
? `${item.current_holders.find((x) => x.orgRevisionId == findRevision.id)?.orgChild3.orgChild3ShortName} ${item.current_holders.find((x) => x.orgRevisionId == findRevision.id)?.posMasterNo}`
|
||||
: item.current_holders.find((x) => x.orgRevisionId == findRevision.id) != null &&
|
||||
item.current_holders.find((x) => x.orgRevisionId == findRevision.id)
|
||||
?.orgChild2 != null
|
||||
? `${item.current_holders.find((x) => x.orgRevisionId == findRevision.id)?.orgChild2.orgChild2ShortName} ${item.current_holders.find((x) => x.orgRevisionId == findRevision.id)?.posMasterNo}`
|
||||
: item.current_holders.find((x) => x.orgRevisionId == findRevision.id) != null &&
|
||||
: item.current_holders.find((x) => x.orgRevisionId == findRevision.id) !=
|
||||
null &&
|
||||
item.current_holders.find((x) => x.orgRevisionId == findRevision.id)
|
||||
?.orgChild1 != null
|
||||
? `${item.current_holders.find((x) => x.orgRevisionId == findRevision.id)?.orgChild1.orgChild1ShortName} ${item.current_holders.find((x) => x.orgRevisionId == findRevision.id)?.posMasterNo}`
|
||||
|
|
@ -10983,21 +10981,36 @@ export class ProfileController extends Controller {
|
|||
posMasterNo = item.current_holders?.find(
|
||||
(x) => x.orgRevisionId == findRevision.id,
|
||||
)?.posMasterNo;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
const profileSalary = await this.salaryRepo
|
||||
.createQueryBuilder("s")
|
||||
.where("s.profileId = :profileId", { profileId: item.id })
|
||||
.andWhere("s.commandCode IN (:...codes)", {
|
||||
codes: ["0","9","1","2","3","4","8","10","11","12","13","14","15","16"],
|
||||
codes: [
|
||||
"0",
|
||||
"9",
|
||||
"1",
|
||||
"2",
|
||||
"3",
|
||||
"4",
|
||||
"8",
|
||||
"10",
|
||||
"11",
|
||||
"12",
|
||||
"13",
|
||||
"14",
|
||||
"15",
|
||||
"16",
|
||||
"20",
|
||||
],
|
||||
})
|
||||
.orderBy("s.order", "DESC")
|
||||
.addOrderBy("s.createdAt", "DESC")
|
||||
.take(2)
|
||||
.getMany();
|
||||
if (profileSalary.length > 0) {
|
||||
shortName = item.isRetirement
|
||||
? profileSalary.length > 1
|
||||
shortName = item.isRetirement
|
||||
? profileSalary.length > 1
|
||||
? `${profileSalary[1]?.posNoAbb} ${profileSalary[1]?.posNo}`
|
||||
: `${profileSalary[0]?.posNoAbb} ${profileSalary[0]?.posNo}`
|
||||
: `${profileSalary[0]?.posNoAbb} ${profileSalary[0]?.posNo}`;
|
||||
|
|
@ -11006,7 +11019,7 @@ export class ProfileController extends Controller {
|
|||
? profileSalary[1]?.posNo
|
||||
: profileSalary[0]?.posNo
|
||||
: profileSalary[0]?.posNo;
|
||||
root = item.isRetirement
|
||||
root = item.isRetirement
|
||||
? profileSalary.length > 1
|
||||
? profileSalary[1]?.orgRoot
|
||||
: profileSalary[0]?.orgRoot
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue