feiyu02
2024-11-19 752e00503f672ddfe2066afb6c235721a3a912b5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
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)
        }
    }
}