page.list.vo.java.ftl 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. package ${package};
  2. <#if isImport || isExport>
  3. import com.alibaba.excel.annotation.ExcelProperty;
  4. import com.alibaba.excel.annotation.ExcelIgnore;
  5. import com.alibaba.excel.annotation.write.style.ContentStyle;
  6. </#if>
  7. import com.fasterxml.jackson.annotation.JsonFormat;
  8. import io.swagger.annotations.ApiModelProperty;
  9. import lombok.Data;
  10. import com.xjrsoft.common.annotation.Trans;
  11. import com.xjrsoft.common.enums.TransType;
  12. import java.time.LocalTime;
  13. import java.time.LocalDateTime;
  14. import java.math.BigDecimal;
  15. import java.util.Date;
  16. /**
  17. * @title: ${tableComment}
  18. * @Author ${author}
  19. * @Date: ${date}
  20. * @Version 1.0
  21. */
  22. @Data
  23. public class ${entityClass}${isPage?string("Page","List")}Vo {
  24. <#--属性遍历-->
  25. <#list fields as field>
  26. /**
  27. * ${field.fieldComment}
  28. */
  29. <#if !(field.pk || field.fieldName == "ruleUserId")>
  30. <#if isImport || isExport>
  31. <#-- 所有单元格设置成文本格式-->
  32. @ContentStyle(dataFormat = 49)
  33. @ExcelProperty("${field.label}")
  34. </#if>
  35. <#else>
  36. <#if isImport || isExport>
  37. @ExcelIgnore
  38. </#if>
  39. </#if>
  40. @ApiModelProperty("${field.fieldComment}")
  41. <#if field.fieldType == "LocalDateTime" && field.pattern??>
  42. @JsonFormat(pattern = "${field.pattern}")
  43. </#if>
  44. <#if field.datasourceType??>
  45. <#assign multi = "">
  46. <#if field.multi><#assign multi = ", isMulti = true"></#if>
  47. <#if field.datasourceType = "dic">
  48. @Trans(type = TransType.DIC, id = "${field.datasourceId}"${multi})
  49. </#if>
  50. <#if field.datasourceType = "api">
  51. @Trans(type = TransType.API, id = "${field.datasourceId}"${multi})
  52. </#if>
  53. </#if>
  54. <#if field.componentType??>
  55. <#if field.componentType = "user">
  56. @Trans(type = TransType.USER)
  57. </#if>
  58. <#if field.componentType = "organization">
  59. @Trans(type = TransType.DEPT)
  60. </#if>
  61. <#if field.componentType = "area">
  62. @Trans(type = TransType.AREA)
  63. </#if>
  64. <#if field.componentType = "cascader">
  65. @Trans(type = TransType.CASCADE, id = "${field.datasourceId}", separator = "${field.separator}", showFormat = "${field.showFormat}")
  66. </#if>
  67. </#if>
  68. private ${field.fieldType} ${field.fieldName};
  69. </#list>
  70. }