|
|
|
@ -260,6 +260,11 @@ export class QueryVisitorByNumberDto {
|
|
|
|
@IsString()
|
|
|
|
@IsString()
|
|
|
|
@IsNotEmpty()
|
|
|
|
@IsNotEmpty()
|
|
|
|
identity_card_no: string
|
|
|
|
identity_card_no: string
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ApiPropertyOptional({ description: "", required: false })
|
|
|
|
|
|
|
|
@IsString()
|
|
|
|
|
|
|
|
@IsOptional()
|
|
|
|
|
|
|
|
area_code?: string
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Controller()
|
|
|
|
@Controller()
|
|
|
|
@ -301,11 +306,15 @@ export class AppController {
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
@Get("/visitor")
|
|
|
|
@Get("/visitor")
|
|
|
|
@ApiBearerAuth()
|
|
|
|
@ApiBearerAuth()
|
|
|
|
async getVisiotr(@Query() { identity_card_no }: QueryVisitorByNumberDto, @Req() req: any) {
|
|
|
|
async getVisiotr(@Query() { identity_card_no, area_code }: QueryVisitorByNumberDto, @Req() req: any) {
|
|
|
|
let date = new Date().toDateString();
|
|
|
|
let date = new Date().toDateString();
|
|
|
|
let node_other_visitor;
|
|
|
|
let node_other_visitor;
|
|
|
|
|
|
|
|
const where: any = { identity_card_no, end_time: IsNull() };
|
|
|
|
|
|
|
|
if (area_code) {
|
|
|
|
|
|
|
|
where.to_area_code = area_code;
|
|
|
|
|
|
|
|
}
|
|
|
|
const node_other_visitors: any = await this.nodeOtherVisitorRepository.find({
|
|
|
|
const node_other_visitors: any = await this.nodeOtherVisitorRepository.find({
|
|
|
|
where: { identity_card_no, end_time: IsNull() },
|
|
|
|
where,
|
|
|
|
order: {
|
|
|
|
order: {
|
|
|
|
created_date: "DESC"
|
|
|
|
created_date: "DESC"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|