feiyu02
2024-01-09 c1becf4cbd2e99601ce011c14b8742427249cfb4
1. 多项调整
已修改57个文件
已删除26个文件
已添加40个文件
已重命名2个文件
6369 ■■■■■ 文件已修改
pom.xml 45 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/business/AutoScore.kt 484 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/business/Info.kt 26 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/business/ScoreItem.kt 159 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/business/autooutput/AopTaskCtrl.kt 80 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/business/autooutput/dataanalysis/AopDataAnalysis.kt 54 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/business/autooutput/dataanalysis/JACsDataAnalysis.kt 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/business/autooutput/dataanalysis/JSCsDataAnalysis.kt 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/business/autooutput/dataanalysis/JSDustDataAnalysis.kt 142 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/business/autooutput/dataanalysis/JSMpDataAnalysis.kt 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/business/autooutput/dataanalysis/JSWhDataAnalysis.kt 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/business/autooutput/dataanalysis/XHFuDataAnalysis.kt 145 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/business/autooutput/datasource/AopDataConfig.kt 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/business/autooutput/datasource/AopDataSource.kt 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/business/autooutput/datasource/AopSceneTypeCheck.kt 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/business/autooutput/score/AopCreditCode.kt 46 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/business/autooutput/score/AopEvaluation.kt 46 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/business/autooutput/score/ScoreItem.kt 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/business/autooutput/score/ScoreUtil.kt 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/business/autooutput/score/construction/CsScoreItem1.kt 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/business/autooutput/score/construction/CsScoreItem2.kt 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/business/autooutput/score/mixingplant/MpScoreItem1.kt 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/business/autooutput/score/mixingplant/MpScoreItem2.kt 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/business/autooutput/score/restaurant/ReScoreItem10.kt 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/business/autooutput/score/restaurant/ReScoreItem11.kt 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/business/autooutput/score/restaurant/ReScoreItem5.kt 118 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/business/autooutput/score/restaurant/ReScoreItem5BackUp.kt 86 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/business/autooutput/score/restaurant/ReScoreItem7.kt 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/business/autooutput/score/restaurant/ReScoreItem8.kt 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/business/autooutput/score/restaurant/ReScoreItem9.kt 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/business/autooutput/score/storage/StScoreItem1.kt 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/business/autooutput/score/wharf/WhScoreItem1.kt 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/business/autooutput/score/wharf/WhScoreItem2.kt 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/business/fume/AutoScore3.kt 521 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/business/fume/item/ScoreItem_1.kt 61 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/business/fume/item/ScoreItem_10.kt 97 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/business/fume/item/ScoreItem_11.kt 56 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/business/fume/item/ScoreItem_2.kt 76 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/business/fume/item/ScoreItem_3.kt 73 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/business/fume/item/ScoreItem_4.kt 85 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/business/fume/item/ScoreItem_5.kt 94 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/business/fume/item/ScoreItem_6.kt 49 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/business/fume/item/ScoreItem_7.kt 87 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/business/fume/item/ScoreItem_8.kt 108 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/business/fume/item/ScoreItem_9.kt 85 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/business/fume/package-info.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/business/report/DataSource.kt 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/business/report/cols/ColStatus.kt 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/business/report/cols/ColTotalGrade.kt 24 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/business/report/template/ProAnalysisSummary.kt 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/business/report/template/ProTypeRankMainSummary.kt 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/business/report/template/ProTypeStatusSummary.kt 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/business/storage/JinAnScore.kt 62 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/business/storage/StAutoScore.kt 531 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/business/storage/item/CsScoreItem_1.kt 57 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/business/storage/item/CsScoreItem_2.kt 67 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/business/storage/item/MpScoreItem_1.kt 57 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/business/storage/item/MpScoreItem_2.kt 67 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/business/storage/item/StScoreItem_1.kt 57 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/business/storage/item/WhScoreItem_1.kt 57 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/business/storage/item/WhScoreItem_2.kt 67 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/business/storage/package-info.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/common/executor/BackgroundTaskCtrl.kt 126 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/common/executor/BgTask.kt 50 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/common/executor/BgTaskConditionVo.kt 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/common/executor/BgTaskStatus.kt 56 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/common/executor/BgTaskType.kt 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/common/utils/Constant.kt 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/config/Swagger2Configuration.kt 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/domain/ds1/entity/Evaluationrule.kt 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/domain/ds1/mapper/EvaluationMapper.kt 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/domain/ds1/repository/EvaluationRep.kt 43 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/domain/ds1/repository/EvaluationRuleRep.kt 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/domain/ds1/repository/TaskRep.kt 38 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/domain/ds2/entity/OverallEvaluation.java 211 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/domain/ds2/mapper/OverallEvaluationMapper.kt 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/domain/ds2/repository/OverallEvaluationRep.kt 60 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/domain/ds2/repository/UserInfoTZRep.kt 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/domain/ds2/repository/UserMapRep.kt 38 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/domain/ds3/entity/FumeSiteMap.java 144 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/domain/ds3/entity/JSDustData.java 139 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/domain/ds3/entity/JSDustSiteMap.java 144 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/domain/ds3/enum/JSSceneType.kt 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/domain/ds3/mapper/FumeSiteMapMapper.kt 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/domain/ds3/mapper/JSDustDataMapper.kt 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/domain/ds3/mapper/JSDustSiteMapMapper.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/BgTaskService.kt 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/EvaluationService.kt 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/EvaluationruleService.kt 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/TaskService.kt 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/BgTaskServiceImpl.kt 54 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/DomainitemServiceImpl.kt 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/EvaluationServiceImpl.kt 50 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/EvaluationruleServiceImpl.kt 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/InspectionServiceImpl.kt 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/LedgerServiceImpl.kt 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/ScenseServiceImpl.kt 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/SearchServiceImpl.kt 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/SubtaskServiceImpl.kt 32 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/TaskServiceImpl.kt 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/AreaEvaVo.kt 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/AreaVo.kt 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/AutoScoreResultVo.kt 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/BaseResponse.kt 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/lightshare/web/BaseResPack.kt 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/lightshare/web/BgTaskController.kt 37 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/lightshare/web/EvaluationController.kt 35 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/lightshare/web/EvaluationruleController.kt 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/lightshare/web/TaskController.kt 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/application-dev.yml 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/application-pro.yml 17 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/application-test.yml 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/application.yml 40 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/generator/generatorConfig4ds1.xml 29 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/generator/generatorConfig4ds3.xml 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/log4j2.xml 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/ds1/EvaluationMapper.xml 92 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/ds2/OverallEvaluationMapper.xml 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/ds3/FumeSiteMapMapper.xml 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/ds3/JSDustDataMapper.xml 44 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/ds3/JSDustSiteMapMapper.xml 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/test/kotlin/cn/flightfeather/supervision/business/QRCodeTest.kt 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/test/kotlin/cn/flightfeather/supervision/business/autooutput/AopEvaluationTest.kt 106 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/test/kotlin/cn/flightfeather/supervision/business/fume/AutoScoreTest.kt 59 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/test/kotlin/cn/flightfeather/supervision/business/location/LocationRoadNearbyTest.kt 44 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pom.xml
@@ -28,6 +28,7 @@
        <!-- tk.mybatis -->
        <mapper.plugin>tk.mybatis.mapper.generator.MapperPlugin</mapper.plugin>
        <mapper.Mapper>tk.mybatis.mapper.common.Mapper</mapper.Mapper>
        <resource.delimiters>@</resource.delimiters>
    </properties>
    <dependencies>
@@ -419,6 +420,7 @@
                <artifactId>mybatis-generator-maven-plugin</artifactId>
                <version>1.3.2</version>
                <configuration>
<!--                    <configurationFile>src/main/resources/generator/generatorConfig4ds1.xml</configurationFile>-->
                    <configurationFile>src/main/resources/generator/generatorConfig4ds3.xml</configurationFile>
                    <overwrite>true</overwrite>
                    <verbose>true</verbose>
@@ -432,26 +434,34 @@
                    </dependency>
                </dependencies>
            </plugin>
<!--            <plugin>-->
<!--                <groupId>org.apache.maven.plugins</groupId>-->
<!--                <artifactId>maven-resources-plugin</artifactId>-->
<!--                <configuration>-->
<!--                    <delimiters>@</delimiters>-->
<!--                    <useDefaultDelimiters>false</useDefaultDelimiters>-->
<!--                </configuration>-->
<!--            </plugin>-->
        </plugins>
        <resources>
            <resource>
                <filtering>true</filtering>
                <directory>src/main/resources</directory>
                <excludes>
                    <exclude>application-dev.yml</exclude>
                    <exclude>application-pro.yml</exclude>
                    <exclude>application.yml</exclude>
                </excludes>
<!--                <excludes>-->
<!--                    <exclude>application-dev.yml</exclude>-->
<!--                    <exclude>application-pro.yml</exclude>-->
<!--                    <exclude>application.yml</exclude>-->
<!--                </excludes>-->
            </resource>
            <resource>
                <filtering>true</filtering>
                <directory>src/main/resources</directory>
                <includes>
                    <include>application-${profileActive}.yml</include>
                    <include>application.yml</include>
                </includes>
            </resource>
<!--            <resource>-->
<!--                <filtering>true</filtering>-->
<!--                <directory>src/main/resources</directory>-->
<!--                <includes>-->
<!--                    <include>application-${profileActive}.yml</include>-->
<!--                    <include>application.yml</include>-->
<!--                </includes>-->
<!--            </resource>-->
        </resources>
    </build>
@@ -470,9 +480,12 @@
            <properties>
                <profileActive>pro</profileActive>
            </properties>
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>
        </profile>
        <profile>
            <id>test</id>
            <properties>
                <profileActive>test</profileActive>
            </properties>
        </profile>
    </profiles>
src/main/kotlin/cn/flightfeather/supervision/business/AutoScore.kt
ÎļþÒÑɾ³ý
src/main/kotlin/cn/flightfeather/supervision/business/Info.kt
@@ -7,20 +7,20 @@
data class Info(
        //场景用户id
        val userId: String?,
    val userId: String?,
        //飞羽环境中场景对应的用户id
        val tzUserId: String?,
    val tzUserId: String?,
        //场景id
        val sceneId: String?,
    val sceneId: String?,
        //场景名称
        val sceneName: String?,
        var sceneType: Constant.ScenseType,
        var year: Int? = null,
        val month: Int? = null,
        val period: Int? = null,
        val sTime: LocalDateTime? = null,
        val eTime: LocalDateTime? = null,
        val subTask: Subtask? = null,
        val sceneIndex: Int? = null,
        val online:Boolean = true
    val sceneName: String?,
    var sceneType: Constant.SceneType,
    var year: Int? = null,
    val month: Int? = null,
    val period: Int? = null,
    val sTime: LocalDateTime? = null,
    val eTime: LocalDateTime? = null,
    val subTask: Subtask? = null,
    val sceneIndex: Int? = null,
    val online:Boolean = true
)
src/main/kotlin/cn/flightfeather/supervision/business/ScoreItem.kt
ÎļþÒÑɾ³ý
src/main/kotlin/cn/flightfeather/supervision/business/autooutput/AopTaskCtrl.kt
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,80 @@
package cn.flightfeather.supervision.business.autooutput
import cn.flightfeather.supervision.business.autooutput.dataanalysis.*
import cn.flightfeather.supervision.business.autooutput.datasource.AopDataConfig
import cn.flightfeather.supervision.business.autooutput.score.AopCreditCode
import cn.flightfeather.supervision.business.autooutput.score.AopEvaluation
import cn.flightfeather.supervision.common.executor.BackgroundTaskCtrl
import cn.flightfeather.supervision.common.executor.BgTaskStatus
import cn.flightfeather.supervision.common.executor.BgTaskType
import cn.flightfeather.supervision.common.utils.Constant
import cn.flightfeather.supervision.domain.ds1.repository.TaskRep
import cn.flightfeather.supervision.lightshare.vo.AreaVo
import org.springframework.stereotype.Component
import java.time.LocalDate
/**
 * è‡ªåŠ¨è¯„ä¼°ä»»åŠ¡ç®¡ç†
 */
@Component
class AopTaskCtrl(
    private val aopEvaluation: AopEvaluation,
    private val aopCreditCode: AopCreditCode,
    private val jaCsDataAnalysis: JACsDataAnalysis,
    private val xhFuDataAnalysis: XHFuDataAnalysis,
    private val jsCsDataAnalysis: JSCsDataAnalysis,
    private val jsMpDataAnalysis: JSMpDataAnalysis,
    private val jsWhDataAnalysis: JSWhDataAnalysis,
    private val backgroundTaskCtrl: BackgroundTaskCtrl,
    private val taskRep: TaskRep,
) {
    private val dataAnalysisMap = mutableMapOf<String, MutableMap<Int, AopDataAnalysis<*>>>()
    init {
        listOf("310106", "310104", "310116").forEach { dataAnalysisMap[it] = mutableMapOf() }
        dataAnalysisMap["310106"]?.put(Constant.SceneType.TYPE1.value.toInt(), jaCsDataAnalysis)
        dataAnalysisMap["310104"]?.put(Constant.SceneType.TYPE5.value.toInt(), xhFuDataAnalysis)
        dataAnalysisMap["310116"]?.put(Constant.SceneType.TYPE1.value.toInt(), jsCsDataAnalysis)
        dataAnalysisMap["310116"]?.put(Constant.SceneType.TYPE2.value.toInt(), jsWhDataAnalysis)
        dataAnalysisMap["310116"]?.put(Constant.SceneType.TYPE3.value.toInt(), jsMpDataAnalysis)
    }
    fun startNewTask(areaVo: AreaVo): BgTaskStatus {
        val task = taskRep.findOneTask(areaVo)
        val taskId = task?.tguid
        if (taskId != null) {
            val districtCode = areaVo.districtcode
            val districtName = areaVo.districtname
            val d = LocalDate.parse(areaVo.starttime)
            val year = d.year
            val month = d.monthValue
            val sceneType = areaVo.scensetypeid?.toInt() ?: throw IllegalStateException("场景类型未设置,无法评估")
            val id = "${BgTaskType.AUTO_SCORE.name}-${districtCode}-${sceneType}"
            val name = "${districtName}${Constant.SceneType.getDes(sceneType)}自动评分"
            val bgTask = backgroundTaskCtrl.startNewTask(BgTaskType.AUTO_SCORE, id, name) {
                dataAnalysis(districtCode, sceneType, taskId, year, month)
                aopEvaluation.executeByTopTask(taskId, sceneType)
                aopCreditCode.execute(AopDataConfig(
                    year = year,
                    month = month,
                    districtName = districtName,
                    sceneType = sceneType,
                    period = 1
                ))
                true
            }
            return bgTask.taskStatus
        } else {
            throw IllegalStateException("巡查总任务不存在,无法评估")
        }
    }
    private fun dataAnalysis(districtCode: String?, sceneType: Int, taskId: String, year: Int, month: Int) {
        val aopDataAnalysis = dataAnalysisMap[districtCode]?.get(sceneType)
        aopDataAnalysis?.setResource(taskId, sceneType, year, month)
        aopDataAnalysis?.execute()
    }
}
src/main/kotlin/cn/flightfeather/supervision/business/autooutput/dataanalysis/AopDataAnalysis.kt
ÎļþÃû´Ó src/main/kotlin/cn/flightfeather/supervision/business/autooutput/score/AopDataAnalysis.kt ÐÞ¸Ä
@@ -1,4 +1,4 @@
package cn.flightfeather.supervision.business.autooutput.score
package cn.flightfeather.supervision.business.autooutput.dataanalysis
import cn.flightfeather.supervision.business.autooutput.AopOutput
import cn.flightfeather.supervision.business.autooutput.datasource.AopDataConfig
@@ -22,13 +22,21 @@
) {
    /**
     * ç»Ÿè®¡ä¸­é—´å­˜å‚¨ç»“æž„
     * ç»Ÿè®¡æ•°æ® ä¸´æ—¶å­˜å‚¨ç»“æž„
     */
    inner class TempResult(
        var total: Double = .0,
        var count: Int = 0,
    ){
        fun avg(): Double {
        var avg: Double = -1.0
            get() {
                if (field == -1.0) {
                    field = avg()
                }
                return field
            }
        private fun avg(): Double {
            return if (count == 0) {
                .0
            } else {
@@ -53,25 +61,39 @@
    /**
     * æ‰§è¡Œç»Ÿè®¡é€»è¾‘
     */
    fun execute() {
        val dAvg = districtAvg(source)
    fun execute(avg: Double? = null) {
        //计算区均值
        val dAvg = avg ?: districtAvg(source)
        println("均值:${dAvg}")
        //循环处理每个场景
        source?.loop { _, evaluationScene ->
            //获取原始监测数据
            val dataList = fetchDataResources(evaluationScene)
            //计算统计结果
            val tempExceedTimes = TempResult()
            val tempAvg = TempResult()
            val tempMax = TempResult()
            val tempMin = TempResult()
            var tempExceedTimes = TempResult()
            var tempAvg = TempResult()
            var tempMax = TempResult()
            var tempMin = TempResult()
            dataList.forEach {
                it.forEach {t ->
                // ç›‘测点有多台设备时,每台设备单独统计,取均值最高的为统计结果
                val _tempExceedTimes = TempResult()
                val _tempAvg = TempResult()
                val _tempMax = TempResult()
                val _tempMin = TempResult()
                it.forEach { t ->
                    t?.let {
                        exceedTimes(t, tempExceedTimes)
                        avg(t, tempAvg)
                        max(t, tempMax)
                        min(t, tempMin)
                        exceedTimes(t, _tempExceedTimes)
                        avg(t, _tempAvg)
                        max(t, _tempMax)
                        min(t, _tempMin)
                    }
                }
                // ä¿ç•™å‡å€¼æœ€é«˜çš„一台设备
                if (_tempAvg.avg > tempAvg.avg) {
                    tempExceedTimes = _tempExceedTimes
                    tempAvg = _tempAvg
                    tempMax = _tempMax
                    tempMin = _tempMin
                }
            }
            val dustDataResult = DustDataResult().apply {
@@ -79,7 +101,7 @@
                drSceneName = evaluationScene.scene.value?.name
                drTime = source?.config?.startTime
                drExceedTimes = tempExceedTimes.count
                drAvg = tempAvg.avg()
                drAvg = tempAvg.avg
                drMax = tempMax.total
                drMin = tempMin.total
                drOverAvgPer = overAvgRate(drAvg, dAvg)
@@ -125,7 +147,7 @@
    /**
     * è¶…月均值百分比
     */
    abstract fun overAvgRate(avg: Double, dAvg: Double?): Double
    abstract fun overAvgRate(avg: Double, dAvg: Double?): Double?
    /**
     * æ•°æ®ä¸ªæ•°
src/main/kotlin/cn/flightfeather/supervision/business/autooutput/dataanalysis/JACsDataAnalysis.kt
ÎļþÃû´Ó src/main/kotlin/cn/flightfeather/supervision/business/autooutput/score/construction/JADataAnalysis.kt ÐÞ¸Ä
@@ -1,10 +1,9 @@
package cn.flightfeather.supervision.business.autooutput.score.construction
package cn.flightfeather.supervision.business.autooutput.dataanalysis
import cn.flightfeather.supervision.business.autooutput.AopOutput
import cn.flightfeather.supervision.business.autooutput.datasource.AopDataSource
import cn.flightfeather.supervision.business.autooutput.datasource.AopDbMapper
import cn.flightfeather.supervision.business.autooutput.datasource.AopSceneTypeCheck
import cn.flightfeather.supervision.business.autooutput.score.AopDataAnalysis
import cn.flightfeather.supervision.domain.ds2.entity.DustSiteMap
import cn.flightfeather.supervision.domain.ds2.entity.HourDustData
import cn.flightfeather.supervision.domain.ds2.mapper.DustSiteMapMapper
@@ -20,7 +19,7 @@
 * é™å®‰å·¥åœ°æ‰¬å°˜ç›‘测数据统计
 */
@Component
class JADataAnalysis(
class JACsDataAnalysis(
    aopDbMapper: AopDbMapper,
    aopSceneTypeCheck: AopSceneTypeCheck,
    aopOutput: AopOutput,
@@ -39,6 +38,7 @@
        var count = 0
        hourDustDataMapper.selectByExample(Example(HourDustData::class.java).apply {
            createCriteria().andBetween("lst", source?.config?.startTime, source?.config?.endTime)
                .andEqualTo("flag", "N")
        }).forEach {
            it?.dustvalue?.let { v ->
                total += v
@@ -116,11 +116,11 @@
        }
    }
    override fun overAvgRate(avg: Double, dAvg: Double?): Double {
    override fun overAvgRate(avg: Double, dAvg: Double?): Double? {
        return if (dAvg != null) {
            round(((avg - dAvg) / dAvg) * 1000) / 1000
        } else {
            .0
            null
        }
    }
src/main/kotlin/cn/flightfeather/supervision/business/autooutput/dataanalysis/JSCsDataAnalysis.kt
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,24 @@
package cn.flightfeather.supervision.business.autooutput.dataanalysis
import cn.flightfeather.supervision.business.autooutput.AopOutput
import cn.flightfeather.supervision.business.autooutput.datasource.AopDbMapper
import cn.flightfeather.supervision.business.autooutput.datasource.AopSceneTypeCheck
import cn.flightfeather.supervision.domain.ds3.enum.JSSceneType
import cn.flightfeather.supervision.domain.ds3.mapper.JSDustDataMapper
import cn.flightfeather.supervision.domain.ds3.mapper.JSDustSiteMapMapper
import org.springframework.stereotype.Component
/**
 * é‡‘山工地扬尘监测数据统计
 */
@Component
class JSCsDataAnalysis(
    aopDbMapper: AopDbMapper,
    aopSceneTypeCheck: AopSceneTypeCheck,
    aopOutput: AopOutput,
    jsDustDataMapper: JSDustDataMapper,
    jsDustSiteMapMapper: JSDustSiteMapMapper
) : JSDustDataAnalysis(aopDbMapper, aopSceneTypeCheck, aopOutput, jsDustDataMapper, jsDustSiteMapMapper){
    override var sceneType: JSSceneType = JSSceneType.Construction
}
src/main/kotlin/cn/flightfeather/supervision/business/autooutput/dataanalysis/JSDustDataAnalysis.kt
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,142 @@
package cn.flightfeather.supervision.business.autooutput.dataanalysis
import cn.flightfeather.supervision.business.autooutput.AopOutput
import cn.flightfeather.supervision.business.autooutput.datasource.AopDataSource
import cn.flightfeather.supervision.business.autooutput.datasource.AopDbMapper
import cn.flightfeather.supervision.business.autooutput.datasource.AopSceneTypeCheck
import cn.flightfeather.supervision.domain.ds3.entity.JSDustData
import cn.flightfeather.supervision.domain.ds3.entity.JSDustSiteMap
import cn.flightfeather.supervision.domain.ds3.enum.JSSceneType
import cn.flightfeather.supervision.domain.ds3.mapper.JSDustDataMapper
import cn.flightfeather.supervision.domain.ds3.mapper.JSDustSiteMapMapper
import tk.mybatis.mapper.entity.Example
import java.time.Duration
import java.time.LocalDateTime
import java.time.ZoneId
import kotlin.math.round
/**
 * é‡‘山扬尘监测数据统计
 */
abstract class JSDustDataAnalysis(
    aopDbMapper: AopDbMapper,
    aopSceneTypeCheck: AopSceneTypeCheck,
    aopOutput: AopOutput,
    private val jsDustDataMapper: JSDustDataMapper,
    private val jsDustSiteMapMapper: JSDustSiteMapMapper,
) : AopDataAnalysis<JSDustData>(aopDbMapper, aopSceneTypeCheck, aopOutput){
    abstract var sceneType: JSSceneType
    override fun districtAvg(source: AopDataSource?): Double? {
        var total = .0
        var count = 0
        var page = 0
        val perPage = 20000
        var hasNextPage = false
        do {
            val res = jsDustDataMapper
                .getDataBySceneType(source?.config?.startTime, source?.config?.endTime, sceneType.value,
                    page * perPage, perPage)
            res.forEach {
                it?.dustValue?.let { v ->
                    total += v
                    count++
                }
            }
            page++
            hasNextPage = res.isNotEmpty()
            println("均值计算:当前页码 $page")
        } while (hasNextPage)
        return if (count == 0) {
            .0
        } else {
            round((total / count) * 1000) / 1000
        }
    }
    override fun fetchDataResources(evaluationScene: AopDataSource.EvaluationScene): List<List<JSDustData?>> {
        val dustSiteMaps = jsDustSiteMapMapper.selectByExample(Example(JSDustSiteMap::class.java).apply {
            createCriteria().andEqualTo("svUserId", evaluationScene.userInfo.value?.guid)
                .andIsNotNull("jsDeviceCode")
        })
        if (dustSiteMaps.isEmpty()) return emptyList()
        val mnCodeList =  dustSiteMaps.map { it?.jsDeviceCode }
        val map = mutableMapOf<String?, MutableList<JSDustData?>>()
        jsDustDataMapper.selectByExample(Example(JSDustData::class.java).apply {
            createCriteria().andBetween("lst", evaluationScene.config?.startTime, evaluationScene.config?.endTime)
                .andIn("mnCode", mnCodeList)
        }).forEach {
            if (!map.containsKey(it?.mnCode)) {
                map[it?.mnCode] = mutableListOf()
            }
            map[it?.mnCode]?.add(it)
        }
        val res = mutableListOf<List<JSDustData?>>()
        map.forEach { (_, u) ->
            res.add(u)
        }
        return res
    }
    override fun exceedTimes(data: JSDustData, t: TempResult) {
        data.dustValue?.let {
            if (it >= 1) {
                t.count++
            }
        }
    }
    override fun avg(data: JSDustData, t: TempResult) {
        data.dustValue?.let {
            t.total += it
            t.count++
        }
    }
    override fun max(data: JSDustData, t: TempResult) {
        data.dustValue?.let {
            if (it > t.total) {
                t.total = it
            }
        }
    }
    override fun min(data: JSDustData, t: TempResult) {
        data.dustValue?.let {
            if (t.count == 0 || it < t.total) {
                t.total = it
            }
            // é€šè¿‡t.count æ¥åˆ¤å®šæ˜¯å¦æ˜¯åˆå§‹åŒ–状态
            if (t.count == 0) t.count = 1
        }
    }
    override fun overAvgRate(avg: Double, dAvg: Double?): Double? {
        return if (dAvg != null) {
            round(((avg - dAvg) / dAvg) * 1000) / 1000
        } else {
            null
        }
    }
    override fun effectiveRate(
        dataList: List<List<JSDustData?>>,
        evaluationScene: AopDataSource.EvaluationScene,
    ): Double {
        if (dataList.isEmpty()) return .0
        val st = LocalDateTime.ofInstant(evaluationScene.config?.startTime?.toInstant(), ZoneId.systemDefault())
        val et = LocalDateTime.ofInstant(evaluationScene.config?.endTime?.toInstant(), ZoneId.systemDefault())
        val days = Duration.between(st, et).toDays() + 1
        return if (days == 0L) {
            .0
        } else {
            round((count(dataList) / (dataList.size * days * 24 * 4).toDouble()) * 1000) / 1000
        }
    }
}
src/main/kotlin/cn/flightfeather/supervision/business/autooutput/dataanalysis/JSMpDataAnalysis.kt
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,24 @@
package cn.flightfeather.supervision.business.autooutput.dataanalysis
import cn.flightfeather.supervision.business.autooutput.AopOutput
import cn.flightfeather.supervision.business.autooutput.datasource.AopDbMapper
import cn.flightfeather.supervision.business.autooutput.datasource.AopSceneTypeCheck
import cn.flightfeather.supervision.domain.ds3.enum.JSSceneType
import cn.flightfeather.supervision.domain.ds3.mapper.JSDustDataMapper
import cn.flightfeather.supervision.domain.ds3.mapper.JSDustSiteMapMapper
import org.springframework.stereotype.Component
/**
 * é‡‘山搅拌站扬尘监测数据统计
 */
@Component
class JSMpDataAnalysis(
    aopDbMapper: AopDbMapper,
    aopSceneTypeCheck: AopSceneTypeCheck,
    aopOutput: AopOutput,
    jsDustDataMapper: JSDustDataMapper,
    jsDustSiteMapMapper: JSDustSiteMapMapper,
) : JSDustDataAnalysis(aopDbMapper, aopSceneTypeCheck, aopOutput, jsDustDataMapper, jsDustSiteMapMapper) {
    override var sceneType: JSSceneType = JSSceneType.MixingPlant
}
src/main/kotlin/cn/flightfeather/supervision/business/autooutput/dataanalysis/JSWhDataAnalysis.kt
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,24 @@
package cn.flightfeather.supervision.business.autooutput.dataanalysis
import cn.flightfeather.supervision.business.autooutput.AopOutput
import cn.flightfeather.supervision.business.autooutput.datasource.AopDbMapper
import cn.flightfeather.supervision.business.autooutput.datasource.AopSceneTypeCheck
import cn.flightfeather.supervision.domain.ds3.enum.JSSceneType
import cn.flightfeather.supervision.domain.ds3.mapper.JSDustDataMapper
import cn.flightfeather.supervision.domain.ds3.mapper.JSDustSiteMapMapper
import org.springframework.stereotype.Component
/**
 * é‡‘山码头扬尘监测数据统计
 */
@Component
class JSWhDataAnalysis(
    aopDbMapper: AopDbMapper,
    aopSceneTypeCheck: AopSceneTypeCheck,
    aopOutput: AopOutput,
    jsDustDataMapper: JSDustDataMapper,
    jsDustSiteMapMapper: JSDustSiteMapMapper,
) : JSDustDataAnalysis(aopDbMapper, aopSceneTypeCheck, aopOutput, jsDustDataMapper, jsDustSiteMapMapper) {
    override var sceneType: JSSceneType = JSSceneType.Wharf
}
src/main/kotlin/cn/flightfeather/supervision/business/autooutput/dataanalysis/XHFuDataAnalysis.kt
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,145 @@
package cn.flightfeather.supervision.business.autooutput.dataanalysis
import cn.flightfeather.supervision.business.autooutput.AopOutput
import cn.flightfeather.supervision.business.autooutput.datasource.AopDataSource
import cn.flightfeather.supervision.business.autooutput.datasource.AopDbMapper
import cn.flightfeather.supervision.business.autooutput.datasource.AopSceneTypeCheck
import cn.flightfeather.supervision.domain.ds3.entity.FumeDailyAnalysis
import cn.flightfeather.supervision.domain.ds3.entity.FumeExceptionData
import cn.flightfeather.supervision.domain.ds3.entity.FumeSiteMap
import cn.flightfeather.supervision.domain.ds3.mapper.FumeDailyAnalysisMapper
import cn.flightfeather.supervision.domain.ds3.mapper.FumeExceptionDataMapper
import cn.flightfeather.supervision.domain.ds3.mapper.FumeSiteMapMapper
import org.springframework.stereotype.Component
import tk.mybatis.mapper.entity.Example
import kotlin.math.round
/**
 * å¾æ±‡æ²¹çƒŸç›‘测数据统计
 */
@Component
class XHFuDataAnalysis(
    aopDbMapper: AopDbMapper,
    aopSceneTypeCheck: AopSceneTypeCheck,
    aopOutput: AopOutput,
    private val fumeSiteMapMapper: FumeSiteMapMapper,
    private val fumeDailyAnalysisMapper: FumeDailyAnalysisMapper,
    private val fumeExceptionDataMapper: FumeExceptionDataMapper,
): AopDataAnalysis<FumeDailyAnalysis>(aopDbMapper, aopSceneTypeCheck, aopOutput) {
    // æ²¹çƒŸæ•°æ®æš‚无区均值的计算
    override fun districtAvg(source: AopDataSource?): Double? {
        return null
    }
    private fun getDeviceCodes(evaluationScene: AopDataSource.EvaluationScene): List<String?> {
        val fumeSiteMaps = fumeSiteMapMapper.selectByExample(Example(FumeSiteMap::class.java).apply {
            createCriteria().andEqualTo("svUserId", evaluationScene.userInfo.value?.guid)
                .andIsNotNull("xhDeviceCode")
        })
        return fumeSiteMaps.map { it?.xhDeviceCode }
    }
    override fun fetchDataResources(evaluationScene: AopDataSource.EvaluationScene): List<List<FumeDailyAnalysis?>> {
        val deviceCodeList = getDeviceCodes(evaluationScene)
        val map = mutableMapOf<String?, MutableList<FumeDailyAnalysis?>>()
        fumeDailyAnalysisMapper.selectByExample(Example(FumeDailyAnalysis::class.java).apply {
            createCriteria().andBetween("fumeDate", evaluationScene.config?.startTime, evaluationScene.config?.endTime)
                .andIn("fumeDevId", deviceCodeList)
        }).forEach {
            if (!map.containsKey(it?.fumeDevId)) {
                map[it?.fumeDevId] = mutableListOf()
            }
            map[it?.fumeDevId]?.add(it)
        }
        val res = mutableListOf<List<FumeDailyAnalysis?>>()
        map.forEach { (_, u) ->
            res.add(u)
        }
        return res
    }
    fun fetchExceptionData(evaluationScene: AopDataSource.EvaluationScene): List<FumeExceptionData?> {
        val deviceCodeList = getDeviceCodes(evaluationScene)
        return if (deviceCodeList.isEmpty()) {
            emptyList()
        } else {
            val code = deviceCodeList[0]
            fumeExceptionDataMapper.selectByExample(Example(FumeExceptionData::class.java).apply {
                createCriteria().andBetween("beginTime", evaluationScene.config?.startTime, evaluationScene.config?.endTime)
                    .andEqualTo("devId", code)
                    .andEqualTo("exception", "数据异常")
                    .andEqualTo("exceptionType", "0")
            })
        }
    }
    /**
     * æ²¹çƒŸè¶…标数
     * åªç»Ÿè®¡é‡ç‚¹æ—¶æ®µå†…(中午、晚上)的超标情况
     */
    override fun exceedTimes(data: FumeDailyAnalysis, t: TempResult) {
        data.noonExceedingNum?.toInt()?.let {
            t.count += it
        }
        data.nightExceedingNum?.toInt()?.let {
            t.count += it
        }
    }
    override fun avg(data: FumeDailyAnalysis, t: TempResult) {
        data.fumeDayAverage?.let {
            t.total += it
            t.count++
        }
    }
    override fun max(data: FumeDailyAnalysis, t: TempResult) {
        data.fumeDayMax?.let {
            if (it > t.total) {
                t.total = it
            }
        }
    }
    override fun min(data: FumeDailyAnalysis, t: TempResult) {
        data.fumeDayMin?.let {
            if (t.count == 0 || it < t.total) {
                t.total = it
            }
            // é€šè¿‡t.count æ¥åˆ¤å®šæ˜¯å¦æ˜¯åˆå§‹åŒ–状态
            if (t.count == 0) t.count = 1
        }
    }
    override fun overAvgRate(avg: Double, dAvg: Double?): Double? {
        return null
    }
    override fun effectiveRate(
        dataList: List<List<FumeDailyAnalysis?>>,
        evaluationScene: AopDataSource.EvaluationScene,
    ): Double {
        var total = .0
        var count = 0
        dataList.forEach {list ->
            list.forEach {
                val noon = it?.noonOnlineRate?.removeSuffix("%")?.toDouble()?.div(100)
                val night = it?.nightOnlineRate?.removeSuffix("%")?.toDouble()?.div(100)
                noon?.let {
                    total += noon
                    count++
                }
                night?.let {
                    total += night
                    count++
                }
            }
        }
        return if (count == 0) {
            .0
        } else {
            round((total / count) * 1000) / 1000
        }
    }
}
src/main/kotlin/cn/flightfeather/supervision/business/autooutput/datasource/AopDataConfig.kt
@@ -9,8 +9,8 @@
 * æ•°æ®æ¥æºå‚æ•°
 */
data class AopDataConfig(
    val startTime: Date? = null,
    val endTime: Date? = null,
    var startTime: Date? = null,
    var endTime: Date? = null,
    val year: Int? = null,
    val month: Int? = null,
@@ -25,7 +25,7 @@
    val topTaskGuid: String? = null,
    /**
     * åœºæ™¯ç±»åž‹æ ¹æ®ä¸åŒç³»ç»Ÿé‡‡ç”¨ä¸åŒçš„值,参考[Constant.ScenseType]
     * åœºæ™¯ç±»åž‹æ ¹æ®ä¸åŒç³»ç»Ÿé‡‡ç”¨ä¸åŒçš„值,参考[Constant.SceneType]
     */
    var sceneType: Int? = null,
src/main/kotlin/cn/flightfeather/supervision/business/autooutput/datasource/AopDataSource.kt
@@ -47,6 +47,18 @@
        }
    }
    fun setResource(subtask: Subtask) {
        val scene = aopDbMapper.scenseMapper.selectByPrimaryKey(subtask.scenseid)
        val sceneType = scene.typeid?.toInt()
        val config = AopDataConfig(topTaskGuid = subtask.tguid, sceneType = sceneType,
            districtName = subtask.districtname, townCode = subtask.towncode)
        evaluationScene.config = config
//        val check = aopSceneTypeCheck.checkSceneType(sceneType)
        this.mode = 0
        sceneSourceList.clear()
        sceneSourceList.add(scene)
    }
    /**
     * è½®è¯¢æ•°æ®æº
     */
@@ -83,12 +95,6 @@
        aopDbMapper.scenseMapper.selectByExample(Example(Scense::class.java).apply {
            createCriteria()
                .andIn("guid", taskSceneIdList)
//                .andEqualTo("provincecode", config.provinceCode)
//                .andEqualTo("citycode", config.cityCode)
//                .andEqualTo("districtcode", config.districtCode)
//                .andEqualTo("towncode", config.townCode)
//                .andEqualTo("typeid", config.sceneType)
//                .andNotEqualTo("extension1", '0')
        })?.let { sceneSourceList.addAll(it) }
    }
@@ -166,23 +172,23 @@
        val baseScene = InfoProxy<BaseScene> {_,_ ->
            return@InfoProxy when (config?.sceneType.toString()) {
                // ç›‘管系统
                Constant.ScenseType.TYPE1.value -> {
                Constant.SceneType.TYPE1.value -> {
                    aopDbMapper.sceneConstructionSiteMapper.selectByPrimaryKey(scene.value?.guid)
                }
                Constant.ScenseType.TYPE2.value -> {
                Constant.SceneType.TYPE2.value -> {
                    aopDbMapper.sceneWharfMapper.selectByPrimaryKey(scene.value?.guid)
                }
                Constant.ScenseType.TYPE3.value -> {
                Constant.SceneType.TYPE3.value -> {
                    aopDbMapper.sceneMixingPlantMapper.selectByPrimaryKey(scene.value?.guid)
                }
                Constant.ScenseType.TYPE14.value -> {
                Constant.SceneType.TYPE14.value -> {
                    aopDbMapper.sceneStorageYardMapper.selectByPrimaryKey(scene.value?.guid)
                }
                // å°è´¦ç³»ç»Ÿ
                Constant.ScenseType.TYPE5.value -> {
                Constant.SceneType.TYPE5.value -> {
                    aopDbMapper.restaurantBaseInfoMapper.selectByPrimaryKey(userInfoTZ.value?.guid)
                }
                Constant.ScenseType.TYPE6.value -> {
                Constant.SceneType.TYPE6.value -> {
                    aopDbMapper.vehicleBaseInfoMapper.selectByPrimaryKey(userInfoTZ.value?.guid)
                }
                else -> null
@@ -295,7 +301,7 @@
        //必填台账数量
        val ledgerCount = InfoProxy<Int>(config?.sceneType.toString()) {_, cacheMap ->
            val tzSceneType = Constant.ScenseType.typeMap(scene.value?.typeid)
            val tzSceneType = Constant.SceneType.typeMap(scene.value?.typeid)
            val list = aopDbMapper.ledgerSubTypeMapper.selectCountByExample(Example(LedgerSubType::class.java).apply {
                createCriteria().andEqualTo("lScenetype", tzSceneType).andEqualTo("lNeedupdate", true)
            })
src/main/kotlin/cn/flightfeather/supervision/business/autooutput/datasource/AopSceneTypeCheck.kt
@@ -17,12 +17,12 @@
     * åœºæ™¯ç±»åž‹åˆ¤å®š
     * @return åˆ¤æ–­ç»“果,(是否使用本系统定义,类型值)
     */
    fun checkSceneType(sceneType: Int): Pair<Boolean, Int> {
    fun checkSceneType(sceneType: Int?): Pair<Boolean, Int?> {
        // TODO: 2023/9/7 é€šè¿‡æ•°æ®åº“配置表决定当前类型的最终类型定义
        // FIXME: 2023/9/7 æš‚时写死相关配置
        return if (sceneType.toString() == Constant.ScenseType.TYPE6.value) {
            Pair(false, Constant.ScenseType.typeMap(sceneType.toByte())!!.toInt())
        return if (sceneType.toString() == Constant.SceneType.TYPE6.value) {
            Pair(false, Constant.SceneType.typeMap(sceneType?.toByte())!!.toInt())
        } else {
            Pair(true, sceneType)
        }
src/main/kotlin/cn/flightfeather/supervision/business/autooutput/score/AopCreditCode.kt
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,46 @@
package cn.flightfeather.supervision.business.autooutput.score
import cn.flightfeather.supervision.business.autooutput.datasource.AopDataConfig
import cn.flightfeather.supervision.common.utils.Constant
import cn.flightfeather.supervision.domain.ds1.repository.EvaluationRep
import cn.flightfeather.supervision.domain.ds2.entity.UserinfoTZ
import cn.flightfeather.supervision.domain.ds2.repository.OverallEvaluationRep
import cn.flightfeather.supervision.domain.ds2.repository.UserInfoTZRep
import cn.flightfeather.supervision.domain.ds2.repository.UserMapRep
import org.springframework.stereotype.Component
import java.time.LocalDate
/**
 * æ ¹æ®è‡ªåŠ¨è¯„ä¼°[AopEvaluation]结果生成环信码
 */
@Component
class AopCreditCode(
    private val userInfoTZRep: UserInfoTZRep,
    private val userMapRep: UserMapRep,
    private val evaluationRep: EvaluationRep,
    private val overallEvaluationRep: OverallEvaluationRep,
) {
    fun execute(config: AopDataConfig) {
        if (config.year == null || config.month == null) throw IllegalStateException("环信码评估时必须传递时间条件!")
        // æ‰¾åˆ°é£žç¾½çŽ¯å¢ƒä¸­éœ€è¦ç”ŸæˆçŽ¯ä¿¡ç çš„æ‰€æœ‰ç«™ç‚¹
        val sceneType = Constant.SceneType.getByValue(config.sceneType.toString())
        val userList = findUsers(config.districtName, sceneType)
        val date = LocalDate.of(config.year, config.month, 1)
        val endDate = date.plusMonths(config.period.toLong() - 1)
        userList.forEach {
            userMapRep.findFromSupervision(it)?.let { s ->
                // ä»Žé£žç¾½ç›‘管系统中查找评分
                val e = evaluationRep.findByScene(s.guid, date)
                e?.resultscorebef?.toInt()?.let {score ->
                    // æ ¹æ®è¯„分生成对应的环信码
                    overallEvaluationRep.insertOrUpdateOne(it?.guid, score, sceneType, date, endDate)
                }
            }
        }
    }
    private fun findUsers(districtName: String?, type: Constant.SceneType): List<UserinfoTZ?> {
        return userInfoTZRep.findEnterpriseUser(districtName, type)
    }
}
src/main/kotlin/cn/flightfeather/supervision/business/autooutput/score/AopEvaluation.kt
@@ -15,6 +15,7 @@
import cn.flightfeather.supervision.common.utils.UUIDGenerator
import cn.flightfeather.supervision.domain.ds1.entity.Evaluation
import cn.flightfeather.supervision.domain.ds1.entity.Itemevaluation
import cn.flightfeather.supervision.domain.ds1.entity.Subtask
import org.springframework.stereotype.Component
import java.util.*
import kotlin.math.abs
@@ -24,9 +25,9 @@
 */
@Component
class AopEvaluation(
    private val aopOutput: AopOutput,
    private val aopDbMapper: AopDbMapper,
    private val aopSceneTypeCheck: AopSceneTypeCheck,
    private val aopOutput: AopOutput,
    csScoreItem1: CsScoreItem1,
    csScoreItem2: CsScoreItem2,
    mpScoreItem1: MpScoreItem1,
@@ -35,15 +36,14 @@
    whScoreItem1: WhScoreItem1,
    whScoreItem2: WhScoreItem2,
    reScoreItem5: ReScoreItem5,
    reScoreItem7: ReScoreItem7,
    // FIXME: 2023/12/29 åˆ åŽ»ç‰¹æ®Šè¯„ä¼°è§„åˆ™
//    reScoreItem7: ReScoreItem7,
    reScoreItem8: ReScoreItem8,
    reScoreItem9: ReScoreItem9,
    reScoreItem10: ReScoreItem10,
    reScoreItem11: ReScoreItem11,
) {
    //数据源
    private var source: AopDataSource? = null
    //特定评分项(除了统一的根据巡查问题直接扣分外,有特定的扣分逻辑的评估项)
    private val itemList = mutableListOf<ScoreItem>()
@@ -57,7 +57,7 @@
            add(whScoreItem1)
            add(whScoreItem2)
            add(reScoreItem5)
            add(reScoreItem7)
//            add(reScoreItem7)
            add(reScoreItem8)
            add(reScoreItem9)
            add(reScoreItem10)
@@ -65,18 +65,43 @@
        }
    }
    fun setResource(topTaskGuid: String?, sceneType: Int, districtName: String? = null, townCode: String? = null) {
        source = AopDataSource(aopDbMapper, aopSceneTypeCheck)
        source?.setResource(topTaskGuid, sceneType, districtName, townCode)
    fun executeByTopTask(topTaskGuid: String?, sceneType: Int, districtName: String? = null, townCode: String? = null) {
        val source = setResource(topTaskGuid, sceneType, districtName, townCode)
        execute(source)
    }
    /**
     * å¯¹ç‰¹å®šçš„巡查任务进行单独评分
     */
    fun executeBySubTask(subTask:Subtask) {
        val source = setResource(subTask)
        execute(source)
    }
    private fun setResource(subTask: Subtask): AopDataSource {
        val source = AopDataSource(aopDbMapper, aopSceneTypeCheck)
        source.setResource(subTask)
        return source
    }
    private fun setResource(
        topTaskGuid: String?,
        sceneType: Int,
        districtName: String?,
        townCode: String?,
    ): AopDataSource {
        val source = AopDataSource(aopDbMapper, aopSceneTypeCheck)
        source.setResource(topTaskGuid, sceneType, districtName, townCode)
        return source
    }
    /**
     * æ‰§è¡Œè¯„分逻辑
     */
    fun execute() {
    private fun execute(source: AopDataSource) {
        //获取数据源(待评估的场景)
        //循环处理每个场景
        source?.loop {index, evaluationScene ->
        source.loop {index, evaluationScene ->
            if (evaluationScene.noRecord()) return@loop
            itemGrade(index, evaluationScene)
@@ -84,7 +109,6 @@
                aopOutput.toDbEvaluation(evaluationScene, this)
            }
        }
    }
    /**
src/main/kotlin/cn/flightfeather/supervision/business/autooutput/score/ScoreItem.kt
@@ -66,7 +66,7 @@
     * @param size ä¼ å…¥è¯„分条目的数量,评分条目按照一定规则进行排序
     * @return è¿”回需要扣分的评分条目的序号
     */
    abstract fun otherProblem(size: Int): Int?
    abstract fun otherProblem(size: Int): List<Int>?
    /**
     * è‡ªåŠ¨è¯„åˆ†è®¡ç®—é€»è¾‘
@@ -77,7 +77,9 @@
            return
        }
        otherProblem(rulePair?.second!!.size)?.let {i-> rulePair?.second!![i].getScore() }
        otherProblem(rulePair?.second!!.size)?.let { it.forEach {i ->
            rulePair?.second!![i].getScore()
        } }
        ScoreUtil.subRuleCal(rulePair)
    }
src/main/kotlin/cn/flightfeather/supervision/business/autooutput/score/ScoreUtil.kt
@@ -2,11 +2,13 @@
import cn.flightfeather.supervision.business.Info
import cn.flightfeather.supervision.business.autooutput.datasource.AopDataSource
import cn.flightfeather.supervision.common.utils.ExcelUtil
import cn.flightfeather.supervision.common.utils.UUIDGenerator
import cn.flightfeather.supervision.domain.ds1.entity.Evaluationrule
import cn.flightfeather.supervision.domain.ds1.entity.Evaluationsubrule2
import cn.flightfeather.supervision.domain.ds1.entity.Inspection
import cn.flightfeather.supervision.domain.ds1.entity.Itemevaluation
import org.apache.poi.hssf.util.HSSFColor
import kotlin.math.abs
/**
@@ -63,4 +65,24 @@
            value = itemRule.extension1 ?: "0"
            extension1 = (itemRule.extension1 != null).toString()
        }
    /**
     * åˆ†æ•°è½¬æ¢çŽ¯ä¿¡ç 
     */
    fun scoreToCredit(s: Int?): Pair<Int?, String?> {
        return when (s) {
            in 0..59 -> Pair(2, "红码")
            in 60..89 -> Pair(1, "黄码")
            in 90..100 -> Pair(0, "绿码")
            null -> Pair(null, null)
            else -> Pair(-1, "超出范围")
        }
    }
    /**
     * åˆ†æ•°è½¬æ¢è§„范等级
     */
    fun scoreToStandard() {
    }
}
src/main/kotlin/cn/flightfeather/supervision/business/autooutput/score/construction/CsScoreItem1.kt
@@ -33,7 +33,7 @@
     *      1.问题部分整改或不及时提供材料
     *      2.问题无整改
     */
    override fun otherProblem(size: Int): Int? {
    override fun otherProblem(size: Int): List<Int>? {
        val p = problemlistMapper.selectByExample(Example(Problemlist::class.java).apply {
            createCriteria().andEqualTo("stguid", evaluationScene.subTask.value?.stguid)
//                .andGreaterThanOrEqualTo("time", info.sTime)
@@ -49,8 +49,8 @@
            }
        }
        return when {
            changed == 0 && total > 0 -> 1
            changed < total -> 0
            changed == 0 && total > 0 -> listOf(1)
            changed < total -> listOf(0)
            else -> null
        }
    }
src/main/kotlin/cn/flightfeather/supervision/business/autooutput/score/construction/CsScoreItem2.kt
@@ -40,7 +40,7 @@
     *      1.监测数据出现单日及以上有效超标
     *      2.监测数据月均值超区域月均值20%以上或数据明显异常
     */
    override fun otherProblem(size: Int): Int? {
    override fun otherProblem(size: Int): List<Int>? {
        val time = evaluationScene.subTask.value?.planstarttime
        val lt = LocalDateTime.ofInstant(time?.toInstant(), ZoneId.systemDefault())
        val st = lt.withDayOfMonth(1).withHour(0).withMinute(0).withSecond(0)
@@ -51,14 +51,14 @@
                .andEqualTo("drSceneId", evaluationScene.scene.value?.guid)
        })
        var result: Int? = null
        var result = mutableListOf<Int>()
        r.forEach {
            if (it == null) return@forEach
            if (it.drExceedTimes > 0) {
                result = 0
                result.add(0)
            }
            if (it.drOverAvgPer > 0.2) {
                result = 1
                result.add(1)
            }
        }
src/main/kotlin/cn/flightfeather/supervision/business/autooutput/score/mixingplant/MpScoreItem1.kt
@@ -33,7 +33,7 @@
     *      1.问题部分整改或不及时提供材料
     *      2.问题无整改
     */
    override fun otherProblem(size: Int): Int? {
    override fun otherProblem(size: Int): List<Int>? {
        val p = problemlistMapper.selectByExample(Example(Problemlist::class.java).apply {
            createCriteria().andEqualTo("stguid", evaluationScene.subTask.value?.stguid)
//                .andGreaterThanOrEqualTo("time", info.sTime)
@@ -49,8 +49,8 @@
            }
        }
        return when {
            changed == 0 && total > 0 -> 1
            changed < total -> 0
            changed == 0 && total > 0 -> listOf(1)
            changed < total -> listOf(0)
            else -> null
        }
    }
src/main/kotlin/cn/flightfeather/supervision/business/autooutput/score/mixingplant/MpScoreItem2.kt
@@ -40,7 +40,7 @@
     *      1.监测数据出现单日及以上有效超标
     *      2.监测数据月均值超区域月均值20%以上或数据明显异常
     */
    override fun otherProblem(size: Int): Int? {
    override fun otherProblem(size: Int): List<Int>? {
        val time = evaluationScene.subTask.value?.planstarttime
        val lt = LocalDateTime.ofInstant(time?.toInstant(), ZoneId.systemDefault())
        val st = lt.withDayOfMonth(1).withHour(0).withMinute(0).withSecond(0)
@@ -51,14 +51,14 @@
                .andEqualTo("drSceneId", evaluationScene.scene.value?.guid)
        })
        var result: Int? = null
        var result = mutableListOf<Int>()
        r.forEach {
            if (it == null) return@forEach
            if (it.drExceedTimes > 0) {
                result = 0
                result.add(0)
            }
            if (it.drOverAvgPer > 0.2) {
                result = 1
                result.add(1)
            }
        }
src/main/kotlin/cn/flightfeather/supervision/business/autooutput/score/restaurant/ReScoreItem10.kt
@@ -38,7 +38,7 @@
     *      3.收到执法意见书
     *      4.有环境违法行为且受到行政处罚
     */
    override fun otherProblem(size: Int): Int? {
    override fun otherProblem(size: Int): List<Int>? {
        val time = evaluationScene.subTask.value?.planstarttime
        val lt = LocalDateTime.ofInstant(time?.toInstant(), ZoneId.systemDefault())
        val s = lt.withDayOfMonth(1).withHour(0).withMinute(0).withSecond(0)
@@ -48,21 +48,16 @@
        when {
            condition3(s, e) -> {
                i = 3
                if (i > size - 1) i = size - 1
                return i
            }
            condition2(s, e) -> {
                i = 2
                if (i > size - 1) i = size - 1
                return i
            }
            condition1(s, e) -> {
                i = 1
                if (i > size - 1) i = size - 1
                return i
            }
            else -> return null
        }
        if (i > size - 1) i = size - 1
        return listOf(i)
    }
    /**
src/main/kotlin/cn/flightfeather/supervision/business/autooutput/score/restaurant/ReScoreItem11.kt
@@ -25,17 +25,15 @@
     *      1.环境信用不规范或承诺未按时提交或超有效期,以及涉及法人变更的或营业执照变更未重新承诺的
     *      2.环境信用自评未按时自评或未按时提
     */
    override fun otherProblem(size: Int): Int? {
        var i = 1
    override fun otherProblem(size: Int): List<Int>? {
        var i = 0
        if (condition1()) {
            if (i > size - 1) i = size - 1
            return i
            i = 1
        } else if (condition2()) {
            i = 2
            if (i > size - 1) i = size - 1
            return i
        }
        return null
        if (i > size - 1) i = size - 1
        return listOf(i)
    }
    /**
src/main/kotlin/cn/flightfeather/supervision/business/autooutput/score/restaurant/ReScoreItem5.kt
@@ -1,18 +1,23 @@
package cn.flightfeather.supervision.business.autooutput.score.restaurant
import cn.flightfeather.supervision.business.autooutput.dataanalysis.XHFuDataAnalysis
import cn.flightfeather.supervision.business.autooutput.score.ScoreItem
import cn.flightfeather.supervision.domain.ds1.entity.DustDataResult
import cn.flightfeather.supervision.domain.ds1.entity.Evaluationsubrule2
import cn.flightfeather.supervision.domain.ds1.mapper.DustDataResultMapper
import cn.flightfeather.supervision.domain.ds3.entity.FumeDailyAnalysis
import cn.flightfeather.supervision.domain.ds3.entity.FumeExceptionData
import cn.flightfeather.supervision.domain.ds3.mapper.FumeDailyAnalysisMapper
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.stereotype.Component
import tk.mybatis.mapper.entity.Example
import java.time.LocalDateTime
import java.time.ZoneId
import java.util.*
import javax.annotation.PostConstruct
@Component
class ReScoreItem5: ScoreItem() {
class ReScoreItem5(private val xhFuDataAnalysis: XHFuDataAnalysis) : ScoreItem() {
    companion object {
        private lateinit var instance: ReScoreItem5
    }
@@ -24,7 +29,7 @@
    override var id: String = "PSQUi9f0f7JK6w9d"
    override var name: String="油烟在线监测数据量级"
    override var name: String = "油烟在线监测数据量级"
    @Autowired
    lateinit var dustDataResultMapper: DustDataResultMapper
@@ -32,67 +37,80 @@
    /**
     * å¾æ±‡åŒºé¤é¥®ç›‘管平台联网记录、在线率分析数据和高峰经营时段小时超标情况
     * é€‰é¡¹å¦‚下:
     *      1.数据无异常且无超标或显示净化装置清洁
     *      2.高峰经营时段数据在线率低于90%或显示净化装置故障
     *      3.当月高峰经营时段出现三次及以上10分钟均值超标或显示净化装置较脏
     *      4.当月高峰经营时段数据持续异常或出现三次及以上小时数据超标或无油烟净化装置或净化装置未正常开启
     *      1.数据无异常且无超标或显示净化装置清洁(不扣分)
     *      2.当月存在日高峰经营时段数据在线率低于90%且出现3日及以上(扣5分)
     *      3.当月存在日高峰经营时段连续三次及以上10分钟均值超标且出现2日及以内的或显示净化装置较脏(扣5分)
     *      4.当月存在日高峰经营时段连续三次及以上10分钟均值超标且出现3日及以上的或无油烟净化装置或净化装置未正常开启或显示净化装置故障(扣10分)
     */
    override fun otherProblem(size: Int): Int? {
        var i = 1
        when {
            condition1() -> {
                if (i > size - 1) i = size - 1
                return i
            }
            condition2() -> {
                i = 2
                if (i > size - 1) i = size - 1
                return i
            }
            condition3() -> {
                i = 3
                if (i > size - 1) i = size - 1
                return i
            }
            else -> return null
        }
    }
    override fun otherProblem(size: Int): List<Int>? {
        val result = mutableListOf<Int>()
    /**
     * @return true  é«˜å³°ç»è¥æ—¶æ®µæ•°æ®åœ¨çº¿çŽ‡ä½ŽäºŽ90%或显示净化装置故障
     */
    private fun condition1(): Boolean {
        return false
    }
    /**
     * @return true  å½“月高峰经营时段出现三次及以上10分钟均值超标或显示净化装置较脏
     */
    private fun condition2(): Boolean {
        val time = evaluationScene.subTask.value?.planstarttime
        val lt = LocalDateTime.ofInstant(time?.toInstant(), ZoneId.systemDefault())
        val st = lt.withDayOfMonth(1).withHour(0).withMinute(0).withSecond(0)
        val et = st.plusMonths(1)
        val r = dustDataResultMapper.selectByExample(Example(DustDataResult::class.java).apply {
            createCriteria().andGreaterThanOrEqualTo("drTime", st)
                .andLessThan("drTime", et)
                .andEqualTo("drSceneId", evaluationScene.scene.value?.guid)
        })
        evaluationScene.config?.startTime = Date.from(st.atZone(ZoneId.systemDefault()).toInstant())
        evaluationScene.config?.endTime = Date.from(et.atZone(ZoneId.systemDefault()).toInstant())
        val dailyAnalysisDataList = xhFuDataAnalysis.fetchDataResources(evaluationScene)
        val exceptionDataList = xhFuDataAnalysis.fetchExceptionData(evaluationScene)
        var result = false
        r.forEach {
            if (it == null) return@forEach
            if (it.drExceedTimes >= 3) {
                result = true
        var count = 0
        dailyAnalysisDataList.forEach { it.forEach dList@ {f ->
            val keyOnlineRate = f?.keyOnlineRate?.split("%")?.get(0)?.toDouble() ?: return@dList
            if (keyOnlineRate < 0.9) {
                count++
            }
        } }
        if (count >= 3) {
            result.add(1)
        }
        val dayList = mutableListOf<Int>()
        exceptionDataList.forEach {
            // ä¸åœ¨é«˜å³°æ—¶æ®µçš„异常数据不作为判断依据
            if (!peakPeriod(it)) return@forEach
            // å¼‚常时长大于等于20分钟,表示三个时间点的数据异常
            if ((it?.endTime?.time?.minus(it.beginTime.time) ?: 0) >= (20 * 60 * 1000)) {
                val cal = Calendar.getInstance()
                cal.time = it!!.beginTime
                val date = cal.get(Calendar.DAY_OF_MONTH)
                if (!dayList.contains(date)) {
                    dayList.add(date)
                }
            }
        }
        //日高峰经营时段连续三次及以上10分钟均值超标且出现3日及以上
        if (dayList.size >= 3) {
            result.add(3)
        }
        //日高峰经营时段连续三次及以上10分钟均值超标且出现2日及以内
        else if (dayList.size > 0) {
            result.add(2)
        }
        return result
    }
    /**
     * @return true  å½“月高峰经营时段数据持续异常或出现三次及以上小时数据超标或无油烟净化装置或净化装置未正常开启
     * åˆ¤æ–­å¼‚常是否处于高峰时段
     */
    private fun condition3(): Boolean {
        return false
    private fun peakPeriod(data: FumeExceptionData?): Boolean {
        if (data == null) return false
        val today = LocalDateTime.ofInstant(data.beginTime.toInstant(), ZoneId.systemDefault())
        val noonP1 = today.withHour(9).withMinute(59).withSecond(59)
        val noonP2 = today.withHour(14).withMinute(0).withSecond(0)
        val nightP1 = today.withHour(16).withMinute(59).withSecond(59)
        val nightP2 = today.withHour(21).withMinute(0).withSecond(0)
        val beginTime = LocalDateTime.ofInstant(data.beginTime.toInstant(), ZoneId.systemDefault())
        val endTime = LocalDateTime.ofInstant(data.endTime.toInstant(), ZoneId.systemDefault())
        val b1 =
            (beginTime.isAfter(noonP1) && beginTime.isBefore(noonP2)) || (beginTime.isAfter(nightP1) && beginTime.isBefore(
                nightP2))
        val b2 = (endTime.isAfter(noonP1) && endTime.isBefore(noonP2)) || (endTime.isAfter(nightP1) && endTime.isBefore(
            nightP2))
        return b1 || b2
    }
}
src/main/kotlin/cn/flightfeather/supervision/business/autooutput/score/restaurant/ReScoreItem5BackUp.kt
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,86 @@
package cn.flightfeather.supervision.business.autooutput.score.restaurant
import cn.flightfeather.supervision.business.autooutput.score.ScoreItem
import cn.flightfeather.supervision.domain.ds1.entity.DustDataResult
import cn.flightfeather.supervision.domain.ds1.mapper.DustDataResultMapper
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.stereotype.Component
import tk.mybatis.mapper.entity.Example
import java.time.LocalDateTime
import java.time.ZoneId
import javax.annotation.PostConstruct
@Component
class ReScoreItem5BackUp: ScoreItem() {
    companion object {
        private lateinit var instance: ReScoreItem5BackUp
    }
    @PostConstruct
    fun init() {
        instance = this
    }
    override var id: String = "PSQUi9f0f7JK6w9d"
    override var name: String="油烟在线监测数据量级"
    @Autowired
    lateinit var dustDataResultMapper: DustDataResultMapper
    /**
     * å¾æ±‡åŒºé¤é¥®ç›‘管平台联网记录、在线率分析数据和高峰经营时段小时超标情况
     * é€‰é¡¹å¦‚下:
     *      1.数据无异常且无超标或显示净化装置清洁
     *      2.高峰经营时段数据在线率低于90%或显示净化装置故障
     *      3.当月高峰经营时段出现三次及以上10分钟均值超标或显示净化装置较脏
     *      4.当月高峰经营时段数据持续异常或出现三次及以上小时数据超标或无油烟净化装置或净化装置未正常开启
     */
    override fun otherProblem(size: Int): List<Int>? {
        val time = evaluationScene.subTask.value?.planstarttime
        val lt = LocalDateTime.ofInstant(time?.toInstant(), ZoneId.systemDefault())
        val st = lt.withDayOfMonth(1).withHour(0).withMinute(0).withSecond(0)
        val et = st.plusMonths(1)
        val res = dustDataResultMapper.selectByExample(Example(DustDataResult::class.java).apply {
            createCriteria().andGreaterThanOrEqualTo("drTime", st)
                .andLessThan("drTime", et)
                .andEqualTo("drSceneId", evaluationScene.scene.value?.guid)
        }).takeIf { it.isNotEmpty() }?.get(0) ?: return null
        var i = 0
        when {
            condition1(res) -> {
                i = 1
            }
            condition2(res) -> {
                i = 2
            }
            condition3(res) -> {
                i = 3
            }
        }
        if (i > size - 1) i = size - 1
        return listOf(i)
    }
    /**
     * @return true  é«˜å³°ç»è¥æ—¶æ®µæ•°æ®åœ¨çº¿çŽ‡ä½ŽäºŽ90%或显示净化装置故障
     */
    private fun condition1(res: DustDataResult): Boolean {
        return res.drEffectiveRate < .9
    }
    /**
     * @return true  å½“月高峰经营时段出现三次及以上10分钟均值超标或显示净化装置较脏
     */
    private fun condition2(res: DustDataResult): Boolean {
        return res.drExceedTimes >= 3
    }
    /**
     * @return true  å½“月高峰经营时段数据持续异常或出现三次及以上小时数据超标或无油烟净化装置或净化装置未正常开启
     */
    private fun condition3(res: DustDataResult): Boolean {
        return false
    }
}
src/main/kotlin/cn/flightfeather/supervision/business/autooutput/score/restaurant/ReScoreItem7.kt
@@ -46,7 +46,7 @@
     *      2.台账少量缺失或未及时记录更新
     *      3.台账严重缺失或关键台账无效
     */
    override fun otherProblem(size: Int): Int? {
    override fun otherProblem(size: Int): List<Int>? {
        // TODO: 2021/3/9 æ‰¾å‡ºç”¨æˆ·ç±»åž‹å¯¹åº”的必填台账
        val time = evaluationScene.subTask.value?.planstarttime
        val lt = LocalDateTime.ofInstant(time?.toInstant(), ZoneId.systemDefault())
@@ -66,13 +66,11 @@
        var i = 1
        if (condition1(ledgerTypeCount, rCount)) {
            if (i > size - 1) i = size - 1
            return i
        } else if (condition2(ledgerTypeCount, rCount)) {
            i = 2
            if (i > size - 1) i = size - 1
            return i
        }
        return null
        return listOf(i)
    }
    /**
src/main/kotlin/cn/flightfeather/supervision/business/autooutput/score/restaurant/ReScoreItem8.kt
@@ -29,10 +29,11 @@
    /**
     * æ‰§æ³•检查汇总情况
     * é€‰é¡¹å¦‚下:
     *      1.问题部分整改或不及时提供材料
     *      2.问题无整改
     *      1.全部按时整改并及时提交材料
     *      2.问题部分整改或不及时提供材料
     *      3.问题无整改
     */
    override fun otherProblem(size: Int): Int? {
    override fun otherProblem(size: Int): List<Int>? {
        val p = problemlistMapper.selectByExample(Example(Problemlist::class.java).apply {
            createCriteria().andEqualTo("stguid", evaluationScene.subTask.value?.stguid)
//                .andGreaterThanOrEqualTo("time", info.sTime)
@@ -48,8 +49,8 @@
            }
        }
        return when {
            changed == 0 && total > 0 -> 1
            changed < total -> 0
            changed == 0 && total > 0 -> listOf(2)
            changed < total -> listOf(1)
            else -> null
        }
    }
src/main/kotlin/cn/flightfeather/supervision/business/autooutput/score/restaurant/ReScoreItem9.kt
@@ -37,7 +37,7 @@
     *      2.本季度发生单次区级信访投诉
     *      3.本季度发生市级信访投诉或多次区级信访、投诉或监管不配合
     */
    override fun otherProblem(size: Int): Int? {
    override fun otherProblem(size: Int): List<Int>? {
        val time = evaluationScene.subTask.value?.planstarttime
        val lt = LocalDateTime.ofInstant(time?.toInstant(), ZoneId.systemDefault())
        val st = lt.withDayOfMonth(1).withHour(0).withMinute(0).withSecond(0)
@@ -49,16 +49,14 @@
                .andLessThan("cpTime", et)
        })
        var i = 2
        var i = 0
        if (condition2(complaints)) {
            if (i > size - 1) i = size - 1
            return i
            i = 2
        } else if (condition1(complaints)) {
            i = 1
            if (i > size - 1) i = size - 1
            return i
        }
        return null
        if (i > size - 1) i = size - 1
        return listOf(i)
    }
    /**
src/main/kotlin/cn/flightfeather/supervision/business/autooutput/score/storage/StScoreItem1.kt
@@ -33,7 +33,7 @@
     *      1.问题部分整改或不及时提供材料
     *      2.问题无整改
     */
    override fun otherProblem(size: Int): Int? {
    override fun otherProblem(size: Int): List<Int>? {
        val p = problemlistMapper.selectByExample(Example(Problemlist::class.java).apply {
            createCriteria().andEqualTo("stguid", evaluationScene.subTask.value?.stguid)
//                .andGreaterThanOrEqualTo("time", info.sTime)
@@ -49,8 +49,8 @@
            }
        }
        return when {
            changed == 0 && total > 0 -> 1
            changed < total -> 0
            changed == 0 && total > 0 -> listOf(1)
            changed < total -> listOf(0)
            else -> null
        }
    }
src/main/kotlin/cn/flightfeather/supervision/business/autooutput/score/wharf/WhScoreItem1.kt
@@ -33,7 +33,7 @@
     *      1.问题部分整改或不及时提供材料
     *      2.问题无整改
     */
    override fun otherProblem(size: Int): Int? {
    override fun otherProblem(size: Int): List<Int>? {
        val p = problemlistMapper.selectByExample(Example(Problemlist::class.java).apply {
            createCriteria().andEqualTo("stguid", evaluationScene.subTask.value?.stguid)
//                .andGreaterThanOrEqualTo("time", info.sTime)
@@ -49,8 +49,8 @@
            }
        }
        return when {
            changed == 0 && total > 0 -> 1
            changed < total -> 0
            changed == 0 && total > 0 -> listOf(1)
            changed < total -> listOf(0)
            else -> null
        }
    }
src/main/kotlin/cn/flightfeather/supervision/business/autooutput/score/wharf/WhScoreItem2.kt
@@ -40,7 +40,7 @@
     *      1.监测数据出现单日及以上有效超标
     *      2.监测数据月均值超区域月均值20%以上或数据明显异常
     */
    override fun otherProblem(size: Int): Int? {
    override fun otherProblem(size: Int): List<Int>? {
        val time = evaluationScene.subTask.value?.planstarttime
        val lt = LocalDateTime.ofInstant(time?.toInstant(), ZoneId.systemDefault())
        val st = lt.withDayOfMonth(1).withHour(0).withMinute(0).withSecond(0)
@@ -51,14 +51,14 @@
                .andEqualTo("drSceneId", evaluationScene.scene.value?.guid)
        })
        var result: Int? = null
        var result = mutableListOf<Int>()
        r.forEach {
            if (it == null) return@forEach
            if (it.drExceedTimes > 0) {
                result = 0
                result.add(0)
            }
            if (it.drOverAvgPer > 0.2) {
                result = 1
                result.add(1)
            }
        }
src/main/kotlin/cn/flightfeather/supervision/business/fume/AutoScore3.kt
ÎļþÒÑɾ³ý
src/main/kotlin/cn/flightfeather/supervision/business/fume/item/ScoreItem_1.kt
ÎļþÒÑɾ³ý
src/main/kotlin/cn/flightfeather/supervision/business/fume/item/ScoreItem_10.kt
ÎļþÒÑɾ³ý
src/main/kotlin/cn/flightfeather/supervision/business/fume/item/ScoreItem_11.kt
ÎļþÒÑɾ³ý
src/main/kotlin/cn/flightfeather/supervision/business/fume/item/ScoreItem_2.kt
ÎļþÒÑɾ³ý
src/main/kotlin/cn/flightfeather/supervision/business/fume/item/ScoreItem_3.kt
ÎļþÒÑɾ³ý
src/main/kotlin/cn/flightfeather/supervision/business/fume/item/ScoreItem_4.kt
ÎļþÒÑɾ³ý
src/main/kotlin/cn/flightfeather/supervision/business/fume/item/ScoreItem_5.kt
ÎļþÒÑɾ³ý
src/main/kotlin/cn/flightfeather/supervision/business/fume/item/ScoreItem_6.kt
ÎļþÒÑɾ³ý
src/main/kotlin/cn/flightfeather/supervision/business/fume/item/ScoreItem_7.kt
ÎļþÒÑɾ³ý
src/main/kotlin/cn/flightfeather/supervision/business/fume/item/ScoreItem_8.kt
ÎļþÒÑɾ³ý
src/main/kotlin/cn/flightfeather/supervision/business/fume/item/ScoreItem_9.kt
ÎļþÒÑɾ³ý
src/main/kotlin/cn/flightfeather/supervision/business/fume/package-info.java
ÎļþÒÑɾ³ý
src/main/kotlin/cn/flightfeather/supervision/business/report/DataSource.kt
@@ -11,13 +11,9 @@
import cn.flightfeather.supervision.domain.ds2.mapper.LedgerSubTypeMapper
import cn.flightfeather.supervision.domain.ds2.mapper.UserMapMapper
import cn.flightfeather.supervision.lightshare.vo.ExcelConfigVo
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.stereotype.Component
import tk.mybatis.mapper.entity.Example
import java.time.Duration
import java.time.LocalDateTime
import java.time.ZoneId
import javax.annotation.PostConstruct
/**
 * æŠ¥å‘Šæ‰€éœ€æºæ•°æ®
@@ -73,7 +69,7 @@
     */
    fun areaName(): String {
        val t = dbMapper.taskMapper.selectByPrimaryKey(config.topTaskGuid)
        return "${dateUtil.DateToString(t.starttime, DateUtil.DateStyle.YYYY_MM_CN)}${t.districtname}${if (area != t.districtname) area else ""}${Constant.ScenseType.getDes(config.sceneType)}"
        return "${dateUtil.DateToString(t.starttime, DateUtil.DateStyle.YYYY_MM_CN)}${t.districtname}${if (area != t.districtname) area else ""}${Constant.SceneType.getDes(config.sceneType)}"
    }
    /**
@@ -164,16 +160,16 @@
            get() {
                if (_baseScene == null) {
                    _baseScene = when (this.scene?.typeid.toString()) {
                        Constant.ScenseType.TYPE1.value -> {
                        Constant.SceneType.TYPE1.value -> {
                            dbMapper.sceneConstructionSiteMapper.selectByPrimaryKey(scene?.guid)
                        }
                        Constant.ScenseType.TYPE2.value -> {
                        Constant.SceneType.TYPE2.value -> {
                            dbMapper.sceneWharfMapper.selectByPrimaryKey(scene?.guid)
                        }
                        Constant.ScenseType.TYPE3.value -> {
                        Constant.SceneType.TYPE3.value -> {
                            dbMapper.sceneMixingPlantMapper.selectByPrimaryKey(scene?.guid)
                        }
                        Constant.ScenseType.TYPE14.value -> {
                        Constant.SceneType.TYPE14.value -> {
                            dbMapper.sceneStorageYardMapper.selectByPrimaryKey(scene?.guid)
                        }
                        else -> null
@@ -307,7 +303,7 @@
        val ledgerCount: Int
            get() {
                if (_ledgerCount == -1) {
                    val tzSceneType = Constant.ScenseType.typeMap(scene?.typeid)
                    val tzSceneType = Constant.SceneType.typeMap(scene?.typeid)
                    _ledgerCount = dbMapper.ledgerSubTypeMapper.selectCountByExample(Example(LedgerSubType::class.java).apply {
                        createCriteria().andEqualTo("lScenetype", tzSceneType).andEqualTo("lNeedupdate", true)
                    })
src/main/kotlin/cn/flightfeather/supervision/business/report/cols/ColStatus.kt
@@ -21,19 +21,19 @@
        var status: String? = ""
        var stage: String? = ""
        when (rowData.scene?.typeid.toString()) {
            Constant.ScenseType.TYPE1.value -> {
            Constant.SceneType.TYPE1.value -> {
                (rowData.baseScene as SceneConstructionSite?)?.apply {
                    status = csStatus
                    stage = siExtension1
                }
            }
            Constant.ScenseType.TYPE2.value -> {
            Constant.SceneType.TYPE2.value -> {
                status = (rowData.baseScene as SceneWharf?)?.getwStatus()
            }
            Constant.ScenseType.TYPE3.value -> {
            Constant.SceneType.TYPE3.value -> {
                status = (rowData.baseScene as SceneMixingPlant?)?.mpStatus
            }
            Constant.ScenseType.TYPE14.value -> {
            Constant.SceneType.TYPE14.value -> {
                status = (rowData.baseScene as SceneStorageYard?)?.syStatus
            }
            else -> ""
src/main/kotlin/cn/flightfeather/supervision/business/report/cols/ColTotalGrade.kt
@@ -27,20 +27,18 @@
                //总分和环信码
                rowData.evaluation.let { e ->
                    val s = e?.resultscorebef?.toIntOrNull() ?: -1
                    val code = when (s) {
                        in 0..59 -> ExcelUtil.MyCell("红码", fontColor = HSSFColor.HSSFColorPredefined.RED.index)
                        in 60..89 -> ExcelUtil.MyCell("黄码", fontColor = HSSFColor.HSSFColorPredefined.GOLD.index)
                        in 90..100 -> ExcelUtil.MyCell("绿码", fontColor = HSSFColor.HSSFColorPredefined.BRIGHT_GREEN.index)
                        -1 -> ExcelUtil.MyCell("", fontColor = HSSFColor.HSSFColorPredefined.BLACK.index)
                        else -> ExcelUtil.MyCell("超出范围:${s}", fontColor = HSSFColor.HSSFColorPredefined.BLACK.index)
                    val code = when {
                        s in 0..59 -> ExcelUtil.MyCell("红码", fontColor = HSSFColor.HSSFColorPredefined.RED.index)
                        s in 60..89 -> ExcelUtil.MyCell("黄码", fontColor = HSSFColor.HSSFColorPredefined.GOLD.index)
                        s >= 90 -> ExcelUtil.MyCell("绿码", fontColor = HSSFColor.HSSFColorPredefined.BRIGHT_GREEN.index)
                        else -> ExcelUtil.MyCell("", fontColor = HSSFColor.HSSFColorPredefined.BLACK.index)
                    }
                    val normalization = when (s) {
                        in 0..39 -> ExcelUtil.MyCell("严重不规范", fontColor = HSSFColor.HSSFColorPredefined.RED.index)
                        in 40..89 -> ExcelUtil.MyCell("不规范", fontColor = HSSFColor.HSSFColorPredefined.ROSE.index)
                        in 90..99 -> ExcelUtil.MyCell("基本规范", fontColor = HSSFColor.HSSFColorPredefined.GOLD.index)
                        100 -> ExcelUtil.MyCell("规范", fontColor = HSSFColor.HSSFColorPredefined.BRIGHT_GREEN.index)
                        -1 -> ExcelUtil.MyCell("", fontColor = HSSFColor.HSSFColorPredefined.BLACK.index)
                        else -> ExcelUtil.MyCell("超出范围:${s}", fontColor = HSSFColor.HSSFColorPredefined.BLACK.index)
                    val normalization = when {
                        s in 0..39 -> ExcelUtil.MyCell("严重不规范", fontColor = HSSFColor.HSSFColorPredefined.RED.index)
                        s in 40..89 -> ExcelUtil.MyCell("不规范", fontColor = HSSFColor.HSSFColorPredefined.ROSE.index)
                        s in 90..99 -> ExcelUtil.MyCell("基本规范", fontColor = HSSFColor.HSSFColorPredefined.GOLD.index)
                        s >= 100 -> ExcelUtil.MyCell("规范", fontColor = HSSFColor.HSSFColorPredefined.BRIGHT_GREEN.index)
                        else -> ExcelUtil.MyCell("", fontColor = HSSFColor.HSSFColorPredefined.BLACK.index)
                    }
                    add(code)
                    add(normalization)
src/main/kotlin/cn/flightfeather/supervision/business/report/template/ProAnalysisSummary.kt
@@ -12,7 +12,6 @@
import cn.flightfeather.supervision.domain.ds1.entity.SceneMixingPlant
import cn.flightfeather.supervision.domain.ds1.entity.SceneStorageYard
import cn.flightfeather.supervision.domain.ds1.entity.SceneWharf
import kotlin.math.round
/**
 * åˆ†è¡—镇问题整改分析汇总表
@@ -47,16 +46,16 @@
            districtMap[k]?.apply {
                sceneCount++
                val status = when (dataSource.config.sceneType.toString()) {
                    Constant.ScenseType.TYPE1.value -> {
                    Constant.SceneType.TYPE1.value -> {
                        (rowData.baseScene as SceneConstructionSite?)?.csStatus
                    }
                    Constant.ScenseType.TYPE2.value -> {
                    Constant.SceneType.TYPE2.value -> {
                        (rowData.baseScene as SceneWharf?)?.getwStatus()
                    }
                    Constant.ScenseType.TYPE3.value -> {
                    Constant.SceneType.TYPE3.value -> {
                        (rowData.baseScene as SceneMixingPlant?)?.mpStatus
                    }
                    Constant.ScenseType.TYPE14.value -> {
                    Constant.SceneType.TYPE14.value -> {
                        (rowData.baseScene as SceneStorageYard?)?.syStatus
                    }
                    else -> ""
src/main/kotlin/cn/flightfeather/supervision/business/report/template/ProTypeRankMainSummary.kt
@@ -3,7 +3,6 @@
import cn.flightfeather.supervision.business.report.DataSource
import cn.flightfeather.supervision.common.utils.Constant
import cn.flightfeather.supervision.common.utils.ExcelUtil
import kotlin.math.round
class ProTypeRankMainSummary(dataSource: DataSource) : ProTypeRankSummary(dataSource) {
    override val templateName: String = "月度主要或典型问题分析表"
@@ -11,7 +10,7 @@
    override fun formatTable(summarys: MutableList<Summary>) {
        //排名靠前的max个问题被认定为主要或典型问题
        val max = when (dataSource.config.sceneType.toString()) {
            Constant.ScenseType.TYPE1.value -> 5
            Constant.SceneType.TYPE1.value -> 5
            else -> 4
        }
src/main/kotlin/cn/flightfeather/supervision/business/report/template/ProTypeStatusSummary.kt
@@ -6,7 +6,6 @@
import cn.flightfeather.supervision.common.utils.Constant
import cn.flightfeather.supervision.common.utils.ExcelUtil
import cn.flightfeather.supervision.domain.ds1.entity.SceneConstructionSite
import kotlin.math.round
class ProTypeStatusSummary(dataSource: DataSource) : BaseTemplate(dataSource) {
    override val cols: List<BaseCols> = listOf()
@@ -14,7 +13,7 @@
    @Throws(Exception::class)
    override fun execute() {
        if (dataSource.config.sceneType.toString() != Constant.ScenseType.TYPE1.value) {
        if (dataSource.config.sceneType.toString() != Constant.SceneType.TYPE1.value) {
//            throw IllegalStateException("${templateName}只能针对工地进行分析,当前传入场景类型编号为${dataSource.config.sceneType}")
            println("sadas")
        }
src/main/kotlin/cn/flightfeather/supervision/business/storage/JinAnScore.kt
ÎļþÒÑɾ³ý
src/main/kotlin/cn/flightfeather/supervision/business/storage/StAutoScore.kt
ÎļþÒÑɾ³ý
src/main/kotlin/cn/flightfeather/supervision/business/storage/item/CsScoreItem_1.kt
ÎļþÒÑɾ³ý
src/main/kotlin/cn/flightfeather/supervision/business/storage/item/CsScoreItem_2.kt
ÎļþÒÑɾ³ý
src/main/kotlin/cn/flightfeather/supervision/business/storage/item/MpScoreItem_1.kt
ÎļþÒÑɾ³ý
src/main/kotlin/cn/flightfeather/supervision/business/storage/item/MpScoreItem_2.kt
ÎļþÒÑɾ³ý
src/main/kotlin/cn/flightfeather/supervision/business/storage/item/StScoreItem_1.kt
ÎļþÒÑɾ³ý
src/main/kotlin/cn/flightfeather/supervision/business/storage/item/WhScoreItem_1.kt
ÎļþÒÑɾ³ý
src/main/kotlin/cn/flightfeather/supervision/business/storage/item/WhScoreItem_2.kt
ÎļþÒÑɾ³ý
src/main/kotlin/cn/flightfeather/supervision/business/storage/package-info.java
ÎļþÒÑɾ³ý
src/main/kotlin/cn/flightfeather/supervision/common/executor/BackgroundTaskCtrl.kt
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,126 @@
package cn.flightfeather.supervision.common.executor
import org.springframework.stereotype.Component
import java.time.LocalDateTime
import java.util.concurrent.ConcurrentHashMap
import java.util.concurrent.Executors
import kotlin.jvm.Throws
/**
 * åŽå°è€—时任务精确管理
 */
@Component
class BackgroundTaskCtrl {
    // ä»»åŠ¡åˆ—è¡¨
    private val taskCollection = ConcurrentHashMap<BgTaskType, ConcurrentHashMap<String, BgTask>>()
    // çº¿ç¨‹æ± 
    private val executorService = Executors.newCachedThreadPool()
    /**
     * æ–°å¢žä»»åŠ¡
     */
    @Throws(IllegalStateException::class)
    fun newTask(type: BgTaskType, id: String, name: String, task: () -> Boolean): BgTask {
        if (!taskCollection.containsKey(type)) {
            taskCollection[type] = ConcurrentHashMap<String, BgTask>()
        }
        val taskSet = taskCollection[type]!!
        if (taskSet.containsKey(id)) throw IllegalStateException("无法创建任务, ä»»åŠ¡[${name}]的id重复")
        val t = BgTask(type, id, name, task)
        taskSet[id] = t
        return t
    }
    /**
     * å¼€å§‹ä»»åŠ¡
     */
    @Throws(IllegalStateException::class)
    fun startTask(type: BgTaskType, id: String): BgTask {
        val taskSet = taskCollection[type] ?: throw throw IllegalStateException("无法开启任务,该任务类型[${type.des}]不存在")
        val t = taskSet[id] ?: throw IllegalStateException("无法开启任务,该任务[${id}]不存在")
        return startTask(t)
    }
    @Throws(IllegalStateException::class)
    fun startTask(task: BgTask): BgTask {
        if (task.taskStatus.status != TaskStatus.WAITING) {
            if (task.taskStatus.status == TaskStatus.RUNNING) {
                throw IllegalStateException("无法开启任务,任务[${task.name}]正在执行")
            } else {
                throw IllegalStateException("无法开启任务,任务[${task.name}]已结束")
            }
        } else {
            task.ready()
            task.future = executorService.submit { task.execute() }
            return task
        }
    }
    /**
     * æ–°å¢žå¹¶å¼€å§‹ä»»åŠ¡
     */
    @Throws(IllegalStateException::class)
    fun startNewTask(type: BgTaskType, id: String, name: String, task: () -> Boolean): BgTask {
        val t = newTask(type, id, name, task)
        return startTask(t)
    }
    /**
     * èŽ·å–ä»»åŠ¡çŠ¶æ€
     */
    fun getTaskStatus(type: BgTaskType?, id: String? = null): List<BgTaskStatus?> {
        if (type != null) {
            val set = taskCollection[type] ?: return emptyList()
            return if (id == null) {
                set.toList().map {
                    it.second.taskStatus
                }.sortedBy { it.createTime }
            } else {
                val s = set[id]?.taskStatus
                listOf(s)
            }
        } else {
            val res = mutableListOf<BgTaskStatus?>()
            taskCollection.forEach { (t, u) ->
                val statusList = u.toList().map {
                    it.second.taskStatus
                }
                res.addAll(statusList)
            }
            return res.sortedBy { it?.createTime }
        }
    }
    /**
     * å¼ºåˆ¶å…³é—­ä»»åŠ¡
     */
    @Throws(IllegalStateException::class)
    fun shutDownTask(type: BgTaskType, id: String?): List<BgTaskStatus?> {
        val taskMap = taskCollection[type] ?: throw IllegalStateException("无法关闭任务,任务类型[${type.des}]未创建")
        return if (id != null) {
            val task = taskMap[id] ?: throw IllegalStateException("无法关闭任务,任务[${id}]不存在")
            task.shutdown()
            listOf(task.taskStatus)
        } else {
            val res = mutableListOf<BgTaskStatus?>()
            taskMap.forEach { (t, u) ->
                u.shutdown()
                res.add(u.taskStatus)
            }
            res.sortedBy { it?.createTime }
        }
    }
    @Throws(IllegalStateException::class)
    fun removeTask(type: BgTaskType, id: String): Boolean {
        val statusList = shutDownTask(type, id)
        if (statusList.isNotEmpty()) {
            val s = statusList.first() ?: throw IllegalStateException("无法移除任务,任务不存在")
            taskCollection[s.type]?.remove(s.id)
            return true
        }
        return false
    }
}
src/main/kotlin/cn/flightfeather/supervision/common/executor/BgTask.kt
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,50 @@
package cn.flightfeather.supervision.common.executor
import org.springframework.scheduling.annotation.Async
import java.time.LocalDateTime
import java.util.concurrent.Future
/**
 * åŽå°ä»»åŠ¡
 */
class BgTask(
    val type: BgTaskType,
    val id: String,
    val name: String,
    private val task: () -> Boolean,
) {
    var taskStatus = BgTaskStatus(type, id, name)
    var future: Future<*>? = null
    fun ready() {
        taskStatus.status = TaskStatus.RUNNING
        taskStatus.startTime = LocalDateTime.now()
    }
    fun execute() {
        val res = task()
        if (res) success() else fail()
    }
    fun success() {
        taskStatus.status = TaskStatus.SUCCESS
        complete()
    }
    fun fail() {
        taskStatus.status = TaskStatus.FAIL
        complete()
    }
    fun shutdown() {
        if (future?.isCancelled == false && !future!!.isDone) {
            future!!.cancel(true)
            taskStatus.status = TaskStatus.SHUTDOWN
            complete()
        }
    }
    fun complete() {
        taskStatus.endTime = LocalDateTime.now()
    }
}
src/main/kotlin/cn/flightfeather/supervision/common/executor/BgTaskConditionVo.kt
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,10 @@
package cn.flightfeather.supervision.common.executor
/**
 * åŽå°ä»»åŠ¡æŸ¥è¯¢æ¡ä»¶
 */
class BgTaskConditionVo {
    var type: BgTaskType? = null
    var id: String? = null
}
src/main/kotlin/cn/flightfeather/supervision/common/executor/BgTaskStatus.kt
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,56 @@
package cn.flightfeather.supervision.common.executor
import java.time.Duration
import java.time.LocalDateTime
/**
 * åŽå°è€—时任务状态
 */
class BgTaskStatus(
    val type: BgTaskType,
    val id: String,
    val name: String,
) {
    //    ä»»åŠ¡çŠ¶æ€
    var status: TaskStatus = TaskStatus.WAITING
    //    å¼€å§‹æ—¶é—´
    var startTime: LocalDateTime? = null
    //    ç»“束时间
    var endTime: LocalDateTime? = null
    //    åˆ›å»ºæ—¶é—´
    var createTime: LocalDateTime = LocalDateTime.now()
    //    è¿è¡Œæ—¶é•¿ï¼ˆç§’)
    val runTime: Long
        get() {
            when (status) {
                TaskStatus.WAITING -> {
                    return 0
                }
                TaskStatus.RUNNING -> {
                    val now = LocalDateTime.now()
                    val duration = Duration.between(startTime, now)
                    return duration.toMillis() / 1000
                }
                TaskStatus.SUCCESS,
                TaskStatus.FAIL,
                TaskStatus.SHUTDOWN,
                -> {
                    val duration = Duration.between(startTime, endTime)
                    return duration.toMillis() / 1000
                }
            }
        }
}
enum class TaskStatus {
    WAITING,
    RUNNING,
    SUCCESS,
    FAIL,
    SHUTDOWN
}
src/main/kotlin/cn/flightfeather/supervision/common/executor/BgTaskType.kt
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,20 @@
package cn.flightfeather.supervision.common.executor
enum class BgTaskType(val index: Int, val des: String) {
    //测试任务
    TEST(0, "测试任务"),
    //自动评分
    AUTO_SCORE(1, "自动评估任务");
    companion object {
        fun getByIndex(index: Int?): BgTaskType? {
            return when (index) {
                TEST.index -> TEST
                AUTO_SCORE.index -> AUTO_SCORE
                else -> null
            }
        }
    }
}
src/main/kotlin/cn/flightfeather/supervision/common/utils/Constant.kt
@@ -2,8 +2,12 @@
class Constant{
    //用户
    enum class UserType(val text: String){
        ALLUSER("0")//所有用户
    enum class UserType(val value: Int, val des: String){
        ALL_USER(-1,"0"),//所有用户
        ADMIN(0, "管理员"),
        INSIDER(1, "内部人员"),
        GOV(2, "政府部门"),
        ENTERPRISE(3, "企业")
    }
    //规范类别
    enum class RuleType(val value: Byte, val text: String){
@@ -16,7 +20,7 @@
        RUNINGSTATUS3("3","已结束")
    }
    //场景类型
    enum class ScenseType(val value: String,  val text: String){
    enum class SceneType(val value: String, val text: String){
        TYPE1("1","工地"), TYPE2("2","码头"),
        TYPE3("3","水泥搅拌站"), TYPE4("4","工业企业"),
        TYPE5("5","餐饮"), TYPE6("6","汽修"),
src/main/kotlin/cn/flightfeather/supervision/config/Swagger2Configuration.kt
@@ -16,16 +16,16 @@
 */
@Configuration
@EnableSwagger2
class Swagger2Configuration {
class Swagger2Configuration(
    @Value("\${springfox.documentation.swagger.v2.enabled}")
    var swagger2Enable: Boolean
) {
    companion object {
        const val SWAGGER_SCAN_BASE_PACKAGE = "cn.flightfeather.supervision"
        const val VERSION = "1.0.0"
    }
    @Value("\${springfox.documentation.swagger.v2.enabled}")
    private val swagger2Enable: Boolean = true
    @Bean
    fun createRestApi(): Docket =
src/main/kotlin/cn/flightfeather/supervision/domain/ds1/entity/Evaluationrule.kt
@@ -98,7 +98,7 @@
     * ä»Žå€¼åŸŸè¡¨èŽ·å–ï¼ˆ1 çœï¼›2 åœ°å¸‚ï¼›3 åŒºåŽ¿ï¼›4 è¡—镇;5 æ··åˆï¼‰
     */
    @Column(name = "ER_IsUse")
    var isuse: String? = null
    var isuse: Boolean? = null
    @Column(name = "ER_StartTime")
    var starttime: Date? = null
src/main/kotlin/cn/flightfeather/supervision/domain/ds1/mapper/EvaluationMapper.kt
@@ -2,8 +2,11 @@
import cn.flightfeather.supervision.domain.ds1.entity.Evaluation
import cn.flightfeather.supervision.domain.util.MyMapper
import cn.flightfeather.supervision.lightshare.vo.AutoScoreResultVo
import org.apache.ibatis.annotations.Mapper
@Mapper
interface EvaluationMapper:MyMapper<Evaluation> {
    fun findEvaluation(topTaskId: String, sceneTypeId: String): List<AutoScoreResultVo>
}
src/main/kotlin/cn/flightfeather/supervision/domain/ds1/repository/EvaluationRep.kt
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,43 @@
package cn.flightfeather.supervision.domain.ds1.repository
import cn.flightfeather.supervision.domain.ds1.entity.Evaluation
import cn.flightfeather.supervision.domain.ds1.mapper.EvaluationMapper
import cn.flightfeather.supervision.domain.ds1.mapper.ItemevaluationMapper
import cn.flightfeather.supervision.lightshare.vo.AreaVo
import cn.flightfeather.supervision.lightshare.vo.AutoScoreResultVo
import org.springframework.stereotype.Repository
import tk.mybatis.mapper.entity.Example
import java.time.LocalDate
@Repository
class EvaluationRep(
    private val evaluationMapper: EvaluationMapper,
    private val itemevaluationMapper: ItemevaluationMapper,
    private val taskRep: TaskRep,
) {
    /**
     * æŸ¥æ‰¾åœºæ™¯å¯¹åº”的得分
     * @param sceneId åœºæ™¯id
     * @param date æ—¥æœŸï¼Œåªä½¿ç”¨å¹´å’Œæœˆ
     * @return
     */
    fun findByScene(sceneId: String?, date: LocalDate): Evaluation? {
        val sT = date.withDayOfMonth(1).atStartOfDay()
        val eT = sT.plusMonths(1).minusSeconds(1)
        val res = evaluationMapper.selectByExample(Example(Evaluation::class.java).apply {
            createCriteria().andEqualTo("sguid", sceneId)
                .andBetween("evaluatetime", sT, eT)
        })
        return if (res.isNotEmpty()) res[0] else null
    }
    /**
     * æŸ¥æ‰¾è‡ªåŠ¨è¯„åˆ†ç»“æžœ
     */
    fun findAutoScore(areaVo: AreaVo): List<AutoScoreResultVo?>? {
        areaVo.scensetypeid ?: return null
        val task = taskRep.findOneTask(areaVo) ?: return null
        return evaluationMapper.findEvaluation(task.tguid!!, areaVo.scensetypeid!!)
    }
}
src/main/kotlin/cn/flightfeather/supervision/domain/ds1/repository/EvaluationRuleRep.kt
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,30 @@
package cn.flightfeather.supervision.domain.ds1.repository
import cn.flightfeather.supervision.domain.ds1.entity.Evaluationrule
import cn.flightfeather.supervision.domain.ds1.mapper.EvaluationruleMapper
import cn.flightfeather.supervision.lightshare.vo.AreaEvaVo
import org.springframework.stereotype.Repository
import tk.mybatis.mapper.entity.Example
/**
 * è¯„估规则数据库相关操作
 */
@Repository
class EvaluationRuleRep(private val evaluationruleMapper: EvaluationruleMapper) {
    /**
     * æ ¹æ®å‚数查询总规则
     * @param areaEvaVo æŸ¥è¯¢å‚æ•°
     */
    fun findBaseRule(areaEvaVo: AreaEvaVo): List<Evaluationrule?> {
        return evaluationruleMapper.selectByExample(Example(Evaluationrule::class.java).apply {
            createCriteria().andEqualTo("tasktypeid", areaEvaVo.taskTypeId)
                .andEqualTo("scensetypeid", areaEvaVo.scensetypeid)
                .andEqualTo("provincecode", areaEvaVo.provincecode)
                .andEqualTo("citycode", areaEvaVo.citycode)
                .andEqualTo("districtcode", areaEvaVo.districtcode)
                .andEqualTo("towncode", areaEvaVo.towncode)
                .andEqualTo("isuse", true)
        })
    }
}
src/main/kotlin/cn/flightfeather/supervision/domain/ds1/repository/TaskRep.kt
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,38 @@
package cn.flightfeather.supervision.domain.ds1.repository
import cn.flightfeather.supervision.domain.ds1.entity.Task
import cn.flightfeather.supervision.domain.ds1.mapper.TaskMapper
import cn.flightfeather.supervision.lightshare.vo.AreaVo
import org.springframework.stereotype.Repository
import java.time.LocalDate
import java.time.ZoneId
import java.util.*
@Repository
class TaskRep(private val taskMapper: TaskMapper) {
    private fun exampleTask(areaVo: AreaVo): Task?{
        areaVo.starttime ?: return null
        val mStart = LocalDate.parse(areaVo.starttime).withDayOfMonth(1).atStartOfDay()
        val mEnd = mStart.plusMonths(1).minusSeconds(1)
        return Task().apply {
            provincecode = areaVo.provincecode
            citycode = areaVo.citycode
            districtcode = areaVo.districtcode
            starttime = Date.from(mStart.atZone(ZoneId.systemDefault()).toInstant())
            endtime = Date.from(mEnd.atZone(ZoneId.systemDefault()).toInstant())
        }
    }
    /**
     * æŸ¥æ‰¾ä¸€ä¸ªæ€»ä»»åŠ¡
     */
    fun findOneTask(areaVo: AreaVo): Task? {
        val example = exampleTask(areaVo) ?: return null
        return taskMapper.selectOne(example)
    }
    fun findTasks(areaVo: AreaVo): List<Task?> {
        val example = exampleTask(areaVo) ?: return emptyList()
        return taskMapper.select(example)
    }
}
src/main/kotlin/cn/flightfeather/supervision/domain/ds2/entity/OverallEvaluation.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,211 @@
package cn.flightfeather.supervision.domain.ds2.entity;
import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import java.util.Date;
@Table(name = "ea_t_overall_evaluation")
public class OverallEvaluation {
    @Id
    @Column(name = "OE_GUID")
    private Integer oeGuid;
    @Column(name = "BI_GUID")
    private String biGuid;
    @Column(name = "OE_Score")
    private Integer oeScore;
    @Column(name = "OE_Publish_Time")
    private Date oePublishTime;
    @Column(name = "OE_Update_Time")
    private Date oeUpdateTime;
    @Column(name = "OE_Scene_Type_Id")
    private Byte oeSceneTypeId;
    @Column(name = "OE_Scene_Type")
    private String oeSceneType;
    @Column(name = "OE_Period")
    private String oePeriod;
    @Column(name = "OE_Code_Level")
    private Byte oeCodeLevel;
    /**
     * ç”Ÿæ•ˆå¼€å§‹æ—¶é—´
     */
    @Column(name = "OE_Start_Time")
    private Date oeStartTime;
    /**
     * ç”Ÿæ•ˆç»“束时间
     */
    @Column(name = "OE_End_Time")
    private Date oeEndTime;
    /**
     * @return OE_GUID
     */
    public Integer getOeGuid() {
        return oeGuid;
    }
    /**
     * @param oeGuid
     */
    public void setOeGuid(Integer oeGuid) {
        this.oeGuid = oeGuid;
    }
    /**
     * @return BI_GUID
     */
    public String getBiGuid() {
        return biGuid;
    }
    /**
     * @param biGuid
     */
    public void setBiGuid(String biGuid) {
        this.biGuid = biGuid == null ? null : biGuid.trim();
    }
    /**
     * @return OE_Score
     */
    public Integer getOeScore() {
        return oeScore;
    }
    /**
     * @param oeScore
     */
    public void setOeScore(Integer oeScore) {
        this.oeScore = oeScore;
    }
    /**
     * @return OE_Publish_Time
     */
    public Date getOePublishTime() {
        return oePublishTime;
    }
    /**
     * @param oePublishTime
     */
    public void setOePublishTime(Date oePublishTime) {
        this.oePublishTime = oePublishTime;
    }
    /**
     * @return OE_Update_Time
     */
    public Date getOeUpdateTime() {
        return oeUpdateTime;
    }
    /**
     * @param oeUpdateTime
     */
    public void setOeUpdateTime(Date oeUpdateTime) {
        this.oeUpdateTime = oeUpdateTime;
    }
    /**
     * @return OE_Scene_Type_Id
     */
    public Byte getOeSceneTypeId() {
        return oeSceneTypeId;
    }
    /**
     * @param oeSceneTypeId
     */
    public void setOeSceneTypeId(Byte oeSceneTypeId) {
        this.oeSceneTypeId = oeSceneTypeId;
    }
    /**
     * @return OE_Scene_Type
     */
    public String getOeSceneType() {
        return oeSceneType;
    }
    /**
     * @param oeSceneType
     */
    public void setOeSceneType(String oeSceneType) {
        this.oeSceneType = oeSceneType == null ? null : oeSceneType.trim();
    }
    /**
     * @return OE_Period
     */
    public String getOePeriod() {
        return oePeriod;
    }
    /**
     * @param oePeriod
     */
    public void setOePeriod(String oePeriod) {
        this.oePeriod = oePeriod == null ? null : oePeriod.trim();
    }
    /**
     * @return OE_Code_Level
     */
    public Byte getOeCodeLevel() {
        return oeCodeLevel;
    }
    /**
     * @param oeCodeLevel
     */
    public void setOeCodeLevel(Byte oeCodeLevel) {
        this.oeCodeLevel = oeCodeLevel;
    }
    /**
     * èŽ·å–ç”Ÿæ•ˆå¼€å§‹æ—¶é—´
     *
     * @return RE_Start_Time - ç”Ÿæ•ˆå¼€å§‹æ—¶é—´
     */
    public Date getOeStartTime() {
        return oeStartTime;
    }
    /**
     * è®¾ç½®ç”Ÿæ•ˆå¼€å§‹æ—¶é—´
     *
     * @param oeStartTime ç”Ÿæ•ˆå¼€å§‹æ—¶é—´
     */
    public void setOeStartTime(Date oeStartTime) {
        this.oeStartTime = oeStartTime;
    }
    /**
     * èŽ·å–ç”Ÿæ•ˆç»“æŸæ—¶é—´
     *
     * @return RE_End_Time - ç”Ÿæ•ˆç»“束时间
     */
    public Date getOeEndTime() {
        return oeEndTime;
    }
    /**
     * è®¾ç½®ç”Ÿæ•ˆç»“束时间
     *
     * @param oeEndTime ç”Ÿæ•ˆç»“束时间
     */
    public void setOeEndTime(Date oeEndTime) {
        this.oeEndTime = oeEndTime;
    }
}
src/main/kotlin/cn/flightfeather/supervision/domain/ds2/mapper/OverallEvaluationMapper.kt
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,8 @@
package cn.flightfeather.supervision.domain.ds2.mapper
import cn.flightfeather.supervision.domain.ds2.entity.OverallEvaluation
import cn.flightfeather.supervision.domain.util.MyMapper
import org.apache.ibatis.annotations.Mapper
@Mapper
interface OverallEvaluationMapper : MyMapper<OverallEvaluation?>
src/main/kotlin/cn/flightfeather/supervision/domain/ds2/repository/OverallEvaluationRep.kt
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,60 @@
package cn.flightfeather.supervision.domain.ds2.repository
import cn.flightfeather.supervision.business.autooutput.score.ScoreUtil
import cn.flightfeather.supervision.common.utils.Constant
import cn.flightfeather.supervision.domain.ds2.entity.OverallEvaluation
import cn.flightfeather.supervision.domain.ds2.mapper.OverallEvaluationMapper
import org.springframework.stereotype.Repository
import java.time.LocalDate
import java.time.ZoneId
import java.util.*
@Repository
class OverallEvaluationRep(private val overallEvaluationMapper: OverallEvaluationMapper){
    /**
     * æ’入一条环信码记录
     * @param userId
     * @param score
     * @param sceneType
     * @param sT
     * @param eT
     * @return
     */
    fun insertOrUpdateOne(
        userId: String?,
        score: Int?,
        sceneType: Constant.SceneType,
        sT: LocalDate,
        eT: LocalDate,
    ): Int {
        val period = "${sT.year}/${sT.monthValue}-${eT.monthValue}"
        val codeLevel = ScoreUtil.scoreToCredit(score)
        val oE = overallEvaluationMapper.selectOne(OverallEvaluation().apply {
            biGuid = userId
            oePeriod = period
        })
        if (oE != null) {
            oE.oeScore = score
            oE.oeCodeLevel = codeLevel.first?.toByte()
            return overallEvaluationMapper.updateByPrimaryKey(oE)
        } else {
            val startTime = sT.withDayOfMonth(1)
            val endTime = eT.plusMonths(1).withDayOfMonth(1).minusDays(1)
            val publishTime = Date.from(endTime.plusDays(1).atStartOfDay().atZone(ZoneId.systemDefault()).toInstant())
            val e = OverallEvaluation().apply {
                biGuid = userId
                oeScore = score
                oePublishTime = publishTime
                oeUpdateTime = publishTime
                oeSceneTypeId = Constant.SceneType.typeMap(sceneType.value.toByte())
                oeSceneType = sceneType.text
                oePeriod = period
                oeCodeLevel = codeLevel.first?.toByte()
                oeStartTime = Date.from(startTime.atStartOfDay().atZone(ZoneId.systemDefault()).toInstant())
                oeEndTime = Date.from(endTime.atStartOfDay().atZone(ZoneId.systemDefault()).toInstant())
            }
            return overallEvaluationMapper.insert(e)
        }
    }
}
src/main/kotlin/cn/flightfeather/supervision/domain/ds2/repository/UserInfoTZRep.kt
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,28 @@
package cn.flightfeather.supervision.domain.ds2.repository
import cn.flightfeather.supervision.common.utils.Constant
import cn.flightfeather.supervision.domain.ds2.entity.UserinfoTZ
import cn.flightfeather.supervision.domain.ds2.mapper.UserinfoTZMapper
import org.springframework.stereotype.Repository
import tk.mybatis.mapper.entity.Example
@Repository
class UserInfoTZRep(private val userinfoTZMapper: UserinfoTZMapper) {
    /**
     * æŸ¥æ‰¾åœ¨çº¿çš„æ­£å¼ä¼ä¸šç”¨æˆ·
     * @param district åŒºåŽ¿åç§°
     * @param sceneType åœºæ™¯ç±»åž‹
     * @return
     */
    fun findEnterpriseUser(district: String?, sceneType: Constant.SceneType): List<UserinfoTZ?> {
        val type = Constant.SceneType.typeMap(sceneType.value.toByte())
        return userinfoTZMapper.selectByExample(Example(UserinfoTZ::class.java).apply {
            createCriteria().andEqualTo("extension2", type)
                .andEqualTo("extension1", district)
                .andEqualTo("usertypeid", Constant.UserType.ENTERPRISE.value)
                .andEqualTo("isenable", true)
            and(createCriteria().orIsNull("workno").orNotEqualTo("workno", "test"))
        })
    }
}
src/main/kotlin/cn/flightfeather/supervision/domain/ds2/repository/UserMapRep.kt
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,38 @@
package cn.flightfeather.supervision.domain.ds2.repository
import cn.flightfeather.supervision.domain.ds1.entity.Scense
import cn.flightfeather.supervision.domain.ds1.mapper.ScenseMapper
import cn.flightfeather.supervision.domain.ds1.mapper.UserinfoMapper
import cn.flightfeather.supervision.domain.ds2.entity.UserMap
import cn.flightfeather.supervision.domain.ds2.entity.UserinfoTZ
import cn.flightfeather.supervision.domain.ds2.mapper.UserMapMapper
import org.springframework.stereotype.Repository
@Repository
class UserMapRep(
    private val userMapMapper: UserMapMapper,
    private val scenseMapper: ScenseMapper,
    private val userinfoMapper: UserinfoMapper
) {
    /**
     * ä»Žé£žç¾½ç›‘管系统中查找基本信息
     * @param userinfoTZ é£žç¾½çŽ¯å¢ƒä¸­çš„ç”¨æˆ·ä¿¡æ¯
     * @return
     */
    fun findFromSupervision(userinfoTZ: UserinfoTZ?): Scense? {
        val userMap = UserMap().apply {
            tzUserId = userinfoTZ?.guid
        }
        // æ‰¾åˆ°ä¸¤ä¸ªç³»ç»Ÿç”¨æˆ·çš„对应关系
        val uMap = userMapMapper.selectOne(userMap)
        if (uMap == null) {
            println("${userinfoTZ?.guid}, ${userinfoTZ?.realname}")
            return null
        }
        // æ‰¾åˆ°é£žç¾½ç›‘管中的用户信息
        val userInfoSp = userinfoMapper.selectByPrimaryKey(uMap.svUserId)
        // æ‰¾åˆ°é£žç¾½ç›‘管中的场景信息
        return scenseMapper.selectByPrimaryKey(userInfoSp.dGuid)
    }
}
src/main/kotlin/cn/flightfeather/supervision/domain/ds3/entity/FumeSiteMap.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,144 @@
package cn.flightfeather.supervision.domain.ds3.entity;
import java.util.Date;
import javax.persistence.*;
@Table(name = "fu_xh_t_site_map")
public class FumeSiteMap {
    @Id
    @Column(name = "Id")
    private Integer id;
    @Column(name = "TZ_User_Id")
    private String tzUserId;
    @Column(name = "TZ_User_Name")
    private String tzUserName;
    @Column(name = "XH_Device_Code")
    private String xhDeviceCode;
    @Column(name = "XH_Device_Name")
    private String xhDeviceName;
    @Column(name = "SV_User_Id")
    private String svUserId;
    @Column(name = "SV_User_Name")
    private String svUserName;
    @Column(name = "Create_Time")
    private Date createTime;
    /**
     * @return Id
     */
    public Integer getId() {
        return id;
    }
    /**
     * @param id
     */
    public void setId(Integer id) {
        this.id = id;
    }
    /**
     * @return TZ_User_Id
     */
    public String getTzUserId() {
        return tzUserId;
    }
    /**
     * @param tzUserId
     */
    public void setTzUserId(String tzUserId) {
        this.tzUserId = tzUserId == null ? null : tzUserId.trim();
    }
    /**
     * @return TZ_User_Name
     */
    public String getTzUserName() {
        return tzUserName;
    }
    /**
     * @param tzUserName
     */
    public void setTzUserName(String tzUserName) {
        this.tzUserName = tzUserName == null ? null : tzUserName.trim();
    }
    /**
     * @return XH_Device_Code
     */
    public String getXhDeviceCode() {
        return xhDeviceCode;
    }
    /**
     * @param xhDeviceCode
     */
    public void setXhDeviceCode(String xhDeviceCode) {
        this.xhDeviceCode = xhDeviceCode == null ? null : xhDeviceCode.trim();
    }
    /**
     * @return XH_Device_Name
     */
    public String getXhDeviceName() {
        return xhDeviceName;
    }
    /**
     * @param xhDeviceName
     */
    public void setXhDeviceName(String xhDeviceName) {
        this.xhDeviceName = xhDeviceName == null ? null : xhDeviceName.trim();
    }
    /**
     * @return SV_User_Id
     */
    public String getSvUserId() {
        return svUserId;
    }
    /**
     * @param svUserId
     */
    public void setSvUserId(String svUserId) {
        this.svUserId = svUserId == null ? null : svUserId.trim();
    }
    /**
     * @return SV_User_Name
     */
    public String getSvUserName() {
        return svUserName;
    }
    /**
     * @param svUserName
     */
    public void setSvUserName(String svUserName) {
        this.svUserName = svUserName == null ? null : svUserName.trim();
    }
    /**
     * @return Create_Time
     */
    public Date getCreateTime() {
        return createTime;
    }
    /**
     * @param createTime
     */
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
}
src/main/kotlin/cn/flightfeather/supervision/domain/ds3/entity/JSDustData.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,139 @@
package cn.flightfeather.supervision.domain.ds3.entity;
import java.util.Date;
import javax.persistence.*;
@Table(name = "ja_t_dust_site_data_info")
public class JSDustData {
    @Id
    private Integer id;
    @Column(name = "mn_code")
    private String mnCode;
    @Column(name = "dust_value")
    private Double dustValue;
    @Column(name = "noise_value")
    private Double noiseValue;
    private Date lst;
    private String quality;
    private Integer grade;
    private String flag;
    /**
     * @return id
     */
    public Integer getId() {
        return id;
    }
    /**
     * @param id
     */
    public void setId(Integer id) {
        this.id = id;
    }
    /**
     * @return mn_code
     */
    public String getMnCode() {
        return mnCode;
    }
    /**
     * @param mnCode
     */
    public void setMnCode(String mnCode) {
        this.mnCode = mnCode == null ? null : mnCode.trim();
    }
    /**
     * @return dust_value
     */
    public Double getDustValue() {
        return dustValue;
    }
    /**
     * @param dustValue
     */
    public void setDustValue(Double dustValue) {
        this.dustValue = dustValue;
    }
    /**
     * @return noise_value
     */
    public Double getNoiseValue() {
        return noiseValue;
    }
    /**
     * @param noiseValue
     */
    public void setNoiseValue(Double noiseValue) {
        this.noiseValue = noiseValue;
    }
    /**
     * @return lst
     */
    public Date getLst() {
        return lst;
    }
    /**
     * @param lst
     */
    public void setLst(Date lst) {
        this.lst = lst;
    }
    /**
     * @return quality
     */
    public String getQuality() {
        return quality;
    }
    /**
     * @param quality
     */
    public void setQuality(String quality) {
        this.quality = quality == null ? null : quality.trim();
    }
    /**
     * @return grade
     */
    public Integer getGrade() {
        return grade;
    }
    /**
     * @param grade
     */
    public void setGrade(Integer grade) {
        this.grade = grade;
    }
    /**
     * @return flag
     */
    public String getFlag() {
        return flag;
    }
    /**
     * @param flag
     */
    public void setFlag(String flag) {
        this.flag = flag == null ? null : flag.trim();
    }
}
src/main/kotlin/cn/flightfeather/supervision/domain/ds3/entity/JSDustSiteMap.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,144 @@
package cn.flightfeather.supervision.domain.ds3.entity;
import java.util.Date;
import javax.persistence.*;
@Table(name = "du_js_t_site_map")
public class JSDustSiteMap {
    @Id
    @Column(name = "Id")
    private Integer id;
    @Column(name = "TZ_User_Id")
    private String tzUserId;
    @Column(name = "TZ_User_Name")
    private String tzUserName;
    @Column(name = "JS_Device_Code")
    private String jsDeviceCode;
    @Column(name = "JS_Device_Name")
    private String jsDeviceName;
    @Column(name = "SV_User_Id")
    private String svUserId;
    @Column(name = "SV_User_Name")
    private String svUserName;
    @Column(name = "Create_Time")
    private Date createTime;
    /**
     * @return Id
     */
    public Integer getId() {
        return id;
    }
    /**
     * @param id
     */
    public void setId(Integer id) {
        this.id = id;
    }
    /**
     * @return TZ_User_Id
     */
    public String getTzUserId() {
        return tzUserId;
    }
    /**
     * @param tzUserId
     */
    public void setTzUserId(String tzUserId) {
        this.tzUserId = tzUserId == null ? null : tzUserId.trim();
    }
    /**
     * @return TZ_User_Name
     */
    public String getTzUserName() {
        return tzUserName;
    }
    /**
     * @param tzUserName
     */
    public void setTzUserName(String tzUserName) {
        this.tzUserName = tzUserName == null ? null : tzUserName.trim();
    }
    /**
     * @return JS_Device_Code
     */
    public String getJsDeviceCode() {
        return jsDeviceCode;
    }
    /**
     * @param jsDeviceCode
     */
    public void setJsDeviceCode(String jsDeviceCode) {
        this.jsDeviceCode = jsDeviceCode == null ? null : jsDeviceCode.trim();
    }
    /**
     * @return JS_Device_Name
     */
    public String getJsDeviceName() {
        return jsDeviceName;
    }
    /**
     * @param jsDeviceName
     */
    public void setJsDeviceName(String jsDeviceName) {
        this.jsDeviceName = jsDeviceName == null ? null : jsDeviceName.trim();
    }
    /**
     * @return SV_User_Id
     */
    public String getSvUserId() {
        return svUserId;
    }
    /**
     * @param svUserId
     */
    public void setSvUserId(String svUserId) {
        this.svUserId = svUserId == null ? null : svUserId.trim();
    }
    /**
     * @return SV_User_Name
     */
    public String getSvUserName() {
        return svUserName;
    }
    /**
     * @param svUserName
     */
    public void setSvUserName(String svUserName) {
        this.svUserName = svUserName == null ? null : svUserName.trim();
    }
    /**
     * @return Create_Time
     */
    public Date getCreateTime() {
        return createTime;
    }
    /**
     * @param createTime
     */
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
}
src/main/kotlin/cn/flightfeather/supervision/domain/ds3/enum/JSSceneType.kt
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,7 @@
package cn.flightfeather.supervision.domain.ds3.enum
enum class JSSceneType(val value:Int, val des:String) {
    Construction(1, "建筑工地"),
    Wharf(3, "码头"),
    MixingPlant(4, "搅拌站")
}
src/main/kotlin/cn/flightfeather/supervision/domain/ds3/mapper/FumeSiteMapMapper.kt
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,8 @@
package cn.flightfeather.supervision.domain.ds3.mapper
import cn.flightfeather.supervision.domain.ds3.entity.FumeSiteMap
import cn.flightfeather.supervision.domain.util.MyMapper
import org.apache.ibatis.annotations.Mapper
@Mapper
interface FumeSiteMapMapper : MyMapper<FumeSiteMap?>
src/main/kotlin/cn/flightfeather/supervision/domain/ds3/mapper/JSDustDataMapper.kt
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,12 @@
package cn.flightfeather.supervision.domain.ds3.mapper
import cn.flightfeather.supervision.domain.ds3.entity.JSDustData
import cn.flightfeather.supervision.domain.util.MyMapper
import org.apache.ibatis.annotations.Mapper
import java.util.*
@Mapper
interface JSDustDataMapper : MyMapper<JSDustData?> {
    fun getDataBySceneType(st: Date?, et: Date?, sceneType: Int, startIndex:Int, perPage:Int): List<JSDustData?>
}
src/main/kotlin/cn/flightfeather/supervision/domain/ds3/mapper/JSDustSiteMapMapper.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,8 @@
package cn.flightfeather.supervision.domain.ds3.mapper;
import cn.flightfeather.supervision.domain.ds3.entity.JSDustSiteMap;
import cn.flightfeather.supervision.domain.util.MyMapper;
import tk.mybatis.mapper.common.Mapper;
public interface JSDustSiteMapMapper extends MyMapper<JSDustSiteMap> {
}
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/BgTaskService.kt
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,30 @@
package cn.flightfeather.supervision.lightshare.service
import cn.flightfeather.supervision.common.executor.BgTaskConditionVo
import cn.flightfeather.supervision.common.executor.BgTaskStatus
interface BgTaskService {
    /**
     * èŽ·å–ä»»åŠ¡çŠ¶æ€
     */
    fun getTaskStatus(condition: BgTaskConditionVo): List<BgTaskStatus?>
    fun startTask(condition: BgTaskConditionVo): BgTaskStatus?
    fun shutDownTask(condition: BgTaskConditionVo): List<BgTaskStatus?>
    fun removeTask(condition: BgTaskConditionVo): Boolean
    /******************************Test************************************************/
    /**
     * æ–°å»ºå¹¶è¿è¡Œä¸€ä¸ªæµ‹è¯•任务
     */
    fun startNewTestTask(taskId: String): BgTaskStatus?
    /**
     * æ–°å»ºä¸€ä¸ªæµ‹è¯•任务
     */
    fun newTestTask(taskId: String): BgTaskStatus?
}
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/EvaluationService.kt
@@ -1,7 +1,11 @@
package cn.flightfeather.supervision.lightshare.service
import cn.flightfeather.supervision.common.executor.BgTaskStatus
import cn.flightfeather.supervision.domain.ds1.entity.Evaluation
import cn.flightfeather.supervision.domain.ds1.entity.Itemevaluation
import cn.flightfeather.supervision.lightshare.vo.AreaVo
import cn.flightfeather.supervision.lightshare.vo.AutoScoreResultVo
import cn.flightfeather.supervision.lightshare.vo.BaseResponse
interface EvaluationService {
@@ -19,8 +23,6 @@
    fun getRankOfTown(tguid: String, scensetypeid: String?):List<AreaVo>
    fun getTopTaskByScene(sceneId: String?): String?
    fun autoScore(districtCode: String, time: String): List<String>
    fun autoScore2(subTaskId: String): List<String>
@@ -28,4 +30,12 @@
    fun autoScore3(tGuid: String, sceneTypeId: String): String
    fun findByInspectionId(inspectionId:String):List<Evaluation>
    /**
     * è‡ªåŠ¨è¯„ä¼°
     * @param areaVo è¯„估范围
     */
    fun autoEvaluate(areaVo: AreaVo): BgTaskStatus?
    fun findAutoEvaluation(areaVo: AreaVo): List<AutoScoreResultVo?>?
}
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/EvaluationruleService.kt
@@ -1,6 +1,8 @@
package cn.flightfeather.supervision.lightshare.service
import cn.flightfeather.supervision.domain.ds1.entity.Evaluationrule
import cn.flightfeather.supervision.lightshare.vo.AreaEvaVo
import cn.flightfeather.supervision.lightshare.vo.AreaVo
interface EvaluationruleService {
@@ -16,4 +18,5 @@
    fun findBySpecificRule(tasktypeid: Byte?, scensetypeid: Byte?, districtcode: String?): Evaluationrule?
    fun find(areaVo: AreaEvaVo): List<Evaluationrule?>
}
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/TaskService.kt
@@ -1,10 +1,8 @@
package cn.flightfeather.supervision.lightshare.service
import cn.flightfeather.supervision.domain.ds1.entity.Task
import cn.flightfeather.supervision.lightshare.vo.DayTaskProgressVo
import cn.flightfeather.supervision.lightshare.vo.RankVo
import cn.flightfeather.supervision.lightshare.vo.TaskFrequencyVo
import cn.flightfeather.supervision.lightshare.vo.TaskVo
import cn.flightfeather.supervision.lightshare.vo.*
import org.springframework.web.bind.annotation.RequestBody
import java.util.*
interface TaskService {
@@ -52,4 +50,6 @@
    fun getByDistrictCode(districtCode: String, date: Date):List<TaskVo>
    fun findTask(areaVo: AreaVo):List<Task?>
}
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/BgTaskServiceImpl.kt
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,54 @@
package cn.flightfeather.supervision.lightshare.service.impl
import cn.flightfeather.supervision.common.executor.BackgroundTaskCtrl
import cn.flightfeather.supervision.common.executor.BgTaskConditionVo
import cn.flightfeather.supervision.common.executor.BgTaskStatus
import cn.flightfeather.supervision.common.executor.BgTaskType
import cn.flightfeather.supervision.lightshare.service.BgTaskService
import org.springframework.stereotype.Service
@Service
class BgTaskServiceImpl(private val backgroundTaskCtrl: BackgroundTaskCtrl) : BgTaskService {
    override fun getTaskStatus(condition: BgTaskConditionVo): List<BgTaskStatus?> {
        return backgroundTaskCtrl.getTaskStatus(condition.type, condition.id)
    }
    override fun startTask(condition: BgTaskConditionVo): BgTaskStatus? {
        condition.type ?: throw IllegalStateException("任务类型不能为空")
        condition.id ?: throw IllegalStateException("任务id不能为空")
        val task = backgroundTaskCtrl.startTask(condition.type!!, condition.id!!)
        return task.taskStatus
    }
    override fun shutDownTask(condition: BgTaskConditionVo): List<BgTaskStatus?> {
        condition.type ?: throw IllegalStateException("任务类型不能为空")
        return backgroundTaskCtrl.shutDownTask(condition.type!!, condition.id)
    }
    override fun removeTask(condition: BgTaskConditionVo): Boolean {
        condition.type ?: throw IllegalStateException("任务类型不能为空")
        condition.id ?: throw IllegalStateException("任务id不能为空")
        return backgroundTaskCtrl.removeTask(condition.type!!, condition.id!!)
    }
    override fun startNewTestTask(taskId: String): BgTaskStatus? {
        val task = backgroundTaskCtrl.startNewTask(BgTaskType.TEST, taskId, "测试任务-${taskId}") { testTask() }
        return task.taskStatus
    }
    override fun newTestTask(taskId: String): BgTaskStatus? {
        val task = backgroundTaskCtrl.newTask(BgTaskType.TEST, taskId, "测试任务-${taskId}") { testTask() }
        return task.taskStatus
    }
    private fun testTask(): Boolean {
        var times = 10
        while (times > 0) {
            Thread.sleep(2000)
            times--
        }
        return true
    }
}
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/DomainitemServiceImpl.kt
@@ -82,12 +82,12 @@
    override fun getLocation(sceneType: Int): List<Domainitem> {
        val lId = when (sceneType.toString()) {
            Constant.ScenseType.TYPE1.value -> Constant.INDUSTRY_LOCATION_ID
            Constant.ScenseType.TYPE2.value -> Constant.WHARF_LOCATION_ID
            Constant.ScenseType.TYPE14.value -> Constant.STORAGE_YARD_LOCATION_ID
            Constant.ScenseType.TYPE3.value -> Constant.MIX_LOCATION_ID
            Constant.ScenseType.TYPE5.value -> Constant.RESTAURANT_LOCATION_ID
            Constant.ScenseType.TYPE6.value -> Constant.Vehicle_LOCATION_ID
            Constant.SceneType.TYPE1.value -> Constant.INDUSTRY_LOCATION_ID
            Constant.SceneType.TYPE2.value -> Constant.WHARF_LOCATION_ID
            Constant.SceneType.TYPE14.value -> Constant.STORAGE_YARD_LOCATION_ID
            Constant.SceneType.TYPE3.value -> Constant.MIX_LOCATION_ID
            Constant.SceneType.TYPE5.value -> Constant.RESTAURANT_LOCATION_ID
            Constant.SceneType.TYPE6.value -> Constant.Vehicle_LOCATION_ID
            else -> Constant.INDUSTRY_LOCATION_ID
        }
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/EvaluationServiceImpl.kt
@@ -1,7 +1,11 @@
package cn.flightfeather.supervision.lightshare.service.impl
import cn.flightfeather.supervision.business.AutoScore2
import cn.flightfeather.supervision.business.storage.StAutoScore
import cn.flightfeather.supervision.business.autooutput.AopTaskCtrl
import cn.flightfeather.supervision.business.autooutput.score.AopEvaluation
import cn.flightfeather.supervision.common.executor.BackgroundTaskCtrl
import cn.flightfeather.supervision.common.executor.BgTaskStatus
import cn.flightfeather.supervision.common.executor.BgTaskType
import cn.flightfeather.supervision.domain.ds1.entity.Domainitem
import cn.flightfeather.supervision.domain.ds1.entity.Evaluation
import cn.flightfeather.supervision.domain.ds1.entity.Subtask
@@ -11,10 +15,12 @@
import cn.flightfeather.supervision.common.utils.Constant
import cn.flightfeather.supervision.common.utils.DateUtil
import cn.flightfeather.supervision.common.utils.Domain
import cn.flightfeather.supervision.domain.ds1.repository.EvaluationRep
import cn.flightfeather.supervision.lightshare.service.EvaluationService
import cn.flightfeather.supervision.lightshare.service.SubtaskService
import cn.flightfeather.supervision.lightshare.vo.AreaVo
import cn.flightfeather.supervision.lightshare.vo.SubtaskVo
import cn.flightfeather.supervision.lightshare.vo.AutoScoreResultVo
import cn.flightfeather.supervision.lightshare.vo.BaseResponse
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.stereotype.Service
import tk.mybatis.mapper.entity.Example
@@ -22,7 +28,11 @@
import kotlin.Comparator
@Service
class EvaluationServiceImpl(val evaluationMapper: EvaluationMapper) : EvaluationService {
class EvaluationServiceImpl(
    private val evaluationMapper: EvaluationMapper,
    private val evaluationRep: EvaluationRep,
    private val aopTaskCtrl: AopTaskCtrl,
) : EvaluationService {
    @Autowired
    lateinit var subtaskService: SubtaskService
@@ -31,7 +41,7 @@
    @Autowired
    lateinit var subtaskMapper: SubtaskMapper
    @Autowired
    lateinit var autoScore: StAutoScore
    lateinit var aopEvaluation: AopEvaluation
    private var isAutoScoreRunning = false
    //获取某顶层任务下某个场景的街道评分排名
@@ -187,21 +197,6 @@
        return areaVolist
    }
    override fun getTopTaskByScene(sceneId: String?): String? {
        val example = Example(Evaluation::class.java)
        val criteria = example.createCriteria()
        criteria.andEqualTo("sguid", sceneId)
        example.orderBy("evaluatetime").desc()
        val evaluationlist = evaluationMapper.selectByExample(example)
        var subtask = SubtaskVo()
        if (evaluationlist.isNotEmpty()) {
            val stguid = evaluationlist[0].stguid
            if (stguid != null)
                subtask = subtaskService.findByID(stguid)
        }
        return subtask.tguid
    }
    override fun autoScore(districtCode: String, time: String): List<String> {
        val resultList = mutableListOf<String>()
@@ -251,9 +246,10 @@
    override fun autoScore3(tGuid: String, sceneTypeId: String): String {
        if (isAutoScoreRunning) return "自动评分执行中,请等待完成"
        isAutoScoreRunning = true
        val t = Constant.ScenseType.getByValue(sceneTypeId)
        autoScore.sceneType = t
        autoScore.topTaskGrade(tGuid)
//        val t = Constant.ScenseType.getByValue(sceneTypeId)
//        autoScore.sceneType = t
//        autoScore.topTaskGrade(tGuid)
        aopEvaluation.executeByTopTask(tGuid, sceneTypeId.toInt())
        isAutoScoreRunning = false
        return "自动评分完成"
    }
@@ -263,4 +259,14 @@
            createCriteria().andEqualTo("iguid", inspectionId)
        })
    }
    override fun autoEvaluate(areaVo: AreaVo): BgTaskStatus? {
        //执行自动评估
        return aopTaskCtrl.startNewTask(areaVo)
    }
    override fun findAutoEvaluation(areaVo: AreaVo): List<AutoScoreResultVo?>? {
        //1. æŸ¥æ‰¾åŽ†å²è®°å½•ï¼ŒæŸ¥çœ‹è¯„ä¼°æ˜¯å¦å·²å­˜åœ¨
        return evaluationRep.findAutoScore(areaVo)
    }
}
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/EvaluationruleServiceImpl.kt
@@ -2,12 +2,17 @@
import cn.flightfeather.supervision.domain.ds1.entity.Evaluationrule
import cn.flightfeather.supervision.domain.ds1.mapper.EvaluationruleMapper
import cn.flightfeather.supervision.domain.ds1.repository.EvaluationRuleRep
import cn.flightfeather.supervision.lightshare.service.EvaluationruleService
import cn.flightfeather.supervision.lightshare.vo.AreaEvaVo
import org.springframework.stereotype.Service
import tk.mybatis.mapper.entity.Example
@Service
class EvaluationruleServiceImpl(val evaluationruleMapper: EvaluationruleMapper) : EvaluationruleService {
class EvaluationruleServiceImpl(
    private val evaluationruleMapper: EvaluationruleMapper,
    private val evaluationRuleRep: EvaluationRuleRep
) : EvaluationruleService {
    override fun findOne(id: String): Evaluationrule{
        return evaluationruleMapper.selectByPrimaryKey(id)
@@ -30,4 +35,8 @@
        val evaluationrules = evaluationruleMapper.selectByExample(example)
        return if (evaluationrules.size>0) evaluationrules[0] else null
    }
    override fun find(areaVo: AreaEvaVo): List<Evaluationrule?> {
        return evaluationRuleRep.findBaseRule(areaVo)
    }
}
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/InspectionServiceImpl.kt
@@ -29,6 +29,8 @@
    @Autowired
    lateinit var subtaskService: SubtaskService
    private val dateUtil = DateUtil()
    //获取污染场景版本主页的监管情况展示内容
    override fun getInspectionInfoByScene(sceneId: String, topTaskId: String): InspectionInfoVo {
        val maps = inspectionMapper.getInspectionInfoByScene(sceneId, topTaskId)
@@ -43,9 +45,10 @@
                inspectionInfoVo.inspectionId = map["inspectionId"].toString()
                inspectionInfoVo.subtaskId = map["subtaskId"].toString()
                inspectionInfoVo.inspected = map["isInspected"].toString().equals("1")
                inspectionInfoVo.inspectionTime = map["inspectionTime"].toString()
                val time = inspectionInfoVo.inspectionTime
                inspectionInfoVo.inspectionTime = time?.substring(0, time.length-11)
                map["inspectionTime"]?.let {
                    val time = it.toString()
                    inspectionInfoVo.inspectionTime = dateUtil.StringToString(time, DateUtil.DateStyle.YYYY_MM_DD)
                }
                inspectionInfoVo.inspectionTimes = map["inspectionTimes"].toString().toInt()
                inspectionInfoVo.promised = map["isPromised"].toString().equals("1")
                inspectionInfoVo.changed = map["isChanged"].toString().equals("1")
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/LedgerServiceImpl.kt
@@ -62,7 +62,7 @@
                    val typeCount = ledgerSubTypeMapper.selectCountByExample(Example(LedgerSubType::class.java).apply {
                        createCriteria().andEqualTo(
                            "lScenetype",
                            Constant.ScenseType.typeMap(sceneLedgerSummary.scene?.typeid)
                            Constant.SceneType.typeMap(sceneLedgerSummary.scene?.typeid)
                        )
                            .andEqualTo("lNeedupdate", true)
                    })
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/ScenseServiceImpl.kt
@@ -264,10 +264,10 @@
        sceneDetail.scense = scene
        val mapper = when (scene.typeid.toString()) {
            Constant.ScenseType.TYPE1.value -> sceneConstructionSiteMapper
            Constant.ScenseType.TYPE2.value -> sceneWharfMapper
            Constant.ScenseType.TYPE3.value -> sceneMixingPlantMapper
            Constant.ScenseType.TYPE14.value -> sceneStorageYardMapper
            Constant.SceneType.TYPE1.value -> sceneConstructionSiteMapper
            Constant.SceneType.TYPE2.value -> sceneWharfMapper
            Constant.SceneType.TYPE3.value -> sceneMixingPlantMapper
            Constant.SceneType.TYPE14.value -> sceneStorageYardMapper
            else -> null
        }
@@ -304,7 +304,7 @@
            var r = 0
            var isUpdate = true
            when (typeId.toString()) {
                Constant.ScenseType.TYPE1.value -> {
                Constant.SceneType.TYPE1.value -> {
                    val subScene = Gson().fromJson(sceneDetailStr.subScene, SceneConstructionSite::class.java)
                    if (subScene.getsGuid() != null) {
                        val record = sceneConstructionSiteMapper.selectByPrimaryKey(subScene.getsGuid())
@@ -316,7 +316,7 @@
                        }
                    }
                }
                Constant.ScenseType.TYPE2.value -> {
                Constant.SceneType.TYPE2.value -> {
                    val subScene = Gson().fromJson(sceneDetailStr.subScene, SceneWharf::class.java)
                    if (subScene.getsGuid() != null) {
                        val record = sceneWharfMapper.selectByPrimaryKey(subScene.getsGuid())
@@ -328,7 +328,7 @@
                        }
                    }
                }
                Constant.ScenseType.TYPE3.value -> {
                Constant.SceneType.TYPE3.value -> {
                    val subScene = Gson().fromJson(sceneDetailStr.subScene, SceneMixingPlant::class.java)
                    if (subScene.getsGuid() != null) {
                        val record = sceneMixingPlantMapper.selectByPrimaryKey(subScene.getsGuid())
@@ -340,7 +340,7 @@
                        }
                    }
                }
                Constant.ScenseType.TYPE14.value -> {
                Constant.SceneType.TYPE14.value -> {
                    val subScene = Gson().fromJson(sceneDetailStr.subScene, SceneStorageYard::class.java)
                    if (subScene.getsGuid() != null) {
                        val record = sceneStorageYardMapper.selectByPrimaryKey(subScene.getsGuid())
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/SearchServiceImpl.kt
@@ -22,9 +22,7 @@
import java.io.File
import java.io.FileInputStream
import java.io.FileOutputStream
import java.io.OutputStream
import java.net.URLEncoder
import java.nio.charset.Charset
import java.nio.charset.StandardCharsets
import java.util.*
import javax.servlet.http.HttpServletResponse
@@ -519,7 +517,7 @@
        val task = taskService.getByDistrictCode(config.districtCode, config.startTime)?.takeIf { it.isNotEmpty() }?.get(0)
        config.topTaskGuid = task?.tguid ?: ""
        val dataSource = mutableListOf<DataSource>()
        config.sceneType = Constant.ScenseType.TYPE1.value.toInt()
        config.sceneType = Constant.SceneType.TYPE1.value.toInt()
        dataSource.add(DataSource(config, dbMapper))
//        val config2 = config.copy(sceneType = Constant.ScenseType.TYPE2.value.toInt())
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/SubtaskServiceImpl.kt
@@ -1,8 +1,6 @@
package cn.flightfeather.supervision.lightshare.service.impl
import cn.flightfeather.supervision.business.storage.JinAnScore
import cn.flightfeather.supervision.business.storage.StAutoScore
import cn.flightfeather.supervision.business.storage.item.*
import cn.flightfeather.supervision.business.autooutput.score.AopEvaluation
import cn.flightfeather.supervision.domain.ds1.entity.*
import cn.flightfeather.supervision.domain.ds1.mapper.*
import cn.flightfeather.supervision.common.utils.Constant
@@ -24,20 +22,11 @@
@Service
class SubtaskServiceImpl(
    private val subtaskMapper: SubtaskMapper,
    private val mpScoreItem_1: MpScoreItem_1,
    private val mpScoreItem_2: MpScoreItem_2,
    private val stScoreItem_1: StScoreItem_1,
    private val whScoreItem_1: WhScoreItem_1,
    private val whScoreItem_2: WhScoreItem_2,
    private val jinAnScore: JinAnScore,
    private val aopEvaluation: AopEvaluation,
) : SubtaskService {
    val dateUtil = DateUtil()
    @Autowired
    lateinit var scoreItem1: CsScoreItem_1
    @Autowired
    lateinit var scoreItem2: CsScoreItem_2
    @Autowired
    lateinit var taskService: TaskService
    @Autowired
@@ -71,7 +60,7 @@
        if (StringUtil.isNotEmpty(areaVo.towncode))
            criteria.andEqualTo("towncode", areaVo.towncode)
        criteria.andBetween("planstarttime", areaVo.starttime, areaVo.endtime)
        if (!Objects.equals(userGuid, Constant.UserType.ALLUSER.text))
        if (!Objects.equals(userGuid, Constant.UserType.ALL_USER.des))
            criteria.andLike("executorguids","%"+userGuid+"%")
        var completecount = 0
        var subtasklist = subtaskMapper.selectByExample(example)
@@ -479,20 +468,7 @@
            criteria.andEqualTo("stguid", subtask.stguid)
            val result = evaluationMapper.selectByExample(example)
            if (result.isEmpty()) {
//                if (subtask.districtname == "徐汇区") {
//                    val autoScore = AutoScore2()
//                    autoScore.subtask = subtask
//                    autoScore.calculateScore()
//                } else {
//                    val autoScore = AutoScore()
//                    autoScore.subtask = subtask
//                    autoScore.calculateScore()
//                }
                val s = scenseMapper.selectByPrimaryKey(subtask.scenseid)
                val autoScore = StAutoScore(scoreItem1, scoreItem2, mpScoreItem_1, mpScoreItem_2, stScoreItem_1,
                    whScoreItem_1, whScoreItem_2, jinAnScore)
                autoScore.sceneType = Constant.ScenseType.getByValue(s.typeid?.toString())
                autoScore.sceneGrade(subtask)
                aopEvaluation.executeBySubTask(subtask)
            }
        }
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/TaskServiceImpl.kt
@@ -8,6 +8,7 @@
import cn.flightfeather.supervision.domain.ds1.mapper.TaskMapper
import cn.flightfeather.supervision.common.utils.Constant
import cn.flightfeather.supervision.common.utils.DateUtil
import cn.flightfeather.supervision.domain.ds1.repository.TaskRep
import cn.flightfeather.supervision.lightshare.service.EvaluationService
import cn.flightfeather.supervision.lightshare.service.SubtaskService
import cn.flightfeather.supervision.lightshare.service.TaskService
@@ -21,7 +22,7 @@
import kotlin.collections.ArrayList
@Service
class TaskServiceImpl(val taskMapper: TaskMapper) : TaskService {
class TaskServiceImpl(val taskMapper: TaskMapper, private val taskRep: TaskRep,) : TaskService {
    @Autowired
    lateinit var subtaskService: SubtaskService
@@ -725,4 +726,7 @@
        return taskProgressVolist
    }
    override fun findTask(areaVo: AreaVo): List<Task?> {
        return taskRep.findTasks(areaVo)
    }
}
src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/AreaEvaVo.kt
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,12 @@
package cn.flightfeather.supervision.lightshare.vo
import com.fasterxml.jackson.annotation.JsonInclude
/**
 * è¯„估规则查询条件
 */
@JsonInclude(JsonInclude.Include.NON_NULL)
class AreaEvaVo : AreaVo() {
    // è¯„估规则类型,1:巡查情况评估;99:自动评估
    var taskTypeId: Int = 1
}
src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/AreaVo.kt
@@ -3,7 +3,7 @@
import com.fasterxml.jackson.annotation.JsonInclude
@JsonInclude(JsonInclude.Include.NON_NULL)
class AreaVo{
open class AreaVo{
    var provincecode: String? = null
src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/AutoScoreResultVo.kt
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,24 @@
package cn.flightfeather.supervision.lightshare.vo
import cn.flightfeather.supervision.domain.ds1.entity.Evaluation
import cn.flightfeather.supervision.domain.ds1.entity.Itemevaluation
import cn.flightfeather.supervision.domain.ds1.entity.Subtask
import java.util.*
/**
 * è‡ªåŠ¨è¯„ä¼°ç»“æžœ
 */
class AutoScoreResultVo {
    var userId: String? = null
    var userName: String? = null
    var sceneId: String? = null
    var sceneName: String? = null
    var pName: String? = null
    var cName: String? = null
    var dName: String? = null
    var tName: String? = null
    var subTaskId:String? = null
    var subTaskTime: Date? = null
    var evaluation: Evaluation? = null
    var itemEvaluations: List<Itemevaluation?>? = null
}
src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/BaseResponse.kt
@@ -18,15 +18,15 @@
        var message: String = "",
        val head: DataHead? = null,
        @ApiModelProperty("请求返回数据")
        val data: T? = null
){
        init {
                if (message.isBlank()) {
                        message = if (success) {
                                "请求成功"
                        } else {
                                "请求失败"
                        }
                }
        val data: T? = null,
) {
    init {
        if (message.isBlank()) {
            message = if (success) {
                "请求成功"
            } else {
                "请求失败"
            }
        }
    }
}
src/main/kotlin/cn/flightfeather/supervision/lightshare/web/BaseResPack.kt
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,25 @@
package cn.flightfeather.supervision.lightshare.web
import cn.flightfeather.supervision.lightshare.vo.BaseResponse
import cn.flightfeather.supervision.lightshare.vo.DataHead
/**
 * åŒ…装接口返回结果
 */
fun resPack(service: () -> Any?): BaseResponse<Any> {
    return try {
        val res = service()
        if (res is Pair<*, *>) {
            val head = res.first
            if (head is DataHead) {
                BaseResponse(true, head = head, data = res.second)
            } else {
                BaseResponse(true, data = res.second)
            }
        } else {
            BaseResponse(true, data = res)
        }
    } catch (e: Exception) {
        BaseResponse(false, message = e.message ?: "")
    }
}
src/main/kotlin/cn/flightfeather/supervision/lightshare/web/BgTaskController.kt
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,37 @@
package cn.flightfeather.supervision.lightshare.web
import cn.flightfeather.supervision.common.executor.BgTaskConditionVo
import cn.flightfeather.supervision.lightshare.service.BgTaskService
import io.swagger.annotations.Api
import io.swagger.annotations.ApiOperation
import org.springframework.web.bind.annotation.*
@Api(tags = ["BgTaskController"], description = "后台耗时任务API接口")
@RestController
@RequestMapping("/bgTask")
class BgTaskController(val bgTaskService: BgTaskService){
    @ApiOperation(value = "获取后台任务状态")
    @PostMapping("/status")
    fun getTaskStatus(@RequestBody condition: BgTaskConditionVo) = resPack { bgTaskService.getTaskStatus(condition) }
    @ApiOperation(value = "运行一个任务")
    @PutMapping("/start")
    fun startTask(@RequestBody condition: BgTaskConditionVo) = resPack { bgTaskService.startTask(condition) }
    @ApiOperation(value = "强制关闭任务")
    @PutMapping("/shutDown")
    fun shutDownTask(@RequestBody condition: BgTaskConditionVo) = resPack { bgTaskService.shutDownTask(condition) }
    @ApiOperation(value = "移除一个任务")
    @PutMapping("/remove")
    fun removeTask(@RequestBody condition: BgTaskConditionVo) = resPack { bgTaskService.removeTask(condition) }
    @ApiOperation(value = "新建并运行一个测试任务")
    @PutMapping("/newTask/test/start")
    fun startNewTestTask(@RequestParam taskId: String) = resPack { bgTaskService.startNewTestTask(taskId) }
    @ApiOperation(value = "新建一个测试任务")
    @PutMapping("/newTask/test")
    fun newTestTask(@RequestParam taskId: String) = resPack { bgTaskService.newTestTask(taskId) }
}
src/main/kotlin/cn/flightfeather/supervision/lightshare/web/EvaluationController.kt
@@ -2,7 +2,9 @@
import cn.flightfeather.supervision.domain.ds1.entity.Evaluation
import cn.flightfeather.supervision.lightshare.service.EvaluationService
import cn.flightfeather.supervision.lightshare.vo.AreaVo
import io.swagger.annotations.Api
import io.swagger.annotations.ApiOperation
import org.springframework.web.bind.annotation.*
@Api(tags = ["EvaluationController"], description = "评估总分API接口")
@@ -25,27 +27,42 @@
    fun delete(@PathVariable id: String) = evaluationService.delete(id)
    @GetMapping("/rankofscense")
    fun getRankOfScense(@RequestParam(value = "tguid", required = true) tguid: String,
                        @RequestParam(value = "scensetypeid", required = false) scensetypeid: String?,
                        @RequestParam(value = "ruletypeid", required = false) ruletypeid: ByteArray?) = evaluationService.getRankOfSense(tguid, scensetypeid, ruletypeid)
    fun getRankOfScense(
        @RequestParam(value = "tguid", required = true) tguid: String,
        @RequestParam(value = "scensetypeid", required = false) scensetypeid: String?,
        @RequestParam(value = "ruletypeid", required = false) ruletypeid: ByteArray?,
    ) = evaluationService.getRankOfSense(tguid, scensetypeid, ruletypeid)
    @GetMapping("/rankoftown")
    fun getRankOfTown(@RequestParam(value = "tguid", required = true) tguid: String,
                      @RequestParam(value = "scensetypeid", required = false) scensetypeid: String?) = evaluationService.getRankOfTown(tguid, scensetypeid)
    fun getRankOfTown(
        @RequestParam(value = "tguid", required = true) tguid: String,
        @RequestParam(value = "scensetypeid", required = false) scensetypeid: String?,
    ) = evaluationService.getRankOfTown(tguid, scensetypeid)
    @GetMapping("/autoScore")
    fun autoScore(@RequestParam(value = "districtCode") districtCode: String,
                  @RequestParam(value = "time") time: String) = evaluationService.autoScore(districtCode, time)
    fun autoScore(
        @RequestParam(value = "districtCode") districtCode: String,
        @RequestParam(value = "time") time: String,
    ) = evaluationService.autoScore(districtCode, time)
    @GetMapping("/autoScore3")
    fun autoScore3(
        @RequestParam(value = "topTaskId") tGuid: String,
        @RequestParam(value = "sceneTypeId") sceneTypeId: String
        @RequestParam(value = "sceneTypeId") sceneTypeId: String,
    ) = evaluationService.autoScore3(tGuid, sceneTypeId)
    @PostMapping("/autoScore")
    fun autoScore2(@RequestParam(value = "subTaskId") subTaskId: String) = evaluationService.autoScore2(subTaskId)
    @GetMapping("/byInspection")
    fun findByInspectionId(@RequestParam("inspectionId") inspectionId: String) = evaluationService.findByInspectionId(inspectionId)
    fun findByInspectionId(@RequestParam("inspectionId") inspectionId: String) =
        evaluationService.findByInspectionId(inspectionId)
    @ApiOperation(value = "根据区域范围自动评估")
    @PostMapping("/auto")
    fun autoEvaluate(@RequestBody areaVo: AreaVo) = resPack { evaluationService.autoEvaluate(areaVo) }
    @ApiOperation(value = "根据区域范围获取自动评估历史记录")
    @PostMapping("/auto/record")
    fun findAutoEvaluation(@RequestBody areaVo: AreaVo) = resPack { evaluationService.findAutoEvaluation(areaVo) }
}
src/main/kotlin/cn/flightfeather/supervision/lightshare/web/EvaluationruleController.kt
@@ -2,6 +2,8 @@
import cn.flightfeather.supervision.domain.ds1.entity.Evaluationrule
import cn.flightfeather.supervision.lightshare.service.EvaluationruleService
import cn.flightfeather.supervision.lightshare.vo.AreaEvaVo
import cn.flightfeather.supervision.lightshare.vo.AreaVo
import io.swagger.annotations.Api
import org.springframework.web.bind.annotation.*
@@ -23,4 +25,7 @@
    @DeleteMapping("/{id}")
    fun delete (@PathVariable id: String) = evaluationruleService.delete(id)
    @PostMapping("/find")
    fun find(@RequestBody areaVo: AreaEvaVo) = resPack { evaluationruleService.find(areaVo) }
}
src/main/kotlin/cn/flightfeather/supervision/lightshare/web/TaskController.kt
@@ -2,6 +2,7 @@
import cn.flightfeather.supervision.domain.ds1.entity.Task
import cn.flightfeather.supervision.lightshare.service.TaskService
import cn.flightfeather.supervision.lightshare.vo.AreaVo
import io.swagger.annotations.Api
import org.springframework.web.bind.annotation.*
@@ -61,4 +62,7 @@
    fun getRank(@RequestParam(value = "id", required = true) id: String,
                @RequestParam(value = "curSceneTypeId", required = true) sceneTypeId: String,
                @RequestParam(value = "sceneId", required = false) sceneId: String?) = taskService.getRank(id, sceneTypeId, sceneId)
    @PostMapping("/find")
    fun findTask(@RequestBody areaVo: AreaVo) = resPack { taskService.findTask(areaVo) }
}
src/main/resources/application-dev.yml
@@ -1,3 +1,16 @@
spring:
  datasource:
    ds1:
      #-本地测试服务器-
      url: jdbc:mysql://localhost:3306/supervision?serverTimezone=Asia/Shanghai&prepStmtCacheSize=517&cachePrepStmts=true&autoReconnect=true&characterEncoding=utf-8&allowMultiQueries=true&useSSL=false
      username: root
      password: 123456
    ds2:
      # æœ¬åœ°æµ‹è¯•
      url: jdbc:mysql://localhost:3306/ledger?serverTimezone=Asia/Shanghai&prepStmtCacheSize=517&cachePrepStmts=true&autoReconnect=true&characterEncoding=utf-8&allowMultiQueries=true&useSSL=false
      username: root
      password: 123456
springfox:
  documentation:
    swagger:
src/main/resources/application-pro.yml
@@ -1,7 +1,14 @@
springfox:
  documentation:
    swagger:
      v2:
        enabled: false
spring:
  datasource:
    ds1:
      #-发布服务器-
      url: jdbc:mysql://localhost:3306/supervision?serverTimezone=Asia/Shanghai&prepStmtCacheSize=517&cachePrepStmts=true&autoReconnect=true&characterEncoding=utf-8&allowMultiQueries=true&useSSL=false
      username: supervision
      password: supervision_feiyu2021
    ds2:
      #-发布服务器-
      url: jdbc:mysql://localhost:3306/ledger?serverTimezone=Asia/Shanghai&prepStmtCacheSize=517&cachePrepStmts=true&autoReconnect=true&characterEncoding=utf-8&allowMultiQueries=true&useSSL=false
      username: ledger
      password: ledger_fxxchackxr
src/main/resources/application-test.yml
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,28 @@
spring:
  datasource:
    ds1:
      #-局域网服务器-
      #    url: jdbc:mysql://192.168.0.200:3306/supervision?serverTimezone=Asia/Shanghai&prepStmtCacheSize=517&cachePrepStmts=true&autoReconnect=true&characterEncoding=utf-8&allowMultiQueries=true&useSSL=false
      #    username: root
      #    password: cn.FLIGHTFEATHER
      #-环境督察测试服务器-
      #      url: jdbc:mysql://192.168.0.200:3306/supervision_ii?serverTimezone=Asia/Shanghai&prepStmtCacheSize=517&cachePrepStmts=true&autoReconnect=true&characterEncoding=utf-8&allowMultiQueries=true&useSSL=false
      #      username: root
      #      password: cn.FLIGHTFEATHER
      #-远程测试服务器-
      url: jdbc:mysql://47.100.191.150:3306/supervision?serverTimezone=Asia/Shanghai&prepStmtCacheSize=517&cachePrepStmts=true&autoReconnect=true&characterEncoding=utf-8&allowMultiQueries=true&useSSL=false
      username: remoteU1
      password: eSoF8DnzfGTlhAjE
    ds2:
      #-远程测试服务器-
      url: jdbc:mysql://47.100.191.150:3306/ledger?serverTimezone=Asia/Shanghai&prepStmtCacheSize=517&cachePrepStmts=true&autoReconnect=true&characterEncoding=utf-8&allowMultiQueries=true&useSSL=false
      username: remoteU1
      password: eSoF8DnzfGTlhAjE
springfox:
  documentation:
    swagger:
      v2:
        enabled: true
src/main/resources/application.yml
@@ -3,31 +3,6 @@
    ds1:
      type: com.alibaba.druid.pool.DruidDataSource
      driver-class-name: com.mysql.jdbc.Driver
      #-本地测试服务器-
  #    username: root
  #    password: 123456
  #    url: jdbc:mysql://localhost:3306/supervision?serverTimezone=Asia/Shanghai&prepStmtCacheSize=517&cachePrepStmts=true&autoReconnect=true&characterEncoding=utf-8&allowMultiQueries=true&useSSL=false
      #-局域网服务器-
  #    url: jdbc:mysql://192.168.0.200:3306/supervision?serverTimezone=Asia/Shanghai&prepStmtCacheSize=517&cachePrepStmts=true&autoReconnect=true&characterEncoding=utf-8&allowMultiQueries=true&useSSL=false
  #    username: root
  #    password: cn.FLIGHTFEATHER
      #-远程测试服务器-
      url: jdbc:mysql://47.100.191.150:3306/supervision?serverTimezone=Asia/Shanghai&prepStmtCacheSize=517&cachePrepStmts=true&autoReconnect=true&characterEncoding=utf-8&allowMultiQueries=true&useSSL=false
      username: remoteU1
      password: eSoF8DnzfGTlhAjE
      #-发布服务器-
#      url: jdbc:mysql://localhost:3306/supervision?serverTimezone=Asia/Shanghai&prepStmtCacheSize=517&cachePrepStmts=true&autoReconnect=true&characterEncoding=utf-8&allowMultiQueries=true&useSSL=false
#      username: supervision
#      password: supervision_feiyu2021
      #-环境督察测试服务器-
#      url: jdbc:mysql://192.168.0.200:3306/supervision_ii?serverTimezone=Asia/Shanghai&prepStmtCacheSize=517&cachePrepStmts=true&autoReconnect=true&characterEncoding=utf-8&allowMultiQueries=true&useSSL=false
#      username: root
#      password: cn.FLIGHTFEATHER
      initialSize: 5
      minIdle: 5
      maxWait: 60000
@@ -45,17 +20,6 @@
    ds2:
      type: com.alibaba.druid.pool.DruidDataSource
      driver-class-name: com.mysql.jdbc.Driver
      #-发布服务器-
#      url: jdbc:mysql://localhost:3306/ledger?serverTimezone=Asia/Shanghai&prepStmtCacheSize=517&cachePrepStmts=true&autoReconnect=true&characterEncoding=utf-8&allowMultiQueries=true&useSSL=false
#      username: ledger
#      password: ledger_fxxchackxr
      #   å¼€å‘远程服务器
      url: jdbc:mysql://47.100.191.150:3306/ledger?serverTimezone=Asia/Shanghai&prepStmtCacheSize=517&cachePrepStmts=true&autoReconnect=true&characterEncoding=utf-8&allowMultiQueries=true&useSSL=false
      username: remoteU1
      password: eSoF8DnzfGTlhAjE
      initialSize: 5
      minIdle: 5
      maxWait: 60000
@@ -100,7 +64,7 @@
      request-timeout: 20s
  profiles:
    active: '@profileActive@'
    active: @profileActive@
  jmx:
    default-domain: ETSupervision
@@ -125,5 +89,5 @@
  documentation:
    swagger:
      v2:
        enabled: true
        enabled: false
src/main/resources/generator/generatorConfig4ds1.xml
@@ -41,31 +41,6 @@
            <property name="enableSubPackages" value="true"/>
        </javaClientGenerator>
        <!-- è¦ç”Ÿæˆçš„表 tableName是数据库中的表名或视图名 domainObjectName是实体类名-->
        <!--<table tableName="adm_dept" domainObjectName="Department" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table>-->
        <!--<table tableName="adm_group" domainObjectName="UserGroup" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table>-->
        <!--<table tableName="adm_groupuserright" domainObjectName="GroupUserRight" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table>-->
        <!--<table tableName="adm_user" domainObjectName="User" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table>-->
        <!--<table tableName="usertable" domainObjectName="UserTable" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table>-->
        <!--<table tableName="adm_groupuser" domainObjectName="GroupUser" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table>-->
        <!--<table tableName="adm_rights" domainObjectName="Rights" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table>-->
        <!--<table tableName="province" domainObjectName="Province" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table>-->
        <!--<table tableName="city" domainObjectName="City" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table>-->
        <!--<table tableName="town" domainObjectName="Town" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table>-->
        <!--<table tableName="projectinfo" domainObjectName="ProjectInfo" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table>-->
        <!--<table tableName="siteinfo" domainObjectName="SiteInfo" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table>-->
        <!--<table tableName="station_alertvalue_config" domainObjectName="StationAlertvalueConfig" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table>-->
        <!--<table tableName="company" domainObjectName="Company" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table>-->
        <!--<table tableName="vprinfo" domainObjectName="Vprinfo" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table>-->
        <!--<table tableName="devinfo" domainObjectName="Devinfo" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table>-->
        <!--<table tableName="frontendconfig_new" domainObjectName="FrontendConfig" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table>-->
        <!--<table tableName="munitevalue" domainObjectName="MuniteValue" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table>-->
        <!--<table tableName="hourvalue" domainObjectName="HourValue" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table>-->
        <!--<table tableName="dayvalue" domainObjectName="DayValue" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table>-->
        <!--<table tableName="t_stationgroup" domainObjectName="StationGroup" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table>-->
        <!--<table tableName="t_addressee" domainObjectName="Addressee" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table>-->
        <!--<table tableName="t_smstemplate" domainObjectName="SMSTemplate" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table>-->
        <!--<table tableName="t_smsrecord" domainObjectName="SMSRecord" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table>-->
        <!--<table tableName="t_user" domainObjectName="User" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table>-->
        <!--<table tableName="sm_t_changeadvice" domainObjectName="ChangeAdvice" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table>-->
        <!--<table tableName="sm_t_changeeffect" domainObjectName="ChangeEffect" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table>-->
        <!--<table tableName="sm_t_monitorobjectversion" domainObjectName="Monitorobjectversion" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table>-->
@@ -79,7 +54,9 @@
<!--        <table tableName="sm_t_score" domainObjectName="Score" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"/>-->
<!--        <table tableName="sm_t_scense" domainObjectName="Scense" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"/>-->
<!--        <table tableName="ea_t_mediafile" domainObjectName="LedgerMediaFile" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"/>-->
        <table tableName="ea_t_dust_data_result" domainObjectName="DustDataResult" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false"
<!--        <table tableName="ea_t_dust_data_result" domainObjectName="DustDataResult" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false"-->
<!--               enableSelectByExample="false" selectByExampleQueryId="false"/>-->
        <table tableName="ea_t_evaluation" domainObjectName="Evaluation" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false"
               enableSelectByExample="false" selectByExampleQueryId="false"/>
    </context>
</generatorConfiguration>
src/main/resources/generator/generatorConfig4ds3.xml
@@ -43,8 +43,20 @@
            <property name="enableSubPackages" value="true"/>
        </javaClientGenerator>
        <!-- è¦ç”Ÿæˆçš„表 tableName是数据库中的表名或视图名 domainObjectName是实体类名-->
        <table tableName="fm_web_analysis_data" domainObjectName="FumeDailyAnalysis" enableCountByExample="false"
               enableUpdateByExample="false" enableDeleteByExample="false"
               enableSelectByExample="false" selectByExampleQueryId="false"/>
<!--        <table tableName="fm_web_analysis_data" domainObjectName="FumeDailyAnalysis" enableCountByExample="false"-->
<!--               enableUpdateByExample="false" enableDeleteByExample="false"-->
<!--               enableSelectByExample="false" selectByExampleQueryId="false"/>-->
<!--        <table tableName="fu_xh_t_site_map" domainObjectName="FumeSiteMap" enableCountByExample="false"-->
<!--               enableUpdateByExample="false" enableDeleteByExample="false"-->
<!--               enableSelectByExample="false" selectByExampleQueryId="false"/>-->
            <table tableName="abnormal_data" domainObjectName="FumeExceptionData" enableCountByExample="false"
                   enableUpdateByExample="false" enableDeleteByExample="false"
                   enableSelectByExample="false" selectByExampleQueryId="false"/>
<!--        <table tableName="ja_t_dust_site_data_info" domainObjectName="JSDustData" enableCountByExample="false"-->
<!--               enableUpdateByExample="false" enableDeleteByExample="false"-->
<!--               enableSelectByExample="false" selectByExampleQueryId="false"/>-->
<!--        <table tableName="du_js_t_site_map" domainObjectName="JSDustSiteMap" enableCountByExample="false"-->
<!--               enableUpdateByExample="false" enableDeleteByExample="false"-->
<!--               enableSelectByExample="false" selectByExampleQueryId="false"/>-->
    </context>
</generatorConfiguration>
src/main/resources/log4j2.xml
@@ -63,10 +63,10 @@
            <appender-ref ref="Console"/>
        </logger>
        <logger name="org.mybatis" level="DEBUG">
            <appender-ref ref="Console"/>
<!--            <appender-ref ref="Console"/>-->
        </logger>
        <logger name="org.apache.ibatis" level="DEBUG">
            <appender-ref ref="Console"/>
<!--            <appender-ref ref="Console"/>-->
        </logger>
        <logger name="cn.flightfeather.supervision" level="INFO" includeLocation="true" additivity="false">
src/main/resources/mapper/ds1/EvaluationMapper.xml
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,92 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.flightfeather.supervision.domain.ds1.mapper.EvaluationMapper">
  <resultMap id="BaseResultMap" type="cn.flightfeather.supervision.domain.ds1.entity.Evaluation">
    <!--
      WARNING - @mbg.generated
    -->
    <id column="E_GUID" jdbcType="VARCHAR" property="guid" />
    <result column="I_GUID" jdbcType="VARCHAR" property="iguid" />
    <result column="ST_GUID" jdbcType="VARCHAR" property="stguid" />
    <result column="S_GUID" jdbcType="VARCHAR" property="sguid" />
    <result column="E_ScenseTypeID" jdbcType="TINYINT" property="scensetypeid" />
    <result column="E_ScenseType" jdbcType="VARCHAR" property="scensetype" />
    <result column="E_SubScenseTypeID" jdbcType="TINYINT" property="subscensetypeid" />
    <result column="E_SubScenseType" jdbcType="VARCHAR" property="subscensetype" />
    <result column="E_ERType" jdbcType="TINYINT" property="ertype" />
    <result column="E_ProvinceCode" jdbcType="VARCHAR" property="provincecode" />
    <result column="E_ProvinceName" jdbcType="VARCHAR" property="provincename" />
    <result column="E_CityCode" jdbcType="VARCHAR" property="citycode" />
    <result column="E_CityName" jdbcType="VARCHAR" property="cityname" />
    <result column="E_DistrictCode" jdbcType="VARCHAR" property="districtcode" />
    <result column="E_DistrictName" jdbcType="VARCHAR" property="districtname" />
    <result column="E_TownCode" jdbcType="VARCHAR" property="towncode" />
    <result column="E_TownName" jdbcType="VARCHAR" property="townname" />
    <result column="E_ScenseName" jdbcType="VARCHAR" property="scensename" />
    <result column="E_ScenseAddress" jdbcType="VARCHAR" property="scenseaddress" />
    <result column="E_EvaluateTime" jdbcType="TIMESTAMP" property="evaluatetime" />
    <result column="E_EvaluatorGUID" jdbcType="VARCHAR" property="evaluatorguid" />
    <result column="E_EvaluatoruserName" jdbcType="VARCHAR" property="evaluatorusername" />
    <result column="E_EvaluatorRealName" jdbcType="VARCHAR" property="evaluatorrealname" />
    <result column="E_ResultStandardBef" jdbcType="VARCHAR" property="resultstandardbef" />
    <result column="E_ResultScoreBef" jdbcType="VARCHAR" property="resultscorebef" />
    <result column="E_PromissedNum" jdbcType="INTEGER" property="promissednum" />
    <result column="E_ChangedNum" jdbcType="INTEGER" property="changednum" />
    <result column="ResultStandardAft" jdbcType="VARCHAR" property="resultstandardaft" />
    <result column="E_ResultScoreAft" jdbcType="VARCHAR" property="resultscoreaft" />
    <result column="E_CreateDate" jdbcType="TIMESTAMP" property="createdate" />
    <result column="E_UpdateDate" jdbcType="TIMESTAMP" property="updatedate" />
    <result column="E_Extension1" jdbcType="VARCHAR" property="extension1" />
    <result column="E_Extension2" jdbcType="VARCHAR" property="extension2" />
    <result column="E_Extension3" jdbcType="VARCHAR" property="extension3" />
    <result column="E_Remark" jdbcType="VARCHAR" property="remark" />
  </resultMap>
  <sql id="Base_Column_List">
    <!--
      WARNING - @mbg.generated
    -->
    E_GUID, I_GUID, ST_GUID, S_GUID, E_ScenseTypeID, E_ScenseType, E_SubScenseTypeID,
    E_SubScenseType, E_ERType, E_ProvinceCode, E_ProvinceName, E_CityCode, E_CityName,
    E_DistrictCode, E_DistrictName, E_TownCode, E_TownName, E_ScenseName, E_ScenseAddress,
    E_EvaluateTime, E_EvaluatorGUID, E_EvaluatoruserName, E_EvaluatorRealName, E_ResultStandardBef,
    E_ResultScoreBef, E_PromissedNum, E_ChangedNum, ResultStandardAft, E_ResultScoreAft,
    E_CreateDate, E_UpdateDate, E_Extension1, E_Extension2, E_Extension3, E_Remark
  </sql>
  <resultMap id="AutoScoreResultMap" type="cn.flightfeather.supervision.lightshare.vo.AutoScoreResultVo">
    <result column="userId" jdbcType="VARCHAR" property="userId"/>
    <result column="userName" jdbcType="VARCHAR" property="userName"/>
    <result column="sceneId" jdbcType="VARCHAR" property="sceneId"/>
    <result column="sceneName" jdbcType="VARCHAR" property="sceneName"/>
    <result column="pName" jdbcType="VARCHAR" property="pName"/>
    <result column="cName" jdbcType="VARCHAR" property="cName"/>
    <result column="dName" jdbcType="VARCHAR" property="dName"/>
    <result column="tName" jdbcType="VARCHAR" property="tName"/>
    <result column="subTaskId" jdbcType="VARCHAR" property="subTaskId"/>
    <result column="planstarttime" property="subTaskTime" jdbcType="TIMESTAMP" />
    <association property="evaluation" resultMap="BaseResultMap" />
  </resultMap>
  <select id="findEvaluation" resultMap="AutoScoreResultMap">
    SELECT
    c.UI_GUID AS userId,
    c.UI_RealName AS userName,
    b.S_GUID AS sceneId,
    b.S_Name AS sceneName,
    b.S_ProvinceName AS pName,
    b.S_CityName AS cName,
    b.S_DistrictName AS dName,
    b.S_TownName AS tName,
    d.ST_GUID AS subTaskId,
    d.ST_PlanStartTime AS planstarttime,
    e.*
    FROM
    (SELECT * FROM sm_t_monitorobjectversion WHERE T_ID = #{topTaskId} )AS a
    LEFT JOIN sm_t_scense AS b ON a.S_GUID = b.S_GUID
    LEFT JOIN sm_t_userinfo AS c ON b.S_GUID = c.D_GUID
    LEFT JOIN (SELECT * FROM tm_t_subtask WHERE T_GUID = #{topTaskId}) AS d ON a.S_GUID = d.ST_ScenseID
    LEFT JOIN ea_t_evaluation AS e ON d.ST_GUID = e.ST_GUID
    WHERE
    b.S_TypeID = #{sceneTypeId}
  </select>
</mapper>
src/main/resources/mapper/ds2/OverallEvaluationMapper.xml
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.flightfeather.supervision.domain.ds2.mapper.OverallEvaluationMapper">
  <resultMap id="BaseResultMap" type="cn.flightfeather.supervision.domain.ds2.entity.OverallEvaluation">
    <!--
      WARNING - @mbg.generated
    -->
    <id column="OE_GUID" jdbcType="INTEGER" property="oeGuid" />
    <result column="BI_GUID" jdbcType="VARCHAR" property="biGuid" />
    <result column="OE_Score" jdbcType="INTEGER" property="oeScore" />
    <result column="OE_Publish_Time" jdbcType="TIMESTAMP" property="oePublishTime" />
    <result column="OE_Update_Time" jdbcType="TIMESTAMP" property="oeUpdateTime" />
    <result column="OE_Scene_Type_Id" jdbcType="TINYINT" property="oeSceneTypeId" />
    <result column="OE_Scene_Type" jdbcType="VARCHAR" property="oeSceneType" />
    <result column="OE_Period" jdbcType="VARCHAR" property="oePeriod" />
    <result column="OE_Code_Level" jdbcType="TINYINT" property="oeCodeLevel" />
    <result column="OE_Start_Time" jdbcType="DATE" property="oeStartTime" />
    <result column="OE_End_Time" jdbcType="DATE" property="oeEndTime" />
  </resultMap>
  <sql id="Base_Column_List">
    <!--
      WARNING - @mbg.generated
    -->
    OE_GUID, BI_GUID, OE_Score, OE_Publish_Time, OE_Update_Time, OE_Scene_Type_Id, OE_Scene_Type,
    OE_Period, OE_Code_Level, OE_Start_Time, OE_End_Time
  </sql>
</mapper>
src/main/resources/mapper/ds3/FumeSiteMapMapper.xml
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="cn.flightfeather.supervision.domain.ds3.mapper.FumeSiteMapMapper" >
  <resultMap id="BaseResultMap" type="cn.flightfeather.supervision.domain.ds3.entity.FumeSiteMap" >
    <!--
      WARNING - @mbg.generated
    -->
    <id column="Id" property="id" jdbcType="INTEGER" />
    <result column="TZ_User_Id" property="tzUserId" jdbcType="VARCHAR" />
    <result column="TZ_User_Name" property="tzUserName" jdbcType="VARCHAR" />
    <result column="XH_Device_Code" property="xhDeviceCode" jdbcType="VARCHAR" />
    <result column="XH_Device_Name" property="xhDeviceName" jdbcType="VARCHAR" />
    <result column="SV_User_Id" property="svUserId" jdbcType="VARCHAR" />
    <result column="SV_User_Name" property="svUserName" jdbcType="VARCHAR" />
    <result column="Create_Time" property="createTime" jdbcType="TIMESTAMP" />
  </resultMap>
  <sql id="Base_Column_List" >
    <!--
      WARNING - @mbg.generated
    -->
    Id, TZ_User_Id, TZ_User_Name, XH_Device_Code, XH_Device_Name, SV_User_Id, SV_User_Name,
    Create_Time
  </sql>
</mapper>
src/main/resources/mapper/ds3/JSDustDataMapper.xml
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,44 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="cn.flightfeather.supervision.domain.ds3.mapper.JSDustDataMapper" >
  <resultMap id="BaseResultMap" type="cn.flightfeather.supervision.domain.ds3.entity.JSDustData" >
    <!--
      WARNING - @mbg.generated
    -->
    <id column="id" property="id" jdbcType="INTEGER" />
    <result column="mn_code" property="mnCode" jdbcType="VARCHAR" />
    <result column="dust_value" property="dustValue" jdbcType="DOUBLE" />
    <result column="noise_value" property="noiseValue" jdbcType="DOUBLE" />
    <result column="lst" property="lst" jdbcType="TIMESTAMP" />
    <result column="quality" property="quality" jdbcType="VARCHAR" />
    <result column="grade" property="grade" jdbcType="INTEGER" />
    <result column="flag" property="flag" jdbcType="VARCHAR" />
  </resultMap>
  <sql id="Base_Column_List" >
    <!--
      WARNING - @mbg.generated
    -->
    id, mn_code, dust_value, noise_value, lst, quality, grade, flag
  </sql>
  <select id="getDataBySceneType" resultMap="BaseResultMap">
    SELECT a.* FROM
    (SELECT
    *
    FROM
    ja_t_dust_site_data_info
    <where>
      flag = 'N'
      <if test="st != null">
        AND lst >= #{st}
      </if>
      <if test="et != null">
        AND lst &lt;= #{et}
      </if>
    </where>
    LIMIT #{startIndex}, #{perPage}
    ) AS a
    LEFT JOIN ja_t_dust_site_info AS b ON a.mn_code = b.mn_code
    WHERE b.type_id = #{sceneType}
  </select>
</mapper>
src/main/resources/mapper/ds3/JSDustSiteMapMapper.xml
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="cn.flightfeather.supervision.domain.ds3.mapper.JSDustSiteMapMapper" >
  <resultMap id="BaseResultMap" type="cn.flightfeather.supervision.domain.ds3.entity.JSDustSiteMap" >
    <!--
      WARNING - @mbg.generated
    -->
    <id column="Id" property="id" jdbcType="INTEGER" />
    <result column="TZ_User_Id" property="tzUserId" jdbcType="VARCHAR" />
    <result column="TZ_User_Name" property="tzUserName" jdbcType="VARCHAR" />
    <result column="JS_Device_Code" property="jsDeviceCode" jdbcType="VARCHAR" />
    <result column="JS_Device_Name" property="jsDeviceName" jdbcType="VARCHAR" />
    <result column="SV_User_Id" property="svUserId" jdbcType="VARCHAR" />
    <result column="SV_User_Name" property="svUserName" jdbcType="VARCHAR" />
    <result column="Create_Time" property="createTime" jdbcType="TIMESTAMP" />
  </resultMap>
  <sql id="Base_Column_List" >
    <!--
      WARNING - @mbg.generated
    -->
    Id, TZ_User_Id, TZ_User_Name, JS_Device_Code, JS_Device_Name, SV_User_Id, SV_User_Name,
    Create_Time
  </sql>
</mapper>
src/test/kotlin/cn/flightfeather/supervision/business/QRCodeTest.kt
@@ -1,5 +1,6 @@
package cn.flightfeather.supervision.business
import cn.flightfeather.supervision.common.executor.TaskStatus
import cn.flightfeather.supervision.common.utils.QRCodeUtil
import org.apache.poi.hssf.usermodel.HSSFWorkbook
import org.junit.Test
@@ -243,4 +244,11 @@
        metadata.mergeTree("javax_imageio_1.0", root)
    }
    @Test
    fun foo1() {
        val s = TaskStatus.WAITING
        println(s.name)
        println(s.ordinal)
    }
}
src/test/kotlin/cn/flightfeather/supervision/business/autooutput/AopEvaluationTest.kt
@@ -1,7 +1,14 @@
package cn.flightfeather.supervision.business.autooutput
import cn.flightfeather.supervision.business.autooutput.score.AopEvaluation
import cn.flightfeather.supervision.business.autooutput.score.construction.JADataAnalysis
import cn.flightfeather.supervision.business.autooutput.dataanalysis.JACsDataAnalysis
import cn.flightfeather.supervision.business.autooutput.dataanalysis.JSCsDataAnalysis
import cn.flightfeather.supervision.business.autooutput.dataanalysis.JSMpDataAnalysis
import cn.flightfeather.supervision.business.autooutput.dataanalysis.XHFuDataAnalysis
import cn.flightfeather.supervision.business.autooutput.dataanalysis.JSWhDataAnalysis
import cn.flightfeather.supervision.business.autooutput.datasource.AopDataConfig
import cn.flightfeather.supervision.business.autooutput.score.AopCreditCode
import cn.flightfeather.supervision.common.utils.Constant
import cn.flightfeather.supervision.lightshare.service.SearchService
import cn.flightfeather.supervision.lightshare.vo.ExcelConfigVo
import org.junit.Test
@@ -21,38 +28,113 @@
    lateinit var aopEvaluation: AopEvaluation
    @Autowired
    lateinit var aopCreditCode: AopCreditCode
    @Autowired
    lateinit var searchService: SearchService
    @Autowired
    lateinit var jaDataAnalysis: JADataAnalysis
    lateinit var jaCsDataAnalysis: JACsDataAnalysis
    @Autowired
    lateinit var xhFuDataAnalysis: XHFuDataAnalysis
    @Autowired
    lateinit var jsCsDataAnalysis: JSCsDataAnalysis
    @Autowired
    lateinit var jsMpDataAnalysis: JSMpDataAnalysis
    @Autowired
    lateinit var jsWhDataAnalysis: JSWhDataAnalysis
    /**
     * ç»Ÿè®¡ç›‘测数据结果
     * é™å®‰å·¥åœ°è‡ªè¯„
     */
    @Test
    fun test1() {
        jaDataAnalysis.setResource("VHXHS1dHsykTNUf2", 1, 2023, 8)
        jaDataAnalysis.execute()
        val taskId = "tTbZIUg7nQJ1MRgE"
        val districtCode = "310106"
        val year = 2023
        val month = 12
        val sceneType = Constant.SceneType.TYPE1.value.toInt()
        jaCsDataAnalysis.setResource(taskId, sceneType, year, month)
        jaCsDataAnalysis.execute(0.124)
        aopEvaluation.executeByTopTask(taskId, sceneType)
        val mode = 9
        searchService.writeToFile(ExcelConfigVo(
            taskId,
            districtCode = districtCode,
            sceneType = sceneType), mode)
    }
    /**
     * è‡ªåŠ¨è¯„ä¼°
     * å¾æ±‡é¤é¥®è‡ªè¯„
     */
    @Test
    fun test() {
        aopEvaluation.setResource("VHXHS1dHsykTNUf2", 1)
        aopEvaluation.execute()
        val taskId = "88wgq9l5gm9cUMg1"
        val districtCode = "310104"
        val districtName = "徐汇区"
        val year = 2023
        val month = 11
        val sceneType = Constant.SceneType.TYPE5.value.toInt()
        xhFuDataAnalysis.setResource(taskId, sceneType, year, month)
        xhFuDataAnalysis.execute()
        aopEvaluation.executeByTopTask(taskId, sceneType)
        val mode = 9
        searchService.writeToFile(ExcelConfigVo(
            taskId,
            districtCode = districtCode,
            sceneType = sceneType), mode)
        aopCreditCode.execute(AopDataConfig(
            year = year,
            month = month,
            districtName = districtName,
            sceneType = sceneType,
            period = 1
        ))
    }
    /**
     * å¯¼å‡ºè‡ªåŠ¨è¯„ä¼°ç»“æžœ
     * é‡‘山工地、码头、搅拌站自评
     */
    @Test
    fun test2() {
        val taskId = "rXtm0AozZYJqoEpW"
        val districtCode = "310116"
        val year = 2023
        val month = 11
//        val sceneType = Constant.SceneType.TYPE1.value.toInt()
//        val sceneType = Constant.SceneType.TYPE2.value.toInt()
        val sceneType = Constant.SceneType.TYPE3.value.toInt()
//        val sceneType = Constant.SceneType.TYPE14.value.toInt()
        when (sceneType) {
            Constant.SceneType.TYPE1.value.toInt()->{
                jsCsDataAnalysis.setResource(taskId, sceneType, year, month)
                jsCsDataAnalysis.execute()
            }
            Constant.SceneType.TYPE2.value.toInt()->{
                jsWhDataAnalysis.setResource(taskId, sceneType, year, month)
                jsWhDataAnalysis.execute()
            }
            Constant.SceneType.TYPE3.value.toInt()->{
                jsMpDataAnalysis.setResource(taskId, sceneType, year, month)
                jsMpDataAnalysis.execute()
            }
        }
        aopEvaluation.executeByTopTask(taskId, sceneType)
        val mode = 9
        searchService.writeToFile(ExcelConfigVo(
            "VHXHS1dHsykTNUf2",
            districtCode = "310106",
            sceneType = 1), mode)
            taskId,
            districtCode = districtCode,
            sceneType = sceneType), mode)
    }
}
src/test/kotlin/cn/flightfeather/supervision/business/fume/AutoScoreTest.kt
ÎļþÒÑɾ³ý
src/test/kotlin/cn/flightfeather/supervision/business/location/LocationRoadNearbyTest.kt
@@ -24,27 +24,29 @@
//        val b = LocationRoadNearby.BasePlace("", Pair(121.378346, 30.84923), Pair(121.378296, 30.861472))
//        locationRoadNearby.search(b, 1000.0)
        val bList = listOf(
            LocationRoadNearby.BasePlace("干钱路-金石北路-金张公路", Pair(121.218411,30.826654), Pair(121.227142,30.828403)),
            LocationRoadNearby.BasePlace("金廊公路-建乐路-朱吕公路", Pair(121.18409,30.835699), Pair(121.183811,30.831636)),
            LocationRoadNearby.BasePlace("金张公路-田新路-干钱路", Pair(121.219555,30.829319), Pair(121.227142,30.828403)),
            LocationRoadNearby.BasePlace("大茫中心路-朱平公路-朱增路", Pair(121.147448,30.858481), Pair(121.149312,30.857804)),
            LocationRoadNearby.BasePlace("大茫中心路-建富路-朱平公路", Pair(121.141819,30.858344), Pair(121.147448,30.858481)),
            LocationRoadNearby.BasePlace("朱吕公路-金张公路-康兴路", Pair(121.177261,30.83326), Pair(121.18053,30.830751)),
            LocationRoadNearby.BasePlace("朱吕公路-金廊公路-康兴路", Pair(121.183811,30.831636), Pair(121.18053,30.830751)),
            LocationRoadNearby.BasePlace("吕新路-建乐路-朱吕公路", Pair(121.191766,30.835612), Pair(121.196591,30.831604)),
            LocationRoadNearby.BasePlace("溪北路-朱吕公路-新东街", Pair(121.171163,30.832014), Pair(121.174958,30.827349)),
            LocationRoadNearby.BasePlace("东方红中心路-农建路-朱平公路", Pair(121.141617,30.870365), Pair(121.145145,30.870635)),
            LocationRoadNearby.BasePlace("东方红中心路-朱平公路-朱增路", Pair(121.145145,30.870635), Pair(121.155051,30.870966)),
            LocationRoadNearby.BasePlace("朱吕公路-金廊公路-田欢路", Pair(121.183811,30.831636), Pair(121.18989,30.831606)),
            LocationRoadNearby.BasePlace("朱平公路-东富路-大茫中心路", Pair(121.146281,30.864199), Pair(121.147448,30.858481)),
            LocationRoadNearby.BasePlace("朱平公路-东方红中心路-东富路", Pair(121.145404,30.869592), Pair(121.146281,30.864199)),
            LocationRoadNearby.BasePlace("金张公路-金石北路-田新路", Pair(121.215668,30.830838), Pair(121.219555,30.829319)),
            LocationRoadNearby.BasePlace("朱平公路-吕青路-蔷荚路", Pair(121.148479,30.836083), Pair(121.14842,30.842135)),
            LocationRoadNearby.BasePlace("朱泾农建路-建富路-朱平公路", Pair(121.142609,30.863955), Pair(121.146407,30.864167)),
            LocationRoadNearby.BasePlace("朱泾农建路-朱平公路-朱增路", Pair(121.146407,30.864167), Pair(121.153675,30.864075)),
            LocationRoadNearby.BasePlace("吕青路-朱吕公路-朱平公路", Pair(121.136318,30.833325), Pair(121.148624,30.836094)),
            LocationRoadNearby.BasePlace("泖湾支路-吕青路-朱平公路", Pair(121.155048,30.835229), Pair(121.148659,30.829861)),
//            LocationRoadNearby.BasePlace("干钱路-金石北路-金张公路", Pair(121.218411,30.826654), Pair(121.227142,30.828403)),
//            LocationRoadNearby.BasePlace("金廊公路-建乐路-朱吕公路", Pair(121.18409,30.835699), Pair(121.183811,30.831636)),
//            LocationRoadNearby.BasePlace("金张公路-田新路-干钱路", Pair(121.219555,30.829319), Pair(121.227142,30.828403)),
//            LocationRoadNearby.BasePlace("大茫中心路-朱平公路-朱增路", Pair(121.147448,30.858481), Pair(121.149312,30.857804)),
//            LocationRoadNearby.BasePlace("大茫中心路-建富路-朱平公路", Pair(121.141819,30.858344), Pair(121.147448,30.858481)),
//            LocationRoadNearby.BasePlace("朱吕公路-金张公路-康兴路", Pair(121.177261,30.83326), Pair(121.18053,30.830751)),
//            LocationRoadNearby.BasePlace("朱吕公路-金廊公路-康兴路", Pair(121.183811,30.831636), Pair(121.18053,30.830751)),
//            LocationRoadNearby.BasePlace("吕新路-建乐路-朱吕公路", Pair(121.191766,30.835612), Pair(121.196591,30.831604)),
//            LocationRoadNearby.BasePlace("溪北路-朱吕公路-新东街", Pair(121.171163,30.832014), Pair(121.174958,30.827349)),
//            LocationRoadNearby.BasePlace("东方红中心路-农建路-朱平公路", Pair(121.141617,30.870365), Pair(121.145145,30.870635)),
//            LocationRoadNearby.BasePlace("东方红中心路-朱平公路-朱增路", Pair(121.145145,30.870635), Pair(121.155051,30.870966)),
//            LocationRoadNearby.BasePlace("朱吕公路-金廊公路-田欢路", Pair(121.183811,30.831636), Pair(121.18989,30.831606)),
//            LocationRoadNearby.BasePlace("朱平公路-东富路-大茫中心路", Pair(121.146281,30.864199), Pair(121.147448,30.858481)),
//            LocationRoadNearby.BasePlace("朱平公路-东方红中心路-东富路", Pair(121.145404,30.869592), Pair(121.146281,30.864199)),
//            LocationRoadNearby.BasePlace("金张公路-金石北路-田新路", Pair(121.215668,30.830838), Pair(121.219555,30.829319)),
//            LocationRoadNearby.BasePlace("朱平公路-吕青路-蔷荚路", Pair(121.148479,30.836083), Pair(121.14842,30.842135)),
//            LocationRoadNearby.BasePlace("朱泾农建路-建富路-朱平公路", Pair(121.142609,30.863955), Pair(121.146407,30.864167)),
//            LocationRoadNearby.BasePlace("朱泾农建路-朱平公路-朱增路", Pair(121.146407,30.864167), Pair(121.153675,30.864075)),
//            LocationRoadNearby.BasePlace("吕青路-朱吕公路-朱平公路", Pair(121.136318,30.833325), Pair(121.148624,30.836094)),
//            LocationRoadNearby.BasePlace("泖湾支路-吕青路-朱平公路", Pair(121.155048,30.835229), Pair(121.148659,30.829861)),
            LocationRoadNearby.BasePlace("徐汇上师大", Pair(121.416643,31.163531), Pair(121.416643,31.163531)),
        )
        locationRoadNearby.searchList(bList, 1000.0)
        locationRoadNearby.searchList(bList, 2000.0)
    }
}