| | |
| | | import com.ruoyi.waterrecord.service.WaterRecordService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | @RestController |
| | | @Api(tags = "用水管理") |
| | | @RequestMapping("/waterRecord") |
| | | @AllArgsConstructor |
| | | public class WaterRecordController extends BaseController { |
| | | |
| | | @Autowired |
| | | private WaterRecordService waterRecordService; |
| | | |
| | | @GetMapping("/listPage") |
| | |
| | | @PostMapping("/export") |
| | | @ApiOperation("导出用水管理") |
| | | public void export(HttpServletResponse response) { |
| | | Page page = new Page(-1,-1); |
| | | WaterRecord waterRecord = new WaterRecord(); |
| | | IPage<WaterRecord> listPage = waterRecordService.listPage(page, waterRecord); |
| | | ExcelUtil<WaterRecord> util = new ExcelUtil<WaterRecord>(WaterRecord.class); |
| | | util.exportExcel(response, null , "用水管理"); |
| | | util.exportExcel(response, listPage.getRecords() , "用水管理"); |
| | | } |
| | | |
| | | } |