Skip to content

Commit

Permalink
!89 update 0.9.8.5
Browse files Browse the repository at this point in the history
Merge pull request !89 from Foming/dev
  • Loading branch information
Foming authored and gitee-org committed Sep 7, 2022
2 parents 6175dde + 0860db7 commit 4d9fa1a
Show file tree
Hide file tree
Showing 26 changed files with 429 additions and 299 deletions.
15 changes: 7 additions & 8 deletions doc/docs/guide/quicklyDistribution.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
```
第一步,下载zip包,解压
第二步,conf->bootstrap.yml,修改mysql连接
第二步,conf->bootstrap.yml,修改mysql连接等信息
第三步,启动bin目录下start.sh
第四步,访问 http://localhost:9095
第四步,访问 http://localhost:9095 admin 123456
第五步,修改"数据源->mysql数据源"用户名密码
```

## 下载发行版
Expand All @@ -21,10 +22,10 @@
![bootstrap.png](../picture/quickly/img_2.png) <br>
****:请确认你的Mysql是否支持远程连接,登陆用户是否有DDL权限 <br>

## 上传功能
## OSS配置

使用上传功能,必须修改此内容,注意路径格式,比如Win是 \ ,linux是 / <br>
![file.png](../picture/quickly/img_15.png) <br>
OSS底层已支持minio、amazonS3、dfs,都配置的情况下优先级minio->amazonS3->nfs <br>
![file.png](../picture/quickly/img.png) <br>

## 启动

Expand All @@ -38,9 +39,7 @@ aj-report-XXX --> bin --> start.bat <br>

如果start.bat启动有问题的话,可以尝试以下方法解决。<br>
修改第4行的JAVA_HOME,改成你自己的JAVA_HOME,并去掉**rem**注释,双击启动<br>
![java.png](../picture/quickly/img_7.png) <br>
****:如果你JAVA_HOME目录存在空格,将bat文件最下面的JAVA_HOME添加""号
![img.png](../picture/quickly/img_8.png) <br>
![java.png](../picture/quickly/img_7.png)

## 访问

Expand Down
65 changes: 32 additions & 33 deletions doc/docs/guide/quicklySeparate.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ java -jar
BASE_API: '"./"',改成自己后端的api
npm install
npm run build
使用nginx转发
```

## linux部署后端
Expand All @@ -24,8 +26,8 @@ npm run build
- [Apache Maven] 3.5 <br>
- [Node.js] v14.16.0 <br>
- [Jdk] 1.8 <br>
请在你的Windows上先准备好maven、node.js、jdk <br>
****:已知 **Jdk11** (部分小版本)存在兼容性问题,请不要使用openJdk,环境问题请看 **常见问题** 大类 <br>

****:已知 **Jdk11** (部分小版本)存在兼容性问题,请不要使用openJdk,环境问题请看 **常见问题** 大类 <br>

### 克隆源码

Expand All @@ -36,46 +38,39 @@ git clone https://gitee.com/anji-plus/report.git <br>
### 修改mysql连接

report-core --> src --> main --> resources --> bootstrap.yml <br>
![bootstrap.png](../picture/quickly/img_2.png) <br>
将图中关于mysql的连接配置信息换成你使用的IP <br>
****:aj_report库是存放底层基础信息的库,flyway启动时会自动建立,如果你在这里修改了库,将会出错<br>
****:请确认你的Mysql是否支持远程连接,登陆用户是否有DDL权限 <br>

### 上传功能

使用上传功能,必须修改此内容,注意路径格式,比如Win是 \ ,linux是 / <br>
![file.png](../picture/quickly/img_15.png) <br>
![bootstrap.png](../picture/quickly/img_2.png) <br>

### maven打包
**注 :**

**打包之前如果系统用的不止mysql数据源,需要自己在pom文件中加入对应的数据库的驱动,登陆系统之后,数据源提示无驱动,则选择通用JDBC数据源,这里不做演示了** <br>
使用 maven package <br>
****:不要使用maven install <br>
****:此方式不会打包 lib目录下的驱动,详情可查看 **数据源 扩展** <br>
![img10](../picture/quickly/img_10.png) <br>

### linux启动jar包
```
1、aj_report库是存放底层基础信息的库,flyway启动时会自动建立,如果你在这里修改了库,将会出错
2、请确认你的Mysql是否支持远程连接,登陆用户是否有DDL权限
```

将上步生成的jar包上传至linux,使用java -jar命令启动 <br>
****:请确保你的linux有jdk <br>
### OSS配置

## 本地启动前端
OSS底层已支持minio、amazonS3、dfs,都配置的情况下优先级minio->amazonS3->nfs <br>
![file.png](../picture/quickly/img.png) <br>

### 前端编译
### maven打包

进入前端目录:report-ui <br>
![img11](../picture/quickly/img_11.png) <br>
执行 npm install <br>
直接使用 maven package 打包,打包完成如图所示<br>

### 修改config
![img10](../picture/quickly/img_10.png) <br>
**注 :**

目录地址:report-ui --> config --> dev.env.js <br>
修改你的BASE_API地址 <br>
```
1、打包之前如果系统用的不止mysql数据源,需要自己在pom文件中加入对应的数据库的驱动,登陆系统之后,数据源提示无驱动,则选择通用JDBC数据源,这里不做演示了
2、不要使用 maven install
3、此方式不会打包 lib目录下的驱动,详情可查看 "数据源->扩展"
```

### 启动前端
### linux启动jar包

report-ui目录: <br>
执行 npm run dev <br>
将上步生成的jar包上传至linux,使用java -jar命令启动 <br>
****:请确保你的linux有jdk1.8 <br>

## 前端build

Expand All @@ -88,14 +83,18 @@ report-ui目录: <br>
### 修改config

目录地址:report-ui --> config --> prod.env.js <br>
修改你的BASE_API地址,改成自己后端的api <br>
将BASE_API地址,改成你后端的api地址 <br>

### build
### 打包

reoprt-ui目录: <br>
执行 npm run build <br>

生成的前端dist目录文件在report-ui下面 <br>

![img12](../picture/quickly/img_12.png) <br>

### 前端部署

使用nginx做转发


15 changes: 9 additions & 6 deletions doc/docs/guide/quicklySource.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ cd aj-report-xxxx
vim conf/bootstrap.yml 修改数据库连接、上传文件的路径以及地址
sh bin/start.sh
访问
http://serverip:9095
访问:http://serverip:9095
admin 123456
修改:"数据源->mysql数据源"用户名密码
```

## 编译环境
Expand All @@ -37,7 +39,8 @@ git clone https://gitee.com/anji-plus/report.git <br>
编译完成后是放在当前目录下的build文件夹中:aj-report-xxxx.zip <br>

**注:** 如果Win10部署的话,如图用git执行sh build.sh就行了。Linux就直接去report目录下执行sh build.sh就行。 <br>
**特别注意:** 如果是Win10编译,那么几个启动脚本的格式则是win的格式,放linux上执行会报错的,反之放linux编译在win10启动也会报错,需要转格式。 <br>
**特别注意:**
如果是Win10编译,那么几个启动脚本的格式则是win的格式,放linux上执行会报错的,反之放linux编译在win10启动也会报错,需要转格式。 <br>

## 修改mysql连接

Expand All @@ -50,10 +53,10 @@ git clone https://gitee.com/anji-plus/report.git <br>
![bootstrap.png](../picture/quickly/img_2.png) <br>
****:请确认你的Mysql是否支持远程连接,登陆用户是否有DDL权限 <br>

## 上传功能
## OSS配置

使用上传功能,必须修改此内容,注意路径格式,比如Win是 \ ,linux是 / <br>
![file.png](../picture/quickly/img_15.png)
OSS底层已支持minio、amazonS3、dfs,都配置的情况下优先级minio->amazonS3->nfs <br>
![file.png](../picture/quickly/img.png) <br>

## 启动

Expand Down
Binary file added doc/docs/picture/quickly/img.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed doc/docs/picture/quickly/img_15.png
Binary file not shown.
40 changes: 40 additions & 0 deletions report-core/README.md
Original file line number Diff line number Diff line change
@@ -1 +1,41 @@
## 后端springboot

### 采用redis缓存

#### 1.pom文件
```java
<dependency>
<groupId>com.anji-plus</groupId>
<artifactId>spring-boot-gaea</artifactId>
<version>2.0.5.RELEASE</version>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-redis</artifactId>
</exclusion>
</exclusions>
</dependency>
```
删除exclusions内容,因为底层默认支持redis
删除ehcache相关依赖

#### 2.删除 package com.anjiplus.template.gaea.business.cache
CacheHelper底层默认实现为RedisCacheHelper。
@ConditionalOnMissingBean 注解起到的作用
```java
package com.anji.plus.gaea;

@Configuration
@EnableConfigurationProperties({GaeaProperties.class})
public class GaeaAutoConfiguration {
@Bean
@ConditionalOnClass({RedisAutoConfiguration.class})
@ConditionalOnMissingBean
public CacheHelper cacheHelper() {
return new RedisCacheHelper();
}
}
```

#### 3.bootstrap.yml加上对应的redis配置即可

17 changes: 15 additions & 2 deletions report-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,12 @@
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-mock</artifactId>
<version>2.0.8</version>
</dependency>

<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-context</artifactId>
Expand All @@ -76,7 +82,7 @@
<dependency>
<groupId>com.anji-plus</groupId>
<artifactId>spring-boot-gaea</artifactId>
<version>2.0.3.RELEASE</version>
<version>2.0.5.RELEASE</version>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
Expand All @@ -85,6 +91,12 @@
</exclusions>
</dependency>

<dependency>
<groupId>com.anji-plus</groupId>
<artifactId>spring-boot-starter-gaea-oss</artifactId>
<version>2.0.5.RELEASE</version>
</dependency>

<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-boot-starter</artifactId>
Expand All @@ -94,6 +106,7 @@
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>8.0.28</version>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
Expand All @@ -115,7 +128,7 @@
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.10</version>
<version>4.5.13</version>
</dependency>

<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,8 @@ public interface ResponseCode {
String FILE_SUFFIX_UNSUPPORTED = "2002";
String FILE_UPLOAD_ERROR = "2003";
String FILE_ONT_EXSIT = "2004";
String LIST_IS_EMPTY = "2005";
String FILE_OPERATION_FAILED = "file.operation.failed";

String PUSHCODE_NEED_UNIQUE = "3001";
String RECEIVER_IS_EMPTY = "3002";
String DATA_SOURCE_CONNECTION_FAILED = "4001";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ private AtomicBoolean authorize(HttpServletRequest request, String gaeaUserJsonS
}

private void error(HttpServletResponse response) throws IOException {
ResponseBean responseBean = ResponseBean.builder().code("50008").message("The Token has expired").build();
ResponseBean responseBean = ResponseBean.builder().code("User.credentials.expired").message("The Token has expired").build();
response.setContentType(ContentType.APPLICATION_JSON.getMimeType());
response.getWriter().print(JSONObject.toJSONString(responseBean));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import com.anji.plus.gaea.bean.TreeNode;
import com.anji.plus.gaea.cache.CacheHelper;
import com.anji.plus.gaea.constant.BaseOperationEnum;
import com.anji.plus.gaea.constant.GaeaConstant;
import com.anji.plus.gaea.exception.BusinessException;
import com.anji.plus.gaea.exception.BusinessExceptionBuilder;
import com.anji.plus.gaea.curd.mapper.GaeaBaseMapper;
Expand Down Expand Up @@ -163,7 +164,7 @@ public GaeaUserDto login(GaeaUserDto gaeaUserDto) {
} else {
// 生成用户token
String uuid = GaeaUtils.UUID();
token = jwtBean.createToken(loginName, uuid);
token = jwtBean.createToken(loginName, uuid, 0, GaeaConstant.TENANT_CODE);
cacheHelper.stringSetExpire(tokenKey, token, 3600);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,13 @@ public class ReportDashboardServiceImpl implements ReportDashboardService, Initi
@Autowired
private ReportService reportService;

@Value("${customer.file.downloadPath:''}")
@Value("${spring.gaea.subscribes.oss.downloadPath:}")
private String fileDownloadPath;

@Value("${customer.file.dist-path:''}")
@Value("${customer.file.tmp-path:.}")
private String dictPath;

private final static String ZIP_PATH = "/zip/";
private final static String ZIP_PATH = "/tmp_zip/";
private final static String JSON_PATH = "dashboard.json";

private Map<String, ChartStrategy> queryServiceImplMap = new HashMap<>();
Expand Down Expand Up @@ -331,7 +331,7 @@ public void importDashboard(MultipartFile file, String reportCode) {
GaeaFile gaeaFile = gaeaFileService.selectOne(queryWrapper);
String uploadPath;
if (null == gaeaFile) {
GaeaFile upload = gaeaFileService.upload(imageFile, fileName);
GaeaFile upload = gaeaFileService.upload(imageFile);
log.info("存入图片: {}", upload.getFilePath());
uploadPath = upload.getUrlPath();
}else {
Expand Down Expand Up @@ -395,13 +395,9 @@ private void zipLoadImage(String imageAddress, String path) {
queryWrapper.eq(GaeaFile::getFileId, fileName);
GaeaFile gaeaFile = gaeaFileService.selectOne(queryWrapper);
if (null != gaeaFile) {
String fileType = gaeaFile.getFileType();
path = path + "/image/" + fileName + "." + fileType;
//path = /app/disk/upload/zip/UUID/image

//原始文件的路径
String filePath = gaeaFile.getFilePath();
FileUtil.copyFileUsingFileChannels(filePath, path);
byte[] file = gaeaFileService.getFile(gaeaFile.getFileId());
path = path + "/image/";
FileUtil.byte2File(file, path, gaeaFile.getFileId().concat(".").concat(gaeaFile.getFileType()));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import com.anji.plus.gaea.annotation.Query;
import com.anji.plus.gaea.constant.QueryEnum;
import com.anji.plus.gaea.curd.params.PageParam;
import lombok.Data;

import java.io.Serializable;

Expand All @@ -13,6 +14,7 @@
* @author peiyanni
* @since 2021-02-18 14:48:29
*/
@Data
public class GaeaFileParam extends PageParam implements Serializable {

/** 模糊查询 */
Expand Down
Loading

0 comments on commit 4d9fa1a

Please sign in to comment.