mirror of
https://gitee.com/log4j/pig.git
synced 2025-01-03 23:42:22 +08:00
⬆️ Upgrading dependencies. easyexcel 3.1.1 clsoe #I5PJYE
This commit is contained in:
parent
659d2f3e74
commit
7d3552ef60
@ -1,7 +1,9 @@
|
||||
package com.pig4cloud.pig.admin.api.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnore;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.alibaba.excel.annotation.write.style.ColumnWidth;
|
||||
import com.pig4cloud.plugin.excel.annotation.ExcelLine;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
@ -21,6 +23,13 @@ public class PostExcelVO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* excel 行号
|
||||
*/
|
||||
@ExcelLine
|
||||
@ExcelIgnore
|
||||
private Long lineNum;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
|
@ -1,7 +1,9 @@
|
||||
package com.pig4cloud.pig.admin.api.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnore;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.alibaba.excel.annotation.write.style.ColumnWidth;
|
||||
import com.pig4cloud.plugin.excel.annotation.ExcelLine;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
@ -20,6 +22,13 @@ public class RoleExcelVO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* excel 行号
|
||||
*/
|
||||
@ExcelLine
|
||||
@ExcelIgnore
|
||||
private Long lineNum;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
|
@ -1,7 +1,9 @@
|
||||
package com.pig4cloud.pig.admin.api.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnore;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.alibaba.excel.annotation.write.style.ColumnWidth;
|
||||
import com.pig4cloud.plugin.excel.annotation.ExcelLine;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
@ -20,6 +22,13 @@ public class UserExcelVO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* excel 行号
|
||||
*/
|
||||
@ExcelLine
|
||||
@ExcelIgnore
|
||||
private Long lineNum;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
|
@ -60,8 +60,7 @@ public class SysPostServiceImpl extends ServiceImpl<SysPostMapper, SysPost> impl
|
||||
List<SysPost> postList = this.list();
|
||||
|
||||
// 执行数据插入操作 组装 PostDto
|
||||
for (int i = 0; i < excelVOList.size(); i++) {
|
||||
PostExcelVO excel = excelVOList.get(i);
|
||||
for (PostExcelVO excel : excelVOList) {
|
||||
Set<String> errorMsg = new HashSet<>();
|
||||
// 检验岗位名称或者岗位编码是否存在
|
||||
boolean existPost = postList.stream().anyMatch(post -> excel.getPostName().equals(post.getPostName())
|
||||
@ -78,7 +77,7 @@ public class SysPostServiceImpl extends ServiceImpl<SysPostMapper, SysPost> impl
|
||||
}
|
||||
else {
|
||||
// 数据不合法
|
||||
errorMessageList.add(new ErrorMessage((long) (i + 2), errorMsg));
|
||||
errorMessageList.add(new ErrorMessage(excel.getLineNum(), errorMsg));
|
||||
}
|
||||
}
|
||||
if (CollUtil.isNotEmpty(errorMessageList)) {
|
||||
|
@ -84,8 +84,7 @@ public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> impl
|
||||
List<SysRole> roleList = this.list();
|
||||
|
||||
// 执行数据插入操作 组装 RoleDto
|
||||
for (int i = 0; i < excelVOList.size(); i++) {
|
||||
RoleExcelVO excel = excelVOList.get(i);
|
||||
for (RoleExcelVO excel : excelVOList) {
|
||||
Set<String> errorMsg = new HashSet<>();
|
||||
// 检验角色名称或者角色编码是否存在
|
||||
boolean existRole = roleList.stream().anyMatch(sysRole -> excel.getRoleName().equals(sysRole.getRoleName())
|
||||
@ -102,7 +101,7 @@ public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> impl
|
||||
}
|
||||
else {
|
||||
// 数据不合法情况
|
||||
errorMessageList.add(new ErrorMessage((long) (i + 2), errorMsg));
|
||||
errorMessageList.add(new ErrorMessage(excel.getLineNum(), errorMsg));
|
||||
}
|
||||
}
|
||||
if (CollUtil.isNotEmpty(errorMessageList)) {
|
||||
|
@ -38,7 +38,6 @@ import com.pig4cloud.pig.common.core.constant.enums.MenuTypeEnum;
|
||||
import com.pig4cloud.pig.common.core.exception.ErrorCodes;
|
||||
import com.pig4cloud.pig.common.core.util.MsgUtils;
|
||||
import com.pig4cloud.pig.common.core.util.R;
|
||||
import com.pig4cloud.pig.common.security.util.SecurityUtils;
|
||||
import com.pig4cloud.plugin.excel.vo.ErrorMessage;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@ -278,8 +277,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
|
||||
List<SysPost> postList = sysPostMapper.selectList(Wrappers.emptyWrapper());
|
||||
|
||||
// 执行数据插入操作 组装 UserDto
|
||||
for (int i = 0; i < excelVOList.size(); i++) {
|
||||
UserExcelVO excel = excelVOList.get(i);
|
||||
for (UserExcelVO excel : excelVOList) {
|
||||
Set<String> errorMsg = new HashSet<>();
|
||||
// 校验用户名是否存在
|
||||
boolean exsitUserName = userList.stream()
|
||||
@ -322,7 +320,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
|
||||
}
|
||||
else {
|
||||
// 数据不合法情况
|
||||
errorMessageList.add(new ErrorMessage((long) (i + 2), errorMsg));
|
||||
errorMessageList.add(new ErrorMessage(excel.getLineNum(), errorMsg));
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user