| | |
| | | public AjaxResult listAll(ZfEvent zfEvent){ |
| | | Integer pageNum = Convert.toInt(ServletUtils.getParameter(PAGE_NUM), 1); |
| | | Integer pageSize = Convert.toInt(ServletUtils.getParameter(PAGE_SIZE), 10); |
| | | return zfEventService.selectEventList(zfEvent, pageNum, pageSize); |
| | | return zfEventService.selectDataList(zfEvent, pageNum, pageSize); |
| | | } |
| | | |
| | | |
| | |
| | | @PostMapping("/importData") |
| | | public AjaxResult importData(@RequestParam("excelImport") MultipartFile file) throws Exception |
| | | { |
| | | ExcelUtil<ZfEvent> util = new ExcelUtil<>(ZfEvent.class); |
| | | List<ZfEvent> eventList = util.importExcel(file.getInputStream()); |
| | | log.info("家庭大事件列表为:{}",eventList); |
| | | |
| | | if (zfEventService.saveBatch(eventList)) { |
| | | return AjaxResult.success("导入数据成功"); |
| | | } |
| | | return AjaxResult.error("导入数据失败"); |
| | | return zfEventService.importExcel(file); |
| | | |
| | | } |
| | | |
| | |
| | | @PostMapping |
| | | public AjaxResult add(@RequestBody ZfEvent zfEvent) |
| | | { |
| | | return toAjax(zfEventService.save(zfEvent)); |
| | | return zfEventService.addData2(zfEvent); |
| | | } |
| | | |
| | | /** |