Skip to content

Commit fecb3a9

Browse files
author
zhuoda
committed
v3.14.0 更新;【新增】EasyExcel重磅升级为FastExcel;【新增】使用最强Argon2算法作为密码存储;【新增】大家吐槽的数据字典改为可重复;【新增】前端布局再增加多种样式;
1 parent e74f179 commit fecb3a9

File tree

207 files changed

+4223
-1982
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

207 files changed

+4223
-1982
lines changed

smart-admin-api-java17-springboot3/pom.xml

+30-9
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
2222
<springboot.version>3.3.1</springboot.version>
2323
<spring-mock.version>2.0.8</spring-mock.version>
24+
<spring-security-crypto.version>6.4.3</spring-security-crypto.version>
2425
<mybatis-plus.version>3.5.7</mybatis-plus.version>
2526
<p6spy.version>3.9.1</p6spy.version>
2627
<knife4j.version>4.4.0</knife4j.version>
@@ -33,10 +34,11 @@
3334
<commons-io.version>2.15.0</commons-io.version>
3435
<commons-lang3.version>3.12.0</commons-lang3.version>
3536
<commons-collections4.version>4.4</commons-collections4.version>
37+
<commons-compress.version>1.26.0</commons-compress.version>
3638
<commons-codec.version>1.13</commons-codec.version>
3739
<commons-text.version>1.9</commons-text.version>
3840
<xerces.version>2.12.0</xerces.version>
39-
<easy-excel.version>3.3.2</easy-excel.version>
41+
<fast-excel.version>1.0.0</fast-excel.version>
4042
<poi.version>5.2.4</poi.version>
4143
<ooxml-schemas.version>1.4</ooxml-schemas.version>
4244
<aws-java-sdk.version>1.11.842</aws-java-sdk.version>
@@ -48,14 +50,15 @@
4850
<velocity-tools.version>3.1</velocity-tools.version>
4951
<sa-token.version>1.37.0</sa-token.version>
5052
<ip2region.version>2.7.0</ip2region.version>
51-
<bcprov.version>1.59</bcprov.version>
53+
<bcprov.version>1.80</bcprov.version>
5254
<jackson-datatype-jsr310.version>2.13.4</jackson-datatype-jsr310.version>
5355
<jackson-dataformat-yaml.version>2.16.1</jackson-dataformat-yaml.version>
5456
<smartdb.version>1.2.0</smartdb.version>
5557
<redisson.version>3.25.0</redisson.version>
5658
<snakeyaml.version>2.2</snakeyaml.version>
5759
<freemarker.version>2.3.33</freemarker.version>
5860
<jsoup.version>1.18.1</jsoup.version>
61+
<tika.version>3.1.0</tika.version>
5962
</properties>
6063

6164
<dependencyManagement>
@@ -83,6 +86,12 @@
8386
</exclusions>
8487
</dependency>
8588

89+
<dependency>
90+
<groupId>org.springframework.security</groupId>
91+
<artifactId>spring-security-crypto</artifactId>
92+
<version>${spring-security-crypto.version}</version>
93+
</dependency>
94+
8695
<dependency>
8796
<groupId>p6spy</groupId>
8897
<artifactId>p6spy</artifactId>
@@ -156,6 +165,12 @@
156165
<version>${commons-collections4.version}</version>
157166
</dependency>
158167

168+
<dependency>
169+
<groupId>org.apache.commons</groupId>
170+
<artifactId>commons-compress</artifactId>
171+
<version>${commons-compress.version}</version>
172+
</dependency>
173+
159174
<dependency>
160175
<artifactId>commons-codec</artifactId>
161176
<groupId>commons-codec</groupId>
@@ -235,18 +250,18 @@
235250

236251
<dependency>
237252
<groupId>org.bouncycastle</groupId>
238-
<artifactId>bcprov-jdk15on</artifactId>
253+
<artifactId>bcprov-jdk18on</artifactId>
239254
<version>${bcprov.version}</version>
240255
</dependency>
241256

242257
<dependency>
243-
<groupId>com.alibaba</groupId>
244-
<artifactId>easyexcel</artifactId>
245-
<version>${easy-excel.version}</version>
258+
<groupId>cn.idev.excel</groupId>
259+
<artifactId>fastexcel</artifactId>
260+
<version>${fast-excel.version}</version>
246261
<exclusions>
247262
<exclusion>
248-
<artifactId>poi-ooxml-schemas</artifactId>
249-
<groupId>org.apache.poi</groupId>
263+
<artifactId>logback-classic</artifactId>
264+
<groupId>ch.qos.logback</groupId>
250265
</exclusion>
251266
</exclusions>
252267
</dependency>
@@ -318,6 +333,12 @@
318333
<version>${freemarker.version}</version>
319334
</dependency>
320335

336+
<dependency>
337+
<groupId>org.apache.tika</groupId>
338+
<artifactId>tika-core</artifactId>
339+
<version>${tika.version}</version>
340+
</dependency>
341+
321342
</dependencies>
322343

323344
</dependencyManagement>
@@ -407,4 +428,4 @@
407428
</profile>
408429
</profiles>
409430

410-
</project>
431+
</project>

smart-admin-api-java17-springboot3/sa-admin/src/main/java/net/lab1024/sa/admin/interceptor/AdminInterceptor.java

+5-45
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
import cn.dev33.satoken.annotation.SaIgnore;
44
import cn.dev33.satoken.exception.SaTokenException;
5-
import cn.dev33.satoken.stp.StpUtil;
65
import cn.dev33.satoken.strategy.SaStrategy;
6+
import cn.dev33.satoken.stp.StpUtil;
77
import cn.hutool.core.util.StrUtil;
88
import jakarta.annotation.Resource;
99
import jakarta.servlet.http.HttpServletRequest;
@@ -14,14 +14,9 @@
1414
import net.lab1024.sa.base.common.annoation.NoNeedLogin;
1515
import net.lab1024.sa.base.common.code.SystemErrorCode;
1616
import net.lab1024.sa.base.common.code.UserErrorCode;
17-
import net.lab1024.sa.base.common.constant.StringConst;
1817
import net.lab1024.sa.base.common.domain.ResponseDTO;
19-
import net.lab1024.sa.base.common.domain.SystemEnvironment;
20-
import net.lab1024.sa.base.common.enumeration.SystemEnvironmentEnum;
21-
import net.lab1024.sa.base.common.enumeration.UserTypeEnum;
2218
import net.lab1024.sa.base.common.util.SmartRequestUtil;
2319
import net.lab1024.sa.base.common.util.SmartResponseUtil;
24-
import org.springframework.beans.factory.annotation.Value;
2520
import org.springframework.http.HttpMethod;
2621
import org.springframework.http.HttpStatus;
2722
import org.springframework.stereotype.Component;
@@ -47,9 +42,6 @@ public class AdminInterceptor implements HandlerInterceptor {
4742
@Resource
4843
private LoginService loginService;
4944

50-
@Resource
51-
private SystemEnvironment systemEnvironment;
52-
5345
@Override
5446
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
5547

@@ -68,25 +60,15 @@ public boolean preHandle(HttpServletRequest request, HttpServletResponse respons
6860
// --------------- 第一步: 根据token 获取用户 ---------------
6961

7062
String tokenValue = StpUtil.getTokenValue();
71-
boolean debugNumberTokenFlag = isDevDebugNumberToken(tokenValue);
72-
73-
String loginId = null;
74-
if (debugNumberTokenFlag) {
75-
//开发、测试环境,且为数字的话,则表明为 调试临时用户,即需要调用 sa-token switch
76-
loginId = UserTypeEnum.ADMIN_EMPLOYEE.getValue() + StringConst.COLON + tokenValue;
77-
StpUtil.switchTo(loginId);
78-
} else {
79-
loginId = (String) StpUtil.getLoginIdByToken(tokenValue);
80-
}
81-
63+
String loginId = (String) StpUtil.getLoginIdByToken(tokenValue);
8264
RequestEmployee requestEmployee = loginService.getLoginEmployee(loginId, request);
8365

8466
// --------------- 第二步: 校验 登录 ---------------
8567

8668
Method method = ((HandlerMethod) handler).getMethod();
8769
NoNeedLogin noNeedLogin = ((HandlerMethod) handler).getMethodAnnotation(NoNeedLogin.class);
8870
if (noNeedLogin != null) {
89-
checkActiveTimeout(requestEmployee, debugNumberTokenFlag);
71+
checkActiveTimeout(requestEmployee);
9072
return true;
9173
}
9274

@@ -96,7 +78,7 @@ public boolean preHandle(HttpServletRequest request, HttpServletResponse respons
9678
}
9779

9880
// 检测token 活跃频率
99-
checkActiveTimeout(requestEmployee, debugNumberTokenFlag);
81+
checkActiveTimeout(requestEmployee);
10082

10183

10284
// --------------- 第三步: 校验 权限 ---------------
@@ -143,12 +125,7 @@ public boolean preHandle(HttpServletRequest request, HttpServletResponse respons
143125
/**
144126
* 检测:token 最低活跃频率(单位:秒),如果 token 超过此时间没有访问系统就会被冻结
145127
*/
146-
private void checkActiveTimeout(RequestEmployee requestEmployee, boolean debugNumberTokenFlag) {
147-
148-
// 对于开发环境的 数字 debug token ,不需要检测活跃有效期
149-
if (debugNumberTokenFlag) {
150-
return;
151-
}
128+
private void checkActiveTimeout(RequestEmployee requestEmployee) {
152129

153130
// 用户不在线,也不用检测
154131
if (requestEmployee == null) {
@@ -160,28 +137,11 @@ private void checkActiveTimeout(RequestEmployee requestEmployee, boolean debugNu
160137
}
161138

162139

163-
/**
164-
* 是否为开发使用的 debug token
165-
*
166-
* @param token
167-
* @return
168-
*/
169-
private boolean isDevDebugNumberToken(String token) {
170-
if (!StrUtil.isNumeric(token)) {
171-
return false;
172-
}
173-
return systemEnvironment.getCurrentEnvironment() == SystemEnvironmentEnum.DEV
174-
|| systemEnvironment.getCurrentEnvironment() == SystemEnvironmentEnum.TEST;
175-
}
176140

177141
@Override
178142
public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {
179143
// 清除上下文
180144
SmartRequestUtil.remove();
181-
// 开发环境,关闭 sa token 的临时切换用户
182-
if (systemEnvironment.getCurrentEnvironment() == SystemEnvironmentEnum.DEV) {
183-
StpUtil.endSwitch();
184-
}
185145
}
186146

187147

smart-admin-api-java17-springboot3/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/goods/domain/form/GoodsImportForm.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package net.lab1024.sa.admin.module.business.goods.domain.form;
22

3-
import com.alibaba.excel.annotation.ExcelProperty;
3+
import cn.idev.excel.annotation.ExcelProperty;
44
import lombok.Data;
55

66
import java.math.BigDecimal;

smart-admin-api-java17-springboot3/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/goods/domain/vo/GoodsExcelVO.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package net.lab1024.sa.admin.module.business.goods.domain.vo;
22

3-
import com.alibaba.excel.annotation.ExcelProperty;
3+
4+
import cn.idev.excel.annotation.ExcelProperty;
45
import lombok.AllArgsConstructor;
56
import lombok.Builder;
67
import lombok.Data;

smart-admin-api-java17-springboot3/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/goods/domain/vo/GoodsVO.java

-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
import io.swagger.v3.oas.annotations.media.Schema;
55
import lombok.Data;
66
import net.lab1024.sa.admin.module.business.goods.constant.GoodsStatusEnum;
7-
import net.lab1024.sa.base.common.json.serializer.DictValueVoSerializer;
87
import net.lab1024.sa.base.common.swagger.SchemaEnum;
98

109
import java.math.BigDecimal;
@@ -32,7 +31,6 @@ public class GoodsVO {
3231
private Integer goodsStatus;
3332

3433
@Schema(description = "产地")
35-
@JsonSerialize(using = DictValueVoSerializer.class)
3634
private String place;
3735

3836
@Schema(description = "商品价格")

smart-admin-api-java17-springboot3/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/goods/service/GoodsService.java

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package net.lab1024.sa.admin.module.business.goods.service;
22

3-
import com.alibaba.excel.EasyExcel;
3+
import cn.idev.excel.FastExcel;
44
import com.alibaba.fastjson.JSON;
55
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
66
import jakarta.annotation.Resource;
@@ -174,7 +174,7 @@ public ResponseDTO<PageResult<GoodsVO>> query(GoodsQueryForm queryForm) {
174174
public ResponseDTO<String> importGoods(MultipartFile file) {
175175
List<GoodsImportForm> dataList;
176176
try {
177-
dataList = EasyExcel.read(file.getInputStream()).head(GoodsImportForm.class)
177+
dataList = FastExcel.read(file.getInputStream()).head(GoodsImportForm.class)
178178
.sheet()
179179
.doReadSync();
180180
} catch (IOException e) {
@@ -194,12 +194,13 @@ public ResponseDTO<String> importGoods(MultipartFile file) {
194194
*/
195195
public List<GoodsExcelVO> getAllGoods() {
196196
List<GoodsEntity> goodsEntityList = goodsDao.selectList(null);
197+
String keyCode="GODOS_PLACE";
197198
return goodsEntityList.stream()
198199
.map(e ->
199200
GoodsExcelVO.builder()
200201
.goodsStatus(SmartEnumUtil.getEnumDescByValue(e.getGoodsStatus(), GoodsStatusEnum.class))
201202
.categoryName(categoryQueryService.queryCategoryName(e.getCategoryId()))
202-
.place(Arrays.stream(e.getPlace().split(",")).map(code -> dictCacheService.selectValueNameByValueCode(code)).collect(Collectors.joining(",")))
203+
.place(Arrays.stream(e.getPlace().split(",")).map(code -> dictCacheService.selectValueNameByValueCode(keyCode,code)).collect(Collectors.joining(",")))
203204
.price(e.getPrice())
204205
.goodsName(e.getGoodsName())
205206
.remark(e.getRemark())

smart-admin-api-java17-springboot3/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/enterprise/domain/vo/EnterpriseExcelVO.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package net.lab1024.sa.admin.module.business.oa.enterprise.domain.vo;
22

3-
import com.alibaba.excel.annotation.ExcelProperty;
3+
import cn.idev.excel.annotation.ExcelProperty;
44
import lombok.Data;
55

66
/**

smart-admin-api-java17-springboot3/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/notice/domain/form/NoticeQueryForm.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public class NoticeQueryForm extends PageParam {
2828
private String documentNumber;
2929

3030
@Schema(description = "创建人")
31-
private Long createUserId;
31+
private String createUserName;
3232

3333
@Schema(description = "删除标识")
3434
private Boolean deletedFlag;

smart-admin-api-java17-springboot3/sa-admin/src/main/java/net/lab1024/sa/admin/module/business/oa/notice/service/NoticeService.java

+4
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,10 @@ public NoticeUpdateFormVO getUpdateFormVO(Long noticeId) {
208208
}
209209

210210
NoticeUpdateFormVO updateFormVO = SmartBeanUtil.copy(noticeEntity, NoticeUpdateFormVO.class);
211+
NoticeTypeVO noticeType = noticeTypeService.getByNoticeTypeId(noticeEntity.getNoticeTypeId());
212+
updateFormVO.setNoticeTypeName(noticeType.getNoticeTypeName());
213+
updateFormVO.setPublishFlag(updateFormVO.getPublishTime() != null && updateFormVO.getPublishTime().isBefore(LocalDateTime.now()));
214+
211215
if (!updateFormVO.getAllVisibleFlag()) {
212216
List<NoticeVisibleRangeVO> noticeVisibleRangeList = noticeDao.queryVisibleRange(noticeId);
213217
List<Long> employeeIdList = noticeVisibleRangeList.stream().filter(e -> NoticeVisibleRangeDataTypeEnum.EMPLOYEE.getValue().equals(e.getDataType()))

smart-admin-api-java17-springboot3/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/datascope/constant/DataScopeViewTypeEnum.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66

77
/**
8-
* 数据范围 种类
8+
* 数据可见范围类型
99
*
1010
* @Author 1024创新实验室: 罗伊
1111
* @Date 2020/11/28 20:59:17

smart-admin-api-java17-springboot3/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/datascope/domain/DataScopeSqlConfig.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public class DataScopeSqlConfig {
2525
/**
2626
* join sql 具体实现类
2727
*/
28-
private Class joinSqlImplClazz;
28+
private Class<?> joinSqlImplClazz;
2929

3030
private String joinSql;
3131

smart-admin-api-java17-springboot3/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/datascope/domain/DataScopeViewTypeVO.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import lombok.Data;
66

77
/**
8-
* 数据范围
8+
* 数据可见范围
99
*
1010
* @Author 1024创新实验室: 罗伊
1111
* @Date 2020/11/28 20:59:17

0 commit comments

Comments
 (0)