feiyu02
2026-01-19 53ce8de426561e7a43847afda23b5e24e6f76c4e
2026.1.19
1. 新增可配置的台账提交期限
2. 新增可配置的自巡查承诺
已修改14个文件
116 ■■■■ 文件已修改
src/main/kotlin/cn/flightfeather/supervision/bgtask/TaskJinAnHourlyDustData.kt 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/common/net/JinAnLianTongHttpService.kt 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/domain/repository/UserConfigRep.kt 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/ConfigService.kt 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/ConfigServiceImpl.kt 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/SelfPatrolServiceImpl.kt 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/UserinfoServiceImpl.kt 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/SelfPatrolService.kt 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/lightshare/web/ConfigController.kt 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/lightshare/web/SelfPatrolController.kt 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/scheduler/ScheduleService.kt 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/application-pro.yml 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/application-proapp.yml 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/generator/generatorConfig.xml 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
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
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)
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
    }
}
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?
}
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)
    }
}
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")
    }
}
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 街镇的条件查询需要扩充BaseInfo数据表字段后再实现
        })
        //2025.11.28 通过BaseInfo表中的biTownCode字段来筛选出符合条件的用户
        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)
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?
}
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) }
}
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 = "自寻查任务id") @RequestParam taskId: String,
    ) = selfPatrolService.getDetailList(taskId)
    @ApiOperation("自巡查承诺")
    @PostMapping("/promise")
    fun promiseSelfPatrol(
        @RequestBody record: UserSettingRecord,
    ) = resPack { selfPatrolService.promiseSelfPatrol(record) }
}
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)
src/main/resources/application-pro.yml
@@ -10,4 +10,5 @@
#imgPath: C:/02product/05ledger/images/
#filePath: C:/02product/05ledger/files/
#针对微信小程序和安卓app两种前端,目前有部分区别,pro:表示小程序
mode: pro
src/main/resources/application-proapp.yml
@@ -8,6 +8,5 @@
imgPath: D:/02product/05ledger/images/
filePath: D:/02product/05ledger/files/
#针对微信小程序和安卓app两种前端,目前有部分区别,true:表示app,false:表示小程序
#systemIsApp: true
#针对微信小程序和安卓app两种前端,目前有部分区别,proapp:表示app
mode: proapp
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>