Compare commits
17 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0cb1581176 | ||
|
|
5ed663e112 | ||
|
|
b5fd837ccf | ||
|
|
38d6bae04f | ||
|
|
e49bf32117 | ||
|
|
bc3ea0e10c | ||
|
|
305dc743b2 | ||
|
|
6f0360bad5 | ||
|
|
5012c4bd53 | ||
|
|
dd69b3bb1f | ||
|
|
33d20c518e | ||
|
|
d0935cbda0 | ||
|
|
3ed9a47c66 | ||
|
|
3f6989d039 | ||
|
|
6f6e997fd3 | ||
|
|
d9987b41ea | ||
|
|
c33ad6075e |
@@ -9,8 +9,8 @@ deploy-jar:
|
|||||||
rules:
|
rules:
|
||||||
- if: $CI_COMMIT_TAG
|
- if: $CI_COMMIT_TAG
|
||||||
script:
|
script:
|
||||||
- mvn clean deploy -Dmaven.test.skip -DaltDeploymentRepository=master::default::file:/usr/local/nginx/html/kepai-repo
|
- mvn clean deploy -Dmaven.test.skip -DaltDeploymentRepository=master::default::file:$TAG_REPO_FOLDER
|
||||||
- cd /usr/local/nginx/html/kepai-repo
|
- cd $TAG_REPO_FOLDER
|
||||||
- git checkout master
|
- git checkout master
|
||||||
- git pull
|
- git pull
|
||||||
- git add .
|
- git add .
|
||||||
|
|||||||
24
pom.xml
24
pom.xml
@@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||||
<artifactId>springboot-parent</artifactId>
|
<artifactId>springboot-parent</artifactId>
|
||||||
<version>0.9.10</version>
|
<version>1.0.1</version>
|
||||||
<packaging>pom</packaging>
|
<packaging>pom</packaging>
|
||||||
<name>springboot-parent</name>
|
<name>springboot-parent</name>
|
||||||
<description>杭州铁晟科技有限公司基础依赖</description>
|
<description>杭州铁晟科技有限公司基础依赖</description>
|
||||||
@@ -57,55 +57,55 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||||
<artifactId>springboot-database</artifactId>
|
<artifactId>springboot-database</artifactId>
|
||||||
<version>0.9.10</version>
|
<version>1.0.1</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||||
<artifactId>springboot-login</artifactId>
|
<artifactId>springboot-login</artifactId>
|
||||||
<version>0.9.10</version>
|
<version>1.0.1</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||||
<artifactId>springboot-web</artifactId>
|
<artifactId>springboot-web</artifactId>
|
||||||
<version>0.9.10</version>
|
<version>1.0.1</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||||
<artifactId>springboot-util</artifactId>
|
<artifactId>springboot-util</artifactId>
|
||||||
<version>0.9.10</version>
|
<version>1.0.1</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||||
<artifactId>springboot-platform</artifactId>
|
<artifactId>springboot-platform</artifactId>
|
||||||
<version>0.9.10</version>
|
<version>1.0.1</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||||
<artifactId>springboot-message</artifactId>
|
<artifactId>springboot-message</artifactId>
|
||||||
<version>0.9.10</version>
|
<version>1.0.1</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||||
<artifactId>springboot-encrypt</artifactId>
|
<artifactId>springboot-encrypt</artifactId>
|
||||||
<version>0.9.10</version>
|
<version>1.0.1</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||||
<artifactId>springboot-annotation</artifactId>
|
<artifactId>springboot-annotation</artifactId>
|
||||||
<version>0.9.10</version>
|
<version>1.0.1</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||||
<artifactId>springboot-poi</artifactId>
|
<artifactId>springboot-poi</artifactId>
|
||||||
<version>0.9.10</version>
|
<version>1.0.1</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
@@ -117,7 +117,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.baomidou</groupId>
|
<groupId>com.baomidou</groupId>
|
||||||
<artifactId>mybatis-plus-boot-starter</artifactId>
|
<artifactId>mybatis-plus-boot-starter</artifactId>
|
||||||
<version>3.5.1</version>
|
<version>3.5.3</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
@@ -126,7 +126,7 @@
|
|||||||
<pluginRepositories>
|
<pluginRepositories>
|
||||||
<pluginRepository>
|
<pluginRepository>
|
||||||
<id>kepai-repo-plugin</id>
|
<id>kepai-repo-plugin</id>
|
||||||
<url>http://git.kepai365.com/zeng_wenhao/kepai-repo/raw/master</url>
|
<url>http://git.kepai365.com/tiesheng/repository/raw/master</url>
|
||||||
</pluginRepository>
|
</pluginRepository>
|
||||||
</pluginRepositories>
|
</pluginRepositories>
|
||||||
|
|
||||||
|
|||||||
@@ -6,11 +6,11 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||||
<artifactId>springboot-parent</artifactId>
|
<artifactId>springboot-parent</artifactId>
|
||||||
<version>0.9.10</version>
|
<version>1.0.1</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>springboot-ademo</artifactId>
|
<artifactId>springboot-ademo</artifactId>
|
||||||
<version>1.0.0</version>
|
<version>1.0.1</version>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<maven.compiler.source>8</maven.compiler.source>
|
<maven.compiler.source>8</maven.compiler.source>
|
||||||
@@ -36,7 +36,7 @@
|
|||||||
<repositories>
|
<repositories>
|
||||||
<repository>
|
<repository>
|
||||||
<id>kepai-repo</id>
|
<id>kepai-repo</id>
|
||||||
<url>http://git.kepai365.com/zeng_wenhao/kepai-repo/raw/master</url>
|
<url>http://git.kepai365.com/tiesheng/repository/raw/master</url>
|
||||||
</repository>
|
</repository>
|
||||||
</repositories>
|
</repositories>
|
||||||
|
|
||||||
|
|||||||
@@ -2,15 +2,17 @@ package com.tiesheng.demo.controller;
|
|||||||
|
|
||||||
import cn.hutool.core.collection.CollUtil;
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import cn.hutool.core.date.TimeInterval;
|
import cn.hutool.core.date.TimeInterval;
|
||||||
|
import cn.hutool.core.thread.ThreadUtil;
|
||||||
import cn.hutool.json.JSONUtil;
|
import cn.hutool.json.JSONUtil;
|
||||||
import cn.hutool.log.LogFactory;
|
import cn.hutool.log.LogFactory;
|
||||||
import cn.hutool.poi.excel.ExcelUtil;
|
import cn.hutool.poi.excel.ExcelUtil;
|
||||||
import cn.hutool.poi.excel.sax.handler.RowHandler;
|
|
||||||
import com.alibaba.excel.EasyExcel;
|
import com.alibaba.excel.EasyExcel;
|
||||||
import com.alibaba.excel.context.AnalysisContext;
|
import com.alibaba.excel.context.AnalysisContext;
|
||||||
import com.alibaba.excel.read.listener.ReadListener;
|
import com.alibaba.excel.read.listener.ReadListener;
|
||||||
import com.tiesheng.annotation.token.TokenIgnore;
|
import com.tiesheng.annotation.token.TokenIgnore;
|
||||||
|
import com.tiesheng.core.service.CoreLogService;
|
||||||
import com.tiesheng.core.service.CoreMessageService;
|
import com.tiesheng.core.service.CoreMessageService;
|
||||||
|
import com.tiesheng.core.util.ProcessImportConsumer;
|
||||||
import com.tiesheng.demo.pojos.PoiBean;
|
import com.tiesheng.demo.pojos.PoiBean;
|
||||||
import com.tiesheng.demo.pojos.TestFile;
|
import com.tiesheng.demo.pojos.TestFile;
|
||||||
import com.tiesheng.login.config.token.TsTokenConfig;
|
import com.tiesheng.login.config.token.TsTokenConfig;
|
||||||
@@ -27,6 +29,7 @@ import org.springframework.web.bind.annotation.RestController;
|
|||||||
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -46,6 +49,8 @@ public class TestController {
|
|||||||
EncryptConfig encryptConfig;
|
EncryptConfig encryptConfig;
|
||||||
@Autowired
|
@Autowired
|
||||||
CoreMessageService coreMessageService;
|
CoreMessageService coreMessageService;
|
||||||
|
@Autowired
|
||||||
|
CoreLogService coreLogService;
|
||||||
|
|
||||||
|
|
||||||
@RequestMapping("/index")
|
@RequestMapping("/index")
|
||||||
@@ -60,6 +65,25 @@ public class TestController {
|
|||||||
@RequestMapping("/redirect")
|
@RequestMapping("/redirect")
|
||||||
@TokenIgnore
|
@TokenIgnore
|
||||||
public void redirect(HttpServletResponse response) {
|
public void redirect(HttpServletResponse response) {
|
||||||
|
|
||||||
|
ArrayList<String> strings = CollUtil.newArrayList("11111","22222");
|
||||||
|
coreLogService.addProcess("fdfd", strings, new ProcessImportConsumer<String>() {
|
||||||
|
@Override
|
||||||
|
public int accept(List<String> list) {
|
||||||
|
LogFactory.get().info("list: " + list.size());
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getFailFile() {
|
||||||
|
LogFactory.get().info("getFailFile: " + strings.size());
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
LogFactory.get().info("strings: " + strings.size());
|
||||||
|
|
||||||
|
|
||||||
// tsTokenConfig.validToken("eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE2NzYwMDY4NzUsImlkIjoiMSIsImVudmlyb25tZW50VHlwZSI6Im1vYmlsZSIsInNlcnZpY2UiOiJjb250ZXN0LXJlc2VydmUiLCJleHRyYSI6IiJ9.nsfxEFpCNHC7eNCS5DJXdu1VDdnHrTjSfgrozND70Lc", true);
|
// tsTokenConfig.validToken("eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE2NzYwMDY4NzUsImlkIjoiMSIsImVudmlyb25tZW50VHlwZSI6Im1vYmlsZSIsInNlcnZpY2UiOiJjb250ZXN0LXJlc2VydmUiLCJleHRyYSI6IiJ9.nsfxEFpCNHC7eNCS5DJXdu1VDdnHrTjSfgrozND70Lc", true);
|
||||||
globalConfig.redirect("mobile", "/test", response);
|
globalConfig.redirect("mobile", "/test", response);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||||
<artifactId>springboot-parent</artifactId>
|
<artifactId>springboot-parent</artifactId>
|
||||||
<version>0.9.10</version>
|
<version>1.0.1</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>springboot-annotation</artifactId>
|
<artifactId>springboot-annotation</artifactId>
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||||
<artifactId>springboot-parent</artifactId>
|
<artifactId>springboot-parent</artifactId>
|
||||||
<version>0.9.10</version>
|
<version>1.0.1</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>springboot-database</artifactId>
|
<artifactId>springboot-database</artifactId>
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||||
<artifactId>springboot-parent</artifactId>
|
<artifactId>springboot-parent</artifactId>
|
||||||
<version>0.9.10</version>
|
<version>1.0.1</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>springboot-encrypt</artifactId>
|
<artifactId>springboot-encrypt</artifactId>
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||||
<artifactId>springboot-parent</artifactId>
|
<artifactId>springboot-parent</artifactId>
|
||||||
<version>0.9.10</version>
|
<version>1.0.1</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>springboot-login</artifactId>
|
<artifactId>springboot-login</artifactId>
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||||
<artifactId>springboot-parent</artifactId>
|
<artifactId>springboot-parent</artifactId>
|
||||||
<version>0.9.10</version>
|
<version>1.0.1</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>springboot-message</artifactId>
|
<artifactId>springboot-message</artifactId>
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||||
<artifactId>springboot-parent</artifactId>
|
<artifactId>springboot-parent</artifactId>
|
||||||
<version>0.9.10</version>
|
<version>1.0.1</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>springboot-platform</artifactId>
|
<artifactId>springboot-platform</artifactId>
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||||
<artifactId>springboot-parent</artifactId>
|
<artifactId>springboot-parent</artifactId>
|
||||||
<version>0.9.10</version>
|
<version>1.0.1</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>springboot-poi</artifactId>
|
<artifactId>springboot-poi</artifactId>
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||||
<artifactId>springboot-parent</artifactId>
|
<artifactId>springboot-parent</artifactId>
|
||||||
<version>0.9.10</version>
|
<version>1.0.1</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>springboot-util</artifactId>
|
<artifactId>springboot-util</artifactId>
|
||||||
@@ -33,14 +33,14 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>cn.hutool</groupId>
|
<groupId>cn.hutool</groupId>
|
||||||
<artifactId>hutool-all</artifactId>
|
<artifactId>hutool-all</artifactId>
|
||||||
<version>5.8.11</version>
|
<version>5.8.16</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- fastJson -->
|
<!-- fastJson -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.alibaba</groupId>
|
<groupId>com.alibaba</groupId>
|
||||||
<artifactId>fastjson</artifactId>
|
<artifactId>fastjson</artifactId>
|
||||||
<version>1.2.78</version>
|
<version>1.2.83</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- 加解密 -->
|
<!-- 加解密 -->
|
||||||
|
|||||||
@@ -20,7 +20,9 @@ public class CommonUtil {
|
|||||||
FastJsonConfig config = new FastJsonConfig();
|
FastJsonConfig config = new FastJsonConfig();
|
||||||
config.setSerializerFeatures(SerializerFeature.WriteMapNullValue,
|
config.setSerializerFeatures(SerializerFeature.WriteMapNullValue,
|
||||||
SerializerFeature.WriteNullStringAsEmpty,
|
SerializerFeature.WriteNullStringAsEmpty,
|
||||||
SerializerFeature.WriteEnumUsingName);
|
SerializerFeature.WriteEnumUsingName,
|
||||||
|
SerializerFeature.DisableCircularReferenceDetect
|
||||||
|
);
|
||||||
config.setDateFormat("yyyy-MM-dd HH:mm:ss");
|
config.setDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||||
config.setSerializeFilters(new DesensitizeValueFilter());
|
config.setSerializeFilters(new DesensitizeValueFilter());
|
||||||
return config;
|
return config;
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import cn.hutool.core.comparator.VersionComparator;
|
|||||||
import cn.hutool.core.io.FileUtil;
|
import cn.hutool.core.io.FileUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import cn.hutool.extra.spring.SpringUtil;
|
import cn.hutool.extra.spring.SpringUtil;
|
||||||
|
import cn.hutool.json.JSONUtil;
|
||||||
import cn.hutool.log.LogFactory;
|
import cn.hutool.log.LogFactory;
|
||||||
import com.tiesheng.util.exception.ApiException;
|
import com.tiesheng.util.exception.ApiException;
|
||||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||||
@@ -13,6 +14,7 @@ import org.springframework.core.io.Resource;
|
|||||||
import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
|
import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -71,12 +73,24 @@ public class GlobalConfig {
|
|||||||
}
|
}
|
||||||
PathMatchingResourcePatternResolver patternResolver = new PathMatchingResourcePatternResolver();
|
PathMatchingResourcePatternResolver patternResolver = new PathMatchingResourcePatternResolver();
|
||||||
try {
|
try {
|
||||||
Resource[] resources = patternResolver.getResources(String.format("classpath*:static/%s*/index.html", htmlDir));
|
|
||||||
List<String> versions = new ArrayList<>();
|
List<String> versions = new ArrayList<>();
|
||||||
|
|
||||||
|
// jar包中的资源
|
||||||
|
Resource[] resources = patternResolver.getResources(String.format("classpath*:static/%s*/index.html", htmlDir));
|
||||||
for (Resource resource : resources) {
|
for (Resource resource : resources) {
|
||||||
String path = FileUtil.normalize(resource.getURL().getPath());
|
String path = FileUtil.normalize(resource.getURL().getPath());
|
||||||
versions.add(StrUtil.subBetween(path, htmlDir, "/index.html"));
|
versions.add(StrUtil.subBetween(path, htmlDir, "/index.html"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 目录中的资源
|
||||||
|
String folder = String.format("%s/static/%s", System.getProperty("user.dir"), htmlDir);
|
||||||
|
if (FileUtil.exist(folder)) {
|
||||||
|
File[] files = FileUtil.ls(folder);
|
||||||
|
for (File file : files) {
|
||||||
|
versions.add(StrUtil.subAfter(file.getAbsolutePath(), htmlDir, true));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (CollUtil.isEmpty(versions)) {
|
if (CollUtil.isEmpty(versions)) {
|
||||||
throw new ApiException("无法重定向,请检查资源");
|
throw new ApiException("无法重定向,请检查资源");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ import javax.annotation.PostConstruct;
|
|||||||
@ConfigurationProperties(prefix = "tiesheng.ip2region")
|
@ConfigurationProperties(prefix = "tiesheng.ip2region")
|
||||||
public class Ip2regionConfig {
|
public class Ip2regionConfig {
|
||||||
|
|
||||||
private String dbUrl = "http://git.kepai365.com/zeng_wenhao/kepai-repo/raw/master/ipdb/ip2region.xdb";
|
private String dbUrl = "http://git.kepai365.com/tiesheng/repository/raw/master/ipdb/ip2region.xdb";
|
||||||
private String dbPath = System.getProperty("user.dir") + "/runtime/ip2region/ip2region.xdb";
|
private String dbPath = System.getProperty("user.dir") + "/runtime/ip2region/ip2region.xdb";
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||||
<artifactId>springboot-parent</artifactId>
|
<artifactId>springboot-parent</artifactId>
|
||||||
<version>0.9.10</version>
|
<version>1.0.1</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>springboot-web</artifactId>
|
<artifactId>springboot-web</artifactId>
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ import com.tiesheng.core.pojos.dto.config.ConfigFuncDTO;
|
|||||||
import com.tiesheng.core.pojos.dto.config.ConfigSystemDTO;
|
import com.tiesheng.core.pojos.dto.config.ConfigSystemDTO;
|
||||||
import com.tiesheng.core.pojos.dto.config.EnumTypeDTO;
|
import com.tiesheng.core.pojos.dto.config.EnumTypeDTO;
|
||||||
import com.tiesheng.core.service.CoreConfigService;
|
import com.tiesheng.core.service.CoreConfigService;
|
||||||
|
import com.tiesheng.core.service.TieshengWebConfigurer;
|
||||||
import com.tiesheng.util.exception.ApiException;
|
import com.tiesheng.util.exception.ApiException;
|
||||||
import com.tiesheng.util.pojos.ApiResp;
|
import com.tiesheng.util.pojos.ApiResp;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@@ -31,6 +32,8 @@ public class ConfigController {
|
|||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
CoreConfigService coreConfigService;
|
CoreConfigService coreConfigService;
|
||||||
|
@Autowired
|
||||||
|
TieshengWebConfigurer tieshengWebConfigurer;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -72,6 +75,8 @@ public class ConfigController {
|
|||||||
configKey.setConfigVal(dto.getConfigVal());
|
configKey.setConfigVal(dto.getConfigVal());
|
||||||
configKey.setRemark(dto.getRemark());
|
configKey.setRemark(dto.getRemark());
|
||||||
configKey.setExtra(dto.getExtra());
|
configKey.setExtra(dto.getExtra());
|
||||||
|
|
||||||
|
tieshengWebConfigurer.configSystemCheck(configKey);
|
||||||
coreConfigService.updateById(configKey);
|
coreConfigService.updateById(configKey);
|
||||||
|
|
||||||
return ApiResp.respOK("");
|
return ApiResp.respOK("");
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ import com.baomidou.mybatisplus.annotation.TableField;
|
|||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import com.tiesheng.core.pojos.DaoBase;
|
import com.tiesheng.core.pojos.DaoBase;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -37,12 +36,6 @@ public class CoreLogProcess extends DaoBase {
|
|||||||
@TableField(value = "fail_num")
|
@TableField(value = "fail_num")
|
||||||
private Integer failNum;
|
private Integer failNum;
|
||||||
|
|
||||||
/**
|
|
||||||
* 失败的文件
|
|
||||||
*/
|
|
||||||
@TableField(value = "fail_file")
|
|
||||||
private String failFile;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 类型(import-导入,sync-同步)
|
* 类型(import-导入,sync-同步)
|
||||||
*/
|
*/
|
||||||
@@ -50,11 +43,29 @@ public class CoreLogProcess extends DaoBase {
|
|||||||
private String type;
|
private String type;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 状态(0-未完成,1-完成)
|
* 状态(0-未完成,1-已完成)
|
||||||
*/
|
*/
|
||||||
@TableField(value = "`status`")
|
@TableField(value = "`status`")
|
||||||
private Integer status;
|
private Integer status;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 失败的文件
|
||||||
|
*/
|
||||||
|
@TableField(value = "fail_file")
|
||||||
|
private String failFile;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 异常说明
|
||||||
|
*/
|
||||||
|
@TableField(value = "error")
|
||||||
|
private String error;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 进度
|
||||||
|
*/
|
||||||
|
@TableField(value = "`process`")
|
||||||
|
private Integer process;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取标题
|
* 获取标题
|
||||||
*
|
*
|
||||||
@@ -127,14 +138,6 @@ public class CoreLogProcess extends DaoBase {
|
|||||||
this.failNum = failNum;
|
this.failNum = failNum;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getFailFile() {
|
|
||||||
return failFile;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setFailFile(String failFile) {
|
|
||||||
this.failFile = failFile;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取类型(import-导入,sync-同步)
|
* 获取类型(import-导入,sync-同步)
|
||||||
*
|
*
|
||||||
@@ -154,20 +157,74 @@ public class CoreLogProcess extends DaoBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取状态(0-未完成,1-完成)
|
* 获取状态(0-未完成,1-已完成)
|
||||||
*
|
*
|
||||||
* @return status - 状态(0-未完成,1-完成)
|
* @return status - 状态(0-未完成,1-已完成)
|
||||||
*/
|
*/
|
||||||
public Integer getStatus() {
|
public Integer getStatus() {
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设置状态(0-未完成,1-完成)
|
* 设置状态(0-未完成,1-已完成)
|
||||||
*
|
*
|
||||||
* @param status 状态(0-未完成,1-完成)
|
* @param status 状态(0-未完成,1-已完成)
|
||||||
*/
|
*/
|
||||||
public void setStatus(Integer status) {
|
public void setStatus(Integer status) {
|
||||||
this.status = status;
|
this.status = status;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
/**
|
||||||
|
* 获取失败的文件
|
||||||
|
*
|
||||||
|
* @return fail_file - 失败的文件
|
||||||
|
*/
|
||||||
|
public String getFailFile() {
|
||||||
|
return failFile;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置失败的文件
|
||||||
|
*
|
||||||
|
* @param failFile 失败的文件
|
||||||
|
*/
|
||||||
|
public void setFailFile(String failFile) {
|
||||||
|
this.failFile = failFile;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取异常说明
|
||||||
|
*
|
||||||
|
* @return error - 异常说明
|
||||||
|
*/
|
||||||
|
public String getError() {
|
||||||
|
return error;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置异常说明
|
||||||
|
*
|
||||||
|
* @param error 异常说明
|
||||||
|
*/
|
||||||
|
public void setError(String error) {
|
||||||
|
this.error = error;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取进度
|
||||||
|
*
|
||||||
|
* @return process - 进度
|
||||||
|
*/
|
||||||
|
public Integer getProcess() {
|
||||||
|
return process;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置进度
|
||||||
|
*
|
||||||
|
* @param process 进度
|
||||||
|
*/
|
||||||
|
public void setProcess(Integer process) {
|
||||||
|
this.process = process;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -13,12 +13,16 @@ public class ProcessDetailVo {
|
|||||||
|
|
||||||
private Integer failNum;
|
private Integer failNum;
|
||||||
|
|
||||||
|
private Integer process;
|
||||||
|
|
||||||
private String type;
|
private String type;
|
||||||
|
|
||||||
private Integer status;
|
private Integer status;
|
||||||
|
|
||||||
private String failFile;
|
private String failFile;
|
||||||
|
|
||||||
|
private String error;
|
||||||
|
|
||||||
public Integer getStatus() {
|
public Integer getStatus() {
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
@@ -74,4 +78,20 @@ public class ProcessDetailVo {
|
|||||||
public void setFailFile(String failFile) {
|
public void setFailFile(String failFile) {
|
||||||
this.failFile = failFile;
|
this.failFile = failFile;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Integer getProcess() {
|
||||||
|
return process;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setProcess(Integer process) {
|
||||||
|
this.process = process;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getError() {
|
||||||
|
return error;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setError(String error) {
|
||||||
|
this.error = error;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -79,21 +79,28 @@ public class CoreLogService extends TsServiceBase<CoreLogOperationMapper, CoreLo
|
|||||||
coreLogProcess.setType("import");
|
coreLogProcess.setType("import");
|
||||||
coreLogProcess.setSuccessNum(0);
|
coreLogProcess.setSuccessNum(0);
|
||||||
coreLogProcess.setFailNum(0);
|
coreLogProcess.setFailNum(0);
|
||||||
|
coreLogProcess.setProcess(0);
|
||||||
|
coreLogProcess.setError("");
|
||||||
coreLogProcessMapper.insert(coreLogProcess);
|
coreLogProcessMapper.insert(coreLogProcess);
|
||||||
|
|
||||||
ThreadUtil.execute(() -> {
|
ThreadUtil.execute(() -> {
|
||||||
CollUtil.split(list, 100).forEach((it) -> {
|
CollUtil.split(list, 100).forEach((it) -> {
|
||||||
int accept = consumer.accept(it);
|
int accept = 0;
|
||||||
coreLogProcess.setSuccessNum(coreLogProcess.getSuccessNum() + accept);
|
try {
|
||||||
coreLogProcess.setFailNum(coreLogProcess.getFailNum() + 100 - accept);
|
accept = consumer.accept(it);
|
||||||
|
} catch (Exception e) {
|
||||||
if (coreLogProcess.getFailNum() + coreLogProcess.getSuccessNum() == list.size()) {
|
coreLogProcess.setError(coreLogProcess.getError() + ";" + JSONUtil.toJsonStr(e));
|
||||||
coreLogProcess.setFailFile(consumer.getFailFile());
|
|
||||||
coreLogProcess.setStatus(1);
|
|
||||||
}
|
}
|
||||||
|
coreLogProcess.setProcess(coreLogProcess.getProcess() + it.size());
|
||||||
|
coreLogProcess.setSuccessNum(coreLogProcess.getSuccessNum() + accept);
|
||||||
|
coreLogProcess.setFailNum(coreLogProcess.getFailNum() + it.size() - accept);
|
||||||
coreLogProcessMapper.updateById(coreLogProcess);
|
coreLogProcessMapper.updateById(coreLogProcess);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// 执行结束
|
||||||
|
coreLogProcess.setFailFile(consumer.getFailFile());
|
||||||
|
coreLogProcess.setStatus(1);
|
||||||
|
coreLogProcessMapper.updateById(coreLogProcess);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
@@ -111,24 +118,34 @@ public class CoreLogService extends TsServiceBase<CoreLogOperationMapper, CoreLo
|
|||||||
public CoreLogProcess addProcess(String title, ProcessSyncConsumer consumer) {
|
public CoreLogProcess addProcess(String title, ProcessSyncConsumer consumer) {
|
||||||
CoreLogProcess coreLogProcess = new CoreLogProcess();
|
CoreLogProcess coreLogProcess = new CoreLogProcess();
|
||||||
coreLogProcess.setTitle(title);
|
coreLogProcess.setTitle(title);
|
||||||
coreLogProcess.setTotal(0);
|
|
||||||
coreLogProcess.setType("sync");
|
coreLogProcess.setType("sync");
|
||||||
coreLogProcess.setSuccessNum(0);
|
coreLogProcess.setSuccessNum(0);
|
||||||
coreLogProcess.setFailNum(0);
|
coreLogProcess.setFailNum(0);
|
||||||
|
coreLogProcess.setTotal(0);
|
||||||
|
coreLogProcess.setProcess(0);
|
||||||
|
coreLogProcess.setError("");
|
||||||
coreLogProcessMapper.insert(coreLogProcess);
|
coreLogProcessMapper.insert(coreLogProcess);
|
||||||
|
|
||||||
ThreadUtil.execute(() -> {
|
ThreadUtil.execute(() -> {
|
||||||
int pageSize = 1000;
|
int pageSize = 1000;
|
||||||
int pageNum = 1, lastCount = pageSize;
|
int pageNum = 1, lastCount = pageSize;
|
||||||
while (lastCount == pageSize) {
|
while (lastCount == pageSize) {
|
||||||
lastCount = consumer.accept(pageNum, pageSize);
|
try {
|
||||||
coreLogProcess.setSuccessNum(coreLogProcess.getSuccessNum() + lastCount);
|
lastCount = consumer.accept(pageNum, pageSize);
|
||||||
if (lastCount != pageSize) {
|
coreLogProcess.setTotal(coreLogProcess.getTotal() + lastCount);
|
||||||
coreLogProcess.setStatus(1);
|
coreLogProcess.setProcess(coreLogProcess.getTotal());
|
||||||
|
coreLogProcess.setSuccessNum(coreLogProcess.getSuccessNum() + lastCount);
|
||||||
|
} catch (Exception e) {
|
||||||
|
coreLogProcess.setError(coreLogProcess.getError() + ";" + JSONUtil.toJsonStr(e));
|
||||||
}
|
}
|
||||||
coreLogProcessMapper.updateById(coreLogProcess);
|
coreLogProcessMapper.updateById(coreLogProcess);
|
||||||
pageNum++;
|
pageNum++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 执行结束
|
||||||
|
coreLogProcess.setStatus(1);
|
||||||
|
coreLogProcessMapper.updateById(coreLogProcess);
|
||||||
});
|
});
|
||||||
|
|
||||||
return coreLogProcess;
|
return coreLogProcess;
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package com.tiesheng.core.service;
|
|||||||
|
|
||||||
import cn.hutool.log.LogFactory;
|
import cn.hutool.log.LogFactory;
|
||||||
import com.tiesheng.core.pojos.RequestUserInfo;
|
import com.tiesheng.core.pojos.RequestUserInfo;
|
||||||
|
import com.tiesheng.core.pojos.dao.CoreConfigSystem;
|
||||||
import com.tiesheng.core.pojos.dao.CorePlatformUnique;
|
import com.tiesheng.core.pojos.dao.CorePlatformUnique;
|
||||||
import com.tiesheng.login.config.token.bean.TokenBean;
|
import com.tiesheng.login.config.token.bean.TokenBean;
|
||||||
import com.tiesheng.util.exception.ApiRespEnum;
|
import com.tiesheng.util.exception.ApiRespEnum;
|
||||||
@@ -54,6 +55,14 @@ public interface TieshengWebConfigurer {
|
|||||||
return uploadPath;
|
return uploadPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 系统配置验证
|
||||||
|
* 如果不符合规则,可以抛出异常
|
||||||
|
*/
|
||||||
|
default void configSystemCheck(CoreConfigSystem configSystem) {
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 登录逻辑
|
* 登录逻辑
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -64,6 +64,12 @@ ALTER TABLE core_log_process
|
|||||||
ALTER TABLE core_log_process
|
ALTER TABLE core_log_process
|
||||||
ADD fail_file varchar(500) null default null COMMENT '失败的文件';
|
ADD fail_file varchar(500) null default null COMMENT '失败的文件';
|
||||||
|
|
||||||
|
ALTER TABLE core_log_process
|
||||||
|
ADD error text null default null COMMENT '异常说明';
|
||||||
|
|
||||||
|
ALTER TABLE core_log_process
|
||||||
|
ADD process int(6) not null default 0 COMMENT '进度';
|
||||||
|
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
-- Table structure for core_log_operation
|
-- Table structure for core_log_operation
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
|
|||||||
@@ -15,10 +15,12 @@
|
|||||||
<result column="type" jdbcType="VARCHAR" property="type" />
|
<result column="type" jdbcType="VARCHAR" property="type" />
|
||||||
<result column="status" jdbcType="INTEGER" property="status" />
|
<result column="status" jdbcType="INTEGER" property="status" />
|
||||||
<result column="fail_file" jdbcType="VARCHAR" property="failFile" />
|
<result column="fail_file" jdbcType="VARCHAR" property="failFile" />
|
||||||
|
<result column="error" jdbcType="LONGVARCHAR" property="error" />
|
||||||
|
<result column="process" jdbcType="INTEGER" property="process" />
|
||||||
</resultMap>
|
</resultMap>
|
||||||
<sql id="Base_Column_List">
|
<sql id="Base_Column_List">
|
||||||
<!--@mbg.generated-->
|
<!--@mbg.generated-->
|
||||||
id, create_time, update_time, is_deleted, title, total, success_num, fail_num, `type`,
|
id, create_time, update_time, is_deleted, title, total, success_num, fail_num, `type`,
|
||||||
`status`, fail_file
|
`status`, fail_file, error, `process`
|
||||||
</sql>
|
</sql>
|
||||||
</mapper>
|
</mapper>
|
||||||
Reference in New Issue
Block a user