page.list.vo.java.ftl 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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. /**
  16. * @title: ${tableComment}
  17. * @Author ${author}
  18. * @Date: ${date}
  19. * @Version 1.0
  20. */
  21. @Data
  22. public class ${entityClass}${isPage?string("Page","List")}Vo {
  23. <#--属性遍历-->
  24. <#list fields as field>
  25. /**
  26. * ${(field.fieldComment)!''}
  27. */
  28. <#if !(field.pk || field.fieldName == "ruleUserId")>
  29. <#if isImport || isExport>
  30. <#-- 所有单元格设置成文本格式-->
  31. @ContentStyle(dataFormat = 49)
  32. @ExcelProperty("${field.label}")
  33. </#if>
  34. <#else>
  35. <#if isImport || isExport>
  36. @ExcelIgnore
  37. </#if>
  38. </#if>
  39. @ApiModelProperty("${(field.fieldComment)!''}")
  40. <#if field.fieldType == "LocalDateTime" && field.pattern??>
  41. @JsonFormat(pattern = "${field.pattern}")
  42. </#if>
  43. <#if field.datasourceType??>
  44. <#assign multi = "">
  45. <#if field.multi><#assign multi = ", isMulti = true"></#if>
  46. <#if field.datasourceType = "dic">
  47. @Trans(type = TransType.DIC, id = "${field.datasourceId}"${multi})
  48. </#if>
  49. <#if field.datasourceType = "api">
  50. @Trans(type = TransType.API, id = "${field.datasourceId}"${multi})
  51. </#if>
  52. </#if>
  53. <#if field.componentType??>
  54. <#if field.componentType = "user">
  55. @Trans(type = TransType.USER)
  56. </#if>
  57. <#if field.componentType = "organization">
  58. @Trans(type = TransType.DEPT)
  59. </#if>
  60. <#if field.componentType = "area">
  61. @Trans(type = TransType.AREA)
  62. </#if>
  63. <#if field.componentType = "cascader">
  64. @Trans(type = TransType.CASCADE, id = "${field.datasourceId}", separator = "${field.separator}", showFormat = "${field.showFormat}")
  65. </#if>
  66. </#if>
  67. private ${field.fieldType} ${field.fieldName};
  68. </#list>
  69. }