GenTable.java 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436
  1. package com.boman.gen.domain;
  2. import java.util.List;
  3. import javax.validation.Valid;
  4. import javax.validation.constraints.NotBlank;
  5. import org.apache.commons.lang3.ArrayUtils;
  6. import com.boman.common.core.constant.GenConstants;
  7. import com.boman.common.core.utils.StringUtils;
  8. import com.boman.common.core.web.domain.BaseEntity;
  9. /**
  10. * 业务表 gen_table
  11. *
  12. * @author ruoyi
  13. */
  14. public class GenTable extends BaseEntity
  15. {
  16. private static final long serialVersionUID = 1L;
  17. /** 编号 */
  18. private Long tableId;
  19. /** 表名称 */
  20. @NotBlank(message = "表名称不能为空")
  21. private String tableName;
  22. /** 表描述 */
  23. @NotBlank(message = "表描述不能为空")
  24. private String tableComment;
  25. /** 关联父表的表名 */
  26. private String subTableName;
  27. /** 本表关联父表的外键名 */
  28. private String subTableFkName;
  29. /** 实体类名称(首字母大写) */
  30. @NotBlank(message = "实体类名称不能为空")
  31. private String className;
  32. /** 使用的模板(crud单表操作 tree树表操作 sub主子表操作) */
  33. private String tplCategory;
  34. /** 生成包路径 */
  35. @NotBlank(message = "生成包路径不能为空")
  36. private String packageName;
  37. /** 生成模块名 */
  38. @NotBlank(message = "生成模块名不能为空")
  39. private String moduleName;
  40. /** 生成业务名 */
  41. @NotBlank(message = "生成业务名不能为空")
  42. private String businessName;
  43. /** 生成功能名 */
  44. @NotBlank(message = "生成功能名不能为空")
  45. private String functionName;
  46. /** 生成作者 */
  47. @NotBlank(message = "作者不能为空")
  48. private String functionAuthor;
  49. /** 生成代码方式(0zip压缩包 1自定义路径) */
  50. private String genType;
  51. /** 生成路径(不填默认项目路径) */
  52. private String genPath;
  53. /** 主键信息 */
  54. private GenTableColumn pkColumn;
  55. /** 子表信息 */
  56. private GenTable subTable;
  57. /** 表列信息 */
  58. @Valid
  59. private List<GenTableColumn> columns;
  60. /** 主表关联的附表信息(附表包含字段信息) */
  61. @Valid
  62. private List<GenTable> relationList;
  63. /** 其它生成选项 */
  64. private String options;
  65. /**
  66. * 是否菜单
  67. */
  68. private String isMenu;
  69. /**
  70. * 菜单权限(AMDQSUE)
  71. */
  72. @NotBlank(message = "菜单权限不能为空")
  73. private String menuRole;
  74. /**
  75. * 输入字段
  76. */
  77. private Long akColumn;
  78. /**
  79. * 输出字段
  80. */
  81. private Long dkColumn;
  82. /** 树编码字段 */
  83. private String treeCode;
  84. /** 树父编码字段 */
  85. private String treeParentCode;
  86. /** 树名称字段 */
  87. private String treeName;
  88. /** 上级菜单ID字段 */
  89. private String parentMenuId;
  90. /** 上级菜单名称字段 */
  91. private String parentMenuName;
  92. public Long getAkColumn() {
  93. return akColumn;
  94. }
  95. public void setAkColumn(Long akColumn) {
  96. this.akColumn = akColumn;
  97. }
  98. public Long getDkColumn() {
  99. return dkColumn;
  100. }
  101. public void setDkColumn(Long dkColumn) {
  102. this.dkColumn = dkColumn;
  103. }
  104. public String getIsMenu() {
  105. return isMenu;
  106. }
  107. public void setIsMenu(String isMenu) {
  108. this.isMenu = isMenu;
  109. }
  110. public String getMenuRole() {
  111. return menuRole;
  112. }
  113. public void setMenuRole(String menuRole) {
  114. this.menuRole = menuRole;
  115. }
  116. public Long getTableId()
  117. {
  118. return tableId;
  119. }
  120. public void setTableId(Long tableId)
  121. {
  122. this.tableId = tableId;
  123. }
  124. public String getTableName()
  125. {
  126. return tableName;
  127. }
  128. public void setTableName(String tableName)
  129. {
  130. this.tableName = tableName;
  131. }
  132. public String getTableComment()
  133. {
  134. return tableComment;
  135. }
  136. public void setTableComment(String tableComment)
  137. {
  138. this.tableComment = tableComment;
  139. }
  140. public String getSubTableName()
  141. {
  142. return subTableName;
  143. }
  144. public void setSubTableName(String subTableName)
  145. {
  146. this.subTableName = subTableName;
  147. }
  148. public String getSubTableFkName()
  149. {
  150. return subTableFkName;
  151. }
  152. public void setSubTableFkName(String subTableFkName)
  153. {
  154. this.subTableFkName = subTableFkName;
  155. }
  156. public String getClassName()
  157. {
  158. return className;
  159. }
  160. public void setClassName(String className)
  161. {
  162. this.className = className;
  163. }
  164. public String getTplCategory()
  165. {
  166. return tplCategory;
  167. }
  168. public void setTplCategory(String tplCategory)
  169. {
  170. this.tplCategory = tplCategory;
  171. }
  172. public String getPackageName()
  173. {
  174. return packageName;
  175. }
  176. public void setPackageName(String packageName)
  177. {
  178. this.packageName = packageName;
  179. }
  180. public String getModuleName()
  181. {
  182. return moduleName;
  183. }
  184. public void setModuleName(String moduleName)
  185. {
  186. this.moduleName = moduleName;
  187. }
  188. public String getBusinessName()
  189. {
  190. return businessName;
  191. }
  192. public void setBusinessName(String businessName)
  193. {
  194. this.businessName = businessName;
  195. }
  196. public String getFunctionName()
  197. {
  198. return functionName;
  199. }
  200. public void setFunctionName(String functionName)
  201. {
  202. this.functionName = functionName;
  203. }
  204. public String getFunctionAuthor()
  205. {
  206. return functionAuthor;
  207. }
  208. public void setFunctionAuthor(String functionAuthor)
  209. {
  210. this.functionAuthor = functionAuthor;
  211. }
  212. public String getGenType()
  213. {
  214. return genType;
  215. }
  216. public void setGenType(String genType)
  217. {
  218. this.genType = genType;
  219. }
  220. public String getGenPath()
  221. {
  222. return genPath;
  223. }
  224. public void setGenPath(String genPath)
  225. {
  226. this.genPath = genPath;
  227. }
  228. public GenTableColumn getPkColumn()
  229. {
  230. return pkColumn;
  231. }
  232. public void setPkColumn(GenTableColumn pkColumn)
  233. {
  234. this.pkColumn = pkColumn;
  235. }
  236. public GenTable getSubTable()
  237. {
  238. return subTable;
  239. }
  240. public void setSubTable(GenTable subTable)
  241. {
  242. this.subTable = subTable;
  243. }
  244. public List<GenTableColumn> getColumns()
  245. {
  246. return columns;
  247. }
  248. public void setColumns(List<GenTableColumn> columns)
  249. {
  250. this.columns = columns;
  251. }
  252. public String getOptions()
  253. {
  254. return options;
  255. }
  256. public void setOptions(String options)
  257. {
  258. this.options = options;
  259. }
  260. public String getTreeCode()
  261. {
  262. return treeCode;
  263. }
  264. public void setTreeCode(String treeCode)
  265. {
  266. this.treeCode = treeCode;
  267. }
  268. public String getTreeParentCode()
  269. {
  270. return treeParentCode;
  271. }
  272. public void setTreeParentCode(String treeParentCode)
  273. {
  274. this.treeParentCode = treeParentCode;
  275. }
  276. public String getTreeName()
  277. {
  278. return treeName;
  279. }
  280. public void setTreeName(String treeName)
  281. {
  282. this.treeName = treeName;
  283. }
  284. public String getParentMenuId()
  285. {
  286. return parentMenuId;
  287. }
  288. public void setParentMenuId(String parentMenuId)
  289. {
  290. this.parentMenuId = parentMenuId;
  291. }
  292. public String getParentMenuName()
  293. {
  294. return parentMenuName;
  295. }
  296. public void setParentMenuName(String parentMenuName)
  297. {
  298. this.parentMenuName = parentMenuName;
  299. }
  300. public boolean isSub()
  301. {
  302. return isSub(this.tplCategory);
  303. }
  304. public static boolean isSub(String tplCategory)
  305. {
  306. return tplCategory != null && StringUtils.equals(GenConstants.TPL_SUB, tplCategory);
  307. }
  308. public boolean isTree()
  309. {
  310. return isTree(this.tplCategory);
  311. }
  312. public static boolean isTree(String tplCategory)
  313. {
  314. return tplCategory != null && StringUtils.equals(GenConstants.TPL_TREE, tplCategory);
  315. }
  316. public boolean isCrud()
  317. {
  318. return isCrud(this.tplCategory);
  319. }
  320. public static boolean isCrud(String tplCategory)
  321. {
  322. return tplCategory != null && StringUtils.equals(GenConstants.TPL_CRUD, tplCategory);
  323. }
  324. public boolean isSuperColumn(String javaField)
  325. {
  326. return isSuperColumn(this.tplCategory, javaField);
  327. }
  328. public static boolean isSuperColumn(String tplCategory, String javaField)
  329. {
  330. if (isTree(tplCategory))
  331. {
  332. return StringUtils.equalsAnyIgnoreCase(javaField,
  333. ArrayUtils.addAll(GenConstants.TREE_ENTITY, GenConstants.BASE_ENTITY));
  334. }
  335. return StringUtils.equalsAnyIgnoreCase(javaField, GenConstants.BASE_ENTITY);
  336. }
  337. public List<GenTable> getRelationList() {
  338. return relationList;
  339. }
  340. public void setRelationList(List<GenTable> relationList) {
  341. this.relationList = relationList;
  342. }
  343. }