Compare commits

...

3 Commits
1.0.2 ... 1.0.4

Author SHA1 Message Date
曾文豪
f8c121ba6f publish 1.0.4 2023-05-23 15:15:19 +08:00
曾文豪
0307d3f544 perf:调整过程日志的异常数据存储方式 2023-05-23 15:14:32 +08:00
曾文豪
6f0bfb1a7d publish 1.0.3 2023-05-22 11:58:40 +08:00
13 changed files with 29 additions and 26 deletions

20
pom.xml
View File

@@ -6,7 +6,7 @@
<groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-parent</artifactId>
<version>1.0.2</version>
<version>1.0.4</version>
<packaging>pom</packaging>
<name>springboot-parent</name>
<description>杭州铁晟科技有限公司基础依赖</description>
@@ -57,55 +57,55 @@
<dependency>
<groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-database</artifactId>
<version>1.0.2</version>
<version>1.0.4</version>
</dependency>
<dependency>
<groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-login</artifactId>
<version>1.0.2</version>
<version>1.0.4</version>
</dependency>
<dependency>
<groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-web</artifactId>
<version>1.0.2</version>
<version>1.0.4</version>
</dependency>
<dependency>
<groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-util</artifactId>
<version>1.0.2</version>
<version>1.0.4</version>
</dependency>
<dependency>
<groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-platform</artifactId>
<version>1.0.2</version>
<version>1.0.4</version>
</dependency>
<dependency>
<groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-message</artifactId>
<version>1.0.2</version>
<version>1.0.4</version>
</dependency>
<dependency>
<groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-encrypt</artifactId>
<version>1.0.2</version>
<version>1.0.4</version>
</dependency>
<dependency>
<groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-annotation</artifactId>
<version>1.0.2</version>
<version>1.0.4</version>
</dependency>
<dependency>
<groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-poi</artifactId>
<version>1.0.2</version>
<version>1.0.4</version>
</dependency>
<dependency>

View File

@@ -6,7 +6,7 @@
<parent>
<groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-parent</artifactId>
<version>1.0.2</version>
<version>1.0.4</version>
</parent>
<artifactId>springboot-ademo</artifactId>

View File

@@ -6,7 +6,7 @@
<parent>
<groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-parent</artifactId>
<version>1.0.2</version>
<version>1.0.4</version>
</parent>
<artifactId>springboot-annotation</artifactId>

View File

@@ -6,7 +6,7 @@
<parent>
<groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-parent</artifactId>
<version>1.0.2</version>
<version>1.0.4</version>
</parent>
<artifactId>springboot-database</artifactId>

View File

@@ -6,7 +6,7 @@
<parent>
<groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-parent</artifactId>
<version>1.0.2</version>
<version>1.0.4</version>
</parent>
<artifactId>springboot-encrypt</artifactId>

View File

@@ -6,7 +6,7 @@
<parent>
<groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-parent</artifactId>
<version>1.0.2</version>
<version>1.0.4</version>
</parent>
<artifactId>springboot-login</artifactId>

View File

@@ -6,7 +6,7 @@
<parent>
<groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-parent</artifactId>
<version>1.0.2</version>
<version>1.0.4</version>
</parent>
<artifactId>springboot-message</artifactId>

View File

@@ -6,7 +6,7 @@
<parent>
<groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-parent</artifactId>
<version>1.0.2</version>
<version>1.0.4</version>
</parent>
<artifactId>springboot-platform</artifactId>

View File

@@ -6,7 +6,7 @@
<parent>
<groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-parent</artifactId>
<version>1.0.2</version>
<version>1.0.4</version>
</parent>
<artifactId>springboot-poi</artifactId>

View File

@@ -6,7 +6,7 @@
<parent>
<groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-parent</artifactId>
<version>1.0.2</version>
<version>1.0.4</version>
</parent>
<artifactId>springboot-util</artifactId>

View File

@@ -6,7 +6,7 @@
<parent>
<groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-parent</artifactId>
<version>1.0.2</version>
<version>1.0.4</version>
</parent>
<artifactId>springboot-web</artifactId>

View File

@@ -16,8 +16,6 @@ import org.springframework.stereotype.Component;
import javax.servlet.http.HttpServletRequest;
import java.lang.reflect.Method;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
@@ -74,11 +72,11 @@ public class OperationAspect {
ConcurrentHashMap<String, Object> allParams = new ConcurrentHashMap<>(16);
if (joinPoint.getArgs().length > 0) {
reqObj = joinPoint.getArgs()[0];
allParams.putAll(BeanUtil.beanToMap(reqObj));
allParams.putAll(BeanUtil.beanToMap(reqObj, false, true));
}
Object response = joinPoint.proceed(joinPoint.getArgs());
allParams.putAll(BeanUtil.beanToMap(response));
allParams.putAll(BeanUtil.beanToMap(response, false, true));
if (!StrUtil.isEmpty(subject)) {
// 添加、编辑关键字处理

View File

@@ -28,6 +28,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.servlet.http.HttpServletRequest;
import java.util.ArrayList;
import java.util.List;
/**
@@ -84,12 +85,13 @@ public class CoreLogService extends TsServiceBase<CoreLogOperationMapper, CoreLo
coreLogProcessMapper.insert(coreLogProcess);
ThreadUtil.execute(() -> {
List<Exception> errorList = new ArrayList<>();
CollUtil.split(list, 100).forEach((it) -> {
int accept = 0;
try {
accept = consumer.accept(it);
} catch (Exception e) {
coreLogProcess.setError(coreLogProcess.getError() + ";" + JSONUtil.toJsonStr(e));
errorList.add(e);
}
coreLogProcess.setProcess(coreLogProcess.getProcess() + it.size());
coreLogProcess.setSuccessNum(coreLogProcess.getSuccessNum() + accept);
@@ -100,6 +102,7 @@ public class CoreLogService extends TsServiceBase<CoreLogOperationMapper, CoreLo
// 执行结束
coreLogProcess.setFailFile(consumer.getFailFile());
coreLogProcess.setStatus(1);
coreLogProcess.setError(JSONUtil.toJsonStr(errorList));
coreLogProcessMapper.updateById(coreLogProcess);
});
@@ -130,6 +133,7 @@ public class CoreLogService extends TsServiceBase<CoreLogOperationMapper, CoreLo
ThreadUtil.execute(() -> {
int pageSize = 1000;
int pageNum = 1, lastCount = pageSize;
List<Exception> errorList = new ArrayList<>();
while (lastCount == pageSize) {
try {
lastCount = consumer.accept(pageNum, pageSize);
@@ -137,13 +141,14 @@ public class CoreLogService extends TsServiceBase<CoreLogOperationMapper, CoreLo
coreLogProcess.setProcess(coreLogProcess.getTotal());
coreLogProcess.setSuccessNum(coreLogProcess.getSuccessNum() + lastCount);
} catch (Exception e) {
coreLogProcess.setError(coreLogProcess.getError() + ";" + JSONUtil.toJsonStr(e));
errorList.add(e);
}
coreLogProcessMapper.updateById(coreLogProcess);
pageNum++;
}
// 执行结束
coreLogProcess.setError(JSONUtil.toJsonStr(errorList));
coreLogProcess.setStatus(1);
coreLogProcessMapper.updateById(coreLogProcess);
});