From 53ce8de426561e7a43847afda23b5e24e6f76c4e Mon Sep 17 00:00:00 2001
From: feiyu02 <risaku@163.com>
Date: 星期一, 19 一月 2026 17:29:55 +0800
Subject: [PATCH] 2026.1.19 1. 新增可配置的台账提交期限 2. 新增可配置的自巡查承诺

---
 src/main/kotlin/cn/flightfeather/supervision/domain/repository/UserConfigRep.kt |   18 ++++++++++++++++++
 1 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/src/main/kotlin/cn/flightfeather/supervision/domain/repository/UserConfigRep.kt b/src/main/kotlin/cn/flightfeather/supervision/domain/repository/UserConfigRep.kt
index ac1f61b..1622240 100644
--- a/src/main/kotlin/cn/flightfeather/supervision/domain/repository/UserConfigRep.kt
+++ b/src/main/kotlin/cn/flightfeather/supervision/domain/repository/UserConfigRep.kt
@@ -1,10 +1,13 @@
 package cn.flightfeather.supervision.domain.repository
 
+import cn.flightfeather.supervision.common.exception.BizException
 import cn.flightfeather.supervision.domain.entity.BaseInfo
 import cn.flightfeather.supervision.domain.entity.UserConfig
+import cn.flightfeather.supervision.domain.entity.UserSetting
 import cn.flightfeather.supervision.domain.entity.Userinfo
 import cn.flightfeather.supervision.domain.mapper.BaseInfoMapper
 import cn.flightfeather.supervision.domain.mapper.UserConfigMapper
+import cn.flightfeather.supervision.domain.mapper.UserSettingMapper
 import cn.flightfeather.supervision.domain.mapper.UserinfoMapper
 import org.springframework.stereotype.Repository
 import tk.mybatis.mapper.entity.Example
@@ -14,6 +17,7 @@
     private val userConfigMapper: UserConfigMapper,
     private val userinfoMapper: UserinfoMapper,
     private val baseInfoMapper: BaseInfoMapper,
+    private val userSettingMapper: UserSettingMapper,
 ) {
 
     fun select(configId: Int): UserConfig? {
@@ -79,4 +83,18 @@
         return userConfigMapper.selectByPrimaryKey(configId)
     }
 
+    fun getUserSetting(userId: String): UserSetting? {
+        val userInfo = userinfoMapper.selectByPrimaryKey(userId) ?: throw BizException("璇ョ敤鎴蜂笉瀛樺湪")
+        val baseInfo = baseInfoMapper.selectByPrimaryKey(userId)
+        val userSetting = UserSetting().apply {
+            userTypeId = userInfo.usertypeid?.toInt()
+            provinceName = baseInfo?.biProvinceName
+            cityName = baseInfo?.biCityName
+            districtName = baseInfo?.biDistrictName ?: userInfo.extension1
+            sceneTypeId = userInfo.extension2?.toInt()
+        }
+        val res = userSettingMapper.select(userSetting)
+
+        return if (res.isNotEmpty()) res[0] else null
+    }
 }
\ No newline at end of file

--
Gitblit v1.9.3