feiyu02
2025-12-20 5a003a42d2b34e8362910ac1d3e5a8866768e5fe
src/main/kotlin/cn/flightfeather/supervision/domain/ds1/repository/SceneRep.kt
@@ -91,6 +91,35 @@
        return isUpdate to r
    }
    fun findSubSceneList(scenes: List<Scense>): List<BaseScene?> {
        val result = mutableListOf<BaseScene>()
        scenes.groupBy { it.typeid }.forEach {
            when (it.key.toString()) {
                Constant.SceneType.TYPE1.value -> {
                    sceneConstructionSiteMapper.selectByExample(Example(SceneConstructionSite::class.java).apply {
                        createCriteria().andIn("sGuid", it.value.map { v-> v.guid })
                    }).let { s-> result.addAll(s) }
                }
                Constant.SceneType.TYPE2.value -> {
                    sceneWharfMapper.selectByExample(Example(SceneWharf::class.java).apply {
                        createCriteria().andIn("sGuid", it.value.map { v-> v.guid })
                    }).let { s-> result.addAll(s) }
                }
                Constant.SceneType.TYPE3.value -> {
                    sceneMixingPlantMapper.selectByExample(Example(SceneMixingPlant::class.java).apply {
                        createCriteria().andIn("sGuid", it.value.map { v-> v.guid })
                    }).let { s-> result.addAll(s) }
                }
                Constant.SceneType.TYPE14.value -> {
                    sceneStorageYardMapper.selectByExample(Example(SceneStorageYard::class.java).apply {
                        createCriteria().andIn("sGuid", it.value.map { v-> v.guid })
                    }).let { s-> result.addAll(s) }
                }
            }
        }
        return result
    }
    fun findScene(userId: String?): Scense? {
        val user = userinfoMapper.selectByPrimaryKey(userId) ?: throw BizException("用户id不存在")
        return scenseMapper.selectByPrimaryKey(user.dGuid)