From 84569abda51ecf6c5549dec4cadee8d043422379 Mon Sep 17 00:00:00 2001 From: feiyu02 <risaku@163.com> Date: 星期二, 30 九月 2025 09:33:28 +0800 Subject: [PATCH] 2025.9.30 --- src/main/kotlin/com/flightfeather/grid/service/impl/ClueConclusionServiceImpl.kt | 59 +++++++++++++++++++++++++++++++++++++++++------------------ 1 files changed, 41 insertions(+), 18 deletions(-) diff --git a/src/main/kotlin/com/flightfeather/grid/service/impl/ClueConclusionServiceImpl.kt b/src/main/kotlin/com/flightfeather/grid/service/impl/ClueConclusionServiceImpl.kt index 660f4e9..e301854 100644 --- a/src/main/kotlin/com/flightfeather/grid/service/impl/ClueConclusionServiceImpl.kt +++ b/src/main/kotlin/com/flightfeather/grid/service/impl/ClueConclusionServiceImpl.kt @@ -23,39 +23,62 @@ clueConclusion.cId ?: throw BizException("绾跨储id缂哄け") clueConclusion.ccUploaded = false clueConclusion.ccCreateTime = Date() + if (clueConclusion.ccInternal == null) clueConclusion.ccInternal = false + val conclusion: ClueConclusion? try { - val conclusion = clueConclusionMapper.selectOne(ClueConclusion().apply { cId = clueConclusion.cId }) - // 鏇存柊 - return if (conclusion != null) { - if (conclusion.ccUploaded) throw BizException("绾跨储缁撹宸叉帹閫侊紝鏃犳硶淇敼") - clueConclusion.ccId = conclusion.ccId - val res = clueConclusionMapper.updateByPrimaryKeySelective(clueConclusion) - res == 1 - } - // 鎻掑叆 - else { - val res = clueConclusionMapper.insert(clueConclusion) - res == 1 - } + conclusion = clueConclusionMapper.selectOne(ClueConclusion().apply { + cId = clueConclusion.cId + ccInternal = clueConclusion.ccInternal + }) } catch (e: Exception) { throw BizException("姣忔潯绾跨储鏈�澶氳兘鏈変竴鏉$粨璁猴紝璇ョ嚎绱㈢粨璁哄瓨鍦ㄥ鏉★紝璇锋鏌ョ郴缁熼�昏緫") } + // 鏇存柊 + return if (conclusion != null) { + if (conclusion.ccUploaded) throw BizException("绾跨储缁撹宸叉帹閫侊紝鏃犳硶淇敼") + clueConclusion.ccId = conclusion.ccId + val res = clueConclusionMapper.updateByPrimaryKeySelective(clueConclusion) + res == 1 + } + // 鎻掑叆 + else { + val res = clueConclusionMapper.insert(clueConclusion) + res == 1 + } + } - override fun getClueConclusion(clueId: String): ClueConclusion? { + override fun getClueConclusion(clueId: String, internal: Boolean?): ClueConclusion? { val res = clueConclusionMapper.selectByExample(Example(ClueConclusion::class.java).apply { createCriteria().andEqualTo("cId", clueId) + .apply { + if (internal == true) { + andEqualTo("ccInternal", true) + } else { + and( + createCriteria().orIsNull("ccInternal") + .orEqualTo("ccInternal", false) + ) + } + } }) return if (res.isNotEmpty()) res[0] else null } override fun pushConclusion(conclusionIdList: List<String>?): Boolean { clueConclusionMapper.selectByExample(Example(ClueConclusion::class.java).apply { - createCriteria().andEqualTo("ccUploaded", false).apply { - conclusionIdList?.let { - andIn("ccId", it) + createCriteria() + .andEqualTo("ccUploaded", false) + .apply { + conclusionIdList?.let { + andIn("ccId", it) + } + // 鎺掗櫎鎺夊唴閮ㄧ嚎绱㈢粨璁� + and( + createCriteria().orIsNull("ccInternal") + .orEqualTo("ccInternal", false) + ) } - } }).forEach { it?.let { clueHttpService.uploadConclusion(it) -- Gitblit v1.9.3