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