feiyu02
2024-09-10 6c7f45871b93ef26d353a5a3596701ac2f39ed9c
1. 新增问题更新接口
已修改20个文件
已删除2个文件
已添加3个文件
637 ■■■■■ 文件已修改
src/main/kotlin/cn/flightfeather/supervision/business/AutoScore2.kt 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/docx4j/demo/Test.kt 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/domain/ds1/entity/Mediafile.kt 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/domain/ds1/entity/Problemlist.kt 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/domain/ds1/repository/MediaFileRep.kt 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/domain/ds1/repository/ProblemRep.kt 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/InspectionService.kt 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/MediafileService.kt 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/ProblemlistService.kt 28 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/InspectionServiceImpl.kt 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/MediafileServiceImpl.kt 55 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/ProblemlistServiceImpl.kt 156 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/SearchServiceImpl.kt 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/VersionServiceImpl.kt 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/GitlistVo.kt 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/InspectionVo.kt 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/MediaFileVo.kt 87 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/MediafileVo.kt 54 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/ProblemListVo.kt 45 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/ProblemlistVo.kt 80 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/ProblemlistsubtastVo.kt 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/lightshare/web/ProblemlistController.kt 25 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/lightshare/web/SubtaskController.kt 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/application-dev.yml 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/test/kotlin/cn/flightfeather/supervision/business/location/LocationRoadNearbyTest.kt 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/business/AutoScore2.kt
@@ -4,7 +4,7 @@
import cn.flightfeather.supervision.common.utils.UUIDGenerator
import cn.flightfeather.supervision.lightshare.service.*
import cn.flightfeather.supervision.lightshare.vo.InspectionVo
import cn.flightfeather.supervision.lightshare.vo.ProblemlistVo
import cn.flightfeather.supervision.lightshare.vo.ProblemListVo
import cn.flightfeather.supervision.lightshare.vo.ScenseVo
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.stereotype.Component
@@ -40,7 +40,7 @@
    @Autowired
    lateinit var itemevaluationService: ItemevaluationService
    private var problems: ArrayList<ProblemlistVo> = ArrayList()
    private var problems: ArrayList<ProblemListVo> = ArrayList()
    private var allRules: ArrayList<Evaluationsubrule> = ArrayList()
src/main/kotlin/cn/flightfeather/supervision/docx4j/demo/Test.kt
@@ -1,8 +1,5 @@
package cn.flightfeather.supervision.docx4j.demo
import cn.flightfeather.supervision.lightshare.vo.MediafileVo
import com.fasterxml.jackson.core.type.TypeReference
import com.fasterxml.jackson.databind.ObjectMapper
import java.io.File
class Test {
src/main/kotlin/cn/flightfeather/supervision/domain/ds1/entity/Mediafile.kt
@@ -9,7 +9,7 @@
@Table(name = "im_t_mediafile")
@JsonInclude(JsonInclude.Include.NON_NULL)
public class Mediafile {
open class Mediafile {
    @Id
    @Column(name = "MF_GUID")
    var guid: String? = null
src/main/kotlin/cn/flightfeather/supervision/domain/ds1/entity/Problemlist.kt
@@ -9,7 +9,7 @@
@Table(name = "im_t_problemlist")
@JsonInclude(JsonInclude.Include.NON_NULL)
public class Problemlist {
open class Problemlist {
    @Id
    @Column(name = "PL_GUID")
    var guid: String? = null
src/main/kotlin/cn/flightfeather/supervision/domain/ds1/repository/MediaFileRep.kt
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,28 @@
package cn.flightfeather.supervision.domain.ds1.repository
import cn.flightfeather.supervision.common.utils.Constant
import cn.flightfeather.supervision.domain.ds1.entity.Mediafile
import cn.flightfeather.supervision.domain.ds1.mapper.MediafileMapper
import org.springframework.beans.factory.annotation.Value
import org.springframework.stereotype.Repository
import tk.mybatis.mapper.entity.Example
import java.io.File
/**
 * å¤šåª’体文件数据库操作
 * @date 2024/9/10
 * @author feiyu02
 */
@Repository
class MediaFileRep(private val mediaFileMapper: MediafileMapper, @Value("\${imgPath}") var imgPath: String,) {
    fun deleteOne(guid: String?): Int {
        return mediaFileMapper.deleteByPrimaryKey(guid)
    }
    fun findList(idList: List<String>): List<Mediafile?> {
        return mediaFileMapper.selectByExample(Example(Mediafile::class.java).apply {
            createCriteria().andIn("guid", idList)
        })
    }
}
src/main/kotlin/cn/flightfeather/supervision/domain/ds1/repository/ProblemRep.kt
@@ -1,5 +1,6 @@
package cn.flightfeather.supervision.domain.ds1.repository
import cn.flightfeather.supervision.domain.ds1.entity.Problemlist
import cn.flightfeather.supervision.domain.ds1.mapper.ProblemlistMapper
import cn.flightfeather.supervision.lightshare.vo.SceneProblemSummary
import org.springframework.stereotype.Repository
@@ -7,8 +8,19 @@
@Repository
class ProblemRep(private val problemlistMapper: ProblemlistMapper) {
    fun getSceneProSummary(topTaskId: String, sceneTypeId: String?, sort: String?, sortBy: String):
    /**
     * èŽ·å–å„åœºæ™¯çš„é—®é¢˜å’Œæ•´æ”¹æ•°é‡ç»Ÿè®¡
     */
    fun selectSceneProSummary(topTaskId: String, sceneTypeId: String?, sort: String?, sortBy: String):
            List<SceneProblemSummary> {
        return problemlistMapper.getSceneProSummary(topTaskId, sceneTypeId, sort, sortBy)
    }
    fun findOne(guid: String?): Problemlist? {
        return problemlistMapper.selectByPrimaryKey(guid)
    }
    fun selectProPic() {
    }
}
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/InspectionService.kt
@@ -6,7 +6,7 @@
interface InspectionService {
    fun findProblemListById(id: String): List<ProblemlistVo>
    fun findProblemListById(id: String): List<ProblemListVo>
    fun findAll(): MutableList<Inspection>
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/MediafileService.kt
@@ -1,7 +1,7 @@
package cn.flightfeather.supervision.lightshare.service
import cn.flightfeather.supervision.domain.ds1.entity.Mediafile
import cn.flightfeather.supervision.lightshare.vo.MediafileVo
import cn.flightfeather.supervision.lightshare.vo.MediaFileVo
import org.springframework.web.multipart.MultipartFile
@@ -16,11 +16,13 @@
    fun delete(id: String): Int
    fun findByBusinessGUID(businessGuid: String): List<MediafileVo>
    fun deleteList(idList: List<String>): Int
    fun findByBusinessGUID(businessGuid: String): List<MediaFileVo>
    fun addMedifile(mediafileVoList: String, files: Array<MultipartFile>)
    fun findByProblemID(id: String): List<MediafileVo>
    fun findByProblemID(id: String): List<MediaFileVo>
    fun findBysubtaskbtid(id: String, btid: String): MutableList<Mediafile>?
}
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/ProblemlistService.kt
@@ -1,6 +1,8 @@
package cn.flightfeather.supervision.lightshare.service
import cn.flightfeather.supervision.domain.ds1.entity.Inspection
import cn.flightfeather.supervision.domain.ds1.entity.Problemlist
import cn.flightfeather.supervision.domain.ds1.entity.Scense
import cn.flightfeather.supervision.domain.ds1.entity.Subtask
import cn.flightfeather.supervision.lightshare.vo.*
import org.springframework.web.multipart.MultipartFile
@@ -18,17 +20,17 @@
    fun setDeleteStatus(id: String): BaseResponse<Int>
    fun findBySubtaskId(subTaskID: String): List<ProblemlistVo>
    fun findBySubtaskId(subTaskID: String): List<ProblemListVo>
    fun findByInspectionID(inspectionID: String): List<ProblemlistVo>
    fun findByInspectionID(inspectionID: String): List<ProblemListVo>
    fun addProblem(problemlistVo: ProblemlistVo)
    fun addProblem(problemlistVo: ProblemListVo)
    fun findByID(id: String): ProblemlistVo
    fun findByID(id: String): ProblemListVo
    fun getByArea(areaVo: AreaVo):List<ProblemlistVo>
    fun getByArea(areaVo: AreaVo):List<ProblemListVo>
    fun getByTopTask(tguid: String): List<ProblemlistVo>
    fun getByTopTask(tguid: String): List<ProblemListVo>
    fun getStatisticalResult(areaVo: AreaVo):List<StatisticsVo>
@@ -36,7 +38,7 @@
    fun getChargeResult(areaVo: AreaVo): ChargeInfoVo
    fun getProblemByScene(sceneId: String, date: String):List<ProblemlistVo>
    fun getProblemByScene(sceneId: String, date: String):List<ProblemListVo>
    fun findMonthProblemById(taskId:String, sceneId:Int?):List<MonthProblemVo>
@@ -44,9 +46,19 @@
    fun newProblem(problem: String, files: Array<MultipartFile>): BaseResponse<String>
    fun updateProblem(problem: ProblemListVo, deleteImg: List<String>, files: Array<MultipartFile>): String
    /**
     * ä¿å­˜é—®é¢˜å›¾ç‰‡
     */
    fun saveProFile(
        problemlist: Problemlist, inspection: Inspection,
        scene: Scense, files: Array<MultipartFile>,
    ): Int
    fun changeProblem(problemId: String, files: Array<MultipartFile>): BaseResponse<String>
    fun getBySubTask(stGuid: String, all:Boolean?): List<ProblemlistVo>
    fun getBySubTask(stGuid: String, all:Boolean?): List<ProblemListVo>
    fun getSceneByProType(areaVo: AreaVo, pType:String):List<Subtask?>
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/InspectionServiceImpl.kt
@@ -41,9 +41,9 @@
    }
    //根据巡查ID获取问题列表
    override fun findProblemListById(id: String): MutableList<ProblemlistVo> {
    override fun findProblemListById(id: String): MutableList<ProblemListVo> {
        val problemList = mutableListOf<ProblemlistVo>()
        val problemList = mutableListOf<ProblemListVo>()
        val inspection = inspectionMapper.selectByPrimaryKey(id)
        if (inspection != null) {
            val problemListVo = problemlistService.findByInspectionID(inspection.guid!!)
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/MediafileServiceImpl.kt
@@ -4,8 +4,9 @@
import cn.flightfeather.supervision.domain.ds1.mapper.MediafileMapper
import cn.flightfeather.supervision.common.utils.Constant
import cn.flightfeather.supervision.common.utils.FileUtil
import cn.flightfeather.supervision.domain.ds1.repository.MediaFileRep
import cn.flightfeather.supervision.lightshare.service.MediafileService
import cn.flightfeather.supervision.lightshare.vo.MediafileVo
import cn.flightfeather.supervision.lightshare.vo.MediaFileVo
import com.fasterxml.jackson.core.type.TypeReference
import org.springframework.beans.BeanUtils
import org.springframework.stereotype.Service
@@ -20,6 +21,7 @@
@Service
class MediafileServiceImpl(
    val mediafileMapper: MediafileMapper,
    private val mediaFileRep: MediaFileRep,
    @Value("\${filePath}") var filePath: String,
    @Value("\${imgPath}") var imgPath: String,
) : MediafileService {
@@ -37,20 +39,20 @@
    }
    //根据问题id获取媒体文件
    override fun findByProblemID(id: String): List<MediafileVo> {
        val mediafileVos = mutableListOf<MediafileVo>()
    override fun findByProblemID(id: String): List<MediaFileVo> {
        val mediaFileVos = mutableListOf<MediaFileVo>()
        val mediafile = Mediafile()
        mediafile.iguid = id
        val mediafiles = mediafileMapper.select(mediafile)
        if (mediafiles.isNotEmpty()) {
            mediafiles.forEach {
                val mediafileVo = MediafileVo()
                val mediafileVo = MediaFileVo()
                BeanUtils.copyProperties(it, mediafileVo)
                mediafileVos.add(mediafileVo)
                mediaFileVos.add(mediafileVo)
            }
        }
        mediafileVos.sortBy { it.savetime }
        return mediafileVos
        mediaFileVos.sortBy { it.savetime }
        return mediaFileVos
    }
    //新增媒体文件
@@ -60,11 +62,11 @@
        val mapper = ObjectMapper()
        //json转object
        val mediafileVos =
            mapper.readValue<List<MediafileVo>>(mediafileVoList, object : TypeReference<List<MediafileVo>>() {})
        val mediaFileVos =
            mapper.readValue<List<MediaFileVo>>(mediafileVoList, object : TypeReference<List<MediaFileVo>>() {})
        if (mediafileVos.isNotEmpty()) {
            mediafileVos.forEach {
        if (mediaFileVos.isNotEmpty()) {
            mediaFileVos.forEach {
                val mediafile = Mediafile()
                BeanUtils.copyProperties(it, mediafile)
@@ -77,11 +79,11 @@
            }
            //根据扩展字段1获取保存路径
            val path = mediafileVos[0].extension1
            val path = mediaFileVos[0].extension1
            for (image in files) {
                val fileName = image.originalFilename
                val filePath = "${Constant.DEFAULT_FILE_PATH}/images/$path/"
                val filePath = "${imgPath}/$path/"
                try {
                    //调用文件保存方法
                    FileUtil.uploadFile(image.bytes, filePath, fileName!!)
@@ -94,17 +96,17 @@
    //根据业务类型ID获取媒体文件
    override fun findByBusinessGUID(businessGuid: String): List<MediafileVo> {
        val mediafileVoList = mutableListOf<MediafileVo>()
    override fun findByBusinessGUID(businessGuid: String): List<MediaFileVo> {
        val mediaFileVoList = mutableListOf<MediaFileVo>()
        val mediafile = Mediafile()
        mediafile.businessguid = businessGuid
        val mediafiles = mediafileMapper.select(mediafile)
        mediafiles.forEach {
            val mediafileVo = MediafileVo()
            val mediafileVo = MediaFileVo()
            BeanUtils.copyProperties(it, mediafileVo)
            mediafileVoList.add(mediafileVo)
            mediaFileVoList.add(mediafileVo)
        }
        return mediafileVoList
        return mediaFileVoList
    }
    override fun findOne(id: String): Mediafile = mediafileMapper.selectByPrimaryKey(id)
@@ -122,10 +124,25 @@
        val path = mediafile.extension1
        //File("/Users/liwei/images/${path}/${id}.jpg").delete()
        //先删图片
        val f = File("${Constant.DEFAULT_FILE_PATH}/images/$path/$id.jpg")
        val f = File("${imgPath}/$path/$id.jpg")
        if (f.exists()) {
            f.delete()
        }
        return mediafileMapper.deleteByPrimaryKey(id)
    }
    override fun deleteList(idList: List<String>): Int {
        var res = 0
        mediaFileRep.findList(idList).forEach {
            //服务器保存路径
            val path = it?.extension1
            //先删图片
            val f = File("${imgPath}/$path/${it?.guid}.jpg")
            if (f.exists()) {
                f.delete()
            }
            res += mediaFileRep.deleteOne(it?.guid)
        }
        return res
    }
}
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/ProblemlistServiceImpl.kt
@@ -3,13 +3,10 @@
import cn.flightfeather.supervision.common.exception.BizException
import cn.flightfeather.supervision.common.log.BizLog
import cn.flightfeather.supervision.common.log.WorkStreamLogInfo
import cn.flightfeather.supervision.domain.ds1.entity.Problemlist
import cn.flightfeather.supervision.domain.ds1.entity.Scense
import cn.flightfeather.supervision.common.utils.Constant
import cn.flightfeather.supervision.common.utils.FileUtil
import cn.flightfeather.supervision.common.utils.UUIDGenerator
import cn.flightfeather.supervision.domain.ds1.entity.Mediafile
import cn.flightfeather.supervision.domain.ds1.entity.Subtask
import cn.flightfeather.supervision.domain.ds1.entity.*
import cn.flightfeather.supervision.domain.ds1.mapper.*
import cn.flightfeather.supervision.domain.ds1.repository.ProblemRep
import cn.flightfeather.supervision.domain.ds1.repository.SubTaskRep
@@ -22,6 +19,7 @@
import com.fasterxml.jackson.databind.ObjectMapper
import com.github.pagehelper.PageHelper
import org.springframework.beans.BeanUtils
import org.springframework.beans.factory.annotation.Value
import org.springframework.stereotype.Service
import org.springframework.web.multipart.MultipartFile
import tk.mybatis.mapper.entity.Example
@@ -45,6 +43,8 @@
    private val subTaskRep: SubTaskRep,
    private val problemRep: ProblemRep,
    private val bizLog: BizLog,
    @Value("\${filePath}") var filePath: String,
    @Value("\${imgPath}") var imgPath: String,
) : ProblemlistService {
    @Resource
@@ -62,29 +62,29 @@
    @Resource
    lateinit var mediafileService: MediafileService
    override fun getByTopTask(tguid: String): List<ProblemlistVo> {
    override fun getByTopTask(tguid: String): List<ProblemListVo> {
        TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
    }
    //根据场景id和时间获取对应顶层任务下的所有问题
    override fun getProblemByScene(sceneId: String, date: String): List<ProblemlistVo> {
    override fun getProblemByScene(sceneId: String, date: String): List<ProblemListVo> {
        val simpleDateFormat = SimpleDateFormat("yyyy-MM-dd HH:mm:ss")
        val date1 = simpleDateFormat.parse(date)
        val scene = scenseMapper.selectByPrimaryKey(sceneId)
        val district = scene.districtcode
        val taskVolist = taskService.getByDistrictCode(district!!, date1)
        val problemlistVolistTemp1 = mutableListOf<ProblemlistVo>()
        val problemListVolistTemp1 = mutableListOf<ProblemListVo>()
        if (!taskVolist.isEmpty()) {
            val problemlists = (problemlistMapper.getProblemByScene(sceneId, taskVolist[0].tguid!!))
            problemlists.forEach {
                // é™åˆ¶ä¼ä¸šæŸ¥çœ‹æœªå®¡æ ¸çš„问题
                if (it.extension3 != Constant.PROBLEM_UNCHECKED && it.extension3 != Constant.PROBLEM_CHECK_FAIL) {
                    val problemVo = ProblemlistVo();
                    val problemVo = ProblemListVo();
                    BeanUtils.copyProperties(it, problemVo)
                    problemlistVolistTemp1.add(problemVo)
                    problemListVolistTemp1.add(problemVo)
                }
            }
            problemlistVolistTemp1.forEach {
            problemListVolistTemp1.forEach {
                if (it.ptguid != null) {
                    val tmp1 = problemtypeMapper.selectByPrimaryKey(it.ptguid)
                    if (tmp1 != null) {
@@ -102,7 +102,7 @@
                }
            }
        }
        return problemlistVolistTemp1
        return problemListVolistTemp1
    }
    //获取某顶层任务下,某个场景下的问题整改情况
@@ -213,8 +213,8 @@
    }
    //根据地域获取问题
    override fun getByArea(areaVo: AreaVo): List<ProblemlistVo> {
        val problemlist = mutableListOf<ProblemlistVo>()
    override fun getByArea(areaVo: AreaVo): List<ProblemListVo> {
        val problemlist = mutableListOf<ProblemListVo>()
//        val tmpproblemlsit = mutableListOf<Problemlist>()
        val example = Example(Scense::class.java)
        val criteria = example.createCriteria()
@@ -238,7 +238,7 @@
                tmpcriteria.andBetween("time", areaVo.starttime, areaVo.endtime)
                val tmp = problemlistMapper.selectByExample(tmpexample)
                tmp.forEach {
                    val problem = ProblemlistVo();
                    val problem = ProblemListVo();
                    BeanUtils.copyProperties(it, problem)
                    problemlist.add(problem)
                }
@@ -258,47 +258,47 @@
    }
    //根据巡查ID获取问题
    override fun findByInspectionID(inspectionID: String): List<ProblemlistVo> {
        val problemlistVoList = mutableListOf<ProblemlistVo>()
    override fun findByInspectionID(inspectionID: String): List<ProblemListVo> {
        val problemListVoList = mutableListOf<ProblemListVo>()
        val problemlist = Problemlist()
        problemlist.iguid = inspectionID
        val problemlists = problemlistMapper.select(problemlist)
        problemlists.forEach {
            val problemlistVo = ProblemlistVo()
            val problemlistVo = ProblemListVo()
            if (it.remark != Constant.PROBLEM_DELETED) {
                BeanUtils.copyProperties(it, problemlistVo)
                problemlistVoList.add(problemlistVo)
                problemListVoList.add(problemlistVo)
            }
        }
        //排序
        problemlistVoList.sortBy { it.time }
        return problemlistVoList
        problemListVoList.sortBy { it.time }
        return problemListVoList
    }
    //新增一个问题
    override fun addProblem(problemlistVo: ProblemlistVo) {
    override fun addProblem(problemlistVo: ProblemListVo) {
        val probemlist = Problemlist()
        BeanUtils.copyProperties(problemlistVo, probemlist)
        problemlistMapper.insert(probemlist)
    }
    //根据子任务ID查询问题
    override fun findBySubtaskId(subTaskID: String): List<ProblemlistVo> {
        val problemlistVoList = mutableListOf<ProblemlistVo>()
    override fun findBySubtaskId(subTaskID: String): List<ProblemListVo> {
        val problemListVoList = mutableListOf<ProblemListVo>()
        val problemlist = Problemlist()
        problemlist.stguid = subTaskID
        val problemlists = problemlistMapper.select(problemlist)
        problemlists.forEach {
            val problemlistVo = ProblemlistVo()
            val problemlistVo = ProblemListVo()
            BeanUtils.copyProperties(it, problemlistVo)
            problemlistVoList.add(problemlistVo)
            problemListVoList.add(problemlistVo)
        }
        return problemlistVoList
        return problemListVoList
    }
    //根据问题ID获取一个问题
    override fun findByID(id: String): ProblemlistVo {
        val problemlistVo = ProblemlistVo()
    override fun findByID(id: String): ProblemListVo {
        val problemlistVo = ProblemListVo()
        val problemlist = problemlistMapper.selectByPrimaryKey(id)
        if (problemlist != null) {
            BeanUtils.copyProperties(problemlist, problemlistVo)
@@ -464,67 +464,15 @@
        //json转object
        val problemVo = mapper.readValue(problem, object : TypeReference<ProblemVo>() {})
        // ä¿å­˜é—®é¢˜
        val inspection = inspectionMapper.selectByPrimaryKey(problemVo.insGuid) ?: return BaseResponse(false, "巡查记录不存在")
        val scene = scenseMapper.selectByPrimaryKey(inspection.sguid) ?: return BaseResponse(false, "巡查记录对应场景不存在")
        val problemlist = Problemlist().apply {
            guid = UUIDGenerator.generate16ShortUUID()
            iguid = inspection.guid
            stguid = inspection.stguid
            sguid = inspection.sguid
            sensename = inspection.scensename
            senseaddress = inspection.scenseaddress
            ptguid = problemVo.ptGuid
            problemname = problemVo.proName
            longitude = problemVo.longitude ?: scene.longitude
            latitude = problemVo.latitude ?: scene.latitude
            locationid = problemVo.locationId
            location = problemVo.location
            time = Date()
            isrechecked = false
            ischanged = false
            advise = problemVo.advice
            extension3 = Constant.PROBLEM_UNCHECKED
        }
        // ä¿å­˜é—®é¢˜
        val problemlist = ProblemListVo.newPro(inspection, problemVo, scene)
        problemlistMapper.insert(problemlist)
        // ä¿å­˜å›¾ç‰‡
        val now = LocalDateTime.now()
        for (image in files) {
            val mediaFile = Mediafile().apply {
                guid = UUIDGenerator.generate16ShortUUID()
                iguid = inspection.guid
                businessguid = problemlist.guid
                longitude = problemlist.longitude
                latitude = problemlist.latitude
                address = problemlist.senseaddress
                filetype = 1
                businesstype = "问题"
                businesstypeid = 1
                path =
                    "FlightFeather/Photo/" + scene.districtname + "/" + now.year + "å¹´" + now.monthValue + "月/" + now.monthValue + "月" + now.dayOfMonth + "日/" + scene.name + "/"
                description =
                    problemlist.problemname + " " + problemlist.location + " " + UUIDGenerator.generateUUID(4) + ".jpg"
                savetime = Date()
                ischanged = false
                extension1 =
                    scene.citycode + "/" + scene.districtcode + "/" + now.format(DateTimeFormatter.ofPattern("yyyy-MM-dd")) + "/" + scene.guid + "/"
                remark = "已上传"
            }
            mediafileMapper.insert(mediaFile)
            val path = mediaFile.extension1
            val fileName = mediaFile.guid + ".jpg"
//            val filePath = "E:\\work\\第三方监管app\\自动评分\\餐饮\\"
            val filePath = "${Constant.DEFAULT_FILE_PATH}/images/$path/"
            try {
                //调用文件保存方法
                FileUtil.uploadFile(image.bytes, filePath, fileName)
            } catch (e: Exception) {
                // TODO: handle exception
            }
        }
        saveProFile(problemlist, inspection, scene, files)
        //更新巡查信息的问题数
        if (inspection.problemcount != null) {
@@ -539,6 +487,40 @@
        }
        return BaseResponse(true)
    }
    override fun updateProblem(problem: ProblemListVo, deleteImg: List<String>, files: Array<MultipartFile>): String {
        problemRep.findOne(problem.guid) ?: throw BizException("该问题不存在")
        val inspection = inspectionMapper.selectByPrimaryKey(problem.guid) ?: throw BizException("巡查记录不存在")
        val scene = scenseMapper.selectByPrimaryKey(inspection.sguid) ?: throw BizException("巡查记录对应场景不存在")
        saveProFile(problem, inspection, scene, files)
        mediafileService.deleteList(deleteImg)
        return "success"
    }
    override fun saveProFile(
        problemlist: Problemlist,
        inspection: Inspection,
        scene: Scense,
        files: Array<MultipartFile>,
    ): Int {
        var res = 0
        // ä¿å­˜å›¾ç‰‡
        for (image in files) {
            val mediaFile = MediaFileVo.newProFile(inspection, problemlist, scene)
            res += mediafileMapper.insert(mediaFile)
            val path = mediaFile.extension1
            val fileName = mediaFile.guid + ".jpg"
            val filePath = "${imgPath}/$path/"
            try {
                //调用文件保存方法
                FileUtil.uploadFile(image.bytes, filePath, fileName)
            } catch (e: Exception) {
                // TODO: handle exception
            }
        }
        return res
    }
    override fun changeProblem(problemId: String, files: Array<MultipartFile>): BaseResponse<String> {
@@ -585,7 +567,7 @@
            val path = m.extension1
            val fileName = m.guid + ".jpg"
//            val filePath = "E:\\work\\第三方监管app\\自动评分\\餐饮\\"
            val filePath = "${Constant.DEFAULT_FILE_PATH}/images/$path"
            val filePath = "${imgPath}/$path"
            try {
                //调用文件保存方法
                FileUtil.uploadFile(image.bytes, filePath, fileName)
@@ -597,9 +579,9 @@
        return BaseResponse(true)
    }
    override fun getBySubTask(stGuid: String, all: Boolean?): List<ProblemlistVo> {
    override fun getBySubTask(stGuid: String, all: Boolean?): List<ProblemListVo> {
        //根据子任务ID获取问题列表
        val problemListVo = mutableListOf<ProblemlistVo>()
        val problemListVo = mutableListOf<ProblemListVo>()
        if (all == false) {
            //去除未审核以及审核不通过的问题
            findBySubtaskId(stGuid).forEach {
@@ -637,7 +619,7 @@
        areaVo.scensetypeid ?: throw BizException("缺少场景类型参数")
        val task = taskRep.findOneTask(areaVo) ?: throw BizException("未找到对应的巡查总任务")
        val p = PageHelper.startPage<SceneProblemSummary>(page, per_page)
        val res = problemRep.getSceneProSummary(task.tguid!!, areaVo.scensetypeid!!, areaVo.sort, sortBy)
        val res = problemRep.selectSceneProSummary(task.tguid!!, areaVo.scensetypeid!!, areaVo.sort, sortBy)
        return DataHead(p.pageNum, p.pages, p.total) to res
    }
}
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/SearchServiceImpl.kt
@@ -258,7 +258,7 @@
        //建立第一层目录,包含所有的任务
        val time = DateUtil.DateToString(Date(), "yyyy-MM-dd_HH-mm-ss")
        var basePath =
            Constant.DEFAULT_FILE_PATH + File.separator + "images" + File.separator + "temp" + File.separator + time
            imgPath + File.separator + "temp" + File.separator + time
        var file = File(basePath)
        var i = 1
        while (file.exists() && i <= 100) {
@@ -310,7 +310,7 @@
                    createCriteria().andEqualTo("businessguid", p.guid)
                }).forEach { m ->
                    val picPath =
                        Constant.DEFAULT_FILE_PATH + File.separator + "images" + File.separator + m.extension1 + m.guid + ".jpg"
                        imgPath + File.separator + m.extension1 + m.guid + ".jpg"
                    val fromFile = File(picPath)
                    val picName = p.problemname + "_" + p.location + "($y).jpg"
                    val toFile = File(pPath + File.separator + picName)
@@ -351,7 +351,7 @@
        val topTask = taskMapper.selectByPrimaryKey(topTaskId)
        val time = DateUtil.DateToString(Date(), "yyyy-MM-dd_HH-mm-ss")
        val basePath =
            Constant.DEFAULT_FILE_PATH + File.separator + "images" + File.separator + "temp" + File.separator + topTask.name
            imgPath + File.separator + "temp" + File.separator + topTask.name
        val file = File(basePath)
        if (!file.exists()) {
            file.mkdirs()
@@ -420,7 +420,7 @@
                        u.forEach { f ->
                            val picPath =
                                Constant.DEFAULT_FILE_PATH + File.separator + "images" + File.separator + f.extension1 + f.guid + ".jpg"
                                imgPath + File.separator + f.extension1 + f.guid + ".jpg"
                            val fromFile = File(picPath)
                            val picName = f.description
                            val toFile = File(pPath + File.separator + picName)
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/VersionServiceImpl.kt
@@ -5,12 +5,16 @@
import cn.flightfeather.supervision.common.utils.Constant
import cn.flightfeather.supervision.common.utils.FileUtil
import cn.flightfeather.supervision.lightshare.service.VersionService
import org.springframework.beans.factory.annotation.Value
import org.springframework.stereotype.Service
import org.springframework.web.multipart.MultipartFile
import tk.mybatis.mapper.entity.Example
@Service
class VersionServiceImpl(val versionMapper: VersionMapper): VersionService {
class VersionServiceImpl(
    val versionMapper: VersionMapper, @Value("\${filePath}") var filePath: String,
    @Value("\${imgPath}") var imgPath: String,
): VersionService {
    override fun save(version: Version): Int = versionMapper.insert(version)
@@ -32,8 +36,8 @@
        if (files.isNotEmpty()) {
            val file = files[0]
            val fileName = files[0].originalFilename
            val basePath = Constant.DEFAULT_FILE_PATH + "/files/"
            val path = "crash/"
            val basePath = filePath
            val path = "/crash/"
            try {
                //调用文件保存方法
                FileUtil.uploadFile(file.bytes, basePath + path, fileName!!)
src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/GitlistVo.kt
@@ -49,5 +49,5 @@
    var remark: String? = null
    var mediafileList: List<MediafileVo>? = null
    var mediafileList: List<MediaFileVo>? = null
}
src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/InspectionVo.kt
@@ -79,7 +79,7 @@
    var remark: String? = null
    //问题列表
    var problemList:List<ProblemlistVo> ?= null
    var problemList:List<ProblemListVo> ?= null
    //技防措施列表
    var gitList:List<GitlistVo> ?= null
src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/MediaFileVo.kt
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,87 @@
package cn.flightfeather.supervision.lightshare.vo
import cn.flightfeather.supervision.common.utils.UUIDGenerator
import cn.flightfeather.supervision.domain.ds1.entity.Inspection
import cn.flightfeather.supervision.domain.ds1.entity.Mediafile
import cn.flightfeather.supervision.domain.ds1.entity.Problemlist
import cn.flightfeather.supervision.domain.ds1.entity.Scense
import com.fasterxml.jackson.annotation.JsonInclude
import java.math.BigDecimal
import java.time.LocalDateTime
import java.time.format.DateTimeFormatter
import java.util.*
@JsonInclude(JsonInclude.Include.NON_NULL)
class MediaFileVo : Mediafile() {
    companion object {
        /**
         * ç”Ÿæˆä¸€ä¸ªé—®é¢˜å›¾ç‰‡
         */
        fun newProFile(inspection: Inspection, problemlist: Problemlist, scene: Scense) = Mediafile().apply {
            val now = LocalDateTime.now()
            guid = UUIDGenerator.generate16ShortUUID()
            iguid = inspection.guid
            businessguid = problemlist.guid
            longitude = problemlist.longitude
            latitude = problemlist.latitude
            address = problemlist.senseaddress
            filetype = 1
            businesstype = "问题"
            businesstypeid = 1
            path =
                "FlightFeather/Photo/" + scene.districtname + "/" + now.year + "å¹´" + now.monthValue + "月/" + now.monthValue + "月" + now.dayOfMonth + "日/" + scene.name + "/"
            description =
                problemlist.problemname + " " + problemlist.location + " " + UUIDGenerator.generateUUID(4) + ".jpg"
            savetime = Date()
            ischanged = false
            extension1 =
                scene.citycode + "/" + scene.districtcode + "/" + now.format(DateTimeFormatter.ofPattern("yyyy-MM-dd")) + "/" + scene.guid + "/"
            remark = "已上传"
        }
    }
//    var guid: String? = null
//
//    var iguid: String? = null
//
//    /**
//     * æ ¹æ®MF_BusinessType插不同表的GUID,如问题表、技防措施表
//     */
//    var businessguid: String? = null
//
//    var longitude: BigDecimal? = null
//
//    var latitude: BigDecimal? = null
//
//    var address: String? = null
//
//    /**
//     * 1图片 2音频 3视频
//     */
//    var filetype: Int? = null
//
//    var businesstypeid: Byte? = null
//
//    /**
//     * 1. é—®é¢˜ï¼›2技防措施;3监测设备;4治理设置;5 å¸¸è§„记录,99 å…¶ä»–
//     */
//    var businesstype: String? = null
//
//    var path: String? = null
//
//    var description: String? = null
//
//    var savetime: Date? = null
//
//    /**
//     * å¦ä¸ºæ•´æ”¹å‰çš„图片
//     */
//    var ischanged: Boolean? = null
//
//    var extension1: String? = null
//
//    var extension2: String? = null
//
//    var extension3: String? = null
//
//    var remark: String? = null
}
src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/MediafileVo.kt
ÎļþÒÑɾ³ý
src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/ProblemListVo.kt
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,45 @@
package cn.flightfeather.supervision.lightshare.vo
import cn.flightfeather.supervision.common.utils.Constant
import cn.flightfeather.supervision.common.utils.UUIDGenerator
import cn.flightfeather.supervision.domain.ds1.entity.Inspection
import cn.flightfeather.supervision.domain.ds1.entity.Problemlist
import cn.flightfeather.supervision.domain.ds1.entity.Scense
import com.fasterxml.jackson.annotation.JsonInclude
import java.math.BigDecimal
import java.util.*
@JsonInclude(JsonInclude.Include.NON_NULL)
class ProblemListVo : Problemlist() {
    var mediafileList: List<MediaFileVo>? = null
    var typeid: Byte? = null//问题类型id
    var typename: String? = null//问题类型名称
    companion object {
        /**
         * ç”Ÿæˆä¸€ä¸ªæ–°é—®é¢˜
         */
        fun newPro(inspection: Inspection, problemVo:ProblemVo, scene: Scense) = Problemlist().apply {
            guid = UUIDGenerator.generate16ShortUUID()
            iguid = inspection.guid
            stguid = inspection.stguid
            sguid = inspection.sguid
            sensename = inspection.scensename
            senseaddress = inspection.scenseaddress
            ptguid = problemVo.ptGuid
            problemname = problemVo.proName
            longitude = problemVo.longitude ?: scene.longitude
            latitude = problemVo.latitude ?: scene.latitude
            locationid = problemVo.locationId
            location = problemVo.location
            time = Date()
            isrechecked = false
            ischanged = false
            advise = problemVo.advice
            extension3 = Constant.PROBLEM_UNCHECKED
        }
    }
}
src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/ProblemlistVo.kt
ÎļþÒÑɾ³ý
src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/ProblemlistsubtastVo.kt
@@ -1,6 +1,6 @@
package cn.flightfeather.supervision.lightshare.vo
class ProblemlistsubtastVo {
    var problemlistVo: List<ProblemlistVo>? = null
    var problemlistVo: List<ProblemListVo>? = null
    var subtaskVo: SubtaskVo? = null
}
src/main/kotlin/cn/flightfeather/supervision/lightshare/web/ProblemlistController.kt
@@ -6,6 +6,8 @@
import cn.flightfeather.supervision.lightshare.service.ProblemlistService
import cn.flightfeather.supervision.lightshare.service.SubtaskService
import cn.flightfeather.supervision.lightshare.vo.*
import com.fasterxml.jackson.core.type.TypeReference
import com.fasterxml.jackson.databind.ObjectMapper
import io.swagger.annotations.Api
import io.swagger.annotations.ApiOperation
import io.swagger.annotations.ApiParam
@@ -46,15 +48,15 @@
    fun setDeleteStatus(@PathVariable id: String) = problemlistService.setDeleteStatus(id)
    @PostMapping("/add")
    fun addProblem(@RequestBody problemlistVo: ProblemlistVo) {
    fun addProblem(@RequestBody problemlistVo: ProblemListVo) {
        problemlistService.addProblem(problemlistVo)
    }
    @PostMapping("/getbyarea")
    fun getByArea(@RequestBody areaVo: AreaVo): List<ProblemlistVo> = problemlistService.getByArea(areaVo)
    fun getByArea(@RequestBody areaVo: AreaVo): List<ProblemListVo> = problemlistService.getByArea(areaVo)
    @GetMapping("/getbytoptask")
    fun getByTopTask(@RequestParam(value = "tguid", required = true) tguid: String): List<ProblemlistVo> =
    fun getByTopTask(@RequestParam(value = "tguid", required = true) tguid: String): List<ProblemListVo> =
        problemlistService.getByTopTask(tguid)
    @PostMapping("/getStatisticalResult")
@@ -74,7 +76,7 @@
    fun getProblemsByScene(
        @RequestParam(value = "sceneId", required = true) sceneId: String,
        @RequestParam date: String,
    ): List<ProblemlistVo> = problemlistService.getProblemByScene(sceneId, date)
    ): List<ProblemListVo> = problemlistService.getProblemByScene(sceneId, date)
    @GetMapping("/month_anlysis")
    fun getMonthProblemsById(
@@ -96,10 +98,21 @@
    @ApiOperation(value = "新增一个问题", notes = "简化上传所需问题信息,将大部分操作交由后台完成")
    @PostMapping("/newProblem")
    fun newProblem(
        @RequestParam("problemVo") problemVo: String,
        @RequestPart("images") files: Array<MultipartFile>,
        @ApiParam("问题信息json") @RequestParam("problemVo") problemVo: String,
        @ApiParam("问题图片") @RequestPart("images") files: Array<MultipartFile>,
    ) = problemlistService.newProblem(problemVo, files)
    @ApiOperation("更新一个问题")
    @PostMapping("/updateProblem")
    fun updateDeviceLocation(
        @ApiParam("问题信息json") @RequestParam("problem") problem: String,
        @ApiParam("删除的问题图片id") @RequestParam("deleteImg") deleteImg: List<String>,
        @ApiParam("问题图片") @RequestPart("images") images: Array<MultipartFile>,
    ) = resPack {
        val problemVo = ObjectMapper().readValue(problem, object : TypeReference<ProblemListVo>() {})
        problemlistService.updateProblem(problemVo, deleteImg, images)
    }
    @ApiOperation(value = "整改一个问题", notes = "简化上传所需问题信息,将大部分操作交由后台完成")
    @PostMapping("/changeProblem")
    fun changeProblem(
src/main/kotlin/cn/flightfeather/supervision/lightshare/web/SubtaskController.kt
@@ -90,7 +90,7 @@
    @PostMapping("/summary/area")
    fun getTaskProgressByArea(
        @RequestBody areaVo: AreaVo,
    ) = resPack { subtaskService.getTaskProgressByArea(areaVo) }
    ) = subtaskService.getTaskProgressByArea(areaVo)
    @ApiOperation("获取某个场景的巡查任务")
    @GetMapping("/byScene")
src/main/resources/application-dev.yml
@@ -17,6 +17,6 @@
      v2:
        enabled: true
imgPath: target
filePath: target
imgPath: C:\02product\supervision\images
filePath: C:\02product\supervision\files
mode: dev
src/test/kotlin/cn/flightfeather/supervision/business/location/LocationRoadNearbyTest.kt
@@ -45,9 +45,9 @@
//            LocationRoadNearby.BasePlace("吕青路-朱吕公路-朱平公路", Pair(121.136318,30.833325), Pair(121.148624,30.836094)),
//            LocationRoadNearby.BasePlace("泖湾支路-吕青路-朱平公路", Pair(121.155048,30.835229), Pair(121.148659,30.829861)),
//            LocationRoadNearby.BasePlace("徐汇上师大", Pair(121.419384,31.161433), Pair(121.419384,31.161433)),
//            LocationRoadNearby.BasePlace("静安监测站国控点", Pair(121.429439, 31.223632), Pair(121.429439, 31.223632)),
//            LocationRoadNearby.BasePlace("金山大道2000号", Pair(121.3404, 30.744262), Pair(121.3404, 30.744262)),
            LocationRoadNearby.BasePlace("徐汇上师大", Pair(121.419384,31.161433), Pair(121.419384,31.161433)),
            LocationRoadNearby.BasePlace("静安监测站国控点", Pair(121.429439, 31.223632), Pair(121.429439, 31.223632)),
            LocationRoadNearby.BasePlace("金山大道2000号", Pair(121.3404, 30.744262), Pair(121.3404, 30.744262)),
            LocationRoadNearby.BasePlace("仙霞站", Pair(121.394775, 31.203982), Pair(121.394775, 31.203982)),
//            LocationRoadNearby.BasePlace("程桥站", Pair(121.362928, 31.192925), Pair(121.362928, 31.192925)),
@@ -76,9 +76,9 @@
//            LocationRoadNearby.BasePlace("九丰路", Pair(121.254114, 30.903438), Pair(121.254715, 30.893363)),
        )
        listOf(
            500.0,
//            500.0,
//            1000.0,
            2000.0,
//            2000.0,
            3000.0
        ).forEach {
            locationRoadNearby.searchList(bList, it)