| | |
| | | import com.sinata.appointment.service.VisitorUserManageApplicationService; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import jakarta.validation.Valid; |
| | | import jakarta.validation.constraints.NotBlank; |
| | | import java.io.IOException; |
| | | import java.time.LocalDate; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.http.HttpHeaders; |
| | | import org.springframework.http.MediaType; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | |
| | | @Operation(summary = "导出 Excel") |
| | | @GetMapping("/export") |
| | | @SaCheckPermission("sys:visitor-users:export") |
| | | public ResponseEntity<byte[]> export( |
| | | public void export( |
| | | HttpServletResponse response, |
| | | @RequestParam(required = false) String userName, |
| | | @RequestParam(required = false) String mobile, |
| | | @RequestParam(required = false) String companyName, |
| | | @RequestParam(required = false) @DateTimeFormat(pattern = "yyyy-MM-dd") LocalDate registerStartDate, |
| | | @RequestParam(required = false) @DateTimeFormat(pattern = "yyyy-MM-dd") LocalDate registerEndDate, |
| | | @RequestParam(required = false) Integer status) { |
| | | byte[] body = |
| | | visitorUserManageApplicationService.exportExcel( |
| | | userName, mobile, companyName, registerStartDate, registerEndDate, status); |
| | | return ResponseEntity.ok() |
| | | .contentType( |
| | | MediaType.parseMediaType( |
| | | "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")) |
| | | .header( |
| | | HttpHeaders.CONTENT_DISPOSITION, |
| | | "attachment; filename=\"visitor-users.xlsx\"") |
| | | .body(body); |
| | | @RequestParam(required = false) Integer status) |
| | | throws IOException { |
| | | visitorUserManageApplicationService.exportExcel( |
| | | response, userName, mobile, companyName, registerStartDate, registerEndDate, status); |
| | | } |
| | | |
| | | @Operation(summary = "详情(须 uuid)") |
| | | @Operation(summary = "详情") |
| | | @GetMapping("/{id}") |
| | | @SaCheckPermission("sys:visitor-users:detail") |
| | | public Result<VisitorUserDetailVo> detail( |
| | |
| | | return ResultUtil.success(); |
| | | } |
| | | |
| | | @Operation(summary = "删除(逻辑删除,须传 uuid)") |
| | | @Operation(summary = "删除") |
| | | @DeleteMapping("/{id}") |
| | | @SaCheckPermission("sys:visitor-users:delete") |
| | | public Result<Void> delete( |
| | |
| | | return ResultUtil.success(); |
| | | } |
| | | } |
| | | |