处理报表数据问题

This commit is contained in:
wanggeng 2021-12-15 15:33:49 +08:00
parent 4cd1698513
commit 16580fb2f3
3 changed files with 52 additions and 32 deletions

View File

@ -223,7 +223,9 @@ public class CountServiceImpl extends BaseService implements ICountService {
// 实际检查企业统计 // 实际检查企业统计
Integer checkCount = getCheckCountByYear(userIdList, year); Integer checkCount = getCheckCountByYear(userIdList, year);
resultListMap.put("checkCount", checkCount); resultListMap.put("checkCount", checkCount);
resultListMap.put("completeRatio", checkPlanCount == null || checkPlanCount == 0 ? 0 : String.format("%.2f", (double) checkCount / checkPlanCount * 100)); Double completeRatio = (double) checkCount / checkPlanCount * 100;
completeRatio = completeRatio > 100D ? 100D : completeRatio;
resultListMap.put("completeRatio", checkPlanCount == null || checkPlanCount == 0 ? 0 : String.format("%.2f", completeRatio));
// 待复查企业 // 待复查企业
List<String> listNeedReCheck = listNeedReCheckIds(userIdList); List<String> listNeedReCheck = listNeedReCheckIds(userIdList);
List<CheckDTO> checkDTOs = listNeedReCheck(listNeedReCheck, year); List<CheckDTO> checkDTOs = listNeedReCheck(listNeedReCheck, year);
@ -241,12 +243,15 @@ public class CountServiceImpl extends BaseService implements ICountService {
resultListMap.put("countReCheckHiddenDanger", countReCheckHiddenDanger); resultListMap.put("countReCheckHiddenDanger", countReCheckHiddenDanger);
// 复查整改总数 // 复查整改总数
Integer countRectification = countCheckHiddenDanger - countReCheckHiddenDanger; Integer countRectification = countCheckHiddenDanger - countReCheckHiddenDanger;
resultListMap.put("countRectification", countRectification); countRectification = countRectification < 0 ? 0 : countRectification;
resultListMap.put("countRectification", countRectification < 0 ? 0 : countRectification);
// 立即整改现场整改数量 // 立即整改现场整改数量
Integer countImmediatelyRectification = countImmediatelyRectification(checkItemOptionDTOs, userIdList, year); Integer countImmediatelyRectification = countImmediatelyRectification(checkItemOptionDTOs, userIdList, year);
resultListMap.put("countImmediatelyRectification", countImmediatelyRectification); resultListMap.put("countImmediatelyRectification", countImmediatelyRectification);
// 整改率 // 整改率
resultListMap.put("rectificationRate", countCheckHiddenDanger == null || countCheckHiddenDanger == 0 ? 0 : String.format("%.2f", (double) countRectification / countCheckHiddenDanger * 100)); Double rectificationRate = (double) countRectification / countCheckHiddenDanger * 100;
rectificationRate = rectificationRate > 100D ? 100D : rectificationRate;
resultListMap.put("rectificationRate", countCheckHiddenDanger == null || countCheckHiddenDanger == 0 ? 0 : String.format("%.2f", rectificationRate));
// 不配合次数上报条数 // 不配合次数上报条数
Integer countUnCoordination = countUnCoordination(userIdList, year); Integer countUnCoordination = countUnCoordination(userIdList, year);
resultListMap.put("countUnCoordination", countUnCoordination); resultListMap.put("countUnCoordination", countUnCoordination);

View File

@ -1,7 +1,7 @@
server: server:
port: 8082 port: 7002
url: http://58.18.22.25:8082/inspection url: http://1.180.60.42:8083/inspection
title: inspection title: 隐患上报系统
servlet: servlet:
context-path: /inspection context-path: /inspection
@ -24,7 +24,7 @@ spring:
db-type: mysql db-type: mysql
driver-class-name: com.mysql.jdbc.Driver driver-class-name: com.mysql.jdbc.Driver
username: root username: root
password: root password: TSkj@0471.123
initial-size: 2 initial-size: 2
min-idle: 2 min-idle: 2
max-active: 5 max-active: 5
@ -46,6 +46,13 @@ spring:
connection-properties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000 connection-properties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000
use-global-data-source-stat: true use-global-data-source-stat: true
api-path:
user-center: http://127.0.0.1:7001/usercenter
notice-url: http://127.0.0.1:7001/usercenter
version: 1
report-form:
check-detail: true
# 数据库 # 数据库
mybatis: mybatis:
config-location: classpath:mybatis/mybatis-config.xml config-location: classpath:mybatis/mybatis-config.xml
@ -55,13 +62,13 @@ mybatis:
swagger: swagger:
title: 接口文档 title: 接口文档
description: 隐患排查系统接口文档 description: 隐患排查系统接口文档
service-url: http://58.18.22.25:8082/inspection service-url: http://1.180.60.42:8083/inspection
version: 1.0 version: 1.0
swagger-base-package: com.cm swagger-base-package: com.cm
# 文件 # 文件
file: file:
uploadPath: D:\projects\uploadFiles\ uploadPath: /root/projects/uploadFiles/
imageTypes: png,jpg,jpeg,gif,blob imageTypes: png,jpg,jpeg,gif,blob
videoTypes: mp4,rmvb videoTypes: mp4,rmvb
audioTypes: mp3,wmv audioTypes: mp3,wmv
@ -71,24 +78,21 @@ file:
# 安全 # 安全
security: security:
oauth2: oauth2:
oauth-server: http://58.18.22.25:8081/usercenter oauth-server: http://1.180.60.42:8083/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: 32ec344a5fd04fd9911586df5d1dc36b client-id: 32ec344a5fd04fd9911586df5d1dc36b
client-secret: a2NORTAyZmthdTNtVHNwLytGVVo0ckFhNktHQU9JWVFmUks0TGw5L2hQRW1ac2wwZTJHWk5NbXh3L3h3U2c4Rg== client-secret: a2NORTAyZmthdTNtVHNwLytGVVo0ckFhNktHQU9JWVFmUks0TGw5L2hQRW1ac2wwZTJHWk5NbXh3L3h3U2c4Rg==
user-authorization-uri: ${security.oauth2.oauth-server}/oauth/authorize user-authorization-uri: ${security.oauth2.oauth-server}/oauth_client/authorize
access-token-uri: ${security.oauth2.oauth-server}/oauth/token access-token-uri: ${security.oauth2.oauth-server}/oauth_client/token
grant-type: authorization_code grant-type: authorization_code
resource: resource:
jwt: jwt:
key-uri: ${security.oauth2.oauth-server}/oauth/token_key key-uri: ${security.oauth2.oauth-server}/oauth_client/token_key
token-info-uri: ${security.oauth2.oauth-server}/oauth/check_token token-info-uri: ${security.oauth2.oauth-server}/oauth_client/check_token
user-info-uri: ${security.oauth2.oauth-server}/user user-info-uri: ${security.oauth2.oauth-server}/user
authorization: authorization:
check-token-access: ${security.oauth2.oauth-server}/oauth/token_key check-token-access: ${security.oauth2.oauth-server}/oauth_client/token_key
api-path:
user-center: ${security.oauth2.oauth-server}
# 访问控制 # 访问控制
access-control: access-control:
@ -116,7 +120,22 @@ access-control:
# 日志 # 日志
logging: logging:
file: D:\projects\logs\usercenter\serviceuser-logs.log file: /root/projects/logs/inspection/inspection-logs.log
level: level:
root: error root: error
com.cm: debug com.cm: debug
socket:
central-control:
active: true
client:
client-id: 214a85ad-aa2e-4a95-9d95-09216d0c7ef3
client-secret: 3uJKuWabdEb90yVKWOFTbvkIrXrhzNHYrU1EAP1ZvnJcBAMgGAgSwbOM0F1+AgiY
host: 49.233.36.36
port: 8888
max-reconnect-count: 20
reconnect-time-step: 1
delay-ping-seconds: 3
send-client-info-active: false
# 上报服务器数据时间
send-client-info-second: 30

View File

@ -20,14 +20,12 @@ spring:
max-request-size: 1GB max-request-size: 1GB
datasource: datasource:
druid: druid:
# url: jdbc:mysql://49.233.36.36:6688/db_cloud_inspection?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&autoReconnect=true&failOverReadOnly=false&useSSL=false url: jdbc:mysql://10.110.208.232:3306/db_cloud_inspection?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&autoReconnect=true&failOverReadOnly=false&useSSL=false
url: jdbc:mysql://127.0.0.1:3306/db_cloud_inspection?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&autoReconnect=true&failOverReadOnly=false&useSSL=false # url: jdbc:mysql://127.0.0.1:3306/db_cloud_inspection?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&autoReconnect=true&failOverReadOnly=false&useSSL=false
db-type: mysql db-type: mysql
driver-class-name: com.mysql.jdbc.Driver driver-class-name: com.mysql.jdbc.Driver
# username: wanggeng username: wanggeng
username: root password: TSkj@0471.123
# password: WenG>2132997
password: root
initial-size: 2 initial-size: 2
min-idle: 2 min-idle: 2
max-active: 100 max-active: 100
@ -81,13 +79,11 @@ file:
# 安全 # 安全
security: security:
oauth2: oauth2:
oauth-server: http://192.168.0.103:7001/usercenter oauth-server: http://1.180.60.42:8083/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: 44a8dc867f7f4465b7ba6065d87e30d7 client-id: 888d9c22b2d34f0694672c8ad56e8d0b
# client-id: 32ec344a5fd04fd9911586df5d1dc36b client-secret: RW91Mzg4dkU5Q0MyRkNycUVPc0NGMmVtRFI2TVBpMW1wWHo3K2RibEQyMG1ac2wwZTJHWk5NbXh3L3h3U2c4Rg==
client-secret: bTRCTEw1TEZkL284bVhLOXJ2NDYrSUlGdU1DSlNGaGdLTWhEb1l1VHZHMG1ac2wwZTJHWk5NbXh3L3h3U2c4Rg==
# client-secret: a2NORTAyZmthdTNtVHNwLytGVVo0ckFhNktHQU9JWVFmUks0TGw5L2hQRW1ac2wwZTJHWk5NbXh3L3h3U2c4Rg==
user-authorization-uri: ${security.oauth2.oauth-server}/oauth_client/authorize user-authorization-uri: ${security.oauth2.oauth-server}/oauth_client/authorize
access-token-uri: ${security.oauth2.oauth-server}/oauth_client/token access-token-uri: ${security.oauth2.oauth-server}/oauth_client/token
grant-type: authorization_code grant-type: authorization_code
@ -101,10 +97,10 @@ security:
api-path: api-path:
user-center: ${security.oauth2.oauth-server} user-center: ${security.oauth2.oauth-server}
notice-url: http://192.168.0.103:7001/usercenter notice-url: http://1.180.60.42:8083/usercenter
version: 1 version: 1
report-form: report-form:
check-detail: true check-detail: false
# 访问控制 # 访问控制
access-control: access-control: