| | |
| | | @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 toAjax(zfEventService.addEvent(zfEvent)); |
| | | } |
| | | |
| | | /** |