feiyu02
2026-01-21 fe031e01cc1737c2f05a133fde7c36c7a2a7b4b4
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/LedgerServiceImpl.kt
@@ -97,6 +97,7 @@
                sceneType = it.getlScenetype(),
                iconUrl = it.getlIconurl(),
                realTime = it.getlRealTime(),
                copy = it.getlAutoCopy() ?: false,
                description = it.getlDescription(),
                notRelated = it.getlNotRelatedSwitch() ?: true,
                multigroup = it.getlMultiGroup() ?: false
@@ -188,6 +189,9 @@
                ledgerType = type?.get(0)?.getlTypename()
                ledgerFinished = true
                isUpLoad = true
                this.year = it.lrYear
                this.month = it.lrMonth
                this.day = it.lrDay
                updateDate = it.lrSubmitdate
                updateType = it.lrUpdatetype
                fileType = it.lrEasubmitkind.toInt()
@@ -248,6 +252,9 @@
                ledgerType = type?.get(0)?.getlTypename()
                ledgerFinished = true
                isUpLoad = true
                this.year = it.lrYear
                this.month = it.lrMonth
                this.day = it.lrDay
                updateDate = it.lrSubmitdate
                updateType = it.lrUpdatetype
                fileType = it.lrEasubmitkind.toInt()
@@ -576,8 +583,8 @@
    }
    override fun copyLedger(userId: String, time: String, copyLedgerList: List<CopyLedgerVo>): BaseResponse<String> {
        val year = time.split("-")[0]
        val month = time.split("-")[1]
        val year = time.split("-")[0].toIntOrNull() ?: return BaseResponse(false, "年份格式错误")
        val month = time.split("-")[1].toIntOrNull() ?: return BaseResponse(false, "月份格式错误")
        val date = DateUtil.StringToDate(time, DateUtil.DateStyle.YYYY_MM)
        copyLedgerList.forEach {
            //去重判断
@@ -591,14 +598,17 @@
                return@forEach
            }
            val y = it.time?.split("-")?.get(0) ?: return@forEach
            val m = it.time?.split("-")?.get(1) ?: return@forEach
            val y = it.time?.split("-")?.get(0)
            val m = it.time?.split("-")?.get(1)
            ledgerRecordMapper.selectByExample(Example(LedgerRecord::class.java).apply {
                createCriteria().andEqualTo("lrSubmitid", userId)
                    .andEqualTo("lsSubtypeid", it.subTypeId)
                    .andEqualTo("lrYear", y)
                    .andEqualTo("lrMonth", m)
            }).forEach record@{ lr ->
                orderBy("lrYear").desc()
                    .orderBy("lrMonth").desc()
                    .orderBy("lrSubmitdate").desc()
            }).takeIf { list-> list.isNotEmpty() }?.get(0)?.let record@{ lr ->
                //获取记录对应的文件信息
                val fileList = ledgerMediaFileMapper.selectByExample(Example(LedgerMediaFile::class.java).apply {
                    createCriteria().andEqualTo("lrGuid", lr.lrGuid)