no message
This commit is contained in:
parent
4d24a34674
commit
6ed7265094
2 changed files with 56 additions and 31 deletions
|
|
@ -775,13 +775,37 @@ export class SalaryPeriodController extends Controller {
|
|||
await this.salaryOrgRepository.remove(salaryOrg);
|
||||
await this.salaryProfileRepository.remove(salaryProfile);
|
||||
|
||||
console.log("11111111111111111111111");
|
||||
let orgs = await new CallAPI().GetData(request, "org/active/root/id");
|
||||
let orgProfiles = await new CallAPI().PostData(request, "org/profile/salary/gen", {
|
||||
page: 1,
|
||||
pageSize: 100,
|
||||
keyword: "",
|
||||
});
|
||||
console.log("22222222222222222222222");
|
||||
let orgProfiles: any;
|
||||
await new CallAPI()
|
||||
.PostData(request, "org/profile/salary/gen", {
|
||||
page: 1,
|
||||
pageSize: 100,
|
||||
keyword: "",
|
||||
})
|
||||
.then((x) => {
|
||||
orgProfiles = x.data;
|
||||
});
|
||||
console.log("333333333333333333333");
|
||||
if (orgProfiles.total > 100) {
|
||||
const page = Math.ceil(orgProfiles.total.length / 100);
|
||||
for (let index = 2; index <= page; index++) {
|
||||
await new CallAPI()
|
||||
.PostData(request, "org/profile/salary/gen", {
|
||||
page: index,
|
||||
pageSize: 100,
|
||||
keyword: "",
|
||||
})
|
||||
.then((x) => {
|
||||
Array.prototype.push.apply(orgProfiles, x.data);
|
||||
});
|
||||
}
|
||||
}
|
||||
console.log("44444444444444444444444");
|
||||
let revisionId = await new CallAPI().GetData(request, "org/revision/latest");
|
||||
console.log("55555555555555555555555");
|
||||
|
||||
salaryPeriod.revisionId = revisionId;
|
||||
await this.salaryPeriodRepository.save(salaryPeriod);
|
||||
|
|
@ -882,42 +906,39 @@ export class SalaryPeriodController extends Controller {
|
|||
*/
|
||||
async CronjobSalaryPeriod() {
|
||||
const current = new Date();
|
||||
let salaryPeriod: any
|
||||
let salaryPeriod: any;
|
||||
// console.log(current.getDate(), current.getMonth() , current.getFullYear())
|
||||
if(current.getDate() == 1 && current.getMonth() == 2){
|
||||
salaryPeriod = await this.salaryPeriodRepository.findOne({
|
||||
where: {
|
||||
if (current.getDate() == 1 && current.getMonth() == 2) {
|
||||
salaryPeriod = await this.salaryPeriodRepository.findOne({
|
||||
where: {
|
||||
year: current.getFullYear(),
|
||||
period: "MAR",
|
||||
isActive: true
|
||||
}
|
||||
isActive: true,
|
||||
},
|
||||
});
|
||||
}
|
||||
else if(current.getDate() == 1 && current.getMonth() == 3){
|
||||
salaryPeriod = await this.salaryPeriodRepository.findOne({
|
||||
where: {
|
||||
} else if (current.getDate() == 1 && current.getMonth() == 3) {
|
||||
salaryPeriod = await this.salaryPeriodRepository.findOne({
|
||||
where: {
|
||||
year: current.getFullYear(),
|
||||
period: "APR",
|
||||
isActive: true
|
||||
}
|
||||
isActive: true,
|
||||
},
|
||||
});
|
||||
}
|
||||
else if(current.getDate() == 1 && current.getMonth() == 8){
|
||||
salaryPeriod = await this.salaryPeriodRepository.findOne({
|
||||
where: {
|
||||
} else if (current.getDate() == 1 && current.getMonth() == 8) {
|
||||
salaryPeriod = await this.salaryPeriodRepository.findOne({
|
||||
where: {
|
||||
year: current.getFullYear(),
|
||||
period: "SEP",
|
||||
isActive: true
|
||||
}
|
||||
isActive: true,
|
||||
},
|
||||
});
|
||||
}
|
||||
else if(current.getDate() == 1 && current.getMonth() == 9){
|
||||
salaryPeriod = await this.salaryPeriodRepository.findOne({
|
||||
where: {
|
||||
} else if (current.getDate() == 1 && current.getMonth() == 9) {
|
||||
salaryPeriod = await this.salaryPeriodRepository.findOne({
|
||||
where: {
|
||||
year: current.getFullYear(),
|
||||
period: "OCT",
|
||||
isActive: true
|
||||
}
|
||||
isActive: true,
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue