|
@@ -4,18 +4,15 @@ package com.ruoyi.web.controller.system;
|
|
|
import java.util.List;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
|
+import com.ruoyi.common.core.domain.model.LoginUser;
|
|
|
+import com.ruoyi.common.utils.ServletUtils;
|
|
|
+import com.ruoyi.framework.web.service.TokenService;
|
|
|
+import com.ruoyi.system.service.ILcdInfoImportDataService;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-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.DeleteMapping;
|
|
|
-import org.springframework.web.bind.annotation.PathVariable;
|
|
|
-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.bind.annotation.*;
|
|
|
import com.ruoyi.common.annotation.Log;
|
|
|
import com.ruoyi.common.core.controller.BaseController;
|
|
|
import com.ruoyi.common.core.domain.AjaxResult;
|
|
@@ -24,6 +21,7 @@ import com.ruoyi.system.domain.PostUser;
|
|
|
import com.ruoyi.system.service.IPostUserService;
|
|
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
|
|
import com.ruoyi.common.core.page.TableDataInfo;
|
|
|
+import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
/**
|
|
|
* 权限模块 用户Controller
|
|
@@ -39,6 +37,8 @@ public class PostUserController extends BaseController
|
|
|
@Autowired
|
|
|
private IPostUserService postUserService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private ILcdInfoImportDataService iLcdInfoImportDataService;
|
|
|
/**
|
|
|
* 查询权限模块 用户列表
|
|
|
*/
|
|
@@ -66,6 +66,30 @@ public class PostUserController extends BaseController
|
|
|
util.exportExcel(response, list, "权限模块 用户数据");
|
|
|
}
|
|
|
|
|
|
+ @ApiOperation("导入用户列表")
|
|
|
+ @Log(title = "用户管理", businessType = BusinessType.IMPORT)
|
|
|
+ @RequestMapping(value = "/importData", method = RequestMethod.POST, headers = "content-type=multipart/form-data")
|
|
|
+ public AjaxResult importData(@RequestPart("fire") MultipartFile file, @RequestParam(value = "updateSupport",required=false)boolean updateSupport) throws Exception
|
|
|
+ {
|
|
|
+ ExcelUtil<PostUser> util = new ExcelUtil<PostUser>(PostUser.class);
|
|
|
+ List<PostUser> stuList = util.importExcel(file.getInputStream());
|
|
|
+ String operName = getUsername();
|
|
|
+ String message = iLcdInfoImportDataService.importData(stuList, updateSupport, operName);
|
|
|
+ return AjaxResult.success(message);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 下载模板
|
|
|
+ */
|
|
|
+ @ApiOperation("下载模板")
|
|
|
+ @GetMapping("/importTemplate")
|
|
|
+ public AjaxResult importTemplate()
|
|
|
+ {
|
|
|
+ ExcelUtil<PostUser> util = new ExcelUtil<PostUser>(PostUser.class);
|
|
|
+ return util.importTemplateExcel("用户数据");
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
/**
|
|
|
* 获取权限模块 用户详细信息
|
|
|
*/
|