From 6c7f45871b93ef26d353a5a3596701ac2f39ed9c Mon Sep 17 00:00:00 2001 From: feiyu02 <risaku@163.com> Date: 星期二, 10 九月 2024 17:48:27 +0800 Subject: [PATCH] 1. 新增问题更新接口 --- src/main/kotlin/cn/flightfeather/supervision/domain/ds1/repository/MediaFileRep.kt | 28 ++ src/main/kotlin/cn/flightfeather/supervision/lightshare/service/InspectionService.kt | 2 src/main/kotlin/cn/flightfeather/supervision/lightshare/service/MediafileService.kt | 8 src/main/kotlin/cn/flightfeather/supervision/lightshare/web/ProblemlistController.kt | 25 + src/main/kotlin/cn/flightfeather/supervision/docx4j/demo/Test.kt | 3 src/main/kotlin/cn/flightfeather/supervision/domain/ds1/entity/Problemlist.kt | 2 src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/MediaFileVo.kt | 87 ++++++++ src/main/kotlin/cn/flightfeather/supervision/business/AutoScore2.kt | 4 src/main/kotlin/cn/flightfeather/supervision/domain/ds1/repository/ProblemRep.kt | 14 + src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/InspectionServiceImpl.kt | 4 src/main/kotlin/cn/flightfeather/supervision/domain/ds1/entity/Mediafile.kt | 2 src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/InspectionVo.kt | 2 src/test/kotlin/cn/flightfeather/supervision/business/location/LocationRoadNearbyTest.kt | 10 /dev/null | 80 -------- src/main/kotlin/cn/flightfeather/supervision/lightshare/web/SubtaskController.kt | 2 src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/ProblemlistsubtastVo.kt | 2 src/main/kotlin/cn/flightfeather/supervision/lightshare/service/ProblemlistService.kt | 28 ++ src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/VersionServiceImpl.kt | 10 src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/MediafileServiceImpl.kt | 55 +++- src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/ProblemListVo.kt | 45 ++++ src/main/resources/application-dev.yml | 4 src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/ProblemlistServiceImpl.kt | 156 ++++++-------- src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/GitlistVo.kt | 2 src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/SearchServiceImpl.kt | 8 24 files changed, 351 insertions(+), 232 deletions(-) diff --git a/src/main/kotlin/cn/flightfeather/supervision/business/AutoScore2.kt b/src/main/kotlin/cn/flightfeather/supervision/business/AutoScore2.kt index b60edbc..1b2a38f 100644 --- a/src/main/kotlin/cn/flightfeather/supervision/business/AutoScore2.kt +++ b/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() diff --git a/src/main/kotlin/cn/flightfeather/supervision/docx4j/demo/Test.kt b/src/main/kotlin/cn/flightfeather/supervision/docx4j/demo/Test.kt index 1de965f..0ab2824 100644 --- a/src/main/kotlin/cn/flightfeather/supervision/docx4j/demo/Test.kt +++ b/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 { diff --git a/src/main/kotlin/cn/flightfeather/supervision/domain/ds1/entity/Mediafile.kt b/src/main/kotlin/cn/flightfeather/supervision/domain/ds1/entity/Mediafile.kt index fb5d079..b925a1b 100644 --- a/src/main/kotlin/cn/flightfeather/supervision/domain/ds1/entity/Mediafile.kt +++ b/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 diff --git a/src/main/kotlin/cn/flightfeather/supervision/domain/ds1/entity/Problemlist.kt b/src/main/kotlin/cn/flightfeather/supervision/domain/ds1/entity/Problemlist.kt index f3f5972..8e04d61 100644 --- a/src/main/kotlin/cn/flightfeather/supervision/domain/ds1/entity/Problemlist.kt +++ b/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 diff --git a/src/main/kotlin/cn/flightfeather/supervision/domain/ds1/repository/MediaFileRep.kt b/src/main/kotlin/cn/flightfeather/supervision/domain/ds1/repository/MediaFileRep.kt new file mode 100644 index 0000000..65eb3a5 --- /dev/null +++ b/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) + }) + } +} \ No newline at end of file diff --git a/src/main/kotlin/cn/flightfeather/supervision/domain/ds1/repository/ProblemRep.kt b/src/main/kotlin/cn/flightfeather/supervision/domain/ds1/repository/ProblemRep.kt index 2334562..a4c9e11 100644 --- a/src/main/kotlin/cn/flightfeather/supervision/domain/ds1/repository/ProblemRep.kt +++ b/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() { + + } } \ No newline at end of file diff --git a/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/InspectionService.kt b/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/InspectionService.kt index ba3cb51..ac80776 100644 --- a/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/InspectionService.kt +++ b/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> diff --git a/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/MediafileService.kt b/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/MediafileService.kt index c2a59eb..ded5657 100644 --- a/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/MediafileService.kt +++ b/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>? } \ No newline at end of file diff --git a/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/ProblemlistService.kt b/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/ProblemlistService.kt index 5aff8f1..a3731a9 100644 --- a/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/ProblemlistService.kt +++ b/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?> diff --git a/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/InspectionServiceImpl.kt b/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/InspectionServiceImpl.kt index 9072c29..9b3a7c3 100644 --- a/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/InspectionServiceImpl.kt +++ b/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!!) diff --git a/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/MediafileServiceImpl.kt b/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/MediafileServiceImpl.kt index 8f142eb..27ca9c2 100644 --- a/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/MediafileServiceImpl.kt +++ b/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杞琽bject - 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 + } } \ No newline at end of file diff --git a/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/ProblemlistServiceImpl.kt b/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/ProblemlistServiceImpl.kt index 8f2b7d4..e84b05a 100644 --- a/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/ProblemlistServiceImpl.kt +++ b/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) } //鏍规嵁瀛愪换鍔D鏌ヨ闂 - 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杞琽bject 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\\绗笁鏂圭洃绠pp\\鑷姩璇勫垎\\椁愰ギ\\" - 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\\绗笁鏂圭洃绠pp\\鑷姩璇勫垎\\椁愰ギ\\" - 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> { //鏍规嵁瀛愪换鍔D鑾峰彇闂鍒楄〃 - 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 } } \ No newline at end of file diff --git a/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/SearchServiceImpl.kt b/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/SearchServiceImpl.kt index 2a55953..b6b57b7 100644 --- a/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/SearchServiceImpl.kt +++ b/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) diff --git a/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/VersionServiceImpl.kt b/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/VersionServiceImpl.kt index d9de583..e8b031e 100644 --- a/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/VersionServiceImpl.kt +++ b/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!!) diff --git a/src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/GitlistVo.kt b/src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/GitlistVo.kt index 0a6f034..1a9e5d0 100644 --- a/src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/GitlistVo.kt +++ b/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 } \ No newline at end of file diff --git a/src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/InspectionVo.kt b/src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/InspectionVo.kt index 1cdfd81..56eae4c 100644 --- a/src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/InspectionVo.kt +++ b/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 diff --git a/src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/MediaFileVo.kt b/src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/MediaFileVo.kt new file mode 100644 index 0000000..d5b4291 --- /dev/null +++ b/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鎻掍笉鍚岃〃鐨凣UID锛屽闂琛ㄣ�佹妧闃叉帾鏂借〃 +// */ +// 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 +} \ No newline at end of file diff --git a/src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/MediafileVo.kt b/src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/MediafileVo.kt deleted file mode 100644 index 33fec6f..0000000 --- a/src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/MediafileVo.kt +++ /dev/null @@ -1,54 +0,0 @@ -package cn.flightfeather.supervision.lightshare.vo - -import com.fasterxml.jackson.annotation.JsonInclude -import java.math.BigDecimal -import java.util.* - -@JsonInclude(JsonInclude.Include.NON_NULL) -public class MediafileVo { - var guid: String? = null - - var iguid: String? = null - - /** - * 鏍规嵁MF_BusinessType鎻掍笉鍚岃〃鐨凣UID锛屽闂琛ㄣ�佹妧闃叉帾鏂借〃 - */ - 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 -} \ No newline at end of file diff --git a/src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/ProblemListVo.kt b/src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/ProblemListVo.kt new file mode 100644 index 0000000..db2bafa --- /dev/null +++ b/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 + } + } +} \ No newline at end of file diff --git a/src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/ProblemlistVo.kt b/src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/ProblemlistVo.kt deleted file mode 100644 index 46a40e2..0000000 --- a/src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/ProblemlistVo.kt +++ /dev/null @@ -1,80 +0,0 @@ -package cn.flightfeather.supervision.lightshare.vo - -import com.fasterxml.jackson.annotation.JsonInclude -import java.math.BigDecimal -import java.util.* - -@JsonInclude(JsonInclude.Include.NON_NULL) -public class ProblemlistVo { - var guid: String? = null - - var iguid: String? = null - - var stguid: String? = null - - var sguid: String? = null - - var sensename: String? = null - - var senseaddress: String? = null - - var ptguid: String? = null - - var problemname: String? = null - - var longitude: BigDecimal? = null - - var latitude: BigDecimal? = null - - var locationid: Byte? = null - - var location: String? = null - - var time: Date? = null - - var isrechecked: Boolean? = null - - var rechecktime: Date? = null - - var recheckuserguid: String? = null - - var recheckusername: String? = null - - var recheckuserrealname: String? = null - - var recheckdescription: String? = null - - var recheckresultid: Boolean? = null - - /** - * 鏈暣鏀�/閮ㄥ垎鏁存敼/澶ч儴鍒嗘暣鏀�/鍏ㄩ儴鏁存敼锛屼粠鍊煎煙琛ㄩ噷璋冪敤 - */ - var recheckresult: String? = null - - var ischanged: Boolean? = null - - /** - * 鐜板満鏁存敼/鎵胯鏁存敼 鍊煎煙琛� - */ - var changecatalog: String? = null - - var changedtime: Date? = null - - var changedresult: String? = null - - var advise: String? = null - - var extension1: String? = null - - var extension2: String? = null - - var extension3: String? = null - - var remark: String? = null - - var mediafileList: List<MediafileVo>? = null - - var typeid: Byte? = null//闂绫诲瀷id - - var typename: String? = null//闂绫诲瀷鍚嶇О -} \ No newline at end of file diff --git a/src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/ProblemlistsubtastVo.kt b/src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/ProblemlistsubtastVo.kt index f570420..f711f70 100644 --- a/src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/ProblemlistsubtastVo.kt +++ b/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 } diff --git a/src/main/kotlin/cn/flightfeather/supervision/lightshare/web/ProblemlistController.kt b/src/main/kotlin/cn/flightfeather/supervision/lightshare/web/ProblemlistController.kt index 416e7e9..8baf3fa 100644 --- a/src/main/kotlin/cn/flightfeather/supervision/lightshare/web/ProblemlistController.kt +++ b/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("鍒犻櫎鐨勯棶棰樺浘鐗噄d") @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( diff --git a/src/main/kotlin/cn/flightfeather/supervision/lightshare/web/SubtaskController.kt b/src/main/kotlin/cn/flightfeather/supervision/lightshare/web/SubtaskController.kt index cf2670e..103e7a1 100644 --- a/src/main/kotlin/cn/flightfeather/supervision/lightshare/web/SubtaskController.kt +++ b/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") diff --git a/src/main/resources/application-dev.yml b/src/main/resources/application-dev.yml index 5c35911..d18704d 100644 --- a/src/main/resources/application-dev.yml +++ b/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 diff --git a/src/test/kotlin/cn/flightfeather/supervision/business/location/LocationRoadNearbyTest.kt b/src/test/kotlin/cn/flightfeather/supervision/business/location/LocationRoadNearbyTest.kt index d519504..dc83b49 100644 --- a/src/test/kotlin/cn/flightfeather/supervision/business/location/LocationRoadNearbyTest.kt +++ b/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) -- Gitblit v1.9.3