|
@@ -4,8 +4,10 @@ import java.util.List;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
|
import com.ruoyi.common.core.domain.entity.SysUser;
|
|
|
+import com.ruoyi.common.utils.SecurityUtils;
|
|
|
import com.ruoyi.system.domain.UserInfo;
|
|
|
import com.ruoyi.system.service.IUserInfoService;
|
|
|
+import org.springframework.scheduling.annotation.EnableAsync;
|
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
@@ -26,14 +28,14 @@ import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
/**
|
|
|
* 导入人员信息Controller
|
|
|
- *
|
|
|
+ *
|
|
|
* @author ruoyi
|
|
|
* @date 2022-08-11
|
|
|
*/
|
|
|
@RestController
|
|
|
@RequestMapping("/system/info")
|
|
|
-public class UserInfoController extends BaseController
|
|
|
-{
|
|
|
+@EnableAsync
|
|
|
+public class UserInfoController extends BaseController {
|
|
|
@Autowired
|
|
|
private IUserInfoService userInfoService;
|
|
|
|
|
@@ -41,8 +43,7 @@ public class UserInfoController extends BaseController
|
|
|
* 查询导入人员信息列表
|
|
|
*/
|
|
|
@GetMapping("/list")
|
|
|
- public TableDataInfo list(UserInfo userInfo)
|
|
|
- {
|
|
|
+ public TableDataInfo list(UserInfo userInfo) {
|
|
|
startPage();
|
|
|
List<UserInfo> list = userInfoService.selectUserInfoList(userInfo);
|
|
|
return getDataTable(list);
|
|
@@ -64,8 +65,7 @@ public class UserInfoController extends BaseController
|
|
|
@PreAuthorize("@ss.hasPermi('system:info:export')")
|
|
|
@Log(title = "导入人员信息", businessType = BusinessType.EXPORT)
|
|
|
@PostMapping("/export")
|
|
|
- public void export(HttpServletResponse response, UserInfo userInfo)
|
|
|
- {
|
|
|
+ public void export(HttpServletResponse response, UserInfo userInfo) {
|
|
|
List<UserInfo> list = userInfoService.selectUserInfoList(userInfo);
|
|
|
ExcelUtil<UserInfo> util = new ExcelUtil<UserInfo>(UserInfo.class);
|
|
|
util.exportExcel(response, list, "导入人员信息数据");
|
|
@@ -74,13 +74,14 @@ public class UserInfoController extends BaseController
|
|
|
|
|
|
/**
|
|
|
* 核酸比对人员导入
|
|
|
+ *
|
|
|
* @param file
|
|
|
- * @param jobStyle jobStyle
|
|
|
+ * @param jobStyle jobStyle
|
|
|
* @param focusCrowdStyle focusCrowdStyle
|
|
|
* @param detectionNumber detectionNumber
|
|
|
- * @param detectionScope detectionScope
|
|
|
- * @param startTime startTime
|
|
|
- * @param endTime 比对结束时间
|
|
|
+ * @param detectionScope detectionScope
|
|
|
+ * @param startTime startTime
|
|
|
+ * @param endTime 比对结束时间
|
|
|
* @return
|
|
|
* @throws Exception
|
|
|
*/
|
|
@@ -88,21 +89,20 @@ public class UserInfoController extends BaseController
|
|
|
@PreAuthorize("@ss.hasPermi('system:info:import')")
|
|
|
@PostMapping("/importData")
|
|
|
public AjaxResult importData(MultipartFile file, String jobStyle, String focusCrowdStyle, String detectionNumber,
|
|
|
- String detectionScope,String startTime,String endTime) throws Exception
|
|
|
- {
|
|
|
+ String detectionScope, String startTime, String endTime) throws Exception {
|
|
|
ExcelUtil<UserInfo> util = new ExcelUtil<UserInfo>(UserInfo.class);
|
|
|
List<UserInfo> userList = util.importExcel(file.getInputStream());
|
|
|
+ SysUser user = SecurityUtils.getLoginUser().getUser();
|
|
|
//String operName = getUsername();
|
|
|
- String message = userInfoService.importUser(userList, jobStyle, focusCrowdStyle, detectionNumber, detectionScope,startTime,endTime);
|
|
|
- return AjaxResult.success(message);
|
|
|
+ userInfoService.importUser(userList, jobStyle, focusCrowdStyle, detectionNumber, detectionScope, startTime, endTime, user);
|
|
|
+ return AjaxResult.success("正在处理中,请稍后刷新页面");
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 获取导入人员信息详细信息
|
|
|
*/
|
|
|
@GetMapping(value = "/{id}")
|
|
|
- public AjaxResult getInfo(@PathVariable("id") Long id)
|
|
|
- {
|
|
|
+ public AjaxResult getInfo(@PathVariable("id") Long id) {
|
|
|
return AjaxResult.success(userInfoService.selectUserInfoById(id));
|
|
|
}
|
|
|
|
|
@@ -111,8 +111,7 @@ public class UserInfoController extends BaseController
|
|
|
*/
|
|
|
@Log(title = "导入人员信息", businessType = BusinessType.INSERT)
|
|
|
@PostMapping
|
|
|
- public AjaxResult add(@RequestBody UserInfo userInfo)
|
|
|
- {
|
|
|
+ public AjaxResult add(@RequestBody UserInfo userInfo) {
|
|
|
return toAjax(userInfoService.insertUserInfo(userInfo));
|
|
|
}
|
|
|
|
|
@@ -121,8 +120,7 @@ public class UserInfoController extends BaseController
|
|
|
*/
|
|
|
@Log(title = "导入人员信息", businessType = BusinessType.UPDATE)
|
|
|
@PutMapping
|
|
|
- public AjaxResult edit(@RequestBody UserInfo userInfo)
|
|
|
- {
|
|
|
+ public AjaxResult edit(@RequestBody UserInfo userInfo) {
|
|
|
return toAjax(userInfoService.updateUserInfo(userInfo));
|
|
|
}
|
|
|
|
|
@@ -130,9 +128,8 @@ public class UserInfoController extends BaseController
|
|
|
* 删除导入人员信息
|
|
|
*/
|
|
|
@Log(title = "导入人员信息", businessType = BusinessType.DELETE)
|
|
|
- @DeleteMapping("/{ids}")
|
|
|
- public AjaxResult remove(@PathVariable Long[] ids)
|
|
|
- {
|
|
|
+ @DeleteMapping("/{ids}")
|
|
|
+ public AjaxResult remove(@PathVariable Long[] ids) {
|
|
|
return toAjax(userInfoService.deleteUserInfoByIds(ids));
|
|
|
}
|
|
|
}
|