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