| | |
| | | return zfDoctorService.selectDoctorList(zfDoctor, pageNum, pageSize); |
| | | } |
| | | |
| | | @GetMapping("/type") |
| | | public AjaxResult listType(){ |
| | | return zfDoctorService.listType(); |
| | | } |
| | | |
| | | /** |
| | | * 获取导入模板 |
| | | */ |
| | |
| | | // @PreAuthorize("@ss.hasPermi('system:property:export')") |
| | | @Log(title = "家庭小医生记录", businessType = BusinessType.EXPORT) |
| | | @PostMapping("/export1/{ids}") |
| | | public void export1(HttpServletResponse response, @PathVariable Long[] ids) |
| | | public void export(HttpServletResponse response, @PathVariable Long[] ids) |
| | | { |
| | | List<ZfDoctor> list = zfDoctorService.selectByIds(ids); |
| | | log.info("导出记录为:{}",list); |
| | |
| | | @PostMapping("/importData") |
| | | public AjaxResult importData(@RequestParam("excelImport") MultipartFile file) throws Exception |
| | | { |
| | | ExcelUtil<ZfDoctor> util = new ExcelUtil<>(ZfDoctor.class); |
| | | List<ZfDoctor> eventList = util.importExcel(file.getInputStream()); |
| | | log.info("家庭小医生列表为:{}",eventList); |
| | | // ExcelUtil<ZfDoctor> util = new ExcelUtil<>(ZfDoctor.class); |
| | | // List<ZfDoctor> eventList = util.importExcel(file.getInputStream()); |
| | | // log.info("家庭小医生列表为:{}",eventList); |
| | | // |
| | | // if (zfDoctorService.saveBatch(eventList)) { |
| | | // return AjaxResult.success("导入数据成功"); |
| | | // } |
| | | // return AjaxResult.error("导入数据失败"); |
| | | |
| | | if (zfDoctorService.saveBatch(eventList)) { |
| | | return AjaxResult.success("导入数据成功"); |
| | | } |
| | | return AjaxResult.error("导入数据失败"); |
| | | return zfDoctorService.importExcel(file); |
| | | } |
| | | |
| | | /** |
| | |
| | | @PostMapping |
| | | public AjaxResult add(@RequestBody ZfDoctor zfDoctor) |
| | | { |
| | | return zfDoctorService.mySave(zfDoctor); |
| | | return zfDoctorService.addData(zfDoctor); |
| | | } |
| | | |
| | | /** |
| | |
| | | @PutMapping |
| | | public AjaxResult edit(@RequestBody ZfDoctor zfDoctor) |
| | | { |
| | | return toAjax(zfDoctorService.updateById(zfDoctor)); |
| | | return zfDoctorService.updateData(zfDoctor); |
| | | } |
| | | // |
| | | /** |
| | |
| | | @DeleteMapping("/{ids}") |
| | | public AjaxResult remove(@PathVariable Long[] ids) |
| | | { |
| | | return toAjax(zfDoctorService.removeByIds(Arrays.asList(ids))); |
| | | return zfDoctorService.deleteData(ids); |
| | | } |
| | | |
| | | } |