no message

This commit is contained in:
Kittapath 2024-02-28 14:46:17 +07:00
parent 6ed7265094
commit 8339e6ce6d
4 changed files with 32 additions and 25 deletions

View file

@ -28,6 +28,7 @@ import { PosLevel } from "../entities/PosLevel";
import { Salarys } from "../entities/Salarys";
import { SalaryRanks } from "../entities/SalaryRanks";
import CallAPI from "../interfaces/call-api";
import { Int32 } from "typeorm/browser";
@Route("api/v1/salary/period")
@Tags("Salary")
@ -772,30 +773,25 @@ export class SalaryPeriodController extends Controller {
const salaryProfile = await this.salaryProfileRepository.find({
where: { salaryOrgId: In(salaryOrg.map((x) => x.id)) },
});
await this.salaryOrgRepository.remove(salaryOrg);
await this.salaryProfileRepository.remove(salaryProfile);
await this.salaryOrgRepository.remove(salaryOrg);
console.log("11111111111111111111111");
let orgs = await new CallAPI().GetData(request, "org/active/root/id");
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);
let total = 1000;
let _orgProfiles = await new CallAPI().PostData(request, "org/profile/salary/gen", {
page: 1,
pageSize: 1000,
keyword: "",
});
let orgProfiles = _orgProfiles.data;
total = _orgProfiles.total;
if (total > 1000) {
const page = Math.ceil(total / 1000);
for (let index = 2; index <= page; index++) {
await new CallAPI()
.PostData(request, "org/profile/salary/gen", {
page: index,
pageSize: 100,
pageSize: 1000,
keyword: "",
})
.then((x) => {
@ -803,9 +799,7 @@ export class SalaryPeriodController extends Controller {
});
}
}
console.log("44444444444444444444444");
let revisionId = await new CallAPI().GetData(request, "org/revision/latest");
console.log("55555555555555555555555");
salaryPeriod.revisionId = revisionId;
await this.salaryPeriodRepository.save(salaryPeriod);