/**
 * 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.OtherExpenseRecord;
import org.springblade.transport.pojo.vo.OtherExpenseRecordVO;

import java.util.Objects;

/**
 * 其他费用记录包装类
 *
 * @author Chill
 */
public class OtherExpenseRecordWrapper extends BaseEntityWrapper<OtherExpenseRecord, OtherExpenseRecordVO> {

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

	@Override
	public OtherExpenseRecordVO entityVO(OtherExpenseRecord otherExpenseRecord) {
		OtherExpenseRecordVO otherExpenseRecordVO = Objects.requireNonNull(BeanUtil.copyProperties(otherExpenseRecord, OtherExpenseRecordVO.class));
		otherExpenseRecordVO.setUpdateUserName(UserCache.getUserRealName(otherExpenseRecord.getUpdateUser()));
		return otherExpenseRecordVO;
	}

}
