This commit is contained in:
moss 2025-03-26 10:12:56 +07:00
parent 0d9a5d6979
commit ac67f49dfb

View file

@ -2096,23 +2096,23 @@ export class SalaryPeriodController extends Controller {
await this.salaryProfileEmployeeRepository.remove(salaryProfileEmployee, { data: request }); await this.salaryProfileEmployeeRepository.remove(salaryProfileEmployee, { data: request });
await this.salaryOrgEmployeeRepository.remove(salaryOrgEmployee, { data: request }); await this.salaryOrgEmployeeRepository.remove(salaryOrgEmployee, { data: request });
let orgs = await new CallAPI().GetData(request, "/org/unauthorize/active/root/id"); let orgs = await new CallAPI().GetData(request, "/org/unauthorize/active/root/id");
let total = 1000; let total = 100;
let _orgProfiles = await new CallAPI().PostData(request, "/org/unauthorize/salary/gen", { let _orgProfiles = await new CallAPI().PostData(request, "/org/unauthorize/salary/gen", {
page: 1, page: 1,
pageSize: 1000, pageSize: 100,
keyword: "", keyword: "",
year: salaryPeriod.year, year: salaryPeriod.year,
period: salaryPeriod.period, period: salaryPeriod.period,
}); });
let orgProfiles = _orgProfiles.data; let orgProfiles = _orgProfiles.data;
total = _orgProfiles.total; total = _orgProfiles.total;
if (total > 1000) { if (total > 100) {
const page = Math.ceil(total / 1000); const page = Math.ceil(total / 100);
for (let index = 2; index <= page; index++) { for (let index = 2; index <= page; index++) {
await new CallAPI() await new CallAPI()
.PostData(request, "/org/unauthorize/salary/gen", { .PostData(request, "/org/unauthorize/salary/gen", {
page: index, page: index,
pageSize: 1000, pageSize: 100,
keyword: "", keyword: "",
year: salaryPeriod.year, year: salaryPeriod.year,
period: salaryPeriod.period, period: salaryPeriod.period,
@ -2122,14 +2122,14 @@ export class SalaryPeriodController extends Controller {
}); });
} }
} }
total = 1000; total = 100;
let orgProfileEmployees: any; let orgProfileEmployees: any;
let _orgProfileEmployees = await new CallAPI().PostData( let _orgProfileEmployees = await new CallAPI().PostData(
request, request,
"/org/unauthorize/salary/employee/gen", "/org/unauthorize/salary/employee/gen",
{ {
page: 1, page: 1,
pageSize: 1000, pageSize: 100,
keyword: "", keyword: "",
year: salaryPeriod.year, year: salaryPeriod.year,
period: salaryPeriod.period, period: salaryPeriod.period,
@ -2137,13 +2137,13 @@ export class SalaryPeriodController extends Controller {
); );
orgProfileEmployees = _orgProfileEmployees.data; orgProfileEmployees = _orgProfileEmployees.data;
total = _orgProfileEmployees.total; total = _orgProfileEmployees.total;
if (total > 1000) { if (total > 100) {
const page = Math.ceil(total / 1000); const page = Math.ceil(total / 100);
for (let index = 2; index <= page; index++) { for (let index = 2; index <= page; index++) {
await new CallAPI() await new CallAPI()
.PostData(request, "/org/unauthorize/salary/employee/gen", { .PostData(request, "/org/unauthorize/salary/employee/gen", {
page: index, page: index,
pageSize: 1000, pageSize: 100,
keyword: "", keyword: "",
year: salaryPeriod.year, year: salaryPeriod.year,
period: salaryPeriod.period, period: salaryPeriod.period,
@ -2154,7 +2154,7 @@ export class SalaryPeriodController extends Controller {
} }
} }
let revisionId = await new CallAPI().GetData(request, "/org/unauthorize/revision/latest"); let revisionId = await new CallAPI().GetData(request, "/org/unauthorize/revision/latest");
let _null:any = null; let _null: any = null;
const beforeSalaryPeriod = structuredClone(salaryPeriod); const beforeSalaryPeriod = structuredClone(salaryPeriod);
salaryPeriod.revisionId = revisionId; salaryPeriod.revisionId = revisionId;
salaryPeriod.lastUpdateUserId = request.user.sub; salaryPeriod.lastUpdateUserId = request.user.sub;
@ -2172,7 +2172,7 @@ export class SalaryPeriodController extends Controller {
salaryOrgNew.salaryPeriodId = salaryPeriod.id; salaryOrgNew.salaryPeriodId = salaryPeriod.id;
salaryOrgNew.status = "PENDING"; salaryOrgNew.status = "PENDING";
salaryOrgNew.rootId = root.rootId; salaryOrgNew.rootId = root.rootId;
salaryOrgNew.rootDnaId = root.rootDnaId??_null; salaryOrgNew.rootDnaId = root.rootDnaId ?? _null;
salaryOrgNew.root = root.root; salaryOrgNew.root = root.root;
salaryOrgNew.revisionId = salaryPeriod.revisionId; salaryOrgNew.revisionId = salaryPeriod.revisionId;
salaryOrgNew.snapshot = snapshot; salaryOrgNew.snapshot = snapshot;
@ -2657,23 +2657,23 @@ export class SalaryPeriodController extends Controller {
await this.salaryOrgEmployeeRepository.remove(salaryOrgEmployee, { data: request }); await this.salaryOrgEmployeeRepository.remove(salaryOrgEmployee, { data: request });
let orgs = await new CallAPI().GetData(request, "/org/unauthorize/active/root/id"); let orgs = await new CallAPI().GetData(request, "/org/unauthorize/active/root/id");
let total = 1000; let total = 100;
let _orgProfiles = await new CallAPI().PostData(request, "/org/unauthorize/salary/gen", { let _orgProfiles = await new CallAPI().PostData(request, "/org/unauthorize/salary/gen", {
page: 1, page: 1,
pageSize: 1000, pageSize: 100,
keyword: "", keyword: "",
year: salaryPeriod.year, year: salaryPeriod.year,
period: salaryPeriod.period, period: salaryPeriod.period,
}); });
let orgProfiles = _orgProfiles.data; let orgProfiles = _orgProfiles.data;
total = _orgProfiles.total; total = _orgProfiles.total;
if (total > 1000) { if (total > 100) {
const page = Math.ceil(total / 1000); const page = Math.ceil(total / 100);
for (let index = 2; index <= page; index++) { for (let index = 2; index <= page; index++) {
await new CallAPI() await new CallAPI()
.PostData(request, "/org/unauthorize/profile/salary/gen", { .PostData(request, "/org/unauthorize/profile/salary/gen", {
page: index, page: index,
pageSize: 1000, pageSize: 100,
keyword: "", keyword: "",
year: salaryPeriod.year, year: salaryPeriod.year,
period: salaryPeriod.period, period: salaryPeriod.period,
@ -2683,13 +2683,13 @@ export class SalaryPeriodController extends Controller {
}); });
} }
} }
total = 1000; total = 100;
let _orgProfileEmployees = await new CallAPI().PostData( let _orgProfileEmployees = await new CallAPI().PostData(
request, request,
"/org/unauthorize/profile/salary/employee/gen", "/org/unauthorize/profile/salary/employee/gen",
{ {
page: 1, page: 1,
pageSize: 1000, pageSize: 100,
keyword: "", keyword: "",
year: salaryPeriod.year, year: salaryPeriod.year,
period: salaryPeriod.period, period: salaryPeriod.period,
@ -2697,13 +2697,13 @@ export class SalaryPeriodController extends Controller {
); );
let orgProfileEmployees = _orgProfileEmployees.data; let orgProfileEmployees = _orgProfileEmployees.data;
total = _orgProfileEmployees.total; total = _orgProfileEmployees.total;
if (total > 1000) { if (total > 100) {
const page = Math.ceil(total / 1000); const page = Math.ceil(total / 100);
for (let index = 2; index <= page; index++) { for (let index = 2; index <= page; index++) {
await new CallAPI() await new CallAPI()
.PostData(request, "/org/unauthorize/profile/salary/employee/gen", { .PostData(request, "/org/unauthorize/profile/salary/employee/gen", {
page: index, page: index,
pageSize: 1000, pageSize: 100,
keyword: "", keyword: "",
year: salaryPeriod.year, year: salaryPeriod.year,
period: salaryPeriod.period, period: salaryPeriod.period,