feiyu02
2025-09-17 8c15c9cc0d6474ed77e313258f9b09f7f2d6366e
2025.9.17
1. 新增数据产品接口
已修改3个文件
已添加18个文件
857 ■■■■■ 文件已修改
src/main/kotlin/cn/flightfeather/supervision/business/autooutput/datasource/AopDbMapper.kt 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/common/utils/Constant.kt 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/common/utils/QueryByCache.kt 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/DataProdBaseService.kt 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/DataProdFinalService.kt 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/DataProdMiddleService.kt 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/DataProdBaseServiceImpl.kt 209 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/DataProdMiddleServiceImpl.kt 153 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/ScenseVo.kt 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/dataprod/DPEvaluateInfo.kt 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/dataprod/DPInspectionInfo.kt 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/dataprod/DPMonitorDataInfo.kt 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/dataprod/DPSceneInfo.kt 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/dataprod/QueryOpt.kt 41 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/dataprod/middle/DPEvaluationByArea.kt 59 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/dataprod/middle/DPInspectionSummary.kt 34 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/dataprod/middle/DPProblemCountByArea.kt 38 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/dataprod/middle/DPProblemTypeCount.kt 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/lightshare/web/DataProdBaseController.kt 42 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/lightshare/web/DataProdFinalController.kt 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/lightshare/web/DataProdMiddleController.kt 48 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/business/autooutput/datasource/AopDbMapper.kt
@@ -28,5 +28,6 @@
    val userMapMapper: UserMapMapper,
    val townMapper: TownMapper,
    val restaurantBaseInfoMapper: RestaurantBaseInfoMapper,
    val vehicleBaseInfoMapper: VehicleBaseInfoMapper
    val vehicleBaseInfoMapper: VehicleBaseInfoMapper,
    val dustDataResultMapper: DustDataResultMapper
)
src/main/kotlin/cn/flightfeather/supervision/common/utils/Constant.kt
@@ -24,6 +24,10 @@
    enum class RuleType(val value: Byte, val text: String){
        STANDARD(1,"规范性"), SCORE(2,"评分")
    }
    //规范性等级
    enum class EvaluationLevel(val value: Byte, val text: String){
        A(1,"规范"), B(2,"基本规范"), C(3,"不规范"), D(4,"严重不规范")
    }
    //任务状态
    enum class TaskProgress(val value: String, val text: String){
        RUNINGSTATUS1("1","未执行"),
src/main/kotlin/cn/flightfeather/supervision/common/utils/QueryByCache.kt
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,26 @@
package cn.flightfeather.supervision.common.utils
/**
 * ç¼“存查询工具类
 * @date 2025/9/15
 * @author feiyu02
 */
object QueryByCache {
    /**
     * ç¼“存查询
     * @param cache ç¼“存获取方法
     * @param calculate è®¡ç®—方法
     * @param save ç¼“存保存方法
     * @return
     */
    fun <T> queryCache(cache: () -> T?, calculate: () -> T, save: (t: T) -> Unit): T {
        val cacheData = cache.invoke()
        if (cacheData != null) {
            return cacheData
        }
        val calculateData = calculate.invoke()
        save.invoke(calculateData)
        return calculateData
    }
}
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/DataProdBaseService.kt
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,31 @@
package cn.flightfeather.supervision.lightshare.service
import cn.flightfeather.supervision.lightshare.vo.dataprod.*
/**
 * åŸºç¡€æ•°æ®äº§å“æœåŠ¡æŽ¥å£
 * @date 2025/9/15
 * @author feiyu02
 */
interface DataProdBaseService {
    /**
     * èŽ·å–æ•°æ®äº§å“åœºæ™¯ä¿¡æ¯
     */
    fun getSceneInfo(queryOpt: QueryOpt): List<DPSceneInfo>
    /**
     * èŽ·å–æ•°æ®äº§å“è§„èŒƒè¯„ä¼°ä¿¡æ¯
     */
    fun getEvaluateInfo(queryOpt: QueryOpt): List<DPEvaluateInfo>
    /**
     * èŽ·å–æ•°æ®äº§å“å·¡æŸ¥ä¿¡æ¯
     */
    fun getInspectionInfo(queryOpt: QueryOpt): List<DPInspectionInfo>
    /**
     * èŽ·å–æ•°æ®äº§å“ç›‘æµ‹æ•°æ®ä¿¡æ¯
     */
    fun getMonitorDataInfo(queryOpt: QueryOpt): List<DPMonitorDataInfo>
}
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/DataProdFinalService.kt
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,9 @@
package cn.flightfeather.supervision.lightshare.service
/**
 * æœ€ç»ˆæ•°æ®äº§å“æœåŠ¡æŽ¥å£
 * @date 2025/9/15
 * @author feiyu02
 */
interface DataProdFinalService {
}
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/DataProdMiddleService.kt
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,35 @@
package cn.flightfeather.supervision.lightshare.service
import cn.flightfeather.supervision.lightshare.vo.dataprod.middle.DPInspectionSummary
import cn.flightfeather.supervision.lightshare.vo.dataprod.QueryOpt
import cn.flightfeather.supervision.lightshare.vo.dataprod.middle.DPEvaluationByArea
import cn.flightfeather.supervision.lightshare.vo.dataprod.middle.DPProblemCountByArea
import cn.flightfeather.supervision.lightshare.vo.dataprod.middle.DPProblemTypeCount
/**
 * ä¸­é—´æ•°æ®äº§å“æœåŠ¡æŽ¥å£
 * @date 2025/9/15
 * @author feiyu02
 */
interface DataProdMiddleService {
    /**
     * å·¡æŸ¥å®Œæˆæƒ…况汇总
     */
    fun getInspectionSummary(queryOpt: QueryOpt): DPInspectionSummary
    /**
     * é—®é¢˜åˆ†ç±»æ±‡æ€»
     */
    fun getProblemTypeSummary(queryOpt: QueryOpt): List<DPProblemTypeCount>
    /**
     * åˆ†åŒºåŸŸå•场景问题数量
     */
    fun getProblemCountByArea(queryOpt: QueryOpt): List<DPProblemCountByArea>
    /**
     * åˆ†åŒºåŸŸè§„范性情况
     */
    fun getEvaluationByArea(queryOpt: QueryOpt): List<DPEvaluationByArea>
}
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/DataProdBaseServiceImpl.kt
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,209 @@
package cn.flightfeather.supervision.lightshare.service.impl
import cn.flightfeather.supervision.business.autooutput.datasource.AopDbMapper
import cn.flightfeather.supervision.common.utils.Constant
import cn.flightfeather.supervision.common.utils.QueryByCache
import cn.flightfeather.supervision.domain.ds1.entity.*
import cn.flightfeather.supervision.lightshare.service.DataProdBaseService
import cn.flightfeather.supervision.lightshare.vo.ProblemListVo
import cn.flightfeather.supervision.lightshare.vo.dataprod.*
import org.springframework.beans.BeanUtils
import org.springframework.stereotype.Service
import tk.mybatis.mapper.entity.Example
/**
 *
 * @date 2025/9/15
 * @author feiyu02
 */
@Service
class DataProdBaseServiceImpl(private val aopDbMapper: AopDbMapper) : DataProdBaseService {
    override fun getSceneInfo(queryOpt: QueryOpt): List<DPSceneInfo> {
        return QueryByCache.queryCache(
            cache = { return@queryCache null },
            calculate = {
                val res = mutableListOf<DPSceneInfo>()
                val objList = aopDbMapper.monitorobjectversionMapper.selectByExample(Example(Monitorobjectversion::class.java).apply {
                    createCriteria().andEqualTo("tid", queryOpt.topTaskId)
                })
                if (objList.isEmpty()) return@queryCache emptyList<DPSceneInfo>()
                val guidList = objList.map { it.sguid }
                val baseScene = aopDbMapper.scenseMapper.selectByExample(Example(Scense::class.java).apply {
                    createCriteria().andIn("guid", guidList)
                        .andEqualTo("typeid", queryOpt.sceneTypeId)
                    orderBy("typeid").orderBy("index")
                })
                baseScene.groupBy { it.typeid }.forEach { (typeid, sceneList) ->
                    when (typeid.toString()) {
                        Constant.SceneType.TYPE1.value -> {
                            val subScene = aopDbMapper.sceneConstructionSiteMapper.selectByExample(Example(SceneConstructionSite::class.java).apply {
                                createCriteria().andIn("sGuid", sceneList.map { it.guid })
                            })
                            sceneList.forEach {
                                val sub = subScene.find { sub-> sub.getsGuid() == it.guid }
                                res.add(DPSceneInfo().apply {
                                    this.scene = it
                                    this.subScene = sub
                                    this.status = sub?.csStatus
                                    this.statusBool = sub?.csStatus == "建设中"
                                    this.stage = sub?.siExtension1
                                })
                            }
                        }
                        Constant.SceneType.TYPE2.value -> {
                            val subScene = aopDbMapper.sceneWharfMapper.selectByExample(Example(SceneWharf::class.java).apply {
                                createCriteria().andIn("sGuid", sceneList.map { it.guid })
                            })
                            sceneList.forEach {
                                val sub = subScene.find { sub-> sub.getsGuid() == it.guid }
                                res.add(DPSceneInfo().apply {
                                    this.scene = it
                                    this.subScene = sub
                                    this.status = sub?.getwStatus()
                                    this.statusBool = sub?.getwStatus() == "营运中"
                                })
                            }
                        }
                        Constant.SceneType.TYPE3.value -> {
                            val subScene = aopDbMapper.sceneMixingPlantMapper.selectByExample(Example(SceneMixingPlant::class.java).apply {
                                createCriteria().andIn("sGuid", sceneList.map { it.guid })
                            })
                            sceneList.forEach {
                                val sub = subScene.find { sub-> sub.getsGuid() == it.guid }
                                res.add(DPSceneInfo().apply {
                                    this.scene = it
                                    this.subScene = sub
                                    this.status = sub?.mpStatus
                                    this.statusBool = sub?.mpStatus == "营运中"
                                })
                            }
                        }
                        Constant.SceneType.TYPE14.value -> {
                            val subScene = aopDbMapper.sceneStorageYardMapper.selectByExample(Example
                                (SceneStorageYard::class.java).apply {
                                createCriteria().andIn("sGuid", sceneList.map { it.guid })
                            })
                            sceneList.forEach {
                                val sub = subScene.find { sub-> sub.getsGuid() == it.guid }
                                res.add(DPSceneInfo().apply {
                                    this.scene = it
                                    this.subScene = sub
                                    this.status = sub?.syStatus
                                    this.statusBool = sub?.syStatus == "营运中"
                                })
                            }
                        }
                        else -> {
                            sceneList.forEach {
                                res.add(DPSceneInfo().apply {
                                    this.scene = it
                                })
                            }
                        }
                    }
                }
                return@queryCache res
            },
            save = {  }
        )
    }
    override fun getEvaluateInfo(queryOpt: QueryOpt): List<DPEvaluateInfo> {
        return QueryByCache.queryCache(
            cache = { return@queryCache null },
            calculate = {
                val res = mutableListOf<DPEvaluateInfo>()
                val subtaskList = aopDbMapper.subtaskMapper.selectByExample(Example(Subtask::class.java).apply {
                    createCriteria().andEqualTo("tguid", queryOpt.topTaskId)
                })
                if (subtaskList.isEmpty()) return@queryCache emptyList<DPEvaluateInfo>()
                aopDbMapper.evaluationMapper.selectByExample(Example(Evaluation::class.java).apply {
                    createCriteria().andIn("stguid", subtaskList.map { it.stguid })
                }).forEach {
                    res.add(DPEvaluateInfo().apply {
                        subTask = subtaskList.find { sub-> sub.stguid == it.stguid }
                        evaluate = it
                        val score = it.resultscorebef?.toIntOrNull() ?: -1
                        scoreLevel = when {
                            score in 0..39 -> Constant.EvaluationLevel.D.text
                            score in 40..89 -> Constant.EvaluationLevel.C.text
                            score in 90..99 -> Constant.EvaluationLevel.B.text
                            score >= 100 -> Constant.EvaluationLevel.A.text
                            else -> ""
                        }
                    })
                }
                return@queryCache res
            },
            save = {  }
        )
    }
    override fun getInspectionInfo(queryOpt: QueryOpt): List<DPInspectionInfo> {
        return QueryByCache.queryCache(
            cache = { return@queryCache null },
            calculate = {
                val res = mutableListOf<DPInspectionInfo>()
                val subtaskList = aopDbMapper.subtaskMapper.selectByExample(Example(Subtask::class.java).apply {
                    createCriteria().andEqualTo("tguid", queryOpt.topTaskId)
                })
                if (subtaskList.isEmpty()) return@queryCache emptyList<DPInspectionInfo>()
                val problemList = aopDbMapper.problemlistMapper.selectByExample(Example(Problemlist::class.java).apply {
                    createCriteria().andIn("stguid", subtaskList.map { it.stguid })
                })
                val problemTypeList = aopDbMapper.problemtypeMapper.selectByExample(Example(Problemtype::class.java)
                    .apply { createCriteria().andIn("guid", problemList.map { it.ptguid }) })
                subtaskList.forEach {
                    res.add(DPInspectionInfo().apply {
                        subTask = it
                        problems = problemList.filter { problem-> problem.stguid == it.stguid }.map { problem->
                            val problemListVo = ProblemListVo()
                            BeanUtils.copyProperties(problem, problemListVo)
                            problemListVo.apply {
                                problemTypeList.find { type-> type.guid == problem.ptguid }?.let {
                                    typeid = it.typeid
                                    typename = it.typename
                                }
                            }
                            // TODO åª’体文件
                        }
                    })
                }
                return@queryCache res
            },
            save = {  }
        )
    }
    override fun getMonitorDataInfo(queryOpt: QueryOpt): List<DPMonitorDataInfo> {
        return QueryByCache.queryCache(
            cache = { return@queryCache null },
            calculate = {
                val res = mutableListOf<DPMonitorDataInfo>()
                val objList = aopDbMapper.monitorobjectversionMapper.selectByExample(Example(Monitorobjectversion::class.java).apply {
                    createCriteria().andEqualTo("tid", queryOpt.topTaskId)
                })
                if (objList.isEmpty()) return@queryCache res
                aopDbMapper.dustDataResultMapper.selectByExample(Example(DustDataResult::class.java).apply {
                    createCriteria().andBetween("drTime", queryOpt.startTime, queryOpt.endTime)
                        .andIn("objectId", objList.map { it.sguid })
                }).forEach {
                    res.add(DPMonitorDataInfo().apply {
                        data = it
                    })
                }
                return@queryCache res
            },
            save = {  }
        )
    }
}
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/DataProdMiddleServiceImpl.kt
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,153 @@
package cn.flightfeather.supervision.lightshare.service.impl
import cn.flightfeather.supervision.common.utils.Constant
import cn.flightfeather.supervision.common.utils.QueryByCache
import cn.flightfeather.supervision.domain.ds1.entity.SceneConstructionSite
import cn.flightfeather.supervision.lightshare.service.DataProdBaseService
import cn.flightfeather.supervision.lightshare.service.DataProdMiddleService
import cn.flightfeather.supervision.lightshare.vo.dataprod.QueryOpt
import cn.flightfeather.supervision.lightshare.vo.dataprod.middle.DPEvaluationByArea
import cn.flightfeather.supervision.lightshare.vo.dataprod.middle.DPInspectionSummary
import cn.flightfeather.supervision.lightshare.vo.dataprod.middle.DPProblemCountByArea
import cn.flightfeather.supervision.lightshare.vo.dataprod.middle.DPProblemTypeCount
import org.springframework.stereotype.Service
/**
 *
 * @date 2025/9/15
 * @author feiyu02
 */
@Service
class DataProdMiddleServiceImpl(private val dataProdBaseService: DataProdBaseService) : DataProdMiddleService {
    override fun getInspectionSummary(queryOpt: QueryOpt): DPInspectionSummary {
        return QueryByCache.queryCache(
            cache = { return@queryCache null },
            calculate = {
                val res = DPInspectionSummary()
                val inspectionInfo = dataProdBaseService.getInspectionInfo(queryOpt)
                val sceneInfo = dataProdBaseService.getSceneInfo(queryOpt)
                res.sceneCount = sceneInfo.size
                res.pointCount = inspectionInfo.size
                res.reviewPointCount = inspectionInfo.size - inspectionInfo.distinctBy { it.subTask?.scenseid }.size
                sceneInfo.forEach {
                    when (it.scene?.typeid.toString()) {
                        // å¯¹äºŽå»ºç­‘工地类型,根据其csStatus判断是否停工或完工
                        Constant.SceneType.TYPE1.value -> {
                            when ((it.subScene as SceneConstructionSite).csStatus) {
                                "停工" -> {
                                    res.stopSceneCount++
                                }
                                "完工" -> {
                                    res.completeSceneCount++
                                }
                            }
                        }
                        // å¯¹äºŽå…¶ä»–类型,根据其extension1(代表是否上线)判断是否完工
                        else -> {
                            if (it.scene?.extension1 != "1") {
                                res.completeSceneCount++
                            }
                        }
                    }
                }
                return@queryCache res
            },
            save = {}
        )
    }
    override fun getProblemTypeSummary(queryOpt: QueryOpt): List<DPProblemTypeCount> {
        return QueryByCache.queryCache(
            cache = { return@queryCache null },
            calculate = {
                val res = mutableListOf<DPProblemTypeCount>()
                val inspectionInfo = dataProdBaseService.getInspectionInfo(queryOpt)
                val allProblemList = inspectionInfo.flatMap { it.problems ?: emptyList() }
                allProblemList.groupBy { it.typeid }.forEach { (typeid, problemList) ->
                    res.add(DPProblemTypeCount().apply {
                        this.typeId = typeid
                        this.typeName = problemList.firstOrNull()?.typename
                        this.count = problemList.size
                        this.ratio = problemList.size.toDouble() / allProblemList.size
                    })
                }
                return@queryCache res
            },
            save = {}
        )
    }
    override fun getProblemCountByArea(queryOpt: QueryOpt): List<DPProblemCountByArea> {
        return QueryByCache.queryCache(
            cache = { return@queryCache null },
            calculate = {
                val res = mutableListOf<DPProblemCountByArea>()
                val inspectionInfo = dataProdBaseService.getInspectionInfo(queryOpt)
                inspectionInfo
                    .groupBy { it.subTask?.provincecode + it.subTask?.citycode + it.subTask?.districtcode + it.subTask?.towncode }
                    .forEach { (areaName, ins) ->
                        val firstSubtask = ins.first().subTask
                        val allProblemList = ins.flatMap { it.problems ?: emptyList() }
                        res.add(DPProblemCountByArea().apply {
                            this.provinceCode = firstSubtask?.provincecode
                            this.provinceName = firstSubtask?.provincename
                            this.cityCode = firstSubtask?.citycode
                            this.cityName = firstSubtask?.cityname
                            this.districtCode = firstSubtask?.districtcode
                            this.districtName = firstSubtask?.districtname
                            this.townCode = firstSubtask?.towncode
                            this.townName = firstSubtask?.townname
                            this.sceneCount = ins.distinctBy { it.subTask?.scenseid }.size
                            this.problemCount = allProblemList.size
                            this.ratio = problemCount.toDouble() / sceneCount
                        })
                    }
                return@queryCache res
            },
            save = {}
        )
    }
    override fun getEvaluationByArea(queryOpt: QueryOpt): List<DPEvaluationByArea> {
        return QueryByCache.queryCache(
            cache = { return@queryCache null },
            calculate = {
                val res = mutableListOf<DPEvaluationByArea>()
                val sceneInfo = dataProdBaseService.getSceneInfo(queryOpt)
                val evaluation = dataProdBaseService.getEvaluateInfo(queryOpt)
                evaluation
                    .groupBy { it.subTask?.provincecode + it.subTask?.citycode + it.subTask?.districtcode + it.subTask?.towncode }
                    .forEach { (areaName, evals) ->
                        val firstSubtask = evals.first().subTask
                        res.add(DPEvaluationByArea().apply {
                            this.provinceCode = firstSubtask?.provincecode
                            this.provinceName = firstSubtask?.provincename
                            this.cityCode = firstSubtask?.citycode
                            this.cityName = firstSubtask?.cityname
                            this.districtCode = firstSubtask?.districtcode
                            this.districtName = firstSubtask?.districtname
                            this.townCode = firstSubtask?.towncode
                            this.townName = firstSubtask?.townname
                            this.validSceneCount = sceneInfo
                                .filter {
                                    it.scene?.provincecode + it.scene?.citycode + it.scene?.districtcode + it.scene?.towncode == areaName
                                            && it.statusBool
                                }.size
                            this.evaluationCount = evals.size
                            this.evalLevelACount = evals.count { it.scoreLevel == Constant.EvaluationLevel.A.text }
                            this.evalLevelBCount = evals.count { it.scoreLevel == Constant.EvaluationLevel.B.text }
                            this.evalLevelCCount = evals.count { it.scoreLevel == Constant.EvaluationLevel.C.text }
                            this.evalLevelDCount = evals.count { it.scoreLevel == Constant.EvaluationLevel.D.text }
                            this.evalLevelRatioAB = (this.evalLevelACount + this.evalLevelBCount).toDouble() / this.evaluationCount
                        })
                    }
                return@queryCache res
            },
            save = {}
        )
    }
}
src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/ScenseVo.kt
@@ -74,16 +74,4 @@
    var monitorNum: Int = 0
    var inspectedNum: Int = 0
}
/**
 * æ ¹æ®åœºæ™¯id找到场景
 */
fun List<Scense?>.findByGuid(guid: String?): Scense? {
    this.forEach {
        if (it?.guid == guid) {
            return it
        }
    }
    return null
}
src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/dataprod/DPEvaluateInfo.kt
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,16 @@
package cn.flightfeather.supervision.lightshare.vo.dataprod
import cn.flightfeather.supervision.domain.ds1.entity.Evaluation
import cn.flightfeather.supervision.domain.ds1.entity.Subtask
/**
 * æ•°æ®äº§å“è§„范评估信息类
 * ç”¨äºŽå°è£…场景的规范评估数据,包括场景基本信息和评估结果
 * @date 2025/9/15
 * @author feiyu02
 */
class DPEvaluateInfo {
    var subTask:Subtask? = null
    var evaluate: Evaluation? = null
    var scoreLevel: String? = null
}
src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/dataprod/DPInspectionInfo.kt
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,15 @@
package cn.flightfeather.supervision.lightshare.vo.dataprod
import cn.flightfeather.supervision.domain.ds1.entity.Problemlist
import cn.flightfeather.supervision.domain.ds1.entity.Subtask
import cn.flightfeather.supervision.lightshare.vo.ProblemListVo
/**
 * æ•°æ®äº§å“çŽ°åœºå·¡æŸ¥ä¿¡æ¯
 * @date 2025/9/15
 * @author feiyu02
 */
class DPInspectionInfo {
    var subTask: Subtask? = null
    var problems: List<ProblemListVo>? = null
}
src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/dataprod/DPMonitorDataInfo.kt
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,12 @@
package cn.flightfeather.supervision.lightshare.vo.dataprod
import cn.flightfeather.supervision.domain.ds1.entity.DustDataResult
/**
 * æ•°æ®äº§å“ç›‘测数据信息
 * @date 2025/9/15
 * @author feiyu02
 */
class DPMonitorDataInfo {
    var data: DustDataResult? = null
}
src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/dataprod/DPSceneInfo.kt
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,26 @@
package cn.flightfeather.supervision.lightshare.vo.dataprod
import cn.flightfeather.supervision.domain.ds1.entity.BaseScene
import cn.flightfeather.supervision.domain.ds1.entity.Scense
/**
 * æ•°æ®äº§å“åœºæ™¯ä¿¡æ¯
 * @date 2025/9/15
 * @author feiyu02
 */
class DPSceneInfo {
    // åœºæ™¯åŸºæœ¬ä¿¡æ¯
    var scene: Scense? = null
    // åœºæ™¯ç‰¹æœ‰ä¿¡æ¯
    var subScene: BaseScene? = null
    // çŠ¶æ€ï¼Œæ ¹æ®åœºæ™¯ç±»åž‹ä¸åŒï¼Œæè¿°ä¸åŒï¼ˆä¾‹å¦‚å·¥åœ°ï¼šå»ºè®¾ä¸­ã€å®Œå·¥ã€åœå·¥ï¼›ç å¤´ï¼šåœè¿ã€è¥è¿ä¸­ï¼‰
    var status: String? = null
    var statusBool: Boolean = false
    // é˜¶æ®µï¼Œæ ¹æ®åœºæ™¯ç±»åž‹ä¸åŒï¼Œæè¿°ä¸åŒï¼ˆä¾‹å¦‚工地:基础、结构、室外总体等)
    var stage: String? = null
}
src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/dataprod/QueryOpt.kt
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,41 @@
package cn.flightfeather.supervision.lightshare.vo.dataprod
import com.fasterxml.jackson.annotation.JsonFormat
import io.swagger.annotations.ApiModelProperty
import java.time.LocalDateTime
/**
 * æŸ¥è¯¢å‚æ•°
 * @date 2025/9/15
 * @author feiyu02
 */
class QueryOpt {
    @ApiModelProperty("总任务id")
    var topTaskId: String? = null
    @ApiModelProperty("省份编码")
    var provinceCode: String? = null
    @ApiModelProperty("城市编码")
    var cityCode: String? = null
    @ApiModelProperty("区县编码")
    var districtCode: String? = null
    @ApiModelProperty("街镇编码")
    var townCode: String? = null
    @ApiModelProperty("起始时间,格式 yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    var startTime: LocalDateTime? = null
    @ApiModelProperty("结束时间,格式 yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    var endTime: LocalDateTime? = null
    @ApiModelProperty("场景类型id")
    var sceneTypeId: String? = null
    @ApiModelProperty("是否需要缓存")
    var needCache: Boolean = true
}
src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/dataprod/middle/DPEvaluationByArea.kt
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,59 @@
package cn.flightfeather.supervision.lightshare.vo.dataprod.middle
/**
 * åˆ†åŒºåŸŸè§„范性情况
 * @date 2025/9/15
 * @author feiyu02
 */
class DPEvaluationByArea {
    var provinceCode: String? = null
    var provinceName: String? = null
    var cityCode: String? = null
    var cityName: String? = null
    var districtCode: String? = null
    var districtName: String? = null
    var townCode: String? = null
    var townName: String? = null
    /**
     * æœ‰æ•ˆåœºæ™¯æ•°é‡ï¼ˆå»ºè®¾ä¸­çš„工地,营运中的码头等)
     */
    var validSceneCount: Int = 0
    /**
     * è¯„估点次
     */
    var evaluationCount: Int = 0
    /**
     * è§„范等级A(规范)数量
     */
    var evalLevelACount: Int = 0
    /**
     * è§„范等级B(基本规范)数量
     */
    var evalLevelBCount: Int = 0
    /**
     * è§„范等级C(不规范)数量
     */
    var evalLevelCCount: Int = 0
    /**
     * è§„范等级D(严重不规范)数量
     */
    var evalLevelDCount: Int = 0
    /**
     * è§„范等级A(规范)与B(基本规范)占比
     */
    var evalLevelRatioAB: Double = 0.0
}
src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/dataprod/middle/DPInspectionSummary.kt
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,34 @@
package cn.flightfeather.supervision.lightshare.vo.dataprod.middle
/**
 * æ•°æ®äº§å“å·¡æŸ¥æ±‡æ€»ä¿¡æ¯
 * @date 2025/9/15
 * @author feiyu02
 */
class DPInspectionSummary {
    /**
     * å·¡æŸ¥åœºæ™¯æ€»æ•°
     */
    var sceneCount: Int = 0
    /**
     * å·¡æŸ¥ç‚¹æ¬¡æ€»æ•°
     */
    var pointCount: Int = 0
    /**
     * å·¡æŸ¥å¤æ ¸ç‚¹æ¬¡æ€»æ•°
     */
    var reviewPointCount: Int = 0
    /**
     * åœå·¥åœºæ™¯æ•°
     */
    var stopSceneCount: Int = 0
    /**
     * å®Œå·¥åœºæ™¯æ•°
     */
    var completeSceneCount: Int = 0
}
src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/dataprod/middle/DPProblemCountByArea.kt
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,38 @@
package cn.flightfeather.supervision.lightshare.vo.dataprod.middle
import io.swagger.annotations.ApiModelProperty
/**
 *
 * @date 2025/9/15
 * @author feiyu02
 */
class DPProblemCountByArea {
    var provinceCode: String? = null
    var provinceName: String? = null
    var cityCode: String? = null
    var cityName: String? = null
    var districtCode: String? = null
    var districtName: String? = null
    var townCode: String? = null
    var townName: String? = null
    /**
     * åœºæ™¯æ•°é‡
     */
    var sceneCount: Int = 0
    /**
     * é—®é¢˜æ•°é‡
     */
    var problemCount: Int = 0
    /**
     * é—®é¢˜æ•°é‡å æ¯”
     */
    var ratio: Double = 0.0
}
src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/dataprod/middle/DPProblemTypeCount.kt
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,28 @@
package cn.flightfeather.supervision.lightshare.vo.dataprod.middle
/**
 * æ•°æ®äº§å“é—®é¢˜åˆ†ç±»æ±‡æ€»ä¿¡æ¯
 * @date 2025/9/15
 * @author feiyu02
 */
class DPProblemTypeCount {
    /**
     * é—®é¢˜åˆ†ç±»ID
     */
    var typeId: Byte? = null
    /**
     * é—®é¢˜åˆ†ç±»åç§°
     */
    var typeName: String? = null
    /**
     * é—®é¢˜æ•°é‡
     */
    var count: Int = 0
    /**
     * é—®é¢˜æ•°é‡å æ¯”
     */
    var ratio: Double = 0.0
}
src/main/kotlin/cn/flightfeather/supervision/lightshare/web/DataProdBaseController.kt
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,42 @@
package cn.flightfeather.supervision.lightshare.web
import cn.flightfeather.supervision.lightshare.service.DataProdBaseService
import cn.flightfeather.supervision.lightshare.vo.dataprod.QueryOpt
import io.swagger.annotations.Api
import org.springframework.web.bind.annotation.*
/**
 * åŸºç¡€æ•°æ®äº§å“æŽ§åˆ¶å™¨
 * @date 2025/9/15
 * @author feiyu02
 */
@Api(tags = ["DataProdBaseController"], description = "基础数据产品相关API接口")
@RestController
@RequestMapping("/dataProd/base")
class DataProdBaseController(private val dataProdBaseService: DataProdBaseService) {
    /**
     * åœºæ™¯åˆ—表
     */
    @PostMapping("/scene/get")
    fun getSceneInfo(@RequestBody queryOpt: QueryOpt) = resPack { dataProdBaseService.getSceneInfo(queryOpt) }
    /**
     * è§„范评估列表
     */
    @PostMapping("/evaluate/get")
    fun getEvaluateInfo(@RequestBody queryOpt: QueryOpt) = resPack { dataProdBaseService.getEvaluateInfo(queryOpt) }
    /**
     * å·¡æŸ¥åˆ—表
     */
    @PostMapping("/inspection/get")
    fun getInspectionInfo(@RequestBody queryOpt: QueryOpt) = resPack { dataProdBaseService.getInspectionInfo(queryOpt) }
    /**
     * ç›‘测数据列表
     */
    @PostMapping("/monitorData/get")
    fun getMonitorDataInfo(@RequestBody queryOpt: QueryOpt) = resPack { dataProdBaseService.getMonitorDataInfo(queryOpt) }
}
src/main/kotlin/cn/flightfeather/supervision/lightshare/web/DataProdFinalController.kt
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,16 @@
package cn.flightfeather.supervision.lightshare.web
import io.swagger.annotations.Api
import org.springframework.web.bind.annotation.RequestMapping
import org.springframework.web.bind.annotation.RestController
/**
 * æœ€ç»ˆæ•°æ®äº§å“æŽ§åˆ¶å™¨
 * @date 2025/9/15
 * @author feiyu02
 */
@Api(tags = ["DataProdFinalController"], description = "最终数据产品相关API接口")
@RestController
@RequestMapping("/dataProd/final")
class DataProdFinalController {
}
src/main/kotlin/cn/flightfeather/supervision/lightshare/web/DataProdMiddleController.kt
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,48 @@
package cn.flightfeather.supervision.lightshare.web
import cn.flightfeather.supervision.lightshare.service.DataProdMiddleService
import cn.flightfeather.supervision.lightshare.vo.dataprod.QueryOpt
import io.swagger.annotations.Api
import org.springframework.web.bind.annotation.PostMapping
import org.springframework.web.bind.annotation.RequestBody
import org.springframework.web.bind.annotation.RequestMapping
import org.springframework.web.bind.annotation.RestController
/**
 * ä¸­é—´æ•°æ®äº§å“æŽ§åˆ¶å™¨
 * @date 2025/9/15
 * @author feiyu02
 */
@Api(tags = ["DataProdMiddleController"], description = "中间数据产品相关API接口")
@RestController
@RequestMapping("/dataProd/middle")
class DataProdMiddleController(private val dataProdMiddleService: DataProdMiddleService) {
    /**
     * å·¡æŸ¥å®Œæˆæƒ…况汇总
     */
    @PostMapping("/inspection/summary/get")
    fun getInspectionSummary(@RequestBody queryOpt: QueryOpt) =
        resPack { dataProdMiddleService.getInspectionSummary(queryOpt) }
    /**
     * é—®é¢˜åˆ†ç±»æ±‡æ€»
     */
    @PostMapping("/problemType/summary/get")
    fun getProblemTypeSummary(@RequestBody queryOpt: QueryOpt) =
        resPack { dataProdMiddleService.getProblemTypeSummary(queryOpt) }
    /**
     * åˆ†åŒºåŸŸå•场景问题数量
     */
    @PostMapping("/problemCount/area/get")
    fun getProblemCountByArea(@RequestBody queryOpt: QueryOpt) =
        resPack { dataProdMiddleService.getProblemCountByArea(queryOpt) }
    /**
     * åˆ†åŒºåŸŸè§„范性情况
     */
    @PostMapping("/evaluation/area/get")
    fun getEvaluationByArea(@RequestBody queryOpt: QueryOpt) =
        resPack { dataProdMiddleService.getEvaluationByArea(queryOpt) }
}