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/bgtask/TaskJinAnHourlyDustData.kt | 2
src/main/kotlin/cn/flightfeather/supervision/common/net/JinAnLianTongHttpService.kt | 7 ++-
src/main/kotlin/cn/flightfeather/supervision/domain/repository/UserConfigRep.kt | 18 +++++++++
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/ConfigService.kt | 6 +++
src/main/kotlin/cn/flightfeather/supervision/lightshare/web/SelfPatrolController.kt | 9 ++++
src/main/resources/application-pro.yml | 1
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/SelfPatrolServiceImpl.kt | 8 ++++
src/main/resources/application-proapp.yml | 3 -
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/SelfPatrolService.kt | 3 +
src/main/resources/generator/generatorConfig.xml | 16 ++++++--
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/UserinfoServiceImpl.kt | 9 +++-
src/main/kotlin/cn/flightfeather/supervision/scheduler/ScheduleService.kt | 7 +++
src/main/kotlin/cn/flightfeather/supervision/lightshare/web/ConfigController.kt | 12 ++++++
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/ConfigServiceImpl.kt | 15 +++++--
14 files changed, 99 insertions(+), 17 deletions(-)
diff --git a/src/main/kotlin/cn/flightfeather/supervision/bgtask/TaskJinAnHourlyDustData.kt b/src/main/kotlin/cn/flightfeather/supervision/bgtask/TaskJinAnHourlyDustData.kt
index 78bd2de..7b074a2 100644
--- a/src/main/kotlin/cn/flightfeather/supervision/bgtask/TaskJinAnHourlyDustData.kt
+++ b/src/main/kotlin/cn/flightfeather/supervision/bgtask/TaskJinAnHourlyDustData.kt
@@ -60,7 +60,7 @@
val lastHour = LocalDateTime.ofInstant(sDate.toInstant(), ZoneId.systemDefault()).minusHours(12)
sDate = Date.from(lastHour.atZone(ZoneId.systemDefault()).toInstant())
}
-// sDate = Date.from(LocalDateTime.of(2023, 8, 1, 0, 0, 0, 0).atZone(ZoneId.systemDefault()).toInstant())
+ sDate = Date.from(LocalDateTime.of(2025, 11, 4, 0, 0, 0, 0).atZone(ZoneId.systemDefault()).toInstant())
// eDate = Date.from(LocalDateTime.of(2023, 8, 23, 0, 0, 0, 0).atZone(ZoneId.systemDefault()).toInstant())
var page = 1
var hasNextPage: Boolean = false
diff --git a/src/main/kotlin/cn/flightfeather/supervision/common/net/JinAnLianTongHttpService.kt b/src/main/kotlin/cn/flightfeather/supervision/common/net/JinAnLianTongHttpService.kt
index 16e44ac..72a34b0 100644
--- a/src/main/kotlin/cn/flightfeather/supervision/common/net/JinAnLianTongHttpService.kt
+++ b/src/main/kotlin/cn/flightfeather/supervision/common/net/JinAnLianTongHttpService.kt
@@ -24,7 +24,8 @@
const val TAG = "JinAnLianTongHttpService"
private const val TOKEN = "e6dc8bb9e1ff0ce973fb92b4af2e4c3f"
- private val httpMethod: HttpMethod = HttpMethod("101.230.224.77", 8088, true)
+ // private val httpMethod: HttpMethod = HttpMethod("101.230.224.77", 8088, true)
+ private val httpMethod: HttpMethod = HttpMethod("fmepi.jingan.gov.cn", 8088, true)
open class RequestData(
val current: Int = 1,
@@ -78,7 +79,7 @@
/**
* 鏍规嵁杩斿洖缁撴灉鍒ゆ柇鏄惁鏈変笅涓�鍒嗛〉
*/
- private fun nextPage(data: JsonObject):Boolean {
+ private fun nextPage(data: JsonObject): Boolean {
val current = data["current"].asInt
val pages = data["pages"].asInt
return current < pages
@@ -143,7 +144,7 @@
/**
* 鏌ヨ宸ュ湴鎵皹鐩戞祴鐐瑰皬鏃舵暟鎹�
*/
- fun getHourlyDustData(page: Int = 1, sDate: Date?, eDate: Date?, perPage:Int = 5000): Pair<Boolean,
+ fun getHourlyDustData(page: Int = 1, sDate: Date?, eDate: Date?, perPage: Int = 5000): Pair<Boolean,
List<JinAnHourDustData>> {
val sStr = DateUtil.DateToString(sDate, DateUtil.DateStyle.YYYY_MM_DD_HH_MM_SS)
val eStr = DateUtil.DateToString(eDate, DateUtil.DateStyle.YYYY_MM_DD_HH_MM_SS)
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
diff --git a/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/ConfigService.kt b/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/ConfigService.kt
index 7325099..5b194f0 100644
--- a/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/ConfigService.kt
+++ b/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/ConfigService.kt
@@ -2,6 +2,8 @@
import cn.flightfeather.supervision.domain.entity.CommitmentTemplate
import cn.flightfeather.supervision.domain.entity.UserConfig
+import cn.flightfeather.supervision.domain.entity.UserSetting
+import cn.flightfeather.supervision.domain.entity.UserSettingRecord
import cn.flightfeather.supervision.lightshare.vo.UserSearchCondition
interface ConfigService {
@@ -21,4 +23,8 @@
fun getUserConfig(userId: String): UserConfig?
+ fun getUserSetting(userId: String): UserSetting?
+
+ fun getUserSettingRecord(userId: String): UserSettingRecord?
+
}
\ No newline at end of file
diff --git a/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/ConfigServiceImpl.kt b/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/ConfigServiceImpl.kt
index 484abfd..0b9bf75 100644
--- a/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/ConfigServiceImpl.kt
+++ b/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/ConfigServiceImpl.kt
@@ -1,9 +1,7 @@
package cn.flightfeather.supervision.lightshare.service.Impl
import cn.flightfeather.supervision.common.exception.BizException
-import cn.flightfeather.supervision.domain.entity.CommitmentTemplate
-import cn.flightfeather.supervision.domain.entity.SceneType
-import cn.flightfeather.supervision.domain.entity.UserConfig
+import cn.flightfeather.supervision.domain.entity.*
import cn.flightfeather.supervision.domain.mapper.*
import cn.flightfeather.supervision.domain.repository.UserConfigRep
import cn.flightfeather.supervision.lightshare.service.ConfigService
@@ -18,7 +16,8 @@
private val baseInfoMapper: BaseInfoMapper,
private val commitmentTemplateMapper: CommitmentTemplateMapper,
private val sceneTypeMapper: SceneTypeMapper,
- private val userConfigRep: UserConfigRep
+ private val userConfigRep: UserConfigRep,
+ private val userSettingRecordMapper: UserSettingRecordMapper,
) : ConfigService {
override fun getSceneRange(userId: String): List<Pair<String?, String?>>? {
@@ -67,4 +66,12 @@
override fun getUserConfig(userId: String): UserConfig? {
return userConfigRep.getUserConfigBySubType(userId)
}
+
+ override fun getUserSetting(userId: String): UserSetting? {
+ return userConfigRep.getUserSetting(userId)
+ }
+
+ override fun getUserSettingRecord(userId: String): UserSettingRecord? {
+ return userSettingRecordMapper.selectByPrimaryKey(userId)
+ }
}
\ No newline at end of file
diff --git a/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/SelfPatrolServiceImpl.kt b/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/SelfPatrolServiceImpl.kt
index 4e10000..e505fe4 100644
--- a/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/SelfPatrolServiceImpl.kt
+++ b/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/SelfPatrolServiceImpl.kt
@@ -458,4 +458,12 @@
}
}
}
+
+ /**
+ * 鑷鏌ユ壙璇�
+ * 鎵胯瀹屾垚鍚庯紝鍦ㄤ竴涓嚜鐒跺勾鍐呰褰曢兘鏈夋晥锛屼篃鍙互瑕嗙洊涓婁紶
+ */
+ override fun promiseSelfPatrol(record: UserSettingRecord): UserSettingRecord? {
+ TODO("Not yet implemented")
+ }
}
\ No newline at end of file
diff --git a/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/UserinfoServiceImpl.kt b/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/UserinfoServiceImpl.kt
index 5548748..4e3b176 100644
--- a/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/UserinfoServiceImpl.kt
+++ b/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/UserinfoServiceImpl.kt
@@ -303,7 +303,7 @@
val districtName = condition.districtName ?: user?.extension1
val p = PageHelper.startPage<Userinfo>(page, perPage)
- val result = userinfoMapper.selectByExample(Example(Userinfo::class.java).apply {
+ val userInfoList = userinfoMapper.selectByExample(Example(Userinfo::class.java).apply {
if (condition.searchText?.isNotBlank() == true) {
and(createCriteria()
.orLike("acountname", "%${condition.searchText}%")
@@ -321,8 +321,13 @@
.andEqualTo("isenable", true).apply {
condition.userTypeId?.let { andEqualTo("usertypeid", it) }
})
- //todo 2020.8.19 琛楅晣鐨勬潯浠舵煡璇㈤渶瑕佹墿鍏匓aseInfo鏁版嵁琛ㄥ瓧娈靛悗鍐嶅疄鐜�
})
+ //2025.11.28 閫氳繃BaseInfo琛ㄤ腑鐨刡iTownCode瀛楁鏉ョ瓫閫夊嚭绗﹀悎鏉′欢鐨勭敤鎴�
+ val baseInfoList = baseInfoMapper.selectByExample(Example(BaseInfo::class.java).apply {
+ createCriteria().andIn("biGuid", userInfoList.map { it?.guid })
+ }).filter { it.biTownCode == condition.townCode }
+
+ val result = userInfoList.filter { u-> baseInfoList.any { b-> b.biGuid == u?.guid } }
response.setIntHeader("totalPage", p.pages)
response.setIntHeader("currentPage", p.pageNum)
diff --git a/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/SelfPatrolService.kt b/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/SelfPatrolService.kt
index fab8e14..b9b7d71 100644
--- a/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/SelfPatrolService.kt
+++ b/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/SelfPatrolService.kt
@@ -1,6 +1,7 @@
package cn.flightfeather.supervision.lightshare.service
import cn.flightfeather.supervision.domain.entity.SelfPatrolTask
+import cn.flightfeather.supervision.domain.entity.UserSettingRecord
import cn.flightfeather.supervision.lightshare.vo.BaseResponse
import cn.flightfeather.supervision.lightshare.vo.LedgerSubTypeVo
import cn.flightfeather.supervision.lightshare.vo.LedgerVo
@@ -56,4 +57,6 @@
* @param justFinishedNum 鍐呭瓨涓垰瀹屾垚鐨勪换鍔℃暟锛堣�冭檻鍒氭墽琛屼换鍔¤褰曠殑鎻掑叆璇彞杩樻湭鐪熸鍏ュ簱鐨勬儏鍐碉級
*/
fun checkSelfPatrolFinished(taskId: String?, justFinishedNum: Int)
+
+ fun promiseSelfPatrol(record: UserSettingRecord): UserSettingRecord?
}
\ No newline at end of file
diff --git a/src/main/kotlin/cn/flightfeather/supervision/lightshare/web/ConfigController.kt b/src/main/kotlin/cn/flightfeather/supervision/lightshare/web/ConfigController.kt
index 1f221f4..27329a8 100644
--- a/src/main/kotlin/cn/flightfeather/supervision/lightshare/web/ConfigController.kt
+++ b/src/main/kotlin/cn/flightfeather/supervision/lightshare/web/ConfigController.kt
@@ -30,4 +30,16 @@
fun getUserConfig(
@ApiParam("鐢ㄦ埛id") @RequestParam("userId") userId: String,
) = resPack { configService.getUserConfig(userId) }
+
+ @ApiOperation(value = "鑾峰彇鐢ㄦ埛鐩稿叧涓氬姟灞炴�ч厤缃俊鎭�")
+ @GetMapping("/user/setting")
+ fun getUserSetting(
+ @ApiParam("鐢ㄦ埛id") @RequestParam("userId") userId: String,
+ ) = resPack { configService.getUserSetting(userId) }
+
+ @ApiOperation(value = "鑾峰彇鐢ㄦ埛鐩稿叧涓氬姟灞炴�ч厤缃褰曚俊鎭�")
+ @GetMapping("/user/setting/record")
+ fun getUserSettingRecord(
+ @ApiParam("鐢ㄦ埛id") @RequestParam("userId") userId: String,
+ ) = resPack { configService.getUserSettingRecord(userId) }
}
\ No newline at end of file
diff --git a/src/main/kotlin/cn/flightfeather/supervision/lightshare/web/SelfPatrolController.kt b/src/main/kotlin/cn/flightfeather/supervision/lightshare/web/SelfPatrolController.kt
index 55fda86..dfb0bf2 100644
--- a/src/main/kotlin/cn/flightfeather/supervision/lightshare/web/SelfPatrolController.kt
+++ b/src/main/kotlin/cn/flightfeather/supervision/lightshare/web/SelfPatrolController.kt
@@ -3,6 +3,7 @@
import cn.flightfeather.supervision.domain.entity.Company
import cn.flightfeather.supervision.domain.entity.PersonalInfo
import cn.flightfeather.supervision.domain.entity.SelfPatrolTask
+import cn.flightfeather.supervision.domain.entity.UserSettingRecord
import cn.flightfeather.supervision.lightshare.service.AuthService
import cn.flightfeather.supervision.lightshare.service.SelfPatrolService
import cn.flightfeather.supervision.lightshare.vo.AuthSceneVo
@@ -83,4 +84,12 @@
fun getDetailList(
@ApiParam(value = "鑷鏌ヤ换鍔d") @RequestParam taskId: String,
) = selfPatrolService.getDetailList(taskId)
+
+ @ApiOperation("鑷贰鏌ユ壙璇�")
+ @PostMapping("/promise")
+ fun promiseSelfPatrol(
+ @RequestBody record: UserSettingRecord,
+ ) = resPack { selfPatrolService.promiseSelfPatrol(record) }
+
+
}
\ No newline at end of file
diff --git a/src/main/kotlin/cn/flightfeather/supervision/scheduler/ScheduleService.kt b/src/main/kotlin/cn/flightfeather/supervision/scheduler/ScheduleService.kt
index 5fe3032..b28304a 100644
--- a/src/main/kotlin/cn/flightfeather/supervision/scheduler/ScheduleService.kt
+++ b/src/main/kotlin/cn/flightfeather/supervision/scheduler/ScheduleService.kt
@@ -33,14 +33,17 @@
@Async
@Scheduled(cron = "0 0 * * * *")
fun eachHour() {
+ if (mode != "pro") return
+
logger.info("=====>>>>>姣忓皬鏃朵换鍔℃墽琛� {}", System.currentTimeMillis())
taskJinAnHourlyDustData.doTask(LocalDateTime.now())
logger.info("=====>>>>>姣忓皬鏃朵换鍔$粨鏉� {}", System.currentTimeMillis())
}
-// @Async
+ // @Async
// @Scheduled(cron = "0 0 0 * * *")
fun eachDay() {
+ if (mode != "pro") return
logger.info("=====>>>>>姣忔棩浠诲姟鎵ц {}", System.currentTimeMillis())
logger.info("=====>>>>>姣忔棩浠诲姟缁撴潫 {}", System.currentTimeMillis())
@@ -49,6 +52,7 @@
@Async
@Scheduled(cron = "0 0 0 * * SUN")
fun eachSunday() {
+ if (mode != "pro") return
logger.info("=====>>>>>姣忓懆鏃ラ浂鐐逛换鍔℃墽琛� {}", System.currentTimeMillis())
mTaskJinAnHourlyDustData.handle()
logger.info("=====>>>>>姣忓懆鏃ラ浂鐐逛换鍔$粨鏉� {}", System.currentTimeMillis())
@@ -57,6 +61,7 @@
@Async
@Scheduled(cron = "0 0 3 1 * *")
fun eachMonth() {
+ if (mode != "pro") return
logger.info("=====>>>>>姣忔湀鍒濅换鍔℃墽琛� {}", System.currentTimeMillis())
// 鎵ц涓婁釜鏈堢殑闈欏畨宸ュ湴鎵皹鏁版嵁琛ュ叏浠诲姟
val now = LocalDate.now().minusMonths(1)
diff --git a/src/main/resources/application-pro.yml b/src/main/resources/application-pro.yml
index d145b46..fdfe25d 100644
--- a/src/main/resources/application-pro.yml
+++ b/src/main/resources/application-pro.yml
@@ -10,4 +10,5 @@
#imgPath: C:/02product/05ledger/images/
#filePath: C:/02product/05ledger/files/
+#閽堝寰俊灏忕▼搴忓拰瀹夊崜app涓ょ鍓嶇锛岀洰鍓嶆湁閮ㄥ垎鍖哄埆锛宲ro锛氳〃绀哄皬绋嬪簭
mode: pro
\ No newline at end of file
diff --git a/src/main/resources/application-proapp.yml b/src/main/resources/application-proapp.yml
index 3e8807b..964e5df 100644
--- a/src/main/resources/application-proapp.yml
+++ b/src/main/resources/application-proapp.yml
@@ -8,6 +8,5 @@
imgPath: D:/02product/05ledger/images/
filePath: D:/02product/05ledger/files/
-#閽堝寰俊灏忕▼搴忓拰瀹夊崜app涓ょ鍓嶇锛岀洰鍓嶆湁閮ㄥ垎鍖哄埆锛宼rue锛氳〃绀篴pp锛宖alse锛氳〃绀哄皬绋嬪簭
-#systemIsApp: true
+#閽堝寰俊灏忕▼搴忓拰瀹夊崜app涓ょ鍓嶇锛岀洰鍓嶆湁閮ㄥ垎鍖哄埆锛宲roapp锛氳〃绀篴pp
mode: proapp
\ No newline at end of file
diff --git a/src/main/resources/generator/generatorConfig.xml b/src/main/resources/generator/generatorConfig.xml
index 908862b..2fe17ea 100644
--- a/src/main/resources/generator/generatorConfig.xml
+++ b/src/main/resources/generator/generatorConfig.xml
@@ -151,10 +151,10 @@
<!-- enableCountByExample="false"-->
<!-- enableUpdateByExample="false" enableDeleteByExample="false"-->
<!-- enableSelectByExample="false" selectByExampleQueryId="false" />-->
- <table tableName="ea_t_scene_type" domainObjectName="SceneType"
- enableCountByExample="false"
- enableUpdateByExample="false" enableDeleteByExample="false"
- enableSelectByExample="false" selectByExampleQueryId="false" />
+<!-- <table tableName="ea_t_scene_type" domainObjectName="SceneType"-->
+<!-- enableCountByExample="false"-->
+<!-- enableUpdateByExample="false" enableDeleteByExample="false"-->
+<!-- enableSelectByExample="false" selectByExampleQueryId="false" />-->
<!-- <table tableName="ja_t_dust_site_map" domainObjectName="DustSiteMap"-->
<!-- enableCountByExample="false"-->
<!-- enableUpdateByExample="false" enableDeleteByExample="false"-->
@@ -183,5 +183,13 @@
<!-- enableCountByExample="false"-->
<!-- enableUpdateByExample="false" enableDeleteByExample="false"-->
<!-- enableSelectByExample="false" selectByExampleQueryId="false" />-->
+<!-- <table tableName="sm_t_setting" domainObjectName="UserSetting"-->
+<!-- enableCountByExample="false"-->
+<!-- enableUpdateByExample="false" enableDeleteByExample="false"-->
+<!-- enableSelectByExample="false" selectByExampleQueryId="false" />-->
+ <table tableName="sm_t_setting_record" domainObjectName="UserSettingRecord"
+ enableCountByExample="false"
+ enableUpdateByExample="false" enableDeleteByExample="false"
+ enableSelectByExample="false" selectByExampleQueryId="false" />
</context>
</generatorConfiguration>
\ No newline at end of file
--
Gitblit v1.9.3