feiyu02
2024-09-10 6c7f45871b93ef26d353a5a3596701ac2f39ed9c
src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/MediaFileVo.kt
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,87 @@
package cn.flightfeather.supervision.lightshare.vo
import cn.flightfeather.supervision.common.utils.UUIDGenerator
import cn.flightfeather.supervision.domain.ds1.entity.Inspection
import cn.flightfeather.supervision.domain.ds1.entity.Mediafile
import cn.flightfeather.supervision.domain.ds1.entity.Problemlist
import cn.flightfeather.supervision.domain.ds1.entity.Scense
import com.fasterxml.jackson.annotation.JsonInclude
import java.math.BigDecimal
import java.time.LocalDateTime
import java.time.format.DateTimeFormatter
import java.util.*
@JsonInclude(JsonInclude.Include.NON_NULL)
class MediaFileVo : Mediafile() {
    companion object {
        /**
         * ç”Ÿæˆä¸€ä¸ªé—®é¢˜å›¾ç‰‡
         */
        fun newProFile(inspection: Inspection, problemlist: Problemlist, scene: Scense) = Mediafile().apply {
            val now = LocalDateTime.now()
            guid = UUIDGenerator.generate16ShortUUID()
            iguid = inspection.guid
            businessguid = problemlist.guid
            longitude = problemlist.longitude
            latitude = problemlist.latitude
            address = problemlist.senseaddress
            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"
            savetime = Date()
            ischanged = false
            extension1 =
                scene.citycode + "/" + scene.districtcode + "/" + now.format(DateTimeFormatter.ofPattern("yyyy-MM-dd")) + "/" + scene.guid + "/"
            remark = "已上传"
        }
    }
//    var guid: String? = null
//
//    var iguid: String? = null
//
//    /**
//     * æ ¹æ®MF_BusinessType插不同表的GUID,如问题表、技防措施表
//     */
//    var businessguid: String? = null
//
//    var longitude: BigDecimal? = null
//
//    var latitude: BigDecimal? = null
//
//    var address: String? = null
//
//    /**
//     * 1图片 2音频 3视频
//     */
//    var filetype: Int? = null
//
//    var businesstypeid: Byte? = null
//
//    /**
//     * 1. é—®é¢˜ï¼›2技防措施;3监测设备;4治理设置;5 å¸¸è§„记录,99 å…¶ä»–
//     */
//    var businesstype: String? = null
//
//    var path: String? = null
//
//    var description: String? = null
//
//    var savetime: Date? = null
//
//    /**
//     * å¦ä¸ºæ•´æ”¹å‰çš„图片
//     */
//    var ischanged: Boolean? = null
//
//    var extension1: String? = null
//
//    var extension2: String? = null
//
//    var extension3: String? = null
//
//    var remark: String? = null
}