| | |
| | | ncFileName = vo["filename"].asString |
| | | ncCreateTime = DateUtil.StringToDate(vo["createtime"].asString) |
| | | ncUrl = vo["url"].asString |
| | | val url = ncUrl.split("://")[1].split("/")[0] |
| | | ncUrl = ncUrl.replace(url, "${NCHttpService.IP}:${NCHttpService.PORT}") |
| | | |
| | | ncProvinceCode = PROVINCE_CODE |
| | | ncProvinceName = PROVINCE_NAME |
| | |
| | | object NCHttpService { |
| | | |
| | | data class Params( |
| | | val time: String |
| | | val time: String, |
| | | ) |
| | | |
| | | private val httpMethod = HttpMethod("114.94.28.171", 9006) |
| | | const val IP = "114.94.28.171" |
| | | const val PORT = 9006 |
| | | |
| | | private val httpMethod = HttpMethod(IP, PORT) |
| | | |
| | | fun getFile(time: String): JsonArray? { |
| | | val params = Params(time) |
| | | val data = Gson().toJson(params) |
| | | val response = httpMethod.post("/streetapp/nightwork/getInfo", data, |
| | | listOf(Pair("Authorization", "c2hpZXRpb246MjAyMDBhMjc5NjAx"))) |
| | | val response = httpMethod.post( |
| | | "/streetapp/nightwork/getInfo", data, |
| | | listOf(Pair("Authorization", "c2hpZXRpb246MjAyMDBhMjc5NjAx")) |
| | | ) |
| | | return if (response.success) { |
| | | val json = JsonParser.parseString(response.m.responseBodyAsString) |
| | | if (json.isJsonObject && json.asJsonObject["result"].asString == "1") { |
| | |
| | | const val DOMAIN_GUID_TASK_DEADLINE_TYPE = "cS9MAkmXN1S37Tbv" |
| | | // 任务层次 |
| | | const val DOMAIN_GUID_TASK_LEVEL = "TzbIi3ckPWMzlsH6" |
| | | |
| | | // 工地任意拍图片类型 |
| | | const val MEDIA_FILE_TYPE_INDUSTRY = "vToOfXftwyMuhvN1" |
| | | // 餐饮任意拍图片类型 |
| | | const val MEDIA_FILE_TYPE_RESTAURANT = "cgbe0HoYEVcbzQt0" |
| | | } |
| | | } |
| | |
| | | import org.springframework.web.cors.UrlBasedCorsConfigurationSource |
| | | import org.springframework.web.filter.CorsFilter |
| | | |
| | | @Configuration |
| | | //@Configuration |
| | | class CorsConfig { |
| | | |
| | | private fun buildConfig(): CorsConfiguration { |
| | |
| | | } |
| | | } |
| | | |
| | | @Bean |
| | | // @Bean |
| | | fun corsFilter(): CorsFilter { |
| | | val source = UrlBasedCorsConfigurationSource().apply { |
| | | registerCorsConfiguration("/**", buildConfig()) |
| | |
| | | /** |
| | | * 根据巡查记录和文件业务类型查询 |
| | | */ |
| | | fun findList(iGuid: String?, typeList: List<Int>): List<Mediafile?> { |
| | | fun findList(iGuid: String?, typeList: List<Int?>): List<Mediafile?> { |
| | | return mediaFileMapper.selectByExample(Example(Mediafile::class.java).apply { |
| | | createCriteria().andEqualTo("iguid", iGuid) |
| | | .andIn("businesstypeid", typeList) |
| | |
| | | fun getDeadlineType(): List<Domainitem> |
| | | |
| | | fun getLevelType(): List<Domainitem> |
| | | |
| | | /** |
| | | * 获取场景的任意拍类型 |
| | | * @param sceneType 场景类型 |
| | | * @return 任意拍类型结果map结构,<类型值,类型名称> |
| | | */ |
| | | fun getMediaFileType(sceneType: Int?): MutableMap<String?, String?> |
| | | } |
| | |
| | | orderBy("index") |
| | | }) |
| | | } |
| | | |
| | | override fun getMediaFileType(sceneType: Int?): MutableMap<String?, String?> { |
| | | val res = mutableMapOf<String?, String?>() |
| | | val type = Constant.SceneType.getByValue(sceneType.toString()) |
| | | when (type) { |
| | | // 工地 |
| | | Constant.SceneType.TYPE1 -> { |
| | | val domainItems = domainitemMapper.selectByExample(Example(Domainitem::class.java).apply { |
| | | createCriteria().andEqualTo("dcguid", Constant.MEDIA_FILE_TYPE_INDUSTRY) |
| | | orderBy("index") |
| | | }) |
| | | domainItems.forEach { res[it.value] = it.text } |
| | | // 工地中的任意拍包含“常规记录”类型 |
| | | res[Constant.MediaFileType.RoutineRecord.value.toString()] = Constant.MediaFileType.RoutineRecord.des |
| | | return res |
| | | } |
| | | // 餐饮 |
| | | Constant.SceneType.TYPE5 -> { |
| | | val domainItems = domainitemMapper.selectByExample(Example(Domainitem::class.java).apply { |
| | | createCriteria().andEqualTo("dcguid", Constant.MEDIA_FILE_TYPE_RESTAURANT) |
| | | orderBy("index") |
| | | }) |
| | | domainItems.forEach { res[it.value] = it.text } |
| | | // 餐饮中的任意拍包含“常规记录”类型 |
| | | res[Constant.MediaFileType.RoutineRecord.value.toString()] = Constant.MediaFileType.RoutineRecord.des |
| | | return res |
| | | } |
| | | // 其余类型场景,使用默认的分类 |
| | | else -> { |
| | | listOf( |
| | | Constant.MediaFileType.Nameplate, |
| | | Constant.MediaFileType.MonitorDevice, |
| | | Constant.MediaFileType.RoutineRecord, |
| | | ).forEach { |
| | | res[it.value.toString()] = it.des |
| | | } |
| | | } |
| | | } |
| | | return res |
| | | } |
| | | } |
| | |
| | | import cn.flightfeather.supervision.domain.ds1.repository.MediaFileRep |
| | | import cn.flightfeather.supervision.domain.ds1.repository.SceneRep |
| | | import cn.flightfeather.supervision.domain.ds1.repository.SubTaskRep |
| | | import cn.flightfeather.supervision.lightshare.service.DomainitemService |
| | | import cn.flightfeather.supervision.lightshare.service.MediafileService |
| | | import cn.flightfeather.supervision.lightshare.vo.MediaFileVo |
| | | import com.fasterxml.jackson.core.type.TypeReference |
| | |
| | | private val inspectionRep: InspectionRep, |
| | | private val subTaskRep: SubTaskRep, |
| | | private val sceneRep: SceneRep, |
| | | private val domainItemService: DomainitemService, |
| | | @Value("\${filePath}") var filePath: String, |
| | | @Value("\${imgPath}") var imgPath: String, |
| | | ) : MediafileService { |
| | |
| | | throw BizException("巡查记录id和巡查任务id至少填写其中一个") |
| | | } |
| | | sceneId ?: throw BizException("记录对应的场景不存在") |
| | | val sceneInfo = sceneRep.findScene(sceneId = sceneId) |
| | | val mediaFileTypeList = Constant.MediaFileType.getList(sceneInfo?.typeid).map { it.value } |
| | | val sceneInfo = sceneRep.findScene(sceneId = sceneId) ?: throw BizException("场景不存在,获取场景图片失败") |
| | | val mediaFileTypeList = domainItemService.getMediaFileType(sceneInfo.typeid?.toInt()).entries.map { it.key?.toInt() } |
| | | return mediaFileRep.findList(inspectionGuid, mediaFileTypeList) |
| | | } |
| | | |
| | |
| | | @ApiOperation("获取巡查任务层次类型选项") |
| | | @GetMapping("/level") |
| | | fun getLevelType() = domainitemService.getLevelType() |
| | | |
| | | @ApiOperation("根据场景类型获取任意拍的类型") |
| | | @GetMapping("/mediaFileType") |
| | | fun getMediaFileType( |
| | | @ApiParam("场景类型id") @RequestParam("sceneType") sceneType:Int |
| | | ) = domainitemService.getMediaFileType(sceneType) |
| | | } |
| | |
| | | v2: |
| | | enabled: true |
| | | |
| | | # mybatis 配置 |
| | | mybatis: |
| | | configuration: |
| | | log-impl: org.apache.ibatis.logging.stdout.StdOutImpl |
| | | |
| | | imgPath: C:\02product\supervision\images |
| | | filePath: C:\02product\supervision\files |
| | | mode: dev |
| | |
| | | type-aliases-package: cn.flightfeather.supervision.domain.ds1.entity, cn.flightfeather.supervision.domain.ds2.entity, cn.flightfeather.supervision.domain.ds3.entity |
| | | mapper-locations: classpath*:mapper/**/*.xml |
| | | configuration: |
| | | log-impl: org.apache.ibatis.logging.stdout.StdOutImpl |
| | | # log-impl: org.apache.ibatis.logging.nologging.NoLoggingImpl |
| | | # log-impl: org.apache.ibatis.logging.stdout.StdOutImpl |
| | | log-impl: org.apache.ibatis.logging.nologging.NoLoggingImpl |
| | | # map-underscore-to-camel-case: true |
| | | |
| | | ## 通用 Mapper 配置 |
| | |
| | | "name" + "1" |
| | | mapOf<String, String>("name" to "1") |
| | | } |
| | | |
| | | @Test |
| | | fun findStr() { |
| | | val str = "http://114.233.144.555:9006/asdasd/asdasd" |
| | | val url = str.split("://")[1].split("/")[0] |
| | | val newStr = str.replace(url, "224.55.2.12:8085") |
| | | // val i1 = str.indexOf("://") |
| | | // val i2 = str.indexOf("/") |
| | | println(str) |
| | | println(newStr) |
| | | } |
| | | } |
| | |
| | | |
| | | import cn.flightfeather.supervision.business.datafetch.FetchController |
| | | import cn.flightfeather.supervision.infrastructure.service.ServerManager |
| | | import cn.flightfeather.supervision.common.utils.UUIDGenerator |
| | | //import org.junit.Test |
| | | import org.junit.jupiter.api.Test |
| | | 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 |
| | | |
| | | @RunWith(SpringRunner::class) |
| | | @ExtendWith(SpringExtension::class) |
| | | @SpringBootTest |
| | | class SupervisionApplicationTests { |