Commit 426d251088899adb1b1645beb4e956f63e367ce9

Authored by 王彪总
2 parents a599964b 2ca2c50b

Merge remote-tracking branch 'origin/dev' into dev

Showing 17 changed files with 3406 additions and 0 deletions
AGENTS.md 0 → 100644
  1 +# AGENTS.md
  2 +
  3 +This document provides guidance for agentic coding tools working on the UrbanOps (urbanops) codebase.
  4 +
  5 +## Build & Test Commands
  6 +
  7 +### Build Commands
  8 +```bash
  9 +# Clean and compile all modules
  10 +mvn clean compile
  11 +
  12 +# Build entire project (skipping tests)
  13 +mvn clean install -DskipTests
  14 +
  15 +# Build specific module with dependencies
  16 +mvn clean install -DskipTests -pl <module-name> -am
  17 +```
  18 +
  19 +### Test Commands
  20 +```bash
  21 +# Run all tests
  22 +mvn test
  23 +
  24 +# Run all tests for a specific module
  25 +mvn test -pl urbanops-module-system
  26 +
  27 +# Run a single test class
  28 +mvn test -Dtest=AdminUserServiceImplTest
  29 +
  30 +# Run a single test method
  31 +mvn test -Dtest=AdminUserServiceImplTest#testCreateUser
  32 +
  33 +# Run tests with specific profile
  34 +mvn test -Punit-test
  35 +```
  36 +
  37 +## Project Structure
  38 +
  39 +- `urbanops-server` - Main Spring Boot application entry point
  40 +- `urbanops-module-system` - System management (users, roles, permissions, etc.)
  41 +- `urbanops-module-infra` - Infrastructure (files, jobs, configs, code generation)
  42 +- `urbanops-module-bpm` - Business Process Management (Flowable)
  43 +- `urbanops-module-xxx` - Business domain modules (garden, workorder, report, etc.)
  44 +- `urbanops-framework` - Shared framework components (security, redis, mybatis, etc.)
  45 +- `urbanops-dependencies` - Maven dependency version management
  46 +
  47 +## Code Style Guidelines
  48 +
  49 +### Package Structure
  50 +```
  51 +com.zteits.urbanops.module.{module-name}
  52 +├── controller/admin - Admin API controllers
  53 +├── controller/app - App API controllers
  54 +├── controller/bridge - Legacy bridge controllers
  55 +├── service/.../impl - Service implementations
  56 +├── dal/dataobject - Database entities (DO classes)
  57 +├── dal/mysql - MyBatis mappers
  58 +├── controller/.../vo - View Objects (Request/Response VOs)
  59 +├── convert - MapStruct converters
  60 +└── enums - Module-specific enums
  61 +```
  62 +
  63 +### Naming Conventions
  64 +- **Controllers**: `XxxController` (e.g., `UserController`)
  65 +- **Services**: `XxxService` (interface) and `XxxServiceImpl` (implementation)
  66 +- **Mappers**: `XxxMapper` (e.g., `AdminUserMapper`)
  67 +- **Data Objects**: `XxxDO` (e.g., `AdminUserDO`)
  68 +- **View Objects**: `XxxPageReqVO`, `XxxSaveReqVO`, `XxxRespVO`, `XxxSimpleRespVO`
  69 +- **Converters**: `XxxConvert` (MapStruct interface)
  70 +
  71 +### Code Organization
  72 +- DO classes extend `TenantBaseDO` or `BaseDO`, use `@TableName`, `@KeySequence`, `@Data`, `@EqualsAndHashCode(callSuper = true)`, `@Builder`
  73 +- VO classes use `@Schema` for documentation, `@NotBlank`/`@NotNull`/`@Size` for validation
  74 +- Controllers use `@Tag`, `@Operation`, `@PreAuthorize`, `@Valid`, `CommonResult` for responses
  75 +- Services use `@Service`, `@Slf4j`, `@Transactional(rollbackFor = Exception.class)`, `@Resource`
  76 +
  77 +### Error Handling
  78 +- Use `exception(ErrorCode)` from `ServiceExceptionUtil` to throw business exceptions
  79 +- Define error codes in module's `ErrorCodeConstants` interface
  80 +- Error code format: `1-002-xxx-xxx-xxx` (system module: 1-002-xxx-xxx-xxx)
  81 +
  82 +### Imports & Dependencies
  83 +- Organize: standard library → third-party → project packages
  84 +- No wildcard imports (e.g., avoid `import java.util.*`)
  85 +- Use Jakarta EE: `jakarta.*` imports
  86 +- Use Spring Boot 3.x and Spring Framework 6.x APIs
  87 +
  88 +### Validation
  89 +- Use Jakarta Bean Validation: `@NotNull`, `@NotBlank`, `@Size`, `@Pattern`, `@Email`
  90 +- Use `@Valid` for nested object validation
  91 +- Use `@AssertTrue` for complex validation with custom methods
  92 +
  93 +### Lombok Usage
  94 +- `@Data` for POJOs, `@Builder` for construction, `@EqualsAndHashCode(callSuper = true)` for DOs
  95 +- Configured in `lombok.config`: `lombok.accessors.chain=true`, `lombok.tostring.callsuper=CALL`
  96 +
  97 +### Testing Guidelines
  98 +- Extend `BaseMockitoUnitTest` (no DB) or `BaseDbUnitTest` (H2 database)
  99 +- Use JUnit 5: `@Test`, `@BeforeEach`, `@BeforeAll`
  100 +- Naming: `test{MethodName}_{scenario}`
  101 +- Use `assertPojoEquals()` for comparing DOs, `assertServiceException()` for exceptions
  102 +- Clean up test data via `@Sql` with `/sql/clean.sql`
  103 +
  104 +### Database
  105 +- Use MyBatis Plus, mappers extend `BaseMapper<XxxDO>`
  106 +- Use `TenantBaseDO` for multi-tenant tables, `BaseDO` for single-tenant
  107 +
  108 +### Security
  109 +- Use `@PreAuthorize` with format `{module}:{resource}:{action}` (e.g., `system:user:create`)
  110 +- Inject current user: `SecurityFrameworkUtils.getLoginUserId()`
  111 +
  112 +### Date/Time
  113 +- Use `java.time`, `LocalDateTime` for timestamps
  114 +- Format: `DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND`, `@DateTimeFormat`
  115 +
  116 +### Logging
  117 +- Use `@Slf4j`, levels: `ERROR`, `WARN`, `INFO`, `DEBUG`
  118 +- Log meaningful context, avoid sensitive info (passwords, tokens, PII)
  119 +
  120 +### API Documentation
  121 +- Use OpenAPI 3.0: `@Tag`, `@Operation`, `@Parameter`, `@Schema`
  122 +- Chinese descriptions in `@Schema`, mark required with `requiredMode`, provide `example` values
  123 +
  124 +### Module Communication
  125 +- Use module APIs (`urbanops-module-api`) for cross-module communication
  126 +- Use `@Lazy` to avoid circular dependencies
  127 +
  128 +### Adding New Features
  129 +1. Create DO class in `dal/dataobject`
  130 +2. Create Mapper interface in `dal/mysql`
  131 +3. Create Service interface and implementation
  132 +4. Create VO classes in `controller/.../vo`
  133 +5. Create Controller class
  134 +6. Create Convert interface (MapStruct)
  135 +7. Write unit tests extending appropriate base class
  136 +8. Add error codes to `ErrorCodeConstants`
  137 +
  138 +### Common Pitfalls
  139 +- Forgetting `@Transactional` on modifying service methods
  140 +- Using wrong DO base class (`BaseDO` vs `TenantBaseDO`)
  141 +- Not using `@Valid` for request body validation
  142 +- Not handling exceptions appropriately
  143 +- Direct database access bypassing Service layer
  144 +- Using `System.out.println` instead of logger
... ...
api_document.md 0 → 100644
  1 +# API 接口文档 - 行道树巡检记录与安全风险评估
  2 +
  3 +本文档用于指导微信小程序前端开发人员对接行道树巡检记录与安全风险评估接口。
  4 +为完美契合小程序详情页中按部位折叠面板的设计,接口设计采用了**分层嵌套结构**。
  5 +
  6 +---
  7 +
  8 +## 接口基础信息
  9 +
  10 +* **接口协议**:HTTP / HTTPS
  11 +* **请求格式**:`application/json;charset=utf-8`
  12 +* **响应格式**:`application/json;charset=utf-8`
  13 +* **接口基地址**:`/app-api/garden/tree-inspection` 或 `/app-api/business/tree-inspection`
  14 +* **认证方式**:请求头中需携带 `Authorization: Bearer <token>`
  15 +
  16 +---
  17 +
  18 +## 1. 提交巡检记录并进行风险评估
  19 +
  20 +小程序在巡检人员填写完成表单,点击提交按钮(图3)时调用该接口。
  21 +
  22 +* **接口路径**:`POST /create`
  23 +* **请求方法**:`POST`
  24 +
  25 +### 请求 JSON 参数说明 (`TreeInspectionSaveReqVO`)
  26 +
  27 +| 一级属性名 | 二级字段名 | 类型 | 是否必填 | 枚举值 / 说明 | 字段描述 |
  28 +| :--- | :--- | :--- | :--- | :--- | :--- |
  29 +| **treeId** | - | Long | 是 | 关联的树木档案 ID,如 `1024` | 树木 ID |
  30 +| **inspectionTime** | - | String | 是 | 格式 `"yyyy-MM-dd HH:mm:ss"` | 巡检发生的时间 |
  31 +| **root** | - | Object | 是 | 对应“树根部位”折叠面板 | 树根评估指标组 |
  32 +| | **disease** | Integer | 是 | `0`(无真菌危害/腐朽), `8`(存在危害/腐朽) | 是否存在病害? |
  33 +| | **anchorage** | Integer | 是 | `0`(良好无盘根隆起), `7`(存在隆起或盘根) | 根系下扎情况 |
  34 +| | **cutting** | Integer | 是 | `0`(无工程切根), `5`(存在工程切根) | 是否存在工程切根 |
  35 +| **collar** | - | Object | 是 | 对应“根颈部位”折叠面板 | 根颈评估指标组 |
  36 +| | **woodDamage** | Integer | 是 | `0`(无), `5`(<10%), `15`(10%-30%), `25`(30%-50%), `70`(>=50% 一票否决) | 根颈木质部受损 |
  37 +| | **barkDamage** | Integer | 是 | `0`(<10%), `2`(10%-30%), `4`(30%-50%), `6`(>=50%) | 根颈树皮受损 |
  38 +| | **loosening** | Integer | 是 | `0`(不存在松动), `100`(存在松动 一票否决) | 根颈是否松动 |
  39 +| **trunk** | - | Object | 是 | 对应“主干部位”折叠面板 | 主干评估指标组 |
  40 +| | **woodDamage** | Integer | 是 | `0`(无), `5`(<10%), `12`(10%-30%), `20`(30%-50%), `70`(>=50% 一票否决) | 主干木质部受损 |
  41 +| | **tilt** | Integer | 是 | `0`(<10°), `3`(10°-20°), `8`(20°-30°), `70`(>=30° 一票否决) | 主干倾斜度 |
  42 +| | **barkDamage** | Integer | 是 | `0`(<10%), `1`(10%-30%), `3`(30%-50%), `5`(>=50%) | 主干树皮受损 |
  43 +| **crown** | - | Object | 是 | 对应“树冠部位”折叠面板 | 树冠评估指标组 |
  44 +| | **looseBranch** | Integer | 是 | `0`(无易落枝), `2`(占比<1/10), `3`(占比>=1/10) | 观察是否存在易落枝 |
  45 +| | **collarAbnormal** | Integer | 是 | `0`(无异常), `3`(龟裂/卷皮), `5`(腐烂尚未成洞), `70`(空洞/蛀干 一票否决) | 枝干结合部异常 |
  46 +| | **ventilationBalance**| Integer | 是 | `0`(好不偏冠), `1`(偏冠或透风差不偏冠), `2`(偏冠冠幅适中), `5`(透风差冠幅大不偏冠), `8`(透风差大且偏冠) | 树冠透风与平衡性 |
  47 +| **weight** | - | Object | 是 | 对应“权重因子评估”面板 | 生理与生境权重因子组 |
  48 +| | **treeSpeciesType** | String | 是 | `"深根性树种"`, `"浅根性树种"` | 树种类型 (深根性1.0 / 浅根性1.1) |
  49 +| | **plantingYears** | String | 是 | `"栽植 10 年以内"`, `"栽植 10-30 年"`, `"栽植 30 年以上"` | 栽植年限 (对应 1.0, 1.1, 1.2) |
  50 +| | **isWindCorridor** | Boolean | 是 | `true`(是), `false`(否) | 是否处于风口 (对应权重 2.0 / 1.0) |
  51 +| | **treePoolType** | String | 是 | `"联通树池"`, `"独立树池"`, `"树池硬化"` | 树池类型 (对应 1.0, 1.2, 1.5) |
  52 +| | **treePoolWidthDbhRatio**| String| 是 | `"7 倍及以上"`, `"5 倍-7 倍"`, `"3 倍-5 倍"`, `"3 倍以下"` | 树池宽胸径比 (对应 1.0-1.3) |
  53 +| **result** | - | Object | 是 | 对应“风险评估结果”面板 | 风险评估结果表单项 |
  54 +| | **isEmergency** | Boolean | 是 | `true`(是), `false`(否) | 是否展开应急评估 |
  55 +| | **windPower** | String | 否 | `"7 级及以下"`, `"8-9 级"`, `"10 级"`, `"10 级以上"` | 极端风力等级(`isEmergency`为`true`时必填) |
  56 +| | **defectScore** | Integer | 否 | 输入缺陷总分,如 `9` (若前端已计算则优先以前端为准) | 缺陷总得分 |
  57 +| | **normalResult** | Object | 否 | 常规风险评估计算结果对象 | 常规安全评估结果组 |
  58 +| | **normalResult.score**| Double | 否 | 常规安全评估得分,如 `10.89` | 常规安全得分 |
  59 +| | **normalResult.level**| String | 否 | 常规安全风险等级,如 `"II级 (轻度风险)"` | 常规风险等级 |
  60 +| | **emergencyResult**| Object | 否 | 应急风险评估计算结果对象 | 应急安全评估结果组 |
  61 +| | **emergencyResult.score**| Double| 否 | 应急安全评估得分,如 `16.34` | 应急安全得分 |
  62 +| | **emergencyResult.level**| String| 否 | 应急安全风险等级,如 `"II级 (轻度风险)"` | 应急风险等级 |
  63 +| **status** | - | Object | 是 | 对应“现状及处理措施”面板 | 现状及处理措施数据组 |
  64 +| | **photos** | List | 否 | 数组,最多 5 个图片 URL,超过 5 个会报错拦截 | 现场采集照片 (限制最多5张) |
  65 +
  66 +### 请求示例 JSON
  67 +
  68 +```json
  69 +{
  70 + "treeId": 1024,
  71 + "inspectionTime": "2026-05-26 13:17:00",
  72 + "root": {
  73 + "disease": 0,
  74 + "anchorage": 0,
  75 + "cutting": 0
  76 + },
  77 + "collar": {
  78 + "woodDamage": 5,
  79 + "barkDamage": 0,
  80 + "loosening": 0
  81 + },
  82 + "trunk": {
  83 + "woodDamage": 0,
  84 + "tilt": 3,
  85 + "barkDamage": 0
  86 + },
  87 + "crown": {
  88 + "looseBranch": 0,
  89 + "collarAbnormal": 0,
  90 + "ventilationBalance": 1
  91 + },
  92 + "weight": {
  93 + "treeSpeciesType": "深根性树种",
  94 + "plantingYears": "栽植 10-30 年",
  95 + "isWindCorridor": false,
  96 + "treePoolType": "联通树池",
  97 + "treePoolWidthDbhRatio": "5 倍(含)-7 倍(不含)"
  98 + },
  99 + "result": {
  100 + "isEmergency": true,
  101 + "windPower": "8-9 级",
  102 + "defectScore": 9,
  103 + "normalResult": {
  104 + "score": 10.89,
  105 + "level": "II级 (轻度风险)"
  106 + },
  107 + "emergencyResult": {
  108 + "score": 16.34,
  109 + "level": "II级 (轻度风险)"
  110 + }
  111 + },
  112 + "status": {
  113 + "photos": [
  114 + "https://example.com/images/tree_whole.jpg",
  115 + "https://example.com/images/tree_detail1.jpg"
  116 + ]
  117 + }
  118 +}
  119 +```
  120 +
  121 +### 响应示例 JSON
  122 +
  123 +```json
  124 +{
  125 + "code": 0,
  126 + "data": 12,
  127 + "msg": ""
  128 +}
  129 +```
  130 +*(注:返回的 `data` 值为新建的巡检评估记录 ID。)*
  131 +
  132 +---
  133 +
  134 +## 2. 获得层级嵌套的巡检记录详情
  135 +
  136 +进入巡检历史记录详情页(图2)时,获取该记录所有计算指标及打分结果。该接口返回完全**层次分明、与表单高度对称的结构**,并额外输出每项计算的权重常数、各分类得分与最终安全等级描述。
  137 +
  138 +* **接口路径**:`GET /get`
  139 +* **请求方法**:`GET`
  140 +* **请求参数**:
  141 +
  142 +| 参数名 | 类型 | 是否必填 | 说明 |
  143 +| :--- | :--- | :--- | :--- |
  144 +| **id** | Long | 是 | 巡检记录 ID,例如 `12` |
  145 +
  146 +### 响应示例 JSON
  147 +
  148 +```json
  149 +{
  150 + "code": 0,
  151 + "data": {
  152 + "id": 12,
  153 + "treeId": 1024,
  154 + "treenumber": "D0001-P1-0001",
  155 + "inspectionTime": "2026-05-26 13:17:00",
  156 + "inspectorId": 10001,
  157 + "inspectorName": "张三",
  158 + "root": {
  159 + "disease": 0,
  160 + "anchorage": 0,
  161 + "cutting": 0
  162 + },
  163 + "collar": {
  164 + "woodDamage": 5,
  165 + "barkDamage": 0,
  166 + "loosening": 0
  167 + },
  168 + "trunk": {
  169 + "woodDamage": 0,
  170 + "tilt": 3,
  171 + "barkDamage": 0
  172 + },
  173 + "crown": {
  174 + "looseBranch": 0,
  175 + "collarAbnormal": 0,
  176 + "ventilationBalance": 1
  177 + },
  178 + "weight": {
  179 + "treeSpeciesType": "深根性树种",
  180 + "treeSpeciesWeight": 1.0,
  181 + "plantingYears": "栽植 10-30 年",
  182 + "plantingYearsWeight": 1.1,
  183 + "isWindCorridor": false,
  184 + "windCorridorWeight": 1.0,
  185 + "treePoolType": "联通树池",
  186 + "treePoolWeight": 1.0,
  187 + "treePoolWidthDbhRatio": "5 倍(含)-7 倍(不含)",
  188 + "treePoolRatioWeight": 1.1
  189 + },
  190 + "result": {
  191 + "isEmergency": true,
  192 + "windPower": "8-9 级",
  193 + "windPowerWeight": 1.5,
  194 + "defectScore": 9,
  195 + "normalResult": {
  196 + "score": 10.89,
  197 + "level": "II级 (轻度风险)"
  198 + },
  199 + "emergencyResult": {
  200 + "score": 16.34,
  201 + "level": "II级 (轻度风险)"
  202 + }
  203 + },
  204 + "status": {
  205 + "photos": [
  206 + "https://example.com/images/tree_whole.jpg",
  207 + "https://example.com/images/tree_detail1.jpg"
  208 + ]
  209 + }
  210 + },
  211 + "msg": ""
  212 +}
  213 +```
  214 +
  215 +---
  216 +
  217 +## 3. 分页查询单株树木的历史巡检记录
  218 +
  219 +对应“巡检记录列表”原型图(图1),按历史巡检时间倒序分页加载。
  220 +
  221 +* **接口路径**:`GET /page`
  222 +* **请求方法**:`GET`
  223 +* **请求参数**:
  224 +
  225 +| 参数名 | 类型 | 是否必填 | 示例值 | 说明 |
  226 +| :--- | :--- | :--- | :--- | :--- |
  227 +| **treeId** | Long | 是 | `1024` | 对应树木档案 ID |
  228 +| **pageNo** | Integer | 否 | `1` | 页码,从 1 开始 |
  229 +| **pageSize** | Integer | 否 | `10` | 每页行数 |
  230 +
  231 +### 响应示例 JSON
  232 +
  233 +```json
  234 +{
  235 + "code": 0,
  236 + "data": {
  237 + "list": [
  238 + {
  239 + "id": 12,
  240 + "treeId": 1024,
  241 + "treenumber": "D0001-P1-0001",
  242 + "inspectionTime": "2026-05-26 13:17:00",
  243 + "inspectorName": "张三",
  244 + "normalLevel": "II级 (轻度风险)",
  245 + "emergencyLevel": "II级 (轻度风险)",
  246 + "isEmergency": true,
  247 + "isTreated": false
  248 + },
  249 + {
  250 + "id": 2,
  251 + "treeId": 1024,
  252 + "treenumber": "D0001-P1-0001",
  253 + "inspectionTime": "2026-05-06 13:23:23",
  254 + "inspectorName": "李四",
  255 + "normalLevel": "I级 (基本无风险)",
  256 + "emergencyLevel": null,
  257 + "isEmergency": false,
  258 + "isTreated": true
  259 + }
  260 + ],
  261 + "total": 2
  262 + },
  263 + "msg": ""
  264 +}
  265 +```
  266 +
  267 +---
  268 +
  269 +## 3. 管理后台 - 行道树巡检与风险评估接口
  270 +
  271 +管理后台的“巡检记录”页签(如图所示)包含“巡检历史列表(左侧)”和“单条巡检详情面板(右侧)”。这两个功能可以直接调用本组管理后台 API:
  272 +
  273 +* **接口基地址**:`/admin-api/garden/tree-inspection`
  274 +* **权限标识**:`garden:tree-inspection:query`(需在管理后台的角色权限中进行配置)
  275 +
  276 +### 3.1 获得单条巡检评估详情
  277 +
  278 +对应管理后台点击左侧列表时,右侧展示的全部缺陷分、常规评估、应急评估以及现场照片(右侧详情面板)。
  279 +
  280 +* **接口路径**:`GET /get`
  281 +* **请求方法**:`GET`
  282 +* **请求参数**:同小程序端,根据主键 `id` 检索。
  283 +* **返回 JSON 结构**:与小程序端 `GET /get` 的响应示例格式**完全一致**。返回分层嵌套的 7 大模块,高度契合后台页面树根、根颈、主干、树冠、权重评估、风险评估结果、现状及照片的区块设计。
  284 +
  285 +### 3.2 分页查询单株树木的历史巡检记录
  286 +
  287 +对应管理后台中左侧用于折叠展示的多次巡检历史简要列表。
  288 +
  289 +* **接口路径**:`GET /page`
  290 +* **请求方法**:`GET`
  291 +* **请求参数**:同小程序端 `GET /page`,按 `treeId` 进行分页拉取。
  292 +* **返回 JSON 结构**:与小程序端 `GET /page` 的响应示例格式**完全一致**,按巡检时间由近及远倒序排列。
  293 +
  294 +---
  295 +
  296 +## 常见错误返回状态码
  297 +
  298 +| HTTP状态码 / code 码 | 错误提示内容 | 触发原因 |
  299 +| :--- | :--- | :--- |
  300 +| 400 | `status.photos: 最多只能上传5张现场照片` | 现场采集照片 `photos` 数组长度大于 5 时级联强校验报错 |
  301 +| 400 | `treeId: 关联树木ID不能为空` | 请求体中缺失 `treeId` |
  302 +| 400 | `inspectionTime: 巡检时间不能为空` | 请求体中缺失 `inspectionTime` |
  303 +| 403 | `Forbidden` | 管理后台用户未被授权 `garden:tree-inspection:query` 权限 |
  304 +| 500 / `1-100-008-001` | `巡检评估记录不存在` | 查询详情时 ID 在数据库中被标记删除或不存在 |
  305 +
... ...
guide.txt 0 → 100644
  1 +北京市园林绿化局
  2 +
  3 +行道树安全风险评估指南
  4 +(试行)
  5 +2024 年 11 月
  6 +
  7 + 目 录
  8 +
  9 +目 录
  10 +前 言 .......................................................................................................1
  11 +第一部分 概 述 ..................................................................................... 3
  12 +1.1 基本概念 ............................................................................................................ 3
  13 +1.2 目的及依据 ........................................................................................................ 3
  14 +1.3 适用范围 ............................................................................................................ 3
  15 +1.4 评估原则 ............................................................................................................ 4
  16 +1.5 评估周期 ............................................................................................................ 5
  17 +1.6 方法与工具 ........................................................................................................ 5
  18 +
  19 +第二部分 评估体系 ............................................................................... 7
  20 +2.1 评估指标体系 .................................................................................................... 7
  21 +2.2 风险得分计算 .................................................................................................. 10
  22 +2.3 风险等级判定 .................................................................................................. 11
  23 +
  24 +第三部分 评估流程 ............................................................................. 13
  25 +3.1 整体流程 .......................................................................................................... 13
  26 +3.2 划分风险区域 .................................................................................................. 13
  27 +3.3 道路初筛 .......................................................................................................... 14
  28 +3.4 精细评估 .......................................................................................................... 17
  29 +3.5 评估资料归档 .................................................................................................. 22
  30 +
  31 +第四部分 风险控制 ............................................................................. 25
  32 +4.1 风险防范原则 .................................................................................................. 25
  33 +4.2 常规防范措施 .................................................................................................. 25
  34 +4.3 风险处置措施 .................................................................................................. 26
  35 +4.4 应急抢险 .......................................................................................................... 30
  36 +
  37 +第五部分 附录 ..................................................................................... 31
  38 +附录 1 风险指标判断示例 ..................................................................................... 31
  39 +
  40 +i
  41 +
  42 + ii
  43 +
  44 + 前 言
  45 +本指南由北京市园林绿化局组织实施。
  46 +本指南起草单位:北京市园林绿化局城镇绿化处、北京
  47 +民生智库科技信息咨询有限公司。
  48 +本指南主要起草人:刘明星、周红英、朱永和、申明华、
  49 +陈晓晶、姚士才、常广新、杨志华、吴斌、巢阳、张华
  50 +伟、郭珺琪、张绮思、高天宇、胥心楠、池伯佳、胡嘉
  51 +琪、陈季琴、刘丽婕、杨曦。
  52 +本指南为首次发布。
  53 +
  54 +1
  55 +
  56 + 行道树安全风险评估指南(试行)
  57 +
  58 +2
  59 +
  60 + 第一部分 概 述
  61 +
  62 +第一部分 概 述
  63 +1.1 基本概念
  64 +行道树指种植于道路两侧及分车带、具有一定遮荫功能
  65 +并构成街景的乔木。
  66 +行道树安全风险是城市公共安全风险的一部分,本指南
  67 +所指的行道树安全风险指行道树发生倒伏、断折、落枝等事
  68 +件的可能性。
  69 +行道树安全风险评估是识别、分析和评价行道树发生倒
  70 +伏、断折、落枝可能性的过程。
  71 +1.2 目的及依据
  72 +为了科学评估行道树的潜在安全危险,及时采取处置措
  73 +施,消除行道树安全隐患,依据《风险管理
  74 +
  75 +风险评估技术》
  76 +
  77 +(GBT27921-2023),参考《城市树木健康诊断技术规程》
  78 +(DB11T 1692-2019)等规范文件,结合本市行道树实际情况,
  79 +编制本指南。
  80 +1.3 适用范围
  81 +本指南适用于本市范围内行道树(不含古树名木)的安
  82 +全风险评估,具体评估对象包括种植于人行道、机非隔离带、
  83 +主辅路隔离带、中央隔离带、其他道路两侧的乔木。
  84 +行道树安全风险评估应由具有园林绿化中级及以上技
  85 +术职称并有绿地养护管理经验的人员组织开展。
  86 +3
  87 +
  88 + 行道树安全风险评估指南(试行)
  89 +
  90 +1.4 评估原则
  91 +北京市行道树数量庞大,在资源有限的情况下,应先聚
  92 +焦重点区域,再聚焦单株树木开展安全风险评估。根据北京
  93 +市气象特征,冬季大风和汛期为行道树安全事件多发时段,
  94 +在常规情况下定期开展安全风险评估的同时,还应在极端大
  95 +风天气频发季节开展应急评估。
  96 +
  97 +聚焦重点区域。根据行道树倒伏、断折、落枝等事件对
  98 +公共安全影响的严重程度划分风险区域类别,其中,人员密
  99 +集、交通流量大的主次干路、景区、公园周边道路、城市风
  100 +口位置等区域为高风险区域,行道树安全风险评估应优先保
  101 +障高风险区域。不同风险区域分类参考见表 1。
  102 +表 1 行道树安全风险区域分类
  103 +类别
  104 +
  105 +解释
  106 +
  107 +示例
  108 +1.环路、主干路、次干路等重点道路;
  109 +2.环路、主干路、次干路以外人流量、车流量大的道路;
  110 +
  111 +高风险
  112 +
  113 +频繁使用、人员密
  114 +
  115 +区域
  116 +
  117 +集的道路
  118 +
  119 +3.位于政务活动场所、国际交往场所等重要区域的道路;
  120 +4.位于重点交通枢纽、商务区、会展区、商圈、重点公园等人
  121 +员活动密集区域的道路;
  122 +5.河道两侧、十字路口、立交桥周边、城区高楼之间的狭窄地
  123 +带等具有典型风口特征的位置。
  124 +
  125 +中风险
  126 +区域
  127 +
  128 +使用频率中等、人
  129 +员密集程度略低
  130 +的道路
  131 +
  132 +1.支路等车流量、人流量中等的道路;
  133 +2.位于一般公园、社区、普通医院等周边的道路。
  134 +
  135 +低风险
  136 +
  137 +使用频率较低的
  138 +
  139 +1.街巷等非重点道路人流量、车流量较少的道路;
  140 +
  141 +区域
  142 +
  143 +道路
  144 +
  145 +2.位于开放区域、林地、边缘区域等远离人活动区域的道路。
  146 +
  147 +聚焦单株树木精细评估。具体到每一条道路,首先应使
  148 +用目视法或简单工具对行道树进行初筛,筛选出具有风险特
  149 +征的单株行道树,对其进行精细评估。
  150 +4
  151 +
  152 + 第一部分 概 述
  153 +
  154 +聚焦重要时段。冬季大风和汛期为行道树安全风险防范
  155 +的重要时段,常规情况下的安全风险评估工作应在重要时段
  156 +一个月前完成,重要时段应结合气象预警信息开展应急评估,
  157 +以便提前采取防范措施。
  158 +1.5 评估周期
  159 +常绿行道树安全风险评估全年均可进行,落叶行道树安
  160 +全风险评估建议在生长期进行。评估开展频次根据实际管理
  161 +需求确定,高风险区域建议每半年开展一次,且至少有一次
  162 +于汛期前完成。
  163 +1.6 方法与工具
  164 +本指南以目视法为主,使用到的简易工具包括:胸径尺、
  165 +卷尺、测高器、橡皮锤、量角器等。
  166 +
  167 +5
  168 +
  169 + 行道树安全风险评估指南(试行)
  170 +
  171 +6
  172 +
  173 + 第二部分 评估体系
  174 +
  175 +第二部分 评估体系
  176 +2.1 评估指标体系
  177 +行道树安全风险评估指标体系包括【常规情况下的评估
  178 +指标】和【应急情况下的评估指标】。常规情况下的评估指
  179 +标适用于非汛期常规气象条件下的评估,应急情况下的评估
  180 +指标适用于汛期或极端天气来临之前的评估。
  181 +评估指标体系的整体框架如图 1 所示。
  182 +
  183 +图 1 行道树安全风险评估指标体系整体框架
  184 +
  185 +7
  186 +
  187 + 行道树安全风险评估指南(试行)
  188 +
  189 +2.1.1 常规情况下的评估指标体系
  190 +常规情况下,行道树安全风险评估从【树木缺陷】【树
  191 +木生理特性】和【树木生境】三个维度展开。
  192 +【树木缺陷】维度,依据“根本末”对安全风险的影响
  193 +力递减的原则,依次对“树根”“根颈”“主干”“树冠”
  194 +四个部位的 12 项指标进行赋分,分值越大,风险越高。满
  195 +分为 100 分,其中,树根部位分值为 20 分,根颈部位分值
  196 +为 31 分,主干部位分值为 33 分,树冠部位分值为 16 分,
  197 +各部位所占分值见图 2。
  198 +
  199 +图 2 【树木缺陷】指标中各部位所占分值示意图
  200 +
  201 +8
  202 +
  203 + 第二部分 评估体系
  204 +
  205 +其中,“树根”包括根部病害、根系下扎情况和工程切
  206 +根 3 项指标;“根颈”包括木质部受损、树皮受损 、根颈松
  207 +动 3 项指标;“主干”包括木质部受损、主干倾斜、树皮受
  208 +损 3 项指标;“树冠”包括易落枝、枝干结合部异常、树冠
  209 +透风情况及平衡性 3 项指标。
  210 +将五种缺陷较为严重的情况设置为“一票否决”项,直
  211 +接赋分为 100 分(判定为“极度风险”)或 70 分(判定为
  212 +“重度风险”),详见表 2。
  213 +表 2 【树木缺陷】指标中的“一票否决”项
  214 +“一票否决”项
  215 +根颈松动
  216 +
  217 +赋分及对应的风险等级
  218 +直接赋 100 分,归入极度风险
  219 +
  220 +根颈木质部受损达到 50%及以上
  221 +
  222 +直接赋 70 分,归入重度及以上风险
  223 +
  224 +主干木质部受损达到 50%及以上
  225 +
  226 +直接赋 70 分,归入重度及以上风险
  227 +
  228 +主干倾斜≥30°
  229 +
  230 +直接赋 70 分,归入重度及以上风险
  231 +
  232 +枝干结合部异常有明显空洞或蛀干痕迹
  233 +
  234 +直接赋 70 分,归入重度及以上风险
  235 +
  236 +【树木生理特性】维度包括“树种类型”和“栽植年限”
  237 +两项指标,均为权重指标,权重越高,对风险的影响越大。
  238 +“树种类型”分为深根性树种和浅根性树种,后者权重较高;
  239 +“栽植年限”分为栽植 10 年以内、栽植 10-30 年、栽植 30
  240 +年以上三档,年限越长,权重越高。
  241 +【树木生境】维度包括“是否处于风口”“树池类型”
  242 +和“树池宽度与胸径比”三项指标,均为权重指标,权重越
  243 +9
  244 +
  245 + 行道树安全风险评估指南(试行)
  246 +
  247 +高,对风险的影响越大。处于风口位置的行道树在大风天气
  248 +下承受了更大的风力,赋予较高权重;“树池类型”方面,
  249 +分联通树池、独立树池、树池硬化三种情况,赋予的权重依
  250 +次增大;树池宽度与胸径的比值越大,赋予的权重越小。
  251 +2.1.2 应急情况下的评估指标体系
  252 +汛期或极端天气频发季节,应结合气象预警信息开展应
  253 +急评估。应急情况下的评估指标体系包括“常规情况下安全
  254 +风险评估的全部指标”和“极端天气指标”。极端天气指标
  255 +中将“风力”作为权重因子进行赋权,风力越大,权重越高。
  256 +其中,风力 7 级及以下、8-9 级、10 级和 10 级以上的权重
  257 +值分别为 1.0、1.5、2.0、3.0。
  258 +2.2 风险得分计算
  259 +常规情况下,行道树安全风险评估得分计算公式为:
  260 +常规情况下安全风险得分 =【树木缺陷】各项指标得分相加
  261 +×【树木生理特性】各因子权重
  262 +×【树木生境】各因子权重
  263 +
  264 +应急情况下,行道树安全风险评估得分计算公式为:
  265 +应急情况下安全风险得分 =【树木缺陷】各项指标得分相加
  266 +×【树木生理特性】各因子权重
  267 +×【树木生境】各因子权重
  268 +×【极端天气】因子权重
  269 +
  270 +10
  271 +
  272 + 第二部分 评估体系
  273 +
  274 +2.3 风险等级判定
  275 +根据安全风险得分进行风险等级判定。行道树安全风险
  276 +等级分 5 级,安全风险得分与风险等级对应关系见表 3。
  277 +表 3 行道树安全风险等级划分
  278 +安全风险得分
  279 +
  280 +风险等级
  281 +
  282 +风险等级描述
  283 +
  284 +[0,10)
  285 +
  286 +I级
  287 +
  288 +基本无风险
  289 +
  290 +[10,30)
  291 +
  292 +II 级
  293 +
  294 +轻度风险
  295 +
  296 +[30,70)
  297 +
  298 +III 级
  299 +
  300 +中度风险
  301 +
  302 +[70,100)
  303 +
  304 +IV 级
  305 +
  306 +重度风险
  307 +
  308 +100+
  309 +
  310 +V级
  311 +
  312 +极度风险
  313 +
  314 +说明:当风险得分为临界值时,归入下一个较高风险等级。
  315 +
  316 +11
  317 +
  318 + 行道树安全风险评估指南(试行)
  319 +
  320 +12
  321 +
  322 + 第三部分 评估流程
  323 +
  324 +第三部分 评估流程
  325 +3.1 整体流程
  326 +评估前应做好准备工作,确定每次评估实施范围,统筹
  327 +安排人员和工具。由具有园林绿化中级及以上技术职称并有
  328 +行道树养护管理经验的人员牵头,组织辖区内管养单位的骨
  329 +干技术人员参与,并对参与人员进行充分培训。准备数量充
  330 +足的工具和调查评估表格。
  331 +具体实施时,先划分风险区域类别,对道路进行风险初
  332 +筛,确定需要调查的道路后聚焦道路上“有风险”的单株树
  333 +进行精细评估。评估完成后应将评估资料进行归档,建立风
  334 +险评估台账。
  335 +
  336 +图 3 行道树安全风险评估整体流程
  337 +
  338 +3.2 划分风险区域
  339 +综合考虑人员密集度、交通流量、道路等级等因素,将
  340 +辖区内的道路划分为高风险区域、中风险区域和低风险区域,
  341 +划分示例参考《表 1 行道树安全风险区域分类》。有条件
  342 +的应绘制不同风险区域的道路分布图,为评估工作提供可视
  343 +化参考。风险区域分布图示例见图 4。
  344 +13
  345 +
  346 + 行道树安全风险评估指南(试行)
  347 +
  348 +图 4 不同风险区域的道路分布图
  349 +
  350 +根据风险类别的优先级和现有人力物力条件,确定每次
  351 +评估拟覆盖的范围,原则上高风险区域应先行实施,若一次
  352 +评估无法覆盖所有道路,应制定分步评估计划,确保所有道
  353 +路每年至少评估一次。
  354 +在设计调查路线时,需兼顾科学性和合理性原则,以保
  355 +证评估工作的效率。
  356 +3.3 道路初筛
  357 +优先对高风险区域道路开展全覆盖初筛,中风险和低风
  358 +险区域根据安排适时开展。道路过长时,可分段进行。
  359 +采用目视法结合简易工具,对道路上行道树进行观察,
  360 +快速筛选具有以下任意一种特征的行道树:
  361 +14
  362 +
  363 + 第三部分 评估流程
  364 +
  365 +(1)根颈松动;
  366 +(2)根颈或主干木质部受损 10%以上;
  367 +(3)主干倾斜 20 度以上;
  368 +(4)枝干结合部有明显异常;
  369 +(5)处于风口且树冠结构明显失衡。
  370 +对筛选出的行道树涂抹标记,以便开展精细评估。道路
  371 +初步筛查使用的调查表见表 4。
  372 +表 4 行道树安全风险初步筛查表
  373 +所在区:____________
  374 +存在以下风险表征的行道树
  375 +道路
  376 +
  377 +道路
  378 +
  379 +编号
  380 +
  381 +名称
  382 +
  383 +风险区域分类 根颈
  384 +松动
  385 +
  386 +根颈或主干
  387 +
  388 +主干倾
  389 +
  390 +枝干结合 处于风口且
  391 +
  392 +木质部受损 斜 20 度 部有明显 树冠结构明
  393 +10%以上
  394 +
  395 +以上
  396 +
  397 +异常
  398 +
  399 +显失衡
  400 +
  401 +
  402 +
  403 +
  404 +
  405 +
  406 +
  407 +
  408 +
  409 +
  410 +
  411 +
  412 +
  413 +
  414 +
  415 +
  416 +
  417 +
  418 +
  419 +
  420 +
  421 +
  422 +
  423 +
  424 +
  425 +
  426 +
  427 +
  428 +
  429 +
  430 +
  431 +
  432 +
  433 +
  434 +
  435 +
  436 +
  437 +
  438 +
  439 +
  440 +
  441 +
  442 +
  443 +
  444 +
  445 +
  446 +
  447 +
  448 +
  449 +
  450 +
  451 +
  452 +
  453 +
  454 +
  455 +
  456 +
  457 +
  458 +
  459 +
  460 +
  461 +评估时间:
  462 +
  463 +年
  464 +
  465 +高风险区域
  466 +中风险区域
  467 +低风险区域
  468 +高风险区域
  469 +中风险区域
  470 +低风险区域
  471 +高风险区域
  472 +中风险区域
  473 +低风险区域
  474 +高风险区域
  475 +中风险区域
  476 +低风险区域
  477 +高风险区域
  478 +中风险区域
  479 +低风险区域
  480 +高风险区域
  481 +中风险区域
  482 +低风险区域
  483 +
  484 +是否纳
  485 +入精细
  486 +评估
  487 +
  488 +是
  489 +否
  490 +是
  491 +否
  492 +是
  493 +否
  494 +是
  495 +否
  496 +是
  497 +否
  498 +是
  499 +否
  500 +
  501 +评估单位:
  502 +评估人:
  503 +
  504 +月
  505 +
  506 +日
  507 +
  508 +15
  509 +
  510 + 行道树安全风险评估指南(试行)
  511 +填表说明:
  512 +(1)道路编号
  513 +D+四位数字,从 D0001 开始,对辖区内的道路依次编号,确保每条道路有
  514 +唯一编号。
  515 +(2)风险区域分类
  516 +参考本指南《表 1 行道树安全风险区域分类》,结合本区实际情况进行划
  517 +分。
  518 +(3)风口
  519 +受狭管效应影响,气流由开阔地带流入风口时,风速会急剧增大,狭管效
  520 +应示意图见图 5。
  521 +
  522 +图 5 城市建筑群间的狭管效应示意图
  523 +处于风口位置的行道树具有较高的安全风险,在行道树初筛时,准确判断
  524 +“风口”位置至关重要。判断“风口”的一般性建议如下:
  525 +“风口”的判断
  526 +风口一般位于受狭管效应影响的地带、水面附近等,包括但不限于以下地点:
  527 +
  528 +16
  529 +
  530 +
  531 +
  532 +河道两侧;
  533 +
  534 +
  535 +
  536 +湖面周边的迎风面;
  537 +
  538 +
  539 +
  540 +十字路口各个方位第一株行道树,尤其是东南角;
  541 +
  542 +
  543 +
  544 +立交桥周边的各方位第一株行道树,尤其是东南角;
  545 +
  546 +
  547 +
  548 +城区内高楼大厦间瞬间风力加强的狭窄地带;
  549 +
  550 +
  551 +
  552 +开敞空间,周边无任何遮挡物。
  553 +
  554 + 第三部分 评估流程
  555 +
  556 +3.4 精细评估
  557 +根据道路初筛结果,选择初步筛查标记出的风险树,开
  558 +展精细评估,填写表 5。按照“树根-根颈-主干-树冠”的
  559 +顺序,依次填写树木缺陷各项指标得分,记录树木生理特性
  560 +和树木生境各项权重因子的权重值,根据各项得分或权重值
  561 +计算风险得分,并判断对应的风险等级。
  562 +表 5 行道树安全风险精细评估调查表
  563 +风险树编号:D-P-
  564 +(一)基本信息表
  565 +树种
  566 +
  567 +栽植位置
  568 +
  569 +树高(m)
  570 +
  571 + 人行道
  572 +
  573 +胸径(cm)
  574 +
  575 +点位坐标
  576 +
  577 +一级指标 二级指标
  578 +
  579 +X:
  580 +
  581 +根系下扎情况
  582 +工程切根
  583 +
  584 +木质部受损
  585 +树木缺陷
  586 +根颈
  587 +树皮受损
  588 +
  589 +根颈松动
  590 +主干
  591 +
  592 +木质部受损
  593 +
  594 + 路侧绿地
  595 +
  596 +冠幅(m)
  597 +Y:
  598 +
  599 +(二)行道树缺陷评估
  600 +三级级指标
  601 +评分标准
  602 +根部病害
  603 +
  604 +树根
  605 +
  606 + 分车带
  607 +
  608 +赋分
  609 +
  610 +无真菌危害或腐朽情况
  611 +
  612 +0
  613 +
  614 +存在真菌危害或腐朽情况
  615 +
  616 +8
  617 +
  618 +根部下扎良好,无盘根或隆起
  619 +
  620 +0
  621 +
  622 +存在根部隆起或盘根
  623 +
  624 +7
  625 +
  626 +无工程切根
  627 +
  628 +0
  629 +
  630 +存在工程切根
  631 +
  632 +5
  633 +
  634 +无受损情况
  635 +
  636 +0
  637 +
  638 +受损程度<10%
  639 +
  640 +5
  641 +
  642 +受损程度介于 10%(含)-30%(不含)
  643 +
  644 +15
  645 +
  646 +受损程度介于 30%(含)-50%(不含)
  647 +
  648 +25
  649 +
  650 +受损程度≥50%
  651 +
  652 +70
  653 +
  654 +受损程度<10%
  655 +
  656 +0
  657 +
  658 +受损程度介于 10%-30%
  659 +
  660 +2
  661 +
  662 +受损程度介于 30%-50%
  663 +
  664 +4
  665 +
  666 +受损程度≥50%
  667 +
  668 +6
  669 +
  670 +不存在根颈松动
  671 +
  672 +0
  673 +
  674 +存在根颈松动
  675 +
  676 +100
  677 +
  678 +无受损情况
  679 +
  680 +0
  681 +
  682 +受损程度<10%
  683 +
  684 +5
  685 +
  686 +得分
  687 +
  688 +17
  689 +
  690 + 行道树安全风险评估指南(试行)
  691 +一级指标 二级指标
  692 +
  693 +三级级指标
  694 +
  695 +主干倾
  696 +
  697 +树皮受损
  698 +
  699 +易落枝
  700 +
  701 +树冠
  702 +(16)
  703 +
  704 +评分标准
  705 +
  706 +赋分
  707 +
  708 +受损程度介于 10%(含)-30%(不含)
  709 +
  710 +12
  711 +
  712 +受损程度介于 30%(含)-50%(不含)
  713 +
  714 +20
  715 +
  716 +受损程度≥50%
  717 +
  718 +70
  719 +
  720 +倾斜度<10°
  721 +
  722 +0
  723 +
  724 +倾斜度介于 10°(含)-20°(不含)
  725 +
  726 +3
  727 +
  728 +倾斜度介于 20°(含)-30°(不含)
  729 +
  730 +8
  731 +
  732 +倾斜度≥30°
  733 +
  734 +70
  735 +
  736 +受损程度<10%
  737 +
  738 +0
  739 +
  740 +受损程度介于 10%(含)-30%(不含)
  741 +
  742 +1
  743 +
  744 +受损程度介于 30%(含)-50%(不含)
  745 +
  746 +3
  747 +
  748 +受损程度≥50%
  749 +
  750 +5
  751 +
  752 +未发现易落枝
  753 +
  754 +0
  755 +
  756 +易落枝占整个树冠枝条数量的比例<
  757 +1/10
  758 +
  759 +2
  760 +
  761 +易落枝占整个树冠枝条数量的比例≥
  762 +1/10
  763 +
  764 +3
  765 +
  766 +无异常
  767 +
  768 +0
  769 +
  770 +枝干结合部异 有龟裂或卷皮情况
  771 +常
  772 +有腐烂现象但尚未形成明显空洞
  773 +
  774 +3
  775 +5
  776 +
  777 +有明显空洞或蛀干痕迹
  778 +
  779 +70
  780 +
  781 +透风情况较好,不偏冠
  782 +
  783 +0
  784 +
  785 +【透风情况较好但有明显偏冠】或【透
  786 +树冠透风情况 风性差但冠幅适中,不偏冠】
  787 +透风性差且明显偏冠,但冠幅适中
  788 +及平衡性
  789 +
  790 +得分
  791 +
  792 +1
  793 +2
  794 +
  795 +透风性差且冠幅较大,但不偏冠
  796 +
  797 +5
  798 +
  799 +透风性差、冠幅较大且明显偏冠
  800 +
  801 +8
  802 +
  803 +缺陷评估得分
  804 +(三)权重因子评估
  805 +一级权重因子
  806 +
  807 +二级权重因子
  808 +树种类型
  809 +
  810 +树木生理特性
  811 +栽植年限
  812 +
  813 +树木生境
  814 +
  815 +是否处于风口
  816 +树池类型
  817 +
  818 +18
  819 +
  820 +权重标准
  821 +
  822 +赋权
  823 +
  824 +深根性树种
  825 +
  826 +1.0
  827 +
  828 +浅根性树种
  829 +
  830 +1.1
  831 +
  832 +栽植 10 年以内
  833 +
  834 +1.0
  835 +
  836 +栽植 10-30 年
  837 +
  838 +1.1
  839 +
  840 +栽植 30 年以上
  841 +
  842 +1.2
  843 +
  844 +否
  845 +
  846 +1.0
  847 +
  848 +是
  849 +
  850 +2.0
  851 +
  852 +联通树池
  853 +
  854 +1.0
  855 +
  856 +权重值
  857 +
  858 + 第三部分 评估流程
  859 +独立树池
  860 +
  861 +1.2
  862 +
  863 +树池硬化
  864 +
  865 +1.5
  866 +
  867 +7 倍及以上
  868 +
  869 +1.0
  870 +
  871 +树池宽度与胸径 5 倍(含)-7 倍(不含)
  872 +比
  873 +3 倍(含)-5 倍(不含)
  874 +
  875 +1.1
  876 +
  877 +3 倍以下
  878 +
  879 +1.3
  880 +
  881 +1.2
  882 +
  883 +常规情况下的评估得分
  884 +(四)应急评估增项指标
  885 +一级权重因子
  886 +
  887 +二级权重因子
  888 +
  889 +极端天气
  890 +
  891 +风力
  892 +
  893 +权重标准
  894 +
  895 +赋权
  896 +
  897 +7 级及以下
  898 +
  899 +1.0
  900 +
  901 +8-9 级
  902 +
  903 +1.5
  904 +
  905 +10 级
  906 +
  907 +2.0
  908 +
  909 +10 级以上
  910 +
  911 +3.0
  912 +
  913 +权重值
  914 +
  915 +(五)风险得分及等级判定
  916 +计算安全风险得分
  917 +风险得分所属区间
  918 +
  919 +对应风险等级
  920 +
  921 +□ 得分<10
  922 +
  923 +□ 基本无安全风险
  924 +
  925 +□ 10≤得分<30
  926 +
  927 +□ 轻度安全风险
  928 +
  929 +□ 30≤得分<70
  930 +
  931 +□ 中度安全风险
  932 +
  933 +□ 70≤得分<100
  934 +
  935 +□ 重度安全风险
  936 +
  937 +□ 得分≥100
  938 +
  939 +□ 极度安全风险
  940 +
  941 +选择安全风险等级
  942 +
  943 +评估单位:
  944 +评估人:
  945 +
  946 +评估时间:
  947 +
  948 +年
  949 +
  950 +月
  951 +
  952 +日
  953 +
  954 +填表说明:
  955 +(1)风险树编号
  956 +按“道路编号-树群单元编号-行道树排号-顺序编号”的规则进行编号,即
  957 +DXXXX-PX-XXXX。
  958 +行道树排号编写规则:P+1 位数字,南北走向道路按照从东向西的顺序依
  959 +次命名 P1、P2、P3… …,东西走向的道路按照从北向南的顺序依次命名 P1、
  960 +P2、P3… …,示例见图 6。
  961 +
  962 +19
  963 +
  964 + 行道树安全风险评估指南(试行)
  965 +
  966 +图 6 行道树排号编写规则示例
  967 +比如,道路编号为 D0601,排号为 P1,则该树群单元中的第一株风险树编号
  968 +为 D0601-P1-0001。
  969 +(2)冠幅(m)
  970 +东西方向和南北方向冠幅的平均值。
  971 +(3)根部病害
  972 +仔细检查树根部位是否存在大型真菌或有明显的腐朽症状,若有则此项指
  973 +标得分为 8 分。
  974 +(4)根系下扎情况
  975 +观察根系是否存隆起或盘根现象,若有则此项指标得分为 7 分。
  976 +(5)工程切根
  977 +观察根部是否存在切口,调查人员也可以根据施工记录判定是否存在工程
  978 +切根情况。
  979 +(6)根颈木质部受损
  980 +根颈部位木质部受损情形包括腐朽、空洞、木质部开裂、明显的蛀干害虫
  981 +痕迹等,受损程度以最大受损截面占根颈截面面积的比例计算,根据测算的受
  982 +损比例选择相应的分值填写,若木质部受损程度大于等于 50%,则达到“一票
  983 +否决”标准,直接得分 70,归入“重度风险”。
  984 +(7)根颈树皮受损
  985 +根颈部树皮受损情形包括树皮脱落、木质部裸露、树皮机械损伤等,受损
  986 +程度以受损最大弧长占根颈周长的比例计算,根据测算的受损比例选择相应的
  987 +分值填写。
  988 +(8)根颈松动
  989 +用力推动树干,观察根颈部位是否有明显晃动,此项为“一票否决”项,
  990 +若存在根颈松动情况,直接得分 100,归入极度风险。
  991 +20
  992 +
  993 + 第三部分 评估流程
  994 +(9)主干木质部受损
  995 +主干部位木质部受损情形包括腐朽、空洞、木质部开裂、明显的蛀干害虫
  996 +痕迹等。受损程度以最大受损截面占主干截面面积的比例计算,主干外观无异
  997 +常,应使用橡皮锤敲击,如有不同于正常树干的声音,判断为存在空腐。根据
  998 +测算的受损比例选择相应的分值填写。若木质部受损程度大于等于 50%,则达
  999 +到“一票否决”标准,直接得分 70,归入“重度风险”。
  1000 +(10)主干倾斜
  1001 +使用量角器测量树干偏离竖直方向的度数,根据测量结果选择相应的分值
  1002 +填写,若主干倾斜程度大于等于 30°,则达到“一票否决”标准,直接得分 70,
  1003 +归入“重度风险”。
  1004 +(11)主干树皮受损
  1005 +主干部树皮受损情形包括树皮脱落、木质部裸露、树皮机械损伤等,受损
  1006 +程度以受损最大弧长占主干周长的比例计算,根据测算的受损比例选择相应的
  1007 +分值填写。
  1008 +(12)易落枝
  1009 +观察是否存在易落枝,包括枯死枝、蛀干枝或已折断未掉落的枝条,估算
  1010 +易落枝数量占树冠枝条数量的比例。根据观察结果选择相应的分值填写。
  1011 +(13)枝干结合部异常
  1012 +观察枝干结合部位是否存在异常,包括是否有龟裂或卷皮、腐烂、空洞或
  1013 +蛀干痕迹。根据异常程度选择相应的分值填写,若发现“有明显空洞或蛀干痕
  1014 +迹”,则达到“一票否决”标准,直接得分 70,归入“重度风险”。
  1015 +(14)树冠透风情况及平衡性
  1016 +观察是否存在树冠密不透风、冠幅过大或偏冠的情况,根据观察结果选择
  1017 +相应的分值填写。
  1018 +(15)树种类型
  1019 +常见树种根系类型划分参见表 6。
  1020 +表 6 常见树种根系分类
  1021 +序号
  1022 +
  1023 +树种
  1024 +
  1025 +根系分类
  1026 +
  1027 +序号
  1028 +
  1029 +树种
  1030 +
  1031 +根系分类
  1032 +
  1033 +1
  1034 +
  1035 +国槐
  1036 +
  1037 +深根性
  1038 +
  1039 +8
  1040 +
  1041 +栾树
  1042 +
  1043 +深根性
  1044 +
  1045 +2
  1046 +
  1047 +刺槐
  1048 +
  1049 +浅根性
  1050 +
  1051 +9
  1052 +
  1053 +垂柳
  1054 +
  1055 +浅根性
  1056 +
  1057 +3
  1058 +
  1059 +白蜡
  1060 +
  1061 +深根性
  1062 +
  1063 +10
  1064 +
  1065 +旱柳
  1066 +
  1067 +浅根性
  1068 +
  1069 +4
  1070 +
  1071 +银杏
  1072 +
  1073 +深根性
  1074 +
  1075 +11
  1076 +
  1077 +千头椿
  1078 +
  1079 +浅根性
  1080 +
  1081 +5
  1082 +
  1083 +悬铃木
  1084 +
  1085 +浅根性
  1086 +
  1087 +12
  1088 +
  1089 +臭椿
  1090 +
  1091 +浅根性
  1092 +
  1093 +6
  1094 +
  1095 +毛白杨
  1096 +
  1097 +深根性
  1098 +
  1099 +13
  1100 +
  1101 +油松
  1102 +
  1103 +深根性
  1104 +
  1105 +7
  1106 +
  1107 +加杨
  1108 +
  1109 +深根性
  1110 +
  1111 +14
  1112 +
  1113 +毛泡桐
  1114 +
  1115 +浅根性
  1116 +
  1117 +21
  1118 +
  1119 + 行道树安全风险评估指南(试行)
  1120 +
  1121 +3.5 评估资料归档
  1122 +3.5.1 照片的采集
  1123 +对开展精细评估的每株行道树,均需拍摄现状照片,照
  1124 +片数量不少于 3 张且包括以下角度取景:
  1125 +整体取景:含周边参照物,以展示单株行道树的树体形
  1126 +态及具体位置;
  1127 +树木生境照片:展示树池形态、周边设施、建筑等;
  1128 +细节照片:从不同角度清晰展示树木存在的缺陷问题,
  1129 +如行道树存在多处缺陷,则每种症状的特写均需采集。
  1130 +此外,如遇处于风口的行道树,则需拍摄周边风场环境
  1131 +的照片或视频。
  1132 +3.5.2 点位的采集
  1133 +采集完风险树的信息和照片后,采集风险树点位坐标,
  1134 +以树木编号命名,并以矢量数据保存。
  1135 +3.5.3 资料归档
  1136 +将各项调查评估信息进行汇总整理,形成行道树风险管
  1137 +理档案,具体包括:
  1138 + 风险区域划分图、道路初筛表、精细评估调查表;
  1139 + 对调查评估表格进行电子化,形成风险台账(见表 7);
  1140 + 照片文件夹以树木编号命名,形成照片库;
  1141 + 点位以树木编号命名,以矢量格式储存,与调查信息
  1142 +关联,形成行道树风险点位矢量数据库。
  1143 +22
  1144 +
  1145 + 第三部分 评估流程
  1146 +
  1147 +表 7 行道树安全风险台账表
  1148 +基本信息
  1149 +风险树
  1150 +
  1151 +所属
  1152 +
  1153 +所属道
  1154 +
  1155 +X坐
  1156 +
  1157 +Y坐
  1158 +
  1159 +编号
  1160 +
  1161 +区
  1162 +
  1163 +路
  1164 +
  1165 +标
  1166 +
  1167 +标
  1168 +
  1169 +树种
  1170 +
  1171 +风险评估结果
  1172 +树高
  1173 +
  1174 +胸径
  1175 +
  1176 +冠幅
  1177 +
  1178 +栽植
  1179 +
  1180 +(m)
  1181 +
  1182 +(cm)
  1183 +
  1184 +(m)
  1185 +
  1186 +位置
  1187 +
  1188 +常规情况
  1189 +
  1190 +应急情况
  1191 +
  1192 +下的风险
  1193 +
  1194 +下的风险
  1195 +
  1196 +等级
  1197 +
  1198 +等级
  1199 +
  1200 +风险处置
  1201 +建议处置
  1202 +措施
  1203 +
  1204 +是否已处
  1205 +置
  1206 +
  1207 +评估记录
  1208 +评估
  1209 +时间
  1210 +
  1211 +评估单位
  1212 +
  1213 +评估人
  1214 +
  1215 +23
  1216 +
  1217 + 行道树安全风险评估指南(试行)
  1218 +
  1219 +24
  1220 +
  1221 + 第四部分 风险控制
  1222 +
  1223 +第四部分 风险控制
  1224 +4.1 风险防范原则
  1225 +
  1226 +坚持保护优先的原则。行道树安全风险管理要严格坚持
  1227 +保护优先原则,重在找出问题,提出改善措施。
  1228 +
  1229 +安全风险分级管控原则。重度及以上安全风险树木及早
  1230 +处置,中度、轻度安全风险树木密切监测,采取缓解和保护
  1231 +措施。
  1232 +4.2 常规防范措施
  1233 +行道树作为有生命的城市基础设施,其安全风险管理贯
  1234 +穿树种规划、设计、施工、管养的整个过程。
  1235 +行道树树种规划阶段,应因地制宜,适地适树,优选抗
  1236 +性强、耐修剪、易栽活的乡土树种;设计阶段宜考虑丰富树
  1237 +种多样性和合理布局与搭配,提高行道树抗风险能力;施工
  1238 +阶段应关注施工质量和树木保护,确保严格按照相关规范和
  1239 +标准进行,工程验收时将安全风险指标考虑在内;管养阶段,
  1240 +除日常养护工作外,还应针对长势不良的行道树及时采取树
  1241 +池扩大、联通树池改造或土壤改良等复壮措施。
  1242 +建立常态化安全风险评估机制,实现行道树安全风险台
  1243 +账动态管理,并及时采取措施消除风险。注重收集的行道树
  1244 +安全事故数据,建立风险预警数据库,针对往年行道树安全
  1245 +事件频发的重点区域、位置设置警示标识,完善应急预案,
  1246 +加强巡查监测,提升行道树安全风险管理的有效性。
  1247 +
  1248 +25
  1249 +
  1250 + 行道树安全风险评估指南(试行)
  1251 +
  1252 +4.3 风险处置措施
  1253 +行道树安全风险是行道树健康风险的重要组成部分,按
  1254 +照保护优先和分级管控的原则,对于不同风险等级的行道树
  1255 +采取不同措施进行管理。
  1256 +评估为“轻度风险”“中度风险”的行道树,应依托树
  1257 +木医开展健康管理,减缓风险发展速度。
  1258 +评估为“重度风险”和“极度风险”的行道树,应立即
  1259 +采取措施,消除风险隐患。
  1260 +表 8 行道树安全风险等级对应的处置措施
  1261 +风险等级
  1262 +
  1263 +风险等级描述
  1264 +
  1265 +I级
  1266 +
  1267 +基本无风险
  1268 +
  1269 +II 级
  1270 +
  1271 +轻度风险
  1272 +
  1273 +III 级
  1274 +
  1275 +中度风险
  1276 +
  1277 +IV 级
  1278 +
  1279 +重度风险
  1280 +
  1281 +V级
  1282 +
  1283 +极度风险
  1284 +
  1285 +处置建议
  1286 +正常养护,每年定期开展安全风险评估。
  1287 +根据道路实际情况,结合存在的风险隐患点,开展修剪、支撑、创
  1288 +面或空洞修复、病虫害防治等治理措施,每半年巡查 1 次。
  1289 +加强巡查频次,每季度巡查一次,适时采取风险减缓措施。
  1290 +在极端天气来临前,特别是处于人流量较大区域风险树,在完成评
  1291 +估后 4 周内采取措施。对此类树木密切监察,直至风险降级或解除。
  1292 +立即采取措施,进行树木移除、危险枝清理或其他减轻风险的措施。
  1293 +
  1294 +4.3.1 针对特殊情形树木的移除
  1295 +一般情况下,能采取风险减缓措施的树木均不建议进行
  1296 +移除。
  1297 +针对风险等级达到重度安全风险及以上且不具备采取
  1298 +风险减缓措施条件的行道树,建议进行移除,并适时补植适
  1299 +宜规格的苗木,以保证景观效果。
  1300 +
  1301 +26
  1302 +
  1303 + 第四部分 风险控制
  1304 +建议进行树木移除的情形
  1305 +
  1306 +
  1307 +栽植 2 年以上且根颈出现松动时,应及时采取措施,进行树木移除;
  1308 +
  1309 +
  1310 +
  1311 +树根存在严重腐烂,无法起到支撑作用的行道树,应及时移除;
  1312 +
  1313 +
  1314 +
  1315 +木质部受损(空腐率)超过 50%且树势较弱的行道树;
  1316 +
  1317 +
  1318 +
  1319 +主干倾斜 30 度以上且无法通过缩冠减缓风险或不具备增加支撑条件的行道树;
  1320 +
  1321 +
  1322 +
  1323 +其他经过专家研讨一致认定应及时移除的行道树。
  1324 +
  1325 +4.3.2 针对木质部受损的行道树进行空洞、腐朽处理
  1326 +根颈、主干及大枝的木质部受损,尤其是出现腐朽、空
  1327 +洞时,应及时采取处理措施。
  1328 +(1)木质部腐朽处理措施
  1329 +主干、主枝上有明显裸露腐朽木质部的,首先清除木质
  1330 +部表面的松软碎末等杂物,不损伤活组织的前提下,使用已
  1331 +消毒的工具修整至活组织,喷洒杀菌剂后,再均匀喷洒水溶
  1332 +性防腐剂,待自然风干后均匀涂抹纯熟桐油等天然环保的防
  1333 +腐材料。
  1334 +(2)木质部空洞处理措施
  1335 +主干或主枝上有明显树洞的,针对不同类型空洞,建议
  1336 +采取不同的处置措施。树体修复施工宜在树木休眠期、天气
  1337 +干燥时进行。
  1338 +建议采取的空洞修复方式
  1339 +
  1340 +
  1341 +不易积水、存水的树洞,做好防腐处理,不填充封堵。
  1342 +
  1343 +
  1344 +
  1345 +易积水但不影响树体安全,可在适当位置设导流管(孔)顺利排出的树洞,做好防腐
  1346 +处理不填充封堵。
  1347 +
  1348 +
  1349 +
  1350 +敞开式、贯通式树洞不填充封堵,做好导水、防腐及安全加固处理。
  1351 +
  1352 +
  1353 +
  1354 +易进水、存水的树洞,应封堵洞口,做好排水、通风处理。
  1355 +
  1356 +27
  1357 +
  1358 + 行道树安全风险评估指南(试行)
  1359 +
  1360 +4.3.3 针对倾斜的行道树采取支撑措施
  1361 +针对倾斜且具备支撑、加固条件的行道树,在不妨碍车
  1362 +辆、行人通行的情况下进行支撑、加固。树体外观明显倾斜
  1363 +的行道树,宜采用“人字”硬支撑、拉纤等方法进行支撑、
  1364 +加固。主干有劈裂倾倒隐患或树冠上有断裂隐患的分枝间可
  1365 +采用抱箍和相互拉纤进行加固。
  1366 +4.3.4 针对偏冠、树冠过大的行道树开展缩冠修剪
  1367 +行道树的修剪以冬春季(休眠期)修剪为主,夏季(生
  1368 +长期)修剪为辅,结合大风汛期前的应急修剪进行。
  1369 +针对存在偏冠的行道树,适当进行缩冠修剪。修剪时,
  1370 +应对生长势较弱一方的枝条适当长放或轻剪,对生长势较强
  1371 +一侧适当回缩,以此达到平衡生长势。
  1372 +树冠过大的行道树需进行缩冠修剪,尤其是针对处于风
  1373 +口树冠过大的行道树,必须进行缩冠修剪。按照“由外及里、
  1374 +由上到下”的顺序进行修剪,注意保留大部分枝条顶芽,避
  1375 +免出现截干、重修剪等现象。修剪时应保持树木冠幅及树冠
  1376 +高度与树干适当比例,冠幅宜占全树高度的 1/3~1/2,树冠
  1377 +高度宜占全树高度的 1/2~2/3。
  1378 +4.3.5 针对枝条过密的行道树进行疏枝
  1379 +过密枝条的疏枝按照“一知、二看、三剪、四拿、五处
  1380 +理、六保护”的程序进行操作:
  1381 +一知:参加修剪的全体人员,应明确修剪原则,知道操
  1382 +作规程、技术规范及特殊要求;
  1383 +28
  1384 +
  1385 + 第四部分 风险控制
  1386 +
  1387 +二看:修剪前先绕树观察,对树木的修剪方法做到心中
  1388 +有数;
  1389 +三剪:根据因地制宜,因树修剪的原则,合理修剪;
  1390 +四拿:修剪下来的枝条,及时清运,保证环境整洁;
  1391 +五处理:剪下的枝条要及时处理,防止病虫害蔓延;
  1392 +六保护:疏除大枝、粗枝时,应保护树体。
  1393 +4.3.6 针对枝干结合部异常的修剪
  1394 +针对枝干结合部存在异常,导致连接部位脆弱易发生断
  1395 +折的行道树,应及时去异常部位的枝条,避免产生大枝劈裂
  1396 +的风险。修剪时应注意避开枝领,降低剪切面受到病虫害侵
  1397 +染的几率,修剪后及时涂抹愈合剂。
  1398 +4.3.7 针对蛀干害虫的防治措施
  1399 +常见的蛀干害虫包括鞘翅目的吉丁虫、天牛、小蠹、象
  1400 +甲等,鳞翅目的木蠹蛾、小卷蛾、松梢螟、透翅蛾等,膜翅
  1401 +目的树蜂等。
  1402 +按照“预防为主,综合防治”的原则,做到安全、经济、
  1403 +及时、有效。及时采取物理防治手段,包括诱杀、阻止上树、
  1404 +人工捕捉、摘除网幕、剪除病虫枝等。宜采用生物防治手段,
  1405 +保护和利用天敌。采用化学防治措施时,选择符合环保要求
  1406 +的低毒农药。交替使用不同的药剂,减少喷药次数。
  1407 +
  1408 +29
  1409 +
  1410 + 行道树安全风险评估指南(试行)
  1411 +
  1412 +4.4 应急抢险
  1413 +管理单位应建立组织全面、职能明确、运行有效的应急
  1414 +抢险组织架构(见图 7),确保行道树安全风险管理有效。
  1415 +组织架构设立应急抢险领导小组,下设应急抢险办公室、后
  1416 +勤保障组、现场调查组和应急抢险组。组织架构中相关人员
  1417 +各司其职,保障应急信息、应急指令的及时传递,并定期开
  1418 +展培训和演练。
  1419 +
  1420 +图 7 应急抢险组织架构
  1421 +
  1422 +行道树安全风险事故发生后,应根据险情不同及时启动
  1423 +相应的应急抢险,以保障抢险工作高效、有序进行。当树木
  1424 +完全倒伏至地面或高度较低,采用普通锯除,再将大枝、主
  1425 +枝、主干截段,进行运输处理;当树木倒伏或断枝的位置过
  1426 +高时,采用高空移除,先将中级枝以上分枝去除,再将大枝、
  1427 +主枝、主干截断,再截段运输;若发生倾斜或挤压建筑的树
  1428 +木过大过高,为了防止二次破坏,采用搭建脚手架辅助移除。
  1429 +
  1430 +30
  1431 +
  1432 + 第五部分 附录
  1433 +
  1434 +第五部分 附录
  1435 +附录 1 风险指标判断示例
  1436 +5.1.1 根部病害示例
  1437 +
  1438 +蜜环菌
  1439 +
  1440 +多孔菌
  1441 +
  1442 +鬼伞
  1443 +
  1444 +鬼伞
  1445 +
  1446 +图 8 根部病害示例
  1447 +
  1448 +5.1.2 根系下扎不良示例
  1449 +
  1450 +31
  1451 +
  1452 + 行道树安全风险评估指南(试行)
  1453 +根部隆起
  1454 +
  1455 +根部隆起
  1456 +
  1457 +盘根
  1458 +
  1459 +盘根
  1460 +
  1461 +图 9 根系下扎不良示例
  1462 +
  1463 +5.1.3 工程切根示例
  1464 +
  1465 +图 10 施工切根示例
  1466 +
  1467 +32
  1468 +
  1469 + 第五部分 附录
  1470 +
  1471 +5.1.4 根颈木质部受损示例
  1472 +
  1473 +图 11 根颈木质部受损示例
  1474 +
  1475 +5.1.5 根颈树皮受损示例
  1476 +
  1477 +图 12 根颈树皮受损示例
  1478 +
  1479 +33
  1480 +
  1481 + 行道树安全风险评估指南(试行)
  1482 +
  1483 +5.1.6 主干木质部受损示例
  1484 +
  1485 +图 13 主干部位木质部受损示例
  1486 +
  1487 +34
  1488 +
  1489 + 第五部分 附录
  1490 +
  1491 +5.1.7 主干倾斜示例
  1492 +
  1493 +图 14 主干倾斜示例
  1494 +
  1495 +5.1.8 主干树皮受损示例
  1496 +
  1497 +图 15 主干部位树皮受损示例
  1498 +
  1499 +5.1.9 易落枝示例
  1500 +
  1501 +图 16 易落枝示例
  1502 +
  1503 +35
  1504 +
  1505 + 行道树安全风险评估指南(试行)
  1506 +
  1507 +5.1.10 枝干结合部异常示例
  1508 +
  1509 +图 17 枝干结合部异常示例
  1510 +
  1511 +5.1.11 树冠透风情况及平衡性示例
  1512 +
  1513 +36
  1514 +
  1515 + 第五部分 附录
  1516 +
  1517 +树冠密不透风且冠幅大
  1518 +
  1519 +偏冠
  1520 +
  1521 +图 18 树冠透风情况及平衡性示例
  1522 +
  1523 +37
  1524 +
  1525 + 行道树安全风险评估指南(试行)
  1526 +
  1527 +38
  1528 +
  1529 +
0 1530 \ No newline at end of file
... ...
sql/mysql/garden_tree_inspection.sql 0 → 100644
  1 +-- 行道树巡检与安全风险评估表
  2 +CREATE TABLE IF NOT EXISTS `garden_tree_inspection` (
  3 + `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键',
  4 + `tree_id` bigint NOT NULL COMMENT '一树一档案ID',
  5 + `treenumber` varchar(64) DEFAULT NULL COMMENT '树木编号',
  6 + `inspection_time` datetime NOT NULL COMMENT '巡检时间',
  7 + `inspector_id` bigint DEFAULT NULL COMMENT '巡检人ID',
  8 + `inspector_name` varchar(64) DEFAULT NULL COMMENT '巡检人姓名',
  9 + `dept_id` bigint DEFAULT NULL COMMENT '部门ID',
  10 +
  11 + -- 缺陷评估指标得分 (数值直接存对应选项的分数)
  12 + `root_disease` int DEFAULT '0' COMMENT '根部病害:0-无真菌危害或腐朽,8-存在真菌危害或腐朽',
  13 + `root_anchorage` int DEFAULT '0' COMMENT '根系下扎情况:0-良好,7-存在隆起或盘根',
  14 + `root_cutting` int DEFAULT '0' COMMENT '工程切根:0-无,5-存在',
  15 + `collar_wood_damage` int DEFAULT '0' COMMENT '根颈木质部受损:0-无,5-<10%, 15-10%-30%, 25-30%-50%, 70->=50%',
  16 + `collar_bark_damage` int DEFAULT '0' COMMENT '根颈树皮受损:0-<10%, 2-10%-30%, 4-30%-50%, 6->=50%',
  17 + `collar_loosening` int DEFAULT '0' COMMENT '根颈松动:0-不存在,100-存在',
  18 + `trunk_wood_damage` int DEFAULT '0' COMMENT '主干木质部受损:0-无,5-<10%, 12-10%-30%, 20-30%-50%, 70->=50%',
  19 + `trunk_tilt` int DEFAULT '0' COMMENT '主干倾斜:0-<10度, 3-10-20度, 8-20-30度, 70->=30度',
  20 + `trunk_bark_damage` int DEFAULT '0' COMMENT '主干树皮受损:0-<10%, 1-10%-30%, 3-30%-50%, 5->=50%',
  21 + `crown_loose_branch` int DEFAULT '0' COMMENT '易落枝:0-未发现,2-<1/10, 3->=1/10',
  22 + `crown_collar_abnormal` int DEFAULT '0' COMMENT '枝干结合部异常:0-无,3-龟裂卷皮,5-腐烂未成洞,70-明显空洞或蛀干痕迹',
  23 + `crown_ventilation_balance` int DEFAULT '0' COMMENT '树冠透风及平衡性:0-较好不偏冠, 1-偏冠或透风差不偏冠, 2-透风差明显偏冠但冠幅适中, 5-透风差冠幅大不偏冠, 8-透风差冠幅大且明显偏冠',
  24 +
  25 + -- 权重因子指标值和赋权值
  26 + `tree_species_type` varchar(32) DEFAULT NULL COMMENT '树种类型:深根性树种, 浅根性树种',
  27 + `tree_species_weight` double DEFAULT '1.0' COMMENT '树种类型权重:深根性-1.0, 浅根性-1.1',
  28 + `planting_years` varchar(32) DEFAULT NULL COMMENT '栽植年限:栽植 10 年以内, 栽植 10-30 年, 栽植 30 年以上',
  29 + `planting_years_weight` double DEFAULT '1.0' COMMENT '栽植年限权重:10年内-1.0, 10-30年-1.1, 30年以上-1.2',
  30 + `is_wind_corridor` tinyint DEFAULT '0' COMMENT '是否处于风口:0-否, 1-是',
  31 + `wind_corridor_weight` double DEFAULT '1.0' COMMENT '风口权重:否-1.0, 是-2.0',
  32 + `tree_pool_type` varchar(32) DEFAULT NULL COMMENT '树池类型:联通树池, 独立树池, 树池硬化',
  33 + `tree_pool_weight` double DEFAULT '1.0' COMMENT '树池类型权重:联通树池-1.0, 独立树池-1.2, 树池硬化-1.5',
  34 + `tree_pool_width_dbh_ratio` varchar(32) DEFAULT NULL COMMENT '树池宽度与胸径比:7 倍及以上, 5 倍-7 倍, 3 倍-5 倍, 3 倍以下',
  35 + `tree_pool_ratio_weight` double DEFAULT '1.0' COMMENT '树池比权重:7倍及以上-1.0, 5-7倍-1.1, 3-5倍-1.2, 3倍以下-1.3',
  36 +
  37 + -- 是否展开应急评估及应急权重
  38 + `is_emergency` tinyint DEFAULT '0' COMMENT '是否进行应急评估:0-否, 1-是',
  39 + `wind_power` varchar(32) DEFAULT NULL COMMENT '应急评估极端天气风力:7 级及以下, 8-9 级, 10 级, 10 级以上',
  40 + `wind_power_weight` double DEFAULT '1.0' COMMENT '风力权重:7级及以下-1.0, 8-9级-1.5, 10级-2.0, 10级以上-3.0',
  41 +
  42 + -- 评估结果
  43 + `defect_score` int DEFAULT '0' COMMENT '树木缺陷得分',
  44 + `normal_score` double DEFAULT '0' COMMENT '常规情况下安全风险得分',
  45 + `normal_level` varchar(64) DEFAULT NULL COMMENT '常规情况下风险等级',
  46 + `emergency_score` double DEFAULT NULL COMMENT '应急情况下安全风险得分',
  47 + `emergency_level` varchar(64) DEFAULT NULL COMMENT '应急情况下风险等级',
  48 +
  49 + -- 现状及处理措施
  50 + `treatment_suggestion` varchar(512) DEFAULT NULL COMMENT '建议处置措施',
  51 + `is_treated` tinyint DEFAULT '0' COMMENT '是否已处置:0-未处置, 1-已处置',
  52 + `photos` varchar(1024) DEFAULT NULL COMMENT '现场照片链接(JSON 数组)',
  53 + `estimator_company` varchar(255) DEFAULT NULL COMMENT '评估单位(公司)',
  54 + `estimator` varchar(100) DEFAULT NULL COMMENT '评估人',
  55 +
  56 +
  57 + -- 基础审计与租户字段(继承 BaseDO / TenantBaseDO)
  58 + `creator` varchar(64) DEFAULT NULL COMMENT '创建者',
  59 + `create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  60 + `updater` varchar(64) DEFAULT NULL COMMENT '更新者',
  61 + `update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  62 + `deleted` tinyint DEFAULT '0' COMMENT '是否删除:0-未删除, 1-已删除',
  63 + `tenant_id` bigint DEFAULT '0' COMMENT '租户ID',
  64 + PRIMARY KEY (`id`),
  65 + KEY `idx_tree_id` (`tree_id`)
  66 +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='行道树巡检与安全评估记录';
... ...
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/treeinspection/TreeInspectionController.java 0 → 100644
  1 +package com.zteits.urbanops.module.garden.controller.admin.treeinspection;
  2 +
  3 +import io.swagger.v3.oas.annotations.Operation;
  4 +import io.swagger.v3.oas.annotations.Parameter;
  5 +import io.swagger.v3.oas.annotations.tags.Tag;
  6 +import org.springframework.validation.annotation.Validated;
  7 +import org.springframework.web.bind.annotation.*;
  8 +import org.springframework.security.access.prepost.PreAuthorize;
  9 +import jakarta.annotation.Resource;
  10 +import jakarta.validation.Valid;
  11 +
  12 +import com.zteits.urbanops.framework.common.pojo.CommonResult;
  13 +import com.zteits.urbanops.framework.common.pojo.PageResult;
  14 +import com.zteits.urbanops.module.garden.dal.dataobject.treeinspection.TreeInspectionDO;
  15 +import com.zteits.urbanops.module.garden.service.treeinspection.TreeInspectionService;
  16 +import com.zteits.urbanops.module.garden.controller.app.treeinspection.vo.*;
  17 +import com.zteits.urbanops.module.garden.convert.treeinspection.TreeInspectionConvert;
  18 +
  19 +import static com.zteits.urbanops.framework.common.pojo.CommonResult.success;
  20 +
  21 +@Tag(name = "管理后台 - 行道树巡检记录与评估")
  22 +@RestController("adminTreeInspectionController")
  23 +@RequestMapping("/garden/tree-inspection")
  24 +@Validated
  25 +public class TreeInspectionController {
  26 +
  27 + @Resource
  28 + private TreeInspectionService treeInspectionService;
  29 +
  30 + @GetMapping("/get")
  31 + @Operation(summary = "获得巡检评估详情")
  32 + @Parameter(name = "id", description = "巡检记录编号", required = true, example = "12")
  33 + @PreAuthorize("@ss.hasPermission('garden:tree-inspection:query')")
  34 + public CommonResult<TreeInspectionRespVO> getTreeInspection(@RequestParam("id") Long id) {
  35 + return success(treeInspectionService.getTreeInspection(id));
  36 + }
  37 +
  38 + @GetMapping("/page")
  39 + @Operation(summary = "分页查询单株树木的历史巡检记录")
  40 + @PreAuthorize("@ss.hasPermission('garden:tree-inspection:query')")
  41 + public CommonResult<PageResult<TreeInspectionRespVO>> getTreeInspectionPage(@Valid TreeInspectionPageReqVO pageReqVO) {
  42 + PageResult<TreeInspectionDO> pageResult = treeInspectionService.getTreeInspectionPage(pageReqVO);
  43 + PageResult<TreeInspectionRespVO> respPageResult = new PageResult<>(
  44 + TreeInspectionConvert.INSTANCE.convertList(pageResult.getList()),
  45 + pageResult.getTotal()
  46 + );
  47 + return success(respPageResult);
  48 + }
  49 +
  50 +}
... ...
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/app/treeinspection/AppTreeInspectionController.java 0 → 100644
  1 +package com.zteits.urbanops.module.garden.controller.app.treeinspection;
  2 +
  3 +import io.swagger.v3.oas.annotations.Operation;
  4 +import io.swagger.v3.oas.annotations.Parameter;
  5 +import io.swagger.v3.oas.annotations.tags.Tag;
  6 +import org.springframework.validation.annotation.Validated;
  7 +import org.springframework.web.bind.annotation.*;
  8 +import jakarta.annotation.Resource;
  9 +import jakarta.validation.Valid;
  10 +
  11 +import com.zteits.urbanops.framework.common.pojo.CommonResult;
  12 +import com.zteits.urbanops.framework.common.pojo.PageResult;
  13 +import com.zteits.urbanops.module.garden.dal.dataobject.treeinspection.TreeInspectionDO;
  14 +import com.zteits.urbanops.module.garden.service.treeinspection.TreeInspectionService;
  15 +import com.zteits.urbanops.module.garden.controller.app.treeinspection.vo.*;
  16 +import com.zteits.urbanops.module.garden.convert.treeinspection.TreeInspectionConvert;
  17 +
  18 +import static com.zteits.urbanops.framework.common.pojo.CommonResult.success;
  19 +
  20 +@Tag(name = "App - 行道树巡检与风险评估")
  21 +@RestController
  22 +@RequestMapping({"/garden/tree-inspection", "/business/tree-inspection"})
  23 +@Validated
  24 +public class AppTreeInspectionController {
  25 +
  26 + @Resource
  27 + private TreeInspectionService treeInspectionService;
  28 +
  29 + @PostMapping("/create")
  30 + @Operation(summary = "提交巡检记录并评估")
  31 + public CommonResult<Long> createTreeInspection(@Valid @RequestBody TreeInspectionSaveReqVO createReqVO) {
  32 + return success(treeInspectionService.createTreeInspection(createReqVO));
  33 + }
  34 +
  35 + @GetMapping("/get")
  36 + @Operation(summary = "获得巡检评估详情")
  37 + @Parameter(name = "id", description = "巡检记录编号", required = true, example = "12")
  38 + public CommonResult<TreeInspectionRespVO> getTreeInspection(@RequestParam("id") Long id) {
  39 + return success(treeInspectionService.getTreeInspection(id));
  40 + }
  41 +
  42 + @GetMapping("/page")
  43 + @Operation(summary = "分页查询单株树木的历史巡检记录")
  44 + public CommonResult<PageResult<TreeInspectionRespVO>> getTreeInspectionPage(@Valid TreeInspectionPageReqVO pageReqVO) {
  45 + PageResult<TreeInspectionDO> pageResult = treeInspectionService.getTreeInspectionPage(pageReqVO);
  46 + PageResult<TreeInspectionRespVO> respPageResult = new PageResult<>(
  47 + TreeInspectionConvert.INSTANCE.convertList(pageResult.getList()),
  48 + pageResult.getTotal()
  49 + );
  50 + return success(respPageResult);
  51 + }
  52 +
  53 +}
... ...
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/app/treeinspection/vo/TreeInspectionPageReqVO.java 0 → 100644
  1 +package com.zteits.urbanops.module.garden.controller.app.treeinspection.vo;
  2 +
  3 +import io.swagger.v3.oas.annotations.media.Schema;
  4 +import lombok.Data;
  5 +import lombok.EqualsAndHashCode;
  6 +import lombok.ToString;
  7 +import jakarta.validation.constraints.NotNull;
  8 +import com.zteits.urbanops.framework.common.pojo.PageParam;
  9 +
  10 +@Schema(description = "小程序端 - 行道树巡检历史分页 Request VO")
  11 +@Data
  12 +@EqualsAndHashCode(callSuper = true)
  13 +@ToString(callSuper = true)
  14 +public class TreeInspectionPageReqVO extends PageParam {
  15 +
  16 + @Schema(description = "一树一档案ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
  17 + @NotNull(message = "关联树木ID不能为空")
  18 + private Long treeId;
  19 +
  20 +}
... ...
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/app/treeinspection/vo/TreeInspectionRespVO.java 0 → 100644
  1 +package com.zteits.urbanops.module.garden.controller.app.treeinspection.vo;
  2 +
  3 +import io.swagger.v3.oas.annotations.media.Schema;
  4 +import lombok.Data;
  5 +import org.springframework.format.annotation.DateTimeFormat;
  6 +import com.fasterxml.jackson.annotation.JsonFormat;
  7 +import com.fasterxml.jackson.databind.annotation.JsonSerialize;
  8 +import com.zteits.urbanops.framework.common.util.json.databind.LocalDateTimeStringSerializer;
  9 +import java.time.LocalDateTime;
  10 +import java.util.List;
  11 +
  12 +@Schema(description = "小程序端 - 行道树巡检记录与评估详情 Response VO")
  13 +@Data
  14 +public class TreeInspectionRespVO {
  15 +
  16 + @Schema(description = "主键ID", example = "12")
  17 + private Long id;
  18 +
  19 + @Schema(description = "一树一档案ID", example = "1024")
  20 + private Long treeId;
  21 +
  22 + @Schema(description = "树木编号", example = "D0001-P1-0001")
  23 + private String treenumber;
  24 +
  25 + @Schema(description = "巡检时间")
  26 + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
  27 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
  28 + @JsonSerialize(using = LocalDateTimeStringSerializer.class)
  29 + private LocalDateTime inspectionTime;
  30 +
  31 + @Schema(description = "巡检人ID", example = "10001")
  32 + private Long inspectorId;
  33 +
  34 + @Schema(description = "巡检人姓名", example = "张三")
  35 + private String inspectorName;
  36 +
  37 + @Schema(description = "树根部位指标组")
  38 + private RootRespDTO root;
  39 +
  40 + @Schema(description = "根颈部位指标组")
  41 + private CollarRespDTO collar;
  42 +
  43 + @Schema(description = "主干部位指标组")
  44 + private TrunkRespDTO trunk;
  45 +
  46 + @Schema(description = "树冠部位指标组")
  47 + private CrownRespDTO crown;
  48 +
  49 + @Schema(description = "权重因子评估组")
  50 + private WeightRespDTO weight;
  51 +
  52 + @Schema(description = "风险评估结果组 (折叠面板)")
  53 + private ResultRespDTO result;
  54 +
  55 +
  56 + @Schema(description = "现状及处理措施组")
  57 + private StatusRespDTO status;
  58 +
  59 + @Data
  60 + @Schema(description = "树根部位指标详情")
  61 + public static class RootRespDTO {
  62 + @Schema(description = "根部病害:0-无真菌危害或腐朽,8-存在真菌危害或腐朽", example = "0")
  63 + private Integer disease;
  64 +
  65 + @Schema(description = "根系下扎情况:0-良好,7-存在隆起或盘根", example = "0")
  66 + private Integer anchorage;
  67 +
  68 + @Schema(description = "工程切根:0-无,5-存在", example = "0")
  69 + private Integer cutting;
  70 + }
  71 +
  72 + @Data
  73 + @Schema(description = "根颈部位指标详情")
  74 + public static class CollarRespDTO {
  75 + @Schema(description = "根颈木质部受损:0-无,5-<10%, 15-10%-30%, 25-30%-50%, 70->=50%", example = "5")
  76 + private Integer woodDamage;
  77 +
  78 + @Schema(description = "根颈树皮受损:0-<10%, 2-10%-30%, 4-30%-50%, 6->=50%", example = "0")
  79 + private Integer barkDamage;
  80 +
  81 + @Schema(description = "根颈松动:0-不存在,100-存在", example = "0")
  82 + private Integer loosening;
  83 + }
  84 +
  85 + @Data
  86 + @Schema(description = "主干部位指标详情")
  87 + public static class TrunkRespDTO {
  88 + @Schema(description = "主干木质部受损:0-无,5-<10%, 12-10%-30%, 20-30%-50%, 70->=50%", example = "0")
  89 + private Integer woodDamage;
  90 +
  91 + @Schema(description = "主干倾斜:0-<10度, 3-10-20度, 8-20-30度, 70->=30度", example = "0")
  92 + private Integer tilt;
  93 +
  94 + @Schema(description = "主干树皮受损:0-<10%, 1-10%-30%, 3-30%-50%, 5->=50%", example = "0")
  95 + private Integer barkDamage;
  96 + }
  97 +
  98 + @Data
  99 + @Schema(description = "树冠部位指标详情")
  100 + public static class CrownRespDTO {
  101 + @Schema(description = "易落枝:0-未发现,2-<1/10, 3->=1/10", example = "0")
  102 + private Integer looseBranch;
  103 +
  104 + @Schema(description = "枝干结合部异常:0-无,3-龟裂卷皮,5-腐烂未成洞,70-明显空洞或蛀干痕迹", example = "0")
  105 + private Integer collarAbnormal;
  106 +
  107 + @Schema(description = "树冠透风及平衡性:0-较好不偏冠, 1-偏冠或透风差不偏冠, 2-透风差明显偏冠但冠幅适中, 5-透风差冠幅大不偏冠, 8-透风差冠幅大且明显偏冠", example = "0")
  108 + private Integer ventilationBalance;
  109 + }
  110 +
  111 + @Data
  112 + @Schema(description = "权重因子评估详情")
  113 + public static class WeightRespDTO {
  114 + @Schema(description = "树种类型:深根性树种, 浅根性树种", example = "深根性树种")
  115 + private String treeSpeciesType;
  116 +
  117 + @Schema(description = "树种类型权重常数", example = "1.0")
  118 + private Double treeSpeciesWeight;
  119 +
  120 + @Schema(description = "栽植年限:栽植 10 年以内, 栽植 10-30 年, 栽植 30 年以上", example = "栽植 10-30 年")
  121 + private String plantingYears;
  122 +
  123 + @Schema(description = "栽植年限权重常数", example = "1.1")
  124 + private Double plantingYearsWeight;
  125 +
  126 + @Schema(description = "是否处于风口", example = "false")
  127 + private Boolean isWindCorridor;
  128 +
  129 + @Schema(description = "风口权重常数", example = "1.0")
  130 + private Double windCorridorWeight;
  131 +
  132 + @Schema(description = "树池类型:联通树池, 独立树池, 树池硬化", example = "联通树池")
  133 + private String treePoolType;
  134 +
  135 + @Schema(description = "树池类型权重常数", example = "1.0")
  136 + private Double treePoolWeight;
  137 +
  138 + @Schema(description = "树池宽度与胸径比:7 倍及以上, 5 倍-7 倍, 3 倍-5 倍, 3 倍以下", example = "7 倍及以上")
  139 + private String treePoolWidthDbhRatio;
  140 +
  141 + @Schema(description = "树池比权重常数", example = "1.0")
  142 + private Double treePoolRatioWeight;
  143 + }
  144 +
  145 + @Data
  146 + @Schema(description = "风险评估结果详情 (折叠面板)")
  147 + public static class ResultRespDTO {
  148 + @Schema(description = "是否进行应急评估", example = "true")
  149 + private Boolean isEmergency;
  150 +
  151 + @Schema(description = "应急评估极端天气风力:7 级及以下, 8-9 级, 10 级, 10 级以上", example = "8-9 级")
  152 + private String windPower;
  153 +
  154 + @Schema(description = "风力权重常数", example = "1.5")
  155 + private Double windPowerWeight;
  156 +
  157 + @Schema(description = "树木缺陷得分", example = "9")
  158 + private Integer defectScore;
  159 +
  160 + @Schema(description = "常规安全风险评估结果")
  161 + private EvaluationResultDTO normalResult;
  162 +
  163 + @Schema(description = "应急安全风险评估结果")
  164 + private EvaluationResultDTO emergencyResult;
  165 + }
  166 +
  167 + @Data
  168 + @Schema(description = "安全风险评估得分与等级结果")
  169 + public static class EvaluationResultDTO {
  170 + @Schema(description = "风险得分", example = "87.12")
  171 + private Double score;
  172 +
  173 + @Schema(description = "风险等级", example = "重度风险")
  174 + private String level;
  175 + }
  176 +
  177 +
  178 +
  179 + @Data
  180 + @Schema(description = "现状及处理措施详情")
  181 + public static class StatusRespDTO {
  182 + @Schema(description = "现场照片(最多5张)")
  183 + private List<String> photos;
  184 + }
  185 +
  186 +
  187 +}
... ...
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/app/treeinspection/vo/TreeInspectionSaveReqVO.java 0 → 100644
  1 +package com.zteits.urbanops.module.garden.controller.app.treeinspection.vo;
  2 +
  3 +import io.swagger.v3.oas.annotations.media.Schema;
  4 +import lombok.Data;
  5 +import jakarta.validation.Valid;
  6 +import jakarta.validation.constraints.*;
  7 +import org.springframework.format.annotation.DateTimeFormat;
  8 +import com.fasterxml.jackson.annotation.JsonFormat;
  9 +import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
  10 +import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
  11 +import java.time.LocalDateTime;
  12 +import java.util.List;
  13 +
  14 +@Schema(description = "小程序端 - 行道树巡检记录与评估新增/修改 Request VO")
  15 +@Data
  16 +public class TreeInspectionSaveReqVO {
  17 +
  18 + @Schema(description = "一树一档案ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
  19 + @NotNull(message = "关联树木ID不能为空")
  20 + private Long treeId;
  21 +
  22 + @Schema(description = "巡检时间", requiredMode = Schema.RequiredMode.REQUIRED)
  23 + @NotNull(message = "巡检时间不能为空")
  24 + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
  25 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
  26 + @JsonDeserialize(using = LocalDateTimeDeserializer.class)
  27 + private LocalDateTime inspectionTime;
  28 +
  29 + @Schema(description = "树根部位指标组", requiredMode = Schema.RequiredMode.REQUIRED)
  30 + @NotNull(message = "树根部位指标不能为空")
  31 + @Valid
  32 + private RootDTO root;
  33 +
  34 + @Schema(description = "根颈部位指标组", requiredMode = Schema.RequiredMode.REQUIRED)
  35 + @NotNull(message = "根颈部位指标不能为空")
  36 + @Valid
  37 + private CollarDTO collar;
  38 +
  39 + @Schema(description = "主干部位指标组", requiredMode = Schema.RequiredMode.REQUIRED)
  40 + @NotNull(message = "主干部位指标不能为空")
  41 + @Valid
  42 + private TrunkDTO trunk;
  43 +
  44 + @Schema(description = "树冠部位指标组", requiredMode = Schema.RequiredMode.REQUIRED)
  45 + @NotNull(message = "树冠部位指标不能为空")
  46 + @Valid
  47 + private CrownDTO crown;
  48 +
  49 + @Schema(description = "权重因子评估组", requiredMode = Schema.RequiredMode.REQUIRED)
  50 + @NotNull(message = "权重因子评估组不能为空")
  51 + @Valid
  52 + private WeightDTO weight;
  53 +
  54 + @Schema(description = "风险评估结果组", requiredMode = Schema.RequiredMode.REQUIRED)
  55 + @NotNull(message = "风险评估结果组不能为空")
  56 + @Valid
  57 + private ResultDTO result;
  58 +
  59 +
  60 + @Schema(description = "现状及处理措施组", requiredMode = Schema.RequiredMode.REQUIRED)
  61 + @NotNull(message = "现状及处理措施组不能为空")
  62 + @Valid
  63 + private StatusDTO status;
  64 +
  65 + @Data
  66 + @Schema(description = "树根部位指标 DTO")
  67 + public static class RootDTO {
  68 + @Schema(description = "根部病害:0-无真菌危害或腐朽,8-存在真菌危害或腐朽", requiredMode = Schema.RequiredMode.REQUIRED, example = "0")
  69 + @NotNull(message = "根部病害指标不能为空")
  70 + private Integer disease;
  71 +
  72 + @Schema(description = "根系下扎情况:0-良好,7-存在隆起或盘根", requiredMode = Schema.RequiredMode.REQUIRED, example = "0")
  73 + @NotNull(message = "根系下扎情况指标不能为空")
  74 + private Integer anchorage;
  75 +
  76 + @Schema(description = "工程切根:0-无,5-存在", requiredMode = Schema.RequiredMode.REQUIRED, example = "0")
  77 + @NotNull(message = "工程切根指标不能为空")
  78 + private Integer cutting;
  79 + }
  80 +
  81 + @Data
  82 + @Schema(description = "根颈部位指标 DTO")
  83 + public static class CollarDTO {
  84 + @Schema(description = "根颈木质部受损:0-无,5-<10%, 15-10%-30%, 25-30%-50%, 70->=50%", requiredMode = Schema.RequiredMode.REQUIRED, example = "5")
  85 + @NotNull(message = "根颈木质部受损指标不能为空")
  86 + private Integer woodDamage;
  87 +
  88 + @Schema(description = "根颈树皮受损:0-<10%, 2-10%-30%, 4-30%-50%, 6->=50%", requiredMode = Schema.RequiredMode.REQUIRED, example = "0")
  89 + @NotNull(message = "根颈树皮受损指标不能为空")
  90 + private Integer barkDamage;
  91 +
  92 + @Schema(description = "根颈松动:0-不存在,100-存在", requiredMode = Schema.RequiredMode.REQUIRED, example = "0")
  93 + @NotNull(message = "根颈松动指标不能为空")
  94 + private Integer loosening;
  95 + }
  96 +
  97 + @Data
  98 + @Schema(description = "主干部位指标 DTO")
  99 + public static class TrunkDTO {
  100 + @Schema(description = "主干木质部受损:0-无,5-<10%, 12-10%-30%, 20-30%-50%, 70->=50%", requiredMode = Schema.RequiredMode.REQUIRED, example = "0")
  101 + @NotNull(message = "主干木质部受损指标不能为空")
  102 + private Integer woodDamage;
  103 +
  104 + @Schema(description = "主干倾斜:0-<10度, 3-10-20度, 8-20-30度, 70->=30度", requiredMode = Schema.RequiredMode.REQUIRED, example = "0")
  105 + @NotNull(message = "主干倾斜指标不能为空")
  106 + private Integer tilt;
  107 +
  108 + @Schema(description = "主干树皮受损:0-<10%, 1-10%-30%, 3-30%-50%, 5->=50%", requiredMode = Schema.RequiredMode.REQUIRED, example = "0")
  109 + @NotNull(message = "主干树皮受损指标不能为空")
  110 + private Integer barkDamage;
  111 + }
  112 +
  113 + @Data
  114 + @Schema(description = "树冠部位指标 DTO")
  115 + public static class CrownDTO {
  116 + @Schema(description = "易落枝:0-未发现,2-<1/10, 3->=1/10", requiredMode = Schema.RequiredMode.REQUIRED, example = "0")
  117 + @NotNull(message = "易落枝指标不能为空")
  118 + private Integer looseBranch;
  119 +
  120 + @Schema(description = "枝干结合部异常:0-无,3-龟裂卷皮,5-腐烂未成洞,70-明显空洞或蛀干痕迹", requiredMode = Schema.RequiredMode.REQUIRED, example = "0")
  121 + @NotNull(message = "枝干结合部异常指标不能为空")
  122 + private Integer collarAbnormal;
  123 +
  124 + @Schema(description = "树冠透风及平衡性:0-较好不偏冠, 1-偏冠或透风差不偏冠, 2-透风差明显偏冠但冠幅适中, 5-透风差冠幅大不偏冠, 8-透风差冠幅大且明显偏冠", requiredMode = Schema.RequiredMode.REQUIRED, example = "0")
  125 + @NotNull(message = "树冠透风及平衡性指标不能为空")
  126 + private Integer ventilationBalance;
  127 + }
  128 +
  129 + @Data
  130 + @Schema(description = "权重因子评估 DTO")
  131 + public static class WeightDTO {
  132 + @Schema(description = "树种类型:深根性树种, 浅根性树种", requiredMode = Schema.RequiredMode.REQUIRED, example = "深根性树种")
  133 + @NotBlank(message = "树种类型不能为空")
  134 + private String treeSpeciesType;
  135 +
  136 + @Schema(description = "栽植年限:栽植 10 年以内, 栽植 10-30 年, 栽植 30 年以上", requiredMode = Schema.RequiredMode.REQUIRED, example = "栽植 10-30 年")
  137 + @NotBlank(message = "栽植年限不能为空")
  138 + private String plantingYears;
  139 +
  140 + @Schema(description = "是否处于风口", requiredMode = Schema.RequiredMode.REQUIRED, example = "false")
  141 + @NotNull(message = "是否处于风口标识不能为空")
  142 + private Boolean isWindCorridor;
  143 +
  144 + @Schema(description = "树池类型:联通树池, 独立树池, 树池硬化", requiredMode = Schema.RequiredMode.REQUIRED, example = "联通树池")
  145 + @NotBlank(message = "树池类型不能为空")
  146 + private String treePoolType;
  147 +
  148 + @Schema(description = "树池宽度与胸径比:7 倍及以上, 5 倍-7 倍, 3 倍-5 倍, 3 倍以下", requiredMode = Schema.RequiredMode.REQUIRED, example = "7 倍及以上")
  149 + @NotBlank(message = "树池宽度与胸径比不能为空")
  150 + private String treePoolWidthDbhRatio;
  151 + }
  152 +
  153 + @Data
  154 + @Schema(description = "风险评估结果 DTO (折叠面板)")
  155 + public static class ResultDTO {
  156 + @Schema(description = "是否进行应急评估", requiredMode = Schema.RequiredMode.REQUIRED, example = "true")
  157 + @NotNull(message = "是否应急评估标识不能为空")
  158 + private Boolean isEmergency;
  159 +
  160 + @Schema(description = "应急评估极端天气风力:7 级及以下, 8-9 级, 10 级, 10 级以上", example = "8-9 级")
  161 + private String windPower;
  162 +
  163 + @Schema(description = "树木缺陷得分", example = "9")
  164 + private Integer defectScore;
  165 +
  166 + @Schema(description = "常规安全风险评估结果")
  167 + private EvaluationResultDTO normalResult;
  168 +
  169 + @Schema(description = "应急安全风险评估结果")
  170 + private EvaluationResultDTO emergencyResult;
  171 + }
  172 +
  173 + @Data
  174 + @Schema(description = "安全风险评估得分与等级结果")
  175 + public static class EvaluationResultDTO {
  176 + @Schema(description = "风险得分", example = "87.12")
  177 + private Double score;
  178 +
  179 + @Schema(description = "风险等级", example = "重度风险")
  180 + private String level;
  181 + }
  182 +
  183 +
  184 +
  185 + @Data
  186 + @Schema(description = "现状及处理措施 DTO")
  187 + public static class StatusDTO {
  188 + @Schema(description = "现场照片(最多5张)")
  189 + @Size(max = 5, message = "最多只能上传5张现场照片")
  190 + private List<String> photos;
  191 + }
  192 +
  193 +
  194 +}
... ...
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/convert/treeinspection/TreeInspectionConvert.java 0 → 100644
  1 +package com.zteits.urbanops.module.garden.convert.treeinspection;
  2 +
  3 +import org.mapstruct.Mapper;
  4 +import org.mapstruct.Mapping;
  5 +import org.mapstruct.Mappings;
  6 +import org.mapstruct.factory.Mappers;
  7 +import com.zteits.urbanops.module.garden.dal.dataobject.treeinspection.TreeInspectionDO;
  8 +import com.zteits.urbanops.module.garden.controller.app.treeinspection.vo.TreeInspectionSaveReqVO;
  9 +import com.zteits.urbanops.module.garden.controller.app.treeinspection.vo.TreeInspectionRespVO;
  10 +import java.util.List;
  11 +
  12 +@Mapper
  13 +public interface TreeInspectionConvert {
  14 +
  15 + TreeInspectionConvert INSTANCE = Mappers.getMapper(TreeInspectionConvert.class);
  16 +
  17 + @Mappings({
  18 + @Mapping(source = "root.disease", target = "rootDisease"),
  19 + @Mapping(source = "root.anchorage", target = "rootAnchorage"),
  20 + @Mapping(source = "root.cutting", target = "rootCutting"),
  21 + @Mapping(source = "collar.woodDamage", target = "collarWoodDamage"),
  22 + @Mapping(source = "collar.barkDamage", target = "collarBarkDamage"),
  23 + @Mapping(source = "collar.loosening", target = "collarLoosening"),
  24 + @Mapping(source = "trunk.woodDamage", target = "trunkWoodDamage"),
  25 + @Mapping(source = "trunk.tilt", target = "trunkTilt"),
  26 + @Mapping(source = "trunk.barkDamage", target = "trunkBarkDamage"),
  27 + @Mapping(source = "crown.looseBranch", target = "crownLooseBranch"),
  28 + @Mapping(source = "crown.collarAbnormal", target = "crownCollarAbnormal"),
  29 + @Mapping(source = "crown.ventilationBalance", target = "crownVentilationBalance"),
  30 + @Mapping(source = "weight.treeSpeciesType", target = "treeSpeciesType"),
  31 + @Mapping(source = "weight.plantingYears", target = "plantingYears"),
  32 + @Mapping(source = "weight.isWindCorridor", target = "isWindCorridor"),
  33 + @Mapping(source = "weight.treePoolType", target = "treePoolType"),
  34 + @Mapping(source = "weight.treePoolWidthDbhRatio", target = "treePoolWidthDbhRatio"),
  35 + @Mapping(source = "result.isEmergency", target = "isEmergency"),
  36 + @Mapping(source = "result.windPower", target = "windPower"),
  37 + @Mapping(source = "status.photos", target = "photos"),
  38 + @Mapping(source = "result.defectScore", target = "defectScore"),
  39 + @Mapping(source = "result.normalResult.score", target = "normalScore"),
  40 + @Mapping(source = "result.normalResult.level", target = "normalLevel"),
  41 + @Mapping(source = "result.emergencyResult.score", target = "emergencyScore"),
  42 + @Mapping(source = "result.emergencyResult.level", target = "emergencyLevel")
  43 + })
  44 + TreeInspectionDO convert(TreeInspectionSaveReqVO bean);
  45 +
  46 + @Mappings({
  47 + @Mapping(source = "rootDisease", target = "root.disease"),
  48 + @Mapping(source = "rootAnchorage", target = "root.anchorage"),
  49 + @Mapping(source = "rootCutting", target = "root.cutting"),
  50 + @Mapping(source = "collarWoodDamage", target = "collar.woodDamage"),
  51 + @Mapping(source = "collarBarkDamage", target = "collar.barkDamage"),
  52 + @Mapping(source = "collarLoosening", target = "collar.loosening"),
  53 + @Mapping(source = "trunkWoodDamage", target = "trunk.woodDamage"),
  54 + @Mapping(source = "trunkTilt", target = "trunk.tilt"),
  55 + @Mapping(source = "trunkBarkDamage", target = "trunk.barkDamage"),
  56 + @Mapping(source = "crownLooseBranch", target = "crown.looseBranch"),
  57 + @Mapping(source = "crownCollarAbnormal", target = "crown.collarAbnormal"),
  58 + @Mapping(source = "crownVentilationBalance", target = "crown.ventilationBalance"),
  59 + @Mapping(source = "treeSpeciesType", target = "weight.treeSpeciesType"),
  60 + @Mapping(source = "treeSpeciesWeight", target = "weight.treeSpeciesWeight"),
  61 + @Mapping(source = "plantingYears", target = "weight.plantingYears"),
  62 + @Mapping(source = "plantingYearsWeight", target = "weight.plantingYearsWeight"),
  63 + @Mapping(source = "isWindCorridor", target = "weight.isWindCorridor"),
  64 + @Mapping(source = "windCorridorWeight", target = "weight.windCorridorWeight"),
  65 + @Mapping(source = "treePoolType", target = "weight.treePoolType"),
  66 + @Mapping(source = "treePoolWeight", target = "weight.treePoolWeight"),
  67 + @Mapping(source = "treePoolWidthDbhRatio", target = "weight.treePoolWidthDbhRatio"),
  68 + @Mapping(source = "treePoolRatioWeight", target = "weight.treePoolRatioWeight"),
  69 + @Mapping(source = "isEmergency", target = "result.isEmergency"),
  70 + @Mapping(source = "windPower", target = "result.windPower"),
  71 + @Mapping(source = "windPowerWeight", target = "result.windPowerWeight"),
  72 + @Mapping(source = "defectScore", target = "result.defectScore"),
  73 + @Mapping(source = "normalScore", target = "result.normalResult.score"),
  74 + @Mapping(source = "normalLevel", target = "result.normalResult.level"),
  75 + @Mapping(source = "emergencyScore", target = "result.emergencyResult.score"),
  76 + @Mapping(source = "emergencyLevel", target = "result.emergencyResult.level"),
  77 + @Mapping(source = "photos", target = "status.photos")
  78 + })
  79 + TreeInspectionRespVO convert(TreeInspectionDO bean);
  80 +
  81 +
  82 + List<TreeInspectionRespVO> convertList(List<TreeInspectionDO> list);
  83 +
  84 +}
... ...
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/dataobject/treeinspection/TreeInspectionDO.java 0 → 100644
  1 +package com.zteits.urbanops.module.garden.dal.dataobject.treeinspection;
  2 +
  3 +import lombok.*;
  4 +import java.time.LocalDateTime;
  5 +import java.util.List;
  6 +import com.baomidou.mybatisplus.annotation.*;
  7 +import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
  8 +import com.zteits.urbanops.framework.tenant.core.db.TenantBaseDO;
  9 +
  10 +/**
  11 + * 行道树巡检与安全风险评估记录 DO
  12 + *
  13 + * @author Antigravity
  14 + */
  15 +@TableName(value = "garden_tree_inspection", autoResultMap = true)
  16 +@KeySequence("garden_tree_inspection_seq")
  17 +@Data
  18 +@EqualsAndHashCode(callSuper = true)
  19 +@ToString(callSuper = true)
  20 +@Builder
  21 +@NoArgsConstructor
  22 +@AllArgsConstructor
  23 +public class TreeInspectionDO extends TenantBaseDO {
  24 +
  25 + /**
  26 + * 主键
  27 + */
  28 + @TableId(type = IdType.AUTO)
  29 + private Long id;
  30 +
  31 + /**
  32 + * 一树一档案ID
  33 + */
  34 + private Long treeId;
  35 +
  36 + /**
  37 + * 树木编号
  38 + */
  39 + private String treenumber;
  40 +
  41 + /**
  42 + * 巡检时间
  43 + */
  44 + private LocalDateTime inspectionTime;
  45 +
  46 + /**
  47 + * 巡检人ID
  48 + */
  49 + private Long inspectorId;
  50 +
  51 + /**
  52 + * 巡检人姓名
  53 + */
  54 + private String inspectorName;
  55 +
  56 + /**
  57 + * 部门ID
  58 + */
  59 + private Long deptId;
  60 +
  61 + // ========== 缺陷评估指标得分 ==========
  62 +
  63 + /**
  64 + * 根部病害:0-无真菌危害或腐朽,8-存在真菌危害或腐朽
  65 + */
  66 + private Integer rootDisease;
  67 +
  68 + /**
  69 + * 根系下扎情况:0-良好,7-存在隆起或盘根
  70 + */
  71 + private Integer rootAnchorage;
  72 +
  73 + /**
  74 + * 工程切根:0-无,5-存在
  75 + */
  76 + private Integer rootCutting;
  77 +
  78 + /**
  79 + * 根颈木质部受损:0-无,5-<10%, 15-10%-30%, 25-30%-50%, 70->=50%
  80 + */
  81 + private Integer collarWoodDamage;
  82 +
  83 + /**
  84 + * 根颈树皮受损:0-<10%, 2-10%-30%, 4-30%-50%, 6->=50%
  85 + */
  86 + private Integer collarBarkDamage;
  87 +
  88 + /**
  89 + * 根颈松动:0-不存在,100-存在
  90 + */
  91 + private Integer collarLoosening;
  92 +
  93 + /**
  94 + * 主干木质部受损:0-无,5-<10%, 12-10%-30%, 20-30%-50%, 70->=50%
  95 + */
  96 + private Integer trunkWoodDamage;
  97 +
  98 + /**
  99 + * 主干倾斜:0-<10度, 3-10-20度, 8-20-30度, 70->=30度
  100 + */
  101 + private Integer trunkTilt;
  102 +
  103 + /**
  104 + * 主干树皮受损:0-<10%, 1-10%-30%, 3-30%-50%, 5->=50%
  105 + */
  106 + private Integer trunkBarkDamage;
  107 +
  108 + /**
  109 + * 易落枝:0-未发现,2-<1/10, 3->=1/10
  110 + */
  111 + private Integer crownLooseBranch;
  112 +
  113 + /**
  114 + * 枝干结合部异常:0-无,3-龟裂卷皮,5-腐烂未成洞,70-明显空洞或蛀干痕迹
  115 + */
  116 + private Integer crownCollarAbnormal;
  117 +
  118 + /**
  119 + * 树冠透风及平衡性:0-较好不偏冠, 1-偏冠或透风差不偏冠, 2-透风差明显偏冠但冠幅适中, 5-透风差冠幅大不偏冠, 8-透风差冠幅大且明显偏冠
  120 + */
  121 + private Integer crownVentilationBalance;
  122 +
  123 + // ========== 权重因子指标值和赋权值 ==========
  124 +
  125 + /**
  126 + * 树种类型:深根性树种, 浅根性树种
  127 + */
  128 + private String treeSpeciesType;
  129 +
  130 + /**
  131 + * 树种类型权重:深根性-1.0, 浅根性-1.1
  132 + */
  133 + private Double treeSpeciesWeight;
  134 +
  135 + /**
  136 + * 栽植年限:栽植 10 年以内, 栽植 10-30 年, 栽植 30 年以上
  137 + */
  138 + private String plantingYears;
  139 +
  140 + /**
  141 + * 栽植年限权重:10年内-1.0, 10-30年-1.1, 30年以上-1.2
  142 + */
  143 + private Double plantingYearsWeight;
  144 +
  145 + /**
  146 + * 是否处于风口:0-否, 1-是
  147 + */
  148 + private Boolean isWindCorridor;
  149 +
  150 + /**
  151 + * 风口权重:否-1.0, 是-2.0
  152 + */
  153 + private Double windCorridorWeight;
  154 +
  155 + /**
  156 + * 树池类型:联通树池, 独立树池, 树池硬化
  157 + */
  158 + private String treePoolType;
  159 +
  160 + /**
  161 + * 树池类型权重:联通树池-1.0, 独立树池-1.2, 树池硬化-1.5
  162 + */
  163 + private Double treePoolWeight;
  164 +
  165 + /**
  166 + * 树池宽度与胸径比:7 倍及以上, 5 倍-7 倍, 3 倍-5 倍, 3 倍以下
  167 + */
  168 + private String treePoolWidthDbhRatio;
  169 +
  170 + /**
  171 + * 树池比权重:7倍及以上-1.0, 5-7倍-1.1, 3-5倍-1.2, 3倍以下-1.3
  172 + */
  173 + private Double treePoolRatioWeight;
  174 +
  175 + // ========== 应急评估及加权 ==========
  176 +
  177 + /**
  178 + * 是否进行应急评估:0-否, 1-是
  179 + */
  180 + private Boolean isEmergency;
  181 +
  182 + /**
  183 + * 应急评估极端天气风力:7 级及以下, 8-9 级, 10 级, 10 级以上
  184 + */
  185 + private String windPower;
  186 +
  187 + /**
  188 + * 风力权重:7级及以下-1.0, 8-9级-1.5, 10级-2.0, 10级以上-3.0
  189 + */
  190 + private Double windPowerWeight;
  191 +
  192 + // ========== 评估计算结果 ==========
  193 +
  194 + /**
  195 + * 树木缺陷得分
  196 + */
  197 + private Integer defectScore;
  198 +
  199 + /**
  200 + * 常规情况下安全风险得分
  201 + */
  202 + private Double normalScore;
  203 +
  204 + /**
  205 + * 常规情况下风险等级
  206 + */
  207 + private String normalLevel;
  208 +
  209 + /**
  210 + * 应急情况下安全风险得分
  211 + */
  212 + private Double emergencyScore;
  213 +
  214 + /**
  215 + * 应急情况下风险等级
  216 + */
  217 + private String emergencyLevel;
  218 +
  219 + // ========== 现状及处理措施 ==========
  220 +
  221 + /**
  222 + * 建议处置措施
  223 + */
  224 + private String treatmentSuggestion;
  225 +
  226 + /**
  227 + * 是否已处置:0-未处置, 1-已处置
  228 + */
  229 + private Boolean isTreated;
  230 +
  231 + /**
  232 + * 现场照片链接(JSON 数组)
  233 + */
  234 + @TableField(typeHandler = JacksonTypeHandler.class)
  235 + private List<String> photos;
  236 +
  237 + /**
  238 + * 评估单位(公司)
  239 + */
  240 + private String estimatorCompany;
  241 +
  242 + /**
  243 + * 评估人
  244 + */
  245 + private String estimator;
  246 +
  247 +
  248 +}
... ...
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/treeinspection/TreeInspectionMapper.java 0 → 100644
  1 +package com.zteits.urbanops.module.garden.dal.mysql.treeinspection;
  2 +
  3 +import com.zteits.urbanops.framework.common.pojo.PageResult;
  4 +import com.zteits.urbanops.framework.mybatis.core.query.LambdaQueryWrapperX;
  5 +import com.zteits.urbanops.framework.mybatis.core.mapper.BaseMapperX;
  6 +import com.zteits.urbanops.module.garden.dal.dataobject.treeinspection.TreeInspectionDO;
  7 +import com.zteits.urbanops.module.garden.controller.app.treeinspection.vo.TreeInspectionPageReqVO;
  8 +import org.apache.ibatis.annotations.Mapper;
  9 +
  10 +/**
  11 + * 行道树巡检与安全风险评估记录 Mapper
  12 + *
  13 + * @author Antigravity
  14 + */
  15 +@Mapper
  16 +public interface TreeInspectionMapper extends BaseMapperX<TreeInspectionDO> {
  17 +
  18 + default PageResult<TreeInspectionDO> selectPage(TreeInspectionPageReqVO reqVO) {
  19 + return selectPage(reqVO, new LambdaQueryWrapperX<TreeInspectionDO>()
  20 + .eqIfPresent(TreeInspectionDO::getTreeId, reqVO.getTreeId())
  21 + .orderByDesc(TreeInspectionDO::getInspectionTime)
  22 + .orderByDesc(TreeInspectionDO::getId)
  23 + );
  24 + }
  25 +
  26 +}
... ...
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/enums/ErrorCodeConstants.java
... ... @@ -151,4 +151,7 @@ public interface ErrorCodeConstants {
151 151 ErrorCode PROBLEM_TYPE_NOT_EXISTS = new ErrorCode(1100009000, "问题类型不存在");
152 152 ErrorCode PROBLEM_TYPE_CODE_EXISTS = new ErrorCode(1100009001, "问题类型编码已存在");
153 153  
  154 + // ========== 一树一档案巡检与风险评估 1-100-008-000 ==========
  155 + ErrorCode TREE_INSPECTION_NOT_EXISTS = new ErrorCode(1100008001, "巡检评估记录不存在");
  156 +
154 157 }
... ...
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/treeinspection/TreeInspectionService.java 0 → 100644
  1 +package com.zteits.urbanops.module.garden.service.treeinspection;
  2 +
  3 +import jakarta.validation.Valid;
  4 +import com.zteits.urbanops.framework.common.pojo.PageResult;
  5 +import com.zteits.urbanops.module.garden.dal.dataobject.treeinspection.TreeInspectionDO;
  6 +import com.zteits.urbanops.module.garden.controller.app.treeinspection.vo.*;
  7 +
  8 +/**
  9 + * 行道树巡检与安全风险评估业务 Service 接口
  10 + *
  11 + * @author Antigravity
  12 + */
  13 +public interface TreeInspectionService {
  14 +
  15 + /**
  16 + * 创建行道树巡检与评估记录
  17 + *
  18 + * @param createReqVO 创建信息
  19 + * @return 记录ID
  20 + */
  21 + Long createTreeInspection(@Valid TreeInspectionSaveReqVO createReqVO);
  22 +
  23 + /**
  24 + * 获得行道树巡检与评估详情
  25 + *
  26 + * @param id 编号
  27 + * @return 嵌套结构的详情 VO
  28 + */
  29 + TreeInspectionRespVO getTreeInspection(Long id);
  30 +
  31 + /**
  32 + * 分页查询单株树木的历史巡检记录
  33 + *
  34 + * @param pageReqVO 分页查询请求
  35 + * @return 巡检历史记录分页
  36 + */
  37 + PageResult<TreeInspectionDO> getTreeInspectionPage(TreeInspectionPageReqVO pageReqVO);
  38 +
  39 +}
... ...
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/treeinspection/TreeInspectionServiceImpl.java 0 → 100644
  1 +package com.zteits.urbanops.module.garden.service.treeinspection;
  2 +
  3 +import lombok.extern.slf4j.Slf4j;
  4 +import org.springframework.stereotype.Service;
  5 +import org.springframework.validation.annotation.Validated;
  6 +import org.springframework.transaction.annotation.Transactional;
  7 +import jakarta.annotation.Resource;
  8 +
  9 +import com.zteits.urbanops.framework.common.pojo.PageResult;
  10 +import com.zteits.urbanops.framework.common.exception.util.ServiceExceptionUtil;
  11 +import com.zteits.urbanops.framework.security.core.util.SecurityFrameworkUtils;
  12 +import com.zteits.urbanops.module.garden.dal.dataobject.treeinspection.TreeInspectionDO;
  13 +import com.zteits.urbanops.module.garden.dal.dataobject.tree.TreeDO;
  14 +import com.zteits.urbanops.module.garden.dal.mysql.treeinspection.TreeInspectionMapper;
  15 +import com.zteits.urbanops.module.garden.dal.mysql.tree.TreeMapper;
  16 +import com.zteits.urbanops.module.garden.enums.ErrorCodeConstants;
  17 +import com.zteits.urbanops.module.garden.controller.app.treeinspection.vo.*;
  18 +import com.zteits.urbanops.module.garden.convert.treeinspection.TreeInspectionConvert;
  19 +
  20 +/**
  21 + * 行道树巡检与安全风险评估业务 Service 实现类
  22 + *
  23 + * @author Antigravity
  24 + */
  25 +@Service
  26 +@Validated
  27 +@Slf4j
  28 +public class TreeInspectionServiceImpl implements TreeInspectionService {
  29 +
  30 + @Resource
  31 + private TreeInspectionMapper treeInspectionMapper;
  32 +
  33 + @Resource
  34 + private TreeMapper treeMapper;
  35 +
  36 + @Override
  37 + @Transactional(rollbackFor = Exception.class)
  38 + public Long createTreeInspection(TreeInspectionSaveReqVO createReqVO) {
  39 + // 1. 校验树木档案是否存在
  40 + TreeDO tree = treeMapper.selectById(createReqVO.getTreeId());
  41 + if (tree == null) {
  42 + throw ServiceExceptionUtil.exception(ErrorCodeConstants.TREE_NOT_EXISTS);
  43 + }
  44 +
  45 + // 2. 转换数据并组装 DO 实体
  46 + TreeInspectionDO entity = TreeInspectionConvert.INSTANCE.convert(createReqVO);
  47 + entity.setTreenumber(tree.getTreenumber());
  48 +
  49 + // 3. 填充用户信息与部门信息
  50 + Long loginUserId = SecurityFrameworkUtils.getLoginUserId();
  51 + String nickname = SecurityFrameworkUtils.getLoginUserNickname();
  52 + Long deptId = SecurityFrameworkUtils.getLoginUserDeptId();
  53 +
  54 + entity.setInspectorId(loginUserId);
  55 + entity.setInspectorName(nickname != null ? nickname : "巡检员");
  56 + if (entity.getDeptId() == null) {
  57 + entity.setDeptId(deptId != null ? deptId : tree.getDeptId());
  58 + }
  59 +
  60 + // 4. 补齐各因子的权重指标(即使由前端打分,后端依然补齐数据库里各个细节因子权重以支持底层的统计与分析)
  61 + double treeSpeciesWeight = "浅根性树种".equals(entity.getTreeSpeciesType()) ? 1.1 : 1.0;
  62 + entity.setTreeSpeciesWeight(treeSpeciesWeight);
  63 +
  64 + double plantingYearsWeight = getPlantingYearsWeight(entity.getPlantingYears());
  65 + entity.setPlantingYearsWeight(plantingYearsWeight);
  66 +
  67 + double windCorridorWeight = Boolean.TRUE.equals(entity.getIsWindCorridor()) ? 2.0 : 1.0;
  68 + entity.setWindCorridorWeight(windCorridorWeight);
  69 +
  70 + double treePoolWeight = getTreePoolWeight(entity.getTreePoolType());
  71 + entity.setTreePoolWeight(treePoolWeight);
  72 +
  73 + double treePoolRatioWeight = getTreePoolRatioWeight(entity.getTreePoolWidthDbhRatio());
  74 + entity.setTreePoolRatioWeight(treePoolRatioWeight);
  75 +
  76 + if (Boolean.TRUE.equals(entity.getIsEmergency())) {
  77 + double windPowerWeight = getWindPowerWeight(entity.getWindPower());
  78 + entity.setWindPowerWeight(windPowerWeight);
  79 + } else {
  80 + entity.setWindPowerWeight(1.0);
  81 + }
  82 +
  83 + // 5. 风险打分计算(前端计算结果存储优先,后端自动补齐防空兜底)
  84 + if (entity.getDefectScore() == null
  85 + || entity.getNormalScore() == null
  86 + || entity.getNormalLevel() == null) {
  87 +
  88 + // 后端兜底自动缺陷打分
  89 + int calculatedSum = entity.getRootDisease()
  90 + + entity.getRootAnchorage()
  91 + + entity.getRootCutting()
  92 + + entity.getCollarWoodDamage()
  93 + + entity.getCollarBarkDamage()
  94 + + entity.getCollarLoosening()
  95 + + entity.getTrunkWoodDamage()
  96 + + entity.getTrunkTilt()
  97 + + entity.getTrunkBarkDamage()
  98 + + entity.getCrownLooseBranch()
  99 + + entity.getCrownCollarAbnormal()
  100 + + entity.getCrownVentilationBalance();
  101 +
  102 + int defectScore = calculatedSum;
  103 + // 一票否决规则
  104 + if (entity.getCollarLoosening() == 100) {
  105 + defectScore = 100;
  106 + } else if (entity.getCollarWoodDamage() == 70
  107 + || entity.getTrunkWoodDamage() == 70
  108 + || entity.getTrunkTilt() == 70
  109 + || entity.getCrownCollarAbnormal() == 70) {
  110 + defectScore = Math.max(calculatedSum, 70);
  111 + }
  112 + entity.setDefectScore(defectScore);
  113 +
  114 + // 计算常规安全得分
  115 + double normalScore = defectScore * treeSpeciesWeight * plantingYearsWeight * windCorridorWeight * treePoolWeight * treePoolRatioWeight;
  116 + normalScore = Math.round(normalScore * 100.0) / 100.0;
  117 + entity.setNormalScore(normalScore);
  118 + entity.setNormalLevel(getRiskLevelName(normalScore));
  119 + }
  120 +
  121 + // 6. 应急打分补齐(若前端已计算则信任前端结果,否则后端自动补齐应急兜底)
  122 + if (Boolean.TRUE.equals(entity.getIsEmergency())) {
  123 + if (entity.getEmergencyScore() == null || entity.getEmergencyLevel() == null) {
  124 + double windPowerWeight = entity.getWindPowerWeight();
  125 + double emergencyScore = entity.getNormalScore() * windPowerWeight;
  126 + emergencyScore = Math.round(emergencyScore * 100.0) / 100.0;
  127 + entity.setEmergencyScore(emergencyScore);
  128 + entity.setEmergencyLevel(getRiskLevelName(emergencyScore));
  129 + }
  130 + } else {
  131 + entity.setEmergencyScore(null);
  132 + entity.setEmergencyLevel(null);
  133 + }
  134 +
  135 + // 7. 保存到数据库
  136 + treeInspectionMapper.insert(entity);
  137 + return entity.getId();
  138 + }
  139 +
  140 + @Override
  141 + public TreeInspectionRespVO getTreeInspection(Long id) {
  142 + TreeInspectionDO entity = treeInspectionMapper.selectById(id);
  143 + if (entity == null) {
  144 + throw ServiceExceptionUtil.exception(ErrorCodeConstants.TREE_INSPECTION_NOT_EXISTS);
  145 + }
  146 + return TreeInspectionConvert.INSTANCE.convert(entity);
  147 + }
  148 +
  149 + @Override
  150 + public PageResult<TreeInspectionDO> getTreeInspectionPage(TreeInspectionPageReqVO pageReqVO) {
  151 + return treeInspectionMapper.selectPage(pageReqVO);
  152 + }
  153 +
  154 + // ========== 权重因子规则辅助类 ==========
  155 +
  156 + private double getPlantingYearsWeight(String years) {
  157 + if (years == null) return 1.0;
  158 + if (years.contains("30年")) return 1.2;
  159 + if (years.contains("10-30")) return 1.1;
  160 + if (years.contains("10年")) return 1.0;
  161 + return 1.0;
  162 + }
  163 +
  164 + private double getTreePoolWeight(String type) {
  165 + if (type == null) return 1.0;
  166 + if (type.contains("硬化")) return 1.5;
  167 + if (type.contains("独立")) return 1.2;
  168 + if (type.contains("联通")) return 1.0;
  169 + return 1.0;
  170 + }
  171 +
  172 + private double getTreePoolRatioWeight(String ratio) {
  173 + if (ratio == null) return 1.0;
  174 + if (ratio.contains("3倍以下") || ratio.contains("3 倍以下") || ratio.contains("小于3")) {
  175 + return 1.3;
  176 + }
  177 + if (ratio.contains("3-5") || ratio.contains("3至5") || ratio.contains("3倍") || ratio.contains("3 倍")) {
  178 + return 1.2;
  179 + }
  180 + if (ratio.contains("5-7") || ratio.contains("5至7") || ratio.contains("5倍") || ratio.contains("5 倍")) {
  181 + return 1.1;
  182 + }
  183 + if (ratio.contains("7倍") || ratio.contains("7 倍") || ratio.contains("大于7")) {
  184 + return 1.0;
  185 + }
  186 + return 1.0;
  187 + }
  188 +
  189 + private double getWindPowerWeight(String power) {
  190 + if (power == null) return 1.0;
  191 + if (power.contains("10级以上") || power.contains("10 级以上")) return 3.0;
  192 + if (power.contains("10级") || power.contains("10 级")) return 2.0;
  193 + if (power.contains("8-9")) return 1.5;
  194 + if (power.contains("7级") || power.contains("7 级")) return 1.0;
  195 + return 1.0;
  196 + }
  197 +
  198 + private String getRiskLevelName(double score) {
  199 + if (score < 10.0) {
  200 + return "I级 (基本无风险)";
  201 + } else if (score < 30.0) {
  202 + return "II级 (轻度风险)";
  203 + } else if (score < 70.0) {
  204 + return "III级 (中度风险)";
  205 + } else if (score < 100.0) {
  206 + return "IV级 (重度风险)";
  207 + } else {
  208 + return "V级 (极度风险)";
  209 + }
  210 + }
  211 +
  212 +}
... ...
urbanops-module-garden/src/test/java/com/zteits/urbanops/module/garden/service/treeinspection/TreeInspectionServiceImplTest.java 0 → 100644
  1 +package com.zteits.urbanops.module.garden.service.treeinspection;
  2 +
  3 +import org.junit.jupiter.api.Test;
  4 +import org.mockito.InjectMocks;
  5 +import org.mockito.Mock;
  6 +import java.time.LocalDateTime;
  7 +import java.util.Collections;
  8 +
  9 +import com.zteits.urbanops.framework.common.pojo.PageResult;
  10 +import com.zteits.urbanops.framework.test.core.ut.BaseMockitoUnitTest;
  11 +import com.zteits.urbanops.module.garden.dal.dataobject.treeinspection.TreeInspectionDO;
  12 +import com.zteits.urbanops.module.garden.dal.dataobject.tree.TreeDO;
  13 +import com.zteits.urbanops.module.garden.dal.mysql.treeinspection.TreeInspectionMapper;
  14 +import com.zteits.urbanops.module.garden.dal.mysql.tree.TreeMapper;
  15 +import com.zteits.urbanops.module.garden.controller.app.treeinspection.vo.*;
  16 +import com.zteits.urbanops.module.garden.enums.ErrorCodeConstants;
  17 +
  18 +import static com.zteits.urbanops.framework.test.core.util.AssertUtils.assertServiceException;
  19 +import static com.zteits.urbanops.framework.test.core.util.RandomUtils.randomLongId;
  20 +import static org.junit.jupiter.api.Assertions.*;
  21 +import static org.mockito.ArgumentMatchers.any;
  22 +import static org.mockito.Mockito.*;
  23 +
  24 +public class TreeInspectionServiceImplTest extends BaseMockitoUnitTest {
  25 +
  26 + @InjectMocks
  27 + private TreeInspectionServiceImpl treeInspectionService;
  28 +
  29 + @Mock
  30 + private TreeInspectionMapper treeInspectionMapper;
  31 +
  32 + @Mock
  33 + private TreeMapper treeMapper;
  34 +
  35 + private TreeInspectionSaveReqVO createReqVOBase() {
  36 + TreeInspectionSaveReqVO req = new TreeInspectionSaveReqVO();
  37 + req.setTreeId(1024L);
  38 + req.setInspectionTime(LocalDateTime.now());
  39 +
  40 + // 树根
  41 + TreeInspectionSaveReqVO.RootDTO root = new TreeInspectionSaveReqVO.RootDTO();
  42 + root.setDisease(0);
  43 + root.setAnchorage(0);
  44 + root.setCutting(0);
  45 + req.setRoot(root);
  46 +
  47 + // 根颈
  48 + TreeInspectionSaveReqVO.CollarDTO collar = new TreeInspectionSaveReqVO.CollarDTO();
  49 + collar.setWoodDamage(5); // 扣 5 分
  50 + collar.setBarkDamage(0);
  51 + collar.setLoosening(0);
  52 + req.setCollar(collar);
  53 +
  54 + // 主干
  55 + TreeInspectionSaveReqVO.TrunkDTO trunk = new TreeInspectionSaveReqVO.TrunkDTO();
  56 + trunk.setWoodDamage(0);
  57 + trunk.setTilt(3); // 扣 3 分
  58 + trunk.setBarkDamage(0);
  59 + req.setTrunk(trunk);
  60 +
  61 + // 树冠
  62 + TreeInspectionSaveReqVO.CrownDTO crown = new TreeInspectionSaveReqVO.CrownDTO();
  63 + crown.setLooseBranch(0);
  64 + crown.setCollarAbnormal(0);
  65 + crown.setVentilationBalance(1); // 扣 1 分
  66 + req.setCrown(crown);
  67 +
  68 + // 权重
  69 + TreeInspectionSaveReqVO.WeightDTO weight = new TreeInspectionSaveReqVO.WeightDTO();
  70 + weight.setTreeSpeciesType("深根性树种"); // 1.0
  71 + weight.setPlantingYears("栽植 10-30 年"); // 1.1
  72 + weight.setIsWindCorridor(false); // 1.0
  73 + weight.setTreePoolType("联通树池"); // 1.0
  74 + weight.setTreePoolWidthDbhRatio("5 倍(含)-7 倍(不含)"); // 1.1
  75 + req.setWeight(weight);
  76 +
  77 + // 风险评估结果 (展开应急评估)
  78 + TreeInspectionSaveReqVO.ResultDTO result = new TreeInspectionSaveReqVO.ResultDTO();
  79 + result.setIsEmergency(true);
  80 + result.setWindPower("8-9 级"); // 1.5
  81 + req.setResult(result);
  82 +
  83 + // 现状及建议
  84 + TreeInspectionSaveReqVO.StatusDTO status = new TreeInspectionSaveReqVO.StatusDTO();
  85 + status.setPhotos(Collections.singletonList("http://example.com/tree.jpg"));
  86 + req.setStatus(status);
  87 +
  88 + return req;
  89 + }
  90 +
  91 + @Test
  92 + public void testCreateTreeInspection_success_normal() {
  93 + // 准备参数
  94 + TreeInspectionSaveReqVO req = createReqVOBase();
  95 + // 模拟一树一档案数据
  96 + TreeDO tree = new TreeDO();
  97 + tree.setId(1024L);
  98 + tree.setTreenumber("D0001-P1-0001");
  99 + tree.setDeptId(200L);
  100 + when(treeMapper.selectById(eq(1024L))).thenReturn(tree);
  101 +
  102 + // 调用
  103 + Long resultId = treeInspectionService.createTreeInspection(req);
  104 +
  105 + // 验证数据库插入
  106 + verify(treeInspectionMapper, times(1)).insert(argThat((TreeInspectionDO entity) -> {
  107 + assertNotNull(entity);
  108 + assertEquals("D0001-P1-0001", entity.getTreenumber());
  109 + assertEquals(1024L, entity.getTreeId());
  110 + // 基础累加得分: collar.woodDamage (5) + trunk.tilt (3) + crown.ventilationBalance (1) = 9 分
  111 + assertEquals(9, entity.getDefectScore());
  112 + // 权重乘积: 9 * 1.0 (深根) * 1.1 (10-30年) * 1.0 (非风口) * 1.0 (联通树池) * 1.1 (5-7倍比) = 10.89 分
  113 + assertEquals(10.89, entity.getNormalScore());
  114 + assertEquals("II级 (轻度风险)", entity.getNormalLevel());
  115 + // 应急乘积 (isEmergency = true, windPower = 8-9级 即 1.5): 10.89 * 1.5 = 16.34 分
  116 + assertEquals(16.34, entity.getEmergencyScore());
  117 + assertEquals("II级 (轻度风险)", entity.getEmergencyLevel());
  118 + assertEquals(1, entity.getPhotos().size());
  119 + assertEquals("http://example.com/tree.jpg", entity.getPhotos().get(0));
  120 + return true;
  121 + }));
  122 + }
  123 +
  124 + @Test
  125 + public void testCreateTreeInspection_success_oneVoteVetoLoosening() {
  126 + // 根颈松动一票否决 -> 直接归为 V级极度风险
  127 + TreeInspectionSaveReqVO req = createReqVOBase();
  128 + req.getCollar().setLoosening(100); // 存在根颈松动
  129 +
  130 + TreeDO tree = new TreeDO();
  131 + tree.setId(1024L);
  132 + tree.setTreenumber("D0001-P1-0001");
  133 + when(treeMapper.selectById(eq(1024L))).thenReturn(tree);
  134 +
  135 + treeInspectionService.createTreeInspection(req);
  136 +
  137 + verify(treeInspectionMapper, times(1)).insert(argThat((TreeInspectionDO entity) -> {
  138 + assertEquals(100, entity.getDefectScore());
  139 + // 权重乘积: 100 * 1.0 * 1.1 * 1.0 * 1.0 * 1.1 = 121.0
  140 + assertEquals(121.0, entity.getNormalScore());
  141 + assertEquals("V级 (极度风险)", entity.getNormalLevel());
  142 + return true;
  143 + }));
  144 + }
  145 +
  146 + @Test
  147 + public void testCreateTreeInspection_success_oneVoteVetoTilt() {
  148 + // 主干倾斜>=30度一票否决 -> 缺陷分基准为 70,归为 IV级重度风险及以上
  149 + TreeInspectionSaveReqVO req = createReqVOBase();
  150 + req.getTrunk().setTilt(70); // 主干倾斜度>=30度
  151 +
  152 + TreeDO tree = new TreeDO();
  153 + tree.setId(1024L);
  154 + tree.setTreenumber("D0001-P1-0001");
  155 + when(treeMapper.selectById(eq(1024L))).thenReturn(tree);
  156 +
  157 + treeInspectionService.createTreeInspection(req);
  158 +
  159 + verify(treeInspectionMapper, times(1)).insert(argThat((TreeInspectionDO entity) -> {
  160 + // 70 (一票否决) + 5 (collar) + 1 (crown) = 76 分
  161 + assertEquals(76, entity.getDefectScore());
  162 + // 权重乘积: 76 * 1.0 * 1.1 * 1.0 * 1.0 * 1.1 = 91.96
  163 + assertEquals(91.96, entity.getNormalScore());
  164 + assertEquals("IV级 (重度风险)", entity.getNormalLevel());
  165 + return true;
  166 + }));
  167 + }
  168 +
  169 + @Test
  170 + public void testCreateTreeInspection_treeNotExists() {
  171 + TreeInspectionSaveReqVO req = createReqVOBase();
  172 + when(treeMapper.selectById(eq(1024L))).thenReturn(null);
  173 +
  174 + assertServiceException(() -> treeInspectionService.createTreeInspection(req),
  175 + ErrorCodeConstants.TREE_NOT_EXISTS);
  176 + }
  177 +
  178 + @Test
  179 + public void testGetTreeInspection_success() {
  180 + Long id = randomLongId();
  181 + LocalDateTime now = LocalDateTime.now();
  182 + TreeInspectionDO entity = new TreeInspectionDO();
  183 + entity.setId(id);
  184 + entity.setTreeId(1024L);
  185 + entity.setTreenumber("D0001-P1-0001");
  186 + entity.setInspectionTime(now);
  187 + entity.setRootDisease(0);
  188 + entity.setRootAnchorage(0);
  189 + entity.setRootCutting(0);
  190 + entity.setCollarWoodDamage(5);
  191 + entity.setCollarBarkDamage(0);
  192 + entity.setCollarLoosening(0);
  193 + entity.setTrunkWoodDamage(0);
  194 + entity.setTrunkTilt(3);
  195 + entity.setTrunkBarkDamage(0);
  196 + entity.setCrownLooseBranch(0);
  197 + entity.setCrownCollarAbnormal(0);
  198 + entity.setCrownVentilationBalance(1);
  199 + entity.setTreeSpeciesType("深根性树种");
  200 + entity.setTreeSpeciesWeight(1.0);
  201 + entity.setPlantingYears("栽植 10-30 年");
  202 + entity.setPlantingYearsWeight(1.1);
  203 + entity.setIsWindCorridor(false);
  204 + entity.setWindCorridorWeight(1.0);
  205 + entity.setTreePoolType("联通树池");
  206 + entity.setTreePoolWeight(1.0);
  207 + entity.setTreePoolWidthDbhRatio("5 倍(含)-7 倍(不含)");
  208 + entity.setTreePoolRatioWeight(1.1);
  209 + entity.setIsEmergency(true);
  210 + entity.setWindPower("8-9 级");
  211 + entity.setWindPowerWeight(1.5);
  212 + entity.setDefectScore(9);
  213 + entity.setNormalScore(10.89);
  214 + entity.setNormalLevel("II级 (轻度风险)");
  215 + entity.setEmergencyScore(16.34);
  216 + entity.setEmergencyLevel("II级 (轻度风险)");
  217 + entity.setPhotos(Collections.singletonList("http://example.com/tree.jpg"));
  218 +
  219 + when(treeInspectionMapper.selectById(eq(id))).thenReturn(entity);
  220 +
  221 + TreeInspectionRespVO resp = treeInspectionService.getTreeInspection(id);
  222 +
  223 + assertNotNull(resp);
  224 + assertEquals(id, resp.getId());
  225 + assertEquals("D0001-P1-0001", resp.getTreenumber());
  226 + assertEquals(now, resp.getInspectionTime());
  227 + assertEquals(5, resp.getCollar().getWoodDamage());
  228 + assertEquals(3, resp.getTrunk().getTilt());
  229 + assertEquals(1, resp.getCrown().getVentilationBalance());
  230 + assertEquals(1.1, resp.getWeight().getPlantingYearsWeight());
  231 + assertEquals(1.5, resp.getResult().getWindPowerWeight());
  232 + assertEquals(10.89, resp.getResult().getNormalResult().getScore());
  233 + assertEquals("II级 (轻度风险)", resp.getResult().getNormalResult().getLevel());
  234 + assertEquals(1, resp.getStatus().getPhotos().size());
  235 + }
  236 +
  237 + @Test
  238 + public void testGetTreeInspection_notExists() {
  239 + Long id = randomLongId();
  240 + when(treeInspectionMapper.selectById(eq(id))).thenReturn(null);
  241 +
  242 + assertServiceException(() -> treeInspectionService.getTreeInspection(id),
  243 + ErrorCodeConstants.TREE_INSPECTION_NOT_EXISTS);
  244 + }
  245 +
  246 +}
... ...
北京市行道树安全风险评估指南 2024.11.15.pdf 0 → 100644
No preview for this file type