/**
 * BladeX Commercial License Agreement
 * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
 * <p>
 * Author: Chill Zhuang (bladejava@qq.com)
 */
package org.springblade.transport.wrapper;

import org.springblade.core.mp.support.BaseEntityWrapper;
import org.springblade.core.tool.utils.BeanUtil;
import org.springblade.system.cache.UserCache;
import org.springblade.transport.pojo.entity.OilElectricRecord;
import org.springblade.transport.pojo.vo.OilElectricRecordVO;

import java.util.Objects;

/**
 * 油电记录包装类
 *
 * @author Chill
 */
public class OilElectricRecordWrapper extends BaseEntityWrapper<OilElectricRecord, OilElectricRecordVO> {

	public static OilElectricRecordWrapper build() {
		return new OilElectricRecordWrapper();
	}

	@Override
	public OilElectricRecordVO entityVO(OilElectricRecord oilElectricRecord) {
		OilElectricRecordVO oilElectricRecordVO = Objects.requireNonNull(BeanUtil.copyProperties(oilElectricRecord, OilElectricRecordVO.class));
		oilElectricRecordVO.setUpdateUserName(UserCache.getUserRealName(oilElectricRecord.getUpdateUser()));
		return oilElectricRecordVO;
	}

}
