mirror of
https://gitee.com/log4j/pig.git
synced 2024-12-23 05:00:23 +08:00
Merge branch 'dev'
This commit is contained in:
commit
a19686de34
@ -29,6 +29,8 @@
|
||||
|
||||
![](https://minio.pigx.vip/oss/1648184189.png)
|
||||
|
||||
|
||||
<a href="https://apifox.cn/a1pigcloud" target="_blank"><img src="https://minio.pigx.vip/oss/1662368326.png" height="180" width="550"></a></td>
|
||||
## 快速开始
|
||||
|
||||
### 核心依赖
|
||||
|
@ -28,7 +28,7 @@
|
||||
<mybatis-plus.version>3.5.2</mybatis-plus.version>
|
||||
<mysql.version>8.0.30</mysql.version>
|
||||
<seata.version>1.5.1</seata.version>
|
||||
<excel.version>1.2.4</excel.version>
|
||||
<excel.version>1.2.5</excel.version>
|
||||
<asm.version>7.1</asm.version>
|
||||
<oss.version>1.0.5</oss.version>
|
||||
<sms.version>2.0.2</sms.version>
|
||||
|
@ -1,2 +0,0 @@
|
||||
org.springframework.boot.env.EnvironmentPostProcessor=\
|
||||
com.pig4cloud.pig.common.log.init.ApplicationLoggerInitializer
|
@ -34,7 +34,7 @@ import java.util.Optional;
|
||||
public class PigRemoteRegisteredClientRepository implements RegisteredClientRepository {
|
||||
|
||||
/**
|
||||
* 刷新令牌有效期默认 30 填
|
||||
* 刷新令牌有效期默认 30 天
|
||||
*/
|
||||
private final static int refreshTokenValiditySeconds = 60 * 60 * 24 * 30;
|
||||
|
||||
|
@ -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