edit name null_

This commit is contained in:
kittapath 2025-03-10 09:52:50 +07:00
parent fb96c44753
commit ed111475f8
6 changed files with 171 additions and 135 deletions

View file

@ -1165,10 +1165,10 @@ export class ProfileController extends Controller {
"amount",
"remark",
],
where: {
where: {
profileId: id,
commandCode: In(["5","6"]),
isEntry: false
commandCode: In(["5", "6"]),
isEntry: false,
},
order: { order: "ASC" },
});
@ -1326,11 +1326,11 @@ export class ProfileController extends Controller {
];
const position_raw = await this.salaryRepo.find({
where: {
where: {
profileId: id,
commandCode: In(["1", "2", "3", "4", "8", "10", "11", "12", "15", "16"]),
isEntry: false
},
isEntry: false,
},
order: { order: "ASC" },
});
const positionList =
@ -1457,48 +1457,83 @@ export class ProfileController extends Controller {
const profileAbility =
profileAbility_raw.length > 0
? profileAbility_raw.map((item) => ({
field: item.field?item.field:"",
detail: item.detail?item.detail:"",
}))
: [
{
field: "-",
detail: "-",
},
];
field: item.field ? item.field : "",
detail: item.detail ? item.detail : "",
}))
: [
{
field: "-",
detail: "-",
},
];
const otherIncome_raw = await this.salaryRepo.find({
where: {
profileId: id,
commandCode: "7",
isEntry: false
},
order: { order: "ASC" },
});
const otherIncome =
const otherIncome_raw = await this.salaryRepo.find({
where: {
profileId: id,
commandCode: "7",
isEntry: false,
},
order: { order: "ASC" },
});
const otherIncome =
otherIncome_raw.length > 0
? otherIncome_raw.map((item) => ({
commandDateAffect: item.commandDateAffect?Extension.ToThaiNumber(Extension.ToThaiFullDate2(item.commandDateAffect)):"",
commandDateSign: item.commandDateSign?Extension.ToThaiNumber(Extension.ToThaiFullDate2(item.commandDateSign)):"",
commandNo: item.commandNo?Extension.ToThaiNumber(item.commandNo):"",
position: item.positionName,
posLevel: item.positionLevel?Extension.ToThaiNumber(item.positionLevel):"",
amount: item.amount?Extension.ToThaiNumber(Number(item.amount).toLocaleString()):"",
}))
: [
{
commandDateAffect: "-",
commandDateSign: "-",
commandNo: "-",
position: "-",
posLevel: "-",
amount: "-",
},
];
? otherIncome_raw.map((item) => ({
commandDateAffect: item.commandDateAffect
? Extension.ToThaiNumber(Extension.ToThaiFullDate2(item.commandDateAffect))
: "",
commandDateSign: item.commandDateSign
? Extension.ToThaiNumber(Extension.ToThaiFullDate2(item.commandDateSign))
: "",
commandNo: item.commandNo ? Extension.ToThaiNumber(item.commandNo) : "",
position: item.positionName,
posLevel: item.positionLevel ? Extension.ToThaiNumber(item.positionLevel) : "",
amount: item.amount ? Extension.ToThaiNumber(Number(item.amount).toLocaleString()) : "",
}))
: [
{
commandDateAffect: "-",
commandDateSign: "-",
commandNo: "-",
position: "-",
posLevel: "-",
amount: "-",
},
];
const sum = profiles?Extension.ToThaiNumber((Number(profiles.amount) + Number(profiles.positionSalaryAmount) + Number(profiles.mouthSalaryAmount) + Number(profiles.amountSpecial)).toLocaleString()):"";
const fullCurrentAddress = profiles?Extension.ToThaiNumber(profiles.currentAddress + " ตำบล/แขวง " + profiles.currentSubDistrict.name + " อำเภอ/เขต " + profiles.currentDistrict.name + " จังหวัด " + profiles.currentProvince.name + profiles.currentZipCode):"";
const fullRegistrationAddress = profiles?Extension.ToThaiNumber(profiles.registrationAddress + " ตำบล/แขวง " + profiles.registrationSubDistrict.name + " อำเภอ/เขต " + profiles.registrationDistrict.name + " จังหวัด " + profiles.registrationProvince.name + profiles.registrationZipCode):"";
const sum = profiles
? Extension.ToThaiNumber(
(
Number(profiles.amount) +
Number(profiles.positionSalaryAmount) +
Number(profiles.mouthSalaryAmount) +
Number(profiles.amountSpecial)
).toLocaleString(),
)
: "";
const fullCurrentAddress = profiles
? Extension.ToThaiNumber(
profiles.currentAddress +
" ตำบล/แขวง " +
profiles.currentSubDistrict.name +
" อำเภอ/เขต " +
profiles.currentDistrict.name +
" จังหวัด " +
profiles.currentProvince.name +
profiles.currentZipCode,
)
: "";
const fullRegistrationAddress = profiles
? Extension.ToThaiNumber(
profiles.registrationAddress +
" ตำบล/แขวง " +
profiles.registrationSubDistrict.name +
" อำเภอ/เขต " +
profiles.registrationDistrict.name +
" จังหวัด " +
profiles.registrationProvince.name +
profiles.registrationZipCode,
)
: "";
const data = {
fullName: `${profiles?.prefix}${profiles?.firstName} ${profiles?.lastName}`,
prefix: profiles?.prefix != null ? profiles.prefix : "",
@ -1642,7 +1677,7 @@ export class ProfileController extends Controller {
duty,
assessments,
profileAbility,
otherIncome
otherIncome,
};
return new HttpSuccess({
@ -4622,10 +4657,10 @@ export class ProfileController extends Controller {
if (!profile) {
throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูลโปรไฟล์");
}
let null_: any = null;
let _null: any = null;
profile.isLeave = false;
profile.leaveReason = null_;
profile.dateLeave = null_;
profile.leaveReason = _null;
profile.dateLeave = _null;
profile.lastUpdateUserId = req.user.sub;
profile.lastUpdateFullName = req.user.name;
profile.lastUpdatedAt = new Date();