zhuml4
2026-02-26 36258a63c3222c9c465c68beb8d4a3fca6a53cf5
fix:修改配置问题
1个文件已删除
1个文件已修改
223 ■■■■■ 已修改文件
xp-robotaxi-vehicle-convoy-boot/src/main/java/com/xiaopeng/vehicleConvoy/config/ShardingAlgorithmPropsFixer.java 58 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-vehicle-convoy-boot/src/main/resources/application-local.yml 165 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-vehicle-convoy-boot/src/main/java/com/xiaopeng/vehicleConvoy/config/ShardingAlgorithmPropsFixer.java
File was deleted
xp-robotaxi-vehicle-convoy-boot/src/main/resources/application-local.yml
@@ -1,23 +1,18 @@
spring:
  config:
    activate:
      on-profile: local
  autoconfigure:
    exclude: com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure
  shardingsphere:
    mode:
      type: Standalone
      repository:
        type: File
      overwrite: true
    props:
      sql.show: true
      show-sql: true
    datasource:
      names: xp0
      xp0:
        type: com.alibaba.druid.pool.DruidDataSource
        driver-class-name: com.mysql.cj.jdbc.Driver
        url: jdbc:mysql://192.168.110.34:3306/xprt_operation?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
        username: root
        password: 123456
        url: jdbc:mysql://pc-bp1o444934f546768po.rwlb.rds.aliyuncs.com:3306/xp_rt_maintenance?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
        username: xp_rt_maintenance
        password: gWgoAv_bi02um8sN
        druid:
          initial-size: 10
          min-idle: 10
@@ -48,54 +43,146 @@
    rules:
      sharding:
        tables:
          sys_oper_log:
            actual-data-nodes: xp0.sys_oper_log_$->{0..9}
          xp_charging_record:
            actual-data-nodes: xp0.xp_charging_record_$->{0..9}
            table-strategy:
              standard:
                sharding-column: userId
                sharding-algorithm-name: sys_oper_log_inline
            key-generate-strategy:
              column: oper_id
              key-generator-name: snowflake
          xp_agreement_app_user:
            actual-data-nodes: xp0.xp_agreement_app_user_$->{0..9}
            table-strategy:
              standard:
                sharding-column: app_user_id
                sharding-algorithm-name: xp_agreement_app_user_inline
                sharding-column: vehicle_id
                sharding-algorithm-name: xp-charging-record-inline
            key-generate-strategy:
              column: id
              key-generator-name: snowflake
          xp_point:
            actual-data-nodes: xp0.xp_point_$->{0..9}
          xp_clock_in:
            actual-data-nodes: xp0.xp_clock_in_$->{0..9}
            table-strategy:
              standard:
                sharding-column: id
                sharding-algorithm-name: xp_point_inline
                sharding-column: app_user_id
                sharding-algorithm-name: xp-clock-in-inline
            key-generate-strategy:
              column: id
              key-generator-name: snowflake
          xp_task:
            actual-data-nodes: xp0.xp_task_$->{0..19}
            table-strategy:
              standard:
                sharding-column: vehicle_id
                sharding-algorithm-name: xp-task-inline
            key-generate-strategy:
              column: id
              key-generator-name: snowflake
          xp_task_handle_detail:
            actual-data-nodes: xp0.xp_task_handle_detail_$->{0..19}
            table-strategy:
              standard:
                sharding-column: task_id
                sharding-algorithm-name: xp-task-handle-detail-inline
            key-generate-strategy:
              column: id
              key-generator-name: snowflake
          xp_task_handle_detail_routine:
            actual-data-nodes: xp0.xp_task_handle_detail_routine_$->{0..19}
            table-strategy:
              standard:
                sharding-column: task_id
                sharding-algorithm-name: xp-task-handle-detail-routine-inline
            key-generate-strategy:
              column: id
              key-generator-name: snowflake
          xp_vehicle_detection:
            actual-data-nodes: xp0.xp_vehicle_detection_$->{0..9}
            table-strategy:
              standard:
                sharding-column: task_id
                sharding-algorithm-name: xp-vehicle-detection-inline
            key-generate-strategy:
              column: id
              key-generator-name: snowflake
          xp_vehicle_preparation:
            actual-data-nodes: xp0.xp_vehicle_preparation_$->{0..9}
            table-strategy:
              standard:
                sharding-column: task_id
                sharding-algorithm-name: xp-vehicle-preparation-inline
            key-generate-strategy:
              column: id
              key-generator-name: snowflake
          xp_vehicle_repair:
            actual-data-nodes: xp0.xp_vehicle_repair_$->{0..9}
            table-strategy:
              standard:
                sharding-column: task_id
                sharding-algorithm-name: xp-vehicle-repair-inline
            key-generate-strategy:
              column: id
              key-generator-name: snowflake
          xp_work_order:
            actual-data-nodes: xp0.xp_work_order_$->{0..9}
            table-strategy:
              standard:
                sharding-column: feedback_user_phone
                sharding-algorithm-name: xp-work-order-inline
            key-generate-strategy:
              column: id
              key-generator-name: snowflake
          xp_work_order_log:
            actual-data-nodes: xp0.xp_work_order_log_$->{0..19}
            table-strategy:
              standard:
                sharding-column: work_order_id
                sharding-algorithm-name: xp-work-order-log-inline
            key-generate-strategy:
              column: id
              key-generator-name: snowflake
        sharding-algorithms:
          sys_oper_log_inline:
          xp-charging-record-inline:
            type: INLINE
            props:
              algorithm-expression: sys_oper_log_$->{userId % 10}
          xp_agreement_app_user_inline:
              algorithm-expression: xp_charging_record_${vehicle_id % 20}
          xp-clock-in-inline:
            type: INLINE
            props:
              algorithm-expression: xp_agreement_app_user_$->{app_user_id % 10}
          xp_point_inline:
              algorithm-expression: xp_clock_in_${app_user_id % 10}
          xp-task-inline:
            type: INLINE
            props:
              algorithm-expression: xp_point_$->{id % 10}
              algorithm-expression: xp_task_${vehicle_id % 20}
          xp-task-handle-detail-inline:
            type: INLINE
            props:
              algorithm-expression: xp_task_handle_detail_${task_id % 20}
          xp-task-handle-detail-routine-inline:
            type: INLINE
            props:
              algorithm-expression: xp_task_handle_detail_routine_${task_id % 20}
          xp-vehicle-detection-inline:
            type: INLINE
            props:
              algorithm-expression: xp_vehicle_detection_${task_id % 10}
          xp-vehicle-preparation-inline:
            type: INLINE
            props:
              algorithm-expression: xp_vehicle_preparation_${task_id % 10}
          xp-vehicle-repair-inline:
            type: INLINE
            props:
              algorithm-expression: xp_vehicle_repair_${task_id % 10}
          xp-work-order-inline:
            type: INLINE
            props:
              algorithm-expression: xp_work_order_${feedback_user_phone % 10}
          xp-work-order-log-inline:
            type: INLINE
            props:
              algorithm-expression: xp_work_order_log_${work_order_id % 20}
        key-generators:
          snowflake:
            type: SNOWFLAKE
      single-table:
        default-data-source-name: xp0
    props:
      sql-show: true
      sql-simple: true
seata:
  enabled: false
# 车控接口参数
vehicle:
  control:
    appId: xp_robotaxi_api
    appSecret: zaOuwp7Nb4rRemhP