java110
2022-09-15 e0465ecce35ba1f8f3eb57574df2ac9c2f959941
优化代码
1个文件已修改
2个文件已添加
206 ■■■■■ 已修改文件
java110-core/src/main/java/com/java110/core/smo/impl/ComputeFeeSMOImpl.java 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot/src/main/resources/application-debug.yml 89 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot/src/main/resources/dataSource-debug.yml 105 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-core/src/main/java/com/java110/core/smo/impl/ComputeFeeSMOImpl.java
@@ -1745,12 +1745,6 @@
            value = value.replace("F", roomDto.getFloorArea());
        } else if (value.contains("U")) { //处理单元
            value = value.replace("U", roomDto.getUnitArea());
        } else if (value.contains("R")) { //处理 房屋面积
            value = value.replace("R", roomDto.getBuiltUpArea());
        } else if (value.contains("X")) {// 处理 房屋系数
            value = value.replace("X", roomDto.getFeeCoefficient());
        } else if (value.contains("L")) {//处理房屋层数
            value = value.replace("L", roomDto.getLayer());
        } else if (value.contains("RL")){
            List<RoomAttrDto> roomAttrDtos = roomDto.getRoomAttrDto();
            if(roomAttrDtos != null && roomAttrDtos.size() > 0){
@@ -1758,6 +1752,12 @@
                    value = value.replace("RL"+roomAttrDto.getSpecCd(), roomAttrDto.getValue());
                }
            }
        } else if (value.contains("R")) { //处理 房屋面积
            value = value.replace("R", roomDto.getBuiltUpArea());
        } else if (value.contains("X")) {// 处理 房屋系数
            value = value.replace("X", roomDto.getFeeCoefficient());
        } else if (value.contains("L")) {//处理房屋层数
            value = value.replace("L", roomDto.getLayer());
        }
        ScriptEngineManager manager = new ScriptEngineManager();
springboot/src/main/resources/application-debug.yml
New file
@@ -0,0 +1,89 @@
jedis:
  pool:
    config:
      maxTotal: 300
      maxIdle: 50
      minIdle: 20
      maxWaitMillis: 3000
    host: dev.redis.java110.com
    port: 6379
    timeout: 3000
    password: hc12345678
server:
  port: 8008
  tomcat:
    uri-encoding: UTF-8
java110:
  community-service: community-service
  acct-service: acct-service
  user-service: user-service
  store-service: store-service
  common-service: common-service
  job-service: job-service
  fee-service: fee-service
  report-service: report-service
  dev-service: dev-service
  oa-service: oa-service
spring:
  profiles:
    active: share
  http:
    encoding:
      charset: UTF-8
      enabled: true
      force: true
  application:
    name: boot-service
  redis:
    database: 0
    host: dev.redis.java110.com
    port: 6379
    password: hc12345678
    pool:
      max-active: 300
      max-wait: 3000
      max-idle: 50
      min-idle: 20
      timeout: 0
feign:
  client:
    config:
      default:
        connect-timeout: 10000
        read-timeout: 20000
#============== kafka ===================
kafka:
  consumer:
    zookeeper:
      connect: dev.zk.java110.com:2181
    servers: dev.kafka.java110.com:9092
    enable:
      auto:
        commit: true
    session:
      timeout: 6000
    auto:
      commit:
        interval: 100
      offset:
        reset: latest
    topic: test
    group:
      id: communityBusinessStatus
    concurrency: 10
  producer:
    zookeeper:
      connect: dev.zk.java110.com:2181
    servers: dev.kafka.java110.com:9092
    retries: 0
    batch:
      size: 4096
    linger: 1
    buffer:
      memory: 40960
springboot/src/main/resources/dataSource-debug.yml
New file
@@ -0,0 +1,105 @@
dataSources:
  ds0: !!com.alibaba.druid.pool.DruidDataSource
    driverClassName: com.mysql.cj.jdbc.Driver
    url: jdbc:mysql://dev.db.java110.com:3306/hc_community?useUnicode=true&characterEncoding=utf-8&serverTimezone=GMT%2B8
    username: hc_community
    password: hc12345678
    minIdle: 5
    validationQuery: SELECT 1 FROM DUAL
    initialSize: 5
    maxWait: 60000
    filters: stat,wall,log4j
    poolPreparedStatements: true
  ds1: !!com.alibaba.druid.pool.DruidDataSource
    driverClassName: com.mysql.cj.jdbc.Driver
    url: jdbc:mysql://dev.db.java110.com:3306/TT?useUnicode=true&characterEncoding=utf-8&serverTimezone=GMT%2B8
    username: TT
    password: hc12345678
    minIdle: 5
    validationQuery: SELECT 1 FROM DUAL
    initialSize: 5
    maxWait: 60000
    filters: stat,wall,log4j
    poolPreparedStatements: true
shardingRule:
  tables:
    business_community:
      actualDataNodes: ds${0..1}.business_community
      databaseStrategy:
        inline:
          shardingColumn: community_id
          algorithmExpression: ds${Long.parseLong(community_id) % 2}
    s_community:
      actualDataNodes: ds${0..1}.s_community
      databaseStrategy:
        inline:
          shardingColumn: community_id
          algorithmExpression: ds${Long.parseLong(community_id) % 2}
    business_community_attr:
      actualDataNodes: ds${0..1}.business_community_attr
      databaseStrategy:
        inline:
          shardingColumn: community_id
          algorithmExpression: ds${Long.parseLong(community_id) % 2}
    s_community_attr:
      actualDataNodes: ds${0..1}.s_community_attr
      databaseStrategy:
        inline:
          shardingColumn: community_id
          algorithmExpression: ds${Long.parseLong(community_id) % 2}
    business_community_member:
      actualDataNodes: ds${0..1}.business_community_member
      databaseStrategy:
        inline:
          shardingColumn: community_id
          algorithmExpression: ds${Long.parseLong(community_id) % 2}
    business_community_photo:
      actualDataNodes: ds${0..1}.business_community_photo
      databaseStrategy:
        inline:
          shardingColumn: community_id
          algorithmExpression: ds${Long.parseLong(community_id) % 2}
    s_community_member:
      actualDataNodes: ds${0..1}.s_community_member
      databaseStrategy:
        inline:
          shardingColumn: community_id
          algorithmExpression: ds${Long.parseLong(community_id) % 2}
    s_community_photo:
      actualDataNodes: ds${0..1}.s_community_photo
      databaseStrategy:
        inline:
          shardingColumn: community_id
          algorithmExpression: ds${Long.parseLong(community_id) % 2}
  bindingTables:
    - business_community
    - s_community
    - business_community_member
    - business_community_photo
    - s_community_member
    - s_community_photo
    - business_community_attr
    - s_community_attr
  defaultDataSourceName: ds1
  defaultDatabaseStrategy:
    inline:
      shardingColumn: community_id
      algorithmExpression: ds${Long.parseLong(community_id) % 2}
  defaultTableStrategy:
    none:
#  masterSlaveRules:
#    ms_ds0:
#     masterDataSourceName: ds0
#     slaveDataSourceNames:
#       - ds0_slave0
#     loadBalanceAlgorithmType: ROUND_ROBIN
#   ms_ds1:
#     masterDataSourceName: ds1
#     slaveDataSourceNames:
#       - ds1_slave0
#     loadBalanceAlgorithmType: ROUND_ROBIN
props:
  sql.show: true