kk1 employee
This commit is contained in:
parent
6efa73eeeb
commit
e81ed7f778
2 changed files with 35 additions and 31 deletions
|
|
@ -3410,7 +3410,9 @@ export class ImportDataController extends Controller {
|
||||||
@Post("update-profileSalary")
|
@Post("update-profileSalary")
|
||||||
async UpdateProfileSalary(@Request() request: { user: Record<string, any> }) {
|
async UpdateProfileSalary(@Request() request: { user: Record<string, any> }) {
|
||||||
let rowCount = 0;
|
let rowCount = 0;
|
||||||
const profileSalarys: any = await this.salaryRepo.find({ where: { refId: Not(IsNull()) } });
|
const profileSalarys: any = await this.salaryRepo.find({
|
||||||
|
where: { refId: Not(IsNull()), profileEmployeeId: IsNull(), posNumCodeSit: IsNull() },
|
||||||
|
});
|
||||||
|
|
||||||
for await (const _item of profileSalarys) {
|
for await (const _item of profileSalarys) {
|
||||||
const OFFICER = await this.HR_POSITION_OFFICERRepo.findOne({
|
const OFFICER = await this.HR_POSITION_OFFICERRepo.findOne({
|
||||||
|
|
@ -3434,7 +3436,9 @@ export class ImportDataController extends Controller {
|
||||||
@Post("update-profileSalaryEmp")
|
@Post("update-profileSalaryEmp")
|
||||||
async UpdateProfileSalaryEmp(@Request() request: { user: Record<string, any> }) {
|
async UpdateProfileSalaryEmp(@Request() request: { user: Record<string, any> }) {
|
||||||
let rowCount = 0;
|
let rowCount = 0;
|
||||||
const profileSalarys: any = await this.salaryRepo.find({ where: { refId: Not(IsNull()) } });
|
const profileSalarys: any = await this.salaryRepo.find({
|
||||||
|
where: { refId: Not(IsNull()), profileId: IsNull(), posNumCodeSit: IsNull() },
|
||||||
|
});
|
||||||
|
|
||||||
for await (const _item of profileSalarys) {
|
for await (const _item of profileSalarys) {
|
||||||
const EMPLOYEE = await this.HR_POSITION_EMPLOYEERepo.findOne({
|
const EMPLOYEE = await this.HR_POSITION_EMPLOYEERepo.findOne({
|
||||||
|
|
|
||||||
|
|
@ -618,7 +618,7 @@ export class ProfileEmployeeController extends Controller {
|
||||||
Extension.ToThaiNumber(new Date(item.refCommandDate).getFullYear().toString()) ??
|
Extension.ToThaiNumber(new Date(item.refCommandDate).getFullYear().toString()) ??
|
||||||
null,
|
null,
|
||||||
DisciplineDetail: item.detail ?? null,
|
DisciplineDetail: item.detail ?? null,
|
||||||
RefNo: Extension.ToThaiNumber(item.refCommandNo) ?? null,
|
RefNo: item.refCommandNo ? Extension.ToThaiNumber(item.refCommandNo) : null,
|
||||||
}))
|
}))
|
||||||
: [
|
: [
|
||||||
{
|
{
|
||||||
|
|
@ -1630,7 +1630,7 @@ export class ProfileEmployeeController extends Controller {
|
||||||
firstName: _data.firstName,
|
firstName: _data.firstName,
|
||||||
lastName: _data.lastName,
|
lastName: _data.lastName,
|
||||||
citizenId: _data.citizenId,
|
citizenId: _data.citizenId,
|
||||||
posLevel: `${_data.posType.posTypeShortName?? ""} ${_data.posLevel.posLevelName ?? ""}`,
|
posLevel: `${_data.posType.posTypeShortName ?? ""} ${_data.posLevel.posLevelName ?? ""}`,
|
||||||
posType: _data.posType == null ? null : _data.posType.posTypeName,
|
posType: _data.posType == null ? null : _data.posType.posTypeName,
|
||||||
posLevelId: _data.posLevel == null ? null : _data.posLevel.id,
|
posLevelId: _data.posLevel == null ? null : _data.posLevel.id,
|
||||||
posTypeId: _data.posType == null ? null : _data.posType.id,
|
posTypeId: _data.posType == null ? null : _data.posType.id,
|
||||||
|
|
@ -2612,30 +2612,30 @@ export class ProfileEmployeeController extends Controller {
|
||||||
keyword: `%${requestBody.keyword}%`,
|
keyword: `%${requestBody.keyword}%`,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
.orWhere(
|
.orWhere(
|
||||||
requestBody.keyword != null && requestBody.keyword != ""
|
requestBody.keyword != null && requestBody.keyword != ""
|
||||||
? "profileEmployee.firstName LIKE :keyword"
|
? "profileEmployee.firstName LIKE :keyword"
|
||||||
: "1=1",
|
: "1=1",
|
||||||
{
|
{
|
||||||
keyword: `%${requestBody.keyword}%`,
|
keyword: `%${requestBody.keyword}%`,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
.orWhere(
|
.orWhere(
|
||||||
requestBody.keyword != null && requestBody.keyword != ""
|
requestBody.keyword != null && requestBody.keyword != ""
|
||||||
? "profileEmployee.lastName LIKE :keyword"
|
? "profileEmployee.lastName LIKE :keyword"
|
||||||
: "1=1",
|
: "1=1",
|
||||||
{
|
{
|
||||||
keyword: `%${requestBody.keyword}%`,
|
keyword: `%${requestBody.keyword}%`,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
.orWhere(
|
.orWhere(
|
||||||
requestBody.keyword != null && requestBody.keyword != ""
|
requestBody.keyword != null && requestBody.keyword != ""
|
||||||
? "profileEmployee.citizenId LIKE :keyword"
|
? "profileEmployee.citizenId LIKE :keyword"
|
||||||
: "1=1",
|
: "1=1",
|
||||||
{
|
{
|
||||||
keyword: `%${requestBody.keyword}%`,
|
keyword: `%${requestBody.keyword}%`,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
.andWhere(
|
.andWhere(
|
||||||
|
|
@ -2663,8 +2663,8 @@ export class ProfileEmployeeController extends Controller {
|
||||||
.map((x) => x.current_holderId).length == 0
|
.map((x) => x.current_holderId).length == 0
|
||||||
? ["zxc"]
|
? ["zxc"]
|
||||||
: orgRevision.employeePosMasters
|
: orgRevision.employeePosMasters
|
||||||
.filter((x) => x.current_holderId != null)
|
.filter((x) => x.current_holderId != null)
|
||||||
.map((x) => x.current_holderId),
|
.map((x) => x.current_holderId),
|
||||||
});
|
});
|
||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
|
|
@ -2674,7 +2674,7 @@ export class ProfileEmployeeController extends Controller {
|
||||||
.orderBy("posType.posTypeRank", "ASC")
|
.orderBy("posType.posTypeRank", "ASC")
|
||||||
.addOrderBy("posLevel.posLevelRank", "ASC")
|
.addOrderBy("posLevel.posLevelRank", "ASC")
|
||||||
.getManyAndCount();
|
.getManyAndCount();
|
||||||
|
|
||||||
const data = profiles.map((_data) => ({
|
const data = profiles.map((_data) => ({
|
||||||
id: _data.id,
|
id: _data.id,
|
||||||
prefix: _data.prefix,
|
prefix: _data.prefix,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue