已修改57个文件
已删除26个文件
已添加40个文件
已重命名2个文件
| | |
| | | <!-- tk.mybatis --> |
| | | <mapper.plugin>tk.mybatis.mapper.generator.MapperPlugin</mapper.plugin> |
| | | <mapper.Mapper>tk.mybatis.mapper.common.Mapper</mapper.Mapper> |
| | | <resource.delimiters>@</resource.delimiters> |
| | | </properties> |
| | | |
| | | <dependencies> |
| | |
| | | <artifactId>mybatis-generator-maven-plugin</artifactId> |
| | | <version>1.3.2</version> |
| | | <configuration> |
| | | <!-- <configurationFile>src/main/resources/generator/generatorConfig4ds1.xml</configurationFile>--> |
| | | <configurationFile>src/main/resources/generator/generatorConfig4ds3.xml</configurationFile> |
| | | <overwrite>true</overwrite> |
| | | <verbose>true</verbose> |
| | |
| | | </dependency> |
| | | </dependencies> |
| | | </plugin> |
| | | <!-- <plugin>--> |
| | | <!-- <groupId>org.apache.maven.plugins</groupId>--> |
| | | <!-- <artifactId>maven-resources-plugin</artifactId>--> |
| | | <!-- <configuration>--> |
| | | <!-- <delimiters>@</delimiters>--> |
| | | <!-- <useDefaultDelimiters>false</useDefaultDelimiters>--> |
| | | <!-- </configuration>--> |
| | | <!-- </plugin>--> |
| | | </plugins> |
| | | |
| | | <resources> |
| | | <resource> |
| | | <filtering>true</filtering> |
| | | <directory>src/main/resources</directory> |
| | | <excludes> |
| | | <exclude>application-dev.yml</exclude> |
| | | <exclude>application-pro.yml</exclude> |
| | | <exclude>application.yml</exclude> |
| | | </excludes> |
| | | <!-- <excludes>--> |
| | | <!-- <exclude>application-dev.yml</exclude>--> |
| | | <!-- <exclude>application-pro.yml</exclude>--> |
| | | <!-- <exclude>application.yml</exclude>--> |
| | | <!-- </excludes>--> |
| | | </resource> |
| | | <resource> |
| | | <filtering>true</filtering> |
| | | <directory>src/main/resources</directory> |
| | | <includes> |
| | | <include>application-${profileActive}.yml</include> |
| | | <include>application.yml</include> |
| | | </includes> |
| | | </resource> |
| | | <!-- <resource>--> |
| | | <!-- <filtering>true</filtering>--> |
| | | <!-- <directory>src/main/resources</directory>--> |
| | | <!-- <includes>--> |
| | | <!-- <include>application-${profileActive}.yml</include>--> |
| | | <!-- <include>application.yml</include>--> |
| | | <!-- </includes>--> |
| | | <!-- </resource>--> |
| | | </resources> |
| | | </build> |
| | | |
| | |
| | | <properties> |
| | | <profileActive>pro</profileActive> |
| | | </properties> |
| | | <activation> |
| | | <activeByDefault>false</activeByDefault> |
| | | </activation> |
| | | </profile> |
| | | <profile> |
| | | <id>test</id> |
| | | <properties> |
| | | <profileActive>test</profileActive> |
| | | </properties> |
| | | </profile> |
| | | </profiles> |
| | | |
| | |
| | | |
| | | data class Info( |
| | | //åºæ¯ç¨æ·id |
| | | val userId: String?, |
| | | val userId: String?, |
| | | //é£ç¾½ç¯å¢ä¸åºæ¯å¯¹åºçç¨æ·id |
| | | val tzUserId: String?, |
| | | val tzUserId: String?, |
| | | //åºæ¯id |
| | | val sceneId: String?, |
| | | val sceneId: String?, |
| | | //åºæ¯åç§° |
| | | val sceneName: String?, |
| | | var sceneType: Constant.ScenseType, |
| | | var year: Int? = null, |
| | | val month: Int? = null, |
| | | val period: Int? = null, |
| | | val sTime: LocalDateTime? = null, |
| | | val eTime: LocalDateTime? = null, |
| | | val subTask: Subtask? = null, |
| | | val sceneIndex: Int? = null, |
| | | val online:Boolean = true |
| | | val sceneName: String?, |
| | | var sceneType: Constant.SceneType, |
| | | var year: Int? = null, |
| | | val month: Int? = null, |
| | | val period: Int? = null, |
| | | val sTime: LocalDateTime? = null, |
| | | val eTime: LocalDateTime? = null, |
| | | val subTask: Subtask? = null, |
| | | val sceneIndex: Int? = null, |
| | | val online:Boolean = true |
| | | ) |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package cn.flightfeather.supervision.business.autooutput |
| | | |
| | | import cn.flightfeather.supervision.business.autooutput.dataanalysis.* |
| | | import cn.flightfeather.supervision.business.autooutput.datasource.AopDataConfig |
| | | import cn.flightfeather.supervision.business.autooutput.score.AopCreditCode |
| | | import cn.flightfeather.supervision.business.autooutput.score.AopEvaluation |
| | | import cn.flightfeather.supervision.common.executor.BackgroundTaskCtrl |
| | | import cn.flightfeather.supervision.common.executor.BgTaskStatus |
| | | import cn.flightfeather.supervision.common.executor.BgTaskType |
| | | import cn.flightfeather.supervision.common.utils.Constant |
| | | import cn.flightfeather.supervision.domain.ds1.repository.TaskRep |
| | | import cn.flightfeather.supervision.lightshare.vo.AreaVo |
| | | import org.springframework.stereotype.Component |
| | | import java.time.LocalDate |
| | | |
| | | /** |
| | | * èªå¨è¯ä¼°ä»»å¡ç®¡ç |
| | | */ |
| | | @Component |
| | | class AopTaskCtrl( |
| | | private val aopEvaluation: AopEvaluation, |
| | | private val aopCreditCode: AopCreditCode, |
| | | private val jaCsDataAnalysis: JACsDataAnalysis, |
| | | private val xhFuDataAnalysis: XHFuDataAnalysis, |
| | | private val jsCsDataAnalysis: JSCsDataAnalysis, |
| | | private val jsMpDataAnalysis: JSMpDataAnalysis, |
| | | private val jsWhDataAnalysis: JSWhDataAnalysis, |
| | | private val backgroundTaskCtrl: BackgroundTaskCtrl, |
| | | private val taskRep: TaskRep, |
| | | ) { |
| | | private val dataAnalysisMap = mutableMapOf<String, MutableMap<Int, AopDataAnalysis<*>>>() |
| | | |
| | | init { |
| | | listOf("310106", "310104", "310116").forEach { dataAnalysisMap[it] = mutableMapOf() } |
| | | dataAnalysisMap["310106"]?.put(Constant.SceneType.TYPE1.value.toInt(), jaCsDataAnalysis) |
| | | dataAnalysisMap["310104"]?.put(Constant.SceneType.TYPE5.value.toInt(), xhFuDataAnalysis) |
| | | dataAnalysisMap["310116"]?.put(Constant.SceneType.TYPE1.value.toInt(), jsCsDataAnalysis) |
| | | dataAnalysisMap["310116"]?.put(Constant.SceneType.TYPE2.value.toInt(), jsWhDataAnalysis) |
| | | dataAnalysisMap["310116"]?.put(Constant.SceneType.TYPE3.value.toInt(), jsMpDataAnalysis) |
| | | } |
| | | |
| | | fun startNewTask(areaVo: AreaVo): BgTaskStatus { |
| | | val task = taskRep.findOneTask(areaVo) |
| | | val taskId = task?.tguid |
| | | if (taskId != null) { |
| | | val districtCode = areaVo.districtcode |
| | | val districtName = areaVo.districtname |
| | | val d = LocalDate.parse(areaVo.starttime) |
| | | val year = d.year |
| | | val month = d.monthValue |
| | | val sceneType = areaVo.scensetypeid?.toInt() ?: throw IllegalStateException("åºæ¯ç±»åæªè®¾ç½®ï¼æ æ³è¯ä¼°") |
| | | |
| | | val id = "${BgTaskType.AUTO_SCORE.name}-${districtCode}-${sceneType}" |
| | | val name = "${districtName}${Constant.SceneType.getDes(sceneType)}èªå¨è¯å" |
| | | val bgTask = backgroundTaskCtrl.startNewTask(BgTaskType.AUTO_SCORE, id, name) { |
| | | dataAnalysis(districtCode, sceneType, taskId, year, month) |
| | | |
| | | aopEvaluation.executeByTopTask(taskId, sceneType) |
| | | |
| | | aopCreditCode.execute(AopDataConfig( |
| | | year = year, |
| | | month = month, |
| | | districtName = districtName, |
| | | sceneType = sceneType, |
| | | period = 1 |
| | | )) |
| | | true |
| | | } |
| | | return bgTask.taskStatus |
| | | } else { |
| | | throw IllegalStateException("å·¡æ¥æ»ä»»å¡ä¸åå¨ï¼æ æ³è¯ä¼°") |
| | | } |
| | | } |
| | | |
| | | private fun dataAnalysis(districtCode: String?, sceneType: Int, taskId: String, year: Int, month: Int) { |
| | | val aopDataAnalysis = dataAnalysisMap[districtCode]?.get(sceneType) |
| | | aopDataAnalysis?.setResource(taskId, sceneType, year, month) |
| | | aopDataAnalysis?.execute() |
| | | } |
| | | } |
ÎļþÃû´Ó src/main/kotlin/cn/flightfeather/supervision/business/autooutput/score/AopDataAnalysis.kt ÐÞ¸Ä |
| | |
| | | package cn.flightfeather.supervision.business.autooutput.score |
| | | package cn.flightfeather.supervision.business.autooutput.dataanalysis |
| | | |
| | | import cn.flightfeather.supervision.business.autooutput.AopOutput |
| | | import cn.flightfeather.supervision.business.autooutput.datasource.AopDataConfig |
| | |
| | | ) { |
| | | |
| | | /** |
| | | * ç»è®¡ä¸é´åå¨ç»æ |
| | | * ç»è®¡æ°æ® 临æ¶åå¨ç»æ |
| | | */ |
| | | inner class TempResult( |
| | | var total: Double = .0, |
| | | var count: Int = 0, |
| | | ){ |
| | | fun avg(): Double { |
| | | var avg: Double = -1.0 |
| | | get() { |
| | | if (field == -1.0) { |
| | | field = avg() |
| | | } |
| | | return field |
| | | } |
| | | |
| | | private fun avg(): Double { |
| | | return if (count == 0) { |
| | | .0 |
| | | } else { |
| | |
| | | /** |
| | | * æ§è¡ç»è®¡é»è¾ |
| | | */ |
| | | fun execute() { |
| | | val dAvg = districtAvg(source) |
| | | fun execute(avg: Double? = null) { |
| | | //计ç®åºåå¼ |
| | | val dAvg = avg ?: districtAvg(source) |
| | | println("åå¼ï¼${dAvg}") |
| | | //循ç¯å¤çæ¯ä¸ªåºæ¯ |
| | | source?.loop { _, evaluationScene -> |
| | | //è·ååå§çæµæ°æ® |
| | | val dataList = fetchDataResources(evaluationScene) |
| | | //计ç®ç»è®¡ç»æ |
| | | val tempExceedTimes = TempResult() |
| | | val tempAvg = TempResult() |
| | | val tempMax = TempResult() |
| | | val tempMin = TempResult() |
| | | var tempExceedTimes = TempResult() |
| | | var tempAvg = TempResult() |
| | | var tempMax = TempResult() |
| | | var tempMin = TempResult() |
| | | dataList.forEach { |
| | | it.forEach {t -> |
| | | // çæµç¹æå¤å°è®¾å¤æ¶ï¼æ¯å°è®¾å¤åç¬ç»è®¡ï¼åå弿é«ç为ç»è®¡ç»æ |
| | | val _tempExceedTimes = TempResult() |
| | | val _tempAvg = TempResult() |
| | | val _tempMax = TempResult() |
| | | val _tempMin = TempResult() |
| | | it.forEach { t -> |
| | | t?.let { |
| | | exceedTimes(t, tempExceedTimes) |
| | | avg(t, tempAvg) |
| | | max(t, tempMax) |
| | | min(t, tempMin) |
| | | exceedTimes(t, _tempExceedTimes) |
| | | avg(t, _tempAvg) |
| | | max(t, _tempMax) |
| | | min(t, _tempMin) |
| | | } |
| | | } |
| | | // ä¿çå弿é«çä¸å°è®¾å¤ |
| | | if (_tempAvg.avg > tempAvg.avg) { |
| | | tempExceedTimes = _tempExceedTimes |
| | | tempAvg = _tempAvg |
| | | tempMax = _tempMax |
| | | tempMin = _tempMin |
| | | } |
| | | } |
| | | val dustDataResult = DustDataResult().apply { |
| | |
| | | drSceneName = evaluationScene.scene.value?.name |
| | | drTime = source?.config?.startTime |
| | | drExceedTimes = tempExceedTimes.count |
| | | drAvg = tempAvg.avg() |
| | | drAvg = tempAvg.avg |
| | | drMax = tempMax.total |
| | | drMin = tempMin.total |
| | | drOverAvgPer = overAvgRate(drAvg, dAvg) |
| | |
| | | /** |
| | | * è¶
æåå¼ç¾åæ¯ |
| | | */ |
| | | abstract fun overAvgRate(avg: Double, dAvg: Double?): Double |
| | | abstract fun overAvgRate(avg: Double, dAvg: Double?): Double? |
| | | |
| | | /** |
| | | * æ°æ®ä¸ªæ° |
ÎļþÃû´Ó src/main/kotlin/cn/flightfeather/supervision/business/autooutput/score/construction/JADataAnalysis.kt ÐÞ¸Ä |
| | |
| | | package cn.flightfeather.supervision.business.autooutput.score.construction |
| | | package cn.flightfeather.supervision.business.autooutput.dataanalysis |
| | | |
| | | import cn.flightfeather.supervision.business.autooutput.AopOutput |
| | | import cn.flightfeather.supervision.business.autooutput.datasource.AopDataSource |
| | | import cn.flightfeather.supervision.business.autooutput.datasource.AopDbMapper |
| | | import cn.flightfeather.supervision.business.autooutput.datasource.AopSceneTypeCheck |
| | | import cn.flightfeather.supervision.business.autooutput.score.AopDataAnalysis |
| | | import cn.flightfeather.supervision.domain.ds2.entity.DustSiteMap |
| | | import cn.flightfeather.supervision.domain.ds2.entity.HourDustData |
| | | import cn.flightfeather.supervision.domain.ds2.mapper.DustSiteMapMapper |
| | |
| | | * éå®å·¥å°æ¬å°çæµæ°æ®ç»è®¡ |
| | | */ |
| | | @Component |
| | | class JADataAnalysis( |
| | | class JACsDataAnalysis( |
| | | aopDbMapper: AopDbMapper, |
| | | aopSceneTypeCheck: AopSceneTypeCheck, |
| | | aopOutput: AopOutput, |
| | |
| | | var count = 0 |
| | | hourDustDataMapper.selectByExample(Example(HourDustData::class.java).apply { |
| | | createCriteria().andBetween("lst", source?.config?.startTime, source?.config?.endTime) |
| | | .andEqualTo("flag", "N") |
| | | }).forEach { |
| | | it?.dustvalue?.let { v -> |
| | | total += v |
| | |
| | | } |
| | | } |
| | | |
| | | override fun overAvgRate(avg: Double, dAvg: Double?): Double { |
| | | override fun overAvgRate(avg: Double, dAvg: Double?): Double? { |
| | | return if (dAvg != null) { |
| | | round(((avg - dAvg) / dAvg) * 1000) / 1000 |
| | | } else { |
| | | .0 |
| | | null |
| | | } |
| | | } |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package cn.flightfeather.supervision.business.autooutput.dataanalysis |
| | | |
| | | import cn.flightfeather.supervision.business.autooutput.AopOutput |
| | | import cn.flightfeather.supervision.business.autooutput.datasource.AopDbMapper |
| | | import cn.flightfeather.supervision.business.autooutput.datasource.AopSceneTypeCheck |
| | | import cn.flightfeather.supervision.domain.ds3.enum.JSSceneType |
| | | import cn.flightfeather.supervision.domain.ds3.mapper.JSDustDataMapper |
| | | import cn.flightfeather.supervision.domain.ds3.mapper.JSDustSiteMapMapper |
| | | import org.springframework.stereotype.Component |
| | | |
| | | /** |
| | | * é山工尿¬å°çæµæ°æ®ç»è®¡ |
| | | */ |
| | | @Component |
| | | class JSCsDataAnalysis( |
| | | aopDbMapper: AopDbMapper, |
| | | aopSceneTypeCheck: AopSceneTypeCheck, |
| | | aopOutput: AopOutput, |
| | | jsDustDataMapper: JSDustDataMapper, |
| | | jsDustSiteMapMapper: JSDustSiteMapMapper |
| | | ) : JSDustDataAnalysis(aopDbMapper, aopSceneTypeCheck, aopOutput, jsDustDataMapper, jsDustSiteMapMapper){ |
| | | |
| | | override var sceneType: JSSceneType = JSSceneType.Construction |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package cn.flightfeather.supervision.business.autooutput.dataanalysis |
| | | |
| | | import cn.flightfeather.supervision.business.autooutput.AopOutput |
| | | import cn.flightfeather.supervision.business.autooutput.datasource.AopDataSource |
| | | import cn.flightfeather.supervision.business.autooutput.datasource.AopDbMapper |
| | | import cn.flightfeather.supervision.business.autooutput.datasource.AopSceneTypeCheck |
| | | import cn.flightfeather.supervision.domain.ds3.entity.JSDustData |
| | | import cn.flightfeather.supervision.domain.ds3.entity.JSDustSiteMap |
| | | import cn.flightfeather.supervision.domain.ds3.enum.JSSceneType |
| | | import cn.flightfeather.supervision.domain.ds3.mapper.JSDustDataMapper |
| | | import cn.flightfeather.supervision.domain.ds3.mapper.JSDustSiteMapMapper |
| | | import tk.mybatis.mapper.entity.Example |
| | | import java.time.Duration |
| | | import java.time.LocalDateTime |
| | | import java.time.ZoneId |
| | | import kotlin.math.round |
| | | |
| | | /** |
| | | * éå±±æ¬å°çæµæ°æ®ç»è®¡ |
| | | */ |
| | | abstract class JSDustDataAnalysis( |
| | | aopDbMapper: AopDbMapper, |
| | | aopSceneTypeCheck: AopSceneTypeCheck, |
| | | aopOutput: AopOutput, |
| | | private val jsDustDataMapper: JSDustDataMapper, |
| | | private val jsDustSiteMapMapper: JSDustSiteMapMapper, |
| | | ) : AopDataAnalysis<JSDustData>(aopDbMapper, aopSceneTypeCheck, aopOutput){ |
| | | |
| | | abstract var sceneType: JSSceneType |
| | | |
| | | override fun districtAvg(source: AopDataSource?): Double? { |
| | | var total = .0 |
| | | var count = 0 |
| | | |
| | | var page = 0 |
| | | val perPage = 20000 |
| | | var hasNextPage = false |
| | | do { |
| | | val res = jsDustDataMapper |
| | | .getDataBySceneType(source?.config?.startTime, source?.config?.endTime, sceneType.value, |
| | | page * perPage, perPage) |
| | | res.forEach { |
| | | it?.dustValue?.let { v -> |
| | | total += v |
| | | count++ |
| | | } |
| | | } |
| | | page++ |
| | | hasNextPage = res.isNotEmpty() |
| | | println("åå¼è®¡ç®ï¼å½å页ç $page") |
| | | } while (hasNextPage) |
| | | |
| | | return if (count == 0) { |
| | | .0 |
| | | } else { |
| | | round((total / count) * 1000) / 1000 |
| | | } |
| | | } |
| | | |
| | | override fun fetchDataResources(evaluationScene: AopDataSource.EvaluationScene): List<List<JSDustData?>> { |
| | | val dustSiteMaps = jsDustSiteMapMapper.selectByExample(Example(JSDustSiteMap::class.java).apply { |
| | | createCriteria().andEqualTo("svUserId", evaluationScene.userInfo.value?.guid) |
| | | .andIsNotNull("jsDeviceCode") |
| | | }) |
| | | if (dustSiteMaps.isEmpty()) return emptyList() |
| | | |
| | | val mnCodeList = dustSiteMaps.map { it?.jsDeviceCode } |
| | | val map = mutableMapOf<String?, MutableList<JSDustData?>>() |
| | | jsDustDataMapper.selectByExample(Example(JSDustData::class.java).apply { |
| | | createCriteria().andBetween("lst", evaluationScene.config?.startTime, evaluationScene.config?.endTime) |
| | | .andIn("mnCode", mnCodeList) |
| | | }).forEach { |
| | | if (!map.containsKey(it?.mnCode)) { |
| | | map[it?.mnCode] = mutableListOf() |
| | | } |
| | | map[it?.mnCode]?.add(it) |
| | | } |
| | | val res = mutableListOf<List<JSDustData?>>() |
| | | map.forEach { (_, u) -> |
| | | res.add(u) |
| | | } |
| | | return res |
| | | } |
| | | |
| | | override fun exceedTimes(data: JSDustData, t: TempResult) { |
| | | data.dustValue?.let { |
| | | if (it >= 1) { |
| | | t.count++ |
| | | } |
| | | } |
| | | } |
| | | |
| | | override fun avg(data: JSDustData, t: TempResult) { |
| | | data.dustValue?.let { |
| | | t.total += it |
| | | t.count++ |
| | | } |
| | | } |
| | | |
| | | override fun max(data: JSDustData, t: TempResult) { |
| | | data.dustValue?.let { |
| | | if (it > t.total) { |
| | | t.total = it |
| | | } |
| | | } |
| | | } |
| | | |
| | | override fun min(data: JSDustData, t: TempResult) { |
| | | data.dustValue?.let { |
| | | if (t.count == 0 || it < t.total) { |
| | | t.total = it |
| | | } |
| | | // éè¿t.count æ¥å¤å®æ¯å¦æ¯åå§åç¶æ |
| | | if (t.count == 0) t.count = 1 |
| | | } |
| | | } |
| | | |
| | | override fun overAvgRate(avg: Double, dAvg: Double?): Double? { |
| | | return if (dAvg != null) { |
| | | round(((avg - dAvg) / dAvg) * 1000) / 1000 |
| | | } else { |
| | | null |
| | | } |
| | | } |
| | | |
| | | override fun effectiveRate( |
| | | dataList: List<List<JSDustData?>>, |
| | | evaluationScene: AopDataSource.EvaluationScene, |
| | | ): Double { |
| | | if (dataList.isEmpty()) return .0 |
| | | |
| | | val st = LocalDateTime.ofInstant(evaluationScene.config?.startTime?.toInstant(), ZoneId.systemDefault()) |
| | | val et = LocalDateTime.ofInstant(evaluationScene.config?.endTime?.toInstant(), ZoneId.systemDefault()) |
| | | val days = Duration.between(st, et).toDays() + 1 |
| | | |
| | | return if (days == 0L) { |
| | | .0 |
| | | } else { |
| | | round((count(dataList) / (dataList.size * days * 24 * 4).toDouble()) * 1000) / 1000 |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package cn.flightfeather.supervision.business.autooutput.dataanalysis |
| | | |
| | | import cn.flightfeather.supervision.business.autooutput.AopOutput |
| | | import cn.flightfeather.supervision.business.autooutput.datasource.AopDbMapper |
| | | import cn.flightfeather.supervision.business.autooutput.datasource.AopSceneTypeCheck |
| | | import cn.flightfeather.supervision.domain.ds3.enum.JSSceneType |
| | | import cn.flightfeather.supervision.domain.ds3.mapper.JSDustDataMapper |
| | | import cn.flightfeather.supervision.domain.ds3.mapper.JSDustSiteMapMapper |
| | | import org.springframework.stereotype.Component |
| | | |
| | | /** |
| | | * éå±±æ
æç«æ¬å°çæµæ°æ®ç»è®¡ |
| | | */ |
| | | @Component |
| | | class JSMpDataAnalysis( |
| | | aopDbMapper: AopDbMapper, |
| | | aopSceneTypeCheck: AopSceneTypeCheck, |
| | | aopOutput: AopOutput, |
| | | jsDustDataMapper: JSDustDataMapper, |
| | | jsDustSiteMapMapper: JSDustSiteMapMapper, |
| | | ) : JSDustDataAnalysis(aopDbMapper, aopSceneTypeCheck, aopOutput, jsDustDataMapper, jsDustSiteMapMapper) { |
| | | |
| | | override var sceneType: JSSceneType = JSSceneType.MixingPlant |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package cn.flightfeather.supervision.business.autooutput.dataanalysis |
| | | |
| | | import cn.flightfeather.supervision.business.autooutput.AopOutput |
| | | import cn.flightfeather.supervision.business.autooutput.datasource.AopDbMapper |
| | | import cn.flightfeather.supervision.business.autooutput.datasource.AopSceneTypeCheck |
| | | import cn.flightfeather.supervision.domain.ds3.enum.JSSceneType |
| | | import cn.flightfeather.supervision.domain.ds3.mapper.JSDustDataMapper |
| | | import cn.flightfeather.supervision.domain.ds3.mapper.JSDustSiteMapMapper |
| | | import org.springframework.stereotype.Component |
| | | |
| | | /** |
| | | * éå±±ç 头æ¬å°çæµæ°æ®ç»è®¡ |
| | | */ |
| | | @Component |
| | | class JSWhDataAnalysis( |
| | | aopDbMapper: AopDbMapper, |
| | | aopSceneTypeCheck: AopSceneTypeCheck, |
| | | aopOutput: AopOutput, |
| | | jsDustDataMapper: JSDustDataMapper, |
| | | jsDustSiteMapMapper: JSDustSiteMapMapper, |
| | | ) : JSDustDataAnalysis(aopDbMapper, aopSceneTypeCheck, aopOutput, jsDustDataMapper, jsDustSiteMapMapper) { |
| | | |
| | | override var sceneType: JSSceneType = JSSceneType.Wharf |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package cn.flightfeather.supervision.business.autooutput.dataanalysis |
| | | |
| | | import cn.flightfeather.supervision.business.autooutput.AopOutput |
| | | import cn.flightfeather.supervision.business.autooutput.datasource.AopDataSource |
| | | import cn.flightfeather.supervision.business.autooutput.datasource.AopDbMapper |
| | | import cn.flightfeather.supervision.business.autooutput.datasource.AopSceneTypeCheck |
| | | import cn.flightfeather.supervision.domain.ds3.entity.FumeDailyAnalysis |
| | | import cn.flightfeather.supervision.domain.ds3.entity.FumeExceptionData |
| | | import cn.flightfeather.supervision.domain.ds3.entity.FumeSiteMap |
| | | import cn.flightfeather.supervision.domain.ds3.mapper.FumeDailyAnalysisMapper |
| | | import cn.flightfeather.supervision.domain.ds3.mapper.FumeExceptionDataMapper |
| | | import cn.flightfeather.supervision.domain.ds3.mapper.FumeSiteMapMapper |
| | | import org.springframework.stereotype.Component |
| | | import tk.mybatis.mapper.entity.Example |
| | | import kotlin.math.round |
| | | |
| | | /** |
| | | * 徿±æ²¹ççæµæ°æ®ç»è®¡ |
| | | */ |
| | | @Component |
| | | class XHFuDataAnalysis( |
| | | aopDbMapper: AopDbMapper, |
| | | aopSceneTypeCheck: AopSceneTypeCheck, |
| | | aopOutput: AopOutput, |
| | | private val fumeSiteMapMapper: FumeSiteMapMapper, |
| | | private val fumeDailyAnalysisMapper: FumeDailyAnalysisMapper, |
| | | private val fumeExceptionDataMapper: FumeExceptionDataMapper, |
| | | ): AopDataAnalysis<FumeDailyAnalysis>(aopDbMapper, aopSceneTypeCheck, aopOutput) { |
| | | |
| | | // æ²¹çæ°æ®ææ åºåå¼çè®¡ç® |
| | | override fun districtAvg(source: AopDataSource?): Double? { |
| | | return null |
| | | } |
| | | |
| | | private fun getDeviceCodes(evaluationScene: AopDataSource.EvaluationScene): List<String?> { |
| | | val fumeSiteMaps = fumeSiteMapMapper.selectByExample(Example(FumeSiteMap::class.java).apply { |
| | | createCriteria().andEqualTo("svUserId", evaluationScene.userInfo.value?.guid) |
| | | .andIsNotNull("xhDeviceCode") |
| | | }) |
| | | return fumeSiteMaps.map { it?.xhDeviceCode } |
| | | } |
| | | |
| | | override fun fetchDataResources(evaluationScene: AopDataSource.EvaluationScene): List<List<FumeDailyAnalysis?>> { |
| | | val deviceCodeList = getDeviceCodes(evaluationScene) |
| | | val map = mutableMapOf<String?, MutableList<FumeDailyAnalysis?>>() |
| | | fumeDailyAnalysisMapper.selectByExample(Example(FumeDailyAnalysis::class.java).apply { |
| | | createCriteria().andBetween("fumeDate", evaluationScene.config?.startTime, evaluationScene.config?.endTime) |
| | | .andIn("fumeDevId", deviceCodeList) |
| | | }).forEach { |
| | | if (!map.containsKey(it?.fumeDevId)) { |
| | | map[it?.fumeDevId] = mutableListOf() |
| | | } |
| | | map[it?.fumeDevId]?.add(it) |
| | | } |
| | | val res = mutableListOf<List<FumeDailyAnalysis?>>() |
| | | map.forEach { (_, u) -> |
| | | res.add(u) |
| | | } |
| | | return res |
| | | } |
| | | |
| | | fun fetchExceptionData(evaluationScene: AopDataSource.EvaluationScene): List<FumeExceptionData?> { |
| | | val deviceCodeList = getDeviceCodes(evaluationScene) |
| | | return if (deviceCodeList.isEmpty()) { |
| | | emptyList() |
| | | } else { |
| | | val code = deviceCodeList[0] |
| | | fumeExceptionDataMapper.selectByExample(Example(FumeExceptionData::class.java).apply { |
| | | createCriteria().andBetween("beginTime", evaluationScene.config?.startTime, evaluationScene.config?.endTime) |
| | | .andEqualTo("devId", code) |
| | | .andEqualTo("exception", "æ°æ®å¼å¸¸") |
| | | .andEqualTo("exceptionType", "0") |
| | | }) |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * æ²¹çè¶
æ æ° |
| | | * åªç»è®¡éç¹æ¶æ®µå
ï¼ä¸åãæä¸ï¼çè¶
æ æ
åµ |
| | | */ |
| | | override fun exceedTimes(data: FumeDailyAnalysis, t: TempResult) { |
| | | data.noonExceedingNum?.toInt()?.let { |
| | | t.count += it |
| | | } |
| | | data.nightExceedingNum?.toInt()?.let { |
| | | t.count += it |
| | | } |
| | | } |
| | | |
| | | override fun avg(data: FumeDailyAnalysis, t: TempResult) { |
| | | data.fumeDayAverage?.let { |
| | | t.total += it |
| | | t.count++ |
| | | } |
| | | } |
| | | |
| | | override fun max(data: FumeDailyAnalysis, t: TempResult) { |
| | | data.fumeDayMax?.let { |
| | | if (it > t.total) { |
| | | t.total = it |
| | | } |
| | | } |
| | | } |
| | | |
| | | override fun min(data: FumeDailyAnalysis, t: TempResult) { |
| | | data.fumeDayMin?.let { |
| | | if (t.count == 0 || it < t.total) { |
| | | t.total = it |
| | | } |
| | | // éè¿t.count æ¥å¤å®æ¯å¦æ¯åå§åç¶æ |
| | | if (t.count == 0) t.count = 1 |
| | | } |
| | | } |
| | | |
| | | override fun overAvgRate(avg: Double, dAvg: Double?): Double? { |
| | | return null |
| | | } |
| | | |
| | | override fun effectiveRate( |
| | | dataList: List<List<FumeDailyAnalysis?>>, |
| | | evaluationScene: AopDataSource.EvaluationScene, |
| | | ): Double { |
| | | var total = .0 |
| | | var count = 0 |
| | | dataList.forEach {list -> |
| | | list.forEach { |
| | | val noon = it?.noonOnlineRate?.removeSuffix("%")?.toDouble()?.div(100) |
| | | val night = it?.nightOnlineRate?.removeSuffix("%")?.toDouble()?.div(100) |
| | | noon?.let { |
| | | total += noon |
| | | count++ |
| | | } |
| | | night?.let { |
| | | total += night |
| | | count++ |
| | | } |
| | | } |
| | | } |
| | | return if (count == 0) { |
| | | .0 |
| | | } else { |
| | | round((total / count) * 1000) / 1000 |
| | | } |
| | | } |
| | | } |
| | |
| | | * æ°æ®æ¥æºåæ° |
| | | */ |
| | | data class AopDataConfig( |
| | | val startTime: Date? = null, |
| | | val endTime: Date? = null, |
| | | var startTime: Date? = null, |
| | | var endTime: Date? = null, |
| | | |
| | | val year: Int? = null, |
| | | val month: Int? = null, |
| | |
| | | val topTaskGuid: String? = null, |
| | | |
| | | /** |
| | | * åºæ¯ç±»åæ ¹æ®ä¸åç³»ç»éç¨ä¸åçå¼ï¼åè[Constant.ScenseType] |
| | | * åºæ¯ç±»åæ ¹æ®ä¸åç³»ç»éç¨ä¸åçå¼ï¼åè[Constant.SceneType] |
| | | */ |
| | | var sceneType: Int? = null, |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | fun setResource(subtask: Subtask) { |
| | | val scene = aopDbMapper.scenseMapper.selectByPrimaryKey(subtask.scenseid) |
| | | val sceneType = scene.typeid?.toInt() |
| | | val config = AopDataConfig(topTaskGuid = subtask.tguid, sceneType = sceneType, |
| | | districtName = subtask.districtname, townCode = subtask.towncode) |
| | | evaluationScene.config = config |
| | | // val check = aopSceneTypeCheck.checkSceneType(sceneType) |
| | | this.mode = 0 |
| | | sceneSourceList.clear() |
| | | sceneSourceList.add(scene) |
| | | } |
| | | |
| | | /** |
| | | * è½®è¯¢æ°æ®æº |
| | | */ |
| | |
| | | aopDbMapper.scenseMapper.selectByExample(Example(Scense::class.java).apply { |
| | | createCriteria() |
| | | .andIn("guid", taskSceneIdList) |
| | | // .andEqualTo("provincecode", config.provinceCode) |
| | | // .andEqualTo("citycode", config.cityCode) |
| | | // .andEqualTo("districtcode", config.districtCode) |
| | | // .andEqualTo("towncode", config.townCode) |
| | | // .andEqualTo("typeid", config.sceneType) |
| | | // .andNotEqualTo("extension1", '0') |
| | | })?.let { sceneSourceList.addAll(it) } |
| | | } |
| | | |
| | |
| | | val baseScene = InfoProxy<BaseScene> {_,_ -> |
| | | return@InfoProxy when (config?.sceneType.toString()) { |
| | | // çç®¡ç³»ç» |
| | | Constant.ScenseType.TYPE1.value -> { |
| | | Constant.SceneType.TYPE1.value -> { |
| | | aopDbMapper.sceneConstructionSiteMapper.selectByPrimaryKey(scene.value?.guid) |
| | | } |
| | | Constant.ScenseType.TYPE2.value -> { |
| | | Constant.SceneType.TYPE2.value -> { |
| | | aopDbMapper.sceneWharfMapper.selectByPrimaryKey(scene.value?.guid) |
| | | } |
| | | Constant.ScenseType.TYPE3.value -> { |
| | | Constant.SceneType.TYPE3.value -> { |
| | | aopDbMapper.sceneMixingPlantMapper.selectByPrimaryKey(scene.value?.guid) |
| | | } |
| | | Constant.ScenseType.TYPE14.value -> { |
| | | Constant.SceneType.TYPE14.value -> { |
| | | aopDbMapper.sceneStorageYardMapper.selectByPrimaryKey(scene.value?.guid) |
| | | } |
| | | // å°è´¦ç³»ç» |
| | | Constant.ScenseType.TYPE5.value -> { |
| | | Constant.SceneType.TYPE5.value -> { |
| | | aopDbMapper.restaurantBaseInfoMapper.selectByPrimaryKey(userInfoTZ.value?.guid) |
| | | } |
| | | Constant.ScenseType.TYPE6.value -> { |
| | | Constant.SceneType.TYPE6.value -> { |
| | | aopDbMapper.vehicleBaseInfoMapper.selectByPrimaryKey(userInfoTZ.value?.guid) |
| | | } |
| | | else -> null |
| | |
| | | |
| | | //å¿
å¡«å°è´¦æ°é |
| | | val ledgerCount = InfoProxy<Int>(config?.sceneType.toString()) {_, cacheMap -> |
| | | val tzSceneType = Constant.ScenseType.typeMap(scene.value?.typeid) |
| | | val tzSceneType = Constant.SceneType.typeMap(scene.value?.typeid) |
| | | val list = aopDbMapper.ledgerSubTypeMapper.selectCountByExample(Example(LedgerSubType::class.java).apply { |
| | | createCriteria().andEqualTo("lScenetype", tzSceneType).andEqualTo("lNeedupdate", true) |
| | | }) |
| | |
| | | * åºæ¯ç±»åå¤å® |
| | | * @return å¤æç»æï¼ï¼æ¯å¦ä½¿ç¨æ¬ç³»ç»å®ä¹ï¼ç±»åå¼ï¼ |
| | | */ |
| | | fun checkSceneType(sceneType: Int): Pair<Boolean, Int> { |
| | | fun checkSceneType(sceneType: Int?): Pair<Boolean, Int?> { |
| | | // TODO: 2023/9/7 éè¿æ°æ®åºé
置表å³å®å½åç±»åçæç»ç±»åå®ä¹ |
| | | |
| | | // FIXME: 2023/9/7 ææ¶åæ»ç¸å
³é
ç½® |
| | | return if (sceneType.toString() == Constant.ScenseType.TYPE6.value) { |
| | | Pair(false, Constant.ScenseType.typeMap(sceneType.toByte())!!.toInt()) |
| | | return if (sceneType.toString() == Constant.SceneType.TYPE6.value) { |
| | | Pair(false, Constant.SceneType.typeMap(sceneType?.toByte())!!.toInt()) |
| | | } else { |
| | | Pair(true, sceneType) |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package cn.flightfeather.supervision.business.autooutput.score |
| | | |
| | | import cn.flightfeather.supervision.business.autooutput.datasource.AopDataConfig |
| | | import cn.flightfeather.supervision.common.utils.Constant |
| | | import cn.flightfeather.supervision.domain.ds1.repository.EvaluationRep |
| | | import cn.flightfeather.supervision.domain.ds2.entity.UserinfoTZ |
| | | import cn.flightfeather.supervision.domain.ds2.repository.OverallEvaluationRep |
| | | import cn.flightfeather.supervision.domain.ds2.repository.UserInfoTZRep |
| | | import cn.flightfeather.supervision.domain.ds2.repository.UserMapRep |
| | | import org.springframework.stereotype.Component |
| | | import java.time.LocalDate |
| | | |
| | | /** |
| | | * æ ¹æ®èªå¨è¯ä¼°[AopEvaluation]ç»æçæç¯ä¿¡ç |
| | | */ |
| | | @Component |
| | | class AopCreditCode( |
| | | private val userInfoTZRep: UserInfoTZRep, |
| | | private val userMapRep: UserMapRep, |
| | | private val evaluationRep: EvaluationRep, |
| | | private val overallEvaluationRep: OverallEvaluationRep, |
| | | ) { |
| | | |
| | | fun execute(config: AopDataConfig) { |
| | | if (config.year == null || config.month == null) throw IllegalStateException("ç¯ä¿¡ç è¯ä¼°æ¶å¿
é¡»ä¼ éæ¶é´æ¡ä»¶!") |
| | | // æ¾å°é£ç¾½ç¯å¢ä¸éè¦çæç¯ä¿¡ç çææç«ç¹ |
| | | val sceneType = Constant.SceneType.getByValue(config.sceneType.toString()) |
| | | val userList = findUsers(config.districtName, sceneType) |
| | | val date = LocalDate.of(config.year, config.month, 1) |
| | | val endDate = date.plusMonths(config.period.toLong() - 1) |
| | | userList.forEach { |
| | | userMapRep.findFromSupervision(it)?.let { s -> |
| | | // ä»é£ç¾½ç管系ç»ä¸æ¥æ¾è¯å |
| | | val e = evaluationRep.findByScene(s.guid, date) |
| | | e?.resultscorebef?.toInt()?.let {score -> |
| | | // æ ¹æ®è¯åçæå¯¹åºçç¯ä¿¡ç |
| | | overallEvaluationRep.insertOrUpdateOne(it?.guid, score, sceneType, date, endDate) |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | private fun findUsers(districtName: String?, type: Constant.SceneType): List<UserinfoTZ?> { |
| | | return userInfoTZRep.findEnterpriseUser(districtName, type) |
| | | } |
| | | } |
| | |
| | | import cn.flightfeather.supervision.common.utils.UUIDGenerator |
| | | import cn.flightfeather.supervision.domain.ds1.entity.Evaluation |
| | | import cn.flightfeather.supervision.domain.ds1.entity.Itemevaluation |
| | | import cn.flightfeather.supervision.domain.ds1.entity.Subtask |
| | | import org.springframework.stereotype.Component |
| | | import java.util.* |
| | | import kotlin.math.abs |
| | |
| | | */ |
| | | @Component |
| | | class AopEvaluation( |
| | | private val aopOutput: AopOutput, |
| | | private val aopDbMapper: AopDbMapper, |
| | | private val aopSceneTypeCheck: AopSceneTypeCheck, |
| | | private val aopOutput: AopOutput, |
| | | csScoreItem1: CsScoreItem1, |
| | | csScoreItem2: CsScoreItem2, |
| | | mpScoreItem1: MpScoreItem1, |
| | |
| | | whScoreItem1: WhScoreItem1, |
| | | whScoreItem2: WhScoreItem2, |
| | | reScoreItem5: ReScoreItem5, |
| | | reScoreItem7: ReScoreItem7, |
| | | // FIXME: 2023/12/29 å å»ç¹æ®è¯ä¼°è§å |
| | | // reScoreItem7: ReScoreItem7, |
| | | reScoreItem8: ReScoreItem8, |
| | | reScoreItem9: ReScoreItem9, |
| | | reScoreItem10: ReScoreItem10, |
| | | reScoreItem11: ReScoreItem11, |
| | | ) { |
| | | |
| | | //æ°æ®æº |
| | | private var source: AopDataSource? = null |
| | | //ç¹å®è¯å项ï¼é¤äºç»ä¸çæ ¹æ®å·¡æ¥é®é¢ç´æ¥æ£åå¤ï¼æç¹å®çæ£åé»è¾çè¯ä¼°é¡¹ï¼ |
| | | private val itemList = mutableListOf<ScoreItem>() |
| | | |
| | |
| | | add(whScoreItem1) |
| | | add(whScoreItem2) |
| | | add(reScoreItem5) |
| | | add(reScoreItem7) |
| | | // add(reScoreItem7) |
| | | add(reScoreItem8) |
| | | add(reScoreItem9) |
| | | add(reScoreItem10) |
| | |
| | | } |
| | | } |
| | | |
| | | fun setResource(topTaskGuid: String?, sceneType: Int, districtName: String? = null, townCode: String? = null) { |
| | | source = AopDataSource(aopDbMapper, aopSceneTypeCheck) |
| | | source?.setResource(topTaskGuid, sceneType, districtName, townCode) |
| | | fun executeByTopTask(topTaskGuid: String?, sceneType: Int, districtName: String? = null, townCode: String? = null) { |
| | | val source = setResource(topTaskGuid, sceneType, districtName, townCode) |
| | | execute(source) |
| | | } |
| | | |
| | | /** |
| | | * 对ç¹å®çå·¡æ¥ä»»å¡è¿è¡åç¬è¯å |
| | | */ |
| | | fun executeBySubTask(subTask:Subtask) { |
| | | val source = setResource(subTask) |
| | | execute(source) |
| | | } |
| | | |
| | | private fun setResource(subTask: Subtask): AopDataSource { |
| | | val source = AopDataSource(aopDbMapper, aopSceneTypeCheck) |
| | | source.setResource(subTask) |
| | | return source |
| | | } |
| | | |
| | | private fun setResource( |
| | | topTaskGuid: String?, |
| | | sceneType: Int, |
| | | districtName: String?, |
| | | townCode: String?, |
| | | ): AopDataSource { |
| | | val source = AopDataSource(aopDbMapper, aopSceneTypeCheck) |
| | | source.setResource(topTaskGuid, sceneType, districtName, townCode) |
| | | return source |
| | | } |
| | | |
| | | /** |
| | | * æ§è¡è¯åé»è¾ |
| | | */ |
| | | fun execute() { |
| | | private fun execute(source: AopDataSource) { |
| | | //è·åæ°æ®æºï¼å¾
è¯ä¼°çåºæ¯ï¼ |
| | | //循ç¯å¤çæ¯ä¸ªåºæ¯ |
| | | source?.loop {index, evaluationScene -> |
| | | source.loop {index, evaluationScene -> |
| | | if (evaluationScene.noRecord()) return@loop |
| | | |
| | | itemGrade(index, evaluationScene) |
| | |
| | | aopOutput.toDbEvaluation(evaluationScene, this) |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | /** |
| | |
| | | * @param size ä¼ å
¥è¯åæ¡ç®çæ°éï¼è¯åæ¡ç®æç
§ä¸å®è§åè¿è¡æåº |
| | | * @return è¿åéè¦æ£åçè¯åæ¡ç®çåºå· |
| | | */ |
| | | abstract fun otherProblem(size: Int): Int? |
| | | abstract fun otherProblem(size: Int): List<Int>? |
| | | |
| | | /** |
| | | * èªå¨è¯å计ç®é»è¾ |
| | |
| | | return |
| | | } |
| | | |
| | | otherProblem(rulePair?.second!!.size)?.let {i-> rulePair?.second!![i].getScore() } |
| | | otherProblem(rulePair?.second!!.size)?.let { it.forEach {i -> |
| | | rulePair?.second!![i].getScore() |
| | | } } |
| | | |
| | | ScoreUtil.subRuleCal(rulePair) |
| | | } |
| | |
| | | |
| | | import cn.flightfeather.supervision.business.Info |
| | | import cn.flightfeather.supervision.business.autooutput.datasource.AopDataSource |
| | | import cn.flightfeather.supervision.common.utils.ExcelUtil |
| | | import cn.flightfeather.supervision.common.utils.UUIDGenerator |
| | | import cn.flightfeather.supervision.domain.ds1.entity.Evaluationrule |
| | | import cn.flightfeather.supervision.domain.ds1.entity.Evaluationsubrule2 |
| | | import cn.flightfeather.supervision.domain.ds1.entity.Inspection |
| | | import cn.flightfeather.supervision.domain.ds1.entity.Itemevaluation |
| | | import org.apache.poi.hssf.util.HSSFColor |
| | | import kotlin.math.abs |
| | | |
| | | /** |
| | |
| | | value = itemRule.extension1 ?: "0" |
| | | extension1 = (itemRule.extension1 != null).toString() |
| | | } |
| | | |
| | | /** |
| | | * åæ°è½¬æ¢ç¯ä¿¡ç |
| | | */ |
| | | fun scoreToCredit(s: Int?): Pair<Int?, String?> { |
| | | return when (s) { |
| | | in 0..59 -> Pair(2, "红ç ") |
| | | in 60..89 -> Pair(1, "é»ç ") |
| | | in 90..100 -> Pair(0, "绿ç ") |
| | | null -> Pair(null, null) |
| | | else -> Pair(-1, "è¶
åºèå´") |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * åæ°è½¬æ¢è§èç级 |
| | | */ |
| | | fun scoreToStandard() { |
| | | |
| | | } |
| | | } |
| | |
| | | * 1.é®é¢é¨åæ´æ¹æä¸åæ¶æä¾ææ |
| | | * 2.é®é¢æ æ´æ¹ |
| | | */ |
| | | override fun otherProblem(size: Int): Int? { |
| | | override fun otherProblem(size: Int): List<Int>? { |
| | | val p = problemlistMapper.selectByExample(Example(Problemlist::class.java).apply { |
| | | createCriteria().andEqualTo("stguid", evaluationScene.subTask.value?.stguid) |
| | | // .andGreaterThanOrEqualTo("time", info.sTime) |
| | |
| | | } |
| | | } |
| | | return when { |
| | | changed == 0 && total > 0 -> 1 |
| | | changed < total -> 0 |
| | | changed == 0 && total > 0 -> listOf(1) |
| | | changed < total -> listOf(0) |
| | | else -> null |
| | | } |
| | | } |
| | |
| | | * 1.çæµæ°æ®åºç°åæ¥å以䏿æè¶
æ |
| | | * 2.çæµæ°æ®æåå¼è¶
åºåæåå¼20%ä»¥ä¸ææ°æ®ææ¾å¼å¸¸ |
| | | */ |
| | | override fun otherProblem(size: Int): Int? { |
| | | override fun otherProblem(size: Int): List<Int>? { |
| | | val time = evaluationScene.subTask.value?.planstarttime |
| | | val lt = LocalDateTime.ofInstant(time?.toInstant(), ZoneId.systemDefault()) |
| | | val st = lt.withDayOfMonth(1).withHour(0).withMinute(0).withSecond(0) |
| | |
| | | .andEqualTo("drSceneId", evaluationScene.scene.value?.guid) |
| | | }) |
| | | |
| | | var result: Int? = null |
| | | var result = mutableListOf<Int>() |
| | | r.forEach { |
| | | if (it == null) return@forEach |
| | | if (it.drExceedTimes > 0) { |
| | | result = 0 |
| | | result.add(0) |
| | | } |
| | | if (it.drOverAvgPer > 0.2) { |
| | | result = 1 |
| | | result.add(1) |
| | | } |
| | | } |
| | | |
| | |
| | | * 1.é®é¢é¨åæ´æ¹æä¸åæ¶æä¾ææ |
| | | * 2.é®é¢æ æ´æ¹ |
| | | */ |
| | | override fun otherProblem(size: Int): Int? { |
| | | override fun otherProblem(size: Int): List<Int>? { |
| | | val p = problemlistMapper.selectByExample(Example(Problemlist::class.java).apply { |
| | | createCriteria().andEqualTo("stguid", evaluationScene.subTask.value?.stguid) |
| | | // .andGreaterThanOrEqualTo("time", info.sTime) |
| | |
| | | } |
| | | } |
| | | return when { |
| | | changed == 0 && total > 0 -> 1 |
| | | changed < total -> 0 |
| | | changed == 0 && total > 0 -> listOf(1) |
| | | changed < total -> listOf(0) |
| | | else -> null |
| | | } |
| | | } |
| | |
| | | * 1.çæµæ°æ®åºç°åæ¥å以䏿æè¶
æ |
| | | * 2.çæµæ°æ®æåå¼è¶
åºåæåå¼20%ä»¥ä¸ææ°æ®ææ¾å¼å¸¸ |
| | | */ |
| | | override fun otherProblem(size: Int): Int? { |
| | | override fun otherProblem(size: Int): List<Int>? { |
| | | val time = evaluationScene.subTask.value?.planstarttime |
| | | val lt = LocalDateTime.ofInstant(time?.toInstant(), ZoneId.systemDefault()) |
| | | val st = lt.withDayOfMonth(1).withHour(0).withMinute(0).withSecond(0) |
| | |
| | | .andEqualTo("drSceneId", evaluationScene.scene.value?.guid) |
| | | }) |
| | | |
| | | var result: Int? = null |
| | | var result = mutableListOf<Int>() |
| | | r.forEach { |
| | | if (it == null) return@forEach |
| | | if (it.drExceedTimes > 0) { |
| | | result = 0 |
| | | result.add(0) |
| | | } |
| | | if (it.drOverAvgPer > 0.2) { |
| | | result = 1 |
| | | result.add(1) |
| | | } |
| | | } |
| | | |
| | |
| | | * 3.æ¶å°æ§æ³æè§ä¹¦ |
| | | * 4.æç¯å¢è¿æ³è¡ä¸ºä¸åå°è¡æ¿å¤ç½ |
| | | */ |
| | | override fun otherProblem(size: Int): Int? { |
| | | override fun otherProblem(size: Int): List<Int>? { |
| | | val time = evaluationScene.subTask.value?.planstarttime |
| | | val lt = LocalDateTime.ofInstant(time?.toInstant(), ZoneId.systemDefault()) |
| | | val s = lt.withDayOfMonth(1).withHour(0).withMinute(0).withSecond(0) |
| | |
| | | when { |
| | | condition3(s, e) -> { |
| | | i = 3 |
| | | if (i > size - 1) i = size - 1 |
| | | return i |
| | | } |
| | | condition2(s, e) -> { |
| | | i = 2 |
| | | if (i > size - 1) i = size - 1 |
| | | return i |
| | | } |
| | | condition1(s, e) -> { |
| | | i = 1 |
| | | if (i > size - 1) i = size - 1 |
| | | return i |
| | | } |
| | | else -> return null |
| | | } |
| | | if (i > size - 1) i = size - 1 |
| | | return listOf(i) |
| | | } |
| | | |
| | | /** |
| | |
| | | * 1.ç¯å¢ä¿¡ç¨ä¸è§èææ¿è¯ºæªææ¶æäº¤æè¶
æææï¼ä»¥åæ¶åæ³äººåæ´çæè¥ä¸æ§ç
§åæ´æªéæ°æ¿è¯ºç |
| | | * 2.ç¯å¢ä¿¡ç¨èªè¯æªææ¶èªè¯ææªææ¶æ |
| | | */ |
| | | override fun otherProblem(size: Int): Int? { |
| | | var i = 1 |
| | | override fun otherProblem(size: Int): List<Int>? { |
| | | var i = 0 |
| | | if (condition1()) { |
| | | if (i > size - 1) i = size - 1 |
| | | return i |
| | | i = 1 |
| | | } else if (condition2()) { |
| | | i = 2 |
| | | if (i > size - 1) i = size - 1 |
| | | return i |
| | | } |
| | | return null |
| | | if (i > size - 1) i = size - 1 |
| | | return listOf(i) |
| | | } |
| | | |
| | | /** |
| | |
| | | package cn.flightfeather.supervision.business.autooutput.score.restaurant |
| | | |
| | | import cn.flightfeather.supervision.business.autooutput.dataanalysis.XHFuDataAnalysis |
| | | import cn.flightfeather.supervision.business.autooutput.score.ScoreItem |
| | | import cn.flightfeather.supervision.domain.ds1.entity.DustDataResult |
| | | import cn.flightfeather.supervision.domain.ds1.entity.Evaluationsubrule2 |
| | | import cn.flightfeather.supervision.domain.ds1.mapper.DustDataResultMapper |
| | | import cn.flightfeather.supervision.domain.ds3.entity.FumeDailyAnalysis |
| | | import cn.flightfeather.supervision.domain.ds3.entity.FumeExceptionData |
| | | import cn.flightfeather.supervision.domain.ds3.mapper.FumeDailyAnalysisMapper |
| | | import org.springframework.beans.factory.annotation.Autowired |
| | | import org.springframework.stereotype.Component |
| | | import tk.mybatis.mapper.entity.Example |
| | | import java.time.LocalDateTime |
| | | import java.time.ZoneId |
| | | import java.util.* |
| | | import javax.annotation.PostConstruct |
| | | |
| | | @Component |
| | | class ReScoreItem5: ScoreItem() { |
| | | class ReScoreItem5(private val xhFuDataAnalysis: XHFuDataAnalysis) : ScoreItem() { |
| | | companion object { |
| | | private lateinit var instance: ReScoreItem5 |
| | | } |
| | |
| | | |
| | | override var id: String = "PSQUi9f0f7JK6w9d" |
| | | |
| | | override var name: String="æ²¹çå¨çº¿çæµæ°æ®é级" |
| | | override var name: String = "æ²¹çå¨çº¿çæµæ°æ®é级" |
| | | |
| | | @Autowired |
| | | lateinit var dustDataResultMapper: DustDataResultMapper |
| | |
| | | /** |
| | | * 徿±åºé¤é¥®ç管平å°èç½è®°å½ãå¨çº¿çåææ°æ®åé«å³°ç»è¥æ¶æ®µå°æ¶è¶
æ æ
åµ |
| | | * é项å¦ä¸ï¼ |
| | | * 1.æ°æ®æ å¼å¸¸ä¸æ è¶
æ ææ¾ç¤ºååè£
ç½®æ¸
æ´ |
| | | * 2.é«å³°ç»è¥æ¶æ®µæ°æ®å¨çº¿çä½äº90%ææ¾ç¤ºååè£
ç½®æ
é |
| | | * 3.彿é«å³°ç»è¥æ¶æ®µåºç°ä¸æ¬¡å以ä¸10åéåå¼è¶
æ ææ¾ç¤ºååè£
ç½®è¾è |
| | | * 4.彿é«å³°ç»è¥æ¶æ®µæ°æ®æç»å¼å¸¸æåºç°ä¸æ¬¡å以ä¸å°æ¶æ°æ®è¶
æ ææ æ²¹çååè£
ç½®æååè£
ç½®æªæ£å¸¸å¼å¯ |
| | | * 1.æ°æ®æ å¼å¸¸ä¸æ è¶
æ ææ¾ç¤ºååè£
ç½®æ¸
æ´ï¼ä¸æ£åï¼ |
| | | * 2.彿å卿¥é«å³°ç»è¥æ¶æ®µæ°æ®å¨çº¿çä½äº90%ä¸åºç°3æ¥å以ä¸ï¼æ£5åï¼ |
| | | * 3.彿å卿¥é«å³°ç»è¥æ¶æ®µè¿ç»ä¸æ¬¡å以ä¸10åéåå¼è¶
æ ä¸åºç°2æ¥å以å
çææ¾ç¤ºååè£
ç½®è¾èï¼æ£5åï¼ |
| | | * 4.彿å卿¥é«å³°ç»è¥æ¶æ®µè¿ç»ä¸æ¬¡å以ä¸10åéåå¼è¶
æ ä¸åºç°3æ¥å以ä¸çææ æ²¹çååè£
ç½®æååè£
ç½®æªæ£å¸¸å¼å¯ææ¾ç¤ºååè£
ç½®æ
éï¼æ£10åï¼ |
| | | */ |
| | | override fun otherProblem(size: Int): Int? { |
| | | var i = 1 |
| | | when { |
| | | condition1() -> { |
| | | if (i > size - 1) i = size - 1 |
| | | return i |
| | | } |
| | | condition2() -> { |
| | | i = 2 |
| | | if (i > size - 1) i = size - 1 |
| | | return i |
| | | } |
| | | condition3() -> { |
| | | i = 3 |
| | | if (i > size - 1) i = size - 1 |
| | | return i |
| | | } |
| | | else -> return null |
| | | } |
| | | } |
| | | override fun otherProblem(size: Int): List<Int>? { |
| | | val result = mutableListOf<Int>() |
| | | |
| | | /** |
| | | * @return true é«å³°ç»è¥æ¶æ®µæ°æ®å¨çº¿çä½äº90%ææ¾ç¤ºååè£
ç½®æ
é |
| | | */ |
| | | private fun condition1(): Boolean { |
| | | return false |
| | | } |
| | | |
| | | /** |
| | | * @return true 彿é«å³°ç»è¥æ¶æ®µåºç°ä¸æ¬¡å以ä¸10åéåå¼è¶
æ ææ¾ç¤ºååè£
ç½®è¾è |
| | | */ |
| | | private fun condition2(): Boolean { |
| | | val time = evaluationScene.subTask.value?.planstarttime |
| | | val lt = LocalDateTime.ofInstant(time?.toInstant(), ZoneId.systemDefault()) |
| | | val st = lt.withDayOfMonth(1).withHour(0).withMinute(0).withSecond(0) |
| | | val et = st.plusMonths(1) |
| | | val r = dustDataResultMapper.selectByExample(Example(DustDataResult::class.java).apply { |
| | | createCriteria().andGreaterThanOrEqualTo("drTime", st) |
| | | .andLessThan("drTime", et) |
| | | .andEqualTo("drSceneId", evaluationScene.scene.value?.guid) |
| | | }) |
| | | evaluationScene.config?.startTime = Date.from(st.atZone(ZoneId.systemDefault()).toInstant()) |
| | | evaluationScene.config?.endTime = Date.from(et.atZone(ZoneId.systemDefault()).toInstant()) |
| | | val dailyAnalysisDataList = xhFuDataAnalysis.fetchDataResources(evaluationScene) |
| | | val exceptionDataList = xhFuDataAnalysis.fetchExceptionData(evaluationScene) |
| | | |
| | | var result = false |
| | | r.forEach { |
| | | if (it == null) return@forEach |
| | | if (it.drExceedTimes >= 3) { |
| | | result = true |
| | | var count = 0 |
| | | dailyAnalysisDataList.forEach { it.forEach dList@ {f -> |
| | | val keyOnlineRate = f?.keyOnlineRate?.split("%")?.get(0)?.toDouble() ?: return@dList |
| | | if (keyOnlineRate < 0.9) { |
| | | count++ |
| | | } |
| | | } } |
| | | |
| | | if (count >= 3) { |
| | | result.add(1) |
| | | } |
| | | |
| | | val dayList = mutableListOf<Int>() |
| | | exceptionDataList.forEach { |
| | | // ä¸å¨é«å³°æ¶æ®µçå¼å¸¸æ°æ®ä¸ä½ä¸ºå¤æä¾æ® |
| | | if (!peakPeriod(it)) return@forEach |
| | | // å¼å¸¸æ¶é¿å¤§äºçäº20åéï¼è¡¨ç¤ºä¸ä¸ªæ¶é´ç¹çæ°æ®å¼å¸¸ |
| | | if ((it?.endTime?.time?.minus(it.beginTime.time) ?: 0) >= (20 * 60 * 1000)) { |
| | | val cal = Calendar.getInstance() |
| | | cal.time = it!!.beginTime |
| | | val date = cal.get(Calendar.DAY_OF_MONTH) |
| | | if (!dayList.contains(date)) { |
| | | dayList.add(date) |
| | | } |
| | | } |
| | | } |
| | | //æ¥é«å³°ç»è¥æ¶æ®µè¿ç»ä¸æ¬¡å以ä¸10åéåå¼è¶
æ ä¸åºç°3æ¥åä»¥ä¸ |
| | | if (dayList.size >= 3) { |
| | | result.add(3) |
| | | } |
| | | //æ¥é«å³°ç»è¥æ¶æ®µè¿ç»ä¸æ¬¡å以ä¸10åéåå¼è¶
æ ä¸åºç°2æ¥å以å
|
| | | else if (dayList.size > 0) { |
| | | result.add(2) |
| | | } |
| | | |
| | | return result |
| | | } |
| | | |
| | | /** |
| | | * @return true 彿é«å³°ç»è¥æ¶æ®µæ°æ®æç»å¼å¸¸æåºç°ä¸æ¬¡å以ä¸å°æ¶æ°æ®è¶
æ ææ æ²¹çååè£
ç½®æååè£
ç½®æªæ£å¸¸å¼å¯ |
| | | * 夿å¼å¸¸æ¯å¦å¤äºé«å³°æ¶æ®µ |
| | | */ |
| | | private fun condition3(): Boolean { |
| | | return false |
| | | private fun peakPeriod(data: FumeExceptionData?): Boolean { |
| | | if (data == null) return false |
| | | val today = LocalDateTime.ofInstant(data.beginTime.toInstant(), ZoneId.systemDefault()) |
| | | val noonP1 = today.withHour(9).withMinute(59).withSecond(59) |
| | | val noonP2 = today.withHour(14).withMinute(0).withSecond(0) |
| | | val nightP1 = today.withHour(16).withMinute(59).withSecond(59) |
| | | val nightP2 = today.withHour(21).withMinute(0).withSecond(0) |
| | | val beginTime = LocalDateTime.ofInstant(data.beginTime.toInstant(), ZoneId.systemDefault()) |
| | | val endTime = LocalDateTime.ofInstant(data.endTime.toInstant(), ZoneId.systemDefault()) |
| | | val b1 = |
| | | (beginTime.isAfter(noonP1) && beginTime.isBefore(noonP2)) || (beginTime.isAfter(nightP1) && beginTime.isBefore( |
| | | nightP2)) |
| | | val b2 = (endTime.isAfter(noonP1) && endTime.isBefore(noonP2)) || (endTime.isAfter(nightP1) && endTime.isBefore( |
| | | nightP2)) |
| | | |
| | | return b1 || b2 |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package cn.flightfeather.supervision.business.autooutput.score.restaurant |
| | | |
| | | import cn.flightfeather.supervision.business.autooutput.score.ScoreItem |
| | | import cn.flightfeather.supervision.domain.ds1.entity.DustDataResult |
| | | import cn.flightfeather.supervision.domain.ds1.mapper.DustDataResultMapper |
| | | import org.springframework.beans.factory.annotation.Autowired |
| | | import org.springframework.stereotype.Component |
| | | import tk.mybatis.mapper.entity.Example |
| | | import java.time.LocalDateTime |
| | | import java.time.ZoneId |
| | | import javax.annotation.PostConstruct |
| | | |
| | | @Component |
| | | class ReScoreItem5BackUp: ScoreItem() { |
| | | companion object { |
| | | private lateinit var instance: ReScoreItem5BackUp |
| | | } |
| | | |
| | | @PostConstruct |
| | | fun init() { |
| | | instance = this |
| | | } |
| | | |
| | | override var id: String = "PSQUi9f0f7JK6w9d" |
| | | |
| | | override var name: String="æ²¹çå¨çº¿çæµæ°æ®é级" |
| | | |
| | | @Autowired |
| | | lateinit var dustDataResultMapper: DustDataResultMapper |
| | | |
| | | /** |
| | | * 徿±åºé¤é¥®ç管平å°èç½è®°å½ãå¨çº¿çåææ°æ®åé«å³°ç»è¥æ¶æ®µå°æ¶è¶
æ æ
åµ |
| | | * é项å¦ä¸ï¼ |
| | | * 1.æ°æ®æ å¼å¸¸ä¸æ è¶
æ ææ¾ç¤ºååè£
ç½®æ¸
æ´ |
| | | * 2.é«å³°ç»è¥æ¶æ®µæ°æ®å¨çº¿çä½äº90%ææ¾ç¤ºååè£
ç½®æ
é |
| | | * 3.彿é«å³°ç»è¥æ¶æ®µåºç°ä¸æ¬¡å以ä¸10åéåå¼è¶
æ ææ¾ç¤ºååè£
ç½®è¾è |
| | | * 4.彿é«å³°ç»è¥æ¶æ®µæ°æ®æç»å¼å¸¸æåºç°ä¸æ¬¡å以ä¸å°æ¶æ°æ®è¶
æ ææ æ²¹çååè£
ç½®æååè£
ç½®æªæ£å¸¸å¼å¯ |
| | | */ |
| | | override fun otherProblem(size: Int): List<Int>? { |
| | | val time = evaluationScene.subTask.value?.planstarttime |
| | | val lt = LocalDateTime.ofInstant(time?.toInstant(), ZoneId.systemDefault()) |
| | | val st = lt.withDayOfMonth(1).withHour(0).withMinute(0).withSecond(0) |
| | | val et = st.plusMonths(1) |
| | | val res = dustDataResultMapper.selectByExample(Example(DustDataResult::class.java).apply { |
| | | createCriteria().andGreaterThanOrEqualTo("drTime", st) |
| | | .andLessThan("drTime", et) |
| | | .andEqualTo("drSceneId", evaluationScene.scene.value?.guid) |
| | | }).takeIf { it.isNotEmpty() }?.get(0) ?: return null |
| | | |
| | | var i = 0 |
| | | when { |
| | | condition1(res) -> { |
| | | i = 1 |
| | | } |
| | | condition2(res) -> { |
| | | i = 2 |
| | | } |
| | | condition3(res) -> { |
| | | i = 3 |
| | | } |
| | | } |
| | | if (i > size - 1) i = size - 1 |
| | | return listOf(i) |
| | | } |
| | | |
| | | /** |
| | | * @return true é«å³°ç»è¥æ¶æ®µæ°æ®å¨çº¿çä½äº90%ææ¾ç¤ºååè£
ç½®æ
é |
| | | */ |
| | | private fun condition1(res: DustDataResult): Boolean { |
| | | return res.drEffectiveRate < .9 |
| | | } |
| | | |
| | | /** |
| | | * @return true 彿é«å³°ç»è¥æ¶æ®µåºç°ä¸æ¬¡å以ä¸10åéåå¼è¶
æ ææ¾ç¤ºååè£
ç½®è¾è |
| | | */ |
| | | private fun condition2(res: DustDataResult): Boolean { |
| | | return res.drExceedTimes >= 3 |
| | | } |
| | | |
| | | /** |
| | | * @return true 彿é«å³°ç»è¥æ¶æ®µæ°æ®æç»å¼å¸¸æåºç°ä¸æ¬¡å以ä¸å°æ¶æ°æ®è¶
æ ææ æ²¹çååè£
ç½®æååè£
ç½®æªæ£å¸¸å¼å¯ |
| | | */ |
| | | private fun condition3(res: DustDataResult): Boolean { |
| | | return false |
| | | } |
| | | } |
| | |
| | | * 2.å°è´¦å°éç¼ºå¤±ææªåæ¶è®°å½æ´æ° |
| | | * 3.å°è´¦ä¸¥é缺失æå
³é®å°è´¦æ æ |
| | | */ |
| | | override fun otherProblem(size: Int): Int? { |
| | | override fun otherProblem(size: Int): List<Int>? { |
| | | // TODO: 2021/3/9 æ¾åºç¨æ·ç±»å对åºçå¿
å¡«å°è´¦ |
| | | val time = evaluationScene.subTask.value?.planstarttime |
| | | val lt = LocalDateTime.ofInstant(time?.toInstant(), ZoneId.systemDefault()) |
| | |
| | | var i = 1 |
| | | if (condition1(ledgerTypeCount, rCount)) { |
| | | if (i > size - 1) i = size - 1 |
| | | return i |
| | | } else if (condition2(ledgerTypeCount, rCount)) { |
| | | i = 2 |
| | | if (i > size - 1) i = size - 1 |
| | | return i |
| | | } |
| | | return null |
| | | return listOf(i) |
| | | } |
| | | |
| | | /** |
| | |
| | | /** |
| | | * æ§æ³æ£æ¥æ±æ»æ
åµ |
| | | * é项å¦ä¸ï¼ |
| | | * 1.é®é¢é¨åæ´æ¹æä¸åæ¶æä¾ææ |
| | | * 2.é®é¢æ æ´æ¹ |
| | | * 1.å
¨é¨ææ¶æ´æ¹å¹¶åæ¶æäº¤ææ |
| | | * 2.é®é¢é¨åæ´æ¹æä¸åæ¶æä¾ææ |
| | | * 3.é®é¢æ æ´æ¹ |
| | | */ |
| | | override fun otherProblem(size: Int): Int? { |
| | | override fun otherProblem(size: Int): List<Int>? { |
| | | val p = problemlistMapper.selectByExample(Example(Problemlist::class.java).apply { |
| | | createCriteria().andEqualTo("stguid", evaluationScene.subTask.value?.stguid) |
| | | // .andGreaterThanOrEqualTo("time", info.sTime) |
| | |
| | | } |
| | | } |
| | | return when { |
| | | changed == 0 && total > 0 -> 1 |
| | | changed < total -> 0 |
| | | changed == 0 && total > 0 -> listOf(2) |
| | | changed < total -> listOf(1) |
| | | else -> null |
| | | } |
| | | } |
| | |
| | | * 2.æ¬å£åº¦åç忬¡åºçº§ä¿¡è®¿æè¯ |
| | | * 3.æ¬å£åº¦åçå¸çº§ä¿¡è®¿æè¯æå¤æ¬¡åºçº§ä¿¡è®¿ãæè¯æç管ä¸é
å |
| | | */ |
| | | override fun otherProblem(size: Int): Int? { |
| | | override fun otherProblem(size: Int): List<Int>? { |
| | | val time = evaluationScene.subTask.value?.planstarttime |
| | | val lt = LocalDateTime.ofInstant(time?.toInstant(), ZoneId.systemDefault()) |
| | | val st = lt.withDayOfMonth(1).withHour(0).withMinute(0).withSecond(0) |
| | |
| | | .andLessThan("cpTime", et) |
| | | }) |
| | | |
| | | var i = 2 |
| | | var i = 0 |
| | | if (condition2(complaints)) { |
| | | if (i > size - 1) i = size - 1 |
| | | return i |
| | | i = 2 |
| | | } else if (condition1(complaints)) { |
| | | i = 1 |
| | | if (i > size - 1) i = size - 1 |
| | | return i |
| | | } |
| | | return null |
| | | if (i > size - 1) i = size - 1 |
| | | return listOf(i) |
| | | } |
| | | |
| | | /** |
| | |
| | | * 1.é®é¢é¨åæ´æ¹æä¸åæ¶æä¾ææ |
| | | * 2.é®é¢æ æ´æ¹ |
| | | */ |
| | | override fun otherProblem(size: Int): Int? { |
| | | override fun otherProblem(size: Int): List<Int>? { |
| | | val p = problemlistMapper.selectByExample(Example(Problemlist::class.java).apply { |
| | | createCriteria().andEqualTo("stguid", evaluationScene.subTask.value?.stguid) |
| | | // .andGreaterThanOrEqualTo("time", info.sTime) |
| | |
| | | } |
| | | } |
| | | return when { |
| | | changed == 0 && total > 0 -> 1 |
| | | changed < total -> 0 |
| | | changed == 0 && total > 0 -> listOf(1) |
| | | changed < total -> listOf(0) |
| | | else -> null |
| | | } |
| | | } |
| | |
| | | * 1.é®é¢é¨åæ´æ¹æä¸åæ¶æä¾ææ |
| | | * 2.é®é¢æ æ´æ¹ |
| | | */ |
| | | override fun otherProblem(size: Int): Int? { |
| | | override fun otherProblem(size: Int): List<Int>? { |
| | | val p = problemlistMapper.selectByExample(Example(Problemlist::class.java).apply { |
| | | createCriteria().andEqualTo("stguid", evaluationScene.subTask.value?.stguid) |
| | | // .andGreaterThanOrEqualTo("time", info.sTime) |
| | |
| | | } |
| | | } |
| | | return when { |
| | | changed == 0 && total > 0 -> 1 |
| | | changed < total -> 0 |
| | | changed == 0 && total > 0 -> listOf(1) |
| | | changed < total -> listOf(0) |
| | | else -> null |
| | | } |
| | | } |
| | |
| | | * 1.çæµæ°æ®åºç°åæ¥å以䏿æè¶
æ |
| | | * 2.çæµæ°æ®æåå¼è¶
åºåæåå¼20%ä»¥ä¸ææ°æ®ææ¾å¼å¸¸ |
| | | */ |
| | | override fun otherProblem(size: Int): Int? { |
| | | override fun otherProblem(size: Int): List<Int>? { |
| | | val time = evaluationScene.subTask.value?.planstarttime |
| | | val lt = LocalDateTime.ofInstant(time?.toInstant(), ZoneId.systemDefault()) |
| | | val st = lt.withDayOfMonth(1).withHour(0).withMinute(0).withSecond(0) |
| | |
| | | .andEqualTo("drSceneId", evaluationScene.scene.value?.guid) |
| | | }) |
| | | |
| | | var result: Int? = null |
| | | var result = mutableListOf<Int>() |
| | | r.forEach { |
| | | if (it == null) return@forEach |
| | | if (it.drExceedTimes > 0) { |
| | | result = 0 |
| | | result.add(0) |
| | | } |
| | | if (it.drOverAvgPer > 0.2) { |
| | | result = 1 |
| | | result.add(1) |
| | | } |
| | | } |
| | | |
| | |
| | | import cn.flightfeather.supervision.domain.ds2.mapper.LedgerSubTypeMapper |
| | | import cn.flightfeather.supervision.domain.ds2.mapper.UserMapMapper |
| | | import cn.flightfeather.supervision.lightshare.vo.ExcelConfigVo |
| | | import org.springframework.beans.factory.annotation.Autowired |
| | | import org.springframework.stereotype.Component |
| | | import tk.mybatis.mapper.entity.Example |
| | | import java.time.Duration |
| | | import java.time.LocalDateTime |
| | | import java.time.ZoneId |
| | | import javax.annotation.PostConstruct |
| | | |
| | | /** |
| | | * æ¥åæéæºæ°æ® |
| | |
| | | */ |
| | | fun areaName(): String { |
| | | val t = dbMapper.taskMapper.selectByPrimaryKey(config.topTaskGuid) |
| | | return "${dateUtil.DateToString(t.starttime, DateUtil.DateStyle.YYYY_MM_CN)}${t.districtname}${if (area != t.districtname) area else ""}${Constant.ScenseType.getDes(config.sceneType)}" |
| | | return "${dateUtil.DateToString(t.starttime, DateUtil.DateStyle.YYYY_MM_CN)}${t.districtname}${if (area != t.districtname) area else ""}${Constant.SceneType.getDes(config.sceneType)}" |
| | | } |
| | | |
| | | /** |
| | |
| | | get() { |
| | | if (_baseScene == null) { |
| | | _baseScene = when (this.scene?.typeid.toString()) { |
| | | Constant.ScenseType.TYPE1.value -> { |
| | | Constant.SceneType.TYPE1.value -> { |
| | | dbMapper.sceneConstructionSiteMapper.selectByPrimaryKey(scene?.guid) |
| | | } |
| | | Constant.ScenseType.TYPE2.value -> { |
| | | Constant.SceneType.TYPE2.value -> { |
| | | dbMapper.sceneWharfMapper.selectByPrimaryKey(scene?.guid) |
| | | } |
| | | Constant.ScenseType.TYPE3.value -> { |
| | | Constant.SceneType.TYPE3.value -> { |
| | | dbMapper.sceneMixingPlantMapper.selectByPrimaryKey(scene?.guid) |
| | | } |
| | | Constant.ScenseType.TYPE14.value -> { |
| | | Constant.SceneType.TYPE14.value -> { |
| | | dbMapper.sceneStorageYardMapper.selectByPrimaryKey(scene?.guid) |
| | | } |
| | | else -> null |
| | |
| | | val ledgerCount: Int |
| | | get() { |
| | | if (_ledgerCount == -1) { |
| | | val tzSceneType = Constant.ScenseType.typeMap(scene?.typeid) |
| | | val tzSceneType = Constant.SceneType.typeMap(scene?.typeid) |
| | | _ledgerCount = dbMapper.ledgerSubTypeMapper.selectCountByExample(Example(LedgerSubType::class.java).apply { |
| | | createCriteria().andEqualTo("lScenetype", tzSceneType).andEqualTo("lNeedupdate", true) |
| | | }) |
| | |
| | | var status: String? = "" |
| | | var stage: String? = "" |
| | | when (rowData.scene?.typeid.toString()) { |
| | | Constant.ScenseType.TYPE1.value -> { |
| | | Constant.SceneType.TYPE1.value -> { |
| | | (rowData.baseScene as SceneConstructionSite?)?.apply { |
| | | status = csStatus |
| | | stage = siExtension1 |
| | | } |
| | | } |
| | | Constant.ScenseType.TYPE2.value -> { |
| | | Constant.SceneType.TYPE2.value -> { |
| | | status = (rowData.baseScene as SceneWharf?)?.getwStatus() |
| | | } |
| | | Constant.ScenseType.TYPE3.value -> { |
| | | Constant.SceneType.TYPE3.value -> { |
| | | status = (rowData.baseScene as SceneMixingPlant?)?.mpStatus |
| | | } |
| | | Constant.ScenseType.TYPE14.value -> { |
| | | Constant.SceneType.TYPE14.value -> { |
| | | status = (rowData.baseScene as SceneStorageYard?)?.syStatus |
| | | } |
| | | else -> "" |
| | |
| | | //æ»ååç¯ä¿¡ç |
| | | rowData.evaluation.let { e -> |
| | | val s = e?.resultscorebef?.toIntOrNull() ?: -1 |
| | | val code = when (s) { |
| | | in 0..59 -> ExcelUtil.MyCell("红ç ", fontColor = HSSFColor.HSSFColorPredefined.RED.index) |
| | | in 60..89 -> ExcelUtil.MyCell("é»ç ", fontColor = HSSFColor.HSSFColorPredefined.GOLD.index) |
| | | in 90..100 -> ExcelUtil.MyCell("绿ç ", fontColor = HSSFColor.HSSFColorPredefined.BRIGHT_GREEN.index) |
| | | -1 -> ExcelUtil.MyCell("", fontColor = HSSFColor.HSSFColorPredefined.BLACK.index) |
| | | else -> ExcelUtil.MyCell("è¶
åºèå´ï¼${s}", fontColor = HSSFColor.HSSFColorPredefined.BLACK.index) |
| | | val code = when { |
| | | s in 0..59 -> ExcelUtil.MyCell("红ç ", fontColor = HSSFColor.HSSFColorPredefined.RED.index) |
| | | s in 60..89 -> ExcelUtil.MyCell("é»ç ", fontColor = HSSFColor.HSSFColorPredefined.GOLD.index) |
| | | s >= 90 -> ExcelUtil.MyCell("绿ç ", fontColor = HSSFColor.HSSFColorPredefined.BRIGHT_GREEN.index) |
| | | else -> ExcelUtil.MyCell("", fontColor = HSSFColor.HSSFColorPredefined.BLACK.index) |
| | | } |
| | | val normalization = when (s) { |
| | | in 0..39 -> ExcelUtil.MyCell("严éä¸è§è", fontColor = HSSFColor.HSSFColorPredefined.RED.index) |
| | | in 40..89 -> ExcelUtil.MyCell("ä¸è§è", fontColor = HSSFColor.HSSFColorPredefined.ROSE.index) |
| | | in 90..99 -> ExcelUtil.MyCell("åºæ¬è§è", fontColor = HSSFColor.HSSFColorPredefined.GOLD.index) |
| | | 100 -> ExcelUtil.MyCell("è§è", fontColor = HSSFColor.HSSFColorPredefined.BRIGHT_GREEN.index) |
| | | -1 -> ExcelUtil.MyCell("", fontColor = HSSFColor.HSSFColorPredefined.BLACK.index) |
| | | else -> ExcelUtil.MyCell("è¶
åºèå´ï¼${s}", fontColor = HSSFColor.HSSFColorPredefined.BLACK.index) |
| | | val normalization = when { |
| | | s in 0..39 -> ExcelUtil.MyCell("严éä¸è§è", fontColor = HSSFColor.HSSFColorPredefined.RED.index) |
| | | s in 40..89 -> ExcelUtil.MyCell("ä¸è§è", fontColor = HSSFColor.HSSFColorPredefined.ROSE.index) |
| | | s in 90..99 -> ExcelUtil.MyCell("åºæ¬è§è", fontColor = HSSFColor.HSSFColorPredefined.GOLD.index) |
| | | s >= 100 -> ExcelUtil.MyCell("è§è", fontColor = HSSFColor.HSSFColorPredefined.BRIGHT_GREEN.index) |
| | | else -> ExcelUtil.MyCell("", fontColor = HSSFColor.HSSFColorPredefined.BLACK.index) |
| | | } |
| | | add(code) |
| | | add(normalization) |
| | |
| | | import cn.flightfeather.supervision.domain.ds1.entity.SceneMixingPlant |
| | | import cn.flightfeather.supervision.domain.ds1.entity.SceneStorageYard |
| | | import cn.flightfeather.supervision.domain.ds1.entity.SceneWharf |
| | | import kotlin.math.round |
| | | |
| | | /** |
| | | * åè¡éé®é¢æ´æ¹åææ±æ»è¡¨ |
| | |
| | | districtMap[k]?.apply { |
| | | sceneCount++ |
| | | val status = when (dataSource.config.sceneType.toString()) { |
| | | Constant.ScenseType.TYPE1.value -> { |
| | | Constant.SceneType.TYPE1.value -> { |
| | | (rowData.baseScene as SceneConstructionSite?)?.csStatus |
| | | } |
| | | Constant.ScenseType.TYPE2.value -> { |
| | | Constant.SceneType.TYPE2.value -> { |
| | | (rowData.baseScene as SceneWharf?)?.getwStatus() |
| | | } |
| | | Constant.ScenseType.TYPE3.value -> { |
| | | Constant.SceneType.TYPE3.value -> { |
| | | (rowData.baseScene as SceneMixingPlant?)?.mpStatus |
| | | } |
| | | Constant.ScenseType.TYPE14.value -> { |
| | | Constant.SceneType.TYPE14.value -> { |
| | | (rowData.baseScene as SceneStorageYard?)?.syStatus |
| | | } |
| | | else -> "" |
| | |
| | | import cn.flightfeather.supervision.business.report.DataSource |
| | | import cn.flightfeather.supervision.common.utils.Constant |
| | | import cn.flightfeather.supervision.common.utils.ExcelUtil |
| | | import kotlin.math.round |
| | | |
| | | class ProTypeRankMainSummary(dataSource: DataSource) : ProTypeRankSummary(dataSource) { |
| | | override val templateName: String = "æåº¦ä¸»è¦æå
¸åé®é¢åæè¡¨" |
| | |
| | | override fun formatTable(summarys: MutableList<Summary>) { |
| | | //æåé åçmax个é®é¢è¢«è®¤å®ä¸ºä¸»è¦æå
¸åé®é¢ |
| | | val max = when (dataSource.config.sceneType.toString()) { |
| | | Constant.ScenseType.TYPE1.value -> 5 |
| | | Constant.SceneType.TYPE1.value -> 5 |
| | | else -> 4 |
| | | } |
| | | |
| | |
| | | import cn.flightfeather.supervision.common.utils.Constant |
| | | import cn.flightfeather.supervision.common.utils.ExcelUtil |
| | | import cn.flightfeather.supervision.domain.ds1.entity.SceneConstructionSite |
| | | import kotlin.math.round |
| | | |
| | | class ProTypeStatusSummary(dataSource: DataSource) : BaseTemplate(dataSource) { |
| | | override val cols: List<BaseCols> = listOf() |
| | |
| | | |
| | | @Throws(Exception::class) |
| | | override fun execute() { |
| | | if (dataSource.config.sceneType.toString() != Constant.ScenseType.TYPE1.value) { |
| | | if (dataSource.config.sceneType.toString() != Constant.SceneType.TYPE1.value) { |
| | | // throw IllegalStateException("${templateName}åªè½é对工å°è¿è¡åæï¼å½åä¼ å
¥åºæ¯ç±»åç¼å·ä¸º${dataSource.config.sceneType}") |
| | | println("sadas") |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package cn.flightfeather.supervision.common.executor |
| | | |
| | | import org.springframework.stereotype.Component |
| | | import java.time.LocalDateTime |
| | | import java.util.concurrent.ConcurrentHashMap |
| | | import java.util.concurrent.Executors |
| | | import kotlin.jvm.Throws |
| | | |
| | | /** |
| | | * åå°èæ¶ä»»å¡ç²¾ç¡®ç®¡ç |
| | | */ |
| | | @Component |
| | | class BackgroundTaskCtrl { |
| | | |
| | | // ä»»å¡å表 |
| | | private val taskCollection = ConcurrentHashMap<BgTaskType, ConcurrentHashMap<String, BgTask>>() |
| | | // çº¿ç¨æ± |
| | | private val executorService = Executors.newCachedThreadPool() |
| | | |
| | | /** |
| | | * æ°å¢ä»»å¡ |
| | | */ |
| | | @Throws(IllegalStateException::class) |
| | | fun newTask(type: BgTaskType, id: String, name: String, task: () -> Boolean): BgTask { |
| | | if (!taskCollection.containsKey(type)) { |
| | | taskCollection[type] = ConcurrentHashMap<String, BgTask>() |
| | | } |
| | | val taskSet = taskCollection[type]!! |
| | | if (taskSet.containsKey(id)) throw IllegalStateException("æ æ³å建任å¡ï¼ ä»»å¡[${name}]çidéå¤") |
| | | val t = BgTask(type, id, name, task) |
| | | taskSet[id] = t |
| | | return t |
| | | } |
| | | |
| | | /** |
| | | * å¼å§ä»»å¡ |
| | | */ |
| | | @Throws(IllegalStateException::class) |
| | | fun startTask(type: BgTaskType, id: String): BgTask { |
| | | val taskSet = taskCollection[type] ?: throw throw IllegalStateException("æ æ³å¼å¯ä»»å¡ï¼è¯¥ä»»å¡ç±»å[${type.des}]ä¸åå¨") |
| | | val t = taskSet[id] ?: throw IllegalStateException("æ æ³å¼å¯ä»»å¡ï¼è¯¥ä»»å¡[${id}]ä¸åå¨") |
| | | return startTask(t) |
| | | } |
| | | |
| | | @Throws(IllegalStateException::class) |
| | | fun startTask(task: BgTask): BgTask { |
| | | if (task.taskStatus.status != TaskStatus.WAITING) { |
| | | if (task.taskStatus.status == TaskStatus.RUNNING) { |
| | | throw IllegalStateException("æ æ³å¼å¯ä»»å¡ï¼ä»»å¡[${task.name}]æ£å¨æ§è¡") |
| | | } else { |
| | | throw IllegalStateException("æ æ³å¼å¯ä»»å¡ï¼ä»»å¡[${task.name}]å·²ç»æ") |
| | | } |
| | | } else { |
| | | task.ready() |
| | | task.future = executorService.submit { task.execute() } |
| | | return task |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢å¹¶å¼å§ä»»å¡ |
| | | */ |
| | | @Throws(IllegalStateException::class) |
| | | fun startNewTask(type: BgTaskType, id: String, name: String, task: () -> Boolean): BgTask { |
| | | val t = newTask(type, id, name, task) |
| | | return startTask(t) |
| | | } |
| | | |
| | | /** |
| | | * è·åä»»å¡ç¶æ |
| | | */ |
| | | fun getTaskStatus(type: BgTaskType?, id: String? = null): List<BgTaskStatus?> { |
| | | if (type != null) { |
| | | val set = taskCollection[type] ?: return emptyList() |
| | | return if (id == null) { |
| | | set.toList().map { |
| | | it.second.taskStatus |
| | | }.sortedBy { it.createTime } |
| | | } else { |
| | | val s = set[id]?.taskStatus |
| | | listOf(s) |
| | | } |
| | | } else { |
| | | val res = mutableListOf<BgTaskStatus?>() |
| | | taskCollection.forEach { (t, u) -> |
| | | val statusList = u.toList().map { |
| | | it.second.taskStatus |
| | | } |
| | | res.addAll(statusList) |
| | | } |
| | | return res.sortedBy { it?.createTime } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 强å¶å
³éä»»å¡ |
| | | */ |
| | | @Throws(IllegalStateException::class) |
| | | fun shutDownTask(type: BgTaskType, id: String?): List<BgTaskStatus?> { |
| | | val taskMap = taskCollection[type] ?: throw IllegalStateException("æ æ³å
³éä»»å¡ï¼ä»»å¡ç±»å[${type.des}]æªå建") |
| | | return if (id != null) { |
| | | val task = taskMap[id] ?: throw IllegalStateException("æ æ³å
³éä»»å¡ï¼ä»»å¡[${id}]ä¸åå¨") |
| | | task.shutdown() |
| | | listOf(task.taskStatus) |
| | | } else { |
| | | val res = mutableListOf<BgTaskStatus?>() |
| | | taskMap.forEach { (t, u) -> |
| | | u.shutdown() |
| | | res.add(u.taskStatus) |
| | | } |
| | | res.sortedBy { it?.createTime } |
| | | } |
| | | } |
| | | |
| | | @Throws(IllegalStateException::class) |
| | | fun removeTask(type: BgTaskType, id: String): Boolean { |
| | | val statusList = shutDownTask(type, id) |
| | | if (statusList.isNotEmpty()) { |
| | | val s = statusList.first() ?: throw IllegalStateException("æ æ³ç§»é¤ä»»å¡ï¼ä»»å¡ä¸åå¨") |
| | | taskCollection[s.type]?.remove(s.id) |
| | | return true |
| | | } |
| | | return false |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package cn.flightfeather.supervision.common.executor |
| | | |
| | | import org.springframework.scheduling.annotation.Async |
| | | import java.time.LocalDateTime |
| | | import java.util.concurrent.Future |
| | | |
| | | /** |
| | | * åå°ä»»å¡ |
| | | */ |
| | | class BgTask( |
| | | val type: BgTaskType, |
| | | val id: String, |
| | | val name: String, |
| | | private val task: () -> Boolean, |
| | | ) { |
| | | var taskStatus = BgTaskStatus(type, id, name) |
| | | var future: Future<*>? = null |
| | | |
| | | fun ready() { |
| | | taskStatus.status = TaskStatus.RUNNING |
| | | taskStatus.startTime = LocalDateTime.now() |
| | | } |
| | | |
| | | fun execute() { |
| | | val res = task() |
| | | if (res) success() else fail() |
| | | } |
| | | |
| | | fun success() { |
| | | taskStatus.status = TaskStatus.SUCCESS |
| | | complete() |
| | | } |
| | | |
| | | fun fail() { |
| | | taskStatus.status = TaskStatus.FAIL |
| | | complete() |
| | | } |
| | | |
| | | fun shutdown() { |
| | | if (future?.isCancelled == false && !future!!.isDone) { |
| | | future!!.cancel(true) |
| | | taskStatus.status = TaskStatus.SHUTDOWN |
| | | complete() |
| | | } |
| | | } |
| | | |
| | | fun complete() { |
| | | taskStatus.endTime = LocalDateTime.now() |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package cn.flightfeather.supervision.common.executor |
| | | |
| | | /** |
| | | * åå°ä»»å¡æ¥è¯¢æ¡ä»¶ |
| | | */ |
| | | class BgTaskConditionVo { |
| | | |
| | | var type: BgTaskType? = null |
| | | var id: String? = null |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package cn.flightfeather.supervision.common.executor |
| | | |
| | | import java.time.Duration |
| | | import java.time.LocalDateTime |
| | | |
| | | /** |
| | | * åå°èæ¶ä»»å¡ç¶æ |
| | | */ |
| | | class BgTaskStatus( |
| | | val type: BgTaskType, |
| | | val id: String, |
| | | val name: String, |
| | | ) { |
| | | // ä»»å¡ç¶æ |
| | | var status: TaskStatus = TaskStatus.WAITING |
| | | |
| | | // å¼å§æ¶é´ |
| | | var startTime: LocalDateTime? = null |
| | | |
| | | // ç»ææ¶é´ |
| | | var endTime: LocalDateTime? = null |
| | | |
| | | // å建æ¶é´ |
| | | var createTime: LocalDateTime = LocalDateTime.now() |
| | | |
| | | // è¿è¡æ¶é¿ï¼ç§ï¼ |
| | | val runTime: Long |
| | | get() { |
| | | when (status) { |
| | | TaskStatus.WAITING -> { |
| | | return 0 |
| | | } |
| | | TaskStatus.RUNNING -> { |
| | | val now = LocalDateTime.now() |
| | | val duration = Duration.between(startTime, now) |
| | | return duration.toMillis() / 1000 |
| | | } |
| | | TaskStatus.SUCCESS, |
| | | TaskStatus.FAIL, |
| | | TaskStatus.SHUTDOWN, |
| | | -> { |
| | | val duration = Duration.between(startTime, endTime) |
| | | return duration.toMillis() / 1000 |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | enum class TaskStatus { |
| | | WAITING, |
| | | RUNNING, |
| | | SUCCESS, |
| | | FAIL, |
| | | SHUTDOWN |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package cn.flightfeather.supervision.common.executor |
| | | |
| | | enum class BgTaskType(val index: Int, val des: String) { |
| | | //æµè¯ä»»å¡ |
| | | TEST(0, "æµè¯ä»»å¡"), |
| | | //èªå¨è¯å |
| | | AUTO_SCORE(1, "èªå¨è¯ä¼°ä»»å¡"); |
| | | |
| | | |
| | | companion object { |
| | | |
| | | fun getByIndex(index: Int?): BgTaskType? { |
| | | return when (index) { |
| | | TEST.index -> TEST |
| | | AUTO_SCORE.index -> AUTO_SCORE |
| | | else -> null |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | class Constant{ |
| | | //ç¨æ· |
| | | enum class UserType(val text: String){ |
| | | ALLUSER("0")//ææç¨æ· |
| | | enum class UserType(val value: Int, val des: String){ |
| | | ALL_USER(-1,"0"),//ææç¨æ· |
| | | ADMIN(0, "管çå"), |
| | | INSIDER(1, "å
é¨äººå"), |
| | | GOV(2, "æ¿åºé¨é¨"), |
| | | ENTERPRISE(3, "ä¼ä¸") |
| | | } |
| | | //è§èç±»å« |
| | | enum class RuleType(val value: Byte, val text: String){ |
| | |
| | | RUNINGSTATUS3("3","å·²ç»æ") |
| | | } |
| | | //åºæ¯ç±»å |
| | | enum class ScenseType(val value: String, val text: String){ |
| | | enum class SceneType(val value: String, val text: String){ |
| | | TYPE1("1","å·¥å°"), TYPE2("2","ç 头"), |
| | | TYPE3("3","æ°´æ³¥æ
æç«"), TYPE4("4","å·¥ä¸ä¼ä¸"), |
| | | TYPE5("5","é¤é¥®"), TYPE6("6","汽修"), |
| | |
| | | */ |
| | | @Configuration |
| | | @EnableSwagger2 |
| | | class Swagger2Configuration { |
| | | class Swagger2Configuration( |
| | | @Value("\${springfox.documentation.swagger.v2.enabled}") |
| | | var swagger2Enable: Boolean |
| | | ) { |
| | | |
| | | companion object { |
| | | const val SWAGGER_SCAN_BASE_PACKAGE = "cn.flightfeather.supervision" |
| | | |
| | | const val VERSION = "1.0.0" |
| | | } |
| | | |
| | | @Value("\${springfox.documentation.swagger.v2.enabled}") |
| | | private val swagger2Enable: Boolean = true |
| | | |
| | | @Bean |
| | | fun createRestApi(): Docket = |
| | |
| | | * ä»å¼å表è·åï¼1 çï¼2 å°å¸ï¼3 åºå¿ï¼4 è¡éï¼5 æ··åï¼ |
| | | */ |
| | | @Column(name = "ER_IsUse") |
| | | var isuse: String? = null |
| | | var isuse: Boolean? = null |
| | | |
| | | @Column(name = "ER_StartTime") |
| | | var starttime: Date? = null |
| | |
| | | |
| | | import cn.flightfeather.supervision.domain.ds1.entity.Evaluation |
| | | import cn.flightfeather.supervision.domain.util.MyMapper |
| | | import cn.flightfeather.supervision.lightshare.vo.AutoScoreResultVo |
| | | import org.apache.ibatis.annotations.Mapper |
| | | |
| | | @Mapper |
| | | interface EvaluationMapper:MyMapper<Evaluation> { |
| | | |
| | | fun findEvaluation(topTaskId: String, sceneTypeId: String): List<AutoScoreResultVo> |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package cn.flightfeather.supervision.domain.ds1.repository |
| | | |
| | | import cn.flightfeather.supervision.domain.ds1.entity.Evaluation |
| | | import cn.flightfeather.supervision.domain.ds1.mapper.EvaluationMapper |
| | | import cn.flightfeather.supervision.domain.ds1.mapper.ItemevaluationMapper |
| | | import cn.flightfeather.supervision.lightshare.vo.AreaVo |
| | | import cn.flightfeather.supervision.lightshare.vo.AutoScoreResultVo |
| | | import org.springframework.stereotype.Repository |
| | | import tk.mybatis.mapper.entity.Example |
| | | import java.time.LocalDate |
| | | |
| | | @Repository |
| | | class EvaluationRep( |
| | | private val evaluationMapper: EvaluationMapper, |
| | | private val itemevaluationMapper: ItemevaluationMapper, |
| | | private val taskRep: TaskRep, |
| | | ) { |
| | | |
| | | /** |
| | | * æ¥æ¾åºæ¯å¯¹åºçå¾å |
| | | * @param sceneId åºæ¯id |
| | | * @param date æ¥æï¼åªä½¿ç¨å¹´åæ |
| | | * @return |
| | | */ |
| | | fun findByScene(sceneId: String?, date: LocalDate): Evaluation? { |
| | | val sT = date.withDayOfMonth(1).atStartOfDay() |
| | | val eT = sT.plusMonths(1).minusSeconds(1) |
| | | val res = evaluationMapper.selectByExample(Example(Evaluation::class.java).apply { |
| | | createCriteria().andEqualTo("sguid", sceneId) |
| | | .andBetween("evaluatetime", sT, eT) |
| | | }) |
| | | return if (res.isNotEmpty()) res[0] else null |
| | | } |
| | | |
| | | /** |
| | | * æ¥æ¾èªå¨è¯åç»æ |
| | | */ |
| | | fun findAutoScore(areaVo: AreaVo): List<AutoScoreResultVo?>? { |
| | | areaVo.scensetypeid ?: return null |
| | | val task = taskRep.findOneTask(areaVo) ?: return null |
| | | return evaluationMapper.findEvaluation(task.tguid!!, areaVo.scensetypeid!!) |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package cn.flightfeather.supervision.domain.ds1.repository |
| | | |
| | | import cn.flightfeather.supervision.domain.ds1.entity.Evaluationrule |
| | | import cn.flightfeather.supervision.domain.ds1.mapper.EvaluationruleMapper |
| | | import cn.flightfeather.supervision.lightshare.vo.AreaEvaVo |
| | | import org.springframework.stereotype.Repository |
| | | import tk.mybatis.mapper.entity.Example |
| | | |
| | | /** |
| | | * è¯ä¼°è§åæ°æ®åºç¸å
³æä½ |
| | | */ |
| | | @Repository |
| | | class EvaluationRuleRep(private val evaluationruleMapper: EvaluationruleMapper) { |
| | | |
| | | /** |
| | | * æ ¹æ®åæ°æ¥è¯¢æ»è§å |
| | | * @param areaEvaVo æ¥è¯¢åæ° |
| | | */ |
| | | fun findBaseRule(areaEvaVo: AreaEvaVo): List<Evaluationrule?> { |
| | | return evaluationruleMapper.selectByExample(Example(Evaluationrule::class.java).apply { |
| | | createCriteria().andEqualTo("tasktypeid", areaEvaVo.taskTypeId) |
| | | .andEqualTo("scensetypeid", areaEvaVo.scensetypeid) |
| | | .andEqualTo("provincecode", areaEvaVo.provincecode) |
| | | .andEqualTo("citycode", areaEvaVo.citycode) |
| | | .andEqualTo("districtcode", areaEvaVo.districtcode) |
| | | .andEqualTo("towncode", areaEvaVo.towncode) |
| | | .andEqualTo("isuse", true) |
| | | }) |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package cn.flightfeather.supervision.domain.ds1.repository |
| | | |
| | | import cn.flightfeather.supervision.domain.ds1.entity.Task |
| | | import cn.flightfeather.supervision.domain.ds1.mapper.TaskMapper |
| | | import cn.flightfeather.supervision.lightshare.vo.AreaVo |
| | | import org.springframework.stereotype.Repository |
| | | import java.time.LocalDate |
| | | import java.time.ZoneId |
| | | import java.util.* |
| | | |
| | | @Repository |
| | | class TaskRep(private val taskMapper: TaskMapper) { |
| | | |
| | | private fun exampleTask(areaVo: AreaVo): Task?{ |
| | | areaVo.starttime ?: return null |
| | | val mStart = LocalDate.parse(areaVo.starttime).withDayOfMonth(1).atStartOfDay() |
| | | val mEnd = mStart.plusMonths(1).minusSeconds(1) |
| | | return Task().apply { |
| | | provincecode = areaVo.provincecode |
| | | citycode = areaVo.citycode |
| | | districtcode = areaVo.districtcode |
| | | starttime = Date.from(mStart.atZone(ZoneId.systemDefault()).toInstant()) |
| | | endtime = Date.from(mEnd.atZone(ZoneId.systemDefault()).toInstant()) |
| | | } |
| | | } |
| | | /** |
| | | * æ¥æ¾ä¸ä¸ªæ»ä»»å¡ |
| | | */ |
| | | fun findOneTask(areaVo: AreaVo): Task? { |
| | | val example = exampleTask(areaVo) ?: return null |
| | | return taskMapper.selectOne(example) |
| | | } |
| | | |
| | | fun findTasks(areaVo: AreaVo): List<Task?> { |
| | | val example = exampleTask(areaVo) ?: return emptyList() |
| | | return taskMapper.select(example) |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package cn.flightfeather.supervision.domain.ds2.entity; |
| | | |
| | | import javax.persistence.Column; |
| | | import javax.persistence.Id; |
| | | import javax.persistence.Table; |
| | | import java.util.Date; |
| | | |
| | | @Table(name = "ea_t_overall_evaluation") |
| | | public class OverallEvaluation { |
| | | @Id |
| | | @Column(name = "OE_GUID") |
| | | private Integer oeGuid; |
| | | |
| | | @Column(name = "BI_GUID") |
| | | private String biGuid; |
| | | |
| | | @Column(name = "OE_Score") |
| | | private Integer oeScore; |
| | | |
| | | @Column(name = "OE_Publish_Time") |
| | | private Date oePublishTime; |
| | | |
| | | @Column(name = "OE_Update_Time") |
| | | private Date oeUpdateTime; |
| | | |
| | | @Column(name = "OE_Scene_Type_Id") |
| | | private Byte oeSceneTypeId; |
| | | |
| | | @Column(name = "OE_Scene_Type") |
| | | private String oeSceneType; |
| | | |
| | | @Column(name = "OE_Period") |
| | | private String oePeriod; |
| | | |
| | | @Column(name = "OE_Code_Level") |
| | | private Byte oeCodeLevel; |
| | | |
| | | /** |
| | | * çæå¼å§æ¶é´ |
| | | */ |
| | | @Column(name = "OE_Start_Time") |
| | | private Date oeStartTime; |
| | | |
| | | /** |
| | | * çæç»ææ¶é´ |
| | | */ |
| | | @Column(name = "OE_End_Time") |
| | | private Date oeEndTime; |
| | | |
| | | /** |
| | | * @return OE_GUID |
| | | */ |
| | | public Integer getOeGuid() { |
| | | return oeGuid; |
| | | } |
| | | |
| | | /** |
| | | * @param oeGuid |
| | | */ |
| | | public void setOeGuid(Integer oeGuid) { |
| | | this.oeGuid = oeGuid; |
| | | } |
| | | |
| | | /** |
| | | * @return BI_GUID |
| | | */ |
| | | public String getBiGuid() { |
| | | return biGuid; |
| | | } |
| | | |
| | | /** |
| | | * @param biGuid |
| | | */ |
| | | public void setBiGuid(String biGuid) { |
| | | this.biGuid = biGuid == null ? null : biGuid.trim(); |
| | | } |
| | | |
| | | /** |
| | | * @return OE_Score |
| | | */ |
| | | public Integer getOeScore() { |
| | | return oeScore; |
| | | } |
| | | |
| | | /** |
| | | * @param oeScore |
| | | */ |
| | | public void setOeScore(Integer oeScore) { |
| | | this.oeScore = oeScore; |
| | | } |
| | | |
| | | /** |
| | | * @return OE_Publish_Time |
| | | */ |
| | | public Date getOePublishTime() { |
| | | return oePublishTime; |
| | | } |
| | | |
| | | /** |
| | | * @param oePublishTime |
| | | */ |
| | | public void setOePublishTime(Date oePublishTime) { |
| | | this.oePublishTime = oePublishTime; |
| | | } |
| | | |
| | | /** |
| | | * @return OE_Update_Time |
| | | */ |
| | | public Date getOeUpdateTime() { |
| | | return oeUpdateTime; |
| | | } |
| | | |
| | | /** |
| | | * @param oeUpdateTime |
| | | */ |
| | | public void setOeUpdateTime(Date oeUpdateTime) { |
| | | this.oeUpdateTime = oeUpdateTime; |
| | | } |
| | | |
| | | /** |
| | | * @return OE_Scene_Type_Id |
| | | */ |
| | | public Byte getOeSceneTypeId() { |
| | | return oeSceneTypeId; |
| | | } |
| | | |
| | | /** |
| | | * @param oeSceneTypeId |
| | | */ |
| | | public void setOeSceneTypeId(Byte oeSceneTypeId) { |
| | | this.oeSceneTypeId = oeSceneTypeId; |
| | | } |
| | | |
| | | /** |
| | | * @return OE_Scene_Type |
| | | */ |
| | | public String getOeSceneType() { |
| | | return oeSceneType; |
| | | } |
| | | |
| | | /** |
| | | * @param oeSceneType |
| | | */ |
| | | public void setOeSceneType(String oeSceneType) { |
| | | this.oeSceneType = oeSceneType == null ? null : oeSceneType.trim(); |
| | | } |
| | | |
| | | /** |
| | | * @return OE_Period |
| | | */ |
| | | public String getOePeriod() { |
| | | return oePeriod; |
| | | } |
| | | |
| | | /** |
| | | * @param oePeriod |
| | | */ |
| | | public void setOePeriod(String oePeriod) { |
| | | this.oePeriod = oePeriod == null ? null : oePeriod.trim(); |
| | | } |
| | | |
| | | /** |
| | | * @return OE_Code_Level |
| | | */ |
| | | public Byte getOeCodeLevel() { |
| | | return oeCodeLevel; |
| | | } |
| | | |
| | | /** |
| | | * @param oeCodeLevel |
| | | */ |
| | | public void setOeCodeLevel(Byte oeCodeLevel) { |
| | | this.oeCodeLevel = oeCodeLevel; |
| | | } |
| | | |
| | | /** |
| | | * è·åçæå¼å§æ¶é´ |
| | | * |
| | | * @return RE_Start_Time - çæå¼å§æ¶é´ |
| | | */ |
| | | public Date getOeStartTime() { |
| | | return oeStartTime; |
| | | } |
| | | |
| | | /** |
| | | * 设置çæå¼å§æ¶é´ |
| | | * |
| | | * @param oeStartTime çæå¼å§æ¶é´ |
| | | */ |
| | | public void setOeStartTime(Date oeStartTime) { |
| | | this.oeStartTime = oeStartTime; |
| | | } |
| | | |
| | | /** |
| | | * è·åçæç»ææ¶é´ |
| | | * |
| | | * @return RE_End_Time - çæç»ææ¶é´ |
| | | */ |
| | | public Date getOeEndTime() { |
| | | return oeEndTime; |
| | | } |
| | | |
| | | /** |
| | | * 设置çæç»ææ¶é´ |
| | | * |
| | | * @param oeEndTime çæç»ææ¶é´ |
| | | */ |
| | | public void setOeEndTime(Date oeEndTime) { |
| | | this.oeEndTime = oeEndTime; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package cn.flightfeather.supervision.domain.ds2.mapper |
| | | |
| | | import cn.flightfeather.supervision.domain.ds2.entity.OverallEvaluation |
| | | import cn.flightfeather.supervision.domain.util.MyMapper |
| | | import org.apache.ibatis.annotations.Mapper |
| | | |
| | | @Mapper |
| | | interface OverallEvaluationMapper : MyMapper<OverallEvaluation?> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package cn.flightfeather.supervision.domain.ds2.repository |
| | | |
| | | import cn.flightfeather.supervision.business.autooutput.score.ScoreUtil |
| | | import cn.flightfeather.supervision.common.utils.Constant |
| | | import cn.flightfeather.supervision.domain.ds2.entity.OverallEvaluation |
| | | import cn.flightfeather.supervision.domain.ds2.mapper.OverallEvaluationMapper |
| | | import org.springframework.stereotype.Repository |
| | | import java.time.LocalDate |
| | | import java.time.ZoneId |
| | | import java.util.* |
| | | |
| | | @Repository |
| | | class OverallEvaluationRep(private val overallEvaluationMapper: OverallEvaluationMapper){ |
| | | |
| | | /** |
| | | * æå
¥ä¸æ¡ç¯ä¿¡ç è®°å½ |
| | | * @param userId |
| | | * @param score |
| | | * @param sceneType |
| | | * @param sT |
| | | * @param eT |
| | | * @return |
| | | */ |
| | | fun insertOrUpdateOne( |
| | | userId: String?, |
| | | score: Int?, |
| | | sceneType: Constant.SceneType, |
| | | sT: LocalDate, |
| | | eT: LocalDate, |
| | | ): Int { |
| | | val period = "${sT.year}/${sT.monthValue}-${eT.monthValue}" |
| | | val codeLevel = ScoreUtil.scoreToCredit(score) |
| | | val oE = overallEvaluationMapper.selectOne(OverallEvaluation().apply { |
| | | biGuid = userId |
| | | oePeriod = period |
| | | }) |
| | | if (oE != null) { |
| | | oE.oeScore = score |
| | | oE.oeCodeLevel = codeLevel.first?.toByte() |
| | | return overallEvaluationMapper.updateByPrimaryKey(oE) |
| | | } else { |
| | | val startTime = sT.withDayOfMonth(1) |
| | | val endTime = eT.plusMonths(1).withDayOfMonth(1).minusDays(1) |
| | | val publishTime = Date.from(endTime.plusDays(1).atStartOfDay().atZone(ZoneId.systemDefault()).toInstant()) |
| | | val e = OverallEvaluation().apply { |
| | | biGuid = userId |
| | | oeScore = score |
| | | oePublishTime = publishTime |
| | | oeUpdateTime = publishTime |
| | | oeSceneTypeId = Constant.SceneType.typeMap(sceneType.value.toByte()) |
| | | oeSceneType = sceneType.text |
| | | oePeriod = period |
| | | oeCodeLevel = codeLevel.first?.toByte() |
| | | oeStartTime = Date.from(startTime.atStartOfDay().atZone(ZoneId.systemDefault()).toInstant()) |
| | | oeEndTime = Date.from(endTime.atStartOfDay().atZone(ZoneId.systemDefault()).toInstant()) |
| | | } |
| | | return overallEvaluationMapper.insert(e) |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package cn.flightfeather.supervision.domain.ds2.repository |
| | | |
| | | import cn.flightfeather.supervision.common.utils.Constant |
| | | import cn.flightfeather.supervision.domain.ds2.entity.UserinfoTZ |
| | | import cn.flightfeather.supervision.domain.ds2.mapper.UserinfoTZMapper |
| | | import org.springframework.stereotype.Repository |
| | | import tk.mybatis.mapper.entity.Example |
| | | |
| | | @Repository |
| | | class UserInfoTZRep(private val userinfoTZMapper: UserinfoTZMapper) { |
| | | |
| | | /** |
| | | * æ¥æ¾å¨çº¿çæ£å¼ä¼ä¸ç¨æ· |
| | | * @param district åºå¿åç§° |
| | | * @param sceneType åºæ¯ç±»å |
| | | * @return |
| | | */ |
| | | fun findEnterpriseUser(district: String?, sceneType: Constant.SceneType): List<UserinfoTZ?> { |
| | | val type = Constant.SceneType.typeMap(sceneType.value.toByte()) |
| | | return userinfoTZMapper.selectByExample(Example(UserinfoTZ::class.java).apply { |
| | | createCriteria().andEqualTo("extension2", type) |
| | | .andEqualTo("extension1", district) |
| | | .andEqualTo("usertypeid", Constant.UserType.ENTERPRISE.value) |
| | | .andEqualTo("isenable", true) |
| | | and(createCriteria().orIsNull("workno").orNotEqualTo("workno", "test")) |
| | | }) |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package cn.flightfeather.supervision.domain.ds2.repository |
| | | |
| | | import cn.flightfeather.supervision.domain.ds1.entity.Scense |
| | | import cn.flightfeather.supervision.domain.ds1.mapper.ScenseMapper |
| | | import cn.flightfeather.supervision.domain.ds1.mapper.UserinfoMapper |
| | | import cn.flightfeather.supervision.domain.ds2.entity.UserMap |
| | | import cn.flightfeather.supervision.domain.ds2.entity.UserinfoTZ |
| | | import cn.flightfeather.supervision.domain.ds2.mapper.UserMapMapper |
| | | import org.springframework.stereotype.Repository |
| | | |
| | | @Repository |
| | | class UserMapRep( |
| | | private val userMapMapper: UserMapMapper, |
| | | private val scenseMapper: ScenseMapper, |
| | | private val userinfoMapper: UserinfoMapper |
| | | ) { |
| | | |
| | | /** |
| | | * ä»é£ç¾½ç管系ç»ä¸æ¥æ¾åºæ¬ä¿¡æ¯ |
| | | * @param userinfoTZ é£ç¾½ç¯å¢ä¸çç¨æ·ä¿¡æ¯ |
| | | * @return |
| | | */ |
| | | fun findFromSupervision(userinfoTZ: UserinfoTZ?): Scense? { |
| | | val userMap = UserMap().apply { |
| | | tzUserId = userinfoTZ?.guid |
| | | } |
| | | // æ¾å°ä¸¤ä¸ªç³»ç»ç¨æ·ç对åºå
³ç³» |
| | | val uMap = userMapMapper.selectOne(userMap) |
| | | if (uMap == null) { |
| | | println("${userinfoTZ?.guid}, ${userinfoTZ?.realname}") |
| | | return null |
| | | } |
| | | // æ¾å°é£ç¾½ç管ä¸çç¨æ·ä¿¡æ¯ |
| | | val userInfoSp = userinfoMapper.selectByPrimaryKey(uMap.svUserId) |
| | | // æ¾å°é£ç¾½ç管ä¸çåºæ¯ä¿¡æ¯ |
| | | return scenseMapper.selectByPrimaryKey(userInfoSp.dGuid) |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package cn.flightfeather.supervision.domain.ds3.entity; |
| | | |
| | | import java.util.Date; |
| | | import javax.persistence.*; |
| | | |
| | | @Table(name = "fu_xh_t_site_map") |
| | | public class FumeSiteMap { |
| | | @Id |
| | | @Column(name = "Id") |
| | | private Integer id; |
| | | |
| | | @Column(name = "TZ_User_Id") |
| | | private String tzUserId; |
| | | |
| | | @Column(name = "TZ_User_Name") |
| | | private String tzUserName; |
| | | |
| | | @Column(name = "XH_Device_Code") |
| | | private String xhDeviceCode; |
| | | |
| | | @Column(name = "XH_Device_Name") |
| | | private String xhDeviceName; |
| | | |
| | | @Column(name = "SV_User_Id") |
| | | private String svUserId; |
| | | |
| | | @Column(name = "SV_User_Name") |
| | | private String svUserName; |
| | | |
| | | @Column(name = "Create_Time") |
| | | private Date createTime; |
| | | |
| | | /** |
| | | * @return Id |
| | | */ |
| | | public Integer getId() { |
| | | return id; |
| | | } |
| | | |
| | | /** |
| | | * @param id |
| | | */ |
| | | public void setId(Integer id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | /** |
| | | * @return TZ_User_Id |
| | | */ |
| | | public String getTzUserId() { |
| | | return tzUserId; |
| | | } |
| | | |
| | | /** |
| | | * @param tzUserId |
| | | */ |
| | | public void setTzUserId(String tzUserId) { |
| | | this.tzUserId = tzUserId == null ? null : tzUserId.trim(); |
| | | } |
| | | |
| | | /** |
| | | * @return TZ_User_Name |
| | | */ |
| | | public String getTzUserName() { |
| | | return tzUserName; |
| | | } |
| | | |
| | | /** |
| | | * @param tzUserName |
| | | */ |
| | | public void setTzUserName(String tzUserName) { |
| | | this.tzUserName = tzUserName == null ? null : tzUserName.trim(); |
| | | } |
| | | |
| | | /** |
| | | * @return XH_Device_Code |
| | | */ |
| | | public String getXhDeviceCode() { |
| | | return xhDeviceCode; |
| | | } |
| | | |
| | | /** |
| | | * @param xhDeviceCode |
| | | */ |
| | | public void setXhDeviceCode(String xhDeviceCode) { |
| | | this.xhDeviceCode = xhDeviceCode == null ? null : xhDeviceCode.trim(); |
| | | } |
| | | |
| | | /** |
| | | * @return XH_Device_Name |
| | | */ |
| | | public String getXhDeviceName() { |
| | | return xhDeviceName; |
| | | } |
| | | |
| | | /** |
| | | * @param xhDeviceName |
| | | */ |
| | | public void setXhDeviceName(String xhDeviceName) { |
| | | this.xhDeviceName = xhDeviceName == null ? null : xhDeviceName.trim(); |
| | | } |
| | | |
| | | /** |
| | | * @return SV_User_Id |
| | | */ |
| | | public String getSvUserId() { |
| | | return svUserId; |
| | | } |
| | | |
| | | /** |
| | | * @param svUserId |
| | | */ |
| | | public void setSvUserId(String svUserId) { |
| | | this.svUserId = svUserId == null ? null : svUserId.trim(); |
| | | } |
| | | |
| | | /** |
| | | * @return SV_User_Name |
| | | */ |
| | | public String getSvUserName() { |
| | | return svUserName; |
| | | } |
| | | |
| | | /** |
| | | * @param svUserName |
| | | */ |
| | | public void setSvUserName(String svUserName) { |
| | | this.svUserName = svUserName == null ? null : svUserName.trim(); |
| | | } |
| | | |
| | | /** |
| | | * @return Create_Time |
| | | */ |
| | | public Date getCreateTime() { |
| | | return createTime; |
| | | } |
| | | |
| | | /** |
| | | * @param createTime |
| | | */ |
| | | public void setCreateTime(Date createTime) { |
| | | this.createTime = createTime; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package cn.flightfeather.supervision.domain.ds3.entity; |
| | | |
| | | import java.util.Date; |
| | | import javax.persistence.*; |
| | | |
| | | @Table(name = "ja_t_dust_site_data_info") |
| | | public class JSDustData { |
| | | @Id |
| | | private Integer id; |
| | | |
| | | @Column(name = "mn_code") |
| | | private String mnCode; |
| | | |
| | | @Column(name = "dust_value") |
| | | private Double dustValue; |
| | | |
| | | @Column(name = "noise_value") |
| | | private Double noiseValue; |
| | | |
| | | private Date lst; |
| | | |
| | | private String quality; |
| | | |
| | | private Integer grade; |
| | | |
| | | private String flag; |
| | | |
| | | /** |
| | | * @return id |
| | | */ |
| | | public Integer getId() { |
| | | return id; |
| | | } |
| | | |
| | | /** |
| | | * @param id |
| | | */ |
| | | public void setId(Integer id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | /** |
| | | * @return mn_code |
| | | */ |
| | | public String getMnCode() { |
| | | return mnCode; |
| | | } |
| | | |
| | | /** |
| | | * @param mnCode |
| | | */ |
| | | public void setMnCode(String mnCode) { |
| | | this.mnCode = mnCode == null ? null : mnCode.trim(); |
| | | } |
| | | |
| | | /** |
| | | * @return dust_value |
| | | */ |
| | | public Double getDustValue() { |
| | | return dustValue; |
| | | } |
| | | |
| | | /** |
| | | * @param dustValue |
| | | */ |
| | | public void setDustValue(Double dustValue) { |
| | | this.dustValue = dustValue; |
| | | } |
| | | |
| | | /** |
| | | * @return noise_value |
| | | */ |
| | | public Double getNoiseValue() { |
| | | return noiseValue; |
| | | } |
| | | |
| | | /** |
| | | * @param noiseValue |
| | | */ |
| | | public void setNoiseValue(Double noiseValue) { |
| | | this.noiseValue = noiseValue; |
| | | } |
| | | |
| | | /** |
| | | * @return lst |
| | | */ |
| | | public Date getLst() { |
| | | return lst; |
| | | } |
| | | |
| | | /** |
| | | * @param lst |
| | | */ |
| | | public void setLst(Date lst) { |
| | | this.lst = lst; |
| | | } |
| | | |
| | | /** |
| | | * @return quality |
| | | */ |
| | | public String getQuality() { |
| | | return quality; |
| | | } |
| | | |
| | | /** |
| | | * @param quality |
| | | */ |
| | | public void setQuality(String quality) { |
| | | this.quality = quality == null ? null : quality.trim(); |
| | | } |
| | | |
| | | /** |
| | | * @return grade |
| | | */ |
| | | public Integer getGrade() { |
| | | return grade; |
| | | } |
| | | |
| | | /** |
| | | * @param grade |
| | | */ |
| | | public void setGrade(Integer grade) { |
| | | this.grade = grade; |
| | | } |
| | | |
| | | /** |
| | | * @return flag |
| | | */ |
| | | public String getFlag() { |
| | | return flag; |
| | | } |
| | | |
| | | /** |
| | | * @param flag |
| | | */ |
| | | public void setFlag(String flag) { |
| | | this.flag = flag == null ? null : flag.trim(); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package cn.flightfeather.supervision.domain.ds3.entity; |
| | | |
| | | import java.util.Date; |
| | | import javax.persistence.*; |
| | | |
| | | @Table(name = "du_js_t_site_map") |
| | | public class JSDustSiteMap { |
| | | @Id |
| | | @Column(name = "Id") |
| | | private Integer id; |
| | | |
| | | @Column(name = "TZ_User_Id") |
| | | private String tzUserId; |
| | | |
| | | @Column(name = "TZ_User_Name") |
| | | private String tzUserName; |
| | | |
| | | @Column(name = "JS_Device_Code") |
| | | private String jsDeviceCode; |
| | | |
| | | @Column(name = "JS_Device_Name") |
| | | private String jsDeviceName; |
| | | |
| | | @Column(name = "SV_User_Id") |
| | | private String svUserId; |
| | | |
| | | @Column(name = "SV_User_Name") |
| | | private String svUserName; |
| | | |
| | | @Column(name = "Create_Time") |
| | | private Date createTime; |
| | | |
| | | /** |
| | | * @return Id |
| | | */ |
| | | public Integer getId() { |
| | | return id; |
| | | } |
| | | |
| | | /** |
| | | * @param id |
| | | */ |
| | | public void setId(Integer id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | /** |
| | | * @return TZ_User_Id |
| | | */ |
| | | public String getTzUserId() { |
| | | return tzUserId; |
| | | } |
| | | |
| | | /** |
| | | * @param tzUserId |
| | | */ |
| | | public void setTzUserId(String tzUserId) { |
| | | this.tzUserId = tzUserId == null ? null : tzUserId.trim(); |
| | | } |
| | | |
| | | /** |
| | | * @return TZ_User_Name |
| | | */ |
| | | public String getTzUserName() { |
| | | return tzUserName; |
| | | } |
| | | |
| | | /** |
| | | * @param tzUserName |
| | | */ |
| | | public void setTzUserName(String tzUserName) { |
| | | this.tzUserName = tzUserName == null ? null : tzUserName.trim(); |
| | | } |
| | | |
| | | /** |
| | | * @return JS_Device_Code |
| | | */ |
| | | public String getJsDeviceCode() { |
| | | return jsDeviceCode; |
| | | } |
| | | |
| | | /** |
| | | * @param jsDeviceCode |
| | | */ |
| | | public void setJsDeviceCode(String jsDeviceCode) { |
| | | this.jsDeviceCode = jsDeviceCode == null ? null : jsDeviceCode.trim(); |
| | | } |
| | | |
| | | /** |
| | | * @return JS_Device_Name |
| | | */ |
| | | public String getJsDeviceName() { |
| | | return jsDeviceName; |
| | | } |
| | | |
| | | /** |
| | | * @param jsDeviceName |
| | | */ |
| | | public void setJsDeviceName(String jsDeviceName) { |
| | | this.jsDeviceName = jsDeviceName == null ? null : jsDeviceName.trim(); |
| | | } |
| | | |
| | | /** |
| | | * @return SV_User_Id |
| | | */ |
| | | public String getSvUserId() { |
| | | return svUserId; |
| | | } |
| | | |
| | | /** |
| | | * @param svUserId |
| | | */ |
| | | public void setSvUserId(String svUserId) { |
| | | this.svUserId = svUserId == null ? null : svUserId.trim(); |
| | | } |
| | | |
| | | /** |
| | | * @return SV_User_Name |
| | | */ |
| | | public String getSvUserName() { |
| | | return svUserName; |
| | | } |
| | | |
| | | /** |
| | | * @param svUserName |
| | | */ |
| | | public void setSvUserName(String svUserName) { |
| | | this.svUserName = svUserName == null ? null : svUserName.trim(); |
| | | } |
| | | |
| | | /** |
| | | * @return Create_Time |
| | | */ |
| | | public Date getCreateTime() { |
| | | return createTime; |
| | | } |
| | | |
| | | /** |
| | | * @param createTime |
| | | */ |
| | | public void setCreateTime(Date createTime) { |
| | | this.createTime = createTime; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package cn.flightfeather.supervision.domain.ds3.enum |
| | | |
| | | enum class JSSceneType(val value:Int, val des:String) { |
| | | Construction(1, "建çå·¥å°"), |
| | | Wharf(3, "ç 头"), |
| | | MixingPlant(4, "æ
æç«") |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package cn.flightfeather.supervision.domain.ds3.mapper |
| | | |
| | | import cn.flightfeather.supervision.domain.ds3.entity.FumeSiteMap |
| | | import cn.flightfeather.supervision.domain.util.MyMapper |
| | | import org.apache.ibatis.annotations.Mapper |
| | | |
| | | @Mapper |
| | | interface FumeSiteMapMapper : MyMapper<FumeSiteMap?> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package cn.flightfeather.supervision.domain.ds3.mapper |
| | | |
| | | import cn.flightfeather.supervision.domain.ds3.entity.JSDustData |
| | | import cn.flightfeather.supervision.domain.util.MyMapper |
| | | import org.apache.ibatis.annotations.Mapper |
| | | import java.util.* |
| | | |
| | | @Mapper |
| | | interface JSDustDataMapper : MyMapper<JSDustData?> { |
| | | |
| | | fun getDataBySceneType(st: Date?, et: Date?, sceneType: Int, startIndex:Int, perPage:Int): List<JSDustData?> |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package cn.flightfeather.supervision.domain.ds3.mapper; |
| | | |
| | | import cn.flightfeather.supervision.domain.ds3.entity.JSDustSiteMap; |
| | | import cn.flightfeather.supervision.domain.util.MyMapper; |
| | | import tk.mybatis.mapper.common.Mapper; |
| | | |
| | | public interface JSDustSiteMapMapper extends MyMapper<JSDustSiteMap> { |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package cn.flightfeather.supervision.lightshare.service |
| | | |
| | | import cn.flightfeather.supervision.common.executor.BgTaskConditionVo |
| | | import cn.flightfeather.supervision.common.executor.BgTaskStatus |
| | | |
| | | interface BgTaskService { |
| | | |
| | | /** |
| | | * è·åä»»å¡ç¶æ |
| | | */ |
| | | fun getTaskStatus(condition: BgTaskConditionVo): List<BgTaskStatus?> |
| | | |
| | | fun startTask(condition: BgTaskConditionVo): BgTaskStatus? |
| | | |
| | | fun shutDownTask(condition: BgTaskConditionVo): List<BgTaskStatus?> |
| | | |
| | | fun removeTask(condition: BgTaskConditionVo): Boolean |
| | | |
| | | /******************************Test************************************************/ |
| | | /** |
| | | * æ°å»ºå¹¶è¿è¡ä¸ä¸ªæµè¯ä»»å¡ |
| | | */ |
| | | fun startNewTestTask(taskId: String): BgTaskStatus? |
| | | |
| | | /** |
| | | * æ°å»ºä¸ä¸ªæµè¯ä»»å¡ |
| | | */ |
| | | fun newTestTask(taskId: String): BgTaskStatus? |
| | | |
| | | } |
| | |
| | | package cn.flightfeather.supervision.lightshare.service |
| | | |
| | | import cn.flightfeather.supervision.common.executor.BgTaskStatus |
| | | import cn.flightfeather.supervision.domain.ds1.entity.Evaluation |
| | | import cn.flightfeather.supervision.domain.ds1.entity.Itemevaluation |
| | | import cn.flightfeather.supervision.lightshare.vo.AreaVo |
| | | import cn.flightfeather.supervision.lightshare.vo.AutoScoreResultVo |
| | | import cn.flightfeather.supervision.lightshare.vo.BaseResponse |
| | | |
| | | |
| | | interface EvaluationService { |
| | |
| | | |
| | | fun getRankOfTown(tguid: String, scensetypeid: String?):List<AreaVo> |
| | | |
| | | fun getTopTaskByScene(sceneId: String?): String? |
| | | |
| | | fun autoScore(districtCode: String, time: String): List<String> |
| | | |
| | | fun autoScore2(subTaskId: String): List<String> |
| | |
| | | fun autoScore3(tGuid: String, sceneTypeId: String): String |
| | | |
| | | fun findByInspectionId(inspectionId:String):List<Evaluation> |
| | | |
| | | /** |
| | | * èªå¨è¯ä¼° |
| | | * @param areaVo è¯ä¼°èå´ |
| | | */ |
| | | fun autoEvaluate(areaVo: AreaVo): BgTaskStatus? |
| | | |
| | | fun findAutoEvaluation(areaVo: AreaVo): List<AutoScoreResultVo?>? |
| | | } |
| | |
| | | package cn.flightfeather.supervision.lightshare.service |
| | | |
| | | import cn.flightfeather.supervision.domain.ds1.entity.Evaluationrule |
| | | import cn.flightfeather.supervision.lightshare.vo.AreaEvaVo |
| | | import cn.flightfeather.supervision.lightshare.vo.AreaVo |
| | | |
| | | |
| | | interface EvaluationruleService { |
| | |
| | | |
| | | fun findBySpecificRule(tasktypeid: Byte?, scensetypeid: Byte?, districtcode: String?): Evaluationrule? |
| | | |
| | | fun find(areaVo: AreaEvaVo): List<Evaluationrule?> |
| | | } |
| | |
| | | package cn.flightfeather.supervision.lightshare.service |
| | | |
| | | import cn.flightfeather.supervision.domain.ds1.entity.Task |
| | | import cn.flightfeather.supervision.lightshare.vo.DayTaskProgressVo |
| | | import cn.flightfeather.supervision.lightshare.vo.RankVo |
| | | import cn.flightfeather.supervision.lightshare.vo.TaskFrequencyVo |
| | | import cn.flightfeather.supervision.lightshare.vo.TaskVo |
| | | import cn.flightfeather.supervision.lightshare.vo.* |
| | | import org.springframework.web.bind.annotation.RequestBody |
| | | import java.util.* |
| | | |
| | | interface TaskService { |
| | |
| | | |
| | | fun getByDistrictCode(districtCode: String, date: Date):List<TaskVo> |
| | | |
| | | fun findTask(areaVo: AreaVo):List<Task?> |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package cn.flightfeather.supervision.lightshare.service.impl |
| | | |
| | | import cn.flightfeather.supervision.common.executor.BackgroundTaskCtrl |
| | | import cn.flightfeather.supervision.common.executor.BgTaskConditionVo |
| | | import cn.flightfeather.supervision.common.executor.BgTaskStatus |
| | | import cn.flightfeather.supervision.common.executor.BgTaskType |
| | | import cn.flightfeather.supervision.lightshare.service.BgTaskService |
| | | import org.springframework.stereotype.Service |
| | | |
| | | @Service |
| | | class BgTaskServiceImpl(private val backgroundTaskCtrl: BackgroundTaskCtrl) : BgTaskService { |
| | | |
| | | override fun getTaskStatus(condition: BgTaskConditionVo): List<BgTaskStatus?> { |
| | | return backgroundTaskCtrl.getTaskStatus(condition.type, condition.id) |
| | | } |
| | | |
| | | override fun startTask(condition: BgTaskConditionVo): BgTaskStatus? { |
| | | condition.type ?: throw IllegalStateException("ä»»å¡ç±»åä¸è½ä¸ºç©º") |
| | | condition.id ?: throw IllegalStateException("ä»»å¡idä¸è½ä¸ºç©º") |
| | | |
| | | val task = backgroundTaskCtrl.startTask(condition.type!!, condition.id!!) |
| | | return task.taskStatus |
| | | } |
| | | |
| | | override fun shutDownTask(condition: BgTaskConditionVo): List<BgTaskStatus?> { |
| | | condition.type ?: throw IllegalStateException("ä»»å¡ç±»åä¸è½ä¸ºç©º") |
| | | return backgroundTaskCtrl.shutDownTask(condition.type!!, condition.id) |
| | | } |
| | | |
| | | override fun removeTask(condition: BgTaskConditionVo): Boolean { |
| | | condition.type ?: throw IllegalStateException("ä»»å¡ç±»åä¸è½ä¸ºç©º") |
| | | condition.id ?: throw IllegalStateException("ä»»å¡idä¸è½ä¸ºç©º") |
| | | return backgroundTaskCtrl.removeTask(condition.type!!, condition.id!!) |
| | | } |
| | | |
| | | override fun startNewTestTask(taskId: String): BgTaskStatus? { |
| | | val task = backgroundTaskCtrl.startNewTask(BgTaskType.TEST, taskId, "æµè¯ä»»å¡-${taskId}") { testTask() } |
| | | return task.taskStatus |
| | | } |
| | | |
| | | override fun newTestTask(taskId: String): BgTaskStatus? { |
| | | val task = backgroundTaskCtrl.newTask(BgTaskType.TEST, taskId, "æµè¯ä»»å¡-${taskId}") { testTask() } |
| | | return task.taskStatus |
| | | } |
| | | |
| | | private fun testTask(): Boolean { |
| | | var times = 10 |
| | | while (times > 0) { |
| | | Thread.sleep(2000) |
| | | times-- |
| | | } |
| | | return true |
| | | } |
| | | } |
| | |
| | | |
| | | override fun getLocation(sceneType: Int): List<Domainitem> { |
| | | val lId = when (sceneType.toString()) { |
| | | Constant.ScenseType.TYPE1.value -> Constant.INDUSTRY_LOCATION_ID |
| | | Constant.ScenseType.TYPE2.value -> Constant.WHARF_LOCATION_ID |
| | | Constant.ScenseType.TYPE14.value -> Constant.STORAGE_YARD_LOCATION_ID |
| | | Constant.ScenseType.TYPE3.value -> Constant.MIX_LOCATION_ID |
| | | Constant.ScenseType.TYPE5.value -> Constant.RESTAURANT_LOCATION_ID |
| | | Constant.ScenseType.TYPE6.value -> Constant.Vehicle_LOCATION_ID |
| | | Constant.SceneType.TYPE1.value -> Constant.INDUSTRY_LOCATION_ID |
| | | Constant.SceneType.TYPE2.value -> Constant.WHARF_LOCATION_ID |
| | | Constant.SceneType.TYPE14.value -> Constant.STORAGE_YARD_LOCATION_ID |
| | | Constant.SceneType.TYPE3.value -> Constant.MIX_LOCATION_ID |
| | | Constant.SceneType.TYPE5.value -> Constant.RESTAURANT_LOCATION_ID |
| | | Constant.SceneType.TYPE6.value -> Constant.Vehicle_LOCATION_ID |
| | | else -> Constant.INDUSTRY_LOCATION_ID |
| | | } |
| | | |
| | |
| | | package cn.flightfeather.supervision.lightshare.service.impl |
| | | |
| | | import cn.flightfeather.supervision.business.AutoScore2 |
| | | import cn.flightfeather.supervision.business.storage.StAutoScore |
| | | import cn.flightfeather.supervision.business.autooutput.AopTaskCtrl |
| | | import cn.flightfeather.supervision.business.autooutput.score.AopEvaluation |
| | | import cn.flightfeather.supervision.common.executor.BackgroundTaskCtrl |
| | | import cn.flightfeather.supervision.common.executor.BgTaskStatus |
| | | import cn.flightfeather.supervision.common.executor.BgTaskType |
| | | import cn.flightfeather.supervision.domain.ds1.entity.Domainitem |
| | | import cn.flightfeather.supervision.domain.ds1.entity.Evaluation |
| | | import cn.flightfeather.supervision.domain.ds1.entity.Subtask |
| | |
| | | import cn.flightfeather.supervision.common.utils.Constant |
| | | import cn.flightfeather.supervision.common.utils.DateUtil |
| | | import cn.flightfeather.supervision.common.utils.Domain |
| | | import cn.flightfeather.supervision.domain.ds1.repository.EvaluationRep |
| | | import cn.flightfeather.supervision.lightshare.service.EvaluationService |
| | | import cn.flightfeather.supervision.lightshare.service.SubtaskService |
| | | import cn.flightfeather.supervision.lightshare.vo.AreaVo |
| | | import cn.flightfeather.supervision.lightshare.vo.SubtaskVo |
| | | import cn.flightfeather.supervision.lightshare.vo.AutoScoreResultVo |
| | | import cn.flightfeather.supervision.lightshare.vo.BaseResponse |
| | | import org.springframework.beans.factory.annotation.Autowired |
| | | import org.springframework.stereotype.Service |
| | | import tk.mybatis.mapper.entity.Example |
| | |
| | | import kotlin.Comparator |
| | | |
| | | @Service |
| | | class EvaluationServiceImpl(val evaluationMapper: EvaluationMapper) : EvaluationService { |
| | | class EvaluationServiceImpl( |
| | | private val evaluationMapper: EvaluationMapper, |
| | | private val evaluationRep: EvaluationRep, |
| | | private val aopTaskCtrl: AopTaskCtrl, |
| | | ) : EvaluationService { |
| | | |
| | | @Autowired |
| | | lateinit var subtaskService: SubtaskService |
| | |
| | | @Autowired |
| | | lateinit var subtaskMapper: SubtaskMapper |
| | | @Autowired |
| | | lateinit var autoScore: StAutoScore |
| | | lateinit var aopEvaluation: AopEvaluation |
| | | private var isAutoScoreRunning = false |
| | | |
| | | //è·åæé¡¶å±ä»»å¡ä¸æä¸ªåºæ¯çè¡éè¯åæå |
| | |
| | | return areaVolist |
| | | } |
| | | |
| | | override fun getTopTaskByScene(sceneId: String?): String? { |
| | | val example = Example(Evaluation::class.java) |
| | | val criteria = example.createCriteria() |
| | | criteria.andEqualTo("sguid", sceneId) |
| | | example.orderBy("evaluatetime").desc() |
| | | val evaluationlist = evaluationMapper.selectByExample(example) |
| | | var subtask = SubtaskVo() |
| | | if (evaluationlist.isNotEmpty()) { |
| | | val stguid = evaluationlist[0].stguid |
| | | if (stguid != null) |
| | | subtask = subtaskService.findByID(stguid) |
| | | } |
| | | return subtask.tguid |
| | | } |
| | | |
| | | override fun autoScore(districtCode: String, time: String): List<String> { |
| | | val resultList = mutableListOf<String>() |
| | | |
| | |
| | | override fun autoScore3(tGuid: String, sceneTypeId: String): String { |
| | | if (isAutoScoreRunning) return "èªå¨è¯åæ§è¡ä¸ï¼è¯·çå¾
宿" |
| | | isAutoScoreRunning = true |
| | | val t = Constant.ScenseType.getByValue(sceneTypeId) |
| | | autoScore.sceneType = t |
| | | autoScore.topTaskGrade(tGuid) |
| | | // val t = Constant.ScenseType.getByValue(sceneTypeId) |
| | | // autoScore.sceneType = t |
| | | // autoScore.topTaskGrade(tGuid) |
| | | aopEvaluation.executeByTopTask(tGuid, sceneTypeId.toInt()) |
| | | isAutoScoreRunning = false |
| | | return "èªå¨è¯å宿" |
| | | } |
| | |
| | | createCriteria().andEqualTo("iguid", inspectionId) |
| | | }) |
| | | } |
| | | |
| | | override fun autoEvaluate(areaVo: AreaVo): BgTaskStatus? { |
| | | //æ§è¡èªå¨è¯ä¼° |
| | | return aopTaskCtrl.startNewTask(areaVo) |
| | | } |
| | | |
| | | override fun findAutoEvaluation(areaVo: AreaVo): List<AutoScoreResultVo?>? { |
| | | //1. æ¥æ¾åå²è®°å½ï¼æ¥çè¯ä¼°æ¯å¦å·²åå¨ |
| | | return evaluationRep.findAutoScore(areaVo) |
| | | } |
| | | } |
| | |
| | | |
| | | import cn.flightfeather.supervision.domain.ds1.entity.Evaluationrule |
| | | import cn.flightfeather.supervision.domain.ds1.mapper.EvaluationruleMapper |
| | | import cn.flightfeather.supervision.domain.ds1.repository.EvaluationRuleRep |
| | | import cn.flightfeather.supervision.lightshare.service.EvaluationruleService |
| | | import cn.flightfeather.supervision.lightshare.vo.AreaEvaVo |
| | | import org.springframework.stereotype.Service |
| | | import tk.mybatis.mapper.entity.Example |
| | | |
| | | @Service |
| | | class EvaluationruleServiceImpl(val evaluationruleMapper: EvaluationruleMapper) : EvaluationruleService { |
| | | class EvaluationruleServiceImpl( |
| | | private val evaluationruleMapper: EvaluationruleMapper, |
| | | private val evaluationRuleRep: EvaluationRuleRep |
| | | ) : EvaluationruleService { |
| | | |
| | | override fun findOne(id: String): Evaluationrule{ |
| | | return evaluationruleMapper.selectByPrimaryKey(id) |
| | |
| | | val evaluationrules = evaluationruleMapper.selectByExample(example) |
| | | return if (evaluationrules.size>0) evaluationrules[0] else null |
| | | } |
| | | |
| | | override fun find(areaVo: AreaEvaVo): List<Evaluationrule?> { |
| | | return evaluationRuleRep.findBaseRule(areaVo) |
| | | } |
| | | } |
| | |
| | | @Autowired |
| | | lateinit var subtaskService: SubtaskService |
| | | |
| | | private val dateUtil = DateUtil() |
| | | |
| | | //è·å污æåºæ¯çæ¬ä¸»é¡µçç管æ
åµå±ç¤ºå
容 |
| | | override fun getInspectionInfoByScene(sceneId: String, topTaskId: String): InspectionInfoVo { |
| | | val maps = inspectionMapper.getInspectionInfoByScene(sceneId, topTaskId) |
| | |
| | | inspectionInfoVo.inspectionId = map["inspectionId"].toString() |
| | | inspectionInfoVo.subtaskId = map["subtaskId"].toString() |
| | | inspectionInfoVo.inspected = map["isInspected"].toString().equals("1") |
| | | inspectionInfoVo.inspectionTime = map["inspectionTime"].toString() |
| | | val time = inspectionInfoVo.inspectionTime |
| | | inspectionInfoVo.inspectionTime = time?.substring(0, time.length-11) |
| | | map["inspectionTime"]?.let { |
| | | val time = it.toString() |
| | | inspectionInfoVo.inspectionTime = dateUtil.StringToString(time, DateUtil.DateStyle.YYYY_MM_DD) |
| | | } |
| | | inspectionInfoVo.inspectionTimes = map["inspectionTimes"].toString().toInt() |
| | | inspectionInfoVo.promised = map["isPromised"].toString().equals("1") |
| | | inspectionInfoVo.changed = map["isChanged"].toString().equals("1") |
| | |
| | | val typeCount = ledgerSubTypeMapper.selectCountByExample(Example(LedgerSubType::class.java).apply { |
| | | createCriteria().andEqualTo( |
| | | "lScenetype", |
| | | Constant.ScenseType.typeMap(sceneLedgerSummary.scene?.typeid) |
| | | Constant.SceneType.typeMap(sceneLedgerSummary.scene?.typeid) |
| | | ) |
| | | .andEqualTo("lNeedupdate", true) |
| | | }) |
| | |
| | | sceneDetail.scense = scene |
| | | |
| | | val mapper = when (scene.typeid.toString()) { |
| | | Constant.ScenseType.TYPE1.value -> sceneConstructionSiteMapper |
| | | Constant.ScenseType.TYPE2.value -> sceneWharfMapper |
| | | Constant.ScenseType.TYPE3.value -> sceneMixingPlantMapper |
| | | Constant.ScenseType.TYPE14.value -> sceneStorageYardMapper |
| | | Constant.SceneType.TYPE1.value -> sceneConstructionSiteMapper |
| | | Constant.SceneType.TYPE2.value -> sceneWharfMapper |
| | | Constant.SceneType.TYPE3.value -> sceneMixingPlantMapper |
| | | Constant.SceneType.TYPE14.value -> sceneStorageYardMapper |
| | | else -> null |
| | | } |
| | | |
| | |
| | | var r = 0 |
| | | var isUpdate = true |
| | | when (typeId.toString()) { |
| | | Constant.ScenseType.TYPE1.value -> { |
| | | Constant.SceneType.TYPE1.value -> { |
| | | val subScene = Gson().fromJson(sceneDetailStr.subScene, SceneConstructionSite::class.java) |
| | | if (subScene.getsGuid() != null) { |
| | | val record = sceneConstructionSiteMapper.selectByPrimaryKey(subScene.getsGuid()) |
| | |
| | | } |
| | | } |
| | | } |
| | | Constant.ScenseType.TYPE2.value -> { |
| | | Constant.SceneType.TYPE2.value -> { |
| | | val subScene = Gson().fromJson(sceneDetailStr.subScene, SceneWharf::class.java) |
| | | if (subScene.getsGuid() != null) { |
| | | val record = sceneWharfMapper.selectByPrimaryKey(subScene.getsGuid()) |
| | |
| | | } |
| | | } |
| | | } |
| | | Constant.ScenseType.TYPE3.value -> { |
| | | Constant.SceneType.TYPE3.value -> { |
| | | val subScene = Gson().fromJson(sceneDetailStr.subScene, SceneMixingPlant::class.java) |
| | | if (subScene.getsGuid() != null) { |
| | | val record = sceneMixingPlantMapper.selectByPrimaryKey(subScene.getsGuid()) |
| | |
| | | } |
| | | } |
| | | } |
| | | Constant.ScenseType.TYPE14.value -> { |
| | | Constant.SceneType.TYPE14.value -> { |
| | | val subScene = Gson().fromJson(sceneDetailStr.subScene, SceneStorageYard::class.java) |
| | | if (subScene.getsGuid() != null) { |
| | | val record = sceneStorageYardMapper.selectByPrimaryKey(subScene.getsGuid()) |
| | |
| | | import java.io.File |
| | | import java.io.FileInputStream |
| | | import java.io.FileOutputStream |
| | | import java.io.OutputStream |
| | | import java.net.URLEncoder |
| | | import java.nio.charset.Charset |
| | | import java.nio.charset.StandardCharsets |
| | | import java.util.* |
| | | import javax.servlet.http.HttpServletResponse |
| | |
| | | val task = taskService.getByDistrictCode(config.districtCode, config.startTime)?.takeIf { it.isNotEmpty() }?.get(0) |
| | | config.topTaskGuid = task?.tguid ?: "" |
| | | val dataSource = mutableListOf<DataSource>() |
| | | config.sceneType = Constant.ScenseType.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()) |
| | |
| | | package cn.flightfeather.supervision.lightshare.service.impl |
| | | |
| | | import cn.flightfeather.supervision.business.storage.JinAnScore |
| | | import cn.flightfeather.supervision.business.storage.StAutoScore |
| | | import cn.flightfeather.supervision.business.storage.item.* |
| | | import cn.flightfeather.supervision.business.autooutput.score.AopEvaluation |
| | | import cn.flightfeather.supervision.domain.ds1.entity.* |
| | | import cn.flightfeather.supervision.domain.ds1.mapper.* |
| | | import cn.flightfeather.supervision.common.utils.Constant |
| | |
| | | @Service |
| | | class SubtaskServiceImpl( |
| | | private val subtaskMapper: SubtaskMapper, |
| | | private val mpScoreItem_1: MpScoreItem_1, |
| | | private val mpScoreItem_2: MpScoreItem_2, |
| | | private val stScoreItem_1: StScoreItem_1, |
| | | private val whScoreItem_1: WhScoreItem_1, |
| | | private val whScoreItem_2: WhScoreItem_2, |
| | | private val jinAnScore: JinAnScore, |
| | | private val aopEvaluation: AopEvaluation, |
| | | ) : SubtaskService { |
| | | |
| | | val dateUtil = DateUtil() |
| | | |
| | | @Autowired |
| | | lateinit var scoreItem1: CsScoreItem_1 |
| | | @Autowired |
| | | lateinit var scoreItem2: CsScoreItem_2 |
| | | @Autowired |
| | | lateinit var taskService: TaskService |
| | | @Autowired |
| | |
| | | if (StringUtil.isNotEmpty(areaVo.towncode)) |
| | | criteria.andEqualTo("towncode", areaVo.towncode) |
| | | criteria.andBetween("planstarttime", areaVo.starttime, areaVo.endtime) |
| | | if (!Objects.equals(userGuid, Constant.UserType.ALLUSER.text)) |
| | | if (!Objects.equals(userGuid, Constant.UserType.ALL_USER.des)) |
| | | criteria.andLike("executorguids","%"+userGuid+"%") |
| | | var completecount = 0 |
| | | var subtasklist = subtaskMapper.selectByExample(example) |
| | |
| | | criteria.andEqualTo("stguid", subtask.stguid) |
| | | val result = evaluationMapper.selectByExample(example) |
| | | if (result.isEmpty()) { |
| | | // if (subtask.districtname == "徿±åº") { |
| | | // val autoScore = AutoScore2() |
| | | // autoScore.subtask = subtask |
| | | // autoScore.calculateScore() |
| | | // } else { |
| | | // val autoScore = AutoScore() |
| | | // autoScore.subtask = subtask |
| | | // autoScore.calculateScore() |
| | | // } |
| | | val s = scenseMapper.selectByPrimaryKey(subtask.scenseid) |
| | | val autoScore = StAutoScore(scoreItem1, scoreItem2, mpScoreItem_1, mpScoreItem_2, stScoreItem_1, |
| | | whScoreItem_1, whScoreItem_2, jinAnScore) |
| | | autoScore.sceneType = Constant.ScenseType.getByValue(s.typeid?.toString()) |
| | | autoScore.sceneGrade(subtask) |
| | | aopEvaluation.executeBySubTask(subtask) |
| | | } |
| | | } |
| | | |
| | |
| | | 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.domain.ds1.repository.TaskRep |
| | | import cn.flightfeather.supervision.lightshare.service.EvaluationService |
| | | import cn.flightfeather.supervision.lightshare.service.SubtaskService |
| | | import cn.flightfeather.supervision.lightshare.service.TaskService |
| | |
| | | import kotlin.collections.ArrayList |
| | | |
| | | @Service |
| | | class TaskServiceImpl(val taskMapper: TaskMapper) : TaskService { |
| | | class TaskServiceImpl(val taskMapper: TaskMapper, private val taskRep: TaskRep,) : TaskService { |
| | | |
| | | @Autowired |
| | | lateinit var subtaskService: SubtaskService |
| | |
| | | return taskProgressVolist |
| | | } |
| | | |
| | | override fun findTask(areaVo: AreaVo): List<Task?> { |
| | | return taskRep.findTasks(areaVo) |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package cn.flightfeather.supervision.lightshare.vo |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonInclude |
| | | |
| | | /** |
| | | * è¯ä¼°è§åæ¥è¯¢æ¡ä»¶ |
| | | */ |
| | | @JsonInclude(JsonInclude.Include.NON_NULL) |
| | | class AreaEvaVo : AreaVo() { |
| | | // è¯ä¼°è§åç±»åï¼1ï¼å·¡æ¥æ
åµè¯ä¼°ï¼99ï¼èªå¨è¯ä¼° |
| | | var taskTypeId: Int = 1 |
| | | } |
| | |
| | | import com.fasterxml.jackson.annotation.JsonInclude |
| | | |
| | | @JsonInclude(JsonInclude.Include.NON_NULL) |
| | | class AreaVo{ |
| | | open class AreaVo{ |
| | | |
| | | var provincecode: String? = null |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package cn.flightfeather.supervision.lightshare.vo |
| | | |
| | | import cn.flightfeather.supervision.domain.ds1.entity.Evaluation |
| | | import cn.flightfeather.supervision.domain.ds1.entity.Itemevaluation |
| | | import cn.flightfeather.supervision.domain.ds1.entity.Subtask |
| | | import java.util.* |
| | | |
| | | /** |
| | | * èªå¨è¯ä¼°ç»æ |
| | | */ |
| | | class AutoScoreResultVo { |
| | | var userId: String? = null |
| | | var userName: String? = null |
| | | var sceneId: String? = null |
| | | var sceneName: String? = null |
| | | var pName: String? = null |
| | | var cName: String? = null |
| | | var dName: String? = null |
| | | var tName: String? = null |
| | | var subTaskId:String? = null |
| | | var subTaskTime: Date? = null |
| | | var evaluation: Evaluation? = null |
| | | var itemEvaluations: List<Itemevaluation?>? = null |
| | | } |
| | |
| | | var message: String = "", |
| | | val head: DataHead? = null, |
| | | @ApiModelProperty("请æ±è¿åæ°æ®") |
| | | val data: T? = null |
| | | ){ |
| | | init { |
| | | if (message.isBlank()) { |
| | | message = if (success) { |
| | | "è¯·æ±æå" |
| | | } else { |
| | | "请æ±å¤±è´¥" |
| | | } |
| | | } |
| | | val data: T? = null, |
| | | ) { |
| | | init { |
| | | if (message.isBlank()) { |
| | | message = if (success) { |
| | | "è¯·æ±æå" |
| | | } else { |
| | | "请æ±å¤±è´¥" |
| | | } |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package cn.flightfeather.supervision.lightshare.web |
| | | |
| | | import cn.flightfeather.supervision.lightshare.vo.BaseResponse |
| | | import cn.flightfeather.supervision.lightshare.vo.DataHead |
| | | |
| | | /** |
| | | * å
è£
æ¥å£è¿åç»æ |
| | | */ |
| | | fun resPack(service: () -> Any?): BaseResponse<Any> { |
| | | return try { |
| | | val res = service() |
| | | if (res is Pair<*, *>) { |
| | | val head = res.first |
| | | if (head is DataHead) { |
| | | BaseResponse(true, head = head, data = res.second) |
| | | } else { |
| | | BaseResponse(true, data = res.second) |
| | | } |
| | | } else { |
| | | BaseResponse(true, data = res) |
| | | } |
| | | } catch (e: Exception) { |
| | | BaseResponse(false, message = e.message ?: "") |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package cn.flightfeather.supervision.lightshare.web |
| | | |
| | | import cn.flightfeather.supervision.common.executor.BgTaskConditionVo |
| | | import cn.flightfeather.supervision.lightshare.service.BgTaskService |
| | | import io.swagger.annotations.Api |
| | | import io.swagger.annotations.ApiOperation |
| | | import org.springframework.web.bind.annotation.* |
| | | |
| | | @Api(tags = ["BgTaskController"], description = "åå°èæ¶ä»»å¡APIæ¥å£") |
| | | @RestController |
| | | @RequestMapping("/bgTask") |
| | | class BgTaskController(val bgTaskService: BgTaskService){ |
| | | |
| | | @ApiOperation(value = "è·ååå°ä»»å¡ç¶æ") |
| | | @PostMapping("/status") |
| | | fun getTaskStatus(@RequestBody condition: BgTaskConditionVo) = resPack { bgTaskService.getTaskStatus(condition) } |
| | | |
| | | @ApiOperation(value = "è¿è¡ä¸ä¸ªä»»å¡") |
| | | @PutMapping("/start") |
| | | fun startTask(@RequestBody condition: BgTaskConditionVo) = resPack { bgTaskService.startTask(condition) } |
| | | |
| | | @ApiOperation(value = "强å¶å
³éä»»å¡") |
| | | @PutMapping("/shutDown") |
| | | fun shutDownTask(@RequestBody condition: BgTaskConditionVo) = resPack { bgTaskService.shutDownTask(condition) } |
| | | |
| | | @ApiOperation(value = "ç§»é¤ä¸ä¸ªä»»å¡") |
| | | @PutMapping("/remove") |
| | | fun removeTask(@RequestBody condition: BgTaskConditionVo) = resPack { bgTaskService.removeTask(condition) } |
| | | |
| | | @ApiOperation(value = "æ°å»ºå¹¶è¿è¡ä¸ä¸ªæµè¯ä»»å¡") |
| | | @PutMapping("/newTask/test/start") |
| | | fun startNewTestTask(@RequestParam taskId: String) = resPack { bgTaskService.startNewTestTask(taskId) } |
| | | |
| | | @ApiOperation(value = "æ°å»ºä¸ä¸ªæµè¯ä»»å¡") |
| | | @PutMapping("/newTask/test") |
| | | fun newTestTask(@RequestParam taskId: String) = resPack { bgTaskService.newTestTask(taskId) } |
| | | } |
| | |
| | | |
| | | import cn.flightfeather.supervision.domain.ds1.entity.Evaluation |
| | | import cn.flightfeather.supervision.lightshare.service.EvaluationService |
| | | import cn.flightfeather.supervision.lightshare.vo.AreaVo |
| | | import io.swagger.annotations.Api |
| | | import io.swagger.annotations.ApiOperation |
| | | import org.springframework.web.bind.annotation.* |
| | | |
| | | @Api(tags = ["EvaluationController"], description = "è¯ä¼°æ»åAPIæ¥å£") |
| | |
| | | fun delete(@PathVariable id: String) = evaluationService.delete(id) |
| | | |
| | | @GetMapping("/rankofscense") |
| | | fun getRankOfScense(@RequestParam(value = "tguid", required = true) tguid: String, |
| | | @RequestParam(value = "scensetypeid", required = false) scensetypeid: String?, |
| | | @RequestParam(value = "ruletypeid", required = false) ruletypeid: ByteArray?) = evaluationService.getRankOfSense(tguid, scensetypeid, ruletypeid) |
| | | fun getRankOfScense( |
| | | @RequestParam(value = "tguid", required = true) tguid: String, |
| | | @RequestParam(value = "scensetypeid", required = false) scensetypeid: String?, |
| | | @RequestParam(value = "ruletypeid", required = false) ruletypeid: ByteArray?, |
| | | ) = evaluationService.getRankOfSense(tguid, scensetypeid, ruletypeid) |
| | | |
| | | @GetMapping("/rankoftown") |
| | | fun getRankOfTown(@RequestParam(value = "tguid", required = true) tguid: String, |
| | | @RequestParam(value = "scensetypeid", required = false) scensetypeid: String?) = evaluationService.getRankOfTown(tguid, scensetypeid) |
| | | fun getRankOfTown( |
| | | @RequestParam(value = "tguid", required = true) tguid: String, |
| | | @RequestParam(value = "scensetypeid", required = false) scensetypeid: String?, |
| | | ) = evaluationService.getRankOfTown(tguid, scensetypeid) |
| | | |
| | | @GetMapping("/autoScore") |
| | | fun autoScore(@RequestParam(value = "districtCode") districtCode: String, |
| | | @RequestParam(value = "time") time: String) = evaluationService.autoScore(districtCode, time) |
| | | fun autoScore( |
| | | @RequestParam(value = "districtCode") districtCode: String, |
| | | @RequestParam(value = "time") time: String, |
| | | ) = evaluationService.autoScore(districtCode, time) |
| | | |
| | | @GetMapping("/autoScore3") |
| | | fun autoScore3( |
| | | @RequestParam(value = "topTaskId") tGuid: String, |
| | | @RequestParam(value = "sceneTypeId") sceneTypeId: String |
| | | @RequestParam(value = "sceneTypeId") sceneTypeId: String, |
| | | ) = evaluationService.autoScore3(tGuid, sceneTypeId) |
| | | |
| | | @PostMapping("/autoScore") |
| | | fun autoScore2(@RequestParam(value = "subTaskId") subTaskId: String) = evaluationService.autoScore2(subTaskId) |
| | | |
| | | @GetMapping("/byInspection") |
| | | fun findByInspectionId(@RequestParam("inspectionId") inspectionId: String) = evaluationService.findByInspectionId(inspectionId) |
| | | fun findByInspectionId(@RequestParam("inspectionId") inspectionId: String) = |
| | | evaluationService.findByInspectionId(inspectionId) |
| | | |
| | | @ApiOperation(value = "æ ¹æ®åºåèå´èªå¨è¯ä¼°") |
| | | @PostMapping("/auto") |
| | | fun autoEvaluate(@RequestBody areaVo: AreaVo) = resPack { evaluationService.autoEvaluate(areaVo) } |
| | | |
| | | @ApiOperation(value = "æ ¹æ®åºåèå´è·åèªå¨è¯ä¼°åå²è®°å½") |
| | | @PostMapping("/auto/record") |
| | | fun findAutoEvaluation(@RequestBody areaVo: AreaVo) = resPack { evaluationService.findAutoEvaluation(areaVo) } |
| | | } |
| | |
| | | |
| | | import cn.flightfeather.supervision.domain.ds1.entity.Evaluationrule |
| | | import cn.flightfeather.supervision.lightshare.service.EvaluationruleService |
| | | import cn.flightfeather.supervision.lightshare.vo.AreaEvaVo |
| | | import cn.flightfeather.supervision.lightshare.vo.AreaVo |
| | | import io.swagger.annotations.Api |
| | | import org.springframework.web.bind.annotation.* |
| | | |
| | |
| | | |
| | | @DeleteMapping("/{id}") |
| | | fun delete (@PathVariable id: String) = evaluationruleService.delete(id) |
| | | |
| | | @PostMapping("/find") |
| | | fun find(@RequestBody areaVo: AreaEvaVo) = resPack { evaluationruleService.find(areaVo) } |
| | | } |
| | |
| | | |
| | | import cn.flightfeather.supervision.domain.ds1.entity.Task |
| | | import cn.flightfeather.supervision.lightshare.service.TaskService |
| | | import cn.flightfeather.supervision.lightshare.vo.AreaVo |
| | | import io.swagger.annotations.Api |
| | | import org.springframework.web.bind.annotation.* |
| | | |
| | |
| | | fun getRank(@RequestParam(value = "id", required = true) id: String, |
| | | @RequestParam(value = "curSceneTypeId", required = true) sceneTypeId: String, |
| | | @RequestParam(value = "sceneId", required = false) sceneId: String?) = taskService.getRank(id, sceneTypeId, sceneId) |
| | | |
| | | @PostMapping("/find") |
| | | fun findTask(@RequestBody areaVo: AreaVo) = resPack { taskService.findTask(areaVo) } |
| | | } |
| | |
| | | spring: |
| | | datasource: |
| | | ds1: |
| | | #-æ¬å°æµè¯æå¡å¨- |
| | | url: jdbc:mysql://localhost:3306/supervision?serverTimezone=Asia/Shanghai&prepStmtCacheSize=517&cachePrepStmts=true&autoReconnect=true&characterEncoding=utf-8&allowMultiQueries=true&useSSL=false |
| | | username: root |
| | | password: 123456 |
| | | ds2: |
| | | # æ¬å°æµè¯ |
| | | url: jdbc:mysql://localhost:3306/ledger?serverTimezone=Asia/Shanghai&prepStmtCacheSize=517&cachePrepStmts=true&autoReconnect=true&characterEncoding=utf-8&allowMultiQueries=true&useSSL=false |
| | | username: root |
| | | password: 123456 |
| | | |
| | | springfox: |
| | | documentation: |
| | | swagger: |
| | |
| | | springfox: |
| | | documentation: |
| | | swagger: |
| | | v2: |
| | | enabled: false |
| | | spring: |
| | | datasource: |
| | | ds1: |
| | | #-å叿å¡å¨- |
| | | url: jdbc:mysql://localhost:3306/supervision?serverTimezone=Asia/Shanghai&prepStmtCacheSize=517&cachePrepStmts=true&autoReconnect=true&characterEncoding=utf-8&allowMultiQueries=true&useSSL=false |
| | | username: supervision |
| | | password: supervision_feiyu2021 |
| | | ds2: |
| | | #-å叿å¡å¨- |
| | | url: jdbc:mysql://localhost:3306/ledger?serverTimezone=Asia/Shanghai&prepStmtCacheSize=517&cachePrepStmts=true&autoReconnect=true&characterEncoding=utf-8&allowMultiQueries=true&useSSL=false |
| | | username: ledger |
| | | password: ledger_fxxchackxr |
| | | |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | spring: |
| | | datasource: |
| | | ds1: |
| | | #-å±åç½æå¡å¨- |
| | | # url: jdbc:mysql://192.168.0.200:3306/supervision?serverTimezone=Asia/Shanghai&prepStmtCacheSize=517&cachePrepStmts=true&autoReconnect=true&characterEncoding=utf-8&allowMultiQueries=true&useSSL=false |
| | | # username: root |
| | | # password: cn.FLIGHTFEATHER |
| | | |
| | | #-ç¯å¢ç£å¯æµè¯æå¡å¨- |
| | | # url: jdbc:mysql://192.168.0.200:3306/supervision_ii?serverTimezone=Asia/Shanghai&prepStmtCacheSize=517&cachePrepStmts=true&autoReconnect=true&characterEncoding=utf-8&allowMultiQueries=true&useSSL=false |
| | | # username: root |
| | | # password: cn.FLIGHTFEATHER |
| | | |
| | | #-è¿ç¨æµè¯æå¡å¨- |
| | | url: jdbc:mysql://47.100.191.150:3306/supervision?serverTimezone=Asia/Shanghai&prepStmtCacheSize=517&cachePrepStmts=true&autoReconnect=true&characterEncoding=utf-8&allowMultiQueries=true&useSSL=false |
| | | username: remoteU1 |
| | | password: eSoF8DnzfGTlhAjE |
| | | ds2: |
| | | #-è¿ç¨æµè¯æå¡å¨- |
| | | url: jdbc:mysql://47.100.191.150:3306/ledger?serverTimezone=Asia/Shanghai&prepStmtCacheSize=517&cachePrepStmts=true&autoReconnect=true&characterEncoding=utf-8&allowMultiQueries=true&useSSL=false |
| | | username: remoteU1 |
| | | password: eSoF8DnzfGTlhAjE |
| | | |
| | | springfox: |
| | | documentation: |
| | | swagger: |
| | | v2: |
| | | enabled: true |
| | |
| | | ds1: |
| | | type: com.alibaba.druid.pool.DruidDataSource |
| | | driver-class-name: com.mysql.jdbc.Driver |
| | | #-æ¬å°æµè¯æå¡å¨- |
| | | # username: root |
| | | # password: 123456 |
| | | # url: jdbc:mysql://localhost:3306/supervision?serverTimezone=Asia/Shanghai&prepStmtCacheSize=517&cachePrepStmts=true&autoReconnect=true&characterEncoding=utf-8&allowMultiQueries=true&useSSL=false |
| | | |
| | | #-å±åç½æå¡å¨- |
| | | # url: jdbc:mysql://192.168.0.200:3306/supervision?serverTimezone=Asia/Shanghai&prepStmtCacheSize=517&cachePrepStmts=true&autoReconnect=true&characterEncoding=utf-8&allowMultiQueries=true&useSSL=false |
| | | # username: root |
| | | # password: cn.FLIGHTFEATHER |
| | | |
| | | #-è¿ç¨æµè¯æå¡å¨- |
| | | url: jdbc:mysql://47.100.191.150:3306/supervision?serverTimezone=Asia/Shanghai&prepStmtCacheSize=517&cachePrepStmts=true&autoReconnect=true&characterEncoding=utf-8&allowMultiQueries=true&useSSL=false |
| | | username: remoteU1 |
| | | password: eSoF8DnzfGTlhAjE |
| | | |
| | | #-å叿å¡å¨- |
| | | # url: jdbc:mysql://localhost:3306/supervision?serverTimezone=Asia/Shanghai&prepStmtCacheSize=517&cachePrepStmts=true&autoReconnect=true&characterEncoding=utf-8&allowMultiQueries=true&useSSL=false |
| | | # username: supervision |
| | | # password: supervision_feiyu2021 |
| | | |
| | | #-ç¯å¢ç£å¯æµè¯æå¡å¨- |
| | | # url: jdbc:mysql://192.168.0.200:3306/supervision_ii?serverTimezone=Asia/Shanghai&prepStmtCacheSize=517&cachePrepStmts=true&autoReconnect=true&characterEncoding=utf-8&allowMultiQueries=true&useSSL=false |
| | | # username: root |
| | | # password: cn.FLIGHTFEATHER |
| | | |
| | | initialSize: 5 |
| | | minIdle: 5 |
| | | maxWait: 60000 |
| | |
| | | ds2: |
| | | type: com.alibaba.druid.pool.DruidDataSource |
| | | driver-class-name: com.mysql.jdbc.Driver |
| | | |
| | | #-å叿å¡å¨- |
| | | # url: jdbc:mysql://localhost:3306/ledger?serverTimezone=Asia/Shanghai&prepStmtCacheSize=517&cachePrepStmts=true&autoReconnect=true&characterEncoding=utf-8&allowMultiQueries=true&useSSL=false |
| | | # username: ledger |
| | | # password: ledger_fxxchackxr |
| | | |
| | | # å¼åè¿ç¨æå¡å¨ |
| | | url: jdbc:mysql://47.100.191.150:3306/ledger?serverTimezone=Asia/Shanghai&prepStmtCacheSize=517&cachePrepStmts=true&autoReconnect=true&characterEncoding=utf-8&allowMultiQueries=true&useSSL=false |
| | | username: remoteU1 |
| | | password: eSoF8DnzfGTlhAjE |
| | | |
| | | initialSize: 5 |
| | | minIdle: 5 |
| | | maxWait: 60000 |
| | |
| | | request-timeout: 20s |
| | | |
| | | profiles: |
| | | active: '@profileActive@' |
| | | active: @profileActive@ |
| | | jmx: |
| | | default-domain: ETSupervision |
| | | |
| | |
| | | documentation: |
| | | swagger: |
| | | v2: |
| | | enabled: true |
| | | enabled: false |
| | | |
| | |
| | | <property name="enableSubPackages" value="true"/> |
| | | </javaClientGenerator> |
| | | <!-- è¦çæç表 tableNameæ¯æ°æ®åºä¸ç表åæè§å¾å domainObjectNameæ¯å®ä½ç±»å--> |
| | | <!--<table tableName="adm_dept" domainObjectName="Department" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table>--> |
| | | <!--<table tableName="adm_group" domainObjectName="UserGroup" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table>--> |
| | | <!--<table tableName="adm_groupuserright" domainObjectName="GroupUserRight" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table>--> |
| | | <!--<table tableName="adm_user" domainObjectName="User" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table>--> |
| | | <!--<table tableName="usertable" domainObjectName="UserTable" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table>--> |
| | | <!--<table tableName="adm_groupuser" domainObjectName="GroupUser" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table>--> |
| | | <!--<table tableName="adm_rights" domainObjectName="Rights" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table>--> |
| | | <!--<table tableName="province" domainObjectName="Province" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table>--> |
| | | <!--<table tableName="city" domainObjectName="City" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table>--> |
| | | <!--<table tableName="town" domainObjectName="Town" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table>--> |
| | | <!--<table tableName="projectinfo" domainObjectName="ProjectInfo" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table>--> |
| | | <!--<table tableName="siteinfo" domainObjectName="SiteInfo" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table>--> |
| | | <!--<table tableName="station_alertvalue_config" domainObjectName="StationAlertvalueConfig" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table>--> |
| | | <!--<table tableName="company" domainObjectName="Company" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table>--> |
| | | <!--<table tableName="vprinfo" domainObjectName="Vprinfo" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table>--> |
| | | <!--<table tableName="devinfo" domainObjectName="Devinfo" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table>--> |
| | | <!--<table tableName="frontendconfig_new" domainObjectName="FrontendConfig" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table>--> |
| | | <!--<table tableName="munitevalue" domainObjectName="MuniteValue" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table>--> |
| | | <!--<table tableName="hourvalue" domainObjectName="HourValue" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table>--> |
| | | <!--<table tableName="dayvalue" domainObjectName="DayValue" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table>--> |
| | | <!--<table tableName="t_stationgroup" domainObjectName="StationGroup" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table>--> |
| | | <!--<table tableName="t_addressee" domainObjectName="Addressee" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table>--> |
| | | <!--<table tableName="t_smstemplate" domainObjectName="SMSTemplate" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table>--> |
| | | <!--<table tableName="t_smsrecord" domainObjectName="SMSRecord" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table>--> |
| | | <!--<table tableName="t_user" domainObjectName="User" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table>--> |
| | | <!--<table tableName="sm_t_changeadvice" domainObjectName="ChangeAdvice" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table>--> |
| | | <!--<table tableName="sm_t_changeeffect" domainObjectName="ChangeEffect" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table>--> |
| | | <!--<table tableName="sm_t_monitorobjectversion" domainObjectName="Monitorobjectversion" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table>--> |
| | |
| | | <!-- <table tableName="sm_t_score" domainObjectName="Score" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"/>--> |
| | | <!-- <table tableName="sm_t_scense" domainObjectName="Scense" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"/>--> |
| | | <!-- <table tableName="ea_t_mediafile" domainObjectName="LedgerMediaFile" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"/>--> |
| | | <table tableName="ea_t_dust_data_result" domainObjectName="DustDataResult" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" |
| | | <!-- <table tableName="ea_t_dust_data_result" domainObjectName="DustDataResult" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false"--> |
| | | <!-- enableSelectByExample="false" selectByExampleQueryId="false"/>--> |
| | | <table tableName="ea_t_evaluation" domainObjectName="Evaluation" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" |
| | | enableSelectByExample="false" selectByExampleQueryId="false"/> |
| | | </context> |
| | | </generatorConfiguration> |
| | |
| | | <property name="enableSubPackages" value="true"/> |
| | | </javaClientGenerator> |
| | | <!-- è¦çæç表 tableNameæ¯æ°æ®åºä¸ç表åæè§å¾å domainObjectNameæ¯å®ä½ç±»å--> |
| | | <table tableName="fm_web_analysis_data" domainObjectName="FumeDailyAnalysis" enableCountByExample="false" |
| | | enableUpdateByExample="false" enableDeleteByExample="false" |
| | | enableSelectByExample="false" selectByExampleQueryId="false"/> |
| | | <!-- <table tableName="fm_web_analysis_data" domainObjectName="FumeDailyAnalysis" enableCountByExample="false"--> |
| | | <!-- enableUpdateByExample="false" enableDeleteByExample="false"--> |
| | | <!-- enableSelectByExample="false" selectByExampleQueryId="false"/>--> |
| | | <!-- <table tableName="fu_xh_t_site_map" domainObjectName="FumeSiteMap" enableCountByExample="false"--> |
| | | <!-- enableUpdateByExample="false" enableDeleteByExample="false"--> |
| | | <!-- enableSelectByExample="false" selectByExampleQueryId="false"/>--> |
| | | <table tableName="abnormal_data" domainObjectName="FumeExceptionData" enableCountByExample="false" |
| | | enableUpdateByExample="false" enableDeleteByExample="false" |
| | | enableSelectByExample="false" selectByExampleQueryId="false"/> |
| | | <!-- <table tableName="ja_t_dust_site_data_info" domainObjectName="JSDustData" enableCountByExample="false"--> |
| | | <!-- enableUpdateByExample="false" enableDeleteByExample="false"--> |
| | | <!-- enableSelectByExample="false" selectByExampleQueryId="false"/>--> |
| | | <!-- <table tableName="du_js_t_site_map" domainObjectName="JSDustSiteMap" enableCountByExample="false"--> |
| | | <!-- enableUpdateByExample="false" enableDeleteByExample="false"--> |
| | | <!-- enableSelectByExample="false" selectByExampleQueryId="false"/>--> |
| | | </context> |
| | | </generatorConfiguration> |
| | |
| | | <appender-ref ref="Console"/> |
| | | </logger> |
| | | <logger name="org.mybatis" level="DEBUG"> |
| | | <appender-ref ref="Console"/> |
| | | <!-- <appender-ref ref="Console"/>--> |
| | | </logger> |
| | | <logger name="org.apache.ibatis" level="DEBUG"> |
| | | <appender-ref ref="Console"/> |
| | | <!-- <appender-ref ref="Console"/>--> |
| | | </logger> |
| | | |
| | | <logger name="cn.flightfeather.supervision" level="INFO" includeLocation="true" additivity="false"> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="cn.flightfeather.supervision.domain.ds1.mapper.EvaluationMapper"> |
| | | <resultMap id="BaseResultMap" type="cn.flightfeather.supervision.domain.ds1.entity.Evaluation"> |
| | | <!-- |
| | | WARNING - @mbg.generated |
| | | --> |
| | | <id column="E_GUID" jdbcType="VARCHAR" property="guid" /> |
| | | <result column="I_GUID" jdbcType="VARCHAR" property="iguid" /> |
| | | <result column="ST_GUID" jdbcType="VARCHAR" property="stguid" /> |
| | | <result column="S_GUID" jdbcType="VARCHAR" property="sguid" /> |
| | | <result column="E_ScenseTypeID" jdbcType="TINYINT" property="scensetypeid" /> |
| | | <result column="E_ScenseType" jdbcType="VARCHAR" property="scensetype" /> |
| | | <result column="E_SubScenseTypeID" jdbcType="TINYINT" property="subscensetypeid" /> |
| | | <result column="E_SubScenseType" jdbcType="VARCHAR" property="subscensetype" /> |
| | | <result column="E_ERType" jdbcType="TINYINT" property="ertype" /> |
| | | <result column="E_ProvinceCode" jdbcType="VARCHAR" property="provincecode" /> |
| | | <result column="E_ProvinceName" jdbcType="VARCHAR" property="provincename" /> |
| | | <result column="E_CityCode" jdbcType="VARCHAR" property="citycode" /> |
| | | <result column="E_CityName" jdbcType="VARCHAR" property="cityname" /> |
| | | <result column="E_DistrictCode" jdbcType="VARCHAR" property="districtcode" /> |
| | | <result column="E_DistrictName" jdbcType="VARCHAR" property="districtname" /> |
| | | <result column="E_TownCode" jdbcType="VARCHAR" property="towncode" /> |
| | | <result column="E_TownName" jdbcType="VARCHAR" property="townname" /> |
| | | <result column="E_ScenseName" jdbcType="VARCHAR" property="scensename" /> |
| | | <result column="E_ScenseAddress" jdbcType="VARCHAR" property="scenseaddress" /> |
| | | <result column="E_EvaluateTime" jdbcType="TIMESTAMP" property="evaluatetime" /> |
| | | <result column="E_EvaluatorGUID" jdbcType="VARCHAR" property="evaluatorguid" /> |
| | | <result column="E_EvaluatoruserName" jdbcType="VARCHAR" property="evaluatorusername" /> |
| | | <result column="E_EvaluatorRealName" jdbcType="VARCHAR" property="evaluatorrealname" /> |
| | | <result column="E_ResultStandardBef" jdbcType="VARCHAR" property="resultstandardbef" /> |
| | | <result column="E_ResultScoreBef" jdbcType="VARCHAR" property="resultscorebef" /> |
| | | <result column="E_PromissedNum" jdbcType="INTEGER" property="promissednum" /> |
| | | <result column="E_ChangedNum" jdbcType="INTEGER" property="changednum" /> |
| | | <result column="ResultStandardAft" jdbcType="VARCHAR" property="resultstandardaft" /> |
| | | <result column="E_ResultScoreAft" jdbcType="VARCHAR" property="resultscoreaft" /> |
| | | <result column="E_CreateDate" jdbcType="TIMESTAMP" property="createdate" /> |
| | | <result column="E_UpdateDate" jdbcType="TIMESTAMP" property="updatedate" /> |
| | | <result column="E_Extension1" jdbcType="VARCHAR" property="extension1" /> |
| | | <result column="E_Extension2" jdbcType="VARCHAR" property="extension2" /> |
| | | <result column="E_Extension3" jdbcType="VARCHAR" property="extension3" /> |
| | | <result column="E_Remark" jdbcType="VARCHAR" property="remark" /> |
| | | </resultMap> |
| | | <sql id="Base_Column_List"> |
| | | <!-- |
| | | WARNING - @mbg.generated |
| | | --> |
| | | E_GUID, I_GUID, ST_GUID, S_GUID, E_ScenseTypeID, E_ScenseType, E_SubScenseTypeID, |
| | | E_SubScenseType, E_ERType, E_ProvinceCode, E_ProvinceName, E_CityCode, E_CityName, |
| | | E_DistrictCode, E_DistrictName, E_TownCode, E_TownName, E_ScenseName, E_ScenseAddress, |
| | | E_EvaluateTime, E_EvaluatorGUID, E_EvaluatoruserName, E_EvaluatorRealName, E_ResultStandardBef, |
| | | E_ResultScoreBef, E_PromissedNum, E_ChangedNum, ResultStandardAft, E_ResultScoreAft, |
| | | E_CreateDate, E_UpdateDate, E_Extension1, E_Extension2, E_Extension3, E_Remark |
| | | </sql> |
| | | |
| | | <resultMap id="AutoScoreResultMap" type="cn.flightfeather.supervision.lightshare.vo.AutoScoreResultVo"> |
| | | <result column="userId" jdbcType="VARCHAR" property="userId"/> |
| | | <result column="userName" jdbcType="VARCHAR" property="userName"/> |
| | | <result column="sceneId" jdbcType="VARCHAR" property="sceneId"/> |
| | | <result column="sceneName" jdbcType="VARCHAR" property="sceneName"/> |
| | | <result column="pName" jdbcType="VARCHAR" property="pName"/> |
| | | <result column="cName" jdbcType="VARCHAR" property="cName"/> |
| | | <result column="dName" jdbcType="VARCHAR" property="dName"/> |
| | | <result column="tName" jdbcType="VARCHAR" property="tName"/> |
| | | <result column="subTaskId" jdbcType="VARCHAR" property="subTaskId"/> |
| | | <result column="planstarttime" property="subTaskTime" jdbcType="TIMESTAMP" /> |
| | | <association property="evaluation" resultMap="BaseResultMap" /> |
| | | </resultMap> |
| | | |
| | | <select id="findEvaluation" resultMap="AutoScoreResultMap"> |
| | | SELECT |
| | | c.UI_GUID AS userId, |
| | | c.UI_RealName AS userName, |
| | | b.S_GUID AS sceneId, |
| | | b.S_Name AS sceneName, |
| | | b.S_ProvinceName AS pName, |
| | | b.S_CityName AS cName, |
| | | b.S_DistrictName AS dName, |
| | | b.S_TownName AS tName, |
| | | d.ST_GUID AS subTaskId, |
| | | d.ST_PlanStartTime AS planstarttime, |
| | | e.* |
| | | FROM |
| | | (SELECT * FROM sm_t_monitorobjectversion WHERE T_ID = #{topTaskId} )AS a |
| | | LEFT JOIN sm_t_scense AS b ON a.S_GUID = b.S_GUID |
| | | LEFT JOIN sm_t_userinfo AS c ON b.S_GUID = c.D_GUID |
| | | LEFT JOIN (SELECT * FROM tm_t_subtask WHERE T_GUID = #{topTaskId}) AS d ON a.S_GUID = d.ST_ScenseID |
| | | LEFT JOIN ea_t_evaluation AS e ON d.ST_GUID = e.ST_GUID |
| | | WHERE |
| | | b.S_TypeID = #{sceneTypeId} |
| | | </select> |
| | | </mapper> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="cn.flightfeather.supervision.domain.ds2.mapper.OverallEvaluationMapper"> |
| | | <resultMap id="BaseResultMap" type="cn.flightfeather.supervision.domain.ds2.entity.OverallEvaluation"> |
| | | <!-- |
| | | WARNING - @mbg.generated |
| | | --> |
| | | <id column="OE_GUID" jdbcType="INTEGER" property="oeGuid" /> |
| | | <result column="BI_GUID" jdbcType="VARCHAR" property="biGuid" /> |
| | | <result column="OE_Score" jdbcType="INTEGER" property="oeScore" /> |
| | | <result column="OE_Publish_Time" jdbcType="TIMESTAMP" property="oePublishTime" /> |
| | | <result column="OE_Update_Time" jdbcType="TIMESTAMP" property="oeUpdateTime" /> |
| | | <result column="OE_Scene_Type_Id" jdbcType="TINYINT" property="oeSceneTypeId" /> |
| | | <result column="OE_Scene_Type" jdbcType="VARCHAR" property="oeSceneType" /> |
| | | <result column="OE_Period" jdbcType="VARCHAR" property="oePeriod" /> |
| | | <result column="OE_Code_Level" jdbcType="TINYINT" property="oeCodeLevel" /> |
| | | <result column="OE_Start_Time" jdbcType="DATE" property="oeStartTime" /> |
| | | <result column="OE_End_Time" jdbcType="DATE" property="oeEndTime" /> |
| | | </resultMap> |
| | | <sql id="Base_Column_List"> |
| | | <!-- |
| | | WARNING - @mbg.generated |
| | | --> |
| | | OE_GUID, BI_GUID, OE_Score, OE_Publish_Time, OE_Update_Time, OE_Scene_Type_Id, OE_Scene_Type, |
| | | OE_Period, OE_Code_Level, OE_Start_Time, OE_End_Time |
| | | </sql> |
| | | </mapper> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > |
| | | <mapper namespace="cn.flightfeather.supervision.domain.ds3.mapper.FumeSiteMapMapper" > |
| | | <resultMap id="BaseResultMap" type="cn.flightfeather.supervision.domain.ds3.entity.FumeSiteMap" > |
| | | <!-- |
| | | WARNING - @mbg.generated |
| | | --> |
| | | <id column="Id" property="id" jdbcType="INTEGER" /> |
| | | <result column="TZ_User_Id" property="tzUserId" jdbcType="VARCHAR" /> |
| | | <result column="TZ_User_Name" property="tzUserName" jdbcType="VARCHAR" /> |
| | | <result column="XH_Device_Code" property="xhDeviceCode" jdbcType="VARCHAR" /> |
| | | <result column="XH_Device_Name" property="xhDeviceName" jdbcType="VARCHAR" /> |
| | | <result column="SV_User_Id" property="svUserId" jdbcType="VARCHAR" /> |
| | | <result column="SV_User_Name" property="svUserName" jdbcType="VARCHAR" /> |
| | | <result column="Create_Time" property="createTime" jdbcType="TIMESTAMP" /> |
| | | </resultMap> |
| | | <sql id="Base_Column_List" > |
| | | <!-- |
| | | WARNING - @mbg.generated |
| | | --> |
| | | Id, TZ_User_Id, TZ_User_Name, XH_Device_Code, XH_Device_Name, SV_User_Id, SV_User_Name, |
| | | Create_Time |
| | | </sql> |
| | | </mapper> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > |
| | | <mapper namespace="cn.flightfeather.supervision.domain.ds3.mapper.JSDustDataMapper" > |
| | | <resultMap id="BaseResultMap" type="cn.flightfeather.supervision.domain.ds3.entity.JSDustData" > |
| | | <!-- |
| | | WARNING - @mbg.generated |
| | | --> |
| | | <id column="id" property="id" jdbcType="INTEGER" /> |
| | | <result column="mn_code" property="mnCode" jdbcType="VARCHAR" /> |
| | | <result column="dust_value" property="dustValue" jdbcType="DOUBLE" /> |
| | | <result column="noise_value" property="noiseValue" jdbcType="DOUBLE" /> |
| | | <result column="lst" property="lst" jdbcType="TIMESTAMP" /> |
| | | <result column="quality" property="quality" jdbcType="VARCHAR" /> |
| | | <result column="grade" property="grade" jdbcType="INTEGER" /> |
| | | <result column="flag" property="flag" jdbcType="VARCHAR" /> |
| | | </resultMap> |
| | | <sql id="Base_Column_List" > |
| | | <!-- |
| | | WARNING - @mbg.generated |
| | | --> |
| | | id, mn_code, dust_value, noise_value, lst, quality, grade, flag |
| | | </sql> |
| | | |
| | | <select id="getDataBySceneType" resultMap="BaseResultMap"> |
| | | SELECT a.* FROM |
| | | (SELECT |
| | | * |
| | | FROM |
| | | ja_t_dust_site_data_info |
| | | <where> |
| | | flag = 'N' |
| | | <if test="st != null"> |
| | | AND lst >= #{st} |
| | | </if> |
| | | <if test="et != null"> |
| | | AND lst <= #{et} |
| | | </if> |
| | | </where> |
| | | LIMIT #{startIndex}, #{perPage} |
| | | ) AS a |
| | | LEFT JOIN ja_t_dust_site_info AS b ON a.mn_code = b.mn_code |
| | | WHERE b.type_id = #{sceneType} |
| | | </select> |
| | | </mapper> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > |
| | | <mapper namespace="cn.flightfeather.supervision.domain.ds3.mapper.JSDustSiteMapMapper" > |
| | | <resultMap id="BaseResultMap" type="cn.flightfeather.supervision.domain.ds3.entity.JSDustSiteMap" > |
| | | <!-- |
| | | WARNING - @mbg.generated |
| | | --> |
| | | <id column="Id" property="id" jdbcType="INTEGER" /> |
| | | <result column="TZ_User_Id" property="tzUserId" jdbcType="VARCHAR" /> |
| | | <result column="TZ_User_Name" property="tzUserName" jdbcType="VARCHAR" /> |
| | | <result column="JS_Device_Code" property="jsDeviceCode" jdbcType="VARCHAR" /> |
| | | <result column="JS_Device_Name" property="jsDeviceName" jdbcType="VARCHAR" /> |
| | | <result column="SV_User_Id" property="svUserId" jdbcType="VARCHAR" /> |
| | | <result column="SV_User_Name" property="svUserName" jdbcType="VARCHAR" /> |
| | | <result column="Create_Time" property="createTime" jdbcType="TIMESTAMP" /> |
| | | </resultMap> |
| | | <sql id="Base_Column_List" > |
| | | <!-- |
| | | WARNING - @mbg.generated |
| | | --> |
| | | Id, TZ_User_Id, TZ_User_Name, JS_Device_Code, JS_Device_Name, SV_User_Id, SV_User_Name, |
| | | Create_Time |
| | | </sql> |
| | | </mapper> |
| | |
| | | package cn.flightfeather.supervision.business |
| | | |
| | | import cn.flightfeather.supervision.common.executor.TaskStatus |
| | | import cn.flightfeather.supervision.common.utils.QRCodeUtil |
| | | import org.apache.poi.hssf.usermodel.HSSFWorkbook |
| | | import org.junit.Test |
| | |
| | | |
| | | metadata.mergeTree("javax_imageio_1.0", root) |
| | | } |
| | | |
| | | @Test |
| | | fun foo1() { |
| | | val s = TaskStatus.WAITING |
| | | println(s.name) |
| | | println(s.ordinal) |
| | | } |
| | | } |
| | |
| | | package cn.flightfeather.supervision.business.autooutput |
| | | |
| | | import cn.flightfeather.supervision.business.autooutput.score.AopEvaluation |
| | | import cn.flightfeather.supervision.business.autooutput.score.construction.JADataAnalysis |
| | | import cn.flightfeather.supervision.business.autooutput.dataanalysis.JACsDataAnalysis |
| | | import cn.flightfeather.supervision.business.autooutput.dataanalysis.JSCsDataAnalysis |
| | | import cn.flightfeather.supervision.business.autooutput.dataanalysis.JSMpDataAnalysis |
| | | import cn.flightfeather.supervision.business.autooutput.dataanalysis.XHFuDataAnalysis |
| | | import cn.flightfeather.supervision.business.autooutput.dataanalysis.JSWhDataAnalysis |
| | | import cn.flightfeather.supervision.business.autooutput.datasource.AopDataConfig |
| | | import cn.flightfeather.supervision.business.autooutput.score.AopCreditCode |
| | | import cn.flightfeather.supervision.common.utils.Constant |
| | | import cn.flightfeather.supervision.lightshare.service.SearchService |
| | | import cn.flightfeather.supervision.lightshare.vo.ExcelConfigVo |
| | | import org.junit.Test |
| | |
| | | lateinit var aopEvaluation: AopEvaluation |
| | | |
| | | @Autowired |
| | | lateinit var aopCreditCode: AopCreditCode |
| | | |
| | | @Autowired |
| | | lateinit var searchService: SearchService |
| | | |
| | | @Autowired |
| | | lateinit var jaDataAnalysis: JADataAnalysis |
| | | lateinit var jaCsDataAnalysis: JACsDataAnalysis |
| | | |
| | | @Autowired |
| | | lateinit var xhFuDataAnalysis: XHFuDataAnalysis |
| | | |
| | | @Autowired |
| | | lateinit var jsCsDataAnalysis: JSCsDataAnalysis |
| | | |
| | | @Autowired |
| | | lateinit var jsMpDataAnalysis: JSMpDataAnalysis |
| | | |
| | | @Autowired |
| | | lateinit var jsWhDataAnalysis: JSWhDataAnalysis |
| | | |
| | | /** |
| | | * ç»è®¡çæµæ°æ®ç»æ |
| | | * éå®å·¥å°èªè¯ |
| | | */ |
| | | @Test |
| | | fun test1() { |
| | | jaDataAnalysis.setResource("VHXHS1dHsykTNUf2", 1, 2023, 8) |
| | | jaDataAnalysis.execute() |
| | | val taskId = "tTbZIUg7nQJ1MRgE" |
| | | val districtCode = "310106" |
| | | val year = 2023 |
| | | val month = 12 |
| | | val sceneType = Constant.SceneType.TYPE1.value.toInt() |
| | | jaCsDataAnalysis.setResource(taskId, sceneType, year, month) |
| | | jaCsDataAnalysis.execute(0.124) |
| | | |
| | | aopEvaluation.executeByTopTask(taskId, sceneType) |
| | | |
| | | val mode = 9 |
| | | searchService.writeToFile(ExcelConfigVo( |
| | | taskId, |
| | | districtCode = districtCode, |
| | | sceneType = sceneType), mode) |
| | | } |
| | | |
| | | /** |
| | | * èªå¨è¯ä¼° |
| | | * 徿±é¤é¥®èªè¯ |
| | | */ |
| | | @Test |
| | | fun test() { |
| | | aopEvaluation.setResource("VHXHS1dHsykTNUf2", 1) |
| | | aopEvaluation.execute() |
| | | val taskId = "88wgq9l5gm9cUMg1" |
| | | val districtCode = "310104" |
| | | val districtName = "徿±åº" |
| | | val year = 2023 |
| | | val month = 11 |
| | | val sceneType = Constant.SceneType.TYPE5.value.toInt() |
| | | xhFuDataAnalysis.setResource(taskId, sceneType, year, month) |
| | | xhFuDataAnalysis.execute() |
| | | |
| | | aopEvaluation.executeByTopTask(taskId, sceneType) |
| | | |
| | | val mode = 9 |
| | | searchService.writeToFile(ExcelConfigVo( |
| | | taskId, |
| | | districtCode = districtCode, |
| | | sceneType = sceneType), mode) |
| | | aopCreditCode.execute(AopDataConfig( |
| | | year = year, |
| | | month = month, |
| | | districtName = districtName, |
| | | sceneType = sceneType, |
| | | period = 1 |
| | | )) |
| | | } |
| | | |
| | | /** |
| | | * 导åºèªå¨è¯ä¼°ç»æ |
| | | * é山工å°ãç 头ãæ
æç«èªè¯ |
| | | */ |
| | | @Test |
| | | fun test2() { |
| | | val taskId = "rXtm0AozZYJqoEpW" |
| | | val districtCode = "310116" |
| | | val year = 2023 |
| | | val month = 11 |
| | | // val sceneType = Constant.SceneType.TYPE1.value.toInt() |
| | | // val sceneType = Constant.SceneType.TYPE2.value.toInt() |
| | | val sceneType = Constant.SceneType.TYPE3.value.toInt() |
| | | // val sceneType = Constant.SceneType.TYPE14.value.toInt() |
| | | |
| | | when (sceneType) { |
| | | Constant.SceneType.TYPE1.value.toInt()->{ |
| | | jsCsDataAnalysis.setResource(taskId, sceneType, year, month) |
| | | jsCsDataAnalysis.execute() |
| | | } |
| | | Constant.SceneType.TYPE2.value.toInt()->{ |
| | | jsWhDataAnalysis.setResource(taskId, sceneType, year, month) |
| | | jsWhDataAnalysis.execute() |
| | | } |
| | | Constant.SceneType.TYPE3.value.toInt()->{ |
| | | jsMpDataAnalysis.setResource(taskId, sceneType, year, month) |
| | | jsMpDataAnalysis.execute() |
| | | } |
| | | } |
| | | |
| | | aopEvaluation.executeByTopTask(taskId, sceneType) |
| | | |
| | | val mode = 9 |
| | | searchService.writeToFile(ExcelConfigVo( |
| | | "VHXHS1dHsykTNUf2", |
| | | districtCode = "310106", |
| | | sceneType = 1), mode) |
| | | taskId, |
| | | districtCode = districtCode, |
| | | sceneType = sceneType), mode) |
| | | } |
| | | } |
| | |
| | | // val b = LocationRoadNearby.BasePlace("", Pair(121.378346, 30.84923), Pair(121.378296, 30.861472)) |
| | | // locationRoadNearby.search(b, 1000.0) |
| | | val bList = listOf( |
| | | LocationRoadNearby.BasePlace("å¹²é±è·¯-éç³åè·¯-éå¼ å
¬è·¯", Pair(121.218411,30.826654), Pair(121.227142,30.828403)), |
| | | LocationRoadNearby.BasePlace("éå»å
¬è·¯-建ä¹è·¯-æ±åå
¬è·¯", Pair(121.18409,30.835699), Pair(121.183811,30.831636)), |
| | | LocationRoadNearby.BasePlace("éå¼ å
¬è·¯-ç°æ°è·¯-å¹²é±è·¯", Pair(121.219555,30.829319), Pair(121.227142,30.828403)), |
| | | LocationRoadNearby.BasePlace("大è«ä¸å¿è·¯-æ±å¹³å
¬è·¯-æ±å¢è·¯", Pair(121.147448,30.858481), Pair(121.149312,30.857804)), |
| | | LocationRoadNearby.BasePlace("大è«ä¸å¿è·¯-建å¯è·¯-æ±å¹³å
¬è·¯", Pair(121.141819,30.858344), Pair(121.147448,30.858481)), |
| | | LocationRoadNearby.BasePlace("æ±åå
¬è·¯-éå¼ å
¬è·¯-康å
´è·¯", Pair(121.177261,30.83326), Pair(121.18053,30.830751)), |
| | | LocationRoadNearby.BasePlace("æ±åå
¬è·¯-éå»å
¬è·¯-康å
´è·¯", Pair(121.183811,30.831636), Pair(121.18053,30.830751)), |
| | | LocationRoadNearby.BasePlace("åæ°è·¯-建ä¹è·¯-æ±åå
¬è·¯", Pair(121.191766,30.835612), Pair(121.196591,30.831604)), |
| | | LocationRoadNearby.BasePlace("溪åè·¯-æ±åå
¬è·¯-æ°ä¸è¡", Pair(121.171163,30.832014), Pair(121.174958,30.827349)), |
| | | LocationRoadNearby.BasePlace("䏿¹çº¢ä¸å¿è·¯-å建路-æ±å¹³å
¬è·¯", Pair(121.141617,30.870365), Pair(121.145145,30.870635)), |
| | | LocationRoadNearby.BasePlace("䏿¹çº¢ä¸å¿è·¯-æ±å¹³å
¬è·¯-æ±å¢è·¯", Pair(121.145145,30.870635), Pair(121.155051,30.870966)), |
| | | LocationRoadNearby.BasePlace("æ±åå
¬è·¯-éå»å
¬è·¯-ç°æ¬¢è·¯", Pair(121.183811,30.831636), Pair(121.18989,30.831606)), |
| | | LocationRoadNearby.BasePlace("æ±å¹³å
¬è·¯-ä¸å¯è·¯-大è«ä¸å¿è·¯", Pair(121.146281,30.864199), Pair(121.147448,30.858481)), |
| | | LocationRoadNearby.BasePlace("æ±å¹³å
¬è·¯-䏿¹çº¢ä¸å¿è·¯-ä¸å¯è·¯", Pair(121.145404,30.869592), Pair(121.146281,30.864199)), |
| | | LocationRoadNearby.BasePlace("éå¼ å
¬è·¯-éç³åè·¯-ç°æ°è·¯", Pair(121.215668,30.830838), Pair(121.219555,30.829319)), |
| | | LocationRoadNearby.BasePlace("æ±å¹³å
¬è·¯-åéè·¯-è·èè·¯", Pair(121.148479,30.836083), Pair(121.14842,30.842135)), |
| | | LocationRoadNearby.BasePlace("æ±æ³¾å建路-建å¯è·¯-æ±å¹³å
¬è·¯", Pair(121.142609,30.863955), Pair(121.146407,30.864167)), |
| | | LocationRoadNearby.BasePlace("æ±æ³¾å建路-æ±å¹³å
¬è·¯-æ±å¢è·¯", Pair(121.146407,30.864167), Pair(121.153675,30.864075)), |
| | | 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.218411,30.826654), Pair(121.227142,30.828403)), |
| | | // LocationRoadNearby.BasePlace("éå»å
¬è·¯-建ä¹è·¯-æ±åå
¬è·¯", Pair(121.18409,30.835699), Pair(121.183811,30.831636)), |
| | | // LocationRoadNearby.BasePlace("éå¼ å
¬è·¯-ç°æ°è·¯-å¹²é±è·¯", Pair(121.219555,30.829319), Pair(121.227142,30.828403)), |
| | | // LocationRoadNearby.BasePlace("大è«ä¸å¿è·¯-æ±å¹³å
¬è·¯-æ±å¢è·¯", Pair(121.147448,30.858481), Pair(121.149312,30.857804)), |
| | | // LocationRoadNearby.BasePlace("大è«ä¸å¿è·¯-建å¯è·¯-æ±å¹³å
¬è·¯", Pair(121.141819,30.858344), Pair(121.147448,30.858481)), |
| | | // LocationRoadNearby.BasePlace("æ±åå
¬è·¯-éå¼ å
¬è·¯-康å
´è·¯", Pair(121.177261,30.83326), Pair(121.18053,30.830751)), |
| | | // LocationRoadNearby.BasePlace("æ±åå
¬è·¯-éå»å
¬è·¯-康å
´è·¯", Pair(121.183811,30.831636), Pair(121.18053,30.830751)), |
| | | // LocationRoadNearby.BasePlace("åæ°è·¯-建ä¹è·¯-æ±åå
¬è·¯", Pair(121.191766,30.835612), Pair(121.196591,30.831604)), |
| | | // LocationRoadNearby.BasePlace("溪åè·¯-æ±åå
¬è·¯-æ°ä¸è¡", Pair(121.171163,30.832014), Pair(121.174958,30.827349)), |
| | | // LocationRoadNearby.BasePlace("䏿¹çº¢ä¸å¿è·¯-å建路-æ±å¹³å
¬è·¯", Pair(121.141617,30.870365), Pair(121.145145,30.870635)), |
| | | // LocationRoadNearby.BasePlace("䏿¹çº¢ä¸å¿è·¯-æ±å¹³å
¬è·¯-æ±å¢è·¯", Pair(121.145145,30.870635), Pair(121.155051,30.870966)), |
| | | // LocationRoadNearby.BasePlace("æ±åå
¬è·¯-éå»å
¬è·¯-ç°æ¬¢è·¯", Pair(121.183811,30.831636), Pair(121.18989,30.831606)), |
| | | // LocationRoadNearby.BasePlace("æ±å¹³å
¬è·¯-ä¸å¯è·¯-大è«ä¸å¿è·¯", Pair(121.146281,30.864199), Pair(121.147448,30.858481)), |
| | | // LocationRoadNearby.BasePlace("æ±å¹³å
¬è·¯-䏿¹çº¢ä¸å¿è·¯-ä¸å¯è·¯", Pair(121.145404,30.869592), Pair(121.146281,30.864199)), |
| | | // LocationRoadNearby.BasePlace("éå¼ å
¬è·¯-éç³åè·¯-ç°æ°è·¯", Pair(121.215668,30.830838), Pair(121.219555,30.829319)), |
| | | // LocationRoadNearby.BasePlace("æ±å¹³å
¬è·¯-åéè·¯-è·èè·¯", Pair(121.148479,30.836083), Pair(121.14842,30.842135)), |
| | | // LocationRoadNearby.BasePlace("æ±æ³¾å建路-建å¯è·¯-æ±å¹³å
¬è·¯", Pair(121.142609,30.863955), Pair(121.146407,30.864167)), |
| | | // LocationRoadNearby.BasePlace("æ±æ³¾å建路-æ±å¹³å
¬è·¯-æ±å¢è·¯", Pair(121.146407,30.864167), Pair(121.153675,30.864075)), |
| | | // 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.416643,31.163531), Pair(121.416643,31.163531)), |
| | | ) |
| | | locationRoadNearby.searchList(bList, 1000.0) |
| | | locationRoadNearby.searchList(bList, 2000.0) |
| | | } |
| | | } |