|
@@ -5,6 +5,7 @@ import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
|
import com.ruoyi.common.core.domain.entity.SysUser;
|
|
|
import com.ruoyi.common.utils.SecurityUtils;
|
|
|
+import com.ruoyi.common.utils.StringUtils;
|
|
|
import com.ruoyi.system.domain.UserInfo;
|
|
|
import com.ruoyi.system.service.IUserInfoService;
|
|
|
import org.springframework.scheduling.annotation.EnableAsync;
|
|
@@ -93,6 +94,25 @@ public class UserInfoController extends BaseController {
|
|
|
ExcelUtil<UserInfo> util = new ExcelUtil<UserInfo>(UserInfo.class);
|
|
|
List<UserInfo> userList = util.importExcel(file.getInputStream());
|
|
|
SysUser user = SecurityUtils.getLoginUser().getUser();
|
|
|
+ if (userList == null) {
|
|
|
+ return AjaxResult.error("表格格式错误,请按照表格模板格式上传人员名单");
|
|
|
+ }
|
|
|
+
|
|
|
+ System.out.println("接口开始========");
|
|
|
+ StringBuilder sb = new StringBuilder();
|
|
|
+ for (UserInfo userInfo : userList) {
|
|
|
+ if (userInfo == null) {
|
|
|
+ return AjaxResult.error("表格格式错误,请按照表格模板格式上传人员名单");
|
|
|
+ }
|
|
|
+
|
|
|
+ if (userInfo.getIdCard().length() != 18) {
|
|
|
+ sb.append(userInfo.getName()).append(",");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (StringUtils.isNotEmpty(sb.toString())) {
|
|
|
+ return AjaxResult.error("操作失败,以下人员身份证格式错误【" + sb.toString() + "】");
|
|
|
+ }
|
|
|
//String operName = getUsername();
|
|
|
userInfoService.importUser(userList, jobStyle, focusCrowdStyle, detectionNumber, detectionScope, startTime, endTime, user);
|
|
|
return AjaxResult.success("正在处理中,请稍后刷新页面");
|