| | |
| | | package com.talentcard.server.business.admin; |
| | | |
| | | import java.time.LocalDate; |
| | | import java.util.List; |
| | | |
| | | import com.talentcard.server.business.PageResult; |
| | |
| | | import io.swagger.v3.oas.annotations.responses.ApiResponses; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import jakarta.validation.Valid; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PatchMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | |
| | | @GetMapping |
| | | public ApiResponse<PageResult<DependentCardApplyAdminResponse>> page( |
| | | @Parameter(description = "主卡ID") @RequestParam(required = false) Long talentCardId, |
| | | @Parameter(description = "状态:0待审核、1已通过、2已驳回、3已解绑") @RequestParam(required = false) Integer status, |
| | | @Parameter(description = "家属姓名、手机号或身份证号") @RequestParam(required = false) String familyKeyword, |
| | | @Parameter(description = "持卡人姓名、手机号、身份证号或卡号") @RequestParam(required = false) String talentKeyword, |
| | | @Parameter(description = "卡片等级") @RequestParam(required = false) String cardLevel, |
| | | @Parameter(description = "状态:0待审核、1已通过、2已驳回、3已取消") @RequestParam(required = false) Integer status, |
| | | @Parameter(description = "申请开始日期") @RequestParam(required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate applyStart, |
| | | @Parameter(description = "申请结束日期") @RequestParam(required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate applyEnd, |
| | | @Parameter(description = "是否按家属卡管理范围查询(仅已绑定和已解绑)") @RequestParam(defaultValue = "false") boolean management, |
| | | @Parameter(description = "页码") @RequestParam(defaultValue = "1") int page, |
| | | @Parameter(description = "每页数量,最大100") @RequestParam(defaultValue = "10") int size |
| | | ) { |
| | | return ApiResponse.success(service.page(talentCardId, status, page, size)); |
| | | return ApiResponse.success(service.page(talentCardId, familyKeyword, talentKeyword, cardLevel, status, applyStart, applyEnd, management, page, size)); |
| | | } |
| | | |
| | | @Operation(summary = "查询家属附属卡申请详情") |
| | |
| | | return ApiResponse.success(service.audit(id, request, operatorId)); |
| | | } |
| | | |
| | | @Operation(summary = "解除家属卡绑定", description = "仅正常状态的家属卡可以解除绑定") |
| | | @PatchMapping("/{id}/unbind") |
| | | public ApiResponse<DependentCardApplyAdminResponse> unbind( |
| | | @PathVariable Long id, |
| | | @RequestAttribute(AdminAuthInterceptor.OPERATOR_ID_ATTRIBUTE) Long operatorId |
| | | ) { |
| | | return ApiResponse.success(service.unbind(id, operatorId)); |
| | | } |
| | | |
| | | @Operation(summary = "查询家属附属卡申请状态记录") |
| | | @GetMapping("/{id}/status-logs") |
| | | public ApiResponse<List<DependentCardApplyStatusLogResponse>> statusLogs(@PathVariable Long id) { |
| | | return ApiResponse.success(service.statusLogs(id)); |
| | | } |
| | | } |
| | | } |