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)