1. 新增后台任务关联模块
2. 新增自动评分后台任务;
3. 修复部分bug
已修改74个文件
已删除2个文件
已添加16个文件
已重命名1个文件
| | |
| | | <version>4.1.2</version> |
| | | </dependency> |
| | | |
| | | <!-- https://mvnrepository.com/artifact/org.apache.poi/poi-ooxml --> |
| | | <dependency> |
| | | <groupId>org.apache.poi</groupId> |
| | | <artifactId>poi-ooxml</artifactId> |
| | | <version>4.1.2</version> |
| | | </dependency> |
| | | |
| | | <!-- https://mvnrepository.com/artifact/com.google.zxing/core --> |
| | | <dependency> |
| | | <groupId>com.google.zxing</groupId> |
| | |
| | | /** |
| | | * è¶
æåå¼ç¾åæ¯ |
| | | */ |
| | | abstract fun overAvgRate(avg: Double, dAvg: Double?): Double? |
| | | open fun overAvgRate(avg: Double, dAvg: Double?): Double? { |
| | | return if (dAvg != null && dAvg != .0) { |
| | | round(((avg - dAvg) / dAvg) * 1000) / 1000 |
| | | } else { |
| | | .0 |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * æ°æ®ä¸ªæ° |
| | |
| | | package cn.flightfeather.supervision.business.autooutput.dataanalysis |
| | | |
| | | import cn.flightfeather.supervision.common.exception.BizException |
| | | import cn.flightfeather.supervision.common.utils.Constant |
| | | import cn.flightfeather.supervision.domain.ds2.repository.JADustSiteMapRep |
| | | import cn.flightfeather.supervision.domain.ds3.repository.JSDustSiteMapRep |
| | | import cn.flightfeather.supervision.common.utils.ExcelUtil |
| | | import cn.flightfeather.supervision.domain.ds1.entity.Scense |
| | | import cn.flightfeather.supervision.domain.ds1.repository.SceneRep |
| | | import cn.flightfeather.supervision.domain.ds1.repository.TaskRep |
| | | import cn.flightfeather.supervision.domain.ds1.repository.UserInfoSVRep |
| | | import cn.flightfeather.supervision.domain.ds2.repository.JADustSiteRep |
| | | import cn.flightfeather.supervision.domain.ds3.repository.JSDustSiteRep |
| | | import cn.flightfeather.supervision.domain.ds3.repository.XHFumeSiteMapRep |
| | | import cn.flightfeather.supervision.lightshare.vo.AreaVo |
| | | import cn.flightfeather.supervision.lightshare.vo.DeviceMapVo |
| | | import cn.flightfeather.supervision.lightshare.vo.* |
| | | import org.apache.poi.hssf.usermodel.HSSFWorkbook |
| | | import org.springframework.stereotype.Component |
| | | import java.io.FileOutputStream |
| | | import java.util.* |
| | | |
| | | /** |
| | | * çæµæ°æ®åç³»ç»ç¨æ·çæ å°ç®¡ç |
| | | */ |
| | | @Component |
| | | class AopDataDeviceMap( |
| | | private val jaDustSiteMapRep: JADustSiteMapRep, |
| | | private val jsDustSiteMapRep: JSDustSiteMapRep, |
| | | private val jaDustSiteRep: JADustSiteRep, |
| | | private val jsDustSiteRep: JSDustSiteRep, |
| | | private val xhFumeSiteMapRep: XHFumeSiteMapRep, |
| | | private val taskRep: TaskRep, |
| | | private val sceneRep: SceneRep, |
| | | private val userInfoSVRep: UserInfoSVRep, |
| | | ) { |
| | | |
| | | /** |
| | |
| | | //éå®åº |
| | | "310106" -> when (areaVo.scensetypeid) { |
| | | //å·¥å° |
| | | Constant.SceneType.TYPE1.value -> jaDustSiteMapRep.findBySVUserId(userIdList) |
| | | Constant.SceneType.TYPE1.value -> jaDustSiteRep.findMapBySVUserId(userIdList) |
| | | else -> emptyList() |
| | | } |
| | | //éå±±åº |
| | |
| | | Constant.SceneType.TYPE1.value, |
| | | Constant.SceneType.TYPE2.value, |
| | | Constant.SceneType.TYPE3.value, |
| | | -> jsDustSiteMapRep.findBySVUserId(userIdList) |
| | | -> jsDustSiteRep.findMapBySVUserId(userIdList) |
| | | else -> emptyList() |
| | | } |
| | | //徿±åº |
| | |
| | | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * è¾åºçæµç¹ä½åçæµè®¾å¤ç对åºå¹é
å
³ç³» |
| | | * @param areaVo åºåæ¡ä»¶ |
| | | */ |
| | | fun outputMapSet(areaVo: AreaVo) { |
| | | // ç管æ»ä»»å¡ |
| | | val task = taskRep.findOneTask(areaVo) ?: throw BizException("å½åæ¥è¯¢æ¡ä»¶ä¸æªæ¾å°å¯¹åºé¡¶å±ä»»å¡") |
| | | // æ»ä»»å¡å
å«å¯¹åºç±»åçåºæ¯ |
| | | val scenes = sceneRep.findScene(task.tguid!!, areaVo.scensetypeid?.toInt(), areaVo.towncode) |
| | | val sceneIds = scenes.map { it?.guid } |
| | | val userIdList = userInfoSVRep.findUser(sceneIds).map { it?.guid } |
| | | // åºæ¯åçæµç¹çå¹é
å
³ç³» |
| | | val mapSet = this.findMapSet(areaVo, userIdList) |
| | | // çæµè®¾å¤ä¿¡æ¯ |
| | | val deviceSiteList = when (areaVo.districtcode) { |
| | | //éå®åº |
| | | "310106" -> when (areaVo.scensetypeid) { |
| | | //å·¥å° |
| | | Constant.SceneType.TYPE1.value -> jaDustSiteRep.findSiteInfo() |
| | | else -> emptyList() |
| | | } |
| | | //éå±±åº |
| | | "310116" -> when (areaVo.scensetypeid) { |
| | | //å·¥å°,ç 头水泥æ
æç« |
| | | Constant.SceneType.TYPE1.value, |
| | | Constant.SceneType.TYPE2.value, |
| | | Constant.SceneType.TYPE3.value, |
| | | -> jsDustSiteRep.findSiteInfo() |
| | | else -> emptyList() |
| | | } |
| | | //徿±åº |
| | | "310104" -> when (areaVo.scensetypeid) { |
| | | //é¤é¥® |
| | | Constant.SceneType.TYPE5.value -> emptyList() |
| | | else -> emptyList() |
| | | } |
| | | else -> emptyList() |
| | | } |
| | | |
| | | outputMapSetToFile(areaVo, scenes, mapSet, deviceSiteList) |
| | | } |
| | | |
| | | /** |
| | | * è¾åºçæµç¹ä½åçæµè®¾å¤ç对åºå¹é
å
³ç³»å°æä»¶ä¸ |
| | | * @param scenes åºæ¯ä¿¡æ¯å表 |
| | | * @param mapSet åºæ¯åçæµç¹å¯¹åºå
³ç³» |
| | | * @param siteList çæµç¹ä¿¡æ¯å表 |
| | | */ |
| | | private fun outputMapSetToFile(areaVo: AreaVo, scenes: List<Scense?>, mapSet: List<DeviceMapVo>, siteList: |
| | | List<DeviceSiteVo>) { |
| | | val _scenes = mutableListOf<Scense?>().also { it.addAll(scenes) } |
| | | val _siteList = mutableListOf<DeviceSiteVo>().also { it.addAll(siteList) } |
| | | |
| | | val sceneDeviceList = mutableListOf<SceneDeviceVo>() |
| | | //表头 |
| | | val head = sceneDeviceList.tableHead() |
| | | scenes.forEach { |
| | | val sceneDeviceVo = SceneDeviceVo() |
| | | sceneDeviceVo.scene = it |
| | | val user = userInfoSVRep.findUser(it?.guid) |
| | | mapSet.findBySVUserId(user?.guid).forEach { map -> |
| | | val site = siteList.findByMNCode(map.deviceCode) |
| | | sceneDeviceVo.deviceList.add(site) |
| | | _siteList.remove(site) |
| | | } |
| | | sceneDeviceList.add(sceneDeviceVo) |
| | | } |
| | | //å
容 |
| | | val contents = sceneDeviceList.tableContent() |
| | | |
| | | |
| | | val workbook = HSSFWorkbook() |
| | | ExcelUtil.write(head, contents, workbook, sheetName = "åºæ¯è®¾å¤å¹é
") |
| | | |
| | | val head2 = sceneDeviceList.tableHeadDevice() |
| | | val contents2 = mutableListOf<Array<Any>>() |
| | | _siteList.forEach { |
| | | contents2.add(arrayOf(it.id ?: "", it.mnCode ?: "", it.name ?: "", it.address ?: "", it.beginDate ?: "", it |
| | | .dutyCompany ?: "", it.groupName ?: "")) |
| | | } |
| | | ExcelUtil.write(head2, contents2, workbook, sheetName = "æªå¹é
设å¤") |
| | | |
| | | val path = "target/" |
| | | val fileName = "${areaVo.districtname}-åºæ¯è®¾å¤ä¿¡æ¯-${Date().time}.xls" |
| | | val out = FileOutputStream(path + fileName) |
| | | workbook.write(out) |
| | | workbook.close() |
| | | out.flush() |
| | | out.close() |
| | | } |
| | | |
| | | } |
| | |
| | | } |
| | | |
| | | override fun overAvgRate(avg: Double, dAvg: Double?): Double? { |
| | | return if (dAvg != null) { |
| | | round(((avg - dAvg) / dAvg) * 1000) / 1000 |
| | | } else { |
| | | null |
| | | } |
| | | return super.overAvgRate(avg, dAvg) |
| | | } |
| | | |
| | | override fun count(dataList: List<List<HourDustData?>>): Int { |
| | |
| | | } |
| | | |
| | | override fun overAvgRate(avg: Double, dAvg: Double?): Double? { |
| | | return if (dAvg != null) { |
| | | round(((avg - dAvg) / dAvg) * 1000) / 1000 |
| | | } else { |
| | | null |
| | | } |
| | | return super.overAvgRate(avg, dAvg) |
| | | } |
| | | |
| | | override fun effectiveRate( |
| | |
| | | package cn.flightfeather.supervision.business.autooutput.datasource |
| | | |
| | | import cn.flightfeather.supervision.common.exception.ResponseErrorException |
| | | import cn.flightfeather.supervision.common.exception.BizException |
| | | import cn.flightfeather.supervision.common.utils.Constant |
| | | import cn.flightfeather.supervision.domain.ds1.entity.* |
| | | import cn.flightfeather.supervision.domain.ds2.entity.LedgerRecord |
| | |
| | | |
| | | // ä»ç管系ç»è·ååºæ¯ |
| | | private fun initSceneSource(config: AopDataConfig) { |
| | | config.topTaskGuid ?: throw ResponseErrorException("é¡¶å±ä»»å¡idä¸è½ä¸ºnull") |
| | | config.topTaskGuid ?: throw BizException("é¡¶å±ä»»å¡idä¸è½ä¸ºnull") |
| | | this.config = config |
| | | this.mode = 0 |
| | | sceneSourceList.clear() |
| | |
| | | package cn.flightfeather.supervision.business.autooutput.score |
| | | |
| | | import cn.flightfeather.supervision.business.autooutput.datasource.AopDataConfig |
| | | import cn.flightfeather.supervision.common.exception.ResponseErrorException |
| | | import cn.flightfeather.supervision.common.exception.BizException |
| | | import cn.flightfeather.supervision.common.utils.Constant |
| | | import cn.flightfeather.supervision.domain.ds1.repository.EvaluationRep |
| | | import cn.flightfeather.supervision.domain.ds2.entity.UserinfoTZ |
| | |
| | | ) { |
| | | |
| | | fun execute(config: AopDataConfig) { |
| | | if (config.year == null || config.month == null) throw ResponseErrorException("ç¯ä¿¡ç è¯ä¼°æ¶å¿
é¡»ä¼ éæ¶é´æ¡ä»¶!") |
| | | if (config.year == null || config.month == null) throw BizException("ç¯ä¿¡ç è¯ä¼°æ¶å¿
é¡»ä¼ éæ¶é´æ¡ä»¶!") |
| | | // æ¾å°é£ç¾½ç¯å¢ä¸éè¦çæç¯ä¿¡ç çææç«ç¹ |
| | | val sceneType = Constant.SceneType.getByValue(config.sceneType.toString()) |
| | | val userList = findUsers(config.districtName, sceneType) |
| | |
| | | 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.exception.ResponseErrorException |
| | | import cn.flightfeather.supervision.common.exception.BizException |
| | | import cn.flightfeather.supervision.common.executor.BackgroundTaskCtrl |
| | | import cn.flightfeather.supervision.common.executor.BgTaskStatus |
| | | import cn.flightfeather.supervision.common.executor.BgTaskType |
| | |
| | | val districtCode = areaVo.districtcode |
| | | val districtName = areaVo.districtname |
| | | // val d = LocalDateTime.parse(areaVo.starttime, DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")) |
| | | val d = areaVo.starttime ?: throw ResponseErrorException("èªå¨è¯ä¼°ä»»å¡å¿
é¡»è®¾å®æ¶é´") |
| | | val d = areaVo.starttime ?: throw BizException("èªå¨è¯ä¼°ä»»å¡å¿
é¡»è®¾å®æ¶é´") |
| | | val year = d.year |
| | | val month = d.monthValue |
| | | val sceneType = areaVo.scensetypeid?.toInt() ?: throw ResponseErrorException("åºæ¯ç±»åæªè®¾ç½®ï¼æ æ³è¯ä¼°") |
| | | val sceneType = areaVo.scensetypeid?.toInt() ?: throw BizException("åºæ¯ç±»åæªè®¾ç½®ï¼æ æ³è¯ä¼°") |
| | | |
| | | val id = "${BgTaskType.AUTO_SCORE.name}-${districtCode}-${sceneType}" |
| | | val name = "${districtName}${Constant.SceneType.getDes(sceneType)}èªå¨è¯å" |
| | |
| | | } |
| | | return bgTask.taskStatus |
| | | } else { |
| | | throw ResponseErrorException("å·¡æ¥æ»ä»»å¡ä¸åå¨ï¼æ æ³è¯ä¼°") |
| | | throw BizException("å·¡æ¥æ»ä»»å¡ä¸åå¨ï¼æ æ³è¯ä¼°") |
| | | } |
| | | } |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package cn.flightfeather.supervision.business.import |
| | | |
| | | import cn.flightfeather.supervision.common.exception.BizException |
| | | import cn.flightfeather.supervision.common.utils.Constant |
| | | import cn.flightfeather.supervision.common.utils.ExcelUtil |
| | | import cn.flightfeather.supervision.domain.ds1.entity.Scense |
| | | import cn.flightfeather.supervision.domain.ds1.repository.RegionRep |
| | | import org.apache.poi.ss.usermodel.CellType |
| | | import org.springframework.stereotype.Component |
| | | import java.io.InputStream |
| | | import java.util.* |
| | | |
| | | /** |
| | | * åºæ¯ä¿¡æ¯å¯¼å
¥å·¥å
· |
| | | */ |
| | | @Component |
| | | class SceneImport( |
| | | private val regionRep: RegionRep, |
| | | ) { |
| | | private val headers = |
| | | listOf( |
| | | ExcelUtil.MyHeader("ç¼å·ï¼è¥ä¸å¡«åï¼åæç
§é¡ºåºèªå¨æ·»å ï¼", CellType.NUMERIC), |
| | | ExcelUtil.MyHeader("åç§°", CellType.STRING), |
| | | ExcelUtil.MyHeader("ç±»å", CellType.STRING), |
| | | ExcelUtil.MyHeader("å°å", CellType.STRING), |
| | | ExcelUtil.MyHeader("ç»åº¦ï¼é«å¾·ï¼", CellType.NUMERIC), |
| | | ExcelUtil.MyHeader("纬度ï¼é«å¾·ï¼", CellType.NUMERIC), |
| | | ExcelUtil.MyHeader("ç", CellType.STRING), |
| | | ExcelUtil.MyHeader("å¸", CellType.STRING), |
| | | ExcelUtil.MyHeader("åº", CellType.STRING), |
| | | ExcelUtil.MyHeader("è¡é", CellType.STRING), |
| | | ExcelUtil.MyHeader("è系人", CellType.STRING), |
| | | ExcelUtil.MyHeader("èç³»çµè¯", CellType.STRING) |
| | | ) |
| | | |
| | | /** |
| | | * éè¿æä»¶è¯»ååºæ¯ä¿¡æ¯ |
| | | */ |
| | | fun readFromFile(file: InputStream): List<Scense> { |
| | | val result = mutableListOf<Scense>() |
| | | try { |
| | | ExcelUtil.readXLXS(file, headers) { |
| | | val data = Scense().apply { |
| | | guid = null |
| | | name = it.getCell(1)?.stringCellValue?.trim() |
| | | typeid = null |
| | | type = it.getCell(2)?.stringCellValue?.trim() |
| | | scensesubtypeid = null |
| | | scensesubtype = null |
| | | location = it.getCell(3)?.stringCellValue?.trim() |
| | | longitude = it.getCell(4)?.numericCellValue?.toBigDecimal() |
| | | latitude = it.getCell(5)?.numericCellValue?.toBigDecimal() |
| | | provincecode = null |
| | | provincename = it.getCell(6)?.stringCellValue?.trim() |
| | | citycode = null |
| | | cityname = it.getCell(7)?.stringCellValue?.trim() |
| | | districtcode = null |
| | | districtname = it.getCell(8)?.stringCellValue?.trim() |
| | | towncode = null |
| | | townname = it.getCell(9)?.stringCellValue?.trim() |
| | | contactst = it.getCell(11)?.stringCellValue?.trim() |
| | | contactswx = null |
| | | contacts = it.getCell(10)?.stringCellValue?.trim() |
| | | createdate = Date() |
| | | updatedate = Date() |
| | | extension1 = "1" |
| | | extension2 = null |
| | | index = it.getCell(5)?.stringCellValue?.trim()?.toInt() |
| | | remark = null |
| | | } |
| | | data.typeid = Constant.SceneType.getByName(data.type)?.value?.toByte() |
| | | ?: throw BizException(errorStr(it.rowNum + 1, 2, "åºæ¯ç±»åä¸åå¨")) |
| | | data.provincecode = regionRep.findProvince(data.provincename)?.provincecode |
| | | ?: throw BizException(errorStr(it.rowNum + 1, 6, "ç份é误æç³»ç»æªæ¾é
ç½®")) |
| | | data.citycode = regionRep.findCity(data.cityname)?.citycode |
| | | ?: throw BizException(errorStr(it.rowNum + 1, 7, "åå¸é误æç³»ç»æªæ¾é
ç½®")) |
| | | data.districtcode = regionRep.findDistrict(data.districtname)?.districtcode |
| | | ?: throw BizException(errorStr(it.rowNum + 1, 8, "åºå¿é误æç³»ç»æªæ¾é
ç½®")) |
| | | data.towncode = regionRep.findTown(data.townname)?.towncode |
| | | ?: throw BizException(errorStr(it.rowNum + 1, 9, "è¡éé误æç³»ç»æªæ¾é
ç½®")) |
| | | |
| | | result.add(data) |
| | | } |
| | | } catch (e: IllegalStateException) { |
| | | throw BizException("excelæä»¶å
容éè¯¯ï¼æ°æ®è½¬æ¢å¤±è´¥ï¼", e) |
| | | } |
| | | return result |
| | | } |
| | | |
| | | private fun errorStr(row: Int, col: Int, str: String): String { |
| | | return "第${row}è¡ï¼ç¬¬${col}ååå
æ ¼é误ï¼${str}" |
| | | } |
| | | } |
| | |
| | | package cn.flightfeather.supervision.business.report |
| | | |
| | | import cn.flightfeather.supervision.common.exception.ResponseErrorException |
| | | import cn.flightfeather.supervision.common.utils.Constant |
| | | import cn.flightfeather.supervision.common.utils.DateUtil |
| | | import cn.flightfeather.supervision.common.exception.BizException |
| | | import cn.flightfeather.supervision.common.utils.ExcelUtil |
| | | import cn.flightfeather.supervision.domain.ds1.entity.Problemlist |
| | | import org.apache.poi.hssf.usermodel.HSSFWorkbook |
| | | import tk.mybatis.mapper.entity.Example |
| | | import java.io.FileOutputStream |
| | | import java.io.OutputStream |
| | | import java.util.* |
| | |
| | | |
| | | |
| | | open fun execute() { |
| | | if (dataSourceList.isEmpty()) throw ResponseErrorException("${templateName}: æ°æ®æºä¸ºç©º") |
| | | if (dataSourceList.isEmpty()) throw BizException("${templateName}: æ°æ®æºä¸ºç©º") |
| | | //åæè¡¨å¤´ |
| | | cols.forEach { |
| | | it.combineHead(head, dataSourceList[0]) |
| | |
| | | private var _baseScene: BaseScene? = null |
| | | |
| | | //å
·ä½çé®é¢ |
| | | val problems: MutableList<Problemlist> |
| | | val problems: List<Problemlist> |
| | | get() { |
| | | if (noRecord()) return mutableListOf() |
| | | |
| | | if (_problems.isEmpty()) { |
| | | if (_problems == null) { |
| | | val r = dbMapper.problemlistMapper.selectByExample(Example(Problemlist::class.java).apply { |
| | | createCriteria().andEqualTo("stguid", subTask?.stguid) |
| | | }) |
| | | _problems.addAll(r) |
| | | _problems = r |
| | | } |
| | | return _problems |
| | | return _problems ?: emptyList() |
| | | } |
| | | private var _problems = mutableListOf<Problemlist>() |
| | | private var _problems: List<Problemlist>? = null |
| | | |
| | | //è¯ä¼°æ»å |
| | | val evaluation: Evaluation? |
| | |
| | | private var _evaluation: Evaluation? = null |
| | | |
| | | //è¯ä¼°ç»åå¾å |
| | | val itemevaluationList: MutableList<Itemevaluation> |
| | | val itemevaluationList: List<Itemevaluation> |
| | | get() { |
| | | if (_itemevaluationList.isEmpty()) { |
| | | if (_itemevaluationList == null) { |
| | | val r = dbMapper.itemevaluationMapper.selectByExample(Example(Itemevaluation::class.java).apply { |
| | | createCriteria().andEqualTo("stguid", subTask?.stguid) |
| | | }) |
| | | _itemevaluationList.addAll(r) |
| | | _itemevaluationList = r |
| | | println("-------------------itemevaluationList--------------------------------") |
| | | } |
| | | return _itemevaluationList |
| | | return _itemevaluationList ?: emptyList() |
| | | } |
| | | private var _itemevaluationList = mutableListOf<Itemevaluation>() |
| | | private var _itemevaluationList: List<Itemevaluation>? = null |
| | | |
| | | //é®é¢ç±»å |
| | | val problemTypes: MutableList<Problemtype> |
| | | val problemTypes: List<Problemtype> |
| | | get() { |
| | | if (_problemTypes.isEmpty()) { |
| | | if (_problemTypes == null) { |
| | | val r = dbMapper.problemtypeMapper.selectByExample(Example(Problemtype::class.java).apply { |
| | | createCriteria().andEqualTo("scensetypeid", scene?.typeid) |
| | | .andEqualTo("districtcode", scene?.districtcode) |
| | | orderBy("extension1") |
| | | }) |
| | | _problemTypes.addAll(r) |
| | | _problemTypes = r |
| | | } |
| | | return _problemTypes |
| | | return _problemTypes ?: emptyList() |
| | | } |
| | | private var _problemTypes = mutableListOf<Problemtype>() |
| | | private var _problemTypes: List<Problemtype>? = null |
| | | |
| | | //èªå¨è¯åè§åä¸çº§åç±» |
| | | val topItems: MutableList<Evaluationsubrule2> |
| | | val topItems: List<Evaluationsubrule2> |
| | | get() { |
| | | if (_topItems.isEmpty()) { |
| | | if (_topItems == null) { |
| | | val tempTopItems = mutableListOf<Evaluationsubrule2>() |
| | | val secRules = mutableListOf<Pair<Evaluationsubrule2, MutableList<Evaluationsubrule2>>>() |
| | | val rule = dbMapper.evaluationruleMapper.selectByExample(Example(Evaluationrule::class.java).apply { |
| | | createCriteria() |
| | | .andEqualTo("tasktypeid", 99) |
| | |
| | | }) |
| | | rules.forEach { |
| | | if (it.ertype == 2) { |
| | | _topItems.add(it) |
| | | tempTopItems.add(it) |
| | | } |
| | | } |
| | | _topItems.sortBy { it.displayid } |
| | | tempTopItems.sortBy { it.displayid } |
| | | |
| | | var t = 0 |
| | | _topItems.forEach { |
| | | tempTopItems.forEach { |
| | | t += it.maxscore ?: 0 |
| | | val tempRules = mutableListOf<Evaluationsubrule2>() |
| | | for (i in rules) { |
| | |
| | | } |
| | | } |
| | | tempSubRules.sortBy { ts -> ts.displayid } |
| | | this._rules.add(Pair(temp, tempSubRules)) |
| | | secRules.add(Pair(temp, tempSubRules)) |
| | | } |
| | | } |
| | | } |
| | | this._rules = secRules |
| | | _topItems = tempTopItems |
| | | } |
| | | return _topItems |
| | | return _topItems ?: emptyList() |
| | | } |
| | | private var _topItems = mutableListOf<Evaluationsubrule2>() |
| | | private var _topItems: List<Evaluationsubrule2>? = null |
| | | |
| | | //èªå¨è¯åè§åäºçº§åä¸çº§åç±» |
| | | val rules: MutableList<Pair<Evaluationsubrule2, MutableList<Evaluationsubrule2>>> |
| | | val rules: List<Pair<Evaluationsubrule2, MutableList<Evaluationsubrule2>>> |
| | | get() { |
| | | if (_rules.isEmpty()) { |
| | | if (_rules == null) { |
| | | this.topItems |
| | | } |
| | | return _rules |
| | | return _rules ?: emptyList() |
| | | } |
| | | private var _rules = mutableListOf<Pair<Evaluationsubrule2, MutableList<Evaluationsubrule2>>>() |
| | | private var _rules: List<Pair<Evaluationsubrule2, MutableList<Evaluationsubrule2>>>? = null |
| | | |
| | | //å¿
å¡«å°è´¦æ°é |
| | | val ledgerCount: Int |
| | |
| | | fun clear() { |
| | | _scene = null |
| | | _baseScene = null |
| | | _problems.clear() |
| | | _problems = null |
| | | _evaluation = null |
| | | _itemevaluationList.clear() |
| | | _itemevaluationList = null |
| | | _ledgerRecordNum = null |
| | | if (lastScene != null && lastScene?.typeid != scene?.typeid) { |
| | | _problemTypes.clear() |
| | | _topItems.clear() |
| | | _rules.clear() |
| | | _problemTypes = null |
| | | _topItems = null |
| | | _rules = null |
| | | _ledgerCount = -1 |
| | | } |
| | | recordLastScene() |
| ÎļþÃû´Ó src/main/kotlin/cn/flightfeather/supervision/common/exception/ResponseErrorException.kt ÐÞ¸Ä |
| | |
| | | package cn.flightfeather.supervision.common.exception |
| | | |
| | | /** |
| | | * å
许æ¥å£è¿åçä¸å¡å±é¢çé误 |
| | | * å
许æ¥å£è¿åçä¸å¡å±é¢é误 |
| | | */ |
| | | class ResponseErrorException : Exception { |
| | | class BizException : Exception { |
| | | constructor():super() |
| | | constructor(message: String) : super(message) |
| | | constructor(message: String, cause: Throwable) : super(message, cause) |
| | |
| | | package cn.flightfeather.supervision.common.executor |
| | | |
| | | import cn.flightfeather.supervision.common.exception.ResponseErrorException |
| | | import cn.flightfeather.supervision.common.exception.BizException |
| | | import org.springframework.stereotype.Component |
| | | import java.time.LocalDateTime |
| | | import java.util.concurrent.ConcurrentHashMap |
| | | import java.util.concurrent.Executors |
| | | import kotlin.jvm.Throws |
| | |
| | | /** |
| | | * æ°å¢ä»»å¡ |
| | | */ |
| | | @Throws(ResponseErrorException::class) |
| | | @Throws(BizException::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 ResponseErrorException("æ æ³å建任å¡ï¼ ä»»å¡[${name}]çidéå¤") |
| | | // 夿任å¡idæ¯å¦åå¨ |
| | | if (taskSet.containsKey(id)) { |
| | | val oldTask = taskSet[id] |
| | | // å½ä»»å¡å·²ç»ç»ææ¶ï¼ç´æ¥å é¤ï¼æ¿æ¢ä¸ºæ°ä»»å¡ |
| | | if (oldTask?.taskStatus?.status != TaskStatus.WAITING || oldTask.taskStatus.status != TaskStatus.RUNNING) { |
| | | taskSet.remove(id) |
| | | } |
| | | else { |
| | | throw BizException("æ æ³éå¤å建任å¡") |
| | | } |
| | | } |
| | | val t = BgTask(type, id, name, task) |
| | | taskSet[id] = t |
| | | return t |
| | |
| | | /** |
| | | * å¼å§ä»»å¡ |
| | | */ |
| | | @Throws(ResponseErrorException::class) |
| | | @Throws(BizException::class) |
| | | fun startTask(type: BgTaskType, id: String): BgTask { |
| | | val taskSet = taskCollection[type] ?: throw throw ResponseErrorException("æ æ³å¼å¯ä»»å¡ï¼è¯¥ä»»å¡ç±»å[${type.des}]ä¸åå¨") |
| | | val t = taskSet[id] ?: throw ResponseErrorException("æ æ³å¼å¯ä»»å¡ï¼è¯¥ä»»å¡[${id}]ä¸åå¨") |
| | | val taskSet = taskCollection[type] ?: throw throw BizException("æ æ³å¼å¯ä»»å¡ï¼è¯¥ä»»å¡ç±»å[${type.des}]ä¸åå¨") |
| | | val t = taskSet[id] ?: throw BizException("æ æ³å¼å¯ä»»å¡ï¼è¯¥ä»»å¡[${id}]ä¸åå¨") |
| | | return startTask(t) |
| | | } |
| | | |
| | | @Throws(ResponseErrorException::class) |
| | | @Throws(BizException::class) |
| | | fun startTask(task: BgTask): BgTask { |
| | | if (task.taskStatus.status != TaskStatus.WAITING) { |
| | | if (task.taskStatus.status == TaskStatus.RUNNING) { |
| | | throw ResponseErrorException("æ æ³å¼å¯ä»»å¡ï¼ä»»å¡[${task.name}]æ£å¨æ§è¡") |
| | | throw BizException("æ æ³å¼å¯ä»»å¡ï¼ä»»å¡[${task.name}]æ£å¨æ§è¡") |
| | | } else { |
| | | throw ResponseErrorException("æ æ³å¼å¯ä»»å¡ï¼ä»»å¡[${task.name}]å·²ç»æ") |
| | | throw BizException("æ æ³å¼å¯ä»»å¡ï¼ä»»å¡[${task.name}]å·²ç»æ") |
| | | } |
| | | } else { |
| | | task.ready() |
| | |
| | | /** |
| | | * æ°å¢å¹¶å¼å§ä»»å¡ |
| | | */ |
| | | @Throws(ResponseErrorException::class) |
| | | @Throws(BizException::class) |
| | | fun startNewTask(type: BgTaskType, id: String, name: String, task: () -> Boolean): BgTask { |
| | | val t = newTask(type, id, name, task) |
| | | return startTask(t) |
| | |
| | | /** |
| | | * 强å¶å
³éä»»å¡ |
| | | */ |
| | | @Throws(ResponseErrorException::class) |
| | | @Throws(BizException::class) |
| | | fun shutDownTask(type: BgTaskType, id: String?): List<BgTaskStatus?> { |
| | | val taskMap = taskCollection[type] ?: throw ResponseErrorException("æ æ³å
³éä»»å¡ï¼ä»»å¡ç±»å[${type.des}]æªå建") |
| | | val taskMap = taskCollection[type] ?: throw BizException("æ æ³å
³éä»»å¡ï¼ä»»å¡ç±»å[${type.des}]æªå建") |
| | | return if (id != null) { |
| | | val task = taskMap[id] ?: throw ResponseErrorException("æ æ³å
³éä»»å¡ï¼ä»»å¡[${id}]ä¸åå¨") |
| | | val task = taskMap[id] ?: throw BizException("æ æ³å
³éä»»å¡ï¼ä»»å¡[${id}]ä¸åå¨") |
| | | task.shutdown() |
| | | listOf(task.taskStatus) |
| | | } else { |
| | |
| | | } |
| | | } |
| | | |
| | | @Throws(ResponseErrorException::class) |
| | | @Throws(BizException::class) |
| | | fun removeTask(type: BgTaskType, id: String): Boolean { |
| | | val statusList = shutDownTask(type, id) |
| | | if (statusList.isNotEmpty()) { |
| | | val s = statusList.first() ?: throw ResponseErrorException("æ æ³ç§»é¤ä»»å¡ï¼ä»»å¡ä¸åå¨") |
| | | val s = statusList.first() ?: throw BizException("æ æ³ç§»é¤ä»»å¡ï¼ä»»å¡ä¸åå¨") |
| | | taskCollection[s.type]?.remove(s.id) |
| | | return true |
| | | } |
| | |
| | | package cn.flightfeather.supervision.common.executor |
| | | |
| | | import org.springframework.scheduling.annotation.Async |
| | | import java.time.LocalDateTime |
| | | import java.util.concurrent.Future |
| | | |
| | |
| | | } |
| | | |
| | | fun execute() { |
| | | val res = task() |
| | | if (res) success() else fail() |
| | | try { |
| | | val res = task() |
| | | if (res) success() else fail() |
| | | } catch (e: Exception) { |
| | | fail() |
| | | taskStatus.extra = e.message |
| | | } |
| | | } |
| | | |
| | | fun success() { |
| | |
| | | fun shutdown() { |
| | | if (future?.isCancelled == false && !future!!.isDone) { |
| | | future!!.cancel(true) |
| | | taskStatus.status = TaskStatus.SHUTDOWN |
| | | complete() |
| | | } |
| | | taskStatus.status = TaskStatus.SHUTDOWN |
| | | complete() |
| | | } |
| | | |
| | | fun complete() { |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package cn.flightfeather.supervision.common.utils |
| | | |
| | | import org.springframework.stereotype.Component |
| | | |
| | | /** |
| | | * ç¼ååé管çå·¥å
· |
| | | * å
è®¸æ°æ®åºå¸¸ç¨çåéå¨å
åä¸ç¼å䏿®µæ¶é´ï¼æé«è®¿é®é度 |
| | | * åç»åºè¯¥ä½¿ç¨redisçNOSQLæ°æ®åºæ¿ä»£ |
| | | */ |
| | | @Component |
| | | class CacheUtil { |
| | | |
| | | /** |
| | | * æ·»å åé |
| | | * |
| | | */ |
| | | fun addParams(p:Any?) { |
| | | |
| | | } |
| | | } |
| | |
| | | else -> sceneTypeId |
| | | } |
| | | |
| | | fun getDes(value: Int?) = when (value.toString()) { |
| | | "1" -> TYPE1.text |
| | | "2" -> TYPE2.text |
| | | "3" -> TYPE3.text |
| | | "4" -> TYPE4.text |
| | | "5" -> TYPE5.text |
| | | "6" -> TYPE6.text |
| | | "7" -> TYPE7.text |
| | | "8" -> TYPE8.text |
| | | "9" -> TYPE9.text |
| | | "10" -> TYPE10.text |
| | | "11" -> TYPE11.text |
| | | "12" -> TYPE12.text |
| | | "13" -> TYPE13.text |
| | | "14" -> TYPE14.text |
| | | "99" -> TYPE99.text |
| | | else -> "" |
| | | fun getDes(value: Int?): String { |
| | | return getByValue(value?.toString()).text |
| | | } |
| | | |
| | | fun getByValue(value: String?) = when (value.toString()) { |
| | |
| | | "99" -> TYPE99 |
| | | else -> TYPE99 |
| | | } |
| | | |
| | | fun getByName(name: String?) = when (name) { |
| | | TYPE1.text -> TYPE1 |
| | | TYPE2.text -> TYPE2 |
| | | TYPE3.text -> TYPE3 |
| | | TYPE4.text -> TYPE4 |
| | | TYPE5.text -> TYPE5 |
| | | TYPE6.text -> TYPE6 |
| | | TYPE7.text -> TYPE7 |
| | | TYPE8.text -> TYPE8 |
| | | TYPE9.text -> TYPE9 |
| | | TYPE10.text -> TYPE10 |
| | | TYPE11.text -> TYPE11 |
| | | TYPE12.text -> TYPE12 |
| | | TYPE13.text -> TYPE13 |
| | | TYPE14.text -> TYPE14 |
| | | TYPE99.text -> TYPE99 |
| | | else -> null |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | package cn.flightfeather.supervision.common.utils |
| | | |
| | | import cn.flightfeather.supervision.common.exception.BizException |
| | | import org.apache.poi.hssf.usermodel.HSSFWorkbook |
| | | import org.apache.poi.ss.usermodel.CellType |
| | | import org.apache.poi.ss.usermodel.Row |
| | | import org.apache.poi.ss.util.CellRangeAddress |
| | | import org.apache.poi.xssf.usermodel.XSSFWorkbook |
| | | import java.io.InputStream |
| | | import java.io.OutputStream |
| | | import java.time.LocalDate |
| | | import java.util.* |
| | |
| | | */ |
| | | object ExcelUtil { |
| | | |
| | | /** |
| | | * åå
æ ¼ |
| | | */ |
| | | class MyCell( |
| | | var text: String, |
| | | var rowSpan: Int = 1, |
| | |
| | | ) |
| | | |
| | | /** |
| | | * 表头å®ä¹ |
| | | */ |
| | | class MyHeader( |
| | | var name: String, |
| | | val type: CellType, |
| | | ) |
| | | |
| | | private fun cellTypeName(type: CellType): String = when (type) { |
| | | CellType.NUMERIC -> "æ°å" |
| | | CellType.STRING -> "ææ¬" |
| | | CellType.FORMULA -> "FORMULA" |
| | | CellType.BLANK -> "空ç½" |
| | | CellType.BOOLEAN -> "å¸å°å¼" |
| | | else -> "æªå®ä¹" |
| | | } |
| | | |
| | | |
| | | /** |
| | | * å
æ¬ .xlsx æä»¶ |
| | | */ |
| | | fun readXLXS(input: InputStream, headers: List<MyHeader>, onRow: (row: Row) -> Unit) { |
| | | val workbook = XSSFWorkbook(input) |
| | | val sheet1 = workbook.getSheetAt(0) |
| | | val header = sheet1.getRow(sheet1.topRow.toInt()) |
| | | // æ£æ¥ä¼ å
¥çæä»¶è¡¨å¤´æ¯å¦ç¬¦åè¦æ± |
| | | val cellIterator = header.cellIterator() |
| | | val headIterator = headers.iterator() |
| | | while (headIterator.hasNext()) { |
| | | val head = headIterator.next() |
| | | if (cellIterator.hasNext()) { |
| | | val cellText = cellIterator.next().stringCellValue |
| | | if (!cellText.equals(head.name)) { |
| | | throw BizException("æä»¶æ ¼å¼é误, 表头[${head}]åºè¯¥ä¸º[${cellText}]") |
| | | } |
| | | } else { |
| | | throw BizException("æä»¶æ ¼å¼é误, 表头[${head}]缺失") |
| | | } |
| | | } |
| | | // è·åè¿ä»£å¨å¹¶å»é¤ç¬¬ä¸è¡æ é¢ |
| | | val iterator = sheet1.rowIterator().also { it.next() } |
| | | iterator.forEach { |
| | | // æ£æ¥å½åè¡æ¯ä¸ªåå
æ ¼ç±»åæ¯å¦ä¸è¡¨å¤´å®ä¹å¹é
|
| | | headers.forEachIndexed { i, h -> |
| | | val t = it.getCell(i + 1).cellType |
| | | if (t != CellType.BLANK || t != h.type) { |
| | | throw BizException("第${it.rowNum + 1}è¡ï¼ç¬¬${i + 1}ååå
æ ¼æ ¼å¼é误ï¼åºè¯¥ä¸º${cellTypeName(h.type)}") |
| | | } |
| | | } |
| | | onRow(it) |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * èªå¨å¤çè¡åå¹¶æ°æ® |
| | | */ |
| | | fun write(heads: List<Array<Any>>, contents: MutableList<Array<Any>>, workbook: HSSFWorkbook, sheetName: String = "sheet1") { |
| | | fun write(heads: List<Array<Any>>, contents: MutableList<Array<Any>>, workbook: HSSFWorkbook, sheetName: String |
| | | = "sheet1") { |
| | | |
| | | val sheet = workbook.createSheet(sheetName) |
| | | |
| | |
| | | out.close() |
| | | } |
| | | |
| | | private fun getMaxRows(rowArray: Array<Any>): Int { |
| | | private fun getMaxRows(rowArray: Array<out Any>): Int { |
| | | var maxRows = 1 |
| | | rowArray.forEach { |
| | | if (it is Array<*>) { |
| | |
| | | import javax.persistence.Id |
| | | import javax.persistence.Table |
| | | |
| | | /** |
| | | * @date 2024.4.25 |
| | | * ç¨äºææ¶æ¿ä»£[Evaluationsubrule]çç±» |
| | | * å ä¸ºåæ°[Evaluationsubrule.ertype]被é误ç设å®ä¸º[Boolean]ç±»åï¼å®é
åºä¸º[Int]ç±»åï¼ |
| | | * ç®å主è¦å½±åäºå®åAPPç¨åºï¼å°APPç¨åºå¯¹åºåæ°è°æ´åæ¬ç±»å¯å®å
¨æ¿æ¢[Evaluationsubrule] |
| | | */ |
| | | @Table(name = "sm_t_evaluationsubrule") |
| | | @JsonInclude(JsonInclude.Include.NON_NULL) |
| | | public class Evaluationsubrule2 { |
| | |
| | | |
| | | import cn.flightfeather.supervision.domain.ds1.entity.Inspection |
| | | import cn.flightfeather.supervision.domain.util.MyMapper |
| | | import cn.flightfeather.supervision.lightshare.vo.InspectionInfoVo |
| | | import cn.flightfeather.supervision.lightshare.vo.InspectionStatisticVo |
| | | import org.apache.ibatis.annotations.Mapper |
| | | import kotlin.reflect.jvm.internal.impl.load.kotlin.JvmType |
| | |
| | | interface InspectionMapper:MyMapper<Inspection> { |
| | | |
| | | //è·å污æåºæ¯çæ¬ä¸»é¡µçç管æ
åµå±ç¤ºå
容 |
| | | fun getInspectionInfoByScene(sceneId: String, topTaskId: String): List<Map<String, JvmType.Object>> |
| | | fun getInspectionInfoByScene(sceneId: String, topTaskId: String): List<InspectionInfoVo?> |
| | | |
| | | //è·åæä»»å¡å·¡æ¥ç»è®¡ä¿¡æ¯ |
| | | fun getStatistic(topTaskId: String, sceneTypeId: String): List<InspectionStatisticVo> |
| | |
| | | package cn.flightfeather.supervision.domain.ds1.mapper |
| | | |
| | | import cn.flightfeather.supervision.domain.ds1.entity.Monitorobjectversion |
| | | import cn.flightfeather.supervision.domain.ds1.entity.Scense |
| | | import cn.flightfeather.supervision.domain.util.MyMapper |
| | | import org.apache.ibatis.annotations.Mapper |
| | | import org.apache.ibatis.annotations.Select |
| | | |
| | | @Mapper |
| | | interface MonitorobjectversionMapper:MyMapper<Monitorobjectversion> |
| | | interface MonitorobjectversionMapper : MyMapper<Monitorobjectversion> { |
| | | |
| | | fun findMonitorListByScene(taskId: String, sceneTypeId: String?): List<Monitorobjectversion> |
| | | } |
| | |
| | | |
| | | import cn.flightfeather.supervision.domain.ds1.entity.Problemlist |
| | | import cn.flightfeather.supervision.domain.util.MyMapper |
| | | import cn.flightfeather.supervision.lightshare.vo.SceneProblemSummary |
| | | import cn.flightfeather.supervision.lightshare.vo.StatisticsVo |
| | | import cn.flightfeather.supervision.lightshare.vo.UnChangedPro |
| | | import org.apache.ibatis.annotations.Mapper |
| | | import kotlin.reflect.jvm.internal.impl.load.kotlin.JvmType |
| | | |
| | | @Mapper |
| | | interface ProblemlistMapper:MyMapper<Problemlist> { |
| | | interface ProblemlistMapper : MyMapper<Problemlist> { |
| | | |
| | | /** |
| | | * è·åææ¶é´æ®µå
ãæä¸ªåºå¿çæç§åºæ¯ä¸ï¼åç±»åçé®é¢æ°éç»è®¡ |
| | | * @param districtcode åºå¿è¡æ¿ç¼ç |
| | | * @param starttime å¼å§æ¶é´ |
| | | * @param endtime ç»ææ¶é´ |
| | | * @param districtCode åºå¿è¡æ¿ç¼ç |
| | | * @param startTime å¼å§æ¶é´ |
| | | * @param endTime ç»ææ¶é´ |
| | | * @param sceneType åºæ¯ç±»å |
| | | */ |
| | | fun getStatisticalResult(districtcode:String?, starttime:String?, endtime:String?, sceneType:String?): List<Map<String, JvmType.Object>> |
| | | // fun getStatisticalResult(): List<Map<String, JvmType.Object>> |
| | | fun getStatisticalResult( |
| | | districtCode: String?, |
| | | startTime: String?, |
| | | endTime: String?, |
| | | sceneType: String?, |
| | | sceneId: String?, |
| | | ): List<StatisticsVo> |
| | | |
| | | fun getStatisticalResultById(topTaskId: String?, sceneTypeId: String?): List<Map<String, JvmType.Object>> |
| | | |
| | |
| | | * @param topTaskId é¡¶å±ä»»å¡ä¸»é®id |
| | | * @param sceneType åºæ¯ç±»åid |
| | | */ |
| | | fun getChangeResult(topTaskId:String?, sceneType:String?): List<Map<String, JvmType.Object>> |
| | | fun getChangeResult(topTaskId: String?, sceneType: String?): List<Map<String, JvmType.Object>> |
| | | |
| | | fun getScoreResult(topTaskId:String?, sceneType:String?): List<Map<String, JvmType.Object>> |
| | | fun getScoreResult(topTaskId: String?, sceneType: String?): List<Map<String, JvmType.Object>> |
| | | |
| | | fun selectSE(sql: String): String |
| | | |
| | |
| | | /** |
| | | * éè¿IDæ¥æ¾ æé®é¢å表 |
| | | */ |
| | | fun findMonthProblemById(taskId: String,sceneType: Int?): List<Map<String, JvmType.Object?>> |
| | | fun findMonthProblemById(taskId: String, sceneType: Int?): List<Map<String, JvmType.Object?>> |
| | | |
| | | /** |
| | | * éè¿æ¥ä»»å¡idæ¥æ¾æªæ´æ¹å®æçå任塿°,è¿åçæ¯æ¯ä¸ªå任塿ªå®ææ´æ¹çé®é¢æ° |
| | |
| | | * æ¥æ¾é®é¢çææ¶é´å¨ç»å®æ¶é´ä¹åçææé®é¢ |
| | | */ |
| | | fun getUnChangedProblem(deadLine: String): List<UnChangedPro> |
| | | |
| | | /** |
| | | * è·åæ»ä»»å¡ |
| | | */ |
| | | fun getSceneProSummary( |
| | | topTaskId: String, |
| | | sceneTypeId: String?, |
| | | sort: String?, |
| | | sortBy: String, |
| | | ): List<SceneProblemSummary> |
| | | } |
| | |
| | | package cn.flightfeather.supervision.domain.ds1.mapper |
| | | |
| | | import cn.flightfeather.supervision.domain.ds1.entity.Scense |
| | | import cn.flightfeather.supervision.domain.ds1.entity.Subtask |
| | | import cn.flightfeather.supervision.domain.util.MyMapper |
| | | import cn.flightfeather.supervision.lightshare.vo.SubTaskSearchResultVo2 |
| | |
| | | import cn.flightfeather.supervision.lightshare.vo.SubtaskSearchResultVo |
| | | import cn.flightfeather.supervision.lightshare.vo.SubtaskVo |
| | | import org.apache.ibatis.annotations.Mapper |
| | | import java.time.LocalDateTime |
| | | import java.util.* |
| | | |
| | | @Mapper |
| | |
| | | fun selectByTopTask2(topTaskId: String, sceneTypeId: Int? = null): List<Subtask> |
| | | |
| | | fun getSummary(topTaskId: String, sceneTypeId: Int?): List<SubTaskSummary> |
| | | |
| | | fun getSummaryByScene(sceneId: String, startTime: LocalDateTime?, endTime: LocalDateTime?): List<SubTaskSummary> |
| | | |
| | | fun findSubTasksByProType(topTaskId: String, sceneTypeId: String, proType: String): List<Subtask> |
| | | } |
| | |
| | | package cn.flightfeather.supervision.domain.ds1.repository |
| | | |
| | | import cn.flightfeather.supervision.domain.ds1.entity.Evaluation |
| | | import cn.flightfeather.supervision.domain.ds1.entity.Itemevaluation |
| | | import cn.flightfeather.supervision.domain.ds1.mapper.EvaluationMapper |
| | | import cn.flightfeather.supervision.domain.ds1.mapper.ItemevaluationMapper |
| | | import cn.flightfeather.supervision.lightshare.vo.AreaVo |
| | |
| | | return if (res.isNotEmpty()) res[0] else null |
| | | } |
| | | |
| | | |
| | | /** |
| | | * æ¥æ¾èªå¨è¯åç»æ |
| | | */ |
| | |
| | | val task = taskRep.findOneTask(areaVo) ?: return null |
| | | return evaluationMapper.findEvaluation(task.tguid!!, areaVo.scensetypeid!!) |
| | | } |
| | | |
| | | /** |
| | | * æ¥æ¾å·¡æ¥ä»»å¡çå
·ä½è¯å |
| | | */ |
| | | fun findItemEvaluation(subTaskId: String): List<Itemevaluation> { |
| | | return itemevaluationMapper.selectByExample(Example(Itemevaluation::class.java).apply { |
| | | createCriteria().andEqualTo("stguid", subTaskId) |
| | | }) |
| | | } |
| | | } |
| | |
| | | package cn.flightfeather.supervision.domain.ds1.repository |
| | | |
| | | import cn.flightfeather.supervision.common.utils.Constant |
| | | import cn.flightfeather.supervision.domain.ds1.entity.Evaluationrule |
| | | import cn.flightfeather.supervision.domain.ds1.mapper.EvaluationruleMapper |
| | | import cn.flightfeather.supervision.lightshare.vo.AreaEvaVo |
| | |
| | | * è¯ä¼°è§åæ°æ®åºç¸å
³æä½ |
| | | */ |
| | | @Repository |
| | | class EvaluationRuleRep(private val evaluationruleMapper: EvaluationruleMapper) { |
| | | class EvaluationRuleRep( |
| | | private val evaluationruleMapper: EvaluationruleMapper, |
| | | private val sceneRep: SceneRep, |
| | | ) { |
| | | |
| | | /** |
| | | * æ ¹æ®åæ°æ¥è¯¢æ»è§å |
| | |
| | | and(createCriteria().orEqualTo("towncode", areaEvaVo.towncode).orIsNull("towncode")) |
| | | }) |
| | | } |
| | | |
| | | fun findAutoEvaluationRule(subTaskId:String): Evaluationrule? { |
| | | val scene = sceneRep.findBySubTask(subTaskId) |
| | | return findAutoEvaluationRule(Constant.SceneType.getByValue(scene?.typeid.toString())) |
| | | } |
| | | |
| | | fun findAutoEvaluationRule(sceneType: Constant.SceneType): Evaluationrule? { |
| | | return evaluationruleMapper.selectOne(Evaluationrule().apply { |
| | | scensetypeid = sceneType.value.toByteOrNull() |
| | | tasktypeid = 99 |
| | | }) |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package cn.flightfeather.supervision.domain.ds1.repository |
| | | |
| | | import cn.flightfeather.supervision.domain.ds1.mapper.ProblemlistMapper |
| | | import cn.flightfeather.supervision.lightshare.vo.SceneProblemSummary |
| | | import org.springframework.stereotype.Repository |
| | | |
| | | @Repository |
| | | class ProblemRep(private val problemlistMapper: ProblemlistMapper) { |
| | | |
| | | fun getSceneProSummary(topTaskId: String, sceneTypeId: String?, sort: String?, sortBy: String): |
| | | List<SceneProblemSummary> { |
| | | return problemlistMapper.getSceneProSummary(topTaskId, sceneTypeId, sort, sortBy) |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package cn.flightfeather.supervision.domain.ds1.repository |
| | | |
| | | import cn.flightfeather.supervision.common.utils.CacheUtil |
| | | import cn.flightfeather.supervision.domain.ds1.entity.City |
| | | import cn.flightfeather.supervision.domain.ds1.entity.District |
| | | import cn.flightfeather.supervision.domain.ds1.entity.Province |
| | | import cn.flightfeather.supervision.domain.ds1.entity.Town |
| | | import cn.flightfeather.supervision.domain.ds1.mapper.CityMapper |
| | | import cn.flightfeather.supervision.domain.ds1.mapper.DistrictMapper |
| | | import cn.flightfeather.supervision.domain.ds1.mapper.ProvinceMapper |
| | | import cn.flightfeather.supervision.domain.ds1.mapper.TownMapper |
| | | import org.springframework.stereotype.Repository |
| | | import tk.mybatis.mapper.entity.Example |
| | | |
| | | /** |
| | | * å°åä¿¡æ¯ç¸å
³æ°æ®åºæä½ |
| | | */ |
| | | @Repository |
| | | class RegionRep( |
| | | private val provinceMapper: ProvinceMapper, |
| | | private val cityMapper: CityMapper, |
| | | private val districtMapper: DistrictMapper, |
| | | private val townMapper: TownMapper, |
| | | private val cacheUtil: CacheUtil, |
| | | ) { |
| | | private val cacheMap = mutableMapOf<String, Any?>() |
| | | |
| | | private fun<T : Any?> findCache(key: String?, findDb: () -> T?): T? { |
| | | key ?: return null |
| | | val s = cacheMap[key] |
| | | return if (s == null) { |
| | | val value = findDb() |
| | | cacheMap[key] = value |
| | | value |
| | | } else { |
| | | try { |
| | | s as T |
| | | } catch (e: Exception) { |
| | | null |
| | | } |
| | | } |
| | | } |
| | | |
| | | fun findProvince(name: String?): Province? { |
| | | return findCache(name) { |
| | | provinceMapper.selectOne(Province().apply { provincename = name }) |
| | | } |
| | | } |
| | | |
| | | fun findCity(name: String?): City? { |
| | | return findCache(name) { |
| | | cityMapper.selectOne(City().apply { cityname = name }) |
| | | } |
| | | } |
| | | |
| | | fun findDistrict(name: String?): District? { |
| | | return findCache(name) { |
| | | districtMapper.selectOne(District().apply { districtname = name }) |
| | | } |
| | | } |
| | | |
| | | fun findTown(name: String?): Town? { |
| | | return findCache(name) { |
| | | townMapper.selectOne(Town().apply { townname = name }) |
| | | } |
| | | } |
| | | } |
| | |
| | | package cn.flightfeather.supervision.domain.ds1.repository |
| | | |
| | | import cn.flightfeather.supervision.common.exception.BizException |
| | | import cn.flightfeather.supervision.common.utils.UUIDGenerator |
| | | 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 javafx.scene.Scene |
| | | import org.springframework.stereotype.Repository |
| | | import tk.mybatis.mapper.entity.Example |
| | | import java.util.* |
| | | |
| | | /** |
| | | * åºæ¯ä¿¡æ¯æ°æ®åºç¸å
³æä½ |
| | |
| | | @Repository |
| | | class SceneRep( |
| | | private val scenseMapper: ScenseMapper, |
| | | private val userinfoMapper: UserinfoMapper, |
| | | private val subTaskRep: SubTaskRep, |
| | | ) { |
| | | |
| | | fun insert(scense: Scense?):Int { |
| | | scense ?: return 0 |
| | | if (scense.guid == null) scense.guid = UUIDGenerator.generate16ShortUUID() |
| | | scense.createdate = Date() |
| | | return scenseMapper.insertSelective(scense) |
| | | } |
| | | |
| | | /** |
| | | * æ¥æ¾åºæ¯ |
| | |
| | | fun findScene(topTaskId: String, sceneTypeId: Int? = null, townCode: String? = null): List<Scense?> { |
| | | return scenseMapper.getSceneByType(topTaskId, sceneTypeId, townCode) |
| | | } |
| | | |
| | | fun findScene(userId: String?): Scense? { |
| | | val user = userinfoMapper.selectByPrimaryKey(userId) ?: throw BizException("ç¨æ·idä¸åå¨") |
| | | return scenseMapper.selectByPrimaryKey(user.dGuid) |
| | | } |
| | | |
| | | fun findScene(sceneId: String? = null, sceneName: String? = null): Scense? { |
| | | return scenseMapper.selectOne(Scense().apply { |
| | | guid = sceneId |
| | | name = sceneName |
| | | }) |
| | | } |
| | | |
| | | fun findScenes(nameList: List<String?>): List<Scense?> { |
| | | return scenseMapper.selectByExample(Example(Scense::class.java).apply { |
| | | createCriteria().andIn("name", nameList) |
| | | }) |
| | | } |
| | | |
| | | fun findBySubTask(subTaskId: String): Scense? { |
| | | val subtask = subTaskRep.find(subTaskId) |
| | | return scenseMapper.selectByPrimaryKey(subtask?.scenseid) |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package cn.flightfeather.supervision.domain.ds1.repository |
| | | |
| | | import cn.flightfeather.supervision.domain.ds1.entity.Subtask |
| | | import cn.flightfeather.supervision.domain.ds1.mapper.SubtaskMapper |
| | | import org.springframework.stereotype.Repository |
| | | |
| | | @Repository |
| | | class SubTaskRep(private val subtaskMapper: SubtaskMapper) { |
| | | |
| | | |
| | | fun find(id:String): Subtask? { |
| | | return subtaskMapper.selectByPrimaryKey(id) |
| | | } |
| | | /** |
| | | * æ ¹æ®æ»ä»»å¡ãåºæ¯ç±»åãé®é¢ç±»åï¼è·ååç°è¯¥ç§ç±»é®é¢çåºæ¯ä¿¡æ¯ |
| | | */ |
| | | fun findSubtasks(topTaskId: String, sceneTypeId:String, proType: String): List<Subtask?> { |
| | | return subtaskMapper.findSubTasksByProType(topTaskId, sceneTypeId, proType) |
| | | } |
| | | } |
| | |
| | | package cn.flightfeather.supervision.domain.ds1.repository |
| | | |
| | | import cn.flightfeather.supervision.domain.ds1.entity.Monitorobjectversion |
| | | import cn.flightfeather.supervision.domain.ds1.entity.Task |
| | | import cn.flightfeather.supervision.domain.ds1.mapper.MonitorobjectversionMapper |
| | | 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.LocalDateTime |
| | | import java.time.ZoneId |
| | | import java.time.format.DateTimeFormatter |
| | | import java.util.* |
| | | |
| | | @Repository |
| | | class TaskRep(private val taskMapper: TaskMapper) { |
| | | class TaskRep(private val taskMapper: TaskMapper, private val monitorobjectversionMapper: MonitorobjectversionMapper) { |
| | | |
| | | private fun exampleTask(areaVo: AreaVo): Task?{ |
| | | areaVo.starttime ?: return null |
| | |
| | | val example = exampleTask(areaVo) ?: return emptyList() |
| | | return taskMapper.select(example) |
| | | } |
| | | |
| | | /** |
| | | * è·åæ»ä»»å¡å¯¹åºççç®¡çæ¬ |
| | | */ |
| | | fun findMonitorList(taskId: String, sceneTypeId:String?): List<Monitorobjectversion> { |
| | | val monitorList = monitorobjectversionMapper.findMonitorListByScene(taskId, sceneTypeId) |
| | | return monitorList.sortedBy { it.displayid } |
| | | } |
| | | } |
| | |
| | | ) { |
| | | |
| | | /** |
| | | * æ¥æ¾åºæ¯ |
| | | * æ¥æ¾ç¨æ· |
| | | */ |
| | | fun findUser(sceneIdList: List<String?>): List<Userinfo?> { |
| | | return userinfoMapper.selectByExample(Example(Userinfo::class.java).apply { |
| | |
| | | }) |
| | | } |
| | | |
| | | fun findUser(sceneId: String): List<Userinfo?> { |
| | | return userinfoMapper.selectByExample(Example(Userinfo::class.java).apply { |
| | | createCriteria().andEqualTo("dGuid", sceneId) |
| | | }) |
| | | fun findUser(sceneId: String?): Userinfo? { |
| | | return try { |
| | | userinfoMapper.selectOne(Userinfo().apply { dGuid = sceneId }) |
| | | } catch (e: Exception) { |
| | | null |
| | | } |
| | | } |
| | | } |
| | |
| | | private String biName; |
| | | |
| | | /** |
| | | * ç¨æ·ç®ç§° |
| | | */ |
| | | @Column(name = "BI_Nick_Name") |
| | | private String biNickName; |
| | | |
| | | /** |
| | | * æå±å
¬å¸id |
| | | */ |
| | | @Column(name = "CI_GUID") |
| | |
| | | */ |
| | | @Column(name = "CI_Name") |
| | | private String ciName; |
| | | |
| | | @Column(name = "BI_Province_Code") |
| | | private String biProvinceCode; |
| | | |
| | | @Column(name = "BI_Province_Name") |
| | | private String biProvinceName; |
| | | |
| | | @Column(name = "BI_City_Code") |
| | | private String biCityCode; |
| | | |
| | | @Column(name = "BI_City_Name") |
| | | private String biCityName; |
| | | |
| | | @Column(name = "BI_District_Code") |
| | | private String biDistrictCode; |
| | | |
| | | @Column(name = "BI_District_Name") |
| | | private String biDistrictName; |
| | | |
| | | @Column(name = "BI_Town_Code") |
| | | private String biTownCode; |
| | | |
| | | @Column(name = "BI_Town_Name") |
| | | private String biTownName; |
| | | |
| | | @Column(name = "BI_Area_Code") |
| | | private String biAreaCode; |
| | | |
| | | @Column(name = "BI_Area") |
| | | private String biArea; |
| | | |
| | | /** |
| | | * æå±ç©ä¸å
¬å¸åç§°id |
| | |
| | | } |
| | | |
| | | /** |
| | | * è·åç¨æ·ç®ç§° |
| | | * |
| | | * @return BI_Nick_Name - ç¨æ·ç®ç§° |
| | | */ |
| | | public String getBiNickName() { |
| | | return biNickName; |
| | | } |
| | | |
| | | /** |
| | | * è®¾ç½®ç¨æ·ç®ç§° |
| | | * |
| | | * @param biNickName ç¨æ·ç®ç§° |
| | | */ |
| | | public void setBiNickName(String biNickName) { |
| | | this.biNickName = biNickName == null ? null : biNickName.trim(); |
| | | } |
| | | |
| | | /** |
| | | * è·åæå±å
¬å¸id |
| | | * |
| | | * @return CI_GUID - æå±å
¬å¸id |
| | |
| | | } |
| | | |
| | | /** |
| | | * @return BI_Province_Code |
| | | */ |
| | | public String getBiProvinceCode() { |
| | | return biProvinceCode; |
| | | } |
| | | |
| | | /** |
| | | * @param biProvinceCode |
| | | */ |
| | | public void setBiProvinceCode(String biProvinceCode) { |
| | | this.biProvinceCode = biProvinceCode == null ? null : biProvinceCode.trim(); |
| | | } |
| | | |
| | | /** |
| | | * @return BI_Province_Name |
| | | */ |
| | | public String getBiProvinceName() { |
| | | return biProvinceName; |
| | | } |
| | | |
| | | /** |
| | | * @param biProvinceName |
| | | */ |
| | | public void setBiProvinceName(String biProvinceName) { |
| | | this.biProvinceName = biProvinceName == null ? null : biProvinceName.trim(); |
| | | } |
| | | |
| | | /** |
| | | * @return BI_City_Code |
| | | */ |
| | | public String getBiCityCode() { |
| | | return biCityCode; |
| | | } |
| | | |
| | | /** |
| | | * @param biCityCode |
| | | */ |
| | | public void setBiCityCode(String biCityCode) { |
| | | this.biCityCode = biCityCode == null ? null : biCityCode.trim(); |
| | | } |
| | | |
| | | /** |
| | | * @return BI_City_Name |
| | | */ |
| | | public String getBiCityName() { |
| | | return biCityName; |
| | | } |
| | | |
| | | /** |
| | | * @param biCityName |
| | | */ |
| | | public void setBiCityName(String biCityName) { |
| | | this.biCityName = biCityName == null ? null : biCityName.trim(); |
| | | } |
| | | |
| | | /** |
| | | * @return BI_District_Code |
| | | */ |
| | | public String getBiDistrictCode() { |
| | | return biDistrictCode; |
| | | } |
| | | |
| | | /** |
| | | * @param biDistrictCode |
| | | */ |
| | | public void setBiDistrictCode(String biDistrictCode) { |
| | | this.biDistrictCode = biDistrictCode == null ? null : biDistrictCode.trim(); |
| | | } |
| | | |
| | | /** |
| | | * @return BI_District_Name |
| | | */ |
| | | public String getBiDistrictName() { |
| | | return biDistrictName; |
| | | } |
| | | |
| | | /** |
| | | * @param biDistrictName |
| | | */ |
| | | public void setBiDistrictName(String biDistrictName) { |
| | | this.biDistrictName = biDistrictName == null ? null : biDistrictName.trim(); |
| | | } |
| | | |
| | | /** |
| | | * @return BI_Town_Code |
| | | */ |
| | | public String getBiTownCode() { |
| | | return biTownCode; |
| | | } |
| | | |
| | | /** |
| | | * @param biTownCode |
| | | */ |
| | | public void setBiTownCode(String biTownCode) { |
| | | this.biTownCode = biTownCode == null ? null : biTownCode.trim(); |
| | | } |
| | | |
| | | /** |
| | | * @return BI_Town_Name |
| | | */ |
| | | public String getBiTownName() { |
| | | return biTownName; |
| | | } |
| | | |
| | | /** |
| | | * @param biTownName |
| | | */ |
| | | public void setBiTownName(String biTownName) { |
| | | this.biTownName = biTownName == null ? null : biTownName.trim(); |
| | | } |
| | | |
| | | /** |
| | | * @return BI_Area_Code |
| | | */ |
| | | public String getBiAreaCode() { |
| | | return biAreaCode; |
| | | } |
| | | |
| | | /** |
| | | * @param biAreaCode |
| | | */ |
| | | public void setBiAreaCode(String biAreaCode) { |
| | | this.biAreaCode = biAreaCode == null ? null : biAreaCode.trim(); |
| | | } |
| | | |
| | | /** |
| | | * @return UC_Area |
| | | */ |
| | | public String getBiArea() { |
| | | return biArea; |
| | | } |
| | | |
| | | /** |
| | | * @param biArea |
| | | */ |
| | | public void setBiArea(String biArea) { |
| | | this.biArea = biArea == null ? null : biArea.trim(); |
| | | } |
| | | |
| | | /** |
| | | * è·åæå±ç©ä¸å
¬å¸åç§°id |
| | | * |
| | | * @return BI_Management_Company_Id - æå±ç©ä¸å
¬å¸åç§°id |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package cn.flightfeather.supervision.domain.ds2.repository |
| | | |
| | | import cn.flightfeather.supervision.domain.ds1.entity.Scense |
| | | import cn.flightfeather.supervision.domain.ds2.entity.BaseInfo |
| | | import cn.flightfeather.supervision.domain.ds2.entity.UserinfoTZ |
| | | import cn.flightfeather.supervision.domain.ds2.mapper.BaseInfoMapper |
| | | import org.springframework.stereotype.Repository |
| | | import java.util.* |
| | | |
| | | @Repository |
| | | class BaseInfoRep( |
| | | private val baseInfoMapper: BaseInfoMapper, |
| | | ) { |
| | | |
| | | fun create(info: UserinfoTZ, scense: Scense): BaseInfo { |
| | | val baseInfo = BaseInfo().apply { |
| | | biGuid = info.guid |
| | | biName = info.realname |
| | | biProvinceCode = scense.provincecode |
| | | biProvinceName = scense.provincename |
| | | biCityCode = scense.citycode |
| | | biCityName = scense.cityname |
| | | biDistrictCode = scense.districtcode |
| | | biDistrictName = scense.districtname |
| | | biTownCode = scense.towncode |
| | | biTownName = scense.townname |
| | | biContact = scense.contacts |
| | | biTelephone = scense.contactst |
| | | biAddress = scense.location |
| | | biCreateTime = Date() |
| | | biExtension1 = info.acountname |
| | | } |
| | | baseInfoMapper.insert(baseInfo) |
| | | return baseInfo |
| | | } |
| | | } |
| | |
| | | import java.util.* |
| | | |
| | | /** |
| | | * 信访æè¯åè¡æ¿å¤ç½æ°æ®åºç¸å
³æä½ |
| | | * 信访æè¯åè¡æ¿å¤ç½æ°æ®åºç¸å
³æä½ |
| | | */ |
| | | @Repository |
| | | class ComplaintAndPunishmentRep( |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package cn.flightfeather.supervision.domain.ds2.repository |
| | | |
| | | import cn.flightfeather.supervision.domain.ds2.entity.DustSiteMap |
| | | import cn.flightfeather.supervision.domain.ds2.mapper.DustSiteInfoMapper |
| | | import cn.flightfeather.supervision.domain.ds2.mapper.DustSiteMapMapper |
| | | import cn.flightfeather.supervision.lightshare.vo.DeviceMapVo |
| | | import cn.flightfeather.supervision.lightshare.vo.DeviceSiteVo |
| | | import org.springframework.stereotype.Repository |
| | | import tk.mybatis.mapper.entity.Example |
| | | |
| | | /** |
| | | * éå®å·¥å°æ¬å°çæµç¹ä½æ°æ®åºç¸å
³æä½ |
| | | */ |
| | | @Repository |
| | | class JADustSiteRep( |
| | | private val dustSiteMapMapper: DustSiteMapMapper, |
| | | private val dustSiteInfoMapper: DustSiteInfoMapper, |
| | | ) { |
| | | |
| | | /** |
| | | * æ ¹æ®é£ç¾½çç®¡ç¨æ·idæ¥è¯¢åºæ¯åçæµè®¾å¤çå¹é
å
³ç³» |
| | | * @param idList çç®¡åºæ¯å¯¹åºçç¨æ·idå表 |
| | | * @return å¹é
å
³ç³»å表 |
| | | */ |
| | | fun findMapBySVUserId(idList: List<String?>): List<DeviceMapVo> { |
| | | val res = dustSiteMapMapper.selectByExample(Example(DustSiteMap::class.java).apply { |
| | | createCriteria().andIn("svUserId", idList) |
| | | }) |
| | | return DeviceMapVo.fromJADustSiteMap(res) |
| | | } |
| | | |
| | | /** |
| | | * è·åéå®å·¥å°ç¹ä½åºæ¬ä¿¡æ¯ |
| | | * @return çæµç¹ä¿¡æ¯å表 |
| | | */ |
| | | fun findSiteInfo(): List<DeviceSiteVo> { |
| | | val res = dustSiteInfoMapper.selectAll() |
| | | return DeviceSiteVo.fromJADustSiteInfo(res) |
| | | } |
| | | } |
| | |
| | | package cn.flightfeather.supervision.domain.ds2.repository |
| | | |
| | | import cn.flightfeather.supervision.common.utils.Constant |
| | | import cn.flightfeather.supervision.common.utils.UUIDGenerator |
| | | 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 |
| | | import java.util.* |
| | | |
| | | @Repository |
| | | class UserInfoTZRep(private val userinfoTZMapper: UserinfoTZMapper) { |
| | |
| | | and(createCriteria().orIsNull("workno").orNotEqualTo("workno", "test")) |
| | | }) |
| | | } |
| | | |
| | | fun findOne(userinfoTZ: UserinfoTZ): UserinfoTZ? { |
| | | return userinfoTZMapper.selectOne(userinfoTZ) |
| | | } |
| | | |
| | | fun insert(userinfoTZ: UserinfoTZ): Int { |
| | | if (userinfoTZ.guid == null) userinfoTZ.guid = UUIDGenerator.generate16ShortUUID() |
| | | if (userinfoTZ.headIconUrl == null) userinfoTZ.headIconUrl = "" |
| | | userinfoTZ.uiCreateTime = Date() |
| | | return userinfoTZMapper.insert(userinfoTZ) |
| | | } |
| | | |
| | | } |
| | |
| | | import cn.flightfeather.supervision.domain.ds2.mapper.UserMapMapper |
| | | import org.springframework.stereotype.Repository |
| | | import tk.mybatis.mapper.entity.Example |
| | | import java.util.* |
| | | |
| | | @Repository |
| | | class UserMapRep( |
| | |
| | | * @return |
| | | */ |
| | | fun findFromSupervision(userinfoTZ: UserinfoTZ?): Scense? { |
| | | return findFromSupervision(userinfoTZ?.guid) |
| | | } |
| | | |
| | | fun findFromSupervision(guid: String?): Scense? { |
| | | val userMap = UserMap().apply { |
| | | tzUserId = userinfoTZ?.guid |
| | | tzUserId = guid |
| | | } |
| | | // æ¾å°ä¸¤ä¸ªç³»ç»ç¨æ·ç对åºå
³ç³» |
| | | val uMap = userMapMapper.selectOne(userMap) |
| | | if (uMap == null) { |
| | | println("${userinfoTZ?.guid}, ${userinfoTZ?.realname}") |
| | | return null |
| | | } |
| | | val uMap = userMapMapper.selectOne(userMap) ?: return null |
| | | // æ¾å°é£ç¾½ç管ä¸çç¨æ·ä¿¡æ¯ |
| | | val userInfoSp = userinfoMapper.selectByPrimaryKey(uMap.svUserId) |
| | | // æ¾å°é£ç¾½ç管ä¸çåºæ¯ä¿¡æ¯ |
| | |
| | | createCriteria().andIn("svUserId", idList) |
| | | }) |
| | | } |
| | | |
| | | fun insert(userMap: UserMap): Int { |
| | | if (userMap.umCreateTime == null) userMap.umCreateTime = Date() |
| | | return userMapMapper.insert(userMap) |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package cn.flightfeather.supervision.domain.ds3.entity; |
| | | |
| | | import javax.persistence.Column; |
| | | import javax.persistence.Id; |
| | | import javax.persistence.Table; |
| | | import java.util.Date; |
| | | |
| | | @Table(name = "ja_t_dust_site_info") |
| | | public class JSDustSiteInfo { |
| | | @Id |
| | | private Integer id; |
| | | |
| | | /** |
| | | * 设å¤ç¼ç |
| | | */ |
| | | @Column(name = "mn_code") |
| | | private String mnCode; |
| | | |
| | | /** |
| | | * å®è£
å°å |
| | | */ |
| | | private String address; |
| | | |
| | | /** |
| | | * ç«ç¹åç§° |
| | | */ |
| | | private String name; |
| | | |
| | | /** |
| | | * ç«ç¹ç¼ç |
| | | */ |
| | | private String code; |
| | | |
| | | /** |
| | | * å¼å·¥æ¶é´ |
| | | */ |
| | | @Column(name = "begin_date") |
| | | private Date beginDate; |
| | | |
| | | /** |
| | | * è¿ç»´å |
| | | */ |
| | | @Column(name = "duty_company") |
| | | private String dutyCompany; |
| | | |
| | | /** |
| | | * è¿ç»´åid |
| | | */ |
| | | @Column(name = "duty_company_id") |
| | | private String dutyCompanyId; |
| | | |
| | | /** |
| | | * ç»ææ¶é´ |
| | | */ |
| | | @Column(name = "end_date") |
| | | private Date endDate; |
| | | |
| | | /** |
| | | * å½åæ½å·¥é¶æ®µ |
| | | */ |
| | | @Column(name = "engineering_stage") |
| | | private String engineeringStage; |
| | | |
| | | /** |
| | | * æå±åºå¿ä»£ç |
| | | */ |
| | | @Column(name = "group_id") |
| | | private String groupId; |
| | | |
| | | /** |
| | | * æå±åºå¿ |
| | | */ |
| | | @Column(name = "group_name") |
| | | private String groupName; |
| | | |
| | | /** |
| | | * æ¯å¦å¨çº¿ |
| | | */ |
| | | @Column(name = "is_online") |
| | | private String isOnline; |
| | | |
| | | /** |
| | | * è®¾å¤æ¯å¦å¼å¸¸ |
| | | */ |
| | | @Column(name = "is_trouble") |
| | | private String isTrouble; |
| | | |
| | | /** |
| | | * æ´æ°æ¶é´ |
| | | */ |
| | | @Column(name = "jhpt_update_time") |
| | | private String jhptUpdateTime; |
| | | |
| | | private String kindex; |
| | | |
| | | /** |
| | | * 纬度 |
| | | */ |
| | | private String latitude; |
| | | |
| | | /** |
| | | * è系人 |
| | | */ |
| | | private String linkman; |
| | | |
| | | /** |
| | | * ç»åº¦ |
| | | */ |
| | | private String longitude; |
| | | |
| | | /** |
| | | * è系人çµè¯ |
| | | */ |
| | | private String phone; |
| | | |
| | | /** |
| | | * æå±ç份 |
| | | */ |
| | | private String province; |
| | | |
| | | /** |
| | | * å
ä¸å¤ç¯ç¼ç |
| | | */ |
| | | @Column(name = "ring_id") |
| | | private String ringId; |
| | | |
| | | /** |
| | | * å
ä¸å¤ç¯ |
| | | */ |
| | | @Column(name = "ring_name") |
| | | private String ringName; |
| | | |
| | | /** |
| | | * ç±»åç¼ç |
| | | */ |
| | | @Column(name = "type_id") |
| | | private String typeId; |
| | | |
| | | /** |
| | | * ç±»ååç§° |
| | | */ |
| | | private String typename; |
| | | |
| | | /** |
| | | * 忢æ¶é´ |
| | | */ |
| | | @Column(name = "stop_time") |
| | | private Date stopTime; |
| | | |
| | | private String active; |
| | | |
| | | /** |
| | | * æ
鿬¡æ° |
| | | */ |
| | | @Column(name = "trouble_num") |
| | | private Integer troubleNum; |
| | | |
| | | /** |
| | | * æ°å¢æ¶é´ |
| | | */ |
| | | @Column(name = "insert_time") |
| | | private Date insertTime; |
| | | |
| | | /** |
| | | * é¶æ®µå¼å§æ¥æ |
| | | */ |
| | | @Column(name = "stage_begin_date") |
| | | private Date stageBeginDate; |
| | | |
| | | /** |
| | | * tspæµåº¦ |
| | | */ |
| | | private Double tsp; |
| | | |
| | | /** |
| | | * ç»è®¡ç±»åç¼ç |
| | | */ |
| | | @Column(name = "union_type_id") |
| | | private String unionTypeId; |
| | | |
| | | /** |
| | | * å´å¢é«åº¦ |
| | | */ |
| | | @Column(name = "wall_height") |
| | | private String wallHeight; |
| | | |
| | | /** |
| | | * ä¸å¡æ¶é´ |
| | | */ |
| | | @Column(name = "ywsj_date") |
| | | private Date ywsjDate; |
| | | |
| | | /** |
| | | * 建çé¢ç§¯ |
| | | */ |
| | | @Column(name = "build_area") |
| | | private String buildArea; |
| | | |
| | | /** |
| | | * æ½å·¥åä½ |
| | | */ |
| | | @Column(name = "construction_unit") |
| | | private String constructionUnit; |
| | | |
| | | /** |
| | | * ç¹ä½æ§å¶çº§ |
| | | */ |
| | | @Column(name = "control_level") |
| | | private String controlLevel; |
| | | |
| | | /** |
| | | * å¼åå |
| | | */ |
| | | private String developers; |
| | | |
| | | /** |
| | | * æ§è¡æ¶é´ |
| | | */ |
| | | @Column(name = "do_time") |
| | | private Date doTime; |
| | | |
| | | /** |
| | | * æ¯å¦æçæµ |
| | | */ |
| | | @Column(name = "has_monitor") |
| | | private String hasMonitor; |
| | | |
| | | /** |
| | | * ééæ¶é´ |
| | | */ |
| | | @Column(name = "data_time") |
| | | private Date dataTime; |
| | | |
| | | /** |
| | | * å½åæ½å·¥é¶æ®µç¼ç |
| | | */ |
| | | @Column(name = "engineering_stage_code") |
| | | private String engineeringStageCode; |
| | | |
| | | /** |
| | | * 设å¤ç¼ç |
| | | */ |
| | | @Column(name = "equipment_code") |
| | | private String equipmentCode; |
| | | |
| | | /** |
| | | * å å°é¢ç§¯ |
| | | */ |
| | | @Column(name = "floor_area") |
| | | private String floorArea; |
| | | |
| | | /** |
| | | * å 餿 å¿ä½ |
| | | */ |
| | | @Column(name = "jhpt_delete") |
| | | private String jhptDelete; |
| | | |
| | | /** |
| | | * åªå£°åè½åº |
| | | */ |
| | | @Column(name = "noise_region") |
| | | private String noiseRegion; |
| | | |
| | | /** |
| | | * è´è´£äºº |
| | | */ |
| | | private String responsible; |
| | | |
| | | /** |
| | | * @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 address - å®è£
å°å |
| | | */ |
| | | public String getAddress() { |
| | | return address; |
| | | } |
| | | |
| | | /** |
| | | * 设置å®è£
å°å |
| | | * |
| | | * @param address å®è£
å°å |
| | | */ |
| | | public void setAddress(String address) { |
| | | this.address = address == null ? null : address.trim(); |
| | | } |
| | | |
| | | /** |
| | | * è·åç«ç¹åç§° |
| | | * |
| | | * @return name - ç«ç¹åç§° |
| | | */ |
| | | public String getName() { |
| | | return name; |
| | | } |
| | | |
| | | /** |
| | | * 设置ç«ç¹åç§° |
| | | * |
| | | * @param name ç«ç¹åç§° |
| | | */ |
| | | public void setName(String name) { |
| | | this.name = name == null ? null : name.trim(); |
| | | } |
| | | |
| | | /** |
| | | * è·åç«ç¹ç¼ç |
| | | * |
| | | * @return code - ç«ç¹ç¼ç |
| | | */ |
| | | public String getCode() { |
| | | return code; |
| | | } |
| | | |
| | | /** |
| | | * 设置ç«ç¹ç¼ç |
| | | * |
| | | * @param code ç«ç¹ç¼ç |
| | | */ |
| | | public void setCode(String code) { |
| | | this.code = code == null ? null : code.trim(); |
| | | } |
| | | |
| | | /** |
| | | * è·åå¼å·¥æ¶é´ |
| | | * |
| | | * @return begin_date - å¼å·¥æ¶é´ |
| | | */ |
| | | public Date getBeginDate() { |
| | | return beginDate; |
| | | } |
| | | |
| | | /** |
| | | * 设置å¼å·¥æ¶é´ |
| | | * |
| | | * @param beginDate å¼å·¥æ¶é´ |
| | | */ |
| | | public void setBeginDate(Date beginDate) { |
| | | this.beginDate = beginDate; |
| | | } |
| | | |
| | | /** |
| | | * è·åè¿ç»´å |
| | | * |
| | | * @return duty_company - è¿ç»´å |
| | | */ |
| | | public String getDutyCompany() { |
| | | return dutyCompany; |
| | | } |
| | | |
| | | /** |
| | | * 设置è¿ç»´å |
| | | * |
| | | * @param dutyCompany è¿ç»´å |
| | | */ |
| | | public void setDutyCompany(String dutyCompany) { |
| | | this.dutyCompany = dutyCompany == null ? null : dutyCompany.trim(); |
| | | } |
| | | |
| | | /** |
| | | * è·åè¿ç»´åid |
| | | * |
| | | * @return duty_company_id - è¿ç»´åid |
| | | */ |
| | | public String getDutyCompanyId() { |
| | | return dutyCompanyId; |
| | | } |
| | | |
| | | /** |
| | | * 设置è¿ç»´åid |
| | | * |
| | | * @param dutyCompanyId è¿ç»´åid |
| | | */ |
| | | public void setDutyCompanyId(String dutyCompanyId) { |
| | | this.dutyCompanyId = dutyCompanyId == null ? null : dutyCompanyId.trim(); |
| | | } |
| | | |
| | | /** |
| | | * è·åç»ææ¶é´ |
| | | * |
| | | * @return end_date - ç»ææ¶é´ |
| | | */ |
| | | public Date getEndDate() { |
| | | return endDate; |
| | | } |
| | | |
| | | /** |
| | | * è®¾ç½®ç»ææ¶é´ |
| | | * |
| | | * @param endDate ç»ææ¶é´ |
| | | */ |
| | | public void setEndDate(Date endDate) { |
| | | this.endDate = endDate; |
| | | } |
| | | |
| | | /** |
| | | * è·åå½åæ½å·¥é¶æ®µ |
| | | * |
| | | * @return engineering_stage - å½åæ½å·¥é¶æ®µ |
| | | */ |
| | | public String getEngineeringStage() { |
| | | return engineeringStage; |
| | | } |
| | | |
| | | /** |
| | | * 设置å½åæ½å·¥é¶æ®µ |
| | | * |
| | | * @param engineeringStage å½åæ½å·¥é¶æ®µ |
| | | */ |
| | | public void setEngineeringStage(String engineeringStage) { |
| | | this.engineeringStage = engineeringStage == null ? null : engineeringStage.trim(); |
| | | } |
| | | |
| | | /** |
| | | * è·åæå±åºå¿ä»£ç |
| | | * |
| | | * @return group_id - æå±åºå¿ä»£ç |
| | | */ |
| | | public String getGroupId() { |
| | | return groupId; |
| | | } |
| | | |
| | | /** |
| | | * 设置æå±åºå¿ä»£ç |
| | | * |
| | | * @param groupId æå±åºå¿ä»£ç |
| | | */ |
| | | public void setGroupId(String groupId) { |
| | | this.groupId = groupId == null ? null : groupId.trim(); |
| | | } |
| | | |
| | | /** |
| | | * è·åæå±åºå¿ |
| | | * |
| | | * @return group_name - æå±åºå¿ |
| | | */ |
| | | public String getGroupName() { |
| | | return groupName; |
| | | } |
| | | |
| | | /** |
| | | * 设置æå±åºå¿ |
| | | * |
| | | * @param groupName æå±åºå¿ |
| | | */ |
| | | public void setGroupName(String groupName) { |
| | | this.groupName = groupName == null ? null : groupName.trim(); |
| | | } |
| | | |
| | | /** |
| | | * è·åæ¯å¦å¨çº¿ |
| | | * |
| | | * @return is_online - æ¯å¦å¨çº¿ |
| | | */ |
| | | public String getIsOnline() { |
| | | return isOnline; |
| | | } |
| | | |
| | | /** |
| | | * 设置æ¯å¦å¨çº¿ |
| | | * |
| | | * @param isOnline æ¯å¦å¨çº¿ |
| | | */ |
| | | public void setIsOnline(String isOnline) { |
| | | this.isOnline = isOnline == null ? null : isOnline.trim(); |
| | | } |
| | | |
| | | /** |
| | | * è·åè®¾å¤æ¯å¦å¼å¸¸ |
| | | * |
| | | * @return is_trouble - è®¾å¤æ¯å¦å¼å¸¸ |
| | | */ |
| | | public String getIsTrouble() { |
| | | return isTrouble; |
| | | } |
| | | |
| | | /** |
| | | * è®¾ç½®è®¾å¤æ¯å¦å¼å¸¸ |
| | | * |
| | | * @param isTrouble è®¾å¤æ¯å¦å¼å¸¸ |
| | | */ |
| | | public void setIsTrouble(String isTrouble) { |
| | | this.isTrouble = isTrouble == null ? null : isTrouble.trim(); |
| | | } |
| | | |
| | | /** |
| | | * è·åæ´æ°æ¶é´ |
| | | * |
| | | * @return jhpt_update_time - æ´æ°æ¶é´ |
| | | */ |
| | | public String getJhptUpdateTime() { |
| | | return jhptUpdateTime; |
| | | } |
| | | |
| | | /** |
| | | * è®¾ç½®æ´æ°æ¶é´ |
| | | * |
| | | * @param jhptUpdateTime æ´æ°æ¶é´ |
| | | */ |
| | | public void setJhptUpdateTime(String jhptUpdateTime) { |
| | | this.jhptUpdateTime = jhptUpdateTime == null ? null : jhptUpdateTime.trim(); |
| | | } |
| | | |
| | | /** |
| | | * @return kindex |
| | | */ |
| | | public String getKindex() { |
| | | return kindex; |
| | | } |
| | | |
| | | /** |
| | | * @param kindex |
| | | */ |
| | | public void setKindex(String kindex) { |
| | | this.kindex = kindex == null ? null : kindex.trim(); |
| | | } |
| | | |
| | | /** |
| | | * è·å纬度 |
| | | * |
| | | * @return latitude - 纬度 |
| | | */ |
| | | public String getLatitude() { |
| | | return latitude; |
| | | } |
| | | |
| | | /** |
| | | * 设置纬度 |
| | | * |
| | | * @param latitude 纬度 |
| | | */ |
| | | public void setLatitude(String latitude) { |
| | | this.latitude = latitude == null ? null : latitude.trim(); |
| | | } |
| | | |
| | | /** |
| | | * è·åè系人 |
| | | * |
| | | * @return linkman - è系人 |
| | | */ |
| | | public String getLinkman() { |
| | | return linkman; |
| | | } |
| | | |
| | | /** |
| | | * 设置è系人 |
| | | * |
| | | * @param linkman è系人 |
| | | */ |
| | | public void setLinkman(String linkman) { |
| | | this.linkman = linkman == null ? null : linkman.trim(); |
| | | } |
| | | |
| | | /** |
| | | * è·åç»åº¦ |
| | | * |
| | | * @return longitude - ç»åº¦ |
| | | */ |
| | | public String getLongitude() { |
| | | return longitude; |
| | | } |
| | | |
| | | /** |
| | | * 设置ç»åº¦ |
| | | * |
| | | * @param longitude ç»åº¦ |
| | | */ |
| | | public void setLongitude(String longitude) { |
| | | this.longitude = longitude == null ? null : longitude.trim(); |
| | | } |
| | | |
| | | /** |
| | | * è·åè系人çµè¯ |
| | | * |
| | | * @return phone - è系人çµè¯ |
| | | */ |
| | | public String getPhone() { |
| | | return phone; |
| | | } |
| | | |
| | | /** |
| | | * 设置è系人çµè¯ |
| | | * |
| | | * @param phone è系人çµè¯ |
| | | */ |
| | | public void setPhone(String phone) { |
| | | this.phone = phone == null ? null : phone.trim(); |
| | | } |
| | | |
| | | /** |
| | | * è·åæå±ç份 |
| | | * |
| | | * @return province - æå±ç份 |
| | | */ |
| | | public String getProvince() { |
| | | return province; |
| | | } |
| | | |
| | | /** |
| | | * 设置æå±ç份 |
| | | * |
| | | * @param province æå±ç份 |
| | | */ |
| | | public void setProvince(String province) { |
| | | this.province = province == null ? null : province.trim(); |
| | | } |
| | | |
| | | /** |
| | | * è·åå
ä¸å¤ç¯ç¼ç |
| | | * |
| | | * @return ring_id - å
ä¸å¤ç¯ç¼ç |
| | | */ |
| | | public String getRingId() { |
| | | return ringId; |
| | | } |
| | | |
| | | /** |
| | | * 设置å
ä¸å¤ç¯ç¼ç |
| | | * |
| | | * @param ringId å
ä¸å¤ç¯ç¼ç |
| | | */ |
| | | public void setRingId(String ringId) { |
| | | this.ringId = ringId == null ? null : ringId.trim(); |
| | | } |
| | | |
| | | /** |
| | | * è·åå
ä¸å¤ç¯ |
| | | * |
| | | * @return ring_name - å
ä¸å¤ç¯ |
| | | */ |
| | | public String getRingName() { |
| | | return ringName; |
| | | } |
| | | |
| | | /** |
| | | * 设置å
ä¸å¤ç¯ |
| | | * |
| | | * @param ringName å
ä¸å¤ç¯ |
| | | */ |
| | | public void setRingName(String ringName) { |
| | | this.ringName = ringName == null ? null : ringName.trim(); |
| | | } |
| | | |
| | | /** |
| | | * è·åç±»åç¼ç |
| | | * |
| | | * @return type_id - ç±»åç¼ç |
| | | */ |
| | | public String getTypeId() { |
| | | return typeId; |
| | | } |
| | | |
| | | /** |
| | | * 设置类åç¼ç |
| | | * |
| | | * @param typeId ç±»åç¼ç |
| | | */ |
| | | public void setTypeId(String typeId) { |
| | | this.typeId = typeId == null ? null : typeId.trim(); |
| | | } |
| | | |
| | | /** |
| | | * è·åç±»ååç§° |
| | | * |
| | | * @return typename - ç±»ååç§° |
| | | */ |
| | | public String getTypename() { |
| | | return typename; |
| | | } |
| | | |
| | | /** |
| | | * 设置类ååç§° |
| | | * |
| | | * @param typename ç±»ååç§° |
| | | */ |
| | | public void setTypename(String typename) { |
| | | this.typename = typename == null ? null : typename.trim(); |
| | | } |
| | | |
| | | /** |
| | | * è·å忢æ¶é´ |
| | | * |
| | | * @return stop_time - 忢æ¶é´ |
| | | */ |
| | | public Date getStopTime() { |
| | | return stopTime; |
| | | } |
| | | |
| | | /** |
| | | * è®¾ç½®åæ¢æ¶é´ |
| | | * |
| | | * @param stopTime 忢æ¶é´ |
| | | */ |
| | | public void setStopTime(Date stopTime) { |
| | | this.stopTime = stopTime; |
| | | } |
| | | |
| | | /** |
| | | * @return active |
| | | */ |
| | | public String getActive() { |
| | | return active; |
| | | } |
| | | |
| | | /** |
| | | * @param active |
| | | */ |
| | | public void setActive(String active) { |
| | | this.active = active == null ? null : active.trim(); |
| | | } |
| | | |
| | | /** |
| | | * è·åæ
鿬¡æ° |
| | | * |
| | | * @return trouble_num - æ
鿬¡æ° |
| | | */ |
| | | public Integer getTroubleNum() { |
| | | return troubleNum; |
| | | } |
| | | |
| | | /** |
| | | * 设置æ
鿬¡æ° |
| | | * |
| | | * @param troubleNum æ
鿬¡æ° |
| | | */ |
| | | public void setTroubleNum(Integer troubleNum) { |
| | | this.troubleNum = troubleNum; |
| | | } |
| | | |
| | | /** |
| | | * è·åæ°å¢æ¶é´ |
| | | * |
| | | * @return insert_time - æ°å¢æ¶é´ |
| | | */ |
| | | public Date getInsertTime() { |
| | | return insertTime; |
| | | } |
| | | |
| | | /** |
| | | * 设置æ°å¢æ¶é´ |
| | | * |
| | | * @param insertTime æ°å¢æ¶é´ |
| | | */ |
| | | public void setInsertTime(Date insertTime) { |
| | | this.insertTime = insertTime; |
| | | } |
| | | |
| | | /** |
| | | * è·åé¶æ®µå¼å§æ¥æ |
| | | * |
| | | * @return stage_begin_date - é¶æ®µå¼å§æ¥æ |
| | | */ |
| | | public Date getStageBeginDate() { |
| | | return stageBeginDate; |
| | | } |
| | | |
| | | /** |
| | | * è®¾ç½®é¶æ®µå¼å§æ¥æ |
| | | * |
| | | * @param stageBeginDate é¶æ®µå¼å§æ¥æ |
| | | */ |
| | | public void setStageBeginDate(Date stageBeginDate) { |
| | | this.stageBeginDate = stageBeginDate; |
| | | } |
| | | |
| | | /** |
| | | * è·åtspæµåº¦ |
| | | * |
| | | * @return tsp - tspæµåº¦ |
| | | */ |
| | | public Double getTsp() { |
| | | return tsp; |
| | | } |
| | | |
| | | /** |
| | | * 设置tspæµåº¦ |
| | | * |
| | | * @param tsp tspæµåº¦ |
| | | */ |
| | | public void setTsp(Double tsp) { |
| | | this.tsp = tsp; |
| | | } |
| | | |
| | | /** |
| | | * è·åç»è®¡ç±»åç¼ç |
| | | * |
| | | * @return union_type_id - ç»è®¡ç±»åç¼ç |
| | | */ |
| | | public String getUnionTypeId() { |
| | | return unionTypeId; |
| | | } |
| | | |
| | | /** |
| | | * 设置ç»è®¡ç±»åç¼ç |
| | | * |
| | | * @param unionTypeId ç»è®¡ç±»åç¼ç |
| | | */ |
| | | public void setUnionTypeId(String unionTypeId) { |
| | | this.unionTypeId = unionTypeId == null ? null : unionTypeId.trim(); |
| | | } |
| | | |
| | | /** |
| | | * è·åå´å¢é«åº¦ |
| | | * |
| | | * @return wall_height - å´å¢é«åº¦ |
| | | */ |
| | | public String getWallHeight() { |
| | | return wallHeight; |
| | | } |
| | | |
| | | /** |
| | | * 设置å´å¢é«åº¦ |
| | | * |
| | | * @param wallHeight å´å¢é«åº¦ |
| | | */ |
| | | public void setWallHeight(String wallHeight) { |
| | | this.wallHeight = wallHeight == null ? null : wallHeight.trim(); |
| | | } |
| | | |
| | | /** |
| | | * è·åä¸å¡æ¶é´ |
| | | * |
| | | * @return ywsj_date - ä¸å¡æ¶é´ |
| | | */ |
| | | public Date getYwsjDate() { |
| | | return ywsjDate; |
| | | } |
| | | |
| | | /** |
| | | * 设置ä¸å¡æ¶é´ |
| | | * |
| | | * @param ywsjDate ä¸å¡æ¶é´ |
| | | */ |
| | | public void setYwsjDate(Date ywsjDate) { |
| | | this.ywsjDate = ywsjDate; |
| | | } |
| | | |
| | | /** |
| | | * è·å建çé¢ç§¯ |
| | | * |
| | | * @return build_area - 建çé¢ç§¯ |
| | | */ |
| | | public String getBuildArea() { |
| | | return buildArea; |
| | | } |
| | | |
| | | /** |
| | | * 设置建çé¢ç§¯ |
| | | * |
| | | * @param buildArea 建çé¢ç§¯ |
| | | */ |
| | | public void setBuildArea(String buildArea) { |
| | | this.buildArea = buildArea == null ? null : buildArea.trim(); |
| | | } |
| | | |
| | | /** |
| | | * è·åæ½å·¥åä½ |
| | | * |
| | | * @return construction_unit - æ½å·¥åä½ |
| | | */ |
| | | public String getConstructionUnit() { |
| | | return constructionUnit; |
| | | } |
| | | |
| | | /** |
| | | * 设置æ½å·¥åä½ |
| | | * |
| | | * @param constructionUnit æ½å·¥åä½ |
| | | */ |
| | | public void setConstructionUnit(String constructionUnit) { |
| | | this.constructionUnit = constructionUnit == null ? null : constructionUnit.trim(); |
| | | } |
| | | |
| | | /** |
| | | * è·åç¹ä½æ§å¶çº§ |
| | | * |
| | | * @return control_level - ç¹ä½æ§å¶çº§ |
| | | */ |
| | | public String getControlLevel() { |
| | | return controlLevel; |
| | | } |
| | | |
| | | /** |
| | | * 设置ç¹ä½æ§å¶çº§ |
| | | * |
| | | * @param controlLevel ç¹ä½æ§å¶çº§ |
| | | */ |
| | | public void setControlLevel(String controlLevel) { |
| | | this.controlLevel = controlLevel == null ? null : controlLevel.trim(); |
| | | } |
| | | |
| | | /** |
| | | * è·åå¼åå |
| | | * |
| | | * @return developers - å¼åå |
| | | */ |
| | | public String getDevelopers() { |
| | | return developers; |
| | | } |
| | | |
| | | /** |
| | | * 设置å¼åå |
| | | * |
| | | * @param developers å¼åå |
| | | */ |
| | | public void setDevelopers(String developers) { |
| | | this.developers = developers == null ? null : developers.trim(); |
| | | } |
| | | |
| | | /** |
| | | * è·åæ§è¡æ¶é´ |
| | | * |
| | | * @return do_time - æ§è¡æ¶é´ |
| | | */ |
| | | public Date getDoTime() { |
| | | return doTime; |
| | | } |
| | | |
| | | /** |
| | | * 设置æ§è¡æ¶é´ |
| | | * |
| | | * @param doTime æ§è¡æ¶é´ |
| | | */ |
| | | public void setDoTime(Date doTime) { |
| | | this.doTime = doTime; |
| | | } |
| | | |
| | | /** |
| | | * è·åæ¯å¦æçæµ |
| | | * |
| | | * @return has_monitor - æ¯å¦æçæµ |
| | | */ |
| | | public String getHasMonitor() { |
| | | return hasMonitor; |
| | | } |
| | | |
| | | /** |
| | | * 设置æ¯å¦æçæµ |
| | | * |
| | | * @param hasMonitor æ¯å¦æçæµ |
| | | */ |
| | | public void setHasMonitor(String hasMonitor) { |
| | | this.hasMonitor = hasMonitor == null ? null : hasMonitor.trim(); |
| | | } |
| | | |
| | | /** |
| | | * è·åééæ¶é´ |
| | | * |
| | | * @return data_time - ééæ¶é´ |
| | | */ |
| | | public Date getDataTime() { |
| | | return dataTime; |
| | | } |
| | | |
| | | /** |
| | | * 设置ééæ¶é´ |
| | | * |
| | | * @param dataTime ééæ¶é´ |
| | | */ |
| | | public void setDataTime(Date dataTime) { |
| | | this.dataTime = dataTime; |
| | | } |
| | | |
| | | /** |
| | | * è·åå½åæ½å·¥é¶æ®µç¼ç |
| | | * |
| | | * @return engineering_stage_code - å½åæ½å·¥é¶æ®µç¼ç |
| | | */ |
| | | public String getEngineeringStageCode() { |
| | | return engineeringStageCode; |
| | | } |
| | | |
| | | /** |
| | | * 设置å½åæ½å·¥é¶æ®µç¼ç |
| | | * |
| | | * @param engineeringStageCode å½åæ½å·¥é¶æ®µç¼ç |
| | | */ |
| | | public void setEngineeringStageCode(String engineeringStageCode) { |
| | | this.engineeringStageCode = engineeringStageCode == null ? null : engineeringStageCode.trim(); |
| | | } |
| | | |
| | | /** |
| | | * è·å设å¤ç¼ç |
| | | * |
| | | * @return equipment_code - 设å¤ç¼ç |
| | | */ |
| | | public String getEquipmentCode() { |
| | | return equipmentCode; |
| | | } |
| | | |
| | | /** |
| | | * 设置设å¤ç¼ç |
| | | * |
| | | * @param equipmentCode 设å¤ç¼ç |
| | | */ |
| | | public void setEquipmentCode(String equipmentCode) { |
| | | this.equipmentCode = equipmentCode == null ? null : equipmentCode.trim(); |
| | | } |
| | | |
| | | /** |
| | | * è·åå å°é¢ç§¯ |
| | | * |
| | | * @return floor_area - å å°é¢ç§¯ |
| | | */ |
| | | public String getFloorArea() { |
| | | return floorArea; |
| | | } |
| | | |
| | | /** |
| | | * 设置å å°é¢ç§¯ |
| | | * |
| | | * @param floorArea å å°é¢ç§¯ |
| | | */ |
| | | public void setFloorArea(String floorArea) { |
| | | this.floorArea = floorArea == null ? null : floorArea.trim(); |
| | | } |
| | | |
| | | /** |
| | | * è·åå 餿 å¿ä½ |
| | | * |
| | | * @return jhpt_delete - å 餿 å¿ä½ |
| | | */ |
| | | public String getJhptDelete() { |
| | | return jhptDelete; |
| | | } |
| | | |
| | | /** |
| | | * 设置å 餿 å¿ä½ |
| | | * |
| | | * @param jhptDelete å 餿 å¿ä½ |
| | | */ |
| | | public void setJhptDelete(String jhptDelete) { |
| | | this.jhptDelete = jhptDelete == null ? null : jhptDelete.trim(); |
| | | } |
| | | |
| | | /** |
| | | * è·ååªå£°åè½åº |
| | | * |
| | | * @return noise_region - åªå£°åè½åº |
| | | */ |
| | | public String getNoiseRegion() { |
| | | return noiseRegion; |
| | | } |
| | | |
| | | /** |
| | | * 设置åªå£°åè½åº |
| | | * |
| | | * @param noiseRegion åªå£°åè½åº |
| | | */ |
| | | public void setNoiseRegion(String noiseRegion) { |
| | | this.noiseRegion = noiseRegion == null ? null : noiseRegion.trim(); |
| | | } |
| | | |
| | | /** |
| | | * è·åè´è´£äºº |
| | | * |
| | | * @return responsible - è´è´£äºº |
| | | */ |
| | | public String getResponsible() { |
| | | return responsible; |
| | | } |
| | | |
| | | /** |
| | | * 设置è´è´£äºº |
| | | * |
| | | * @param responsible è´è´£äºº |
| | | */ |
| | | public void setResponsible(String responsible) { |
| | | this.responsible = responsible == null ? null : responsible.trim(); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package cn.flightfeather.supervision.domain.ds3.mapper |
| | | |
| | | import cn.flightfeather.supervision.domain.ds3.entity.JSDustSiteInfo |
| | | import cn.flightfeather.supervision.domain.util.MyMapper |
| | | import org.apache.ibatis.annotations.Mapper |
| | | |
| | | @Mapper |
| | | interface JSDustSiteInfoMapper : MyMapper<JSDustSiteInfo?> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package cn.flightfeather.supervision.domain.ds3.repository |
| | | |
| | | import cn.flightfeather.supervision.domain.ds3.entity.JSDustSiteMap |
| | | import cn.flightfeather.supervision.domain.ds3.mapper.JSDustSiteInfoMapper |
| | | import cn.flightfeather.supervision.domain.ds3.mapper.JSDustSiteMapMapper |
| | | import cn.flightfeather.supervision.lightshare.vo.DeviceMapVo |
| | | import cn.flightfeather.supervision.lightshare.vo.DeviceSiteVo |
| | | import org.springframework.stereotype.Repository |
| | | import tk.mybatis.mapper.entity.Example |
| | | |
| | | /** |
| | | * éå±±æ¬å°çæµç¹ä½åç³»ç»ç¨æ·æ å°å
³ç³»æ°æ®åºç¸å
³æä½ |
| | | */ |
| | | @Repository |
| | | class JSDustSiteRep( |
| | | private val jsDustSiteMapMapper: JSDustSiteMapMapper, |
| | | private val jsDustSiteInfoMapper: JSDustSiteInfoMapper, |
| | | ) { |
| | | |
| | | /** |
| | | * æ ¹æ®é£ç¾½çç®¡ç¨æ·idæ¥è¯¢åºæ¯åçæµè®¾å¤çå¹é
å
³ç³» |
| | | * @param idList çç®¡åºæ¯å¯¹åºçç¨æ·idå表 |
| | | * @return å¹é
å
³ç³»å表 |
| | | */ |
| | | fun findMapBySVUserId(idList: List<String?>): List<DeviceMapVo> { |
| | | val res = jsDustSiteMapMapper.selectByExample(Example(JSDustSiteMap::class.java).apply { |
| | | createCriteria().andIn("svUserId", idList) |
| | | }) |
| | | return DeviceMapVo.fromJSDustSiteMap(res) |
| | | } |
| | | |
| | | /** |
| | | * è·åéå±±çæµç¹ä½åºæ¬ä¿¡æ¯ |
| | | * @return çæµç¹ä¿¡æ¯å表 |
| | | */ |
| | | fun findSiteInfo(): List<DeviceSiteVo> { |
| | | val res = jsDustSiteInfoMapper.selectAll() |
| | | return DeviceSiteVo.fromJSDustSiteInfo(res) |
| | | } |
| | | } |
| | |
| | | |
| | | fun findAutoEvaluation(areaVo: AreaVo): List<AutoScoreResultVo?>? |
| | | |
| | | fun downloadAutoEvaluation(areaVo: AreaVo, response: HttpServletResponse): Boolean |
| | | fun downloadAutoEvaluation(areaVo: AreaVo, forceUpdate: Boolean, response: HttpServletResponse): Boolean |
| | | } |
| | |
| | | package cn.flightfeather.supervision.lightshare.service |
| | | |
| | | import cn.flightfeather.supervision.domain.ds1.entity.Evaluationsubrule |
| | | import cn.flightfeather.supervision.lightshare.vo.EvaluationVo |
| | | |
| | | |
| | | interface EvaluationsubruleService { |
| | |
| | | |
| | | fun search(districtCode: String, sceneTypeId: String, version: String? = null): List<Evaluationsubrule> |
| | | |
| | | fun getAutoScore(subTaskId: String): List<EvaluationVo> |
| | | |
| | | } |
| | |
| | | |
| | | fun findGitListById(id: String): List<GitlistVo> |
| | | |
| | | fun getInspectionInfoByScene(sceneId: String, topTaskId: String): InspectionInfoVo |
| | | fun getInspectionInfoByScene(sceneId: String, topTaskId: String): InspectionInfoVo? |
| | | |
| | | //è·åæä»»å¡å·¡æ¥ç»è®¡ä¿¡æ¯ |
| | | fun getStatistic(topTaskId: String, sceneTypeId: String): BaseResponse<List<InspectionStatisticVo>> |
| | | fun getStatistic(topTaskId: String, sceneTypeId: String): List<InspectionStatisticVo> |
| | | |
| | | //è·åæä»»å¡å·¡æ¥ç»è®¡ä¿¡æ¯ |
| | | fun getStatistic(areaVo: AreaVo): List<InspectionStatisticVo> |
| | | } |
| | |
| | | package cn.flightfeather.supervision.lightshare.service |
| | | |
| | | import cn.flightfeather.supervision.domain.ds1.entity.Problemlist |
| | | import cn.flightfeather.supervision.domain.ds1.entity.Subtask |
| | | import cn.flightfeather.supervision.lightshare.vo.* |
| | | import org.springframework.web.multipart.MultipartFile |
| | | |
| | |
| | | |
| | | fun changeProblem(problemId: String, files: Array<MultipartFile>): BaseResponse<String> |
| | | |
| | | fun getBySubTask(stGuid: String): List<ProblemlistVo> |
| | | fun getBySubTask(stGuid: String, all:Boolean?): List<ProblemlistVo> |
| | | |
| | | fun getSceneByProType(areaVo: AreaVo, pType:String):List<Subtask?> |
| | | |
| | | fun getSceneProSummary(areaVo: AreaVo, sortBy: String, page: Int, per_page: Int): Pair<DataHead?, |
| | | List<SceneProblemSummary>?> |
| | | } |
| | |
| | | |
| | | import cn.flightfeather.supervision.domain.ds1.entity.Scense |
| | | import cn.flightfeather.supervision.domain.ds1.entity.Task |
| | | import cn.flightfeather.supervision.domain.ds1.entity.Userinfo |
| | | import cn.flightfeather.supervision.lightshare.vo.* |
| | | import org.springframework.web.multipart.MultipartFile |
| | | |
| | | |
| | | interface ScenseService { |
| | |
| | | fun searchScene(areaVo: AreaVo, page: Int?, perPage: Int?): BaseResponse<List<Scense>> |
| | | |
| | | fun searchByCoordinate(lng: Double, lat: Double, radius: Double): List<Scense> |
| | | |
| | | /** |
| | | * éè¿æä»¶æ¹é导å
¥åºæ¯ä¿¡æ¯ |
| | | */ |
| | | fun importSceneInfo(file: MultipartFile): Boolean |
| | | |
| | | /** |
| | | * åå»ºåºæ¯ä¿¡æ¯ |
| | | */ |
| | | fun createScene(scense: Scense): Scense |
| | | |
| | | fun createOneScene(scense: Scense) |
| | | |
| | | fun createTZUserInfo(userInfo: Userinfo, scense: Scense) |
| | | } |
| | |
| | | |
| | | import cn.flightfeather.supervision.domain.ds1.entity.Subtask |
| | | import cn.flightfeather.supervision.lightshare.vo.* |
| | | import java.time.LocalDateTime |
| | | |
| | | |
| | | interface SubtaskService { |
| | |
| | | fun getByTopTaskAndDate(topTaskId: String, startTime: String?, endTime: String?, sceneTypeId: Int? = null): List<Subtask> |
| | | |
| | | fun getSummary(topTaskId: String, sceneTypeId: Int? = null): List<SubTaskSummary> |
| | | |
| | | fun getSummaryByArea(areaVo: AreaVo): List<TaskProgressVo> |
| | | |
| | | fun getByScene(sceneId: String, startTime: LocalDateTime?, endTime: LocalDateTime?): List<SubTaskSummary> |
| | | } |
| | |
| | | |
| | | fun findTask(areaVo: AreaVo):List<Task?> |
| | | |
| | | /** |
| | | * æ¥æ¾æ»ä»»å¡å®ææ
åµ |
| | | * @param areaVo ç鿡件 |
| | | */ |
| | | fun findTaskProgress(areaVo: AreaVo): List<TaskProgressVo?> |
| | | |
| | | } |
| | |
| | | package cn.flightfeather.supervision.lightshare.service |
| | | |
| | | import cn.flightfeather.supervision.domain.ds1.entity.Scense |
| | | import cn.flightfeather.supervision.domain.ds2.entity.UserMap |
| | | import cn.flightfeather.supervision.lightshare.vo.AreaVo |
| | | import cn.flightfeather.supervision.lightshare.vo.DeviceMapVo |
| | |
| | | */ |
| | | fun getTZIdBySceneId(sceneId: String): UserMap |
| | | |
| | | /** |
| | | * æ ¹æ®é£ç¾½ç¯å¢ç³»ç»ä¸çåºæ¯idï¼è·åä¸é£ç¾½ç管系ç»ä¸çå
³èç¨æ· |
| | | */ |
| | | fun getSceneByTZId(tzUserId: String): Scense? |
| | | |
| | | fun autoCreateMap() |
| | | |
| | | fun fetchDeviceMap(areaVo: AreaVo): List<DeviceMapVo?> |
| | |
| | | package cn.flightfeather.supervision.lightshare.service |
| | | |
| | | import cn.flightfeather.supervision.domain.ds1.entity.Scense |
| | | import cn.flightfeather.supervision.domain.ds1.entity.Userinfo |
| | | import cn.flightfeather.supervision.domain.ds2.entity.UserinfoTZ |
| | | |
| | | interface UserinfoService { |
| | | fun findOne(id: String): Userinfo? |
| | |
| | | |
| | | fun findByScene(sceneId: String): Userinfo? |
| | | |
| | | fun getUName(sceneName: String): String |
| | | |
| | | fun autoCreateAccount() |
| | | |
| | | fun createAccount(scence: Scense):Userinfo |
| | | |
| | | fun createAccountTZ(userinfo: Userinfo, scence: Scense): UserinfoTZ |
| | | } |
| | |
| | | package cn.flightfeather.supervision.lightshare.service.impl |
| | | |
| | | import cn.flightfeather.supervision.common.exception.ResponseErrorException |
| | | import cn.flightfeather.supervision.common.exception.BizException |
| | | import cn.flightfeather.supervision.common.executor.BackgroundTaskCtrl |
| | | import cn.flightfeather.supervision.common.executor.BgTaskConditionVo |
| | | import cn.flightfeather.supervision.common.executor.BgTaskStatus |
| | |
| | | } |
| | | |
| | | override fun startTask(condition: BgTaskConditionVo): BgTaskStatus? { |
| | | condition.type ?: throw ResponseErrorException("ä»»å¡ç±»åä¸è½ä¸ºç©º") |
| | | condition.id ?: throw ResponseErrorException("ä»»å¡idä¸è½ä¸ºç©º") |
| | | condition.type ?: throw BizException("ä»»å¡ç±»åä¸è½ä¸ºç©º") |
| | | condition.id ?: throw BizException("ä»»å¡idä¸è½ä¸ºç©º") |
| | | |
| | | val task = backgroundTaskCtrl.startTask(condition.type!!, condition.id!!) |
| | | return task.taskStatus |
| | | } |
| | | |
| | | override fun shutDownTask(condition: BgTaskConditionVo): List<BgTaskStatus?> { |
| | | condition.type ?: throw ResponseErrorException("ä»»å¡ç±»åä¸è½ä¸ºç©º") |
| | | condition.type ?: throw BizException("ä»»å¡ç±»åä¸è½ä¸ºç©º") |
| | | return backgroundTaskCtrl.shutDownTask(condition.type!!, condition.id) |
| | | } |
| | | |
| | | override fun removeTask(condition: BgTaskConditionVo): Boolean { |
| | | condition.type ?: throw ResponseErrorException("ä»»å¡ç±»åä¸è½ä¸ºç©º") |
| | | condition.id ?: throw ResponseErrorException("ä»»å¡idä¸è½ä¸ºç©º") |
| | | condition.type ?: throw BizException("ä»»å¡ç±»åä¸è½ä¸ºç©º") |
| | | condition.id ?: throw BizException("ä»»å¡idä¸è½ä¸ºç©º") |
| | | return backgroundTaskCtrl.removeTask(condition.type!!, condition.id!!) |
| | | } |
| | | |
| | |
| | | package cn.flightfeather.supervision.lightshare.service.impl |
| | | |
| | | import cn.flightfeather.supervision.common.exception.ResponseErrorException |
| | | import cn.flightfeather.supervision.common.exception.BizException |
| | | import cn.flightfeather.supervision.domain.ds1.repository.SceneRep |
| | | import cn.flightfeather.supervision.domain.ds1.repository.TaskRep |
| | | import cn.flightfeather.supervision.domain.ds1.repository.UserInfoSVRep |
| | | import cn.flightfeather.supervision.domain.ds2.entity.Complaint |
| | | import cn.flightfeather.supervision.domain.ds2.entity.Punishment |
| | | import cn.flightfeather.supervision.domain.ds2.mapper.ComplaintMapper |
| | | import cn.flightfeather.supervision.domain.ds2.mapper.PunishmentMapper |
| | | import cn.flightfeather.supervision.domain.ds2.repository.ComplaintAndPunishmentRep |
| | | import cn.flightfeather.supervision.domain.ds2.repository.UserInfoTZRep |
| | | import cn.flightfeather.supervision.domain.ds2.repository.UserMapRep |
| | | import cn.flightfeather.supervision.lightshare.service.ComplaintService |
| | | import cn.flightfeather.supervision.lightshare.service.UserinfoService |
| | | import cn.flightfeather.supervision.lightshare.vo.AreaVo |
| | | import cn.flightfeather.supervision.lightshare.vo.ComplaintVo |
| | | import cn.flightfeather.supervision.lightshare.vo.PunishmentVo |
| | |
| | | } |
| | | //以é£ç¾½ç管系ç»ä¸çç¨æ·ä¸ºä¸»ä½ |
| | | 2 -> { |
| | | val task = taskRep.findOneTask(areaVo) ?: throw ResponseErrorException("å½åæ¥è¯¢æ¡ä»¶ä¸æªæ¾å°å¯¹åºé¡¶å±ä»»å¡") |
| | | val task = taskRep.findOneTask(areaVo) ?: throw BizException("å½åæ¥è¯¢æ¡ä»¶ä¸æªæ¾å°å¯¹åºé¡¶å±ä»»å¡") |
| | | val scenes = sceneRep.findScene(task.tguid!!, areaVo.scensetypeid?.toInt(), areaVo.towncode) |
| | | .map { it?.guid } |
| | | val idList = userInfoSVRep.findUser(scenes).map { it?.guid } |
| | |
| | | import cn.flightfeather.supervision.business.bgtask.ReportTaskCtrl |
| | | import cn.flightfeather.supervision.business.report.DataSource |
| | | import cn.flightfeather.supervision.business.report.DbMapper |
| | | import cn.flightfeather.supervision.business.report.file.ReportOne |
| | | import cn.flightfeather.supervision.business.report.file.ReportThree |
| | | import cn.flightfeather.supervision.business.report.file.ReportTwo |
| | | import cn.flightfeather.supervision.common.exception.ResponseErrorException |
| | | import cn.flightfeather.supervision.common.exception.BizException |
| | | import cn.flightfeather.supervision.common.executor.BgTaskStatus |
| | | import cn.flightfeather.supervision.domain.ds1.entity.Domainitem |
| | | import cn.flightfeather.supervision.domain.ds1.entity.Evaluation |
| | |
| | | import org.springframework.stereotype.Service |
| | | import tk.mybatis.mapper.entity.Example |
| | | import java.io.File |
| | | import java.net.URLEncoder |
| | | import java.util.* |
| | | import javax.servlet.http.HttpServletResponse |
| | | import kotlin.Comparator |
| | |
| | | return evaluationRep.findAutoScore(areaVo) |
| | | } |
| | | |
| | | override fun downloadAutoEvaluation(areaVo: AreaVo, response: HttpServletResponse): Boolean { |
| | | areaVo.scensetypeid ?: throw ResponseErrorException("å¿
须鿩ä¸ä¸ªåºæ¯ç±»å") |
| | | val topTask = taskRep.findOneTask(areaVo) ?: throw ResponseErrorException("æªæ¾å°ç¬¦åæ¡ä»¶çé¡¶å±ä»»å¡") |
| | | override fun downloadAutoEvaluation(areaVo: AreaVo, forceUpdate: Boolean, response: HttpServletResponse): Boolean { |
| | | areaVo.scensetypeid ?: throw BizException("å¿
须鿩ä¸ä¸ªåºæ¯ç±»å") |
| | | val topTask = taskRep.findOneTask(areaVo) ?: throw BizException("æªæ¾å°ç¬¦åæ¡ä»¶çé¡¶å±ä»»å¡") |
| | | val config = ExcelConfigVo( |
| | | topTask.tguid ?: "", |
| | | topTask.starttime, |
| | |
| | | topTask.citycode, |
| | | topTask.districtcode, |
| | | topTask.towncode, |
| | | areaVo.scensetypeid?.toInt() |
| | | areaVo.scensetypeid?.toInt(), |
| | | forceUpdate = forceUpdate |
| | | ) |
| | | |
| | | val dataSource = DataSource(config, dbMapper) |
| | |
| | | val p = "$filePath/autoscore/" |
| | | val file = File(p + fileName) |
| | | if (config.forceUpdate || !file.exists()) { |
| | | // val downloadUrl = "/autoscore/${fileName}" |
| | | // reportTaskCtrl.startTask(t, downloadUrl) |
| | | val downloadUrl = "/autoscore/${fileName}" |
| | | reportTaskCtrl.startTask(t, downloadUrl) |
| | | return false |
| | | } else { |
| | | val fName = Base64.getEncoder().encodeToString(fileName.toByteArray()) |
| | |
| | | package cn.flightfeather.supervision.lightshare.service.impl |
| | | |
| | | import cn.flightfeather.supervision.domain.ds1.entity.Evaluationrule |
| | | import cn.flightfeather.supervision.domain.ds1.entity.Evaluationsubrule |
| | | import cn.flightfeather.supervision.domain.ds1.entity.* |
| | | import cn.flightfeather.supervision.domain.ds1.mapper.EvaluationruleMapper |
| | | import cn.flightfeather.supervision.domain.ds1.mapper.EvaluationsubruleMapper |
| | | import cn.flightfeather.supervision.domain.ds1.repository.EvaluationRep |
| | | import cn.flightfeather.supervision.domain.ds1.repository.EvaluationRuleRep |
| | | import cn.flightfeather.supervision.lightshare.service.EvaluationsubruleService |
| | | import cn.flightfeather.supervision.lightshare.vo.EvaluationVo |
| | | import cn.flightfeather.supervision.lightshare.vo.SubEvaluationVo |
| | | import cn.flightfeather.supervision.lightshare.vo.ThirdEvaluationVo |
| | | import org.springframework.stereotype.Service |
| | | import tk.mybatis.mapper.entity.Example |
| | | |
| | | @Service |
| | | class EvaluationsubruleServiceImpl ( |
| | | val evaluationsubruleMapper: EvaluationsubruleMapper, |
| | | val evaluationruleMapper: EvaluationruleMapper |
| | | ):EvaluationsubruleService { |
| | | class EvaluationsubruleServiceImpl( |
| | | val evaluationsubruleMapper: EvaluationsubruleMapper, |
| | | val evaluationruleMapper: EvaluationruleMapper, |
| | | private val evaluationRep: EvaluationRep, |
| | | private val evaluationRuleRep: EvaluationRuleRep, |
| | | ) : EvaluationsubruleService { |
| | | |
| | | override fun findOne(id: String): Evaluationsubrule = evaluationsubruleMapper.selectByPrimaryKey(id) |
| | | |
| | |
| | | |
| | | override fun save(evaluationsubrule: Evaluationsubrule): Int = evaluationsubruleMapper.insert(evaluationsubrule) |
| | | |
| | | override fun update(evaluationsubrule: Evaluationsubrule): Int = evaluationsubruleMapper.updateByPrimaryKey(evaluationsubrule) |
| | | override fun update(evaluationsubrule: Evaluationsubrule): Int = |
| | | evaluationsubruleMapper.updateByPrimaryKey(evaluationsubrule) |
| | | |
| | | override fun delete(id: String): Int = evaluationsubruleMapper.deleteByPrimaryKey(id) |
| | | |
| | |
| | | val result = mutableListOf<Evaluationsubrule>() |
| | | evaluationruleMapper.selectByExample(Example(Evaluationrule::class.java).apply { |
| | | createCriteria().andEqualTo("districtcode", districtCode) |
| | | .andEqualTo("scensetypeid", sceneTypeId) |
| | | }).takeIf { it.isNotEmpty() }?.get(0)?.let {rule -> |
| | | .andEqualTo("scensetypeid", sceneTypeId) |
| | | }).takeIf { it.isNotEmpty() }?.get(0)?.let { rule -> |
| | | evaluationsubruleMapper.selectByExample(Example(Evaluationsubrule::class.java).apply { |
| | | createCriteria().andEqualTo("erguid", rule.guid) |
| | | }) |
| | |
| | | |
| | | return result |
| | | } |
| | | |
| | | override fun getAutoScore(subTaskId: String): List<EvaluationVo> { |
| | | //åè§åéæ¡å¾å |
| | | val subRuleScores = evaluationRep.findItemEvaluation(subTaskId) |
| | | //æ»è§åid |
| | | val ruleId = mutableListOf<Evaluation>() |
| | | //è¯åæ»è§å |
| | | val rule = evaluationRuleRep.findAutoEvaluationRule(subTaskId) |
| | | //æ»è§å对åºçè¯ååè§å |
| | | val subRules = mutableListOf<Evaluationsubrule2>() |
| | | //æ¥è¯¢ç»æ |
| | | val resultList = mutableListOf<EvaluationVo>() |
| | | |
| | | var _group = 0 |
| | | subRules.forEach { |
| | | when (it.ertype) { |
| | | 2 -> resultList.add(EvaluationVo().apply { |
| | | id = it.guid |
| | | title1 = it.itemname |
| | | scoreMode = it.extension1 |
| | | gradeMode = it.extension2 |
| | | score = when (gradeMode) { |
| | | "minus_mode" -> it.minscore?.minus(it.maxscore ?: 0) ?: 0 |
| | | "add_mode" -> it.maxscore ?: 0 |
| | | else -> it.minscore?.minus(it.maxscore ?: 0) ?: 0 |
| | | } |
| | | selectMode = it.extension3 |
| | | |
| | | //妿æå¾åè®°å½ï¼åæ¹åç¶æä¸ºéä¸ |
| | | for (s in subRuleScores) { |
| | | if (it.guid == s.esrguid) { |
| | | select = s.extension1 == "true" |
| | | break |
| | | } |
| | | } |
| | | }) |
| | | 3 -> { |
| | | for (r in resultList) { |
| | | if (it.fatherid == r.id) { |
| | | r.sub1.add(SubEvaluationVo().apply { |
| | | id = it.guid |
| | | title2 = it.itemname |
| | | gradeMode = it.extension2 |
| | | selectMode = it.extension3 |
| | | score = when (gradeMode) { |
| | | "minus_mode" -> it.minscore?.minus(it.maxscore ?: 0) ?: 0 |
| | | "add_mode" -> it.maxscore ?: 0 |
| | | else -> it.minscore?.minus(it.maxscore ?: 0) ?: 0 |
| | | } |
| | | group = _group++ |
| | | |
| | | //妿æå¾åè®°å½ï¼åæ¹åç¶æä¸ºéä¸ |
| | | for (s in subRuleScores) { |
| | | if (it.guid == s.esrguid) { |
| | | select = s.extension1 == "true" |
| | | break |
| | | } |
| | | } |
| | | }) |
| | | break |
| | | } |
| | | } |
| | | } |
| | | 4 -> { |
| | | resultList.forEach{ r -> |
| | | //4级çè¯ä¼°é¡¹ç´æ¥éå±äº2级è¯ä¼°é¡¹ |
| | | if (r.id == it.fatherid) { |
| | | if (r.sub1.isEmpty()) { |
| | | r.sub1.add(SubEvaluationVo().apply { |
| | | placeholder = true |
| | | id = it.guid |
| | | title2 = r.title1 |
| | | score = r.score |
| | | gradeMode = r.gradeMode |
| | | selectMode = r.selectMode |
| | | group = _group++ |
| | | }) |
| | | } |
| | | r.sub1[0].sub2.add(ThirdEvaluationVo().apply { |
| | | id = it.guid |
| | | content = it.itemname |
| | | score = when (r.sub1[0].gradeMode) { |
| | | "minus_mode" -> r.score.plus(it.maxscore ?: 0) |
| | | "add_mode" -> it.maxscore ?: 0 |
| | | else -> r.score.plus(it.maxscore ?: 0) |
| | | } |
| | | //妿æå¾åè®°å½ï¼åæ¹åç¶æä¸ºéä¸ |
| | | for (s in subRuleScores) { |
| | | if (it.guid == s.esrguid) { |
| | | select = s.extension1 == "true" |
| | | break |
| | | } |
| | | } |
| | | }) |
| | | } else { |
| | | r.sub1.forEach { sr -> |
| | | if (sr.id == it.fatherid){ |
| | | sr.sub2.add(ThirdEvaluationVo().apply { |
| | | id = it.guid |
| | | content = it.itemname |
| | | score = when (sr.gradeMode) { |
| | | "minus_mode" -> sr.score.plus(it.maxscore ?: 0) |
| | | "add_mode" -> it.maxscore ?: 0 |
| | | else -> sr.score.plus(it.maxscore ?: 0) |
| | | } |
| | | //妿æå¾åè®°å½ï¼åæ¹åç¶æä¸ºéä¸ |
| | | for (s in subRuleScores) { |
| | | if (it.guid == s.esrguid) { |
| | | select = s.extension1 == "true" |
| | | break |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | return resultList |
| | | |
| | | } |
| | | } |
| | |
| | | package cn.flightfeather.supervision.lightshare.service.impl |
| | | |
| | | import cn.flightfeather.supervision.common.exception.BizException |
| | | import cn.flightfeather.supervision.domain.ds1.entity.Inspection |
| | | import cn.flightfeather.supervision.domain.ds1.mapper.InspectionMapper |
| | | import cn.flightfeather.supervision.common.utils.DateUtil |
| | | import cn.flightfeather.supervision.common.utils.UUIDGenerator |
| | | import cn.flightfeather.supervision.domain.ds1.repository.TaskRep |
| | | import cn.flightfeather.supervision.lightshare.service.* |
| | | import cn.flightfeather.supervision.lightshare.vo.* |
| | | import org.springframework.beans.BeanUtils |
| | |
| | | import tk.mybatis.mapper.entity.Example |
| | | |
| | | @Service |
| | | class InspectionServiceImpl(val inspectionMapper: InspectionMapper) : InspectionService { |
| | | class InspectionServiceImpl( |
| | | val inspectionMapper: InspectionMapper, |
| | | private val taskRep: TaskRep, |
| | | ) : InspectionService { |
| | | |
| | | @Autowired |
| | | lateinit var problemlistService: ProblemlistService |
| | |
| | | private val dateUtil = DateUtil() |
| | | |
| | | //è·å污æåºæ¯çæ¬ä¸»é¡µçç管æ
åµå±ç¤ºå
容 |
| | | override fun getInspectionInfoByScene(sceneId: String, topTaskId: String): InspectionInfoVo { |
| | | val maps = inspectionMapper.getInspectionInfoByScene(sceneId, topTaskId) |
| | | val inspectionInfoVo = InspectionInfoVo() |
| | | if (maps.isNotEmpty()) { |
| | | val map = maps[0] |
| | | if (map.isNotEmpty()) { |
| | | inspectionInfoVo.topTaskid = map["topTaskId"].toString() |
| | | inspectionInfoVo.topTaskName = map["topTaskName"].toString() |
| | | inspectionInfoVo.sceneId = map["sceneId"].toString() |
| | | inspectionInfoVo.sceneName = map["sceneName"].toString() |
| | | inspectionInfoVo.inspectionId = map["inspectionId"].toString() |
| | | inspectionInfoVo.subtaskId = map["subtaskId"].toString() |
| | | inspectionInfoVo.inspected = map["isInspected"].toString().equals("1") |
| | | 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") |
| | | inspectionInfoVo.unChangedCount = map["unChangedCount"].toString().toInt() |
| | | inspectionInfoVo.changedCount = map["changedCount"].toString().toInt() |
| | | inspectionInfoVo.promisedTime = map["promisedTime"].toString() |
| | | } |
| | | } |
| | | return inspectionInfoVo |
| | | override fun getInspectionInfoByScene(sceneId: String, topTaskId: String): InspectionInfoVo? { |
| | | val resList = inspectionMapper.getInspectionInfoByScene(sceneId, topTaskId) |
| | | return if (resList.isNotEmpty()) resList[0] else InspectionInfoVo() |
| | | } |
| | | |
| | | //æ ¹æ®å·¡æ¥IDè·åé®é¢å表 |
| | |
| | | |
| | | override fun delete(id: String): Int = inspectionMapper.deleteByPrimaryKey(id) |
| | | |
| | | override fun getStatistic(topTaskId: String, sceneTypeId: String): BaseResponse<List<InspectionStatisticVo>> { |
| | | override fun getStatistic(topTaskId: String, sceneTypeId: String): List<InspectionStatisticVo> { |
| | | val result = inspectionMapper.getStatistic(topTaskId, sceneTypeId) |
| | | return if (result.isNotEmpty()) { |
| | | BaseResponse(true, data = result) |
| | | } else { |
| | | BaseResponse(false) |
| | | } |
| | | return result.ifEmpty { throw BizException("æ å·¡æ¥è®°å½") } |
| | | } |
| | | |
| | | override fun getStatistic(areaVo: AreaVo): List<InspectionStatisticVo> { |
| | | areaVo.scensetypeid ?: throw BizException("请æ±åæ°requestBodyä¸åºæ¯ç±»åscensetypeidä¸è½ä¸ºç©º") |
| | | val topTask = taskRep.findOneTask(areaVo) ?: throw BizException("æªæ¾å°ç¸å
³å·¡æ¥æ»ä»»å¡") |
| | | return getStatistic(topTask.tguid!!, areaVo.scensetypeid!!) |
| | | } |
| | | } |
| | |
| | | override fun updatelist(itemevaluationlist: List<Itemevaluation>): Int { |
| | | //循ç¯ä¿®æ¹ |
| | | itemevaluationlist.forEach { |
| | | itemevaluationMapper.updateByPrimaryKey(it) |
| | | itemevaluationMapper.updateByPrimaryKeySelective(it) |
| | | } |
| | | return itemevaluationlist.size |
| | | } |
| | |
| | | |
| | | override fun save(itemevaluation: Itemevaluation): Int = itemevaluationMapper.insert(itemevaluation) |
| | | |
| | | override fun update(itemevaluation: Itemevaluation): Int = itemevaluationMapper.updateByPrimaryKey(itemevaluation) |
| | | override fun update(itemevaluation: Itemevaluation): Int = itemevaluationMapper.updateByPrimaryKeySelective(itemevaluation) |
| | | |
| | | override fun delete(id: String): Int = itemevaluationMapper.deleteByPrimaryKey(id) |
| | | } |
| | |
| | | package cn.flightfeather.supervision.lightshare.service.impl |
| | | |
| | | import cn.flightfeather.supervision.common.utils.UUIDGenerator |
| | | import cn.flightfeather.supervision.domain.ds1.entity.Monitorobjectversion |
| | | import cn.flightfeather.supervision.domain.ds1.entity.Scense |
| | | import cn.flightfeather.supervision.domain.ds1.mapper.MonitorobjectversionMapper |
| | |
| | | @Transactional |
| | | override fun saveList(monitorobjectversionlist: List<Monitorobjectversion>): Int { |
| | | monitorobjectversionlist.forEach { |
| | | if (it.movid == null) it.movid = UUIDGenerator.generate16ShortUUID() |
| | | monitorobjectversionMapper.insert(it) |
| | | } |
| | | return monitorobjectversionlist.size |
| | |
| | | package cn.flightfeather.supervision.lightshare.service.impl |
| | | |
| | | import cn.flightfeather.supervision.common.exception.BizException |
| | | import cn.flightfeather.supervision.domain.ds1.entity.Problemlist |
| | | import cn.flightfeather.supervision.domain.ds1.entity.Scense |
| | | import cn.flightfeather.supervision.common.utils.Constant |
| | | import cn.flightfeather.supervision.common.utils.FileUtil |
| | | import cn.flightfeather.supervision.common.utils.UUIDGenerator |
| | | import cn.flightfeather.supervision.domain.ds1.entity.Mediafile |
| | | import cn.flightfeather.supervision.domain.ds1.entity.Subtask |
| | | import cn.flightfeather.supervision.domain.ds1.mapper.* |
| | | import cn.flightfeather.supervision.domain.ds1.repository.ProblemRep |
| | | import cn.flightfeather.supervision.domain.ds1.repository.SubTaskRep |
| | | import cn.flightfeather.supervision.domain.ds1.repository.TaskRep |
| | | import cn.flightfeather.supervision.lightshare.service.MediafileService |
| | | import cn.flightfeather.supervision.lightshare.service.ProblemlistService |
| | | import cn.flightfeather.supervision.lightshare.service.TaskService |
| | | import cn.flightfeather.supervision.lightshare.vo.* |
| | | import com.fasterxml.jackson.core.type.TypeReference |
| | | import com.fasterxml.jackson.databind.ObjectMapper |
| | | import com.github.pagehelper.PageHelper |
| | | import org.springframework.beans.BeanUtils |
| | | import org.springframework.stereotype.Service |
| | | import org.springframework.web.multipart.MultipartFile |
| | |
| | | class ProblemlistServiceImpl( |
| | | val problemlistMapper: ProblemlistMapper, |
| | | val inspectionMapper: InspectionMapper, |
| | | val mediafileMapper: MediafileMapper |
| | | val mediafileMapper: MediafileMapper, |
| | | private val taskRep: TaskRep, |
| | | private val subTaskRep: SubTaskRep, |
| | | private val problemRep: ProblemRep, |
| | | ) : ProblemlistService { |
| | | |
| | | @Resource |
| | | lateinit var scenseMapper: ScenseMapper |
| | | |
| | | @Resource |
| | | lateinit var problemtypeMapper: ProblemtypeMapper |
| | | |
| | | @Resource |
| | | lateinit var taskMapper: TaskMapper |
| | | |
| | | @Resource |
| | | lateinit var taskService: TaskService |
| | | |
| | | @Resource |
| | | lateinit var mediafileService: MediafileService |
| | | |
| | |
| | | val sceneType = areaVo.scensetypeid |
| | | val startTime = areaVo.starttime?.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")) |
| | | val endTime = areaVo.endtime?.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")) |
| | | val maps = problemlistMapper.getStatisticalResult(districtcode,startTime, endTime, sceneType) |
| | | val statisticsVos = mutableListOf<StatisticsVo>() |
| | | maps.forEach { |
| | | if (!it.isEmpty() && it.get("name") != null) { |
| | | val statisticsVo = StatisticsVo() |
| | | statisticsVo.name = it.get("name").toString() |
| | | try { |
| | | statisticsVo.count = it.get("count").toString().toInt() |
| | | } catch (e: Exception) { |
| | | } |
| | | try { |
| | | statisticsVo.changeCount = it.get("changeCount").toString().toInt() |
| | | } catch (e: Exception) { |
| | | } |
| | | statisticsVos.add(statisticsVo) |
| | | } |
| | | } |
| | | return statisticsVos |
| | | return problemlistMapper.getStatisticalResult(districtcode, startTime, endTime, sceneType, areaVo.sceneId) |
| | | } |
| | | |
| | | override fun getChargeResult(areaVo: AreaVo): ChargeInfoVo { |
| | |
| | | } catch (e: Exception) { |
| | | } |
| | | try { |
| | | sceneInfo.changeCount =it.get("changeCount").toString().toInt() |
| | | sceneInfo.changeCount = it.get("changeCount").toString().toInt() |
| | | } catch (e: Exception) { |
| | | } |
| | | chargeInfoVo.sceneInfos.add(sceneInfo) |
| | |
| | | var curScore = -1 |
| | | if (it.get("scoreAft") != null) { |
| | | curScore = it.get("scoreAft").toString().toInt() |
| | | }else if (it.get("scoreBef") != null) { |
| | | } else if (it.get("scoreBef") != null) { |
| | | curScore = it.get("scoreBef").toString().toInt() |
| | | } |
| | | if (curScore >= 100) { |
| | | scoreInfo1.count++ |
| | | }else if (curScore >= 78 && curScore < 100) { |
| | | } else if (curScore >= 78 && curScore < 100) { |
| | | scoreInfo2.count++ |
| | | }else if (curScore >= 54 && curScore < 78) { |
| | | } else if (curScore >= 54 && curScore < 78) { |
| | | scoreInfo3.count++ |
| | | }else if (curScore < 54 && curScore >= 0) { |
| | | } else if (curScore < 54 && curScore >= 0) { |
| | | scoreInfo4.count++ |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | //æ ¹æ®å°åè·åé®é¢ |
| | | override fun getByArea(areaVo: AreaVo):List<ProblemlistVo> { |
| | | override fun getByArea(areaVo: AreaVo): List<ProblemlistVo> { |
| | | val problemlist = mutableListOf<ProblemlistVo>() |
| | | // val tmpproblemlsit = mutableListOf<Problemlist>() |
| | | val example = Example(Scense::class.java) |
| | |
| | | criteria.andEqualTo("towncode", areaVo.towncode) |
| | | criteria.andEqualTo("typeid", areaVo.scensetypeid) |
| | | val result1 = scenseMapper.selectByExample(example) |
| | | if (result1.isNotEmpty()){ |
| | | result1.forEach{ |
| | | if (result1.isNotEmpty()) { |
| | | result1.forEach { |
| | | val tmpexample = Example(Problemlist::class.java) |
| | | val tmpcriteria = tmpexample.createCriteria() |
| | | //对äºç¡®å®çæ¯ä¸ªåºæ¯ï¼æ ¹æ®æ¶é´æ¥è¯¢é®é¢ |
| | |
| | | |
| | | override fun findMonthProblemById(taskId: String, sceneId: Int?): List<MonthProblemVo> { |
| | | val monthProblemlistVoList = mutableListOf<MonthProblemVo>() |
| | | var map = problemlistMapper.findMonthProblemById(taskId,sceneId) |
| | | var map = problemlistMapper.findMonthProblemById(taskId, sceneId) |
| | | map.forEach { m -> |
| | | val monthProblemVo = MonthProblemVo() |
| | | monthProblemVo.townCode =if(m.get("towncode")!= null) BigDecimal(m.get("towncode").toString()).toString() else null |
| | | monthProblemVo.townCode = |
| | | if (m.get("towncode") != null) BigDecimal(m.get("towncode").toString()).toString() else null |
| | | monthProblemVo.townName = if (m.get("townname") != null) m.get("townname").toString() else null |
| | | monthProblemVo.scenetype =if (m.get("scenetype") != null) m.get("scenetype").toString().toInt()else null |
| | | monthProblemVo.scenetypename =if(m.get("scenetypename") != null)m.get("scenetypename").toString()else null |
| | | monthProblemVo.totalscenecount =if(m.get("totalscenecount") != null)m.get("totalscenecount").toString().toInt()else null |
| | | monthProblemVo.problemscenes =if(m.get("problemscenes") != null)m.get("problemscenes").toString().toInt()else null |
| | | monthProblemVo.totalproblems =if(m.get("totalproblems") != null)m.get("totalproblems").toString().toInt()else null |
| | | monthProblemVo.changedproblems =if(m.get("changedproblems") != null)m.get("changedproblems").toString().toInt()else null |
| | | monthProblemVo.scenetype = if (m.get("scenetype") != null) m.get("scenetype").toString().toInt() else null |
| | | monthProblemVo.scenetypename = |
| | | if (m.get("scenetypename") != null) m.get("scenetypename").toString() else null |
| | | monthProblemVo.totalscenecount = |
| | | if (m.get("totalscenecount") != null) m.get("totalscenecount").toString().toInt() else null |
| | | monthProblemVo.problemscenes = |
| | | if (m.get("problemscenes") != null) m.get("problemscenes").toString().toInt() else null |
| | | monthProblemVo.totalproblems = |
| | | if (m.get("totalproblems") != null) m.get("totalproblems").toString().toInt() else null |
| | | monthProblemVo.changedproblems = |
| | | if (m.get("changedproblems") != null) m.get("changedproblems").toString().toInt() else null |
| | | monthProblemlistVoList.add(monthProblemVo) |
| | | } |
| | | return monthProblemlistVoList; |
| | | } |
| | | |
| | | override fun check(pId: String, action: Byte, remark: String, userId: String, userName: String): BaseResponse<String> { |
| | | override fun check( |
| | | pId: String, |
| | | action: Byte, |
| | | remark: String, |
| | | userId: String, |
| | | userName: String, |
| | | ): BaseResponse<String> { |
| | | if (action !in 0..3) { |
| | | return BaseResponse(false, "éæ³çæä½æä»¤") |
| | | } |
| | |
| | | 0.toByte() -> extension3 = Constant.PROBLEM_CHECK_PASS |
| | | 1.toByte() -> extension3 = Constant.PROBLEM_CHECK_FAIL |
| | | 2.toByte(), |
| | | 3.toByte() -> { |
| | | 3.toByte(), |
| | | -> { |
| | | response.success = false |
| | | response.message = "é®é¢æäº¤è¿æªå®¡æ ¸ï¼æ æ³è¿è¡æ´æ¹å®¡æ ¸ï¼" |
| | | } |
| | | } |
| | | }else if (extension3 == Constant.PROBLEM_CHECK_PASS || extension3 == Constant.PROBLEM_CHECK_FAIL) { |
| | | } else if (extension3 == Constant.PROBLEM_CHECK_PASS || extension3 == Constant.PROBLEM_CHECK_FAIL) { |
| | | when (action) { |
| | | 0.toByte() -> extension3 = Constant.PROBLEM_CHECK_PASS |
| | | 1.toByte() -> extension3 = Constant.PROBLEM_CHECK_FAIL |
| | | 2.toByte(), |
| | | 3.toByte() -> { |
| | | 3.toByte(), |
| | | -> { |
| | | if (ischanged == true && extension3 == Constant.PROBLEM_CHECK_PASS) { |
| | | response.success = true |
| | | extension3 = if (action == 2.toByte()) { |
| | | Constant.CHANGE_CHECK_PASS |
| | | }else{ |
| | | } else { |
| | | Constant.CHANGE_CHECK_FAIL |
| | | } |
| | | } else { |
| | |
| | | } |
| | | } |
| | | } |
| | | }else if (extension3 == Constant.CHANGE_UNCHECKED) { |
| | | } else if (extension3 == Constant.CHANGE_UNCHECKED) { |
| | | when (action) { |
| | | 0.toByte(), |
| | | 1.toByte() -> { |
| | | 1.toByte(), |
| | | -> { |
| | | response.success = false |
| | | response.message = "é®é¢æäº¤å·²å®¡æ ¸ï¼å¹¶ä¸å·²è¢«æ´æ¹ãæä½æ æ" |
| | | } |
| | | 2.toByte() -> extension3 = Constant.CHANGE_CHECK_PASS |
| | | 3.toByte() -> extension3 = Constant.CHANGE_CHECK_FAIL |
| | | } |
| | | }else if (extension3 == Constant.CHANGE_CHECK_PASS || extension3 == Constant.CHANGE_CHECK_FAIL) { |
| | | } else if (extension3 == Constant.CHANGE_CHECK_PASS || extension3 == Constant.CHANGE_CHECK_FAIL) { |
| | | when (action) { |
| | | 0.toByte(), |
| | | 1.toByte() -> { |
| | | 1.toByte(), |
| | | -> { |
| | | response.success = false |
| | | response.message = "é®é¢æäº¤å·²å®¡æ ¸ï¼å¹¶ä¸å·²è¢«æ´æ¹ãæä½æ æ" |
| | | } |
| | |
| | | filetype = 1 |
| | | businesstype = "é®é¢" |
| | | businesstypeid = 1 |
| | | path = "FlightFeather/Photo/" + scene.districtname + "/" + now.year + "å¹´" + now.monthValue + "æ/" + now.monthValue + "æ" + now.dayOfMonth + "æ¥/" + scene.name + "/" |
| | | description = problemlist.problemname + " " + problemlist.location + " " + UUIDGenerator.generateUUID(4) + ".jpg" |
| | | path = |
| | | "FlightFeather/Photo/" + scene.districtname + "/" + now.year + "å¹´" + now.monthValue + "æ/" + now.monthValue + "æ" + now.dayOfMonth + "æ¥/" + scene.name + "/" |
| | | description = |
| | | problemlist.problemname + " " + problemlist.location + " " + UUIDGenerator.generateUUID(4) + ".jpg" |
| | | savetime = Date() |
| | | ischanged = false |
| | | extension1 = scene.citycode + "/" + scene.districtcode + "/" + now.format(DateTimeFormatter.ofPattern("yyyy-MM-dd")) + "/" + scene.guid + "/" |
| | | extension1 = |
| | | scene.citycode + "/" + scene.districtcode + "/" + now.format(DateTimeFormatter.ofPattern("yyyy-MM-dd")) + "/" + scene.guid + "/" |
| | | remark = "å·²ä¸ä¼ " |
| | | } |
| | | mediafileMapper.insert(mediaFile) |
| | |
| | | return BaseResponse(true) |
| | | } |
| | | |
| | | override fun getBySubTask(stGuid: String): List<ProblemlistVo> { |
| | | override fun getBySubTask(stGuid: String, all: Boolean?): List<ProblemlistVo> { |
| | | //æ ¹æ®åä»»å¡IDè·åé®é¢å表 |
| | | val problemListVo = findBySubtaskId(stGuid) |
| | | //夿æ¯å¦æé®é¢å表 |
| | | if (!problemListVo.isEmpty()) { |
| | | //æ ¹æ®æ¯ä¸ªé®é¢,è·ååªä½æä»¶ |
| | | problemListVo.forEach { |
| | | val mediafileVo = mediafileService.findByBusinessGUID(it.guid!!) |
| | | //夿æ¯å¦æåªä½èµæ |
| | | if (!mediafileVo.isEmpty()) { |
| | | //èµå¼ |
| | | it.mediafileList = mediafileVo |
| | | val problemListVo = mutableListOf<ProblemlistVo>() |
| | | if (all == false) { |
| | | //å»é¤æªå®¡æ ¸ä»¥åå®¡æ ¸ä¸éè¿çé®é¢ |
| | | findBySubtaskId(stGuid).forEach { |
| | | if (it.extension3 != Constant.PROBLEM_UNCHECKED && it.extension3 != Constant.PROBLEM_CHECK_FAIL) { |
| | | problemListVo.add(it) |
| | | } |
| | | } |
| | | } else { |
| | | problemListVo.addAll(findBySubtaskId(stGuid)) |
| | | } |
| | | //æ ¹æ®æ¯ä¸ªé®é¢,è·ååªä½æä»¶ |
| | | problemListVo.forEach { |
| | | val mediafileVo = mediafileService.findByBusinessGUID(it.guid!!) |
| | | //夿æ¯å¦æåªä½èµæ |
| | | if (mediafileVo.isNotEmpty()) { |
| | | //èµå¼ |
| | | it.mediafileList = mediafileVo |
| | | } |
| | | } |
| | | return problemListVo |
| | | } |
| | | |
| | | override fun getSceneByProType(areaVo: AreaVo, pType: String): List<Subtask?> { |
| | | areaVo.scensetypeid ?: throw BizException("缺å°åºæ¯ç±»ååæ°") |
| | | val task = taskRep.findOneTask(areaVo) ?: throw BizException("æªæ¾å°å¯¹åºçå·¡æ¥æ»ä»»å¡") |
| | | return subTaskRep.findSubtasks(task.tguid!!, areaVo.scensetypeid!!, pType) |
| | | } |
| | | |
| | | override fun getSceneProSummary( |
| | | areaVo: AreaVo, |
| | | sortBy: String, |
| | | page: Int, |
| | | per_page: Int, |
| | | ): Pair<DataHead?, List<SceneProblemSummary>?> { |
| | | areaVo.scensetypeid ?: throw BizException("缺å°åºæ¯ç±»ååæ°") |
| | | val task = taskRep.findOneTask(areaVo) ?: throw BizException("æªæ¾å°å¯¹åºçå·¡æ¥æ»ä»»å¡") |
| | | val p = PageHelper.startPage<SceneProblemSummary>(page, per_page) |
| | | val res = problemRep.getSceneProSummary(task.tguid!!, areaVo.scensetypeid!!, areaVo.sort, sortBy) |
| | | return DataHead(p.pageNum, p.pages, p.total) to res |
| | | } |
| | | } |
| | |
| | | package cn.flightfeather.supervision.lightshare.service.impl |
| | | |
| | | import cn.flightfeather.supervision.business.import.SceneImport |
| | | import cn.flightfeather.supervision.business.location.LocationRoadNearby |
| | | import cn.flightfeather.supervision.common.exception.BizException |
| | | import cn.flightfeather.supervision.common.utils.Constant |
| | | import cn.flightfeather.supervision.domain.ds1.entity.* |
| | | import cn.flightfeather.supervision.domain.ds1.mapper.* |
| | | import cn.flightfeather.supervision.domain.ds1.repository.SceneRep |
| | | import cn.flightfeather.supervision.domain.ds2.entity.UserMap |
| | | import cn.flightfeather.supervision.domain.ds2.repository.BaseInfoRep |
| | | import cn.flightfeather.supervision.domain.ds2.repository.UserMapRep |
| | | import cn.flightfeather.supervision.lightshare.service.* |
| | | import cn.flightfeather.supervision.lightshare.vo.* |
| | | import com.github.pagehelper.PageHelper |
| | | import com.google.gson.Gson |
| | | import org.jetbrains.kotlin.utils.addToStdlib.ifNotEmpty |
| | | import org.springframework.beans.BeanUtils |
| | | import org.springframework.beans.factory.annotation.Autowired |
| | | import org.springframework.stereotype.Service |
| | | import org.springframework.transaction.annotation.Transactional |
| | | import org.springframework.web.multipart.MultipartFile |
| | | import tk.mybatis.mapper.entity.Example |
| | | import tk.mybatis.mapper.util.StringUtil |
| | | import java.io.ByteArrayInputStream |
| | | import java.util.* |
| | | import kotlin.collections.ArrayList |
| | | |
| | | @Service |
| | | class ScenseServiceImpl( |
| | |
| | | val sceneWharfMapper: SceneWharfMapper, |
| | | val userinfoService: UserinfoService, |
| | | private val locationRoadNearby: LocationRoadNearby, |
| | | private val sceneImport: SceneImport, |
| | | private val sceneRep: SceneRep, |
| | | private val baseInfoRep: BaseInfoRep, |
| | | private val userMapRep: UserMapRep, |
| | | ) : ScenseService { |
| | | |
| | | @Autowired |
| | |
| | | } |
| | | |
| | | override fun save(scense: Scense): Int { |
| | | // TODO: 2021/7/20 æ°å¢åºæ¯çåæ¶çæè´¦æ· |
| | | val r = scenseMapper.insert(scense) |
| | | if (r == 1) { |
| | | scense.guid?.let { userinfoService.createAccount(it) } |
| | | return try { |
| | | createScene(scense) |
| | | 1 |
| | | } catch (e: BizException) { |
| | | println(e.message) |
| | | 0 |
| | | } |
| | | return r |
| | | } |
| | | |
| | | override fun update(scense: Scense): Int = scenseMapper.updateByPrimaryKeySelective(scense) |
| | |
| | | areaVo.towncode?.let { andEqualTo("towncode", it) } |
| | | areaVo.scensetypeid?.let { andEqualTo("typeid", it) } |
| | | areaVo.sceneName?.let { andLike("name", "%${it}%") } |
| | | |
| | | } |
| | | areaVo.online?.let { |
| | | and(createCriteria().apply { |
| | |
| | | override fun searchByCoordinate(lng: Double, lat: Double, radius: Double): List<Scense> { |
| | | return locationRoadNearby.searchByRadius(Pair(lng, lat), radius) |
| | | } |
| | | |
| | | override fun importSceneInfo(file: MultipartFile): Boolean { |
| | | val f = ByteArrayInputStream(file.bytes) |
| | | val scenes = sceneImport.readFromFile(f) |
| | | // æ¥æ¾åºæ¯åç§°æ¯å¦éå¤ |
| | | val names = scenes.map { it.name } |
| | | sceneRep.findScenes(names).map { it?.name }.ifNotEmpty { |
| | | val str = this.joinToString("ï¼") |
| | | throw BizException("åå¨éå¤åºæ¯ï¼å¦ä¸ï¼${str}") |
| | | } |
| | | scenes.forEach { |
| | | createOneScene(it) |
| | | } |
| | | return true |
| | | } |
| | | |
| | | override fun createScene(scense: Scense): Scense { |
| | | val names = listOf(scense.name) |
| | | sceneRep.findScenes(names).map { it?.name }.ifNotEmpty { |
| | | val str = this.joinToString("ï¼") |
| | | throw BizException("åå¨éå¤åºæ¯ï¼å¦ä¸ï¼${str}") |
| | | } |
| | | createOneScene(scense) |
| | | return scense |
| | | } |
| | | |
| | | |
| | | override fun createOneScene(scense: Scense) { |
| | | //1. æå
¥åºæ¯è¡¨ |
| | | sceneRep.insert(scense) |
| | | //2. çæå¯¹åºè´¦æ·ä¿¡æ¯ |
| | | val userInfo = userinfoService.createAccount(scense) |
| | | createTZUserInfo(userInfo, scense) |
| | | } |
| | | |
| | | override fun createTZUserInfo(userInfo: Userinfo, scense: Scense) { |
| | | //1. çæé£ç¾½ç¯å¢ç³»ç»å¯¹åºè´¦æ·ååºç¡ä¿¡æ¯ |
| | | val userInfoTZ = userinfoService.createAccountTZ(userInfo, scense) |
| | | val baseInfo = baseInfoRep.create(userInfoTZ, scense) |
| | | //2. çæç¨æ·å¹é
ä¿¡æ¯ |
| | | userMapRep.insert(UserMap().apply { |
| | | tzUserId = userInfoTZ.guid |
| | | tzUserName = userInfoTZ.realname |
| | | svUserId = userInfo.guid |
| | | svUserName = userInfo.realname |
| | | umCreateTime = Date() |
| | | }) |
| | | } |
| | | |
| | | } |
| | |
| | | package cn.flightfeather.supervision.lightshare.service.impl |
| | | |
| | | import cn.flightfeather.supervision.business.autooutput.score.AopEvaluation |
| | | import cn.flightfeather.supervision.common.exception.BizException |
| | | import cn.flightfeather.supervision.domain.ds1.entity.* |
| | | import cn.flightfeather.supervision.domain.ds1.mapper.* |
| | | import cn.flightfeather.supervision.common.utils.Constant |
| | | import cn.flightfeather.supervision.common.utils.DateUtil |
| | | import cn.flightfeather.supervision.common.utils.UUIDGenerator |
| | | import cn.flightfeather.supervision.domain.ds1.repository.TaskRep |
| | | import cn.flightfeather.supervision.lightshare.service.SubtaskService |
| | | import cn.flightfeather.supervision.lightshare.service.TaskService |
| | | import cn.flightfeather.supervision.lightshare.vo.* |
| | |
| | | import org.springframework.transaction.annotation.Transactional |
| | | import tk.mybatis.mapper.entity.Example |
| | | import tk.mybatis.mapper.util.StringUtil |
| | | import java.time.LocalDateTime |
| | | import java.util.* |
| | | import kotlin.math.ceil |
| | | |
| | |
| | | class SubtaskServiceImpl( |
| | | private val subtaskMapper: SubtaskMapper, |
| | | private val aopEvaluation: AopEvaluation, |
| | | private val taskRep: TaskRep, |
| | | ) : SubtaskService { |
| | | |
| | | val dateUtil = DateUtil() |
| | |
| | | return resultList |
| | | } |
| | | |
| | | override fun getByTopTaskAndDate(topTaskId: String, startTime: String?, endTime: String?, sceneTypeId: Int?): List<Subtask> { |
| | | // val startDate = dateUtil.StringToDate(startTime) |
| | | // val endDate = dateUtil.StringToDate(endTime) |
| | | // |
| | | // val cal = Calendar.getInstance().apply { time = startDate } |
| | | // val _startTime = dateUtil.DateToString(cal.time, DateUtil.DateStyle.YYYY_MM_DD_HH_MM_SS) ?: startTime |
| | | // |
| | | // if (endDate == null) { |
| | | // cal.add(Calendar.MONTH, 1) |
| | | // cal.add(Calendar.DAY_OF_MONTH, -1) |
| | | // } else { |
| | | // cal.time = endDate |
| | | // } |
| | | // cal.set(Calendar.HOUR_OF_DAY, 23) |
| | | // cal.set(Calendar.MINUTE, 59) |
| | | // cal.set(Calendar.SECOND, 59) |
| | | // val _endTime = dateUtil.DateToString(cal.time, DateUtil.DateStyle.YYYY_MM_DD_HH_MM_SS) ?: endTime |
| | | override fun getByTopTaskAndDate( |
| | | topTaskId: String, |
| | | startTime: String?, |
| | | endTime: String?, |
| | | sceneTypeId: Int? |
| | | ): List<Subtask> { |
| | | |
| | | val resultList = subtaskMapper.selectByTopTask2(topTaskId, sceneTypeId) |
| | | |
| | | return resultList |
| | | return subtaskMapper.selectByTopTask2(topTaskId, sceneTypeId) |
| | | } |
| | | |
| | | override fun getSummary(topTaskId: String, sceneTypeId: Int?): List<SubTaskSummary> { |
| | | // val result = mutableListOf<SubTaskSummary>() |
| | | |
| | | // subtaskMapper.selectByTopTask2(topTaskId, sceneTypeId).forEach { |
| | | // val scene = scenseMapper.selectByPrimaryKey(it.scenseid) |
| | | // var p = 0 |
| | | // var c = 0 |
| | | // var pc = 0 |
| | | // var cc = 0 |
| | | // problemlistMapper.selectByExample(Example(Problemlist::class.java).apply { |
| | | // createCriteria().andEqualTo("stguid", it.stguid) |
| | | // }).forEach {pro -> |
| | | // p++ |
| | | // if (pro.ischanged == true) c++ |
| | | // if (pro.extension3 != Constant.PROBLEM_UNCHECKED) pc++ |
| | | // if (pro.extension3 == Constant.CHANGE_CHECK_PASS || pro.extension3 == Constant.CHANGE_CHECK_FAIL) cc++ |
| | | // } |
| | | // val ins = inspectionMapper.selectByExample(Example(Inspection::class.java).apply { |
| | | // createCriteria().andEqualTo("stguid", it.stguid) |
| | | // }) |
| | | // result.add(SubTaskSummary().apply { |
| | | // stGuid = it.stguid |
| | | // stName = it.name |
| | | // if (ins.isNotEmpty()) insGuid = ins[0].guid |
| | | // sceneId = it.scenseid |
| | | // sceneName = scene.name |
| | | // sceneType = scene.type |
| | | // stPlanTime = it.planstarttime |
| | | // proNum = p |
| | | // changeNum = c |
| | | // proCheckedNum = pc |
| | | // changeCheckedNum = cc |
| | | // }) |
| | | // } |
| | | |
| | | // return result |
| | | |
| | | return subtaskMapper.getSummary(topTaskId, sceneTypeId) |
| | | } |
| | | |
| | | override fun getSummaryByArea(areaVo: AreaVo): List<TaskProgressVo> { |
| | | areaVo.scensetypeid ?: throw BizException("缺å°åºæ¯ç±»ååæ°") |
| | | val res = mutableListOf<TaskProgressVo>() |
| | | taskRep.findTasks(areaVo).forEach {t-> |
| | | if (t?.tguid == null) return@forEach |
| | | val pro = TaskProgressVo().apply { |
| | | tguid = t.tguid |
| | | name = t.name |
| | | levelnum = t.levelnum |
| | | provinceCode = t.provincecode |
| | | provinceName = t.provincename |
| | | cityCode = t.citycode |
| | | cityName = t.cityname |
| | | districtCode = t.districtcode |
| | | districtName = t.districtname |
| | | townCode = t.towncode |
| | | townName = t.townname |
| | | subTaskSummary = subtaskMapper.getSummary(t.tguid!!, areaVo.scensetypeid?.toIntOrNull()) |
| | | } |
| | | res.add(pro) |
| | | } |
| | | return res |
| | | } |
| | | |
| | | override fun getByScene(sceneId: String, startTime: LocalDateTime?, endTime: LocalDateTime?): List<SubTaskSummary> { |
| | | return subtaskMapper.getSummaryByScene(sceneId, startTime, endTime) |
| | | } |
| | | } |
| | |
| | | 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 cn.flightfeather.supervision.lightshare.service.UserinfoService |
| | | import cn.flightfeather.supervision.lightshare.service.* |
| | | import cn.flightfeather.supervision.lightshare.vo.* |
| | | import org.springframework.beans.BeanUtils |
| | | import org.springframework.beans.factory.annotation.Autowired |
| | |
| | | import kotlin.collections.ArrayList |
| | | |
| | | @Service |
| | | class TaskServiceImpl(val taskMapper: TaskMapper, private val taskRep: TaskRep,) : TaskService { |
| | | class TaskServiceImpl( |
| | | val taskMapper: TaskMapper, |
| | | private val taskRep: TaskRep, |
| | | ) : TaskService { |
| | | |
| | | @Autowired |
| | | lateinit var subtaskService: SubtaskService |
| | |
| | | override fun findTask(areaVo: AreaVo): List<Task?> { |
| | | return taskRep.findTasks(areaVo) |
| | | } |
| | | |
| | | override fun findTaskProgress(areaVo: AreaVo): List<TaskProgressVo?> { |
| | | val res = mutableListOf<TaskProgressVo?>() |
| | | taskRep.findTasks(areaVo).forEach {t-> |
| | | if (t?.tguid == null) return@forEach |
| | | val pro = TaskProgressVo().apply { |
| | | tguid = t.tguid |
| | | name = t.name |
| | | levelnum = t.levelnum |
| | | provinceCode = t.provincecode |
| | | provinceName = t.provincename |
| | | cityCode = t.citycode |
| | | cityName = t.cityname |
| | | districtCode = t.districtcode |
| | | districtName = t.districtname |
| | | townCode = t.towncode |
| | | townName = t.townname |
| | | var count = 0 |
| | | taskRep.findMonitorList(t.tguid!!, areaVo.scensetypeid).forEach { |
| | | val c = if (it.extension1 != null) it.extension1!!.toInt() else 1 |
| | | count += c |
| | | } |
| | | totaltask = count |
| | | completetask = subtaskService.getSummary(t.tguid!!, areaVo.scensetypeid?.toIntOrNull()).size |
| | | } |
| | | res.add(pro) |
| | | } |
| | | return res |
| | | } |
| | | } |
| | |
| | | package cn.flightfeather.supervision.lightshare.service.impl |
| | | |
| | | import cn.flightfeather.supervision.business.autooutput.dataanalysis.AopDataDeviceMap |
| | | import cn.flightfeather.supervision.common.exception.ResponseErrorException |
| | | import cn.flightfeather.supervision.common.utils.Constant |
| | | import cn.flightfeather.supervision.common.exception.BizException |
| | | import cn.flightfeather.supervision.common.utils.UUIDGenerator |
| | | import cn.flightfeather.supervision.domain.ds1.entity.Scense |
| | | import cn.flightfeather.supervision.domain.ds1.entity.Userinfo |
| | | import cn.flightfeather.supervision.domain.ds1.mapper.UserinfoMapper |
| | | import cn.flightfeather.supervision.domain.ds1.repository.SceneRep |
| | |
| | | import cn.flightfeather.supervision.domain.ds2.mapper.UserMapMapper |
| | | import cn.flightfeather.supervision.domain.ds2.mapper.UserinfoTZMapper |
| | | import cn.flightfeather.supervision.domain.ds2.repository.UserInfoTZRep |
| | | import cn.flightfeather.supervision.domain.ds2.repository.UserMapRep |
| | | import cn.flightfeather.supervision.lightshare.service.UserMapService |
| | | import cn.flightfeather.supervision.lightshare.service.UserinfoService |
| | | import cn.flightfeather.supervision.lightshare.vo.AreaVo |
| | | import cn.flightfeather.supervision.lightshare.vo.DeviceMapVo |
| | | import org.springframework.stereotype.Service |
| | | import tk.mybatis.mapper.entity.Example |
| | | import java.util.* |
| | | |
| | | @Service |
| | | class UserMapServiceImpl( |
| | |
| | | private val taskRep: TaskRep, |
| | | private val userInfoSVRep: UserInfoSVRep, |
| | | private val userInfoTZRep: UserInfoTZRep, |
| | | private val userMapRep: UserMapRep, |
| | | private val aopDataDeviceMap: AopDataDeviceMap, |
| | | ) : UserMapService { |
| | | |
| | | override fun getTZIdBySceneId(sceneId: String): UserMap { |
| | | val list = userInfoSVRep.findUser(sceneId) |
| | | if (list.isEmpty()) return UserMap() |
| | | val userId = list[0]?.guid |
| | | val user = userInfoSVRep.findUser(sceneId) |
| | | val userId = user?.guid |
| | | val result = userMapMapper.selectByExample(Example(UserMap::class.java).apply { |
| | | createCriteria().andEqualTo("svUserId", userId) |
| | | }) |
| | | return if (result.isNotEmpty()) result[0] else UserMap() |
| | | } |
| | | |
| | | override fun getSceneByTZId(tzUserId: String): Scense? { |
| | | return userMapRep.findFromSupervision(tzUserId) |
| | | } |
| | | |
| | | override fun autoCreateMap() { |
| | | // éæ©éè¦å¤ççè´¦æ· |
| | | val userList = userinfoMapper.selectByExample(Example(Userinfo::class.java).apply { |
| | | createCriteria().andEqualTo("remark", "éå®åº") |
| | | createCriteria().andEqualTo("remark", "徿±åº") |
| | | }) |
| | | userList.forEach { |
| | | // æ¥æ¾æ¯å¦å·²ç»æè´¦æ·å¹é
è®°å½ |
| | |
| | | tzUserName = id |
| | | svUserId = it.guid |
| | | svUserName = it.realname |
| | | umCreateTime = Date() |
| | | }) |
| | | } |
| | | } |
| | |
| | | } |
| | | //以é£ç¾½ç管系ç»ä¸çç¨æ·ä¸ºä¸»ä½ |
| | | 2 -> { |
| | | val task = taskRep.findOneTask(areaVo) ?: throw ResponseErrorException("å½åæ¥è¯¢æ¡ä»¶ä¸æªæ¾å°å¯¹åºé¡¶å±ä»»å¡") |
| | | val task = taskRep.findOneTask(areaVo) ?: throw BizException("å½åæ¥è¯¢æ¡ä»¶ä¸æªæ¾å°å¯¹åºé¡¶å±ä»»å¡") |
| | | val scenes = sceneRep.findScene(task.tguid!!, areaVo.scensetypeid?.toInt(), areaVo.towncode) |
| | | .map { it?.guid } |
| | | userInfoSVRep.findUser(scenes).map { it?.guid } |
| | |
| | | package cn.flightfeather.supervision.lightshare.service.impl |
| | | |
| | | import cn.flightfeather.supervision.common.utils.Constant |
| | | import cn.flightfeather.supervision.common.utils.PinYin |
| | | import cn.flightfeather.supervision.common.utils.UUIDGenerator |
| | | import cn.flightfeather.supervision.domain.ds1.entity.Scense |
| | |
| | | import cn.flightfeather.supervision.domain.ds1.repository.SceneRep |
| | | import cn.flightfeather.supervision.domain.ds1.repository.TaskRep |
| | | import cn.flightfeather.supervision.domain.ds1.repository.UserInfoSVRep |
| | | import cn.flightfeather.supervision.domain.ds2.entity.UserinfoTZ |
| | | import cn.flightfeather.supervision.domain.ds2.repository.UserInfoTZRep |
| | | import cn.flightfeather.supervision.lightshare.service.UserinfoService |
| | | import cn.flightfeather.supervision.lightshare.vo.AreaVo |
| | | import org.springframework.beans.BeanUtils |
| | | import org.springframework.stereotype.Service |
| | | import tk.mybatis.mapper.entity.Example |
| | | import kotlin.random.Random |
| | |
| | | class UserinfoServiceImpl( |
| | | val userinfoMapper: UserinfoMapper, |
| | | private val scenseMapper: ScenseMapper, |
| | | private val userInfoSVRep: UserInfoSVRep, |
| | | private val userInfoTZRep: UserInfoTZRep, |
| | | ) : UserinfoService { |
| | | |
| | | //æ ¹æ®userinfoæ¡ä»¶æ¥è¯¢ |
| | |
| | | findByScene(sceneId)?.let { return it } |
| | | |
| | | scenseMapper.selectByPrimaryKey(sceneId)?.let { |
| | | val sceneName = it.name ?: return Userinfo() |
| | | val uName = getUName(sceneName) |
| | | |
| | | val userInfo = Userinfo().apply { |
| | | guid = UUIDGenerator.generate16ShortUUID() |
| | | acountname = uName |
| | | realname = sceneName |
| | | password = "123456" |
| | | usertypeid = 3 |
| | | usertype = "ä¼ä¸" |
| | | dGuid = it.guid |
| | | departmentname = sceneName |
| | | isenable = true |
| | | remark = it.districtname |
| | | } |
| | | |
| | | val r = userinfoMapper.insert(userInfo) |
| | | if (r == 1) { |
| | | return userInfo |
| | | } |
| | | createAccount(it) |
| | | } |
| | | return Userinfo() |
| | | } |
| | |
| | | return null |
| | | } |
| | | |
| | | private fun getUName(sceneName: String): String { |
| | | override fun getUName(sceneName: String): String { |
| | | var uName = PinYin.getPinYinHeader(sceneName) |
| | | var suffix = "" |
| | | var repeated: Boolean |
| | |
| | | } |
| | | } |
| | | |
| | | private fun createAccount(scence: Scense) { |
| | | override fun createAccount(scence: Scense):Userinfo { |
| | | scence.let { |
| | | val sceneName = it.name ?: return |
| | | val uName = getUName(sceneName) |
| | | // å¤æè¯¥åºæ¯æ¯å¦å·²æå¯¹åºè´¦æ· |
| | | val user = userInfoSVRep.findUser(it.guid) |
| | | if (user != null) return Userinfo() |
| | | |
| | | val sceneName = it.name ?: return Userinfo() |
| | | val uName = getUName(sceneName) |
| | | val userInfo = Userinfo().apply { |
| | | guid = UUIDGenerator.generate16ShortUUID() |
| | | acountname = uName |
| | |
| | | |
| | | val r = userinfoMapper.insert(userInfo) |
| | | if (r == 1) { |
| | | println("${userInfo.guid}--${userInfo.acountname}--${userInfo.realname}") |
| | | return userInfo |
| | | } else { |
| | | return Userinfo() |
| | | } |
| | | } |
| | | } |
| | | |
| | | override fun createAccountTZ(userinfo: Userinfo, scence: Scense): UserinfoTZ { |
| | | val userinfoTZ = UserinfoTZ() |
| | | BeanUtils.copyProperties(userinfo, userinfoTZ) |
| | | // ä½¿ç¨æ°çid |
| | | userinfoTZ.guid = UUIDGenerator.generate16ShortUUID() |
| | | // æ·»å åºå¿æè¿° |
| | | // FIXME: 2024/4/23 ç®åå¨BaseInfoåºç¡ä¿¡æ¯ä¸å·²åå¨å®æ´çè¡æ¿åºåï¼åç»åºå°æ¤å¤è®°å½å»é¤ |
| | | userinfoTZ.extension1 = userinfoTZ.remark |
| | | userinfoTZ.remark = null |
| | | // åºæ¯ç±»åè½¬æ¢ |
| | | userinfoTZ.extension2 = Constant.SceneType.typeMap(scence.typeid)?.toString() |
| | | // æ ¹æ®acountnameårealnameè¿è¡éå¤å¤æ |
| | | userInfoTZRep.findOne(UserinfoTZ().apply { |
| | | acountname = userinfoTZ.acountname |
| | | realname = userinfoTZ.realname |
| | | }).takeIf { it == null }.run { |
| | | // 彿²¡ææ¥è¯¢ç»ææ¶ï¼æå
¥æ°è´¦æ·ä¿¡æ¯ |
| | | userInfoTZRep.insert(userinfoTZ) |
| | | } |
| | | return userinfoTZ |
| | | } |
| | | } |
| | |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | var endtime: LocalDateTime? = null |
| | | |
| | | // åºæ¯id |
| | | var sceneId: String? = null |
| | | // åºæ¯åç§° |
| | | var sceneName: String? = null |
| | | // åºæ¯ç±»å |
| | |
| | | |
| | | // ä¸»æ°æ®æºï¼1ï¼ä»¥é£ç¾½ç¯å¢ç³»ç»ä¸çç¨æ·ä¸ºä¸»ä½ï¼2ï¼ä»¥é£ç¾½ç管系ç»ä¸çç¨æ·ä¸ºä¸»ä½ |
| | | var sourceType:Int = 1 |
| | | |
| | | // æ¥è¯¢æåº |
| | | var sort:String? = "asc" |
| | | var sortBy: String? = null |
| | | } |
| | |
| | | return res |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®è®¾å¤mnç¼ç æ¾å°å¯¹åºå
³ç³» |
| | | */ |
| | | fun List<DeviceMapVo>.findByDeviceCode(code: String?): DeviceMapVo? { |
| | | this.forEach { |
| | | if (it.deviceCode == code) { |
| | | return it |
| | | } |
| | | } |
| | | return null |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®é£ç¾½ç管系ç»ç¨æ·idæ¾å°å¯¹åºå
³ç³» |
| | | */ |
| | | fun List<DeviceMapVo>.findBySVUserId(svUserId: String?): List<DeviceMapVo> { |
| | | val res = mutableListOf<DeviceMapVo>() |
| | | this.forEach { |
| | | if (it.svUserId == svUserId) { |
| | | res.add(it) |
| | | } |
| | | } |
| | | return res |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package cn.flightfeather.supervision.lightshare.vo |
| | | |
| | | import cn.flightfeather.supervision.domain.ds2.entity.DustSiteInfo |
| | | import cn.flightfeather.supervision.domain.ds3.entity.JSDustSiteInfo |
| | | import java.util.* |
| | | |
| | | /** |
| | | * çæµè®¾å¤ä¿¡æ¯ |
| | | */ |
| | | class DeviceSiteVo { |
| | | |
| | | var id: Int? = null |
| | | var mnCode: String? = null |
| | | var address: String? = null |
| | | var name: String? = null |
| | | var code: String? = null |
| | | var beginDate: Date? = null |
| | | var endDate: Date? = null |
| | | var dutyCompanyId: String? = null |
| | | var dutyCompany: String? = null |
| | | var engineeringStage: String? = null |
| | | var groupId: String? = null |
| | | var groupName: String? = null |
| | | var isOnline: Boolean? = null |
| | | var isTrouble: Boolean? = null |
| | | var kindex: Double? = null |
| | | var longitude: Double? = null |
| | | var latitude: Double? = null |
| | | var linkman: String? = null |
| | | var phone: String? = null |
| | | var province: String? = null |
| | | var ringId: String? = null |
| | | var ringName: String? = null |
| | | var typeId: String? = null |
| | | var typename: String? = null |
| | | var buildArea: String? = null |
| | | |
| | | companion object { |
| | | /** |
| | | * éè¿éå®åºçæµç¹ä½ä¿¡æ¯è½¬æ¢ |
| | | */ |
| | | fun fromJADustSiteInfo(list: List<DustSiteInfo?>): List<DeviceSiteVo> { |
| | | val res = mutableListOf<DeviceSiteVo>() |
| | | list.forEach { |
| | | it ?: return@forEach |
| | | res.add(DeviceSiteVo().apply { |
| | | id = it.id?.toIntOrNull() |
| | | mnCode = it.mnCode |
| | | address = it.address |
| | | name = it.name |
| | | code = it.code |
| | | beginDate = it.beginDate |
| | | endDate = it.endDate |
| | | dutyCompanyId = it.dutyCompanyId |
| | | dutyCompany = it.dutyCompany |
| | | engineeringStage = it.engineeringStage |
| | | groupId = it.groupId |
| | | groupName = it.groupName |
| | | isOnline = it.isOnline?.toBoolean() |
| | | isTrouble = it.isTrouble?.toBoolean() |
| | | kindex = it.kindex?.toDoubleOrNull() |
| | | longitude = it.longitude?.toDoubleOrNull() |
| | | latitude = it.latitude?.toDoubleOrNull() |
| | | linkman = it.linkman |
| | | phone = it.phone |
| | | province = it.province |
| | | ringId = it.ringId |
| | | // ringName = it.ringName |
| | | typeId = it.typeId |
| | | typename = it.typename |
| | | buildArea = it.buildArea |
| | | }) |
| | | } |
| | | return res |
| | | } |
| | | |
| | | /** |
| | | * éè¿éå±±åºçæµç¹ä½ä¿¡æ¯è½¬æ¢ |
| | | */ |
| | | fun fromJSDustSiteInfo(list: List<JSDustSiteInfo?>): List<DeviceSiteVo> { |
| | | val res = mutableListOf<DeviceSiteVo>() |
| | | list.forEach { |
| | | it ?: return@forEach |
| | | res.add(DeviceSiteVo().apply { |
| | | id = it.id |
| | | mnCode = it.mnCode |
| | | address = it.address |
| | | name = it.name |
| | | code = it.code |
| | | beginDate = it.beginDate |
| | | endDate = it.endDate |
| | | dutyCompanyId = it.dutyCompanyId |
| | | dutyCompany = it.dutyCompany |
| | | engineeringStage = it.engineeringStage |
| | | groupId = it.groupId |
| | | groupName = it.groupName |
| | | isOnline = it.isOnline?.toBoolean() |
| | | isTrouble = it.isTrouble?.toBoolean() |
| | | kindex = it.kindex?.toDoubleOrNull() |
| | | longitude = it.longitude?.toDoubleOrNull() |
| | | latitude = it.latitude?.toDoubleOrNull() |
| | | linkman = it.linkman |
| | | phone = it.phone |
| | | province = it.province |
| | | ringId = it.ringId |
| | | ringName = it.ringName |
| | | typeId = it.typeId |
| | | typename = it.typename |
| | | buildArea = it.buildArea |
| | | }) |
| | | } |
| | | return res |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®è®¾å¤mnç¼ç æ¾å°è®¾å¤ä¿¡æ¯ |
| | | */ |
| | | fun List<DeviceSiteVo>.findByMNCode(mnCode: String?): DeviceSiteVo? { |
| | | this.forEach { |
| | | if (it.mnCode == mnCode) { |
| | | return it |
| | | } |
| | | } |
| | | return null |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package cn.flightfeather.supervision.lightshare.vo |
| | | |
| | | /** |
| | | * è¯åè§ååå¾å |
| | | */ |
| | | class EvaluationVo { |
| | | //è§åid |
| | | var id: String? = null |
| | | //è§åæè¿° |
| | | var title1: String? = null |
| | | //åå¼ |
| | | var score: Int = 0 |
| | | //æ¯å¦éä¸ |
| | | var select: Boolean = false |
| | | //basic_score: åºç¡åï¼å¿
éï¼addition_scoreï¼éå åï¼å¯éï¼nullï¼é»è®¤åºç¡å |
| | | var scoreMode: String? = "basic_score" |
| | | //minus_mode: å忍¡å¼ï¼add_modeï¼å 忍¡å¼ï¼nullï¼ä¸å设å®ï¼è¯´æå
¶å项䏿¯å
·ä½çè¯ä¼°ç»å |
| | | var gradeMode: String? = "minus_mode" |
| | | //single_mode: å鿍¡å¼ï¼multi_modeï¼å¤é模å¼ï¼nullï¼ä¸å设å®ï¼è¯´æå
¶å项䏿¯å
·ä½çè¯ä¼°ç»å |
| | | var selectMode: String? = "single_mode" |
| | | //äºçº§åè§å |
| | | var sub1: MutableList<SubEvaluationVo> = mutableListOf() |
| | | } |
| | | |
| | | class SubEvaluationVo { |
| | | //ææ¶åä¸çº§çè§åä¸é¢ç´æ¥æ¯ä¸çº§è§åï¼æ²¡æäºçº§è§åï¼å æ¤æ¤æ¶çäºçº§è§ååªæ¯ä¸ºäºç»æå®æ´æ§èåºç°ç |
| | | var placeholder: Boolean = false |
| | | //è§åid |
| | | var id: String? = null |
| | | //è§åæè¿° |
| | | var title2: String? = null |
| | | //åå¼ |
| | | var score: Int = 0 |
| | | //æ¯å¦éä¸ |
| | | var select: Boolean = false |
| | | //minus_mode: å忍¡å¼ï¼add_modeï¼å 忍¡å¼ï¼ |
| | | var gradeMode: String? = "minus_mode" |
| | | //single_mode: å鿍¡å¼ï¼multi_modeï¼å¤é模å¼ï¼ |
| | | var selectMode: String? = "single_mode" |
| | | //äºçº§è§ååç» |
| | | var group: Int? = null |
| | | //ä¸çº§åè§å |
| | | var sub2: MutableList<ThirdEvaluationVo> = mutableListOf() |
| | | } |
| | | |
| | | class ThirdEvaluationVo { |
| | | //è§åid |
| | | var id: String? = null |
| | | //è§åæè¿° |
| | | var content: String? = null |
| | | //åå¼ |
| | | var score: Int = 0 |
| | | //æ¯å¦éä¸ |
| | | var select: Boolean = false |
| | | } |
| | |
| | | package cn.flightfeather.supervision.lightshare.vo |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat |
| | | import com.fasterxml.jackson.annotation.JsonInclude |
| | | import org.apache.xpath.operations.Bool |
| | | import java.time.LocalDateTime |
| | | import java.util.* |
| | | |
| | | @JsonInclude(JsonInclude.Include.NON_NULL) |
| | | class InspectionInfoVo { |
| | |
| | | //æ¯å¦å·²ç管 |
| | | var inspected: Boolean? = null |
| | | //ç管æ¶é´ |
| | | var inspectionTime: String? = null |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | var inspectionTime: Date? = null |
| | | //çç®¡æ¬¡æ° |
| | | var inspectionTimes: Int? = null |
| | | //æ¯å¦æ¿è¯º |
| | |
| | | var subScene: BaseScene? = null, |
| | | //åºæ¯çæµè®¾å¤ä¿¡æ¯ |
| | | @ApiModelProperty("åºæ¯çæµè®¾å¤ä¿¡æ¯") |
| | | var sceneDevice: SceneDevice? = null |
| | | var sceneDevice: SceneDevice? = null, |
| | | ) |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package cn.flightfeather.supervision.lightshare.vo |
| | | |
| | | import cn.flightfeather.supervision.domain.ds1.entity.Scense |
| | | |
| | | /** |
| | | * åºæ¯å对åºçæµç¹ä½ä¿¡æ¯ |
| | | */ |
| | | class SceneDeviceVo { |
| | | var scene: Scense? = null |
| | | var deviceList: MutableList<DeviceSiteVo?> = mutableListOf() |
| | | } |
| | | |
| | | fun List<SceneDeviceVo>.tableHeadScene(): List<Array<Any>> { |
| | | return listOf(arrayOf( |
| | | "åºæ¯ç¼å·", "åç§°", "ç±»å", "å°å", "åºå¿", "è¡é", "è系人", "çµè¯", "å建æ¶é´", |
| | | )) |
| | | } |
| | | |
| | | fun List<SceneDeviceVo>.tableHeadDevice(): List<Array<Any>> { |
| | | return listOf(arrayOf( |
| | | "çæµç¹ç¼å·", "MNç¼ç ", "ç¹ä½åç§°", "å°å", "å¼å·¥æ¶é´", "è¿ç»´å", "åºå¿", |
| | | )) |
| | | } |
| | | |
| | | fun List<SceneDeviceVo>.tableHead(): List<Array<Any>> { |
| | | val a = this.tableHeadScene()[0].toMutableList() |
| | | val b = this.tableHeadDevice()[0].toList() |
| | | a.addAll(b) |
| | | return listOf(a.toTypedArray()) |
| | | } |
| | | |
| | | fun List<SceneDeviceVo>.tableContent(): MutableList<Array<Any>> { |
| | | val contents = mutableListOf<Array<Any>>() |
| | | this.forEach { s -> |
| | | val deviceList = s.deviceList |
| | | val scene = s.scene |
| | | deviceList.forEach each@ { |
| | | it ?: return@each |
| | | val content = mutableListOf<Any>() |
| | | content.addAll(listOf(scene?.index ?: "", scene?.name ?: "", scene?.type ?: "", scene?.location ?: "", |
| | | scene?.districtname ?: "", scene?.townname ?: "", scene?.contacts ?: "", scene?.contactst ?: "", |
| | | scene?.createdate ?: "")) |
| | | content.addAll(listOf(it.id ?: "", it.mnCode ?: "", it.name ?: "", it.address ?: "", it.beginDate ?: "", it |
| | | .dutyCompany ?: "", it.groupName ?: "")) |
| | | contents.add(content.toTypedArray()) |
| | | } |
| | | if (contents.isEmpty()) { |
| | | contents.add(arrayOf(scene?.index ?: "", scene?.name ?: "", scene?.type ?: "", scene?.location ?: "", |
| | | scene?.districtname ?: "", scene?.townname ?: "", scene?.contacts ?: "", scene?.contactst ?: "", |
| | | scene?.createdate ?: "")) |
| | | } |
| | | } |
| | | return contents |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package cn.flightfeather.supervision.lightshare.vo |
| | | |
| | | import cn.flightfeather.supervision.domain.ds1.entity.Scense |
| | | import cn.flightfeather.supervision.domain.ds1.entity.Subtask |
| | | |
| | | /** |
| | | * åºæ¯é®é¢ç»è®¡ |
| | | */ |
| | | class SceneProblemSummary { |
| | | var sceneId: String? = null |
| | | |
| | | // åºæ¯ä¿¡æ¯ |
| | | var scene: Scense? = null |
| | | |
| | | var subtasks: List<Subtask>? = null |
| | | |
| | | // é®é¢æ° |
| | | var proNum = 0 |
| | | |
| | | // æ´æ¹æ° |
| | | var changeNum = 0 |
| | | |
| | | var changePer: Double = 0.0 |
| | | } |
| | |
| | | package cn.flightfeather.supervision.lightshare.vo |
| | | |
| | | import cn.flightfeather.supervision.domain.ds1.entity.Scense |
| | | import com.fasterxml.jackson.annotation.JsonInclude |
| | | import java.math.BigDecimal |
| | | import java.util.* |
| | |
| | | var monitorNum: Int = 0 |
| | | |
| | | var inspectedNum: Int = 0 |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®åºæ¯idæ¾å°åºæ¯ |
| | | */ |
| | | fun List<Scense?>.findByGuid(guid: String?): Scense? { |
| | | this.forEach { |
| | | if (it?.guid == guid) { |
| | | return it |
| | | } |
| | | } |
| | | return null |
| | | } |
| | |
| | | var sceneName: String? = null |
| | | var sceneType: String? = null |
| | | var stPlanTime: Date? = null |
| | | var stStatus:String? = null |
| | | |
| | | var proNum = 0 |
| | | var changeNum = 0 |
| | |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonInclude |
| | | |
| | | /** |
| | | * ä»»å¡å®ææ
åµç»è®¡ |
| | | */ |
| | | @JsonInclude(JsonInclude.Include.NON_NULL) |
| | | class TaskProgressVo{ |
| | | |
| | | // ä»»å¡id |
| | | var tguid: String? = null |
| | | |
| | | // ä»»å¡åç§° |
| | | var name: String? = null |
| | | |
| | | // ä»»å¡ç级(2:æ»ä»»å¡ï¼nullï¼æ¥ä»»å¡æåä»»å¡) |
| | | var levelnum: Int? = null |
| | | |
| | | var provinceCode: String? = null |
| | | var provinceName: String? = null |
| | | var cityCode: String? = null |
| | | var cityName: String? = null |
| | | var districtCode: String? = null |
| | | var districtName: String? = null |
| | | var townCode: String? = null |
| | | var townName: String? = null |
| | | |
| | | var totaltask:Int? = null |
| | | |
| | |
| | | |
| | | var mycompletetask:Int? = null |
| | | |
| | | var subtaskprogressVo = mutableListOf<TaskProgressVo>() |
| | | var subtaskprogressVo: List<TaskProgressVo>? = null |
| | | |
| | | var subTaskSummary: List<SubTaskSummary>? = null |
| | | } |
| | |
| | | package cn.flightfeather.supervision.lightshare.web |
| | | |
| | | import cn.flightfeather.supervision.common.exception.ResponseErrorException |
| | | import cn.flightfeather.supervision.common.exception.BizException |
| | | import cn.flightfeather.supervision.lightshare.vo.BaseResponse |
| | | import cn.flightfeather.supervision.lightshare.vo.DataHead |
| | | |
| | |
| | | } else { |
| | | BaseResponse(true, data = res) |
| | | } |
| | | } catch (e: ResponseErrorException) { |
| | | } catch (e: BizException) { |
| | | BaseResponse(false, message = e.message ?: "") |
| | | } |
| | | } |
| | |
| | | package cn.flightfeather.supervision.lightshare.web |
| | | |
| | | import cn.flightfeather.supervision.common.executor.BgTaskConditionVo |
| | | import cn.flightfeather.supervision.common.executor.BgTaskStatus |
| | | import cn.flightfeather.supervision.lightshare.service.BgTaskService |
| | | import io.swagger.annotations.Api |
| | | import io.swagger.annotations.ApiOperation |
| | |
| | | |
| | | @ApiOperation(value = "ä¸è½½èªå¨è¯ä¼°ç»æ") |
| | | @PostMapping("/auto/record/download") |
| | | fun downloadAutoEvaluation(@RequestBody areaVo: AreaVo, @ApiIgnore response: HttpServletResponse) = |
| | | resPack { evaluationService.downloadAutoEvaluation(areaVo, response) } |
| | | fun downloadAutoEvaluation( |
| | | @RequestBody areaVo: AreaVo, @RequestParam forceUpdate: Boolean, |
| | | @ApiIgnore response: HttpServletResponse, |
| | | ) = resPack { evaluationService.downloadAutoEvaluation(areaVo, forceUpdate, response) } |
| | | } |
| | |
| | | @ApiParam("åºæ¯ç±»åid") @RequestParam("sceneTypeId") sceneTypeId: String, |
| | | @ApiParam(value = "è¯åè¡¨çæ¬ï¼ æ ¼å¼ yyyy-MM, é»è®¤è·åææ°çæ¬") @RequestParam("version") version: String? |
| | | ) = evaluationsubruleService.search(districtCode, sceneTypeId, version) |
| | | |
| | | @ApiOperation(value = "æ¥æ¾å·¡æ¥ä»»å¡èªå¨è¯ä¼°çè¯åç»è") |
| | | @GetMapping("/score") |
| | | fun getAutoScore( |
| | | @ApiParam(value = "å·¡æ¥ä»»å¡id") @RequestParam subTaskId: String, |
| | | ) = resPack { evaluationsubruleService.getAutoScore(subTaskId) } |
| | | } |
| | |
| | | package cn.flightfeather.supervision.lightshare.web |
| | | |
| | | import cn.flightfeather.supervision.common.exception.BizException |
| | | import cn.flightfeather.supervision.domain.ds1.entity.Inspection |
| | | import cn.flightfeather.supervision.lightshare.service.InspectionService |
| | | import cn.flightfeather.supervision.lightshare.vo.AreaVo |
| | | import cn.flightfeather.supervision.lightshare.vo.BaseResponse |
| | | import io.swagger.annotations.Api |
| | | import io.swagger.annotations.ApiOperation |
| | | import io.swagger.annotations.ApiParam |
| | |
| | | @Api(tags = ["InspectionController"], description = "å·¡æ¥ä¿¡æ¯APIæ¥å£") |
| | | @RestController |
| | | @RequestMapping("/inspection") |
| | | class InspectionController (val inspectionService: InspectionService){ |
| | | class InspectionController(val inspectionService: InspectionService) { |
| | | @GetMapping |
| | | fun getAll() = inspectionService.findAll() |
| | | |
| | |
| | | fun update(@RequestBody inspection: Inspection) = inspectionService.update(inspection) |
| | | |
| | | @GetMapping("/{id}") |
| | | fun getById(@PathVariable id:String) = inspectionService.findByID(id) |
| | | fun getById(@PathVariable id: String) = inspectionService.findByID(id) |
| | | |
| | | @GetMapping("/{id}/problemlist") |
| | | fun findProblemListById(@PathVariable id:String) = inspectionService.findProblemListById(id) |
| | | fun findProblemListById(@PathVariable id: String) = inspectionService.findProblemListById(id) |
| | | |
| | | @GetMapping("/{id}/gitlist") |
| | | fun findGitListById(@PathVariable id:String) = inspectionService.findGitListById(id) |
| | | fun findGitListById(@PathVariable id: String) = inspectionService.findGitListById(id) |
| | | |
| | | @GetMapping("/{id}/{date}/lastproblemlist") |
| | | fun findLastProblemListById(@PathVariable id:String,@PathVariable date:String) = inspectionService.findLastProblemListBySenceId(id,date) |
| | | fun findLastProblemListById(@PathVariable id: String, @PathVariable date: String) = |
| | | inspectionService.findLastProblemListBySenceId(id, date) |
| | | |
| | | @GetMapping("/find/{id}") |
| | | fun findBySubTaskID(@PathVariable id:String) = inspectionService.findBySubTaskID(id) |
| | | fun findBySubTaskID(@PathVariable id: String) = inspectionService.findBySubTaskID(id) |
| | | |
| | | @DeleteMapping("/{id}") |
| | | fun delete (@PathVariable id: String) = inspectionService.delete(id) |
| | | fun delete(@PathVariable id: String) = inspectionService.delete(id) |
| | | |
| | | @GetMapping("/getInspectionInfoByScene") |
| | | fun getInspectionInfoByScene(@RequestParam(value = "sceneId", required = true)sceneId:String, @RequestParam(value = "topTaskId", required = true)topTaskId:String) |
| | | = inspectionService.getInspectionInfoByScene(sceneId, topTaskId) |
| | | fun getInspectionInfoByScene( |
| | | @RequestParam(value = "sceneId", required = true) sceneId: String, |
| | | @RequestParam(value = "topTaskId", required = true) topTaskId: String, |
| | | ) = inspectionService.getInspectionInfoByScene(sceneId, topTaskId) |
| | | |
| | | @ApiOperation(value = "è·åæä¸ªæ»ä»»å¡ä¸æåºæ¯çç»è®¡ä¿¡æ¯", notes = "å
æ¬åºæ¯åºæ¬ä¿¡æ¯ãè¯åãå
·ä½é®é¢ç") |
| | | @GetMapping("/statistic") |
| | | @PostMapping("/statistic") |
| | | fun getStatistic( |
| | | @ApiParam("æ»ä»»å¡id") @RequestParam("topTaskId") topTaskId: String, |
| | | @ApiParam("åºæ¯ç±»åid") @RequestParam("sceneTypeId") sceneTypeId: String |
| | | ) = inspectionService.getStatistic(topTaskId, sceneTypeId) |
| | | @ApiParam("æ»ä»»å¡id") @RequestParam(required = false) topTaskId: String?, |
| | | @ApiParam("åºæ¯ç±»åid") @RequestParam(required = false) sceneTypeId: String?, |
| | | @ApiParam("åºåæ¡ä»¶") @RequestBody(required = false) areaVo: AreaVo?, |
| | | ): BaseResponse<Any> { |
| | | return resPack { |
| | | if (topTaskId != null && sceneTypeId != null) { |
| | | inspectionService.getStatistic(topTaskId, sceneTypeId) |
| | | } else if (areaVo != null) { |
| | | inspectionService.getStatistic(areaVo) |
| | | } else { |
| | | throw BizException("缺失æ»ä»»å¡idååºåæ¡ä»¶ï¼è¯·éæ©ä¼ è¾å
¶ä¸ä¸ç§åæ°") |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | fun getByArea(@RequestBody areaVo: AreaVo): List<ProblemlistVo> = problemlistService.getByArea(areaVo) |
| | | |
| | | @GetMapping("/getbytoptask") |
| | | fun getByTopTask(@RequestParam(value = "tguid", required = true) tguid: String): List<ProblemlistVo> = problemlistService.getByTopTask(tguid) |
| | | fun getByTopTask(@RequestParam(value = "tguid", required = true) tguid: String): List<ProblemlistVo> = |
| | | problemlistService.getByTopTask(tguid) |
| | | |
| | | @PostMapping("/getStatisticalResult") |
| | | fun getStatisticalResult(@RequestBody areaVo: AreaVo): List<StatisticsVo> = problemlistService.getStatisticalResult(areaVo) |
| | | fun getStatisticalResult(@RequestBody areaVo: AreaVo): List<StatisticsVo> = |
| | | problemlistService.getStatisticalResult(areaVo) |
| | | |
| | | @PostMapping("/getStatisticalResultById") |
| | | fun getStatisticalResult(@RequestParam(value = "id", required = true) topTaskId: String, |
| | | @RequestParam(value = "curSceneTypeId", required = true) sceneTypeId: String): List<StatisticsVo> = problemlistService.getStatisticalResultById(topTaskId, sceneTypeId) |
| | | fun getStatisticalResult( |
| | | @RequestParam(value = "id", required = true) topTaskId: String, |
| | | @RequestParam(value = "curSceneTypeId", required = true) sceneTypeId: String, |
| | | ): List<StatisticsVo> = problemlistService.getStatisticalResultById(topTaskId, sceneTypeId) |
| | | |
| | | @PostMapping("/getChargeResult") |
| | | fun getChargeResult(@RequestBody areaVo: AreaVo): ChargeInfoVo = problemlistService.getChargeResult(areaVo) |
| | | |
| | | @GetMapping("/getProblemsByScene") |
| | | fun getProblemsByScene(@RequestParam(value = "sceneId", required = true) sceneId: String, @RequestParam date: String): List<ProblemlistVo> |
| | | = problemlistService.getProblemByScene(sceneId, date) |
| | | fun getProblemsByScene( |
| | | @RequestParam(value = "sceneId", required = true) sceneId: String, |
| | | @RequestParam date: String, |
| | | ): List<ProblemlistVo> = problemlistService.getProblemByScene(sceneId, date) |
| | | |
| | | @GetMapping("/month_anlysis") |
| | | fun getMonthProblemsById(@RequestParam(value = "taskId", required = true) taskId: String, |
| | | @RequestParam(value = "sceneType", required = false) sceneType: Int?): List<MonthProblemVo> = problemlistService.findMonthProblemById(taskId, sceneType) |
| | | fun getMonthProblemsById( |
| | | @RequestParam(value = "taskId", required = true) taskId: String, |
| | | @RequestParam(value = "sceneType", required = false) sceneType: Int?, |
| | | ): List<MonthProblemVo> = problemlistService.findMonthProblemById(taskId, sceneType) |
| | | |
| | | @ApiOperation(value = "对é®é¢è¿è¡å®¡æ ¸æä½", notes = "å
æ¬é®é¢çæäº¤å®¡æ ¸åæ´æ¹å®¡æ ¸ä¸¤ç§") |
| | | @PostMapping("/check") |
| | | fun checkProblem( |
| | | @ApiParam(value = "é®é¢id主é®") @RequestParam("pId") pId: String, |
| | | @ApiParam(value = "å®¡æ ¸æä½, 0: å®¡æ ¸éè¿ï¼1: å®¡æ ¸ä¸éè¿ï¼2: æ´æ¹éè¿ï¼3: æ´æ¹ä¸éè¿", allowableValues = "0,1,2,3") @RequestParam("action") action: Byte, |
| | | @ApiParam(value = "å®¡æ ¸å¤æ³¨") @RequestParam("remark") remark: String, |
| | | @ApiParam(value = "ç¨æ·id") @RequestParam("userId") userId: String, |
| | | @ApiParam(value = "ç¨æ·å") @RequestParam("userName") userName: String |
| | | @ApiParam(value = "é®é¢id主é®") @RequestParam("pId") pId: String, |
| | | @ApiParam(value = "å®¡æ ¸æä½, 0: å®¡æ ¸éè¿ï¼1: å®¡æ ¸ä¸éè¿ï¼2: æ´æ¹éè¿ï¼3: æ´æ¹ä¸éè¿", |
| | | allowableValues = "0,1,2,3") @RequestParam("action") action: Byte, |
| | | @ApiParam(value = "å®¡æ ¸å¤æ³¨") @RequestParam("remark") remark: String, |
| | | @ApiParam(value = "ç¨æ·id") @RequestParam("userId") userId: String, |
| | | @ApiParam(value = "ç¨æ·å") @RequestParam("userName") userName: String, |
| | | ) = problemlistService.check(pId, action, remark, userId, userName) |
| | | |
| | | @ApiOperation(value = "æ°å¢ä¸ä¸ªé®é¢", notes = "ç®åä¸ä¼ æéé®é¢ä¿¡æ¯ï¼å°å¤§é¨åæä½äº¤ç±åå°å®æ") |
| | | @PostMapping("/newProblem") |
| | | fun newProblem( |
| | | @RequestParam("problemVo") problemVo: String, |
| | | @RequestPart("images") files: Array<MultipartFile> |
| | | @RequestPart("images") files: Array<MultipartFile>, |
| | | ) = problemlistService.newProblem(problemVo, files) |
| | | |
| | | @ApiOperation(value = "æ´æ¹ä¸ä¸ªé®é¢", notes = "ç®åä¸ä¼ æéé®é¢ä¿¡æ¯ï¼å°å¤§é¨åæä½äº¤ç±åå°å®æ") |
| | | @PostMapping("/changeProblem") |
| | | fun changeProblem( |
| | | @RequestParam("problemId") problemId: String, |
| | | @RequestPart("images") files: Array<MultipartFile> |
| | | @RequestPart("images") files: Array<MultipartFile>, |
| | | ) = problemlistService.changeProblem(problemId, files) |
| | | |
| | | @ApiOperation(value = "éè¿ä»»å¡æ¥æ¾é®é¢", notes = "ç®åä¸ä¼ æéé®é¢ä¿¡æ¯ï¼å°å¤§é¨åæä½äº¤ç±åå°å®æ") |
| | | @ApiOperation(value = "éè¿ä»»å¡æ¥æ¾é®é¢") |
| | | @GetMapping("/subtask") |
| | | fun getBySubTask( |
| | | @RequestParam("stGuid") stGuid: String, |
| | | ) = problemlistService.getBySubTask(stGuid) |
| | | @ApiParam(value = "æ¯å¦è·åæªå®¡æ ¸åå®¡æ ¸ä¸éè¿çé®é¢") @RequestParam(required = false) all:Boolean? |
| | | ) = problemlistService.getBySubTask(stGuid, all) |
| | | |
| | | @ApiOperation(value = "æ¥æ¾åç°äºæç§é®é¢ç±»åçææå·¡æ¥åä»»å¡") |
| | | @PostMapping("/type/subtask") |
| | | fun getSceneByProType( |
| | | @RequestBody areaVo: AreaVo, |
| | | @RequestParam pType: String, |
| | | ) = resPack { problemlistService.getSceneByProType(areaVo, pType) } |
| | | |
| | | @ApiOperation(value = "æ¥è¯¢ææ»ä»»å¡ä¸ååºæ¯çé®é¢æ°éç»è®¡") |
| | | @PostMapping("/summary/scene") |
| | | fun getSceneProSummary( |
| | | @RequestBody areaVo: AreaVo, |
| | | @ApiParam(value = "æåºå段", allowableValues = "pro, changePer") @RequestParam sortBy: String, |
| | | @ApiParam(value = "页ç ") @RequestParam(value = "page") page: Int, |
| | | @ApiParam(value = "åé¡µæ°æ®é") @RequestParam(value = "per_page") perPage: Int, |
| | | ) = resPack { problemlistService.getSceneProSummary(areaVo, sortBy, page, perPage) } |
| | | } |
| | |
| | | import io.swagger.annotations.ApiImplicitParam |
| | | import io.swagger.annotations.ApiOperation |
| | | import org.springframework.web.bind.annotation.* |
| | | import org.springframework.web.multipart.MultipartFile |
| | | |
| | | @Api(tags = ["ScenseController"], description = "çç®¡åºæ¯APIæ¥å£") |
| | | @RestController |
| | |
| | | @RequestParam("lat") lat: Double, |
| | | @RequestParam("radius") radius: Double, |
| | | ) = resPack { scenseService.searchByCoordinate(lng, lat, radius) } |
| | | |
| | | @ApiOperation(value = "éè¿æä»¶å¯¼å
¥åºæ¯ä¿¡æ¯") |
| | | @PostMapping("/import") |
| | | fun importSceneInfo( |
| | | @RequestPart("file") file: MultipartFile, |
| | | ) = resPack { scenseService.importSceneInfo(file) } |
| | | |
| | | @ApiOperation(value = "åå»ºåºæ¯ä¿¡æ¯") |
| | | @PutMapping("/create") |
| | | fun createScene( |
| | | @RequestBody scense: Scense |
| | | ) = resPack { scenseService.createScene(scense) } |
| | | } |
| | |
| | | import cn.flightfeather.supervision.lightshare.service.SubtaskService |
| | | import cn.flightfeather.supervision.lightshare.vo.AreaVo |
| | | import cn.flightfeather.supervision.lightshare.vo.TaskVo |
| | | import com.fasterxml.jackson.annotation.JsonFormat |
| | | import io.swagger.annotations.Api |
| | | import io.swagger.annotations.ApiOperation |
| | | import org.springframework.format.annotation.DateTimeFormat |
| | | import org.springframework.web.bind.annotation.* |
| | | import java.time.LocalDateTime |
| | | |
| | | @Api(tags = ["SubtaskController"], description = "å·¡æ¥åä»»å¡APIæ¥å£") |
| | | @RestController |
| | |
| | | @RequestParam("topTaskId") topTaskId: String, |
| | | @RequestParam(value = "sceneTypeId", required = false) sceneTypeId: Int? |
| | | ) = subtaskService.getSummary(topTaskId, sceneTypeId) |
| | | |
| | | @ApiOperation("è·åæç±»åºæ¯çå·¡æ¥ä»»å¡ç»è®¡ä¿¡æ¯") |
| | | @PostMapping("/summary/area") |
| | | fun getSummaryByArea( |
| | | @RequestBody areaVo: AreaVo, |
| | | ) = subtaskService.getSummaryByArea(areaVo) |
| | | |
| | | @ApiOperation("è·åæä¸ªåºæ¯çå·¡æ¥ä»»å¡") |
| | | @GetMapping("/byScene") |
| | | fun getByScene( |
| | | @RequestParam sceneId: String, |
| | | @RequestParam(required = false) @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") startTime: LocalDateTime?, |
| | | @RequestParam(required = false) @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") endTime: LocalDateTime?, |
| | | ) = subtaskService.getByScene(sceneId, startTime, endTime) |
| | | } |
| | |
| | | import cn.flightfeather.supervision.lightshare.service.TaskService |
| | | 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 = ["TaskController"], description = "å·¡æ¥æ»ä»»å¡åæ¥ä»»å¡APIæ¥å£") |
| | |
| | | |
| | | @PostMapping("/find") |
| | | fun findTask(@RequestBody areaVo: AreaVo) = resPack { taskService.findTask(areaVo) } |
| | | |
| | | @ApiOperation(value = "è·åæ»ä»»å¡ç宿æ
åµ") |
| | | @PostMapping("/progress") |
| | | fun findTaskProgress(@RequestBody areaVo: AreaVo) = resPack { taskService.findTaskProgress(areaVo) } |
| | | } |
| | |
| | | |
| | | @ApiOperation(value = "æ ¹æ®é£ç¾½ç管系ç»ä¸çåºæ¯idï¼è·åä¸é£ç¾½ç¯å¢ç³»ç»ä¸çå
³èç¨æ·") |
| | | @GetMapping |
| | | fun getTZId(@RequestParam("sceneId") sceneId: String) = userMapService.getTZIdBySceneId(sceneId) |
| | | fun getTZId(@RequestParam sceneId: String) = userMapService.getTZIdBySceneId(sceneId) |
| | | |
| | | @ApiOperation(value = "æ ¹æ®é£ç¾½ç¯å¢ç³»ç»ä¸çç¨æ·idï¼è·åä¸é£ç¾½ç管系ç»ä¸çå
³èç¨æ·") |
| | | @GetMapping("/scene") |
| | | fun getSceneByTzId(@RequestParam tzUserId: String) = userMapService.getSceneByTZId(tzUserId) |
| | | |
| | | @ApiOperation(value = "è·ååºåç¨æ·ççæµè®¾å¤åé£ç¾½ç管系ç»ãé£ç¾½ç¯å¢ç³»ç»çå¹é
è®°å½") |
| | | @PostMapping("/device") |
| | |
| | | <result column="I_Remark" property="iRemark" jdbcType="VARCHAR" /> |
| | | </resultMap> |
| | | |
| | | <sql id="Base_Column_List" > |
| | | <!-- |
| | | WARNING - @mbg.generated |
| | | --> |
| | | I_GUID, ST_GUID, S_GUID, I_ScenseName, I_ScenseAddress, I_IsTogether, I_EntourageT, |
| | | I_EntourageWX, I_Entourage, I_ExecutionStartTime, I_ExecutionEndTime, I_ProblemCount, |
| | | I_IsRechecked, I_RecheckCount, I_PromissedNum, I_ChangedNum, I_IsChanged, I_IsRvaluated, |
| | | I_isPromissed, I_PromissedTime, I_PromissedUserGUID, I_PromissedUserName, I_PromissedUserRealName, |
| | | I_PromissedWay, I_PromissedDeadline, I_PromissBookPath, I_SignPath, I_Extension1, |
| | | I_Extension2, I_Extension3, I_Remark |
| | | </sql> |
| | | |
| | | <resultMap id="InspectionStatisticVo" type="cn.flightfeather.supervision.lightshare.vo.InspectionStatisticVo" > |
| | | <id column="MOV_DisplayID" property="index" jdbcType="INTEGER" /> |
| | | <result column="S_GUID" property="sceneId" jdbcType="VARCHAR" /> |
| | |
| | | <result column="problems" property="problem" jdbcType="VARCHAR" /> |
| | | </resultMap> |
| | | |
| | | <sql id="Base_Column_List" > |
| | | <!-- |
| | | WARNING - @mbg.generated |
| | | --> |
| | | I_GUID, ST_GUID, S_GUID, I_ScenseName, I_ScenseAddress, I_IsTogether, I_EntourageT, |
| | | I_EntourageWX, I_Entourage, I_ExecutionStartTime, I_ExecutionEndTime, I_ProblemCount, |
| | | I_IsRechecked, I_RecheckCount, I_PromissedNum, I_ChangedNum, I_IsChanged, I_IsRvaluated, |
| | | I_isPromissed, I_PromissedTime, I_PromissedUserGUID, I_PromissedUserName, I_PromissedUserRealName, |
| | | I_PromissedWay, I_PromissedDeadline, I_PromissBookPath, I_SignPath, I_Extension1, |
| | | I_Extension2, I_Extension3, I_Remark |
| | | </sql> |
| | | <resultMap id="InspectionInfoVo" type="cn.flightfeather.supervision.lightshare.vo.InspectionInfoVo" > |
| | | <id column="inspectionId" property="inspectionId" /> |
| | | <result column="topTaskid" property="topTaskid"/> |
| | | <result column="topTaskName" property="topTaskName"/> |
| | | <result column="sceneId" property="sceneId"/> |
| | | <result column="sceneName" property="sceneName"/> |
| | | <result column="subtaskId" property="subtaskId"/> |
| | | <result column="inspected" property="inspected"/> |
| | | <result column="inspectionTime" property="inspectionTime"/> |
| | | <result column="inspectionTimes" property="inspectionTimes"/> |
| | | <result column="promised" property="promised"/> |
| | | <result column="changed" property="changed"/> |
| | | <result column="unChangedCount" property="unChangedCount"/> |
| | | <result column="changedCount" property="changedCount"/> |
| | | <result column="inspectionTimes" property="inspectionTimes"/> |
| | | <result column="promisedTime" property="promisedTime"/> |
| | | </resultMap> |
| | | |
| | | <select id="getInspectionInfoByScene" parameterType="String" resultType="map"> |
| | | <select id="getInspectionInfoByScene" resultMap="InspectionInfoVo"> |
| | | SELECT |
| | | a.T_GUID AS topTaskId, |
| | | a.T_Name AS topTaskName, |
| | |
| | | b.ST_ScenseName AS sceneName, |
| | | c.I_GUID AS inspectionId, |
| | | b.ST_GUID AS subtaskId, |
| | | (CASE WHEN COUNT(DISTINCT c.I_GUID) > 0 THEN TRUE ELSE FALSE END) AS isInspected, |
| | | (CASE WHEN COUNT(DISTINCT c.I_GUID) > 0 THEN TRUE ELSE FALSE END) AS inspected, |
| | | c.I_ExecutionStartTime AS inspectionTime, |
| | | COUNT(DISTINCT c.I_GUID) AS inspectionTimes, |
| | | (CASE WHEN (SUM(CASE WHEN d.PL_Extension1 IS NULL THEN 0 ELSE 1 END)) > 0 THEN TRUE ELSE FALSE END) AS isPromised, |
| | | CASE WHEN SUM(d.PL_IsChanged) = COUNT(d.PL_IsChanged) THEN TRUE ELSE FALSE END AS isChanged, |
| | | (CASE WHEN (SUM(CASE WHEN d.PL_Extension1 IS NULL THEN 0 ELSE 1 END)) > 0 THEN TRUE ELSE FALSE END) AS promised, |
| | | CASE WHEN SUM(d.PL_IsChanged) = COUNT(d.PL_IsChanged) THEN TRUE ELSE FALSE END AS changed, |
| | | COUNT(CASE WHEN d.PL_IsChanged = 0 AND d.PL_Extension3 = 'pass' THEN 1 ELSE NULL END) AS unChangedCount, |
| | | COUNT(CASE WHEN d.PL_IsChanged = 1 THEN 1 ELSE NULL END) AS changedCount, |
| | | d.PL_Extension1 AS promisedTime |
| | |
| | | <id column="MOV_ID" property="movId" jdbcType="VARCHAR" /> |
| | | <result column="T_ID" property="tId" jdbcType="VARCHAR" /> |
| | | <result column="S_GUID" property="sGuid" jdbcType="VARCHAR" /> |
| | | <result column="MOV_SenseName" property="movSensename" jdbcType="VARCHAR" /> |
| | | <result column="MOV_TaskTypeID" property="movTasktypeid" jdbcType="TINYINT" /> |
| | | <result column="MOV_TaskType" property="movTasktype" jdbcType="VARCHAR" /> |
| | | <result column="MOV_MonitorNum" property="movMonitornum" jdbcType="INTEGER" /> |
| | | <result column="MOV_Suitable" property="movSuitable" jdbcType="BIT" /> |
| | | <result column="MOV_DisplayID" property="movDisplayid" jdbcType="INTEGER" /> |
| | | <result column="MOV_Year" property="movYear" jdbcType="INTEGER" /> |
| | | <result column="MOV_Month" property="movMonth" jdbcType="INTEGER" /> |
| | | <result column="MOV_Day" property="movDay" jdbcType="INTEGER" /> |
| | | <result column="MOV_ISCP" property="movIscp" jdbcType="BIT" /> |
| | | <result column="MOV_CustomPeriod" property="movCustomperiod" jdbcType="VARCHAR" /> |
| | | <result column="MOV_Extension1" property="movExtension1" jdbcType="VARCHAR" /> |
| | | <result column="MOV_Extension2" property="movExtension2" jdbcType="VARCHAR" /> |
| | | <result column="MOV_Extension3" property="movExtension3" jdbcType="VARCHAR" /> |
| | | <result column="MOV_Remark" property="movRemark" jdbcType="VARCHAR" /> |
| | | <result column="MOV_SenseName" property="sensename" jdbcType="VARCHAR" /> |
| | | <result column="MOV_TaskTypeID" property="tasktypeid" jdbcType="TINYINT" /> |
| | | <result column="MOV_TaskType" property="tasktype" jdbcType="VARCHAR" /> |
| | | <result column="MOV_MonitorNum" property="monitornum" jdbcType="INTEGER" /> |
| | | <result column="MOV_Suitable" property="suitable" jdbcType="BIT" /> |
| | | <result column="MOV_DisplayID" property="displayid" jdbcType="INTEGER" /> |
| | | <result column="MOV_Year" property="year" jdbcType="INTEGER" /> |
| | | <result column="MOV_Month" property="month" jdbcType="INTEGER" /> |
| | | <result column="MOV_Day" property="day" jdbcType="INTEGER" /> |
| | | <result column="MOV_ISCP" property="iscp" jdbcType="BIT" /> |
| | | <result column="MOV_CustomPeriod" property="customperiod" jdbcType="VARCHAR" /> |
| | | <result column="MOV_Extension1" property="extension1" jdbcType="VARCHAR" /> |
| | | <result column="MOV_Extension2" property="extension2" jdbcType="VARCHAR" /> |
| | | <result column="MOV_Extension3" property="extension3" jdbcType="VARCHAR" /> |
| | | <result column="MOV_Remark" property="remark" jdbcType="VARCHAR" /> |
| | | </resultMap> |
| | | <sql id="Base_Column_List" > |
| | | <!-- |
| | | WARNING - @mbg.generated |
| | | --> |
| | | MOV_ID, T_ID, S_GUID, MOV_SenseName, MOV_TaskTypeID, MOV_TaskType, MOV_MonitorNum, |
| | | MOV_Suitable, MOV_DisplayID, MOV_Year, MOV_Month, MOV_Day, MOV_ISCP, MOV_CustomPeriod, |
| | | MOV_ID, T_ID, S_GUID, MOV_SenseName, MOV_TaskTypeID, MOV_TaskType, MOV_MonitorNum, |
| | | MOV_Suitable, MOV_DisplayID, MOV_Year, MOV_Month, MOV_Day, MOV_ISCP, MOV_CustomPeriod, |
| | | MOV_Extension1, MOV_Extension2, MOV_Extension3, MOV_Remark |
| | | </sql> |
| | | |
| | | <select id="findMonitorListByScene" resultMap="BaseResultMap"> |
| | | select |
| | | a.* |
| | | from sm_t_monitorobjectversion as a |
| | | left join sm_t_scense as b on a.S_GUID = b.S_GUID |
| | | where T_ID = #{taskId} |
| | | <if test="sceneTypeId != null"> |
| | | and b.S_TypeID = #{sceneTypeId} |
| | | </if> |
| | | </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.ds1.mapper.ProblemlistMapper" > |
| | | <resultMap id="BaseResultMap" type="cn.flightfeather.supervision.domain.ds1.entity.Problemlist" > |
| | | <!-- |
| | | WARNING - @mbg.generated |
| | | --> |
| | | <id column="PL_GUID" property="guid" jdbcType="VARCHAR" /> |
| | | <result column="I_GUID" property="iguid" jdbcType="VARCHAR" /> |
| | | <result column="ST_GUID" property="stguid" jdbcType="VARCHAR" /> |
| | | <result column="S_GUID" property="sguid" jdbcType="VARCHAR" /> |
| | | <result column="PL_SenseName" property="sensename" jdbcType="VARCHAR" /> |
| | | <result column="PL_SenseAddress" property="senseaddress" jdbcType="VARCHAR" /> |
| | | <result column="PT_GUID" property="ptguid" jdbcType="VARCHAR" /> |
| | | <result column="PL_ProblemName" property="problemname" jdbcType="VARCHAR" /> |
| | | <result column="PL_Longitude" property="longitude" jdbcType="DECIMAL" /> |
| | | <result column="PL_Latitude" property="latitude" jdbcType="DECIMAL" /> |
| | | <result column="PL_LocationID" property="locationid" jdbcType="TINYINT" /> |
| | | <result column="PL_Location" property="location" jdbcType="VARCHAR" /> |
| | | <result column="PL_Time" property="time" jdbcType="TIMESTAMP" /> |
| | | <result column="PL_IsRechecked" property="isrechecked" jdbcType="BIT" /> |
| | | <result column="PL_RecheckTime" property="rechecktime" jdbcType="TIMESTAMP" /> |
| | | <result column="PL_RecheckUserGUID" property="recheckuserguid" jdbcType="VARCHAR" /> |
| | | <result column="PL_RecheckUserName" property="recheckusername" jdbcType="VARCHAR" /> |
| | | <result column="PL_RecheckUserRealName" property="recheckuserrealname" jdbcType="VARCHAR" /> |
| | | <result column="PL_RecheckDescription" property="recheckdescription" jdbcType="VARCHAR" /> |
| | | <result column="PL_RecheckResultID" property="recheckresultid" jdbcType="BIT" /> |
| | | <result column="PL_RecheckResult" property="recheckresult" jdbcType="VARCHAR" /> |
| | | <result column="PL_IsChanged" property="ischanged" jdbcType="BIT" /> |
| | | <result column="PL_ChangeCatalog" property="changecatalog" jdbcType="VARCHAR" /> |
| | | <result column="PL_ChangedTime" property="changedtime" jdbcType="TIMESTAMP" /> |
| | | <result column="PL_ChangedResult" property="changedresult" jdbcType="VARCHAR" /> |
| | | <result column="PL_Advise" property="advise" jdbcType="VARCHAR" /> |
| | | <result column="PL_Extension1" property="extension1" jdbcType="VARCHAR" /> |
| | | <result column="PL_Extension2" property="extension2" jdbcType="VARCHAR" /> |
| | | <result column="PL_Extension3" property="extension3" jdbcType="VARCHAR" /> |
| | | <result column="PL_Remark" property="remark" jdbcType="VARCHAR" /> |
| | | </resultMap> |
| | | |
| | | <resultMap id="StatisticsVoMap" type="cn.flightfeather.supervision.lightshare.vo.StatisticsVo"> |
| | | <id property="name" column="T_Name"/> |
| | | <result property="startTime" column="startTime"/> |
| | | <result property="endTime" column="endTime"/> |
| | | <result property="count" column="count1"/> |
| | | </resultMap> |
| | | <sql id="Base_Column_List" > |
| | | <!-- |
| | | WARNING - @mbg.generated |
| | | --> |
| | | PL_GUID, I_GUID, ST_GUID, S_GUID, PL_SenseName, PL_SenseAddress, PT_GUID, PL_ProblemName, |
| | | PL_Longitude, PL_Latitude, PL_LocationID, PL_Location, PL_Time, PL_IsRechecked, PL_RecheckTime, |
| | | PL_RecheckUserGUID, PL_RecheckUserName, PL_RecheckUserRealName, PL_RecheckDescription, |
| | | PL_RecheckResultID, PL_RecheckResult, PL_IsChanged, PL_ChangeCatalog, PL_ChangedTime, |
| | | PL_ChangedResult, PL_Advise, PL_Extension1, PL_Extension2, PL_Extension3, PL_Remark |
| | | </sql> |
| | | <mapper namespace="cn.flightfeather.supervision.domain.ds1.mapper.ProblemlistMapper"> |
| | | <resultMap id="BaseResultMap" type="cn.flightfeather.supervision.domain.ds1.entity.Problemlist"> |
| | | <!-- |
| | | WARNING - @mbg.generated |
| | | --> |
| | | <id column="PL_GUID" property="guid" jdbcType="VARCHAR"/> |
| | | <result column="I_GUID" property="iguid" jdbcType="VARCHAR"/> |
| | | <result column="ST_GUID" property="stguid" jdbcType="VARCHAR"/> |
| | | <result column="S_GUID" property="sguid" jdbcType="VARCHAR"/> |
| | | <result column="PL_SenseName" property="sensename" jdbcType="VARCHAR"/> |
| | | <result column="PL_SenseAddress" property="senseaddress" jdbcType="VARCHAR"/> |
| | | <result column="PT_GUID" property="ptguid" jdbcType="VARCHAR"/> |
| | | <result column="PL_ProblemName" property="problemname" jdbcType="VARCHAR"/> |
| | | <result column="PL_Longitude" property="longitude" jdbcType="DECIMAL"/> |
| | | <result column="PL_Latitude" property="latitude" jdbcType="DECIMAL"/> |
| | | <result column="PL_LocationID" property="locationid" jdbcType="TINYINT"/> |
| | | <result column="PL_Location" property="location" jdbcType="VARCHAR"/> |
| | | <result column="PL_Time" property="time" jdbcType="TIMESTAMP"/> |
| | | <result column="PL_IsRechecked" property="isrechecked" jdbcType="BIT"/> |
| | | <result column="PL_RecheckTime" property="rechecktime" jdbcType="TIMESTAMP"/> |
| | | <result column="PL_RecheckUserGUID" property="recheckuserguid" jdbcType="VARCHAR"/> |
| | | <result column="PL_RecheckUserName" property="recheckusername" jdbcType="VARCHAR"/> |
| | | <result column="PL_RecheckUserRealName" property="recheckuserrealname" jdbcType="VARCHAR"/> |
| | | <result column="PL_RecheckDescription" property="recheckdescription" jdbcType="VARCHAR"/> |
| | | <result column="PL_RecheckResultID" property="recheckresultid" jdbcType="BIT"/> |
| | | <result column="PL_RecheckResult" property="recheckresult" jdbcType="VARCHAR"/> |
| | | <result column="PL_IsChanged" property="ischanged" jdbcType="BIT"/> |
| | | <result column="PL_ChangeCatalog" property="changecatalog" jdbcType="VARCHAR"/> |
| | | <result column="PL_ChangedTime" property="changedtime" jdbcType="TIMESTAMP"/> |
| | | <result column="PL_ChangedResult" property="changedresult" jdbcType="VARCHAR"/> |
| | | <result column="PL_Advise" property="advise" jdbcType="VARCHAR"/> |
| | | <result column="PL_Extension1" property="extension1" jdbcType="VARCHAR"/> |
| | | <result column="PL_Extension2" property="extension2" jdbcType="VARCHAR"/> |
| | | <result column="PL_Extension3" property="extension3" jdbcType="VARCHAR"/> |
| | | <result column="PL_Remark" property="remark" jdbcType="VARCHAR"/> |
| | | </resultMap> |
| | | <sql id="Base_Column_List"> |
| | | <!-- |
| | | WARNING - @mbg.generated |
| | | --> |
| | | PL_GUID, I_GUID, ST_GUID, S_GUID, PL_SenseName, PL_SenseAddress, PT_GUID, PL_ProblemName, |
| | | PL_Longitude, PL_Latitude, PL_LocationID, PL_Location, PL_Time, PL_IsRechecked, PL_RecheckTime, |
| | | PL_RecheckUserGUID, PL_RecheckUserName, PL_RecheckUserRealName, PL_RecheckDescription, |
| | | PL_RecheckResultID, PL_RecheckResult, PL_IsChanged, PL_ChangeCatalog, PL_ChangedTime, |
| | | PL_ChangedResult, PL_Advise, PL_Extension1, PL_Extension2, PL_Extension3, PL_Remark |
| | | </sql> |
| | | |
| | | <!--<select id="getStatisticalResult" parameterType="String" resultMap="StatisticsVoMap">--> |
| | | <select id="getStatisticalResult" parameterType="String" resultType="map"> |
| | | SELECT |
| | | <resultMap id="StatisticsVoMap" type="cn.flightfeather.supervision.lightshare.vo.StatisticsVo"> |
| | | <result property="name" column="name"/> |
| | | <result property="startTime" column="startTime"/> |
| | | <result property="endTime" column="endTime"/> |
| | | <result property="count" column="count"/> |
| | | <result property="changeCount" column="changeCount"/> |
| | | </resultMap> |
| | | <resultMap id="SceneProblemSummary" type="cn.flightfeather.supervision.lightshare.vo.SceneProblemSummary"> |
| | | <id property="sceneId" column="sceneId"/> |
| | | <result property="proNum" column="proNum"/> |
| | | <result property="changeNum" column="changeNum"/> |
| | | <result property="changePer" column="changePer"/> |
| | | <association property="scene" resultMap="cn.flightfeather.supervision.domain.ds1.mapper.ScenseMapper.BaseResultMap" /> |
| | | <!-- <collection property="subtasks" ofType="cn.flightfeather.supervision.domain.ds1.entity.Subtask"--> |
| | | <!-- resultMap="cn.flightfeather.supervision.domain.ds1.mapper.SubtaskMapper.BaseResultMap" />--> |
| | | </resultMap> |
| | | |
| | | <select id="getStatisticalResult" parameterType="String" resultMap="StatisticsVoMap"> |
| | | SELECT |
| | | b.PT_TypeName as name, |
| | | COUNT(b.PT_TypeName) as count, |
| | | COUNT(CASE WHEN a.PL_IsChanged = 1 THEN 1 ELSE NULL END) as changeCount |
| | | FROM |
| | | FROM |
| | | im_t_problemlist AS a |
| | | LEFT JOIN sm_t_problemtype AS b ON a.PT_GUID = b.PT_GUID |
| | | LEFT JOIN sm_t_scense AS f ON a.S_GUID = f.S_GUID |
| | | WHERE |
| | | a.ST_GUID IN ( |
| | | SELECT |
| | | d.ST_GUID |
| | | FROM |
| | | tm_t_subtask AS d LEFT JOIN tm_t_task AS e ON d.T_GUID = e.T_GUID |
| | | WHERE |
| | | e.T_LevelNum = '2' |
| | | AND e.T_StartTime <= #{param2} |
| | | AND e.T_EndTime >= #{param3} |
| | | AND e.T_DistrictCode = #{param1} |
| | | ) |
| | | AND f.S_TypeID = #{param4} |
| | | GROUP BY |
| | | LEFT JOIN sm_t_problemtype AS b ON a.PT_GUID = b.PT_GUID |
| | | LEFT JOIN sm_t_scense AS f ON a.S_GUID = f.S_GUID |
| | | LEFT JOIN tm_t_subtask AS c ON a.ST_GUID = c.ST_GUID |
| | | <where> |
| | | <!-- a.ST_GUID IN (--> |
| | | <!-- SELECT--> |
| | | <!-- d.ST_GUID--> |
| | | <!-- FROM--> |
| | | <!-- tm_t_subtask AS d LEFT JOIN tm_t_task AS e ON d.T_GUID = e.T_GUID--> |
| | | <!-- WHERE--> |
| | | <!-- e.T_LevelNum = '2'--> |
| | | <!-- <if test="startTime != null">--> |
| | | <!-- AND e.T_StartTime <= #{startTime}--> |
| | | <!-- </if>--> |
| | | <!-- <if test="endTime != null">--> |
| | | <!-- AND e.T_EndTime >= #{endTime}--> |
| | | <!-- </if>--> |
| | | <!-- <if test="districtCode != null">--> |
| | | <!-- AND e.T_DistrictCode = #{districtCode}--> |
| | | <!-- </if>--> |
| | | <!-- )--> |
| | | <if test="startTime != null"> |
| | | AND c.ST_PlanStartTime >= #{startTime} |
| | | </if> |
| | | <if test="endTime != null"> |
| | | AND c.ST_PlanStartTime <= #{endTime} |
| | | </if> |
| | | <if test="districtCode != null"> |
| | | AND f.S_DistrictCode = #{districtCode} |
| | | </if> |
| | | <if test="sceneType != null"> |
| | | AND f.S_TypeID = #{sceneType} |
| | | </if> |
| | | <if test="sceneId != null"> |
| | | AND a.S_GUID = #{sceneId} |
| | | </if> |
| | | </where> |
| | | GROUP BY |
| | | b.PT_TypeName |
| | | ORDER BY |
| | | ORDER BY |
| | | COUNT(b.PT_TypeName) DESC |
| | | </select> |
| | | <!--select DISTINCT T_Name as name, count(*) as count from tm_t_task where T_LevelNum = 2--> |
| | | </select> |
| | | <!--æ ¹æ®é¡¶å±ä»»å¡idååºæ¯ç±»åidè·åé®é¢åç±»æ
åµï¼ç»æågetStatisticalResult--> |
| | | <select id="getStatisticalResultById" parameterType="String" resultType="map"> |
| | | SELECT |
| | | b.PT_TypeName AS name, |
| | | COUNT(b.PT_TypeName) AS count, |
| | | COUNT(CASE WHEN a.PL_IsChanged = 1 THEN 1 ELSE NULL END) as changeCount |
| | | b.PT_TypeName AS name, |
| | | COUNT(b.PT_TypeName) AS count, |
| | | COUNT(CASE WHEN a.PL_IsChanged = 1 THEN 1 ELSE NULL END) as changeCount |
| | | FROM |
| | | im_t_problemlist AS a |
| | | im_t_problemlist AS a |
| | | LEFT JOIN sm_t_problemtype AS b ON a.PT_GUID = b.PT_GUID |
| | | LEFT JOIN sm_t_scense AS f ON a.S_GUID = f.S_GUID |
| | | LEFT JOIN tm_t_subtask AS c ON a.ST_GUID = c.ST_GUID |
| | | WHERE |
| | | c.T_GUID = #{param1} |
| | | c.T_GUID = #{param1} |
| | | AND f.S_TypeID = #{param2} |
| | | GROUP BY |
| | | b.PT_TypeName |
| | | b.PT_TypeName |
| | | ORDER BY |
| | | COUNT(b.PT_TypeName) DESC |
| | | COUNT(b.PT_TypeName) DESC |
| | | </select> |
| | | |
| | | |
| | | <select id="getChangeResult" parameterType="String" resultType="map"> |
| | | SELECT |
| | | a.S_GUID as id, |
| | | a.PL_SenseName as name, |
| | | f.S_TypeID as type, |
| | | COUNT(a.PL_GUID) as problemCount, |
| | | COUNT(CASE WHEN a.PL_IsChanged = 1 THEN 1 ELSE NULL END) as changeCount |
| | | FROM |
| | | im_t_problemlist AS a |
| | | LEFT JOIN sm_t_problemtype AS b ON a.PT_GUID = b.PT_GUID |
| | | LEFT JOIN sm_t_scense AS f ON a.S_GUID = f.S_GUID |
| | | LEFT JOIN sm_t_monitorobjectversion as g ON a.S_GUID = g.S_GUID |
| | | WHERE |
| | | a.ST_GUID IN ( |
| | | SELECT |
| | | ST_GUID |
| | | FROM |
| | | tm_t_subtask |
| | | WHERE |
| | | T_GUID = #{param1} |
| | | ) |
| | | AND f.S_TypeID = #{param2} |
| | | AND g.T_ID = #{param1} |
| | | GROUP BY |
| | | id |
| | | ORDER BY |
| | | problemCount DESC |
| | | SELECT |
| | | a.S_GUID as id, |
| | | a.PL_SenseName as name, |
| | | f.S_TypeID as type, |
| | | COUNT(a.PL_GUID) as problemCount, |
| | | COUNT(CASE WHEN a.PL_IsChanged = 1 THEN 1 ELSE NULL END) as changeCount |
| | | FROM |
| | | im_t_problemlist AS a |
| | | LEFT JOIN sm_t_problemtype AS b ON a.PT_GUID = b.PT_GUID |
| | | LEFT JOIN sm_t_scense AS f ON a.S_GUID = f.S_GUID |
| | | LEFT JOIN sm_t_monitorobjectversion as g ON a.S_GUID = g.S_GUID |
| | | WHERE |
| | | a.ST_GUID IN ( |
| | | SELECT |
| | | ST_GUID |
| | | FROM |
| | | tm_t_subtask |
| | | WHERE |
| | | T_GUID = #{param1} |
| | | ) |
| | | AND f.S_TypeID = #{param2} |
| | | AND g.T_ID = #{param1} |
| | | GROUP BY |
| | | id |
| | | ORDER BY |
| | | problemCount DESC |
| | | </select> |
| | | <select id="getScoreResult" resultType="map" parameterType="String"> |
| | | SELECT |
| | | b.ST_name as name, |
| | | E_ResultScoreBef as scoreBef, |
| | | E_ResultScoreAft as scoreAft |
| | | b.ST_name as name, |
| | | E_ResultScoreBef as scoreBef, |
| | | E_ResultScoreAft as scoreAft |
| | | FROM |
| | | ea_t_evaluation AS a |
| | | ea_t_evaluation AS a |
| | | RIGHT JOIN tm_t_subtask AS b ON a.ST_GUID = b.ST_GUID |
| | | WHERE |
| | | b.T_GUID = #{param1} |
| | | b.T_GUID = #{param1} |
| | | AND a.E_ScenseTypeID = #{param2} |
| | | </select> |
| | | |
| | | <select id="selectSE" resultType="string" parameterType="String"> |
| | | ${_parameter} |
| | | </select> |
| | | |
| | | <select id="getProblemByScene" resultMap="BaseResultMap" parameterType="String"> |
| | | SELECT |
| | | a.* |
| | | a.* |
| | | FROM |
| | | im_t_problemlist AS a |
| | | im_t_problemlist AS a |
| | | LEFT JOIN tm_t_subtask AS b ON a.ST_GUID = b.ST_GUID |
| | | WHERE |
| | | a.S_GUID = #{param1} |
| | | a.S_GUID = #{param1} |
| | | AND b.T_GUID = #{param2} |
| | | </select> |
| | | <select id="findMonthProblemById" resultType="map" > |
| | | </select> |
| | | <select id="findMonthProblemById" resultType="map"> |
| | | SELECT |
| | | b.S_TownCode as towncode, |
| | | b.S_TownName as townname, |
| | | b.S_TypeID as scenetype, |
| | | b.S_Type as scenetypename, |
| | | COUNT(DISTINCT a.S_GUID) as totalscenecount, |
| | | COUNT(DISTINCT d.S_GUID) as problemscenes, |
| | | COUNT(d.PL_GUID) as totalproblems, |
| | | SUM(CASE WHEN d.PL_IsChanged = 1 THEN 1 ELSE 0 END) as changedproblems |
| | | b.S_TownCode as towncode, |
| | | b.S_TownName as townname, |
| | | b.S_TypeID as scenetype, |
| | | b.S_Type as scenetypename, |
| | | COUNT(DISTINCT a.S_GUID) as totalscenecount, |
| | | COUNT(DISTINCT d.S_GUID) as problemscenes, |
| | | COUNT(d.PL_GUID) as totalproblems, |
| | | SUM(CASE WHEN d.PL_IsChanged = 1 THEN 1 ELSE 0 END) as changedproblems |
| | | FROM |
| | | sm_t_monitorobjectversion AS a |
| | | sm_t_monitorobjectversion AS a |
| | | LEFT JOIN sm_t_scense AS b ON a.S_GUID = b.S_GUID |
| | | LEFT JOIN tm_t_subtask AS c ON a.T_ID = c.T_GUID AND b.S_GUID = c.ST_ScenseID |
| | | LEFT JOIN im_t_problemlist AS d ON c.ST_GUID = d.ST_GUID |
| | | WHERE |
| | | a.T_ID = #{param1} |
| | | a.T_ID = #{param1} |
| | | <if test="param2 !=null and param2 !=''"> |
| | | AND S_TypeID = #{param2} |
| | | </if> |
| | | GROUP BY |
| | | b.S_TownCode |
| | | b.S_TownCode |
| | | </select> |
| | | |
| | | <select id="findUnchangedCount" resultType="int" parameterType="String"> |
| | | SELECT |
| | | SUM(CASE WHEN a.PL_IsChanged = 0 THEN 1 ELSE 0 END) as unChanged |
| | | SUM(CASE WHEN a.PL_IsChanged = 0 THEN 1 ELSE 0 END) as unChanged |
| | | FROM |
| | | im_t_problemlist AS a |
| | | LEFT JOIN tm_t_subtask AS b ON a.ST_GUID = b.ST_GUID |
| | | im_t_problemlist AS a |
| | | LEFT JOIN tm_t_subtask AS b ON a.ST_GUID = b.ST_GUID |
| | | WHERE |
| | | b.TS_GUID = #{param1} |
| | | b.TS_GUID = #{param1} |
| | | GROUP BY |
| | | b.ST_GUID |
| | | b.ST_GUID |
| | | </select> |
| | | <select id="getSceneProSummary" resultMap="SceneProblemSummary"> |
| | | SELECT |
| | | IF(proNum = 0, 1, changeNum/proNum) AS changePer, |
| | | t_p.* |
| | | FROM ( |
| | | SELECT |
| | | b.S_GUID AS sceneId, |
| | | SUM(d.PL_GUID is NOT null) AS proNum, |
| | | SUM(d.PL_IsChanged = TRUE) AS changeNum, |
| | | b.* |
| | | FROM |
| | | sm_t_scense AS b |
| | | LEFT JOIN tm_t_subtask AS a ON a.ST_ScenseID = b.S_GUID |
| | | LEFT JOIN im_t_problemlist AS d ON a.ST_GUID = d.ST_GUID |
| | | WHERE |
| | | a.T_GUID = #{topTaskId} |
| | | <if test="sceneTypeId != null"> |
| | | and b.S_TypeID = #{sceneTypeId} |
| | | </if> |
| | | GROUP BY |
| | | b.S_GUID |
| | | ) as t_p |
| | | <if test="sortBy == 'pro'"> |
| | | <if test="sort == 'asc'"> |
| | | ORDER BY proNum asc, changeNum desc |
| | | </if> |
| | | <if test="sort == 'desc'"> |
| | | ORDER BY proNum desc, changeNum asc |
| | | </if> |
| | | </if> |
| | | <if test="sortBy == 'changePer'"> |
| | | <if test="sort == 'asc'"> |
| | | ORDER BY changePer asc, proNum desc |
| | | </if> |
| | | <if test="sort == 'desc'"> |
| | | ORDER BY changePer desc, proNum asc |
| | | </if> |
| | | </if> |
| | | </select> |
| | | </mapper> |
| | |
| | | <result column="ST_GUID" property="stGuid" jdbcType="VARCHAR" /> |
| | | <result column="ST_name" property="stName" jdbcType="VARCHAR" /> |
| | | <result column="ST_PlanStartTime" property="stPlanTime" jdbcType="TIMESTAMP" /> |
| | | <result column="ST_Status" property="stStatus" jdbcType="VARCHAR" /> |
| | | <result column="S_GUID" property="sceneId" jdbcType="VARCHAR" /> |
| | | <result column="S_Name" property="sceneName" jdbcType="VARCHAR" /> |
| | | <result column="S_Type" property="sceneType" jdbcType="VARCHAR" /> |
| | |
| | | a.ST_GUID, |
| | | a.ST_name, |
| | | a.ST_PlanStartTime, |
| | | a.ST_Status, |
| | | b.S_GUID, |
| | | b.S_Name, |
| | | b.S_Type, |
| | |
| | | GROUP BY |
| | | a.ST_GUID |
| | | </select> |
| | | |
| | | <select id="getSummaryByScene" resultMap="SubTaskSummary"> |
| | | SELECT |
| | | a.ST_GUID, |
| | | a.ST_name, |
| | | a.ST_PlanStartTime, |
| | | a.ST_Status, |
| | | b.S_GUID, |
| | | b.S_Name, |
| | | b.S_Type, |
| | | c.I_GUID, |
| | | SUM(d.PL_GUID is NOT null) AS proNum, |
| | | SUM(d.PL_IsChanged = TRUE) AS changeNum, |
| | | SUM(d.PL_Extension3 != 'unCheck') AS proCheckedNum, |
| | | SUM( |
| | | d.PL_Extension3 = 'change_pass' || d.PL_Extension3 = 'change_fail' |
| | | ) AS changeCheckedNum |
| | | |
| | | FROM |
| | | tm_t_subtask AS a |
| | | LEFT JOIN sm_t_scense AS b ON a.ST_ScenseID = b.S_GUID |
| | | LEFT JOIN im_t_inspection AS c ON a.ST_GUID = c.ST_GUID |
| | | LEFT JOIN im_t_problemlist AS d ON a.ST_GUID = d.ST_GUID |
| | | WHERE |
| | | a.ST_ScenseID = #{sceneId} |
| | | <if test="startTime != null"> |
| | | and a.ST_PlanStartTime BETWEEN #{startTime} AND #{endTime} |
| | | </if> |
| | | GROUP BY |
| | | a.ST_GUID |
| | | ORDER BY a.ST_PlanStartTime DESC |
| | | </select> |
| | | |
| | | <select id="findSubTasksByProType" resultMap="BaseResultMap"> |
| | | SELECT |
| | | a.* |
| | | FROM |
| | | tm_t_subtask AS a |
| | | LEFT JOIN im_t_problemlist AS b ON a.ST_GUID = b.ST_GUID |
| | | LEFT JOIN sm_t_problemtype AS c ON b.PT_GUID = c.PT_GUID |
| | | LEFT JOIN sm_t_scense AS d ON a.ST_ScenseID = d.S_GUID |
| | | WHERE |
| | | a.T_GUID = #{topTaskId} |
| | | AND c.PT_TypeName = #{proType} |
| | | AND d.S_TypeID = #{sceneTypeId} |
| | | GROUP BY a.ST_GUID |
| | | </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.BaseInfoMapper" > |
| | | <resultMap id="BaseResultMap" type="cn.flightfeather.supervision.domain.ds2.entity.BaseInfo" > |
| | | <resultMap id="BaseResultMap" type="cn.flightfeather.supervision.domain.ds2.entity.BaseInfo"> |
| | | <!-- |
| | | WARNING - @mbg.generated |
| | | --> |
| | | <id column="BI_GUID" property="biGuid" jdbcType="VARCHAR" /> |
| | | <result column="BI_Name" property="biName" jdbcType="VARCHAR" /> |
| | | <result column="CI_GUID" property="ciGuid" jdbcType="VARCHAR" /> |
| | | <result column="CI_Name" property="ciName" jdbcType="VARCHAR" /> |
| | | <result column="BI_Management_Company_Id" property="biManagementCompanyId" jdbcType="VARCHAR" /> |
| | | <result column="BI_Management_Company" property="biManagementCompany" jdbcType="VARCHAR" /> |
| | | <result column="BI_Contact" property="biContact" jdbcType="VARCHAR" /> |
| | | <result column="BI_Telephone" property="biTelephone" jdbcType="VARCHAR" /> |
| | | <result column="BI_Address" property="biAddress" jdbcType="VARCHAR" /> |
| | | <result column="BI_Create_Time" property="biCreateTime" jdbcType="TIMESTAMP" /> |
| | | <result column="BI_Update_Time" property="biUpdateTime" jdbcType="TIMESTAMP" /> |
| | | <result column="BI_Extension1" property="biExtension1" jdbcType="VARCHAR" /> |
| | | <result column="BI_Extension2" property="biExtension2" jdbcType="VARCHAR" /> |
| | | <result column="BI_Extension3" property="biExtension3" jdbcType="VARCHAR" /> |
| | | <result column="BI_Remark" property="biRemark" jdbcType="VARCHAR" /> |
| | | <id column="BI_GUID" jdbcType="VARCHAR" property="biGuid"/> |
| | | <result column="BI_Name" jdbcType="VARCHAR" property="biName"/> |
| | | <result column="BI_Nick_Name" jdbcType="VARCHAR" property="biNickName"/> |
| | | <result column="CI_GUID" jdbcType="VARCHAR" property="ciGuid"/> |
| | | <result column="CI_Name" jdbcType="VARCHAR" property="ciName"/> |
| | | <result column="BI_Province_Code" jdbcType="VARCHAR" property="biProvinceCode"/> |
| | | <result column="BI_Province_Name" jdbcType="VARCHAR" property="biProvinceName"/> |
| | | <result column="BI_City_Code" jdbcType="VARCHAR" property="biCityCode"/> |
| | | <result column="BI_City_Name" jdbcType="VARCHAR" property="biCityName"/> |
| | | <result column="BI_District_Code" jdbcType="VARCHAR" property="biDistrictCode"/> |
| | | <result column="BI_District_Name" jdbcType="VARCHAR" property="biDistrictName"/> |
| | | <result column="BI_Town_Code" jdbcType="VARCHAR" property="biTownCode"/> |
| | | <result column="BI_Town_Name" jdbcType="VARCHAR" property="biTownName"/> |
| | | <result column="BI_Area_Code" jdbcType="VARCHAR" property="biAreaCode"/> |
| | | <result column="BI_Area" jdbcType="VARCHAR" property="biArea"/> |
| | | <result column="BI_Management_Company_Id" jdbcType="VARCHAR" property="biManagementCompanyId"/> |
| | | <result column="BI_Management_Company" jdbcType="VARCHAR" property="biManagementCompany"/> |
| | | <result column="BI_Contact" jdbcType="VARCHAR" property="biContact"/> |
| | | <result column="BI_Telephone" jdbcType="VARCHAR" property="biTelephone"/> |
| | | <result column="BI_Address" jdbcType="VARCHAR" property="biAddress"/> |
| | | <result column="BI_Create_Time" jdbcType="TIMESTAMP" property="biCreateTime"/> |
| | | <result column="BI_Update_Time" jdbcType="TIMESTAMP" property="biUpdateTime"/> |
| | | <result column="BI_Extension1" jdbcType="VARCHAR" property="biExtension1"/> |
| | | <result column="BI_Extension2" jdbcType="VARCHAR" property="biExtension2"/> |
| | | <result column="BI_Extension3" jdbcType="VARCHAR" property="biExtension3"/> |
| | | <result column="BI_Remark" jdbcType="VARCHAR" property="biRemark"/> |
| | | </resultMap> |
| | | <sql id="Base_Column_List" > |
| | | <sql id="Base_Column_List"> |
| | | <!-- |
| | | WARNING - @mbg.generated |
| | | --> |
| | | BI_GUID, BI_Name, CI_GUID, CI_Name, BI_Management_Company_Id, BI_Management_Company, |
| | | BI_Contact, BI_Telephone, BI_Address, BI_Create_Time, BI_Update_Time, BI_Extension1, |
| | | BI_Extension2, BI_Extension3, BI_Remark |
| | | BI_GUID, BI_Name, BI_Nick_Name, CI_GUID, CI_Name, BI_Province_Code, BI_Province_Name, |
| | | BI_City_Code, BI_City_Name, BI_District_Code, BI_District_Name, BI_Town_Code, BI_Town_Name, |
| | | BI_Area_Code, BI_Area, BI_Management_Company_Id, BI_Management_Company, BI_Contact, |
| | | BI_Telephone, BI_Address, BI_Create_Time, BI_Update_Time, BI_Extension1, BI_Extension2, |
| | | BI_Extension3, BI_Remark |
| | | </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.JSDustSiteInfoMapper"> |
| | | <resultMap id="BaseResultMap" type="cn.flightfeather.supervision.domain.ds3.entity.JSDustSiteInfo"> |
| | | <!-- |
| | | WARNING - @mbg.generated |
| | | --> |
| | | <id column="id" jdbcType="INTEGER" property="id" /> |
| | | <result column="mn_code" jdbcType="VARCHAR" property="mnCode" /> |
| | | <result column="address" jdbcType="VARCHAR" property="address" /> |
| | | <result column="name" jdbcType="VARCHAR" property="name" /> |
| | | <result column="code" jdbcType="VARCHAR" property="code" /> |
| | | <result column="begin_date" jdbcType="TIMESTAMP" property="beginDate" /> |
| | | <result column="duty_company" jdbcType="VARCHAR" property="dutyCompany" /> |
| | | <result column="duty_company_id" jdbcType="VARCHAR" property="dutyCompanyId" /> |
| | | <result column="end_date" jdbcType="TIMESTAMP" property="endDate" /> |
| | | <result column="engineering_stage" jdbcType="VARCHAR" property="engineeringStage" /> |
| | | <result column="group_id" jdbcType="VARCHAR" property="groupId" /> |
| | | <result column="group_name" jdbcType="VARCHAR" property="groupName" /> |
| | | <result column="is_online" jdbcType="VARCHAR" property="isOnline" /> |
| | | <result column="is_trouble" jdbcType="VARCHAR" property="isTrouble" /> |
| | | <result column="jhpt_update_time" jdbcType="VARCHAR" property="jhptUpdateTime" /> |
| | | <result column="kindex" jdbcType="VARCHAR" property="kindex" /> |
| | | <result column="latitude" jdbcType="VARCHAR" property="latitude" /> |
| | | <result column="linkman" jdbcType="VARCHAR" property="linkman" /> |
| | | <result column="longitude" jdbcType="VARCHAR" property="longitude" /> |
| | | <result column="phone" jdbcType="VARCHAR" property="phone" /> |
| | | <result column="province" jdbcType="VARCHAR" property="province" /> |
| | | <result column="ring_id" jdbcType="VARCHAR" property="ringId" /> |
| | | <result column="ring_name" jdbcType="VARCHAR" property="ringName" /> |
| | | <result column="type_id" jdbcType="VARCHAR" property="typeId" /> |
| | | <result column="typename" jdbcType="VARCHAR" property="typename" /> |
| | | <result column="stop_time" jdbcType="TIMESTAMP" property="stopTime" /> |
| | | <result column="active" jdbcType="VARCHAR" property="active" /> |
| | | <result column="trouble_num" jdbcType="INTEGER" property="troubleNum" /> |
| | | <result column="insert_time" jdbcType="TIMESTAMP" property="insertTime" /> |
| | | <result column="stage_begin_date" jdbcType="TIMESTAMP" property="stageBeginDate" /> |
| | | <result column="tsp" jdbcType="DOUBLE" property="tsp" /> |
| | | <result column="union_type_id" jdbcType="VARCHAR" property="unionTypeId" /> |
| | | <result column="wall_height" jdbcType="VARCHAR" property="wallHeight" /> |
| | | <result column="ywsj_date" jdbcType="TIMESTAMP" property="ywsjDate" /> |
| | | <result column="build_area" jdbcType="VARCHAR" property="buildArea" /> |
| | | <result column="construction_unit" jdbcType="VARCHAR" property="constructionUnit" /> |
| | | <result column="control_level" jdbcType="VARCHAR" property="controlLevel" /> |
| | | <result column="developers" jdbcType="VARCHAR" property="developers" /> |
| | | <result column="do_time" jdbcType="TIMESTAMP" property="doTime" /> |
| | | <result column="has_monitor" jdbcType="VARCHAR" property="hasMonitor" /> |
| | | <result column="data_time" jdbcType="TIMESTAMP" property="dataTime" /> |
| | | <result column="engineering_stage_code" jdbcType="VARCHAR" property="engineeringStageCode" /> |
| | | <result column="equipment_code" jdbcType="VARCHAR" property="equipmentCode" /> |
| | | <result column="floor_area" jdbcType="VARCHAR" property="floorArea" /> |
| | | <result column="jhpt_delete" jdbcType="VARCHAR" property="jhptDelete" /> |
| | | <result column="noise_region" jdbcType="VARCHAR" property="noiseRegion" /> |
| | | <result column="responsible" jdbcType="VARCHAR" property="responsible" /> |
| | | </resultMap> |
| | | <sql id="Base_Column_List"> |
| | | <!-- |
| | | WARNING - @mbg.generated |
| | | --> |
| | | id, mn_code, address, name, code, begin_date, duty_company, duty_company_id, end_date, |
| | | engineering_stage, group_id, group_name, is_online, is_trouble, jhpt_update_time, |
| | | kindex, latitude, linkman, longitude, phone, province, ring_id, ring_name, type_id, |
| | | typename, stop_time, active, trouble_num, insert_time, stage_begin_date, tsp, union_type_id, |
| | | wall_height, ywsj_date, build_area, construction_unit, control_level, developers, |
| | | do_time, has_monitor, data_time, engineering_stage_code, equipment_code, floor_area, |
| | | jhpt_delete, noise_region, responsible |
| | | </sql> |
| | | </mapper> |
| | |
| | | |
| | | import org.junit.Test |
| | | import java.util.* |
| | | import kotlin.properties.Delegates |
| | | |
| | | class CommonTest { |
| | | |
| | |
| | | println(fName) |
| | | println(dName) |
| | | } |
| | | |
| | | @Test |
| | | fun annotationTest() { |
| | | "name" + "1" |
| | | mapOf<String, String>("name" to "1") |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package cn.flightfeather.supervision.business.autooutput.dataanalysis |
| | | |
| | | import cn.flightfeather.supervision.lightshare.vo.AreaVo |
| | | import org.junit.Test |
| | | import org.junit.jupiter.api.extension.ExtendWith |
| | | import org.junit.runner.RunWith |
| | | import org.springframework.beans.factory.annotation.Autowired |
| | | import org.springframework.boot.test.context.SpringBootTest |
| | | import org.springframework.test.context.junit.jupiter.SpringExtension |
| | | import org.springframework.test.context.junit4.SpringRunner |
| | | import java.time.LocalDateTime |
| | | |
| | | @RunWith(SpringRunner::class) |
| | | @ExtendWith(SpringExtension::class) |
| | | @SpringBootTest |
| | | class AopDataDeviceMapTest { |
| | | |
| | | @Autowired |
| | | lateinit var aopDataDeviceMap: AopDataDeviceMap |
| | | |
| | | @Test |
| | | fun outputMapSet() { |
| | | // éå±±å·¥å° |
| | | val areaVo = AreaVo().apply { |
| | | provincecode = "31" |
| | | provincename = "䏿µ·å¸" |
| | | citycode = "3100" |
| | | cityname = "䏿µ·å¸" |
| | | districtcode = "310116" |
| | | districtname = "éå±±åº" |
| | | starttime = LocalDateTime.of(2024, 1, 1, 0, 0, 0) |
| | | scensetypeid = "1" |
| | | sourceType = 2 |
| | | } |
| | | aopDataDeviceMap.outputMapSet(areaVo) |
| | | |
| | | // éå±±ç 头 |
| | | areaVo.apply { |
| | | scensetypeid = "2" |
| | | } |
| | | aopDataDeviceMap.outputMapSet(areaVo) |
| | | |
| | | // éå±±æ
æç« |
| | | areaVo.apply { |
| | | scensetypeid = "3" |
| | | } |
| | | aopDataDeviceMap.outputMapSet(areaVo) |
| | | |
| | | // éå®å·¥å° |
| | | areaVo.apply { |
| | | districtcode = "310106" |
| | | districtname = "éå®åº" |
| | | scensetypeid = "1" |
| | | } |
| | | aopDataDeviceMap.outputMapSet(areaVo) |
| | | } |
| | | } |
| | |
| | | |
| | | import cn.flightfeather.supervision.SupervisionApplication |
| | | import cn.flightfeather.supervision.domain.ds1.entity.Scense |
| | | import cn.flightfeather.supervision.domain.ds1.repository.SceneRep |
| | | import cn.flightfeather.supervision.domain.ds1.repository.UserInfoSVRep |
| | | import cn.flightfeather.supervision.lightshare.service.ScenseService |
| | | import org.junit.Test |
| | | import org.junit.runner.RunWith |
| | |
| | | |
| | | @Autowired |
| | | lateinit var scenseService: ScenseService |
| | | |
| | | @Autowired |
| | | lateinit var sceneRep: SceneRep |
| | | |
| | | @Autowired |
| | | lateinit var userInfoSVRep: UserInfoSVRep |
| | | |
| | | @Test |
| | | fun getSceneType() { |
| | |
| | | val r = scenseService.search(s) |
| | | println(r) |
| | | } |
| | | |
| | | @Test |
| | | fun createTZUserInfo() { |
| | | val sId = listOf("lMqvVUjDrcAfb5l9", |
| | | "iRn69RgMMJVCnvVy", |
| | | "BHkeYXhWBIN7dpm4", |
| | | "moT0gClykLAgTedp", |
| | | "9tNfxmcUBspynqOB", |
| | | "dXcHOIqFvFRSeKhg", |
| | | "XNoilpfLZESw5DP0", |
| | | "f4fOMCcBAtrmqDO7", |
| | | "GyOZyyiouI15lfdZ", |
| | | "k2FSexhq1Yj3GXAA", |
| | | "K7FTWRkLFrfenq4G", |
| | | "0nPo3EoR7K0JHq6d", |
| | | "YHYxGucNfjkMjSLI", |
| | | "ppzbVvgaqTbHLMFL", |
| | | "eJcnnfg6joXLUlYN", |
| | | "dSuH4hr66NAfflti", |
| | | "Ba8jWakmIYexMxvK", |
| | | "jYRzLMfB81qfOaec", |
| | | "L5ABNgmzgqDLGWnw", |
| | | "yYy88ocNnnZDreIK", |
| | | ) |
| | | sId.forEach { |
| | | val scene = sceneRep.findScene(sceneId = it) ?: return@forEach |
| | | val userInfo = userInfoSVRep.findUser(it) ?: return@forEach |
| | | scenseService.createTZUserInfo(userInfo, scene) |
| | | } |
| | | } |
| | | } |