1. 环信码生成时,如果在线场景当期没有评估(未巡查)结果,则延用历史最新一次的结果;
2. 新增跨时间跨月度的历史整改记录查询逻辑
3. 优化获取顶层任务和日任务的获取逻辑
已修改10个文件
已添加5个文件
409 ■■■■ 文件已修改
src/main/kotlin/cn/flightfeather/supervision/business/autooutput/score/AopCreditCode.kt 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/business/crosstimechange/CrossTimeChangeManager.kt 190 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/business/crosstimechange/ProblemInfo.kt 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/business/crosstimechange/ScenePbGroup.kt 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/business/crosstimechange/package.info 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/domain/ds1/repository/EvaluationRep.kt 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/domain/ds1/repository/ProblemRep.kt 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/domain/ds1/repository/TaskRep.kt 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/domain/ds2/repository/OverallEvaluationRep.kt 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/TaskService.kt 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/ProblemlistServiceImpl.kt 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/TaskServiceImpl.kt 79 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/lightshare/web/TaskController.kt 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/test/kotlin/cn/flightfeather/supervision/business/autooutput/AopEvaluationTest.kt 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/test/kotlin/cn/flightfeather/supervision/business/crosstimechange/CrossTimeChangeManagerTest.kt 43 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/business/autooutput/score/AopCreditCode.kt
@@ -10,6 +10,8 @@
import cn.flightfeather.supervision.domain.ds2.repository.UserMapRep
import org.springframework.stereotype.Component
import java.time.LocalDate
import java.time.ZoneId
import java.util.*
/**
 * æ ¹æ®è‡ªåŠ¨è¯„ä¼°[AopEvaluation]结果生成环信码
@@ -33,9 +35,19 @@
            userMapRep.findFromSupervision(it)?.let { s ->
                // ä»Žé£žç¾½ç›‘管系统中查找评分
                val e = evaluationRep.findByScene(s.guid, date)
                e?.resultscorebef?.toInt()?.let {score ->
                if (e.isNotEmpty()) {
                    // æ ¹æ®è¯„分生成对应的环信码
                    var score = 0
                    e.forEach {eva ->
                        val s = eva?.resultscorebef?.toInt() ?: 0
                        if (s > score) score = s
                    }
                    overallEvaluationRep.insertOrUpdateOne(it?.guid, score, sceneType, date, endDate)
                } else {
                    // TODO: 2024/12/6 å½“没有找到自动评分记录时,采用历史最新的环信码记录作为本期记录
                    overallEvaluationRep.selectLatest(it?.guid)?.let {o ->
                        overallEvaluationRep.insertOrUpdateOne(o.biGuid, o.oeScore, sceneType, date, endDate)
                    }
                }
            }
        }
src/main/kotlin/cn/flightfeather/supervision/business/crosstimechange/CrossTimeChangeManager.kt
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,190 @@
package cn.flightfeather.supervision.business.crosstimechange
import cn.flightfeather.supervision.common.utils.DateUtil
import cn.flightfeather.supervision.common.utils.ExcelUtil
import cn.flightfeather.supervision.domain.ds1.entity.Problemlist
import cn.flightfeather.supervision.domain.ds1.repository.ProblemRep
import cn.flightfeather.supervision.domain.ds1.repository.SubTaskRep
import cn.flightfeather.supervision.lightshare.vo.AreaVo
import org.springframework.stereotype.Component
import java.io.File
import java.io.FileOutputStream
import java.time.format.DateTimeFormatter
/**
 * è·¨æ—¶é—´è·¨æœˆåº¦æ•´æ”¹
 * @date 2024/12/20
 * @author feiyu02
 */
@Component
class CrossTimeChangeManager(private val subTaskRep: SubTaskRep, private val problemRep: ProblemRep) {
    /**
     * æ‰§è¡Œè·¨æœˆåº¦è·¨æ—¶é—´æ•´æ”¹åˆ†æž
     * @param areaVo ç­›é€‰æ¡ä»¶ï¼ŒåŒ…括区域、场景类型、时间范围
     */
    fun execute(areaVo: AreaVo, fileName: String) {
        val pbGroupList = searchProblem(areaVo)
        pbGroupList.forEach { changeAnalysis(it) }
        formatToExcel(areaVo, pbGroupList, fileName)
    }
    /**
     * æŸ¥è¯¢èŒƒå›´å†…的场景及各月度问题
     */
    fun searchProblem(areaVo: AreaVo): List<ScenePbGroup> {
        // èŽ·å–èŒƒå›´å†…æ‰€æœ‰çš„å·¡æŸ¥è®°å½•åŠå…·ä½“é—®é¢˜
        val summary = subTaskRep.findSummary(areaVo)
        // æŒ‰ç…§åœºæ™¯è¿›è¡Œå½’ç±»
        val sceneMap = mutableMapOf<String?, ScenePbGroup>()
        summary.forEach {
            if (!sceneMap.containsKey(it.sceneId)) {
                sceneMap[it.sceneId] = ScenePbGroup().apply {
                    scene = it.scene
                }
            }
            sceneMap[it.sceneId]?.apply {
                pbGroup.add(ProblemInfo().apply {
                    subtask = it.subtask
                    val pList = problemRep.find(Problemlist().apply {
                        stguid = it.stGuid
                    })
                    pbList.addAll(pList)
                })
            }
        }
        // å°†å½’类好的各场景问题按照巡查时间升序排列并转换为数组结构
        val res = mutableListOf<ScenePbGroup>()
        sceneMap.forEach { (t, u) ->
            u.pbGroup.sortBy { it?.subtask?.planstarttime }
            res.add(u)
        }
        // å°†åœºæ™¯æŒ‰ç…§å”¯ä¸€ç¼–号升序排列(非必要)
        res.sortBy { it.scene?.index }
        return res
    }
    /**
     * åˆ†æžå•个场景各月问题是否可以整改
     */
    fun changeAnalysis(scenePbGroup: ScenePbGroup) {
        scenePbGroup.pbGroup.forEachIndexed {i,it ->
            it?.pbList?.forEach { p ->
                // å·²æ•´æ”¹çš„问题略过
                if (p?.ischanged == true) return@forEach
                // æ‰¾åˆ°ç»“果(指有一个月未出现此问题,或者出现了此问题但已整改),则允许将此历史问题作为已整改
                var found = false
                // å‘后续月度查找是否有相同的问题出现
                var index = i + 1
                while (!found && index < scenePbGroup.pbGroup.size) {
                    val nextGroup = scenePbGroup.pbGroup[index]
                    val result = nextGroup?.pbList?.find { nP ->
                        nP?.ptguid == p?.ptguid
                    }
                    // è¯¥æœˆæœªå‡ºçŽ°æ­¤é—®é¢˜ï¼Œæˆ–è€…å‡ºçŽ°äº†æ­¤é—®é¢˜ä½†å·²æ•´æ”¹
                    if (result == null || result.ischanged == true) {
                        found = true
                    }
                    index++
                }
                // è‹¥è¯¥é—®é¢˜ç¬¦åˆæ•´æ”¹æ¡ä»¶ï¼Œåˆ™æ·»åŠ è‡³å¯æ•´æ”¹åˆ—è¡¨
                if (found) {
                    it.pbChangeList.add(p)
                }
            }
        }
    }
    /**
     * æ ¼å¼åŒ–输出至excel文件
     */
    fun formatToExcel(areaVo: AreaVo, pbGroupList: List<ScenePbGroup>, fileName: String) {
        if (pbGroupList.isEmpty()) return
        val h = mutableListOf<MutableList<Any>>()
        val c = mutableListOf<MutableList<Any>>()
        // ç”Ÿæˆè¡¨å¤´
        val h1 = mutableListOf<Any>("唯一编号", "场景")
        val monHead = mutableListOf<String>()
        var time = areaVo.starttime?.toLocalDate()
        val end = areaVo.endtime?.toLocalDate()
        // æ­¤å¤„开始时间应为月初,结束时间应为月末,则可以直接用isBefore比较
        while (time?.isBefore(end) == true) {
            monHead.add(time.format(DateTimeFormatter.ofPattern("YYYY-MM")))
            time = time.plusMonths(1)
        }
        monHead.forEach {
            val str = it.split("-")[1] + "月"
            h1.addAll(listOf(str + "问题", str + "未整改", str + "未整改数"))
        }
        monHead.forEach {
            val str = it.split("-")[1] + "月"
            h1.addAll(listOf(str + "可整改", str + "原整改数", str + "新增可整改数"))
        }
        h.add(h1)
        // ç”Ÿæˆå†…容
        pbGroupList.forEach {pbg ->
            val index = pbg.scene?.index ?: ""
            val name = pbg.scene?.name ?: ""
            val problemContent = mutableListOf<Any>()
            monHead.forEach {mH ->
                val stp = pbg.pbGroup.find { pbi ->
                    DateUtil.DateToString(pbi?.subtask?.planstarttime, DateUtil.DateStyle.YYYY_MM) == mH
                }
                if (stp == null) {
                    problemContent.addAll(listOf("/", "/", "/"))
                } else {
                    // é—®é¢˜
                    problemContent.add(stp.pbList.mapIndexed { i, pb -> "${i+1}、${pb?.problemname}" }.joinToString
                        ("\n"))
                    val unchanged = stp.pbList.filter { pb-> pb?.ischanged != true }
                    // æœªæ•´æ”¹
                    problemContent.add(unchanged.mapIndexed { i, pb -> "${i+1}、${pb?.problemname}" }.joinToString("\n"))
                    // æœªæ•´æ”¹æ•°
                    problemContent.add(unchanged.size)
                }
            }
            val willChangeContent = mutableListOf<Any>()
            monHead.forEach {mH ->
                val stp = pbg.pbGroup.find { pbi ->
                    DateUtil.DateToString(pbi?.subtask?.planstarttime, DateUtil.DateStyle.YYYY_MM) == mH
                }
                if (stp == null) {
                    willChangeContent.addAll(listOf("/", "/", "/"))
                } else {
                    // å¯æ•´æ”¹
                    willChangeContent.add(stp.pbChangeList.mapIndexed { i, pb -> "${i+1}、${pb?.problemname}" }
                        .joinToString("\n"))
                    val changed = stp.pbList.filter { pb-> pb?.ischanged == true }
                    // åŽŸæ•´æ”¹æ•°
                    willChangeContent.add(changed.size)
                    // æ–°å¢žå¯æ•´æ”¹æ•°
                    willChangeContent.add(stp.pbChangeList.size)
                }
            }
            val row = mutableListOf<Any>()
            row.add(index)
            row.add(name)
            row.addAll(problemContent)
            row.addAll(willChangeContent)
            c.add(row)
        }
        // ç”Ÿæˆæ–‡ä»¶
        val file = File("target/${fileName}")
        val out = FileOutputStream(file)
        ExcelUtil.write2(out, h.map { it.toTypedArray() }, c.map { it.toTypedArray() }.toMutableList())
    }
}
src/main/kotlin/cn/flightfeather/supervision/business/crosstimechange/ProblemInfo.kt
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,21 @@
package cn.flightfeather.supervision.business.crosstimechange
import cn.flightfeather.supervision.domain.ds1.entity.Problemlist
import cn.flightfeather.supervision.domain.ds1.entity.Subtask
/**
 * é—®é¢˜æ•´æ”¹æƒ…况
 * @date 2024/12/20
 * @author feiyu02
 */
class ProblemInfo {
    // å·¡æŸ¥ä»»åŠ¡
    var subtask: Subtask? = null
    // åŽ†å²é—®é¢˜
    val pbList = mutableListOf<Problemlist?>()
    // å¯è¢«è·¨æ—¶é—´è·¨æœˆåº¦æ•´æ”¹çš„问题
    val pbChangeList = mutableListOf<Problemlist?>()
}
src/main/kotlin/cn/flightfeather/supervision/business/crosstimechange/ScenePbGroup.kt
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,17 @@
package cn.flightfeather.supervision.business.crosstimechange
import cn.flightfeather.supervision.domain.ds1.entity.Scense
/**
 * åœºæ™¯è·¨æœˆåº¦é—®é¢˜ç»„
 * @date 2024/12/20
 * @author feiyu02
 */
class ScenePbGroup {
    // åœºæ™¯
    var scene: Scense? = null
    // åŽ†æ¥å„æœˆä»½çš„é—®é¢˜æƒ…å†µ
    val pbGroup = mutableListOf<ProblemInfo?>()
}
src/main/kotlin/cn/flightfeather/supervision/business/crosstimechange/package.info
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,7 @@
跨时间跨月度整改
对于同一家场景,以N个月为周期,需要判断每个月未整改的问题在后续月份监管中是否未出现,若未出现,则认为该问题已整改
具体逻辑
1. ç­›é€‰è¿™N个月的问题;
2. å¾ªçŽ¯åˆ¤æ–­æ¯ä¸ªæœˆçš„æ¯ä¸ªæœªæ•´æ”¹é—®é¢˜ï¼Œåœ¨åŽç»­æœˆä»½ä¸­ï¼Œè‹¥è‡³å°‘æœ‰ä¸€ä¸ªæœˆæœªå‡ºçŽ°è¿‡è¯¥é—®é¢˜ï¼Œåˆ™è®¤ä¸ºè¯¥é—®é¢˜å·²æ•´æ”¹
src/main/kotlin/cn/flightfeather/supervision/domain/ds1/repository/EvaluationRep.kt
@@ -24,14 +24,14 @@
     * @param date æ—¥æœŸï¼Œåªä½¿ç”¨å¹´å’Œæœˆ
     * @return
     */
    fun findByScene(sceneId: String?, date: LocalDate): Evaluation? {
    fun findByScene(sceneId: String?, date: LocalDate): List<Evaluation?> {
        val sT = date.withDayOfMonth(1).atStartOfDay()
        val eT = sT.plusMonths(1).minusSeconds(1)
        val res = evaluationMapper.selectByExample(Example(Evaluation::class.java).apply {
            createCriteria().andEqualTo("sguid", sceneId)
                .andBetween("evaluatetime", sT, eT)
        })
        return if (res.isNotEmpty()) res[0] else null
        return res
    }
    fun findBySubtask(subTaskId: String?): Evaluation? {
src/main/kotlin/cn/flightfeather/supervision/domain/ds1/repository/ProblemRep.kt
@@ -18,6 +18,10 @@
        return problemlistMapper.updateByPrimaryKey(problemlist)
    }
    fun find(problemlist: Problemlist): List<Problemlist?> {
        return problemlistMapper.select(problemlist)
    }
    /**
     * èŽ·å–å„åœºæ™¯çš„é—®é¢˜å’Œæ•´æ”¹æ•°é‡ç»Ÿè®¡
     */
src/main/kotlin/cn/flightfeather/supervision/domain/ds1/repository/TaskRep.kt
@@ -79,10 +79,13 @@
    /**
     * èŽ·å–æ—¥ä»»åŠ¡
     * @param taskId é¡¶å±‚任务id
     * @param userId æ‰§è¡Œç”¨æˆ·id
     */
    fun findDayTasks(taskId: String?): List<Task?> {
    fun findDayTasks(taskId: String?, userId: String? = null): List<Task?> {
        return taskMapper.selectByExample(Example(Task::class.java).apply {
            createCriteria().andEqualTo("tsguid", taskId)
            createCriteria().andEqualTo("tsguid", taskId).apply {
                userId?.let { andLike("executorguids", "%$it%") }
            }
            orderBy("starttime").desc()
        })
    }
src/main/kotlin/cn/flightfeather/supervision/domain/ds2/repository/OverallEvaluationRep.kt
@@ -5,6 +5,7 @@
import cn.flightfeather.supervision.domain.ds2.entity.OverallEvaluation
import cn.flightfeather.supervision.domain.ds2.mapper.OverallEvaluationMapper
import org.springframework.stereotype.Repository
import tk.mybatis.mapper.entity.Example
import java.time.LocalDate
import java.time.ZoneId
import java.util.*
@@ -13,6 +14,17 @@
class OverallEvaluationRep(private val overallEvaluationMapper: OverallEvaluationMapper){
    /**
     * èŽ·å–æœ€æ–°è®°å½•
     */
    fun selectLatest(userId: String?): OverallEvaluation? {
        val res = overallEvaluationMapper.selectByExample(Example(OverallEvaluation::class.java).apply {
            createCriteria().andEqualTo("biGuid", userId)
            orderBy("oeUpdateTime").desc()
        })
        return if (res.isNotEmpty()) res[0] else null
    }
    /**
     * æ’入一条环信码记录
     * @param userId
     * @param score
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/TaskService.kt
@@ -30,7 +30,7 @@
    fun getDayTaskList(taskVoList: List<TaskVo>, date: String, guid: String, userType: String): List<TaskVo>
    fun getDayTask(taskId: String, userId: String, userType: String): List<DayTaskProgressVo>
    fun getDayTask(taskId: String, userId: String?, userType: String): List<DayTaskProgressVo>
    fun findByName(name: String): TaskVo
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/ProblemlistServiceImpl.kt
@@ -526,6 +526,7 @@
        return "success"
    }
    override fun changeProblem(problemId: String, files: Array<MultipartFile>): BaseResponse<String> {
        // é—®é¢˜å’Œé—®é¢˜å›¾ç‰‡åˆæ³•性检查
        val p = problemlistMapper.selectByPrimaryKey(problemId) ?: return BaseResponse(false, "问题不存在")
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/TaskServiceImpl.kt
@@ -318,55 +318,64 @@
        return taskVoList
    }
    override fun getDayTask(taskId: String, userId: String, userType: String): List<DayTaskProgressVo> {
        val example = Example(Task::class.java)
        val criteria = example.createCriteria()
        //构造查询条件
        criteria.andEqualTo("tsguid", taskId)
        if (userType == "1") {
            criteria.andLike("executorguids", "%$userId%")
        }
    override fun getDayTask(taskId: String, userId: String?, userType: String): List<DayTaskProgressVo> {
        val resultList = ArrayList<DayTaskProgressVo>()
        // èŽ·å–æ€»ä»»åŠ¡ä¸‹æ‰€æœ‰æ—¥ä»»åŠ¡
        val dayTasks = if (userType == "1") {
            taskRep.findDayTasks(taskId, userId)
        } else {
            taskRep.findDayTasks(taskId)
        }
        // èŽ·å–æ€»ä»»åŠ¡ä¸‹æ‰€æœ‰çš„å­ä»»åŠ¡
        val subTasks = subTaskRep.findAll(Subtask().apply { tguid = taskId })
        //根据sql条件查询
        taskMapper.selectByExample(example).forEach {
            val exampleTotal = Example(Subtask::class.java).apply {
                createCriteria().andEqualTo("tsguid", it.tguid)
        dayTasks.forEach {t->
            // ç­›é€‰å½“前日任务下的子任务
            val filterSubTasks = subTasks.filter {s->
                s?.tsguid == t?.tguid
            }
            // å­ä»»åŠ¡æ€»æ•°
            val total = filterSubTasks.size
            // å­ä»»åŠ¡å®Œæˆæ•°
            val complete = filterSubTasks.count {fs->
                fs?.status == Constant.TaskProgress.RUNINGSTATUS3.text
            }
            val total = subtaskMapper.selectCountByExample(exampleTotal)
            val exampleComplete = exampleTotal.apply {
                and().andEqualTo("status", Constant.TaskProgress.RUNINGSTATUS3.text)
            // èŽ·å–å½“æ—¥æ‰€æœ‰çš„é—®é¢˜
            val subTaskIds = filterSubTasks.map { fs-> fs?.stguid }
            val problemList = if (subTaskIds.isNotEmpty()) {
                problemListMapper.selectByExample(Example(Problemlist::class.java).apply {
                    createCriteria().andIn("stguid", subTaskIds)
                })
            } else{
                emptyList()
            }
            val complete = subtaskMapper.selectCountByExample(exampleComplete)
            var changed = 0
            problemListMapper.findUnchangedCount(it.tguid ?: "").forEach { i ->
                //结果表示该子任务未整改问题数
                if (i == 0) {
                    changed++
                }
            }
            //审核是否完成
            var check = false
            with(subtaskMapper.selectByExample(exampleTotal)) breaking@{
                forEach {
                    problemListMapper.selectByExample(Example(Problemlist::class.java).apply {
                        createCriteria().andEqualTo("stguid", it.stguid)
                    }).forEach { problem ->
                        if (problem.extension3 == Constant.PROBLEM_UNCHECKED) {
                            check = true
                            return@breaking
                        }
            var check = true
            filterSubTasks.forEach {fs ->
                // ç­›é€‰æ¯ä¸ªå­ä»»åŠ¡ä¸‹çš„é—®é¢˜æœªæ•´æ”¹æ•°
                problemList.filter { p-> p?.stguid == fs?.stguid }.onEach { pro ->
                    // å½“存在至少一个问题没有审核时,当日审核状态为未审核
                    if (pro.extension3 == Constant.PROBLEM_UNCHECKED || pro.extension3 == Constant.CHANGE_UNCHECKED) {
                        check = false
                    }
                }.count { i -> i?.ischanged != true }.let { c ->
                    // æ²¡æœ‰æœªæ•´æ”¹é—®é¢˜æ—¶ï¼Œåˆ™è¡¨ç¤ºè¯¥å­ä»»åŠ¡å·²ç»æ•´æ”¹å®Œæˆ
                    if (c == 0) {
                        changed++
                    }
                }
            }
            resultList.add(DayTaskProgressVo(
                it.tguid, it.starttime, taskId, complete, changed, total, check
                t?.tguid, t?.starttime, taskId, complete, changed, total, check
            ))
        }
src/main/kotlin/cn/flightfeather/supervision/lightshare/web/TaskController.kt
@@ -52,7 +52,7 @@
    @GetMapping("/dayTask/{taskId}")
    fun getDayTask(
            @PathVariable("taskId") taskId: String,
            @RequestParam("userId") userId: String,
            @RequestParam("userId", required = false) userId: String?,
            @RequestParam("userType") userType: String
    ) = taskService.getDayTask(taskId, userId, userType)
src/test/kotlin/cn/flightfeather/supervision/business/autooutput/AopEvaluationTest.kt
@@ -79,11 +79,11 @@
     */
    @Test
    fun test() {
        val taskId = "88wgq9l5gm9cUMg1"
        val districtCode = "310104"
//        val taskId = "88wgq9l5gm9cUMg1"
//        val districtCode = "310104"
        val districtName = "徐汇区"
        val year = 2024
        val month = 5
        val month = 11
        val sceneType = Constant.SceneType.TYPE5.value.toInt()
//        xhFuDataAnalysis.setResource(taskId, sceneType, year, month)
//        xhFuDataAnalysis.execute()
src/test/kotlin/cn/flightfeather/supervision/business/crosstimechange/CrossTimeChangeManagerTest.kt
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,43 @@
package cn.flightfeather.supervision.business.crosstimechange
import cn.flightfeather.supervision.common.utils.Constant
import cn.flightfeather.supervision.lightshare.vo.AreaVo
import org.junit.Test
import org.junit.jupiter.api.Assertions.*
import org.junit.jupiter.api.extension.ExtendWith
import org.junit.runner.RunWith
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.boot.test.context.SpringBootTest
import org.springframework.test.context.junit.jupiter.SpringExtension
import org.springframework.test.context.junit4.SpringRunner
import java.time.LocalDateTime
@RunWith(SpringRunner::class)
@ExtendWith(SpringExtension::class)
@SpringBootTest
class CrossTimeChangeManagerTest {
    @Autowired
    lateinit var crossTimeChangeManager: CrossTimeChangeManager
    @Test
    fun execute() {
//        crossTimeChangeManager.execute(AreaVo().apply {
//            provincecode = "31"
//            citycode = "3100"
//            districtcode = "310104"
//            starttime = LocalDateTime.of(2024, 3, 1, 0, 0, 0, 0)
//            endtime = LocalDateTime.of(2024, 6, 30, 23, 59, 59, 999)
//            scensetypeid = Constant.SceneType.TYPE5.value
//        }, "徐汇餐饮历史问题可整改统计-3至6月.xlsx")
        crossTimeChangeManager.execute(AreaVo().apply {
            provincecode = "31"
            citycode = "3100"
            districtcode = "310104"
            starttime = LocalDateTime.of(2024, 7, 1, 0, 0, 0, 0)
            endtime = LocalDateTime.of(2024, 10, 31, 23, 59, 59, 999)
            scensetypeid = Constant.SceneType.TYPE5.value
        }, "徐汇餐饮历史问题可整改统计-7至10月.xlsx")
    }
}