edit name null_
This commit is contained in:
parent
fb96c44753
commit
ed111475f8
6 changed files with 171 additions and 135 deletions
|
|
@ -87,11 +87,11 @@ export class AuthRoleController extends Controller {
|
||||||
@Request() req: RequestWithUser,
|
@Request() req: RequestWithUser,
|
||||||
@Body() body: CreateAddAuthRole,
|
@Body() body: CreateAddAuthRole,
|
||||||
) {
|
) {
|
||||||
let NULL_: any = null;
|
let _null: any = null;
|
||||||
let getDetail;
|
let getDetail;
|
||||||
|
|
||||||
if (body.authRoleId == "") {
|
if (body.authRoleId == "") {
|
||||||
body.authRoleId = NULL_;
|
body.authRoleId = _null;
|
||||||
} else {
|
} else {
|
||||||
getDetail = await this.authRoleRepo.findOneBy({ id: body.authRoleId });
|
getDetail = await this.authRoleRepo.findOneBy({ id: body.authRoleId });
|
||||||
if (!getDetail) throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูลสิทธิ์");
|
if (!getDetail) throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูลสิทธิ์");
|
||||||
|
|
@ -131,11 +131,11 @@ export class AuthRoleController extends Controller {
|
||||||
@Request() req: RequestWithUser,
|
@Request() req: RequestWithUser,
|
||||||
@Body() body: CreateAddAuthRole,
|
@Body() body: CreateAddAuthRole,
|
||||||
) {
|
) {
|
||||||
let NULL_: any = null;
|
let _null: any = null;
|
||||||
let getDetail;
|
let getDetail;
|
||||||
|
|
||||||
if (body.authRoleId == "") {
|
if (body.authRoleId == "") {
|
||||||
body.authRoleId = NULL_;
|
body.authRoleId = _null;
|
||||||
} else {
|
} else {
|
||||||
getDetail = await this.authRoleRepo.findOneBy({ id: body.authRoleId });
|
getDetail = await this.authRoleRepo.findOneBy({ id: body.authRoleId });
|
||||||
if (!getDetail) throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูลสิทธิ์");
|
if (!getDetail) throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูลสิทธิ์");
|
||||||
|
|
|
||||||
|
|
@ -110,7 +110,7 @@ export class ImportDataController extends Controller {
|
||||||
// const filePath = path.resolve(__dirname, "OFFICER.csv"); // Corrected file path
|
// const filePath = path.resolve(__dirname, "OFFICER.csv"); // Corrected file path
|
||||||
// const readStream = fs.createReadStream(filePath).pipe(csvParser());
|
// const readStream = fs.createReadStream(filePath).pipe(csvParser());
|
||||||
// let profiles: any = [];
|
// let profiles: any = [];
|
||||||
let null_: any = null;
|
let _null: any = null;
|
||||||
let profile: any;
|
let profile: any;
|
||||||
// await Promise.all(
|
// await Promise.all(
|
||||||
// OFFICER.map(async (item) => {
|
// OFFICER.map(async (item) => {
|
||||||
|
|
@ -178,12 +178,12 @@ export class ImportDataController extends Controller {
|
||||||
: item.RANK_NAME;
|
: item.RANK_NAME;
|
||||||
profile.firstName = item.FNAME == "" ? null : item.FNAME;
|
profile.firstName = item.FNAME == "" ? null : item.FNAME;
|
||||||
profile.lastName = item.LNAME == "" ? null : item.LNAME;
|
profile.lastName = item.LNAME == "" ? null : item.LNAME;
|
||||||
profile.gender = item.SEX == "1" ? "ชาย" : item.SEX == "2" ? "หญิง" : null_;
|
profile.gender = item.SEX == "1" ? "ชาย" : item.SEX == "2" ? "หญิง" : _null;
|
||||||
profile.birthDate = item.BORN == "" ? null_ : new Date(item.BORN);
|
profile.birthDate = item.BORN == "" ? _null : new Date(item.BORN);
|
||||||
profile.dateAppoint = item.BEGIN_ENTRY_DATE == "" ? null_ : new Date(item.BEGIN_ENTRY_DATE);
|
profile.dateAppoint = item.BEGIN_ENTRY_DATE == "" ? _null : new Date(item.BEGIN_ENTRY_DATE);
|
||||||
profile.dateStart = item.BEGIN_ENTRY_DATE == "" ? null_ : new Date(item.BEGIN_ENTRY_DATE);
|
profile.dateStart = item.BEGIN_ENTRY_DATE == "" ? _null : new Date(item.BEGIN_ENTRY_DATE);
|
||||||
profile.dateRetire = dateRetire == null ? null_ : calculateRetireDate(dateRetire);
|
profile.dateRetire = dateRetire == null ? _null : calculateRetireDate(dateRetire);
|
||||||
profile.dateRetireLaw = dateRetire == null ? null_ : calculateRetireLaw(dateRetire);
|
profile.dateRetireLaw = dateRetire == null ? _null : calculateRetireLaw(dateRetire);
|
||||||
profile.position = item.WORK_LINE_NAME == "" ? null : item.WORK_LINE_NAME;
|
profile.position = item.WORK_LINE_NAME == "" ? null : item.WORK_LINE_NAME;
|
||||||
profile.posTypeId =
|
profile.posTypeId =
|
||||||
type_ != null && type_.posTypeName == item.MP_CATEGORY && type_ ? type_.id : null;
|
type_ != null && type_.posTypeName == item.MP_CATEGORY && type_ ? type_.id : null;
|
||||||
|
|
@ -202,11 +202,11 @@ export class ImportDataController extends Controller {
|
||||||
// },
|
// },
|
||||||
// },
|
// },
|
||||||
// });
|
// });
|
||||||
// profile.posLevelId = level?.id ?? null_;
|
// profile.posLevelId = level?.id ?? _null;
|
||||||
// const type = await this.posTypeRepo.findOne({
|
// const type = await this.posTypeRepo.findOne({
|
||||||
// where: { posTypeName: item.MP_Type },
|
// where: { posTypeName: item.MP_Type },
|
||||||
// });
|
// });
|
||||||
// profile.posTypeId = type?.id ?? null_;
|
// profile.posTypeId = type?.id ?? _null;
|
||||||
profile.amount = item.SALARY == "" ? 0 : Number(item.SALARY);
|
profile.amount = item.SALARY == "" ? 0 : Number(item.SALARY);
|
||||||
// profile.isLeave =
|
// profile.isLeave =
|
||||||
// item.FLAG_RETIRE_STATUSxxxx == "" || item.FLAG_RETIRE_STATUSxxxx == null ? false : true;
|
// item.FLAG_RETIRE_STATUSxxxx == "" || item.FLAG_RETIRE_STATUSxxxx == null ? false : true;
|
||||||
|
|
@ -247,7 +247,7 @@ export class ImportDataController extends Controller {
|
||||||
const filePath = path.resolve(__dirname, "EMP.csv"); // Corrected file path
|
const filePath = path.resolve(__dirname, "EMP.csv"); // Corrected file path
|
||||||
const readStream = fs.createReadStream(filePath).pipe(csvParser());
|
const readStream = fs.createReadStream(filePath).pipe(csvParser());
|
||||||
let profiles: any = [];
|
let profiles: any = [];
|
||||||
let null_: any = null;
|
let _null: any = null;
|
||||||
let profileEmp: any;
|
let profileEmp: any;
|
||||||
|
|
||||||
for await (const item of readStream) {
|
for await (const item of readStream) {
|
||||||
|
|
@ -291,13 +291,13 @@ export class ImportDataController extends Controller {
|
||||||
: item["RANK_NAME"];
|
: item["RANK_NAME"];
|
||||||
profileEmp.firstName = item["FNAME"] == "" ? null : item["FNAME"];
|
profileEmp.firstName = item["FNAME"] == "" ? null : item["FNAME"];
|
||||||
profileEmp.lastName = item["LNAME"] == "" ? null : item["LNAME"];
|
profileEmp.lastName = item["LNAME"] == "" ? null : item["LNAME"];
|
||||||
profileEmp.gender = item["SEX"] == "1" ? "ชาย" : item["SEX"] == "2" ? "หญิง" : null_;
|
profileEmp.gender = item["SEX"] == "1" ? "ชาย" : item["SEX"] == "2" ? "หญิง" : _null;
|
||||||
profileEmp.birthDate = item["BORN"] == "" ? null_ : new Date(item["BORN"]);
|
profileEmp.birthDate = item["BORN"] == "" ? _null : new Date(item["BORN"]);
|
||||||
profileEmp.dateAppoint =
|
profileEmp.dateAppoint =
|
||||||
item["BEGIN_ENTRY_DATE"] == "" ? null_ : new Date(item["BEGIN_ENTRY_DATE"]);
|
item["BEGIN_ENTRY_DATE"] == "" ? _null : new Date(item["BEGIN_ENTRY_DATE"]);
|
||||||
profileEmp.dateStart = item["MP_FORCE_DATE"] == "" ? null_ : new Date(item["MP_FORCE_DATE"]);
|
profileEmp.dateStart = item["MP_FORCE_DATE"] == "" ? _null : new Date(item["MP_FORCE_DATE"]);
|
||||||
profileEmp.dateRetire = dateRetire == null ? null_ : calculateRetireDate(dateRetire);
|
profileEmp.dateRetire = dateRetire == null ? _null : calculateRetireDate(dateRetire);
|
||||||
profileEmp.dateRetireLaw = dateRetire == null ? null_ : calculateRetireLaw(dateRetire);
|
profileEmp.dateRetireLaw = dateRetire == null ? _null : calculateRetireLaw(dateRetire);
|
||||||
profileEmp.position = item["WORK_LINE_NAME"] == "" ? null : item["WORK_LINE_NAME"];
|
profileEmp.position = item["WORK_LINE_NAME"] == "" ? null : item["WORK_LINE_NAME"];
|
||||||
profileEmp.salaryLevel = item["SALARY_LEVEL_CODE"] == "" ? null : item["SALARY_LEVEL_CODE"];
|
profileEmp.salaryLevel = item["SALARY_LEVEL_CODE"] == "" ? null : item["SALARY_LEVEL_CODE"];
|
||||||
profileEmp.relationship =
|
profileEmp.relationship =
|
||||||
|
|
@ -332,7 +332,7 @@ export class ImportDataController extends Controller {
|
||||||
@Post("uploadProfileSalary-Officer")
|
@Post("uploadProfileSalary-Officer")
|
||||||
async UploadFileSQLSalary(@Request() request: { user: Record<string, any> }) {
|
async UploadFileSQLSalary(@Request() request: { user: Record<string, any> }) {
|
||||||
let rowCount = 0;
|
let rowCount = 0;
|
||||||
let null_: any = null;
|
let _null: any = null;
|
||||||
let sqlStatements: string[] = [];
|
let sqlStatements: string[] = [];
|
||||||
|
|
||||||
const [profiles, total] = await AppDataSource.getRepository(Profile)
|
const [profiles, total] = await AppDataSource.getRepository(Profile)
|
||||||
|
|
@ -392,14 +392,14 @@ export class ImportDataController extends Controller {
|
||||||
profileSalary.commandYear = item.cur_year > 2500 ? item.cur_year - 543 : item.cur_year;
|
profileSalary.commandYear = item.cur_year > 2500 ? item.cur_year - 543 : item.cur_year;
|
||||||
profileSalary.commandDateSign =
|
profileSalary.commandDateSign =
|
||||||
item.mp_command_date == null
|
item.mp_command_date == null
|
||||||
? null_
|
? _null
|
||||||
: new Date(item.mp_command_date.setDate(item.mp_command_date.getDate() + 1))
|
: new Date(item.mp_command_date.setDate(item.mp_command_date.getDate() + 1))
|
||||||
.toISOString()
|
.toISOString()
|
||||||
.replace("T", " ")
|
.replace("T", " ")
|
||||||
.substring(0, 19);
|
.substring(0, 19);
|
||||||
profileSalary.commandDateAffect =
|
profileSalary.commandDateAffect =
|
||||||
item.mp_pos_date == null
|
item.mp_pos_date == null
|
||||||
? null_
|
? _null
|
||||||
: new Date(item.mp_pos_date.setDate(item.mp_pos_date.getDate() + 1))
|
: new Date(item.mp_pos_date.setDate(item.mp_pos_date.getDate() + 1))
|
||||||
.toISOString()
|
.toISOString()
|
||||||
.replace("T", " ")
|
.replace("T", " ")
|
||||||
|
|
@ -755,15 +755,15 @@ export class ImportDataController extends Controller {
|
||||||
|
|
||||||
const sal_pos_amount_1: any =
|
const sal_pos_amount_1: any =
|
||||||
item.sal_pos_amount_1 == null || item.sal_pos_amount_1 == ""
|
item.sal_pos_amount_1 == null || item.sal_pos_amount_1 == ""
|
||||||
? null_
|
? _null
|
||||||
: Number(item.sal_pos_amount_1);
|
: Number(item.sal_pos_amount_1);
|
||||||
const sal_pos_amount_2: any =
|
const sal_pos_amount_2: any =
|
||||||
item.sal_pos_amount_2 == null || item.sal_pos_amount_2 == ""
|
item.sal_pos_amount_2 == null || item.sal_pos_amount_2 == ""
|
||||||
? null_
|
? _null
|
||||||
: Number(item.sal_pos_amount_2);
|
: Number(item.sal_pos_amount_2);
|
||||||
profileSalary.positionSalaryAmount = sal_pos_amount_1 ?? sal_pos_amount_2;
|
profileSalary.positionSalaryAmount = sal_pos_amount_1 ?? sal_pos_amount_2;
|
||||||
const special_amt: any =
|
const special_amt: any =
|
||||||
item.special_amt == null || item.special_amt == "" ? null_ : Number(item.special_amt);
|
item.special_amt == null || item.special_amt == "" ? _null : Number(item.special_amt);
|
||||||
profileSalary.amountSpecial = special_amt;
|
profileSalary.amountSpecial = special_amt;
|
||||||
|
|
||||||
profileSalary.createdUserId = request.user.sub;
|
profileSalary.createdUserId = request.user.sub;
|
||||||
|
|
@ -842,7 +842,7 @@ export class ImportDataController extends Controller {
|
||||||
@Post("uploadProfileSalary-Employee")
|
@Post("uploadProfileSalary-Employee")
|
||||||
async UploadFileSQLSalaryEmp(@Request() request: { user: Record<string, any> }) {
|
async UploadFileSQLSalaryEmp(@Request() request: { user: Record<string, any> }) {
|
||||||
let rowCount = 0;
|
let rowCount = 0;
|
||||||
let null_: any = null;
|
let _null: any = null;
|
||||||
|
|
||||||
const [profiles, total] = await AppDataSource.getRepository(ProfileEmployee)
|
const [profiles, total] = await AppDataSource.getRepository(ProfileEmployee)
|
||||||
.createQueryBuilder("profile")
|
.createQueryBuilder("profile")
|
||||||
|
|
@ -891,15 +891,15 @@ export class ImportDataController extends Controller {
|
||||||
|
|
||||||
const sal_pos_amount_1: any =
|
const sal_pos_amount_1: any =
|
||||||
item.sal_pos_amount_1 == null || item.sal_pos_amount_1 == ""
|
item.sal_pos_amount_1 == null || item.sal_pos_amount_1 == ""
|
||||||
? null_
|
? _null
|
||||||
: Number(item.sal_pos_amount_1);
|
: Number(item.sal_pos_amount_1);
|
||||||
const sal_pos_amount_2: any =
|
const sal_pos_amount_2: any =
|
||||||
item.sal_pos_amount_2 == null || item.sal_pos_amount_2 == ""
|
item.sal_pos_amount_2 == null || item.sal_pos_amount_2 == ""
|
||||||
? null_
|
? _null
|
||||||
: Number(item.sal_pos_amount_2);
|
: Number(item.sal_pos_amount_2);
|
||||||
profileSalary.positionSalaryAmount = sal_pos_amount_1 ?? sal_pos_amount_2;
|
profileSalary.positionSalaryAmount = sal_pos_amount_1 ?? sal_pos_amount_2;
|
||||||
const special_amt: any =
|
const special_amt: any =
|
||||||
item.special_amt == null || item.special_amt == "" ? null_ : Number(item.special_amt);
|
item.special_amt == null || item.special_amt == "" ? _null : Number(item.special_amt);
|
||||||
profileSalary.amountSpecial = special_amt;
|
profileSalary.amountSpecial = special_amt;
|
||||||
|
|
||||||
profileSalary.commandId;
|
profileSalary.commandId;
|
||||||
|
|
@ -1222,7 +1222,7 @@ export class ImportDataController extends Controller {
|
||||||
async UploadFileSQLEducation(@Request() request: { user: Record<string, any> }) {
|
async UploadFileSQLEducation(@Request() request: { user: Record<string, any> }) {
|
||||||
let rowCount = 0;
|
let rowCount = 0;
|
||||||
let educations: any = [];
|
let educations: any = [];
|
||||||
let null_: any = null;
|
let _null: any = null;
|
||||||
const [profiles, total] = await AppDataSource.getRepository(Profile)
|
const [profiles, total] = await AppDataSource.getRepository(Profile)
|
||||||
.createQueryBuilder("profile")
|
.createQueryBuilder("profile")
|
||||||
.select(["profile.citizenId", "profile.id"])
|
.select(["profile.citizenId", "profile.id"])
|
||||||
|
|
@ -1274,22 +1274,22 @@ export class ImportDataController extends Controller {
|
||||||
|
|
||||||
let startDate = item.START_EDUCATION_YEAR
|
let startDate = item.START_EDUCATION_YEAR
|
||||||
? Extension.ConvertToDateTimeV2(item.START_EDUCATION_YEAR)
|
? Extension.ConvertToDateTimeV2(item.START_EDUCATION_YEAR)
|
||||||
: null_;
|
: _null;
|
||||||
// startDate = startDate ? new Date(startDate, 0, 1) : null_;
|
// startDate = startDate ? new Date(startDate, 0, 1) : _null;
|
||||||
|
|
||||||
let endDate = item.EDUCATION_YEAR
|
let endDate = item.EDUCATION_YEAR
|
||||||
? Extension.ConvertToDateTimeV2(item.EDUCATION_YEAR)
|
? Extension.ConvertToDateTimeV2(item.EDUCATION_YEAR)
|
||||||
: null_;
|
: _null;
|
||||||
// endDate = endDate ? new Date(endDate, 0, 1) : null_;
|
// endDate = endDate ? new Date(endDate, 0, 1) : _null;
|
||||||
|
|
||||||
education.level = educationLevel == null ? 1 : educationLevel.level + 1;
|
education.level = educationLevel == null ? 1 : educationLevel.level + 1;
|
||||||
education.profileId = _item.id;
|
education.profileId = _item.id;
|
||||||
education.degree = educationCode ? educationCode.EDUCATION_NAME : null_;
|
education.degree = educationCode ? educationCode.EDUCATION_NAME : _null;
|
||||||
education.field = hrMajorCode ? hrMajorCode.MAJOR_NAME : null_;
|
education.field = hrMajorCode ? hrMajorCode.MAJOR_NAME : _null;
|
||||||
education.educationLevel = hrFundCourseCode ? hrFundCourseCode.FUND_COURSE_NAME : null_;
|
education.educationLevel = hrFundCourseCode ? hrFundCourseCode.FUND_COURSE_NAME : _null;
|
||||||
education.educationLevelId = hrFundCourseCode ? hrFundCourseCode.refId : null_;
|
education.educationLevelId = hrFundCourseCode ? hrFundCourseCode.refId : _null;
|
||||||
education.institute = item.INSTITUE;
|
education.institute = item.INSTITUE;
|
||||||
education.level = item.EDUCATION_SEQ ? Number(item.EDUCATION_SEQ) : null_;
|
education.level = item.EDUCATION_SEQ ? Number(item.EDUCATION_SEQ) : _null;
|
||||||
education.startDate = startDate;
|
education.startDate = startDate;
|
||||||
education.endDate = endDate;
|
education.endDate = endDate;
|
||||||
education.createdUserId = request.user.sub;
|
education.createdUserId = request.user.sub;
|
||||||
|
|
@ -1318,7 +1318,7 @@ export class ImportDataController extends Controller {
|
||||||
async UploadFileSQLEducationEmp(@Request() request: { user: Record<string, any> }) {
|
async UploadFileSQLEducationEmp(@Request() request: { user: Record<string, any> }) {
|
||||||
let rowCount = 0;
|
let rowCount = 0;
|
||||||
let educations: any = [];
|
let educations: any = [];
|
||||||
let null_: any = null;
|
let _null: any = null;
|
||||||
const [profiles, total] = await AppDataSource.getRepository(ProfileEmployee)
|
const [profiles, total] = await AppDataSource.getRepository(ProfileEmployee)
|
||||||
.createQueryBuilder("profile")
|
.createQueryBuilder("profile")
|
||||||
.select(["profile.citizenId", "profile.id"])
|
.select(["profile.citizenId", "profile.id"])
|
||||||
|
|
@ -1366,19 +1366,19 @@ export class ImportDataController extends Controller {
|
||||||
|
|
||||||
let startDate = item.START_EDUCATION_YEAR
|
let startDate = item.START_EDUCATION_YEAR
|
||||||
? Extension.ConvertToDateTimeV2(item.START_EDUCATION_YEAR)
|
? Extension.ConvertToDateTimeV2(item.START_EDUCATION_YEAR)
|
||||||
: null_;
|
: _null;
|
||||||
// startDate = startDate ? new Date(startDate, 0, 1) : null_;
|
// startDate = startDate ? new Date(startDate, 0, 1) : _null;
|
||||||
|
|
||||||
let endDate = item.EDUCATION_YEAR
|
let endDate = item.EDUCATION_YEAR
|
||||||
? Extension.ConvertToDateTimeV2(item.EDUCATION_YEAR)
|
? Extension.ConvertToDateTimeV2(item.EDUCATION_YEAR)
|
||||||
: null_;
|
: _null;
|
||||||
// endDate = endDate ? new Date(endDate, 0, 1) : null_;
|
// endDate = endDate ? new Date(endDate, 0, 1) : _null;
|
||||||
|
|
||||||
education.level = educationLevel == null ? 1 : educationLevel.level + 1;
|
education.level = educationLevel == null ? 1 : educationLevel.level + 1;
|
||||||
education.profileEmployeeId = _item.id;
|
education.profileEmployeeId = _item.id;
|
||||||
education.degree = educationCode ? educationCode.EDUCATION_NAME : "";
|
education.degree = educationCode ? educationCode.EDUCATION_NAME : "";
|
||||||
education.institute = item.INSTITUE;
|
education.institute = item.INSTITUE;
|
||||||
education.level = item.EDUCATION_SEQ ? null_ : Number(item.EDUCATION_SEQ);
|
education.level = item.EDUCATION_SEQ ? _null : Number(item.EDUCATION_SEQ);
|
||||||
education.startDate = startDate;
|
education.startDate = startDate;
|
||||||
education.endDate = endDate;
|
education.endDate = endDate;
|
||||||
education.createdUserId = request.user.sub;
|
education.createdUserId = request.user.sub;
|
||||||
|
|
@ -1509,7 +1509,7 @@ export class ImportDataController extends Controller {
|
||||||
@Post("uploadProfileAddress-Officer")
|
@Post("uploadProfileAddress-Officer")
|
||||||
async UploadFileSQLAddress(@Request() request: { user: Record<string, any> }) {
|
async UploadFileSQLAddress(@Request() request: { user: Record<string, any> }) {
|
||||||
let rowCount = 0;
|
let rowCount = 0;
|
||||||
let null_: any = null;
|
let _null: any = null;
|
||||||
const [profiles, total] = await AppDataSource.getRepository(Profile)
|
const [profiles, total] = await AppDataSource.getRepository(Profile)
|
||||||
.createQueryBuilder("profile")
|
.createQueryBuilder("profile")
|
||||||
.select(["profile.citizenId", "profile.id"])
|
.select(["profile.citizenId", "profile.id"])
|
||||||
|
|
@ -1559,7 +1559,7 @@ export class ImportDataController extends Controller {
|
||||||
});
|
});
|
||||||
await this.provinceIdRepo.save(provinceId);
|
await this.provinceIdRepo.save(provinceId);
|
||||||
}
|
}
|
||||||
_item.registrationProvinceId = provinceId ? provinceId.id : null_;
|
_item.registrationProvinceId = provinceId ? provinceId.id : _null;
|
||||||
if (AMPHUR_CODE) {
|
if (AMPHUR_CODE) {
|
||||||
let districtRegis_ = await this.amphurRepo.findOne({
|
let districtRegis_ = await this.amphurRepo.findOne({
|
||||||
where: {
|
where: {
|
||||||
|
|
@ -1582,7 +1582,7 @@ export class ImportDataController extends Controller {
|
||||||
});
|
});
|
||||||
await this.provinceIdRepo.save(provinceId);
|
await this.provinceIdRepo.save(provinceId);
|
||||||
}
|
}
|
||||||
_item.registrationDistrictId = districtId ? districtId.id : null_;
|
_item.registrationDistrictId = districtId ? districtId.id : _null;
|
||||||
if (DISTRICT_CODE) {
|
if (DISTRICT_CODE) {
|
||||||
let subDistrictRegis_ = await this.subDistrictRepo.findOne({
|
let subDistrictRegis_ = await this.subDistrictRepo.findOne({
|
||||||
where: {
|
where: {
|
||||||
|
|
@ -1607,7 +1607,7 @@ export class ImportDataController extends Controller {
|
||||||
});
|
});
|
||||||
await this.provinceIdRepo.save(provinceId);
|
await this.provinceIdRepo.save(provinceId);
|
||||||
}
|
}
|
||||||
_item.registrationSubDistrictId = subDistrictId ? subDistrictId.id : null_;
|
_item.registrationSubDistrictId = subDistrictId ? subDistrictId.id : _null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1633,7 +1633,7 @@ export class ImportDataController extends Controller {
|
||||||
});
|
});
|
||||||
await this.provinceIdRepo.save(provinceId);
|
await this.provinceIdRepo.save(provinceId);
|
||||||
}
|
}
|
||||||
_item.currentProvinceId = provinceId ? provinceId.id : null_;
|
_item.currentProvinceId = provinceId ? provinceId.id : _null;
|
||||||
if (CONTACT_AMPHUR_CODE) {
|
if (CONTACT_AMPHUR_CODE) {
|
||||||
let districtCurr_ = await this.amphurRepo.findOne({
|
let districtCurr_ = await this.amphurRepo.findOne({
|
||||||
where: {
|
where: {
|
||||||
|
|
@ -1656,7 +1656,7 @@ export class ImportDataController extends Controller {
|
||||||
});
|
});
|
||||||
await this.provinceIdRepo.save(provinceId);
|
await this.provinceIdRepo.save(provinceId);
|
||||||
}
|
}
|
||||||
_item.currentDistrictId = districtId ? districtId.id : null_;
|
_item.currentDistrictId = districtId ? districtId.id : _null;
|
||||||
if (CONTACT_DISTRICT_CODE) {
|
if (CONTACT_DISTRICT_CODE) {
|
||||||
let subDistrictCurr_ = await this.subDistrictRepo.findOne({
|
let subDistrictCurr_ = await this.subDistrictRepo.findOne({
|
||||||
where: {
|
where: {
|
||||||
|
|
@ -1681,7 +1681,7 @@ export class ImportDataController extends Controller {
|
||||||
});
|
});
|
||||||
await this.provinceIdRepo.save(provinceId);
|
await this.provinceIdRepo.save(provinceId);
|
||||||
}
|
}
|
||||||
_item.currentSubDistrictId = subDistrictId ? subDistrictId.id : null_;
|
_item.currentSubDistrictId = subDistrictId ? subDistrictId.id : _null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1711,7 +1711,7 @@ export class ImportDataController extends Controller {
|
||||||
async UploadFileSQLAddressEmp(@Request() request: { user: Record<string, any> }) {
|
async UploadFileSQLAddressEmp(@Request() request: { user: Record<string, any> }) {
|
||||||
let rowCount = 0;
|
let rowCount = 0;
|
||||||
let profileDatas: any = [];
|
let profileDatas: any = [];
|
||||||
let null_: any = null;
|
let _null: any = null;
|
||||||
const [profiles, total] = await AppDataSource.getRepository(ProfileEmployee)
|
const [profiles, total] = await AppDataSource.getRepository(ProfileEmployee)
|
||||||
.createQueryBuilder("profile")
|
.createQueryBuilder("profile")
|
||||||
.select(["profile.citizenId", "profile.id"])
|
.select(["profile.citizenId", "profile.id"])
|
||||||
|
|
@ -1755,7 +1755,7 @@ export class ImportDataController extends Controller {
|
||||||
name: provinceRegis_.PROVINCE_NAME,
|
name: provinceRegis_.PROVINCE_NAME,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
_item.registrationProvinceId = provinceId ? provinceId.id : null_;
|
_item.registrationProvinceId = provinceId ? provinceId.id : _null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (existingProfile.AMPHUR_CODE && provinceRegis_) {
|
if (existingProfile.AMPHUR_CODE && provinceRegis_) {
|
||||||
|
|
@ -1771,7 +1771,7 @@ export class ImportDataController extends Controller {
|
||||||
name: districtRegis_.AMPHUR_NAME,
|
name: districtRegis_.AMPHUR_NAME,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
_item.registrationDistrictId = districtId ? districtId.id : null_;
|
_item.registrationDistrictId = districtId ? districtId.id : _null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (existingProfile.DISTRICT_CODE && districtRegis_ && provinceRegis_) {
|
if (existingProfile.DISTRICT_CODE && districtRegis_ && provinceRegis_) {
|
||||||
|
|
@ -1788,7 +1788,7 @@ export class ImportDataController extends Controller {
|
||||||
name: subDistrictRegis_.DISTRICT_NAME,
|
name: subDistrictRegis_.DISTRICT_NAME,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
_item.registrationSubDistrictId = subDistrictId ? subDistrictId.id : null_;
|
_item.registrationSubDistrictId = subDistrictId ? subDistrictId.id : _null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//current address
|
//current address
|
||||||
|
|
@ -1802,7 +1802,7 @@ export class ImportDataController extends Controller {
|
||||||
name: provinceCurr_.PROVINCE_NAME,
|
name: provinceCurr_.PROVINCE_NAME,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
_item.currentProvinceId = provinceId ? provinceId.id : null_;
|
_item.currentProvinceId = provinceId ? provinceId.id : _null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (existingProfile.CONTACT_AMPHUR_CODE && provinceCurr_) {
|
if (existingProfile.CONTACT_AMPHUR_CODE && provinceCurr_) {
|
||||||
|
|
@ -1818,7 +1818,7 @@ export class ImportDataController extends Controller {
|
||||||
name: districtCurr_.AMPHUR_NAME,
|
name: districtCurr_.AMPHUR_NAME,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
_item.currentDistrictId = districtId ? districtId.id : null_;
|
_item.currentDistrictId = districtId ? districtId.id : _null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (existingProfile.CONTACT_DISTRICT_CODE && districtCurr_ && provinceCurr_) {
|
if (existingProfile.CONTACT_DISTRICT_CODE && districtCurr_ && provinceCurr_) {
|
||||||
|
|
@ -1835,7 +1835,7 @@ export class ImportDataController extends Controller {
|
||||||
name: subDistrictCurr_.DISTRICT_NAME,
|
name: subDistrictCurr_.DISTRICT_NAME,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
_item.currentSubDistrictId = subDistrictId ? subDistrictId.id : null_;
|
_item.currentSubDistrictId = subDistrictId ? subDistrictId.id : _null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
_item.registrationAddress = existingProfile.H_NUMBER;
|
_item.registrationAddress = existingProfile.H_NUMBER;
|
||||||
|
|
@ -2251,7 +2251,7 @@ export class ImportDataController extends Controller {
|
||||||
// .take(20)
|
// .take(20)
|
||||||
.getManyAndCount();
|
.getManyAndCount();
|
||||||
let rowCount = 0;
|
let rowCount = 0;
|
||||||
let null_: any = null;
|
let _null: any = null;
|
||||||
let type_: any = null;
|
let type_: any = null;
|
||||||
let level_: any = null;
|
let level_: any = null;
|
||||||
const orgRevision = await this.orgRevisionRepo.findOne({
|
const orgRevision = await this.orgRevisionRepo.findOne({
|
||||||
|
|
@ -2304,17 +2304,17 @@ export class ImportDataController extends Controller {
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
let posMaster = new PosMaster();
|
let posMaster = new PosMaster();
|
||||||
posMaster.orgRootId = orgRoot?.id ?? null_;
|
posMaster.orgRootId = orgRoot?.id ?? _null;
|
||||||
posMaster.orgChild1Id = orgChild1?.id ?? null_;
|
posMaster.orgChild1Id = orgChild1?.id ?? _null;
|
||||||
posMaster.orgChild2Id = orgChild2?.id ?? null_;
|
posMaster.orgChild2Id = orgChild2?.id ?? _null;
|
||||||
posMaster.orgChild3Id = orgChild3?.id ?? null_;
|
posMaster.orgChild3Id = orgChild3?.id ?? _null;
|
||||||
posMaster.statusReport = "PENDING";
|
posMaster.statusReport = "PENDING";
|
||||||
posMaster.isCondition = false;
|
posMaster.isCondition = false;
|
||||||
posMaster.isStaff = false;
|
posMaster.isStaff = false;
|
||||||
posMaster.isDirector = false;
|
posMaster.isDirector = false;
|
||||||
posMaster.isSit = false;
|
posMaster.isSit = false;
|
||||||
posMaster.current_holderId = existingProfile.id;
|
posMaster.current_holderId = existingProfile.id;
|
||||||
posMaster.posMasterNo = item.SALARY == "" ? null_ : Number(item.POS_NUM_CODE);
|
posMaster.posMasterNo = item.SALARY == "" ? _null : Number(item.POS_NUM_CODE);
|
||||||
posMaster.orgRevisionId = orgRevision.id;
|
posMaster.orgRevisionId = orgRevision.id;
|
||||||
posMaster.posMasterCreatedAt = new Date();
|
posMaster.posMasterCreatedAt = new Date();
|
||||||
posMaster.createdUserId = request.user.sub;
|
posMaster.createdUserId = request.user.sub;
|
||||||
|
|
@ -2372,7 +2372,7 @@ export class ImportDataController extends Controller {
|
||||||
let posExecutive = new PosExecutive();
|
let posExecutive = new PosExecutive();
|
||||||
|
|
||||||
posExecutive.posExecutivePriority =
|
posExecutive.posExecutivePriority =
|
||||||
posExecutiveOrder == null ? null_ : posExecutiveOrder.posExecutivePriority + 1;
|
posExecutiveOrder == null ? _null : posExecutiveOrder.posExecutivePriority + 1;
|
||||||
posExecutive.posExecutiveName = item.ADMIN_NAME;
|
posExecutive.posExecutiveName = item.ADMIN_NAME;
|
||||||
posExecutive.createdUserId = request.user.sub;
|
posExecutive.createdUserId = request.user.sub;
|
||||||
posExecutive.createdFullName = request.user.name;
|
posExecutive.createdFullName = request.user.name;
|
||||||
|
|
@ -2382,8 +2382,8 @@ export class ImportDataController extends Controller {
|
||||||
posExecutive.lastUpdatedAt = new Date();
|
posExecutive.lastUpdatedAt = new Date();
|
||||||
await this.posExecutiveRepo.save(posExecutive);
|
await this.posExecutiveRepo.save(posExecutive);
|
||||||
}
|
}
|
||||||
position.posExecutiveId = posExecutive == null ? null_ : posExecutive.id;
|
position.posExecutiveId = posExecutive == null ? _null : posExecutive.id;
|
||||||
position.positionName = item.WORK_LINE_NAME == "" ? null_ : item.WORK_LINE_NAME;
|
position.positionName = item.WORK_LINE_NAME == "" ? _null : item.WORK_LINE_NAME;
|
||||||
position.posTypeId =
|
position.posTypeId =
|
||||||
type_ != null && type_.posTypeName == item.MP_CATEGORY && type_ ? type_.id : null;
|
type_ != null && type_.posTypeName == item.MP_CATEGORY && type_ ? type_.id : null;
|
||||||
position.posLevelId =
|
position.posLevelId =
|
||||||
|
|
@ -2399,7 +2399,7 @@ export class ImportDataController extends Controller {
|
||||||
@Post("uploadProfileSalary-OfficerEntry")
|
@Post("uploadProfileSalary-OfficerEntry")
|
||||||
async UploadFileSQLSalaryEntry(@Request() request: { user: Record<string, any> }) {
|
async UploadFileSQLSalaryEntry(@Request() request: { user: Record<string, any> }) {
|
||||||
let rowCount = 0;
|
let rowCount = 0;
|
||||||
let null_: any = null;
|
let _null: any = null;
|
||||||
let sqlStatements: string[] = [];
|
let sqlStatements: string[] = [];
|
||||||
|
|
||||||
const [profiles, total] = await AppDataSource.getRepository(Profile)
|
const [profiles, total] = await AppDataSource.getRepository(Profile)
|
||||||
|
|
@ -2444,7 +2444,7 @@ export class ImportDataController extends Controller {
|
||||||
|
|
||||||
profileSalary.commandDateAffect =
|
profileSalary.commandDateAffect =
|
||||||
item.Date == null
|
item.Date == null
|
||||||
? null_
|
? _null
|
||||||
: new Date(item.Date.setDate(item.Date.getDate() + 1))
|
: new Date(item.Date.setDate(item.Date.getDate() + 1))
|
||||||
.toISOString()
|
.toISOString()
|
||||||
.replace("T", " ")
|
.replace("T", " ")
|
||||||
|
|
@ -2464,7 +2464,7 @@ export class ImportDataController extends Controller {
|
||||||
profileSalary.positionLevel = item.PositionLevelName;
|
profileSalary.positionLevel = item.PositionLevelName;
|
||||||
profileSalary.positionCee = this.canConvertToInt(item.PositionLevelName)
|
profileSalary.positionCee = this.canConvertToInt(item.PositionLevelName)
|
||||||
? item.PositionLevelName
|
? item.PositionLevelName
|
||||||
: null_;
|
: _null;
|
||||||
//xxxxxxxxxxxxxxxxx
|
//xxxxxxxxxxxxxxxxx
|
||||||
profileSalary.positionType = item.PositionTypeName;
|
profileSalary.positionType = item.PositionTypeName;
|
||||||
profileSalary.isEntry = true;
|
profileSalary.isEntry = true;
|
||||||
|
|
|
||||||
|
|
@ -1165,10 +1165,10 @@ export class ProfileController extends Controller {
|
||||||
"amount",
|
"amount",
|
||||||
"remark",
|
"remark",
|
||||||
],
|
],
|
||||||
where: {
|
where: {
|
||||||
profileId: id,
|
profileId: id,
|
||||||
commandCode: In(["5","6"]),
|
commandCode: In(["5", "6"]),
|
||||||
isEntry: false
|
isEntry: false,
|
||||||
},
|
},
|
||||||
order: { order: "ASC" },
|
order: { order: "ASC" },
|
||||||
});
|
});
|
||||||
|
|
@ -1326,11 +1326,11 @@ export class ProfileController extends Controller {
|
||||||
];
|
];
|
||||||
|
|
||||||
const position_raw = await this.salaryRepo.find({
|
const position_raw = await this.salaryRepo.find({
|
||||||
where: {
|
where: {
|
||||||
profileId: id,
|
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"]),
|
||||||
isEntry: false
|
isEntry: false,
|
||||||
},
|
},
|
||||||
order: { order: "ASC" },
|
order: { order: "ASC" },
|
||||||
});
|
});
|
||||||
const positionList =
|
const positionList =
|
||||||
|
|
@ -1457,48 +1457,83 @@ export class ProfileController extends Controller {
|
||||||
const profileAbility =
|
const profileAbility =
|
||||||
profileAbility_raw.length > 0
|
profileAbility_raw.length > 0
|
||||||
? profileAbility_raw.map((item) => ({
|
? profileAbility_raw.map((item) => ({
|
||||||
field: item.field?item.field:"",
|
field: item.field ? item.field : "",
|
||||||
detail: item.detail?item.detail:"",
|
detail: item.detail ? item.detail : "",
|
||||||
}))
|
}))
|
||||||
: [
|
: [
|
||||||
{
|
{
|
||||||
field: "-",
|
field: "-",
|
||||||
detail: "-",
|
detail: "-",
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
const otherIncome_raw = await this.salaryRepo.find({
|
const otherIncome_raw = await this.salaryRepo.find({
|
||||||
where: {
|
where: {
|
||||||
profileId: id,
|
profileId: id,
|
||||||
commandCode: "7",
|
commandCode: "7",
|
||||||
isEntry: false
|
isEntry: false,
|
||||||
},
|
},
|
||||||
order: { order: "ASC" },
|
order: { order: "ASC" },
|
||||||
});
|
});
|
||||||
const otherIncome =
|
const otherIncome =
|
||||||
otherIncome_raw.length > 0
|
otherIncome_raw.length > 0
|
||||||
? otherIncome_raw.map((item) => ({
|
? otherIncome_raw.map((item) => ({
|
||||||
commandDateAffect: item.commandDateAffect?Extension.ToThaiNumber(Extension.ToThaiFullDate2(item.commandDateAffect)):"",
|
commandDateAffect: item.commandDateAffect
|
||||||
commandDateSign: item.commandDateSign?Extension.ToThaiNumber(Extension.ToThaiFullDate2(item.commandDateSign)):"",
|
? Extension.ToThaiNumber(Extension.ToThaiFullDate2(item.commandDateAffect))
|
||||||
commandNo: item.commandNo?Extension.ToThaiNumber(item.commandNo):"",
|
: "",
|
||||||
position: item.positionName,
|
commandDateSign: item.commandDateSign
|
||||||
posLevel: item.positionLevel?Extension.ToThaiNumber(item.positionLevel):"",
|
? Extension.ToThaiNumber(Extension.ToThaiFullDate2(item.commandDateSign))
|
||||||
amount: item.amount?Extension.ToThaiNumber(Number(item.amount).toLocaleString()):"",
|
: "",
|
||||||
}))
|
commandNo: item.commandNo ? Extension.ToThaiNumber(item.commandNo) : "",
|
||||||
: [
|
position: item.positionName,
|
||||||
{
|
posLevel: item.positionLevel ? Extension.ToThaiNumber(item.positionLevel) : "",
|
||||||
commandDateAffect: "-",
|
amount: item.amount ? Extension.ToThaiNumber(Number(item.amount).toLocaleString()) : "",
|
||||||
commandDateSign: "-",
|
}))
|
||||||
commandNo: "-",
|
: [
|
||||||
position: "-",
|
{
|
||||||
posLevel: "-",
|
commandDateAffect: "-",
|
||||||
amount: "-",
|
commandDateSign: "-",
|
||||||
},
|
commandNo: "-",
|
||||||
];
|
position: "-",
|
||||||
|
posLevel: "-",
|
||||||
|
amount: "-",
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
const sum = profiles?Extension.ToThaiNumber((Number(profiles.amount) + Number(profiles.positionSalaryAmount) + Number(profiles.mouthSalaryAmount) + Number(profiles.amountSpecial)).toLocaleString()):"";
|
const sum = profiles
|
||||||
const fullCurrentAddress = profiles?Extension.ToThaiNumber(profiles.currentAddress + " ตำบล/แขวง " + profiles.currentSubDistrict.name + " อำเภอ/เขต " + profiles.currentDistrict.name + " จังหวัด " + profiles.currentProvince.name + profiles.currentZipCode):"";
|
? Extension.ToThaiNumber(
|
||||||
const fullRegistrationAddress = profiles?Extension.ToThaiNumber(profiles.registrationAddress + " ตำบล/แขวง " + profiles.registrationSubDistrict.name + " อำเภอ/เขต " + profiles.registrationDistrict.name + " จังหวัด " + profiles.registrationProvince.name + profiles.registrationZipCode):"";
|
(
|
||||||
|
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 = {
|
const data = {
|
||||||
fullName: `${profiles?.prefix}${profiles?.firstName} ${profiles?.lastName}`,
|
fullName: `${profiles?.prefix}${profiles?.firstName} ${profiles?.lastName}`,
|
||||||
prefix: profiles?.prefix != null ? profiles.prefix : "",
|
prefix: profiles?.prefix != null ? profiles.prefix : "",
|
||||||
|
|
@ -1642,7 +1677,7 @@ export class ProfileController extends Controller {
|
||||||
duty,
|
duty,
|
||||||
assessments,
|
assessments,
|
||||||
profileAbility,
|
profileAbility,
|
||||||
otherIncome
|
otherIncome,
|
||||||
};
|
};
|
||||||
|
|
||||||
return new HttpSuccess({
|
return new HttpSuccess({
|
||||||
|
|
@ -4622,10 +4657,10 @@ export class ProfileController extends Controller {
|
||||||
if (!profile) {
|
if (!profile) {
|
||||||
throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูลโปรไฟล์");
|
throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูลโปรไฟล์");
|
||||||
}
|
}
|
||||||
let null_: any = null;
|
let _null: any = null;
|
||||||
profile.isLeave = false;
|
profile.isLeave = false;
|
||||||
profile.leaveReason = null_;
|
profile.leaveReason = _null;
|
||||||
profile.dateLeave = null_;
|
profile.dateLeave = _null;
|
||||||
profile.lastUpdateUserId = req.user.sub;
|
profile.lastUpdateUserId = req.user.sub;
|
||||||
profile.lastUpdateFullName = req.user.name;
|
profile.lastUpdateFullName = req.user.name;
|
||||||
profile.lastUpdatedAt = new Date();
|
profile.lastUpdatedAt = new Date();
|
||||||
|
|
|
||||||
|
|
@ -519,6 +519,7 @@ export class ProfileSalaryController extends Controller {
|
||||||
await this.salaryHistoryRepo.save(history, { data: req });
|
await this.salaryHistoryRepo.save(history, { data: req });
|
||||||
|
|
||||||
profile.amount = body?.amount ?? _null;
|
profile.amount = body?.amount ?? _null;
|
||||||
|
profile.amountSpecial = body.amountSpecial ?? _null;
|
||||||
profile.positionSalaryAmount = body?.positionSalaryAmount ?? _null;
|
profile.positionSalaryAmount = body?.positionSalaryAmount ?? _null;
|
||||||
profile.mouthSalaryAmount = body.mouthSalaryAmount ?? _null;
|
profile.mouthSalaryAmount = body.mouthSalaryAmount ?? _null;
|
||||||
await this.profileRepo.save(profile, { data: req });
|
await this.profileRepo.save(profile, { data: req });
|
||||||
|
|
@ -563,11 +564,11 @@ export class ProfileSalaryController extends Controller {
|
||||||
history.profileSalaryId = data.id;
|
history.profileSalaryId = data.id;
|
||||||
await this.salaryHistoryRepo.save(history, { data: req });
|
await this.salaryHistoryRepo.save(history, { data: req });
|
||||||
|
|
||||||
let null_: any = null;
|
let _null: any = null;
|
||||||
profile.amount = body.amount ?? null_;
|
profile.amount = body.amount ?? _null;
|
||||||
profile.amountSpecial = body.amountSpecial ?? null_;
|
profile.amountSpecial = body.amountSpecial ?? _null;
|
||||||
profile.positionSalaryAmount = body.positionSalaryAmount ?? null_;
|
profile.positionSalaryAmount = body.positionSalaryAmount ?? _null;
|
||||||
profile.mouthSalaryAmount = body.mouthSalaryAmount ?? null_;
|
profile.mouthSalaryAmount = body.mouthSalaryAmount ?? _null;
|
||||||
await this.profileRepo.save(profile);
|
await this.profileRepo.save(profile);
|
||||||
return new HttpSuccess();
|
return new HttpSuccess();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -250,11 +250,11 @@ export class ProfileSalaryEmployeeController extends Controller {
|
||||||
history.profileSalaryId = data.id;
|
history.profileSalaryId = data.id;
|
||||||
await this.salaryHistoryRepo.save(history, { data: req });
|
await this.salaryHistoryRepo.save(history, { data: req });
|
||||||
|
|
||||||
let null_: any = null;
|
let _null: any = null;
|
||||||
profile.amount = body.amount ?? null_;
|
profile.amount = body.amount ?? _null;
|
||||||
profile.amountSpecial = body.amountSpecial ?? null_;
|
profile.amountSpecial = body.amountSpecial ?? _null;
|
||||||
profile.positionSalaryAmount = body.positionSalaryAmount ?? null_;
|
profile.positionSalaryAmount = body.positionSalaryAmount ?? _null;
|
||||||
profile.mouthSalaryAmount = body.mouthSalaryAmount ?? null_;
|
profile.mouthSalaryAmount = body.mouthSalaryAmount ?? _null;
|
||||||
await this.profileRepo.save(profile);
|
await this.profileRepo.save(profile);
|
||||||
return new HttpSuccess();
|
return new HttpSuccess();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -260,14 +260,14 @@ export class KeycloakController extends Controller {
|
||||||
});
|
});
|
||||||
if (!profileEmp) {
|
if (!profileEmp) {
|
||||||
} else {
|
} else {
|
||||||
const null_: any = null;
|
const _null: any = null;
|
||||||
profileEmp.keycloak = null_;
|
profileEmp.keycloak = _null;
|
||||||
profileEmp.roleKeycloaks = [];
|
profileEmp.roleKeycloaks = [];
|
||||||
await this.profileEmpRepo.save(profileEmp);
|
await this.profileEmpRepo.save(profileEmp);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
const null_: any = null;
|
const _null: any = null;
|
||||||
profile.keycloak = null_;
|
profile.keycloak = _null;
|
||||||
profile.roleKeycloaks = [];
|
profile.roleKeycloaks = [];
|
||||||
await this.profileRepo.save(profile);
|
await this.profileRepo.save(profile);
|
||||||
return new HttpSuccess();
|
return new HttpSuccess();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue