Ver código fonte

Merge remote-tracking branch 'origin/main'

zhanghao 1 mês atrás
pai
commit
473074f5c4

+ 0 - 264
project-admin/src/main/resources/application-ben.yml

@@ -1,264 +0,0 @@
-# 项目相关配置
-change:
-  # 名称
-  name: sxgw-dev
-  # 版本
-  version: 3.8.3
-  # 版权年份
-  copyrightYear: 2022
-  # 实例演示开关
-  demoEnabled: true
-  # 文件路径 示例( Windows配置D:/change/uploadPath,Linux配置 /home/change/uploadPath)
-  profile: ./uploadPath
-  # 获取ip地址开关
-  addressEnabled: false
-  # 验证码类型 math 数组计算 char 字符验证
-  captchaType: math
-  # 当前项目 redis cookie等 变量后缀
-  projectSuffix: _sxgw24
-
-# 接口地址配置
-apiurl:
-  # 服务保障中心接口地址
-  #serviceUrl: http://25.39.79.244:18080/zhhq_app/zhhq_large_screen/queryByAppOrg
-  serviceUrl: http://192.168.1.189/fxkj/php/public/home/Wechat/test
-  # 楼宇运行监控 接口前缀
-  buildPrefix: http://192.168.1.74:6789/psbims/office/energy/
-  # 楼宇运行监控 碳排放量月度变化趋势图接口
-  buildCarbonEmissionStatistics: carbonEmissionStatistics
-  # 办公能耗情况接口 年度累计综合能耗
-  buildEnergyForYear: energyForYear
-  # 办公能耗情况接口 年度综合能耗趋势接口
-  buildEnergyStatistics: energyStatistics
-  # 办公能耗情况接口 年度累计电耗接口
-  buildPowerForYear: powerForYear
-  # 办公能耗情况接口 年度电耗趋势接口
-  buildElectricityStatistics: electricityStatistics
-  # 办公能耗情况接口 年度累计水耗接口
-  buildWaterForYear: waterForYear
-  # 办公能耗情况接口 年度水耗趋势接口
-  buildWaterStatistics: waterStatistics
-  # 办公能耗情况接口 年度累计非供暖能耗接口
-  buildNonHeatingEnergyForYear: nonHeatingEnergyForYear
-  # 办公能耗情况接口 年度非供暖能耗趋势接口
-  buildUsePowerStatistics: usePowerStatistics
-  # 办公能耗情况接口 月用电量信息接口
-  buildPowerForMonth: powerForMonth
-  # 办公能耗情况接口 楼宇月用水电热信息接口
-  buildUseHeatGas: useHeatGas
-  # 数据中心机房信息接口
-  buildDataCenterRoom: dataCenterRoom
-  # 供暖能耗信息接口
-  buildHeatingEnergy: heatingEnergy
-  # 燃气用量信息接口
-  buildGasInfo: gasInfo
-  # 资源信息接口
-  buildResourceInfo: resourceInfo
-  # 可再生电力信息接口
-  buildGreenPowerInfo: greenPowerInfo
-  # 办公碳排放情况接口
-  buildOfficeCarbonForYear: officeCarbonForYear
-  # 各单位年度累计办公碳排放量统计接口
-  buildOfficeCarbonForFloor: officeCarbonForFloor
-
-znhqcamera:
-  path: /usr/local/ffmpeg/bin/ffmpeg # ffmpeg安装的位置
-  rtmp: rtmp://25.39.67.168:10612/myapp/ # rtmp 链接前缀
-  flv: http://25.39.67.168:10611/rtmpLive?port=10612&app=myapp&stream= # http访问链接前缀
-  stat: http://25.39.67.168:10611/statjson # 流媒体服务器状态文件访问路径
-  corn: 0 0/10 * * * ?   # 定时关流
-
-# 开发环境配置
-server:
-  # 服务器的HTTP端口,默认为8890
-  port: 8115
-  servlet:
-    # 应用的访问路径
-    context-path: /
-  tomcat:
-    # tomcat的URI编码
-    uri-encoding: UTF-8
-    # 连接数满后的排队数,默认为100
-    accept-count: 1000
-    threads:
-      # tomcat最大线程数,默认为200
-      max: 800
-      # Tomcat启动初始化的线程数,默认值10
-      min-spare: 100
-# 业务配置
-business:
-  # 请求、响应数据加密
-  aes-encrypt:
-    # 是否启用
-    enabled: false
-# 日志配置
-logging:
-  level:
-    com.project: DEBUG
-    org.springframework: WARN
-
-# 用户配置
-user:
-  password:
-    # 密码最大错误次数
-    maxRetryCount: 5
-    # 密码锁定时间(默认10分钟)
-    lockTime: 10
-
-# Spring配置
-spring:
-  # 资源信息
-  messages:
-    # 国际化资源文件路径
-    basename: i18n/messages
-  # 文件上传
-  servlet:
-    multipart:
-      # 单个文件大小
-      max-file-size: 1024MB
-      # 设置总上传的文件大小
-      max-request-size: 2048MB
-  # 服务模块
-  devtools:
-    restart:
-      # 热部署开关
-      enabled: true
-  datasource:
-    type: com.alibaba.druid.pool.DruidDataSource
-    driverClassName: com.mysql.cj.jdbc.Driver
-    druid:
-      # 主库数据源
-      master:
-        url: jdbc:mysql://127.0.0.1:3306/24_sxgw?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&tinyInt1isBit=false&allowMultiQueries=true&serverTimezone=GMT%2B8
-        username: 24_sxgw
-        password: sxgw123456!
-      # 从库数据源
-      slave:
-        # 从数据源开关/默认关闭
-        enabled: false
-        url:
-        username:
-        password:
-      # 初始连接数
-      initialSize: 5
-      # 最小连接池数量
-      minIdle: 10
-      # 最大连接池数量
-      maxActive: 20
-      # 配置获取连接等待超时的时间
-      maxWait: 60000
-      # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
-      timeBetweenEvictionRunsMillis: 60000
-      # 配置一个连接在池中最小生存的时间,单位是毫秒
-      minEvictableIdleTimeMillis: 300000
-      # 配置一个连接在池中最大生存的时间,单位是毫秒
-      maxEvictableIdleTimeMillis: 900000
-      # 配置检测连接是否有效
-      validationQuery: SELECT 1 FROM DUAL
-      testWhileIdle: true
-      testOnBorrow: false
-      testOnReturn: false
-      webStatFilter:
-        enabled: true
-      statViewServlet:
-        enabled: true
-        # 设置白名单,不填则允许所有访问
-        allow:
-        url-pattern: /druid/*
-        # 控制台管理用户名和密码
-        login-username: admin
-        login-password: 123456
-      filter:
-        stat:
-          enabled: true
-          # 慢SQL记录
-          log-slow-sql: true
-          slow-sql-millis: 1000
-          merge-sql: true
-        wall:
-          config:
-            multi-statement-allow: true
-  # redis 配置
-#  redis:
-#    # 地址
-#    host: localhost
-#    # 端口,默认为6379
-#    port: 6379
-#    # 数据库索引
-#    database: 0
-#    # 密码
-#    password: 123456
-#    # 连接超时时间
-#    timeout: 10s
-#    lettuce:
-#      pool:
-#        # 连接池中的最小空闲连接
-#        min-idle: 0
-#        # 连接池中的最大空闲连接
-#        max-idle: 8
-#        # 连接池的最大数据库连接数
-#        max-active: 8
-#        # #连接池最大阻塞等待时间(使用负值表示没有限制)
-#        max-wait: -1ms
-
-# token配置
-token:
-  # 令牌自定义标识
-  header: Authorization
-  # 令牌密钥
-  secret: abcdefghijklmnopqrstuvwxyz
-  # 令牌有效期(默认30分钟)
-  expireTime: 3000
-
-# MyBatisPlus配置
-mybatis-plus:
-  # 搜索指定包别名
-  typeAliasesPackage: com.project.**.domain
-  # 配置mapper的扫描,找到所有的mapper.xml映射文件
-  mapperLocations: classpath*:mapper/**/*Mapper.xml
-  # 全局配置
-  global-config:
-    db-config:
-      id-type: auto
-      logic-delete-field: delFlag
-      logic-not-delete-value: "0"
-      logic-delete-value: "1"
-  configuration:
-    map-underscore-to-camel-case: true
-    #log-impl: org.apache.ibatis.logging.stdout.StdOutImpl # 打印sql
-
-# MyBatisPlusJoin配置
-mybatis-plus-join:
-  #是否打印 mybatis plus join banner 默认true
-  banner: true
-  #全局启用副表逻辑删除(默认true) 关闭后关联查询不会加副表逻辑删除
-  sub-table-logic: true
-  #拦截器MappedStatement缓存(默认true)
-  ms-cache: true
-  #表别名(默认 t)
-  table-alias: t
-  #副表逻辑删除条件的位置,支持where、on
-  #默认ON (1.4.7.2及之前版本默认为where)
-  logic-del-type: on
-
-# PageHelper分页插件
-pagehelper:
-  helperDialect: mysql
-  supportMethodsArguments: true
-  params: count=countSql
-
-# Swagger配置
-swagger:
-  # 是否开启swagger
-  enabled: true
-  # 请求前缀
-  pathMapping: /dev-api
-
-# 防止XSS攻击
-xss:
-  # 过滤开关
-  enabled: true
-  # 排除链接(多个用逗号分隔)
-  excludes: /system/notice
-  # 匹配链接
-  urlPatterns: /system/*,/monitor/*,/tool/*

+ 1 - 1
project-admin/src/main/resources/application-dev.yml

@@ -306,7 +306,7 @@ spring:
 # token配置
 token:
   # 令牌自定义标识
-  header: Authorization
+  header: SX-Access-Token
   # 令牌密钥
   secret: abcdefghijklmnopqrstuvwxyz
   # 令牌有效期(默认30分钟)

+ 56 - 39
project-admin/src/main/resources/application-local.yml

@@ -17,49 +17,66 @@ change:
   # 当前项目 redis cookie等 变量后缀
   projectSuffix: _sxgw24
 
+upload:
+  directory: "/Users/yangbq/home/path/to/upload/directory"
 # 接口地址配置
 apiurl:
   # 服务保障中心接口地址
   #serviceUrl: http://25.39.79.244:18080/zhhq_app/zhhq_large_screen/queryByAppOrg
   serviceUrl: http://192.168.1.189/fxkj/php/public/home/Wechat/test
-  # 楼宇运行监控 接口前缀
-  buildPrefix: http://192.168.1.74:6789/psbims/office/energy/
-  # 楼宇运行监控 碳排放量月度变化趋势图接口
-  buildCarbonEmissionStatistics: carbonEmissionStatistics
-  # 办公能耗情况接口 年度累计综合能耗
-  buildEnergyForYear: energyForYear
-  # 办公能耗情况接口 年度综合能耗趋势接口
-  buildEnergyStatistics: energyStatistics
-  # 办公能耗情况接口 年度累计电耗接口
-  buildPowerForYear: powerForYear
-  # 办公能耗情况接口 年度电耗趋势接口
-  buildElectricityStatistics: electricityStatistics
-  # 办公能耗情况接口 年度累计水耗接口
-  buildWaterForYear: waterForYear
-  # 办公能耗情况接口 年度水耗趋势接口
-  buildWaterStatistics: waterStatistics
-  # 办公能耗情况接口 年度累计非供暖能耗接口
-  buildNonHeatingEnergyForYear: nonHeatingEnergyForYear
-  # 办公能耗情况接口 年度非供暖能耗趋势接口
-  buildUsePowerStatistics: usePowerStatistics
-  # 办公能耗情况接口 月用电量信息接口
-  buildPowerForMonth: powerForMonth
-  # 办公能耗情况接口 楼宇月用水电热信息接口
-  buildUseHeatGas: useHeatGas
-  # 数据中心机房信息接口
-  buildDataCenterRoom: dataCenterRoom
-  # 供暖能耗信息接口
-  buildHeatingEnergy: heatingEnergy
-  # 燃气用量信息接口
-  buildGasInfo: gasInfo
-  # 资源信息接口
-  buildResourceInfo: resourceInfo
-  # 可再生电力信息接口
-  buildGreenPowerInfo: greenPowerInfo
-  # 办公碳排放情况接口
-  buildOfficeCarbonForYear: officeCarbonForYear
-  # 各单位年度累计办公碳排放量统计接口
-  buildOfficeCarbonForFloor: officeCarbonForFloor
+  # 后勤运行监控中心接口地址
+  logisticsUrl: http://25.39.64.51:18080/unified-access/sgcc/shanxi/monitoring/assetMetrics
+
+  # 楼宇运行监控左半部 接口前缀
+  controlApiUrl: http://113.44.175.227
+  # 楼宇中控 楼宇本周用电量
+  controlElectricity: /electricity/init
+  # 楼宇中控 楼宇本周用电量机房总用电量
+  controlElectricityRoom: /electricity/room
+  # 楼宇中控 楼宇本周用电量明细
+  controlElectricityDetail: /electricity/details
+  # 楼宇中控 楼宇今日总用电量
+  controlTodaySum: /today/sum
+  # 楼宇中控 楼宇每月用电量
+  controlMonthSum: /monthly/sum
+  # 楼宇中控 配电室重要回路负荷情况
+  controlImportantSum: /important/sum
+  # 楼宇中控 楼宇中当前告警的设备
+  controlEquipment: /equipment/state
+  # 楼宇中控 楼宇中异常点位查看
+  controlAlertDetails: /equipment/alertDetails
+  # 楼宇中控 告警事件的历史统计
+  controlAlarm: /alarm/count
+  # 楼宇中控 水箱水位情况
+  controlWater: /water/state
+
+  # 楼宇运行监控右边 接口地址
+  buildPrefix: http://25.39.64.37:10611/psbims
+  # 楼宇运行监控 巡更次数统计(近6月)
+  jsonFrequency: /screen/patrol/frequency/statistics
+  # 办公能耗情况接口 巡更及时率
+  jsonPatrol: /screen/patrol/timeliness
+  # 办公能耗情况接口 巡更点统计
+  jsonPatrolPoint: /logistics/base/patrolPoint/countPoint
+  # 办公能耗情况接口 近一月楼宇能耗信息
+  jsonPowerWaterMonth: /screen/synthetical/power/water/year/total?timeType=month
+  # 办公能耗情况接口 空气概况
+  jsonAir: /screen/environment/air/overview
+  # 办公能耗情况接口 定额指标
+  jsonTarget: /screen/synthetical/target/build/person
+  # 办公能耗情况接口 用电分项(月)
+  jsonUseElectricity: /logistics/base/patrolPoint/usePowerStatistics
+  # 办公能耗情况接口 绿电比例
+  jsonGreenElectricity: /logistics/base/patrolPoint/greenElectricityAnalysis
+  # 办公能耗情况接口 碳排放量月度变化趋势图
+  jsonCarbon: /screen/carbon/carbonEmissionCurve
+  # 办公能耗情况接口 年度累计综合能粍
+  jsonEnergyYear: /office/energy/integrationEnergyForYear
+  # 办公能耗情况接口 年度累计电耗
+  jsonPowerYear: /office/energy/integrationPowerForYear
+  # 办公能耗情况接口 年度累计水耗
+  jsonWaterYear: /office/energy/integrationWaterForYear
+
 
 znhqcamera:
   path: /usr/local/ffmpeg/bin/ffmpeg # ffmpeg安装的位置
@@ -222,7 +239,7 @@ spring:
 # token配置
 token:
   # 令牌自定义标识
-  header: Authorization
+  header: SX-Access-Token
   # 令牌密钥
   secret: abcdefghijklmnopqrstuvwxyz
   # 令牌有效期(默认30分钟)

+ 0 - 266
project-admin/src/main/resources/application-pad.yml

@@ -1,266 +0,0 @@
-# 项目相关配置
-change:
-  # 名称
-  name: sxgw-prod
-  # 版本
-  version: 3.8.3
-  # 版权年份
-  copyrightYear: 2022
-  # 实例演示开关
-  demoEnabled: true
-  # 文件路径 示例( Windows配置D:/change/uploadPath,Linux配置 /home/change/uploadPath)
-  profile: ./uploadPath
-  # 获取ip地址开关
-  addressEnabled: false
-  # 验证码类型 math 数组计算 char 字符验证
-  captchaType: math
-  # 当前项目 redis cookie等 变量后缀
-  projectSuffix: _sxgw24
-
-# 接口地址配置
-apiurl:
-  # 服务保障中心接口地址
-  serviceUrl: http://172.20.52.31:18080/zhhq_api/zhhq_large_screen/queryByAppOrg
-  # 楼宇运行监控 接口前缀
-  buildPrefix: http://25.39.67.168:10611/psbims/office/energy/
-  # 楼宇运行监控 碳排放量月度变化趋势图接口
-  buildCarbonEmissionStatistics: carbonEmissionStatistics
-  # 办公能耗情况接口 年度累计综合能耗
-  buildEnergyForYear: energyForYear
-  # 办公能耗情况接口 年度综合能耗趋势接口
-  buildEnergyStatistics: energyStatistics
-  # 办公能耗情况接口 年度累计电耗接口
-  buildPowerForYear: powerForYear
-  # 办公能耗情况接口 年度电耗趋势接口
-  buildElectricityStatistics: electricityStatistics
-  # 办公能耗情况接口 年度累计水耗接口
-  buildWaterForYear: waterForYear
-  # 办公能耗情况接口 年度水耗趋势接口
-  buildWaterStatistics: waterStatistics
-  # 办公能耗情况接口 年度累计非供暖能耗接口
-  buildNonHeatingEnergyForYear: nonHeatingEnergyForYear
-  # 办公能耗情况接口 年度非供暖能耗趋势接口
-  buildUsePowerStatistics: usePowerStatistics
-  # 办公能耗情况接口 月用电量信息接口
-  buildPowerForMonth: powerForMonth
-  # 办公能耗情况接口 楼宇月用水电热信息接口
-  buildUseHeatGas: useHeatGas
-  # 数据中心机房信息接口
-  buildDataCenterRoom: dataCenterRoom
-  # 供暖能耗信息接口
-  buildHeatingEnergy: heatingEnergy
-  # 燃气用量信息接口
-  buildGasInfo: gasInfo
-  # 资源信息接口
-  buildResourceInfo: resourceInfo
-  # 可再生电力信息接口
-  buildGreenPowerInfo: greenPowerInfo
-  # 办公碳排放情况接口
-  buildOfficeCarbonForYear: officeCarbonForYear
-  # 各单位年度累计办公碳排放量统计接口
-  buildOfficeCarbonForFloor: officeCarbonForFloor
-
-znhqcamera:
-  path: /usr/local/ffmpeg/bin/ffmpeg # ffmpeg安装的位置
-  rtmp: rtmp://25.39.67.168:10612/myapp/ # rtmp 链接前缀
-  flv: http://25.39.67.168:10611/rtmpLive?port=10612&app=myapp&stream= # http访问链接前缀
-  stat: http://25.39.67.168:10611/statjson # 流媒体服务器状态文件访问路径
-  corn: 0 0/10 * * * ?   # 定时关流
-
-# 开发环境配置
-server:
-  # 服务器的HTTP端口,默认为 pad-19901 pc-8080
-  port: 19901
-  servlet:
-    # 应用的访问路径
-    context-path: /
-  tomcat:
-    # tomcat的URI编码
-    uri-encoding: UTF-8
-    # 连接数满后的排队数,默认为100
-    accept-count: 1000
-    threads:
-      # tomcat最大线程数,默认为200
-      max: 800
-      # Tomcat启动初始化的线程数,默认值10
-      min-spare: 100
-# 业务配置
-business:
-  # 请求、响应数据加密
-  aes-encrypt:
-    # 是否启用
-    enabled: false
-# 日志配置
-logging:
-  level:
-    com.project: DEBUG
-    org.springframework: WARN
-
-# 用户配置
-user:
-  password:
-    # 密码最大错误次数
-    maxRetryCount: 5
-    # 密码锁定时间(默认10分钟)
-    lockTime: 10
-
-# Spring配置
-spring:
-  # 资源信息
-  messages:
-    # 国际化资源文件路径
-    basename: i18n/messages
-  # 文件上传
-  servlet:
-    multipart:
-      # 单个文件大小
-      max-file-size: 1024MB
-      # 设置总上传的文件大小
-      max-request-size: 2048MB
-  # 服务模块
-  devtools:
-    restart:
-      # 热部署开关
-      enabled: true
-  datasource:
-#    type: com.alibaba.druid.pool.DruidDataSource
-    driverClassName: sgcc.nds.jdbc.driver.NdsDriver
-    druid:
-      # 主库数据源
-      master:
-#        url: jdbc:nds://172.20.45.201:18700,172.20.45.202:18700/v_18700_znhg_uat?appname=app_znhq&opt=0&use_bala=0
-#        username: root
-#        password: Ldsx@2020
-        url: jdbc:nds://172.20.45.201:18700,172.20.45.202:18700/v_18700_znhg_uat?appname=app_znhq_uat&opt=0&use_bala=0
-        username: root
-        password: Ldsx@2020
-      # 从库数据源
-      slave:
-        # 从数据源开关/默认关闭
-        enabled: false
-        url:
-        username:
-        password:
-      # 初始连接数
-      initialSize: 5
-      # 最小连接池数量
-      minIdle: 10
-      # 最大连接池数量
-      maxActive: 20
-      # 配置获取连接等待超时的时间
-      maxWait: 60000
-      # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
-      timeBetweenEvictionRunsMillis: 60000
-      # 配置一个连接在池中最小生存的时间,单位是毫秒
-      minEvictableIdleTimeMillis: 300000
-      # 配置一个连接在池中最大生存的时间,单位是毫秒
-      maxEvictableIdleTimeMillis: 900000
-      # 配置检测连接是否有效
-      validationQuery: SELECT 1 FROM DUAL
-      testWhileIdle: true
-      testOnBorrow: false
-      testOnReturn: false
-      webStatFilter:
-        enabled: true
-      statViewServlet:
-        enabled: true
-        # 设置白名单,不填则允许所有访问
-        allow:
-        url-pattern: /druid/*
-        # 控制台管理用户名和密码
-        login-username: admin
-        login-password: 123456
-      filter:
-        stat:
-          enabled: true
-          # 慢SQL记录
-          log-slow-sql: true
-          slow-sql-millis: 1000
-          merge-sql: true
-        wall:
-          config:
-            multi-statement-allow: true
-  # redis 配置
-#  redis:
-#    # 地址
-#    host: localhost
-#    # 端口,默认为6379
-#    port: 6379
-#    # 数据库索引
-#    database: 0
-#    # 密码
-#    password:
-#    # 连接超时时间
-#    timeout: 10s
-#    lettuce:
-#      pool:
-#        # 连接池中的最小空闲连接
-#        min-idle: 0
-#        # 连接池中的最大空闲连接
-#        max-idle: 8
-#        # 连接池的最大数据库连接数
-#        max-active: 8
-#        # #连接池最大阻塞等待时间(使用负值表示没有限制)
-#        max-wait: -1ms
-
-# token配置
-token:
-  # 令牌自定义标识
-  header: Authorization
-  # 令牌密钥
-  secret: abcdefghijklmnopqrstuvwxyz
-  # 令牌有效期(默认30分钟)
-  expireTime: 3000
-
-# MyBatisPlus配置
-mybatis-plus:
-  # 搜索指定包别名
-  typeAliasesPackage: com.project.**.domain
-  # 配置mapper的扫描,找到所有的mapper.xml映射文件
-  mapperLocations: classpath*:mapper/**/*Mapper.xml
-  # 全局配置
-  global-config:
-    db-config:
-      id-type: auto
-      logic-delete-field: delFlag
-      logic-not-delete-value: "0"
-      logic-delete-value: "1"
-  configuration:
-    map-underscore-to-camel-case: true
-    #log-impl: org.apache.ibatis.logging.stdout.StdOutImpl # 打印sql
-
-# MyBatisPlusJoin配置
-mybatis-plus-join:
-  #是否打印 mybatis plus join banner 默认true
-  banner: true
-  #全局启用副表逻辑删除(默认true) 关闭后关联查询不会加副表逻辑删除
-  sub-table-logic: true
-  #拦截器MappedStatement缓存(默认true)
-  ms-cache: true
-  #表别名(默认 t)
-  table-alias: t
-  #副表逻辑删除条件的位置,支持where、on
-  #默认ON (1.4.7.2及之前版本默认为where)
-  logic-del-type: on
-
-# PageHelper分页插件
-pagehelper:
-  helperDialect: mysql
-  supportMethodsArguments: true
-  params: count=countSql
-
-# Swagger配置
-swagger:
-  # 是否开启swagger
-  enabled: true
-  # 请求前缀
-  pathMapping: /prod-api
-
-# 防止XSS攻击
-xss:
-  # 过滤开关
-  enabled: true
-  # 排除链接(多个用逗号分隔)
-  excludes: /system/notice
-  # 匹配链接
-  urlPatterns: /system/*,/monitor/*,/tool/*

+ 5 - 1
project-admin/src/main/resources/application-prod.yml

@@ -42,6 +42,8 @@ apiurl:
   controlMonthSum: /monthly/sum
   # 楼宇中控 配电室重要回路负荷情况
   controlImportantSum: /important/sum
+  # 楼宇中控 配电室重要回路负荷明细
+  controlImportantDetails: /important/details
   # 楼宇中控 楼宇中当前告警的设备
   controlEquipment: /equipment/state
   # 楼宇中控 楼宇中异常点位查看
@@ -50,6 +52,8 @@ apiurl:
   controlAlarm: /alarm/count
   # 楼宇中控 水箱水位情况
   controlWater: /water/state
+  # 楼宇中控 光伏发电
+  photovoltaicPower: /electricity/gf
 
   # 楼宇运行监控右边 接口地址
   buildPrefix: http://25.39.64.37:10611/psbims
@@ -274,7 +278,7 @@ spring:
 # token配置
 token:
   # 令牌自定义标识
-  header: Authorization
+  header: SX-Access-Token
   # 令牌密钥
   secret: abcdefghijklmnopqrstuvwxyz
   # 令牌有效期(默认30分钟)

+ 7 - 45
project-admin/src/main/resources/banner.txt

@@ -1,49 +1,11 @@
 Application Version: ${ruoyi.version}
 Spring Boot Version: ${spring-boot.version}
 
-                     Ki    L#,
-                    jj;     KL;
-              jD#   W Ej   .       D
-              .EK   f  W    Kj   K  t
-               # E      :,   .    E G
-               iW  tEDG:   fKEK  ; ;j
-         K..     DE     KEEDL  DE. f    L
-        fj .   LE.    EEEEEEEEEi LD.   L##
-        KiG...D  E   EE,EEEEEEEEEL E: L #WW
-         DG, E EE,  EEiKEEEEEEEEEEG K: ; D
-          K D EEE  EEK EEEEEEEEEEEEE DfLL
-           E.EEE  :EE DEEEEEEEEEEEEEE.E
-      f   E.EEEE  EEE.EEEEEEEEEEEEEEED D    f
-      ED  W:EEEf DEE EEEEEEEEEEEEEEEEED E  E
-     K.. D EEEE. EEK EEEEEEEEEEEEEEEEEE K j  .
-       , LGEEEE  EE  EEEEEEEEEEEEEEEEEEE K G G
-    EK. D EEEE; KEE :EEEEEEEEEEEEEEEEEEE.E  D ;
-   t  K E EEEE  EEE WEEEEEEEEEEEEEEEEEEEE  ;E.:
-   ;W   jEEEED  DED DEEEEEEEEEEEEEEEEEEEE K  .K
-   .GE : DEEEE  EEW EEEEEEEEEEEEEEEEEEEEE D E
-   t   K EEEEE  EEL EEEEEEEEEEEEEEEEEEED  E .
-       E EEEEE .EE, EEEEEEEEEEEEEEEEEEE   K Et,
-   EKK D EEEEE ;EE. EEEEEEEEEEEEEEEEEE   fE D.;
-     K E EEDEE iEE  EEEEEEEEEEEEEEEEE   DKK K  .
-    :L E EEEDD .EE. EEEEEEEEEEEEEEEE   KEEK . :
-   .   D WEE.K  EE; DEEEEEEEEEEEDE    EEE D L
-   W .    KED   EED KEEEEEEEEEEK    KED:E E .ED
-        K  EDE.     .DEEEEEE..    EEEK EE f
-    EDD G    EW Ki             ,EEEE;.EEKD  .
-    ::  f :   t EEE  EKKEKKEEEEEDE. ;EEE E E.
-    ;D , E E     EEi KEEEEEEEEKD  .KEEEK t  :D.
-    . .E K EEE.       tLLf:     ,EEEEED E KLE
-     t .W D.EEEE .           tKEEEEEEEtfi i  .
-      G. ; K EEEE DED  DEDEEEEEEEEEEEE K  GDL
-      , EG W,LEEE.DEE   DEEEEEEEEEEEE E
-       E  K.K;,KED EEE  LEEEEEEEEEDE E
-         D.E Ej EEGKEE;  GEEEEEEED, E    ;E
-        :  E  ,E :EKDED   :EEEEED KK t K.
-         jK  W  EE  EEED    EEj ,E  EE  .
-            E j   EE   :L    .GEi  .D,K
-            :  E    .WEEEEEEEt   jE  K
-             E i E D           L .K. j
-                L:K E :E. E  D LWt W
-                 jKK .,ED f EE j t
-                    iK  K K D.L
+      :::::::: :::    :::::::::::: :::::::::               ::::::::  ::::::::
+    :+:    :+::+:    :+::+:    :+::+:    :+:             :+:    :+::+:    :+:
+   +:+        +:+  +:+ +:+    +:++:+    +:+             +:+       +:+
+  +#++:++#++  +#++:+  +#+    +:++#++:++#+ +#++:++#++:+++#++:++#+++#+
+        +#+ +#+  +#+ +#+    +#++#+                           +#++#+
+#+#    #+##+#    #+##+#    #+##+#                    #+#    #+##+#    #+#
+######## ###    ############ ###                     ########  ########
 

+ 0 - 2
project-common/src/main/java/com/project/common/utils/SecurityUtils.java

@@ -1,8 +1,6 @@
 package com.project.common.utils;
 
-import com.project.common.constant.HttpStatus;
 import com.project.common.core.domain.model.LoginUser;
-import com.project.common.exception.ServiceException;
 import org.springframework.security.core.Authentication;
 import org.springframework.security.core.context.SecurityContextHolder;
 import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;

+ 4 - 2
project-framework/src/main/java/com/project/framework/config/ResourcesConfig.java

@@ -14,6 +14,8 @@ import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
 import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
 import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
 
+import java.util.Arrays;
+
 /**
  * 通用配置
  *
@@ -59,9 +61,9 @@ public class ResourcesConfig implements WebMvcConfigurer {
         // 设置访问源地址
         config.addAllowedOriginPattern("*");
         // 设置访问源请求头
-        config.addAllowedHeader("*");
+        config.setAllowedHeaders(Arrays.asList("Authorization","X-Access-Token", "Content-Type"));
         // 设置访问源请求方法
-        config.addAllowedMethod("*");
+        config.setAllowedMethods(Arrays.asList("GET", "POST", "PUT", "DELETE", "OPTIONS"));
         // 有效期 1800秒
         config.setMaxAge(1800L);
         // 添加映射路径,拦截一切请求

+ 1 - 1
project-framework/src/main/java/com/project/framework/config/SecurityConfig.java

@@ -119,7 +119,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
                 // 静态资源,可匿名访问
                 .antMatchers(HttpMethod.GET, "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/profile/**").permitAll()
                 //.antMatchers( "/sxgw/**","/sxgw/**/**","/sxgw/**/**/**","/basics/**", "/basics/**/**", "/build/**", "/build/**/**","/employee/**", "/employee/**/**","/health/**", "/health/**/**","/post/**", "/post/**/**","/property/**", "/property/**/**","/smart/**", "/smart/**/**","/video/**", "/video/**/**").permitAll()
-                .antMatchers( "/webjars/**", "/*/api-docs", "/druid/**").permitAll()
+                .antMatchers( "/webjars/**").permitAll()
                 // 除上面外的所有请求全部需要鉴权认证
                 .anyRequest().authenticated()
                 .and()

+ 25 - 0
project-framework/src/main/java/com/project/framework/security/filter/JwtAuthenticationTokenFilter.java

@@ -4,6 +4,8 @@ import com.project.common.core.domain.model.LoginUser;
 import com.project.common.utils.SecurityUtils;
 import com.project.common.utils.StringUtils;
 import com.project.framework.web.service.TokenService;
+import com.project.system.domain.SysOperLog;
+import com.project.system.service.ISysOperLogService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
 import org.springframework.security.core.context.SecurityContextHolder;
@@ -16,6 +18,8 @@ import javax.servlet.ServletException;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
+import java.util.Date;
+import java.util.Objects;
 
 /**
  * token过滤器 验证token有效性
@@ -26,11 +30,15 @@ import java.io.IOException;
 public class JwtAuthenticationTokenFilter extends OncePerRequestFilter {
     @Autowired
     private TokenService tokenService;
+    @Autowired
+    private ISysOperLogService sysOperLogService;
 
     @Override
     protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain chain)
             throws ServletException, IOException {
         LoginUser loginUser = tokenService.getLoginUser(request);
+        // TODO 测试用是否携带token
+        //saveOperLog(request, loginUser);
         if (StringUtils.isNotNull(loginUser) && StringUtils.isNull(SecurityUtils.getAuthentication())) {
             tokenService.verifyToken(loginUser);
             UsernamePasswordAuthenticationToken authenticationToken = new UsernamePasswordAuthenticationToken(loginUser, null, loginUser.getAuthorities());
@@ -39,4 +47,21 @@ public class JwtAuthenticationTokenFilter extends OncePerRequestFilter {
         }
         chain.doFilter(request, response);
     }
+
+    private void saveOperLog(HttpServletRequest request, LoginUser loginUser) {
+        String url = request.getRequestURI();
+        SysOperLog operLog = new SysOperLog();
+        String token = request.getHeader("SX-Access-Token");
+        operLog.setTitle("token");
+        operLog.setBusinessType(0);
+        operLog.setOperatorType(1);
+        if (Objects.nonNull(loginUser)){
+            operLog.setOperParam(loginUser.getUsername());
+            operLog.setJsonResult(token);
+        }
+        operLog.setStatus(0);
+        operLog.setOperUrl(url);
+        operLog.setOperTime(new Date());
+        sysOperLogService.insertOperlog(operLog);
+    }
 }

+ 13 - 0
project-framework/src/main/java/com/project/framework/web/service/TokenService.java

@@ -17,6 +17,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Component;
 
+import javax.servlet.http.Cookie;
 import javax.servlet.http.HttpServletRequest;
 import java.util.HashMap;
 import java.util.Map;
@@ -61,6 +62,7 @@ public class TokenService {
                 LoginUser user = redisCache.getCacheObject(userKey);
                 return user;
             } catch (Exception e) {
+                e.printStackTrace();
             }
         }
         return null;
@@ -204,6 +206,17 @@ public class TokenService {
         if (StringUtils.isNotEmpty(token) && token.startsWith(Constants.TOKEN_PREFIX)) {
             token = token.replace(Constants.TOKEN_PREFIX, "");
         }
+
+        if (StringUtils.isBlank(token)) {
+            Cookie[] cookies = request.getCookies();
+            if (cookies != null) {
+                for (Cookie cookie : cookies) {
+                    if (header.equals(cookie.getName())) {
+                        token = cookie.getValue();
+                    }
+                }
+            }
+        }
         return token;
     }