SYYTe/maku-boot-module/maku-module-generator/src/main/resources/template/java/Excel.java.ftl

49 lines
1.3 KiB
Plaintext
Raw Normal View History

package ${package}.${moduleName}.vo;
import lombok.Data;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.fhs.core.trans.vo.TransPojo;
2024-08-27 19:13:07 +08:00
import com.fhs.core.trans.anno.Trans;
import com.fhs.core.trans.constant.TransType;
2024-09-25 14:17:23 +08:00
import ${package}.framework.common.excel.LocalDateTimeConverter;
<#list importList as i>
import ${i!};
</#list>
/**
* ${tableComment}
*
* @author ${author} ${email!}
* <a href="https://maku.net">MAKU</a>
*/
@Data
public class ${ClassName}ExcelVO implements TransPojo {
2024-08-27 19:13:07 +08:00
<#list gridList as field>
<#if field.attrName == 'id'>
<#assign isPrimaryKey = 'true'>
</#if>
</#list>
<#if !isPrimaryKey??>
@ExcelIgnore
private ${primaryType} ${primaryName};
2024-08-27 19:13:07 +08:00
</#if>
<#list gridList as field>
<#if field.attrType == 'LocalDateTime'>
2024-09-25 14:17:23 +08:00
@ExcelProperty(value = "${field.fieldComment!}", converter = LocalDateTimeConverter.class)
<#elseif field.fieldComment!?length gt 0>
@ExcelProperty("${field.fieldComment}")
</#if>
<#if field.formDict??>
private String ${field.attrName}Label;
@ExcelIgnore
@Trans(type = TransType.DICTIONARY, key = "${field.formDict}", ref = "${field.attrName}Label")
private ${field.attrType} ${field.attrName};
<#else>
private ${field.attrType} ${field.attrName};
</#if>
</#list>
}