space posno
This commit is contained in:
parent
b1b9700e40
commit
d9fb4110e3
18 changed files with 1283 additions and 875 deletions
|
|
@ -2487,24 +2487,31 @@ export class ImportDataController extends Controller {
|
|||
let _null: any = null;
|
||||
let sqlStatements: string[] = [];
|
||||
|
||||
const [profiles, total] = await AppDataSource.getRepository(Profile)
|
||||
.createQueryBuilder("profile")
|
||||
.select(["profile.citizenId", "profile.id"])
|
||||
.orderBy("profile.citizenId", "ASC")
|
||||
// .skip(0)
|
||||
// .take(1000)
|
||||
.getManyAndCount();
|
||||
const filePath = path.join(__dirname, "salaryProfile1.csv");
|
||||
// CSV Header
|
||||
let csvData = `"id","createdAt","createdUserId","lastUpdatedAt","lastUpdateUserId","createdFullName","lastUpdateFullName","profileId","profileEmployeeId","order","commandNo","commandYear","commandDateSign","commandDateAffect","commandCode","commandName","posNoAbb","posNo","positionName","positionType","positionLevel","positionCee","orgRoot","orgChild1","orgChild2","orgChild3","orgChild4","positionExecutive","amount","amountSpecial","positionSalaryAmount","mouthSalaryAmount","remark","dateGovernment","isGovernment","commandId","refId","isEntry"\n`;
|
||||
|
||||
fs.appendFile(filePath, csvData, (err) => {
|
||||
if (err) {
|
||||
console.error("Error writing CSV file:", err);
|
||||
} else {
|
||||
console.log("Salary profiles successfully written to salaryProfile.csv");
|
||||
}
|
||||
// const [profiles, total] = await AppDataSource.getRepository(Profile)
|
||||
// .createQueryBuilder("profile")
|
||||
// .select(["profile.citizenId", "profile.id"])
|
||||
// .orderBy("profile.citizenId", "ASC")
|
||||
// // .skip(0)
|
||||
// // .take(1000)
|
||||
// .getManyAndCount();
|
||||
const profiles = await this.profileRepo.find({
|
||||
where: { profileSalary: { isEntry: Not(true) } },
|
||||
order: {
|
||||
citizenId: "ASC",
|
||||
},
|
||||
select: ["citizenId", "id"],
|
||||
});
|
||||
// const filePath = path.join(__dirname, "salaryProfile1.csv");
|
||||
// CSV Header
|
||||
// let csvData = `"id","createdAt","createdUserId","lastUpdatedAt","lastUpdateUserId","createdFullName","lastUpdateFullName","profileId","profileEmployeeId","order","commandNo","commandYear","commandDateSign","commandDateAffect","commandCode","commandName","posNoAbb","posNo","positionName","positionType","positionLevel","positionCee","orgRoot","orgChild1","orgChild2","orgChild3","orgChild4","positionExecutive","amount","amountSpecial","positionSalaryAmount","mouthSalaryAmount","remark","dateGovernment","isGovernment","commandId","refId","isEntry"\n`;
|
||||
|
||||
// fs.appendFile(filePath, csvData, (err) => {
|
||||
// if (err) {
|
||||
// console.error("Error writing CSV file:", err);
|
||||
// } else {
|
||||
// console.log("Salary profiles successfully written to salaryProfile.csv");
|
||||
// }
|
||||
// });
|
||||
// await Promise.all(
|
||||
// profiles.map(async (_item) => {
|
||||
for await (const _item of profiles) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue