package cn.flightfeather.supervision.lightshare.vo
|
|
import cn.flightfeather.supervision.domain.entity.BaseInfo
|
import cn.flightfeather.supervision.domain.entity.Company
|
import cn.flightfeather.supervision.domain.entity.Userinfo
|
import cn.flightfeather.supervision.domain.enumeration.AuthenticationStatus
|
import org.springframework.beans.BeanUtils
|
import java.util.*
|
|
/**
|
* 场景认证信息
|
*/
|
open class AuthSceneVo {
|
//场景名称
|
var biName: String? = null
|
//场景简称
|
var biNickName: String? = null
|
//场景联系人
|
var biContact: String? = null
|
//场景联系电话
|
var biTelephone: String? = null
|
//场景地址
|
var biAddress: String? = null
|
//场景所属行政区域
|
var biLocation: Array<String> = emptyArray()
|
|
/**
|
* 生成新的场景基础信息对象
|
*/
|
fun toNewBaseInfo(newUser: Userinfo?, cInfo:Company?) = BaseInfo().apply {
|
biGuid = newUser?.guid
|
ciGuid = cInfo?.ciGuid
|
ciName = cInfo?.ciName
|
biCreateTime = Date()
|
biExtension1 = newUser?.acountname
|
updateBaseInfo(this)
|
}
|
|
/**
|
* 更新至场景基础信息
|
*/
|
fun updateBaseInfo(baseInfo: BaseInfo) {
|
baseInfo.apply {
|
// biName = biName
|
// biNickName = biNickName
|
// biContact = biContact
|
// biTelephone = biTelephone
|
// biAddress = biAddress
|
if (biLocation.isNotEmpty()) {
|
biProvinceName = biLocation[0]
|
biCityName = biLocation[1]
|
biDistrictName = biLocation[2]
|
biTownName = biLocation[3]
|
biProvinceCode = biLocation[4]
|
biCityCode = biLocation[5]
|
biDistrictCode = biLocation[6]
|
biTownCode = biLocation[7]
|
}
|
biUpdateTime = Date()
|
biExtension3 = AuthenticationStatus.YES.des
|
BeanUtils.copyProperties(this@AuthSceneVo, this)
|
}
|
}
|
}
|