riku
2025-08-28 3bb4fb15c664d29d179083698fdad35a661b1d7f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
//package com.flightfeather.uav.biz.report
//
//import com.flightfeather.uav.common.file.Docx4jGenerator
//import com.flightfeather.uav.common.utils.DateUtil
//import com.flightfeather.uav.common.utils.ObjToMapUtil
//import com.flightfeather.uav.lightshare.bean.AreaVo
//import org.springframework.stereotype.Component
//import java.time.LocalDateTime
//import java.time.format.DateTimeFormatter
//import java.util.*
//
///**
// * 走航季度报告
// * @date 2025/8/28 10:02
// * @author feiyu
// */
//@Component
//class UnderwaySeasonReport {
//
//    fun generate() {
//        // 准备数据模型
//        val summary = MissionSummary.Summary(
//            time = "2025年第三季度(7-9月)",
//            area = AreaVo().apply {
//                // 固定行政区划信息
//                provinceCode = "31"
//                provinceName = "上海市"
//                cityCode = "310100"
//                cityName = "上海市"
//                districtCode = "310101"
//                districtName = "黄浦区"
//                townCode = "310101001"
//                townName = "外滩街道"
//                // 固定区域编码和名称
//                areaCode = "SH-HP-001"
//                area = "黄浦区走航监测区域"
//                // 固定管理公司信息
//                managementCompanyId = "MC001"
//                managementCompany = "上海环境监测有限公司"
//                // 固定场景类型ID
//                sceneTypeId = "ST001"
//            },
//            count = 34,
//            kilometres = 256.8,
//            regionList = listOf("工业园区A", "化工区B", "居民区C"),
//            countByDegree = listOf(
//                Triple("优", 15, 0.45),    // 优:15次,占比45%
//                Triple("良", 12, 0.36),    // 良:12次,占比36%
//                Triple("轻度污染", 5, 0.15),// 轻度污染:5次,占比15%
//                Triple("中度污染", 2, 0.04) // 中度污染:2次,占比4%
//            ),
//            probCount = 50,
//            highRiskSceneCount = 8,
//            probByFactor = listOf(
//                Triple("VOCs", 28, 0.56),  // VOCs:28次,占比56%
//                Triple("PM2.5", 12, 0.24), // PM2.5:12次,占比24%
//                Triple("NO2", 7, 0.14),    // NO2:7次,占比14%
//                Triple("SO2", 3, 0.06)     // SO2:3次,占比6%
//            )
//        )
//        val dataModel = ObjToMapUtil.objectToMap(summary)
//
//        // 生成Word文件
//        val timeStr = DateTimeFormatter.ofPattern("yyyyMMddHHmmss").format(LocalDateTime.now())
//        Docx4jGenerator.generate(
//            templatePath = "underway_season_report.docx",
//            outputPath = "E:/idea/underway-spring/src/main/resources/templates/mission_summary_${timeStr}.docx",
//            dataModel = dataModel
//        )
//
//    }
//}