no message
This commit is contained in:
parent
928d806313
commit
2446c755e6
2 changed files with 38 additions and 30 deletions
|
|
@ -61,6 +61,7 @@ export class OrganizationUnauthorizeController extends Controller {
|
||||||
.leftJoinAndSelect("positions.posExecutive", "posExecutive")
|
.leftJoinAndSelect("positions.posExecutive", "posExecutive")
|
||||||
.leftJoinAndSelect("current_holder.profileSalary", "profileSalary")
|
.leftJoinAndSelect("current_holder.profileSalary", "profileSalary")
|
||||||
.leftJoinAndSelect("current_holder.profileDisciplines", "profileDisciplines")
|
.leftJoinAndSelect("current_holder.profileDisciplines", "profileDisciplines")
|
||||||
|
.leftJoinAndSelect("current_holder.profileLeaves", "profileLeaves")
|
||||||
.leftJoinAndSelect("current_holder.profileAssessments", "profileAssessments")
|
.leftJoinAndSelect("current_holder.profileAssessments", "profileAssessments")
|
||||||
.leftJoinAndSelect("current_holder.posLevel", "posLevel")
|
.leftJoinAndSelect("current_holder.posLevel", "posLevel")
|
||||||
.leftJoinAndSelect("current_holder.posType", "posType")
|
.leftJoinAndSelect("current_holder.posType", "posType")
|
||||||
|
|
@ -191,11 +192,9 @@ export class OrganizationUnauthorizeController extends Controller {
|
||||||
const isSpecial = specialPosition ? specialPosition.isSpecial : null;
|
const isSpecial = specialPosition ? specialPosition.isSpecial : null;
|
||||||
|
|
||||||
const latestProfileAssessment = item.current_holder.profileAssessments
|
const latestProfileAssessment = item.current_holder.profileAssessments
|
||||||
? item.current_holder.profileAssessments.sort((a:any, b:any) => b.date - a.date)[0]
|
? item.current_holder.profileAssessments.sort((a: any, b: any) => b.date - a.date)[0]
|
||||||
: null;
|
|
||||||
const pointSumtotal = latestProfileAssessment
|
|
||||||
? latestProfileAssessment.pointSumTotal
|
|
||||||
: null;
|
: null;
|
||||||
|
const pointSumtotal = latestProfileAssessment ? latestProfileAssessment.pointSumTotal : null;
|
||||||
return {
|
return {
|
||||||
id: item.id,
|
id: item.id,
|
||||||
profileId: item.current_holder.id,
|
profileId: item.current_holder.id,
|
||||||
|
|
@ -239,8 +238,8 @@ export class OrganizationUnauthorizeController extends Controller {
|
||||||
? true
|
? true
|
||||||
: false,
|
: false,
|
||||||
isSuspension: item.current_holder.dateRetire == null ? false : true,
|
isSuspension: item.current_holder.dateRetire == null ? false : true,
|
||||||
isAbsent: false,
|
isAbsent: item.current_holder.profileDisciplines.length > 0 ? true : false,
|
||||||
isLeave: false,
|
isLeave: item.current_holder.profileLeaves.length > 0 ? true : false,
|
||||||
isRetired:
|
isRetired:
|
||||||
item.current_holder.birthDate == null ||
|
item.current_holder.birthDate == null ||
|
||||||
calculateRetireDate(item.current_holder.birthDate).getFullYear() != body.year
|
calculateRetireDate(item.current_holder.birthDate).getFullYear() != body.year
|
||||||
|
|
@ -287,6 +286,7 @@ export class OrganizationUnauthorizeController extends Controller {
|
||||||
.leftJoinAndSelect("employeePosMaster.positions", "positions")
|
.leftJoinAndSelect("employeePosMaster.positions", "positions")
|
||||||
.leftJoinAndSelect("current_holder.profileSalarys", "profileSalarys")
|
.leftJoinAndSelect("current_holder.profileSalarys", "profileSalarys")
|
||||||
.leftJoinAndSelect("current_holder.profileDisciplines", "profileDisciplines")
|
.leftJoinAndSelect("current_holder.profileDisciplines", "profileDisciplines")
|
||||||
|
.leftJoinAndSelect("current_holder.profileLeaves", "profileLeaves")
|
||||||
.leftJoinAndSelect("current_holder.profileAssessments", "profileAssessments")
|
.leftJoinAndSelect("current_holder.profileAssessments", "profileAssessments")
|
||||||
.leftJoinAndSelect("current_holder.posLevel", "posLevel")
|
.leftJoinAndSelect("current_holder.posLevel", "posLevel")
|
||||||
.leftJoinAndSelect("current_holder.posType", "posType")
|
.leftJoinAndSelect("current_holder.posType", "posType")
|
||||||
|
|
@ -401,10 +401,10 @@ export class OrganizationUnauthorizeController extends Controller {
|
||||||
datePeriodStart.getMonth() - 6,
|
datePeriodStart.getMonth() - 6,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
const latestProfileAssessment = item.current_holder.profileAssessments
|
const latestProfileAssessment = item.current_holder.profileAssessments
|
||||||
? item.current_holder.profileAssessments.sort((a: any, b: any) => b.date - a.date)[0]
|
? item.current_holder.profileAssessments.sort((a: any, b: any) => b.date - a.date)[0]
|
||||||
: null;
|
: null;
|
||||||
const pointSumtotal = latestProfileAssessment ? latestProfileAssessment.pointSumTotal : null;
|
const pointSum = latestProfileAssessment ? latestProfileAssessment.pointSum : null;
|
||||||
return {
|
return {
|
||||||
profileId: item.current_holder.id,
|
profileId: item.current_holder.id,
|
||||||
salaryLevel: item.current_holder.salaryLevel,
|
salaryLevel: item.current_holder.salaryLevel,
|
||||||
|
|
@ -435,7 +435,7 @@ export class OrganizationUnauthorizeController extends Controller {
|
||||||
child3: item.orgChild3?.orgChild3Name ? item.orgChild3.orgChild3Name : null,
|
child3: item.orgChild3?.orgChild3Name ? item.orgChild3.orgChild3Name : null,
|
||||||
child4Id: item.orgChild4Id,
|
child4Id: item.orgChild4Id,
|
||||||
child4: item.orgChild4?.orgChild4Name ? item.orgChild4.orgChild4Name : null,
|
child4: item.orgChild4?.orgChild4Name ? item.orgChild4.orgChild4Name : null,
|
||||||
result: pointSumtotal,
|
result: pointSum,
|
||||||
duration: null,
|
duration: null,
|
||||||
isPunish:
|
isPunish:
|
||||||
item.current_holder.profileDisciplines.filter(
|
item.current_holder.profileDisciplines.filter(
|
||||||
|
|
@ -450,8 +450,8 @@ export class OrganizationUnauthorizeController extends Controller {
|
||||||
? true
|
? true
|
||||||
: false,
|
: false,
|
||||||
isSuspension: item.current_holder.dateRetire == null ? false : true,
|
isSuspension: item.current_holder.dateRetire == null ? false : true,
|
||||||
isAbsent: false,
|
isAbsent: item.current_holder.profileDisciplines.length > 0 ? true : false,
|
||||||
isLeave: false,
|
isLeave: item.current_holder.profileLeaves.length > 0 ? true : false,
|
||||||
isRetired:
|
isRetired:
|
||||||
item.current_holder.birthDate == null ||
|
item.current_holder.birthDate == null ||
|
||||||
calculateRetireDate(item.current_holder.birthDate).getFullYear() != body.year
|
calculateRetireDate(item.current_holder.birthDate).getFullYear() != body.year
|
||||||
|
|
|
||||||
|
|
@ -17,21 +17,31 @@ export function calculateAge(start: Date, end = new Date()) {
|
||||||
// end.getDate();
|
// end.getDate();
|
||||||
// }
|
// }
|
||||||
|
|
||||||
if (day < 0) {
|
if (day < 0) {
|
||||||
month -= 1;
|
month -= 1;
|
||||||
day += new Date(end.getFullYear(), end.getMonth(), 0).getDate();
|
day += new Date(end.getFullYear(), end.getMonth(), 0).getDate();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (month < 0) {
|
|
||||||
month += 12;
|
|
||||||
year -= 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
if (month < 0) {
|
||||||
|
month += 12;
|
||||||
|
year -= 1;
|
||||||
|
}
|
||||||
|
|
||||||
return { year, month, day };
|
return { year, month, day };
|
||||||
}
|
}
|
||||||
|
|
||||||
export function calculateRetireDate(birthDate: Date) {
|
export function calculateRetireDate(birthDate: Date) {
|
||||||
|
// let _birthDate = birthDate;
|
||||||
|
|
||||||
|
// _birthDate.setFullYear(_birthDate.getFullYear() + 60); var year = d.getFullYear();
|
||||||
|
var d = birthDate;
|
||||||
|
var year = d.getFullYear();
|
||||||
|
var month = d.getMonth();
|
||||||
|
var day = d.getDate();
|
||||||
|
var c = new Date(year + 60, month, day);
|
||||||
|
return c;
|
||||||
|
}
|
||||||
|
export function calculateRetireLaw(birthDate: Date) {
|
||||||
let dd = birthDate.getDate();
|
let dd = birthDate.getDate();
|
||||||
let mm = birthDate.getMonth();
|
let mm = birthDate.getMonth();
|
||||||
let yy = birthDate.getFullYear();
|
let yy = birthDate.getFullYear();
|
||||||
|
|
@ -39,23 +49,21 @@ export function calculateRetireDate(birthDate: Date) {
|
||||||
let flag = true;
|
let flag = true;
|
||||||
|
|
||||||
switch (mm) {
|
switch (mm) {
|
||||||
case 10:
|
case 9:
|
||||||
if (dd >= 2) flag = false;
|
if (dd >= 2) flag = false;
|
||||||
break;
|
break;
|
||||||
case 11:
|
case 10:
|
||||||
|
flag = false;
|
||||||
break;
|
break;
|
||||||
case 12:
|
case 11:
|
||||||
|
flag = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (flag) return new Date(`${yy + 60}-09-30T00:00:00.000+07:00`);
|
if (flag == true) return new Date(`${yy + 60}-09-30T00:00:00.000+07:00`);
|
||||||
|
|
||||||
return new Date(`${yy + 61}-09-30T00:00:00.000+07:00`);
|
return new Date(`${yy + 61}-09-30T00:00:00.000+07:00`);
|
||||||
}
|
}
|
||||||
export function calculateRetireLaw(birthDate: Date) {
|
|
||||||
let yy = birthDate.getFullYear();
|
|
||||||
return new Date(`${yy + 60}-09-30T00:00:00.000+07:00`);
|
|
||||||
}
|
|
||||||
|
|
||||||
export function calculateRetireYear(birthDate: Date) {
|
export function calculateRetireYear(birthDate: Date) {
|
||||||
let dd = birthDate.getDate();
|
let dd = birthDate.getDate();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue