1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- package com.boman.file.controller;
- import com.alibaba.fastjson.JSONObject;
- import com.boman.common.core.web.domain.AjaxResult;
- import com.boman.domain.dto.ImportExcelDto;
- import com.boman.file.service.ISysFileService;
- import org.springframework.web.bind.annotation.PostMapping;
- import org.springframework.web.bind.annotation.RequestBody;
- import org.springframework.web.bind.annotation.RequestMapping;
- import org.springframework.web.bind.annotation.RestController;
- import org.springframework.web.multipart.MultipartFile;
- import javax.annotation.Resource;
- import java.util.List;
- @RestController
- @RequestMapping("/common/file")
- public class ExcelController {
- @Resource
- private ISysFileService fileService;
-
-
- @PostMapping("/import")
- public AjaxResult importExcelCommon(MultipartFile multipartFile, String tableName) throws Exception {
- List<JSONObject> result = null;
- try {
- result = fileService.importExcelCommon(multipartFile, tableName);
- } catch (Exception e) {
- e.printStackTrace();
- }
- return AjaxResult.success(result);
- }
- }
|