package cn.flightfeather.supervision.lightshare.vo
|
|
import cn.flightfeather.supervision.domain.entity.BaseInfo
|
import cn.flightfeather.supervision.domain.entity.FumePurifyDevice
|
import cn.flightfeather.supervision.domain.entity.MonitorDevice
|
import cn.flightfeather.supervision.domain.entity.RestaurantBaseInfo
|
import cn.flightfeather.supervision.infrastructure.utils.UUIDGenerator
|
import org.springframework.beans.BeanUtils
|
import java.util.*
|
|
/**
|
* 餐饮店认证信息
|
*/
|
class AuthSceneRestVo : AuthSceneVo() {
|
//经营菜系
|
var rbCuisine: String? = null
|
//就餐位总数
|
var rbTotalSeating: Int? = null
|
//灶头数
|
var rbCookingRangeNum: Int? = null
|
//年均用油量(数据库记录为月度用油量)
|
var rbCookingOilCapacity: Int? = null
|
//用油类型
|
var rbCookingOilType: String? = null
|
//所属集中区
|
var rbConcentrationArea: String? = null
|
//排口数量
|
var rbOutfallCount: Int? = null
|
//排口位置
|
var rbOutfallLocation: String? = null
|
//排口编号
|
var rbOutfallNum: String? = null
|
|
//净化设备数量
|
var fpNum: String? = null
|
//监测设备数量
|
var mdNum: String? = null
|
|
/**
|
* 生成新的餐饮信息对象
|
*/
|
fun toNewRestInfo(userId: String) = RestaurantBaseInfo().apply {
|
rbGuid = userId
|
updateRestInfo(this)
|
}
|
|
/**
|
* 更新至餐饮信息
|
*/
|
fun updateRestInfo(restInfo: RestaurantBaseInfo) {
|
restInfo.apply {
|
// rbCuisine = rbCuisine
|
// rbTotalSeating = rbTotalSeating
|
// rbCookingRangeNum = rbCookingRangeNum
|
// rbCookingOilType = rbCookingOilType
|
// rbConcentrationArea = rbConcentrationArea
|
// rbOutfallCount = rbOutfallCount
|
// rbOutfallLocation = rbOutfallLocation
|
// rbOutfallNum = rbOutfallNum
|
BeanUtils.copyProperties(this@AuthSceneRestVo, this)
|
rbCookingOilCapacity = this@AuthSceneRestVo.rbCookingOilCapacity?.div(12).toString()
|
}
|
}
|
|
/**
|
* 生成新的餐饮油烟净化装置信息对象
|
*/
|
fun toNewFpdInfo(baseInfo: BaseInfo) = FumePurifyDevice().apply {
|
fpGuid = UUIDGenerator.generate16ShortUUID()
|
fpUserId = baseInfo.biGuid
|
fpUserName = baseInfo.biName
|
fpUpdatingTime = Date()
|
updateFpdInfo(this)
|
}
|
|
/**
|
* 更新至餐饮油烟净化装置信息
|
*/
|
fun updateFpdInfo(fpdInfo: FumePurifyDevice) {
|
fpdInfo.apply {
|
fpNum = this@AuthSceneRestVo.fpNum
|
}
|
}
|
|
/**
|
* 生成新的餐饮油烟监测设备信息对象
|
*/
|
fun toNewMdInfo(baseInfo: BaseInfo) = MonitorDevice().apply {
|
mdGuid = UUIDGenerator.generate16ShortUUID()
|
mdUserId = baseInfo.biGuid
|
mdUserName = baseInfo.biName
|
mdUpdatingTime = Date()
|
updateMdInfo(this)
|
}
|
|
/**
|
* 更新至餐饮油烟监测设备信息
|
*/
|
fun updateMdInfo(mdInfo: MonitorDevice) {
|
mdInfo.apply {
|
mdNum = this@AuthSceneRestVo.mdNum
|
}
|
}
|
}
|