处理统计页面报错问题

This commit is contained in:
wanggeng 2022-12-25 16:41:36 +08:00
parent b7b58ab7bc
commit 2f44e2a77f
3 changed files with 53 additions and 42 deletions

View File

@ -152,7 +152,8 @@
<dependency> <dependency>
<groupId>org.projectlombok</groupId> <groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId> <artifactId>lombok</artifactId>
<version>1.16.18</version> <version>1.18.24</version>
<scope>compile</scope>
</dependency> </dependency>
</dependencies> </dependencies>

View File

@ -188,7 +188,8 @@ public class DefaultHomePageAppController extends DefaultBaseController {
} }
List<String> educationName = new ArrayList<>(); List<String> educationName = new ArrayList<>();
List<Integer> counts = new ArrayList<>(); List<Integer> counts = new ArrayList<>();
for(int i = 0; i < 10; i++){ int countsSize = Math.min(list.size(), 10);
for (int i = 0; i < countsSize; i++) {
Map<String, Object> item = list.get(i); Map<String, Object> item = list.get(i);
String educationId = item.get("education").toString(); String educationId = item.get("education").toString();
DataDTO dataDTO = mongoDataService.get(educationId); DataDTO dataDTO = mongoDataService.get(educationId);
@ -213,7 +214,8 @@ public class DefaultHomePageAppController extends DefaultBaseController {
} }
List<String> nationName = new ArrayList<>(); List<String> nationName = new ArrayList<>();
List<Integer> counts = new ArrayList<>(); List<Integer> counts = new ArrayList<>();
for(int i = 0; i < 9; i++){ int countSize = Math.min(list.size(), 10);
for (int i = 0; i < countSize; i++) {
Map<String, Object> item = list.get(i); Map<String, Object> item = list.get(i);
String nationId = item.get("nation").toString(); String nationId = item.get("nation").toString();
DataDTO dataDTO = mongoDataService.get(nationId); DataDTO dataDTO = mongoDataService.get(nationId);

View File

@ -1,11 +1,12 @@
server: server:
port: 8080 port: 8080
url: http://192.168.0.109:8080/population url: http://127.0.0.1:8080/population
system-title: 人口信息平台 system-title: 人口信息平台
system-sub-title: 人口信息平台 system-sub-title: 人口信息平台
default-home-page: default.html default-home-page: default.html
servlet: servlet:
context-path: /population context-path: /population
# nav-page: http://121.36.71.250:58011/usercenter
nav-page: http://192.168.0.155:7011/usercenter nav-page: http://192.168.0.155:7011/usercenter
spring: spring:
@ -27,11 +28,11 @@ spring:
max-request-size: 1GB max-request-size: 1GB
datasource: datasource:
druid: druid:
url: jdbc:mysql://127.0.0.1:3306/db_cloud_population_v2?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&autoReconnect=true&failOverReadOnly=false&useSSL=false&serverTimezone=UTC url: jdbc:mysql://192.168.0.151:3306/db_smart_city_population?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&autoReconnect=true&failOverReadOnly=false&useSSL=false&serverTimezone=UTC
db-type: mysql db-type: mysql
driver-class-name: com.mysql.cj.jdbc.Driver driver-class-name: com.mysql.cj.jdbc.Driver
username: root username: root
password: 123456 password: root
initial-size: 2 initial-size: 2
min-idle: 2 min-idle: 2
max-active: 5 max-active: 5
@ -54,11 +55,14 @@ spring:
use-global-data-source-stat: true use-global-data-source-stat: true
data: data:
mongodb: mongodb:
# uri: mongodb://smartcity:smartcity@121.36.71.250:58022/smartcity
uri: mongodb://smartcity:smartcity@192.168.0.156:27017/smartcity uri: mongodb://smartcity:smartcity@192.168.0.156:27017/smartcity
redis: redis:
database: 6 database: 6
host: 192.168.0.156 # host: 192.168.0.156
port: 6379 host: 121.36.71.250
# port: 6379
port: 58021
password: 666 password: 666
timeout: 3000ms timeout: 3000ms
jedis: jedis:
@ -68,7 +72,8 @@ spring:
max-idle: 8 max-idle: 8
min-idle: 0 min-idle: 0
kafka: kafka:
bootstrap-servers: 192.168.0.156:9093 # bootstrap-servers: 121.36.71.250:58025
bootstrap-servers: 192.168.0.156:9092
producer: producer:
# 写入失败时重试次数。当leader节点失效一个repli节点会替代成为leader节点此时可能出现写入失败 # 写入失败时重试次数。当leader节点失效一个repli节点会替代成为leader节点此时可能出现写入失败
# 当retris为0时produce不会重复。retirs重发此时repli节点完全成为leader节点不会产生消息丢失。 # 当retris为0时produce不会重复。retirs重发此时repli节点完全成为leader节点不会产生消息丢失。
@ -92,13 +97,14 @@ spring:
# 安全 # 安全
security: security:
oauth2: oauth2:
# oauth-server: http://121.36.71.250:58011/usercenter
oauth-server: http://192.168.0.155:7011/usercenter oauth-server: http://192.168.0.155:7011/usercenter
oauth-logout: ${security.oauth2.oauth-server}/logout?redirect_uri=${server.url} oauth-logout: ${security.oauth2.oauth-server}/logout?redirect_uri=${server.url}
client: client:
#client-id: c00491da506842ddb516d4b1e5ccd13e #client-id: c00491da506842ddb516d4b1e5ccd13e
client-id: 5bc261e8e21c40a4aade918ba12299c1 client-id: c2db96771c144803afbfedea1bfd11f7
#client-secret: bll3ZVZuUGZsSXBqckJjRVNEMkc3bklic0pOZDYyWkk0SFd2eDY3N3dhUGxIdG9KZmEyTjJIRnI0dG1McEdEVA== #client-secret: bll3ZVZuUGZsSXBqckJjRVNEMkc3bklic0pOZDYyWkk0SFd2eDY3N3dhUGxIdG9KZmEyTjJIRnI0dG1McEdEVA==
client-secret: a0oweWNraWNQRkprcDY4NURKKzFtSktOV08vUS9sclBxY0JmRStNNkNKN2xIdG9KZmEyTjJIRnI0dG1McEdEVA== client-secret: b3VwVndUU1BFbVNnOU1vSnRYTFJ1VTdieFdDRGZZVkhRdTJ2MFVxYytTRGxIdG9KZmEyTjJIRnI0dG1McEdEVA==
user-authorization-uri: ${security.oauth2.oauth-server}/oauth2_client/authorize user-authorization-uri: ${security.oauth2.oauth-server}/oauth2_client/authorize
access-token-uri: ${security.oauth2.oauth-server}/oauth2_client/token access-token-uri: ${security.oauth2.oauth-server}/oauth2_client/token
grant-type: authorization_code grant-type: authorization_code
@ -110,6 +116,7 @@ security:
authorization: authorization:
check-token-access: ${security.oauth2.oauth-server}/oauth2_client/token_key check-token-access: ${security.oauth2.oauth-server}/oauth2_client/token_key
api-path: api-path:
# user-center: http://121.36.71.250:58011/usercenter
user-center: http://192.168.0.155:7011/usercenter user-center: http://192.168.0.155:7011/usercenter
# 数据库 # 数据库
@ -128,7 +135,7 @@ swagger:
# 文件 # 文件
file: file:
# 文件的保存路径 # 文件的保存路径
upload-path: D:/ideaWorkspace/uploadfiles/population upload-path: /Users/wanggeng/Desktop/UploadFiles/
# 图片类型 # 图片类型
image-types: png,jpg,jpeg,gif,blob image-types: png,jpg,jpeg,gif,blob
# 视频类型 # 视频类型
@ -159,13 +166,14 @@ file:
use-min-io: true use-min-io: true
# 与use-min-io配套使用 # 与use-min-io配套使用
min-io: min-io:
endpoint: http://192.168.0.156:19001 # endpoint: http://121.36.71.250:58023
endpoint: http://192.168.0.156:19000
access-key: minioadmin access-key: minioadmin
secret-key: minioadmin secret-key: minioadmin
# 日志 # 日志
logging: logging:
file: file:
name: D:/ideaWorkspace/uploadfiles/population.log name: /Users/wanggeng/Desktop/UploadFiles/logs/population.log
level: level:
root: error root: error
ink.wgink: debug ink.wgink: debug