物流对账单
This commit is contained in:
@@ -373,6 +373,86 @@ export class AdminWineryBillController {
|
||||
}
|
||||
}
|
||||
|
||||
@Controller('admin/logistics-bills')
|
||||
@UseGuards(HqAuthGuard)
|
||||
export class AdminLogisticsBillController {
|
||||
constructor(private readonly settlementService: SettlementService) {}
|
||||
|
||||
@Get()
|
||||
list(@Query() query: Record<string, string>) {
|
||||
return this.settlementService.listAdminLogisticsBills({
|
||||
page: query.page ? Number(query.page) : 1,
|
||||
pageSize: query.pageSize ? Number(query.pageSize) : 20,
|
||||
status: query.status,
|
||||
providerId: query.providerId,
|
||||
year: query.year ? Number(query.year) : undefined,
|
||||
month: query.month ? Number(query.month) : undefined,
|
||||
});
|
||||
}
|
||||
|
||||
@Get('provider-summary')
|
||||
providerSummary(@Query() query: Record<string, string>) {
|
||||
return this.settlementService.listLogisticsProviderSummary({
|
||||
year: query.year ? Number(query.year) : undefined,
|
||||
month: query.month ? Number(query.month) : undefined,
|
||||
});
|
||||
}
|
||||
|
||||
@Get('export')
|
||||
export(@Query() query: Record<string, string>) {
|
||||
return this.settlementService.exportAdminLogisticsBills({
|
||||
status: query.status,
|
||||
providerId: query.providerId,
|
||||
year: query.year ? Number(query.year) : undefined,
|
||||
month: query.month ? Number(query.month) : undefined,
|
||||
});
|
||||
}
|
||||
|
||||
@Post('generate')
|
||||
generate(@Body() body: { year: number; month: number; providerId?: string }) {
|
||||
if (!body?.year || !body?.month) {
|
||||
throw new BadRequestException('请指定年月');
|
||||
}
|
||||
if (body.providerId) {
|
||||
return this.settlementService.generateLogisticsBill({
|
||||
providerId: body.providerId,
|
||||
year: body.year,
|
||||
month: body.month,
|
||||
});
|
||||
}
|
||||
return this.settlementService.generateAllLogisticsBills({
|
||||
year: body.year,
|
||||
month: body.month,
|
||||
});
|
||||
}
|
||||
|
||||
@Post('batch-confirm')
|
||||
@HqOperation({
|
||||
action: HqOperationAction.LOGISTICS_BILL_BATCH_CONFIRM,
|
||||
refType: 'LOGISTICS_BILL',
|
||||
batch: true,
|
||||
includeBody: true,
|
||||
})
|
||||
batchConfirm(@Body() body: { ids: string[] }) {
|
||||
return this.settlementService.batchConfirmLogisticsBills(body.ids ?? []);
|
||||
}
|
||||
|
||||
@Get(':id')
|
||||
detail(@Param('id') id: string) {
|
||||
return this.settlementService.getAdminLogisticsBill(BigInt(id));
|
||||
}
|
||||
|
||||
@Post(':id/confirm')
|
||||
@HqOperation({
|
||||
action: HqOperationAction.LOGISTICS_BILL_CONFIRM,
|
||||
refType: 'LOGISTICS_BILL',
|
||||
refIdParam: 'id',
|
||||
})
|
||||
confirm(@Param('id') id: string) {
|
||||
return this.settlementService.confirmLogisticsBill(BigInt(id));
|
||||
}
|
||||
}
|
||||
|
||||
@Controller('partner/me')
|
||||
@UseGuards(JwtAuthGuard)
|
||||
export class PartnerMeController {
|
||||
|
||||
Reference in New Issue
Block a user