src/main/kotlin/cn/flightfeather/supervision/business/import/SceneImport.kt
@@ -7,6 +7,7 @@ import cn.flightfeather.supervision.domain.ds1.repository.RegionRep import cn.flightfeather.supervision.lightshare.vo.SceneDetail import com.google.gson.Gson import org.apache.poi.ss.usermodel.Cell import org.apache.poi.ss.usermodel.CellType import org.springframework.stereotype.Component import java.io.InputStream @@ -111,23 +112,23 @@ when (scense?.typeid.toString()) { Constant.SceneType.TYPE1.value -> { subScene = SceneConstructionSite().apply { csProjectType = it.getCell(12)?.stringCellValue?.trim() csStatus = it.getCell(13)?.stringCellValue?.trim() siExtension1 = it.getCell(14)?.stringCellValue?.trim() csStartTime = it.getCell(15)?.stringCellValue?.trim() csEndTime = it.getCell(16)?.stringCellValue?.trim() csLeftTime = it.getCell(17)?.stringCellValue?.trim() csFloorSpace = it.getCell(18)?.numericCellValue?.toString() csConstructionArea = it.getCell(19)?.numericCellValue?.toString() csConstructionAreaPerMonth = it.getCell(20)?.numericCellValue?.toString() csEmployerUnit = it.getCell(21)?.stringCellValue?.trim() csEmployerContacts = it.getCell(22)?.stringCellValue?.trim() csEmployerContactsTel = it.getCell(23)?.stringCellValue?.trim() csConstructionUnit = it.getCell(24)?.stringCellValue?.trim() csConstructionContacts = it.getCell(25)?.stringCellValue?.trim() csConstructionContactsTel = it.getCell(26)?.stringCellValue?.trim() csSecurityOfficer = it.getCell(27)?.stringCellValue?.trim() csSecurityOfficerTel = it.getCell(28)?.stringCellValue?.trim() csProjectType = getCellValueToString(it.getCell(12)) csStatus = getCellValueToString(it.getCell(13)) siExtension1 = getCellValueToString(it.getCell(14)) csStartTime = getCellValueToString(it.getCell(15)) csEndTime = getCellValueToString(it.getCell(16)) csLeftTime = getCellValueToString(it.getCell(17)) csFloorSpace = getCellValueToString(it.getCell(18)) csConstructionArea = getCellValueToString(it.getCell(19)) csConstructionAreaPerMonth = getCellValueToString(it.getCell(20)) csEmployerUnit = getCellValueToString(it.getCell(21)) csEmployerContacts = getCellValueToString(it.getCell(22)) csEmployerContactsTel = getCellValueToString(it.getCell(23)) csConstructionUnit = getCellValueToString(it.getCell(24)) csConstructionContacts = getCellValueToString(it.getCell(25)) csConstructionContactsTel = getCellValueToString(it.getCell(26)) csSecurityOfficer = getCellValueToString(it.getCell(27)) csSecurityOfficerTel = getCellValueToString(it.getCell(28)) } } Constant.SceneType.TYPE2.value -> { @@ -145,7 +146,7 @@ result.add(data) } } catch (e: IllegalStateException) { throw BizException("excelæä»¶å 容éè¯¯ï¼æ°æ®è½¬æ¢å¤±è´¥ï¼", e) throw BizException(e.message, e) } return result } @@ -153,4 +154,16 @@ private fun errorStr(row: Int, col: Int, str: String): String { return "第${row}è¡ï¼ç¬¬${col}ååå æ ¼é误ï¼${str}" } private fun getCellValueToString(cell: Cell?): String { cell ?: return "" return when (cell.cellType) { CellType.STRING -> cell.stringCellValue.trim() CellType.NUMERIC -> cell.numericCellValue.toString().trim() CellType.BLANK -> cell.stringCellValue.trim() CellType.BOOLEAN -> cell.booleanCellValue.toString().trim() CellType.ERROR -> cell.errorCellValue.toString().trim() else -> throw BizException(errorStr(cell.rowIndex + 1, cell.columnIndex + 1, "åå æ ¼æ ¼å¼ä¸æ¯å¸¸è§æ ¼å¼ï¼æ æ³è¯å«")) } } } src/main/kotlin/cn/flightfeather/supervision/common/utils/FileUtil.kt
@@ -122,6 +122,7 @@ fos.write(b, 0, a) a = fis.read(b) } } } @@ -145,30 +146,21 @@ } /** * æç §åºå®å®½åº¦å缩å¾çè³base64å½¢å¼ * æç §è·¯å¾å»ºç«æä»¶å¤¹ï¼å¹¶èªå¨å¤çéå¤è·¯å¾ */ // fun compressImage2(bytes: ByteArray): String { // val length = 1440//å¾çé¿è¾¹åºå®å缩为1440åç´ // // val input = ByteArrayInputStream(bytes) // val srcImg = ImageIO.read(input) // var srcLong = 0 // var srcShort = 0 // if (srcImg.width <= srcImg.height) { // srcLong = srcImg.height // srcShort = srcImg.width // // } else { // // } // val scale = w.toFloat() / srcW // val h = (srcImg.height * scale).toInt() // // val buffImg = BufferedImage(w, h, BufferedImage.TYPE_INT_ARGB) // buffImg.graphics.drawImage(srcImg.getScaledInstance(w, h, Image.SCALE_SMOOTH), 0, 0, null) // val out = ByteArrayOutputStream() // ImageIO.write(buffImg, "PNG", out) // // return SCHEME_PNG + Base64.getEncoder().encodeToString(out.toByteArray()) // } fun mkDirs(basePath: String): File { var file = File(basePath) var i = 1 while (file.exists() && i <= 100) { val path = "$basePath($i)" file = File(path) i++ } if (file.exists()) { delAllFile(file.absolutePath) } else { file.mkdirs() } return file } } src/main/kotlin/cn/flightfeather/supervision/common/utils/StringUtil.kt
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,22 @@ package cn.flightfeather.supervision.common.utils /** * * @date 2026/1/20 * @author feiyu02 */ object StringUtil { /** * æ´æ°æ°åæç §æ¾ç¤ºä½æ°æ ¼å¼å * @param num æ°å * @param digit æ¾ç¤ºä½æ° */ fun numberFormat(num: Int?, digit: Int): String { var str = num.toString() while (str.length < digit) { str = "0$str" } return str } } src/main/kotlin/cn/flightfeather/supervision/config/RestExceptionHandler.kt
@@ -35,6 +35,7 @@ @ExceptionHandler(BizException::class) @ResponseStatus(HttpStatus.OK) fun bizException(e: BizException): BaseResponse<String> { e.printStackTrace() return BaseResponse.fail("200", e) } } src/main/kotlin/cn/flightfeather/supervision/domain/ds1/entity/Subtask.kt
@@ -11,7 +11,7 @@ @JsonInclude(JsonInclude.Include.NON_NULL) @Table(name = "tm_t_subtask") @ApiModel(value = "Subtask") public class Subtask { open class Subtask { @Id @Column(name = "ST_GUID") @ApiModelProperty(value = "主é®16ä½guid") src/main/kotlin/cn/flightfeather/supervision/lightshare/service/DataProductService.kt
@@ -1,6 +1,7 @@ package cn.flightfeather.supervision.lightshare.service import cn.flightfeather.supervision.lightshare.vo.AreaVo import cn.flightfeather.supervision.lightshare.vo.dataprod.QueryOpt import cn.flightfeather.supervision.model.dataproduct.DataProdOption import cn.flightfeather.supervision.model.dataproduct.PPListProbRecurrence import cn.flightfeather.supervision.model.dataproduct.PPListProblemChange @@ -27,4 +28,14 @@ * é®é¢å¤åæ åµ */ fun problemRecurrence(option: DataProdOption): List<PPListProbRecurrence> /** * æ¥è¯¢æ°æ®äº§åè®°å½ */ fun findProduct(queryOpt: QueryOpt, page: Int, perPage: Int) /** * çææ°æ®äº§å */ fun generateProduct(queryOpt: QueryOpt) } src/main/kotlin/cn/flightfeather/supervision/lightshare/service/MediafileService.kt
@@ -1,8 +1,10 @@ package cn.flightfeather.supervision.lightshare.service import cn.flightfeather.supervision.domain.ds1.entity.Mediafile import cn.flightfeather.supervision.lightshare.vo.ExcelConfigVo import cn.flightfeather.supervision.lightshare.vo.MediaFileVo import org.springframework.web.multipart.MultipartFile import javax.servlet.http.HttpServletResponse interface MediafileService { @@ -32,4 +34,6 @@ fun findBysubtaskbtid(id: String, btid: String): MutableList<Mediafile>? fun getRoutineRecord(iGuid: String?, stGuid: String?): List<Mediafile?> fun downloadPic(config: ExcelConfigVo, response: HttpServletResponse): HttpServletResponse } src/main/kotlin/cn/flightfeather/supervision/lightshare/service/ProblemlistService.kt
@@ -45,7 +45,7 @@ fun newProblem(problem: String, files: Array<MultipartFile>): String fun updateProblem(problem: ProblemListVo, deleteImg: List<String>, files: Array<MultipartFile>): String fun updateProblem(problem: ProblemListVo, deleteImg: List<String>?, files: Array<MultipartFile>): String fun changeProblem(problemId: String, files: Array<MultipartFile>): String src/main/kotlin/cn/flightfeather/supervision/lightshare/service/SubtaskService.kt
@@ -37,7 +37,7 @@ fun findByDayTaskID(taskId: String): List<SubtaskVo> fun findByDayTaskID(dayTaskId: String, userId: String, userType: String): List<Subtask> fun findByDayTaskID(dayTaskId: String, userId: String, userType: String): List<SubtaskVo> fun getTaskProgress(areaVo: AreaVo, userGuid: String): TaskVo src/main/kotlin/cn/flightfeather/supervision/lightshare/service/UserMapService.kt
@@ -39,4 +39,9 @@ * æç´¢ç¬¬ä¸æ¹è®¾å¤ */ fun searchThirdPartyDevice(areaVo: AreaVo, keyword: String, page: Int?, perPage: Int?): Pair<DataHead, List<DeviceSiteVo>> /** * åæ¥ä¸¤ä¸ªç³»ç»åºæ¯çä¸ä¸çº¿ç¶æ */ fun syncOnlineStatus() } src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/DataProductServiceImpl.kt
@@ -12,6 +12,7 @@ import cn.flightfeather.supervision.lightshare.service.DataProductService import cn.flightfeather.supervision.lightshare.vo.AreaVo import cn.flightfeather.supervision.lightshare.vo.ExcelConfigVo import cn.flightfeather.supervision.lightshare.vo.dataprod.QueryOpt import cn.flightfeather.supervision.model.dataproduct.DataProdOption import cn.flightfeather.supervision.model.dataproduct.PPListProbRecurrence import cn.flightfeather.supervision.model.dataproduct.PPListProblemChange @@ -112,4 +113,13 @@ } return res } override fun findProduct(queryOpt: QueryOpt, page: Int, perPage: Int) { // æ ¹æ®äº§åç±»åç¼å·ãåºåãæ¶æ®µãåºæ¯ç±»åãé ç½®idæ¥è¯¢ TODO("Not yet implemented") } override fun generateProduct(queryOpt: QueryOpt) { TODO("Not yet implemented") } } src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/MediafileServiceImpl.kt
@@ -1,17 +1,20 @@ package cn.flightfeather.supervision.lightshare.service.impl import cn.flightfeather.supervision.business.autooutput.datasource.AopDbMapper import cn.flightfeather.supervision.common.exception.BizException import cn.flightfeather.supervision.common.utils.* import cn.flightfeather.supervision.domain.ds1.entity.Mediafile 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.entity.Inspection import cn.flightfeather.supervision.domain.ds1.entity.Subtask import cn.flightfeather.supervision.domain.ds1.repository.InspectionRep import cn.flightfeather.supervision.domain.ds1.repository.MediaFileRep import cn.flightfeather.supervision.domain.ds1.repository.SceneRep import cn.flightfeather.supervision.domain.ds1.repository.SubTaskRep import cn.flightfeather.supervision.lightshare.service.DomainitemService import cn.flightfeather.supervision.lightshare.service.MediafileService import cn.flightfeather.supervision.lightshare.vo.AreaVo import cn.flightfeather.supervision.lightshare.vo.ExcelConfigVo import cn.flightfeather.supervision.lightshare.vo.MediaFileVo import com.fasterxml.jackson.core.type.TypeReference import org.springframework.beans.BeanUtils @@ -21,7 +24,15 @@ import org.slf4j.Logger import org.slf4j.LoggerFactory import org.springframework.beans.factory.annotation.Value import tk.mybatis.mapper.entity.Example import java.io.File import java.io.FileInputStream import java.io.FileOutputStream import java.nio.charset.StandardCharsets import java.time.LocalDateTime import java.time.ZoneId import java.util.* import javax.servlet.http.HttpServletResponse @Service @@ -32,6 +43,7 @@ private val subTaskRep: SubTaskRep, private val sceneRep: SceneRep, private val domainItemService: DomainitemService, private val dbMapper: AopDbMapper, @Value("\${filePath}") var filePath: String, @Value("\${imgPath}") var imgPath: String, ) : MediafileService { @@ -98,7 +110,9 @@ mapper.readValue<List<MediaFileVo>>(mediafileVoList, object : TypeReference<List<MediaFileVo>>() {}) if (mediaFileVos.isNotEmpty()) { mediaFileVos.forEach { mediaFileVos.forEachIndexed { i, it -> if (i >= files.size) return@forEachIndexed val mediafile = Mediafile() BeanUtils.copyProperties(it, mediafile) @@ -108,17 +122,15 @@ if (reme == null) { mediafileMapper.insert(mediafile) } } //æ ¹æ®æ©å±å段1è·åä¿åè·¯å¾ val path = mediaFileVos[0].extension1 for (image in files) { val fileName = image.originalFilename //æ ¹æ®æ©å±å段1è·åä¿åè·¯å¾ val path = it.extension1 val fileName = it.guid + ".jpg" val image = files[i] val filePath = "${imgPath}/$path/" try { //è°ç¨æä»¶ä¿åæ¹æ³ FileUtil.uploadFile(image.bytes, filePath, fileName!!) FileUtil.uploadFile(image.bytes, filePath, fileName) } catch (e: Exception) { // TODO: handle exception } @@ -198,4 +210,97 @@ } return res } override fun downloadPic(config: ExcelConfigVo, response: HttpServletResponse): HttpServletResponse { val subSum = dbMapper.subtaskMapper.getSummaryByArea(AreaVo().apply { provincecode = config.provinceCode citycode = config.cityCode districtcode = config.districtCode starttime = LocalDateTime.ofInstant(config.startTime?.toInstant(), ZoneId.systemDefault()) endtime = LocalDateTime.ofInstant(config.endTime?.toInstant(), ZoneId.systemDefault()) scensetypeid = config.sceneType.toString() }) if (subSum.isEmpty()) return response val mediaList = mediafileMapper.selectByExample(Example(Mediafile::class.java).apply { createCriteria().andIn("iguid", subSum.map { it.insGuid }) .apply { if (!config.fileType.isNullOrEmpty()) { andIn("businesstypeid", config.fileType) } } }) //建ç«ç¬¬ä¸å±ç®å½ï¼å 嫿æçä»»å¡ val time = DateUtil.DateToString(Date(), "yyyy-MM-dd_HH-mm-ss") val basePath = imgPath + File.separator + "temp" + File.separator + time FileUtil.mkDirs(basePath) //循ç¯å»ºç«ç¬¬äºå±ç®å½ï¼æç §æ¥æåç±» subSum.groupBy { it.stPlanTime }.forEach { (date, sList) -> //建ç«ä¸ä¸ªæ¥ææä»¶å¤¹ val datePath = "${basePath}${File.separator}${DateUtil.DateToString(date, DateUtil.DateStyle.YYYY_MM_DD)}" FileUtil.mkDirs(datePath) //循ç¯å»ºç«ç¬¬ä¸å±ç®å½ï¼æç §å·¡æ¥ä»»å¡åç±» sList.forEach {s -> //建ç«ä¸ä¸ªå任塿件夹 val subTaskFilePath = "${datePath}${File.separator}${StringUtil.numberFormat(s.sceneIndex, 3)} ${s.sceneName}" FileUtil.mkDirs(subTaskFilePath) //循ç¯å»ºç«ç¬¬åå±ç®å½ï¼æç §å¾çç±»ååç±» mediaList.filter { m-> m.iguid == s.insGuid }.groupBy { m-> m.businesstype }.forEach { (type, mList) -> val mediaTypeFilePath = "${subTaskFilePath}${File.separator}${type}" FileUtil.mkDirs(mediaTypeFilePath) // åå ¥å¾ç mList.forEachIndexed { i, m-> val fromPicName = m.guid + ".jpg" val picPath = imgPath + File.separator + m.extension1 + fromPicName val fromFile = File(picPath) val picName = if (m.description != null) { m.description!!.replace("/", "-") .replace("\\", "-") .replace("\n", "") .replace(".", "(${i + 1}).") } else { fromPicName } // val picName = fromPicName val toFile = File(mediaTypeFilePath + File.separator + picName) if (fromFile.exists()) { FileUtil.copy(fromFile, toFile) } } } } } response.apply { setHeader("Content-Disposition", "attachment;filename=$time.zip") contentType = "application/octet-stream" characterEncoding = StandardCharsets.UTF_8.name() } val zipFile = File("$basePath.zip") val fos1 = FileOutputStream(zipFile) ZipUtils.toZip(basePath, fos1, true) val out = response.outputStream val fis = FileInputStream(zipFile) val buf = ByteArray(2 * 1024) var len = fis.read(buf) while (len != -1) { out.write(buf, 0, len) len = fis.read(buf) } out.flush() out.close() fis.close() fos1.close() return response } } src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/ProblemlistServiceImpl.kt
@@ -555,13 +555,13 @@ return "success" } override fun updateProblem(problem: ProblemListVo, deleteImg: List<String>, files: Array<MultipartFile>): String { override fun updateProblem(problem: ProblemListVo, deleteImg: List<String>?, files: Array<MultipartFile>): String { problemRep.findOne(problem.guid) ?: throw BizException("该é®é¢ä¸åå¨") problemRep.update(problem) val inspection = inspectionMapper.selectByPrimaryKey(problem.iguid) ?: throw BizException("å·¡æ¥è®°å½ä¸åå¨") val scene = scenseMapper.selectByPrimaryKey(inspection.sguid) ?: throw BizException("å·¡æ¥è®°å½å¯¹åºåºæ¯ä¸åå¨") mediafileService.saveMediaFile(files) { MediaFileVo.newProFile(inspection, problem, scene) } mediafileService.deleteList(deleteImg) deleteImg?.let { mediafileService.deleteList(it) } return "success" } @@ -615,9 +615,10 @@ val mediaFiles = mediafileMapper.selectByExample(Example(Mediafile::class.java).apply { createCriteria().andEqualTo("businessguid", problemId) .andEqualTo("businesstypeid", 1) .andEqualTo("ischanged", true) // .andEqualTo("ischanged", true) }) if (mediaFiles.isEmpty()) throw BizException("é®é¢è¿æªæ´æ¹ï¼æ æ³ä¿®æ¹æ´æ¹") if (mediaFiles.isEmpty()) throw BizException("缺å°é®é¢åæ´æ¹å¾çï¼æ æ³ä¿®æ¹") if (p.ischanged != true) throw BizException("æªæ´æ¹é®é¢æ æ³ä¿®æ¹") // ä¿åæ°çæ´æ¹å¾ç val m = mediaFiles[0] @@ -626,6 +627,7 @@ m.apply { guid = UUIDGenerator.generate16ShortUUID() description = p.problemname + " " + p.location + " æ´æ¹ " + UUIDGenerator.generateUUID(4) + ".jpg" ischanged = true } } mediafileService.deleteList(deleteImg) src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/SubtaskServiceImpl.kt
@@ -1,7 +1,6 @@ package cn.flightfeather.supervision.lightshare.service.impl import cn.flightfeather.supervision.business.autooutput.score.AopEvaluation import cn.flightfeather.supervision.common.exception.BizException import cn.flightfeather.supervision.domain.ds1.entity.* import cn.flightfeather.supervision.domain.ds1.mapper.* import cn.flightfeather.supervision.common.utils.Constant @@ -104,7 +103,7 @@ return subtaskVoList } override fun findByDayTaskID(dayTaskId: String, userId: String, userType: String): List<Subtask> { override fun findByDayTaskID(dayTaskId: String, userId: String, userType: String): List<SubtaskVo> { val example = Example(Subtask::class.java) val criteria = example.createCriteria() criteria.andEqualTo("tsguid", dayTaskId) @@ -115,25 +114,31 @@ ) } example.orderBy("name") val result = subtaskMapper.selectByExample(example).apply { forEach breaking@{ //å·²å®¡æ ¸æç¤º it.remark = Constant.PROBLEM_CHECK_PASS problemlistMapper.selectByExample(Example(Problemlist::class.java).apply { createCriteria().andEqualTo("stguid", it.stguid) and( createCriteria().orIsNull("remark") .orNotEqualTo("remark", Constant.PROBLEM_DELETED) ) }).forEach { problem -> //åä»»å¡ä¸æé®é¢æªå®¡æ ¸æ¶ï¼è®¾ç½®æªå®¡æ ¸æç¤º if (problem.extension3 == Constant.PROBLEM_UNCHECKED) { it.remark = Constant.PROBLEM_UNCHECKED return@breaking } val result = subtaskMapper.selectByExample(example).map { val vo = SubtaskVo() BeanUtils.copyProperties(it, vo) vo }.onEach { //å·²å®¡æ ¸æç¤º it.remark = Constant.PROBLEM_CHECK_PASS problemlistMapper.selectByExample(Example(Problemlist::class.java).apply { createCriteria().andEqualTo("stguid", it.stguid) and( createCriteria().orIsNull("remark") .orNotEqualTo("remark", Constant.PROBLEM_DELETED) ) }).forEach { problem -> //åä»»å¡ä¸æé®é¢æªå®¡æ ¸æ¶ï¼è®¾ç½®æªå®¡æ ¸æç¤º if (problem.extension3 == Constant.PROBLEM_UNCHECKED) { it.remark = Constant.PROBLEM_UNCHECKED } } // åºæ¯ç±»å scenseMapper.selectByPrimaryKey(it.scenseid)?.let { s-> it.sceneTypeId = s.typeid it.sceneTypeName = s.type } } return result } src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/TaskServiceImpl.kt
@@ -337,11 +337,14 @@ // è·åæ»ä»»å¡ä¸ææçåä»»å¡ val subTasks = subTaskRep.findAll(Subtask().apply { tguid = taskId }) if (subTasks.isEmpty()) return emptyList() // è·åææå任塿¶åçå·¡æ¥åºæ¯ä¿¡æ¯ val sceneList = scenseMapper.selectByExample(Example(Scense::class.java).apply { createCriteria().andIn("guid", subTasks.map { it?.scenseid }) }) val sceneList = if (subTasks.isEmpty()) { emptyList() } else { scenseMapper.selectByExample(Example(Scense::class.java).apply { createCriteria().andIn("guid", subTasks.map { it?.scenseid }) }) } //æ ¹æ®sqlæ¡ä»¶æ¥è¯¢ dayTasks.forEach { t -> @@ -377,7 +380,7 @@ val userProgressMap = mutableMapOf<String, ProgressPerUserPerDay>() filterSubTasks.forEach fst@{ fst -> fst ?: return@fst // fixme 2025.11.30 ç±äºç管APPçbugï¼å¯¼è´ç¨æ·å¯ä»¥ä¸éæ©æ§è¡äººåç´æ¥å建任å¡ï¼æä»¥ææ¶å°æ²¡ææ§è¡äººåçä»»å¡å®ä¹ä¸ºå¿åç¨æ· // 2026.2.2 å°æ²¡ææ§è¡äººåçä»»å¡å®ä¹ä¸ºå¿åç¨æ· if (fst.executorguids.isNullOrBlank()) { fst.executorguids = "niming" fst.executorusernames = "niming" @@ -400,8 +403,8 @@ // å½å¤ä¸ªäººä¸èµ·æ§è¡åä¸ä»»å¡æ¶ï¼å¹³åå·¡æ¥é this.totalTaskNum += 1.0 / ids.size if (fst.status == Constant.TaskProgress.RUNINGSTATUS3.text) { this.completeTaskNum += 1.0 / ids.size } this.completeTaskNum += 1.0 / ids.size // åäººæ´æ¹ç累计ï¼è¯åï¼ this.totalProblemNum += proList.size.toDouble() / ids.size @@ -741,7 +744,7 @@ override fun create(task: Task): Task { val res = save(task) if (res < 1) throw BizException("ä»»å¡å建失败") throw BizException("æ»ä»»å¡æå½æ¥ä»»å¡å建失败") else return task } src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/UserMapServiceImpl.kt
@@ -164,4 +164,8 @@ ): Pair<DataHead, List<DeviceSiteVo>> { return aopDataDeviceMap.searchDevice(areaVo, keyword, page ?: 1, perPage ?: 30) } override fun syncOnlineStatus() { TODO("Not yet implemented") } } src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/ExcelConfigVo.kt
@@ -30,4 +30,7 @@ // å³å®æ¯å¦ç»è®¡æ»ä»»å¡ä¸ææçåºæ¯æåªç»è®¡çéåºçåä»»å¡å¯¹åºçåºæ¯ var allScene: Boolean = true, // åªä½æä»¶çç±»å var fileType: List<Int>? = null, ) src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/SubtaskVo.kt
@@ -1,122 +1,16 @@ package cn.flightfeather.supervision.lightshare.vo import cn.flightfeather.supervision.domain.ds1.entity.Subtask import com.fasterxml.jackson.annotation.JsonInclude import java.util.* @JsonInclude(JsonInclude.Include.NON_NULL) public class SubtaskVo { var stguid: String? = null class SubtaskVo : Subtask() { /** * æä»»å¡æå ¶ä»é¡¶å±ä»»å¡ï¼ä¸ä¸ºç©º */ var tguid: String? = null var sceneTypeId: Byte? = null /** * æå±æ¥çT_GUIDï¼å¯ä¸ºç©º */ var tsguid: String? = null var name: String? = null var priority: Boolean? = null var typeno: Byte? = null var type: String? = null var provincecode: String? = null var provincename: String? = null var citycode: String? = null var cityname: String? = null var districtcode: String? = null var districtname: String? = null var towncode: String? = null var townname: String? = null var scensename: String? = null var scenseid: String? = null var scenseTypeId: String? = null var scenseaddress: String? = null var deadlinetype: String? = null var planstarttime: Date? = null var sceneTypeName: String? = null var planstarttimestr: String? = null var planendtime: Date? = null var planendtimestr: String? = null var deployerguid: String? = null var deployerusername: String? = null var deployerrealname: String? = null var deploytime: Date? = null var executionstarttime: Date? = null var executionendtime: Date? = null var executorguids: String? = null var executorusernames: String? = null /** * ä¸ç¨æ·è¡¨ç¨æ·åå ³è,ç¨â&âè¿æ¥å¤äººï¼ä¾å¦ï¼å¼ ä¸&æå&çäº */ var executorrealtimes: String? = null /** * æªæ§è¡ãæ£å¨æ§è¡ãå·²ç»æ */ var status: String? = null var notifedcount: Int? = null /** * ER_GUIDçéåï¼å¤ä¸ªæ¶â,âåå²ï¼èªå¨å¹é åºæ¯ï¼åç±»åºæ¯å¤ä¸ªèæ ¸è§èæ¶ï¼ç°åºå·¡æ¥æ¶ï¼å¯åéæå¤éã */ var rulelist: String? = null var stAssessorguid: String? = null var assessorusername: String? = null var assessorrealname: String? = null var assesstime: Date? = null var assessresult: String? = null var thirdassessorguid: String? = null var thirdassessorusername: String? = null var thirdassessorrealname: String? = null var thirdassesstime: Date? = null var thirdassessresult: String? = 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/dataprod/QueryOpt.kt
@@ -11,7 +11,13 @@ * @author feiyu02 */ @ApiModel("æ¥è¯¢åæ°") class QueryOpt { open class QueryOpt { @ApiModelProperty("产åç¼å·") var prodId: String? = null @ApiModelProperty("é ç½®ç¼å·", notes = "0表示æªä½¿ç¨é ç½®çèªå®ä¹æ¶æ®µäº§å") var configId: Int = 0 @ApiModelProperty("æ»ä»»å¡id") var topTaskId: String? = null src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/dataprod/QueryOptSingle.kt
@@ -1,9 +1,7 @@ package cn.flightfeather.supervision.lightshare.vo.dataprod import com.fasterxml.jackson.annotation.JsonFormat import io.swagger.annotations.ApiModel import io.swagger.annotations.ApiModelProperty import java.time.LocalDateTime /** * åä¸ªåºæ¯çºµåæ°æ®ç»è®¡äº§åæ¥è¯¢æ¡ä»¶ @@ -11,16 +9,8 @@ * @author feiyu02 */ @ApiModel("åä¸ªåºæ¯çºµåæ°æ®ç»è®¡äº§åæ¥è¯¢æ¡ä»¶") class QueryOptSingle { class QueryOptSingle : QueryOpt() { @ApiModelProperty("åºæ¯id") var sceneId: String? = null @ApiModelProperty("èµ·å§æ¶é´ï¼æ ¼å¼ yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") var startTime: LocalDateTime? = null @ApiModelProperty("ç»ææ¶é´ï¼æ ¼å¼ yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") var endTime: LocalDateTime? = null } src/main/kotlin/cn/flightfeather/supervision/lightshare/web/DataProductController.kt
@@ -3,6 +3,7 @@ import cn.flightfeather.supervision.lightshare.service.DataProductService import cn.flightfeather.supervision.lightshare.vo.AreaVo import cn.flightfeather.supervision.lightshare.vo.ExcelConfigVo import cn.flightfeather.supervision.lightshare.vo.dataprod.QueryOpt import cn.flightfeather.supervision.model.dataproduct.DataProdOption import io.swagger.annotations.Api import io.swagger.annotations.ApiOperation @@ -42,4 +43,32 @@ fun problemRecurrence( @ApiParam("æ¥è¯¢æ¡ä»¶") @RequestBody option: DataProdOption, ) = dataProductService.problemRecurrence(option) @ApiOperation(value = "æ¥è¯¢æ°æ®äº§å项å对åºçç»è®¡ç¶æ") @GetMapping("/type/query") fun findProductType( @ApiParam("产åç±»å", allowableValues = "base, middle, final", format = "base") @RequestParam types: String, ) { } @ApiOperation(value = "æ¥è¯¢æ°æ®äº§åè®°å½") @PostMapping("/record/query") fun findProduct( @ApiParam("æ¥è¯¢æ¡ä»¶") @RequestBody queryOpt: QueryOpt, @ApiParam("页ç ") @RequestParam(value = "page", required = false, defaultValue = "1") page: Int?, @ApiParam("åé¡µæ°æ®é") @RequestParam(value = "perPage", required = false, defaultValue = "30") perPage: Int?, ) { // æ ¹æ®äº§åç±»åç¼å·ãåºåãæ¶æ®µãåºæ¯ç±»åãé ç½®idæ¥è¯¢ return dataProductService.findProduct(queryOpt, page ?: 1, perPage ?: 30) } // @ApiOperation(value = "çææ°æ®äº§å") // @PostMapping("/generate") // fun generateProduct() = dataProductService.generateProduct() } src/main/kotlin/cn/flightfeather/supervision/lightshare/web/MediafileController.kt
@@ -3,11 +3,14 @@ import cn.flightfeather.supervision.config.IgnoreResponseAdvice import cn.flightfeather.supervision.domain.ds1.entity.Mediafile import cn.flightfeather.supervision.lightshare.service.MediafileService import cn.flightfeather.supervision.lightshare.vo.ExcelConfigVo import io.swagger.annotations.Api import io.swagger.annotations.ApiOperation import io.swagger.annotations.ApiParam import org.springframework.web.bind.annotation.* import org.springframework.web.multipart.MultipartFile import springfox.documentation.annotations.ApiIgnore import javax.servlet.http.HttpServletResponse @Api(tags = ["MediafileController"], description = "å¤åªä½æä»¶APIæ¥å£") @RestController @@ -56,4 +59,12 @@ @ApiParam("å·¡æ¥è®°å½id", required = false) @RequestParam(required = false) iGuid: String?, @ApiParam("å·¡æ¥ä»»å¡id", required = false) @RequestParam(required = false) stGuid: String?, ) = mediafileService.getRoutineRecord(iGuid, stGuid) @IgnoreResponseAdvice @ApiOperation("ä¸è½½å¾ç") @PostMapping("/pic/download") fun downloadPic( @RequestBody config: ExcelConfigVo, @ApiIgnore response: HttpServletResponse ) = mediafileService.downloadPic(config, response) } src/main/kotlin/cn/flightfeather/supervision/lightshare/web/ProblemlistController.kt
@@ -127,7 +127,7 @@ @PostMapping("/updateProblem") fun updateProblem( @ApiParam("é®é¢ä¿¡æ¯json") @RequestParam("problem") problem: String, @ApiParam("å é¤çé®é¢å¾çid") @RequestParam("deleteImg") deleteImg: List<String>, @ApiParam("å é¤çé®é¢å¾çid") @RequestParam("deleteImg", required = false) deleteImg: List<String>?, @ApiParam("é®é¢å¾ç") @RequestPart("images") images: Array<MultipartFile>, ): String { val problemVo = ObjectMapper().readValue(problem, object : TypeReference<ProblemListVo>() {}) src/main/resources/application-pro-https.yml
@@ -15,6 +15,12 @@ configuration: log-impl: org.apache.ibatis.logging.nologging.NoLoggingImpl springfox: documentation: swagger: v2: enabled: true imgPath: D:/02product/04supervision/images/ filePath: D:/02product/04supervision/files/ mode: prohttps src/test/kotlin/cn/flightfeather/supervision/CommonTest.kt
@@ -22,12 +22,8 @@ @Test fun findStr() { val str = "http://114.233.144.555:9006/asdasd/asdasd" val url = str.split("://")[1].split("/")[0] val newStr = str.replace(url, "224.55.2.12:8085") // val i1 = str.indexOf("://") // val i2 = str.indexOf("/") println(str) println(newStr) val m = "cOm7.jpg" val m1 = m.replace("/", "-").replace(".", "(${0 + 1}).") println(m1) } }