【fix sonar】JoaDemoController文件

This commit is contained in:
梁琦涛
2023-03-16 09:55:55 +08:00
parent ba1d890095
commit 586157dd36
@@ -1,15 +1,9 @@
package com.jero.modules.demo.test.controller; package com.jero.modules.demo.test.controller;
import java.io.IOException; import com.alibaba.fastjson.JSON;
import java.io.UnsupportedEncodingException; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import java.net.URLDecoder; import com.baomidou.mybatisplus.core.metadata.IPage;
import java.util.Arrays; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.jero.common.api.vo.Result; import com.jero.common.api.vo.Result;
import com.jero.common.api.vo.ResultConstant; import com.jero.common.api.vo.ResultConstant;
import com.jero.common.system.base.controller.JeroController; import com.jero.common.system.base.controller.JeroController;
@@ -17,31 +11,27 @@ import com.jero.common.system.query.QueryGenerator;
import com.jero.common.util.oConvertUtils; import com.jero.common.util.oConvertUtils;
import com.jero.modules.demo.test.entity.JoaDemo; import com.jero.modules.demo.test.entity.JoaDemo;
import com.jero.modules.demo.test.service.IJoaDemoService; import com.jero.modules.demo.test.service.IJoaDemoService;
import lombok.extern.slf4j.Slf4j;
import org.apache.poi.ss.formula.functions.T;
import org.jeecgframework.poi.excel.ExcelImportUtil; import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants; import org.jeecgframework.poi.excel.def.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams; import org.jeecgframework.poi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.ImportParams; import org.jeecgframework.poi.excel.entity.ImportParams;
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest; import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.ModelAndView;
import com.alibaba.fastjson.JSON; import javax.servlet.http.HttpServletRequest;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import javax.servlet.http.HttpServletResponse;
import com.baomidou.mybatisplus.core.metadata.IPage; import java.io.IOException;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import lombok.extern.slf4j.Slf4j; import java.util.Arrays;
import java.util.List;
import java.util.Map;
/** /**
* @Description: 流程测试 * @Description: 流程测试
@@ -206,7 +196,7 @@ public class JoaDemoController {
*/ */
// @RequestMapping(value = "/importExcel", method = RequestMethod.POST) // @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
@PostMapping("/importExcel") @PostMapping("/importExcel")
public Result importExcel(HttpServletRequest request, HttpServletResponse response) { public Result<T> importExcel(HttpServletRequest request, HttpServletResponse response) {
MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request; MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
Map<String, MultipartFile> fileMap = multipartRequest.getFileMap(); Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) { for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {