feat: bills expense type filter (backend join + frontend Select), sync stub docs

This commit is contained in:
2026-07-06 14:48:47 +08:00
parent 4b02012634
commit 20f3b79179
4 changed files with 20 additions and 9 deletions

View File

@@ -77,12 +77,12 @@ export class BillsController {
@Query('periodEnd') periodEnd?: string,
@Query('studentId') studentId?: string,
@Query('status') status?: string,
@Query('expenseType') expenseType?: string,
) {
return this.service.findAll({
periodStart,
periodEnd,
periodStart, periodEnd,
studentId: studentId ? +studentId : undefined,
status,
status, expenseType,
});
}

View File

@@ -227,6 +227,7 @@ export class BillsService {
periodEnd?: string;
studentId?: number;
status?: string;
expenseType?: string;
}) {
const scopeIds = await this.scope.getScopeDepartmentIds();
const qb = this.billRepo
@@ -238,6 +239,9 @@ export class BillsService {
if (query?.periodEnd) qb.andWhere('b.periodEnd = :pe', { pe: query.periodEnd });
if (query?.studentId) qb.andWhere('b.studentId = :sid', { sid: query.studentId });
if (query?.status) qb.andWhere('b.status = :status', { status: query.status });
if (query?.expenseType) {
qb.innerJoin('b.items', 'bi', 'bi.expenseType = :et', { et: query.expenseType });
}
const bills = await qb.getMany();
return this.attachDepositInfo(bills);
}

View File

@@ -157,10 +157,11 @@ export class SyncService {
this.logger.warn('DingTalk not configured (DINGTALK_APP_KEY missing), skipping sync');
return 0;
}
this.logger.warn(
'DingTalk integration service not yet implemented — add DingTalkService to SyncModule to enable real sync',
);
// 接入指引:
// 1. 创建 apps/server/src/integration/dingtalk.service.ts实现 fetchDepartments()/fetchUsers()
// 2. 在 SyncModule 中注入 DingTalkService
// 3. 取消以下注释并调用 this.dingTalkService.fetchDepartments()
this.logger.warn('DingTalk sync stub: create DingTalkService in src/integration/ to enable real sync');
return 0;
}