¶Ô±ÈÐÂÎļþ |
| | |
| | | package cn.flightfeather.supervision.business.location |
| | | |
| | | /** |
| | | * |
| | | * @date 2024/10/24 |
| | | * @author feiyu02 |
| | | */ |
| | | data class BasePlace( |
| | | val name: String, |
| | | val sP: Pair<Double, Double>, |
| | | val eP: Pair<Double, Double>, |
| | | ) |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package cn.flightfeather.supervision.business.location |
| | | |
| | | import cn.flightfeather.supervision.common.utils.ExcelUtil |
| | | import cn.flightfeather.supervision.domain.ds1.entity.Scense |
| | | import cn.flightfeather.supervision.domain.ds1.mapper.ScenseMapper |
| | | import org.springframework.stereotype.Component |
| | | import tk.mybatis.mapper.entity.Example |
| | | import kotlin.math.round |
| | | |
| | | /** |
| | | * è·ç¦»è®¡ç® |
| | | * @date 2024/10/24 |
| | | * @author feiyu02 |
| | | */ |
| | | @Component |
| | | class LocationDistance(private val scenseMapper: ScenseMapper) { |
| | | |
| | | private val utilFile = UtilExcelDistance(mutableListOf( |
| | | listOf( |
| | | ExcelUtil.MyCell("çæµç¹", colSpan = 1), |
| | | ExcelUtil.MyCell("è·ç¦»ï¼å
¬éï¼", colSpan = 1), |
| | | ExcelUtil.MyCell("å¯ä¸åºå·", colSpan = 1), |
| | | ExcelUtil.MyCell("åä½åç§°", colSpan = 1), |
| | | ExcelUtil.MyCell("ç±»å", colSpan = 1), |
| | | ExcelUtil.MyCell("åä½å°å", colSpan = 1), |
| | | ExcelUtil.MyCell("ç»åº¦", colSpan = 1), |
| | | ExcelUtil.MyCell("纬度", colSpan = 1), |
| | | ExcelUtil.MyCell("åºå¿", colSpan = 1), |
| | | ExcelUtil.MyCell("è¡é", colSpan = 1), |
| | | ExcelUtil.MyCell("常ç¨è系人", colSpan = 1), |
| | | ExcelUtil.MyCell("èç³»æ¹å¼", colSpan = 1), |
| | | ).toTypedArray() |
| | | )) |
| | | |
| | | fun searchList(pList: List<BasePlace>, districtName: String) { |
| | | utilFile.reset() |
| | | pList.forEach { |
| | | val sceneList = findScenes(districtName) |
| | | if (sceneList.isEmpty()) { |
| | | utilFile.addRow(listOf(it.name)) |
| | | } |
| | | sceneList.forEachIndexed { index, s -> |
| | | var distance = CoordinateUtil.calculateDistance( |
| | | it.sP.first, it.sP.second, |
| | | s.longitude?.toDouble() ?: .0, s.latitude?.toDouble() ?: .0 |
| | | ) |
| | | distance = round(distance * 1000) / 1000 |
| | | utilFile.parseRow(listOf<Any>( |
| | | "", |
| | | distance, |
| | | s.index?.toDouble() ?: "", |
| | | s.name ?: "", |
| | | s.type ?: "", |
| | | s.location ?: "", |
| | | s.longitude?.toDouble() ?: .0, |
| | | s.latitude?.toDouble() ?: .0, |
| | | s.districtname ?: "", |
| | | s.townname ?: "", |
| | | s.contacts ?: "", |
| | | s.contactst ?: "" |
| | | ).toTypedArray()) |
| | | if (index == 0) { |
| | | utilFile.updateLastRow(0, ExcelUtil.MyCell(it.name, sceneList.size)) |
| | | } |
| | | } |
| | | utilFile.index = 1 |
| | | } |
| | | utilFile.outPutToFile(districtName) |
| | | } |
| | | |
| | | private fun findScenes(districtName: String): List<Scense> { |
| | | return scenseMapper.selectByExample(Example(Scense::class.java).apply { |
| | | createCriteria().andEqualTo("districtname", districtName) |
| | | and(createCriteria().orNotEqualTo("extension1", "0") |
| | | .orIsNull("extension1")) |
| | | }) |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package cn.flightfeather.supervision.business.location |
| | | |
| | | import cn.flightfeather.supervision.common.utils.DateUtil |
| | | import cn.flightfeather.supervision.common.utils.ExcelUtil |
| | | import cn.flightfeather.supervision.domain.ds1.entity.Scense |
| | | import org.apache.poi.hssf.usermodel.HSSFWorkbook |
| | | import java.io.File |
| | | import java.io.FileOutputStream |
| | | import java.util.* |
| | | |
| | | /** |
| | | * |
| | | * @date 2024/10/24 |
| | | * @author feiyu02 |
| | | */ |
| | | class UtilExcelDistance(head: List<Array<Any>>) { |
| | | |
| | | private val heads = mutableListOf<Array<Any>>() |
| | | private val contents = mutableListOf<Array<Any>>() |
| | | var index = 1 |
| | | |
| | | init { |
| | | heads.addAll(head) |
| | | } |
| | | |
| | | fun reset() { |
| | | index = 1 |
| | | contents.clear() |
| | | } |
| | | |
| | | fun addRow(row: List<Any>) { |
| | | contents.add(row.toTypedArray()) |
| | | } |
| | | |
| | | fun updateLastRow(index: Int, cell: Any) { |
| | | contents.last()[index] = cell |
| | | } |
| | | |
| | | /** |
| | | * çæä¸è¡excelæ°æ® |
| | | */ |
| | | fun parseRow(row: Array<Any>) { |
| | | contents.add(row) |
| | | index++ |
| | | } |
| | | |
| | | fun outPutToFile(districtName: String) { |
| | | val workbook = HSSFWorkbook() |
| | | val fileName = "${districtName}ç¹ä½è·å½æ§ç¹è·ç¦»-${DateUtil.DateToString(Date(), "yyyy-MM-ddhhmmss")}.xls" |
| | | val filePath = "C:\\work\\å·¥ä½\\ç¬¬ä¸æ¹ç管\\ç¹ä½è·å½æ§ç¹è·ç¦»\\$fileName" |
| | | val file = File(filePath) |
| | | if (!file.parentFile.exists()) { |
| | | file.parentFile.mkdirs() |
| | | } |
| | | val out = FileOutputStream(file) |
| | | ExcelUtil.write(heads, contents, workbook) |
| | | workbook.write(out) |
| | | workbook.close() |
| | | out.flush() |
| | | out.close() |
| | | } |
| | | } |
| | |
| | | import java.io.FileOutputStream |
| | | import java.util.* |
| | | |
| | | class UtilFile { |
| | | class UtilFile(head: List<ExcelUtil.MyCell>? = null) { |
| | | |
| | | private val heads = mutableListOf<Array<Any>>() |
| | | private val contents = mutableListOf<Array<Any>>() |
| | |
| | | // ExcelUtil.MyCell("宿³èªæµèªè¯", colSpan = 3), |
| | | // ExcelUtil.MyCell("线ä¸ç管综åé£é©åæä¸å¯¹ç", colSpan = 3), |
| | | // ) |
| | | val h2 = listOf( |
| | | val h2 = head ?: listOf( |
| | | ExcelUtil.MyCell("路段", colSpan = 1), |
| | | ExcelUtil.MyCell("åºå·", colSpan = 1), |
| | | ExcelUtil.MyCell("åä½åç§°", colSpan = 1), |
| | |
| | | // excelææ¡£ |
| | | private var workbook = HSSFWorkbook() |
| | | |
| | | fun getReportName(): String = "${dataSource.areaName()}-${fileName}.xls" |
| | | fun getReportName(): String = "${dataSource.areaName()}-${fileName}.xlsx" |
| | | |
| | | fun toFile(path: String) { |
| | | val fileName = getReportName() |
| | |
| | | val c = mutableListOf<Array<Any>>() |
| | | head.forEach { h.add(it.toTypedArray()) } |
| | | contents.forEach { c.add(it.toTypedArray()) } |
| | | val index = c[0][0] |
| | | //æç
§ç¬¬ä¸åè¿è¡æåº |
| | | if (index is Int) { |
| | | c.sortBy { |
| | | if (it[0] is Int) { |
| | | it[0] as Int |
| | | } else { |
| | | 0 |
| | | if (c.isNotEmpty() && c[0].isNotEmpty()) { |
| | | val index = c[0][0] |
| | | //æç
§ç¬¬ä¸åè¿è¡æåº |
| | | if (index is Int) { |
| | | c.sortBy { |
| | | if (it[0] is Int) { |
| | | it[0] as Int |
| | | } else { |
| | | 0 |
| | | } |
| | | } |
| | | } |
| | | } else { |
| | | c.sortBy { |
| | | it[0].toString() |
| | | } else { |
| | | c.sortBy { |
| | | it[0].toString() |
| | | } |
| | | } |
| | | } |
| | | return Pair(h, c) |
| | |
| | | contents.forEach { |
| | | c.add(it.toTypedArray()) |
| | | } |
| | | val index = c[0][0] |
| | | //æç
§ç¬¬ä¸åè¿è¡æåº |
| | | if (index is Int) { |
| | | c.sortBy { |
| | | if (it[0] is Int) { |
| | | it[0] as Int |
| | | } else { |
| | | 0 |
| | | if (c.isNotEmpty() && c[0].isNotEmpty()) { |
| | | val index = c[0][0] |
| | | //æç
§ç¬¬ä¸åè¿è¡æåº |
| | | if (index is Int) { |
| | | c.sortBy { |
| | | if (it[0] is Int) { |
| | | it[0] as Int |
| | | } else { |
| | | 0 |
| | | } |
| | | } |
| | | } |
| | | } else { |
| | | c.sortBy { |
| | | it[0].toString() |
| | | } else { |
| | | c.sortBy { |
| | | it[0].toString() |
| | | } |
| | | } |
| | | } |
| | | return Pair(h, c) |
| | |
| | | */ |
| | | fun reset() { |
| | | rowData.index = 0 |
| | | rowData.subTask = sourceList.first() |
| | | rowData.subTask = if (sourceList.isEmpty()) null else sourceList.first() |
| | | rowData.clear() |
| | | } |
| | | |
| | |
| | | })?.takeIf { it.isNotEmpty() }?.get(0)?.let { area = it.townname ?: "" } |
| | | } |
| | | |
| | | dbMapper.taskMapper.selectByPrimaryKey(config.topTaskGuid).let { |
| | | dbMapper.taskMapper.selectByPrimaryKey(config.topTaskGuid)?.let { |
| | | val time = LocalDateTime.ofInstant(it.starttime?.toInstant(), ZoneId.systemDefault()) |
| | | this.year = time.year |
| | | this.month = time.monthValue |
| | |
| | | } |
| | | |
| | | //1. æ¥æ¾ç¹å®çå·¡æ¥ä»»å¡æè
ææç计åå·¡æ¥ä»»å¡ |
| | | var taskSceneIdList = listOf<String>() |
| | | val subTaskList = if (config.subTaskIdList?.isNotEmpty() == true) { |
| | | dbMapper.subtaskMapper.selectByExample(Example(Subtask::class.java).apply { |
| | | createCriteria().apply { |
| | | andIn("stguid", config.subTaskIdList) |
| | | config.startTime?.let { andGreaterThanOrEqualTo("planstarttime", it) } |
| | | config.endTime?.let { andLessThanOrEqualTo("planendtime", it) } |
| | | config.districtCode?.let { andEqualTo("districtcode", it) } |
| | | // andEqualTo("tguid", config.topTaskGuid) |
| | | } |
| | | }) |
| | | } else { |
| | | taskSceneIdList = dbMapper.scenseMapper.getSceneByType(config.topTaskGuid, config |
| | | .sceneType, config.townCode).map { it.guid ?: "" } |
| | | dbMapper.subtaskMapper.selectByExample(Example(Subtask::class.java).apply { |
| | | val taskSceneIdList = dbMapper.scenseMapper.getSceneByType(config.topTaskGuid, config.sceneType, |
| | | config.townCode).map { it.guid ?: "" } |
| | | |
| | | // ç»è®¡æ»ä»»å¡ä¸ææåºæ¯ |
| | | if (config.allScene) { |
| | | val subTaskList = dbMapper.subtaskMapper.selectByExample(Example(Subtask::class.java).apply { |
| | | createCriteria().apply { |
| | | if (taskSceneIdList.isNotEmpty()) andIn("scenseid", taskSceneIdList) |
| | | }.andEqualTo("tguid", config.topTaskGuid) |
| | | }) |
| | | } |
| | | |
| | | if (taskSceneIdList.isNotEmpty()) { |
| | | taskSceneIdList.forEach { |
| | | var subtask: Subtask? = null |
| | | for (s in subTaskList) { |
| | | if (s.scenseid == it) { |
| | | subtask = s |
| | | result.add(s) |
| | | // ç»è¿æªå·¡æ¥çåºæ¯çæç©ºçåä»»å¡å¯¹è±¡ |
| | | if (taskSceneIdList.isNotEmpty()) { |
| | | taskSceneIdList.forEach { |
| | | var subtask: Subtask? = null |
| | | for (s in subTaskList) { |
| | | if (s.scenseid == it) { |
| | | subtask = s |
| | | result.add(s) |
| | | } |
| | | } |
| | | if (subtask == null) { |
| | | result.add(Subtask().apply { scenseid = it }) |
| | | } |
| | | } |
| | | if (subtask == null) { |
| | | result.add(Subtask().apply { scenseid = it }) |
| | | } |
| | | } else { |
| | | result.addAll(subTaskList) |
| | | } |
| | | } else { |
| | | } |
| | | else { |
| | | val subTaskList = dbMapper.subtaskMapper.selectByExample(Example(Subtask::class.java).apply { |
| | | createCriteria().apply { |
| | | if (config.subTaskIdList?.isNotEmpty() == true) andIn("stguid", config.subTaskIdList) |
| | | config.startTime?.let { andGreaterThanOrEqualTo("planstarttime", it) } |
| | | config.endTime?.let { andLessThanOrEqualTo("planendtime", it) } |
| | | config.districtCode?.let { andEqualTo("districtcode", it) } |
| | | andEqualTo("tguid", config.topTaskGuid) |
| | | } |
| | | }) |
| | | result.addAll(subTaskList) |
| | | } |
| | | |
| | |
| | | ColSceneName(), |
| | | ColSceneBaseInfo(), |
| | | ColTown(), |
| | | ColInspectionInfo(listOf(2, 3, 4, 5, 7, 8, 9)) |
| | | ColInspectionInfo(listOf(0, 2, 3, 4, 5, 7, 8, 9)) |
| | | ) |
| | | |
| | | override val templateName: String = "æ¥æ¥ç»è®¡" |
| | |
| | | const val RESTAURANT_LOCATION_ID = "bMpvxuqHlB1CTYfh" |
| | | // 汽修é®é¢ä½ç½® |
| | | const val Vehicle_LOCATION_ID = "PuToYNqdSLFQSSYk" |
| | | |
| | | // ä»»å¡ç±»å |
| | | const val DOMAIN_GUID_TASK_TYPE = "qASRIAjgSfCuvJOi" |
| | | // 任塿éç±»å |
| | | const val DOMAIN_GUID_TASK_DEADLINE_TYPE = "cS9MAkmXN1S37Tbv" |
| | | // ä»»å¡å±æ¬¡ |
| | | const val DOMAIN_GUID_TASK_LEVEL = "TzbIi3ckPWMzlsH6" |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package cn.flightfeather.supervision.lightshare.service |
| | | |
| | | import cn.flightfeather.supervision.lightshare.vo.AreaVo |
| | | import cn.flightfeather.supervision.lightshare.vo.ExcelConfigVo |
| | | import javax.servlet.http.HttpServletResponse |
| | | |
| | | /** |
| | | * |
| | | * @date 2024/10/18 |
| | | * @author feiyu02 |
| | | */ |
| | | interface DataProductService { |
| | | |
| | | /** |
| | | * ä¸è½½æ°æ®äº§åæ¥å |
| | | */ |
| | | fun downloadProduct(areaVo: AreaVo, type: Int, forceUpdate: Boolean, response: HttpServletResponse): Boolean |
| | | } |
| | |
| | | fun findByLogName(name: String): List<DomainitemVo> |
| | | |
| | | fun getLocation(sceneType: Int): List<Domainitem> |
| | | |
| | | fun getTaskType(): List<Domainitem> |
| | | |
| | | fun getDeadlineType(): List<Domainitem> |
| | | |
| | | fun getLevelType(): List<Domainitem> |
| | | } |
| | |
| | | package cn.flightfeather.supervision.lightshare.service |
| | | |
| | | import cn.flightfeather.supervision.domain.ds1.entity.Evaluationsubrule |
| | | import cn.flightfeather.supervision.domain.ds1.entity.Evaluationsubrule2 |
| | | import cn.flightfeather.supervision.lightshare.vo.ScoreDetail |
| | | |
| | |
| | | interface EvaluationsubruleService { |
| | | fun findOne(id:String): Evaluationsubrule2 |
| | | |
| | | fun findAll(): MutableList<Evaluationsubrule2> |
| | | fun findAll(): MutableList<Evaluationsubrule> |
| | | |
| | | fun save(evaluationsubrule: Evaluationsubrule2): Int |
| | | |
| | |
| | | |
| | | fun update(subtask: Subtask): Int |
| | | |
| | | /** |
| | | * åæ´å·¡æ¥ä»»å¡ç¶æ |
| | | * æ§è¡ä»»å¡æç»æä»»å¡ |
| | | */ |
| | | fun changeStatus(subtask: Subtask): Int |
| | | |
| | | fun delete(id: String): Int |
| | | |
| | | fun getTaskPackList(date: String, guid: String, type: String): List<TaskPack> |
| | |
| | | |
| | | fun save(task: Task): Int |
| | | |
| | | fun create(task: Task): Task |
| | | |
| | | fun update(task: Task): Int |
| | | |
| | | fun delete(id: String): Int |
| | |
| | | |
| | | fun getDayTaskByTaskID(taskid: String): List<TaskVo> |
| | | |
| | | fun findByDate(date: String): TaskVo |
| | | fun findByDate(topTaskId: String, date: String): TaskVo |
| | | |
| | | fun getTaskProgress(userid: String): List<TaskVo>//è·åé¡¶å±ä»»å¡å¯¹åºçåä»»å¡å®æé |
| | | |
| | |
| | | |
| | | fun findAll(): MutableList<Userinfo> |
| | | |
| | | fun findByType(typeId: Byte): List<Userinfo> |
| | | fun findByType(typeId: Byte, enable: Boolean?): List<Userinfo> |
| | | |
| | | fun save(userinfo: Userinfo): Int |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package cn.flightfeather.supervision.lightshare.service.impl |
| | | |
| | | import cn.flightfeather.supervision.business.bgtask.ReportTaskCtrl |
| | | import cn.flightfeather.supervision.business.report.DataSource |
| | | import cn.flightfeather.supervision.business.report.DbMapper |
| | | import cn.flightfeather.supervision.business.report.file.ReportOne |
| | | import cn.flightfeather.supervision.business.report.file.ReportThree |
| | | import cn.flightfeather.supervision.business.report.file.ReportTwo |
| | | import cn.flightfeather.supervision.common.exception.BizException |
| | | import cn.flightfeather.supervision.domain.ds1.repository.TaskRep |
| | | import cn.flightfeather.supervision.lightshare.service.DataProductService |
| | | import cn.flightfeather.supervision.lightshare.vo.AreaVo |
| | | import cn.flightfeather.supervision.lightshare.vo.ExcelConfigVo |
| | | import org.springframework.beans.factory.annotation.Value |
| | | import org.springframework.http.HttpHeaders |
| | | import org.springframework.http.MediaType |
| | | import org.springframework.stereotype.Service |
| | | import java.io.File |
| | | import java.util.* |
| | | import javax.servlet.http.HttpServletResponse |
| | | |
| | | /** |
| | | * |
| | | * @date 2024/10/18 |
| | | * @author feiyu02 |
| | | */ |
| | | @Service |
| | | class DataProductServiceImpl( |
| | | private val taskRep: TaskRep, |
| | | private val dbMapper: DbMapper, |
| | | @Value("\${filePath}") private val filePath: String, |
| | | private val reportTaskCtrl: ReportTaskCtrl, |
| | | ) : DataProductService { |
| | | |
| | | override fun downloadProduct( |
| | | areaVo: AreaVo, type: Int, forceUpdate: Boolean, response: HttpServletResponse, |
| | | ): Boolean { |
| | | areaVo.scensetypeid ?: throw BizException("å¿
须鿩ä¸ä¸ªåºæ¯ç±»å") |
| | | val topTask = taskRep.findOneTask(areaVo) ?: throw BizException("æªæ¾å°ç¬¦åæ¡ä»¶çé¡¶å±ä»»å¡") |
| | | val config = ExcelConfigVo( |
| | | topTask.tguid ?: "", |
| | | topTask.starttime, |
| | | topTask.endtime, |
| | | topTask.provincecode, |
| | | topTask.citycode, |
| | | topTask.districtcode, |
| | | topTask.towncode, |
| | | areaVo.scensetypeid?.toInt(), |
| | | forceUpdate = forceUpdate |
| | | ) |
| | | val dataSource = DataSource(config, dbMapper) |
| | | val t = when (type) { |
| | | 1 -> ReportOne(dataSource) |
| | | 2 -> ReportTwo(dataSource) |
| | | 3 -> ReportThree(dataSource) |
| | | else -> throw BizException("æªæå®æ°æ®äº§åç±»åï¼æ æ³ä¸è½½") |
| | | } |
| | | val fileName = t.getReportName() |
| | | val p = "$filePath/autoscore/" |
| | | val file = File(p + fileName) |
| | | if (config.forceUpdate || !file.exists()) { |
| | | val downloadUrl = "/autoscore/${fileName}" |
| | | reportTaskCtrl.startTask(t, downloadUrl) |
| | | return false |
| | | } else { |
| | | val fName = Base64.getEncoder().encodeToString(fileName.toByteArray()) |
| | | response.apply { |
| | | setHeader(HttpHeaders.CONTENT_DISPOSITION, "attachment;filename=$fName") |
| | | setHeader("fileName", fName) |
| | | addHeader(HttpHeaders.ACCESS_CONTROL_EXPOSE_HEADERS, "fileName") |
| | | contentType = "application/vnd.ms-excel;charset=UTF-8" |
| | | // contentType = MediaType.APPLICATION_OCTET_STREAM_VALUE |
| | | setHeader(HttpHeaders.PRAGMA, "no-cache") |
| | | setHeader(HttpHeaders.CACHE_CONTROL, "no-cache") |
| | | setDateHeader(HttpHeaders.EXPIRES, 0) |
| | | } |
| | | response.outputStream.write(file.readBytes()) |
| | | return true |
| | | } |
| | | } |
| | | } |
| | |
| | | orderBy("index") |
| | | }) |
| | | } |
| | | |
| | | override fun getTaskType(): List<Domainitem> { |
| | | return domainitemMapper.selectByExample(Example(Domainitem::class.java).apply { |
| | | createCriteria().andEqualTo("dcguid", Constant.DOMAIN_GUID_TASK_TYPE) |
| | | orderBy("index") |
| | | }) |
| | | } |
| | | |
| | | override fun getDeadlineType(): List<Domainitem> { |
| | | return domainitemMapper.selectByExample(Example(Domainitem::class.java).apply { |
| | | createCriteria().andEqualTo("dcguid", Constant.DOMAIN_GUID_TASK_DEADLINE_TYPE) |
| | | orderBy("index") |
| | | }) |
| | | } |
| | | |
| | | override fun getLevelType(): List<Domainitem> { |
| | | return domainitemMapper.selectByExample(Example(Domainitem::class.java).apply { |
| | | createCriteria().andEqualTo("dcguid", Constant.DOMAIN_GUID_TASK_LEVEL) |
| | | orderBy("index") |
| | | }) |
| | | } |
| | | } |
| | |
| | | private val evaluationRep: EvaluationRep, |
| | | private val taskRep: TaskRep, |
| | | private val aopTaskCtrl: AopTaskCtrl, |
| | | private val searchService: SearchService, |
| | | private val dbMapper: DbMapper, |
| | | @Value("\${filePath}") private val filePath: String, |
| | | private val reportTaskCtrl: ReportTaskCtrl, |
| | |
| | | |
| | | import cn.flightfeather.supervision.common.exception.BizException |
| | | import cn.flightfeather.supervision.domain.ds1.entity.Evaluationrule |
| | | import cn.flightfeather.supervision.domain.ds1.entity.Evaluationsubrule |
| | | import cn.flightfeather.supervision.domain.ds1.entity.Evaluationsubrule2 |
| | | import cn.flightfeather.supervision.domain.ds1.mapper.EvaluationruleMapper |
| | | import cn.flightfeather.supervision.domain.ds1.mapper.EvaluationsubruleMapper |
| | |
| | | |
| | | @Service |
| | | class EvaluationsubruleServiceImpl( |
| | | val evaluationsubruleMapper: EvaluationsubruleMapper2, |
| | | val evaluationsubruleMapper2: EvaluationsubruleMapper2, |
| | | val evaluationsubruleMapper: EvaluationsubruleMapper, |
| | | val evaluationruleMapper: EvaluationruleMapper, |
| | | private val evaluationRep: EvaluationRep, |
| | | private val evaluationRuleRep: EvaluationRuleRep, |
| | | private val sceneRep: SceneRep, |
| | | ) : EvaluationsubruleService { |
| | | |
| | | override fun findOne(id: String): Evaluationsubrule2 = evaluationsubruleMapper.selectByPrimaryKey(id) |
| | | override fun findOne(id: String): Evaluationsubrule2 = evaluationsubruleMapper2.selectByPrimaryKey(id) |
| | | |
| | | override fun findAll(): MutableList<Evaluationsubrule2> = evaluationsubruleMapper.selectAll() |
| | | override fun findAll(): MutableList<Evaluationsubrule> = evaluationsubruleMapper.selectAll() |
| | | |
| | | override fun save(evaluationsubrule: Evaluationsubrule2): Int = evaluationsubruleMapper.insert(evaluationsubrule) |
| | | override fun save(evaluationsubrule: Evaluationsubrule2): Int = evaluationsubruleMapper2.insert(evaluationsubrule) |
| | | |
| | | override fun update(evaluationsubrule: Evaluationsubrule2): Int = |
| | | evaluationsubruleMapper.updateByPrimaryKey(evaluationsubrule) |
| | | evaluationsubruleMapper2.updateByPrimaryKey(evaluationsubrule) |
| | | |
| | | override fun delete(id: String): Int = evaluationsubruleMapper.deleteByPrimaryKey(id) |
| | | override fun delete(id: String): Int = evaluationsubruleMapper2.deleteByPrimaryKey(id) |
| | | |
| | | override fun findByRuleId(erguid: String): List<Evaluationsubrule2> { |
| | | return evaluationRuleRep.findSubRule(erguid) |
| | |
| | | createCriteria().andEqualTo("districtcode", districtCode) |
| | | .andEqualTo("scensetypeid", sceneTypeId) |
| | | }).takeIf { it.isNotEmpty() }?.get(0)?.let { rule -> |
| | | evaluationsubruleMapper.selectByExample(Example(Evaluationsubrule2::class.java).apply { |
| | | evaluationsubruleMapper2.selectByExample(Example(Evaluationsubrule2::class.java).apply { |
| | | createCriteria().andEqualTo("erguid", rule.guid) |
| | | }) |
| | | }?.also { |
| | |
| | | val monitorobjectversionlist = monitorobjectversionMapper.select(monitorobjectversion) |
| | | |
| | | return monitorobjectversionlist.filter { |
| | | val usedCount = it.extension1 ?: "0";it.monitornum.toString().toInt() - usedCount.toInt() > 0 |
| | | val usedCount = it.extension1 ?: "0" |
| | | it.monitornum.toString().toInt() - usedCount.toInt() > 0 |
| | | }.sortedBy { it.displayid } |
| | | } |
| | | |
| | |
| | | if (vo.sguid == scene.guid) { |
| | | vo.sceneTypeId = scene.typeid?.toInt() ?: 0 |
| | | vo.sceneType = scene.type |
| | | vo.scene = scene |
| | | return@f |
| | | } |
| | | } |
| | |
| | | package cn.flightfeather.supervision.lightshare.service.impl |
| | | |
| | | import cn.flightfeather.supervision.business.bgtask.ReportTaskCtrl |
| | | import cn.flightfeather.supervision.business.report.DataSource |
| | | import cn.flightfeather.supervision.business.report.DbMapper |
| | | import cn.flightfeather.supervision.business.report.file.ReportOne |
| | |
| | | private val sceneRep: SceneRep, |
| | | @Value("\${filePath}") var filePath: String, |
| | | @Value("\${imgPath}") var imgPath: String, |
| | | private val dbMapper: DbMapper, |
| | | private val reportTaskCtrl: ReportTaskCtrl, |
| | | ) : SearchService { |
| | | |
| | | override fun writeToFile(config: ExcelConfigVo, mode: Int) { |
| | |
| | | } |
| | | |
| | | override fun getExcel(config: ExcelConfigVo, response: HttpServletResponse): Boolean { |
| | | val dbMapper = DbMapper( |
| | | scenseMapper, |
| | | problemlistMapper, |
| | | problemtypeMapper, |
| | | subtaskMapper, |
| | | monitorobjectversionMapper, |
| | | sceneConstructionSiteMapper, |
| | | sceneMixingPlantMapper, |
| | | sceneStorageYardMapper, |
| | | sceneWharfMapper, |
| | | taskMapper, |
| | | evaluationruleMapper, evaluationsubruleMapper, evaluationMapper, itemevaluationMapper, |
| | | ledgerSubTypeMapper, ledgerRecordMapper, userinfoMapper, userMapMapper, townMapper |
| | | ) |
| | | val dataSource = DataSource(config, dbMapper) |
| | | val t = when (config.mode) { |
| | | 1 -> ReportOne(dataSource) |
| | |
| | | else -> ReportOne(dataSource) |
| | | } |
| | | val fileName = t.getReportName() |
| | | val fName = URLEncoder.encode(fileName, "UTF-8") |
| | | response.apply { |
| | | setHeader("Content-Disposition", "attachment;filename=$fName") |
| | | setHeader("fileName", fName) |
| | | addHeader("Access-Control-Expose-Headers", "fileName") |
| | | contentType = "application/vnd.ms-excel;charset=UTF-8" |
| | | setHeader("Pragma", "no-cache") |
| | | setHeader("Cache-Control", "no-cache") |
| | | setDateHeader("Expires", 0) |
| | | } |
| | | |
| | | val p = "$filePath/autoscore/" |
| | | val file = File(p + fileName) |
| | | if (config.forceUpdate || !file.exists()) { |
| | | t.toFile(p) |
| | | val downloadUrl = "/autoscore/${fileName}" |
| | | reportTaskCtrl.startTask(t, downloadUrl) |
| | | return false |
| | | } else { |
| | | val fName = Base64.getEncoder().encodeToString(fileName.toByteArray()) |
| | | response.apply { |
| | | setHeader("Content-Disposition", "attachment;filename=$fName") |
| | | setHeader("fileName", fName) |
| | | addHeader("Access-Control-Expose-Headers", "fileName") |
| | | contentType = "application/vnd.ms-excel;charset=UTF-8" |
| | | setHeader("Pragma", "no-cache") |
| | | setHeader("Cache-Control", "no-cache") |
| | | setDateHeader("Expires", 0) |
| | | } |
| | | response.outputStream.write(file.readBytes()) |
| | | return true |
| | | } |
| | | response.outputStream.write(file.readBytes()) |
| | | |
| | | return true |
| | | } |
| | | |
| | | override fun getSubTaskDetail(config: ExcelConfigVo): SubTaskTableVo { |
| | |
| | | ledgerSubTypeMapper, ledgerRecordMapper, userinfoMapper, userMapMapper, townMapper |
| | | ) |
| | | val task = |
| | | taskService.getByDistrictCode(config.districtCode, config.startTime)?.takeIf { it.isNotEmpty() }?.get(0) |
| | | taskService.getByDistrictCode(config.districtCode, config.startTime).takeIf { it.isNotEmpty() }?.get(0) |
| | | config.topTaskGuid = task?.tguid ?: "" |
| | | config.allScene = false |
| | | val dataSource = mutableListOf<DataSource>() |
| | | config.sceneType = Constant.SceneType.TYPE1.value.toInt() |
| | | // config.sceneType = Constant.SceneType.TYPE1.value.toInt() |
| | | dataSource.add(DataSource(config, dbMapper)) |
| | | |
| | | // val config2 = config.copy(sceneType = Constant.ScenseType.TYPE2.value.toInt()) |
| | |
| | | @Transactional |
| | | override fun saveList(subtasklist: List<Subtask>): Int { |
| | | subtasklist.forEach { |
| | | if (it.stguid == null) it.stguid = UUIDGenerator.generate16ShortUUID() |
| | | subtaskMapper.insert(it) |
| | | } |
| | | return subtasklist.size |
| | |
| | | |
| | | override fun findAll(): MutableList<Subtask> = subtaskMapper.selectAll() |
| | | |
| | | override fun save(subtask: Subtask): Int = subtaskMapper.insert(subtask) |
| | | override fun save(subtask: Subtask): Int { |
| | | if (subtask.stguid == null) subtask.stguid = UUIDGenerator.generate16ShortUUID() |
| | | return subtaskMapper.insert(subtask) |
| | | } |
| | | |
| | | //æ´æ°åä»»å¡ |
| | | override fun update(subtask: Subtask): Int { |
| | | var res = 0 |
| | | //æ ¹æ®åä»»å¡guidè·åé¡¶å±ä»»å¡ |
| | | val toptaskVo = taskService.findByID(subtask.tguid.toString()) |
| | | |
| | | // //æ ¹æ®æ¥æè·åæ¥ä»»å¡ |
| | | // val daytaskVo = taskService.findByDate(DateUtil.getDate(subtask.planstarttime)!!) |
| | | val daytaskVo = taskService.findByDate(subtask.tguid!!, DateUtil.getDate(subtask.planstarttime)!!) |
| | | |
| | | //åºè¯¥ç´æ¥æ ¹æ®åä»»å¡çæ¥ä»»å¡idæ¥è¯¢æ¥ä»»å¡ |
| | | val daytaskVo = taskService.findByID(subtask.tsguid!!) |
| | | // val daytaskVo = taskService.findByID(subtask.tsguid!!) |
| | | |
| | | //夿æ¯å¦ææ¥ä»»å¡ |
| | | if (StringUtil.isEmpty(daytaskVo.tguid)) { |
| | |
| | | task.name = subtask.name |
| | | task.starttime = DateUtil.StringToDate(DateUtil.getDate(subtask.planstarttime)!!.substring(0, 10)) |
| | | task.endtime = |
| | | DateUtil.StringToDate(DateUtil.getDate(subtask.planstarttime)!!.substring(0, 10) + " 23:59:59") |
| | | DateUtil.StringToDate(DateUtil.getDate(subtask.planstarttime)!!.substring(0, 10) + " 23:59:59") |
| | | //****æ¥ä»»å¡æ§è¡ç¶æç»§æ¿åä»»å¡çç¶æ*ï¼ä¿®æ¹ï¼*** |
| | | task.runingstatus = subtask.status |
| | | //******************************************** |
| | | taskService.save(task) |
| | | subtask.tsguid = guid |
| | | subtaskMapper.updateByPrimaryKeySelective(subtask) |
| | | res = subtaskMapper.updateByPrimaryKeySelective(subtask) |
| | | } else { |
| | | // subtask.tsguid = daytaskVo.tguid |
| | | subtask.tsguid = daytaskVo.tguid |
| | | //*ï¼ä¿®æ¹ï¼*æ¥ä»»å¡æ£å¨æ§è¡ï¼åä»»å¡ç»æï¼éåææå
¶ä½åä»»å¡ï¼é½æ¯ç»ææ¶æå°æ¥ä»»å¡ä¿®æ¹ä¸ºç»æ**** |
| | | if (subtask.status == Constant.TaskProgress.RUNINGSTATUS3.text |
| | | && daytaskVo.runingstatus == Constant.TaskProgress.RUNINGSTATUS2.text){ |
| | | && daytaskVo.runingstatus == Constant.TaskProgress.RUNINGSTATUS2.text){ |
| | | val subtaskVolist = findByDayTaskID(daytaskVo.tguid!!) |
| | | var bool = false |
| | | subtaskVolist.forEach { |
| | |
| | | BeanUtils.copyProperties(daytaskVo, daytask) |
| | | taskMapper.updateByPrimaryKeySelective(daytask) |
| | | //**************************************************************************************** |
| | | subtaskMapper.updateByPrimaryKeySelective(subtask) |
| | | res = subtaskMapper.updateByPrimaryKeySelective(subtask) |
| | | } |
| | | return res |
| | | } |
| | | |
| | | override fun changeStatus(subtask: Subtask): Int { |
| | | val res = update(subtask) |
| | | //å¯¹å·²ç»æçåä»»å¡è¿è¡èªå¨è¯å |
| | | if (subtask.status == Constant.TaskProgress.RUNINGSTATUS3.text) { |
| | | val example = Example(Evaluation::class.java) |
| | |
| | | } |
| | | } |
| | | |
| | | return 1 |
| | | return res |
| | | } |
| | | |
| | | override fun delete(id: String): Int{ |
| | |
| | | createCriteria().andEqualTo("tid", topTaskId).andEqualTo("sguid", sceneId) |
| | | }) |
| | | mList.forEach { |
| | | if (it.monitornum == null) { |
| | | it.monitornum = 0 |
| | | } else { |
| | | it.monitornum = it.monitornum!! - 1 |
| | | if (it.monitornum!! < 0) { |
| | | it.monitornum = 0 |
| | | } |
| | | var count = it.extension1?.toIntOrNull() ?: 0 |
| | | count-- |
| | | if (count < 0) { |
| | | count = 0 |
| | | } |
| | | monitorobjectversionMapper.insert(it) |
| | | it.extension1 = count.toString() |
| | | monitorobjectversionMapper.updateByPrimaryKeySelective(it) |
| | | } |
| | | |
| | | // åæ¶å é¤å¯¹åºé®é¢åå·¡æ¥è®°å½ |
| | |
| | | package cn.flightfeather.supervision.lightshare.service.impl |
| | | |
| | | import cn.flightfeather.supervision.common.exception.BizException |
| | | import cn.flightfeather.supervision.domain.ds1.entity.Problemlist |
| | | import cn.flightfeather.supervision.domain.ds1.entity.Subtask |
| | | import cn.flightfeather.supervision.domain.ds1.entity.Task |
| | |
| | | import cn.flightfeather.supervision.domain.ds1.mapper.TaskMapper |
| | | import cn.flightfeather.supervision.common.utils.Constant |
| | | import cn.flightfeather.supervision.common.utils.DateUtil |
| | | import cn.flightfeather.supervision.common.utils.UUIDGenerator |
| | | import cn.flightfeather.supervision.domain.ds1.repository.SubTaskRep |
| | | import cn.flightfeather.supervision.domain.ds1.repository.TaskRep |
| | | import cn.flightfeather.supervision.lightshare.service.* |
| | |
| | | townRank.standardRate = it.get("standardRate").toString().toFloat() |
| | | } catch (e: Exception) { |
| | | } |
| | | val s =it.get("hasScoredNum").toString() |
| | | val s = it.get("hasScoredNum").toString() |
| | | try { |
| | | townRank.hasScoredNum = it.get("hasScoredNum").toString().toInt() |
| | | } catch (e: Exception) { |
| | |
| | | if (type == 0) |
| | | return getAllTop() |
| | | //è·åæªå®æé¡¶å±ä»»å¡åå¯¹åºæ¥ä»»å¡å表 |
| | | else if (type == 1){ |
| | | else if (type == 1) { |
| | | val tmp = getAllTop() |
| | | tmp.forEach { |
| | | if (it.runingstatus != Constant.TaskProgress.RUNINGSTATUS3.text) { |
| | |
| | | } |
| | | |
| | | //æ ¹æ®æ¥æè·åæ¥ä»»å¡ |
| | | override fun findByDate(date: String): TaskVo { |
| | | override fun findByDate(topTaskId: String, date: String): TaskVo { |
| | | val taskVo = TaskVo() |
| | | val example = Example(Task::class.java) |
| | | val criteria = example.createCriteria() |
| | | //gsguidä¸ä¸ºç©ºä¸ºæ¥ä»»å¡,æ¥ä»»å¡å¼å§æ¶é´åç»ææ¶é´å¨åä¸å¤©,è¿æ»¤å¼å§æ¶é´å°±ok |
| | | criteria.andEqualTo("starttime", DateUtil.StringToDate(date.substring(0, 10))) |
| | | criteria.andIsNotNull("tsguid") |
| | | criteria.andEqualTo("tsguid", topTaskId) |
| | | val tasklist = taskMapper.selectByExample(example) |
| | | if (tasklist.isNotEmpty()) { |
| | | BeanUtils.copyProperties(tasklist[0], taskVo) |
| | |
| | | // .andEqualTo("districtcode", districtCode) |
| | | // .andLessThanOrEqualTo("endtime", date) |
| | | // example.or( |
| | | example.createCriteria().andIsNull("tsguid") |
| | | .andEqualTo("districtcode", districtCode) |
| | | .andLessThanOrEqualTo("starttime", date) |
| | | .andGreaterThanOrEqualTo("endtime", date) |
| | | example.createCriteria().andIsNull("tsguid") |
| | | .andEqualTo("districtcode", districtCode) |
| | | .andLessThanOrEqualTo("starttime", date) |
| | | .andGreaterThanOrEqualTo("endtime", date) |
| | | // ) |
| | | example.orderBy("starttime").desc() |
| | | val tasklist = taskMapper.selectByExample(example) |
| | |
| | | val complete = subtaskMapper.selectCountByExample(exampleComplete) |
| | | |
| | | var changed = 0 |
| | | problemListMapper.findUnchangedCount(it.tguid ?: "").forEach {i -> |
| | | problemListMapper.findUnchangedCount(it.tguid ?: "").forEach { i -> |
| | | //ç»æè¡¨ç¤ºè¯¥å任塿ªæ´æ¹é®é¢æ° |
| | | if (i == 0) { |
| | | changed++ |
| | |
| | | forEach { |
| | | problemListMapper.selectByExample(Example(Problemlist::class.java).apply { |
| | | createCriteria().andEqualTo("stguid", it.stguid) |
| | | }).forEach {problem -> |
| | | }).forEach { problem -> |
| | | if (problem.extension3 == Constant.PROBLEM_UNCHECKED) { |
| | | check = true |
| | | return@breaking |
| | |
| | | } |
| | | } |
| | | |
| | | resultList.add(DayTaskProgressVo( |
| | | it.tguid, it.starttime, taskId, complete, changed, total, check |
| | | resultList.add(DayTaskProgressVo( |
| | | it.tguid, it.starttime, taskId, complete, changed, total, check |
| | | )) |
| | | } |
| | | |
| | |
| | | |
| | | val criteria2 = example.createCriteria() |
| | | criteria2.orBetween( |
| | | "endtime", |
| | | startDate, |
| | | endDate |
| | | "endtime", |
| | | startDate, |
| | | endDate |
| | | ).andIsNull("tsguid"); |
| | | if (userType == "1") { |
| | | criteria2.andLike("executorguids", "%$guid%") |
| | | } else if (userType == "2"){ |
| | | } else if (userType == "2") { |
| | | criteria2.andEqualTo("districtcode", districtCode) |
| | | } |
| | | example.or(criteria2) |
| | | |
| | | val criteria3 = example.createCriteria() |
| | | criteria3.orLessThan("starttime", startDate).andGreaterThan( |
| | | "endtime", |
| | | endDate |
| | | "endtime", |
| | | endDate |
| | | ).andIsNull("tsguid"); |
| | | if (userType == "1") { |
| | | criteria3.andLike("executorguids", "%$guid%") |
| | | } else if (userType == "2"){ |
| | | } else if (userType == "2") { |
| | | criteria3.andEqualTo("districtcode", districtCode) |
| | | } |
| | | example.or(criteria3) |
| | |
| | | } |
| | | return taskVoList |
| | | } |
| | | |
| | | |
| | | override fun save(task: Task): Int { |
| | | // FIXME: 2021/10/9 æç
§å½åçé»è¾ï¼æ¤å½æ°ä¸»è¦ç¨äºæ°å»ºé¡¶å±ä»»å¡ä»¥åæ¥ä»»å¡ï¼ä½æ¯æ¥ä»»å¡å
容ççæé»è¾ç®åç±å端app宿ï¼å æ¤ä¼åºç°ä¸ä¸ªbugï¼ |
| | | // FIXME: 2021/10/9 å½å端å¤ä¸ªç¨æ·åæ¶å¨åä¸ä¸ªé¡¶å±ä»»å¡ä¸çæ°çä¸å¤©åå»ºä»»å¡æ¶ï¼ä¼åºç°åä¸å¤©æå¤ä¸ªæ¥ä»»å¡ï¼æ¤æ¶å端åç»æ¥çåªè½çå°å
¶ä¸ä¸ä¸ªæ¥ä»»å¡ä¸çåä»»å¡ |
| | |
| | | // FIXME: 2021/10/9 å¦å¤å¯¹äºé¡¶å±ä»»å¡ä¹æ·»å 类似é»è¾ï¼ç±äºé¡¶å±ä»»å¡çä»»å¡åç§°é»è®¤ç³»ç»èªå¨çæï¼å æ¤ææ¶åªå¤æååçé¡¶å±ä»»å¡ï¼å½åå¨ååé¡¶å±ä»»å¡æ¶ï¼ä¸åä¿åæä½ |
| | | |
| | | var result = 0 |
| | | if (task.tguid == null) task.tguid = UUIDGenerator.generate16ShortUUID() |
| | | // 1ãé¦å
夿æ¯é¡¶å±ä»»å¡è¿æ¯æ¥ä»»å¡ |
| | | if (task.levelnum == 2) { |
| | | //2.1ã æ¯é¡¶å±ä»»å¡æ¶ï¼å¤ææ¯å¦å·²æååä»»å¡ |
| | |
| | | } |
| | | } else { |
| | | //3.1ã 彿¯æ¥ä»»å¡æ¶ï¼å¤æå¨åä¸ä¸ªé¡¶å±ä»»å¡ä¸ï¼æ¯å¦æååçæ¥ä»»å¡ |
| | | val r =taskMapper.selectByExample(Example(Task::class.java).apply { |
| | | val r = taskMapper.selectByExample(Example(Task::class.java).apply { |
| | | createCriteria().andEqualTo("tsguid", task.tsguid) |
| | | .andEqualTo("name", task.name) |
| | | }) |
| | |
| | | return result |
| | | } |
| | | |
| | | override fun create(task: Task): Task { |
| | | val res = save(task) |
| | | if (res < 1) |
| | | throw BizException("ä»»å¡å建失败") |
| | | else |
| | | return task |
| | | } |
| | | |
| | | //ä¿®æ¹æ¥ä»»å¡ä¿¡æ¯,è¥æåä»»å¡,åä»»å¡ä¹ä¿®æ¹ |
| | | override fun update(task: Task): Int { |
| | | var re = 1 |
| | |
| | | BeanUtils.copyProperties(it, subtask) |
| | | subtask.planstarttime = task.starttime |
| | | subtask.planendtime = task.endtime |
| | | subtaskService.update(subtask) |
| | | subtaskService.changeStatus(subtask) |
| | | } |
| | | } |
| | | return re |
| | |
| | | criteria.andIsNull("tsguid") |
| | | example.orderBy("starttime").asc() |
| | | val result = taskMapper.selectByExample(example) |
| | | if (result.isNotEmpty()){ |
| | | if (result.isNotEmpty()) { |
| | | result.forEach { |
| | | var mytotalcount = 0 |
| | | var mycompletecount = 0 |
| | |
| | | taskProgressVo.mycompletetask = mycompletecount |
| | | val daytaskVolist = getDayTaskByTaskID(it.tguid!!) |
| | | val daytasklist = mutableListOf<TaskVo>() |
| | | if (daytaskVolist.isNotEmpty()){ |
| | | if (daytaskVolist.isNotEmpty()) { |
| | | daytaskVolist.forEach { |
| | | var mytotalcount1 = 0 |
| | | var mycompletecount1 = 0 |
| | |
| | | if (Objects.equals(it.status!!, Constant.TaskProgress.RUNINGSTATUS3.text)) |
| | | mycompletecount1++ |
| | | } |
| | | if(Objects.equals(it.status, Constant.TaskProgress.RUNINGSTATUS3.text)) |
| | | if (Objects.equals(it.status, Constant.TaskProgress.RUNINGSTATUS3.text)) |
| | | completecount1++ |
| | | } |
| | | val daytaskProgressVo = TaskVo() |
| | |
| | | |
| | | override fun findTaskProgress(areaVo: AreaVo): List<TaskProgressVo?> { |
| | | val res = mutableListOf<TaskProgressVo?>() |
| | | taskRep.findTasks(areaVo).forEach {t-> |
| | | taskRep.findTasks(areaVo).forEach { t -> |
| | | if (t?.tguid == null) return@forEach |
| | | val pro = TaskProgressVo().apply { |
| | | tguid = t.tguid |
| | |
| | | } |
| | | } |
| | | |
| | | override fun findByType(typeId: Byte): List<Userinfo> { |
| | | override fun findByType(typeId: Byte, enable: Boolean?): List<Userinfo> { |
| | | val result = userinfoMapper.selectByExample(Example(Userinfo::class.java).apply { |
| | | createCriteria().andEqualTo("usertypeid", typeId) |
| | | .apply { |
| | | enable?.let { andEqualTo("isenable", it) } |
| | | } |
| | | }) |
| | | |
| | | return result |
| | |
| | | * 导åºå·¡æ¥ä»»å¡excelæä»¶ æ¡ä»¶ç±» |
| | | */ |
| | | data class ExcelConfigVo( |
| | | var topTaskGuid: String = "", |
| | | var topTaskGuid: String = "", |
| | | |
| | | val startTime: Date? = null, |
| | | val endTime: Date? = null, |
| | | val startTime: Date? = null, |
| | | val endTime: Date? = null, |
| | | |
| | | val provinceCode: String? = null, |
| | | val cityCode: String? = null, |
| | | val districtCode: String? = null, |
| | | val townCode: String? = null, |
| | | val provinceCode: String? = null, |
| | | val cityCode: String? = null, |
| | | val districtCode: String? = null, |
| | | val townCode: String? = null, |
| | | |
| | | var sceneType: Int? = null, |
| | | var sceneType: Int? = null, |
| | | |
| | | val subTaskIdList: List<String>? = null, |
| | | val subTaskIdList: List<String>? = null, |
| | | |
| | | val problemTypeName: String? = null, |
| | | val problemName: String? = null, |
| | | val problemTypeName: String? = null, |
| | | val problemName: String? = null, |
| | | |
| | | val mode: Int = 0, |
| | | val forceUpdate: Boolean = false |
| | | val mode: Int = 0, |
| | | val forceUpdate: Boolean = false, |
| | | |
| | | // å³å®æ¯å¦ç»è®¡æ»ä»»å¡ä¸ææçåºæ¯æåªç»è®¡çéåºçåä»»å¡å¯¹åºçåºæ¯ |
| | | var allScene: Boolean = true, |
| | | ) |
| | |
| | | */ |
| | | var sceneType: String? = null |
| | | |
| | | var scene: ScenseVo? = null |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package cn.flightfeather.supervision.lightshare.web |
| | | |
| | | import cn.flightfeather.supervision.lightshare.service.DataProductService |
| | | import cn.flightfeather.supervision.lightshare.vo.AreaVo |
| | | 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 springfox.documentation.annotations.ApiIgnore |
| | | import javax.servlet.http.HttpServletResponse |
| | | |
| | | /** |
| | | * æ°æ®äº§åç¸å
³APIæ¥å£ |
| | | * @date 2024/10/18 |
| | | * @author feiyu02 |
| | | */ |
| | | @Api(tags = ["DataProductController"], description = "æ°æ®äº§åç¸å
³APIæ¥å£") |
| | | @RestController |
| | | @RequestMapping("/dataProduct") |
| | | class DataProductController(private val dataProductService: DataProductService) { |
| | | |
| | | @ApiOperation(value = "ä¸è½½æ°æ®äº§åæ¥å") |
| | | @PostMapping("/download") |
| | | fun downloadProduct( |
| | | @ApiParam("åºåæ¡ä»¶ä¿¡æ¯") @RequestBody areaVo: AreaVo, |
| | | @ApiParam("æ¥åç±»å", allowableValues = "1:é®é¢ä¸æ´æ¹æ±æ»åæä¸å¨æè·è¸ªæ¸
å;2:è§èæ§è¯ä¼°ä¸åææ¸
å;3:é®é¢ä¸æ´æ¹åå¸åææ¸
å;") |
| | | @RequestParam type: Int, |
| | | @ApiParam("æ¯å¦å¼ºå¶çææ°çæ¥å") @RequestParam forceUpdate: Boolean, |
| | | @ApiIgnore response: HttpServletResponse, |
| | | ) = resPack { dataProductService.downloadProduct(areaVo, type, forceUpdate, response) } |
| | | } |
| | |
| | | import cn.flightfeather.supervision.domain.ds1.entity.Domainitem |
| | | import cn.flightfeather.supervision.lightshare.service.DomainitemService |
| | | import io.swagger.annotations.Api |
| | | import io.swagger.annotations.ApiOperation |
| | | import io.swagger.annotations.ApiParam |
| | | import org.springframework.web.bind.annotation.* |
| | | |
| | | @Api(tags = ["DomainitemController"], description = "å¼åä¿¡æ¯APIæ¥å£") |
| | |
| | | @DeleteMapping("/{id}") |
| | | fun delete (@PathVariable id: String) = domainitemService.delete(id) |
| | | |
| | | @ApiOperation("è·åæç±»åºæ¯çé®é¢ä½ç½®é项") |
| | | @GetMapping("/location") |
| | | fun getLocation( |
| | | @RequestParam("sceneType") sceneType:Int |
| | | @ApiParam("åºæ¯ç±»åid") @RequestParam("sceneType") sceneType:Int |
| | | ) = domainitemService.getLocation(sceneType) |
| | | |
| | | @ApiOperation("è·åå·¡æ¥ä»»å¡çç±»åé项") |
| | | @GetMapping("/taskType") |
| | | fun getTaskType() = domainitemService.getTaskType() |
| | | |
| | | @ApiOperation("è·åå·¡æ¥ä»»å¡çæéç±»åé项") |
| | | @GetMapping("/deadlineType") |
| | | fun getDeadlineType() = domainitemService.getDeadlineType() |
| | | |
| | | @ApiOperation("è·åå·¡æ¥ä»»å¡å±æ¬¡ç±»åé项") |
| | | @GetMapping("/level") |
| | | fun getLevelType() = domainitemService.getLevelType() |
| | | } |
| | |
| | | @ApiOperation("æ ¹æ®ä¸å¡ç±»åè·åæä»¶") |
| | | @GetMapping("/{id}/{btid}") |
| | | fun getBySubtaskId( |
| | | @ApiParam("å·¡æ¥id") @PathVariable iGuid: String, |
| | | @ApiParam("å·¡æ¥id") @PathVariable id: String, |
| | | @ApiParam("æä»¶ä¸å¡ç±»åid", allowableValues = "") @PathVariable btid: String, |
| | | ) = mediafileService.findBysubtaskbtid(iGuid, btid) |
| | | ) = mediafileService.findBysubtaskbtid(id, btid) |
| | | |
| | | @ApiOperation("è·åææä»»ææå¸¸è§è®°å½å¾ç", notes = "éè¿å·¡æ¥è®°å½idæå·¡æ¥ä»»å¡idè·å对åºçææä»»ææå¾çï¼ä¸¤ä¸ªåæ°ä»»éå
¶ä¸å³å¯") |
| | | @GetMapping("/routine") |
| | |
| | | BeanUtils.copyProperties(subtaskVo, subtask) |
| | | //妿guidä¸ä¸ºç©º,é£å°±æ´æ° |
| | | if (!StringUtils.isEmpty(subtask.stguid)) { |
| | | subtaskService.update(subtask) |
| | | subtaskService.changeStatus(subtask) |
| | | } else { |
| | | //è·åæ¥ä»»å¡ |
| | | val daytask = taskService.findByID(subtaskVo.tsguid!!) |
| | |
| | | |
| | | @PostMapping |
| | | fun update(@RequestBody subtask: Subtask): Int { |
| | | val res = subtaskService.update(subtask) |
| | | val res = subtaskService.changeStatus(subtask) |
| | | if (subtask.status == Constant.TaskProgress.RUNINGSTATUS3.text) { |
| | | val event = "å¨${subtask.scensename}ç»æå·¡æ¥" |
| | | bizLog.info(WorkStreamLogInfo(subtask.executorguids, subtask.executorrealtimes, event)) |
| | |
| | | return res |
| | | } |
| | | |
| | | @ApiOperation("è°æ´å·¡æ¥ä»»å¡ä¿¡æ¯") |
| | | @PostMapping("/adjust") |
| | | fun adjust(@RequestBody subtask: Subtask) = resPack { subtaskService.update(subtask) } |
| | | |
| | | @GetMapping("/{id}") |
| | | fun getById(@PathVariable id: String) = subtaskService.findByID(id) |
| | | |
| | |
| | | @PutMapping |
| | | fun save(@RequestBody task: Task) = taskService.save(task) |
| | | |
| | | @PutMapping("/create") |
| | | fun create(@RequestBody task: Task) = resPack { taskService.create(task) } |
| | | |
| | | @PostMapping |
| | | fun update(@RequestBody task: Task) = taskService.update(task) |
| | | |
| | |
| | | @GetMapping("/{id}") |
| | | fun getById(@PathVariable id: String) = userinfoService.findOne(id) |
| | | |
| | | @ApiOperation(value = "æç¨æ·ç±»åæç´¢ç¨æ·ä¿¡æ¯") |
| | | @GetMapping("/type/get") |
| | | fun getUserByTypeId(@RequestParam typeId: Byte) = userinfoService.findByType(typeId) |
| | | fun getUserByTypeId( |
| | | @ApiParam("ç¨æ·ç±»åid") @RequestParam typeId: Byte, |
| | | @ApiParam("ç¨æ·æ¯å¦å¯ç¨", required = false, defaultValue = "true") @RequestParam(required = false) enable: Boolean? |
| | | ) = userinfoService.findByType(typeId, enable) |
| | | |
| | | @PutMapping("") |
| | | fun add(@RequestBody userinfo: Userinfo) = userinfoService.save(userinfo) |
| | |
| | | package cn.flightfeather.supervision |
| | | |
| | | |
| | | import cn.flightfeather.supervision.business.datafetch.FetchController |
| | | import cn.flightfeather.supervision.infrastructure.service.ServerManager |
| | | import cn.flightfeather.supervision.common.utils.UUIDGenerator |
| | | //import org.junit.Test |
| | |
| | | @Autowired |
| | | private lateinit var manager: ServerManager |
| | | |
| | | @Autowired |
| | | // éå®åºå¤é´æ½å·¥è®¸å¯è¯ä¿¡æ¯è·åä»»å¡ |
| | | lateinit var fetchController: FetchController |
| | | |
| | | @Test |
| | | fun contextLoads() { |
| | | |
| | |
| | | @Test |
| | | @Throws(Exception::class) |
| | | fun test1() { |
| | | //manager.startServer(args[0]); |
| | | val uuid= UUIDGenerator.generateUUID(4) |
| | | print(uuid) |
| | | fetchController.run() |
| | | |
| | | } |
| | | |
| | | } |
| | |
| | | // val d = CoordinateUtil.calculateDistance(121.436109, 31.178198, 121.426483, 31.177637) |
| | | // println(d) |
| | | } |
| | | |
| | | @Test |
| | | fun foo3(){ |
| | | val locationDistance = LocationDistance(scenseMapper) |
| | | val bList = listOf( |
| | | BasePlace("é山大é2000å·", Pair(121.3404, 30.744262), Pair(121.3404, 30.744262)), |
| | | ) |
| | | locationDistance.searchList(bList, "éå±±åº") |
| | | } |
| | | } |