mirror of
https://github.com/geekgeekrun/geekgeekrun.git
synced 2026-05-06 20:02:47 +08:00
add latestLogDate column for job library; fix wrong time displayed
This commit is contained in:
@@ -5,12 +5,18 @@ const { ViewEntity, ViewColumn } = requireTypeorm();
|
||||
job_info.*,
|
||||
boss_info.name AS bossName,
|
||||
boss_info.title AS bossTitle,
|
||||
company_info.name AS companyName
|
||||
company_info.name AS companyName,
|
||||
(
|
||||
SELECT job_info_change_log.updateTime
|
||||
FROM job_info_change_log
|
||||
WHERE job_info_change_log.encryptJobId = job_info.encryptJobId
|
||||
ORDER BY job_info_change_log.updateTime ASC
|
||||
LIMIT 1
|
||||
) AS latestLogDate
|
||||
FROM
|
||||
job_info
|
||||
LEFT JOIN boss_info ON boss_info.encryptBossId = job_info.encryptBossId
|
||||
LEFT JOIN company_info ON company_info.encryptCompanyId = job_info.encryptCompanyId
|
||||
`,
|
||||
LEFT JOIN company_info ON company_info.encryptCompanyId = job_info.encryptCompanyId`,
|
||||
})
|
||||
export class VJobLibrary {
|
||||
@ViewColumn()
|
||||
@@ -54,4 +60,7 @@ export class VJobLibrary {
|
||||
|
||||
@ViewColumn()
|
||||
companyName: string;
|
||||
|
||||
@ViewColumn()
|
||||
latestLogDate: string;
|
||||
}
|
||||
|
||||
@@ -25,6 +25,7 @@ import { saveChatStartupRecord, saveJobInfoFromRecommendPage, saveMarkAsNotSuitR
|
||||
import { UpdateChatStartupLogTable1729182577167 } from "./migrations/1729182577167-UpdateChatStartupLogTable";
|
||||
import minimist from 'minimist'
|
||||
import { UpdateBossInfoTable1732032381304 } from "./migrations/1732032381304-UpdateBossInfoTable";
|
||||
import { ChangeJobLibraryView1744467048874 } from "./migrations/1744467048874-ChangeJobLibraryView";
|
||||
|
||||
export function initDb(dbFilePath) {
|
||||
const { DataSource } = requireTypeorm()
|
||||
@@ -56,7 +57,8 @@ export function initDb(dbFilePath) {
|
||||
],
|
||||
migrations: [
|
||||
UpdateChatStartupLogTable1729182577167,
|
||||
UpdateBossInfoTable1732032381304
|
||||
UpdateBossInfoTable1732032381304,
|
||||
ChangeJobLibraryView1744467048874
|
||||
],
|
||||
migrationsRun: true
|
||||
});
|
||||
|
||||
@@ -5,31 +5,28 @@ const viewNames = [
|
||||
"v_chat_startup_log",
|
||||
"v_company_library",
|
||||
"v_job_library",
|
||||
"v_mark_as_not_suit_log"
|
||||
"v_mark_as_not_suit_log",
|
||||
];
|
||||
|
||||
export class UpdateBossInfoTable1732032381304 implements MigrationInterface {
|
||||
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||
for (const viewName of viewNames) {
|
||||
await queryRunner.query(`DROP VIEW IF EXISTS "${viewName}"`);
|
||||
}
|
||||
if (await queryRunner.hasTable("boss_info")) {
|
||||
if (await queryRunner.hasColumn("boss_info", "encryptCompanyId")) {
|
||||
await queryRunner.changeColumn(
|
||||
'boss_info',
|
||||
'encryptCompanyId',
|
||||
new TableColumn({
|
||||
name: 'encryptCompanyId',
|
||||
type: 'varchar',
|
||||
isNullable: true
|
||||
})
|
||||
)
|
||||
debugger
|
||||
}
|
||||
}
|
||||
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||
for (const viewName of viewNames) {
|
||||
await queryRunner.query(`DROP VIEW IF EXISTS "${viewName}"`);
|
||||
}
|
||||
|
||||
public async down(queryRunner: QueryRunner): Promise<void> {
|
||||
if (await queryRunner.hasTable("boss_info")) {
|
||||
if (await queryRunner.hasColumn("boss_info", "encryptCompanyId")) {
|
||||
await queryRunner.changeColumn(
|
||||
"boss_info",
|
||||
"encryptCompanyId",
|
||||
new TableColumn({
|
||||
name: "encryptCompanyId",
|
||||
type: "varchar",
|
||||
isNullable: true,
|
||||
})
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public async down(queryRunner: QueryRunner): Promise<void> {}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
import { MigrationInterface, QueryRunner } from "typeorm";
|
||||
const viewNames = [
|
||||
"v_boss_library",
|
||||
"v_chat_startup_log",
|
||||
"v_company_library",
|
||||
"v_job_library",
|
||||
"v_mark_as_not_suit_log",
|
||||
];
|
||||
export class ChangeJobLibraryView1744467048874 implements MigrationInterface {
|
||||
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||
for (const viewName of viewNames) {
|
||||
await queryRunner.query(`DROP VIEW IF EXISTS "${viewName}"`);
|
||||
}
|
||||
}
|
||||
|
||||
public async down(queryRunner: QueryRunner): Promise<void> {}
|
||||
}
|
||||
@@ -3,9 +3,20 @@
|
||||
<el-form-item label="公司">{{ jobInfo.companyName }}</el-form-item>
|
||||
<el-form-item label="职位名称">{{ jobInfo.jobName }}</el-form-item>
|
||||
<el-form-item label="职位分类">{{ jobInfo.positionName }}</el-form-item>
|
||||
<el-form-item label="开聊时间">{{
|
||||
transformUtcDateToLocalDate(jobInfo.date).format('YYYY-MM-DD HH:mm:ss')
|
||||
}}</el-form-item>
|
||||
<el-form-item v-if="scene === 'jobLibrary'" label="最近抓取时间">
|
||||
{{
|
||||
jobInfo.latestLogDate
|
||||
? transformUtcDateToLocalDate(jobInfo.latestLogDate).format('YYYY-MM-DD HH:mm:ss')
|
||||
: '无记录,数据可能来自旧版本'
|
||||
}}
|
||||
</el-form-item>
|
||||
<el-form-item v-if="scene !== 'jobLibrary'" label="开聊时间">
|
||||
{{
|
||||
jobInfo.date
|
||||
? transformUtcDateToLocalDate(jobInfo.date).format('YYYY-MM-DD HH:mm:ss')
|
||||
: '无记录'
|
||||
}}
|
||||
</el-form-item>
|
||||
<el-form-item label="工作经验">{{ jobInfo.experienceName }}</el-form-item>
|
||||
<el-form-item label="薪资">{{
|
||||
`${jobInfo.salaryLow}-${jobInfo.salaryHigh}k` +
|
||||
@@ -21,12 +32,16 @@
|
||||
<script setup lang="ts">
|
||||
import { PropType } from 'vue'
|
||||
import { type VChatStartupLog } from '@geekgeekrun/sqlite-plugin/src/entity/VChatStartupLog'
|
||||
import { type VJobLibrary } from '@geekgeekrun/sqlite-plugin/src/entity/VJobLibrary'
|
||||
import { transformUtcDateToLocalDate } from '@geekgeekrun/utils/date.mjs'
|
||||
|
||||
const props = defineProps({
|
||||
defineProps({
|
||||
jobInfo: {
|
||||
type: Object as PropType<VChatStartupLog>,
|
||||
type: Object as PropType<VChatStartupLog | VJobLibrary>,
|
||||
required: true
|
||||
},
|
||||
scene: {
|
||||
type: String
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
@@ -38,6 +38,7 @@
|
||||
link
|
||||
type="primary"
|
||||
size="small"
|
||||
:disabled="!row.latestLogDate"
|
||||
@click="handleViewJobHistoryButtonClick(row)"
|
||||
>变更记录</ElButton
|
||||
>
|
||||
@@ -74,6 +75,7 @@
|
||||
<JobInfoSnapshot
|
||||
v-if="selectedJobInfoForViewSnapshot"
|
||||
:job-info="selectedJobInfoForViewSnapshot"
|
||||
scene="jobLibrary"
|
||||
@closed="selectedJobInfoForViewSnapshot = null"
|
||||
/>
|
||||
</ElDrawer>
|
||||
|
||||
Reference in New Issue
Block a user