道路线索应急巡查系统服务后台
feiyu02
2025-04-25 79bd8ea222cc3518ec91dce3dfb30fcf387cf96d
新增应急巡查线索任务相关接口
已修改20个文件
已删除10个文件
已添加5个文件
6032 ■■■■■ 文件已修改
.smarttomcat/grid/conf/catalina.policy 257 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.smarttomcat/grid/conf/catalina.properties 148 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.smarttomcat/grid/conf/context.xml 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.smarttomcat/grid/conf/jaspic-providers.xml 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.smarttomcat/grid/conf/jaspic-providers.xsd 53 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.smarttomcat/grid/conf/logging.properties 70 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.smarttomcat/grid/conf/server.xml 169 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.smarttomcat/grid/conf/tomcat-users.xml 44 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.smarttomcat/grid/conf/tomcat-users.xsd 59 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.smarttomcat/grid/conf/web.xml 4725 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/com/flightfeather/grid/domain/ds1/entity/ClueConclusion.java 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/com/flightfeather/grid/domain/ds1/entity/ClueQuestion.java 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/com/flightfeather/grid/domain/ds1/entity/ClueTask.java 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/com/flightfeather/grid/service/ClueConclusionService.kt 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/com/flightfeather/grid/service/ClueInternalService.kt 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/com/flightfeather/grid/service/ClueQuestionService.kt 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/com/flightfeather/grid/service/ClueService.kt 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/com/flightfeather/grid/service/ClueTaskService.kt 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/com/flightfeather/grid/service/impl/ClueConclusionServiceImpl.kt 28 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/com/flightfeather/grid/service/impl/ClueInternalServiceImpl.kt 60 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/com/flightfeather/grid/service/impl/ClueQuestionServiceImpl.kt 64 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/com/flightfeather/grid/service/impl/ClueServiceImpl.kt 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/com/flightfeather/grid/service/impl/ClueTaskServiceImpl.kt 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/com/flightfeather/grid/vo/ClueInternalTaskVo.kt 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/com/flightfeather/grid/vo/ClueInternalVo.kt 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/com/flightfeather/grid/web/ClueConclusionController.kt 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/com/flightfeather/grid/web/ClueController.kt 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/com/flightfeather/grid/web/ClueInternalController.kt 47 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/com/flightfeather/grid/web/ClueQuestionController.kt 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/com/flightfeather/grid/web/ClueTaskController.kt 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/generator/generatorConfig.xml 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/ds1/ClueConclusionMapper.xml 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/ds1/ClueMapper.xml 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/ds1/ClueQuestionMapper.xml 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/ds1/ClueTaskMapper.xml 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.smarttomcat/grid/conf/catalina.policy
ÎļþÒÑɾ³ý
.smarttomcat/grid/conf/catalina.properties
ÎļþÒÑɾ³ý
.smarttomcat/grid/conf/context.xml
ÎļþÒÑɾ³ý
.smarttomcat/grid/conf/jaspic-providers.xml
ÎļþÒÑɾ³ý
.smarttomcat/grid/conf/jaspic-providers.xsd
ÎļþÒÑɾ³ý
.smarttomcat/grid/conf/logging.properties
ÎļþÒÑɾ³ý
.smarttomcat/grid/conf/server.xml
ÎļþÒÑɾ³ý
.smarttomcat/grid/conf/tomcat-users.xml
ÎļþÒÑɾ³ý
.smarttomcat/grid/conf/tomcat-users.xsd
ÎļþÒÑɾ³ý
.smarttomcat/grid/conf/web.xml
ÎļþÒÑɾ³ý
src/main/kotlin/com/flightfeather/grid/domain/ds1/entity/ClueConclusion.java
@@ -7,6 +7,7 @@
public class ClueConclusion {
    @Id
    @Column(name = "CC_Id")
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Integer ccId;
    @Column(name = "C_Id")
@@ -32,6 +33,12 @@
    @Column(name = "CC_Upload_Time")
    private Date ccUploadTime;
    /**
     * æ˜¯å¦æ˜¯å†…部线索的结论
     */
    @Column(name = "CC_Internal")
    private Boolean ccInternal;
    @Column(name = "CC_Details")
    private String ccDetails;
@@ -143,6 +150,24 @@
    }
    /**
     * èŽ·å–æ˜¯å¦æ˜¯å†…éƒ¨çº¿ç´¢çš„ç»“è®º
     *
     * @return CC_Internal - æ˜¯å¦æ˜¯å†…部线索的结论
     */
    public Boolean getCcInternal() {
        return ccInternal;
    }
    /**
     * è®¾ç½®æ˜¯å¦æ˜¯å†…部线索的结论
     *
     * @param ccInternal æ˜¯å¦æ˜¯å†…部线索的结论
     */
    public void setCcInternal(Boolean ccInternal) {
        this.ccInternal = ccInternal;
    }
    /**
     * @return CC_Details
     */
    public String getCcDetails() {
src/main/kotlin/com/flightfeather/grid/domain/ds1/entity/ClueQuestion.java
@@ -7,6 +7,7 @@
public class ClueQuestion {
    @Id
    @Column(name = "CQ_Id")
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Integer cqId;
    @Column(name = "CQ_Uid")
@@ -47,6 +48,12 @@
    @Column(name = "CQ_Upload_Time")
    private Date cqUploadTime;
    /**
     * æ˜¯å¦æ˜¯å†…部线索的问题
     */
    @Column(name = "CQ_Internal")
    private Boolean cqInternal;
    @Column(name = "CQ_File_Path")
    private String cqFilePath;
@@ -228,6 +235,24 @@
    }
    /**
     * èŽ·å–æ˜¯å¦æ˜¯å†…éƒ¨çº¿ç´¢çš„é—®é¢˜
     *
     * @return CQ_Internal - æ˜¯å¦æ˜¯å†…部线索的问题
     */
    public Boolean getCqInternal() {
        return cqInternal;
    }
    /**
     * è®¾ç½®æ˜¯å¦æ˜¯å†…部线索的问题
     *
     * @param cqInternal æ˜¯å¦æ˜¯å†…部线索的问题
     */
    public void setCqInternal(Boolean cqInternal) {
        this.cqInternal = cqInternal;
    }
    /**
     * @return CQ_File_Path
     */
    public String getCqFilePath() {
src/main/kotlin/com/flightfeather/grid/domain/ds1/entity/ClueTask.java
@@ -69,6 +69,12 @@
    private String executorIds;
    /**
     * æ˜¯å¦æ˜¯å†…部任务
     */
    @Column(name = "internal_task")
    private Boolean internalTask;
    /**
     * @return guid
     */
    public String getGuid() {
@@ -83,7 +89,7 @@
    }
    /**
     * @return clueId
     * @return clue_id
     */
    public Integer getClueId() {
        return clueId;
@@ -321,4 +327,22 @@
    public void setExecutorIds(String executorIds) {
        this.executorIds = executorIds == null ? null : executorIds.trim();
    }
    /**
     * èŽ·å–æ˜¯å¦æ˜¯å†…éƒ¨ä»»åŠ¡
     *
     * @return internal_task - æ˜¯å¦æ˜¯å†…部任务
     */
    public Boolean getInternalTask() {
        return internalTask;
    }
    /**
     * è®¾ç½®æ˜¯å¦æ˜¯å†…部任务
     *
     * @param internalTask æ˜¯å¦æ˜¯å†…部任务
     */
    public void setInternalTask(Boolean internalTask) {
        this.internalTask = internalTask;
    }
}
src/main/kotlin/com/flightfeather/grid/service/ClueConclusionService.kt
@@ -15,7 +15,7 @@
     * èŽ·å–çº¿ç´¢ç»“è®º
     * @param clueId
     */
    fun getClueConclusion(clueId: String): ClueConclusion?
    fun getClueConclusion(clueId: String, internal: Boolean?): ClueConclusion?
    /**
     * æŽ¨é€çº¿ç´¢ç»“论至第三方
src/main/kotlin/com/flightfeather/grid/service/ClueInternalService.kt
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,27 @@
package com.flightfeather.grid.service
import com.flightfeather.grid.constant.ConstantHttp
import com.flightfeather.grid.domain.ds1.entity.Clue
import com.flightfeather.grid.domain.ds1.entity.ClueInternal
import com.flightfeather.grid.utils.net.HttpMethod
import com.flightfeather.grid.vo.BaseResponse
import com.flightfeather.grid.vo.DataHead
interface ClueInternalService {
    fun getClueInternal(
        sTime: String?,
        eTime: String?,
        pageNum: Int? = ConstantHttp.DEFAULT_PAGE_NUM,
        pageSize: Int? = ConstantHttp.DEFAULT_PAGE_SIZE,
    ): Pair<DataHead, List<ClueInternal?>>
    fun searchClueInternal(clueInternal: ClueInternal): List<ClueInternal?>
    fun createClueInternal(clueInternal: ClueInternal): Int
    fun updateClueInternal(clueInternal: ClueInternal): Int
    fun deleteClueInternal(clueInternal: ClueInternal): Int
}
src/main/kotlin/com/flightfeather/grid/service/ClueQuestionService.kt
@@ -50,7 +50,7 @@
     * èŽ·å–çº¿ç´¢é—®é¢˜
     * @param clueId
     */
    fun getClueQuestion(clueId: String): List<ClueQuestion?>
    fun getClueQuestion(clueId: String, internal: Boolean?): List<ClueQuestion?>
    /**
     * æŽ¨é€çº¿ç´¢é—®é¢˜åŠå›¾ç‰‡è‡³ç¬¬ä¸‰æ–¹
src/main/kotlin/com/flightfeather/grid/service/ClueService.kt
@@ -2,6 +2,7 @@
import com.flightfeather.grid.constant.ConstantHttp
import com.flightfeather.grid.domain.ds1.entity.Clue
import com.flightfeather.grid.domain.ds1.entity.ClueInternal
import com.flightfeather.grid.utils.net.HttpMethod
import com.flightfeather.grid.vo.BaseResponse
import com.flightfeather.grid.vo.DataHead
@@ -22,6 +23,8 @@
        pageSize: Int? = ConstantHttp.DEFAULT_PAGE_SIZE,
    ): Pair<DataHead, List<Clue?>>
    fun searchClue(clue: Clue): List<Clue?>
    /**
     * ä»Žè¿œç¨‹æ•°æ®æºæ‹‰å–下发线索
     * @param updateTime ä¸‹å‘时间(每次查询大于此时间的数据)
src/main/kotlin/com/flightfeather/grid/service/ClueTaskService.kt
@@ -1,6 +1,7 @@
package com.flightfeather.grid.service
import com.flightfeather.grid.domain.ds1.entity.ClueTask
import com.flightfeather.grid.vo.ClueInternalTaskVo
/**
 * çº¿ç´¢ä»»åŠ¡ç›¸å…³æœåŠ¡
@@ -9,10 +10,14 @@
 */
interface ClueTaskService {
    fun createInternalClueTask(clueInternalTaskVo: ClueInternalTaskVo): Int
    fun createClueTask(clueTask: ClueTask): Int
    fun updateClueTask(clueTask: ClueTask): Int
    fun getClueTask(clueTask: ClueTask): List<ClueTask?>
    fun deleteClueTask(clueTask: ClueTask): Int
}
src/main/kotlin/com/flightfeather/grid/service/impl/ClueConclusionServiceImpl.kt
@@ -23,6 +23,7 @@
        clueConclusion.cId ?: throw BizException("线索id缺失")
        clueConclusion.ccUploaded = false
        clueConclusion.ccCreateTime = Date()
        if (clueConclusion.ccInternal == null) clueConclusion.ccInternal = false
        try {
            val conclusion = clueConclusionMapper.selectOne(ClueConclusion().apply { cId = clueConclusion.cId })
            // æ›´æ–°
@@ -42,20 +43,37 @@
        }
    }
    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)
src/main/kotlin/com/flightfeather/grid/service/impl/ClueInternalServiceImpl.kt
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,60 @@
package com.flightfeather.grid.service.impl
import com.flightfeather.grid.config.exception.BizException
import com.flightfeather.grid.constant.ConstantHttp
import com.flightfeather.grid.domain.ds1.entity.ClueInternal
import com.flightfeather.grid.domain.ds1.entity.ClueTask
import com.flightfeather.grid.domain.ds1.mapper.ClueInternalMapper
import com.flightfeather.grid.service.ClueInternalService
import com.flightfeather.grid.service.ClueTaskService
import com.flightfeather.grid.vo.DataHead
import com.github.pagehelper.PageHelper
import org.springframework.stereotype.Service
import org.springframework.transaction.annotation.Transactional
/**
 *
 * @date 2025/4/24
 * @author feiyu02
 */
@Service
class ClueInternalServiceImpl(
    private val clueInternalMapper: ClueInternalMapper,
    private val clueTaskService: ClueTaskService,
) : ClueInternalService {
    override fun getClueInternal(
        sTime: String?,
        eTime: String?,
        pageNum: Int?,
        pageSize: Int?,
    ): Pair<DataHead, List<ClueInternal?>> {
        val p = PageHelper.startPage<ClueInternal>(pageNum ?: ConstantHttp.DEFAULT_PAGE_NUM,
            pageSize ?: ConstantHttp.DEFAULT_PAGE_SIZE)
        val res = clueInternalMapper.getClue(sTime, eTime)
        return DataHead(p.pageNum, p.pages, p.total) to res
    }
    override fun searchClueInternal(clueInternal: ClueInternal): List<ClueInternal?> {
        return clueInternalMapper.select(clueInternal)
    }
    override fun createClueInternal(clueInternal: ClueInternal): Int {
        return clueInternalMapper.insert(clueInternal)
    }
    override fun updateClueInternal(clueInternal: ClueInternal): Int {
        return clueInternalMapper.updateByPrimaryKey(clueInternal)
    }
    @Transactional
    override fun deleteClueInternal(clueInternal: ClueInternal): Int {
        clueInternal.cId ?: throw BizException("删除内部线索失败,缺少线索主键cId")
        clueTaskService.deleteClueTask(ClueTask().apply {
            clueId = clueInternal.cId
            internalTask = true
        })
        return clueInternalMapper.delete(clueInternal)
    }
}
src/main/kotlin/com/flightfeather/grid/service/impl/ClueQuestionServiceImpl.kt
@@ -10,6 +10,7 @@
import com.google.gson.Gson
import org.springframework.beans.factory.annotation.Value
import org.springframework.stereotype.Service
import org.springframework.transaction.annotation.Transactional
import org.springframework.web.multipart.MultipartFile
import tk.mybatis.mapper.entity.Example
import java.io.IOException
@@ -24,6 +25,7 @@
    override fun uploadQuestionAndImage(question: String, files: Array<MultipartFile>?): Boolean {
        val questionVo = Gson().fromJson(question, ClueQuestion::class.java)
        if (questionVo.cqInternal == null) questionVo.cqInternal = false
        newQuestionUid(questionVo)
        val picPath = saveImageFile(questionVo, files)
        questionVo.cqFilePath = picPath
@@ -62,13 +64,22 @@
        if (question.cqId != null || question.cqUid != null) return
        // å¦åˆ™æ ¹æ®ä¸Šä¸€ä¸ªé—®é¢˜ç¼–号顺延生成新编号
        PageHelper.startPage<ClueQuestion>(1, 1)
        val clues = clueQuestionMapper.selectByExample(Example(ClueQuestion::class.java).apply {
            createCriteria().andEqualTo("cId", question.cId)
        val clueQuestions = clueQuestionMapper.selectByExample(Example(ClueQuestion::class.java).apply {
            createCriteria().andEqualTo("cId", question.cId).apply {
                if (question.cqInternal == true) {
                    andEqualTo("cqInternal", true)
                } else {
                    and(
                        createCriteria().orIsNull("cqInternal")
                            .orEqualTo("cqInternal", false)
                    )
                }
            }
            orderBy("cqId").desc()
        })
        if (clues.isNotEmpty()) {
            val clue = clues[0]
            clue?.cqUid?.split("-")?.let {
        if (clueQuestions.isNotEmpty()) {
            val clueQuestion = clueQuestions[0]
            clueQuestion?.cqUid?.split("-")?.let {
                question.cqUid = "${it[0]}-${it[1].toInt() + 1}"
            }
        } else {
@@ -84,7 +95,13 @@
            val suffix = file.originalFilename?.split(".")?.last()
            val fileName = UUID.randomUUID().toString() + "." + suffix
            val basePath = imgPath
            val path = "clue/${question.cId}/${question.cqUid}/"
            // å¯¹äºŽå†…部线索问题,图片路径要做出区分
            val path = if (question.cqInternal) {
                "internal-clue/${question.cId}/${question.cqUid}/"
            } else {
                "clue/${question.cId}/${question.cqUid}/"
            }
            picPath += if (picPath.isEmpty()) {
                "$path$fileName"
            } else {
@@ -100,22 +117,36 @@
        return picPath
    }
    @Transactional
    override fun deleteImageFile(question: ClueQuestion, deleteImg: String) {
        try {
            deleteImg.split(";").forEach {
                val path = imgPath + it
                FileUtil.deleteFile(path)
                if (FileUtil.deleteFile(path)) {
                    question.cqFilePath = question.cqFilePath.replace(it, "")
                    question.cqFilePath = question.cqFilePath.replace(";;", ";")
                }
            }
        } catch (e: IOException) {
            throw BizException("图片删除失败,服务器IO操作错误")
        }
        question.cqFilePath.replace(deleteImg, "")
        if (question.cqFilePath.isNotEmpty() && question.cqFilePath.last() == ';') question.cqFilePath.removeSuffix(";")
        question.cqFilePath = question.cqFilePath.removePrefix(";")
        question.cqFilePath = question.cqFilePath.removeSuffix(";")
    }
    override fun getClueQuestion(clueId: String): List<ClueQuestion?> {
    override fun getClueQuestion(clueId: String, internal: Boolean?): List<ClueQuestion?> {
        val res = clueQuestionMapper.selectByExample(Example(ClueQuestion::class.java).apply {
            createCriteria().andEqualTo("cId", clueId)
                .apply {
                    if (internal == true) {
                        andEqualTo("cqInternal", true)
                    } else {
                        and(
                            createCriteria().orIsNull("cqInternal")
                                .orEqualTo("cqInternal", false)
                        )
                    }
                }
            orderBy("cqId")
        })
        return res
@@ -126,6 +157,11 @@
            createCriteria().andEqualTo("cqUploaded", false).apply {
                questionIdList?.let {
                    andIn("cqId", it)
                    // æŽ’除掉内部线索问题
                    and(
                        createCriteria().orIsNull("cqInternal")
                            .orEqualTo("cqInternal", false)
                    )
                }
            }
        }).forEach { it?.let { clueHttpService.uploadQuestion(it) } }
@@ -133,7 +169,13 @@
    }
    private fun deleteImageDirectory(question: ClueQuestion) {
        val path = imgPath + "clue/${question.cId}/${question.cqUid}/"
        // å¯¹äºŽå†…部线索问题,图片路径要做出区分
        val p = if (question.cqInternal) {
            "internal-clue/${question.cId}/${question.cqUid}/"
        } else {
            "clue/${question.cId}/${question.cqUid}/"
        }
        val path = imgPath + p
        FileUtil.deleteDirectory(path)
    }
}
src/main/kotlin/com/flightfeather/grid/service/impl/ClueServiceImpl.kt
@@ -4,8 +4,10 @@
import com.flightfeather.grid.constant.ConstantHttp
import com.flightfeather.grid.domain.ds1.entity.Clue
import com.flightfeather.grid.domain.ds1.entity.ClueConclusion
import com.flightfeather.grid.domain.ds1.entity.ClueInternal
import com.flightfeather.grid.domain.ds1.entity.ClueQuestion
import com.flightfeather.grid.domain.ds1.mapper.ClueConclusionMapper
import com.flightfeather.grid.domain.ds1.mapper.ClueInternalMapper
import com.flightfeather.grid.domain.ds1.mapper.ClueMapper
import com.flightfeather.grid.domain.ds1.mapper.ClueQuestionMapper
import com.flightfeather.grid.external.ClueHttpService
@@ -35,6 +37,10 @@
        return DataHead(p.pageNum, p.pages, p.total) to res
    }
    override fun searchClue(clue: Clue): List<Clue?> {
        return clueMapper.select(clue)
    }
    override fun fetchRemoteClue(updateTime: String): List<Clue?> {
        val res = clueHttpService.getClue(updateTime)
        val result = res.map {
src/main/kotlin/com/flightfeather/grid/service/impl/ClueTaskServiceImpl.kt
@@ -2,9 +2,12 @@
import com.flightfeather.grid.config.exception.BizException
import com.flightfeather.grid.domain.ds1.entity.ClueTask
import com.flightfeather.grid.domain.ds1.mapper.ClueInternalMapper
import com.flightfeather.grid.domain.ds1.mapper.ClueTaskMapper
import com.flightfeather.grid.service.ClueTaskService
import com.flightfeather.grid.vo.ClueInternalTaskVo
import org.springframework.stereotype.Service
import org.springframework.transaction.annotation.Transactional
import java.util.*
/**
@@ -13,7 +16,31 @@
 * @author feiyu02
 */
@Service
class ClueTaskServiceImpl(private val clueTaskMapper: ClueTaskMapper) : ClueTaskService {
class ClueTaskServiceImpl(
    private val clueTaskMapper: ClueTaskMapper,
    private val clueInternalMapper: ClueInternalMapper,
) : ClueTaskService {
    @Transactional
    override fun createInternalClueTask(clueInternalTaskVo: ClueInternalTaskVo): Int {
        clueInternalTaskVo.clueInternal?.cReleaseTime = Date()
        clueInternalTaskVo.clueInternal?.cCreateTime = Date()
        clueInternalTaskVo.clueInternal?.cUploaded = false
        clueInternalMapper.insert(clueInternalTaskVo.clueInternal)
        //
        clueInternalTaskVo.clueTask?.clueId = clueInternalTaskVo.clueInternal?.cId
        if (clueInternalTaskVo.clueTask?.guid == null) {
            clueInternalTaskVo.clueTask?.guid = UUID.randomUUID().toString()
        }
        if (clueInternalTaskVo.clueTask?.hasUav == null) {
            clueInternalTaskVo.clueTask?.hasUav = false
        }
        clueInternalTaskVo.clueTask?.createTime = Date()
        clueInternalTaskVo.clueTask?.updateTime = Date()
        clueInternalTaskVo.clueTask?.internalTask = true
        return clueTaskMapper.insert(clueInternalTaskVo.clueTask)
    }
    override fun createClueTask(clueTask: ClueTask): Int {
        if (clueTask.guid == null) {
@@ -21,6 +48,7 @@
        }
        clueTask.createTime = Date()
        clueTask.updateTime = Date()
        clueTask.internalTask = false
        return clueTaskMapper.insert(clueTask)
    }
@@ -34,4 +62,9 @@
    override fun getClueTask(clueTask: ClueTask): List<ClueTask?> {
        return clueTaskMapper.select(clueTask)
    }
    override fun deleteClueTask(clueTask: ClueTask): Int {
        clueTask.guid ?: throw BizException("删除线索任务失败,缺少任务主键guid")
        return clueTaskMapper.delete(clueTask)
    }
}
src/main/kotlin/com/flightfeather/grid/vo/ClueInternalTaskVo.kt
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,15 @@
package com.flightfeather.grid.vo
import com.flightfeather.grid.domain.ds1.entity.ClueInternal
import com.flightfeather.grid.domain.ds1.entity.ClueTask
/**
 *
 * @date 2025/4/23
 * @author feiyu02
 */
class ClueInternalTaskVo {
    var clueInternal: ClueInternal? = null
    var clueTask: ClueTask? = null
}
src/main/kotlin/com/flightfeather/grid/vo/ClueInternalVo.kt
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,9 @@
package com.flightfeather.grid.vo
import com.flightfeather.grid.domain.ds1.entity.ClueInternal
class ClueInternalVo : ClueInternal() {
    var questionCount: Int = 0
    var conclusionCount: Int = 0
    var taskCount: Int = 0
}
src/main/kotlin/com/flightfeather/grid/web/ClueConclusionController.kt
@@ -22,7 +22,8 @@
    @GetMapping("/fetch")
    fun getClueConclusion(
        @ApiParam("线索id") @RequestParam clueId: String,
    ) = resPack { clueConclusionService.getClueConclusion(clueId) }
        @ApiParam("是否为线索") @RequestParam(required = false) internal: Boolean?,
    ) = resPack { clueConclusionService.getClueConclusion(clueId, internal) }
    @ApiOperation("推送线索结论至第三方")
    @PostMapping("/push")
src/main/kotlin/com/flightfeather/grid/web/ClueController.kt
@@ -1,5 +1,7 @@
package com.flightfeather.grid.web
import com.flightfeather.grid.domain.ds1.entity.Clue
import com.flightfeather.grid.domain.ds1.entity.ClueInternal
import com.flightfeather.grid.service.ClueService
import io.swagger.annotations.Api
import io.swagger.annotations.ApiOperation
@@ -22,6 +24,12 @@
        @ApiParam("单页数据量") @RequestParam(required = false) pageSize: Int?,
    ) = resPack { clueService.getClue(sTime, eTime, pageNum, pageSize) }
    @ApiOperation("查询下发线索")
    @PostMapping("/search")
    fun searchClue(
        @ApiParam("查询条件") @RequestBody clue: Clue,
    ) = resPack { clueService.searchClue(clue) }
    @ApiOperation("从远程数据源拉取下发线索")
    @GetMapping("/fetch/remote")
    fun fetchRemoteClue(
src/main/kotlin/com/flightfeather/grid/web/ClueInternalController.kt
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,47 @@
package com.flightfeather.grid.web
import com.flightfeather.grid.domain.ds1.entity.ClueInternal
import com.flightfeather.grid.service.ClueInternalService
import io.swagger.annotations.Api
import io.swagger.annotations.ApiOperation
import io.swagger.annotations.ApiParam
import org.springframework.web.bind.annotation.*
@Api(tags = ["ClueController"], description = "下发线索API接口")
@RestController
@RequestMapping("/clue/internal")
class ClueInternalController(val clueInternalService: ClueInternalService) {
    @ApiOperation("获取内部线索")
    @GetMapping("/fetch")
    fun getClueInternal(
        @ApiParam("起始时间") @RequestParam(required = false) sTime: String?,
        @ApiParam("结束时间") @RequestParam(required = false) eTime: String?,
        @ApiParam("页码") @RequestParam(required = false) pageNum: Int?,
        @ApiParam("单页数据量") @RequestParam(required = false) pageSize: Int?,
    ) = resPack { clueInternalService.getClueInternal(sTime, eTime, pageNum, pageSize) }
    @ApiOperation("查询内部线索")
    @PostMapping("/search")
    fun searchClueInternal(
        @ApiParam("查询条件") @RequestBody clueInternal: ClueInternal,
    ) = resPack { clueInternalService.searchClueInternal(clueInternal) }
    @ApiOperation("更新内部线索")
    @PutMapping("/create")
    fun createClueInternal(
        @ApiParam("内部线索") @RequestBody clueInternal: ClueInternal,
    ) = resPack { clueInternalService.createClueInternal(clueInternal) }
    @ApiOperation("更新内部线索")
    @PostMapping("/update")
    fun updateClueInternal(
        @ApiParam("内部线索") @RequestBody clueInternal: ClueInternal,
    ) = resPack { clueInternalService.updateClueInternal(clueInternal) }
    @ApiOperation("更新内部线索")
    @DeleteMapping("/delete")
    fun deleteClueInternal(
        @ApiParam("内部线索") @RequestBody clueInternal: ClueInternal,
    ) = resPack { clueInternalService.deleteClueInternal(clueInternal) }
}
src/main/kotlin/com/flightfeather/grid/web/ClueQuestionController.kt
@@ -37,7 +37,8 @@
    @GetMapping("/fetch")
    fun getClueQuestion(
        @ApiParam("线索id") @RequestParam clueId: String,
    ) = resPack { clueQuestionService.getClueQuestion(clueId) }
        @ApiParam("是否为线索") @RequestParam(required = false) internal: Boolean?,
    ) = resPack { clueQuestionService.getClueQuestion(clueId, internal) }
    @ApiOperation("推送线索问题及图片至第三方")
    @PostMapping("/push")
src/main/kotlin/com/flightfeather/grid/web/ClueTaskController.kt
@@ -1,8 +1,8 @@
package com.flightfeather.grid.web
import com.flightfeather.grid.domain.ds1.entity.ClueConclusion
import com.flightfeather.grid.domain.ds1.entity.ClueTask
import com.flightfeather.grid.service.ClueTaskService
import com.flightfeather.grid.vo.ClueInternalTaskVo
import io.swagger.annotations.Api
import io.swagger.annotations.ApiOperation
import io.swagger.annotations.ApiParam
@@ -12,6 +12,12 @@
@RestController
@RequestMapping("/clue/task")
class ClueTaskController(val clueTaskService: ClueTaskService) {
    @ApiOperation("创建内部线索巡查任务")
    @PutMapping("/create/internal")
    fun createInternalClueTask(
        @ApiParam("线索任务") @RequestBody clueInternalTaskVo: ClueInternalTaskVo,
    ) = resPack { clueTaskService.createInternalClueTask(clueInternalTaskVo) }
    @ApiOperation("创建线索巡查任务")
    @PutMapping("/create")
@@ -25,9 +31,15 @@
        @ApiParam("线索任务") @RequestBody clueTask: ClueTask,
    ) = resPack { clueTaskService.updateClueTask(clueTask) }
    @ApiOperation("获取线索结论")
    @ApiOperation("查询线索任务")
    @PostMapping("/fetch")
    fun getClueTask(
        @ApiParam("线索任务") @RequestBody clueTask: ClueTask,
    ) = resPack { clueTaskService.getClueTask(clueTask) }
    @ApiOperation("删除线索任务")
    @DeleteMapping("/delete")
    fun deleteClueTask(
        @ApiParam("线索任务") @RequestBody clueTask: ClueTask,
    ) = resPack { clueTaskService.deleteClueTask(clueTask) }
}
src/main/resources/generator/generatorConfig.xml
@@ -56,14 +56,17 @@
<!--        <table tableName="g_t_clue" domainObjectName="Clue" enableCountByExample="false"-->
<!--               enableUpdateByExample="false" enableDeleteByExample="false"-->
<!--               enableSelectByExample="false" selectByExampleQueryId="false"/>-->
<!--        <table tableName="g_t_clue_conclusion" domainObjectName="ClueConclusion" enableCountByExample="false"-->
<!--               enableUpdateByExample="false" enableDeleteByExample="false"-->
<!--               enableSelectByExample="false" selectByExampleQueryId="false"/>-->
<!--        <table tableName="g_t_clue_question" domainObjectName="ClueQuestion" enableCountByExample="false"-->
<!--               enableUpdateByExample="false" enableDeleteByExample="false"-->
<!--               enableSelectByExample="false" selectByExampleQueryId="false"/>-->
            <table tableName="g_t_clue_task" domainObjectName="ClueTask" enableCountByExample="false"
                   enableUpdateByExample="false" enableDeleteByExample="false"
                   enableSelectByExample="false" selectByExampleQueryId="false"/>
        <table tableName="g_t_clue_conclusion" domainObjectName="ClueConclusion" enableCountByExample="false"
               enableUpdateByExample="false" enableDeleteByExample="false"
               enableSelectByExample="false" selectByExampleQueryId="false"/>
        <table tableName="g_t_clue_question" domainObjectName="ClueQuestion" enableCountByExample="false"
               enableUpdateByExample="false" enableDeleteByExample="false"
               enableSelectByExample="false" selectByExampleQueryId="false"/>
<!--            <table tableName="g_t_clue_task" domainObjectName="ClueTask" enableCountByExample="false"-->
<!--                   enableUpdateByExample="false" enableDeleteByExample="false"-->
<!--                   enableSelectByExample="false" selectByExampleQueryId="false"/>-->
<!--        <table tableName="g_t_clue_internal" domainObjectName="ClueInternal" enableCountByExample="true"-->
<!--               enableUpdateByExample="true" enableDeleteByExample="true"-->
<!--               enableSelectByExample="true" selectByExampleQueryId="true"/>-->
    </context>
</generatorConfiguration>
src/main/resources/mapper/ds1/ClueConclusionMapper.xml
@@ -12,6 +12,7 @@
    <result column="CC_Create_Time" jdbcType="TIMESTAMP" property="ccCreateTime" />
    <result column="CC_Uploaded" jdbcType="BIT" property="ccUploaded" />
    <result column="CC_Upload_Time" jdbcType="TIMESTAMP" property="ccUploadTime" />
    <result column="CC_Internal" jdbcType="BIT" property="ccInternal" />
  </resultMap>
  <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.flightfeather.grid.domain.ds1.entity.ClueConclusion">
    <!--
@@ -23,7 +24,8 @@
    <!--
      WARNING - @mbg.generated
    -->
    CC_Id, C_Id, CC_Question_Type, CC_Conclusion, CC_Create_Time, CC_Uploaded, CC_Upload_Time
    CC_Id, C_Id, CC_Question_Type, CC_Conclusion, CC_Create_Time, CC_Uploaded, CC_Upload_Time,
    CC_Internal
  </sql>
  <sql id="Blob_Column_List">
    <!--
src/main/resources/mapper/ds1/ClueMapper.xml
@@ -35,8 +35,8 @@
  </sql>
  <resultMap extends="BaseResultMap" id="ClueVoMap" type="com.flightfeather.grid.vo.ClueVo">
<!--    &lt;result column="questionCount" jdbcType="INTEGER" property="questionCount" /&gt;-->
<!--    &lt;result column="conclusionCount" jdbcType="INTEGER" property="conclusionCount" /&gt;-->
<!--    &amp;lt;result column="questionCount" jdbcType="INTEGER" property="questionCount" /&amp;gt;-->
<!--    &amp;lt;result column="conclusionCount" jdbcType="INTEGER" property="conclusionCount" /&amp;gt;-->
  </resultMap>
  <sql id="selectClueVo">
@@ -59,7 +59,7 @@
  </sql>
  <select id="getClue" resultMap="ClueVoMap">
    <include refid="selectClueVo"/>
    <include refid="selectClueVo" />
    <where>
      <if test="sTime != null">
        a.C_Release_Time &gt;= #{sTime}
@@ -68,14 +68,14 @@
        AND a.C_Release_Time &lt;= #{eTime}
      </if>
    </where>
    <include refid="groupClueId"/>
    <include refid="groupClueId" />
  </select>
  <select id="getClueById" resultMap="ClueVoMap">
    <include refid="selectClueVo"/>
    <include refid="selectClueVo" />
    <where>
      a.C_Id = #{clueId}
    </where>
    <include refid="groupClueId"/>
    <include refid="groupClueId" />
  </select>
</mapper>
src/main/resources/mapper/ds1/ClueQuestionMapper.xml
@@ -17,6 +17,7 @@
    <result column="CQ_Create_Time" jdbcType="TIMESTAMP" property="cqCreateTime" />
    <result column="CQ_Uploaded" jdbcType="BIT" property="cqUploaded" />
    <result column="CQ_Upload_Time" jdbcType="TIMESTAMP" property="cqUploadTime" />
    <result column="CQ_Internal" jdbcType="BIT" property="cqInternal" />
  </resultMap>
  <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.flightfeather.grid.domain.ds1.entity.ClueQuestion">
    <!--
@@ -29,7 +30,7 @@
      WARNING - @mbg.generated
    -->
    CQ_Id, CQ_Uid, C_Id, CQ_Name, CQ_Description, CQ_Street, CQ_Address, CQ_Longitude, 
    CQ_Latitude, CQ_Create_Time, CQ_Uploaded, CQ_Upload_Time
    CQ_Latitude, CQ_Create_Time, CQ_Uploaded, CQ_Upload_Time, CQ_Internal
  </sql>
  <sql id="Blob_Column_List">
    <!--
src/main/resources/mapper/ds1/ClueTaskMapper.xml
@@ -22,13 +22,14 @@
    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
    <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
    <result column="executor_ids" jdbcType="VARCHAR" property="executorIds" />
    <result column="internal_task" jdbcType="BIT" property="internalTask" />
  </resultMap>
  <sql id="Base_Column_List">
    <!--
      WARNING - @mbg.generated
    -->
    guid, clue_id, task_time, province_code, province_name, city_code, city_name, district_code,
    guid, clue_id, task_time, province_code, province_name, city_code, city_name, district_code,
    district_name, town_code, town_name, response_level, travel_mode, has_uav, create_time, 
    update_time, executor_ids
    update_time, executor_ids, internal_task
  </sql>
</mapper>