refactor: remove scheduled cron sync, manual trigger only
This commit is contained in:
@@ -49,6 +49,32 @@ export class SyncController {
|
||||
return this.syncService.getLogs(platform, limit ? Number(limit) : 50);
|
||||
}
|
||||
|
||||
// ── 排班同步 ──
|
||||
|
||||
/** 触发排班同步到钉钉考勤排班 */
|
||||
@Post('schedule/sync')
|
||||
@RequirePermission('sync:trigger')
|
||||
async syncSchedule(
|
||||
@Query('dateFrom') dateFrom?: string,
|
||||
@Query('days') days?: string,
|
||||
) {
|
||||
const result = await this.syncService.syncScheduleToDingTalk(
|
||||
dateFrom,
|
||||
days ? parseInt(days, 10) : 30,
|
||||
);
|
||||
return { success: true, data: result };
|
||||
}
|
||||
|
||||
/** 查询钉钉排班状态(核对本地 vs 钉钉) */
|
||||
@Get('schedule/status')
|
||||
@RequirePermission('sync:read')
|
||||
async getScheduleStatus(
|
||||
@Query('date') date?: string,
|
||||
) {
|
||||
const status = await this.syncService.getScheduleSyncStatus(date);
|
||||
return { success: true, data: status };
|
||||
}
|
||||
|
||||
private parseRootDeptId(rootDeptId: string): number {
|
||||
const parsed = parseInt(rootDeptId, 10);
|
||||
if (isNaN(parsed)) {
|
||||
|
||||
Reference in New Issue
Block a user